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 |
---|---|---|---|---|---|---|
Get child of a directory by name. | private function child_by_name(?int $parent_id, string $name, bool $throw=true): ?array {
$t = $this->replica->state->tree;
foreach($t->children($parent_id) as $child_id) {
$node = $t->find($child_id);
if($node && $node->meta->name == $name) {
return [$child_id, $node];
}
}
if($throw) {
throw new Exception("Not found: $name");
}
return null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getChild($name)\n {\n $children = $this->getChildren();\n foreach ($children as $child) {\n if ($name === $child->getName()) {\n return $child;\n }\n }\n\n throw new Sabre_DAV_Exception_FileNotFound(\n \"Node with name '$name' cannot be found in the pool\"\n );\n }",
"public static function getChild(string $path, string $file_or_dir_name) : File\n {\n return (new File($path))->getChild($file_or_dir_name);\n }",
"public function getChildByName(FolderInterface $folder, $childName, OperationContext $context = NULL);",
"public function getChildByName($name)\r\n {\r\n $c = new Criteria();\r\n\r\n $c->add(DmsNodePeer::STORE_ID, $this->getId());\r\n $c->add(DmsNodePeer::PARENT_ID, null);\r\n $c->add(DmsNodePeer::NAME, $name);\r\n\r\n return DmsNodePeer::doSelectOne($c);\r\n }",
"function get_child($name, $require_exists = true) {\n\t\t$this->load_children(); // a bit overkill\n\t\tif (isset($this->_children[$name])) {\n\t\t\treturn $this->_children[$name];\n\t\t} else if ($require_exists) {\n\t\t\treturn NULL;\n\t\t} else {\n\t\t\treturn new Entity($this,$name);\n\t\t}\n\t}",
"protected function getChildById( $id ) {\r\n\t\tforeach( $this->getChildren() as $child ) {\r\n\t\t\tif( $child->getId() == $id ) {\r\n\t\t\t\treturn $child;\r\n\t\t\t}\r\n\t\t}\r\n\t\tthrow new Exception( \"ChildNotFoundException\" );\r\n\t}",
"public function get($name) {\n\t\tif( isset($this->childs[$name]) ) {\n\t\t\treturn $this->childs[$name];\n\t\t}\n\t\treturn null;\n\t}",
"public function getByBasename($name)\n {\n return $this->where(function(File $f) use($name) { return $f->getBasename()==$name; })->single();\n }",
"public function getChildFolderByName($name, $create = false)\n {\n $typeHandle = $this->getTreeNodeTypeHandle();\n if ($this->childNodesLoaded) {\n $childNodes = $this->childNodes;\n } else {\n $childNodesData = $this->getHierarchicalNodesOfType($typeHandle, 1, true, false, 1);\n $childNodes = array_map(function ($item) {\n return $item['treeNodeObject'];\n }, $childNodesData);\n }\n $result = null;\n foreach ($childNodes as $childNode) {\n if ($childNode->getTreeNodeTypeHandle() === $typeHandle && $childNode->getTreeNodeName() === $name) {\n $result = $childNode;\n break;\n }\n }\n if ($result === null && $create) {\n $result = static::add($name, $this);\n }\n\n return $result;\n }",
"private function getChildNode($node, $name) {\n\t\tforeach ($node->childNodes as $child) {\n\t\t\tif ($child->nodeName === $name) {\n\t\t\t\treturn $child;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}",
"public function getChildByDiskName($diskname)\r\n {\r\n $c = new Criteria();\r\n\r\n $c->add(DmsNodePeer::STORE_ID, $this->getId());\r\n $c->add(DmsNodePeer::PARENT_ID, null);\r\n $c->add(DmsNodePeer::DISK_NAME, $diskname);\r\n\r\n return DmsNodePeer::doSelectOne($c);\r\n }",
"public function getChild($parentId, $childName, $getDeleted = false, $throw = true)\n {\n $parentId = $parentId instanceof Node ? $parentId->getId() : $parentId;\n $childName = $childName instanceof Node ? $childName->name : $childName;\n \n $searchFilter = new Node_Filter(array(\n array(\n 'field' => 'parent_id',\n 'operator' => $parentId ? 'equals' : 'isnull',\n 'value' => $parentId\n ),\n array(\n 'field' => 'name',\n 'operator' => 'equals',\n 'value' => $childName\n )\n ), Tinebase_Model_Filter_FilterGroup::CONDITION_AND, array('ignoreAcl' => true));\n if (true === $getDeleted) {\n $searchFilter->addFilter(new Tinebase_Model_Filter_Bool('is_deleted', 'equals',\n Tinebase_Model_Filter_Bool::VALUE_NOTSET));\n }\n $child = $this->search($searchFilter)->getFirstRecord();\n \n if (!$child) {\n if (true === $throw) {\n throw new Tinebase_Exception_NotFound('child: ' . $childName . ' not found!');\n }\n return null;\n }\n \n return $child;\n }",
"public function getFirstChildByName($name) {\n foreach($this->__childs as $child) {\n if ($child->getName() == $name) {\n return $child;\n }\n }\n return null; \n }",
"public function getChild($id){\n foreach ($this->children as $node){\n if($node->itemID === $id){\n return $node;\n }\n }\n return null;\n }",
"public function get($name)\n {\n return $this->children[$name];\n }",
"public function offsetGet(mixed $name): self\n {\n return $this->children[$name];\n }",
"public function getChildByGUID($guid) {\n\t\t\tglobal $db;\n\t\t\t$data = $db->get_var(\"SELECT guid FROM pages WHERE parent = '$guid'\");\n\t\t\treturn $data;\n\t\t}",
"public function getChildrenByName($name) {\n $this->select->from($this);\n $this->select->where(\"C.child_full_name LIKE ?\", '%' . $name . '%');\n\n return $this->fetchAll($this->select);\n }",
"public function get_child($child_id)\n {\n }",
"public function getChildByPage(Page $page)\n {\n foreach ($this->children as $child) {\n if ($child->getPage() == $page) {\n return $child;\n }\n }\n\n return false;\n }",
"public function child(string $path, $cls = null);",
"public function fetch_directory()\n\t{\n\t\treturn $this->route_stack[self::SEG_SUBDIR];\n\t}",
"public function getChildByPage(Page $page){\n foreach($this->children as $child)if($child->getPage() == $page) return $child;\n return false;\n }",
"public function getChildByIndex($index)\n {\n $index = intval($index);\n\n return ((null !== $this->children) && array_key_exists($index, $this->children)) ? $this->children[$index] : null;\n }",
"public function get(string $name)\n {\n return $this->disks[$name] ?? $this->resolve($name);\n }",
"function helpers_pl17_dir_get($cd, $i, array $ds = []) { while ($i-- > 0) { $cd = helpers_pl17_dir_down($cd); } unset($i); while (count($ds)) { $d = array_shift($ds); $cd = helpers_pl17_dir_to($cd, $d); } unset($d, $ds); return $cd; }",
"public function getChildsByName($name) {\n $ret = array();\n foreach($this->__childs as $child) {\n if ($child->getName() == $name) {\n $ret[] = $child;\n }\n }\n return $name;\n }",
"public function get($name)\n \t{\n \t\tif ($name[0] == '/') throw new Exception(\"Unable to get '$name' for '{$this->_path}': Expecting a relative path.\");\n \t\treturn Fs::get(\"{$this->_path}/$name\");\n \t}",
"public function getChild($c){\n if($this->childNodes[$c] != NULL){\n return $this->childNodes[$c];\n }\n else{\n return NULL;\n }\n }",
"private function toplevel($name) {\n return $this->child_by_name(null, $name);\n }",
"protected function get($name)\n {\n return isset($this->disks[$name]) ? $this->disks[$name] : $this->resolve($name);\n }",
"public function getChild($id) {\n\t\t//\\OCP\\Util::writeLog('contacts', __METHOD__.' id: '.$id, \\OCP\\Util::DEBUG);\n\t\tif(!$this->hasPermission(\\OCP\\PERMISSION_READ)) {\n\t\t\tthrow new \\Exception(self::$l10n->t('You do not have permissions to see this contacts'), 403);\n\t\t}\n\t\tif(!isset($this->objects[$id])) {\n\t\t\t$contact = $this->backend->getContact($this->getId(), $id);\n\t\t\tif($contact) {\n\t\t\t\t$this->objects[$id] = new Contact($this, $this->backend, $contact);\n\t\t\t} else {\n\t\t\t\tthrow new \\Exception(self::$l10n->t('Contact not found'), 404);\n\t\t\t}\n\t\t}\n\t\t// When requesting a single contact we preparse it\n\t\tif(isset($this->objects[$id])) {\n\t\t\t$this->objects[$id]->retrieve();\n\t\t\treturn $this->objects[$id];\n\t\t}\n\t}",
"public function removeChild($name)\n\t{\n\t\treturn $this->_auth->removeItemChild($this->_calendarId,$this->_name,$name);\n\t}",
"protected function get($name)\n\t{\n\t\treturn isset($this->disks[$name]) ? $this->disks[$name] : $this->resolve($name);\n\t}",
"public function getChild($i) {\n if (array_key_exists ($i, $this->items) ) {\n return $this->items[$i];\n }\n }",
"public function childExists($name)\n {\n try {\n $this->getChild($name);\n return true;\n } catch (Sabre_DAV_Exception_FileNotFound $enf) {\n return false;\n } catch (Exception $e) {\n return false;\n }\n }",
"public function getChildren($name = null)\n {\n if (!$name) {\n return $this->childContainer;\n } else {\n return $this->childContainer->getItem($name);\n }\n }",
"public function find($id)\n {\n return Fork::find($id);\n }",
"public function getChildFolderByPath(array $names, $create = false)\n {\n if (count($names) === 0) {\n $result = $this;\n } else {\n $childName = array_shift($names);\n $result = $this->getChildFolderByName($childName, $create);\n if ($result !== null) {\n $result = $result->getChildFolderByPath($names, $create);\n }\n }\n\n return $result;\n }",
"public function child($index = 0)\r\n {\r\n if (is_null($index)) {\r\n return $this->childs; \r\n }\r\n if (array_key_exists($index, $this->childs)) {\r\n return $this->childs[$index];\r\n }\r\n return false;\r\n }",
"public function find($name, $key = 'basename')\n {\n return $this->all()->filter(function ($file) use ($name, $key) {\n return $file[$key] == $this->basename($name);\n })->first();\n }",
"public function drive($name = null)\n\t{\n\t\treturn $this->disk($name);\n\t}",
"protected function getChild(string $nodename): ?NodeInterface\n {\n $children = $this->getComposedCollection();\n\n return $children->get($nodename);\n }",
"public function getFullPath($name);",
"public abstract function getDirectory();",
"public function getChild($child = NULL)\n {\n if ($child && is_array($child) && isset($child['path']) && isset($child['data']))\n return $this->render($child['path'], $child['data']);\n return false;\n }",
"public function getChild ( $nodeId ) {\n\n if(false === $this->childExists($nodeId))\n throw new Exception(\n 'Child %s does not exist.', 0, $nodeId);\n\n return $this->_childs[$nodeId];\n }",
"public function cloud_gdrive_get_folder($name = false, $parent = false)\r\n {\r\n if ($this->gdrive == false) {\r\n $this->gdrive = $this->get_gdrive_client();\r\n }\r\n\r\n $name_query = $parent_query = '';\r\n\r\n if ($name !== false) {\r\n $name_query = \" and name = '\" . $name . \"' \";\r\n }\r\n\r\n if ($parent !== false) {\r\n if (is_a($parent, 'Google_Service_Drive_DriveFile')) {\r\n $parent_id = $parent->id;\r\n } else {\r\n $parent_id = $parent;\r\n }\r\n $parent_query = \" and '\" . $parent_id . \"' in parents \";\r\n }\r\n\r\n $response = $this->gdrive->files->listFiles(array(\r\n 'spaces' => 'drive',\r\n 'q' => \"mimeType='application/vnd.google-apps.folder' and trashed = false \" . $name_query . $parent_query,\r\n 'fields' => 'nextPageToken, files(id, name)',\r\n 'pageSize' => 10\r\n ));\r\n\r\n $results = $response->getFiles();\r\n\r\n if (empty($results) || !is_array($results)) {\r\n $folder = $this->cloud_gdrive_create_folder($name, $parent);\r\n return $folder->id;\r\n }\r\n\r\n return $results[0]->id;\r\n }",
"public function renderChild($name)\n {\n if ($child = $this->getChild($name)) {\n return $child->render();\n } else {\n return \"\";\n }\n }",
"public function getSingleFolder(){\n $sqlQuery = \"SELECT\n idFolder,\n name, \n id_Folder, \n id_User\n FROM\n \". $this->dbTable .\"\n WHERE \n idFolder = ?\n LIMIT 0,1\";\n\n $stmt = self::$bdd->prepare($sqlQuery);\n \n $stmt->bindParam(1, $this->idFolder);\n\n if($stmt->execute()){\n \n return $stmt->fetch(PDO::FETCH_ASSOC);\n \n }\n else{\n false;\n }\n }",
"public function get(string $path) : VueRoute\n {\n if (!$this->exists($path)) {\n throw new \\RuntimeException(sprintf('The provided child path %s does not exist on path %s (component %s).', $path, $this->get_path(), $this->get_component() ));\n }\n return $this->children[$path];\n }",
"public function hasChild($name)\n\t{\n\t\treturn $this->_auth->hasItemChild($this->_calendarId,$this->_name,$name);\n\t}",
"private static function getParent($name)\n {\n // Store the pos so we only have to search through the string once\n $last_delimit_pos = strrpos($name, '.');\n while ($last_delimit_pos !== false) {\n $current_parent = substr($name, 0, $last_delimit_pos);\n if (Registry::hasLogger($current_parent)) {\n return Registry::getInstance($current_parent);\n }\n $last_delimit_pos = strrpos($current_parent, '.');\n }\n\n return Registry::hasLogger('root') ? Registry::getInstance('root') : self::createLogger('root');\n }",
"public function getPart($name)\n {\n if (array_key_exists($name, $this->parts)) {\n return $this->parts[$name];\n }\n }",
"public function getByBasenameOrDefault($name, $default=null)\n {\n return $this->where(function(File $f) use($name)\n {\n return $f->getBasename() == $name;\n })->singleOrDefault($default);\n }",
"public function getChild()\n {\n return $this->child;\n }",
"public function get($folderId, $childId, $optParams = array())\n {\n $params = array('folderId' => $folderId, 'childId' => $childId);\n $params = array_merge($params, $optParams);\n return $this->call('get', array($params), 'Google\\Service\\Drive\\ChildReference');\n }",
"public function &getValueByChildPath($path, array &$array, $default = null)\n\t{\n\t\t$p = $this->pushRetNew($path);\n\n\t\treturn $p->getValue($array, $default);\n\t}",
"public function readDirectory(Path $path): Directory;",
"function child(string $subpath) {\n if (!$subpath)\n return $this;\n $subpath = explode('/', $subpath);\n $typeChildname = array_shift($subpath);\n $pos = strpos($typeChildname, '-');\n $type = substr($typeChildname, 0, $pos);\n $childname = substr($typeChildname, $pos+1);\n if ($type == 'dbServers')\n $child = new DbServer($this->path.'/dbServers-'.$childname, $this->yaml['dbServers'][$childname]);\n elseif ($type == 'views') {\n //echo \"<pre>yaml=\"; print_r($this->yaml);\n //echo \"childname=$childname<br>\\n\";\n $view = $this->yaml['views'][$childname];\n $child = new Table(\n $this->path.\"/views-$childname\",\n $this->yaml['dbServers'][$view['server']]['params'],\n \"$view[schema].$view[table]\",\n isset($view['criteria']) ? $view['criteria'] : []\n );\n }\n elseif ($type == 'ugeojson') {\n $ugeojson = $this->yaml['ugeojson'][$childname];\n $child = new UGeoJSON(\n $this->path.\"/ugeojson-$childname\",\n $ugeojson['url']\n );\n }\n else\n throw new \\Exception(\"Cas non prévu\");\n if (!$subpath)\n return $child;\n else\n return $child->child(implode('/',$subpath));\n }",
"public static function findByName(string $name)\n {\n return static::where('name', $name)->first();\n }",
"public function getDirectory();",
"public function getDirectory();",
"public function readChildAction()\r\n {\r\n $filterJson = $this->params()->fromQuery('filter');\r\n if (isset($filterJson)) {\r\n $filters = Json::decode($filterJson, Json::TYPE_ARRAY);\r\n } else {\r\n $filters = null;\r\n }\r\n $sortJson = $this->params()->fromQuery('sort');\r\n if (isset($sortJson)) {\r\n $sort = Json::decode($sortJson, Json::TYPE_ARRAY);\r\n } else {\r\n $sort = null;\r\n }\r\n $parentId = $this->params()->fromQuery('node', 'root');\r\n $mongoFilters = $this->_buildFilter($filters);\r\n $dataValues = $this->_dataService->readChild($parentId, $mongoFilters, $sort, false);\r\n $response = array();\r\n $response['children'] = array_values($dataValues);\r\n $response['total'] = count($response['children']);\r\n $response['success'] = TRUE;\r\n $response['message'] = 'OK';\r\n return $this->_returnJson($response);\r\n }",
"public function getNodeByName($name) \n {\n $result = null;\n\n foreach ($this->children as $child) {\n if ($child->getName() === $name) {\n return $child;\n }\n\n $result = $child->getNodeByName($name);\n\n if ($result !== null) {\n return $result;\n }\n }\n }",
"public static function findByName($name)\n {\n return static::find()->where(['name' => $name])->one();\n }",
"public static function getByName($name)\n {\n return static::where('name', $name)->first();\n }",
"public function char($name)\n \t{\n \t\tif ($name[0] == '/') throw new Exception(\"Unable to get '$name' for '{$this->_path}': Expecting a relative path.\");\n \t\treturn Fs::char(\"{$this->_path}/$name\");\n \t}",
"function FetchByName($pathname) {\n\t\t$sql = \"select Pathname_ID('\" . pg_escape_string($pathname) . \"') as id\";\n\n\t\tif ($Debug)\techo \"Element::FetchByName sql = '$sql'<BR>\";\n\n\t\t$result = pg_exec($this->dbh, $sql);\n\t\tif ($result) {\n\t\t\t$numrows = pg_numrows($result);\n\t\t\tif ($numrows == 1) {\n\t\t\t\t$myrow = pg_fetch_array ($result, 0);\n\t\t\t\t$this->id = $myrow[\"id\"];\n\t\t\t\tif ($Debug) echo \"id for '$pathname' is $this->id<BR>\";\n\n\t\t\t\tif (IsSet($this->id)) {\n\t\t\t\t\treturn $this->FetchByID($this->id);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\techo 'pg_exec failed: ' . $sql;\n\t\t}\n\t}",
"protected function get(string $name)\n {\n return $this->getContainer()->get($name);\n }",
"public function __get($name)\r\n {\r\n if(array_key_exists($name, $this->_values)) return $this->_values[$name];\r\n\r\n $path = $this->getPath($name);\r\n if(!$path) return null;\r\n\r\n return $this->readPath($path);\r\n }",
"public function find($name)\n {\n if (isset($this->fileNames[$name])) {\n return $this->fileNames[$name];\n }\n\n $result = self::hasNamespace($name = trim($name))\n ? $this->findInNamespace($name)\n : $this->findInPaths($name, $this->paths);\n\n // No exceptions, so we found the file. Cache the filename and return it.\n return $this->fileNames[$name] = $result;\n }",
"public function get_by_name(string $name)\n {\n if(!empty($name)){\n $result = $this->where('name', $name)->first();\n // $result = $this->builder->where('name', $name)->get(1);\n if($result){\n return $result;\n } else {\n return false;\n }\n } else {\n return false;\n }\n }",
"public function get(string $id): mixed\n {\n $this->zeroLengthStringCheck($id, 'identifier');\n return (!empty($this->children))\n ? $this->compositeGet($id)\n : $this->selfGet($id);\n }",
"public function getChildForPrincipal(array $principalInfo) {\n\t\tlist(, $name) = URLUtil::splitPath($principalInfo['uri']);\n\t\t$user = \\OC::$server->getUserSession()->getUser();\n\t\tif ($user === null || $name !== $user->getUID()) {\n\t\t\t// a user is only allowed to see their own home contents, so in case another collection\n\t\t\t// is accessed, we return a simple empty collection for now\n\t\t\t// in the future this could be considered to be used for accessing shared files\n\t\t\treturn new SimpleCollection($name);\n\t\t}\n\t\t$view = \\OC\\Files\\Filesystem::getView();\n\t\t$home = new FilesHome($principalInfo);\n\t\t$rootInfo = $view->getFileInfo('');\n\t\t$rootNode = new Directory($view, $rootInfo, $home);\n\t\t$home->init($rootNode, $view, \\OC::$server->getMountManager());\n\n\t\treturn $home;\n\t}",
"public function getByName($name) {\n return $this->getBy($name, \"name\");\n }",
"private function getByNameInCache($name)\n {\n $modulesResult = $this->getModulesResult();\n foreach($modulesResult as $module)\n {\n if($name == $module['modulo'])\n {\n return $module;\n }\n }\n }",
"public static function system($dirName) {\n $path=App::system();\n $dir_parts = explode('.', $dirName);\n //foreach loop is possible here\n $path.='/'.implode('/', $dir_parts);\n return new Directory($path);\n }",
"private function get(string $name, $default = null)\n {\n $path = explode('/', $name);\n $current = $this->items;\n\n foreach ($path as $field) {\n if (is_array($current) && isset($current[$field])) {\n $current = $current[$field];\n } else {\n return $default;\n }\n }\n\n return $current;\n }",
"public static function &getModule($name)\n\t{\n\t\t$result\t\t= null;\n\t\t$modules\t= self::_load();\n\t\tforeach ($modules AS $module) {\n\t\t\t// Match the name of the module\n\t\t\tif ($module->position == $name)\n\t\t\t{\n\t\t\t\treturn $module;\n\t\t\t}\n\t\t}\n\n\t\treturn $result;\n\t}",
"function &getChildValue($name, $index = 0) {\n\t\t$node =& $this->getChildByName($name);\n\t\tif ($node) {\n\t\t\t$returner =& $node->getValue();\n\t\t} else {\n\t\t\t$returner = null;\n\t\t}\n\t\treturn $returner;\n\t}",
"public function get(string $name){\n foreach($this->routes as $route){\n\t\t\tif($route->matchName($name))\n\t\t\t\treturn $route;\n\t\t}\n\t\treturn null;\n }",
"protected function get(string $name)\n {\n return $this->drivers[$name] ?? $this->resolve($name);\n }",
"function find($child_id): ?tree_node {\n return @$this->triples[$child_id];\n }",
"abstract protected function createChild(string $name): Item;",
"public function find($fileName = false) {\n\t\t$fileName = $fileName ?: $this->info->file;\n\n\t\tif(!$fileName) {\n\t\t\tthrow new InvalidArgumentException('No filename specified to search');\n\t\t}\n\n\t\tif (isset($this->info->centralDirectory[$fileName])) {\n\t\t\t$this->info->file = $fileName;\n\t\t\treturn new Data\\CDFile($this->info->centralDirectory[$fileName]);\n\t\t}\n\n\t\treturn false;\n\t}",
"public function findPath($path) {\n $pwd = 'root';\n foreach (explode('/', $path) as $p) {\n $file = $this->findIn($p, $pwd);\n $pwd = $file->id;\n }\n return $file;\n }",
"public static function find($name);",
"public static function find($name);",
"protected function getParentDataName(string $name): ?string\n {\n $parentName = null;\n $name = trim($name, \".\");\n if (false !== ($lastDotPos = strrpos($name, \".\"))) {\n $parentName = substr($name, 0, $lastDotPos);\n }\n \n return $parentName;\n }",
"public function get($id)\n {\n return $this->_driver->get(\"/security/folder/$id\");\n }",
"public function find($id, Application_Model_Child $child)\n {\n }",
"public function getDir();",
"protected function get($name)\n {\n return $this->drivers[$name] ?? $this->resolve($name);\n }",
"public function add($child, $name = false) {\n\t\tif( $name ) {\n\t\t\t$this->childs[$name] = $child;\n\t\t} else {\n\t\t\t$this->childs[] = $child;\n\t\t}\n\t\treturn $this;\n\t}",
"public function findName($name)\n {\n return $this->model->where('name', $name)->first();\n }",
"public function getChildren()\n {\n // Singleton: both getChild and getChildren are called\n // by the Sabre_DAV_Browser_Plugin\n if (empty($this->children)) {\n $storedFiles = $this->fileStorage->get_directory_files(\n $this->storedFile->get_contextid(),\n $this->storedFile->get_component(),\n $this->storedFile->get_filearea(),\n $this->itemId,\n $this->storedFile->get_filepath(),\n false, // recursive\n true, // includedirs\n 'filepath ASC, filename ASC' // sort\n );\n\n foreach ($storedFiles as $storedFile) {\n if ($storedFile->is_directory()) {\n $this->children[][] = new DAVRootPoolDirectory($storedFile);\n } else {\n $this->children[][] = new DAVRootPoolFile($storedFile);\n }\n }\n }\n\n return $this->children;\n }",
"private static function getChildClassDirectory()\n {\n $className = get_called_class();\n $reflector = new ReflectionClass($className);\n\n return dirname($reflector->getFileName());\n }",
"public function get_child($position) : HTMLNode\n {\n return $this -> children -> get($position);\n }",
"public function current()\n\t{\n\t\t$handle = $this->getHandle(); \n\t\twhile (!isset($handle->current) || $handle->current == '.' || $handle->current == '..') $handle->current = readdir($handle->resource);\n\t\t\n\t\tif ($handle->current === false) return false;\n\t\treturn Fs::get(\"{$this->_path}/\" . $handle->current);\n\t}"
] | [
"0.66824466",
"0.63746995",
"0.63458383",
"0.6005403",
"0.5772351",
"0.5617116",
"0.56039804",
"0.54759365",
"0.5471897",
"0.54141706",
"0.53768146",
"0.5376553",
"0.5326213",
"0.5319027",
"0.5310802",
"0.5290189",
"0.5218315",
"0.5194682",
"0.50995666",
"0.5063834",
"0.50486124",
"0.5027248",
"0.5019135",
"0.50188833",
"0.5005616",
"0.49558732",
"0.49533573",
"0.49484894",
"0.49206713",
"0.48912293",
"0.48532304",
"0.48450404",
"0.48318928",
"0.48120424",
"0.4760126",
"0.47569484",
"0.47442585",
"0.47152114",
"0.47143716",
"0.47093624",
"0.46931478",
"0.46786094",
"0.4670745",
"0.46665204",
"0.46135038",
"0.4610124",
"0.46019027",
"0.45924884",
"0.45913032",
"0.45702463",
"0.45675927",
"0.45531416",
"0.45343056",
"0.45302308",
"0.45237",
"0.45226374",
"0.4496249",
"0.44864592",
"0.4458661",
"0.4458327",
"0.4458075",
"0.44528404",
"0.44528404",
"0.44284642",
"0.4426341",
"0.44186437",
"0.4405707",
"0.44036508",
"0.43976086",
"0.43944803",
"0.43857223",
"0.4379891",
"0.43658307",
"0.43610713",
"0.43387267",
"0.43348414",
"0.433167",
"0.430633",
"0.4298872",
"0.42977342",
"0.42854765",
"0.42846873",
"0.4281686",
"0.42788455",
"0.42734462",
"0.42625874",
"0.42580214",
"0.42575705",
"0.42575705",
"0.42478475",
"0.42450154",
"0.4240113",
"0.42375058",
"0.42357415",
"0.4214292",
"0.42110592",
"0.4205773",
"0.42043185",
"0.4200865",
"0.41975948"
] | 0.5588165 | 7 |
retrieve a toplevel forest node (root, fileinodes, or trash) | private function toplevel($name) {
return $this->child_by_name(null, $name);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function get_root()\n {\t\n\t\t$query = ee()->db->get_where( $this->tree_table, array('lft' => 1), 1 );\n\t\treturn ( $query->num_rows() ) ? $query->row_array() : FALSE;\n }",
"private function getRoot() {\n $statement = $this->getConn()->prepare('SELECT * FROM `' . $this->_table . '` where ' . $this->_parent . ' is null limit 1');\n $statement->execute();\n $root = $statement->fetch();\n return $root;\n }",
"function get_root() {\n\t\treturn $this->stack[0];\n\t}",
"private function root() { return $this->toplevel(\"root\"); }",
"public function getRoot();",
"abstract public function getRoot() ;",
"abstract public function getRoot() ;",
"function tidy_get_root(tidy $object) {}",
"function getRoot() { return($this->_root); }",
"public function findRootNode()\n {\n return $this->repository->findOneBy(array('lvl' => 0));\n }",
"function get_root()\n\t{ \n\t\t$this->model->where('`'.$this->left_column . '` = 1 ');\n\t\treturn $this->model->find(FALSE,true);\n\t}",
"function readRootId()\n\t{\n\t\tglobal $ilDB;\n\t\t\n\t\t$query = 'SELECT child FROM '.$this->table_tree.' '.\n\t\t\t'WHERE parent = %s '.\n\t\t\t'AND '.$this->tree_pk.' = %s ';\n\t\t$res = $ilDB->queryF($query,array('integer','integer'),array(\n\t\t\t0,\n\t\t\t$this->tree_id));\n\t\t$row = $ilDB->fetchObject($res);\n\t\t$this->root_id = $row->child;\n\t\treturn $this->root_id;\n\t}",
"public function getRoot() {}",
"public function getRoot() {}",
"public function getRoot() {}",
"public function getRoot(): self;",
"public function getRoot()\n {\n return $this->drupalFinder()->getDrupalRoot();\n }",
"public function getRoot(): string;",
"function objFldHeiarchRoot($dbh, $idfld, $parentfld, $tbl, $curid)\r\n{\r\n\t$ret = $curid;\r\n\r\n\tif ($curid)\r\n\t{\r\n\t\t$result = $dbh->Query(\"select $parentfld from $tbl where $idfld='$curid'\");\r\n\t\tif ($dbh->GetNumberRows($result))\r\n\t\t{\r\n\t\t\t$val = $dbh->GetValue($result, 0, $parentfld);\r\n\t\t\tif ($val)\r\n\t\t\t{\r\n\t\t\t\t$ret = objFldHeiarchRoot($dbh, $idfld, $parentfld, $tbl, $val);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\treturn $ret;\r\n}",
"public function getRootLevelFolderObject();",
"public function getRoot()\n {\n return $this->_root;\n }",
"public function getRoot()\n {\n return $this->active->geContext()->getCurrentSiteNode();\n }",
"public function getRoot()\n {\n $root_id = $this->getField('RootID');\n if (! $root_id) {\n return null;\n }\n\n return DataObject::get_one('Gtkdoc', '\"Gtkdoc\".\"ID\" = ' . (int) $root_id);\n }",
"function FullTree();",
"function getRootLevelFolder() ;",
"public function getOuterMostParent() {}",
"function getRoot ()\n\t{\n\t\treturn $this->doc->document_element();\n\t}",
"public function getRootNode() {}",
"function fiftyone_degrees_get_nodes_root_node($node_offset, $headers) {\n $node = fiftyone_degrees_read_node($node_offset, $headers);\n if ($node['parent_offset'] >= 0) {\n return fiftyone_degrees_get_nodes_root_node($node['parent_offset'], $headers);\n }\n else {\n return $node;\n }\n}",
"public function getTree($idEntry = 0);",
"public function getLeaf()\n {\n return $this->leaf;\n }",
"public function getLeafPrototype();",
"function get_root($obj)\n{\n\t$root = $obj;\n\tif (is_array($root))\n\t{\n\t\t$root = $root[0];\n\t}\n\tif (isset($root->{'@graph'}))\n\t{\n\t\t$root = $root->{'@graph'};\n\t\n\t\tif (is_array($root))\n\t\t{\n\t\t\t$root = $root[0];\n\t\t}\n\t}\n\t\n\treturn $root;\n}",
"function get_virtual_root()\n\t{\n\t\tglobal $DBPrefix, $db;\n\t\t// Virtual root element as parent.\n\t\t$query = \"SELECT right_id FROM \" . $DBPrefix . \"categories ORDER BY right_id DESC LIMIT 1\";\n\t\t$db->direct_query($query);\n\t\t$row = $db->result();\n\t\t$root = array('left_id' => 1, 'right_id' => $row['right_id'], 'level' => -1);\n\t\treturn $root;\n\t}",
"function getMainNode(){\n\t\treturn $this->nodeppal;\n\t}",
"function getRoot() {\n return $this->root;\n }",
"public function getRoot()\n {\n $this->iterator->rewind();\n return $this->iterator->current();\n }",
"function _getParent($treeid) {\n $res = $this->CLASS['db']->query(sprintf(\"SELECT belongs_to FROM tree WHERE id=%d\",$treeid));\n $anz = $this->CLASS['db']->num_rows($res);\n\n if($anz == 1) {\n $row = $this->CLASS['db']->fetch_assoc($res);\n return $row['belongs_to'];\n } else {\n return 0;\n }\n }",
"public function getRoot()\n {\n return $this->root;\n }",
"public function getRoot()\n {\n return $this->root;\n }",
"public function getTreeId() {}",
"public function getRoot()\n\t{\n\t\treturn $this->Root;\n\t}",
"public function getFirstChild();",
"private function _getRoot()\n {\n if ($this->_parent instanceOf Horde_Pear_Package_Xml_Directory) {\n return $this->_parent->_getRoot();\n } else {\n return $this->_parent;\n }\n }",
"public function getTree() {\n return $this->_buildBranch($this->root_category_id);\n }",
"public function getLastRootNode()\n {\n $qb = $this->qbFactory\n ->getRootNodeQueryBuilder()\n ->orderBy('e.' . $this->getPathFieldName(), 'DESC')\n ->setMaxResults(1);\n try {\n return $this->getNode($qb->getQuery()->getSingleResult());\n } catch (NoResultException $e) {\n return null;\n }\n }",
"public function root()\r\n\t{\r\n\t\treturn $this->root;\r\n\t}",
"public function getRootNode(){\n\t\tif(!$this->root_node) {\n\t\t\treturn null;\n\t\t}\n\t\treturn $this->root_node;\n\t}",
"public function root() {\n $node = $this;\n while ($parent = $node->getParent())\n $node = $parent;\n return $node;\n }",
"public function getCurrentRoot()\n {\n if (null !== $this->getCurrentPage()) {\n return $this->getCurrentPage()->getRoot();\n } elseif (null === $this->getCurrentSite()) {\n return;\n } else {\n return $this->application->getEntityManager()\n ->getRepository('BackBee\\CoreDomain\\NestedNode\\Page')\n ->getRoot($this->getCurrentSite());\n }\n }",
"public function getGrandParent();",
"private function find_root( $ctx ) {\n if ( isset( $ctx->parent ) ) {\n return $this->find_root( $ctx->parent );\n }\n else {\n return $ctx;\n }\n }",
"public function getRoot() {\n return $this->root;\n }",
"public function getTree()\n {\n return($this->options['tree']);\n }",
"public function getRoot() {\n return $this->__root;\n }",
"function get_parent(tree $tree, $child_id):? tree_node {\n return @$tree->find($child_id);\n}",
"public function getRootLevelFolder() {}",
"public function getTree($url=\"\") {\n \n $models = $this->findAll(array('order' => $this->leftAttribute));\n if (count($models) == 0)\n throw new CDbException(Yii::t('tree', 'There must be minimum one root record in model `' . get_class($this) . '`'));\n $data = $this->loadTree($models, $url);\n // print_r($data);echo \"<hr>\";\n return ($data['data']);\n }",
"function get_top_ancestor_id(){\n\tglobal $post;\n\tif($post->post_parent){\n\t\t$ancestors= array_reverse(get_post_ancestors($post->ID));\n\t\treturn $ancestors[0];\n\t}\t\n\treturn $post->ID;\n}",
"public function getTopLevelUnit()\n {\n return $this->topLevelUnit instanceof BusinessUnitKeyReferenceBuilder ? $this->topLevelUnit->build() : $this->topLevelUnit;\n }",
"public function getTree()\n {\n return $this->hasOne(Tree::className(), ['id' => 'tree_id']);\n }",
"public static function getRootNodeName()\n {\n return 'SuperFund';\n }",
"public function getTreeParent(){\n return $this->treeParentRow;\n }",
"public function getRoot()\n {\n return $this->parent ? $this->parent->getRoot() : $this;\n }",
"protected function retrieveParent()\n {\n }",
"public function get_parent();",
"public function root() {\n return $this->root;\n }",
"public function root($scope = NULL)\n {\n if (is_null($scope) AND $this->loaded)\n {\n $scope = $this->scope;\n }\n elseif (is_null($scope) AND ! $this->loaded)\n {\n throw new Exception('root() must be called on a loaded Cobra_MPTT object instance.');\n }\n \n $sql = \"SELECT * FROM $this->_table_name\n WHERE \n $this->left_column = 1\n AND $this->scope_column = $scope\n ORDER BY \". $this->_sorting[0] .\" \". $this->_sorting[1] .\"\n \";\n $result = $this->_db->query($sql);\n return $this->factory_set($result)[0];\n }",
"public function tree_get($ns = false) {\n $root = $this->tree_get_parent();\n $parent = $this->element_read($root);\n\n if (!$root) {\n // Root-Knoten nicht gefunden\n $this->error = \"ERR_ROOT_NOT_FOUND\";\n return false;\n }\n\n $editable = 0;\n\n if ($ns == false) {\n // Gespeicherten Baum ausgeben\n\n // Nicht bearbeitbar da nicht live\n $editable = 1;\n\t\t$nestedset_ar = array();\n\t\t$nestedset_ar[] = array(\n\t\t\t\"id\" \t\t=> $root,\n\t\t\t\"title\"\t\t=> $parent[\"V1\"],\n\t\t\t\"childs\"\t=> $this->node_create_nestedset($root)\n\t\t);\n\n $ns = array();\n // $nestedset_ar als Nested-Set nach -> $nestedset\n $this->tree_create_nestedset_from_array($nestedset_ar, $ns);\n }\n $result = array();\n $parents = array();\n $parent = $ns[0];\n $parent[\"kidcount\"] = ($parent[\"RGT\"] - $parent[\"LFT\"] - 1) / 2;\n $parent[\"haskids\"] = ($parent[\"kidcount\"] > 0 ? true : false);\n $parent[\"is_first\"] = 1; $parent[\"is_last\"] = 1; $parent[\"level\"] = 0;\n //$parent[\"childs_done\"] = 0;\n for ($i = 1; $i < count($ns); $i++) {\n $ns[$i][\"editable\"] = $editable;\n $ns[$i][\"kidcount\"] = ($ns[$i][\"RGT\"] - $ns[$i][\"LFT\"] - 1) / 2;\n $ns[$i][\"haskids\"] = ($ns[$i][\"kidcount\"] > 0 ? true : false);\n $ns[$i][\"is_first\"] = (($parent[\"LFT\"]+1) == $ns[$i][\"LFT\"] ? 1 : 0);\n $ns[$i][\"is_last\"] = 0;\n $ns[$i][\"index\"] = $i-1;\n $ns[$i][\"level\"] = $parent[\"level\"]+1;\n\n //echo(\"ELE (\".count($parents).\")\".$ns[$i][\"ID_KAT\"].\" | \".$ns[$i][\"RGT\"].\" -> \".$parent[\"RGT\"].\"<br />\");\n if ($ns[$i][\"RGT\"] == ($parent[\"RGT\"]-1)) {\n $ns[$i][\"is_last\"] = 1;\n $parent = array_pop($parents);\n while ((count($parents) > 1) && ($parents[count($parents)-1]) && ($parent[\"RGT\"] == ($parents[count($parents)-1][\"RGT\"]-1))) {\n //echo(\"PAR2 (\".count($parents).\")\".$parent[\"ID_KAT\"].\" | \".$parent[\"RGT\"].\" -> \".$parents[count($parents)-1][\"RGT\"].\"<br />\");\n $result[$parent[\"index\"]][\"is_last\"] = 1;\n $parent = array_pop($parents);\n }\n }\n $result[$i-1] = array_merge($this->element_read($ns[$i][\"ID_KAT\"]), $ns[$i]);\n\n if ($ns[$i][\"kidcount\"] > 0) {\n // Es folgen Kind-Elemente dieses Knotens\n $parents[] = $parent;\n $parent = $ns[$i];\n }\n }\n //die(ht(dump($result)));\n return $result;\n }",
"public function getTreeTable()\n\t{\n\t\treturn $this->table_tree;\n\t}",
"function get_tree($selected)\n\t{\n\t\trequire_code('zones3');\n\t\t$tree=nice_get_zones($selected);\n\t\treturn $tree;\n\t}",
"function get_top_ancestor_id() {\n\n global $post;\n\n if ( $post->post_parent) {\n $ancestors = array_reverse(get_post_ancestors($post->ID));\n return $ancestors[0];\n }\n return $post->ID;\n}",
"public function get_root_location()\n {\n return $this->m_mptt->get_by_node_id(C__OBJ__ROOT_LOCATION);\n }",
"protected function _getTree(){\n\t\tif (!$this->_tree) {\n\t\t\t$this->_tree = Mage::getResourceModel('megamenu2/menuitem_tree')->load();\n\t\t}\n\t\treturn $this->_tree;\n\t}",
"public function getTreeAdaptor();",
"public function getRoot(): BranchGraphNode\n {\n return $this->root;\n }",
"protected function insertTreeRootRecord($tableName)\n {\n $root = new \\stdClass();\n\n $root->slug = 'root';\n $root->name = 'Root Node';\n $root->description = 'The root node for this table.';\n $root->lft = '1';\n $root->rgt = '2';\n $root->hash = sha1($root->slug);\n\n return \\JFactory::getDbo()->insertObject($tableName, $root);\n }",
"public function node()\n\t{\n\t\t$registry = Jquarry_Registry::instance();\n\t\t\n\t\treturn $registry->get_node($this->node_id());\n\t}",
"function get_post_top_ancestor_id(){\n global $post;\n \n if($post->post_parent){\n $ancestors = array_reverse(get_post_ancestors($post->ID));\n return $ancestors[0];\n }\n \n return $post->ID;\n}",
"function ww_get_top_parent( $id = null ) {\n global $post;\n $temp_post = $id ? get_post( $id ) : $post;\n while( $temp_post->post_parent != 0 ) {\n $temp_post = get_post( $temp_post->post_parent );\n }\n return $temp_post;\n}",
"function tdc_find_filenode($database, $file_name){\n $file = $database->xpath('//file[@name=\"'.$file_name.'\"]');\n if($file != False){\n return $file[0];\n }\n}",
"public function parent()\n {\n if ( !$this->loaded )\n $this->reload();\n\n if ($this->is_root())\n return NULL;\n\n if ( ! in_array('parent', $this->_objects) )\n {\n $sql = \"SELECT * FROM $this->_table_name\n WHERE \n $this->primary_column = $this->parent_key\n ORDER BY \". $this->_sorting[0] .\" \". $this->_sorting[1] .\"\n \";\n\n $result = $this->_db->query($sql);\n\n $this->_objects['parent'] = $this->factory_set($result)[0];\n }\n\n return $this->_objects['parent'];\n }",
"public function getRoot()\n {\n return ($this->parent !== null) ? $this->parent->getRoot() : $this;\n }",
"public function tree_get_parent($id = false) {\n global $db;\n if (!$id) {\n // Root-ID ermitteln\n if (!isset($this->id_root))\n $this->id_root = $db->fetch_atom(\"SELECT ID_KAT FROM `\".$this->table.\"` WHERE ROOT=\".$this->root.\" AND PARENT=0\");\n return $this->id_root;\n } else {\n // Parent eines Elements ermitteln\n return $db->fetch_atom(\"SELECT PARENT FROM `\".$this->table.\"` WHERE ROOT=\".$this->root.\" AND ID_KAT=\".$id);\n }\n }",
"public function get_root_content_object();",
"public function getRootRecord() {}",
"public function getLeafId ()\r\n\t{\r\n\t\treturn $this->leafId;\r\n\t}",
"public function getTreePk()\n\t{\n\t\treturn $this->tree_pk;\n\t}",
"public function roots()\n\t{\n\t\t$owner=$this->getOwner();\n\t\t$db=$owner->getDbConnection();\n\t\t$owner->getDbCriteria()->addCondition($db->quoteColumnName($owner->getTableAlias()).'.'.$db->quoteColumnName($this->leftAttribute).'=1');\n\n\t\treturn $owner;\n\t}",
"public function TopMost()\n {\n $tblNavItem = NavigationItem::Schema()->Table();\n $sql = Access::SqlBuilder();\n $where = $sql->Equals($tblNavItem->Field('Navigation'), $sql->Value($this->navi->GetID()))\n ->And_($sql->IsNull($tblNavItem->Field('Parent')))\n ->And_($sql->IsNull($tblNavItem->Field('Previous')));\n \n return NavigationItem::Schema()->First($where);\n }",
"function print_tree(tree $t, $with_id=false) {\n // $root = tree_to_treenode($t);\n print_treenode($t, null, 0, $with_id);\n}",
"public function forumNode()\n {\n if (!$this->forumNode)\n {\n $this->forumNode = eZContentObjectTreeNode::fetch(\n $this->attribute('node_id'),\n $this->languageCode()\n );\n }\n return $this->forumNode;\n }",
"function get_node( $val, $col = 'lft' )\n\t{\n\t\t$node_data = array(\n\t\t\t'node_id' => '',\n\t\t\t'lft' => 0,\n\t\t\t'rgt' => 0,\n\t\t\t'parent' => '',\n\t\t\t'moved' => '',\n\t\t\t'label' => '',\n\t\t\t'entry_id' => '',\n\t\t\t'template_path' => '',\n\t\t\t'custom_url' => '',\n\t\t\t'type' => array(),\n\t\t\t'field_data' => '',\n\t\t\t'depth' => ''\n\t\t);\n\n\t\t$query = ee()->db->get_where( \n\t\t\t$this->tree_table, \n\t\t\tarray($col => $val), \n\t\t\t1 \n\t\t);\n\t\treturn $query->num_rows() ? $query->row_array() : $node_data;\n\t}",
"public function getTreeSource();",
"public function getGrandparent() {\n\t\t\tglobal $db;\n\t\t\t$data = $db->get_var(\"SELECT parent FROM pages WHERE guid = (SELECT parent FROM pages where guid = '{$this->guid}')\"); \n\t\t\treturn $data;\n\t\t}",
"public function leaves()\n {\n if (($root = $this->roothunt()) === NULL) return NULL;\n return $this->leafhunt($root);\n }",
"public function getFirstRootNode()\n {\n $qb = $this->_qbFactory\n ->getRootNodeQueryBuilder()\n ->setMaxResults(1);\n try {\n return $qb->getQuery()->getSingleResult();\n } catch (NoResultsException $e) {\n return null;\n }\n }",
"public function getLeafId() {\r\n\t\treturn $this->leafId;\r\n\t}",
"public function fulltree($scope = NULL)\n {\n $object_id = \"fulltree_$scope\";\n if (! in_array($object_id, $this->_objects))\n {\n $sql = \"SELECT * FROM $this->_table_name\n \";\n\n if ( ! is_null($scope))\n {\n $sql .= \"AND $this->scope_column = $scope\n ORDER BY \". $this->_sorting[0] .\" \". $this->_sorting[1] .\"\n \";\n }\n else\n {\n $sql .= \"ORDER BY\n $this->scope_column ASC,\n $this->left_column ASC\n \";\n }\n\n $result = $this->_db->query($sql);\n $this->_objects[$object_id] = $this->factory_set($result);\n }\n\n return $this->_objects[$object_id];\n }",
"public function getTrees() {}"
] | [
"0.69263345",
"0.67917013",
"0.67551285",
"0.6744625",
"0.6605519",
"0.65869933",
"0.65869933",
"0.6530329",
"0.63389844",
"0.6327342",
"0.62786424",
"0.6277464",
"0.6230852",
"0.6230852",
"0.6230852",
"0.6185556",
"0.6183423",
"0.6149112",
"0.61029935",
"0.606129",
"0.60209876",
"0.60198134",
"0.60175824",
"0.6015863",
"0.6015295",
"0.6005378",
"0.60012186",
"0.5980991",
"0.5934376",
"0.5933399",
"0.5921622",
"0.59078556",
"0.5905288",
"0.58607334",
"0.5845941",
"0.5832656",
"0.5818809",
"0.578898",
"0.5787943",
"0.5787943",
"0.57774675",
"0.5757438",
"0.575286",
"0.57343394",
"0.57223946",
"0.571593",
"0.5715444",
"0.57147425",
"0.5704291",
"0.5702152",
"0.5700839",
"0.5700545",
"0.5694289",
"0.5648015",
"0.56389207",
"0.5630442",
"0.5600191",
"0.5591991",
"0.5588707",
"0.5586108",
"0.55750054",
"0.5572247",
"0.55661106",
"0.5530349",
"0.55275977",
"0.55273545",
"0.55252683",
"0.55189854",
"0.5513514",
"0.5513222",
"0.5510663",
"0.55102235",
"0.5502733",
"0.54988825",
"0.548347",
"0.54609644",
"0.54515815",
"0.5449756",
"0.54427624",
"0.54346645",
"0.54313123",
"0.5424332",
"0.5423507",
"0.5409478",
"0.5405945",
"0.5401896",
"0.5401577",
"0.53922516",
"0.53859764",
"0.53838205",
"0.53789145",
"0.5368485",
"0.53602314",
"0.5345849",
"0.53445894",
"0.53415555",
"0.53272784",
"0.532269",
"0.5313206",
"0.5312284"
] | 0.6163998 | 17 |
retrieve root, fileinodes and trash top level forest nodes. | private function root() { return $this->toplevel("root"); } | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function findRootNodes()\n {\n return $this->findNodes();\n }",
"public function getTrees() {}",
"private function GetAllNodes(){\n $tree = array();\n try {\n $db = new SQLite3('mysqlitedb.db', SQLITE3_OPEN_READWRITE | SQLITE3_OPEN_CREATE);\n $result = $db->query('SELECT * FROM tree WHERE DELETE_AT IS NULL AND PARENT_ID=0');\n if (!is_bool($result)) {\n while ($row = $result->fetchArray()) {\n $nodes = $this->GetNodesByParentId($db, $row[\"ID\"]);\n $tree[] = array(\"ID\" => $row[\"ID\"], \"NAME\" => $row[\"NAME\"], \"NODES\" => $nodes);\n }\n }\n $db->close();\n } catch (Exception $ex) {\n echo \"Exception in Tree->GetAllNodes: \" . $ex->getMessage() . \"<br/>\";\n $db->close();\n }\n return $tree;\n }",
"function get_nodes()\n {\n\n \tif( !isset($this->cache['trees'][$this->tree_id]['nodes']))\n \t{\n \t\tee()->db->select('*');\n\t\t\tee()->db->from( $this->tree_table );\n\t\t\tee()->db->join('channel_titles', 'channel_titles.entry_id = '.$this->tree_table.'.entry_id', 'left');\n\t\t\tee()->db->join('statuses', 'statuses.status = channel_titles.status', 'left');\n \t\t$nodes = ee()->db->get()->result_array();\n\n \t\t// map field names => type\n\t\t\t$cf_map = array();\n\t\t\tforeach( $this->cache['trees'][$this->tree_id]['fields'] as $cf)\n\t\t\t{\n\t\t\t $cf_map[$cf['name']] = $cf['type'];\n\t\t\t}\n\n \t\t// reindex with node ids as keys\n \t\t$node_data = $entry_data = array();\n \t\tforeach($nodes as $node)\n \t\t{\n \t\t\t// if the node is associated with an entry\n \t\t\t// create another index for those\n \t\t\tif($node['entry_id'])\n \t\t\t{\n \t\t\t\t$entry_data[ $node['entry_id'] ] = $node['node_id'];\n \t\t\t}\n\n \t\t\tif($node['type'] != '')\n \t\t\t{\n \t\t\t\t$node['type'] = explode('|', $node['type']);\n \t\t\t}\n \t\t\telse\n \t\t\t{\n \t\t\t\t$node['type'] = array();\n \t\t\t}\n\n \t\t\tif(!empty($node['field_data']))\n \t\t\t{\n \t\t\t\tee()->load->library('taxonomy_field_lib');\n \t\t\t\t$node['field_data'] = json_decode($node['field_data'], TRUE);\n \t\t\t\tforeach($node['field_data'] as $k => $v)\n \t\t\t\t{\n \t\t\t\t\t// this should apply to front end template parsing only \n \t\t\t\t\t$callers = debug_backtrace();\n \t\t\t\t\tif ( isset($callers[2]['function']) && $callers[2]['function'] == 'process_tags' && isset($cf_map[$k]))\n \t\t\t\t\t{\n \t\t\t\t\t\t\n \t\t\t\t\t\t$ft = ee()->taxonomy_field_lib->load($cf_map[$k]);\n \t\t\t\t\t\t// let the fieldtype change the final value\n \t\t\t$v = $ft->replace_value($v);\n \t\t\t// overwrite value\n \t\t\t$node['field_data'][$k] = $v;\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$node[$k] = $v;\n \t\t\t\t}\n \t\t\t}\n\n \t\t\t$node_data[ $node['node_id'] ] = $node;\n \t\t\t$node_data[ $node['node_id'] ]['url'] = $this->build_url($node);\n \t\t\t\n \t\t}\n\n \t\t$this->cache['trees'][$this->tree_id]['nodes']['by_node_id'] = $node_data;\n \t\t$this->cache['trees'][$this->tree_id]['nodes']['by_entry_id'] = $entry_data;\n \t}\n\n \treturn $this->cache['trees'][$this->tree_id]['nodes'];\n\n }",
"private function getRootIndividualsInAllTrees()\n {\n if (!isset($this->rootIndividualsInAllTrees)) {\n $this->rootIndividualsInAllTrees = array();\n\n // get all the site ids the current user is a member in\n $isUserLoggedIn = $this->getCommonUtility()->getIsUserLoggedIn();\n if ($isUserLoggedIn) {\n $memberships = $this->getFamilyGraph()->api('me/memberships');\n if ($memberships && isset($memberships['data']) && count($memberships['data']) > 0) {\n // aggregate the site ids\n $siteIds = array();\n foreach($memberships['data'] as $membership) {\n $siteIds[] = $membership['site']['id'];\n }\n\n // get all the sites trees\n $sitesTrees = $this->getFamilyGraph()->api($siteIds, array('fields' => 'trees'));\n if ($sitesTrees) {\n // iterate over the trees and extract the root individual from them\n foreach ($sitesTrees as $siteTrees) {\n if (!isset($siteTrees['trees']['data']) || !$siteTrees['trees']['data']) {\n // skip sites with no trees\n continue;\n }\n\n // iterate over the trees\n $trees = $siteTrees['trees']['data'];\n foreach ($trees as $tree) {\n if (!isset($tree['root_individual'])) {\n // skip trees with no root individual\n continue;\n }\n\n $rootIndividualData = array(\n 'siteName' => $siteTrees['name'],\n 'treeName' => $tree['name'],\n 'treeRootIndividualId' => $tree['root_individual']['id'],\n 'treeRootIndividualName' => $tree['root_individual']['name'],\n );\n\n $this->rootIndividualsInAllTrees[] = $rootIndividualData;\n }\n }\n }\n }\n }\n }\n \n return $this->rootIndividualsInAllTrees;\n }",
"function get_root()\n {\t\n\t\t$query = ee()->db->get_where( $this->tree_table, array('lft' => 1), 1 );\n\t\treturn ( $query->num_rows() ) ? $query->row_array() : FALSE;\n }",
"public function getRootNodes()\r\n {\r\n $event = $this->getEventManager()->trigger(__FUNCTION__.'.pre', $this);\r\n if ($event->stopped()) {\r\n return $event->last();\r\n }\r\n\r\n $result = $this->mapper->getRootNodes();\r\n\r\n $params['__RESULT__'] = $result;\r\n $this->getEventManager()->trigger(__FUNCTION__.'.post', $this, $params);\r\n\r\n return $result;\r\n }",
"function & get_root_nodes($add_sql = array())\r\n\t{\r\n\t\t$sql = sprintf('SELECT %s %s FROM %s %s WHERE %s.id=%s.root_id %s ORDER BY %s.%s ASC',\r\n\t\t\t\t\t\t\t\t\t\t$this->_get_select_fields(),\r\n\t\t\t\t\t\t\t\t\t\t$this->_add_sql($add_sql, 'columns'),\r\n\t\t\t\t\t\t\t\t\t\t$this->_node_table,\r\n\t\t\t\t\t\t\t\t\t\t$this->_add_sql($add_sql, 'join'),\r\n\t\t\t\t\t\t\t\t\t\t$this->_node_table,\r\n\t\t\t\t\t\t\t\t\t\t$this->_node_table,\r\n\t\t\t\t\t\t\t\t\t\t$this->_add_sql($add_sql, 'append'),\r\n\t\t\t\t\t\t\t\t\t\t$this->_node_table, $this->_secondary_sort);\r\n\r\n\t\t$node_set =& $this->_get_result_set($sql);\r\n\r\n\t\treturn $node_set;\r\n\t}",
"function get_trees()\n\t{\n\n\t\tif(!isset($this->cache['trees']))\n\t\t{\n\n\t\t\tee()->db->order_by('label', 'asc');\n\t\t\t$trees = ee()->db->get_where('taxonomy_trees', array('site_id' => $this->site_id) )->result_array();\n\t\t\t// reindex with node ids as keys\n\t\t\t$data = array();\n\t\t\tforeach($trees as $tree)\n\t\t\t{\n\t\t\t\t$data[ $tree['id'] ] = $tree;\n\t\t\t\t$data[ $tree['id'] ]['templates'] = explode('|', $tree['templates']);\n\t\t\t\t$data[ $tree['id'] ]['channels'] = explode('|', $tree['channels']);\n\t\t\t\t$data[ $tree['id'] ]['member_groups'] = explode('|', $tree['member_groups']);\n\t\t\t\t$data[ $tree['id'] ]['fields'] = ($tree['fields']) ? json_decode($tree['fields'], TRUE) : array();\n\t\t\t\t$data[ $tree['id'] ]['taxonomy'] = ($tree['taxonomy']) ? json_decode($tree['taxonomy'], TRUE) : '';\n\t\t\t}\n\n\t\t\t$this->cache['trees'] = $data;\n\n\t\t}\n\n \treturn $this->cache['trees'];\n\t}",
"abstract public function getRoot() ;",
"abstract public function getRoot() ;",
"public function roots()\n {\n $sql = \"SELECT * FROM $this->_table_name\n WHERE \n $this->left_column = 1\n ORDER BY \". $this->_sorting[0] .\" \". $this->_sorting[1] .\"\n \";\n $result = $this->_db->query($sql);\n return $this->factory_set($result);\n }",
"public function getRoot();",
"public function getRootEntries();",
"public function getRootNodes()\n {\n return $this->getNodes($this->qbFactory\n ->getRootNodeQueryBuilder()\n ->getQuery()\n ->getResult());\n }",
"public function getRoot() {}",
"public function getRoot() {}",
"public function getRoot() {}",
"function root() \n\t{\n\t\t$sql\t=\"select * from tab_gene_user\";\n\t\t$res = $this->db->readValues($sql); \n\t\tif(count($res)> 0 )\n\t\t{\n return $res;\n\t\t}\n\t}",
"function fiftyone_degrees_read_root_node_offsets($headers) {\n $root_char_nodes = array();\n $_fiftyone_degrees_data_file = fiftyone_degrees_get_data_file($headers['root_node_offset']);\n for ($i = 0; $i < $headers['root_node_count']; $i++) {\n $root_char_nodes[] = fiftyone_degrees_read_int($_fiftyone_degrees_data_file);\n }\n return $root_char_nodes;\n}",
"function test_get_root_nodes()\r\n\t{ \r\n\t\t// Create a simple set of rootnodes\r\n\t\t$rootnodes_exp = $this->_create_root_nodes(15);\r\n\t\t$rootnodes = $this->_tree->get_root_nodes();\r\n\t\t$this->assertEqual($rootnodes_exp, $rootnodes, 'getRootNodes() failed'); \r\n\t\t// Create a mixed order set of rootnodes\r\n\t\t$rootnodes_exp = $this->_create_root_nodes(15, true);\r\n\t\t$rootnodes = $this->_tree->get_root_nodes();\r\n\t\t$this->assertEqual($rootnodes_exp, $rootnodes, 'getRootNodes() failed on mixed set');\r\n\t\treturn true;\r\n\t}",
"public function leaves()\n {\n if (($root = $this->roothunt()) === NULL) return NULL;\n return $this->leafhunt($root);\n }",
"function get_root()\n\t{ \n\t\t$this->model->where('`'.$this->left_column . '` = 1 ');\n\t\treturn $this->model->find(FALSE,true);\n\t}",
"function get_root() {\n\t\treturn $this->stack[0];\n\t}",
"function FullTree();",
"function _calculateTree() {\n include_once(\"bitlib/SQL/Tree.php\");\n include_once(\"bitlib/functions/common.php\");\n $db = common::getDB($GLOBALS[\"BX_config\"][\"dsn\"]);\n $t = new SQL_Tree($db);\n $t->FullPath=\"fulluri\";\n $t->Path=\"uri\";\n $t->FullTitlePath=\"fulltitlepath\";\n $t->Title=\"title_de\";\n \n $t->importTree(1);\n }",
"function retrieveHierarchy() {\r\n\t\t$arrCats = $this->generateTreeByLevels(3);\r\n\t\t\r\n\t\treturn $arrCats;\r\n\t}",
"protected function loadTreeData() {}",
"function tidy_get_root(tidy $object) {}",
"public function tree_get($ns = false) {\n $root = $this->tree_get_parent();\n $parent = $this->element_read($root);\n\n if (!$root) {\n // Root-Knoten nicht gefunden\n $this->error = \"ERR_ROOT_NOT_FOUND\";\n return false;\n }\n\n $editable = 0;\n\n if ($ns == false) {\n // Gespeicherten Baum ausgeben\n\n // Nicht bearbeitbar da nicht live\n $editable = 1;\n\t\t$nestedset_ar = array();\n\t\t$nestedset_ar[] = array(\n\t\t\t\"id\" \t\t=> $root,\n\t\t\t\"title\"\t\t=> $parent[\"V1\"],\n\t\t\t\"childs\"\t=> $this->node_create_nestedset($root)\n\t\t);\n\n $ns = array();\n // $nestedset_ar als Nested-Set nach -> $nestedset\n $this->tree_create_nestedset_from_array($nestedset_ar, $ns);\n }\n $result = array();\n $parents = array();\n $parent = $ns[0];\n $parent[\"kidcount\"] = ($parent[\"RGT\"] - $parent[\"LFT\"] - 1) / 2;\n $parent[\"haskids\"] = ($parent[\"kidcount\"] > 0 ? true : false);\n $parent[\"is_first\"] = 1; $parent[\"is_last\"] = 1; $parent[\"level\"] = 0;\n //$parent[\"childs_done\"] = 0;\n for ($i = 1; $i < count($ns); $i++) {\n $ns[$i][\"editable\"] = $editable;\n $ns[$i][\"kidcount\"] = ($ns[$i][\"RGT\"] - $ns[$i][\"LFT\"] - 1) / 2;\n $ns[$i][\"haskids\"] = ($ns[$i][\"kidcount\"] > 0 ? true : false);\n $ns[$i][\"is_first\"] = (($parent[\"LFT\"]+1) == $ns[$i][\"LFT\"] ? 1 : 0);\n $ns[$i][\"is_last\"] = 0;\n $ns[$i][\"index\"] = $i-1;\n $ns[$i][\"level\"] = $parent[\"level\"]+1;\n\n //echo(\"ELE (\".count($parents).\")\".$ns[$i][\"ID_KAT\"].\" | \".$ns[$i][\"RGT\"].\" -> \".$parent[\"RGT\"].\"<br />\");\n if ($ns[$i][\"RGT\"] == ($parent[\"RGT\"]-1)) {\n $ns[$i][\"is_last\"] = 1;\n $parent = array_pop($parents);\n while ((count($parents) > 1) && ($parents[count($parents)-1]) && ($parent[\"RGT\"] == ($parents[count($parents)-1][\"RGT\"]-1))) {\n //echo(\"PAR2 (\".count($parents).\")\".$parent[\"ID_KAT\"].\" | \".$parent[\"RGT\"].\" -> \".$parents[count($parents)-1][\"RGT\"].\"<br />\");\n $result[$parent[\"index\"]][\"is_last\"] = 1;\n $parent = array_pop($parents);\n }\n }\n $result[$i-1] = array_merge($this->element_read($ns[$i][\"ID_KAT\"]), $ns[$i]);\n\n if ($ns[$i][\"kidcount\"] > 0) {\n // Es folgen Kind-Elemente dieses Knotens\n $parents[] = $parent;\n $parent = $ns[$i];\n }\n }\n //die(ht(dump($result)));\n return $result;\n }",
"private function getRoot() {\n $statement = $this->getConn()->prepare('SELECT * FROM `' . $this->_table . '` where ' . $this->_parent . ' is null limit 1');\n $statement->execute();\n $root = $statement->fetch();\n return $root;\n }",
"private function getRoots($model){\n $tree = Doctrine_Core::getTable($model)->getTree();\n return $tree->fetchRoots();\n }",
"function getNodes()\n {\n }",
"public function getRoots()\n {\n return $this->repository->findByParent(NULL);\n }",
"function get_flat_tree( $root = 1 )\n\t {\n\t \t\n\t\t$node = $this->get_node( $root );\n\t\tif($node == false)\n\t\t\treturn false;\n\n\t\t$query = ee()->db->select('*')\n\t\t\t->from( $this->tree_table )\n\t\t\t->join('channel_titles', 'channel_titles.entry_id = '.$this->tree_table.'.entry_id', 'left')\n\t\t\t->where($this->tree_table.\".lft BETWEEN \".$node['lft'].\" AND \".$node['rgt'])\n\t\t\t->group_by($this->tree_table.\".node_id\")\n\t\t\t->order_by($this->tree_table.\".lft\", \"asc\")\n\t\t\t->get();\n\t\t\n\t\t$right = array();\n\t\t$result = array();\n\t\t$current =& $result;\n\t\t$stack = array();\n\t\t$stack[0] =& $result;\n\t\t$level = 0;\n\t\t$i = 0;\n\n\t\tforeach($query->result_array() as $row)\n\t\t{\n\n\t\t\t// go more shallow, if needed\n\t\t\tif(count($right))\n\t\t\t{\n\t\t\t\twhile($right[count($right)-1] < $row['rgt'])\n\t\t\t\t{\n\t\t\t\t\tarray_pop($right);\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Go one level deeper?\n\t\t\tif(count($right) > $level)\n\t\t\t{\n\t\t\t\tend($current);\n\t\t\t}\n\t\t\t// the stack contains all parents, current and maybe next level\n\t\t\t// $current =& $stack[count($right)];\n\t\t\t// add the data\n\t\t\t$current[] = $row;\n\t\t\t// go one level deeper with the index\n\t\t\t$level = count($right);\n\t\t\t$right[] = $row['rgt'];\n\n\t\t\t$current[$i]['level'] = $level;\n\t\t\t$current[$i]['childs'] = round(($row['rgt'] - $row['lft']) / 2, 0);\n\t\t\t$i++;\n\t\t}\n\t\t\n\t\treturn $result;\n\t\t\n\t}",
"function get_tree($selected)\n\t{\n\t\trequire_code('zones3');\n\t\t$tree=nice_get_zones($selected);\n\t\treturn $tree;\n\t}",
"public function getRoots() {\n\t\treturn $this->roots;\n\t}",
"public function network_explorer_tree(Request $request){\n\t\t//get all network data\n\t\t\treturn \\App\\Users::with('children')->get()->where('parent', null);\n\t}",
"public function getNodes();",
"function getRoot() { return($this->_root); }",
"function getBrowseTree() {\n # -> list of top_basisklassen and their document count\n $bkls_top_facet = getBkltopFacet($GLOBALS['base_url'],\n $GLOBALS['bkl_top_query']);\n $bkls_top = array();\n $bkls_top_counts = array();\n foreach ($bkls_top_facet[\"bkl_top_caption\"] as $k => $v) {\n if ($k % 2 == 0) {\n if (strlen($v) > 0) {\n $bkls_top[] = $v;\n $bkls_top_counts[] = $bkls_top_facet[\"bkl_top_caption\"][$k+1];\n }\n }\n }\n array_multisort($bkls_top, SORT_ASC, $bkls_top_counts);\n # multicurl bkl_facet for top_bkls\n $bkl_facetdata = getBklFacetData($GLOBALS['base_url'],\n $GLOBALS['bkl_query'],\n $bkls_top);\n # build tree\n $bkl_tree = array();\n $bkl_top_rest = array();\n $bkl_top_rest_cumsum = 0;\n foreach ($bkls_top as $i => $bkl_top) {\n $bkl_facet = $bkl_facetdata[$bkl_top];\n $bkl_top_count = $bkls_top_counts[$i];\n $top_map_params = array();\n if ($bkl_top_count > 100) {\n $cleaned_bkl = array();\n $bkl_rest = array();\n $bkl_rest_cumsum = 0;\n foreach ($bkl_facet as $i => $bkl) {\n if ($bkl[\"count\"] >= 10) {\n $map_params = buildMaplink($GLOBALS['search_url'],\n array($bkl[\"bkl_caption\"]),\n \"bkl\",\n $bkl[\"count\"],\n $bkl_top);\n $cleaned_bkl[] = array(\"bkl_caption\" => $bkl[\"bkl_caption\"],\n \"count\" => $bkl[\"count\"],\n \"map_params\" => $map_params);\n } else {\n $bkl_rest[] = $bkl[\"bkl_caption\"];\n $bkl_rest_cumsum += $bkl[\"count\"];\n }\n }\n $top_map_params = buildMaplink($GLOBALS['search_url'],\n array($bkl_top),\n \"top\",\n $bkl_top_count,\n $bkl_top);\n $rest_map_params = buildMaplink($GLOBALS['search_url'],\n $bkl_rest,\n \"bkl\",\n $bkl_rest_cumsum,\n $bkl_top);\n $cleaned_bkl[] = array(\"bkl_caption\" => implode(\"; \", $bkl_rest),\n \"count\" => $bkl_rest_cumsum,\n \"map_params\" => $rest_map_params);\n $cleaned_bkl = array_filter($cleaned_bkl, function ($bkl) {\n return ($bkl[\"count\"] >= 10);\n });\n $bkl_tree[] = array(\"bkl_top_caption\" => $bkl_top,\n \"count\" => $bkl_top_count,\n \"bkl_facet\" => $cleaned_bkl,\n \"map_params\" => $top_map_params);\n }\n if ($bkl_top_count >= 10 and $bkl_top_count <= 100) {\n $top_map_params = buildMaplink($GLOBALS['search_url'],\n array($bkl_top),\n \"top\",\n $bkl_top_count,\n $bkl_top);\n $bkl_tree[] = array(\"bkl_top_caption\" => $bkl_top,\n \"count\" => $bkl_top_count,\n \"bkl_facet\" => array(),\n \"map_params\" => $top_map_params);\n }\n if ($bkl_top_count < 10) {\n $bkl_top_rest[] = $bkl_top;\n $bkl_top_rest_cumsum += $bkl_top_count;\n }\n }\n $rest_maplink = buildMaplink($GLOBALS['search_url'],\n $bkl_top_rest,\n \"top\",\n $bkl_top_rest_cumsum,\n \"\");\n $bkl_tree[] = array(\"bkl_top_caption\" => implode(\"; \", $bkl_top_rest),\n \"count\" => $bkl_top_rest_cumsum,\n \"bkl_facet\" => array(),\n \"map_params\" => $rest_maplink);\n $bkl_tree = array_filter($bkl_tree, function($bklt) {\n return(array($bklt[\"count\"] >= 10));\n });\n return json_encode($bkl_tree, JSON_UNESCAPED_UNICODE);\n}",
"function opensky_get_collection_tree () {\n $pid = 'opensky:root';\n $tree = array();\n foreach (opensky_get_subcollections_recursive('opensky:root') as $pid) {\n $tree[$pid] = opensky_get_pid_subcollections_pids($pid);\n }\n return $tree;\n}",
"public function readTree($force = FALSE)\n\t{\n\t\tif (isset($this->class_tree) && count($this->class_tree) && !$force) return;\n\n\t\t$e107 = e107::getInstance();\n\n\t\t$this->class_tree = array();\n\t\t$this->class_parents = array();\n\n\t\t$array = new ArrayData;\n\t\tif ($temp = $e107->ecache->retrieve_sys(UC_CACHE_TAG))\n\t\t{\n\t\t\t$this->class_tree = $array->ReadArray($temp);\n\t\t\tunset($temp);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->sql_r->db_Select('userclass_classes', '*', \"ORDER BY userclass_parent\", 'nowhere');\t\t// The order statement should give a consistent return\n\n\t\t\twhile ($row = $this->sql_r->db_Fetch(MYSQL_ASSOC))\n\t\t\t{\n\t\t\t\t$this->class_tree[$row['userclass_id']] = $row;\n\t\t\t\t$this->class_tree[$row['userclass_id']]['class_children'] = array();\t\t// Create the child array in case needed\n\t\t\t}\n\n\n\t\t\t// Add in any fixed classes that aren't already defined\n\t\t\tforeach ($this->fixed_classes as $c => $d)\n\t\t\t{\n\t\t\t\tif (!isset($this->class_tree[$c]))\n\t\t\t\t{\n\t\t\t\t\tswitch ($c)\n\t\t\t\t\t{\n\t\t\t\t\t\tcase e_UC_ADMIN :\n\t\t\t\t\t\tcase e_UC_MAINADMIN :\n\t\t\t\t\t\t\t$this->class_tree[$c]['userclass_parent'] = e_UC_NOBODY;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase e_UC_NEWUSER :\n\t\t\t\t\t\t\t$this->class_tree[$c]['userclass_parent'] = e_UC_MEMBER;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault :\n\t\t\t\t\t\t\t$this->class_tree[$c]['userclass_parent'] = e_UC_PUBLIC;\n\t\t\t\t\t}\n\t\t\t\t\t$this->class_tree[$c]['userclass_id'] = $c;\n\t\t\t\t\t$this->class_tree[$c]['userclass_name'] = $d;\n\t\t\t\t\t$this->class_tree[$c]['userclass_description'] = 'Fixed class';\n\t\t\t\t\t$this->class_tree[$c]['userclass_visibility'] = e_UC_PUBLIC;\n\t\t\t\t\t$this->class_tree[$c]['userclass_editclass'] = e_UC_MAINADMIN;\n\t\t\t\t\t$this->class_tree[$c]['userclass_accum'] = $c;\n\t\t\t\t\t$this->class_tree[$c]['userclass_type'] = UC_TYPE_STD;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$userCache = $array->WriteArray($this->class_tree, FALSE);\n\t\t\t$e107->ecache->set_sys(UC_CACHE_TAG,$userCache);\n\t\t\tunset($userCache);\n\t\t}\n\n\n\t\t// Now build the tree.\n\t\t// There are just two top-level classes - 'Everybody' and 'Nobody'\n\t\t$this->class_parents[e_UC_PUBLIC] = e_UC_PUBLIC;\n\t\t$this->class_parents[e_UC_NOBODY] = e_UC_NOBODY;\n\t\tforeach ($this->class_tree as $uc)\n\t\t{\n\t\t\tif (($uc['userclass_id'] != e_UC_PUBLIC) && ($uc['userclass_id'] != e_UC_NOBODY))\n\t\t\t{\n\t\t\t\tif (!isset($this->class_tree[$uc['userclass_parent']]))\n\t\t\t\t{\n\t\t\t\t\techo \"Orphaned class record: ID=\".$uc['userclass_id'].\" Name=\".$uc['userclass_name'].\" Parent=\".$uc['userclass_parent'].\"<br />\";\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\t// Add to array\n\t\t\t\t\t$this->class_tree[$uc['userclass_parent']]['class_children'][] = $uc['userclass_id'];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"function find_leaves(){\n\t\t$leaves=array();\n\t\tforeach($this->nodes as $node){\n\t\t\tif(count($node->children)==0){\n\t\t\t$leaves[]=$node;\n\t\t\t}\n\t\t}\n\t\treturn $leaves;\n\t}",
"public function getRoot() {\n\t\t$this->initDataProvider();\n\t\t$node = $this->dataProvider->getRoot();\n\n\t\treturn $node->toArray();\n\t}",
"public function initializeTreeData() {}",
"public function initializeTreeData() {}",
"function test_get_all_nodes()\r\n\t{\r\n\t\t$rnc = 1;\r\n\t\t$depth = 2;\r\n\t\t$npl = 3;\r\n\t\t$this->_create_sub_node($rnc, $depth, $npl);\r\n\r\n\t\t$allnodes = $this->_tree->get_all_nodes();\r\n\t\t$rootnodes = $this->_tree->get_root_nodes();\r\n\t\t$exp_cct = 0;\r\n\t\tforeach($rootnodes AS $rid => $rootnode)\r\n\t\t{\r\n\t\t\t$exp_cct = $exp_cct + floor(($rootnode['r'] - $rootnode['l']) / 2);\r\n\t\t} \r\n\t\t// Does it really return all nodes?\r\n\t\t$cct = count($allnodes);\r\n\t\t$exp_cct = $exp_cct + count($rootnodes);\r\n\t\t$this->assertEqual($exp_cct, $cct, 'Total node count returned is wrong'); \r\n\t\t// Verify the result agains pickNode()\r\n\t\tforeach($allnodes AS $nid => $node)\r\n\t\t{\r\n\t\t\t$this->assertEqual($this->_tree->get_node($nid), $node, 'Result differs from pickNode()');\r\n\t\t} \r\n\r\n\t\treturn true;\r\n\t}",
"public function getRoot()\n {\n return $this->drupalFinder()->getDrupalRoot();\n }",
"function getfamilystree($id_module = 0, $all = 0) {\n\tglobal $db;\n\n\t$family = array();\n\tif ($id_module == 0 && isset($_SESSION['dims']['moduleid'])) $id_module = $_SESSION['dims']['moduleid'];\n\n\t$select = \"\n\t\tSELECT f.*, fl.* FROM dims_mod_cata_famille f\n\t\tINNER JOIN dims_mod_cata_famille_lang fl\n\t\tON fl.id_famille_1 = f.id_famille\n\t\tWHERE f.id_module = {$id_module}\";\n\tif($all!=1) $select .= \" AND f.visible = 1\";\n\t$select .= \" ORDER BY f.id_parent, f.position\";\n\n\t$result = $db->query($select);\n\twhile ($fields = $db->fetchrow($result)) {\n\t\t$family['tree'][$fields['id_parent']][] = $fields['id_famille']; //pour récupere l'ordre d'apparition (position)\n\t\t$family['list'][$fields['id_parent']][$fields['id_famille']] = $fields;\n\t\t$family['list'][$fields['id_parent']][$fields['id_famille']]['allow'] = 1;\n\t}\n\n\t$tree = array();\n\t$depth = getallfamilysrec($tree, $family, 1, 0);\n\treturn($tree);\n}",
"public function getNodeTypes() {}",
"function get_virtual_root()\n\t{\n\t\tglobal $DBPrefix, $db;\n\t\t// Virtual root element as parent.\n\t\t$query = \"SELECT right_id FROM \" . $DBPrefix . \"categories ORDER BY right_id DESC LIMIT 1\";\n\t\t$db->direct_query($query);\n\t\t$row = $db->result();\n\t\t$root = array('left_id' => 1, 'right_id' => $row['right_id'], 'level' => -1);\n\t\treturn $root;\n\t}",
"public function roots()\n\t{\n\t\t$owner=$this->getOwner();\n\t\t$db=$owner->getDbConnection();\n\t\t$owner->getDbCriteria()->addCondition($db->quoteColumnName($owner->getTableAlias()).'.'.$db->quoteColumnName($this->leftAttribute).'=1');\n\n\t\treturn $owner;\n\t}",
"private function get_existed_directory_tree()\r\n {\r\n $node_abs_length = 0;\r\n \r\n for ($dic_depth = 1; $dic_depth < 6; $dic_depth++)\r\n {\r\n $node_abs_length = $dic_depth * TL_NODE_ABS_LENGTH;\r\n \r\n $sql = \"select id, name, parent_id from \" .\r\n $this->db_handler->get_table('nodes_hierarchy') . \" n where n.node_type_id = 2 \" .\r\n \" and LENGTH(n.node_depth_abs) = \" . $node_abs_length;\r\n $result = $this->db_handler->fetchRowsIntoMap($sql, 'id');\r\n \r\n if (count($result, COUNT_NORMAL) > 0)\r\n {\r\n $this->existed_directory_array[$dic_depth] = $result;\r\n }\r\n }\r\n }",
"public function getDatasetNodes()\n {\n $nodes = array();\n $classIdentifier = $this->openDataIni->variable( 'GeneralSettings', 'DatasetClassIdentifier' );\n $class = eZContentClass::fetchByIdentifier( $classIdentifier );\n if ( $class instanceof eZContentClass )\n {\n $params = array(\n 'ClassFilterType' => 'include',\n 'ClassFilterArray' => array( $classIdentifier ),\n 'Depth' => 1,\n 'DepthOperator' => 'ge'\n );\n $nodes = eZContentObjectTreeNode::subTreeByNodeID( $params,\n eZINI::instance( 'content.ini' )->variable( 'NodeSettings', 'RootNode' ) ); \n }\n return $nodes;\n }",
"public function getTree($url=\"\") {\n \n $models = $this->findAll(array('order' => $this->leftAttribute));\n if (count($models) == 0)\n throw new CDbException(Yii::t('tree', 'There must be minimum one root record in model `' . get_class($this) . '`'));\n $data = $this->loadTree($models, $url);\n // print_r($data);echo \"<hr>\";\n return ($data['data']);\n }",
"public function getTreeStructure()\n {\n $result = array();\n $search = function($folder, $prefix) use (&$result, &$search)\n {\n foreach (new \\DirectoryIterator($folder) as $node)\n {\n if ($node->isDir() && !$node->isDot())\n {\n $result[] = $prefix.$node->getFilename();\n $search($node->getPathname(), $prefix.$node->getFilename().'/');\n }\n }\n };\n\n $search($this->path, \"\");\n sort($result);\n return $result;\n }",
"public function getRootNode() {}",
"function test_get_node()\r\n\t{ \r\n\t\t// Set some rootnodes\r\n\t\t$nids = $this->_setup_root_nodes(3); \r\n\t\t// Loop trough the node id's of the newly created rootnodes\r\n\t\tfor($i = 0; $i < count($nids); $i++)\r\n\t\t{\r\n\t\t\t$nid = $nids[$i];\r\n\r\n\t\t\t$nname = 'Node ' . $nid;\r\n\t\t\t$norder = $nid; \r\n\t\t\t// Pick the current node and do the tests\r\n\t\t\t$nnode = $this->_tree->get_node($nid); \r\n\t\t\t// Test Array\r\n\t\t\t$this->assertEqual(is_array($nnode), \"Node $nname: No array given.\"); \r\n\t\t\t// Test lft/rgt\r\n\t\t\t$this->assertEqual(1, $nnode['l'], \"Node $nname: Wrong LFT\");\r\n\t\t\t$this->assertEqual(2, $nnode['r'], \"Node $nname: Wrong RGT\"); \r\n\t\t\t// Test order\r\n\t\t\t$this->assertEqual($norder, $nnode['ordr'], \"Node $nname: Wrong order.\"); \r\n\t\t\t// Test Level\r\n\t\t\t$this->assertEqual(1, $nnode['level'], \"Node $nname: Wrong level.\"); \r\n\t\t\t// Test Name\r\n\t\t\t$this->assertEqual($nname, $nnode['identifier'], \"Node $nname: Wrong name.\");\r\n\t\t} \r\n\t\treturn true;\r\n\t}",
"public function getTree($root, $legalExt)\n\t{\n\t}",
"public function get_nodes()\n {\n }",
"public function get_nodes()\n {\n }",
"public function get_nodes()\n {\n }",
"public function get_nodes()\n {\n }",
"public function get_nodes()\n {\n }",
"public function get_nodes()\n {\n }",
"public function getRootNodes($nodes)\n\t{\n\t$output = array();\n\tforeach($nodes as $name => $node)\n\t if (!count($node->parents)) $output[$name] = $node;\n\treturn $output;\n\t}",
"function fiftyone_degrees_get_nodes_root_node($node_offset, $headers) {\n $node = fiftyone_degrees_read_node($node_offset, $headers);\n if ($node['parent_offset'] >= 0) {\n return fiftyone_degrees_get_nodes_root_node($node['parent_offset'], $headers);\n }\n else {\n return $node;\n }\n}",
"public function readRepoStructure() {\r\n $tree = array();\r\n $entries_list = SvnWrapper::singleton()->ls();\r\n if(is_array($entries_list)) {\r\n// $svntree = $this->buildTreeFromFlatList($entries_list);\r\n $svntree = $this->buildTreeRecursively('/');\r\n $tree = $this->svnTreeTransform($svntree);\r\n }\r\n return $tree;\r\n }",
"public function getTree() {\n\n $servers = Hash::extract($this->find('all', array(\n 'fields' => array(\n 'server_id', 'name', 'short_name', 'parent_id'\n )\n )), '{n}.Server');\n\n $tree = array();\n\n foreach ($servers as $server) {\n\n $parent_id = $server['parent_id'];\n\n if (empty($parent_id)) {\n\n $server_id = $server['server_id'];\n\n if (empty($tree[$server_id])) {\n $tree[$server_id] = $server;\n } else {\n $tree[$server_id] = array_merge($tree[$server_id], $server);\n }\n\n } else {\n\n if (empty($tree[$parent_id])) {\n $tree[$parent_id] = array(\n 'children' => array($server)\n );\n } else if (empty($tree[$parent_id]['children'])) {\n $tree[$parent_id]['children'] = array($server);\n } else {\n $tree[$parent_id]['children'][] = $server;\n }\n }\n }\n\n return $tree;\n }",
"public static function getRootFolders(): array\n {\n\t\tself::instantiateAllExistingMetaFolders();\n\n\t\t$roots = [];\n\n\t\tforeach(self::$instancesById as $f) {\n\t\t\t$nestingInfo = $f->getNestingInformation();\n\t\t\tif($nestingInfo['level'] === 0) {\n\t\t\t\t$roots[] = $f;\n\t\t\t}\n\t\t}\n\n\t\tif(count($roots) < 1) {\n\t\t\tthrow new MetaFolderException('No properly defined root folders found.', MetaFolderException::NO_ROOT_FOLDER_FOUND);\n\t\t}\n\n\t\treturn $roots;\n\t}",
"public function getLeafs() {\n\t\treturn $this->leafs;\n\t}",
"public function findRootNode()\n {\n return $this->repository->findOneBy(array('lvl' => 0));\n }",
"public static function getRootNodeName()\n {\n return 'SuperFund';\n }",
"function get_tree( $flush = FALSE)\n {\n\n \tif( isset($this->cache['trees'][$this->tree_id]) && $flush === FALSE)\n \t{\n \t\treturn $this->cache['trees'][$this->tree_id];\n \t}\n \telse\n \t{\n \t\t$data = ee()->db->get_where('taxonomy_trees', array('id' => $this->tree_id), 1 )->row_array();\n\n\t\t\t$data['templates'] = ($data['templates']) ? explode('|', $data['templates']) : array();\n\t\t\t$data['channels'] = ($data['channels']) ? explode('|', $data['channels']) : array();\n\t\t\t$data['member_groups'] = ($data['member_groups']) ? explode('|', $data['member_groups']) : array();\n\t\t\t$data['fields'] = ($data['fields']) ? json_decode($data['fields'], TRUE) : array();\n\t\t\t$data['taxonomy'] = ($data['taxonomy']) ? json_decode($data['taxonomy'], TRUE) : '';\n\n \t\t$this->cache['trees'][$this->tree_id] = $data;\n\n \t}\n\n \treturn $this->cache['trees'][$this->tree_id];\n\n }",
"function readRootId()\n\t{\n\t\tglobal $ilDB;\n\t\t\n\t\t$query = 'SELECT child FROM '.$this->table_tree.' '.\n\t\t\t'WHERE parent = %s '.\n\t\t\t'AND '.$this->tree_pk.' = %s ';\n\t\t$res = $ilDB->queryF($query,array('integer','integer'),array(\n\t\t\t0,\n\t\t\t$this->tree_id));\n\t\t$row = $ilDB->fetchObject($res);\n\t\t$this->root_id = $row->child;\n\t\treturn $this->root_id;\n\t}",
"function getChildNodes() ;",
"function loadObjTree($types=null,$dq=null){\n\t\t$obj_pool = $this->loadChild($types,$dq);\n\t\t$new_obj_pool=array();\n\t\tforeach($obj_pool as $obj){\n\t\t\t$new_obj_pool[$obj->id]=$this->add($obj);\n\t\t\t$sub_obj_pool = $obj->loadObjTree($types,$dq);\n\t\t\tif (is_array($sub_obj_pool)){\n\t\t\t\t$new_obj_pool = array_merge($new_obj_pool, $sub_obj_pool);\n\t\t\t}\n\t\t}\n\t\treturn $new_obj_pool;\n\t}",
"function getRootLevelFolder() ;",
"function getNodes() {\n\treturn db_query(\"SELECT nodename,ipaddress FROM Nodes\");\n}",
"public function getRoot(): self;",
"public function getRoot()\n {\n return $this->_root;\n }",
"function get_root($obj)\n{\n\t$root = $obj;\n\tif (is_array($root))\n\t{\n\t\t$root = $root[0];\n\t}\n\tif (isset($root->{'@graph'}))\n\t{\n\t\t$root = $root->{'@graph'};\n\t\n\t\tif (is_array($root))\n\t\t{\n\t\t\t$root = $root[0];\n\t\t}\n\t}\n\t\n\treturn $root;\n}",
"function fs_get_tree($dir_path) {\n #echo \"top of fs_get_tree, dir_path=$dir_path\\n\";\n { $old_cwd = getcwd();\n chdir($dir_path);\n #echo \" did chdir to '$dir_path'\\n\";\n\n {\n $fh = opendir('.');\n #echo \" opendir\\n\";\n\n $results = array();\n $n = 0;\n $dirs_to_crawl = array();\n while (true) {\n #echo \" loop\\n\";\n if ($n > 500) {\n #echo \"--- n > LIMIT (n=$n), break\\n\";\n break;\n }\n $n++;\n $file = readdir($fh);\n #echo \" file = '$file'\\n\";\n if (!$file) {\n break;\n }\n if ($file == '.'\n || $file == '..'\n || $file == '.git' #todo #fixme don't assume\n ) {\n #echo \"--- . or .., continuing\\n\";\n continue;\n }\n if (is_dir($file)) {\n #echo \"--- adding $file to dirs, n=$n\\n\";\n $dirs_to_crawl[] = $file;\n }\n $results[$file] = null;\n }\n closedir($fh);\n }\n\n #echo \"\\nnow looping thru dirs_to_crawl\\n\";\n foreach ($dirs_to_crawl as $dir) {\n #echo \" dir = $dir\\n\";\n $results[$dir] = fs_get_tree($dir);\n }\n\n chdir($old_cwd);\n }\n\n return $results;\n }",
"public function calc_tree()\n\t{\n\t\t$this->readTree(TRUE);\t\t\t// Make sure we have accurate data\n\t\tforeach ($this->class_parents as $cp)\n\t\t{\n\t\t\t$rights = array();\n\t\t\t$this->rebuild_tree($cp,$rights);\t\t// increasing rights going down the tree\n\t\t}\n\t}",
"function getCollectionTree(){\n\t\t\n\t\t/* Fetch collection tree from Flickr */\n\t\t$collectionTree = $this->askFlickr('collections.getTree','user_id='.$this->user);\n\t\t\n\t\t/* Ask Flickr For User Collections */\n\t\treturn $collectionTree;\n\t}",
"protected function _getTree()\n\t{\n\t\tif (self::$_deviceAtlasTree === NULL) {\n\n\t\t\t/**\n\t\t\t * caching . . . ?\n\t\t\t */\n\t\t\t$cache = $this->_getCache();\n\t\t\tif ($cache) {\n\t\t\t $cacheId = L8M_Cache::getCacheId('L8M_Mobile_Detector_Mobi', array($this->_options['resource']['file']));\n\t\t\t if (!$tree = $cache->load($cacheId)) {\n\t\t $tree = Mobi_Mtld_DA_Api::getTreeFromFile($this->_options['resource']['path'] . $this->_options['resource']['file']);\n\t\t $cache->save($tree);\n\t\t }\n\t\t } else {\n\t\t $tree = Mobi_Mtld_DA_Api::getTreeFromFile($this->_options['resource']['path'] . $this->_options['resource']['file']);\n\t\t }\n\n\t\t self::$_deviceAtlasTree = $tree;\n\t\t}\n\n\t\treturn self::$_deviceAtlasTree;\n\t}",
"public function getSubtreeInfo($a_endnode_id)\n\t{\n\t\tglobal $ilDB;\n\t\t\n\t\t$query = \"SELECT t2.lft lft, t2.rgt rgt, t2.child child, type \".\n\t\t\t\"FROM \".$this->getTree()->getTreeTable().\" t1 \".\n\t\t\t\"JOIN \".$this->getTree()->getTreeTable().\" t2 ON (t2.lft BETWEEN t1.lft AND t1.rgt) \".\n\t\t\t\"JOIN \".$this->getTree()->getTableReference().\" obr ON t2.child = obr.ref_id \".\n\t\t\t\"JOIN \".$this->getTree()->getObjectDataTable().\" obd ON obr.obj_id = obd.obj_id \".\n\t\t\t\"WHERE t1.child = \".$ilDB->quote($a_endnode_id,'integer').\" \".\n\t\t\t\"AND t1.\".$this->getTree()->getTreePk().\" = \".$ilDB->quote($this->getTree()->getTreeId(),'integer').\" \".\n\t\t\t\"AND t2.\".$this->getTree()->getTreePk().\" = \".$ilDB->quote($this->getTree()->getTreeId(),'integer').\" \".\n\t\t\t\"ORDER BY t2.lft\";\n\t\t\n\t\t $GLOBALS['ilLog']->write(__METHOD__.': '.$query);\n\t\t\n\t\t\t\n\t\t$res = $ilDB->query($query);\n\t\t$nodes = array();\n\t\twhile($row = $res->fetchRow(DB_FETCHMODE_OBJECT))\n\t\t{\n\t\t\t$nodes[$row->child]['lft']\t= $row->lft;\n\t\t\t$nodes[$row->child]['rgt']\t= $row->rgt;\n\t\t\t$nodes[$row->child]['child']= $row->child;\n\t\t\t$nodes[$row->child]['type']\t= $row->type;\n\t\t\t\n\t\t}\n\t\treturn (array) $nodes;\n\t}",
"public function tree() {\n return $this->children()->with(['user', 'children.user', 'children.children.user', 'children.children.children.user', 'children.children.children.children.user'])->get();\n }",
"function folderTree($args)\n {\n if(!array_key_exists('id', $args))\n {\n throw new Exception('Parameter id is not defined', MIDAS_INVALID_PARAMETER);\n }\n\n $id = $args['id'];\n $folder = $this->Folder->load($id);\n\n $userDao = $this->_getUser($args);\n $folders = $this->Folder->getAllChildren($folder, $userDao);\n\n $tree = array();\n $folderTree = array();\n\n foreach($folders as $folder)\n {\n $mainnode = $folder->toArray();\n\n if($folder->getParentId() != -1)\n {\n if(isset($folderTree[$folder->getParentId()]))\n {\n $mainnode['depth'] = $folderTree[$folder->getParentId()]['depth'] + 1;\n }\n else\n {\n $mainnode['depth'] = 1;\n }\n }\n // Cut the name to fit in the tree\n $maxsize = 24 - ($mainnode['depth'] * 2.5);\n if(strlen($mainnode['name']) > $maxsize)\n {\n $mainnode['name'] = substr($mainnode['name'], 0, $maxsize).'...';\n }\n $folderTree[$folder->getKey()] = $mainnode;\n if($folder->getParentId() == -1)\n {\n $tree[] = &$folderTree[$folder->getKey()];\n }\n else\n {\n $tree[$folder->getParentId()][] = &$folderTree[$folder->getKey()];\n }\n }\n return $tree;\n }",
"protected function initTree()\n {\n Table9Peer::doDeleteAll();\n $ret = array();\n // shuffling the results so the db order is not the natural one\n $fixtures = array(\n 't2' => array(2, 3, 1),\n 't5' => array(7, 12, 2),\n 't4' => array(5, 6, 2),\n 't7' => array(10, 11, 3),\n 't1' => array(1, 14, 0),\n 't6' => array(8, 9, 3),\n 't3' => array(4, 13, 1),\n );\n /* in correct order, this is:\n 't1' => array(1, 14, 0),\n 't2' => array(2, 3, 1),\n 't3' => array(4, 13, 1),\n 't4' => array(5, 6, 2),\n 't5' => array(7, 12, 2),\n 't6' => array(8, 9, 3),\n 't7' => array(10, 11, 3),\n */\n foreach ($fixtures as $key => $data) {\n $t = new PublicTable9();\n $t->setTitle($key);\n $t->setLeftValue($data[0]);\n $t->setRightValue($data[1]);\n $t->setLevel($data[2]);\n $t->save();\n $ret[$key]= $t;\n }\n // reordering the results in the fixtures\n ksort($ret);\n\n return array_values($ret);\n }",
"public function remoteRoots(){ return $this->APICall( 'remoteRoots', \"Failed to get the remote Roots for \" . $this->description() ); }",
"public function get_all(): array\n {\n return $this->nodes;\n }",
"protected function _getTree(){\n\t\tif (!$this->_tree) {\n\t\t\t$this->_tree = Mage::getResourceModel('megamenu2/menuitem_tree')->load();\n\t\t}\n\t\treturn $this->_tree;\n\t}",
"private function getLastNodes() {\n $last_five_nodes = array();\n if (\\Drupal::moduleHandler()->moduleExists('node')) {\n $result = db_select('node_field_data', 'n')\n ->fields('n', array('title', 'type', 'nid', 'created', 'langcode'))\n ->condition('n.created', REQUEST_TIME - 3600, '>')\n ->orderBy('n.created', 'DESC')\n ->range(0, 15)\n ->execute();\n\n $count = 0;\n foreach ($result as $record) {\n $last_five_nodes[$count]['url'] = \\Drupal::service('path.alias_manager')\n ->getAliasByPath('/node/' . $record->nid, $record->langcode);\n $last_five_nodes[$count]['title'] = $record->title;\n $last_five_nodes[$count]['type'] = $record->type;\n $last_five_nodes[$count]['created'] = $record->created;\n $count++;\n }\n }\n\n return $last_five_nodes;\n }",
"function ext_tree($parent_id, $con, $lev, $info) {\n\n // rows selection from TBSM tables\n $sel = \"SELECT SERVICEINSTANCEID, SERVICEINSTANCENAME, DISPLAYNAME, SERVICESLANAME, TIMEWINDOWNAME\n\t\t\t\tFROM TBSMBASE.SERVICEINSTANCE, TBSMBASE.SERVICEINSTANCERELATIONSHIP\n\t\t\t\tWHERE PARENTINSTANCEKEY = '$parent_id' AND SERVICEINSTANCEID = CHILDINSTANCEKEY\";\n $stmt = db2_prepare($con, $sel);\n $result = db2_execute($stmt);\n\n $values = 0;\n while ($row = db2_fetch_assoc($stmt)) {\n $values++;\n $info[$lev] = array (\n 'level' => $lev,\n 'endpoint' => false,\n 'id' => $row['SERVICEINSTANCEID'],\n 'service' => $row['SERVICEINSTANCENAME'],\n 'display' => $row['DISPLAYNAME'],\n 'template' => $row['SERVICESLANAME'],\n 'maintenance' => $row['TIMEWINDOWNAME'],\n );\n // unique value\n if (!in_array($row['SERVICEINSTANCEID'], array_column($GLOBALS['results'], 'id')))\n $GLOBALS['results'][] = $info[count($info)-1];\n\n // recursive function call\n ext_tree($row['SERVICEINSTANCEID'], $con, $lev+1, $info);\n }\n\n return ($values > 0);\n}",
"public function getTreeLefts() {\n return $this->treeLefts;\n }",
"public function getTree() {\n return $this->_buildBranch($this->root_category_id);\n }",
"public function getRoot()\n {\n return $this->active->geContext()->getCurrentSiteNode();\n }",
"function print_tree(tree $t, $with_id=false) {\n // $root = tree_to_treenode($t);\n print_treenode($t, null, 0, $with_id);\n}"
] | [
"0.61228055",
"0.60985446",
"0.5971322",
"0.5956617",
"0.5847108",
"0.5809036",
"0.57998794",
"0.57472044",
"0.57398665",
"0.5735058",
"0.5735058",
"0.56853783",
"0.566373",
"0.56478137",
"0.56040275",
"0.55566037",
"0.55566037",
"0.55566037",
"0.5555087",
"0.55022925",
"0.5458156",
"0.54562443",
"0.54514796",
"0.5450284",
"0.5446952",
"0.5442494",
"0.54250807",
"0.54172415",
"0.54168135",
"0.541537",
"0.54091936",
"0.54058874",
"0.5405686",
"0.5403473",
"0.538776",
"0.5372817",
"0.53396314",
"0.5330998",
"0.5329812",
"0.53230655",
"0.5315014",
"0.5306674",
"0.529366",
"0.52787083",
"0.5277696",
"0.5259292",
"0.5259292",
"0.5250337",
"0.5248387",
"0.523508",
"0.52311707",
"0.520972",
"0.52080333",
"0.5203594",
"0.5189373",
"0.5186019",
"0.51481277",
"0.51478183",
"0.513977",
"0.5131631",
"0.51298094",
"0.51298094",
"0.51298094",
"0.51298094",
"0.51298094",
"0.51298094",
"0.51280034",
"0.51249623",
"0.51113003",
"0.50970197",
"0.5068573",
"0.5067371",
"0.5066426",
"0.5063834",
"0.5062679",
"0.5060218",
"0.50584304",
"0.50556487",
"0.5042119",
"0.50370836",
"0.50191456",
"0.5007973",
"0.5006422",
"0.5004342",
"0.5002016",
"0.5001321",
"0.49986443",
"0.4982461",
"0.49809098",
"0.49494478",
"0.49442866",
"0.49369952",
"0.49275333",
"0.4922836",
"0.49197218",
"0.49166837",
"0.49161518",
"0.4910995",
"0.49059448",
"0.48986822"
] | 0.53283477 | 39 |
given a local ino, retrieve corresponding tree node | private function ino_to_local_entry(int $ino) {
// 1. find parent_id (uuid of fs_inode_entry) from parent_ino.
$local_inode = @$this->ino_inodes_local[$ino];
if(!$local_inode) {
throw new Exception("ino not found: $ino");
}
return $local_inode;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function ino_to_tree_id(int $ino) {\n $entry = $this->ino_to_local_entry($ino);\n return $entry->tree_id;\n }",
"function getNodeId($nodeName)\n {\n $query = \"SELECT id FROM target WHERE name='$nodeName'\";\n // echo \"---- NODE QUEry=<$query>. DB=$this->dbName\\n\";\n $nodeInfo = $this->getColumns($query, $this->dbName);\n $currentNodeId = -1;\n if (0 != count($nodeInfo))\n {\n $currentNodeId = $nodeInfo[0]; \n }\n return $currentNodeId;\n }",
"function get_node( $val, $col = 'lft' )\n\t{\n\t\t$node_data = array(\n\t\t\t'node_id' => '',\n\t\t\t'lft' => 0,\n\t\t\t'rgt' => 0,\n\t\t\t'parent' => '',\n\t\t\t'moved' => '',\n\t\t\t'label' => '',\n\t\t\t'entry_id' => '',\n\t\t\t'template_path' => '',\n\t\t\t'custom_url' => '',\n\t\t\t'type' => array(),\n\t\t\t'field_data' => '',\n\t\t\t'depth' => ''\n\t\t);\n\n\t\t$query = ee()->db->get_where( \n\t\t\t$this->tree_table, \n\t\t\tarray($col => $val), \n\t\t\t1 \n\t\t);\n\t\treturn $query->num_rows() ? $query->row_array() : $node_data;\n\t}",
"public function read(int $file_ino, int $fh) {\n $r = $this->replica;\n\n // 1. find inode_id from file_ino.\n $inode_id = $this->ino_to_tree_id($file_ino);\n\n $tree_node = $this->tree_find($inode_id);\n \n return $tree_node->meta->content;\n }",
"public function getTreeId() {}",
"public function lookup(string $path): int {\n // step 1. Find tree node under /root matching path.\n $parts = explode('/', $path);\n $root = $this->root();\n list($node_id, $node) = $root;\n\n if($path == '/') {\n list($node_id, $node) = $root;\n } else {\n if($parts[0] == \"\") {\n array_shift($parts);\n }\n foreach($parts as $name) {\n $result = $this->child_by_name($node_id, $name, false);\n if( $result ) {\n list($node_id, $node) = $result;\n } else {\n return 0;\n }\n }\n }\n\n // step 2. Find node local inode data matching $node_id\n $tn = $this->uuid_inodes_local[$node_id];\n if(!$tn) {\n // note: in a real impl, we would allocate the inode here,\n // and de-allocate in forget() when ref-count drops to zero.\n\n throw new Exception(\"Filesystem out of sync! local inode entry not found!\");\n }\n\n // increment ref count\n $tn->ref_count ++;\n\n return $tn->ino;\n }",
"private function add_fs_inode_local($tree_id, string $kind) {\n // 1. Create fs_inode_local\n $local = new fs_inode_local();\n $local->ino = ++$this->ino_counter;\n $local->tree_id = $tree_id;\n $local->ref_count = 1;\n $local->links = 1;\n $local->is_file = $kind == inode_kind::file;\n\n // 2. Add uuid --> &fs_inode_local index\n $this->uuid_inodes_local[$local->tree_id] = &$local;\n\n // 3. Add ino --> &fs_inode_local_index\n $this->ino_inodes_local[$local->ino] = &$local;\n\n return $local->ino;\n }",
"private function tree_find(int $node_id) {\n $node = $this->replica->state->tree->find($node_id);\n if(!$node) {\n throw new Exception(\"Missing entry for $node_id\");\n }\n return $node;\n }",
"function find_node($tb_no){\n\t//global $conn;\n\tglobal $wise_table;\n\tfor($i=0;$i<count($wise_table);$i++){\n\t\tif($wise_table[$i]->tb_no==$tb_no) return $wise_table[$i]; // found\n\t}\n\treturn null; // not found\t\n}",
"function _getParent($treeid) {\n $res = $this->CLASS['db']->query(sprintf(\"SELECT belongs_to FROM tree WHERE id=%d\",$treeid));\n $anz = $this->CLASS['db']->num_rows($res);\n\n if($anz == 1) {\n $row = $this->CLASS['db']->fetch_assoc($res);\n return $row['belongs_to'];\n } else {\n return 0;\n }\n }",
"function getNode($nodeId){\n global $mysqli;\n $sql = \"SELECT id, lat, lon FROM osm_nodes\n WHERE id = $nodeId\n LIMIT 1\";\n $result = $mysqli->query($sql);\n while($result && $row = $result->fetch_assoc()){\n $n = $row;\n }\n return $n ?? null;\n}",
"function GetNodeForPosition( $spr, $level, $lang_id=NULL )\n {\n $db = DBs::getInstance();\n if( empty($lang_id) ) $lang_id = $this->lang_id;\n $q = \"SELECT `node` FROM `\".$spr.\"` WHERE `cod`='\".$level.\"'\";\n if( !empty($lang_id) ) $q = $q.\" AND `lang_id`='\".$lang_id.\"'\";\n $q = $q.\" GROUP BY `cod`\";\n $res = $db->db_Query( $q );\n// echo '<br> $q='.$q.' $res='.$res.' $db->result='.$db->result;\n if( !$res OR !$db->result )return 0;\n $rows = $db->db_GetNumRows();\n if($rows == 0) return 0;\n $row = $db->db_FetchAssoc();\n return ($row['node']+1);\n }",
"function fiftyone_degrees_get_nodes_root_node($node_offset, $headers) {\n $node = fiftyone_degrees_read_node($node_offset, $headers);\n if ($node['parent_offset'] >= 0) {\n return fiftyone_degrees_get_nodes_root_node($node['parent_offset'], $headers);\n }\n else {\n return $node;\n }\n}",
"public function getNodeFromStack() {}",
"function tdc_find_filenode($database, $file_name){\n $file = $database->xpath('//file[@name=\"'.$file_name.'\"]');\n if($file != False){\n return $file[0];\n }\n}",
"function find_node($tree, $key='', $val='')\n {\n if(isset($tree[$key]) && $tree[$key] == $val)\n {\n \tif(isset($tree['children']))\n \t{\n \t\tunset($tree['children']);\n \t}\n \t$this->cache['temp_node'] = $tree;\n }\n else\n {\n if(isset($tree['children']))\n {\n foreach($tree['children'] as $child)\n {\n $this->find_node($child, $key, $val);\n } \n }\n }\n \n }",
"public function get_node_path($nid) {\n return \\Drupal::service('path_alias.manager')->getAliasByPath('/node/' . $nid);\n }",
"public static function lookupFirstTreeOfNode($a_server_id, $a_mid, $cms_id)\n\t{\n\t\tglobal $ilDB;\n\n\t\t$query = 'SELECT tree_id FROM ecs_cms_data '.\n\t\t\t'WHERE server_id = '.$ilDB->quote($a_server_id,'integer').' '.\n\t\t\t'AND mid = '.$ilDB->quote($a_mid,'integer').' '.\n\t\t\t'AND cms_id = '.$ilDB->quote($cms_id,'integer'). ' '.\n\t\t\t'ORDER BY tree_id ';\n\t\t$res = $ilDB->query($query);\n\t\t\n\t\twhile($row = $res->fetchRow(DB_FETCHMODE_OBJECT))\n\t\t{\n\t\t\treturn $row->tree_id;\n\t\t}\n\t\treturn 0;\n\t}",
"public function getElement($in)\n {\n if (is_array($in)) {\n return $in;\n }\n\n $in = $this->_convertName($in);\n\n return isset($this->_tree[$in])\n ? $this->_tree[$in]\n : null;\n }",
"function getNodeData($a_node_id, $a_tree_pk = null)\n\t// END PATCH WebDAV: Pass tree id to this method\n\t{\n\t\tglobal $ilDB;\n\t\t\n\t\tif (!isset($a_node_id))\n\t\t{\n\t\t\t$GLOBALS['ilLog']->logStack();\n\t\t\t$this->ilErr->raiseError(get_class($this).\"::getNodeData(): No node_id given! \",$this->ilErr->WARNING);\n\t\t}\n\t\tif($this->__isMainTree())\n\t\t{\n\t\t\tif($a_node_id < 1)\n\t\t\t{\n\t\t\t\t$message = sprintf('%s::getNodeData(): No valid parameter given! $a_node_id: %s',\n\t\t\t\t\t\t\t\t get_class($this),\n\t\t\t\t\t\t\t\t $a_node_id);\n\n\t\t\t\t$this->log->write($message,$this->log->FATAL);\n\t\t\t\t$this->ilErr->raiseError($message,$this->ilErr->WARNING);\n\t\t\t}\n\t\t}\n\n\t\t// BEGIN WebDAV: Pass tree id to this method\n\t\t$query = 'SELECT * FROM '.$this->table_tree.' '.\n\t\t\t$this->buildJoin().\n\t\t\t'WHERE '.$this->table_tree.'.child = %s '.\n\t\t\t'AND '.$this->table_tree.'.'.$this->tree_pk.' = %s ';\n\t\t$res = $ilDB->queryF($query,array('integer','integer'),array(\n\t\t\t$a_node_id,\n\t\t\t$a_tree_pk === null ? $this->tree_id : $a_tree_pk));\n\t\t// END WebDAV: Pass tree id to this method\n\t\t$row = $ilDB->fetchAssoc($res);\n\t\t$row[$this->tree_pk] = $this->tree_id;\n\n\t\treturn $this->fetchNodeData($row);\n\t}",
"public function linkToNode($link) {\n // Find the link target.\n $target = readlink($this->nodePath($link, true));\n // Return the node name the last part of the path of the node.\n $node_name = array_slice(explode('/', $target), -1)[0];\n return $node_name;\n }",
"function readRootId()\n\t{\n\t\tglobal $ilDB;\n\t\t\n\t\t$query = 'SELECT child FROM '.$this->table_tree.' '.\n\t\t\t'WHERE parent = %s '.\n\t\t\t'AND '.$this->tree_pk.' = %s ';\n\t\t$res = $ilDB->queryF($query,array('integer','integer'),array(\n\t\t\t0,\n\t\t\t$this->tree_id));\n\t\t$row = $ilDB->fetchObject($res);\n\t\t$this->root_id = $row->child;\n\t\treturn $this->root_id;\n\t}",
"public function link(int $target_ino, int $parent_ino, string $name): int {\n\n $r = $this->replica;\n $ops = [];\n\n // 1. find parent_id (uuid of fs_inode_entry) from parent_ino.\n $parent_id = $this->ino_to_tree_id($parent_ino);\n\n // 2. find target id.\n $target_local_inode = $this->ino_to_local_entry($target_ino);\n $target_id = $target_local_inode->tree_id;\n\n // 5. create tree entry under /root/../parent_id\n $frm = new fs_ref_meta();\n $frm->name = $name;\n $frm->inode_id = $target_id;\n $ops[] = new op_move($r->tick(), $parent_id, $frm, new_id() );\n\n $r->apply_ops($ops);\n\n // 6. increment links count\n $target_local_inode->links ++;\n\n return $target_ino;\n }",
"public static function getNodeById($id){\n\t\treturn FfNodeQuery::create()->findOneById($id);\n\t}",
"public function node()\n\t{\n\t\t$registry = Jquarry_Registry::instance();\n\t\t\n\t\treturn $registry->get_node($this->node_id());\n\t}",
"public function getToNode(): int {\n return $this->toNode;\n }",
"protected function getNodeObject($obj){\n // Get node object, node revisions are not the same as nodes and are not passed as objects.\n // the above error was causing the original build function to display a warning message.\n if (is_scalar($obj)) {\n // if node is a string then its the nid not the actual node.\n return Node::load($obj);\n }\n\n return $obj;\n }",
"public function getLeagueNode(string $nodename)\n {\n $bag = $this->getOrCreateLeagueBag();\n\n return $bag->getLeagueNode($nodename);\n }",
"public function findNodeFromCurrentPath() {\r\n $path = \\Drupal::request()->getRequestUri();\r\n $path_data = explode('/', $path);\r\n\r\n if ($this->currentPathIsValidPrintVariantPath()) {\r\n // By this point, we should be on a PPI Print variant path.\r\n $node_path = '/node/' . $path_data[2];\r\n\r\n return $this->findNodeFromPath($node_path);\r\n }\r\n return NULL;\r\n }",
"function tdc_get_filepath($filenode){\n return $filenode->path[0];\n}",
"public function getNodeId();",
"function get_parent(tree $tree, $child_id):? tree_node {\n return @$tree->find($child_id);\n}",
"public function getFromNode(): int {\n return $this->fromNode;\n }",
"public function getLeagueNode(string $nodename)\n {\n return $this->getChild($nodename);\n }",
"public function getNodeFromUrl() {\n\n $path = $this->getCurrentPath();\n $system_path = drupal_lookup_path('source', $path);\n if (!$system_path) {\n $system_path = $path;\n }\n $menu_item = menu_get_item($system_path);\n if ($menu_item['path'] == 'node/%') {\n $node = node_load($menu_item['original_map'][1]);\n }\n else {\n throw \\Exception(sprintf(\"Node could not be loaded from URL '%s'\", $path));\n }\n return $node;\n }",
"public function getTree($idEntry = 0);",
"public function lookupNode($filename)\n {\n if (! isset($this->_toc)) {\n $up_to_date = _up_to_date($this->LastEdited, $this->DevhelpFile);\n $lifetime = $up_to_date ? 3600 : -1;\n $this->_toc = $this->cacheToFile('getTOC', $lifetime, $this->DevhelpFile);\n }\n return @$this->_toc[$filename];\n }",
"public function getTreePk()\n\t{\n\t\treturn $this->tree_pk;\n\t}",
"public function getTeamNode(string $nodename)\n {\n return $this->getChild($nodename);\n }",
"function GetCurrentPageNodeID()\r\n{\r\n\tmytrace(\"GetCurrentPageNodeID\");\r\n\t\r\n\t// strip the q=\r\n\t$sCurrentPagePath = GetCurrentPagePath(); // i.e. about/news/press-releases\r\n\tmytrace(\"current path = $sCurrentPagePath\");\r\n\t\r\n\t/*\r\n\t$nPos = strrpos($sPHPSelf,\"/\");\r\n\tif ($nPos===false)\r\n\t{\r\n\t\tmytrace(\"unable to determine current page name\");\r\n\t\treturn \"\";\r\n\t}\r\n\t\r\n\t$sCurrentPage = substr($sPHPSelf,$nPos+1);\r\n\tmytrace(\"Page following last forward slash = $sCurrentPage\");\r\n\t\r\n\t// if we have the node at this point, return. \r\n\t// Otherwise we have an alias so lookup the node\r\n\tif (is_int($sCurrentPage)) \r\n\t{\r\n\t\tmytrace(\"page is node based: node = $sCurrentPage\");\r\n\t\treturn \"node/\" . $sCurrentPage; // returns node/21\r\n\t}\r\n\t*/\r\n\t\r\n\t// make lower case\r\n\t$sCurrentPagePath = strtolower($sCurrentPagePath);\r\n\t\r\n\t// mfindlay 7/1/10 strip &debug=0 or &debug=1 if present, as these are debug strings\r\n\t$sCurrentPagePath = StripDebugQS($sCurrentPagePath);\r\n\tmytrace(\"adjusted path = $sCurrentPagePath\");\r\n\t\r\n\t// is the current path a node/21 type path (admin failed to use url aliasing, so just return the node)\r\n\tif (strpos($sCurrentPagePath,\"node\")===0)\r\n\t{\r\n\t\t// node based \r\n\t\tmytrace(\"returning node based current page: $sCurrentPagePath\");\r\n\t\treturn $sCurrentPagePath; \r\n\t}\r\n\t\r\n\t// read from the url_alias table to fetch the NODE for this alias\r\n\t$sSQL = \"SELECT * FROM url_alias WHERE dst='\" . $sCurrentPagePath . \"'\";\r\n\tmytrace($sSQL);\r\n\t\r\n\t$result = db_query($sSQL);\r\n\t\r\n\t// load each returned row into the return array\r\n\tif ($arg = db_fetch_array($result))\r\n\t{\r\n\t\t$sCurrentNode = $arg['src'];\t\r\n\t\tmytrace(\"page is alias based: src = $sCurrentNode\");\r\n\t\treturn $sCurrentNode; // returns node/21 address\r\n\t} \r\n\t\r\n\tmytrace(\"Returning empty string\");\r\n\treturn \"\";\r\n}",
"function getNodeId($from_lat, $from_lon, $transport){\n // find the closest node_id to ($from_lat, $from_lon) on a way\n global $mysqli;\n $offset = 0.01;\n switch ($transport){\n case \"foot\":\n $sql = \"SELECT id, (lat-{$from_lat})*(lat-{$from_lat}) + (lon - {$from_lon})*(lon - {$from_lon}) AS x FROM osm_road_nodes\n WHERE lat < $from_lat+$offset AND lat > $from_lat-$offset\n AND lon < $from_lon+$offset AND lon > $from_lon-$offset\n ORDER BY x ASC LIMIT 1\";\n break;\n case \"bicycle\":\n $sql = \"SELECT id, (lat-{$from_lat})*(lat-{$from_lat}) + (lon - {$from_lon})*(lon - {$from_lon}) AS x FROM osm_road_nodes\n WHERE lat < $from_lat+$offset AND lat > $from_lat-$offset\n AND lon < $from_lon+$offset AND lon > $from_lon-$offset\n ORDER BY x ASC LIMIT 1\";\n break;\n case \"car\":\n $sql = \"SELECT id, (lat-{$from_lat})*(lat-{$from_lat}) + (lon - {$from_lon})*(lon - {$from_lon}) AS x FROM osm_road_nodes\n WHERE lat < $from_lat+$offset AND lat > $from_lat-$offset\n AND lon < $from_lon+$offset AND lon > $from_lon-$offset\n ORDER BY x ASC LIMIT 1\";\n break;\n }\n $arr = array();\n $result = $mysqli->query($sql);\n while($result && $row = $result->fetch_assoc()){\n $arr[] = $row;\n }\n return (int) $arr[0]['id'];\n}",
"public function getTreeNode(string $nodename)\n {\n $children = $this->getChildren();\n\n return $children->get($nodename);\n }",
"public function readdir(int $ino_dir, int $fh, int $offset): ?array {\n $r = $this->replica;\n\n // 1. find directory tree ID, given ino\n $parent_id = $this->ino_to_tree_id($ino_dir);\n\n // 2. find child matching offset.\n $children = $r->state->tree->children($parent_id);\n $child_id = @$children[$offset];\n if(!$child_id) {\n return null;\n }\n\n $tree_node = $this->tree_find($child_id);\n $m = $tree_node->meta;\n $inode_id = property_exists($m, 'inode_id') ? $m->inode_id : $child_id;\n $local_entry = $this->uuid_inodes_local[$inode_id];\n return ['name' => $m->name, 'ino' => $local_entry->ino];\n }",
"protected static function FKToNode($fk) {\r\n $parts = explode('_', $fk);\r\n if (count($parts) > 1) array_pop($parts);\r\n return join('_', $parts);\r\n }",
"public function getLeaf($uniqueKey);",
"public function getNode(): int {\n return $this->node;\n }",
"public function getTreeSource();",
"public function getImportableNode(): Node;",
"public function getNodeForPath($path) {\n\n $path = trim($path,'/');\n\n //if (!$path || $path=='.') return $this->rootNode;\n $currentNode = $this->rootNode;\n $i=0;\n // We're splitting up the path variable into folder/subfolder components and traverse to the correct node.. \n foreach(explode('/',$path) as $pathPart) {\n\n // If this part of the path is just a dot, it actually means we can skip it\n if ($pathPart=='.' || $pathPart=='') continue;\n\n // try { \n $currentNode = $currentNode->getChild($pathPart); \n // } catch (Sabre_DAV_FileNotFoundException $e) { \n // throw new Sabre_DAV_FileNotFoundException('we could not find : ' . $path);\n // }\n\n }\n\n return $currentNode;\n\n }",
"function objFldHeiarchRoot($dbh, $idfld, $parentfld, $tbl, $curid)\r\n{\r\n\t$ret = $curid;\r\n\r\n\tif ($curid)\r\n\t{\r\n\t\t$result = $dbh->Query(\"select $parentfld from $tbl where $idfld='$curid'\");\r\n\t\tif ($dbh->GetNumberRows($result))\r\n\t\t{\r\n\t\t\t$val = $dbh->GetValue($result, 0, $parentfld);\r\n\t\t\tif ($val)\r\n\t\t\t{\r\n\t\t\t\t$ret = objFldHeiarchRoot($dbh, $idfld, $parentfld, $tbl, $val);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\treturn $ret;\r\n}",
"protected function _getNode(mixed $id): EntityInterface\n {\n $config = $this->getConfig();\n [$parent, $left, $right] = [$config['parent'], $config['left'], $config['right']];\n $primaryKey = $this->_getPrimaryKey();\n $fields = [$parent, $left, $right];\n if ($config['level']) {\n $fields[] = $config['level'];\n }\n\n $node = $this->_scope($this->_table->find())\n ->select($fields)\n ->where([$this->_table->aliasField($primaryKey) => $id])\n ->first();\n\n if (!$node) {\n throw new RecordNotFoundException(sprintf('Node `%s` was not found in the tree.', $id));\n }\n\n return $node;\n }",
"private function get_parent($id)\n\t\t{\n\t\t\t$query = \"\tSELECT\n\t\t\t\t\t\t\t`MTN`.`parent` AS 'parent'\n\t\t\t\t\t\tFROM \n\t\t\t\t\t\t\t`\".$this->tree_node.\"` `MTN`\n\t\t\t\t\t\tWHERE 1 = 1\n\t\t\t\t\t\t\tAND `MTN`.`application_release`\t= '\".$this->application_release.\"'\n\t\t\t\t\t\t\tAND `MTN`.`id`\t\t= \".$id.\"\n\t\t\t\t\t\";\n\t\t\t$result = $this->link_mt->query($query);\n\t\t\t$row = $result->fetch_array(MYSQLI_ASSOC);\t\n\t\t\treturn $row['parent'];\t\t\n\t\t}",
"public function getNavnodeById($navnodeId)\n\t{\n\t if (!isset($this->_navnodesById) || !array_key_exists($navnodeId, $this->_navnodesById)) {\n\t $navnodeRecord = NavigationBuilder_NavnodeRecord::model()->findById($navnodeId);\n\n\t if ($navnodeRecord) {\n\t $this->_navnodesById[$navnodeId] = NavigationBuilder_NavnodeModel::populateModel($navnodeRecord);\n\t } else {\n\t $this->_navnodesById[$navnodeId] = null;\n\t }\n\t }\n\t return $this->_navnodesById[$navnodeId];\n\t}",
"function getTree (array $array, $index = '')\n{\n echo '45144654654';\n}",
"private function _getDirectoryInsertionPoint($new)\n {\n $keys = array_keys($this->_subdirectories);\n array_push($keys, $new);\n usort($keys, array($this, '_fileOrder'));\n $pos = array_search($new, $keys);\n if ($pos < count($this->_subdirectories)) {\n return $this->_subdirectories[$keys[$pos + 1]]->getDirectory()->getDirectoryNode();\n } else {\n if (empty($this->_files)) {\n return null;\n } else {\n $keys = array_keys($this->_files);\n usort($keys, array($this, '_fileOrder'));\n return $this->_files[$keys[0]]->getFileNode();\n }\n }\n }",
"function fiftyone_degrees_get_node_index($node, $index, $headers) {\n $offset = $node['node_indexs_offset'] + ($index * (1 + 4 + 4));\n $_fiftyone_degrees_data_file = fiftyone_degrees_get_data_file($offset);\n\n return array(\n 'is_string' =>\n fiftyone_degrees_read_bool($_fiftyone_degrees_data_file),\n 'value' =>\n fiftyone_degrees_read_int($_fiftyone_degrees_data_file),\n 'related_node_index' =>\n fiftyone_degrees_read_int($_fiftyone_degrees_data_file),\n );\n}",
"function getParentTableRowId($nodeId)\n {\n $query = \"SELECT id, node_id FROM target_parent WHERE node_id=$nodeId\";\n $targetParentNodeInfo = $this->getColumns($query, $this->dbName);\n $targetParentRowId = -1;\n if (0 != count($targetParentNodeInfo))\n {\n $targetParentRowId = $targetParentNodeInfo[0]; \n }\n return $targetParentRowId;\n }",
"public function getNode()\n {\n return FileSystem::getInstance()->stat($this->statpath);\n }",
"private function musGetNodeId(){\n }",
"public function getLeafId ()\r\n\t{\r\n\t\treturn $this->leafId;\r\n\t}",
"function fiftyone_degrees_read_node($offset, $headers) {\n global $nodes_checked;\n $nodes_checked++;\n $_fiftyone_degrees_cache = fiftyone_degrees_get_from_cache('node:' . $offset);\n if ($_fiftyone_degrees_cache !== FALSE) {\n return $_fiftyone_degrees_cache;\n }\n\n $_fiftyone_degrees_data_file\n = fiftyone_degrees_get_data_file($headers['node_offset'] + $offset);\n\n $node = array();\n $node['offset'] = $offset;\n $node['position']\n = fiftyone_degrees_read_short($_fiftyone_degrees_data_file);\n $node['next_char_position']\n = fiftyone_degrees_read_short($_fiftyone_degrees_data_file);\n $node['is_complete'] = $node['next_char_position'] != -32768;\n $node['parent_offset']\n = fiftyone_degrees_read_int($_fiftyone_degrees_data_file);\n $node['character_offset'] = fiftyone_degrees_read_int($_fiftyone_degrees_data_file);\n $node['node_index_count']\n = fiftyone_degrees_read_short($_fiftyone_degrees_data_file);\n $node['numeric_children_count']\n = fiftyone_degrees_read_short($_fiftyone_degrees_data_file);\n $node['node_ranked_signature_count']\n = fiftyone_degrees_read_int($_fiftyone_degrees_data_file);\n\n $node['node_indexs_offset'] = ftell($_fiftyone_degrees_data_file);\n $node['node_numeric_children_offset']\n = $node['node_indexs_offset']\n + ($node['node_index_count'] * (1 + 4 + 4));\n\n $node['node_ranked_signature_offset']\n = $node['node_numeric_children_offset']\n + ($node['numeric_children_count'] * (2 + 4));\n\n fiftyone_degrees_save_to_cache('node:' . $offset, $node);\n return $node;\n}",
"public function get_current_nid(){\n\t\treturn $this->current_nid;\n\t}",
"private function get_rel_id($to_big) {\n\n\t\t$stm = $this->db()->prepare(\n\t\t\t'select \"id\"\n\t\t\tfrom \"member_rels\"\n\t\t\twhere (\"member1_big\" = :from_big and \"member2_big\" = :to_big)\n\t\t\t\tor (\"member2_big\" = :from_big and \"member1_big\" = :to_big)\n\t\t\tlimit 1'\n\t\t);\n\t\t$stm->execute(array(\n\t\t\t':from_big'\t=> $this->member_big,\n\t\t\t':to_big'\t=> $to_big,\n\t\t));\n\t\t$rel_id = $stm->fetch(PDO::FETCH_ASSOC);\n\t\treturn $rel_id['id'];\n\n\t}",
"private function getNode($key)\n {\n /* @var $e Node */\n if ($key === null) {\n throw new NullPointerException();\n }\n if (!is_int($key) && !is_string($key)) {\n throw new ClassCastException('keys must be integers or strings');\n }\n \n if ($this->size == 0) {\n return null;\n }\n \n $first = $this->first;\n if ($first->getKey() === $key) {\n return $first;\n }\n if (($e = $first->next) != null) {\n do {\n if ($e->getKey() === $key) {\n return $e;\n }\n } while (($e = $e->next) != null);\n }\n return null;\n }",
"public function GetParentAddress($token);",
"private function _ftok($project)\r\n\t{\r\n\t\tif (function_exists('ftok'))\r\n\t\t{\r\n\t\t\treturn ftok(__FILE__, $project);\r\n\t\t}\r\n\r\n\t\t$s = stat(__FILE__);\r\n\t\treturn sprintf(\"%u\", (($s['ino'] & 0xffff) | (($s['dev'] & 0xff) << 16) | (($project & 0xff) << 24)));\r\n\t}",
"public function getNodeForPath($path) {\n\n\t\t$path = trim($path, '/');\n\t\tif (isset($this->cache[$path])) return $this->cache[$path];\n\n\t\t// Is it the root node?\n\t\tif (!strlen($path)) {\n\t\t\treturn $this->rootNode;\n\t\t}\n\n\t\t$info = Filesystem::getFileInfo($path);\n\n\t\tif (!$info) {\n\t\t\tthrow new \\Sabre_DAV_Exception_NotFound('File with name ' . $path . ' could not be located');\n\t\t}\n\n\t\tif ($info['mimetype'] == 'httpd/unix-directory') {\n\t\t\t$node = new \\OC_Connector_Sabre_Directory($path);\n\t\t} else {\n\t\t\t$node = new \\OC_Connector_Sabre_File($path);\n\t\t}\n\n\t\t$node->setFileinfoCache($info);\n\n\t\t$this->cache[$path] = $node;\n\t\treturn $node;\n\n\t}",
"public function getNode()\n {\n return parent::getNode();\n }",
"function fiftyone_degrees_get_numeric_node_index($node, $index, $headers) {\n $_fiftyone_degrees_data_file = fiftyone_degrees_get_data_file(\n $node['node_numeric_children_offset']\n + ($index * (2 + 4)));\n\n return array(\n 'value' => fiftyone_degrees_read_short($_fiftyone_degrees_data_file),\n 'related_node_index' => fiftyone_degrees_read_int($_fiftyone_degrees_data_file),\n );\n}",
"function getParentId($a_node_id)\n\t{\n\t\tglobal $ilDB;\n\t\t\n\t\tif (!isset($a_node_id))\n\t\t{\n\t\t\t$this->ilErr->raiseError(get_class($this).\"::getParentId(): No node_id given! \",$this->ilErr->WARNING);\n\t\t}\n\n\t\t$query = 'SELECT parent FROM '.$this->table_tree.' '.\n\t\t\t'WHERE child = %s '.\n\t\t\t'AND '.$this->tree_pk.' = %s ';\n\t\t$res = $ilDB->queryF($query,array('integer','integer'),array(\n\t\t\t$a_node_id,\n\t\t\t$this->tree_id));\n\n\t\t$row = $ilDB->fetchObject($res);\n\t\treturn $row->parent;\n\t}",
"public function symlink(string $link, int $parent_ino, string $name): int {\n\n $r = $this->replica;\n $ops = [];\n\n // 1. find parent_id (uuid of fs_inode_entry) from parent_ino.\n $parent_id = $this->ino_to_tree_id($parent_ino);\n\n // 2. find parent dir (under /root/)\n $inode_entry = $this->tree_find($parent_id);\n\n // 3. create tree node under /root/../parent_id\n $fim = new fs_inode_meta($name, inode_kind::symlink);\n $fim->link = $link; // we are setting a non-existent property, gross! but in PHP we can roll like that.\n $ops[] = new op_move($r->tick(), $parent_id, $fim, $new_inode_id = new_id() );\n\n // 4. create/add fs_inode_local\n $ino = $this->add_fs_inode_local($new_inode_id, $fim->kind);\n\n $r->apply_ops($ops);\n\n return $ino;\n }",
"public function nodeLow();",
"function find($child_id): ?tree_node {\n return @$this->triples[$child_id];\n }",
"public function getNodeId()\n\t{\n\t\treturn $this->_node_id;\n\t}",
"public function findTree($id, $locale);",
"public function getTargetNodeId() {\n if(!$this->isTargetInternal())\n return 0;\n \n $c = $this->cutTarget();\n return intval($c['nodeId']);\n }",
"public function getParentNode() {}",
"function get_tree($selected)\n\t{\n\t\trequire_code('zones3');\n\t\t$tree=nice_get_zones($selected);\n\t\treturn $tree;\n\t}",
"public function getInstanceOf(Model $parent, string $type): Node;",
"public function getLeafNative() {\r\n\t\treturn $this->leafNative;\r\n\t}",
"function getActualNode(){\n\t\treturn $this->anode;\n\t}",
"function getLeftValue($a_node_id)\n\t{\n\t\tglobal $ilDB;\n\t\t\n\t\tif (!isset($a_node_id))\n\t\t{\n\t\t\t$this->ilErr->raiseError(get_class($this).\"::getLeftValued(): No node_id given! \",$this->ilErr->WARNING);\n\t\t}\n\n\t\t$query = 'SELECT lft FROM '.$this->table_tree.' '.\n\t\t\t'WHERE child = %s '.\n\t\t\t'AND '.$this->tree_pk.' = %s ';\n\t\t$res = $ilDB->queryF($query,array('integer','integer'),array(\n\t\t\t$a_node_id,\n\t\t\t$this->tree_id));\n\t\t$row = $ilDB->fetchObject($res);\n\t\treturn $row->lft;\n\t}",
"function node(&$model, $ref = null, $fullPath = true, $create = null) {\n\t\tif(is_numeric($ref)){\n\t\t\t$ref = $this->myNodeRef($model, $ref);\n\t\t}\n\t\tif(!empty($ref[$model->alias]['id'])){\n\t\t\t$ref = $this->myNodeRef($model, $ref[$model->alias]['id']);\n\t\t}\n\t\tif (empty($ref)) {\n\t\t\tif(is_null($create)){\n\t\t\t\t$create = true;\n\t\t\t}\n\t\t\t$ref = $model->myNodeRef(null,false,!$create);\n\t\t}\n\t\t$node = $model->Node->getNode($ref,$fullPath);\n\t\tif(empty($node) && $create){\n\t\t\t$ref = $model->updateNode(false,$ref);\n\t\t\tif($ref){\n\t\t\t\t$node = $model->Node->getNode($ref,$fullPath);\n\t\t\t}\n\t\t}\n\t\treturn $node;\n\t}",
"function find_ID($fn, $node){\n\t$nodes = node_set($fn);\n\t$queue = array();\n\t$protein = array();\n\t$index = find_index($nodes, $node);\n\tarray_push($queue, trim($nodes[$index][0]));\n\twhile( count($queue) > 0 ){\n\t\t$temp = array_shift($queue);\n\t\t$index = find_index($nodes, $temp);\n\t\tif($nodes[$index][1][0] == \"N\")\n\t\t\tarray_push($queue, trim($nodes[$index][1]));\n\t\telse array_push($protein, trim($nodes[$index][1]));\n\t\tif($nodes[$index][2][0] == \"N\")\n\t\t\tarray_push($queue, trim($nodes[$index][2]));\n\t\telse array_push($protein, trim($nodes[$index][2]));\n\t}\n\treturn str_replace(\" \", \"\", implode(\",\", id_match($fn, $protein)));\n}",
"function getValNode(){\n\t\t$clase=$this->nmclass;\n\t\t$node=$this->anode;\n\t\t$valor=$this->nodos[$clase][$node];\n\n\t\tif($valor!=''){\n\t\t\treturn $valor;\n\t\t}\n\t\telse{\n\t\t\treturn -1;\n\t\t}\n\t}",
"function fetchSuccessorNode($a_node_id, $a_type = \"\")\n\t{\n\t\tglobal $ilDB;\n\t\t\n\t\tif (!isset($a_node_id))\n\t\t{\n\t\t\t$this->ilErr->raiseError(get_class($this).\"::getNodeData(): No node_id given! \",$this->ilErr->WARNING);\n\t\t}\n\n\t\t// get lft value for current node\n\t\t$query = 'SELECT lft FROM '.$this->table_tree.' '.\n\t\t\t'WHERE '.$this->table_tree.'.child = %s '.\n\t\t\t'AND '.$this->table_tree.'.'.$this->tree_pk.' = %s ';\n\t\t$res = $ilDB->queryF($query,array('integer','integer'),array(\n\t\t\t$a_node_id,\n\t\t\t$this->tree_id));\n\t\t$curr_node = $ilDB->fetchAssoc($res);\n\t\t\n\t\tif($a_type)\n\t\t{\n\t\t\t$query = 'SELECT * FROM '.$this->table_tree.' '.\n\t\t\t\t$this->buildJoin().\n\t\t\t\t'WHERE lft > %s '.\n\t\t\t\t'AND '.$this->table_obj_data.'.type = %s '.\n\t\t\t\t'AND '.$this->table_tree.'.'.$this->tree_pk.' = %s '.\n\t\t\t\t'ORDER BY lft ';\n\t\t\t$ilDB->setLimit(1);\n\t\t\t$res = $ilDB->queryF($query,array('integer','text','integer'),array(\n\t\t\t\t$curr_node['lft'],\n\t\t\t\t$a_type,\n\t\t\t\t$this->tree_id));\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$query = 'SELECT * FROM '.$this->table_tree.' '.\n\t\t\t\t$this->buildJoin().\n\t\t\t\t'WHERE lft > %s '.\n\t\t\t\t'AND '.$this->table_tree.'.'.$this->tree_pk.' = %s '.\n\t\t\t\t'ORDER BY lft ';\n\t\t\t$ilDB->setLimit(1);\n\t\t\t$res = $ilDB->queryF($query,array('integer','integer'),array(\n\t\t\t\t$curr_node['lft'],\n\t\t\t\t$this->tree_id));\n\t\t}\n\n\t\tif ($res->numRows() < 1)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$row = $ilDB->fetchAssoc($res);\n\t\t\treturn $this->fetchNodeData($row);\n\t\t}\n\t}",
"function tdc_get_filename($filenode){\n return $filenode['name'];\n}",
"public function getNodeKey()\n\t{\n\t\treturn $this->_node_key;\n\t}",
"function getMainNode(){\n\t\treturn $this->nodeppal;\n\t}",
"function getParent();",
"function & get_node($id, $add_sql = array())\r\n\t{\r\n\t\t$sql = sprintf('SELECT %s %s FROM %s %s WHERE %s.id=%s %s',\r\n\t\t\t\t\t\t\t\t\t\t$this->_get_select_fields(), \n\t\t\t\t\t\t\t\t\t\t$this->_add_sql($add_sql, 'columns'),\r\n\t\t\t\t\t\t\t\t\t\t$this->_node_table, \n\t\t\t\t\t\t\t\t\t\t$this->_add_sql($add_sql, 'join'),\r\n\t\t\t\t\t\t\t\t\t\t$this->_node_table, $id,\r\n\t\t\t\t\t\t\t\t\t\t$this->_add_sql($add_sql, 'append')\n\t\t\t\t\t\t\t\t\t);\r\n\r\n\t\t$node_set =& $this->_get_result_set($sql);\r\n\r\n\t\treturn current($node_set);\r\n\t}",
"public function getNodeId()\n {\n return $this->nodeId;\n }",
"public function getLeafId() {\r\n\t\treturn $this->leafId;\r\n\t}",
"protected static function getNode() {\r\n if (!$namespace = static::getNamespace()) {\r\n return static::$node;\r\n }\r\n return camelTo_(substr(get_called_class(), strlen($namespace) + 1));\r\n }",
"function getdirections_location_n2u_path($fromnid, $touid) {\n if (module_exists('location') && is_numeric($fromnid) && is_numeric($touid)) {\n return \"getdirections/location_u2n/$fromnid/$touid\";\n }\n}",
"private function getNode($node)\n {\n $token = $this->getToken();\n\n if ($token) {\n return $this->node->getToken($token);\n }\n\n return;\n }",
"function getNextNode($data)\n\t{\t\t\n\t\treturn $this->find('first', array(\n\t\t\t\t\t'conditions'\t=> array($this->name . '.lft > ' . $data[$this->name]['lft']),\n\t\t\t\t\t'order'\t\t\t=> $this->name . '.lft'));\t\t\t\t\t\t\t \t\t\t\t\t\n\t}",
"private function getNode(): NodeInterface {\n $config = $this->getConfiguration();\n return $config['node'];\n }",
"public function get_node() {\n return \\Drupal::routeMatch()->getParameter('node');\n }",
"function tidy_get_root(tidy $object) {}"
] | [
"0.7302514",
"0.5531075",
"0.552558",
"0.55157244",
"0.5511183",
"0.547065",
"0.54450077",
"0.54309994",
"0.5356697",
"0.53114605",
"0.52773046",
"0.5181475",
"0.5146064",
"0.51040626",
"0.5104014",
"0.50495464",
"0.50153023",
"0.50130045",
"0.49976793",
"0.49939358",
"0.49903995",
"0.49810877",
"0.49478558",
"0.49017513",
"0.4900804",
"0.4898279",
"0.4896641",
"0.48925355",
"0.48906648",
"0.48868728",
"0.48815185",
"0.4879122",
"0.48715594",
"0.4870904",
"0.48701048",
"0.48673847",
"0.48551142",
"0.4838967",
"0.4837281",
"0.4824404",
"0.48079485",
"0.48009214",
"0.4781485",
"0.4751212",
"0.47493318",
"0.47485226",
"0.4744462",
"0.47080752",
"0.47046164",
"0.47036818",
"0.47009072",
"0.4698983",
"0.469598",
"0.46874288",
"0.4669028",
"0.46685773",
"0.4663604",
"0.46587592",
"0.46573988",
"0.46496955",
"0.46495047",
"0.46487445",
"0.46204072",
"0.4619201",
"0.46152574",
"0.4611006",
"0.46084383",
"0.46073672",
"0.4606749",
"0.46058846",
"0.45956585",
"0.45936504",
"0.45893478",
"0.45883074",
"0.45787373",
"0.45730326",
"0.4570539",
"0.45658836",
"0.45643994",
"0.45626557",
"0.45618653",
"0.45498747",
"0.4545233",
"0.4543311",
"0.45423865",
"0.4528592",
"0.45284072",
"0.45240584",
"0.4520709",
"0.45108593",
"0.45097423",
"0.45087636",
"0.45030162",
"0.45007572",
"0.45006645",
"0.44997537",
"0.4494701",
"0.449452",
"0.44818377",
"0.44765586"
] | 0.70427513 | 1 |
given a local ino, retrieve corresponding tree node ID | private function ino_to_tree_id(int $ino) {
$entry = $this->ino_to_local_entry($ino);
return $entry->tree_id;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function ino_to_local_entry(int $ino) {\n // 1. find parent_id (uuid of fs_inode_entry) from parent_ino.\n $local_inode = @$this->ino_inodes_local[$ino];\n if(!$local_inode) {\n throw new Exception(\"ino not found: $ino\");\n }\n return $local_inode;\n }",
"public function getTreeId() {}",
"function getNodeId($nodeName)\n {\n $query = \"SELECT id FROM target WHERE name='$nodeName'\";\n // echo \"---- NODE QUEry=<$query>. DB=$this->dbName\\n\";\n $nodeInfo = $this->getColumns($query, $this->dbName);\n $currentNodeId = -1;\n if (0 != count($nodeInfo))\n {\n $currentNodeId = $nodeInfo[0]; \n }\n return $currentNodeId;\n }",
"private function add_fs_inode_local($tree_id, string $kind) {\n // 1. Create fs_inode_local\n $local = new fs_inode_local();\n $local->ino = ++$this->ino_counter;\n $local->tree_id = $tree_id;\n $local->ref_count = 1;\n $local->links = 1;\n $local->is_file = $kind == inode_kind::file;\n\n // 2. Add uuid --> &fs_inode_local index\n $this->uuid_inodes_local[$local->tree_id] = &$local;\n\n // 3. Add ino --> &fs_inode_local_index\n $this->ino_inodes_local[$local->ino] = &$local;\n\n return $local->ino;\n }",
"function readRootId()\n\t{\n\t\tglobal $ilDB;\n\t\t\n\t\t$query = 'SELECT child FROM '.$this->table_tree.' '.\n\t\t\t'WHERE parent = %s '.\n\t\t\t'AND '.$this->tree_pk.' = %s ';\n\t\t$res = $ilDB->queryF($query,array('integer','integer'),array(\n\t\t\t0,\n\t\t\t$this->tree_id));\n\t\t$row = $ilDB->fetchObject($res);\n\t\t$this->root_id = $row->child;\n\t\treturn $this->root_id;\n\t}",
"public function lookup(string $path): int {\n // step 1. Find tree node under /root matching path.\n $parts = explode('/', $path);\n $root = $this->root();\n list($node_id, $node) = $root;\n\n if($path == '/') {\n list($node_id, $node) = $root;\n } else {\n if($parts[0] == \"\") {\n array_shift($parts);\n }\n foreach($parts as $name) {\n $result = $this->child_by_name($node_id, $name, false);\n if( $result ) {\n list($node_id, $node) = $result;\n } else {\n return 0;\n }\n }\n }\n\n // step 2. Find node local inode data matching $node_id\n $tn = $this->uuid_inodes_local[$node_id];\n if(!$tn) {\n // note: in a real impl, we would allocate the inode here,\n // and de-allocate in forget() when ref-count drops to zero.\n\n throw new Exception(\"Filesystem out of sync! local inode entry not found!\");\n }\n\n // increment ref count\n $tn->ref_count ++;\n\n return $tn->ino;\n }",
"public function getNodeId();",
"public function getNodeId()\n\t{\n\t\treturn $this->_node_id;\n\t}",
"public function getLeafId ()\r\n\t{\r\n\t\treturn $this->leafId;\r\n\t}",
"private function musGetNodeId(){\n }",
"public function getTreePk()\n\t{\n\t\treturn $this->tree_pk;\n\t}",
"function getNodeId($from_lat, $from_lon, $transport){\n // find the closest node_id to ($from_lat, $from_lon) on a way\n global $mysqli;\n $offset = 0.01;\n switch ($transport){\n case \"foot\":\n $sql = \"SELECT id, (lat-{$from_lat})*(lat-{$from_lat}) + (lon - {$from_lon})*(lon - {$from_lon}) AS x FROM osm_road_nodes\n WHERE lat < $from_lat+$offset AND lat > $from_lat-$offset\n AND lon < $from_lon+$offset AND lon > $from_lon-$offset\n ORDER BY x ASC LIMIT 1\";\n break;\n case \"bicycle\":\n $sql = \"SELECT id, (lat-{$from_lat})*(lat-{$from_lat}) + (lon - {$from_lon})*(lon - {$from_lon}) AS x FROM osm_road_nodes\n WHERE lat < $from_lat+$offset AND lat > $from_lat-$offset\n AND lon < $from_lon+$offset AND lon > $from_lon-$offset\n ORDER BY x ASC LIMIT 1\";\n break;\n case \"car\":\n $sql = \"SELECT id, (lat-{$from_lat})*(lat-{$from_lat}) + (lon - {$from_lon})*(lon - {$from_lon}) AS x FROM osm_road_nodes\n WHERE lat < $from_lat+$offset AND lat > $from_lat-$offset\n AND lon < $from_lon+$offset AND lon > $from_lon-$offset\n ORDER BY x ASC LIMIT 1\";\n break;\n }\n $arr = array();\n $result = $mysqli->query($sql);\n while($result && $row = $result->fetch_assoc()){\n $arr[] = $row;\n }\n return (int) $arr[0]['id'];\n}",
"function find_ID($fn, $node){\n\t$nodes = node_set($fn);\n\t$queue = array();\n\t$protein = array();\n\t$index = find_index($nodes, $node);\n\tarray_push($queue, trim($nodes[$index][0]));\n\twhile( count($queue) > 0 ){\n\t\t$temp = array_shift($queue);\n\t\t$index = find_index($nodes, $temp);\n\t\tif($nodes[$index][1][0] == \"N\")\n\t\t\tarray_push($queue, trim($nodes[$index][1]));\n\t\telse array_push($protein, trim($nodes[$index][1]));\n\t\tif($nodes[$index][2][0] == \"N\")\n\t\t\tarray_push($queue, trim($nodes[$index][2]));\n\t\telse array_push($protein, trim($nodes[$index][2]));\n\t}\n\treturn str_replace(\" \", \"\", implode(\",\", id_match($fn, $protein)));\n}",
"public function getTargetNodeId() {\n if(!$this->isTargetInternal())\n return 0;\n \n $c = $this->cutTarget();\n return intval($c['nodeId']);\n }",
"public function getLeafId() {\r\n\t\treturn $this->leafId;\r\n\t}",
"private function get_rel_id($to_big) {\n\n\t\t$stm = $this->db()->prepare(\n\t\t\t'select \"id\"\n\t\t\tfrom \"member_rels\"\n\t\t\twhere (\"member1_big\" = :from_big and \"member2_big\" = :to_big)\n\t\t\t\tor (\"member2_big\" = :from_big and \"member1_big\" = :to_big)\n\t\t\tlimit 1'\n\t\t);\n\t\t$stm->execute(array(\n\t\t\t':from_big'\t=> $this->member_big,\n\t\t\t':to_big'\t=> $to_big,\n\t\t));\n\t\t$rel_id = $stm->fetch(PDO::FETCH_ASSOC);\n\t\treturn $rel_id['id'];\n\n\t}",
"public function getNodeId()\n {\n return $this->nodeId;\n }",
"public function getNodeID() : string\n {\n return $this->nodeID;\n }",
"public function get_current_nid(){\n\t\treturn $this->current_nid;\n\t}",
"function _getParent($treeid) {\n $res = $this->CLASS['db']->query(sprintf(\"SELECT belongs_to FROM tree WHERE id=%d\",$treeid));\n $anz = $this->CLASS['db']->num_rows($res);\n\n if($anz == 1) {\n $row = $this->CLASS['db']->fetch_assoc($res);\n return $row['belongs_to'];\n } else {\n return 0;\n }\n }",
"function getParentTableRowId($nodeId)\n {\n $query = \"SELECT id, node_id FROM target_parent WHERE node_id=$nodeId\";\n $targetParentNodeInfo = $this->getColumns($query, $this->dbName);\n $targetParentRowId = -1;\n if (0 != count($targetParentNodeInfo))\n {\n $targetParentRowId = $targetParentNodeInfo[0]; \n }\n return $targetParentRowId;\n }",
"function getElementId($a_node)\n\t{\n\t\t$node = (array) $a_node;\n\t\treturn $node[0];\n\t}",
"public function link(int $target_ino, int $parent_ino, string $name): int {\n\n $r = $this->replica;\n $ops = [];\n\n // 1. find parent_id (uuid of fs_inode_entry) from parent_ino.\n $parent_id = $this->ino_to_tree_id($parent_ino);\n\n // 2. find target id.\n $target_local_inode = $this->ino_to_local_entry($target_ino);\n $target_id = $target_local_inode->tree_id;\n\n // 5. create tree entry under /root/../parent_id\n $frm = new fs_ref_meta();\n $frm->name = $name;\n $frm->inode_id = $target_id;\n $ops[] = new op_move($r->tick(), $parent_id, $frm, new_id() );\n\n $r->apply_ops($ops);\n\n // 6. increment links count\n $target_local_inode->links ++;\n\n return $target_ino;\n }",
"public function get_node_path($nid) {\n return \\Drupal::service('path_alias.manager')->getAliasByPath('/node/' . $nid);\n }",
"function GetCurrentPageNodeID()\r\n{\r\n\tmytrace(\"GetCurrentPageNodeID\");\r\n\t\r\n\t// strip the q=\r\n\t$sCurrentPagePath = GetCurrentPagePath(); // i.e. about/news/press-releases\r\n\tmytrace(\"current path = $sCurrentPagePath\");\r\n\t\r\n\t/*\r\n\t$nPos = strrpos($sPHPSelf,\"/\");\r\n\tif ($nPos===false)\r\n\t{\r\n\t\tmytrace(\"unable to determine current page name\");\r\n\t\treturn \"\";\r\n\t}\r\n\t\r\n\t$sCurrentPage = substr($sPHPSelf,$nPos+1);\r\n\tmytrace(\"Page following last forward slash = $sCurrentPage\");\r\n\t\r\n\t// if we have the node at this point, return. \r\n\t// Otherwise we have an alias so lookup the node\r\n\tif (is_int($sCurrentPage)) \r\n\t{\r\n\t\tmytrace(\"page is node based: node = $sCurrentPage\");\r\n\t\treturn \"node/\" . $sCurrentPage; // returns node/21\r\n\t}\r\n\t*/\r\n\t\r\n\t// make lower case\r\n\t$sCurrentPagePath = strtolower($sCurrentPagePath);\r\n\t\r\n\t// mfindlay 7/1/10 strip &debug=0 or &debug=1 if present, as these are debug strings\r\n\t$sCurrentPagePath = StripDebugQS($sCurrentPagePath);\r\n\tmytrace(\"adjusted path = $sCurrentPagePath\");\r\n\t\r\n\t// is the current path a node/21 type path (admin failed to use url aliasing, so just return the node)\r\n\tif (strpos($sCurrentPagePath,\"node\")===0)\r\n\t{\r\n\t\t// node based \r\n\t\tmytrace(\"returning node based current page: $sCurrentPagePath\");\r\n\t\treturn $sCurrentPagePath; \r\n\t}\r\n\t\r\n\t// read from the url_alias table to fetch the NODE for this alias\r\n\t$sSQL = \"SELECT * FROM url_alias WHERE dst='\" . $sCurrentPagePath . \"'\";\r\n\tmytrace($sSQL);\r\n\t\r\n\t$result = db_query($sSQL);\r\n\t\r\n\t// load each returned row into the return array\r\n\tif ($arg = db_fetch_array($result))\r\n\t{\r\n\t\t$sCurrentNode = $arg['src'];\t\r\n\t\tmytrace(\"page is alias based: src = $sCurrentNode\");\r\n\t\treturn $sCurrentNode; // returns node/21 address\r\n\t} \r\n\t\r\n\tmytrace(\"Returning empty string\");\r\n\treturn \"\";\r\n}",
"function get_nodes_id($db, $modul_id) {\n $nodes_id = array();\n \n $result = $db->prepare('SELECT node_id, id_original FROM node WHERE modul_id = :modul_id');\n $params = array(':modul_id' => $modul_id);\n if(!$result->execute($params)) { exit(\"db9 chyba\"); }\n \n while($node = $result->fetch(PDO::FETCH_ASSOC)) {\n $nodes_id[$node['id_original']] = $node['node_id'];\n }\n \n return $nodes_id;\n}",
"public function getLeafIdTemp() {\r\n\t\treturn $this->leafIdTemp;\r\n\t}",
"public function read(int $file_ino, int $fh) {\n $r = $this->replica;\n\n // 1. find inode_id from file_ino.\n $inode_id = $this->ino_to_tree_id($file_ino);\n\n $tree_node = $this->tree_find($inode_id);\n \n return $tree_node->meta->content;\n }",
"public function getMainUserIdNode(){\n return $this->datasourceGUIDNode->getId();\n }",
"public function getTreeNodeFolderId(): int\n {\n return $this->treeNodeFolderId;\n }",
"public function getNode(): int {\n return $this->node;\n }",
"public function symlink(string $link, int $parent_ino, string $name): int {\n\n $r = $this->replica;\n $ops = [];\n\n // 1. find parent_id (uuid of fs_inode_entry) from parent_ino.\n $parent_id = $this->ino_to_tree_id($parent_ino);\n\n // 2. find parent dir (under /root/)\n $inode_entry = $this->tree_find($parent_id);\n\n // 3. create tree node under /root/../parent_id\n $fim = new fs_inode_meta($name, inode_kind::symlink);\n $fim->link = $link; // we are setting a non-existent property, gross! but in PHP we can roll like that.\n $ops[] = new op_move($r->tick(), $parent_id, $fim, $new_inode_id = new_id() );\n\n // 4. create/add fs_inode_local\n $ino = $this->add_fs_inode_local($new_inode_id, $fim->kind);\n\n $r->apply_ops($ops);\n\n return $ino;\n }",
"public function nodeId($with_ns=true) {\t\t\n\t\t$i = explode(':', $this->host, 3);\n\t\t$i = (count($i) > 1 ) ? $i[1] : $i[0];\n\t\t$i=explode('.',$i);\n\t\t$p = array_reverse($i);\n\t\t$id = implode('.', $p); \n\t\t$resultId = $with_ns ? self::ns().':'.$id :$id;\t\t\n\t\t\n\t\treturn $resultId;\t\t\n\t}",
"protected function getNodeId($node)\n {\n if (is_object($node) && method_exists($node, 'getKey')) {\n return $node->getKey();\n }\n\n return $node;\n }",
"function getParentId($a_node_id)\n\t{\n\t\tglobal $ilDB;\n\t\t\n\t\tif (!isset($a_node_id))\n\t\t{\n\t\t\t$this->ilErr->raiseError(get_class($this).\"::getParentId(): No node_id given! \",$this->ilErr->WARNING);\n\t\t}\n\n\t\t$query = 'SELECT parent FROM '.$this->table_tree.' '.\n\t\t\t'WHERE child = %s '.\n\t\t\t'AND '.$this->tree_pk.' = %s ';\n\t\t$res = $ilDB->queryF($query,array('integer','integer'),array(\n\t\t\t$a_node_id,\n\t\t\t$this->tree_id));\n\n\t\t$row = $ilDB->fetchObject($res);\n\t\treturn $row->parent;\n\t}",
"public static function lookupFirstTreeOfNode($a_server_id, $a_mid, $cms_id)\n\t{\n\t\tglobal $ilDB;\n\n\t\t$query = 'SELECT tree_id FROM ecs_cms_data '.\n\t\t\t'WHERE server_id = '.$ilDB->quote($a_server_id,'integer').' '.\n\t\t\t'AND mid = '.$ilDB->quote($a_mid,'integer').' '.\n\t\t\t'AND cms_id = '.$ilDB->quote($cms_id,'integer'). ' '.\n\t\t\t'ORDER BY tree_id ';\n\t\t$res = $ilDB->query($query);\n\t\t\n\t\twhile($row = $res->fetchRow(DB_FETCHMODE_OBJECT))\n\t\t{\n\t\t\treturn $row->tree_id;\n\t\t}\n\t\treturn 0;\n\t}",
"public function GetNavigationTreeId($sNaviName)\n {\n $query = \"SELECT `tree_node`\n FROM `cms_portal_navigation`\n WHERE `cms_portal_id` = '\".MySqlLegacySupport::getInstance()->real_escape_string($this->id).\"'\n AND `name` = '\".MySqlLegacySupport::getInstance()->real_escape_string($sNaviName).\"'\n \";\n $id = false;\n if ($tmp = MySqlLegacySupport::getInstance()->fetch_array(MySqlLegacySupport::getInstance()->query($query))) {\n $id = $tmp['tree_node'];\n }\n\n return $id;\n }",
"public function getNodeGuidField(string $resource) {\n return $this->config->get($resource . '.mappings.id');\n }",
"private function tree_find(int $node_id) {\n $node = $this->replica->state->tree->find($node_id);\n if(!$node) {\n throw new Exception(\"Missing entry for $node_id\");\n }\n return $node;\n }",
"public function getToNode(): int {\n return $this->toNode;\n }",
"public function getNid() {\n return $this->nid;\n }",
"public function getFromNode(): int {\n return $this->fromNode;\n }",
"function getNode($nodeId){\n global $mysqli;\n $sql = \"SELECT id, lat, lon FROM osm_nodes\n WHERE id = $nodeId\n LIMIT 1\";\n $result = $mysqli->query($sql);\n while($result && $row = $result->fetch_assoc()){\n $n = $row;\n }\n return $n ?? null;\n}",
"public function getParentId(): string;",
"function GetNodeForPosition( $spr, $level, $lang_id=NULL )\n {\n $db = DBs::getInstance();\n if( empty($lang_id) ) $lang_id = $this->lang_id;\n $q = \"SELECT `node` FROM `\".$spr.\"` WHERE `cod`='\".$level.\"'\";\n if( !empty($lang_id) ) $q = $q.\" AND `lang_id`='\".$lang_id.\"'\";\n $q = $q.\" GROUP BY `cod`\";\n $res = $db->db_Query( $q );\n// echo '<br> $q='.$q.' $res='.$res.' $db->result='.$db->result;\n if( !$res OR !$db->result )return 0;\n $rows = $db->db_GetNumRows();\n if($rows == 0) return 0;\n $row = $db->db_FetchAssoc();\n return ($row['node']+1);\n }",
"function getNodeData($a_node_id, $a_tree_pk = null)\n\t// END PATCH WebDAV: Pass tree id to this method\n\t{\n\t\tglobal $ilDB;\n\t\t\n\t\tif (!isset($a_node_id))\n\t\t{\n\t\t\t$GLOBALS['ilLog']->logStack();\n\t\t\t$this->ilErr->raiseError(get_class($this).\"::getNodeData(): No node_id given! \",$this->ilErr->WARNING);\n\t\t}\n\t\tif($this->__isMainTree())\n\t\t{\n\t\t\tif($a_node_id < 1)\n\t\t\t{\n\t\t\t\t$message = sprintf('%s::getNodeData(): No valid parameter given! $a_node_id: %s',\n\t\t\t\t\t\t\t\t get_class($this),\n\t\t\t\t\t\t\t\t $a_node_id);\n\n\t\t\t\t$this->log->write($message,$this->log->FATAL);\n\t\t\t\t$this->ilErr->raiseError($message,$this->ilErr->WARNING);\n\t\t\t}\n\t\t}\n\n\t\t// BEGIN WebDAV: Pass tree id to this method\n\t\t$query = 'SELECT * FROM '.$this->table_tree.' '.\n\t\t\t$this->buildJoin().\n\t\t\t'WHERE '.$this->table_tree.'.child = %s '.\n\t\t\t'AND '.$this->table_tree.'.'.$this->tree_pk.' = %s ';\n\t\t$res = $ilDB->queryF($query,array('integer','integer'),array(\n\t\t\t$a_node_id,\n\t\t\t$a_tree_pk === null ? $this->tree_id : $a_tree_pk));\n\t\t// END WebDAV: Pass tree id to this method\n\t\t$row = $ilDB->fetchAssoc($res);\n\t\t$row[$this->tree_pk] = $this->tree_id;\n\n\t\treturn $this->fetchNodeData($row);\n\t}",
"public function getNodeKey()\n\t{\n\t\treturn $this->_node_key;\n\t}",
"function localIdentifier()\n\t{\n\t\t$id = $this->identifier();\n\t\treturn substr($id,0, strpos($id, '::'));\n\t}",
"public function getRootId();",
"function get_id($liuid)\r\n\t{\r\n\t\t$this->db->select(\"uid\");\r\n\t\t$this->db->where('liuid', $liuid);\r\n\t\t$this->db->limit('1');\r\n\t\t$query = $this->db->get('users');\r\n\t\t$result = $query->result();\r\n\r\n\t\treturn $result[0]->uid;\r\n\t}",
"function ibm_uid ( $dn ) { return dn2uid($dn); }",
"public function get_uid($ip){\n\t\t$query = \"SELECT user_id FROM nodes WHERE user_ip = ?;\";\n\t\t\n\t\t$stmt = $this->prepare_statement($query);\n if(!$stmt)\n return NULL;\n\t\t$bind = $stmt->bind_param(\"s\", $ip);\n\t\tif(!$bind)\n\t\t\treturn NULL;\n\t\t\n\t\t$exec = $stmt->execute();\n\t\tif(!$exec)\n\t\t\treturn NULL;\n\n $stmt->store_result();\n\t\tif($stmt->num_rows == 0)\n\t\t\treturn NULL;\n\n\t\t$stmt->bind_result($uid);\n\t\t$stmt->fetch();\n\t\t\n\t\treturn $uid;\n\t}",
"public function getOID()\n {\n return $this->oID;\n }",
"function find_node($tb_no){\n\t//global $conn;\n\tglobal $wise_table;\n\tfor($i=0;$i<count($wise_table);$i++){\n\t\tif($wise_table[$i]->tb_no==$tb_no) return $wise_table[$i]; // found\n\t}\n\treturn null; // not found\t\n}",
"public function getCaretakerNodeId(){\n\t\t$instance = $this->getInstance();\n\t\treturn 'instance_'.$instance->getUid().'_test_'.$this->getUid();\n\t}",
"abstract public function getIdent();",
"private function _ftok($project)\r\n\t{\r\n\t\tif (function_exists('ftok'))\r\n\t\t{\r\n\t\t\treturn ftok(__FILE__, $project);\r\n\t\t}\r\n\r\n\t\t$s = stat(__FILE__);\r\n\t\treturn sprintf(\"%u\", (($s['ino'] & 0xffff) | (($s['dev'] & 0xff) << 16) | (($project & 0xff) << 24)));\r\n\t}",
"function _get_unique_id_for_node_field() {\n $arg = arg();\nif (!empty($_SESSION['node_preview_unique'])) {\n $reporter_id = $_SESSION['node_preview_unique'];\n }\n else {\n // format uniqueid time node add\n // format uniqueid time nodeid edit\n // So in future we can track from which opration this entry is made.\n \n $unique = 'preview_' . uniqid() . time() . \"_\" .$arg[1] . \"_\" .$arg[2];\n $_SESSION['node_preview_unique'] = $unique;\n $reporter_id = $_SESSION['node_preview_unique'];\n }\n return $reporter_id;\n}",
"protected function _getLoggedInMemberId() {\n\t\tController::loadModel('Member');\n\t\treturn $this->Member->getIdForMember($this->Auth->user());\n\t}",
"public function getParentIdValue(BaseObject $node)\n {\n $getter = self::forgeMethodName($node, 'get', 'parent');\n return $node->$getter();\n }",
"function __renumber($node_id = 1, $i = 1)\n\t{\n\t\tglobal $ilDB;\n\t\t\n\t\t$query = 'UPDATE '.$this->table_tree.' SET lft = %s WHERE child = %s';\n\t\t$res = $ilDB->manipulateF($query,array('integer','integer'),array(\n\t\t\t$i,\n\t\t\t$node_id));\n\n\t\t$childs = $this->getChilds($node_id);\n\n\t\tforeach ($childs as $child)\n\t\t{\n\t\t\t$i = $this->__renumber($child[\"child\"],$i+1);\n\t\t}\n\t\t$i++;\n\t\t\n\t\t// Insert a gap at the end of node, if the node has children\n\t\tif (count($childs) > 0)\n\t\t{\n\t\t\t$i += $this->gap * 2;\n\t\t}\n\t\t\n\t\t\n\t\t$query = 'UPDATE '.$this->table_tree.' SET rgt = %s WHERE child = %s';\n\t\t$res = $ilDB->manipulateF($query,array('integer','integer'),array(\n\t\t\t$i,\n\t\t\t$node_id));\n\t\treturn $i;\n\t}",
"public function GetPortalPageId()\n {\n $oHomeNode = new TCMSTreeNode();\n /** @var $oHomeNode TCMSTreeNode */\n $oHomeNode->LoadWithCaching($this->sqlData['home_node_id']);\n\n return $oHomeNode->GetLinkedPage();\n }",
"public function getLid()\n {\n $value = $this->get(self::LID);\n return $value === null ? (integer)$value : $value;\n }",
"public function getuid($idin=null) {\r\n\t\tif (!is_null($idin)) {\r\n\t\t\tif (is_string($idin)) {\r\n\t\t\t\t$field = ($this->validEmail($idin)) ? 'email' : 'username';\r\n\t\t\t\t$user = $this->db\r\n\t\t\t\t\t->select('user_id')\r\n\t\t\t\t\t->where($field, $idin)\r\n\t\t\t\t\t->get($this->user_table)\r\n\t\t\t\t\t->row();\r\n\t\t\t\treturn (isset($user->user_id)) ? $user->user_id : false;\r\n\t\t\t} elseif (is_int($idin)) {\r\n\t\t\t\treturn $idin;\r\n\t\t\t} else {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t$user_info = $this->decode_session_value(\r\n\t\t\t\t$this->session->userdata($this->sess_login_key)\r\n\t\t\t);\r\n\t\t\tif (is_array($user_info)) {\r\n\t\t\t\treturn ($user_info[0]);\r\n\t\t\t} else {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"function get_alt_par_id($pri_id){\n\t\t$this->db->where('parentPrimary_uacc_id',$pri_id);\n\t\t$this->db->select('parentAlt_uacc_id',$pri_id);\n\t\t\n\t\t$qres=$this->db->get(TWELL_FAM_PROF_TBL);\n\t\tif ($qres->num_rows()==1) {\n\t\t\t$row=$qres->row();\n\t\t\treturn ($row->parentAlt_uacc_id);\n\t\t}else{\n\t\t\t$this->firephp->log(\"Could not retrieve alt_parent user id\");\n\t\t\treturn 0;\n\t\t}\n\t}",
"private function get_tcase_id_by_name($name, $parent_id)\r\n {\r\n $debugMsg='Class:' .__CLASS__ . ' - Method:' . __FUNCTION__ . ' :: ';\r\n \r\n if ($parent_id == null || $parent_id <= 0)\r\n {\r\n $msg = $debugMsg . ' FATAL Error $parentNodeID can not null and <= 0';\r\n throw new Exception($msg);\r\n }\r\n \r\n \r\n $sql = \"/* {$debugMsg} */ \" .\r\n \" SELECT NHA.id FROM \" . $this->db_handler->get_table('nodes_hierarchy') . \" NHA \" .\r\n \" WHERE NHA.node_type_id = 3 \" .\r\n \" AND NHA.name = '\" . $this->db_handler->prepare_string($name) . \"'\" .\r\n \" AND NHA.parent_id = \" . $this->db_handler->prepare_int($parent_id);\r\n \r\n $rs = $this->db_handler->get_recordset($sql);\r\n if (count($rs, COUNT_NORMAL) > 0 && isset($rs[0]['id']) && $rs[0]['id'] > 0)\r\n {\r\n return $rs[0]['id'];\r\n }\r\n else\r\n {\r\n return 0;\r\n }\r\n }",
"public function getRootId()\n {\n return $this\n ->findRoot()\n ->id;\n }",
"function fiftyone_degrees_get_numeric_node_index($node, $index, $headers) {\n $_fiftyone_degrees_data_file = fiftyone_degrees_get_data_file(\n $node['node_numeric_children_offset']\n + ($index * (2 + 4)));\n\n return array(\n 'value' => fiftyone_degrees_read_short($_fiftyone_degrees_data_file),\n 'related_node_index' => fiftyone_degrees_read_int($_fiftyone_degrees_data_file),\n );\n}",
"function getPid() ;",
"static function retrieveOwnerID($pid)\n\t{\n $db = JFactory::getDbo();\n $query = $db->getQuery(true);\n $query->select('agent_id')->from('#__osrs_properties')->where('id = \"'.$pid.'\"');\n $db->setQuery($query);\n return $db->loadResult();\n }",
"function getRealId($entry) {\n if(null==$entry)\n return null;\n if (isset($entry[\"changeForID\"])) {\n return $entry[\"changeForID\"];\n } else {\n if (isset($entry[\"id\"])) {\n return $entry[\"id\"];\n }\n }\n return null;\n}",
"function tdc_get_filepath($filenode){\n return $filenode->path[0];\n}",
"public function getLocalIdentifier()\n {\n if (array_key_exists(\"localIdentifier\", $this->_propDict)) {\n if (is_a($this->_propDict[\"localIdentifier\"], \"\\Beta\\Microsoft\\Graph\\Model\\VpnLocalIdentifier\") || is_null($this->_propDict[\"localIdentifier\"])) {\n return $this->_propDict[\"localIdentifier\"];\n } else {\n $this->_propDict[\"localIdentifier\"] = new VpnLocalIdentifier($this->_propDict[\"localIdentifier\"]);\n return $this->_propDict[\"localIdentifier\"];\n }\n }\n return null;\n }",
"public function grn_id(){\n return parent::get_fk_object(\"grn_id\");\n }",
"private function get_id_info($id)\n\t\t{\n\t\t\t$query = \"\tSELECT\n\t\t\t\t\t\t\t`MTN`.`parent` AS 'parent',\n\t\t\t\t\t\t\t`MTN`.`order` AS 'order',\n\t\t\t\t\t\t\t`MTN`.`mark` AS 'mark' \n\t\t\t\t\t\tFROM \n\t\t\t\t\t\t\t`\".$this->tree_node.\"` `MTN`\n\t\t\t\t\t\tWHERE 1 = 1\n\t\t\t\t\t\t\tAND `MTN`.`application_release`\t= '\".$this->application_release.\"'\n\t\t\t\t\t\t\tAND `MTN`.`id`\t\t= \".$id.\"\n\t\t\t\t\t\t\tLIMIT 1\n\t\t\t\t\t\t\t-- AND `MTN``order`\t\t= 0 -- PERF !! // TODO FORCE exact order list item\n\t\t\t\t\t\";\n\t\t\t$result = $this->link_mt->query($query);\n\t\t\t$row = $result->fetch_array(MYSQLI_ASSOC);\n\t\t\t\n\t\t\tif($row['parent'] == null)\n\t\t\t{\n\t\t\t\t$row['parent'] = 0;\n\t\t\t\t$row['order'] = 0;\n\t\t\t\t$row['mark'] = null;\n\t\t\t}\n\t\t\t\n\t\t\treturn array($row['parent'],$row['order'],$row['mark']);\t\t\n\t\t}",
"function getStorageFolderPid()\n {\n // global $_GET;\n $positionPid = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::htmlspecialchars_decode(\\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::_GET('id'));\n // $pid = t3lib_div::_GP('id');\n // print_r($pid);\n if(empty($positionPid)) {\n $siteid = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::_GET('returnUrl');\n $siteid = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::explodeUrl2Array($siteid);\n $siteid = $siteid['db_list.php?id'];\n $positionPid = $siteid;\n }\n // print_r($positionPid);\n // Negative PID values is pointing to a page on the same level as the current.\n if ($positionPid<0) {\n $pidRow = \\TYPO3\\CMS\\Backend\\Utility\\BackendUtility::getRecord('pages', abs($positionPid), 'pid');\n $positionPid = $pidRow['pid'];\n }\n $row = \\TYPO3\\CMS\\Backend\\Utility\\BackendUtility::getRecord('pages', $positionPid);\n $TSconfig = \\TYPO3\\CMS\\Backend\\Utility\\BackendUtility::getTCEFORM_TSconfig('pages', $row);\n return intval($TSconfig['_STORAGE_PID']);\n }",
"function getMapId($uid) {\n\n\t\t$query = 'SELECT Id FROM maps WHERE Uid=' . quotedString($uid);\n\t\t$res = mysql_query($query);\n\t\tif (mysql_num_rows($res) > 0) {\n\t\t\t$row = mysql_fetch_row($res);\n\t\t\t$rtn = $row[0];\n\t\t} else {\n\t\t\t$rtn = 0;\n\t\t}\n\t\tmysql_free_result($res);\n\t\treturn $rtn;\n\t}",
"protected function getRootId()\n\t{\n\t\t$query = $this->_db->getQuery(true);\n\n\t\t$query->select('id')\n\t\t\t->from('#__menu')\n\t\t\t->where('parent_id = 0');\n\n\t\t$this->_db->setQuery($query);\n\n\t\t$id = $this->_db->loadResult();\n\n\t\treturn (int) $id;\n\t}",
"function getRootId()\n\t{\n\t\treturn $this->root_id;\n\t}",
"public function get_root_location_as_integer()\n {\n $l_locres = $this->get_root_location();\n\n if (count($l_locres) > 0)\n {\n $l_rootdata = $l_locres->get_row();\n\n return $l_rootdata[\"isys_catg_location_list__isys_obj__id\"];\n } // if\n\n return null;\n }",
"public function getNodeKey(): string\n {\n return $this->nodeKey;\n }",
"function getAvailableUserID(){\n\tchdir(\"../userdata/\");\n\t$files = glob(\"*.user\");\n\t$maxid = 0;\n\tforeach ($files as $val) {\n\t\tputdebug($val);\n\t\t$splitarr = explode( \".\", $val );\n\t\t$id = intval($splitarr[0]);\n\t\tif($id > $maxid){\n\t\t\t$maxid = $id;\n\t\t}\n\t}\n\t\n\tputdebug($maxid);\n\t\n\tchdir(\"../php/\");\n\t\n\treturn $maxid + 1;\n}",
"private function get_parent($id)\n\t\t{\n\t\t\t$query = \"\tSELECT\n\t\t\t\t\t\t\t`MTN`.`parent` AS 'parent'\n\t\t\t\t\t\tFROM \n\t\t\t\t\t\t\t`\".$this->tree_node.\"` `MTN`\n\t\t\t\t\t\tWHERE 1 = 1\n\t\t\t\t\t\t\tAND `MTN`.`application_release`\t= '\".$this->application_release.\"'\n\t\t\t\t\t\t\tAND `MTN`.`id`\t\t= \".$id.\"\n\t\t\t\t\t\";\n\t\t\t$result = $this->link_mt->query($query);\n\t\t\t$row = $result->fetch_array(MYSQLI_ASSOC);\t\n\t\t\treturn $row['parent'];\t\t\n\t\t}",
"protected function GetParentId()\n {\n $instance = @IPS_GetInstance($this->InstanceID);\n return $instance['ConnectionID'];\n }",
"abstract public function LowId();",
"private function getParentId($request)\n {\n return $request->getParsedBody()['parent_id'] ?? null;\n }",
"protected function _getAssetParentId() {\n $assetParent = JTable::getInstance('Asset');\n $assetParentId = $assetParent->getRootId();\n\n $assetParent->loadByName('com_lajvit');\n\n if ($assetParent->id) {\n $assetParentId = $assetParent->id;\n }\n return $assetParentId;\n }",
"public function getIdolMasterById(Int $idol_id);",
"function get_id_from_link($link)\n\t{\n\t\t$link_bits = explode('/', $link);\n\t\treturn $link_bits[(count($link_bits)-1)];\n\t}",
"public function readdir(int $ino_dir, int $fh, int $offset): ?array {\n $r = $this->replica;\n\n // 1. find directory tree ID, given ino\n $parent_id = $this->ino_to_tree_id($ino_dir);\n\n // 2. find child matching offset.\n $children = $r->state->tree->children($parent_id);\n $child_id = @$children[$offset];\n if(!$child_id) {\n return null;\n }\n\n $tree_node = $this->tree_find($child_id);\n $m = $tree_node->meta;\n $inode_id = property_exists($m, 'inode_id') ? $m->inode_id : $child_id;\n $local_entry = $this->uuid_inodes_local[$inode_id];\n return ['name' => $m->name, 'ino' => $local_entry->ino];\n }",
"public function getRootId()\r\n {\r\n return $this->get(\"coa\");\r\n }",
"public function linkToNode($link) {\n // Find the link target.\n $target = readlink($this->nodePath($link, true));\n // Return the node name the last part of the path of the node.\n $node_name = array_slice(explode('/', $target), -1)[0];\n return $node_name;\n }",
"function get_dbid($table, $field) {\n\tglobal $DB, $ZBX_LOCALNODEID;\n\n\tif ($DB['TYPE'] == ZBX_DB_POSTGRESQL && $DB['TRANSACTIONS'] && !$DB['TRANSACTION_NO_FAILED_SQLS']) {\n\t\treturn 0;\n\t}\n\n\t$nodeid = get_current_nodeid(false);\n\t$found = false;\n\n\tdo {\n\t\t$min = bcadd(bcmul($nodeid, '100000000000000', 0), bcmul($ZBX_LOCALNODEID, '100000000000', 0), 0);\n\t\t$max = bcadd(bcadd(bcmul($nodeid, '100000000000000', 0), bcmul($ZBX_LOCALNODEID, '100000000000', 0), 0), '99999999999', 0);\n\n\t\t$dbSelect = DBselect('SELECT i.nextid FROM ids i WHERE i.nodeid='.$nodeid.' AND i.table_name='.zbx_dbstr($table).' AND i.field_name='.zbx_dbstr($field));\n\t\tif (!$dbSelect) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$row = DBfetch($dbSelect);\n\t\tif (!$row) {\n\t\t\t$row = DBfetch(DBselect('SELECT MAX('.$field.') AS id FROM '.$table.' WHERE '.$field.'>='.$min.' AND '.$field.'<='.$max));\n\t\t\tif (!$row || ($row['id'] == 0)) {\n\t\t\t\tDBexecute(\"INSERT INTO ids (nodeid,table_name,field_name,nextid) VALUES ($nodeid,'$table','$field',$min)\");\n\t\t\t}\n\t\t\telse {\n\t\t\t\tDBexecute(\"INSERT INTO ids (nodeid,table_name,field_name,nextid) VALUES ($nodeid,'$table','$field',\".$row['id'].')');\n\t\t\t}\n\t\t\tcontinue;\n\t\t}\n\t\telse {\n\t\t\t$ret1 = $row['nextid'];\n\t\t\tif (bccomp($ret1, $min) < 0 || !bccomp($ret1, $max) < 0) {\n\t\t\t\tDBexecute('DELETE FROM ids WHERE nodeid='.$nodeid.' AND table_name='.zbx_dbstr($table).' AND field_name='.zbx_dbstr($field));\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$sql = 'UPDATE ids SET nextid=nextid+1 WHERE nodeid='.$nodeid.' AND table_name='.zbx_dbstr($table).' AND field_name='.zbx_dbstr($field);\n\t\t\tDBexecute($sql);\n\n\t\t\t$row = DBfetch(DBselect('SELECT i.nextid FROM ids i WHERE i.nodeid='.$nodeid.' AND i.table_name='.zbx_dbstr($table).' AND i.field_name='.zbx_dbstr($field)));\n\t\t\tif (!$row || is_null($row['nextid'])) {\n\t\t\t\t// should never be here\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$ret2 = $row['nextid'];\n\t\t\t\tif (bccomp(bcadd($ret1, 1, 0), $ret2, 0) == 0) {\n\t\t\t\t\t$found = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\twhile (false == $found);\n\n\treturn $ret2;\n}",
"public function getRootUid() {}",
"public function getResourceLinkIdentifier(TreeNode $treeNode)\n {\n $data = $this->course->getId() . ':' . $this->contentObjectPublication->getId() . ':' . $treeNode->getId();\n\n return base64_encode($data);\n }",
"public function getParentId();",
"public function getParentId();",
"public function getParentId();",
"public static function getId() {\n return isset(self::$id)\n ? self::$id\n : (self::$id = base_convert(crc32(self::getBaseDir()),16,32));\n\t}",
"function get_current_network_id()\n {\n }"
] | [
"0.7005429",
"0.6393705",
"0.62078667",
"0.59493685",
"0.58931726",
"0.5886112",
"0.58189976",
"0.55625886",
"0.5536959",
"0.55292666",
"0.55063236",
"0.54537326",
"0.5427723",
"0.5405376",
"0.5367488",
"0.536076",
"0.533733",
"0.53335947",
"0.53012216",
"0.5285714",
"0.5282315",
"0.52520037",
"0.5227886",
"0.5215531",
"0.514994",
"0.5141159",
"0.51322496",
"0.51280606",
"0.5124985",
"0.5118921",
"0.5086964",
"0.50750387",
"0.5071056",
"0.505005",
"0.50446665",
"0.5020047",
"0.5019411",
"0.50174165",
"0.5009209",
"0.49989456",
"0.4995201",
"0.49896374",
"0.49811265",
"0.49781218",
"0.49728987",
"0.49690828",
"0.4959491",
"0.4958259",
"0.49548757",
"0.49501556",
"0.49435276",
"0.4934483",
"0.4918493",
"0.49184722",
"0.4892758",
"0.4885668",
"0.48791096",
"0.487421",
"0.48707014",
"0.48580265",
"0.48471427",
"0.48441157",
"0.48308194",
"0.48255706",
"0.4824498",
"0.4822843",
"0.48185897",
"0.48122075",
"0.4811875",
"0.48034763",
"0.4801846",
"0.47992736",
"0.47862384",
"0.47817084",
"0.4769979",
"0.47613478",
"0.47590724",
"0.47555184",
"0.47544348",
"0.4741928",
"0.47418076",
"0.47416073",
"0.47302476",
"0.47204825",
"0.4714692",
"0.47106087",
"0.47029623",
"0.47022325",
"0.4697743",
"0.46958858",
"0.4695147",
"0.469234",
"0.46848655",
"0.46835613",
"0.46831137",
"0.46812958",
"0.46812958",
"0.46812958",
"0.46760938",
"0.4672801"
] | 0.8034423 | 0 |
true if replica stat's are equal and local inode counts match. | public function is_equal(filesystem $other) {
return count($this->ino_inodes_local) == count($other->ino_inodes_local) &&
count($this->uuid_inodes_local) == count($other->uuid_inodes_local) &&
$this->ino_counter == $other->ino_counter &&
$this->replica->state == $other->replica->state;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function test_fs_replicas() {\n // init filesystem, replica 1.\n $fs1 = new filesystem(new replica());\n $fs1->init();\n\n // init filesystem, replica 2.\n $fs2 = new filesystem(new replica());\n\n // get ino for /\n $ino_root = $fs1->lookup(\"/\");\n\n // create /home/bob\n $ino_home = $fs1->mkdir($ino_root, \"home\" );\n $ino_bob = $fs1->mkdir($ino_home, \"bob\" );\n\n $fs2->replica->apply_log_ops($fs1->replica->state->log_op_list);\n\n if($fs1->is_equal($fs2)) {\n echo \"\\n== Pass! replica1 and replica2 filesystems match. ==\\n\";\n } else {\n echo \"\\n== Fail! replica1 and replica2 filesystems do not match. ==\\n\";\n\n $fs1->print_current_state(\"created /home/bob. (replica1 state)\");\n $fs2->print_current_state(\"created /home/bob. (replica2 state)\");\n }\n}",
"public function test_sync_withExistingIds_sameCountAndReturnTrue() {\n\t\t$this->repo->sync(789,91437);\n\t\t\n\t\t$expected = array(\n\t\t\t 'count'=>(integer)$this->repo->count(),\n\t\t\t 'result'=>true\n\t\t);\n\t\t\n\t\t\n\t\t//sync same numbers, count should not change\n\t\t$result = $this->repo->sync(789,91437);\n\t\t\n\t\t$actual = array(\n\t\t\t'count'=>(integer) $this->repo->count(),\n\t\t\t'result'=>$result\n\t\t);\n\t\t\n\t\t$this->assertEquals($expected,$actual);\n\t\t\n\t}",
"private function isSameLength()\n {\n return $this->lengthA == $this->lengthB;\n }",
"private function areEqual()\n {\n $this->compareHeader();\n\n return empty($this->diffHeader);\n }",
"function fm_user_has_shared_ind($sid) {\r\n\tglobal $USER;\r\n\t\r\n\tif (!$sharedfiles = count_records('fmanager_shared', 'id', $sid, 'userid', $USER->id)) {\r\n\t\tif (!count_records('fmanager_shared', 'id', $sid, 'userid', 0)) {\r\n\t\t\terror(get_string('errnoshared', 'block_file_manager'));\r\n\t\t}\r\n\t}\r\n\treturn true;\r\n}",
"function isSameStream( IStreamProperties $_comparison ): bool;",
"function are_there_duplicates_in_db() {\n $result = $this->pdo->query('SELECT filename,md5_sign,count(*) FROM files\n GROUP BY filename, md5_sign\n HAVING COUNT(*) > 1');\n $results = count($result->fetchAll());\n\n if( $results ) {\n return true;\n } else {\n return false;\n }\n }",
"public function hasChanged() {\n\t\treturn trim( $this->fileSize ) != trim( $this->currentSize );\n\t}",
"public function is_new_data() {\n $rv = FALSE;\n if ($this->is_remote($this->url)) {\n $ts_standard = $this->GetRemoteLastModified($this->url . FileFetcher::FILE_STANDARDS);\n $ts_counties = $this->GetRemoteLastModified($this->url . FileFetcher::FILE_COUNTIES);\n }\n else {\n $ts_standard = filemtime($this->url . FileFetcher::FILE_STANDARDS);\n $ts_counties = filemtime($this->url . FileFetcher::FILE_COUNTIES);\n }\n $ts = 0;\n if ($this->last_fetch == '' || $ts_standard > $this->last_fetch) {\n $rv = TRUE;\n $ts = $ts_standard;\n }\n if ($this->last_fetch == '' || $ts_counties > $this->last_fetch) {\n $rv = TRUE;\n $ts = $ts_counties;\n }\n if ($rv) {\n update_option(\"hecc_standard_last_update_datetime\", $ts);\n }\n return $rv;\n }",
"public function testStat_lstat()\n {\n \t$stat = lstat($this->file);\n\t\t\n $stat['type'] = filetype($this->file);\n $stat['perms'] = Fs::mode2perms($stat['mode']);\n \t\n \tif (extension_loaded('posix')) {\n\t \t$userinfo = posix_getpwuid($stat['uid']);\n\t \t$groupinfo = posix_getgrgid($stat['gid']);\n\t \t$stat['owner'] = $userinfo['name'];\n\t \t$stat['group'] = $groupinfo['name'];\n \t} else {\n\t \t$stat['owner'] = $stat['uid'];\n\t \t$stat['group'] = $stat['gid'];\n \t}\n \t\n $this->assertEquals($stat, $this->Fs_Node->stat(Fs::NO_DEREFERENCE));\n }",
"function fm_user_has_shared($original=0, $link=0, $ownertype) {\r\n\tglobal $USER, $CFG;\r\n\r\n\tif ($link == 0) {\r\n\t\tif (!$sharedfiles = (count_records('fmanager_shared', \"owner\", $original, \"ownertype\", $ownertype,\"userid\", $USER->id) + count_records('fmanager_shared', \"owner\", $original, \"ownertype\", $ownertype,\"userid\", 0))) {\t\r\n\t\t\terror(get_string(\"errnoshared\", 'block_file_manager'));\r\n\t\t}\r\n\t} else {\r\n\t\tif (!$sharedfiles = (count_records('fmanager_shared',\"owner=$original AND ownertype\", $ownertype,\"userid\",$USER->id,\"sharedlink\",$link) + count_records('fmanager_shared',\"owner=$original AND ownertype\", $ownertype,\"userid\",0,\"sharedlink\",$link))) {\r\n\t\t\terror(get_string(\"errnoshared\",'block_file_manager'));\r\n\t\t}\r\n\t}\r\n\treturn true;\r\n}",
"function files_are_equal($a, $b)\n{\n if(filesize($a) !== filesize($b))\n return 0;\n\n // Check if content is different\n $ah = fopen($a, 'rb');\n $bh = fopen($b, 'rb');\n\n $result = 1;\n while(!feof($ah))\n {\n if(fread($ah, 8192) != fread($bh, 8192))\n {\n $result = 0;\n break;\n }\n }\n\n fclose($ah);\n fclose($bh);\n\n return $result;\n}",
"public function checkDiff()\n {\n if ($this->tokensOriginal !== $this->tokensMutated) {\n return true;\n }\n\n return false;\n }",
"public static function verifyChecksum(): bool\n {\n $checksumFile = static::getChecksumFileName();\n\n if (!file_exists($checksumFile)) {\n return false;\n }\n\n $oldHashes = static::getStoredChecksums();\n $newHashes = static::generateChecksums();\n\n foreach ($newHashes as $fileName => $hash) {\n if (!array_key_exists($fileName, $oldHashes)) {\n return false;\n }\n\n if ($hash !== $oldHashes[$fileName]) {\n return false;\n }\n }\n\n return true;\n }",
"public function hasAllowReplication(){\n return $this->_has(3);\n }",
"public function isSameSession() {\n\t\tif($this->ipAdress != $_SERVER[\"REMOTE_ADDR\"] || \n\t\t\t$this->userAgent != $_SERVER[\"HTTP_USER_AGENT\"]) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}",
"function _are_attrs_modified($old_slice, $new_slice) {\n return $old_slice['index'] != $new_slice['index'];\n }",
"private function hasMaster(){\n $hosts = $this->mongo->getHosts();\n foreach ($hosts as $host)\n if ($host['state'] == 1) return true;\n return false;\n }",
"public function are_licenses_network_identical() {\r\n return false;\r\n }",
"public function can_sync(){\n\t\tif( true === $this->can_sync ){\n\t\t\treturn true;\n\t\t}\n\t\t$this->find_tags();\n\t\t$this->find_binds();\n\t\t$this->can_sync = ! empty( $this->binds );\n\t\treturn $this->can_sync;\n\t}",
"public function should_succeed_when_snapshots_are_equal(): void\n {\n $prev = new DirectorySnapshot(codecept_root_dir('tests/_support'));\n $snapshot = $prev->snapshotFileName();\n codecept_debug('Snapshot file: ' . $snapshot);\n $this->unlinkAfter[] = $snapshot;\n $prev->assert();\n\n $dirSnapshot = new DirectorySnapshot(codecept_root_dir('tests/_support'));\n $dirSnapshot->setSnapshotFileName($snapshot);\n\n $dirSnapshot->assert();\n }",
"function compare_stat($info1,$info2,$file){\n\t//Previous file details\n\t$atime1 = $info1->atime; //Last Access timestamp\n\t$ctime1 = $info1->ctime; //last inode change timestamp\n\t$mtime1 = $info1->mtime; //Last modification timestamp\n\t$uid1 = $info1->uid; //userid of owner\n\t$guid1 = $info1->gid; //groupid of owner\n\t$dev1 = $info1->dev; //Device ID\n\t\n\t//New file details\n\t$atime2 = $info2->atime; //Last Access timestamp\n\t$ctime2 = $info2->ctime; //last inode change timestamp\n\t$mtime2 = $info2->mtime; //Last modification timestamp\n\t$uid2 = $info2->uid; //userid of owner\n\t$guid2 = $info2->gid; //groupid of owner\n\t$dev2 = $info2->dev; //Device ID\n\t\n\t$file_details = '';\n\tif($mtime1 !== $mtime2){\n\t\t$file_details .= $file.' has been modified'.\"\\n\";\n\t\t$ip = access_log_ip($ctime2);\n\t\t$file_details .= 'Possible IP Address(es) : '.$ip.\"\\n\";\n\t\t$file_details .= 'Modification details:'.\"\\n\";\n\t\t$file_details .= 'Modified Date : '.date('Y-m-d H:i:s',$mtime2).\"\\n\";\n\t\t$file_details .= 'Last Access Date : '.date('Y-m-d H:i:s',$atime2).\"\\n\";\n\t\t$file_details .= 'iNode Change Date : '.date('Y-m-d H:i:s',$ctime2).\"\\n\";\n\t\t$file_details .= 'User ID : '.$uid2.\"\\n\";\n\t\t$file_details .= 'Group ID : '.$guid2.\"\\n\";\n\t\t$file_details .= \"=================================================================\\n\";\n\t}\n\treturn $file_details;\n}",
"function has_changes() {\n $changed = (count($this->add['tables' ]) + count($this->update['tables' ]) + count($this->remove['tables' ]) +\n count($this->add['routines']) + count($this->update['routines']) + count($this->remove['routines']) +\n count($this->add['events' ]) + count($this->update['events' ]) + count($this->remove['events' ]) +\n count($this->add['views' ]) + count($this->update['views' ]) + count($this->remove['views' ]) +\n count($this->add['triggers']) + count($this->update['triggers']) + count($this->remove['triggers'])\n );\n return ($changed != 0 or isset($this->schema->charset) or isset($this->schema->collate));\n }",
"public function isConsistent() {}",
"public function has_access($owner, $name) {\n $stmt = $this->pdo->prepare('select * from share where owner_id = :owner_id and user_id = :id and file_id in (select id from file where owner_id = :owner_id and filename = :name)');\n $stmt->bindValue(':id', $this->id);\n $stmt->bindValue(':owner_id', $owner->id);\n $stmt->bindValue(':name', $name);\n $stmt->execute();\n $res = $stmt->fetchAll();\n return count($res) == 1;\n }",
"function fromLocal(){\n if (!isset($_SERVER['LOCAL_ADDR'])) return $_SERVER['SERVER_ADDR'] == $_SERVER['REMOTE_ADDR'];\n if (!isset($_SERVER['SERVER_ADDR'])) return $_SERVER['LOCAL_ADDR'] == $_SERVER['REMOTE_ADDR'];\n return ($_SERVER['SERVER_ADDR'] == $_SERVER['REMOTE_ADDR'] || $_SERVER['LOCAL_ADDR'] == $_SERVER['REMOTE_ADDR']);\n}",
"public function hasDigests() {\n return $this->_has(2);\n }",
"public function hasDigests() {\n return $this->_has(2);\n }",
"public function is_files_scanned() {\r\n\t\t$this->refresh_status();\r\n\t\treturn $this->is_scanned;\r\n\t}",
"public function getFileConsistency()\r\n {\r\n if (empty($this->file) && empty($this->file2)) {\r\n return false;\r\n } else if (empty($this->file)) {\r\n return $this->file2Consistency;\r\n } else if (empty($this->file2)) {\r\n return $this->file1Consistency;\r\n } else {\r\n return $this->file1Consistency && $this->file2Consistency;\r\n }\r\n }",
"public function fileIndexStatusIsTrueIfUidIsSet() {}",
"public function isConflict($stat, $type)\n {\n // $stat == server's message information\n if ($stat['mod'] > $this->_lastSyncStamp &&\n ($type == Horde_ActiveSync::CHANGE_TYPE_DELETE ||\n $type == Horde_ActiveSync::CHANGE_TYPE_CHANGE)) {\n\n // changed here - deleted there\n // changed here - changed there\n return true;\n }\n\n return false;\n }",
"private function _isMine(): bool {\n\t\treturn $this->isMyServer() && $this->isMyPID();\n\t}",
"function DiferentKeys($keys_home, $keys_sync) {\r\n \tif (count($keys_home) != count($keys_sync)) {\r\n \treturn true;\r\n }\r\n\r\n for ($i = 0; $i < count($keys_home); $i++) {\r\n \tif ($keys_home[$i] != $keys_sync[$i]) {\r\n \treturn true;\r\n }\r\n }\r\n\r\n return false;\r\n }",
"function same($s1, $s2) {\n\t$s1len = strlen($s1);\n\t$s2len = strlen($s2);\n\tif($s1len != $s2len) return false;\n\n\tfor($i = 0; $i < $s1len; $i++) {\n\t\t$count = 0;\n\t\tfor($j = 0; $j < $s1len; $j++) {\n\t\t\tif($s1[$i] == $s2[$j]) $count++;\n\t\t}\n\t\tif($count != 1) return false;\n\t}\n\treturn true;\n}",
"public function is_connected()\n {\n $result = @$this->mcache->getExtendedStats();\n $canconnect = false;\n\n if($result) {\n foreach($result as $server => $stats) {\n if($stats) {\n $canconnect = true;\n break;\n }\n }\n }\n \n return $canconnect;\n }",
"function check_size($file)\n {\n $ret = false;\n if (!$this->_file_init($file)) return true;\n if ($this->_init_header())\n {\n\t$buf = fread($this->fd, 24);\n\t$tmp = unpack('H32id/Vlen/H8unused', $buf);\n\tif ($tmp['id'] == '3626b2758e66cf11a6d900aa0062ce6c')\n\t {\n\t $stat = fstat($this->fd);\n\t $ret = ($stat['size'] == ($this->head['len'] + $tmp['len']));\n\t }\n }\n $this->_file_deinit();\n return $ret;\n }",
"public function hasMd5checksums(){\n return $this->_has(1);\n }",
"public function hasMd5checksums(){\n return $this->_has(1);\n }",
"public function validateUpdate()\n\t{\n\t\tBlocks::log('Validating MD5 for '.$this->_downloadFilePath, \\CLogger::LEVEL_INFO);\n\t\t$sourceMD5 = IOHelper::getFileName($this->_downloadFilePath, false);\n\n\t\t$localMD5 = IOHelper::getFileMD5($this->_downloadFilePath);\n\n\t\tif ($localMD5 === $sourceMD5)\n\t\t{\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}",
"public function typeIsOfSameInternalSize() : bool\n {\n return true;\n }",
"public function satisfied(array $assignment): bool {\n // if there are any duplicates grid locations then there is an overlap\n $allLocations = [];\n foreach ($assignment as $values) {\n foreach ($values as $locs) {\n $allLocations[] = $locs;\n }\n }\n return count($this->unique($allLocations)) == count($allLocations);\n }",
"public function isEqual(Coordinate $coord) {\n return $this->compareValuesWithPrecision($this->x, $coord->x) === 0 &&\n $this->compareValuesWithPrecision($this->y, $coord->y) === 0;\n }",
"public function testGetAttribute_lstat_Posix()\n {\n \tif (!extension_loaded('posix')) $this->markTestSkipped(\"Posix methods not available.\");\n \t\n \t$userinfo = posix_getpwuid(fileowner($this->file));\n \t$groupinfo = posix_getgrgid(filegroup($this->file));\n \t\n \t$this->assertEquals($userinfo['name'], $this->Fs_Node->getAttribute('owner', Fs::NO_DEREFERENCE), 'owner');\n $this->assertEquals($groupinfo['name'], $this->Fs_Node->getAttribute('group', Fs::NO_DEREFERENCE), 'group');\n }",
"public function isThere() {\n\n if($this->options['overwrite'] === true) return false;\n\n // if the thumb already exists and the source hasn't been updated\n // we don't need to generate a new thumbnail\n if(file_exists($this->destination->root) && f::modified($this->destination->root) >= $this->source->modified()) return true;\n\n return false;\n\n }",
"function is_equal(state $other): bool {\n return $this->log_op_list == $other->log_op_list &&\n $this->tree->is_equal($other->tree);\n }",
"function test($compare) {\n return ($this->count == $compare);\n }",
"public function isValid() : bool {\n if($valid = parent::isValid()){\n // check if source/target system are not equal\n // check if source/target belong to same map\n if(\n is_object($this->source) &&\n is_object($this->target) &&\n $this->get('source', true) === $this->get('target', true) ||\n $this->source->get('mapId', true) !== $this->target->get('mapId', true)\n ){\n $valid = false;\n }\n }\n\n return $valid;\n }",
"public function hasDigests() {\n return $this->_has(3);\n }",
"function _is_geometry_modified($old_slice, $new_slice) {\n $old_nodes_ids = array_keys($old_slice['nodes']);\n $new_nodes_ids = array_keys($new_slice['nodes']);\n if ($old_nodes_ids != $new_nodes_ids)\n return true;\n\n foreach ($new_slice['nodes'] as $node) {\n if (isset($node['action']))\n return true;\n }\n\n return false;\n }",
"public function isFull(): bool;",
"public function checkSyncDate(): bool\n {\n /** @var FileInfoImage $item */\n $item = $this->current();\n $date2 = $item->getSyncDateXmp();\n if ($date2 === null) {\n\n return true;\n } else {\n $date1 = DateTime::createFromFormat('U', $this->getMTime());\n\n return $date1 > $date2;\n }\n }",
"public function testStatus(){\n $model = new PersistenceManager();\n $stats = $model->getStatus();\n\n $this->assertEquals(\n intval($stats[0]['total']),\n intval($stats[0]['used'])+intval($stats[0]['not_used'])\n );\n }",
"function checkNginxMagentoFilesUptodate()\n {\n $sampleConfig = PATH_CONFIG_NGINX;\n\n return (filemtime($sampleConfig . '/magento/magento.conf') <= filemtime('/etc/nginx/magento/magento.conf'))\n && (filemtime($sampleConfig . '/conf.d/security.conf') <= filemtime('/etc/nginx/conf.d/security.conf'))\n && (\n filemtime($sampleConfig . '/magento/php5-fcgi-magento.conf')\n <= filemtime('/etc/nginx/magento/php5-fcgi-magento.conf')\n );\n }",
"public function isLocal()\n {\n return $this->server['SERVER_ADDR'] === $this->getClientIP();\n }",
"public function testGetAttribute_lstat_Calculated()\n {\n \t$stat = lstat($this->file);\n \t\n $this->assertEquals(is_link($this->file) ? 'link' : filetype($this->file), $this->Fs_Node->getAttribute('type', Fs::NO_DEREFERENCE), 'type');\n $this->assertEquals(Fs::mode2perms($stat['mode']), $this->Fs_Node->getAttribute('perms', Fs::NO_DEREFERENCE), 'perms');\n }",
"protected function areAllRaidsComplete()\n\t{\n\t\tfor ($vDisk = 0; $vDisk < $this->getDiskAmount(); $vDisk++)\n\t\t\tif (!$this->isRaidComplete($vDisk))\n\t\t\t\treturn(false);\n\n\t\treturn(true);\n\t}",
"public function ensureConnectedToReplica(): bool\n {\n return $this->performConnect('replica');\n }",
"function hasAnonymizedResults()\n\t{\n\t\treturn ($this->getAnonymize() == self::ANONYMIZE_ON || \n\t\t\t$this->getAnonymize() == self::ANONYMIZE_FREEACCESS);\n\t}",
"private function tableIsEqual($table)\n {\n //check columns\n if ($this->getMissingCols($table)) {\n return false;\n }\n\n //check structure\n $table1 = $this->getTableStmt($this->conn1, $table);\n $table2 = $this->getTableStmt($this->conn2, $table);\n return $this->tblStmtHash($table1) == $this->tblStmtHash($table2);\n }",
"public function isDirty() {\n\t\treturn count($this->_modified);\n\t}",
"public function isFileEqual(File $file)\n {\n $a = $file->getPathname();\n\n $disk = $this->getDisk();\n $bh = $disk->readStream($this->path);\n\n // Check if filesize is different\n if(filesize($a) !== $this->size) {\n return false;\n }\n\n // Check if content is different\n $ah = fopen($a, 'rb');\n\n $result = true;\n while(!feof($ah)) {\n if(fread($ah, 8192) != fread($bh, 8192))\n {\n $result = false;\n break;\n }\n }\n\n fclose($ah);\n fclose($bh);\n\n return $result;\n }",
"function is_equal(tree $other): bool {\n // We must treat the triples array as an unordered set\n // (where the two sets are equal even if values are present\n // in a different order).\n // Therefore, we cannot simply check if array_values()\n // for each set is equal.\n foreach($this->triples as $k => $t) {\n $o = @$other->triples[$k];\n if(!$o || !$t->is_equal($o)){\n return false;\n }\n }\n foreach($other->triples as $k => $t) {\n $o = @$this->triples[$k];\n if(!$o || !$t->is_equal($o)){\n return false;\n }\n }\n return true;\n }",
"function test_concurrent_moves_no_conflict() {\n $r1 = new replica();\n $r2 = new replica();\n\n // Setup initial tree state.\n $ops = [new op_move($r1->tick(), null, \"root\", $root_id = new_id()),\n new op_move($r1->tick(), $root_id, \"a\", $a_id = new_id()),\n new op_move($r1->tick(), $root_id, \"b\", $b_id = new_id()),\n ];\n\n $r1->apply_ops($ops); // applied own ops\n $r2->apply_ops($ops); // merged ops from r1.\n\n echo \"Initial tree state on both replicas\\n\";\n print_tree($r1->state->tree);\n\n // replica_1 moves /root/a to /root/c\n $repl1_ops = [new op_move($r1->tick(), $root_id, \"c\", $a_id)];\n\n // replica_2 \"simultaneously\" moves /root/b to /root/d\n $repl2_ops = [new op_move($r2->tick(), $root_id, \"d\", $b_id)];\n\n // replica_1 applies his op, then merges op from replica_2\n $r1->apply_ops($repl1_ops);\n\n echo \"\\nreplica_1 tree after move\\n\";\n print_tree($r1->state->tree);\n $r1->apply_ops($repl2_ops);\n\n // replica_2 applies his op, then merges op from replica_1\n $r2->apply_ops($repl2_ops);\n echo \"\\nreplica_2 tree after move\\n\";\n print_tree($r2->state->tree);\n $r2->apply_ops($repl1_ops);\n\n // expected result: state is the same on both replicas\n // and final path is /root/c/a because last-writer-wins\n // and replica_2's op has a later timestamp.\n if ($r1->state->is_equal($r2->state)) {\n echo \"\\nreplica_1 state matches replica_2 state after each merges other's change. conflict resolved!\\n\";\n print_replica_trees($r1->state, $r2->state);\n } else {\n echo \"\\nwarning: replica_1 state does not match replica_2 state after merge\\n\";\n print_replica_trees($r1->state, $r2->state);\n file_put_contents(\"/tmp/repl1.json\", json_encode($r1, JSON_PRETTY_PRINT));\n file_put_contents(\"/tmp/repl2.json\", json_encode($r2, JSON_PRETTY_PRINT));\n }\n $r1->state->check_log_is_descending();\n return;\n}",
"public function hasCommittedSize(){\n return $this->_has(1);\n }",
"public function hasCommittedSize(){\n return $this->_has(1);\n }",
"public function hasLocalFiles(): bool\n {\n return $this->localFiles !== [];\n }",
"public function localFileExists()\n {\n return file_exists($this->GetRealPath());\n }",
"private function sameImages($imageOne, $imageTwo)\n\t{\n\t\t$widthOne = imagesx($imageOne);\n\t\t$heightOne = imagesy($imageOne);\n\t\t$widthTwo = imagesx($imageTwo);\n\t\t$heightTwo = imagesy($imageTwo);\n\n\t\tif ($widthOne == $widthTwo && $heightOne == $heightTwo) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}",
"private function compareFiles($fileA, $fileB)\n {\n if (sha1($fileA) === sha1($fileB)) {\n return true;\n }\n\n return false;\n }",
"public function equals(Setoid $that): bool;",
"public function valid() {\n\t\t\treturn isset( $this->stat_refs[ $this->position ] );\n\t\t}",
"private static function areAllOperationsSuccessful (array $result) : bool {\n return HashMap::from($result)\n ->all(function ($key, $value) {\n return $value === true; // can be true or Memcached::RES_*\n });\n }",
"public function canBeUsedSimultaneously(VdrChannel $chan) {\r\n\t\t\treturn ($this->sigSource == $chan->sigSource) && ($this->tid == $chan->tid);\r\n\t\t}",
"function areFilesWritable($files)\n\t{\n\t\tglobal $langPatcher;\n\n\t\t$notWritable = array();\n\t\tforeach ($files as $curFile)\n\t\t{\n\t\t\tif (!$this->isWritable($curFile))\n\t\t\t\t$notWritable[] = $curFile;\n\t\t}\n\n\t\tif (count($notWritable) > 0)\n\t\t\tmessage($langPatcher['Files not writable info'].':<br />'.implode('<br />', $notWritable));\n\t\treturn true;\n\t}",
"protected function shouldUpdateSnapshots(): bool\n {\n if (in_array('--update-snapshots', $_SERVER['argv'], true)) {\n return true;\n }\n\n return getenv('UPDATE_SNAPSHOTS') === 'true';\n }",
"public function equals(Counts $comparecounts)\n {\n \t$equals = $this->getHousingCount() == $comparecounts->getHousingCount();\n \t$equals = $equals && $this->getHousingDescription() == $comparecounts->getHousingDescription();\n \t$equals = $equals && $this->getOtherCount() == $comparecounts->getOtherCount();\n \t$equals = $equals && $this->getOtherDescription() == $comparecounts->getOtherDescription();\n \t$equals = $equals && $this->getPhotoCount() == $comparecounts->getPhotoCount();\n \t$equals = $equals && $this->getPhotoDescription() == $comparecounts->getPhotoDescription();\n \t$equals = $equals && $this->getSheetCount() == $comparecounts->getSheetCount();\n \t$equals = $equals && $this->getSheetDescription() == $comparecounts->getSheetDescription();\n \t$equals = $equals && $this->getVolumeCount() == $comparecounts->getVolumeCount();\n \t$equals = $equals && $this->getVolumeDescription() == $comparecounts->getVolumeDescription();\n \t\t$equals = $equals && $this->getBoxCount() == $comparecounts->getBoxCount();\n \t$equals = $equals && $this->getBoxDescription() == $comparecounts->getBoxDescription();\n \t\treturn $equals;\n }",
"public function validateChangedPasswordsIsTheSame(): bool\n {\n return $this->newPassword1 === $this->newPassword2;\n }",
"public function updateNecessary(): bool\n {\n $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable(self::TABLE_NAME);\n $queryBuilder->getRestrictions()->removeAll();\n $elementCount = $queryBuilder->count('uid')\n ->from(self::TABLE_NAME)\n ->where(\n $queryBuilder->expr()->orX(\n $queryBuilder->expr()->eq('path_segment', $queryBuilder->createNamedParameter('', \\PDO::PARAM_STR)),\n $queryBuilder->expr()->isNull('path_segment')\n )\n )\n ->execute()->fetchColumn(0);\n\n return (bool)$elementCount;\n }",
"public static function equals($a, $b)\n {\n if(filesize($a) !== filesize($b))\n return false;\n\n // Check if content is different\n $ah = fopen($a, 'rb');\n $bh = fopen($b, 'rb');\n\n $result = true;\n while(!feof($ah))\n {\n if(fread($ah, 8192) != fread($bh, 8192))\n {\n $result = false;\n break;\n }\n }\n\n fclose($ah);\n fclose($bh);\n\n return $result;\n }",
"public function isSynced(): bool\n {\n return $this->synced;\n }",
"public function fullyEqualsTo( $coord, $precision = 6 ): bool {\n\t\treturn $this->equalsTo( $coord, $precision )\n\t\t\t&& $this->primary == $coord->primary\n\t\t\t&& $this->dim === $coord->dim\n\t\t\t&& $this->type === $coord->type\n\t\t\t&& $this->name === $coord->name\n\t\t\t&& $this->country === $coord->country\n\t\t\t&& $this->region === $coord->region;\n\t}",
"public function hasChanged(): bool\n {\n if (! $this->isSynced()) {\n return true;\n }\n\n return $this->attributes !== $this->original;\n }",
"function _isMatch()\n {\n if (isset($_POST['login'])) {\n if ($this->name_post == $this->name_db && password_verify($this->pass_post, $this->pass_db)) {\n return true;\n }\n $this->mismatch = true;\n }\n return false;\n }",
"public function isChanged()\n {\n return ! empty(array_diff_assoc($this->items, $this->clone));\n }",
"public function isFull() : bool;",
"public function isFresh(): bool\n {\n $lock = $this->lockFile->read();\n\n if (!empty($lock['content-hash'])) {\n // There is a content hash key, use that instead of the file hash\n return $this->contentHash === $lock['content-hash'];\n }\n\n // BC support for old lock files without content-hash\n if (!empty($lock['hash'])) {\n return $this->hash === $lock['hash'];\n }\n\n // should not be reached unless the lock file is corrupted, so assume it's out of date\n return false;\n }",
"private function hasLocalUniqueIndex(): bool\n {\n if ($this->hasLocalUniqueIndex !== null) {\n return $this->hasLocalUniqueIndex;\n }\n foreach ($this->getForeignKey()->getLocalTable()->getIndexes() as $index) {\n if (\n $index->isUnique()\n && count($index->getUnquotedColumns()) === count($this->getForeignKey()->getUnquotedLocalColumns())\n && !array_diff($index->getUnquotedColumns(), $this->getForeignKey()->getUnquotedLocalColumns()) // Check for permuted columns too\n ) {\n $this->hasLocalUniqueIndex = true;\n return true;\n }\n }\n $this->hasLocalUniqueIndex = false;\n return false;\n }",
"public function hasAnyDiff()\n {\n return count($this->fields) > 0;\n }",
"function privCheckFileHeaders(&$p_local_header, &$p_central_header)\n {\n $v_result=1;\n\n \t// ----- Check the static values\n \t// TBC\n \tif ($p_local_header['filename'] != $p_central_header['filename']) {\n \t}\n \tif ($p_local_header['version_extracted'] != $p_central_header['version_extracted']) {\n \t}\n \tif ($p_local_header['flag'] != $p_central_header['flag']) {\n \t}\n \tif ($p_local_header['compression'] != $p_central_header['compression']) {\n \t}\n \tif ($p_local_header['mtime'] != $p_central_header['mtime']) {\n \t}\n \tif ($p_local_header['filename_len'] != $p_central_header['filename_len']) {\n \t}\n\n \t// ----- Look for flag bit 3\n \tif (($p_local_header['flag'] & 8) == 8) {\n $p_local_header['size'] = $p_central_header['size'];\n $p_local_header['compressed_size'] = $p_central_header['compressed_size'];\n $p_local_header['crc'] = $p_central_header['crc'];\n \t}\n\n // ----- Return\n return $v_result;\n }",
"function test_concurrent_moves() {\n $r1 = new replica();\n $r2 = new replica();\n\n // Setup initial tree state.\n $ops = [new op_move($r1->tick(), null, \"root\", $root_id = new_id()),\n new op_move($r1->tick(), $root_id, \"a\", $a_id = new_id()),\n new op_move($r1->tick(), $root_id, \"b\", $b_id = new_id()),\n new op_move($r1->tick(), $root_id, \"c\", $c_id = new_id()),\n ];\n\n $r1->apply_ops($ops); // applied own ops\n $r2->apply_ops($ops); // merged ops from r1.\n\n echo \"Initial tree state on both replicas\\n\";\n print_tree($r1->state->tree);\n\n // replica_1 moves /root/a to /root/b\n $repl1_ops = [new op_move($r1->tick(), $b_id, \"a\", $a_id)];\n\n // replica_2 \"simultaneously\" moves /root/a to /root/c\n $repl2_ops = [new op_move($r2->tick(), $c_id, \"a\", $a_id)];\n\n // replica_1 applies his op, then merges op from replica_2\n $r1->apply_ops($repl1_ops);\n echo \"\\nreplica_1 tree after move\\n\";\n print_tree($r1->state->tree);\n $r1->apply_ops($repl2_ops);\n\n // replica_2 applies his op, then merges op from replica_1\n $r2->apply_ops($repl2_ops);\n echo \"\\nreplica_2 tree after move\\n\";\n print_tree($r2->state->tree);\n $r2->apply_ops($repl1_ops);\n\n // expected result: state is the same on both replicas\n // and final path is /root/c/a because last-writer-wins\n // and replica_2's op has a later timestamp.\n if ($r1->state->is_equal($r2->state)) {\n echo \"\\nreplica_1 state matches replica_2 state after each merges other's change. conflict resolved!\\n\";\n print_replica_trees($r1->state, $r2->state);\n } else {\n echo \"\\nwarning: replica_1 state does not match replica_2 state after merge\\n\";\n print_replica_trees($r1->state, $r2->state);\n file_put_contents(\"/tmp/repl1.json\", json_encode($r1, JSON_PRETTY_PRINT));\n file_put_contents(\"/tmp/repl2.json\", json_encode($r2, JSON_PRETTY_PRINT));\n }\n $r1->state->check_log_is_descending();\n return;\n}",
"public function equals($cmp) {\n return (\n $cmp instanceof InternetAddress and \n $this->personal.$this->localpart.$this->domain === $cmp->personal.$cmp->localpart.$cmp->domain\n );\n }",
"public function ownsLock()\n {\n return $this->owner() === $this->id;\n }",
"public function beenUpdated()\n {\n return count($this->updatePlan) > 0;\n }",
"protected function getCreatedFilesWorldWritableStatus() {}",
"public function isMutipleMatching()\n {\n return $this->mutipleMatching;\n }",
"public function wasModified()\n\t{\n\t\tif ($this->get('modified') && $this->get('modified') != '0000-00-00 00:00:00')\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}",
"private function compareTables($table, $tableMemory)\n {\n $connection = Yii::app()->db;\n if ($connection->schema->getTable($table) && $connection->schema->getTable($tableMemory)) {\n $tableColumns = $connection->schema->getTable($table)->columns;\n $tableMemoryColumns = $connection->schema->getTable($tableMemory)->columns;\n if (count($tableColumns) !== count($tableMemoryColumns)) {\n return false;\n }\n foreach (array_keys($tableColumns) as $key) {\n if (get_object_vars($tableColumns[$key]) !== get_object_vars($tableMemoryColumns[$key])) {\n return false;\n }\n }\n $sourceCount = $connection->createCommand('SELECT COUNT(*) FROM ' . $connection->quoteTableName($table))->queryScalar();\n $destinationCount = $connection->createCommand('SELECT COUNT(*) FROM ' . $connection->quoteTableName($tableMemory))->queryScalar();\n if ($sourceCount !== $destinationCount) {\n return false;\n }\n } elseif ($connection->schema->getTable($table) === null || $connection->schema->getTable($tableMemory) === null) {\n return false;\n }\n return true;\n }",
"public function isEqual(Comparable $item)\n\t{\n\t\treturn ($this->getIdentity() === $item->getIdentity()) ? true : false;\n\t}",
"public function isSameSize(Matrix $matrix) {\n\t\treturn ($matrix->getNumColumns() == $this->getNumColumns() && $matrix->getNumRows() == $this->getNumRows());\n\t}"
] | [
"0.60809237",
"0.571767",
"0.5504179",
"0.54387134",
"0.5366145",
"0.52950233",
"0.5289617",
"0.52098244",
"0.5092188",
"0.50590014",
"0.5054543",
"0.5041617",
"0.50117236",
"0.5001206",
"0.49773738",
"0.4973989",
"0.49282146",
"0.49228442",
"0.491227",
"0.48844996",
"0.48803216",
"0.4873322",
"0.4831982",
"0.4829092",
"0.48056123",
"0.48054957",
"0.48040614",
"0.48040614",
"0.4794812",
"0.4774202",
"0.4769159",
"0.47511655",
"0.4746976",
"0.4746433",
"0.47206077",
"0.47046125",
"0.46795842",
"0.46734193",
"0.46734193",
"0.46602252",
"0.46568877",
"0.46547565",
"0.46538213",
"0.46535948",
"0.46466783",
"0.46374613",
"0.4635044",
"0.46346763",
"0.46226442",
"0.46133125",
"0.46098974",
"0.46070492",
"0.46054506",
"0.46053684",
"0.45798525",
"0.45791048",
"0.4562402",
"0.4548964",
"0.45478535",
"0.4545517",
"0.4541321",
"0.45399305",
"0.45291182",
"0.45260227",
"0.45234832",
"0.45234832",
"0.45205182",
"0.4518691",
"0.45127574",
"0.4512263",
"0.45062113",
"0.44929415",
"0.44922793",
"0.44797266",
"0.44793227",
"0.44775364",
"0.44673488",
"0.44623035",
"0.4458842",
"0.4457314",
"0.44528875",
"0.44517618",
"0.4446058",
"0.44388223",
"0.44382334",
"0.44349203",
"0.44334623",
"0.44328576",
"0.44262445",
"0.44234416",
"0.4418388",
"0.4416184",
"0.44131008",
"0.44097546",
"0.44019595",
"0.44010234",
"0.43989328",
"0.43908474",
"0.43886203",
"0.438324"
] | 0.6348975 | 0 |
This test tries to sync two filesystems only by apply OpMove from replica1 to replica2. That doesn't (presently) work because replica1 also has some local state that does not get recreated by replica2 when applying the ops. Basically, this test demonstrates that the present design does not work for syncing two filesystem replicas, and so we are back to the drawing board. | function test_fs_replicas() {
// init filesystem, replica 1.
$fs1 = new filesystem(new replica());
$fs1->init();
// init filesystem, replica 2.
$fs2 = new filesystem(new replica());
// get ino for /
$ino_root = $fs1->lookup("/");
// create /home/bob
$ino_home = $fs1->mkdir($ino_root, "home" );
$ino_bob = $fs1->mkdir($ino_home, "bob" );
$fs2->replica->apply_log_ops($fs1->replica->state->log_op_list);
if($fs1->is_equal($fs2)) {
echo "\n== Pass! replica1 and replica2 filesystems match. ==\n";
} else {
echo "\n== Fail! replica1 and replica2 filesystems do not match. ==\n";
$fs1->print_current_state("created /home/bob. (replica1 state)");
$fs2->print_current_state("created /home/bob. (replica2 state)");
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function test_concurrent_moves_no_conflict() {\n $r1 = new replica();\n $r2 = new replica();\n\n // Setup initial tree state.\n $ops = [new op_move($r1->tick(), null, \"root\", $root_id = new_id()),\n new op_move($r1->tick(), $root_id, \"a\", $a_id = new_id()),\n new op_move($r1->tick(), $root_id, \"b\", $b_id = new_id()),\n ];\n\n $r1->apply_ops($ops); // applied own ops\n $r2->apply_ops($ops); // merged ops from r1.\n\n echo \"Initial tree state on both replicas\\n\";\n print_tree($r1->state->tree);\n\n // replica_1 moves /root/a to /root/c\n $repl1_ops = [new op_move($r1->tick(), $root_id, \"c\", $a_id)];\n\n // replica_2 \"simultaneously\" moves /root/b to /root/d\n $repl2_ops = [new op_move($r2->tick(), $root_id, \"d\", $b_id)];\n\n // replica_1 applies his op, then merges op from replica_2\n $r1->apply_ops($repl1_ops);\n\n echo \"\\nreplica_1 tree after move\\n\";\n print_tree($r1->state->tree);\n $r1->apply_ops($repl2_ops);\n\n // replica_2 applies his op, then merges op from replica_1\n $r2->apply_ops($repl2_ops);\n echo \"\\nreplica_2 tree after move\\n\";\n print_tree($r2->state->tree);\n $r2->apply_ops($repl1_ops);\n\n // expected result: state is the same on both replicas\n // and final path is /root/c/a because last-writer-wins\n // and replica_2's op has a later timestamp.\n if ($r1->state->is_equal($r2->state)) {\n echo \"\\nreplica_1 state matches replica_2 state after each merges other's change. conflict resolved!\\n\";\n print_replica_trees($r1->state, $r2->state);\n } else {\n echo \"\\nwarning: replica_1 state does not match replica_2 state after merge\\n\";\n print_replica_trees($r1->state, $r2->state);\n file_put_contents(\"/tmp/repl1.json\", json_encode($r1, JSON_PRETTY_PRINT));\n file_put_contents(\"/tmp/repl2.json\", json_encode($r2, JSON_PRETTY_PRINT));\n }\n $r1->state->check_log_is_descending();\n return;\n}",
"function test_concurrent_moves() {\n $r1 = new replica();\n $r2 = new replica();\n\n // Setup initial tree state.\n $ops = [new op_move($r1->tick(), null, \"root\", $root_id = new_id()),\n new op_move($r1->tick(), $root_id, \"a\", $a_id = new_id()),\n new op_move($r1->tick(), $root_id, \"b\", $b_id = new_id()),\n new op_move($r1->tick(), $root_id, \"c\", $c_id = new_id()),\n ];\n\n $r1->apply_ops($ops); // applied own ops\n $r2->apply_ops($ops); // merged ops from r1.\n\n echo \"Initial tree state on both replicas\\n\";\n print_tree($r1->state->tree);\n\n // replica_1 moves /root/a to /root/b\n $repl1_ops = [new op_move($r1->tick(), $b_id, \"a\", $a_id)];\n\n // replica_2 \"simultaneously\" moves /root/a to /root/c\n $repl2_ops = [new op_move($r2->tick(), $c_id, \"a\", $a_id)];\n\n // replica_1 applies his op, then merges op from replica_2\n $r1->apply_ops($repl1_ops);\n echo \"\\nreplica_1 tree after move\\n\";\n print_tree($r1->state->tree);\n $r1->apply_ops($repl2_ops);\n\n // replica_2 applies his op, then merges op from replica_1\n $r2->apply_ops($repl2_ops);\n echo \"\\nreplica_2 tree after move\\n\";\n print_tree($r2->state->tree);\n $r2->apply_ops($repl1_ops);\n\n // expected result: state is the same on both replicas\n // and final path is /root/c/a because last-writer-wins\n // and replica_2's op has a later timestamp.\n if ($r1->state->is_equal($r2->state)) {\n echo \"\\nreplica_1 state matches replica_2 state after each merges other's change. conflict resolved!\\n\";\n print_replica_trees($r1->state, $r2->state);\n } else {\n echo \"\\nwarning: replica_1 state does not match replica_2 state after merge\\n\";\n print_replica_trees($r1->state, $r2->state);\n file_put_contents(\"/tmp/repl1.json\", json_encode($r1, JSON_PRETTY_PRINT));\n file_put_contents(\"/tmp/repl2.json\", json_encode($r2, JSON_PRETTY_PRINT));\n }\n $r1->state->check_log_is_descending();\n return;\n}",
"function test_concurrent_moves_cycle() {\n $r1 = new replica();\n $r2 = new replica();\n\n // Setup initial tree state.\n $ops = [new op_move($r1->tick(), null, \"root\", $root_id = new_id()),\n new op_move($r1->tick(), $root_id, \"a\", $a_id = new_id()),\n new op_move($r1->tick(), $root_id, \"b\", $b_id = new_id()),\n new op_move($r1->tick(), $a_id, \"c\", $c_id = new_id()),\n ];\n\n $r1->apply_ops($ops); // applied own ops\n $r2->apply_ops($ops); // merged ops from r1.\n\n echo \"Initial tree state on both replicas\\n\";\n print_tree($r1->state->tree);\n\n // replica_1 moves /root/b to /root/a\n $repl1_ops = [new op_move($r1->tick(), $a_id, \"b\", $b_id)];\n\n // replica_2 \"simultaneously\" moves /root/a to /root/b\n $repl2_ops = [new op_move($r2->tick(), $b_id, \"a\", $a_id)];\n\n // replica_1 applies his op, then merges op from replica_2\n $r1->apply_ops($repl1_ops);\n\n echo \"\\nreplica_1 tree after move\\n\";\n print_tree($r1->state->tree);\n $r1->apply_ops($repl2_ops);\n\n // replica_2 applies his op, then merges op from replica_1\n $r2->apply_ops($repl2_ops);\n echo \"\\nreplica_2 tree after move\\n\";\n print_tree($r2->state->tree);\n $r2->apply_ops($repl1_ops);\n\n // expected result: state is the same on both replicas\n // and final path is /root/c/a because last-writer-wins\n // and replica_2's op has a later timestamp.\n if ($r1->state->is_equal($r2->state)) {\n echo \"\\nreplica_1 state matches replica_2 state after each merges other's change. conflict resolved!\\n\";\n print_replica_trees($r1->state, $r2->state);\n } else {\n echo \"\\nwarning: replica_1 state does not match replica_2 state after merge\\n\";\n print_replica_trees($r1->state, $r2->state);\n file_put_contents(\"/tmp/repl1.json\", json_encode($r1, JSON_PRETTY_PRINT));\n file_put_contents(\"/tmp/repl2.json\", json_encode($r2, JSON_PRETTY_PRINT));\n }\n $r1->state->check_log_is_descending();\n return;\n}",
"function test_apply_ops_random_order() {\n\n $r1 = new replica();\n $r2 = new replica();\n\n // Generate initial tree state.\n $ops = [new op_move($r1->tick(), null, \"root\", $root_id = new_id()),\n new op_move($r1->tick(), null, \"trash\", $trash_id = new_id()),\n new op_move($r1->tick(), $root_id, \"home\", $home_id = new_id()),\n new op_move($r1->tick(), $home_id, \"dilbert\", $dilbert_id = new_id()),\n new op_move($r1->tick(), $home_id, \"dogbert\", $dogbert_id = $dilbert_id),\n new op_move($r1->tick(), $dogbert_id, \"cycle_not_allowed\", $home_id),\n ];\n\n $r1->apply_ops($ops);\n $r1->state->check_log_is_descending();\n\n $start = microtime(true);\n $num_ops = count($ops);\n\n printf(\"Applying move operations from replica1 to replica2 in random orders...\\n\");\n $all_equal = true;\n\n for($i = 0; $i < 100000; $i ++) {\n $ops2 = $ops;\n shuffle($ops2);\n\n $r2 = new replica();\n $r2->apply_ops($ops2);\n\n if($i % 10000 == 0) {\n printf(\"$i... \");\n }\n $r2->state->check_log_is_descending();\n\n if (!$r1->state->is_equal($r2->state)) {\n file_put_contents(\"/tmp/repl1.json\", json_encode($r1, JSON_PRETTY_PRINT));\n file_put_contents(\"/tmp/repl2.json\", json_encode($r2, JSON_PRETTY_PRINT));\n file_put_contents(\"/tmp/ops1.json\", json_encode($ops, JSON_PRETTY_PRINT));\n file_put_contents(\"/tmp/ops2.json\", json_encode($ops2, JSON_PRETTY_PRINT));\n printf( \"\\nreplica_1 %s replica_2\\n\", $r1->state->is_equal($r2->state) ? \"is equal to\" : \"is not equal to\");\n $all_equal = false;\n break;\n }\n }\n $end = microtime(true);\n $elapsed = $end - $start;\n \n if($all_equal) {\n echo \"\\n\\nStates were consistent and log timestamps descending after each apply. :-)\\n\";\n } else {\n echo \"\\n\\nFound an inconsistent state. Check /tmp/ops{1,2}.json and /tmp/repl{1,2}.json.\\n\";\n }\n\n $tot_ops = $num_ops*$i;\n printf(\"\\nops_per_apply: %s, applies: %s, total_ops: %s, duration: %.8f, secs_per_op: %.8f\\n\", $num_ops, $i, $tot_ops, $elapsed, $elapsed / $tot_ops);\n}",
"public function testMoveTwice(): void\n {\n $this->document1->setResourceSegment('/products/news/content1-news');\n $this->phpcrMapper->save($this->document1);\n $this->sessionManager->getSession()->save();\n\n // first move\n $this->document1->setResourceSegment('/products/news/content2-news');\n $this->phpcrMapper->save($this->document1);\n $this->sessionManager->getSession()->save();\n\n // second move\n $this->document1->setResourceSegment('/products/asdf/content2-news');\n $this->phpcrMapper->save($this->document1);\n $this->sessionManager->getSession()->save();\n\n $oldNode = $this->defaultSession->getNode('/cmf/sulu_io/routes/de/products/news/content1-news');\n $newNode = $this->defaultSession->getNode('/cmf/sulu_io/routes/de/products/asdf/content2-news');\n\n $oldNodeMixins = $oldNode->getMixinNodeTypes();\n $newNodeMixins = $newNode->getMixinNodeTypes();\n\n $this->assertEquals('sulu:path', $newNodeMixins[0]->getName());\n // FIXME after change mixin works: $this->assertEquals('sulu:history', $oldNodeMixins[0]->getName());\n\n $this->assertEquals($newNode, $oldNode->getPropertyValue('sulu:content'));\n $this->assertEquals(\n $this->documentInspector->getNode($this->document1),\n $newNode->getPropertyValue('sulu:content')\n );\n\n // get content from new path\n $result = $this->phpcrMapper->loadByResourceLocator('/products/asdf/content2-news', 'sulu_io', 'de');\n $this->assertEquals($this->document1->getUuid(), $result);\n\n // get content from history should throw an exception\n $this->expectException(ResourceLocatorMovedException::class);\n $this->phpcrMapper->loadByResourceLocator('/products/news/content1-news', 'sulu_io', 'de');\n }",
"public function testMove(): void\n {\n $this->document1->setResourceSegment('/products/news/content1-news');\n $this->phpcrMapper->save($this->document1);\n $this->sessionManager->getSession()->save();\n\n // move\n $this->document1->setResourceSegment('/products/asdf/content2-news');\n $this->phpcrMapper->save($this->document1);\n $this->sessionManager->getSession()->save();\n\n $oldNode = $this->defaultSession->getNode('/cmf/sulu_io/routes/de/products/news/content1-news');\n $newNode = $this->defaultSession->getNode('/cmf/sulu_io/routes/de/products/asdf/content2-news');\n\n $oldNodeMixins = $oldNode->getMixinNodeTypes();\n $newNodeMixins = $newNode->getMixinNodeTypes();\n\n $this->assertEquals('sulu:path', $newNodeMixins[0]->getName());\n $this->assertEquals('sulu:path', $oldNodeMixins[0]->getName());\n\n $this->assertTrue($oldNode->getPropertyValue('sulu:history'));\n $this->assertEquals($newNode, $oldNode->getPropertyValue('sulu:content'));\n $this->assertEquals(\n $this->documentInspector->getNode($this->document1),\n $newNode->getPropertyValue('sulu:content')\n );\n\n // get content from new path\n $result = $this->phpcrMapper->loadByResourceLocator('/products/asdf/content2-news', 'sulu_io', 'de');\n $this->assertEquals($this->document1->getUuid(), $result);\n\n // get content from history should throw an exception\n $this->expectException(ResourceLocatorMovedException::class);\n $this->phpcrMapper->loadByResourceLocator('/products/news/content1-news', 'sulu_io', 'de');\n }",
"public function testMoveTwice()\n {\n $this->rlpMapper->save($this->content1, '/products/news/content1-news', 'default', 'de');\n $this->sessionManager->getSession()->save();\n\n // first move\n $this->rlpMapper->move('/products/news/content1-news', '/products/news/content2-news', 'default', 'de');\n $this->sessionManager->getSession()->save();\n\n // second move\n $this->rlpMapper->move('/products/news/content2-news', '/products/asdf/content2-news', 'default', 'de');\n $this->sessionManager->getSession()->save();\n\n $oldNode = $this->session->getNode('/cmf/default/routes/de/products/news/content1-news');\n $newNode = $this->session->getNode('/cmf/default/routes/de/products/asdf/content2-news');\n\n $oldNodeMixins = $oldNode->getMixinNodeTypes();\n $newNodeMixins = $newNode->getMixinNodeTypes();\n\n $this->assertEquals('sulu:path', $newNodeMixins[0]->getName());\n // FIXME after change mixin works: $this->assertEquals('sulu:history', $oldNodeMixins[0]->getName());\n\n $this->assertEquals($newNode, $oldNode->getPropertyValue('sulu:content'));\n $this->assertEquals($this->content1, $newNode->getPropertyValue('sulu:content'));\n\n // get content from new path\n $result = $this->rlpMapper->loadByResourceLocator('/products/asdf/content2-news', 'default', 'de');\n $this->assertEquals($this->content1->getIdentifier(), $result);\n\n // get content from history should throw an exception\n $this->setExpectedException('Sulu\\Component\\Content\\Exception\\ResourceLocatorMovedException');\n $result = $this->rlpMapper->loadByResourceLocator('/products/news/content1-news', 'default', 'de');\n }",
"public function testMove()\n {\n $this->rlpMapper->save($this->content1, '/products/news/content1-news', 'default', 'de');\n $this->sessionManager->getSession()->save();\n\n // move\n $this->rlpMapper->move('/products/news/content1-news', '/products/asdf/content2-news', 'default', 'de');\n $this->sessionManager->getSession()->save();\n\n $oldNode = $this->session->getNode('/cmf/default/routes/de/products/news/content1-news');\n $newNode = $this->session->getNode('/cmf/default/routes/de/products/asdf/content2-news');\n\n $oldNodeMixins = $oldNode->getMixinNodeTypes();\n $newNodeMixins = $newNode->getMixinNodeTypes();\n\n $this->assertEquals('sulu:path', $newNodeMixins[0]->getName());\n $this->assertEquals('sulu:path', $oldNodeMixins[0]->getName());\n\n $this->assertTrue($oldNode->getPropertyValue('sulu:history'));\n $this->assertEquals($newNode, $oldNode->getPropertyValue('sulu:content'));\n $this->assertEquals($this->content1, $newNode->getPropertyValue('sulu:content'));\n\n // get content from new path\n $result = $this->rlpMapper->loadByResourceLocator('/products/asdf/content2-news', 'default', 'de');\n $this->assertEquals($this->content1->getIdentifier(), $result);\n\n // get content from history should throw an exception\n $this->setExpectedException('Sulu\\Component\\Content\\Exception\\ResourceLocatorMovedException');\n $result = $this->rlpMapper->loadByResourceLocator('/products/news/content1-news', 'default', 'de');\n }",
"function do_op(op_move $op, tree $t): array {\n\n // When a replica applies a Move op to its tree, it also records\n // a corresponding LogMove op in its log. The t, p, m, and c\n // fields are taken directly from the Move record, while the oldp\n // field is filled in based on the state of the tree before the move.\n // If c did not exist in the tree, oldp is set to None. Otherwise\n // oldp records the previous parent and metadata of c.\n $oldp = $t->find($op->child_id);\n $log = new log_op_move($op, $oldp);\n\n // ensures no cycles are introduced. If the node c\n // is being moved, and c is an ancestor of the new parent\n // newp, then the tree is returned unmodified, ie the operation\n // is ignored.\n // Similarly, the operation is also ignored if c == newp\n if($op->child_id === $op->parent_id ||\n is_ancestor($t, $op->parent_id, $op->child_id)) {\n// echo \"tree unchanged!\\n\";\n return [$log, $t];\n }\n\n // Otherwise, the tree is updated by removing c from\n // its existing parent, if any, and adding the new\n // parent-child relationship (newp, m, c) to the tree.\n $t->rm_child($op->child_id);\n $tt = new tree_node($op->parent_id, $op->metadata);\n $t->add_node($op->child_id, $tt);\n// echo \"tree changed!\\n\";\n return [$log, $t];\n}",
"function drush_file_sync($source, $destination) {\n\n $only_public = drush_get_option('only-public', FALSE);\n $only_private = drush_get_option('only-private', FALSE);\n\n if ($only_public && $only_private) {\n drush_log(dt('Only one of --only-public or --only-private can be set'), 'error');\n return false;\n }\n\n // drush_unset_option() is needed to prevent the options for file-sync getting\n // passed through to core-rsync.\n // core-rync loads the original command line options to pass to rsync, so some\n // additional context-hacking is needed.\n // see drush_core_rsync() and drush_get_original_cli_args_and_options().\n $args = &drush_get_context('DRUSH_COMMAND_ARGS', array());\n $original_args = $args;\n\n $command = drush_get_command();\n foreach (array_keys($command['options']) as $option) {\n drush_unset_option($option, 'cli');\n\n $arg_index = array_search('--' . $option, $args);\n if ($arg_index !== FALSE) {\n unset($args[$arg_index]);\n }\n }\n $args = array_values($args);\n\n $public_result = FALSE;\n if (!$only_private) {\n drush_log(dt('Syncing public files'), 'status');\n $public_result = _drush_file_sync_path_alias($source, $destination, '%files');\n }\n\n $private_result = FALSE;\n if (!$only_public) {\n drush_log(dt('Syncing private files'), 'status');\n $private_result = _drush_file_sync_path_alias($source, $destination, '%private', $only_private? 'error': 'warning');\n }\n\n // Restore the original arguments just to be safe.\n $args = $original_args;\n\n if (\n (!$only_private && !$public_result)\n ||\n ($only_private && !$private_result)\n ) {\n // If public transfer is attempted but fails, it's always an error.\n // If private transfer is attempted but fails, it's an error if only\n // transferring private files was attempted.\n drush_log(dt('Sync could not complete successfully'), 'error');\n }\n else if (!$only_public && !$only_private && !$private_result) {\n // A private file path may not be defined, so it's only a warning if the\n // private transfer could not be completed while attempting to transfer all\n // files.\n drush_log(dt('Sync partially completed'), 'warning');\n }\n else {\n drush_log(dt('Sync completed successfully'), 'success');\n }\n}",
"public function method_MOVE( $destination, $overwrite, $path )\n{\n $multistatus = new DAV_Multistatus();\n \n // This might generate an exception, but that's OK:\n $retval = ($destination[0] == '/')\n ? $this->method_COPY( $destination, $overwrite )\n : $this->method_COPY_external( $destination, $overwrite );\n \n foreach ( $this as $member ) {\n try {\n $deeppath = DAV::slashify($path) . $member;\n $deepdest = DAV::slashify($destination) . (\n $destination[0] == '/' ? $member : DAV::urlencode($member)\n );\n $resource = DAV_Server::inst()->resource($deeppath);\n if (!$resource)\n $multistatus->addStatus(\n $deeppath, new DAV_Status(\n REST::HTTP_INTERNAL_SERVER_ERROR,\n \"Resource not found: $deeppath\"\n )\n );\n elseif ( $resource instanceof DAV_Collection )\n $resource->method_MOVE( $deepdest, $overwrite, $deeppath );\n elseif ($destination[0] == '/')\n $resource->method_MOVE( $deepdest, $overwrite );\n else\n $resource->method_MOVE_external( $deepdest, $overwrite );\n }\n catch (DAV_Status $e) {\n $multistatus->addStatus($deeppath, $e);\n }\n catch (DAV_Multistatus $e) {\n $multistatus->mergeWith($e);\n }\n }\n if ( count( $multistatus->statuses() ) )\n throw $multistatus;\n \n try { $this->method_DELETE(); }\n catch (DAV_Status $e) {}\n \n return $retval;\n}",
"public function testOnMovedDocument() {\n\n $obj = new FileSystemStorageProvider($this->logger, getcwd());\n\n $this->dir3->setParentBackedUp($this->dir3->getParent());\n $this->dir2->removeChildren($this->dir3);\n $this->dir1->addChildren($this->dir3);\n\n $obj->onMovedDocument($this->dir3);\n $this->assertFileExists($this->directory . \"/1/3\");\n }",
"function sync_file_move($old, $new)\n{\n require_code('files2');\n _sync_file_move($old, $new);\n}",
"public function testMoveFolder()\n {\n $remoteFolder = \"TestData/In\";\n\n $localName = \"Book1.xlsx\";\n $remoteName = \"Book1.xlsx\";\n\n CellsApiTestBase::ready( $this->instance,$localName ,$remoteFolder . \"/\" . $remoteName , \"\");\n \n $request = new MoveFolderRequest();\n $request->setSrcPath( \"OutResult/Create\");\n $request->setDestPath( \"OutResult/Move\");\n $request->setSrcStorageName( \"\");\n $request->setDestStorageName( \"\");\n $this->instance->moveFolder($request);\n }",
"static public function movePhysically($old_path, $new_path)\n {\n\n if(!is_dir($old_path))\n {\n return true;\n }\n \n if (!is_dir($new_path) || !is_writable($new_path))\n {\n $old = umask(0);\n mkdir($new_path, 0770);\n umask($old); \n }\n \n $files = sfFinder::type('file')->maxdepth(0)->in($old_path);\n $success = true;\n\n foreach ($files as $file)\n {\n $success = rename($file, $new_path . '/' . basename($file)) && $success;\n }\n if ($success)\n {\n $folders = sfFinder::type('dir')->maxdepth(0)->in($old_path);\n foreach($folders as $folder)\n {\n $new_name = substr($folder, strlen($old_path));\n $success = self::movePhysically($folder, $new_path . '/' . $new_name) && $success;\n }\n }\n \n $success = rmdir($old_path) && $success;\n\n return $success;\n }",
"function apply_ops_to_replicas(array $replicas, array $ops) {\n foreach($replicas as $r) {\n $r->apply_ops($ops);\n }\n}",
"public function testInconsistentSiblings()\n {\n $unit1 = $this->getUnit('shipment');\n $unit1->setReversedMapping([\n 'total' => 'map.total'\n ]);\n $unit1->setReversedConnection([\n 'shipment_id' => 'shipment_id',\n ]);\n $unit1->setMapping([\n 'shipment_id' => 'map.shipment_id',\n 'total' => 'map.total',\n ]);\n $unit1->setFilesystem($this->getFS(\n [\n [1, 30],\n [2, 33],\n [3, 55],\n [4, 11],\n false,\n ]\n ));\n $unit1->setIsEntityCondition(function (MapInterface $map) {\n return !empty($map['shipment_id']);\n });\n $unit1->setTmpFileName('shipment_tmp.csv');\n\n $unit3 = $this->getUnit('tracking');\n $unit3->setReversedMapping([\n 'tracking_number' => 'map.tracking_number',\n ]);\n $unit3->setReversedConnection([\n 'shipment_id' => 'shipment_id',\n ]);\n $unit3->setMapping([\n 'id' => 'map.incr(\"track_id\", 1)',\n 'tracking_number' => 'map.tracking_number',\n 'shipment_id' => 'map.shipment_id',\n ]);\n $unit3->setFilesystem($this->getFS(\n [\n [1, '56465454', 1],\n [2, '13122333', 3],\n [3, '13343443', 4],\n false,\n ]\n ));\n $unit3->setTmpFileName('tracking_tmp.csv');\n $unit3->addSibling($unit1);\n $unit3->setOptional(true);\n\n $expected = [\n [[\n 'total' => 30,\n 'tracking_number' => '56465454',\n ]],\n [[\n 'total' => 33,\n 'tracking_number' => null,\n ]],\n [[\n 'total' => 55,\n 'tracking_number' => '13122333',\n ]],\n [[\n 'total' => 11,\n 'tracking_number' => '13343443',\n ]],\n ];\n\n $action = $this->getAction([$unit1, $unit3], $expected);\n $action->process($this->getResultMock());\n }",
"public function testMoveMovesStorages()\n {\n file_put_contents(self::$temp.DS.'foo.txt', 'foo');\n\n Storage::move(self::$temp.DS.'foo.txt', self::$temp.DS.'bar.txt');\n\n $this->assertTrue(is_file(self::$temp.DS.'bar.txt'));\n $this->assertFalse(is_file(self::$temp.DS.'foo.txt'));\n }",
"public function testParallelPatchPatchOther(): void {\n $loc1 = $this->createMetadataResource();\n $loc2 = $this->createMetadataResource();\n $prop = 'http://foo';\n\n $txId = $this->beginTransaction();\n $headers = [\n self::$config->rest->headers->transactionId => $txId,\n 'Eppn' => 'admin',\n 'Content-Type' => 'application/n-triples',\n ];\n $req1 = new Request('patch', $loc1 . '/metadata', $headers, \"<$loc1> <$prop> \\\"value1\\\" .\");\n $req2 = new Request('patch', $loc2 . '/metadata', $headers, \"<$loc2> <$prop> \\\"value2\\\" .\");\n list($resp1, $resp2) = $this->runConcurrently([$req1, $req2], 0);\n $h1 = $resp1->getHeaders();\n $h2 = $resp2->getHeaders();\n $this->assertEquals(200, $resp1->getStatusCode());\n $this->assertEquals(200, $resp2->getStatusCode());\n $this->assertLessThan(min($h1['Time'][0], $h2['Time'][0]) / 2, abs($h1['Start-Time'][0] - $h2['Start-Time'][0])); // make sure they were executed in parallel\n $r1 = $this->extractResource($resp1->getBody(), $loc1);\n $r2 = $this->extractResource($resp2->getBody(), $loc2);\n $this->assertEquals('value1', $r1->getLiteral($prop));\n $this->assertEquals('value2', $r2->getLiteral($prop));\n }",
"public function testMoveDirectoryMovesEntireDirectoryAndOverwrites()\n {\n mkdir(self::$temp.DS.'tmp4', 0777, true);\n file_put_contents(self::$temp.DS.'tmp4'.DS.'foo.txt', '');\n file_put_contents(self::$temp.DS.'tmp4'.DS.'bar.txt', '');\n\n mkdir(self::$temp.DS.'tmp4'.DS.'nested', 0777, true);\n file_put_contents(self::$temp.DS.'tmp4'.DS.'nested'.DS.'baz.txt', '');\n\n mkdir(self::$temp.DS.'tmp5', 0777, true);\n file_put_contents(self::$temp.DS.'tmp5'.DS.'foo2.txt', '');\n file_put_contents(self::$temp.DS.'tmp5'.DS.'bar2.txt', '');\n\n Storage::mvdir(self::$temp.DS.'tmp4', self::$temp.DS.'tmp5', true);\n\n $this->assertTrue(is_dir(self::$temp.DS.'tmp5'));\n $this->assertTrue(is_file(self::$temp.DS.'tmp5'.DS.'foo.txt'));\n $this->assertTrue(is_file(self::$temp.DS.'tmp5'.DS.'bar.txt'));\n $this->assertTrue(is_dir(self::$temp.DS.'tmp5'.DS.'nested'));\n $this->assertTrue(is_file(self::$temp.DS.'tmp5'.DS.'nested'.DS.'baz.txt'));\n\n $this->assertFalse(is_file(self::$temp.DS.'tmp5'.DS.'foo2.txt'));\n $this->assertFalse(is_file(self::$temp.DS.'tmp5'.DS.'bar2.txt'));\n $this->assertFalse(is_dir(self::$temp.DS.'tmp4'));\n }",
"protected function _syncTrapped() {}",
"public function testSubmitConflicts()\n {\n // create a second client.\n $client = new Client;\n $client->setId(\"client-2\")\n ->setRoot($this->getP4Params('clientRoot') . '/client-2')\n ->addView(\"//depot/...\", \"//client-2/...\")\n ->save();\n\n // connect w. second client.\n $p4 = Connection::factory(\n $this->p4->getPort(),\n $this->p4->getUser(),\n $client->getId(),\n $this->getP4Params('password')\n );\n\n // create a situation where resolve is needed.\n // a. from the main test client add/submit 'foo', then edit it.\n // b. from another client sync/edit/submit 'foo'.\n $file1 = new File;\n $file1->setFilespec(\"//depot/foo\")\n ->setLocalContents(\"contents-1\")\n ->add()\n ->submit(\"change 1\")\n ->edit();\n $file2 = new File($p4);\n $file2->setFilespec(\"//depot/foo\")\n ->sync()\n ->edit()\n ->submit(\"change 2\");\n\n // try to submit a change w. files needing resolve.\n $change = new Change;\n try {\n $change->addFile($file1)\n ->submit(\"main client submit\");\n $this->fail(\"Unexpected success; submit should fail.\");\n } catch (ConflictException $e) {\n $files = $change->getFilesToResolve();\n $this->assertEquals(\n 1,\n count($files),\n \"Expected one file needing resolve for submit.\"\n );\n $this->assertSame(\n $file1->getFilespec(),\n $files[0]->getFilespec(),\n \"Expected matching filespecs.\"\n );\n }\n\n // create a situation where revert is needed.\n // a. from the main test client add 'foo'.\n // b. from another client add/submit 'foo'.\n $file1 = new File;\n $file1->setFilespec(\"//depot/bar\")\n ->setLocalContents(\"contents-1\")\n ->add();\n $file2 = new File($p4);\n $file2->setFilespec(\"//depot/bar\")\n ->setLocalContents(\"contents-1\")\n ->add()\n ->submit(\"change 2\")\n ->edit()\n ->submit(\"change 3\");\n\n // try to submit a change w. files needing revert.\n $change = new Change;\n try {\n $change->addFile($file1)\n ->submit(\"main client submit\");\n $this->fail(\"Unexpected success; submit should fail.\");\n } catch (ConflictException $e) {\n $files = $change->getFilesToRevert();\n $this->assertEquals(\n 1,\n count($files),\n \"Expected one file needing resolve for revert.\"\n );\n $this->assertSame(\n $file1->getFilespec(),\n $files[0]->getFilespec(),\n \"Expected matching filespecs.\"\n );\n }\n\n // create another situation where revert is needed.\n // a. from the main test client add/submit 'foo', then edit it.\n // b. from another client sync/delete/submit 'foo'.\n $file1 = new File;\n $file1->setFilespec(\"//depot/baz\")\n ->setLocalContents(\"contents-1\")\n ->add()\n ->submit(\"change 1\")\n ->edit();\n $file2 = new File($p4);\n $file2->setFilespec(\"//depot/baz\")\n ->sync()\n ->delete()\n ->submit(\"change 2\");\n\n // try to submit a change w. files needing revert.\n $change = new Change;\n try {\n $change->addFile($file1)\n ->submit(\"main client submit\");\n $this->fail(\"Unexpected success; submit should fail.\");\n } catch (ConflictException $e) {\n $files = $change->getFilesToRevert();\n $this->assertSame(\n 1,\n count($files),\n \"Expected one file needing resolve.\"\n );\n $this->assertSame(\n $file1->getFilespec(),\n $files[0]->getFilespec(),\n \"Expected matching filespecs.\"\n );\n }\n }",
"public function testSyncEntitiesFromOneRemoteService()\n {\n $this->setupRemoteService();\n\n //Setup the synchonization configuration\n $this->setupConfiguration();\n\n //Setup the synchronization state\n $this->setSyncState();\n\n //Perform synchronization\n $this->manager->execute(array('product'));\n\n\n //Test if all requested entities have been synced\n $state = $this->manager->getState('product');\n\n $this->assertEquals($state->getLastValue(), 10);\n\n }",
"public function beforeSyncing() {}",
"public function is_equal(filesystem $other) {\n return count($this->ino_inodes_local) == count($other->ino_inodes_local) &&\n count($this->uuid_inodes_local) == count($other->uuid_inodes_local) &&\n $this->ino_counter == $other->ino_counter &&\n $this->replica->state == $other->replica->state;\n }",
"public function testReplicateTo()\n {\n if ('05-06' == substr($this->fixture->getDBVersion(), 0, 5)) {\n $this->markTestSkipped('With MySQL 5.6 ARC2_Store::replicateTo does not work. Tables keep their names.');\n }\n\n // test data\n $this->fixture->query('INSERT INTO <http://example.com/> {\n <http://s> <http://p1> \"2009-05-28T18:03:38+09:00\" .\n <http://s> <http://p1> \"2009-05-28T18:03:38+09:00GMT\" .\n <http://s> <http://p1> \"21 August 2007\" .\n }');\n\n // replicate\n $this->fixture->replicateTo('replicate');\n\n /*\n * check for new prefixes\n */\n $tables = $this->fixture->getDBObject()->fetchList('SHOW TABLES');\n $foundArcPrefix = $foundReplicatePrefix = false;\n foreach($tables as $table) {\n // check for original table\n if (false !== strpos($table['Tables_in_'.$this->dbConfig['db_name']], $this->dbConfig['store_name'].'_')) {\n $foundArcPrefix = true;\n // check for replicated table\n } elseif (false !== strpos($table['Tables_in_'.$this->dbConfig['db_name']], 'replicate_')) {\n $foundReplicatePrefix = true;\n }\n }\n\n $this->assertTrue($foundArcPrefix);\n $this->assertTrue($foundReplicatePrefix);\n }",
"public function move(Storable $storable, StorableLocator $storableLocator): void;",
"function mover($source, $dest, $overwrite = false)\n{\n $a1 = copyr($source, $dest, $overwrite);\n if (!$a1) {\n return false;\n }\n\n $a2 = rmdirr($source);\n return $a2;\n}",
"public function testTwoServersSame(): void\n {\n $client = $this->_getClient(['connections' => [\n ['host' => $this->_getHost(), 'port' => 9200],\n ['host' => $this->_getHost(), 'port' => 9200],\n ]]);\n $index = $client->getIndex('elastica_test1');\n $index->create([], [\n 'recreate' => true,\n ]);\n\n // Adds 1 document to the index\n $doc1 = new Document(\n '1',\n ['username' => 'hans', 'test' => ['2', '3', '5']]\n );\n $index->addDocument($doc1);\n\n // Adds a list of documents with _bulk upload to the index\n $docs = [];\n $docs[] = new Document(\n '2',\n ['username' => 'john', 'test' => ['1', '3', '6']]\n );\n $docs[] = new Document(\n '3',\n ['username' => 'rolf', 'test' => ['2', '3', '7']]\n );\n $index->addDocuments($docs);\n\n // Refresh index\n $index->refresh();\n\n $index->search('rolf');\n }",
"public function testCanMethodSyncRoles()\n\t{\n\t\t$acl1 = \\Orchestra\\Support\\Acl::make('mock-one');\n\t\t$acl2 = \\Orchestra\\Support\\Acl::make('mock-two');\n\n\t\t\\Orchestra\\Support\\Acl::add_role('admin');\n\t\t\\Orchestra\\Support\\Acl::add_role('manager');\n\n\t\t$this->assertTrue($acl1->has_role('admin'));\n\t\t$this->assertTrue($acl2->has_role('admin'));\n\t\t$this->assertTrue($acl1->has_role('manager'));\n\t\t$this->assertTrue($acl2->has_role('manager'));\n\n\t\t\\Orchestra\\Support\\Acl::remove_role('manager');\n\n\t\t$this->assertTrue($acl1->has_role('admin'));\n\t\t$this->assertTrue($acl2->has_role('admin'));\n\t\t$this->assertFalse($acl1->has_role('manager'));\n\t\t$this->assertFalse($acl2->has_role('manager'));\n\n\t\t$this->assertTrue(is_array(\\Orchestra\\Support\\Acl::all()));\n\t\t$this->assertFalse(array() === \\Orchestra\\Support\\Acl::all());\n\n\t\t\\Orchestra\\Support\\Acl::shutdown();\n\n\t\t$this->assertEquals(array(), \\Orchestra\\Support\\Acl::all());\n\t}",
"public function mirrorFileCopiesTheGivenFileIfTheSettingSaysSo()\n {\n $sourcePathAndFilename = tempnam('FlowFileSystemPublishingTargetTestSource', '');\n $targetPathAndFilename = tempnam('FlowFileSystemPublishingTargetTestTarget', '');\n\n file_put_contents($sourcePathAndFilename, 'some data');\n touch($sourcePathAndFilename, time() - 5);\n\n $settings = array('resource' => array('publishing' => array('fileSystem' => array('mirrorMode' => 'copy'))));\n\n $publishingTarget = $this->getAccessibleMock('TYPO3\\Flow\\Resource\\Publishing\\FileSystemPublishingTarget', array('dummy'));\n $publishingTarget->injectSettings($settings);\n\n $publishingTarget->_call('mirrorFile', $sourcePathAndFilename, $targetPathAndFilename, true);\n $this->assertFileEquals($sourcePathAndFilename, $targetPathAndFilename);\n\n clearstatcache();\n $this->assertSame(filemtime($sourcePathAndFilename), filemtime($targetPathAndFilename));\n\n unlink($sourcePathAndFilename);\n unlink($targetPathAndFilename);\n }",
"public function testExecuteSkipDataByLastSyncPosition()\n {\n // Set initial start position, if not sure, 0 always returns results.\n $this->setLastSync(0, BinlogParser::START_TYPE_POSITION);\n // Set service so, that it would use last sync position.\n $this\n ->getServiceContainer()\n ->get('ongr_connections.sync.diff_provider.binlog_diff_provider')\n ->setStartType(BinlogParser::START_TYPE_POSITION);\n\n // Creating db and execute some transactions which should not be in final changes log.\n $this->importData('ExtractorTest/sample_db_to_skip.sql');\n\n $this->executeCommand(static::$kernel);\n\n $last_sync_position_1 = $this\n ->getServiceContainer()\n ->get('ongr_connections.pair_storage')\n ->get(BinlogDiffProvider::LAST_SYNC_POSITION_PARAM);\n $this->assertGreaterThan(0, $last_sync_position_1);\n\n foreach ($this->shopIds as $shopId) {\n // Delete data from sync storage, to test if only data from last sync position is processed.\n $storageData = $this\n ->getServiceContainer()\n ->get('ongr_connections.sync.sync_storage')\n ->getChunk(8, null, $shopId);\n\n foreach ($storageData as $storageDataItem) {\n $this\n ->getServiceContainer()\n ->get('ongr_connections.sync.sync_storage')\n ->deleteItem($storageDataItem['id']);\n }\n }\n\n // Execute transactions which should be in changes log.\n $this->importData('ExtractorTest/sample_db_to_use.sql');\n\n // There is some kind of an undocumented feature/bug, in which if kernel is not rebooted,\n // when executing Command second time from same process, after inserting new data\n // it can't add new data to sync storage table, but only if Command was executed earlier.\n static::bootKernel();\n static::$kernel\n ->getContainer()\n ->get('ongr_connections.sync.diff_provider.binlog_diff_provider')\n ->setStartType(BinlogParser::START_TYPE_POSITION);\n\n $commandTester = $this->executeCommand(static::$kernel);\n\n $last_sync_position_2 = $this\n ->getServiceContainer()\n ->get('ongr_connections.pair_storage')\n ->get(BinlogDiffProvider::LAST_SYNC_POSITION_PARAM);\n\n $this->assertGreaterThan($last_sync_position_1, $last_sync_position_2);\n\n foreach ($this->shopIds as $shopId) {\n $expectedData = [\n [\n 'type' => ActionTypes::UPDATE,\n 'document_type' => 'category',\n 'document_id' => 'cat0',\n 'status' => '0',\n 'shop_id' => $shopId,\n ],\n [\n 'type' => ActionTypes::CREATE,\n 'document_type' => 'product',\n 'document_id' => 'art0',\n 'status' => '0',\n 'shop_id' => $shopId,\n ],\n [\n 'type' => ActionTypes::CREATE,\n 'document_type' => 'product',\n 'document_id' => 'art2',\n 'status' => '0',\n 'shop_id' => $shopId,\n ],\n [\n 'type' => ActionTypes::UPDATE,\n 'document_type' => 'product',\n 'document_id' => 'art0',\n 'status' => '0',\n 'shop_id' => $shopId,\n ],\n\n [\n 'type' => ActionTypes::UPDATE,\n 'document_type' => 'product',\n 'document_id' => 'art2',\n 'status' => '0',\n 'shop_id' => $shopId,\n ],\n [\n 'type' => ActionTypes::DELETE,\n 'document_type' => 'product',\n 'document_id' => 'art1',\n 'status' => '0',\n 'shop_id' => $shopId,\n ],\n ];\n\n $storageData = $this->getSyncData(count($expectedData), 0, $shopId);\n\n $this->assertEquals($expectedData, $storageData);\n }\n\n $output = $commandTester->getDisplay();\n\n $this->assertContains('Job finished', $output);\n }",
"public function testParallelPatchPatchSame(): void {\n $location = $this->createMetadataResource();\n $prop = 'http://foo';\n\n $txId = $this->beginTransaction();\n $headers = [\n self::$config->rest->headers->transactionId => $txId,\n 'Eppn' => 'admin',\n 'Content-Type' => 'application/n-triples',\n ];\n $req1 = new Request('patch', $location . '/metadata', $headers, \"<$location> <$prop> \\\"value1\\\" .\");\n $req2 = new Request('patch', $location . '/metadata', $headers, \"<$location> <$prop> \\\"value2\\\" .\");\n list($resp1, $resp2) = $this->runConcurrently([$req1, $req2], 50000);\n $codes = [$resp1->getStatusCode(), $resp2->getStatusCode()];\n $this->assertContains(200, $codes);\n $this->assertContains(409, $codes);\n }",
"public function testShiftTasksAll() {\n\t\t$milestone1_pre = $this->Milestone->findById(1);\n\t\t$milestone3_pre = $this->Milestone->findById(3);\n\n\t\t$this->assertEqual($milestone1_pre['Tasks'], array(\n\t\t\t'open' => array('numTasks' => '2', 'points' => '0'),\n\t\t\t'in progress' => array('numTasks' => '2', 'points' => '0'),\n\t\t\t'resolved' => array('numTasks' => '1', 'points' => '0'),\n\t\t\t'closed' => array('numTasks' => '1', 'points' => '0'),\n\t\t\t'dropped' => array('numTasks' => '1', 'points' => '0'),\n\t\t));\n\t\t$this->assertEqual($milestone3_pre['Tasks'], array(\n\t\t\t'open' => array('numTasks' => '0', 'points' => '0'),\n\t\t\t'in progress' => array('numTasks' => '0', 'points' => '0'),\n\t\t\t'resolved' => array('numTasks' => '0', 'points' => '0'),\n\t\t\t'closed' => array('numTasks' => '0', 'points' => '0'),\n\t\t\t'dropped' => array('numTasks' => '0', 'points' => '0'),\n\t\t));\n\t\t$this->Milestone->shiftTasks(1, 3, true, array('callbacks' => false));\n\n\t\t$milestone1_post = $this->Milestone->findById(1);\n\t\t$milestone3_post = $this->Milestone->findById(3);\n\t\t$this->assertEqual($milestone1_post['Tasks'], array(\n\t\t\t'open' => array('numTasks' => '0', 'points' => '0'),\n\t\t\t'in progress' => array('numTasks' => '0', 'points' => '0'),\n\t\t\t'resolved' => array('numTasks' => '0', 'points' => '0'),\n\t\t\t'closed' => array('numTasks' => '0', 'points' => '0'),\n\t\t\t'dropped' => array('numTasks' => '0', 'points' => '0'),\n\t\t));\n\t\t$this->assertEqual($milestone3_post['Tasks'], array(\n\t\t\t'open' => array('numTasks' => '2', 'points' => '0'),\n\t\t\t'in progress' => array('numTasks' => '2', 'points' => '0'),\n\t\t\t'resolved' => array('numTasks' => '1', 'points' => '0'),\n\t\t\t'closed' => array('numTasks' => '1', 'points' => '0'),\n\t\t\t'dropped' => array('numTasks' => '1', 'points' => '0'),\n\t\t));\n\t}",
"public function test_sync_withExistingIds_sameCountAndReturnTrue() {\n\t\t$this->repo->sync(789,91437);\n\t\t\n\t\t$expected = array(\n\t\t\t 'count'=>(integer)$this->repo->count(),\n\t\t\t 'result'=>true\n\t\t);\n\t\t\n\t\t\n\t\t//sync same numbers, count should not change\n\t\t$result = $this->repo->sync(789,91437);\n\t\t\n\t\t$actual = array(\n\t\t\t'count'=>(integer) $this->repo->count(),\n\t\t\t'result'=>$result\n\t\t);\n\t\t\n\t\t$this->assertEquals($expected,$actual);\n\t\t\n\t}",
"public function test_move()\n {\n $object = Directory::create(ROOT.DS.'test_dir');\n $object->move(SYSTEM);\n $this->assertTrue(is_dir(SYSTEM.DS.'test_dir'));\n $this->assertFalse(is_dir(ROOT.DS.'test_dir'));\n $this->assertEquals($object->get_path(), SYSTEM.DS.'test_dir');\n }",
"function mktree_ops(array &$ops, replica $r, $parent_id, $depth=2, $max_depth=12) {\n if($depth > $max_depth) {\n return;\n }\n for($i=0; $i < 2; $i++) {\n $name = sprintf( \"%s\", $i == 0 ? 'a' : 'b' );\n $ops[] = new op_move($r->tick(), $parent_id, $name, $child_id = new_id());\n mktree_ops($ops, $r, $child_id, $depth+1, $max_depth);\n }\n}",
"function _move_root2root($source, $target, $pos)\r\n\t{\r\n\t\t$lock = $this->_set_lock();\r\n\r\n\t\t$tb = $this->_node_table;\r\n\t\t$s_order = $source['ordr'];\r\n\t\t$t_order = $target['ordr'];\r\n\t\t$s_id = $source['id'];\r\n\t\t$t_id = $target['id'];\r\n\r\n\t\tif ($s_order < $t_order)\r\n\t\t{\r\n\t\t\tif ($pos == NESE_MOVE_BEFORE)\r\n\t\t\t{\r\n\t\t\t\t$sql = \"UPDATE {$tb} SET ordr=ordr-1\r\n WHERE ordr BETWEEN {$s_order} AND {$t_order} AND\r\n id!={$t_id} AND\r\n id!={$s_id} AND\r\n root_id=id\";\n \r\n\t\t\t\t$this->db->sql_exec($sql);\r\n\t\t\t\t$sql = \"UPDATE {$tb} SET ordr={$t_order}-1 WHERE id={$s_id}\";\r\n\t\t\t\t$this->db->sql_exec($sql);\r\n\t\t\t} \n\t\t\telseif ($pos == NESE_MOVE_AFTER)\r\n\t\t\t{\r\n\t\t\t\t$sql = \"UPDATE {$tb} SET ordr=ordr-1\r\n WHERE ordr BETWEEN {$s_order} AND {$t_order} AND\r\n id!={$s_id} AND\r\n root_id=id\";\n \r\n\t\t\t\t$this->db->sql_exec($sql);\r\n\r\n\t\t\t\t$sql = \"UPDATE {$tb} SET ordr={$t_order} WHERE id={$s_id}\";\r\n\t\t\t\t$this->db->sql_exec($sql);\r\n\t\t\t} \r\n\t\t} \r\n\r\n\t\tif ($s_order > $t_order)\r\n\t\t{\r\n\t\t\tif ($pos == NESE_MOVE_BEFORE)\r\n\t\t\t{\r\n\t\t\t\t$sql = \"UPDATE {$tb} SET ordr=ordr+1\r\n WHERE ordr BETWEEN {$t_order} AND {$s_order} AND\r\n id != {$s_id} AND\r\n root_id=id\";\r\n\t\t\t\t$this->db->sql_exec($sql);\r\n\r\n\t\t\t\t$sql = \"UPDATE {$tb} SET ordr={$t_order} WHERE id={$s_id}\";\r\n\t\t\t\t$this->db->sql_exec($sql);\r\n\t\t\t} \n\t\t\telseif ($pos == NESE_MOVE_AFTER)\r\n\t\t\t{\r\n\t\t\t\t$sql = \"UPDATE $tb SET ordr=ordr+1\r\n WHERE ordr BETWEEN $t_order AND $s_order AND\r\n id!=$t_id AND\r\n id!=$s_id AND\r\n root_id=id\";\r\n\t\t\t\t$this->db->sql_exec($sql);\r\n\r\n\t\t\t\t$sql = \"UPDATE {$tb} SET ordr={$t_order}+1 WHERE id={$s_id}\";\r\n\t\t\t\t$this->db->sql_exec($sql);\r\n\t\t\t} \r\n\t\t} \r\n\t\t$this->_release_lock();\r\n\t\treturn $s_id;\r\n\t}",
"public function testShiftTasksNothingToShift() {\n\t\t$milestone5_pre = $this->Milestone->findById(5);\n\t\t$milestone1_pre = $this->Milestone->findById(1);\n\n\t\t$this->assertEqual($milestone5_pre['Tasks'], array(\n\t\t\t'open' => array('numTasks' => '0', 'points' => '0'),\n\t\t\t'in progress' => array('numTasks' => '0', 'points' => '0'),\n\t\t\t'resolved' => array('numTasks' => '0', 'points' => '0'),\n\t\t\t'closed' => array('numTasks' => '0', 'points' => '0'),\n\t\t\t'dropped' => array('numTasks' => '0', 'points' => '0'),\n\t\t));\n\t\t$this->assertEqual($milestone1_pre['Tasks'], array(\n\t\t\t'open' => array('numTasks' => '2', 'points' => '0'),\n\t\t\t'in progress' => array('numTasks' => '2', 'points' => '0'),\n\t\t\t'resolved' => array('numTasks' => '1', 'points' => '0'),\n\t\t\t'closed' => array('numTasks' => '1', 'points' => '0'),\n\t\t\t'dropped' => array('numTasks' => '1', 'points' => '0'),\n\t\t));\n\n\t\t// Shift only the non-resolved/closed tasks and check all is well\n\t\t$this->Milestone->shiftTasks(5, 1, false, array('callbacks' => false));\n\n\t\t$milestone5_post = $this->Milestone->findById(5);\n\t\t$milestone1_post = $this->Milestone->findById(1);\n\t\t$this->assertEqual($milestone5_post['Tasks'], array(\n\t\t\t'open' => array('numTasks' => '0', 'points' => '0'),\n\t\t\t'in progress' => array('numTasks' => '0', 'points' => '0'),\n\t\t\t'resolved' => array('numTasks' => '0', 'points' => '0'),\n\t\t\t'closed' => array('numTasks' => '0', 'points' => '0'),\n\t\t\t'dropped' => array('numTasks' => '0', 'points' => '0'),\n\t\t));\n\t\t$this->assertEqual($milestone1_post['Tasks'], array(\n\t\t\t'open' => array('numTasks' => '2', 'points' => '0'),\n\t\t\t'in progress' => array('numTasks' => '2', 'points' => '0'),\n\t\t\t'resolved' => array('numTasks' => '1', 'points' => '0'),\n\t\t\t'closed' => array('numTasks' => '1', 'points' => '0'),\n\t\t\t'dropped' => array('numTasks' => '1', 'points' => '0'),\n\t\t));\n\t}",
"public function testCopyFolder()\n {\n $remoteFolder = \"TestData/In\";\n\n $localName = \"Book1.xlsx\";\n $remoteName = \"Book1.xlsx\";\n\n CellsApiTestBase::ready( $this->instance,$localName ,$remoteFolder . \"/\" . $remoteName , \"\");\n \n $request = new CopyFolderRequest();\n $request->setSrcPath( $remoteFolder);\n $request->setDestPath( \"OutResult/Create\");\n $request->setSrcStorageName( \"\");\n $request->setDestStorageName( \"\");\n $this->instance->copyFolder($request);\n }",
"public function testMoveNotExist()\n {\n $this->rlpMapper->save($this->content1, '/news/news-1', 'default', 'de');\n $this->sessionManager->getSession()->save();\n\n $this->setExpectedException('Sulu\\Component\\Content\\Exception\\ResourceLocatorNotFoundException');\n $this->rlpMapper->move('/news', '/neuigkeiten', 'default', 'de');\n }",
"function _pm_update_move_files($src_dir, $dest_dir, $skip_list, $remove_conflicts = TRUE) {\n $items_to_move = drush_scan_directory($src_dir, '/.*/', array_merge(array('.', '..'), $skip_list), 0, FALSE, 'filename', 0, TRUE);\n foreach ($items_to_move as $filename => $info) {\n if ($remove_conflicts) {\n drush_delete_dir($dest_dir . '/' . basename($filename));\n }\n if (!file_exists($dest_dir . '/' . basename($filename))) {\n $move_result = drush_move_dir($filename, $dest_dir . '/' . basename($filename));\n }\n }\n return TRUE;\n}",
"public function performSyncOperation() {\n switch ($this->syncOperation) {\n case 'create':\n // Sets up the data array\n $data['LdapObject'] = $this->stagingData;\n $dn = 'uid' . '=' . $this->stagingData['uid'] . ',' . $this->LdapObject->getLdapContext();\n $data['LdapObject']['dn'] = $dn;\n $data['LdapObject']['objectclass'] = $this->ldapObjectClass;\n \n // Save the data\n $createResult = $this->LdapObject->save($data);\n \n if ($createResult) {\n $this->log('SYNC: Created LDAP Object: ' . $createResult['LdapObject']['dn'], LOG_INFO);\n // Sets the properties on the LdapObject for reporting the sync result\n $this->LdapObject->id = $dn;\n $this->LdapObject->primaryKey = 'dn';\n } else {\n $this->log('SYNC: Failed to create LDAP Object: ' . $dn . '. Salesforce ID: '. $this->sforceData['Id'] . '. LDAP Error: ' . $this->LdapObject->getLdapError() . '.', LOG_ERR);\n }\n break;\n case 'update':\n // Push everything to lower case, so String comparison will be accurate.\n $stagingObject = array_change_key_case($this->stagingData, CASE_LOWER);\n $ldapObject = array_change_key_case($this->ldapData, CASE_LOWER);\n // Diff the arrays. Should be efficient. Since we are doing a one way push from Salesforce\n // to LDAP, this also provides a clean way to get exactly the attributes we want to update.\n $diffObject = array_diff_assoc($stagingObject, $ldapObject);\n if (!empty($diffObject)) {\n $data['LdapObject'] = $diffObject;\n \n // Save the data\n $updateResult = $this->LdapObject->save($data);\n \n if ($updateResult) {\n $this->log('SYNC: Updated LDAP Object: ' . $this->LdapObject->id, LOG_INFO);\n } else {\n $this->log('SYNC: Failed to update LDAP Object: ' . $this->LdapObject->id, LOG_ERR);\n }\n } else {\n // Sets the sync operation, so unchanged records (which is the usual case) are separately reported\n $this->syncOperation = 'unchanged';\n $this->log('SYNC: LDAP Object ' . $this->LdapObject->id . ' left unchanged.', LOG_INFO);\n }\n break;\n case 'delete':\n $id = $this->LdapObject->id;\n $deleteResult = $this->LdapObject->delete($this->LdapObject->id);\n if ($deleteResult) {\n $this->log('SYNC: Deleted LDAP Object: ' . $id, LOG_INFO);\n // Sets id on the LdapObject for reporting the sync result\n $this->LdapObject->id = $id;\n } else {\n $this->log('SYNC: Failed to delete LDAP Object: ' . $id , LOG_ERR);\n $ldapError = $this->LdapObject->getLdapError();\n if (!empty($ldapError)) {\n $this->log($ldapError, LOG_ERR);\n }\n }\n break;\n case 'nothing':\n $this->log('SYNC: No action performed on record: ' . $this->sforceData['Id'], LOG_DEBUG);\n break;\n default:\n $this->log('SYNC: No operation found for Salesforce Id \"' . $this->sforceData['Id'] . '\". This object was not synced.', LOG_INFO);\n }\n }",
"private function moveParts()\n {\n $filename = $this->substream->getFilename();\n for ($i = 1; $i <= $this->index; ++$i) {\n $indexed_filename = $this->getIndexPartFilename($filename, $i);\n $source = sys_get_temp_dir().'/'.$indexed_filename;\n $target = dirname($this->filename).'/'.$indexed_filename;\n if (!rename($source, $target)) {\n throw FileAccessException::failedOverwrite($source, $target);\n }\n }\n }",
"function executeMerge(&$cuefile, &$wav, &$trash, $options) {\n // globals from parameter\n global $finalDir;\n global $multiDisks;\n $return = TRUE;\n\n logp(\"log\",\"Executing merge and move...\");\n\n $dir= getArtistFromCwd() . \"/\" . $finalDir;\n $newfile = $finalDir . \".cue\";\n $newpath = $finalDir . \"/\" . $newfile;\n\n // make directory if needed\n if (! is_dir($finalDir))\n if (! mkdir($finalDir))\n logp(\"error,exit1\",\"FATAL ERROR: could not make final Directory, '{$finalDir}'\");\n\n if (file_exists($newfile))\n if ( ! rename($newpath, $newpath . \".pre-merge\"))\n logp(\"error,exit1\",\"FATAL ERROR: could not rename old cue '{$newpath}'\");\n\n // make Convertable\n if (! makeCueConvertable($cuefile)) {\n return FALSE;\n }\n\n // add line termination\n addLineTerm($cuefile);\n\n // write candidate file\n if ( ! file_put_contents($newpath . \".cand\", $cuefile))\n logp(\"error,exit1\", array(\"FATAL ERROR: could not write candidate cuefile\",\n \" '${newpath}.cand'\"));\n\n//print_r($cuefile);\n // verify current cuefile array, without file testing\n if (! verifyCue( '', $dir, $newfile, \"override-nofile\", $cuefile))\n logp(\"error,exit1\",\n \"FATAL ERROR: proposed cuefile array did not verify.\");\n\n // move songs (or test file existance if in check mode)\n if (! moveWav($wav, $options))\n logp(\"error,exit1\",\"FATAL ERROR: error moving wav files. Check logs.\");\n\n // verify with files in place\n // note hack to ../ on base dir so file works\n if (! isDryRun() && ! verifyCue( '..', $dir, $newfile . \".cand\"))\n logp(\"error,exit1\",\n \"FATAL ERROR: proposed cuefile did not verify but wav files have been moved.\");\n\n // move to trash. Note using parent as base trash directory.\n // also note: we move to Trash before we rename .cand file in case\n // the finalDir is one of the contributing dirs (which would remove\n // its cue file)\n if (! moveToTrash($trash, $trashed, \"..\")) $return = FALSE;\n\n // rename candidate file\n if (! isDryRun()) {\n logp(\"log\", \"rename candidate to cue, '{$newpath}'\");\n if ( ! rename($newpath . \".cand\", $newpath))\n logp(\"error,exit1\",\"FATAL ERROR: could not rename candidate '{$newpath}'\");\n } // dryRun\n\n\n // move remaining files source disks\n foreach ($multiDisks as $disc)\n if (! moveDirContents($disc, $finalDir)) {\n logp(\"error\",\"ERROR: could not clear a directory, '{$disc}'\");\n $return = FALSE;\n }\n\n return $return;\n}",
"public function testExecuteWithTimeDifference()\n {\n // Set last sync date, to now.\n $this->setLastSync(new DateTime('now'), BinlogParser::START_TYPE_DATE);\n\n $this->importData('ExtractorTest/sample_db.sql');\n\n $commandTester = $this->executeCommand(static::$kernel);\n\n foreach ($this->shopIds as $shopId) {\n $expectedData = [\n [\n 'type' => ActionTypes::UPDATE,\n 'document_type' => 'category',\n 'document_id' => 'cat0',\n 'status' => '0',\n 'shop_id' => $shopId,\n ],\n [\n 'type' => ActionTypes::CREATE,\n 'document_type' => 'product',\n 'document_id' => 'art0',\n 'status' => '0',\n 'shop_id' => $shopId,\n ],\n [\n 'type' => ActionTypes::CREATE,\n 'document_type' => 'product',\n 'document_id' => 'art2',\n 'status' => '0',\n 'shop_id' => $shopId,\n ],\n [\n 'type' => ActionTypes::UPDATE,\n 'document_type' => 'product',\n 'document_id' => 'art0',\n 'status' => '0',\n 'shop_id' => $shopId,\n ],\n [\n 'type' => ActionTypes::UPDATE,\n 'document_type' => 'product',\n 'document_id' => 'art2',\n 'status' => '0',\n 'shop_id' => $shopId,\n ],\n [\n 'type' => ActionTypes::DELETE,\n 'document_type' => 'product',\n 'document_id' => 'art1',\n 'status' => '0',\n 'shop_id' => $shopId,\n ],\n ];\n\n $storageData = $this->getSyncData(count($expectedData), 0, $shopId);\n\n $this->assertEquals($expectedData, $storageData);\n }\n\n $output = $commandTester->getDisplay();\n $this->assertContains('Job finished', $output);\n }",
"public function move_node($p_mode,$source_id,$target_id)\n\t\t{\n\t\t\t$item_node_info = $this->get_id_info($source_id); \n\t\t\t\n\t\t\t$parent_source = $item_node_info[0];\n\t\t\t$order_source = $item_node_info[1];\n\t\t\t//==================================================================\n\t\t\t\n\t\t\t\n\t\t\tif($p_mode == 'B') // BROTHER\n\t\t\t{\n\t\t\t\t//==================================================================\n\t\t\t\t$item_node_info = $this->get_id_info($target_id);\n\t\t\t\t\n\t\t\t\tif($target_id == 0 )\n\t\t\t\t{\n\t\t\t\t\t// First item of tree\n\t\t\t\t\t$parent_target = 0;\n\t\t\t\t\t$order_target = 0;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$parent_target = $item_node_info[0];\n\t\t\t\t\t$order_target = $item_node_info[1]+1;\n\t\t\t\t}\n\t\t\t\t//==================================================================\n\t\t\n\t\t\t\t//==================================================================\n\t\t\t\t// renumbering order from target id to prepare place\n\t\t\t\t//==================================================================\n\t\t\t\t$query = \"UPDATE `\".$this->tree_node.\"`\n\t\t\t\t\t\t\tSET `order` = `order` + 1\n\t\t\t\t\t\t\tWHERE\n\t\t\t\t\t\t\t\t`application_release` = '\".$this->application_release.\"'\n\t\t\t\t\t\t\t\tAND `parent` = \".$parent_target.\"\n\t\t\t\t\t\t\t\tAND `order` >= \".$order_target.\"\n\t\t\t\t\t\t\tORDER BY `order` desc\";\n\t\t\t\t$result = $this->link_mt->query($query);\n\t\t\t\t//==================================================================\n\t\t\t\n\t\t\t\t//==================================================================\n\t\t\t\t// move item !!!!!\n\t\t\t\t//==================================================================\n\t\t\t\t$query = \"UPDATE `\".$this->tree_node.\"`\n\t\t\t\t\t\t\tSET `parent` = \".$parent_target.\",\n\t\t\t\t\t\t\t\t`order` = \".$order_target.\"\n\t\t\t\t\t\t\tWHERE\n\t\t\t\t\t\t\t\t`application_release` = '\".$this->application_release.\"'\n\t\t\t\t\t\t\t\tAND `id` = \".$source_id.\"\n\t\t\t\t\t\t \";\n\t\t\t\t\n\t\t\t\t$result = $this->link_mt->query($query);\n\t\t\t\t//==================================================================\t\n\t\t\n\t\t\t\t//==================================================================\n\t\t\t\t// renumbering order to fill hole\n\t\t\t\t//==================================================================\n\t\t\t\t$query = \"UPDATE `\".$this->tree_node.\"`\n\t\t\t\t\t\t\tSET `order` = `MTN`.`order` - 1\n\t\t\t\t\t\t\tWHERE\n\t\t\t\t\t\t\t\t`application_release` = '\".$this->application_release.\"'\n\t\t\t\t\t\t\t\tAND `parent` = \".$parent_target.\"\n\t\t\t\t\t\t\t\tAND `order` > \".$order_source.\" \n\t\t\t\t\t\t\tORDER BY `order` asc\";\n\t\t\t\t$result = $this->link_mt->query($query);\n\t\t\t\t//==================================================================\n\t\t\t}\n\t\t\telse // CHILDREN\n\t\t\t{\n\t\t\t\t//==================================================================\n\t\t\t\t// Recover information of target id\n\t\t\t\t//==================================================================\n\t\t\t\t$parent_target = $target_id;\n\t\t\t\t$order_target = 0;\n\t\t\t\t//==================================================================\n\t\t\n\t\t\t\t//==================================================================\n\t\t\t\t// renumbering order from target id to prepare place\n\t\t\t\t//==================================================================\n\t\t\t\t$query = \"UPDATE `\".$this->tree_node.\"`\n\t\t\t\t\t\t\tSET `order` = `order` + 1\n\t\t\t\t\t\t\tWHERE\n\t\t\t\t\t\t\t\t`application_release` = '\".$this->application_release.\"'\n\t\t\t\t\t\t\t\tAND `parent` = \".$parent_target.\"\n\t\t\t\t\t\t\t\tAND `order` >= \".$order_target.\"\n\t\t\t\t\t\t\t\tORDER BY `order` desc\";\n\t\t\t\t\n\t\t\t\t$result = $this->link_mt->query($query);\n\t\t\t\t//==================================================================\n\t\t\t\n\t\t\t\t//==================================================================\n\t\t\t\t// move item !!!!!\n\t\t\t\t//==================================================================\n\t\t\t\t$query = \"UPDATE `\".$this->tree_node.\"`\n\t\t\t\t\t\t\tSET `parent` = \".$parent_target.\",\n\t\t\t\t\t\t\t\t`order` = \".$order_target.\"\n\t\t\t\t\t\t\tWHERE\n\t\t\t\t\t\t\t\t`application_release` = '\".$this->application_release.\"'\n\t\t\t\t\t\t\t\tAND `id` = \".$source_id.\"\n\t\t\t\t\t\t \";\n\t\t\t\t\n\t\t\t\t$result = $this->link_mt->query($query);\n\t\t\t\t//==================================================================\n\t\t\t\n\t\t\t\t//==================================================================\n\t\t\t\t// renumbering order from source id to fill hole\n\t\t\t\t//==================================================================\n\t\t\t\t$query = \"UPDATE `\".$this->tree_node.\"`\n\t\t\t\t\t\t\tSET `order` = `order` - 1\n\t\t\t\t\t\t\tWHERE\n\t\t\t\t\t\t\t\t`application_release` = '\".$this->application_release.\"'\n\t\t\t\t\t\t\t\tAND `parent` = \".$parent_source.\"\n\t\t\t\t\t\t\t\tAND `order` >= \".$order_source.\"\n\t\t\t\t\t\t\t\tORDER BY `order` asc\";\n\t\t\t\t\n\t\t\t\t$result = $this->link_mt->query($query);\n\t\t\t\t//==================================================================\n\t\t\t}\n\t\t\t\n\t\t\t$this->myfocus = $source_id; // Focus on target item\n\t\t\techo $source_id;\n\t\t}",
"public function testMoveDirectoryMovesEntireDirectory()\n {\n mkdir(self::$temp.DS.'tmp2', 0777, true);\n file_put_contents(self::$temp.DS.'tmp2'.DS.'foo.txt', '');\n file_put_contents(self::$temp.DS.'tmp2'.DS.'bar.txt', '');\n\n mkdir(self::$temp.DS.'tmp2'.DS.'nested', 0777, true);\n file_put_contents(self::$temp.DS.'tmp2'.DS.'nested'.DS.'baz.txt', '');\n\n Storage::mvdir(self::$temp.DS.'tmp2', self::$temp.DS.'tmp3');\n\n $this->assertTrue(is_dir(self::$temp.DS.'tmp3'));\n $this->assertTrue(is_file(self::$temp.DS.'tmp3'.DS.'foo.txt'));\n $this->assertTrue(is_file(self::$temp.DS.'tmp3'.DS.'bar.txt'));\n $this->assertTrue(is_dir(self::$temp.DS.'tmp3'.DS.'nested'));\n $this->assertTrue(is_file(self::$temp.DS.'tmp3'.DS.'nested'.DS.'baz.txt'));\n\n $this->assertFalse(is_dir(self::$temp.DS.'tmp2'));\n }",
"public function testParallelCommitAndPatch(): void {\n $location = $this->createMetadataResource();\n $prop = 'http://foo';\n\n $txId = $this->beginTransaction();\n $headers = [\n self::$config->rest->headers->transactionId => $txId,\n 'Eppn' => 'admin',\n 'Content-Type' => 'application/n-triples',\n ];\n $txReq = new Request('put', self::$baseUrl . 'transaction', $headers);\n $resReq = new Request('patch', $location . '/metadata', $headers, \"<$location> <$prop> \\\"value1\\\" .\");\n list($txResp, $resResp) = $this->runConcurrently([$txReq, $resReq], 50000);\n $this->assertEquals(204, $txResp->getStatusCode());\n $this->assertEquals(409, $resResp->getStatusCode());\n }",
"abstract function mirror($locpath, $rempath);",
"public function testNormal() {\n // Pick a file for testing.\n $file = File::create((array) current($this->drupalGetTestFiles('image')));\n\n // Create derivative image.\n $styles = ImageStyle::loadMultiple();\n $style = reset($styles);\n $original_uri = $file->getFileUri();\n $derivative_uri = $style->buildUri($original_uri);\n $style->createDerivative($original_uri, $derivative_uri);\n\n // Check if derivative image exists.\n $this->assertFileExists($derivative_uri);\n\n // Clone the object so we don't have to worry about the function changing\n // our reference copy.\n $desired_filepath = 'public://' . $this->randomMachineName();\n $result = $this->fileRepository->move(clone $file, $desired_filepath, FileSystemInterface::EXISTS_ERROR);\n\n // Check if image has been moved.\n $this->assertFileExists($result->getFileUri());\n\n // Check if derivative image has been flushed.\n $this->assertFileDoesNotExist($derivative_uri);\n }",
"function MoveRep($drive,$space) { // deplace le repertoire de sauvegarde $drive vers $space\n\t$cmd=\"/usr/bin/sudo /usr/share/se3/scripts/move_rep_backuppc.sh \".$drive.\" \".$space;\n\texec($cmd);\n}",
"public function testReplaceCommonSourcePath()\n {\n $test = array(\n array(\n 'complete' => '/path/to/my' . DIRECTORY_SEPARATOR . 'files/folder/file.txt',\n 'path' => '/path/to/my' . DIRECTORY_SEPARATOR . 'files'\n ),\n array(\n 'complete' => '/path/to/my' . DIRECTORY_SEPARATOR . 'folder/and/files/otherFile.txt',\n 'path' => '/path/to/my' . DIRECTORY_SEPARATOR . 'folder/and/files'\n ),\n array(\n 'complete' => '/path/to/my' . DIRECTORY_SEPARATOR . 'other/source/directory/sameFile.txt',\n 'path' => '/path/to/my' . DIRECTORY_SEPARATOR . 'other/source/directory\n ')\n );\n \n $result = $this->_cbErrorHandler->replaceCommonSourcePath($test);\n \n $this->assertEquals('files/folder/file.txt', $result[0]['complete']);\n $this->assertEquals('other/source/directory/sameFile.txt', $result[2]['complete']);\n $this->assertEquals('/path/to/my', $result[2]['path']);\n }",
"public function testInconsistentSiblings2Levels()\n {\n $unit1 = $this->getUnit('shipment');\n $unit1->setReversedMapping([\n 'total' => 'map.total'\n ]);\n $unit1->setReversedConnection([\n 'shipment_id' => 'shipment_id',\n ]);\n $unit1->setMapping([\n 'shipment_id' => 'map.shipment_id',\n 'total' => 'map.total',\n ]);\n $unit1->setFilesystem($this->getFS(\n [\n [1, 30],\n [2, 33],\n [3, 55],\n [4, 11],\n false,\n ]\n ));\n $unit1->setIsEntityCondition(function (MapInterface $map) {\n return !empty($map['shipment_id']);\n });\n $unit1->setTmpFileName('shipment_tmp.csv');\n\n $unit2 = $this->getUnit('item');\n $unit2->setReversedMapping([\n 'item_name' => 'map.name',\n ]);\n $unit2->setReversedConnection([\n 'shipment_id' => 'shipment_id',\n ]);\n $unit2->setMapping([\n 'id' => 'map.incr(\"item_id\", 1)',\n 'name' => 'map.item_name',\n 'shipment_id' => 'map.shipment_id',\n ]);\n $unit2->setFilesystem($this->getFS(\n [\n [1, 'cool item', 1],\n [2, 'another super item', 1],\n [3, 'Coca Cola', 2],\n [4, 'Pepsi', 3],\n [5, 'pants', 4],\n false,\n ]\n ));\n $unit2->setTmpFileName('item_tmp.csv');\n $unit2->setParent($unit1);\n\n $unit3 = $this->getUnit('tracking');\n $unit3->setReversedMapping([\n 'tracking_number' => 'map.tracking_number',\n ]);\n $unit3->setReversedConnection([\n 'shipment_id' => 'shipment_id',\n ]);\n $unit3->setMapping([\n 'id' => 'map.incr(\"track_id\", 1)',\n 'tracking_number' => 'map.tracking_number',\n 'shipment_id' => 'map.shipment_id',\n ]);\n $unit3->setFilesystem($this->getFS(\n [\n [1, '56465454', 1],\n [2, '13122333', 3],\n [3, '13343443', 4],\n false,\n ]\n ));\n $unit3->setTmpFileName('tracking_tmp.csv');\n $unit3->addSibling($unit1);\n $unit3->setOptional(true);\n\n $expected = [\n [[\n 'total' => 30,\n 'tracking_number' => '56465454',\n 'item' => [\n [\n 'item_name' => 'cool item'\n ],\n [\n 'item_name' => 'another super item'\n ],\n ],\n ]],\n [[\n 'total' => 33,\n 'tracking_number' => null,\n 'item' => [\n [\n 'item_name' => 'Coca Cola'\n ],\n ],\n ]],\n [[\n 'total' => 55,\n 'tracking_number' => '13122333',\n 'item' => [\n [\n 'item_name' => 'Pepsi'\n ],\n ],\n ]],\n [[\n 'total' => 11,\n 'tracking_number' => '13343443',\n 'item' => [\n [\n 'item_name' => 'pants'\n ],\n ],\n ]],\n ];\n\n $action = $this->getAction([$unit1, $unit2, $unit3], $expected);\n $action->process($this->getResultMock());\n }",
"public function testMoveEmpty() {\n $sourceDirName = self::TEST_DIR . '/testMoveEmptySource';\n $targetDirName = self::TEST_DIR . '/testMoveEmptyTarget';\n\n mkdir($sourceDirName);\n\n $directoryHandle = new Directory($sourceDirName);\n\n $directoryHandle->move(new Directory($targetDirName));\n\n $this->assertDirectoryExists($targetDirName);\n $this->assertDirectoryNotExists($sourceDirName);\n }",
"function store_move($id, $target, $part)\r\n{\r\n\tglobal $_user;\r\n\tglobal $dropbox_cnf;\r\n\r\n\tif ((isset($id) AND $id<>'') AND (isset($target) AND $target<>'') AND (isset($part) AND $part<>''))\r\n\t{\r\n\t\tif ($part=='received')\r\n\t\t{\r\n\t\t\t$sql=\"UPDATE \".$dropbox_cnf[\"tbl_post\"].\" SET cat_id='\".Database::escape_string($target).\"'\r\n\t\t\t\t\t\tWHERE dest_user_id='\".Database::escape_string($_user['user_id']).\"'\r\n\t\t\t\t\t\tAND file_id='\".Database::escape_string($id).\"'\r\n\t\t\t\t\t\t\";\r\n\t\t\tapi_sql_query($sql,__FILE__,__LINE__);\r\n\t\t\t$return_message=get_lang('ReceivedFileMoved');\r\n\t\t}\r\n\t\tif ($part=='sent')\r\n\t\t{\r\n\t\t\t$sql=\"UPDATE \".$dropbox_cnf[\"tbl_file\"].\" SET cat_id='\".Database::escape_string($target).\"'\r\n\t\t\t\t\t\tWHERE uploader_id='\".Database::escape_string($_user['user_id']).\"'\r\n\t\t\t\t\t\tAND id='\".Database::escape_string($id).\"'\r\n\t\t\t\t\t\t\";\r\n\t\t\tapi_sql_query($sql,__FILE__,__LINE__);\r\n\t\t\t$return_message=get_lang('SentFileMoved');\r\n\t\t}\r\n\t}\r\n\telse\r\n\t{\r\n\t\t$return_message=get_lang('NotMovedError');\r\n\t}\r\n\treturn $return_message;\r\n}",
"public static final function transfer($id,&$old_parent,$old_pos,&$new_par,$new_pos){\n\t\t$new_parent = $new_par; //in case referred object is removed by calling remove kids.\n\t\tdebug('transfer '.$id.' o.pos '.$old_pos.' n_pos '.$new_pos);\n\t\tif($new_pos >= 0 && $os = $old_parent->remove_kids($id,$old_pos,1)){\n\n\t\t\tnotice('after rmove '.$os[0]->abb.': '.$os[0]->folder_name);\n\t\t\t//notice('new Pos= '.$new_pos);\n\t\t\t//notice('np');\n\t\t\t//print_r($new_parent);\n\t\t\t//notice('extracted');\n\t\t\t//print_r($o);\n\t\t\tif ($new_parent->insert_kids($os,$new_pos))\n\t\t\t{\n\t\t\t\tnotice('after insert '.$os[0]->abb.': '.$os[0]->folder_name);\n\t\t\t\t\n\t\t\t$new_parent->reposition_kids();\n\t\t\t/*\n\t\t\t\tif ($new_parent->id == $old_parent->id && $new_parent->object_type == $old_parent->object_type)\n\t\t\t\t\t\t$new_parent->reposition_kids(min($old_pos,$new_pos));\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t\t$old_parent->reposition_kids($old_pos); //update left+right values\n\t\t\t\t\t\t$new_parent->reposition_kids($new_pos);\n\t\t\t\t}\n\t\t\t*/\n\t\t\t} else {\n\t\t\t\tthrow new Exception('Transfer failed!!!');\n\t\t\t}\n\t\t}else\n\t\t\terror('cannot insert => cannot make transfer!');\n\t}",
"public function testDestiny2SetItemLockState()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"function synch($remote, $local)\n{\n\tscan();\n\t$ch = curl_init($remote.\"/myp/index.php?process=synchreq&remote=\".$local);\n curl_setopt($ch, CURLOPT_HEADER, 0);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n $result = curl_exec($ch); \n curl_close($ch);\n\t$synch_data=json_decode($result);\n\t\n\t$pdata=json_decode(file_get_contents(\"../.mypfiles\", true));\n\tfclose($mypfiles);\n\t\n\t//create a log variables\n\t$remfiles=0;\n\t$copfiles=0;\n\t\t\n\tforeach($synch_data as $sd)\n\t{\n\t\t$existence=search_loc_index_stdcls($pdata, $sd->loc);\n\t\t\n\t\tif($existence)\n\t\t{\n\t\t\t$index=array_search($sd, $synch_data);\n\t\t\tif(($sd->flag==0) && ($pdata[$existence]->flag==1))\n\t\t\t{\n\t\t\t\tif(is_dir($sd->loc)) rmdir($sd->loc); //{ echo \"Hi\"; die(); }//exec(\"rm -rf \".$sd->loc);\n\t\t\t\telse unlink($sd->loc);\n\t\t\t\t$remfiles++;\n\t\t\t}\n\t\t\t//if exist then check file creation time. if file exists at remote server with different creation date then copy it here. File is newly created.\n\t\t\telseif($sd->flag!=0)\n\t\t\t{\n\t\t\t\tif((($sd->mtime - $pdata[$existence]->mtime)>1) && ($pdata[$existence]->type!='dir'))\n\t\t\t\t{\n\t\t\t\t\tunlink($sd->loc);\n\t\t\t\t\t$remfiles++;\n\t\t\t\t\t\n\t\t\t\t\t$copy[]=$sd->loc;\n\t\t\t\t\t$copfiles++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//add the file into copy list\n\t\t\tif(($sd->flag!=0) && (!file_exists($sd->loc))) \n\t\t\t{\n\t\t\t\t$copy[]=$sd->loc;\n\t\t\t\t$copfiles++;\n\t\t\t}\t\t\t\n\t\t}\t\n\t}\n\t\n\tif((isset($copy))&& (count($copy)>0))\n\t{\n\t\t//now sending a file copying request to remote server\n\t\t$copy=json_encode($copy);\n\t\t$url = $remote.\"/myp/?process=copyreq&remote=\".$local;\n\t\t\n\t\t$fields=array('copy'=>$copy, 'process'=>'copyreq'); //current server url should be passed to ensure security\n\t\tforeach($fields as $key=>$value) { $fields_string .= $key.'='.$value.'&'; }\n\t\trtrim($fields_string, '&');\n\n\t\t//open connection\n\t\t$ch = curl_init($url);\n\t\tcurl_setopt($ch, CURLOPT_HEADER, 0);\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\t\tcurl_setopt($ch,CURLOPT_POST, count($fields));\n\t\tcurl_setopt($ch,CURLOPT_POSTFIELDS, $fields_string);\n\t\t$result = curl_exec($ch);\n\t\tcurl_close($ch);\n\t\t\n\t\t$file_to_dl=$remote.\"/myp/tmp/\".$result.\".zip\";\n\t\texec(\"wget -O tmp/\".$result.\".zip \".$file_to_dl);\t\t\n\t\t\n\t\t//ask remote server to delete it's temp zip file\n\t\t$chd = curl_init($remote.\"/myp/index.php?process=delreq&remote=\".$local.\"&file=\".$result);\n\t\tcurl_setopt($chd, CURLOPT_HEADER, 0);\n\t\tcurl_setopt($chd, CURLOPT_RETURNTRANSFER, 1);\n\t\tcurl_exec($chd);\n\t\tcurl_close($chd);\n\t\t\n\t\texec(\"unzip -B tmp/\".$result.\".zip -d ../\");\n\t\tunlink(\"tmp/\".$result.\".zip\");\n\t}\n\t\n\tif(!file_exists(\".myplog\"))\n\t{\n\t\tfopen(\".myplog\", \"w\");\n\t\t$break=\"\";\n\t}\n\telse $break=\"\\n\";\n\t\n\tif(($remfiles>0) || ($copfiles>0)) \n\t{\n\t\t$logs=file_get_contents(\".myplog\");\n\t\t$logs=$logs.$break.\"Time: \".date(\"Y-m-d H:i:s\").\" Node: \".$remote.\" Removed: \".$remfiles.\" Added: \".$copfiles;\n\t\tfile_put_contents(\".myplog\", $logs);\n\t}\n}",
"protected function syncSharedFolders()\n\t{\n\t\t$shared = (array) $this->rocketeer->getOption('remote.shared');\n\t\tforeach ($shared as $file) {\n\t\t\t$this->share($file);\n\t\t}\n\t}",
"public function testProcessWeirdCase1()\n {\n $unit1 = $this->getUnit('test');\n $unit1->setReversedMapping([\n 'name' => 'map.field1',\n ]);\n $unit1->setReversedConnection([\n 'tid' => 'id',\n ]);\n $unit1->setMapping([\n 'field1' => 'name',\n 'field2' => 'code',\n 'id' => 'id',\n ]);\n $unit1->setFilesystem($this->getFS(\n [\n ['Pete', 'tst1', '1'],\n false,\n ]\n ));\n $unit1->setTmpFileName('customer_tmp.csv');\n\n $unit2 = $this->getUnit('test2');\n $unit2->setReversedMapping([\n 'name' => 'map.field1',\n ]);\n $unit2->setReversedConnection([\n 'tid' => 'parent_id',\n ]);\n $unit2->setMapping([\n 'field1' => 'name',\n 'field2' => 'code',\n 'parent_id' => 'id',\n ]);\n $unit2->setFilesystem($this->getFS(\n [\n ['Pete', 'tst1', '2'],\n false,\n ]\n ));\n $unit2->setTmpFileName('customer_tmp.csv');\n $unit2->setParent($unit1);\n\n $action = $this->getAction([$unit1, $unit2]);\n $action->process($this->getResultMock());\n }",
"public function reorder_onMove()\n {\n $sourceNode = Page::find(post('sourceNode'));\n $targetNode = post('targetNode') ? Page::find(post('targetNode')) : null;\n\n if ($sourceNode == $targetNode) {\n return;\n }\n\n switch (post('position')) {\n case 'before':\n $sourceNode->moveBefore($targetNode);\n break;\n case 'after':\n $sourceNode->moveAfter($targetNode);\n break;\n case 'child':\n $sourceNode->makeChildOf($targetNode);\n break;\n default:\n $sourceNode->makeRoot();\n break;\n }\n }",
"function move($source, $destination);",
"public function testCopyCopiesStorageProperly()\n {\n $data = 'contents';\n mkdir(self::$temp.DS.'text');\n file_put_contents(self::$temp.DS.'text'.DS.'foo.txt', $data);\n\n Storage::copy(self::$temp.DS.'text'.DS.'foo.txt', self::$temp.DS.'text'.DS.'foo2.txt');\n\n $this->assertTrue(is_file(self::$temp.DS.'text'.DS.'foo2.txt'));\n $this->assertTrue($data === file_get_contents(self::$temp.DS.'text'.DS.'foo2.txt'));\n }",
"public function testRevertFailPatch()\n {\n $patch = new Patch();\n $op = new Resources\\MockAtomic(function(Pointer $pointer){\n $value = 'baz';\n $pointer->set('/foo', $value);\n }, function(Pointer $pointer){\n throw new Operation\\Exception('Reversion failed');\n });\n $patch->addOperation($op);\n $op = new Resources\\MockAtomic(function(Pointer $pointer){\n throw new Operation\\Exception('Forced Reversion');\n });\n $patch->addOperation($op);\n\n $target = ['foo'=>'bar'];\n $patch->apply($target);\n }",
"public function testReplaceCommonSourcePathEmpty()\n {\n $test = array(\n array(\n 'complete' => DIRECTORY_SEPARATOR . 'baz/to/my/file.txt',\n 'path' => DIRECTORY_SEPARATOR . 'baz/to/my'\n ),\n array(\n 'complete' => DIRECTORY_SEPARATOR . 'bar/to/my/otherFile.txt',\n 'path' => DIRECTORY_SEPARATOR . 'bar/to/my'\n ),\n array(\n 'complete' => DIRECTORY_SEPARATOR . 'foo/to/my/sameFile.txt',\n 'path' => DIRECTORY_SEPARATOR . 'foo/to/my'\n )\n );\n \n $result = $this->_cbErrorHandler->replaceCommonSourcePath($test);\n \n $this->assertEquals($test, $result);\n }",
"public function testExecute()\n {\n $kernel = self::createClient()->getKernel();\n $this->importData('SyncCommandsTest/ProductsInitialDummyData.sql');\n $this->importData('SyncCommandsTest/SyncStorageWithDummyData.sql');\n $this->importData('SyncCommandsTest/UpdateProductsData.sql');\n\n $manager = $this->getManager();\n $repository = $manager->getRepository('AcmeTestBundle:Product');\n\n $application = new Application($kernel);\n $application->add(new SyncExecuteCommand());\n $command = $application->find('ongr:sync:execute');\n\n $commandTester = new CommandTester($command);\n $commandTester->execute(['command' => $command->getName()]);\n\n $search = $repository->createSearch();\n\n // Temporary workaround for ESB issue #34 (https://github.com/ongr-io/ElasticsearchBundle/issues/34).\n usleep(50000);\n\n $actualDocuments = iterator_to_array($repository->execute($search));\n\n $expectedDocuments = $this->getTestingData();\n\n sort($expectedDocuments);\n sort($actualDocuments);\n\n $this->assertEquals($expectedDocuments, $actualDocuments);\n }",
"public function testCopyDirectoryMovesEntireDirectory()\n {\n mkdir(self::$temp.DS.'tmp', 0777, true);\n file_put_contents(self::$temp.DS.'tmp'.DS.'foo.txt', '');\n file_put_contents(self::$temp.DS.'tmp'.DS.'bar.txt', '');\n\n mkdir(self::$temp.DS.'tmp'.DS.'nested', 0777, true);\n file_put_contents(self::$temp.DS.'tmp'.DS.'nested'.DS.'baz.txt', '');\n\n Storage::cpdir(self::$temp.DS.'tmp', self::$temp.DS.'tmp2');\n\n $this->assertTrue(is_dir(self::$temp.DS.'tmp2'));\n $this->assertTrue(is_file(self::$temp.DS.'tmp2'.DS.'foo.txt'));\n $this->assertTrue(is_file(self::$temp.DS.'tmp2'.DS.'bar.txt'));\n $this->assertTrue(is_dir(self::$temp.DS.'tmp2'.DS.'nested'));\n $this->assertTrue(is_file(self::$temp.DS.'tmp2'.DS.'nested'.DS.'baz.txt'));\n }",
"function _move_across($source, $target, $pos, $first = false)\r\n\t{\r\n\t\t// Get the current data from a node and exclude the id params which will be changed\r\n\t\t// because of the node move\r\n\t\t$values = array();\r\n\t\tforeach($this->_params as $key => $val)\r\n\t\t{\r\n\t\t\tif ($source[$val] && $val != 'parent_id' && !in_array($val, $this->_required_params))\r\n\t\t\t{\r\n\t\t\t\t$values[$key] = trim($source[$val]);\r\n\t\t\t} \r\n\t\t} \r\n\t\tswitch ($pos)\r\n\t\t{\r\n\t\t\tcase NESE_MOVE_BEFORE:\r\n\t\t\t\t$clone_id = $this->create_left_node($target['id'], $values);\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase NESE_MOVE_AFTER:\n\t\t\t\t$clone_id = $this->create_right_node($target['id'], $values);\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase NESE_MOVE_BELOW:\r\n\t\t\t\t$clone_id = $this->create_sub_node($target['id'], $values);\r\n\t\t\t\tbreak;\r\n\t\t} \r\n\t\t\n\t\t$t_parent_id = false;\r\n\t\tif ($first)\r\n\t\t{\r\n\t\t\tif($t_parent = $this->get_parent($clone_id))\r\n\t\t\t\t$t_parent_id = $t_parent['id'];\r\n\t\t} \n\t\telse\r\n\t\t\t$t_parent_id = $source['parent_id'];\r\n\r\n\t\t$children = $this->get_children($source['id']);\r\n\r\n\t\tif ($children)\r\n\t\t{\r\n\t\t\t$pos = NESE_MOVE_BELOW;\r\n\t\t\t$sclone_id = $clone_id; \r\n\t\t\t// Recurse through the child nodes\r\n\t\t\tforeach($children AS $cid => $child)\r\n\t\t\t{\r\n\t\t\t\t$sclone = $this->get_node($sclone_id);\r\n\t\t\t\t$sclone_id = $this->_move_across($child, $sclone, $pos);\r\n\r\n\t\t\t\t$pos = NESE_MOVE_AFTER;\r\n\t\t\t} \r\n\t\t} \r\n\n\t\t$this->_relations[$source['id']]['clone_id'] = $clone_id;\r\n\t\t$this->_relations[$source['id']]['parent_id'] = $t_parent_id;\n\r\n\t\treturn $clone_id;\r\n\t}",
"public function checkPreflightConditions()\n {\n $paths = $this->pathfinder->getPaths();\n $ignore = $this->pathfinder->getIgnoredPaths();\n $oldSnapshot = $this->workspace . 'oldSnapshot' . \\DIRECTORY_SEPARATOR;\n\n $this->filterFilesToCopy($paths, $ignore);\n $this->createOldVendorSnapshot($oldSnapshot);\n }",
"public function afterSyncing() {}",
"public function testExecuteWithoutTimeDifference()\n {\n // Set last sync date, to now.\n $this->setLastSync(new DateTime('now'), BinlogParser::START_TYPE_DATE);\n\n $this->importData('ExtractorTest/sample_db_nodelay.sql');\n\n $commandTester = $this->executeCommand(static::$kernel);\n\n foreach ($this->shopIds as $shopId) {\n $expectedData = [\n [\n 'type' => ActionTypes::UPDATE,\n 'document_type' => 'category',\n 'document_id' => 'cat0',\n 'status' => '0',\n 'shop_id' => $shopId,\n ],\n [\n 'type' => ActionTypes::UPDATE,\n 'document_type' => 'product',\n 'document_id' => 'art0',\n 'status' => '0',\n 'shop_id' => $shopId,\n ],\n [\n 'type' => ActionTypes::CREATE,\n 'document_type' => 'product',\n 'document_id' => 'art0',\n 'status' => '0',\n 'shop_id' => $shopId,\n ],\n [\n 'type' => ActionTypes::CREATE,\n 'document_type' => 'product',\n 'document_id' => 'art2',\n 'status' => '0',\n 'shop_id' => $shopId,\n ],\n [\n 'type' => ActionTypes::UPDATE,\n 'document_type' => 'product',\n 'document_id' => 'art2',\n 'status' => '0',\n 'shop_id' => $shopId,\n ],\n [\n 'type' => ActionTypes::DELETE,\n 'document_type' => 'product',\n 'document_id' => 'art1',\n 'status' => '0',\n 'shop_id' => $shopId,\n ],\n ];\n\n // Ensure that there is no time difference between records (even though there might be).\n $this\n ->managerMysql\n ->getConnection()\n ->executeQuery(\"update {$this->managerMysql->getTableName($shopId)} set timestamp=NOW()\");\n\n $storageData = $this->getSyncData(count($expectedData), 0, $shopId);\n\n $this->assertEquals($expectedData, $storageData);\n }\n\n $output = $commandTester->getDisplay();\n $this->assertContains('Job finished', $output);\n }",
"public function testParallelPatchAndCommit(): void {\n $location = $this->createMetadataResource();\n $prop = 'http://foo';\n\n $txId = $this->beginTransaction();\n $headers = [\n self::$config->rest->headers->transactionId => $txId,\n 'Eppn' => 'admin',\n 'Content-Type' => 'application/n-triples',\n ];\n $resReq = new Request('patch', $location . '/metadata', $headers, \"<$location> <$prop> \\\"value1\\\" .\");\n $txReq = new Request('put', self::$baseUrl . 'transaction', $headers);\n list($resResp, $txResp) = $this->runConcurrently([$resReq, $txReq], 50000);\n $this->assertEquals(200, $resResp->getStatusCode());\n $this->assertEquals(409, $txResp->getStatusCode());\n }",
"public function test_Incremental_Backup_Restore(){\n\t\tzbase_setup::reset_zbase_vbucketmigrator(TEST_HOST_1,TEST_HOST_2);\n\t\tflushctl_commands::set_flushctl_parameters(TEST_HOST_1, \"chk_max_items\", 100);\n\t\t$this->assertTrue(Data_generation::add_keys(2000, 100, 1, \"testvalue\"), \"adding keys failed\");\n\t\t// Ensure that keys are replicated to the slave\n\t\tsleep(30);\n\t\t$curr_items = stats_functions::get_all_stats(TEST_HOST_1, \"curr_items\");\n\t\t$this->assertEquals($curr_items ,2000 , \"All keys not replicated to slave\");\n\t\t// Take incremental backup using backup daemon\n\t\tbackup_tools_functions::clear_backup_data(TEST_HOST_2);\n\t\tbackup_tools_functions::clear_temp_backup_data(TEST_HOST_2);\n\t\tzbase_backup_setup::start_backup_daemon(TEST_HOST_2);\n\t\t$this->assertTrue(backup_tools_functions::verify_zbase_backup_upload(), \"Failed to upload the backup files to Storage Server\");\n\t\t// Kill vbucket migrator between master and slave\n\t\tvbucketmigrator_function::kill_vbucketmigrator(TEST_HOST_1);\n\t\tzbase_setup::memcached_service(TEST_HOST_2, \"stop\");\n\t\tremote_function::remote_execution(TEST_HOST_2,\"sudo rm -rf /data_*/zbase/*\");\n\t\tzbase_setup::memcached_service(TEST_HOST_2, \"start\");\n\t\t// Perform restore\n\t\tmb_restore_commands::restore_server(TEST_HOST_2);\n\t\t//Attempt get on all keys\n\t\t$this->assertTrue(Data_generation::verify_added_keys(TEST_HOST_2, 2000, \"testvalue\", 1), \"verifying keys failed\");\n\t\t// The below step causes SERVER ERROR\n\t\t//$this->assertTrue(Data_generation::verify_added_keys(TEST_HOST_2, 1, \"testvalue\", 2001), \"verifying keys failed\");\n\t}",
"public function testParallelAtomicTransaction(): void {\n $cfg = yaml_parse_file(__DIR__ . '/../config.yaml');\n $cfg['transactionController']['enforceCompleteness'] = true;\n yaml_emit_file(__DIR__ . '/../config.yaml', $cfg);\n\n $tx = $this->beginTransaction();\n $loc1 = $this->createMetadataResource(null, $tx);\n $req1 = new Request('get', \"$loc1/metadata\");\n $headers = [\n self::$config->rest->headers->transactionId => $tx,\n 'Content-Type' => 'application/n-triples',\n 'Eppn' => 'admin',\n ];\n $resp1 = self::$client->send($req1);\n $this->assertEquals(200, $resp1->getStatusCode());\n\n $meta2 = (new Graph())->resource(self::$baseUrl);\n $meta2->addResource(self::$config->schema->id, $loc1);\n $body2 = $meta2->getGraph()->serialise('application/n-triples');\n $req2 = new Request('post', self::$baseUrl . 'metadata', $headers, $body2);\n\n $meta3 = (new Graph())->resource(self::$baseUrl);\n $body3 = $meta3->getGraph()->serialise('application/n-triples');\n $req3 = new Request('post', self::$baseUrl . 'metadata', $headers, $body3);\n\n $requests = [$req2, $req3, $req3, $req3, $req3, $req3, $req3, $req3, $req3,\n $req3];\n $delays = [100, 10000, 10000, 50000, 100000, 100000, 100000, 200000, 200000];\n $responses = $this->runConcurrently($requests, $delays);\n\n $resp1 = self::$client->send($req1);\n $this->assertEquals(404, $resp1->getStatusCode());\n\n $this->assertEquals(409, $responses[0]->getStatusCode());\n $allowed = [201, 409, 400];\n $allowed400 = [\n \"Transaction $tx doesn't exist\",\n \"Wrong transaction state: rollback\",\n ];\n for ($i = 1; $i < count($responses); $i++) {\n $sc = $responses[$i]->getStatusCode();\n if ($sc !== 201) {\n $allowed = [409, 400];\n if ($sc !== 409) {\n $allowed = [400];\n }\n }\n $this->assertContains($sc, $allowed);\n if ($sc === 409) {\n $this->assertEquals(\"Transaction $tx is in rollback state and can't be locked\", (string) $responses[$i]->getBody());\n } else if ($sc === 400) {\n $this->assertContains((string) $responses[$i]->getBody(), $allowed400);\n }\n }\n $this->assertEquals(\"Transaction $tx doesn't exist\", (string) $responses[$i - 1]->getBody());\n sleep(1);\n }",
"public function testCloneTask()\n {\n // workflow, rule, action and object\n $this->task = factory(TaskEloquent::class)->create([\n 'user_id' => null,\n 'person_id' => $this->person->getKey(),\n ]);\n\n $workflow = factory(WorkflowEloquent::class)->create([\n 'user_id' => $this->user->getKey(),\n ]);\n $action1 = factory(ActionEloquent::class)->create([\n 'action_type' => ActionEloquent::ACTION_TYPE_CLONE,\n 'target_class' => '',\n 'target_field' => '',\n 'value' => '',\n 'task_id' =>$this->task->getKey(),\n ]);\n $workflow->actions()->sync([$action1->getKey() ]); //, $action2->getKey()\n $object = factory(ObjectEloquent::class)->create([\n 'workflow_id' => $workflow->getKey(),\n 'object_class' => 'tags.id',\n 'object_type' => $this->tag->getKey(),\n ]);\n\n\n // rule\n $rule1 = factory(RuleEloquent::class)->create([\n 'name' => 'assign task to user',\n 'workflow_id' => $workflow->getKey(),\n 'rule_type' => RuleEloquent::FIELD_TYPE_NUMBER,\n 'operator' => RuleEloquent::OPERATOR_EQUAL,\n 'field_name' => 'person_contexts.stage_id',\n 'value' => $this->stageId,\n 'runnable_once' => 1, // only once\n ]);\n\n $action1->rules()->sync([ $rule1->getKey()]);\n\n // run action runner\n $kernel = $this->app->make(Kernel::class);\n $status = $kernel->handle(\n $input = new ArrayInput(array(\n 'command' => 'workflow:action-run',\n 'workflow' => $workflow->getKey(),\n 'action' => $action1->getKey(),\n )),\n $output = new BufferedOutput\n );\n //echo $output->fetch();\n $this->assertEquals($status, 0);\n\n // check status\n $this->seeInDatabase('action_logs',[\n 'action_id' => $action1->getKey(),\n 'workflow_id' => $workflow->getKey(),\n 'status' => LogInterface::LOG_STATUS_SUCCESS,\n 'object_class' => $this->person->getLoggableType(), //$leadContext->getLoggableType(),\n 'object_id' => $this->person->getKey(), //$leadContext->getKey(),\n 'user_id' => $this->user->getKey(),\n ]);\n\n // check task\n $this->seeInDatabase('tasks',[\n 'user_id' => $this->user->getKey(),\n 'person_id' => $this->person->getKey(),\n 'created_by' => $this->user->getKey(),\n 'updated_by' => $this->user->getKey(),\n ]);\n\n $this->cleanUpRecords(new PersonObserver, $this->person);\n }",
"public function move_backup_in($working_dir, $dest_dir, $preserve_existing = 1, $do_not_overwrite = array('plugins', 'themes', 'uploads', 'upgrade'), $type = 'not-others', $send_actions = false, $force_local = false) {\n\n\t\tglobal $wp_filesystem, $updraftplus;\n\t\t$updraft_dir = $updraftplus->backups_dir_location();\n\n\t\tif (true == $force_local) {\n\t\t\t$wpfs = new UpdraftPlus_WP_Filesystem_Direct(true);\n\t\t} else {\n\t\t\t$wpfs = $wp_filesystem;\n\t\t}\n\n\t\t// Get the content to be moved in. Include hidden files = true. Recursion is only required if we're likely to copy-in\n\t\t$recursive = (self::MOVEIN_COPY_IN_CONTENTS == $preserve_existing) ? true : false;\n\t\t$upgrade_files = $wpfs->dirlist($working_dir, true, $recursive);\n\n\t\tif (empty($upgrade_files)) return true;\n\n\t\t// check if our path is a file by looking to see if it's in the list of files we want to restore, if it is then remove the file from the path\n\t\tif (isset($upgrade_files[basename($dest_dir)]) && 'f' == $upgrade_files[basename($dest_dir)]['type']) $dest_dir = trailingslashit(dirname($dest_dir));\n\t\t\n\t\tif (!$wpfs->is_dir($dest_dir)) {\n\t\t\tif ($wpfs->is_dir(dirname($dest_dir))) {\n\t\t\t\tif (!$wpfs->mkdir($dest_dir, FS_CHMOD_DIR)) return new WP_Error('mkdir_failed', __('The directory does not exist, and the attempt to create it failed', 'updraftplus') . ' (' . $dest_dir . ')');\n\t\t\t\t$updraftplus->log(\"Destination directory did not exist, but was successfully created ($dest_dir)\");\n\t\t\t} else {\n\t\t\t\treturn new WP_Error('no_such_dir', __('The directory does not exist', 'updraftplus') . \" ($dest_dir)\");\n\t\t\t}\n\t\t}\n\n\t\t$wpcore_config_moved = false;\n\n\t\tif ('plugins' == $type || 'themes' == $type) $updraftplus->log(\"Top-level entities being moved: \".implode(', ', array_keys($upgrade_files)));\n\n\t\tforeach ($upgrade_files as $file => $filestruc) {\n\n\t\t\tif (empty($file)) continue;\n\n\t\t\tif ($dest_dir.$file == $updraft_dir) {\n\t\t\t\t$updraftplus->log('Skipping attempt to replace updraft_dir whilst processing '.$type);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Correctly restore files in 'others' in no directory that were wrongly backed up in versions 1.4.0 - 1.4.48\n\t\t\tif (('others' == $type || 'wpcore' == $type) && preg_match('/^([\\-_A-Za-z0-9]+\\.php)$/i', $file, $matches) && $wpfs->exists($working_dir . \"/$file/$file\")) {\n\t\t\t\tif ('others' == $type) {\n\t\t\t\t\t$updraftplus->log(\"Found file: $file/$file: presuming this is a backup with a known fault (backup made with versions 1.4.0 - 1.4.48, and sometimes up to 1.6.55 on some Windows servers); will rename to simply $file\", 'notice-restore');\n\t\t\t\t} else {\n\t\t\t\t\t$updraftplus->log(\"Found file: $file/$file: presuming this is a backup with a known fault (backup made with versions before 1.6.55 in certain situations on Windows servers); will rename to simply $file\", 'notice-restore');\n\t\t\t\t}\n\t\t\t\t$updraftplus->log(\"$file/$file: rename to $file\");\n\t\t\t\t$file = $matches[1];\n\t\t\t\t$tmp_file = rand(0, 999999999).'.php';\n\t\t\t\t// Rename directory\n\t\t\t\tif (!$wpfs->move($working_dir . \"/$file\", $working_dir . \"/\".$tmp_file, true)) {\n\t\t\t\t\t$this->restore_log_permission_failure_message($working_dir, 'Move '. $working_dir . \"/$file -> \".$working_dir . \"/\".$tmp_file, 'Destination');\n\t\t\t\t}\n\t\t\t\tif (!$wpfs->move($working_dir . \"/$tmp_file/$file\", $working_dir .\"/\".$file, true)) {\n\t\t\t\t\t$this->restore_log_permission_failure_message($working_dir, 'Move '.$working_dir . \"/$tmp_file/$file -> \".$working_dir .\"/\".$file, 'Destination');\n\t\t\t\t}\n\t\t\t\tif (!$wpfs->rmdir($working_dir . \"/$tmp_file\", false)) {\n\t\t\t\t\t$this->restore_log_permission_failure_message($working_dir, 'Delete '.$working_dir . \"/$tmp_file\");\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ('wp-config.php' == $file && 'wpcore' == $type) {\n\t\t\t\tif (empty($this->restore_options['updraft_restorer_wpcore_includewpconfig'])) {\n\t\t\t\t\t$updraftplus->log_e('wp-config.php from backup: will restore as wp-config-backup.php', 'updraftplus');\n\t\t\t\t\tif (!$wpfs->move($working_dir . \"/$file\", $working_dir . \"/wp-config-backup.php\", true)) {\n\t\t\t\t\t\t$this->restore_log_permission_failure_message($working_dir, 'Move '.$working_dir . \"/$file -> \".$working_dir . \"/wp-config-backup.php\", 'Destination');\n\t\t\t\t\t}\n\t\t\t\t\t$file = \"wp-config-backup.php\";\n\t\t\t\t\t$wpcore_config_moved = true;\n\t\t\t\t} else {\n\t\t\t\t\t$updraftplus->log_e(\"wp-config.php from backup: restoring (as per user's request)\", 'updraftplus');\n\t\t\t\t}\n\t\t\t} elseif ('wpcore' == $type && 'wp-config-backup.php' == $file && $wpcore_config_moved) {\n\t\t\t\t// The file is already gone; nothing to do\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Sanity check (should not be possible as these were excluded at backup time)\n\t\t\tif (in_array($file, $do_not_overwrite)) continue;\n\n\t\t\tif (('object-cache.php' == $file || 'advanced-cache.php' == $file) && 'others' == $type) {\n\t\t\t\tif (false == apply_filters('updraftplus_restorecachefiles', true, $file)) {\n\t\t\t\t\t$nfile = preg_replace('/\\.php$/', '-backup.php', $file);\n\t\t\t\t\tif (!$wpfs->move($working_dir . \"/$file\", $working_dir . \"/\" .$nfile, true)) {\n\t\t\t\t\t\t$this->restore_log_permission_failure_message($working_dir, 'Move '. $working_dir . '/' . $file .' -> '.$working_dir . '/' . $nfile, 'Destination');\n\t\t\t\t\t}\n\t\t\t\t\t$file = $nfile;\n\t\t\t\t}\n\t\t\t} elseif (('object-cache-backup.php' == $file || 'advanced-cache-backup.php' == $file) && 'others' == $type) {\n\t\t\t\tif (!$wpfs->delete($working_dir.\"/\".$file)) {\n\t\t\t\t\t$this->restore_log_permission_failure_message($working_dir, 'Delete '.$working_dir.\"/\".$file);\n\t\t\t\t}\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// First, move the existing one, if necessary (may not be present)\n\t\t\tif ($wpfs->exists($dest_dir.$file)) {\n\t\t\t\tif (self::MOVEIN_MAKE_BACKUP_OF_EXISTING == $preserve_existing) {\n\t\t\t\t\tif (!$wpfs->move($dest_dir.$file, $dest_dir.$file.'-old', true)) {\n\t\t\t\t\t\t$this->restore_log_permission_failure_message($dest_dir, 'Move '. $dest_dir.$file.' -> '.$dest_dir.$file.'-old', 'Destination');\n\t\t\t\t\t\treturn new WP_Error('old_move_failed', $this->strings['old_move_failed'].\" ($dest_dir$file)\");\n\t\t\t\t\t}\n\t\t\t\t} elseif (self::MOVEIN_OVERWRITE_NO_BACKUP == $preserve_existing) {\n\t\t\t\t\tif (!$wpfs->delete($dest_dir.$file, true)) {\n\t\t\t\t\t\t$this->restore_log_permission_failure_message($dest_dir, 'Delete '.$dest_dir.$file);\n\t\t\t\t\t\treturn new WP_Error('old_delete_failed', $this->strings['old_delete_failed'].\" ($file)\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\n\t\t\t// Secondly, move in the new one\n\t\t\t$is_dir = $wpfs->is_dir($working_dir.\"/\".$file);\n\n\t\t\tif (self::MOVEIN_DO_NOTHING_IF_EXISTING == $preserve_existing && $wpfs->exists($dest_dir.$file)) {\n\t\t\t\t// Something exists - no move. Remove it from the temporary directory - so that it will be clean later\n\t\t\t\t@$wpfs->delete($working_dir.'/'.$file, true);// phpcs:ignore Generic.PHP.NoSilencedErrors.Discouraged\n\t\t\t// The $is_dir check was added in version 1.11.18; without this, files in the top-level that weren't in the first archive didn't get over-written\n\t\t\t} elseif (self::MOVEIN_COPY_IN_CONTENTS != $preserve_existing || !$wpfs->exists($dest_dir.$file) || !$is_dir) {\n\n\t\t\t\tif ($wpfs->move($working_dir.\"/\".$file, $dest_dir.$file, true)) {\n\t\t\t\t\tif ($send_actions) do_action('updraftplus_restored_'.$type.'_one', $file);\n\t\t\t\t\t// Make sure permissions are at least as great as those of the parent\n\t\t\t\t\tif ($is_dir) {\n\t\t\t\t\t\t// This method is broken due to https://core.trac.wordpress.org/ticket/26598\n\t\t\t\t\t\tif (empty($chmod)) $chmod = octdec(sprintf(\"%04d\", $this->get_current_chmod($dest_dir, $wpfs)));// phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UndefinedVariable\n\t\t\t\t\t\tif (!empty($chmod)) $this->chmod_if_needed($dest_dir.$file, $chmod, false, $wpfs);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$this->restore_log_permission_failure_message($dest_dir, 'Move '. $working_dir.\"/\".$file.\" -> \".$dest_dir.$file, 'Destination');\n\t\t\t\t\treturn new WP_Error('move_failed', $this->strings['move_failed'], $working_dir.\"/\".$file.\" -> \".$dest_dir.$file);\n\t\t\t\t}\n\t\t\t} elseif (self::MOVEIN_COPY_IN_CONTENTS == $preserve_existing && !empty($filestruc['files'])) {\n\t\t\t\t// The directory ($dest_dir) already exists, and we've been requested to copy-in. We need to perform the recursive copy-in\n\t\t\t\t// $filestruc['files'] is then a new structure like $upgrade_files\n\t\t\t\t// First pass: create directory structure\n\t\t\t\t// Get chmod value for the parent directory, and re-use it (instead of passing false)\n\n\t\t\t\t// This method is broken due to https://core.trac.wordpress.org/ticket/26598\n\t\t\t\tif (empty($chmod)) $chmod = octdec(sprintf(\"%04d\", $this->get_current_chmod($dest_dir, $wpfs)));\n\t\t\t\t// Copy in the files. This also needs to make sure the directories exist, in case the zip file lacks entries\n\t\t\t\t$delete_root = ('others' == $type || 'wpcore' == $type) ? false : true;\n\n\t\t\t\t$copy_in = $this->copy_files_in($working_dir.'/'.$file, $dest_dir.$file, $filestruc['files'], $chmod, $delete_root);\n\t\t\t\tif (!empty($chmod)) $this->chmod_if_needed($dest_dir.$file, $chmod, false, $wpfs);\n\n\t\t\t\tif (is_wp_error($copy_in) || !$copy_in) {\n\t\t\t\t\t$this->restore_log_permission_failure_message($dest_dir, 'Move '. $working_dir.\"/\".$file.\" -> \".$dest_dir.$file, 'Destination');\n\t\t\t\t}\n\t\t\t\tif (is_wp_error($copy_in)) return $copy_in;\n\t\t\t\tif (!$copy_in) return new WP_Error('move_failed', $this->strings['move_failed'], \"(2) \".$working_dir.'/'.$file.\" -> \".$dest_dir.$file);\n\n\t\t\t\tif (!$wpfs->rmdir($working_dir.'/'.$file)) {\n\t\t\t\t\t$this->restore_log_permission_failure_message($working_dir, 'Delete '.$working_dir.'/'.$file);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (!$wpfs->rmdir($working_dir.'/'.$file)) {\n\t\t\t\t\t$this->restore_log_permission_failure_message($working_dir, 'Delete '.$working_dir.'/'.$file);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\n\t}",
"public function testRevert()\n {\n $file1 = new File;\n $file1->setFilespec('//depot/one');\n $file1->add();\n\n $file2 = new File;\n $file2->setFilespec('//depot/two');\n $file2->add();\n\n $file3 = new File;\n $file3->setFilespec('//depot/three');\n $file3->add();\n\n $change = new Change;\n $change->setDescription(\"Test change\");\n $change->setFiles(array('//depot/two', '//depot/three'));\n $change->save();\n\n // check that we have three files open.\n $query = FileQuery::create()\n ->addFilespec('//depot/...')\n ->setLimitToOpened(true);\n $this->assertSame(\n 3,\n File::fetchAll($query)->count(),\n \"Expected three open files\"\n );\n\n // revert the pending change.\n $change->revert();\n\n // check that we have one file open.\n $this->assertSame(\n 1,\n File::fetchAll($query)->count(),\n \"Expected one open file\"\n );\n\n // check that the correct files are opened.\n $file1->clearStatusCache();\n $this->assertTrue($file1->isOpened());\n $file2->clearStatusCache();\n $this->assertFalse($file2->isOpened());\n $file3->clearStatusCache();\n $this->assertFalse($file3->isOpened());\n }",
"public function testProcessWeirdCase2()\n {\n $unit1 = $this->getUnit('test');\n $unit1->setReversedMapping([\n 'name' => 'map.field1',\n ]);\n $unit1->setReversedConnection([\n 'tid' => 'id',\n ]);\n $unit1->setMapping([\n 'field1' => 'name',\n 'field2' => 'code',\n 'id' => 'id',\n ]);\n $unit1->setFilesystem($this->getFS(\n [\n ['Pete', 'tst1', '1'],\n false,\n ]\n ));\n $unit1->setTmpFileName('customer_tmp.csv');\n\n $unit2 = $this->getUnit('test2');\n $unit2->setReversedMapping([\n 'name' => 'map.field1',\n ]);\n $unit2->setReversedConnection([\n 'tid' => 'parent_id',\n ]);\n $unit2->setMapping([\n 'field1' => 'name',\n 'field2' => 'code',\n 'parent_id' => 'id',\n ]);\n $unit2->setFilesystem($this->getFS(\n [\n false\n ]\n ));\n $unit2->setTmpFileName('customer_tmp.csv');\n $unit2->setParent($unit1);\n\n $action = $this->getAction([$unit1, $unit2]);\n $action->process($this->getResultMock());\n }",
"public function testSubmitResolveConflicts()\n {\n // create a second client.\n $client = new Client;\n $client->setId(\"client-2\")\n ->setRoot($this->getP4Params('clientRoot') . '/client-2')\n ->addView(\"//depot/...\", \"//client-2/...\")\n ->save();\n\n // connect w. second client.\n $p4 = Connection::factory(\n $this->p4->getPort(),\n $this->p4->getUser(),\n $client->getId(),\n $this->getP4Params('password')\n );\n\n // create a situation where resolve is needed.\n // a. from the main test client add/submit 'foo', then edit it.\n // b. from another client sync/edit/submit 'foo'.\n $file1 = new File;\n $file1->setFilespec(\"//depot/foo\")\n ->setLocalContents(\"contents-1\")\n ->add()\n ->submit(\"change 1\")\n ->edit();\n $file2 = new File($p4);\n $file2->setFilespec(\"//depot/foo\")\n ->sync()\n ->edit()\n ->submit(\"change 2\");\n\n // try to submit a change w. files needing resolve.\n $change = new Change;\n $change->addFile($file1)\n ->submit(\"main client submit\", Change::RESOLVE_ACCEPT_YOURS);\n }",
"public function move($source, $target)\n {\n \n }",
"public function testDestiny2TransferItem()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"public function testCopyDirOverExistingUpcountsDestinationDirname()\n {\n $this->storage->createDir('/', 'dest');\n $this->storage->createDir('/dest', 'tmp');\n $this->storage->createFile('/dest/tmp/', 'a.txt');\n $this->storage->createDir('/', 'tmp');\n $this->storage->createFile('/tmp/', 'b.txt');\n\n $this->storage->copyDir('/tmp', '/dest');\n\n $this->assertDirectoryExists(TEST_REPOSITORY.'/dest/tmp/');\n $this->assertTrue($this->storage->fileExists('/dest/tmp/a.txt'));\n\n $this->assertDirectoryExists(TEST_REPOSITORY.'/dest/tmp (1)');\n $this->assertTrue($this->storage->fileExists('/dest/tmp (1)/b.txt'));\n }",
"public function testSameCodes()\n {\n $unit1 = $this->getUnit('test');\n $unit1->setReversedMapping([\n 'name' => 'map.test_field1',\n ]);\n $unit1->setReversedConnection([\n 'tid' => 'id',\n ]);\n $unit1->setMapping([\n 'field1' => 'name',\n 'field2' => 'code',\n 'id' => 'id',\n ]);\n $unit1->setFilesystem($this->getFS(\n [\n ['Pete', 'tst1', '1'],\n false,\n ]\n ));\n $unit1->setTmpFileName('test_tmp.csv');\n\n $unit2 = $this->getUnit('test2');\n $unit2->setReversedMapping([\n 'secondName' => 'map.test2_field1',\n ]);\n $unit2->setReversedConnection([\n 'tid' => 'parent_id',\n ]);\n $unit2->setMapping([\n 'field1' => 'name',\n 'field2' => 'code',\n 'parent_id' => 'id',\n ]);\n $unit2->setFilesystem($this->getFS(\n [\n ['George', 'tst2', '1'],\n false,\n ]\n ));\n $unit2->setTmpFileName('test2_tmp.csv');\n $unit2->addSibling($unit1);\n\n $expected = [\n [[\n 'name' => 'Pete',\n 'secondName' => 'George',\n ]],\n ];\n\n $action = $this->getAction([$unit1, $unit2], $expected);\n $action->process($this->getResultMock());\n }",
"public function move($source, $destination, $overwrite = \\false)\n {\n }",
"public function move($source, $destination, $overwrite = \\false)\n {\n }",
"public function move($source, $destination, $overwrite = \\false)\n {\n }",
"public function move($source, $destination, $overwrite = \\false)\n {\n }",
"public function createFileSystemMock(MutationInterface2 $mutation);",
"public function test_move_item(): void\n {\n // Arrange\n $user = UserFactory::createOne()->object();\n $collectionLevel1 = CollectionFactory::createOne(['owner' => $user]);\n $collectionLevel2 = CollectionFactory::createOne(['parent' => $collectionLevel1, 'owner' => $user]);\n $collectionLevel3 = CollectionFactory::createOne(['parent' => $collectionLevel2, 'owner' => $user]);\n $item = ItemFactory::createOne(['collection' => $collectionLevel3, 'owner' => $user]);\n\n // Act\n $newCollection = CollectionFactory::createOne(['owner' => $user]);\n $item->setCollection($newCollection->object());\n $item->save();\n\n $this->refreshCachedValuesQueue->process();\n\n // Assert\n $this->assertSame(1, $newCollection->getCachedValues()['counters']['items']);\n $this->assertSame(0, $collectionLevel1->getCachedValues()['counters']['items']);\n $this->assertSame(0, $collectionLevel2->getCachedValues()['counters']['items']);\n $this->assertSame(0, $collectionLevel3->getCachedValues()['counters']['items']);\n }",
"public function testShiftTasksOpenOnly() {\n\t\t$milestone1_pre = $this->Milestone->findById(1);\n\t\t$milestone3_pre = $this->Milestone->findById(3);\n\n\t\t$this->assertEqual($milestone1_pre['Tasks'], array(\n\t\t\t'open' => array('numTasks' => '2', 'points' => '0'),\n\t\t\t'in progress' => array('numTasks' => '2', 'points' => '0'),\n\t\t\t'resolved' => array('numTasks' => '1', 'points' => '0'),\n\t\t\t'closed' => array('numTasks' => '1', 'points' => '0'),\n\t\t\t'dropped' => array('numTasks' => '1', 'points' => '0'),\n\t\t));\n\t\t$this->assertEqual($milestone3_pre['Tasks'], array(\n\t\t\t'open' => array('numTasks' => '0', 'points' => '0'),\n\t\t\t'in progress' => array('numTasks' => '0', 'points' => '0'),\n\t\t\t'resolved' => array('numTasks' => '0', 'points' => '0'),\n\t\t\t'closed' => array('numTasks' => '0', 'points' => '0'),\n\t\t\t'dropped' => array('numTasks' => '0', 'points' => '0'),\n\t\t));\n\n\t\t// Shift only the non-resolved/closed tasks and check all is well\n\t\t$this->Milestone->shiftTasks(1, 3, false, array('callbacks' => false));\n\n\t\t$milestone1_post = $this->Milestone->findById(1);\n\t\t$milestone3_post = $this->Milestone->findById(3);\n\t\t$this->assertEqual($milestone1_post['Tasks'], array(\n\t\t\t'open' => array('numTasks' => '0', 'points' => '0'),\n\t\t\t'in progress' => array('numTasks' => '0', 'points' => '0'),\n\t\t\t'resolved' => array('numTasks' => '1', 'points' => '0'),\n\t\t\t'closed' => array('numTasks' => '1', 'points' => '0'),\n\t\t\t'dropped' => array('numTasks' => '0', 'points' => '0'),\n\t\t));\n\t\t$this->assertEqual($milestone3_post['Tasks'], array(\n\t\t\t'open' => array('numTasks' => '2', 'points' => '0'),\n\t\t\t'in progress' => array('numTasks' => '2', 'points' => '0'),\n\t\t\t'resolved' => array('numTasks' => '0', 'points' => '0'),\n\t\t\t'closed' => array('numTasks' => '0', 'points' => '0'),\n\t\t\t'dropped' => array('numTasks' => '1', 'points' => '0'),\n\t\t));\n\t}",
"function mm_ui_content_copymove_validate($form, &$form_state, $restore = FALSE) {\n _mm_ui_content_copymove_get_values($form_state['values'], $src_mmtid, $modes, $src_parent_mmtid, $dest_mmtid);\n $nodes_only = $modes['move_nodes'] || $modes['copy_nodes'] && !$modes['copy_page'];\n\n if ($modes['copy_page'] || $modes['move_page']) {\n mm_ui_validate_fake_required($form['name_alias']['name'], trim($form_state['values']['name']));\n mm_ui_validate_fake_required($form['name_alias']['alias'], trim($form_state['values']['alias']));\n }\n\n if (!$src_mmtid || !is_numeric($src_mmtid)) {\n form_set_error('', t('Missing one or more required fields'));\n return;\n }\n\n $x = mm_ui_strings(mm_content_is_group($src_mmtid));\n\n if ($modes['move_page'] && !mm_content_user_can($src_mmtid, 'w'))\n $message = t('You do not have permission to modify this @thing.', $x);\n\n if ($modes['move_page'] && !$restore && !mm_content_user_can($src_parent_mmtid, 'a'))\n $message = t('You do not have permission to modify the source @thingpos parent.', $x);\n\n if (!is_numeric($dest_mmtid) || !mm_content_user_can($dest_mmtid, $nodes_only ? 'u' : 'a'))\n $message = t('You do not have permission to modify the destination @thing.', $x);\n\n if (mm_content_is_normal($src_mmtid) != mm_content_is_normal($dest_mmtid) || mm_content_is_group($src_mmtid) != mm_content_is_group($dest_mmtid))\n $message = t('Source and destination are not of the same type.');\n\n if (mm_content_user_can($dest_mmtid, 'IS_RECYCLED'))\n if ($modes['copy_nodes'] || $modes['copy_page']) {\n $message = 'You cannot copy to a recycle bin.';\n }\n else {\n $message = 'You cannot move to a recycle bin using this option. Please use the Delete option, instead.';\n }\n\n if ($message) {\n watchdog('mm', $message, array(), WATCHDOG_WARNING, \"source: $src_mmtid, dest: $dest_mmtid\");\n form_set_error('', t($message));\n return;\n }\n\n if (mm_content_is_vgroup($src_mmtid) != mm_content_is_vgroup($dest_mmtid)) {\n form_set_error('dest', mm_content_is_vgroup($src_mmtid) ? t('Pre-defined groups can only be moved to create sub-groups of other pre-defined groups.') : t('You cannot copy/move a regular group inside the pre-defined groups list.'));\n }\n\n if (!$nodes_only && !_mm_ui_validate_entry($src_mmtid, $dest_mmtid, $form_state['values'], TRUE, TRUE)) {\n return;\n }\n\n if ($dest_mmtid == $src_parent_mmtid && $modes['move_page']) {\n form_set_error('', t('Instead of moving a @thing within the same parent @thing, rename it using Settings->Edit.', $x));\n }\n else if ($dest_mmtid == $src_mmtid && $nodes_only && $modes['move_nodes']) {\n form_set_error('', t('Moving just a @thingpos contents to itself results in no change.', $x));\n }\n else if ($dest_mmtid == $src_mmtid && !$modes['move_nodes'] && ($modes['move_page'] || $modes['copy_recur'])) {\n form_set_error('', t('You cannot copy or move a @thing within itself.', $x));\n }\n else if (mm_content_is_child($dest_mmtid, $src_mmtid)) {\n if ($modes['move_page']) {\n form_set_error('dest', t('You cannot move a @thing into a @subthing of itself. Please choose another destination.', $x));\n }\n else if ($modes['copy_recur']) {\n form_set_error('dest', t('You cannot copy a @thing and any @subthings into a child of itself. Please choose another destination.', $x));\n }\n }\n else if ($modes['move_nodes'] && mm_content_is_archive($dest_mmtid)) {\n form_set_error('dest', t('You cannot move content into an archive. Move the content into the main @thing, instead, and the archive will be updated automatically.', $x));\n }\n}",
"public function testParallelPatchPatchAddId(): void {\n $loc1 = $this->createMetadataResource();\n $loc2 = $this->createMetadataResource();\n $prop = 'http://foo';\n $value = 'http://same/object';\n\n $txId = $this->beginTransaction();\n $headers = [\n self::$config->rest->headers->transactionId => $txId,\n 'Eppn' => 'admin',\n 'Content-Type' => 'application/n-triples',\n ];\n $req1 = new Request('patch', $loc1 . '/metadata', $headers, \"<$loc1> <$prop> <$value> .\");\n $req2 = new Request('patch', $loc2 . '/metadata', $headers, \"<$loc2> <$prop> <$value> .\");\n list($resp1, $resp2) = $this->runConcurrently([$req1, $req2], 0);\n $h1 = $resp1->getHeaders();\n $h2 = $resp2->getHeaders();\n $this->assertEquals(200, $resp1->getStatusCode());\n $this->assertEquals(200, $resp2->getStatusCode());\n $this->assertLessThan(min($h1['Time'][0], $h2['Time'][0]) / 2, abs($h1['Start-Time'][0] - $h2['Start-Time'][0])); // make sure they were executed in parallel\n $r1 = $this->extractResource($resp1->getBody(), $loc1);\n $r2 = $this->extractResource($resp2->getBody(), $loc2);\n $this->assertEquals((string) $r2->getResource($prop), (string) $r1->getResource($prop));\n }",
"public function testProcess2()\n {\n $unit1 = $this->getUnit('customer');\n $unit1->setReversedMapping([\n 'email' => 'map.email',\n 'name' => function ($map) {\n return $map['fname'] . ' ' . $map['lname'];\n },\n 'age' => 'map.age',\n ]);\n $unit1->setReversedConnection([\n 'customer_id' => 'id',\n ]);\n $unit1->setMapping([\n 'id' => 'map.id',\n 'fname' => function ($map) {\n list($fname) = explode(\" \", $map['name']);\n return $fname;\n },\n 'lname' => function ($map) {\n list(, $lname) = explode(\" \", $map['name']);\n return $lname;\n },\n 'email' => 'map.email',\n 'age' => 'map.age',\n ]);\n $unit1->setFilesystem($this->getFS(\n [\n [1, 'Olaf', 'Stone', '[email protected]', 30],\n [2, 'Peter', 'Ostridge', '[email protected]', 33],\n false,\n ]\n ));\n $unit1->setTmpFileName('customer_tmp.csv');\n\n $unit2 = $this->getUnit('address');\n $unit2->setReversedMapping([\n 'addr_city' => 'map.city',\n 'addr_street' => 'map.street',\n ]);\n $unit2->setReversedConnection([\n 'customer_id' => 'parent_id',\n ]);\n $unit2->setMapping([\n 'id' => 'map.addr_id',\n 'street' => 'map.addr_street',\n 'city' => 'map.addr_city',\n 'parent_id' => 'map.id',\n ]);\n $unit2->addContribution(function (MapInterface $map) {\n $map->incr('addr_id', 1);\n });\n $unit2->setFilesystem($this->getFS(\n [\n [1, '4100 Marine dr. App. 54', 'Chicago', 1],\n [2, '3300 St. George, Suite 300', 'New York', 1],\n [3, '111 W Jackson', 'Chicago', 4],\n [4, '111 W Jackson-2', 'Chicago', 4],\n // next rows will not be read due to LogicException\n // [5, 'Hollywood', 'LA', 4],\n // false,\n ]\n ));\n $unit2->setTmpFileName('address_tmp.csv');\n $unit2->setParent($unit1);\n\n $expected = [\n [[\n 'email' => '[email protected]',\n 'name' => 'Olaf Stone',\n 'age' => 30,\n 'address' => [\n [\n 'addr_city' => 'Chicago',\n 'addr_street' => '4100 Marine dr. App. 54',\n ],\n [\n 'addr_city' => 'New York',\n 'addr_street' => '3300 St. George, Suite 300',\n ]\n ]\n ]],\n ];\n\n $action = $this->getAction([$unit1, $unit2], $expected);\n $action->process($this->getResultMock());\n }",
"private function syncRepository()\n {\n $cwd = '/tmp/'.$this->migrationId;\n (new ProcessBuilder(['mkdir']))->add('-p')->add($cwd)->getProcess()->mustRun();\n\n $cloneSourceCommandBuilder = new ProcessBuilder(['git', 'clone', $this->sourceProject->getSshUrlToRepo(), '.']);\n $cloneSourceCommandBuilder\n ->setWorkingDirectory($cwd)\n ->setTimeout(self::TIMEOUT)\n ->getProcess()\n ->mustRun();\n\n $addNewRemoteBuilder = new ProcessBuilder(['git', 'remote', 'add', 'new']);\n $addNewRemoteBuilder\n ->setWorkingDirectory($cwd)\n ->add($this->targetProject->getSshUrlToRepo())\n ->getProcess()\n ->mustRun();\n\n $pushToRemoteBuilder = new ProcessBuilder(['git', 'push', 'new', '--all']);\n $pushToRemoteBuilder\n ->setWorkingDirectory($cwd)\n ->setTimeout(self::TIMEOUT)\n ->getProcess()\n ->mustRun();\n\n $pushTagsToRemoteBuilder = new ProcessBuilder(['git', 'push', 'new', '--tags']);\n $pushTagsToRemoteBuilder\n ->setWorkingDirectory($cwd)\n ->setTimeout(self::TIMEOUT)\n ->getProcess()\n ->mustRun();\n }",
"function move_tree($id, $target_id, $pos, $copy = false)\r\n\t{\r\n\t\tif ($id == $target_id && !$copy)\r\n\t\t{\n \tdebug :: write_error(NESE_ERROR_RECURSION,\r\n \t\t __FILE__ . ' : ' . __LINE__ . ' : ' . __FUNCTION__\r\n \t);\n \treturn false;\r\n\t\t} \r\n\t\t// Get information about source and target\r\n\t\tif (!($source = $this->get_node($id)))\r\n\t\t{\n \tdebug :: write_error(NESE_ERROR_NOT_FOUND,\r\n \t\t __FILE__ . ' : ' . __LINE__ . ' : ' . __FUNCTION__, \r\n \t\tarray('id' => $id)\r\n \t);\n \treturn false;\r\n\t\t} \r\n\r\n\t\tif (!($target = $this->get_node($target_id)))\r\n\t\t{\n \tdebug :: write_error(NESE_ERROR_NOT_FOUND,\r\n \t\t __FILE__ . ' : ' . __LINE__ . ' : ' . __FUNCTION__, \r\n \t\tarray('target_id' => $target_id)\r\n \t);\n \treturn false;\r\n\t\t} \r\n\r\n\t\t$lock = $this->_set_lock(true);\r\n\r\n\t\t$this->_relations = array(); \r\n\r\n\t\tif (!$copy)\r\n\t\t{ \r\n\t\t\t// We have a recursion - let's stop\r\n\t\t\tif (($target['root_id'] == $source['root_id']) &&\r\n\t\t\t\t\t(($source['l'] <= $target['l']) &&\r\n\t\t\t\t\t\t($source['r'] >= $target['r'])))\r\n\t\t\t{\r\n\t\t\t\t$this->_release_lock(true);\n\t\t\t\t\n\t \tdebug :: write_error(NESE_ERROR_RECURSION,\r\n\t \t\t __FILE__ . ' : ' . __LINE__ . ' : ' . __FUNCTION__\r\n\t \t);\n\t \treturn false;\r\n\t\t\t} \r\n\t\t\t// Insert/move before or after\r\n\t\t\tif (($source['root_id'] == $source['id']) &&\r\n\t\t\t\t\t($target['root_id'] == $target['id']) && ($pos != NESE_MOVE_BELOW))\r\n\t\t\t{ \r\n\t\t\t\t// We have to move a rootnode which is different from moving inside a tree\r\n\t\t\t\t$nid = $this->_move_root2root($source, $target, $pos);\r\n\t\t\t\t$this->_release_lock(true);\r\n\t\t\t\treturn $nid;\r\n\t\t\t} \r\n\t\t} \n\t\telseif (($target['root_id'] == $source['root_id']) &&\r\n\t\t\t\t\t\t(\t($source['l'] < $target['l']) &&\r\n\t\t\t\t\t\t\t($source['r'] > $target['r'])))\r\n\t\t{\r\n\t\t\t$this->_release_lock(true);\n\t\t\t\r\n \tdebug :: write_error(NESE_ERROR_RECURSION,\r\n \t\t __FILE__ . ' : ' . __LINE__ . ' : ' . __FUNCTION__\r\n \t);\n \treturn false;\r\n\t\t} \r\n\t\t// We have to move between different levels and maybe subtrees - let's rock ;)\r\n\t\t$move_id = $this->_move_across($source, $target, $pos, true);\r\n\t\t$this->_move_cleanup($copy);\r\n\t\t$this->_release_lock(true);\r\n\r\n\t\tif (!$copy)\r\n\t\t{\r\n\t\t\treturn $id;\r\n\t\t} \r\n\t\telse\r\n\t\t{\r\n\t\t\treturn $move_id;\r\n\t\t} \r\n\t}",
"function tc_file_system_copy($source, $destination, $overwrite = false, $mode = false){\r\n\t\r\n\t//initialize processed files object\r\n\t$processed_files = WPTC_Factory::get('processed-restoredfiles',true);\r\n\t$current_processed_files = array();\r\n\t\r\n\tglobal $wp_filesystem;\r\n\tif($wp_filesystem->method == 'direct'){\r\n\t\t// check if already processed ; if so dont copy\r\n\t\t$processed_file = $processed_files->get_file($source);\r\n\t\t//file_put_contents(WP_CONTENT_DIR .'/DE_clientPluginSIde.php',\"\\n -----processed_file obj------- \".var_export($processed_file,true).\"\\n\",FILE_APPEND);\r\n\t\tif ( !($processed_file) ) {\r\n\t\t\t$copy_result = $wp_filesystem->move($source, $destination, $overwrite, $mode);\r\n\t\t\tif($copy_result)\r\n\t\t\t{\r\n\t\t\t\t//file_put_contents(WP_CONTENT_DIR .'/DE_clientPluginSIde.php',\"\\n ----adding details--------\\n\",FILE_APPEND);\r\n\t\t\t\t//if copied then add the details to DB\r\n\t\t\t\t$this_file_detail['file'] = $source;\r\n\t\t\t\t$this_file_detail['copy_status'] = true;\r\n\t\t\t\t$this_file_detail['revision_number'] = null;\r\n\t\t\t\t$this_file_detail['revision_id'] = null;\r\n\t\t\t\t$this_file_detail['mtime_during_upload'] = null;\r\n\t\t\t\t\r\n\t\t\t\t$current_processed_files[] = $this_file_detail;\r\n\t\t\t\t//file_put_contents(WP_CONTENT_DIR .'/DE_clientPluginSIde.php',\"\\n -----current_processed_files------- \".var_export($current_processed_files,true).\"\\n\",FILE_APPEND);\r\n\t\t\t\t$processed_files->add_files($current_processed_files);\t\r\n\t\t\t\t//file_put_contents(WP_CONTENT_DIR .'/DE_clientPluginSIde.php',\"\\n ---any sql error------ \".var_export(mysql_error(),true).\"\\n\",FILE_APPEND);\r\n\t\t\t\t//set the in_progress option to false on final file copy\r\n\t\t\t}\r\n\t\t\treturn $copy_result;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}\r\n\telseif($wp_filesystem->method == 'ftpext' || $wp_filesystem->method == 'ftpsockets'){\r\n\t\tif ( ! $overwrite && $wp_filesystem->exists($destination) )\r\n\t\t\treturn false;\r\n\t\t//$content = $this->get_contents($source);\r\n//\t\tif ( false === $content)\r\n//\t\t\treturn false;\r\n\t\t\t\r\n\t\t//put content\t\r\n\t\t//$tempfile = wp_tempnam($file);\r\n\t\t$source_handle = fopen($source, 'r');\r\n\t\tif ( ! $source_handle )\r\n\t\t\treturn false;\r\n\r\n\t\t//fwrite($temp, $contents);\r\n\t\t//fseek($temp, 0); //Skip back to the start of the file being written to\r\n\t\t\r\n\t\t$sample_content = fread($source_handle, (1024 * 1024 * 2));//1024 * 1024 * 2 => 2MB\r\n\t\tfseek($source_handle, 0); //Skip back to the start of the file being written to\r\n\r\n\t\t$type = $wp_filesystem->is_binary($sample_content) ? FTP_BINARY : FTP_ASCII;\r\n\t\tunset($sample_content);\r\n\t\tif($wp_filesystem->method == 'ftpext'){\r\n\t\t\t$ret = @ftp_fput($wp_filesystem->link, $destination, $source_handle, $type);\r\n\t\t}\r\n\t\telseif($wp_filesystem->method == 'ftpsockets'){\r\n\t\t\t$wp_filesystem->ftp->SetType($type);\r\n\t\t\t$ret = $wp_filesystem->ftp->fput($destination, $source_handle);\r\n\t\t}\r\n\r\n\t\tfclose($source_handle);\r\n\t\tunlink($source);//to immediately save system space\r\n\t\t//unlink($tempfile);\r\n\r\n\t\t$wp_filesystem->chmod($destination, $mode);\r\n\r\n\t\treturn $ret;\r\n\t\t\r\n\t\t//return $this->put_contents($destination, $content, $mode);\r\n\t}\r\n}",
"public function move($source, $dest);",
"function movefile($POSTfrom, $POSTto, $currentdir) {\n\tif(count($POSTto) == 1) { //if the user selected only one \"move to\" location\n\t\tforeach($POSTfrom as $fromItem => $n1) { //$fromItem returns selected file/folder name to be moved, $n is checkbox status\n\t\t\tforeach($POSTto as $toItem => $n2) {//$toItem returns selected folder to have the files put in\n\t\t\t\tif(!file_exists($currentdir . \"/\" . $toItem . \"/\" . $fromItem)) {\n\t\t\t\t\tif(rename($currentdir . \"/\" . $fromItem, $currentdir . \"/\" . $toItem . \"/\" . $fromItem)) { //if rename worked, do nothing. Else, echo an error. Since rename() can rename a folder, it is possible to rename a file/folder to its new directory and have linux move it accourdingly\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t} else if ($fromItem == $toItem) { //if user tries to move the same folder into its self\n\t\t\t\t\t\techo \"<p><b>Error</b>: Could not move file or folder <b>\" . $fromItem . \"</b>. You cannot move a file into its self. Everything before it was moved.</p>\";\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t} else {\n\t\t\t\t\t\techo \"<p><b>Error</b>: Could not move file or folder <b>\" . $fromItem . \"</b>. Everything before it was moved.</p>\";\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\techo \"<p><b>Error</b>: File already exists in the folder you want to move it to. Everything before <b>\" . $fromItem . \"</b> has been moved.</p>\";\n\t\t\t\t\techo \"<p>Rename file if you want to move it.</p>\";\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} else {\n\t\techo \"<p><b>Error</b>: You selected more than one destination folder, or none at all. Or, you might have not selected anything to move.</p>\";\n\t\treturn false;\n\t}\n\t\n\treturn true; // If everything worked out, return true\n}",
"public function should_succeed_when_snapshots_are_equal(): void\n {\n $prev = new DirectorySnapshot(codecept_root_dir('tests/_support'));\n $snapshot = $prev->snapshotFileName();\n codecept_debug('Snapshot file: ' . $snapshot);\n $this->unlinkAfter[] = $snapshot;\n $prev->assert();\n\n $dirSnapshot = new DirectorySnapshot(codecept_root_dir('tests/_support'));\n $dirSnapshot->setSnapshotFileName($snapshot);\n\n $dirSnapshot->assert();\n }"
] | [
"0.80616426",
"0.8045508",
"0.78977615",
"0.67848736",
"0.62344193",
"0.60945064",
"0.59420586",
"0.5662753",
"0.5563774",
"0.5520011",
"0.5514364",
"0.5431951",
"0.5392575",
"0.51366675",
"0.50090533",
"0.4991651",
"0.49770024",
"0.4942485",
"0.49317673",
"0.48817515",
"0.4881271",
"0.4865458",
"0.4854298",
"0.48155507",
"0.4807783",
"0.48029596",
"0.48011473",
"0.4793872",
"0.47404322",
"0.47268152",
"0.46866518",
"0.46837178",
"0.46644634",
"0.46458623",
"0.46331087",
"0.46304226",
"0.46219003",
"0.46151346",
"0.46120846",
"0.46081188",
"0.45835152",
"0.45827097",
"0.45679846",
"0.45639387",
"0.45582125",
"0.45579812",
"0.4542686",
"0.45224422",
"0.4516925",
"0.45112908",
"0.4510583",
"0.45104057",
"0.4501546",
"0.4499867",
"0.44978228",
"0.44887432",
"0.44830635",
"0.44797793",
"0.44746476",
"0.44697186",
"0.44644392",
"0.44627547",
"0.44544524",
"0.44508576",
"0.444464",
"0.44431746",
"0.4436345",
"0.4433388",
"0.4425519",
"0.44181922",
"0.4413565",
"0.44120598",
"0.44064194",
"0.44053558",
"0.44052893",
"0.43958393",
"0.43908986",
"0.4388388",
"0.43879566",
"0.4383736",
"0.43811756",
"0.43769023",
"0.43725675",
"0.43715155",
"0.43701962",
"0.43696287",
"0.43696287",
"0.43696287",
"0.4366065",
"0.4355601",
"0.43515393",
"0.43379632",
"0.4326049",
"0.43152666",
"0.43057704",
"0.4300078",
"0.4294607",
"0.42887396",
"0.42813286",
"0.42791334"
] | 0.75197244 | 3 |
Gets the currently logged in user from the session. Returns NULL if no user is currently logged in. | public function getUser($defaultValue = null) {} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function get_user() {\n\t\treturn ($this->logged_in()) ? $this->session->get($this->config['session_key'], null) : null;\n\t}",
"public static function getCurrentUser(){\r\n\t\treturn self::isLoggedIn() == true ? User::getUserById($_SESSION[\"id\"]) : null;\r\n\t}",
"private function getLoggedInUser()\n {\n if (null !== $token = $this->securityContext->getToken()) {\n return $token->getUser();\n }\n\n return null;\n }",
"public function getCurrentUser()\n {\n $this->validateUser();\n\n if ($this->session->has(\"user\")) {\n return $this->session->get(\"user\");\n }\n }",
"public function getCurrentUser() {\n if (!property_exists($this, 'currentUser')) {\n $this->currentUser = null;\n $uid = isset($_SESSION['uid']) ? $_SESSION['uid'] : false;\n if ($uid) {\n $this->currentUser = User::find($uid);\n }\n }\n return $this->currentUser;\n }",
"public static function getUser() {\n return isset($_SESSION[Security::SESSION_USER]) ? $_SESSION[Security::SESSION_USER] : NULL;\n }",
"public function getLoggedInUser() {\n return $this->_user->getLoggedInUser();\n }",
"public function get_user()\n\t{\n\t\tif ($this->logged_in())\n\t\t{\n\t\t\treturn $this->_session->get($this->_config['session_key']);\n\t\t}\n\n\t\treturn FALSE;\n\t}",
"public static function get_user_logged_in() {\n if (isset($_SESSION['user'])) {\n $user_id = $_SESSION['user'];\n // Pyydetään User-mallilta käyttäjä session mukaisella id:llä\n $user = User::find($user_id);\n\n return $user;\n }\n\n // Käyttäjä ei ole kirjautunut sisään\n return null;\n }",
"function getLoggedInUser()\n{\n\tif(isLoggedIn()) {\n\t\treturn auth()->user();\n\t}\n\treturn null;\n}",
"static function getCurrentUser()\r\n {\r\n return self::getSingleUser('id', $_SESSION[\"user_id\"]);\r\n }",
"public static function getCurrentUser()\n\t{\n\t\tif (!session_id())\n\t\t{\n\t\t\tsession_start();\n\t\t}\n\n\t\tif (isset($_SESSION['user_name']))\n\t\t{\n\t\t\treturn self::getUser($_SESSION['user_name']);\n\t\t}\n\n\t\t$accessToken = filter_input(INPUT_COOKIE, 'access_token');\n\t\tif ($accessToken)\n\t\t{\n\t\t\t$user = self::validateToken($accessToken);\n\t\t\tif ($user)\n\t\t\t{\n\t\t\t\t$_SESSION['user_name'] = $user;\n\t\t\t\treturn self::getUser($user);\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}",
"public static function getLoggedUser()\r\n {\r\n self::session_start();\r\n if (!isset($_SESSION['user'])) return false;\r\n return $_SESSION['user'];\r\n }",
"public function getLoggedInUser() {\n\t\treturn elgg_get_logged_in_user_entity();\n\t}",
"protected function getLoggedUser()\n {\n if (isset($this->oUser) === true && $this->oUser->isLoaded() === true) {\n return $this->oUser;\n } elseif ($this->loadUserBySession() === true) {\n return $this->oUser;\n } else {\n return null;\n }\n }",
"public static function getCurrentUser()\n {\n /**\n * @var \\ZCMS\\Core\\ZSession $session\n */\n $session = Di::getDefault()->get('session');\n return $session->get('auth');\n }",
"public static function getCurrentUser()\n {\n if (isset($_SESSION['user'])) {\n return $_SESSION['user'];\n } else {\n return new User();\n }\n }",
"function getAuthenticatedUser()\n {\n if (isset($_SESSION['MFW_authenticated_user'])) {\n return $_SESSION['MFW_authenticated_user'];\n }\n\n return null;\n }",
"public function getUser() {\n if (!empty($_SESSION['user'])) {\n return $_SESSION['user'];\n } else {\n return false;\n }\n }",
"function user()\n {\n return isset($_SESSION['user']) ? \\Models\\User::find($_SESSION['user']) : null;\n }",
"public static function getLoggedUser()\n {\n $user = null;\n if(isset($_SESSION['loggedUser']))\n {\n $user = unserialize($_SESSION['loggedUser']);\n }\n return $user;\n }",
"public function getLoggedUser()\n {\n if (null === $token = $this->securityContext->getToken()) {\n return null;\n }\n\n if (!is_object($user = $token->getUser())) {\n return null;\n }\n\n return $user;\n }",
"static function currentUser() {\n $cookie = new CookieSigner(Config::app()['BASE_KEY']);\n\n if (isset($_SESSION['userId']) && $userId = $_SESSION['userId']) {\n $user = new User();\n return $user->findOne($userId);\n } else if ($userId = $cookie->get('userId')) {\n $user = new User();\n $user->findOne($userId);\n\n if ($user && $user->isAuthenticated('remember', $cookie->get('rememberToken'))) {\n self::logIn($user);\n return $user;\n }\n }\n return null;\n }",
"public function get_user()\n {\n\n $user = $this->_session->get($this->_config['session_key']);\n\n // Check for \"remembered\" login\n if (!$user) {\n $user = $this->auto_login();\n }\n // refresh user session regularly to mitigate session fixation attacks\n\n if( ! $this->refresh_session()){\n return FALSE;\n }\n\n return $user;\n }",
"public static function currentUser()\n {\n self::startSession();\n return self::isLoggedIn() ? $_SESSION['user'] :\n new User(array('role' => 'unregistered'));\n }",
"public function getUser() {\n $user = $this->getSessionUser();\n\n return $user;\n }",
"public function getCurrentUser()\n\t{\n\t\treturn $this->users->getCurrentUser();\n\t}",
"public function getLoggedUser() {\n\t\t$session = $this->getUserSession();\n\t\treturn ($this->isAdmin()) ? $session->getUser() : $session->getCustomer();\n\t}",
"public static function getLoggedIn (): ?User\n {\n /**\n * Ist ein*e User*in eingeloggt, ...\n */\n if (self::isLoggedIn()) {\n /**\n * ... so holen wir uns hier die zugehörige ID mit dem default null.\n */\n $userId = Session::get(self::LOGGED_IN_ID, null);\n\n /**\n * Wurde also eine ID ind er Session gefunden, laden wir den/die User*in aus der Datenbank und geben das\n * Ergebnis zurück.\n */\n if ($userId !== null) {\n return User::find($userId);\n }\n }\n /**\n * Andernfalls geben wir null zurück.\n */\n return null;\n }",
"public static function getUser(): ?User\n {\n // Check whether user is logged in\n if (!self::loggedIn()) {\n return null;\n }\n // If loggedIn unserialize the user object and return it\n return unserialize($_SESSION['user']);\n }",
"public function findLoggedUser()\n {\n\t\t$auth = Zend_Auth::getInstance();\n\t\t$user = null;\n\n\t\tif($auth->hasIdentity()) {\n\t\t\t$user = $auth->getIdentity();\n\t\t}\n\n return $user;\n }",
"public static function user()\n {\n if (session()->has('id')) {\n return User::find(session('id'));\n }\n\n return null;\n }",
"public static function user()\n {\n if (isset($_SESSION['LOGGED_IN_USER'])){\n return $username;\n }\n }",
"public static function get_session_user() \n {\n return @$_SESSION['_user'];\n }",
"public static function getUser()\n\t{\n\t\tif(isset($_SESSION['user_id'])){\n\t\t\t\n\t\t\treturn User::findByID($_SESSION['user_id']);\n\t\t\t\n\t\t}else{\n\t\t\n\t\t\treturn static::loginFromRememberCookie();\n\t\t\n\t\t}\n\t}",
"protected function _current_user()\n {\n $user_id = $this->session->userdata(\"user_id\");\n \n if($user_id)\n {\n $this->load->model('user_model');\n $this->current_user = $this->user_model->getOne('' , ['user.user_id' => $user_id]);\n }\n \n return $this->current_user;\n }",
"protected function getCurrentUser() {\n $userUtil = \\JumpUpUser\\Util\\ServicesUtil::getUserUtil($this->getServiceLocator());\n return $userUtil->getCurrentUser();\n }",
"public function getLoggedInUser()\n\t{\n\t\tif (!isset($this->loggedInUser)) {\n $this->loggedInUser = array();\n \n if ($this->getIsUserLoggedIn()) {\n // get the logged in user\n $this->loggedInUser = $this->getFamilyGraph()->api('me');\n }\n }\n \n return $this->loggedInUser;\n\t}",
"public static function getUser() {\n return session(\"auth_user\", null);\n }",
"public function getUser()\n {\n return Session::get(self::USER);\n }",
"function cafet_get_logged_user(): ?User\n {\n if (!isset($_SESSION['user'])) return null;\n \n $user = (object) unserialize($_SESSION['user']);\n \n if ($user instanceof User) return $user;\n else return null;\n }",
"public function GetCurrentUser()\n {\n return $this->userManager->getCurrent();\n }",
"public static function getLoggedUser(){\n self::session_start();\n if(!isset($_SESSION['usuario'])) return false;\n return $_SESSION['usuario'];\n }",
"private static function getFromSession()\n {\n if (empty($_SESSION['current_user'])) {\n // No user in session, create one.\n $entityClassName = static::ENTITIES_CLASS_NAME;\n $user = new $entityClassName(array(\n 'source' => 'cookie',\n ));\n self::setCurrent($user);\n } else {\n Logger::get()->debug('Found user in session.');\n // Regenerate session ID every SESSION_DURATION minutes.\n if (time() > ($_SESSION['timestamp'] + + self::SESSION_DURATION)) {\n Logger::get()->debug('Regenerated session ID.');\n session_regenerate_id();\n }\n }\n\n return $_SESSION['current_user'];\n }",
"protected function getUser()\n {\n $token = $this->securityContext->getToken();\n if ($token) {\n $user = $token->getUser();\n if ($user instanceof UserInterface) {\n return $user;\n }\n }\n\n return null;\n }",
"public function user()\n\t{\n\t\tif (is_null($this->user) and $this->session->has(static::$key))\n\t\t{\n\t\t\t$this->user = call_user_func(Config::get('auth.by_id'), $this->session->get(static::$key));\n\t\t}\n\n\t\treturn $this->user;\n\t}",
"public function getLoggedInUser()\n {\n $securityContext = $this->container->get('security.context');\n $consultant = $securityContext->getToken()->getUser();\n return $consultant;\n }",
"public function getUser ()\n\t{\n\t\tif ($this->check()) {\n\t\t\tif (!static::$_user) {\n\t\t\t\t$username = $this->session->get('user')['username'];\n\t\t\t\tstatic::$_user = $user = User::findFirstByUsername($username);\n\t\t\t}\n\t\t\treturn static::$_user;\n\t\t}\n\t\treturn false;\n\t}",
"public function getCurrentUser(){\n return $_SESSION['user'];\n }",
"static function getUser()\n {\n return isset($_SESSION['user']) ? UserQuery::create()->findOneById($_SESSION['user']) : false;\n }",
"public static function current()\n {\n if (Yii::app()->user->isGuest)\n return null;\n\n if (!User::$current_user)\n User::$current_user = User::model()->findByPk(Yii::app()->user->getId());\n\n return User::$current_user;\n }",
"public static function user(){\n\t\treturn self::session()->user();\n\t}",
"public static function get_user_logged_in(){\n if(isset($_SESSION['admin'])){\n $admin_id = $_SESSION['admin'];\n // Pyydetään Admin-mallilta käyttäjä session mukaisella id:llä\n $admin = Admin::find($admin_id);\n\n return $admin;\n }\n\n // Käyttäjä ei ole kirjautunut sisään\n return null;\n }",
"public function getCurrentOnlineUser()\r\n\t{\r\n\t\tif ($this->user) {\r\n\t\t\treturn $this->user; \r\n\t\t}\r\n\r\n\t\ttry {\r\n\t\t\tif (!$this->validateUserFromSession()) {\r\n\t\t\t\t$this->validateUserFromCookie();\r\n\t\t\t}\r\n\r\n\t\t} catch (\\PDOException $e) {\r\n\t\t\t$this->user = null;\r\n\t\t}\r\n\r\n\t\treturn $this->user;\r\n\t}",
"protected function getUser()\n {\n if ($this->_user === null) {\n $this->_user = Users::findByUsername($this->login);\n }\n\n return $this->_user;\n }",
"public function getUser()\n {\n if ($this->_user === false) {\n $this->_user = User::findByLogin($this->login);\n }\n\n return $this->_user;\n }",
"public function getUser()\n {\n if ($this->_user === false) {\n $this->_user = User::findByLogin($this->login);\n }\n\n return $this->_user;\n }",
"public static function getLoggedInUser() {\n if (self::$loggedInUser == false) {\n //We need the Db class to escape the username, just in case.\n $db = Db::getInstance();\n\n // The email is used as the username to log into the service.\n $login = $db->escapeString($_SERVER['PHP_AUTH_USER']);\n $password = $db->escapeString($_SERVER['PHP_AUTH_PW']);\n \n $query = \"SELECT \".Config::AUTH_FIELD_UID.\", \".Config::AUTH_FIELD_LOGIN.\" \"\n .\"FROM \".Config::DB_DB.\".\".Config::AUTH_TABLE.\" WHERE \"\n .Config::AUTH_FIELD_LOGIN.\" = '$login' \"\n .\"AND `\".Config::AUTH_FIELD_PASSWORD.\"` = SHA1('$password')\";\n\n self::$loggedInUser = self::loadBySql($query);\n }\n\n return self::$loggedInUser;\n }",
"private function getAuthenticatedUser()\r\n {\r\n $tokenStorage = $this->container->get('security.token_storage');\r\n return $tokenStorage->getToken()->getUser();\r\n }",
"private function getAuthenticatedUser()\r\n {\r\n $tokenStorage = $this->container->get('security.token_storage');\r\n return $tokenStorage->getToken()->getUser();\r\n }",
"public function user() {\n\t\tif (!Auth::check()) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn Auth::getUser();\n\t}",
"public static function getUser() \n {\n return $_SESSION['username'];\n }",
"function user()\n\t{\n\t\t$ci =& get_instance();\n\t\t$user = $ci->auth_model->get_logged_user();\n\t\tif (empty($user)) {\n\t\t\t$ci->auth_model->logout();\n\t\t} else {\n\t\t\treturn $user;\n\t\t}\n\t}",
"function user()\n\t{\n\t\t$ci =& get_instance();\n\t\t$user = $ci->auth_model->get_logged_user();\n\t\tif (empty($user)) {\n\t\t\t$ci->auth_model->logout();\n\t\t} else {\n\t\t\treturn $user;\n\t\t}\n\t}",
"public function user()\n {\n if ($this->loggedOut) {\n return;\n }\n\n // If we've already retrieved the user for the current request we can just\n // return it back immediately. We do not want to fetch the user data on\n // every call to this method because that would be tremendously slow.\n if (! is_null($this->user)) {\n return $this->user;\n }\n\n $id = $this->session->get($this->getName());\n\n // First we will try to load the user using the identifier in the session if\n // one exists. Otherwise we will check for a \"remember me\" cookie in this\n // request, and if one exists, attempt to retrieve the user using that.\n if (! is_null($id)) {\n if ($this->user = $this->provider->retrieveById($id)) {\n $this->fireAuthenticatedEvent($this->user);\n }\n }\n\n // If the user is null, but we decrypt a \"recaller\" cookie we can attempt to\n // pull the user data on that cookie which serves as a remember cookie on\n // the application. Once we have a user we can return it to the caller.\n $recaller = $this->recaller();\n\n if (is_null($this->user) && ! is_null($recaller)) {\n $this->user = $this->userFromRecaller($recaller);\n\n if ($this->user) {\n $this->replaceRememberToken($this->user, $recaller->token());\n\n $this->updateSession($this->user->getAuthIdentifier());\n\n $this->fireLoginEvent($this->user, true);\n }\n }\n\n return $this->user;\n }",
"public static function getUser() {\n\t\t\tif(isset($_SESSION['user']))\n\t\t\t\t$user = $_SESSION['user'];\n\t\t\telse\n\t\t\t\t$user = new User();\n\t\t\treturn $user;\n\t\t}",
"public static function user()\n {\n if (!isset(static::$user)) {\n $uid = static::getCurrentUserId();\n if ($uid) static::$user = static::fetchUserById($uid);\n }\n \n return static::$user;\n }",
"protected function getCurrentUser()\n {\n $user = null;\n if (!is_null($this->tokenStorage->getToken())) {\n $user = $this->tokenStorage->getToken()->getUser();\n }\n\n return $user;\n }",
"protected function getCurrentUser()\n {\n return User::query()->findOrFail(Auth::user()->id);\n }",
"public function getCurrentUser() {\n\t\treturn $this->request->getServer ()->get ( 'REMOTE_USER', 'NoUser' );\n\t}",
"public function getUser() {\n if ($this->_user === false) {\n $this->_user = CoLogin::findByUsername($this->username);\n }\n\n return $this->_user;\n }",
"public static function getAuthenticatedUser ()\n\t{\n\t\t$inst = self::getInstance();\n\t\t\n\t\tif ($inst->_authenticatedUser == null) \n\t\t{\n\t\t\t$user = $inst->_auth->getIdentity();\n\t\t\tif ($user)\n\t\t\t\t$inst->_authenticatedUser = Tg_User::getUserById($user['id']);\n\t\t\telse\n\t\t\t\t$inst->_authenticatedUser = false;\n\t\t}\n\t\t\t\n\t\treturn $inst->_authenticatedUser;\n\t}",
"public function userLoggedIn() {\n static $cache = NULL;\n\n if (!is_null($cache)) {\n return $cache;\n }\n else{\n if (isset($_SESSION[SESSNAME]['user']['user_id'])) {\n $cache = $_SESSION[SESSNAME]['user'];\n return $_SESSION[SESSNAME]['user'];\n }\n $chache = FALSE;\n return FALSE;\n }\n }",
"public function get_logged_in_user_id()\n\t\t{\n\t\t\treturn $this->session->userdata('usr_id');\n\t\t}",
"static public function GetUser() {\n if (self::GetImpersonatedUser()) {\n return self::GetImpersonatedUser();\n }\n return self::GetAuthUser();\n }",
"public function getUser() {\n\t\t return $_SESSION['userId'] ?: false;\n\t\t}",
"public function getUser()\n {\n if (!$membership = $this->getMembership()) {\n return false;\n }\n \n return $membership->getUser();\n }",
"function get_user()\n{\n if (!Session::has(\"user\")) {\n return null;\n }\n\n return Session::get(\"user\");\n}",
"public function GetLoggedInUser(): ?AuthUser \n {\n if($this->IsUserLoggedIn()) \n {\n return $this->GetUserById($this->GetLoggedInUserId());\n } \n else \n {\n throw new AuthUserNotLoggedInException(\"The user is not logged in\");\n }\n\n return null;\n }",
"public function get_user() {\r\n\t\treturn ($this->user);\r\n\t}",
"public function get_current_user()\n\t{\n\t\treturn $this->current_user;\n\t}",
"public function get_current_user(){\n $username = $this->session->userdata['logged_in']['username'];\n return $user_id = $this->research_model->current_user($username);\n }",
"public function getUser() {\n\n if (isset($this->user)) {\n return $this->user;\n }\n\n return NULL;\n }",
"public function getUser() {\n // Check if user is logged in\n if ($this->isLoggedIn()) {\n // Get user id from session\n $userId = $_SESSION['user_id'];\n // Query database for user details\n $stmt = $this->_pdo->prepare(\"SELECT * FROM \".$this->_dbTable.\" WHERE \".$this->_dbFields[\"id\"].\" = :user_id\");\n $stmt->execute([\":user_id\" => $userId]);\n $user = $stmt->fetch(\\PDO::FETCH_ASSOC);\n // Return user details as associative array\n return $user;\n } else {\n // User is not logged in so return null\n return null;\n }\n }",
"public static function getCurrentUser();",
"public function getUser() {\n\t\treturn $this->Session->read('UserAuth');\n\t}",
"public static function getCurrentUser(): ?User\n {\n return self::$currentUser;\n }",
"public function getLoggedIn()\n\t{\n\t\treturn auth()->user();\n\t}",
"public function get_user() {\n\t\treturn $this->user;\n\t}",
"public function getUser()\n {\n if ($this->_user === false) {\n $this->_user = User::findByUsername($this->username);\n }\n\n return $this->_user;\n }",
"public function getUser()\n {\n if ($this->_user === false) {\n $this->_user = User::findByUsername($this->username);\n }\n\n return $this->_user;\n }",
"public function getCurrentUser() {\n\t\treturn Zend_Registry::get('currentUser');\n\t}",
"protected function getUser()\n {\n if ($this->_user === null) {\n $this->_user = User::findIdentity(Yii::$app->user->id);\n }\n\n return $this->_user;\n }",
"public function getUser()\n {\n if ($this->user === null) {\n // if we have not already determined this and cached the result.\n $this->user = $this->getUserFromAvailableData();\n }\n\n return $this->user;\n }",
"public function getUser()\n {\n if(!$this->user)\n $this->user = User::getActive();\n\n return $this->user;\n }",
"public function user()\n {\n if (!Zend_Auth::getInstance()->hasIdentity()) {\n return FALSE;\n }\n //If user is logged in\n return Zend_Auth::getInstance()->getIdentity();\n }",
"public function getUser() {\n if ($this->_user === false) {\n $this->_user = User::findByUsername($this->username);\n }\n\n return $this->_user;\n }",
"public function user()\n {\n if ($this->loggedOut) {\n return;\n }\n\n // If we've already retrieved the user for the current request we can just\n // return it back immediately. We do not want to fetch the user data on\n // every call to this method because that would be tremendously slow.\n if (! is_null($this->user)) {\n return $this->user;\n }\n\n if (\\session()->has($this->user_provider->getAuthIdentifierName()))\n {\n $user = \\session()->get($this->user_provider->getAuthIdentifierName());\n return $user;\n }\n\n $authenticated_user = $this->user_provider->retrieveById($this->user_provider->getAuthIdentifier());\n if (!isset($authenticated_user))\n {\n return;\n }\n $this->user_provider->setUserAttribute($authenticated_user);\n $this->setUser($this->user_provider);\n\n return $this->user;\n }",
"public function user()\n {\n if ( ! Auth::check()) {\n return null;\n }\n\n return Auth::getUser();\n }",
"public function getUser()\n {\n $identity = $this->session->get('auth-identity');\n if (isset($identity['id'])) {\n $user = Users::findFirstById($identity['id']);\n if ($user == false) {\n // throw new Exception('The user does not exist');\n }\n\n return $user;\n }\n\n return false;\n }",
"protected function getUser()\n {\n if ($this->_user === null) {\n $this->_user = User::findByUsername($this->username);\n }\n return $this->_user;\n }"
] | [
"0.8823619",
"0.8731397",
"0.85799825",
"0.8490602",
"0.8371665",
"0.83603567",
"0.8259398",
"0.8252049",
"0.81958693",
"0.8179946",
"0.817968",
"0.8142423",
"0.8120466",
"0.80750036",
"0.80644524",
"0.8025058",
"0.80103135",
"0.7972789",
"0.79711807",
"0.796179",
"0.79378694",
"0.7931343",
"0.79242796",
"0.790071",
"0.7875888",
"0.78633726",
"0.78541046",
"0.78428584",
"0.7840697",
"0.78216684",
"0.7816718",
"0.78094757",
"0.7804549",
"0.7802864",
"0.7800503",
"0.7797972",
"0.7787924",
"0.77766067",
"0.7771923",
"0.77482104",
"0.77442324",
"0.77401114",
"0.77177197",
"0.77073365",
"0.76939166",
"0.7684877",
"0.767168",
"0.7658038",
"0.7629142",
"0.76215386",
"0.7590637",
"0.7587988",
"0.75681126",
"0.75498545",
"0.7543141",
"0.7536864",
"0.7536864",
"0.75320446",
"0.75260305",
"0.75260305",
"0.75252223",
"0.75195175",
"0.7513643",
"0.7513643",
"0.7503324",
"0.7500731",
"0.74982995",
"0.74901664",
"0.74800414",
"0.7479326",
"0.7478741",
"0.7449504",
"0.74397355",
"0.74325395",
"0.74294114",
"0.74278927",
"0.7426961",
"0.7426536",
"0.7413091",
"0.73807555",
"0.73502415",
"0.7337094",
"0.73278016",
"0.7326836",
"0.73146814",
"0.7309227",
"0.7309063",
"0.7306831",
"0.73036534",
"0.7299491",
"0.7299491",
"0.7297476",
"0.72973067",
"0.72969097",
"0.7291359",
"0.72872126",
"0.72766125",
"0.7275826",
"0.72711533",
"0.7267148",
"0.72634035"
] | 0.0 | -1 |
Check if user has the role. | public function hasRole($user, string $role = 'login'): bool {} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function hasRole(): bool\n {\n return isset($this->role);\n }",
"public function hasRole(string $role): bool;",
"function hasRole($role)\n{\n\treturn $this->loggedUser? $this->loggedUser->hasRole($role) : false;\n}",
"public function hasRole() {\n return $this->_has(2);\n }",
"function hasRole($role, $userId = null);",
"function tsg_user_has_role( $role = '', $user = null )\n{\n $user = $user ? new WP_User( $user ) : wp_get_current_user();\n\n if ( empty( $user->roles ) )\n return;\n\n if ( in_array( $role, $user->roles ) )\n return true;\n\n return;\n}",
"public function roleExists(string $role): bool;",
"public function hasRole($role){\n return null !== $this->role()->where('name', $role)->first();\n }",
"public function roleInUse(string $role): bool;",
"public function hasRole($role){\n if($this->roles()->where('name', $role)->first()){\n return true;\n }\n return false;\n }",
"function is_user_in_role( $user_id, $role ) {\r\n $user = new WP_User( $user_id );\r\n\treturn ( ! empty( $user->roles ) && is_array( $user->roles ) && in_array( $role, $user->roles ) );\r\n}",
"public function hasRole(): bool\n {\n return $this->has(AttributeType::OID_ROLE);\n }",
"function role_exists($role)\n{\n\n if (!empty($role))\n {\n return $GLOBALS['wp_roles']->is_role($role);\n }\n\n return false;\n}",
"function pilau_user_has_role( $user, $role ) {\n\t\treturn in_array( $role, pilau_get_user_role( $user, false, true ) );\n\t}",
"public function isHasRole($userId, $role) {\n\t}",
"public function HasRole($role)\n {\n if ($this->isConnected()) {\n $reflector = new Reflector($this->user);\n if (!method_exists($this->user,'getRoles')) {\n throw new MazeoException(\"Class {$reflector->getName()} must have an \\\"getRoles\\\" method for perform role access check\");\n }\n return in_array($role, $this->user->getRoles()) ? true : false;\n } else return false;\n }",
"function checkRole($role) {\n\n return in_array($role, $this->listRoleCurUser);\n }",
"public function hasRole($role)\n {\n return $this->isGranted($role); \n }",
"public function hasRole($name);",
"function has_role($user, $role_name) {\n\n\tswitch ($role_name) {\n\t\tcase 'editor' :\n\t\t\tif (is_callable('hj_approve_is_editor')) {\n\t\t\t\treturn call_user_func('hj_approve_is_editor', $user);\n\t\t\t}\n\t\t\tbreak;\n\n\t\tcase 'supervisor' :\n\t\t\tif (is_callable('hj_approve_is_supervisor')) {\n\t\t\t\treturn call_user_func('hj_approve_is_supervisor', $user);\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 'observer' :\n\t\t\tif (is_callable('hj_observer_is_observer')) {\n\t\t\t\treturn call_user_func('hj_observer_is_observer', $user);\n\t\t\t}\n\t\t\tbreak;\n\t}\n\n\tif (is_callable('roles_has_role')) {\n\t\treturn call_user_func('roles_has_role', $user, $role_name);\n\t}\n\n\treturn false;\n}",
"function hasRole($user, $role){\n\n if(ucfirst($user->role) == 'Root'){\n return true;\n }\n else {\n if($user->role == ucwords($role)){\n return true;\n }\n else {\n return false;\n }\n }\n }",
"private function role_exists( $role ) {\n global $wp_roles;\n\n return $wp_roles->is_role( $role );\n }",
"public function hasRoleAccess()\n {\n $roles = $this->map[$this->uri]['roles'];\n\n if ($roles === self::ROLE_PUBLIC) {\n\n return true;\n }\n\n $this->isArray($roles);\n\n $this->collectMissingRoles($roles);\n\n return count(array_intersect($this->currentUserRoles, $roles)) > 0;\n }",
"private function isUser($role = 'user') : bool\n {\n return $this->user->hasRole('user');\n }",
"function check_role( $role_in ) {\n global $_SESSION;\n\n // read the permissions database\n $d = loadDB();\n\n // check if the current user\n $user_name = $_SESSION[\"logged\"];\n // has a specified role\n $roles = array(); // collect all roles for this user\n foreach ( $d[\"users\"] as $key => $value ) {\n if ($value[\"name\"] == $user_name) {\n $roles = array_merge($roles, $value[\"roles\"]);\n }\n }\n \n foreach ( $roles as $role ) {\n if ($role == $role_in) {\n audit( \"check_role\", $role_in.\" as \".$user_name);\n return true;\n }\n }\n audit( \"check_role failed\", $role_in.\" as \".$user_name);\n return false;\n }",
"public function hasRole($role)\n {\n $user = $this->view->user();\n if ($user && in_array($role, $user->roles)) {\n return TRUE;\n }\n return FALSE;\n }",
"public function HasRole ($roleName = NULL, $idRole = NULL);",
"public function checkRoleAndRedirect()\n {\n $roles = Auth::user()->getRoles();\n if (in_array('admin', $roles->toArray()) || in_array('shop-manager', $roles->toArray())) {\n return true;\n }\n return false;\n }",
"public function userHasRole($role_name){\n foreach($this->roles as $role){\n if(Str::lower($role_name) == Str::lower($role->name))\n return true;\n }\n\n return false;\n }",
"function user_role_need ($role) {\r\n\t$info = user_info();\r\n\treturn ($info[3] == $role ? true : false);\r\n}",
"public function hasRole($role)\n {\n return null !== $this->roles()->where('name', $role)->first();\n }",
"function is($role_name){\n $this->CI->load->model('role');\n $role = $this->CI->role->getRoleOnUserByName($this->username(), $role_name);\n if(!empty($role)) return $role;\n else return false;\n }",
"public function hasRole($role)\n {\n return $this->role == $role;\n }",
"function check_user_role($roles, $user_id = null) {\n\tif ($user_id) $user = get_userdata($user_id);\n\telse $user = wp_get_current_user();\n\tif (empty($user)) return false;\n\tforeach ($user->roles as $role) {\n\t\tif (in_array($role, $roles)) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}",
"public function hasRole($role)\n {\n return in_array($role, $this->getRoles());\n }",
"public function isRole(){\n $r=Cache::get('role');\n if ((int)$r ==2)\n {\n return true;\n }\n else\n return false;\n }",
"abstract public function hasRole($roleName);",
"public function hasRole($role)\n {\n return $this->session->hasRole($role);\n }",
"public function is_role($role)\n {\n }",
"public function isSetRole()\n {\n return count ($this->_fields['Role']['FieldValue']) > 0;\n }",
"function user_is_role($role, $user_id = null) {\n\tif ($user_id == null)\n\t\t// defaults to the current user\n\t\t$user_id = $_SESSION['user_id'];\n\n\treturn get_user_role_weight($user_id) === get_role_weight($role);\n}",
"function user_is_role($role, $user_id = null) {\n\tif ($user_id == null)\n\t\t// defaults to the current user\n\t\t$user_id = $_SESSION['user_id'];\n\n\treturn get_user_role_weight($user_id) === get_role_weight($role);\n}",
"function checkRole($role)\n{\n return (Auth::check())?Auth::user()->checkRole($role):false;\n}",
"public function hasRole($role) {\n return in_array((string)$role, $this->roles);\n }",
"function userHasRole($id_utente, $id_ruolo) {\n if ($this->connectToMySql()) {\n $query = sprintf(\"SELECT id_ruoli_granted, id_utente, id_ruolo, ruolo FROM scuola.ruoli_granted_to_utenti\n WHERE id_utente= '%s' and id_ruolo = '%s'\", mysql_real_escape_string($id_utente, $GLOBALS['link']), mysql_real_escape_string($id_ruolo, $GLOBALS['link']));\n\n // Perform Query\n $result = mysql_query($query);\n //$array = mysql_fetch_assoc($result);\n }\n $this->closeConnection();\n return mysql_num_rows($result) == 1;\n }",
"public function hasRole(string $role, FilterInterface $filter = null):bool;",
"function frame_user_role($role, $user_id = null)\n{\n if (is_numeric($user_id))\n $user = get_userdata($user_id);\n else\n $user = wp_get_current_user();\n\n if (empty($user))\n return false;\n\n $intersection = array_intersect((array) $role, (array) $user->roles);\n\n return !empty($intersection) ? true : false;\n}",
"public function checkLogin(): bool{\n\t\treturn isset($_SESSION['user']['role']);\n\t}",
"public function isRole(): bool\n {\n return $this->getType() === static::TYPE_ROLE;\n }",
"public function hasRoles()\n {\n return ! empty($this->roles);\n }",
"public function has_role($id){\n $encontrado=false;\n foreach ($this->roles as $role){\n if($role->id==$id || $role->slug==$id){\n $encontrado=true;\n }\n\n }\n return $encontrado;\n }",
"public function has_role($params) {\n global $DB;\n\n if($params['role'] == 'teacher') {\n $roles = $this->get_teacher_roles();\n } elseif($params['role'] == 'student') {\n $roles = $this->get_student_roles();\n }\n\n $rolefilter = new in_filter($roles, \"role\");\n\n return $DB->record_exists_sql(\n \"SELECT ra.*\n FROM {role_assignments} ra\n WHERE ra.userid = :userid AND\n ra.roleid \". $rolefilter->get_sql(),\n array_merge(['userid' => $params['userid']], $rolefilter->get_params())\n );\n\n }",
"public function hasRole($role)\n {\n return $this->cached_roles->where('slug', $role)->count() > 0;\n }",
"public function userIs( $role ) {\n\n\t\treturn $this->loggedIn( )\n\t\t\t? in_array( $this->user( $this->roleField ), ( array )$role )\n\t\t\t: false;\n\t}",
"public function has_role($role)\n\t{\n\t\t// Check what sort of argument we have been passed\n\t\tif ($role instanceof Sprig)\n\t\t{\n\t\t\t$key = 'id';\n\t\t\t$val = $role->id;\n\t\t}\n\t\telseif (is_string($role))\n\t\t{\n\t\t\t$key = 'name';\n\t\t\t$val = $role;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$key = 'id';\n\t\t\t$val = (int) $role;\n\t\t}\n\n\t\t$values = $this->refresh('roles')->as_array(NULL,$key);\n\t\treturn (in_array($val, $values));\n\t}",
"function userRoleCheck($user_data) {\n if(!empty($user_data['email'])){\n $user_email = $user_data['email'];\n $userTable = TableRegistry::get('Users');\n $query = $userTable->find('all')->where(['email' => $user_email]);\n if(!empty($query->first()->role_id) and ($query->first()->role_id == 2 or $query->first()->role_id == 1) ){ // Doctor = 2 and Admin = 1\n return true;\n } else {\n return false;\n }\n } else {\n return false;\n }\n }",
"public function is($role);",
"function checkSingleRole($roleToCheck) {\n //Ensure user is logged in\n if(Auth::guest()) {\n return false;\n }\n $roleToCheck = strtolower($roleToCheck);\n //Ensure that the user is an admin or an owner\n $roles = Auth::user()->roles;\n //Loop through roles and check for permission\n foreach($roles as $role) {\n if($role->name == $roleToCheck) {\n return true;\n }\n }\n //User is not an admin\n return false;\n}",
"function auth_role($role)\n {\n if (auth_isAnonymous()) {\n return false;\n }\n\n $auth = auth_prerequisite();\n $field = $auth['fields']['role'];\n $session = auth_get();\n\n return $session->$field == $role;\n }",
"public function hasRole($check) {\n return in_array($check, array_fetch($this->roles->toArray(), 'role'));\n }",
"public function isGranted($role)\n {\n return in_array($role, $this->getRoles());\n }",
"public function checkRole(Role $role){\n $grant = false;\n foreach ($this->getRoles() as $userRole){\n if($userRole == $role){\n $grant = true;\n }\n }\n if(!$grant){ \n $_SESSION['login_message'] = 'You do not have required permissions to acces the page';\n header('Location: index.php');\n exit();\n }\n }",
"public function hasRole($name, $requireAll = false);",
"public function hasRole($role)\n {\n return $this->hakAksesPengguna()\n ->where('nama', strtolower($role))\n ->where('status_request', RequestStatus::APPROVED)->count() > 0;\n }",
"public function logged_in($role = null)\n {\n // Get the user from the session\n $user = $this->get_user();\n if (!$user) {\n return false;\n }\n\n // If user exists in session\n if ($user) {\n\n // check session in database\n $sdb = UserSessions::findFirstBySessionId($this->_session->getId());\n if($sdb){\n $thisAgent = \\Phalcon\\DI::getDefault()->getShared('request')->getUserAgent();\n if($sdb->user_agent != $thisAgent || $sdb->user_id != $user->id){\n // user agent or user IDs do not match\n return FALSE;\n }\n }else{\n // Session not found in DB\n return FALSE;\n }\n\n // refresh the user session if needs be\n if( ! $this->refresh_session()){\n return FALSE;\n }\n\n // If we don't have a roll no further checking is needed\n if (!$role) {\n return true;\n }\n\n // Check if user has the role\n if ($this->_config['session_roles'] && $this->_session->has($this->_config['session_roles'])) {\n // Check in session\n $roles = $this->_session->get($this->_config['session_roles']);\n $role = isset($roles[$role]) ? $roles[$role] : null;\n } else {\n // Check in db\n $role = $user->hasRole($role);\n }\n\n\n\n // Return true if user has role\n return $role ? true : false;\n }\n }",
"public function has_role($role_name)\n {\n $role = role_active_record::search()\n ->where('name', $role_name)\n ->execOne();\n $user_role = user_role_active_record::search()\n ->where('uid', $this->uid)\n ->where('rid', $role->rid)\n ->execOne();\n if ($user_role instanceof user_role_active_record) {\n return true;\n } else {\n return false;\n }\n }",
"public function hasRole(string $role): bool\n {\n return getApp()->security()->hasRole($role);\n }",
"private function isUser() : bool\n {\n return $this->role('user');\n }",
"public function has_role($role)\n\t{\n\t\t// Don't mess with these calls, they are too complex\n\t\tif (is_object($role))\n\t\t\treturn parent::has_role($role);\n\n\t\t// Make sure the role name is a string\n\t\t$role = (string) $role;\n\n\t\tif (ctype_digit($role))\n\t\t{\n\t\t\t// Find by id\n\t\t\treturn isset($this->roles[$role]);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Find by name\n\t\t\treturn in_array($role, $this->roles);\n\t\t}\n\t}",
"protected function hasRole($role)\n {\n $right = session()->get(\"role\");\n $result = in_array($right, (array)$role);\n return $result;\n }",
"public function hasRole($role)\n {\n return in_array(strtoupper($role), $this->getRoles(), true);\n }",
"public function hasRole($role)\n {\n return in_array(strtoupper($role), $this->getRoles(), true);\n }",
"public function hasRole($role)\n {\n return in_array(strtoupper($role), $this->getRoles(), true);\n }",
"function checkRole($RoleName){\n\t\tif( in_array($RoleName,$this->user_roles) == true ){\n\t\t\treturn 1;\n\t\t}else{\n\t\t\treturn 0;\n\t\t}\n\t}",
"public function hasRole($roles) {\n return RoleHelper::userHasRole($this, $roles);\n }",
"function hasRole($Role, $UserID = null)\n\t{\n $databaseManager = Rbac::getInstance()->getDatabaseManager();\n $tablePrefix = $databaseManager->getTablePrefix();\n \n\t if ($UserID === null)\n {\n throw new RbacUserNotProvidedException('$UserID is a required argument.');\n }\n $RoleID = Rbac::getInstance()\n ->getRbacManager()\n ->getRoleManager()\n ->getId($Role)\n ;\n\n return(\n $databaseManager->request(\n \"SELECT * FROM {$tablePrefix}userroles AS TUR\n JOIN {$tablePrefix}roles AS TRdirect ON (TRdirect.ID=TUR.RoleID)\n JOIN {$tablePrefix}roles AS TR ON (TR.Lft BETWEEN TRdirect.Lft AND TRdirect.Rght)\n WHERE TUR.UserID=? AND TR.ID=?\"\n , [$UserID, $RoleID])\n !== null);\n\t}",
"public function hasRole(Role $role)\n {\n return $this->role == $role;\n }",
"function isAdmin(){\n $user = $this->loadUser(Yii::app()->user->id);\n return intval($user->role) == 1;\n }",
"function isAdmin(){\n $user = $this->loadUser(Yii::app()->user->id);\n return intval($user->role) == 1;\n }",
"public function authorize()\n {\n $user = User::findOrFail($this->route('id'));\n\n return $user->hasRole('admin') || $user->hasRole('teacher');\n }",
"public function authorize()\n {\n $user = Auth::user();\n\n if(!$user->can('update-role')) {\n return false;\n }\n\n return true;\n }",
"function auth_roles()\n {\n if (auth_isAnonymous()) {\n return false;\n }\n\n $auth = auth_prerequisite();\n $field = $auth['fields']['role'];\n $session = auth_get();\n $roles = func_get_args();\n\n return in_array($session->$field, $roles);\n }",
"public function authorize() {\n\t\treturn $this->user()->hasPermission('edit.roles');\n\t}",
"private function wf_user_permission(){\n\t\t$current_user = wp_get_current_user();\n\t\t$user_ok = false;\n\t\tif ($current_user instanceof WP_User) {\n\t\t\tif (in_array('administrator', $current_user->roles) || in_array('shop_manager', $current_user->roles)) {\n\t\t\t\t$user_ok = true;\n\t\t\t}\n\t\t}\n\t\treturn $user_ok;\n\t}",
"public function isUserAssignable()\r\n {\r\n return strpos($this->assignRole,'ROLE_USER') !== false ? true : false;\r\n }",
"public function hasRole($check)\n {\n\t\n return in_array($check, array_fetch($this->roles->toArray(), 'name'));\n\t\t\n }",
"public function logged_in($role = NULL)\n\t{\n\t\t// Get the user from the session\n\t\tif ($this->_use_session) {\n\t\t\t$user = $this->get_user();\n\t\t\t\n\t\t// If we're not using the session check for an auto_login cookie.\n\t\t} else {\n\t\t\t$user = $this->auto_login();\n\t\t}\n\n\t\tif ( ! $user) {\n\t\t\treturn FALSE;\n\t\t}\n\n\t\tif ($user instanceof Model_User)\n\t\t{\n\t\t\t// If we don't have a roll no further checking is needed\n\t\t\tif ( ! $role) {\n\t\t\t\treturn TRUE;\n\t\t\t}\n\t\t\t\n\t\t\tif (is_array($role))\n\t\t\t{\n\t\t\t\t// Get all the roles\n\t\t\t\t$roles = Doctrine_Query::create()\n\t\t\t\t\t->from('Model_Role r')\n\t\t\t\t\t->where('r.name IN ?', array($role))\n\t\t\t\t\t->execute();\n\t\t\t\t\n\t\t\t\t// Make sure all the roles are valid ones\n\t\t\t\tif (count($roles) !== count($role))\n\t\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif ( ! is_object($role))\n\t\t\t\t{\n\t\t\t\t\t// Load the role\n\t\t\t\t\t$roles = Doctrine::getTable('Model_Role')\n\t\t\t\t\t\t->findByName($role);\n\t\t\t\t\t\n\t\t\t\t\tif ( ! $roles OR count($roles) === 0)\n\t\t\t\t\t\treturn FALSE;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\treturn $user->has_role($roles);\n\t\t}\n\t\treturn FALSE;\n\t}",
"function isAdmin() {\n $user = $this->loadUser(Yii::app()->user->id);\n return intval($user->role) == 1;\n }",
"public function testCheckingRoles()\n {\n $this->assertTrue($this->principal->hasRole('baz'));\n $this->assertFalse($this->principal->hasRole('doesNotExist'));\n }",
"public function checkRole($roletoCheck)\n {\n $IsUserRole = 0;\n $role = Role::where('name', $roletoCheck)->get();\n if (!empty($role) && count($role) != 0) {\n $role_id = $role[0]->id;\n $user = auth()->user();\n $checkRoles = User::find($user->id)->UserHasRoles()->where('role_id', $role_id)->get();\n $IsUserRole = count($checkRoles) == 0 ? 0 : 1;//if helpline show only helpline . Elsewhere show all!\n }\n return $IsUserRole;\n }",
"function UserCheck( $user, $rolecodes )\n {\n // Return True.\n\n if(isset($user))\n {\n if($rolecodes == \"\")\n {\n // No permissions required for this page, just be logged in.\n return true;\n }\n\n if(isset($user->roles))\n {\n if(is_array($rolecodes))\n {\n $allowedroles = $rolecodes;\n }\n else\n {\n $allowedroles = explode(\",\",$rolecodes);\n }\n\n foreach($user->roles as $thisrole)\n {\n foreach($allowedroles as $thisallowedrole)\n {\n if($thisrole->rolecode == $thisallowedrole)\n {\n return true;\n }\n }\n }\n }\n }\n\n // If not, Return False.\n return false;\n }",
"function checkUserRole($userId, $roleToCheck) {\n //Ensure user is logged in\n\n $user = User::find($userId);\n if (is_null($user)) {\n return false; //User dose not exist\n }\n $roleToCheck = strtolower($roleToCheck);\n //Ensure that the user is an admin or an owner\n $roles = $user->roles;\n //Loop through roles and check for permission\n foreach($roles as $role) {\n if($role->name == $roleToCheck) {\n return true;\n }\n }\n //User is not an admin\n return false;\n}",
"public function hasRole($user, $role_id)\n {\n // TODO: Please find better method than roles->contains, try to use Query Builder\n return $user->roles->contains('id', $role_id);\n }",
"public function isGranted($role) {\n $granted = false;\n $user = $this->getUser();\n\n if ($user) {\n $granted = in_array($role, $user->getRoles());\n }\n\n return $granted;\n }",
"private function isOnlyRole($role = 'user') : bool\n {\n return $this->maxRole() === $role;\n }",
"public function hasUser();",
"public function hasRole($roles)\n {\n return $this->roles ? in_array($roles, $this->roles->pluck('id')->toArray()) : false;\n }",
"public function isMember()\n {\n return $this->role == 3;\n }",
"public function roleExists($role)\n {\n return $this->repository->roleExists($role);\n }",
"public function hasPermissions()\n {\n return $this->roles()->count() > 1;\n }"
] | [
"0.8131786",
"0.8126035",
"0.8042169",
"0.7961833",
"0.781458",
"0.7724637",
"0.7707938",
"0.7685536",
"0.7666403",
"0.76437527",
"0.7627791",
"0.76234025",
"0.7584693",
"0.75823665",
"0.7554309",
"0.7552024",
"0.7534581",
"0.7522165",
"0.7515716",
"0.75036603",
"0.7480907",
"0.74649465",
"0.74241436",
"0.7423885",
"0.7422949",
"0.7366813",
"0.73628324",
"0.7349388",
"0.73475444",
"0.7333104",
"0.73084575",
"0.72894543",
"0.7258627",
"0.72410065",
"0.7230484",
"0.72300005",
"0.7213757",
"0.7211972",
"0.71970546",
"0.7186941",
"0.718537",
"0.718537",
"0.71721846",
"0.7168809",
"0.7131758",
"0.71278155",
"0.7108346",
"0.7107358",
"0.71063036",
"0.7101224",
"0.7099466",
"0.7078958",
"0.7059132",
"0.7057256",
"0.7047292",
"0.70320034",
"0.70146185",
"0.7014539",
"0.7012518",
"0.7011443",
"0.69995403",
"0.6998565",
"0.6985273",
"0.69772404",
"0.69692576",
"0.696604",
"0.6957852",
"0.6957364",
"0.6956737",
"0.6948149",
"0.69316053",
"0.69316053",
"0.69316053",
"0.6923813",
"0.69228125",
"0.6919351",
"0.69121027",
"0.689935",
"0.689935",
"0.689792",
"0.68919116",
"0.6888442",
"0.6879828",
"0.68792784",
"0.6865395",
"0.68563116",
"0.6852247",
"0.6851569",
"0.68405527",
"0.6836631",
"0.68340653",
"0.6817218",
"0.6805582",
"0.680352",
"0.6803479",
"0.68024665",
"0.68017304",
"0.67938566",
"0.6786885",
"0.6786706"
] | 0.80954504 | 2 |
Logs a user in. | public function login($username, string $password, bool $remember = false, bool $force = false): ?bool {} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function loginUser() {\n self::$isLoggedIn = true;\n $this->session->setLoginSession(self::$storedUserId, self::$isLoggedIn);\n $this->session->setFlashMessage(1);\n }",
"private function _logUserIn($inputs)\n\t{\n\t\tCraft::log('Logging in user.');\n\n\t\tif (craft()->userSession->login($inputs['username'], $inputs['password']))\n\t\t{\n\t\t\tCraft::log('User logged in successfully.');\n\t\t}\n\t\telse\n\t\t{\n\t\t\tCraft::log('Could not log the user in.', LogLevel::Warning);\n\t\t}\n\t}",
"public function login() {\r\n\r\n // signal any observers that the user has logged in\r\n $this->setState(\"login\");\r\n }",
"public function signInAction()\n {\n $userData = $this->manager->findOneBy(['username' => $this->httpParameters['login']]);\n\n //If no user were found, redirects\n if(empty($userData))\n {\n $this->response->redirect('/auth',HttpResponse::WRONG_LOGIN);\n }\n\n //Instantiates the user\n $user = new User($userData);\n\n //Checks if typed password matches user's password\n if($this->passwordMatch($this->httpParameters['loginPassword'],$user,'/auth'))\n {\n //Sets the user instance as a the new $_SESSION['user']\n $_SESSION['user'] = $user;\n\n $this->response->redirect('/admin');\n }\n }",
"public function log_login()\n {\n if (!$this->config->get('log_logins')) {\n return;\n }\n\n $user_name = $this->get_user_name();\n $user_id = $this->get_user_id();\n\n if (!$user_id) {\n return;\n }\n\n self::write_log('userlogins',\n sprintf('Successful login for %s (ID: %d) from %s in session %s',\n $user_name, $user_id, self::remote_ip(), session_id()));\n }",
"static function logIn($user) {\n if (isset($user)) {\n session_start();\n $_SESSION['userId'] = $user->id;\n }\n }",
"public function do_login()\n {\n $this->userObject = new User();\n\n // grab the uID of the person signing in\n $uid = $this->userObject->checkUser($_POST['user_email'], $_POST['user_password']);\n\n // if the uID exists\n if ($uid) {\n\n $this->set('message', 'You logged in!');\n\n // grab the array of user-data from the database\n $user = $this->userObject->getUser($uid);\n\n // leave out the password\n unset($user['password']);\n unset($user[4]);\n\n // if (strlen($_SESSION['redirect']i) > 0) { // basically, if someone types in the url with the funciton after,\n // // supposed to redirect people to the pages they want.\n // $view = $_SESSION['redirect'];\n // unset($_SESSION['redirect']);\n // header('Location: ' . BASE_URL . $view);\n\n // make the SESSION key 'user' and set it equal to the aray of user-data\n $_SESSION['user'] = $user;\n\n header('Location: /index.php/');\n\n } else {\n\n $this->set('error', 'Sorry! Looks like something might be messed up with your Username or Password! :p');\n }\n }",
"protected function login( )\r\n {\r\n $this->sendData( 'USER', $this->_nick, $this->_nick . ' ' . $this->_user . ' : ' . $this->_realName );\r\n \r\n $this->sendData( 'NICK', $this->_nick );\r\n \r\n $this->_loggedOn = true;\r\n }",
"public static function LoggedIn() {\n\t\tif (empty($_SESSION['current_user'])) {\n\t\t\tnotfound();\n\t\t}\n\t}",
"private function login() {\n //Look for this username in the database\n $params = array($this->auth_username);\n $sql = \"SELECT id, password, salt \n FROM user \n WHERE username = ? \n AND deleted = 0\";\n //If there is a User with this name\n if ($row = $this->db->fetch_array($sql, $params)) {\n //And if password matches\n if (password_verify($this->auth_password.$row[0] ['salt'], $row[0] ['password'])) {\n $params = array(\n session_id(), //Session ID\n $row[0] ['id'], //User ID\n self::ISLOGGEDIN, //Login Status\n time() //Timestamp for last action\n );\n $sql = \"INSERT INTO user_session (session_id, user_id, logged_in, last_action) \n VALUES (?,?,?,?)\";\n $this->db->query($sql, $params);\n header('Location: ' . $_SERVER['HTTP_REFERER']);\n //User now officially logged in\n }\n //If password doesn't match\n else {\n //Send user back to login with error\n $this->login_form(self::ERR_NOUSERFOUND);\n }\n }\n //If there isn't a User with this name\n else {\n //Send user back to login with error\n $this->login_form(self::ERR_NOUSERFOUND);\n }\n }",
"protected function log_user_in($user)\n\t{\n\t\t$_SESSION['email'] = $user->email;\n\t\t$_SESSION['user_id'] = $user->id;\n\t\t$_SESSION['role_id'] = $user->role_id;\n\t\t\n\t\tunset($_SESSION['token']);\n\t}",
"public static function LogIn ($userName = '', $password = '');",
"public function login($user){\n if($user){\n $this->user_id = $_SESSION['userId'] = $user->userId;\n $this->logged_in = TRUE;\n }\n \n }",
"public function login($user){\n if($user){\n $this->user_id = $_SESSION['user_id'] = $user->id;\n $this->logged_in = true;\n }\n }",
"public function login (){\n\t\t$user = $this->get_by(array(\n\t\t\t'email' => $this->input->post('email'),\n\t\t\t'password' => $this->hash($this->input->post('password')),\n\t\t\t), TRUE);\n\t\t\n\t\tif (count($user)) {\n\t\t\t// Log in user\n\t\t\t$data = array(\n\t\t\t\t'username' => $user->username,\n\t\t\t\t'email' => $user->email,\n\t\t\t\t'id' => $user->id,\n\t\t\t\t'loggedin' => TRUE,\n\t\t\t);\n\t\t\t$this->session->set_userdata($data);\n\t\t}\n\t\t}",
"public function it_logs_in_the_user()\n {\n $user = factory(User::class)->create([\n 'password' => '123123',\n ]);\n\n $this->browse(function ($browser) use ($user) {\n $browser->visit(new Login)\n ->type('@email', $user->email)\n ->type('@password', '123123')\n ->click('@submit')\n ->assertPathIs('/app');\n });\n }",
"public function login($user){\r\n\t\t\t// database should find user based on username/password\r\n\t\t\tif($user){\r\n\t\t\t\t$this->user_id = $_SESSION['user_id'] = $user->id;\r\n\t\t\t\t$this->logged_in = true ;\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}",
"public function loginUser()\n {\n $request = new Request();\n\n $email = $request->input('email');\n $password = $request->input('password');\n\n // Check email\n if (!$email) {\n $this->showLoginForm(['Please enter email']);\n }\n // Check password\n if (!$password) {\n $this->showLoginForm(['Please enter password']);\n }\n\n // Check user exist and then password\n $user = $this->getUser($email);\n $password = md5($password);\n if (!$user || $password !== $user['password']) {\n $this->showLoginForm(['Error on login']);\n }\n\n // Save login details to cookies\n if (!defined('APP_USERS_COOKIES_EMAIL')\n || !defined('APP_USERS_COOKIES_PASSWORD')) {\n $this->showLoginForm(['Error on login']);\n }\n setcookie(APP_USERS_COOKIES_EMAIL, $email);\n setcookie(APP_USERS_COOKIES_PASSWORD, $password);\n\n // Redirect to endpoint\n header(\"Location: \" . self::ENDPOINTS['success_login']);\n }",
"public function login($user) \n {\n $_SESSION['user_id'] = $user['id'];\n $_SESSION['is_logged_in'] = true;\n $_SESSION['time_logged_in'] = time();\n }",
"public function log_in()\n\t{\n\t\tif( isset( $_POST['user_login'] ) && wp_verify_nonce( $_POST['login_nonce'], 'login-nonce') ) \n\t\t{\n\t\t\t/** Error when no password enter */\n\t\t\tif( ! isset( $_POST['user_pass']) || $_POST['user_pass'] == '') {\n\t\t\t\t$this->system_message['error'][] = __('Please enter a password');\n\t\t\t\treturn false;\n\t\t\t}\n\t \t\t\n\t\t\t// this returns the user ID and other info from the user name\n\t\t\t$user = get_user_by('login', $_POST['user_login'] );\n \n\t\t\tif( ! $user ) \n\t\t\t{\t\t\t\t\n\t\t\t\t$this->system_message['error'][] = __('Invalid ID or password');\n\t\t\t\treturn false;\n\t\t\t}\n\t \n\t\t\t// check the user's login with their password\n\t\t\tif( ! wp_check_password( $_POST['user_pass'], $user->user_pass, $user->ID) ) {\n\t\t\t\t// if the password is incorrect for the specified user\n\t\t\t\t$this->system_message['error'][] = __('Invalid ID or password');\n\t\t\t}\n\t \n\t\t\t// only log the user in if there are no errors\n\t\t\tif( empty( $this->system_message['error'] )) \n\t\t\t{\n\t\t\t\twp_set_auth_cookie( $user->ID, false, true );\n\t\t\t\twp_set_current_user( $user->ID );\t\n\t\t\t\tdo_action('wp_login', $_POST['user_login']);\n\t \n\t\t\t\twp_redirect( home_url() ); exit;\n\t\t\t}\n\t\t}\n\t}",
"public function login(){\n echo $this->name . ' logged in';\n }",
"public function ual_activity_login() {\n\n\t\t// Prevent user ID returning as 0.\n\t\t$user_reset = apply_filters( 'determine_current_user', false );\n\n\t\twp_set_current_user( $user_reset );\n\n\t\t// Store user id.\n\t\t$user_id = get_current_user_id();\n\n\t\t// If we have the user id, continue.\n\t\tif ( ! empty( $user_id ) ) {\n\t\t\t// Get user data with id.\n\t\t\t$user = get_userdata( $user_id );\n\n\t\t\t// Store a user name.\n\t\t\t$user_name = $user->display_name ? $user->display_name : $user->user_nicename;\n\n\t\t\t// Log this activity.\n\t\t\tdo_action( 'ual_log_action', $user->ID, $user_name . ' logged In', 'logged-in' );\n\t\t}\n\t}",
"public function login(){\n \t\t//TODO redirect if user already logged in\n \t\t//TODO Seut up a form\n \t\t//TODO Try to log in\n \t\t//TODO Redirect\n \t\t//TODO Error message\n \t\t//TODO Set subview and load layout\n\n \t}",
"public function login()\n\t{\n\t\t$mtg_login_failed = I18n::__('mtg_login_failed');\n\t\tR::selectDatabase('oxid');\n\t\t$sql = 'SELECT oxid, oxfname, oxlname FROM oxuser WHERE oxusername = ? AND oxactive = 1 AND oxpassword = MD5(CONCAT(?, UNHEX(oxpasssalt)))';\n\t\t$users = R::getAll($sql, array(\n\t\t\tFlight::request()->data->uname,\n\t\t\tFlight::request()->data->pw\n\t\t));\n\t\tR::selectDatabase('default');//before doing session stuff we have to return to db\n\t\tif ( ! empty($users) && count($users) == 1) {\n\t\t\t$_SESSION['oxuser'] = array(\n\t\t\t\t'id' => $users[0]['oxid'],\n\t\t\t\t'name' => $users[0]['oxfname'].' '.$users[0]['oxlname']\n\t\t\t);\n\t\t} else {\n\t\t\t$_SESSION['msg'] = $mtg_login_failed;\n\t\t}\n\t\t$this->redirect(Flight::request()->data->goto, true);\n\t}",
"public function logInUserChangesToLoggedInStatus() {\n\t\t$user = new Tx_Oelib_Model_FrontEndUser();\n\t\t$this->subject->logInUser($user);\n\n\t\t$this->assertTrue(\n\t\t\t$this->subject->isLoggedIn()\n\t\t);\n\t}",
"public function login()\n {\n if(is_logged_in()) {\n redirect_to(url('thread/index'));\n }\n\n $user = new User;\n $page = Param::get('page_next', 'login');\n\n switch($page) {\n case 'login':\n break;\n\n case 'lobby':\n $user->username = Param::get('username');\n $user->password = Param::get('password');\n\n try {\n $user = $user->verify();\n $_SESSION['id'] = $user['id'];\n } catch (UserNotFoundException $e) {\n $page = 'login';\n }\n break;\n\n default:\n throw new UserNotFoundException(\"User not found\");\n }\n\n $this->set(get_defined_vars());\n $this->render($page);\n }",
"public function login($user)\n {\n if($user)\n {\n $this->user_id =$_SESSION['user_id'] = $user->user_id;\n $this->username=$_SESSION['username'] = $user->username;\n $this->user_status=$_SESSION['user_status']= $user->user_status;\n $this->logged_in=TRUE;\n }\n }",
"public function signIn($user)\n {\n $this->setAuthenticated(true);\n\n $this->setAttribute('loggedin', true, 'user');\n $this->setAttribute('remoteaddress', $_SERVER['REMOTE_ADDR'], 'user');\n $this->setAttribute('useragent', $_SERVER['HTTP_USER_AGENT'], 'user');\n\n $this->initializeUser($user);\n }",
"protected function login()\n {\n $this->send(Response::nick($this->config['nick']));\n $this->send(Response::user(\n $this->config['nick'],\n $this->config['hostname'],\n $this->config['servername'],\n $this->config['realname']\n ));\n }",
"public function login()\n {\n if ($this->getCurrentUser()->get('id')) {\n $this->redirect($this->Auth->redirectUrl());\n }\n\n if ($user = $this->Auth->identify()) {\n $this->Auth->setUser($user);\n\n // set cookie\n if (!empty($this->getRequest()->getData('remember_me'))) {\n if ($CookieAuth = $this->Auth->getAuthenticate('Lil.Cookie')) {\n $CookieAuth->createCookie($this->getRequest()->getData());\n }\n }\n } else {\n if ($this->getRequest()->is('post') || env('PHP_AUTH_USER')) {\n $this->Flash->error(__d('lil', 'Invalid username or password, try again'));\n }\n }\n\n if ($this->getCurrentUser()->get('id')) {\n $redirect = $this->Auth->redirectUrl();\n $event = new Event('Lil.Auth.afterLogin', $this->Auth, [$redirect]);\n $this->getEventManager()->dispatch($event);\n\n return $this->redirect($redirect);\n }\n }",
"public function login()\n\t{\n\t\t//Compute the hash code of the password submited by user\n\t\t$user_password_hash = $this->passwordEncrypt($this->user_info['user_password']);\n\t\t\n\t\t//Do datebase query to get the hash code of the password\n\t\t$db = BFL_Database :: getInstance();\n\t\t$stmt = $db->factory('select `user_id`,`user_password` from '.DB_TABLE_USER.' WHERE `user_name` = :user_name');\n\t\t$stmt->bindParam(':user_name', $this->user_info['user_name']);\n\t\t$stmt->execute();\n\t\t$rs = $stmt->fetch();\n\t\tif (empty($rs))\n\t\t\tthrow new MDL_Exception_User_Passport('user_name');\n\t\t\n\t\tif ($rs['user_password'] != $user_password_hash)\n\t\t\tthrow new MDL_Exception_User_Passport('user_password');\n\n\t\t//Set user session\n\t\t$auth = BFL_ACL :: getInstance();\n\t\t$auth->setUserID($rs['user_id']);\n\t}",
"public static function logIn($userId)\r\n {\r\n (new Session())->set(static::$userIdField, $userId);\r\n }",
"public function login() {\n $this->db->sql = 'SELECT * FROM '.$this->db->dbTbl['users'].' WHERE username = :username LIMIT 1';\n\n $user = $this->db->fetch(array(\n ':username' => $this->getData('un')\n ));\n\n if($user['hash'] === $this->hashPw($user['salt'], $this->getData('pw'))) {\n $this->sessionId = md5($user['id']);\n $_SESSION['user'] = $user['username'];\n $_SESSION['valid'] = true;\n $this->output = array(\n 'success' => true,\n 'sKey' => $this->sessionId\n );\n } else {\n $this->logout();\n $this->output = array(\n 'success' => false,\n 'key' => 'WfzBq'\n );\n }\n\n $this->renderOutput();\n }",
"public function log_in() {\n\n // Check if the user exists on the database\n if (!$this->does_exist('username')) {\n return \"Username does not exist\";\n }\n\n $user = User::find($this->username, 'username');\n\n // If password matches\n if ($user->password !== $this->password) {\n return \"Sorry, password does not match\";\n }\n\n return true;\n }",
"public function signin()\n\t{\n $user = new User();\n\n // If user can succesfully signin then signin\n if ($user->signin(Database::connection(), $_POST['username'], $_POST['password']))\n {\n $_SESSION['id'] = $user->id;\n return True;\n }\n\n return False;\n\t}",
"public function action_login_as()\n {\n if (!$this->loginUserObj || !$this->loginUserObj->isRoleAdmin())\n {\n $this->request->redirect('/');\n }\n $user_id = sanitizeValue($this->request->param('route'));\n $userObj = Model_User::getUserObjById($user_id);\n $user = $this->auth->force_login($userObj->getEmail());\n if ($user) {\n $session = Session::instance();\n $session->set('login_as.id', $this->loginUserObj->getId());\n $session->set('login_as.name', $this->loginUserObj->getName());\n Model_Audit::log($this->loginUserObj->getId(), Model_Audit::TYPE_LOGIN_AS, $user_id);\n $this->request->redirect('/dashboard');\n } else {\n $this->request->redirect('/');\n }\n }",
"function user_action_login($env, $vars) {\n $username = array_pop($vars['data']['username']);\n // We allow also using email for logging in.\n if (valid_email($username)) {\n $username = UserFactory::getUserFromField($env, 'email', $username);\n }\n\n // Initialize an user object.\n $tmp_user = new User($env, $username);\n // Attempt to log in the user.\n $login = $tmp_user->logIn(array_pop($vars['data']['password']));\n exit($login);\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 function login()\n {\n //$this->username = $username; // we are gonnna use the above property: $username here\n //$this->password = $password;\n // we want to call authuser from within login so\n $this->auth_user(); // we don't need to pass any arguments here because we know the class properties above this line\n\n }",
"public function handleUserLogin($event) {\n //Log user login\n $activity = new Activity;\n $activity->activity_type = 'login';\n $activity->actor_id = $event->user->id;\n $activity->actor_type = 'user';\n $activity->activity_data = '';\n $activity->user_agent = $this->request->header('User-Agent');\n $activity->actor_ip = $this->request->ip();\n $activity->save();\n }",
"private function logIn()\n {\n $element = new Submit('login');\n $element->setAttribute('class', 'btn btn-info btn-lg btn-block text-uppercase waves-effect waves-light');\n $element->setUserOption('mainClass', 'form-group text-center m-t-20');\n $this->add($element);\n }",
"public function loginUser()\r\n {\r\n $req = $this->login->authenticate($this->user);\r\n $req_result = get_object_vars($req);\r\n print(json_encode($req_result));\r\n }",
"public function Login(AuthUser $user) \n {\n $_SESSION[\"valid_login\"] = true;\n $_SESSION[\"user_id\"] = $user->id;\n }",
"public function login() {\n\n $user_login = trim(in('id'));\n $user_pass = in('password');\n $remember_me = 1;\n\n $credits = array(\n 'user_login' => $user_login,\n 'user_password' => $user_pass,\n 'rememberme' => $remember_me\n );\n\n $re = wp_signon( $credits, false );\n\n if ( is_wp_error($re) ) {\n $user = user( $user_login );\n if ( $user->exists() ) ferror( -40132, \"Wrong password\" );\n else ferror( -40131, \"Wrong username\" );\n }\n else if ( in('response') == 'ajax' ) {\n // $this->response( user($user_login)->session() ); // 여기서 부터..\n }\n else {\n $this->response( ['data' => $this->get_button_user( $user_login ) ] );\n }\n\n }",
"public function login() {\r\n if (!empty($_POST)) {\r\n $username = filter_input(INPUT_POST, 'username', FILTER_SANITIZE_STRING);\r\n $password = filter_input(INPUT_POST, 'password', FILTER_SANITIZE_STRING);\r\n\r\n $hash = hash('sha512', $password . Configuration::USER_SALT);\r\n unset($password);\r\n\r\n $user = UserModel::getByUsernameAndPasswordHash($username, $hash);\r\n unset($hash);\r\n\r\n if ($user) {\r\n Session::set('user_id', $user->user_id);\r\n Session::set('username', $username);\r\n Session::set('ip', filter_input(INPUT_SERVER, 'REMOTE_ADDR'));\r\n Session::set('ua', filter_input(INPUT_SERVER, 'HTTP_USER_AGENT', FILTER_SANITIZE_STRING));\r\n\r\n Misc::redirect('');\r\n } else {\r\n $this->set('message', 'Nisu dobri login parametri.');\r\n sleep(1);\r\n }\r\n }\r\n }",
"function signInAsUser($args, &$request) {\n\t\t$this->addCheck(new HandlerValidatorJournal($this));\n\t\t// only managers and admins have permission\n\t\t$this->addCheck(new HandlerValidatorRoles($this, true, null, null, array(ROLE_ID_SITE_ADMIN, ROLE_ID_JOURNAL_MANAGER)));\n\t\t$this->validate();\n\n\t\tif (isset($args[0]) && !empty($args[0])) {\n\t\t\t$userId = (int)$args[0];\n\t\t\t$journal =& $request->getJournal();\n\n\t\t\tif (!Validation::canAdminister($journal->getId(), $userId)) {\n\t\t\t\t$this->setupTemplate($request);\n\t\t\t\t// We don't have administrative rights\n\t\t\t\t// over this user. Display an error.\n\t\t\t\t$templateMgr =& TemplateManager::getManager();\n\t\t\t\t$templateMgr->assign('pageTitle', 'manager.people');\n\t\t\t\t$templateMgr->assign('errorMsg', 'manager.people.noAdministrativeRights');\n\t\t\t\t$templateMgr->assign('backLink', $request->url(null, 'manager', 'people', 'all'));\n\t\t\t\t$templateMgr->assign('backLinkLabel', 'manager.people.allUsers');\n\t\t\t\treturn $templateMgr->display('common/error.tpl');\n\t\t\t}\n\n\t\t\t$userDao =& DAORegistry::getDAO('UserDAO');\n\t\t\t$newUser =& $userDao->getUser($userId);\n\t\t\t$session =& $request->getSession();\n\n\t\t\t// FIXME Support \"stack\" of signed-in-as user IDs?\n\t\t\tif (isset($newUser) && $session->getUserId() != $newUser->getId()) {\n\t\t\t\t$session->setSessionVar('signedInAs', $session->getUserId());\n\t\t\t\t$session->setSessionVar('userId', $userId);\n\t\t\t\t$session->setUserId($userId);\n\t\t\t\t$session->setSessionVar('username', $newUser->getUsername());\n\t\t\t\t$request->redirect(null, 'user');\n\t\t\t}\n\t\t}\n\t\t$request->redirect(null, $request->getRequestedPage());\n\t}",
"public function login() {\n\t\tif(!empty(Session::get('http_response'))) {\n\t\t\thttp_response_code(Session::get('http_response'));\n\t\t\tSession::delete('http_response');\n\t\t}\n\t\tif($_POST && isset($_POST['login']) && isset($_POST['password'])) {\n\t\t\t$user = $this->_model->getLogin(strtolower($_POST['login']));\n\t\t\tif($user && $user->enabled) {\n\t\t\t\tif(hash_equals($user->password,crypt($_POST['password'],$user->password))) {\n\t\t\t\t\tif($user->blocked) {\n\t\t\t\t\t\thttp_response_code(403);\n\t\t\t\t\t\tSession::setMessage(array('alert'=>'warning','icon'=>'exclamation','text'=>\"User is blocked\"));\n\t\t\t\t\t} elseif($user->verified) {\n\t\t\t\t\t\tSession::set('user',$user);\n\t\t\t\t\t\tSession::setMessage(array('alert'=>'success','icon'=>'check','text'=>\"User has logged in successfully\"));\n\t\t\t\t\t\t$redirect = Session::get('login_redirect');\n\t\t\t\t\t\tRouter::redirect(Session::get('login_redirect'));\n\t\t\t\t\t} else {\n\t\t\t\t\t\thttp_response_code(401);\n\t\t\t\t\t\tSession::setMessage(array('alert'=>'warning','icon'=>'exclamation','text'=>\"User is not yet confirmed\"));\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\thttp_response_code(401);\n\t\t\t\t\tSession::setMessage(array('alert'=>'danger','icon'=>'ban','text'=>\"Invalid login name or password\"));\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\thttp_response_code(401);\n\t\t\t\tSession::setMessage(array('alert'=>'danger','icon'=>'ban','text'=>\"Invalid login name or password\"));\n\t\t\t}\t\n\t\t}\n\t}",
"public function signinAction()\n {\n // check request method\n if (Router::getMethod() == 'POST') {\n $username = Router::getParam('username');\n $password = Router::getParam('password');\n $remember = Router::getParam('remember') ? 1 : 0;\n\n $user = new User();\n // auth user with request params\n if (!$user->auth($username, $password)) {\n // add errors to display\n $this->setMessage($user->getErrors(), 'error');\n $this->setVars(array(\n 'username' => $username,\n 'remember' => $remember\n ));\n } else {\n // change session expire time\n $now = time();\n $expire = $remember ? ($now + 60 * 60 * 24 * 30 * 12) : ($now + 60 * 60 * 24); // 1 year : 1 day\n $params = session_get_cookie_params();\n setcookie(session_name(), $_COOKIE[session_name()], $expire, $params['path'], $params['domain'], $params['secure'], $params['httponly']);\n\n // remember user id to session\n $_SESSION['userId'] = $user->getUserId();\n\n Router::redirect('index', 'index');\n }\n } elseif (isset($_SESSION['userId'])) {\n Router::redirect('index', 'index');\n }\n $this->setVar('title', 'Sign in page');\n $this->render('signin');\n }",
"function signIn(){\n\t\t\tglobal $db;\n\t\t\tglobal $json;\n\n\t\t\tinclude_once(\"security.php\");\n\t\t\t\n\t\t\tif($this->username == \"\" || $this->password == null){\n\t\t\t\t$json->invalidRequest();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$userInfo = $db->prepare('SELECT * FROM user WHERE Username = :username');\n\t\t\t\t$userInfo->bindParam(':username', $this->username);\n\t\t\t\t$userInfo->execute();\n\t\t\t\t\n\t\t\t\t//Check if user exists\n\t\t\t\tif($userInfo->rowCount() == 0){\n\t\t\t\t\t$json->notFound(\"User\");\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t//If exists, pull Password hash and verify against inserted password\n\t\t\t\t\tforeach($userInfo as $row) {\n\t\t\t\t\t\tif($row['Password'] === crypt($this->password, $row['Password'])){\n\t\t\t\t\t\t\t//correct username & password combination\n\t\t\t\t\t\t\techo '{ \"User\" : { \"Id\" : '.$row['Id'].', \"Username\" : \"'.$row['Username'].'\", \"Subject\" : '.$row['Subject'].', \"Admin\" : '.$row['Admin'].', \"ApiKey\" : \"'.$row['ApiKey'].'\" } }';\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t$json->unauthorizedInvalidPassword();\n\t\t\t\t\t\t\treturn;\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}",
"public function auth_user()\n {\n //echo $this->id;\n //echo $this->username. ' is authenticated';\n }",
"protected function loginUser()\n {\n // Set login data for this user\n /** @var User $oUserModel */\n $oUserModel = Factory::model('User', Constants::MODULE_SLUG);\n $oUserModel->setLoginData($this->mfaUser->id);\n\n // If we're remembering this user set a cookie\n if ($this->remember) {\n $oUserModel->setRememberCookie(\n $this->mfaUser->id,\n $this->mfaUser->password,\n $this->mfaUser->email\n );\n }\n\n // Update their last login and increment their login count\n $oUserModel->updateLastLogin($this->mfaUser->id);\n\n // --------------------------------------------------------------------------\n\n // Generate an event for this log in\n createUserEvent('did_log_in', ['method' => $this->loginMethod], null, $this->mfaUser->id);\n\n // --------------------------------------------------------------------------\n\n // Say hello\n if ($this->mfaUser->last_login) {\n\n /** @var Config $oConfig */\n $oConfig = Factory::service('Config');\n\n $sLastLogin = $oConfig->item('authShowNicetimeOnLogin')\n ? niceTime(strtotime($this->mfaUser->last_login))\n : toUserDatetime($this->mfaUser->last_login);\n\n if ($oConfig->item('authShowLastIpOnLogin')) {\n $this->oUserFeedback->success(lang(\n 'auth_login_ok_welcome_with_ip',\n [\n $this->mfaUser->first_name,\n $sLastLogin,\n $this->mfaUser->last_ip,\n ]\n ));\n\n } else {\n $this->oUserFeedback->success(lang(\n 'auth_login_ok_welcome',\n [\n $this->mfaUser->first_name,\n $sLastLogin,\n ]\n ));\n }\n\n } else {\n $this->oUserFeedback->success(lang(\n 'auth_login_ok_welcome_notime',\n [\n $this->mfaUser->first_name,\n ]\n ));\n }\n\n // --------------------------------------------------------------------------\n\n // Delete the token we generated, it's no needed, eh!\n /** @var Authentication $oAuthService */\n $oAuthService = Factory::model('Authentication', Constants::MODULE_SLUG);\n $oAuthService->mfaTokenDelete($this->data['token']['id']);\n\n // --------------------------------------------------------------------------\n\n $sRedirectUrl = $this->returnTo != siteUrl() ? $this->returnTo : $this->mfaUser->group_homepage;\n redirect($sRedirectUrl);\n }",
"public static function login()\n {\n (new Authenticator(request()))->login();\n }",
"private function attemptLogin($user){\n\n }",
"function login() {\n \t$this->set('indata',$this->data);\n\t\tif(empty($this->data)){\n\t\t\t$this->pageTitle = 'Log in';\n\t\t\t$cookie = $this->Cookie->read('Auth.User');\n\t\t}\n }",
"private function logInSUUser()\n {\n $this->user= self::$kernel->getContainer()->get('doctrine')->getRepository('AppBundle:User')->findOneById(1258);\n\n $session = $this->client->getContainer()->get('session');\n\n $firewall = 'secured_area';\n $attributes = [];\n\n $token = new SamlSpToken(array('ROLE_USER'),$firewall, $attributes, $this->user);\n\n\n $session->set('_security_'.$firewall, serialize($token));\n $this->client->getContainer()->get('security.token_storage')->setToken($token);\n $session->save();\n\n $cookie = new Cookie($session->getName(), $session->getId());\n $this->client->getCookieJar()->set($cookie);\n }",
"public function login() {\r\n\t\t\r\n\t\t$back = $this->hybrid->get_back_url();\r\n\t\t$user_profile = $this->hybrid->auth();\r\n\t\t\r\n\t\t$email = $user_profile->emailVerified;\r\n\t\tif(!$email)\r\n\t\t\t$email = $user_profile->email;\r\n\t\t\r\n\t\tif(!$email)\r\n\t\t\t$this->hybrid->throw_error($this->ts(\"You don't have any email address associated with this account\"));\r\n\t\t\r\n\t\t/* check if user exists */\r\n\t\t$user = current($this->a_session->user->get(array(\"email\" => $email)));\r\n\t\tif(!$user) {\r\n\t\t\t/* create user */\r\n\t\t\t$uid = $this->hybrid->add_user($email, $user_profile);\r\n\t\t\t$user = current($this->a_session->user->get(array(\"id\" => $uid)));\r\n\t\t\t\r\n\t\t\tif(!$user)\r\n\t\t\t\t$this->wf->display_error(500, $this->ts(\"Error creating your account\"), true);\r\n\t\t}\r\n\t\t\r\n\t\t/* login user */\r\n\t\t$sessid = $this->hybrid->generate_session_id();\r\n\t\t$update = array(\r\n\t\t\t\"session_id\" => $sessid,\r\n\t\t\t\"session_time\" => time(),\r\n\t\t\t\"session_time_auth\" => time()\r\n\t\t);\r\n\t\t$this->a_session->user->modify($update, (int)$user[\"id\"]);\r\n\t\t$this->a_session->setcookie(\r\n\t\t\t$this->a_session->session_var,\r\n\t\t\t$sessid,\r\n\t\t\ttime() + $this->a_session->session_timeout\r\n\t\t);\r\n\t\t\r\n\t\t/* save hybridauth session */\r\n\t\t$this->a_session->check_session();\r\n\t\t$this->hybrid->save();\r\n\t\t\r\n\t\t/* redirect */\r\n\t\t$redirect_url = $this->wf->linker('/');\r\n\t\tif(isset($uid))\r\n\t\t\t$redirect_url = $this->wf->linker('/account/secure');\r\n\t\t$redirect_url = $back ? $back : $redirect_url;\r\n\t\t$this->wf->redirector($redirect_url);\r\n\t}",
"public function login()\n {\n if ($this->UserManager_model->verifUser($_POST['user_id'], $_POST['user_password'])) {\n\n $arrUser = $this->UserManager_model->getUserByIdentifier($_POST['user_id']);\n $data = array();\n $objUser = new UserClass_model;\n $objUser->hydrate($arrUser);\n $data['objUser'] = $objUser;\n\n $user = array(\n 'user_id' => $objUser->getId(),\n 'user_pseudo' => $objUser->getPseudo(),\n 'user_img' => $objUser->getImg(),\n 'user_role' => $objUser->getRole(),\n );\n\n $this->session->set_userdata($user);\n redirect('/');\n } else {\n $this->signin(true);\n }\n }",
"public function login(){\n\t\t$this->user = $this->user->checkCredentials();\n\t\t$this->user = array_pop($this->user);\n\t\tif($this->user) {\n\t\t\t$_SESSION['id'] = $this->user['id'];\n\t\t\t$_SESSION['name'] = $this->user['name'];\n\t\t\t$_SESSION['admin'] = $this->user['admin'];\n\t\t\t$this->isAdmin();\n\t \t\theader('location: ../view/home.php');\n\t \t\texit;\n\t \t}\n\t\t$dados = array('msg' => 'Usuário ou senha incorreto!', 'type' => parent::$error);\n\t\t$_SESSION['data'] = $dados;\n\t\theader('location: ../view/login.php');\n \t\texit;\n\t}",
"private function logInSUUser()\n {\n $this->user= self::$kernel->getContainer()->get('doctrine')->getRepository('AppBundle:User')->findOneById(1646);\n\n $session = $this->client->getContainer()->get('session');\n\n $firewall = 'secured_area';\n $attributes = [];\n\n $this->user->setOpRoles('cclavoisier01.in2p3.fr');\n\n $token = new SamlSpToken(array('ROLE_USER'),$firewall, $attributes, $this->user);\n\n\n $session->set('_security_'.$firewall, serialize($token));\n $this->client->getContainer()->get('security.token_storage')->setToken($token);\n $session->save();\n\n $cookie = new Cookie($session->getName(), $session->getId());\n $this->client->getCookieJar()->set($cookie);\n }",
"public static function loginImpl($user)\n {\n tools::destroySession();\n //Get new Session\n session_start();\n\n //Set loggedUser\n $_SESSION['loggedUser'] = serialize($user);\n $_SESSION[\"logged\"] = true;\n }",
"public function login();",
"public function login();",
"function userLoggedIn()\n{\n\tif(Auth::check()) {\n\t\t// Log::info('');\n\t\theader('Location: /users/account?id=' . Auth::id() );\n\t\tdie();\n\t}\n}",
"public function login() {\n $userName = Request::post('user_name');\n $userPassword = Request::post('user_password');\n if (isset($userName) && isset($userPassword)) {\n // perform the login method, put result (true or false) into $login_successful\n $login_successful = LoginModel::login($userName, $userPassword);\n\n // check login status: if true, then redirect user login/showProfile, if false, then to login form again\n if ($login_successful) {\n //if the user successfully logs in, reset the count\n $userID = Session::get('user_id');\n LoginModel::validLogin($userID);\n Redirect::to('login/loginHome');\n } else {\n Redirect::to('login/index');\n }\n }\n }",
"private function login(){\n \n }",
"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 login() {\n\t\t//$salt = Configure::read('Security.salt');\n\t\t//echo md5('password'.$salt);\n\n\t\t// redirect user if already logged in\n\t\tif( $this->Session->check('User') ) {\n\t\t\t$this->redirect(array('controller'=>'dashboard','action'=>'index','admin'=>true));\n\t\t}\n\n\t\tif(!empty($this->data)) {\n\t\t\t// set the form data to enable validation\n\t\t\t$this->User->set( $this->data );\n\t\t\t// see if the data validates\n\t\t\tif($this->User->validates()) {\n\t\t\t\t// check user is valid\n\t\t\t\t$result = $this->User->check_user_data($this->data);\n\n\t\t\t\tif( $result !== FALSE ) {\n\t\t\t\t\t// update login time\n\t\t\t\t\t$this->User->id = $result['User']['id'];\n\t\t\t\t\t$this->User->saveField('last_login',date(\"Y-m-d H:i:s\"));\n\t\t\t\t\t// save to session\n\t\t\t\t\t$this->Session->write('User',$result);\n\t\t\t\t\t//$this->Session->setFlash('You have successfully logged in');\n\t\t\t\t\t$this->redirect(array('controller'=>'dashboard','action'=>'index','admin'=>true));\n\t\t\t\t} else {\n\t\t\t\t\t$this->Session->setFlash('Either your Username of Password is incorrect');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"private function LogIn() : bool\n {\n\n //session::close();\n\n\n $not_specified_user_and_pass = empty($this->username) and empty($this->password);\n\n\n if($not_specified_user_and_pass)\n\n return false;\n\n\n $user = $this->user_details($this->username);\n\n\n $username_not_exists = !$user; //Not user\n\n\n if($username_not_exists)\n\n return false;\n\n\n\n $unrecognized_password = !$this->recognized_password();\n\n\n if($unrecognized_password)\n\n return false;\n\n\n $this->id = $user[\"id\"];\n\n return $this->set_session_key($user);\n\n\n\n }",
"public function Login()\n\t{\n\t\t$this->user->email = $_POST['email'];\n\t\t$this->user->password = $_POST['password'];\n // Here we verify the nonce, so that only users can try to log in\n\t\t// to whom we've actually shown a login page. The first parameter\n\t\t// of Nonce::Verify needs to correspond to the parameter that we\n\t\t// used to create the nonce, but otherwise it can be anything\n\t\t// as long as they match.\n\t\tif (isset($_POST['nonce']) && ulNonce::Verify('login', $_POST['nonce'])){\n\t\t\t// We store it in the session if the user wants to be remembered. This is because\n\t\t\t// some auth backends redirect the user and we will need it after the user\n\t\t\t// arrives back.\n\t\t\t//echo \"login successful\";\n\t\t\t\n\t\t\t///echo $this->input->post('email');\n\n\t\t\tif (isset($_POST['autologin']))\n\t\t\t\t$_SESSION['appRememberMeRequested'] = true;\n\t\t\telse\n\t\t\t\tunset($_SESSION['appRememberMeRequested']);\n \n\t\t\t// This is the line where we actually try to authenticate against some kind\n\t\t\t// of user database. Note that depending on the auth backend, this function might\n\t\t\t// redirect the user to a different page, in which case it does not return.\n\t\t\t$this->ulogin->Authenticate($_POST['email'], $_POST['password']);\n\t\t\tif ($this->ulogin->IsAuthSuccess()){\n\t\t\t\t$_SESSION[\"loggedIn\"] = true;\n\t\t\t\techo \"success\";\n\t\t\t}else echo \"failed\";\n\t\t}else echo 'refresh';\n\t\t//$this->load->view('layout/home.php');\n\t}",
"public function login()\n {\n $authorized = $this->authorize( $_POST );\n if( !empty( $authorized ) && $authorized !== false ){\n $this->register_login_datetime( $authorized );\n ( new Events() )->trigger( 1, true );\n } else {\n ( new Events() )->trigger( 2, true );\n }\n }",
"private function logInSimpleUser()\n {\n $this->user= self::$kernel->getContainer()->get('doctrine')->getRepository('AppBundle:User')->findOneById(41);\n\n $session = $this->client->getContainer()->get('session');\n\n $firewall = 'secured_area';\n $attributes = [];\n\n $token = new SamlSpToken(array('ROLE_USER'),$firewall, $attributes, $this->user);\n\n\n $session->set('_security_'.$firewall, serialize($token));\n $this->client->getContainer()->get('security.token_storage')->setToken($token);\n $session->save();\n\n $cookie = new Cookie($session->getName(), $session->getId());\n $this->client->getCookieJar()->set($cookie);\n }",
"public function actionLoginAsUser()\n {\n \t$user = UserAdmin::findOne(Yii::$app->request->get('id'));\n \tif ($user && Yii::$app->getRequest()->isPost)\n \t{\n \t\tYii::$app->user->login(UserAdminIdentity::findIdentity($user->id));\n \t\treturn $this->redirect([\"/admin/index/index\"]);\n \t}\n \t\n \t$this->layout = '@app/layouts/layout-popup-sm';\n \treturn $this->render('login-as-user', ['model' => $user]);\n }",
"public function login()\n\t{\n\t\tif($this->_identity===null)\n\t\t{\n\t\t\t$this->_identity=new UserIdentity($this->UserName,$this->passWd);\n\t\t\t$this->_identity->authenticate();\n\t\t}\n\t\tif($this->_identity->errorCode===UserIdentity::ERROR_NONE)\n\t\t{\n\t\t\t$duration=$this->rememberMe ? 3600*24*30 : 0; // 30 days\n\t\t\tuser()->login($this->_identity,$duration);\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t\treturn false;\n\t}",
"public function login() {\n $db = Db::getInstance();\n $user = new User($db);\n\n// preventing double submitting\n $token = self::setSubmitToken();\n\n// if user is already logged in redirect him to gallery\n if( $user->is_logged_in() ){\n call('posts', 'index');\n } else {\n// otherwise show login form\n require_once('views/login/index.php');\n// and refresh navigation (Login/Logout)\n require('views/navigation.php');\n }\n }",
"public function login()\n {\n\t\t$login = Input::get('login');\n\t\t$password = Input::get('password');\n\t\ttry{\n\t\t\n\t\t\t$user = Auth::authenticate([\n\t\t\t\t'login' => $login,\n\t\t\t\t'password' => $password\n\t\t\t]);\n\t\t\t$this->setToken($user);\n\t\t\treturn $this->sendResponse('You are now logged in');\n\t\t}\n\t\tcatch (Exception $e) {\n\t\t\treturn $this->sendResponse($e->getMessage());\n\t\t}\n }",
"public function login() {\n\t\treturn $this->login_as( call_user_func( Browser::$user_resolver ) );\n\t}",
"public function p_login() {\n\n\t\t# Sanitize the user entered data to prevent any funny-business (re: SQL Injection Attacks)\n\t\t$_POST = DB::instance(DB_NAME)->sanitize($_POST);\n\n\t\t# Hash submitted password so we can compare it against one in the db\n\t\t$_POST['password'] = sha1(PASSWORD_SALT.$_POST['password']);\n\n\t\t# Search the db for this email and password\n\t\t# Retrieve the token if it's available\n\t\t$q = \"SELECT token \n\t\t\tFROM users \n\t\t\tWHERE email = '\".$_POST['email'].\"' \n\t\t\tAND password = '\".$_POST['password'].\"'\";\n\n\t\t$token = DB::instance(DB_NAME)->select_field($q);\n\n\t\t# If we didn't find a matching token in the database, it means login failed\n\t\tif(!$token) {\n\n\t\t\t# Send them back to the login page\n\t\t\tRouter::redirect(\"/users/login/error\");\n\n\t\t# But if we did, login succeeded! \n\t\t} else {\n\t\t\tsetcookie(\"token\", $token, strtotime('+1 year'), '/');\n\t\t\t# Send them to the main page - or whever you want them to go\n\t\t\tRouter::redirect(\"/\");\n\t\t}\n\t}",
"function user_logged_in($user_id) {\n \n }",
"public function login()\n {\n if (isset($_POST['signIn'])) {\n $userExist = $this->checkIfUserExist($_POST['login']);\n var_dump($userExist);\n \n if ($userExist === false) {\n header('Location: auth&alert=NotUser');\n exit();\n } else {\n $authUser = $this->usersManager->getAuthUser($_POST['login']);\n if (password_verify($_POST['password'], $authUser[0]->userPassword())) {\n $this->usersManager->setLastConnexionUser($authUser[0]->userId());\n $this->openSession($authUser[0]);\n } else {\n header('Location: auth&alert=Login');\n exit();\n }\n }\n } else {\n throw new Exception($this->datasError);\n }\n }",
"function login() \n\t{\n // Specify the navigation column's path so we can include it based\n // on the action being rendered\n \n \n // check for cookies and if set validate and redirect to corresponding page\n\t\t$this->viewData['navigationPath'] = $this->getNavigationPath('users');\n\t\t$this->renderWithTemplate('users/login', 'MemberPageBaseTemplate');\n\t\t\n }",
"public function dologinpage()\n\t\t{\n\t\t\t$userdata = array(\n\t\t\t\t'email' => Input::get('email'),\n\t\t\t\t'password' => Input::get('password')\n\t\t\t);\n\n\t\t\tif(Auth::attempt($userdata)) {\n\t\t\t\tSession::flash('successMessage', \"Welcome back, \" . Auth::user()->username . \"!\");\n\t\t\t\tSession::put('loggedinuser', Auth::user()->username);\n\t\t\t\treturn Redirect::intended('/posts');\n\t\t\t\t// $userid = DB::table('users')->where('username', Session::get('loggedinuser'))->pluck('id');\n\t\t\t\t// Session::put('loggedinid', $userid);\n\t\t\t\t\n\t\t\t\t// return Redirect::action('PostsController@index');\n\t\t\t} else {\n\t\t\t\tSession::flash('errorMessage', 'Your username or password is incorrect');\n\t\t\t\treturn Redirect::to('login');\n\t\t\t}\n\t\t}",
"public function login($userid)\n {\n $this->userId = $userid;\n $this->createSession();\n $this->createCookie();\n $this->logger->setUser($this->userId);\n $this->logger->setIP($this->server['REMOTE_ADDR']);\n $this->logger->loginOutEntry(1);\n }",
"public function doLogin()\r\n {\r\n $input = Request::all();\r\n \r\n if (Auth::attempt(['username' => $input['email'], 'password' => $input['password'], 'deleted_at' => null, 'user_type' => 1]))\r\n {\r\n \r\n $user = Auth::user();\r\n Session::set('current_user_id',$user->id);\r\n return Redirect::intended('/dashboard');\r\n }\r\n else { \r\n Session::flash(\r\n 'systemMessages', ['error' => Lang::get('pages.login.errors.wrong_credentials')]\r\n );\r\n return Redirect::action('UserController@login')\r\n ->withInput(Request::except('password'));\r\n }\r\n }",
"function login()\r\n {\r\n if ($this->data)\r\n {\r\n // Use the AuthComponent's login action\r\n if ($this->Auth->login($this->data))\r\n {\r\n // Retrieve user data\r\n $results = $this->User->find(array('User.username' => $this->data['User']['username']), array('User.active'), null, false);\r\n // Check to see if the User's account isn't active\r\n\r\n if ($results['User']['active'] == 0)\r\n {\r\n // account has not been activated\r\n $this->Auth->logout();\r\n $this->flashNotice('Hello ' . $this->Session->read('Auth.User.username') . '. Your account has not been activated yet! Please check your mail and activate your account.', 'login');\r\n }\r\n // user is active, redirect post login\r\n else\r\n {\r\n $this->User->id = $this->Auth->user('id');\r\n $this->flashSuccess('Hello ' . $this->Session->read('Auth.User.username') . '. You have successfully logged in. Please choose your destination on the left menu.');\r\n $this->User->saveField('last_login', date('Y-m-d H:i:s') );\r\n $this->redirect(array('controller' => 'users', 'action' => 'login'));\r\n }\r\n }\r\n $this->flashWarning('You could not be logged in. Maybe wrong username or password?');\r\n }\r\n }",
"function action_login() \t\t\t\t\t\t\t\t\t// Logs user $user into system.\n\t{\n\t\t$username = $_POST['username'];\n\t\t$password = $_POST['password'];\n\t\t$where = \"username='\".$username.\"' AND password=PASSWORD('\".$password.\"')\";\n\t\t$result = sql_select(\"users\",$where);\n\t\t$row = mysql_fetch_array($result);\n\t\tif($row['ID'])\n\t\t{\n\t\t\t\n\t\t\tses_set(\"userID\", $row['ID']);\n\t\t\tses_set(\"username\", $row['username']);\n\t\t\tses_set(\"fullname\", $row['surname'].\" \".$row['lastname']);\n\t\t\tses_set(\"admin\", $row['group']);\n\t\t\t\n\t\t\tmysql_query(\"UPDATE users SET visits = visits + 1 WHERE username='\".$username.\"'\") or die(\"Query failed : \" . mysql_error());\n\t\t\t\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t\treturn false;\n\t}",
"public function login(){\n\t\t// if already logged-in then redirect to index\n\t\tif($this->Session->check('Auth.User')){\n\t\t\t$this->redirect(array('action'=>'index'));\n\t\t}\n\n\t\t// if we got a post information, try to authenticate\n\t\tif($this->request->is('post')){\n\t\t\t// do login\n\t\t\tif($this->Auth->login()){\n\t\t\t\t// login successful\n\t\t\t\t$this->Session->setFlash(__('Welcome, ' . $this->Auth->user('username')));\n\t\t\t\t$this->redirect($this->Auth->redirectUrl());\n\t\t\t} else {\n\t\t\t\t// login fail\n\t\t\t\t$this->Session->setFlash(__('Invalid username and password'));\n\t\t\t}\n\t\t}\n\t}",
"public function loginAction()\n {\n $data = $this->getRequestData();\n if ($this->getDeviceSession(false)) {\n $this->setErrorResponse('Your device is already running a session. Please logout first.');\n }\n $session = Workapp_Session::login($data['username'], $data['password']);\n if (!$session) {\n $this->setErrorResponse('No user with such username and password');\n }\n $session->registerAction($_SERVER['REMOTE_ADDR']);\n $this->_helper->json(array('session_uid' => $session->getSessionUid()));\n }",
"public function login() {\n return $this->run('login', array());\n }",
"public function login_as()\n {\n // Perform lookup of user\n /** @var \\Nails\\Auth\\Model\\User $oUserModel */\n $oUserModel = Factory::model('User', Constants::MODULE_SLUG);\n /** @var \\Nails\\Common\\Service\\Uri $oUri */\n $oUri = Factory::service('Uri');\n /** @var \\Nails\\Common\\Service\\Input $oInput */\n $oInput = Factory::service('Input');\n\n $sHashId = (string) $oUri->segment(4);\n $sHashPw = (string) $oUri->segment(5);\n $oUser = $oUserModel->getByHashes($sHashId, $sHashPw);\n\n if (!$oUser) {\n show404();\n }\n\n // --------------------------------------------------------------------------\n\n /**\n * Check sign-in permissions; ignore if recovering.\n * Users cannot:\n * - Sign in as themselves\n * - Sign in as superusers (unless they are a superuser)\n */\n\n if (!wasAdmin()) {\n\n $bHasPermission = userHasPermission(\\Nails\\Auth\\Admin\\Permission\\Users\\LoginAs::class);\n $bIsCloning = activeUser('id') == $oUser->id;\n $bIsSuperuser = !isSuperUser() && isSuperUser($oUser);\n\n if (!$bHasPermission || $bIsCloning || $bIsSuperuser) {\n if (!$bHasPermission) {\n $this->oUserFeedback->error(lang('auth_override_fail_nopermission'));\n redirect(\\Nails\\Admin\\Admin\\Controller\\Dashboard::url());\n\n } elseif ($bIsCloning) {\n show404();\n\n } elseif ($bIsSuperuser) {\n show404();\n }\n }\n }\n\n // --------------------------------------------------------------------------\n\n if (!$oInput->get('returningAdmin') && isAdmin()) {\n\n /**\n * The current user is an admin, we should set our Admin Recovery Data so\n * that they can come back.\n */\n\n $oUserModel->setAdminRecoveryData($oUser->id, $oInput->get('return_to'));\n $sRedirectUrl = $oInput->get('forward_to') ?: $oUser->group_homepage;\n\n $this->oUserFeedback->success(lang('auth_override_ok', $oUser->first_name . ' ' . $oUser->last_name));\n\n } elseif (wasAdmin()) {\n\n /**\n * This user is a recovering admin. Work out where we're sending\n * them back to then remove the adminRecovery data.\n */\n\n $oRecoveryData = getAdminRecoveryData();\n $sRedirectUrl = !empty($oRecoveryData->returnTo) ? $oRecoveryData->returnTo : $oUser->group_homepage;\n\n unsetAdminRecoveryData();\n\n $this->oUserFeedback->success(lang('auth_override_return', $oUser->first_name . ' ' . $oUser->last_name));\n\n } else {\n\n /**\n * This user is simply logging in as someone else and has passed the hash\n * verification.\n */\n\n $sRedirectUrl = $oInput->get('forward_to') ?: $oUser->group_homepage;\n\n $this->oUserFeedback->success(lang('auth_override_ok', $oUser->first_name . ' ' . $oUser->last_name));\n }\n\n // --------------------------------------------------------------------------\n\n // Record the event\n createUserEvent(\n 'did_log_in_as',\n [\n 'id' => $oUser->id,\n 'first_name' => $oUser->first_name,\n 'last_name' => $oUser->last_name,\n 'email' => $oUser->email,\n ]\n );\n\n // --------------------------------------------------------------------------\n\n // Replace current user's session data\n $oUserModel->setLoginData($oUser->id, true, true);\n\n // --------------------------------------------------------------------------\n\n redirect($sRedirectUrl);\n }",
"public function login()\n\t{\n\t\tif($this->_identity===null)\n\t\t{\n\t\t\t$this->_identity=new UserIdentity($this->username,$this->password);\n\t\t\t$this->_identity->authenticate();\n\t\t}\n\t\tif($this->_identity->errorCode===UserIdentity::ERROR_NONE)\n\t\t{\n $duration=$this->rememberMe ? 3600*24*30 : 0; // 30 days\n\n\t\t\tYii::app()->user->login($this->_identity,$duration);\n\n $lastLogin = date(\"Y-m-d H:i:s\");\n\n if(Yii::app()->user->tableName === 'tbl_user'){\n $sql = \"UPDATE tbl_user_dynamic SET ulast_login = :lastLogin WHERE user_id = :userid\";\n }\n if(Yii::app()->user->tableName === 'tbl_personnel'){\n $sql = \"UPDATE tbl_user_dynamic SET plast_login = :lastLogin WHERE user_id = :userid\";\n }\n if(Yii::app()->user->tableName === 'tbl_reader'){\n $sql = \"UPDATE tbl_user_dynamic SET rlast_login = :lastLogin WHERE user_id = :userid\";\n }\n $command = Yii::app()->db->createCommand($sql);\n $command->bindValue(\":userid\", $this->_identity->id, PDO::PARAM_STR);\n $command->bindValue(\":lastLogin\", $lastLogin, PDO::PARAM_STR);\n $command->execute();\n Tank::wipeStats();\n Yii::app()->user->setState('todayHasRecord',User::todayHasRecord());\n return true;\n\t\t}\n\t\telse\n\t\t\treturn false;\n\t}",
"public function login($username) {\n $this->username = $username;\n }",
"function login() {\n\t\tif (isset($_REQUEST['username']) && !empty($_REQUEST['username'])) {\n\t\t\t$username = $_REQUEST['username'];\n\n\t\t\t$userDAO = implementationUserDAO_Dummy::getInstance();\n\t\t\t$users = $userDAO->getUsers();\n\n\t\t\tforeach ($users as $key => $user) {\n\t\t\t\tif ($user->getUsername() === $username) {\n\t\t\t\t\t$userFound = $user;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (isset($userFound) && $userFound != null) {\n\n\t\t\t\tif (isset($_REQUEST['password']) && !empty($_REQUEST['password'])) {\n\t\t\t\t\t$password = $_REQUEST['password'];\n\n\t\t\t\t\tif ($userFound->getPassword() === $password) {\n\n\t\t\t\t\t\tsession_start();\n\t\t\t\t\t\t$_SESSION['USERNAME']= $username;\n\n\t\t\t\t\t\t$url = getPreviousUrl();\n\t\t\t\t\t\t$newUrl = substr($url, 0, strpos($url, \"?\"));\n\n\t\t\t\t\t\tredirectToUrl($newUrl);\n\t\t\t\t\t}\n\n\t\t\t\t\telse {\n\t\t\t\t\t\t$this->resendLoginPage('danger', 'Mot de passe invalide.');\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\telse {\n\t\t\t\t\t// redirecting to login with bad password alert\n\t\t\t\t\t$this->resendLoginPage('danger', 'Mot de passe invalide.');\n\t\t\t\t}\n\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$this->resendLoginPage('danger', 'Login invalide.');\n\t\t\t}\n\t\t}\n\n\t\telse {\n\t\t\t// redirecting to login page with bad username alert\n\t\t\t$this->resendLoginPage('danger', 'Login invalide.');\n\t\t}\n\n\n\t}",
"function Login()\n{\n\tglobal $txt, $context;\n\n\t// You're not a guest, why are you here?\n\tif (we::$is_member)\n\t\tredirectexit();\n\n\t// We need to load the Login template/language file.\n\tloadLanguage('Login');\n\tloadTemplate('Login');\n\twetem::load('login');\n\n\t// Get the template ready.... not really much else to do.\n\t$context['page_title'] = $txt['login'];\n\t$context['default_username'] =& $_REQUEST['u'];\n\t$context['default_password'] = '';\n\t$context['never_expire'] = false;\n\t$context['robot_no_index'] = true;\n\n\t// Add the login chain to the link tree.\n\tadd_linktree($txt['login'], '<URL>?action=login');\n\n\t// Set the login URL - will be used when the login process is done (but careful not to send us to an attachment).\n\tif (isset($_SESSION['old_url']) && strpos($_SESSION['old_url'], 'dlattach') === false && strhas($_SESSION['old_url'], array('board=', 'topic=', 'board,', 'topic,')))\n\t\t$_SESSION['login_url'] = $_SESSION['old_url'];\n\telse\n\t\tunset($_SESSION['login_url']);\n}",
"public function login($userName, $password);",
"public function login() {\r\n if ($this->request->is('post')) {\r\n \r\n //If the user is authenticated...\r\n if ($this->Auth->login()) {\r\n \r\n if ($this->isAdmin()) $this->redirect(\"/admin/halls\");\r\n else $this->redirect(\"/halls\");\r\n }\r\n else {\r\n $this->Session->setFlash(__('Invalid username or password, try again'));\r\n }\r\n }\r\n }",
"private function logInVOUser()\n {\n $this->user= self::$kernel->getContainer()->get('doctrine')->getRepository('AppBundle:User')->findOneById(44);\n\n $session = $this->client->getContainer()->get('session');\n\n $firewall = 'secured_area';\n $attributes = [];\n\n $this->user->setOpRoles('cclavoisier01.in2p3.fr');\n\n\n $token = new SamlSpToken(array('ROLE_USER'),$firewall, $attributes, $this->user);\n\n\n $session->set('_security_'.$firewall, serialize($token));\n $this->client->getContainer()->get('security.token_storage')->setToken($token);\n $session->save();\n\n $cookie = new Cookie($session->getName(), $session->getId());\n $this->client->getCookieJar()->set($cookie);\n }",
"public function login(&$objUser)\n\t\t{\n\t\t\tsession_regenerate_id(true);\n\t\t\t$_SESSION['id_admin'] = $objUser->id_usuario;\n\t\t\t$_SESSION['email_admin'] = $objUser->email;\n\t\t\t$_SESSION['user_lastactive_admin'] = time();\n\t\t\t$_SESSION['err'] = \"\";\n\t\t\t\n\t\t\t$this->data[\"logged\"] = true;\n\t\t\t\n\t\t\t//header(\"Location: \"._MSFW_PATH_);\n\t\t\t//exit();\n\t\t}",
"public function login($username, $user) {\r\n //get current logged in Subject and increment the Login Counter\r\n $this->getParent()->getUser()\r\n ->getObject(aam_Control_Object_LoginCounter::UID)\r\n ->increment();\r\n }",
"private static function login() {\n if ( !self::validatePost() ) {\n return;\n }\n $_POST['email'] = strtolower($_POST['email']);\n \n $password = Helper::hash($_POST['password'].$_POST['email']);\n \n $result = Database::getUser($_POST['email'],$password);\n \n if ( $result === false || !is_array($result) ) {\n self::setError('Unbekannter Benutzername oder Passwort!<br>');\n return;\n }\n \n if ( count($result) != 1 ) {\n self::setError('Unbekannter Benutzername oder Passwort!<br>');\n return;\n }\n \n $_SESSION['user']['id'] = $result[0]['id'];\n $_SESSION['user']['email'] = $result[0]['email'];\n $_SESSION['user']['nickname'] = $result[0]['nickname'];\n $_SESSION['user']['verified'] = $result[0]['verified'];\n $_SESSION['user']['moderator'] = $result[0]['moderator'];\n $_SESSION['user']['supermoderator'] = $result[0]['supermoderator'];\n $_SESSION['loggedin'] = true;\n self::$loggedin = true;\n }",
"public function loginUserAction() {\n\t\n\t\t\t$request = $this->getRequest();\n\t\t\t\n\t\t\t\n\t\t\tif ($request->isPost()) {\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t// get the json raw data\n\t\t\t\t$handle = fopen(\"php://input\", \"rb\");\n\t\t\t\t$http_raw_post_data = '';\n\t\t\t\t\n\t\t\t\twhile (!feof($handle)) {\n\t\t\t\t $http_raw_post_data .= fread($handle, 8192);\n\t\t\t\t}\n\t\t\t\tfclose($handle); \n\t\t\t\t\n\t\t\t\t// convert it to a php array\n\t\t\t\t$json_data = json_decode($http_raw_post_data, true);\n\t\t\t\t\n\t\t\t\t//echo json_encode($json_data);\n\t\t\t\t\n\t\t\t\tif (is_array($json_data)) {\n\t\t\t\t\t// convert it back to json\n\t\t\t\t\t\n\t\t\t\t\t// write the user back to database\n\t\t\t\t\t$login = Application_Model_User::loginUser($json_data);\n\t\t\t\t\t\n\t\t\t\t\tif($login) {\n\t\t\t\t\t\techo json_encode($login);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\techo 0;\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 \n\t\t\t\t \n\t\t\t}\n\t\t\t\n\t}",
"public function login() {\n\t\t$this -> load -> model('models_events254/m_clients');\n\t\t$this -> m_clients -> getUser();\n\t\tif ($this -> m_clients -> isUser == 'true') {\n\n\t\t\n\t\t\t/*create session data*/\n\t\t\t$newdata = array('email' => $this -> m_clients -> email, 'logged_in' => TRUE,'id' => $this ->m_clients->id);\n\t\t\t$this -> session -> set_userdata($newdata);\n\n\t\t\tredirect(base_url() . 'C_front/index', 'refresh');\n\t\n\n\t\t} else {\n\t\t\t#use an ajax request and not a whole refresh\n\t\t\t\n\t\t\t$data['message']=\"User Not Found\";\n\t\t\t$data['messageType']=\"error\";\n\t\t\t\n\t\t\t$this->load->view('login',$data);\n\t\t}\n\t}"
] | [
"0.7451285",
"0.74393",
"0.73868906",
"0.7167026",
"0.7149051",
"0.71389085",
"0.7112503",
"0.7066624",
"0.7060725",
"0.70319885",
"0.70154446",
"0.6963597",
"0.6925791",
"0.6909397",
"0.68699414",
"0.6856665",
"0.6798509",
"0.6798164",
"0.6757682",
"0.6749167",
"0.67461044",
"0.6715227",
"0.67113835",
"0.66973555",
"0.6695675",
"0.6686335",
"0.66737306",
"0.66716397",
"0.6657994",
"0.6657151",
"0.66571146",
"0.6644078",
"0.6611626",
"0.6586151",
"0.6583712",
"0.6578495",
"0.656882",
"0.6561734",
"0.6559307",
"0.655586",
"0.65556246",
"0.6555048",
"0.6551101",
"0.65494174",
"0.65370494",
"0.65294456",
"0.6524199",
"0.65222955",
"0.651811",
"0.6514595",
"0.6508",
"0.6502434",
"0.64918643",
"0.6485135",
"0.6483271",
"0.64801764",
"0.6479407",
"0.6473295",
"0.6473085",
"0.64670175",
"0.6465721",
"0.6465721",
"0.6464569",
"0.6456055",
"0.64460015",
"0.64441067",
"0.64403987",
"0.6439557",
"0.6439316",
"0.64348507",
"0.6431481",
"0.6400808",
"0.63869894",
"0.6386726",
"0.6365429",
"0.6363748",
"0.6363674",
"0.6352143",
"0.633495",
"0.6329448",
"0.63269514",
"0.6318838",
"0.63144785",
"0.6306642",
"0.6303297",
"0.6300862",
"0.62988085",
"0.629639",
"0.6295417",
"0.628906",
"0.62849087",
"0.62826324",
"0.628002",
"0.6279657",
"0.62615025",
"0.6248256",
"0.6246731",
"0.6245655",
"0.62451875",
"0.624227",
"0.6236126"
] | 0.0 | -1 |
TODO: Implement __call() method. | public function __call($name, $arguments)
{
var_dump($name,$arguments);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function __invoke()\n {\n }",
"public function call();",
"public function call();",
"public function __invoke()\n {\n\n }",
"public function __invoke();",
"public function __invoke();",
"public function __invoke();",
"public function __invoke();",
"public function call()\n {\n // TODO: Implement call() method.\n }",
"public function invoke();",
"abstract public function __invoke(): void;",
"public function apply() {}",
"public function __call($method, $arguments) {}",
"public function __call($method, $arguments) {}",
"public function __call($method, array $arguments) {}",
"public function __invoke()\n {\n $callable = $this->callable;\n return $callable(...$this->arguments);\n }",
"function __call($name, $arguments)\n {\n }",
"abstract protected function _run();",
"abstract protected function _run();",
"public function __invoke(): void;",
"abstract public function __call($fnc, $args);",
"public function __call($method, $args);",
"public function __invoke( ...$args );",
"public function run()\n {\n // $this->call\n }",
"function __call($method ,$params)\n {\n return self::handleCall($method ,$params);\n }",
"public function __invoke($arguments)\n {\n\n }",
"function __call($method, $args)//call adodb methods\n\t{\n\t\treturn call_user_func_array(array(self::$instance, $method),$args);\n\t}",
"abstract public function run() ;",
"public function __call($name, $arguments);",
"public function __call($method, $arguments);",
"public function __call($name, $arguments)\n {\n }",
"public function __call($name, $arguments)\n {\n }",
"public function __call($name, $arguments)\n {\n }",
"public function __call($name, $arguments) { return self::__callStatic($name, $arguments); }",
"public function __call($name, $arguments) {\n// if(method_exists($this->connection, $name)) {\n// // forward the call to our child object\n// return call_user_func_array(array($this->connection, $name), $arguments);\n// }\n return \"no Function found with this data\";\n }",
"public function apply();",
"public function apply();",
"public function __invoke($param);",
"protected function __init__() { }",
"protected function _exec()\n {\n }",
"abstract public function run();",
"abstract public function run();",
"abstract public function run();",
"abstract public function run();",
"abstract public function run();",
"abstract public function run();",
"abstract public function run();",
"abstract public function run();",
"public function __call(string $method, array $args): mixed;",
"abstract public function Execute();",
"public function __invoke()\n {\n return null;\n }",
"public function __invoke()\n {\n return null;\n }",
"protected abstract function run();",
"private function __() {\n }",
"public function __invoke()\n {\n return $this->apply(func_get_args());\n }",
"public function __call($name, array $arguments);",
"public function __invoke() : array;",
"public function __invoke() : array;",
"function __call($name, $arguments) {\n echo \"Calling G object method '$name' \" . implode(', ', $arguments). \"\\n\";\n }",
"abstract function run();",
"function __call( $method, $arguments ) {\r\n\t\treturn call_user_func_array( array( $this->facebook, $method ), $arguments );\r\n\t}",
"public function __invoke() {\n echo 'hello';\n return $this;\n }",
"function __call($method, $args=[])\n {\n \tcall_user_func_array($this->container[$method], $args);\n }",
"function __call($name, $arguments) {\n echo \"Calling B object method '$name' \" . implode(', ', $arguments). \"\\n\";\n }",
"public function __init(){}",
"function __call($name, $args) {\n\t\treturn main()->extend_call($this, $name, $args);\n\t}",
"protected final function __construct() {}",
"function __call($name, $arguments)\n {\n echo \"方法不存在\";\n }",
"protected function __construct(){}",
"protected function __construct(){}",
"protected function __construct(){}",
"public function __construct()\n {\n parent::__construct('callable');\n }",
"function __call($func, $args)\n {\n return call_user_func_array(array($this->internal, $func), $args);\n }",
"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(){}",
"public function run() {}",
"abstract public function run(): void;",
"public function __call($method, $arguments)\n {\n \n return call_user_func_array([$this, \"_public_$method\"], $arguments);\n \n }",
"public function run(){}",
"final private function __construct() {}",
"final private function __construct() {}",
"protected function __construct() {}",
"protected function __construct() {}",
"protected function __construct() {}",
"protected function __construct() {}"
] | [
"0.7465695",
"0.74534816",
"0.74534816",
"0.73146445",
"0.72799796",
"0.72799796",
"0.72799796",
"0.72799796",
"0.71619594",
"0.6808789",
"0.6746007",
"0.67189497",
"0.67139494",
"0.67139494",
"0.66643625",
"0.6573642",
"0.65496063",
"0.65336317",
"0.65336317",
"0.65056145",
"0.649872",
"0.6395415",
"0.63677925",
"0.63634425",
"0.6309862",
"0.6293679",
"0.6269999",
"0.6263404",
"0.62616426",
"0.62586933",
"0.62435186",
"0.62435186",
"0.62435186",
"0.6236913",
"0.622684",
"0.6222999",
"0.6222999",
"0.6216878",
"0.61824596",
"0.6177839",
"0.61753774",
"0.61753774",
"0.61753774",
"0.61753774",
"0.61753774",
"0.61753774",
"0.61753774",
"0.61753774",
"0.61691445",
"0.6162319",
"0.615147",
"0.615147",
"0.61295104",
"0.61195976",
"0.61153024",
"0.6113479",
"0.61007667",
"0.61007667",
"0.6098706",
"0.6093682",
"0.6086603",
"0.6074349",
"0.6063349",
"0.6054293",
"0.6046935",
"0.60469097",
"0.6037236",
"0.60267323",
"0.6017586",
"0.6017586",
"0.6017586",
"0.6000474",
"0.59991163",
"0.5985348",
"0.5985348",
"0.5985348",
"0.5985348",
"0.5985348",
"0.5985348",
"0.5985348",
"0.5985348",
"0.5985348",
"0.5985348",
"0.5985348",
"0.5985348",
"0.5985348",
"0.5985348",
"0.5985348",
"0.5985348",
"0.5985348",
"0.597478",
"0.59617805",
"0.5959128",
"0.59567225",
"0.59503394",
"0.59503394",
"0.5947665",
"0.5947665",
"0.5947665",
"0.5947665"
] | 0.6001283 | 71 |
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 é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)
{
$data=request()->validate([
'name'=>'string|required',
'role_id'=>'integer',
'dni'=>'string|size:8',
'email'=>'email|required',
]);
User::create([
'role_id'=> $data['role_id'],
'name' => $data['name'],
'dni'=> $data['dni'],
'email'=> $data['email'],
'placa'=> request('placa'),
'password'=>
Hash::make($request->password),
]);
return redirect()->route('users.index')->withSuccess('El usuario fue creado correctamente');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function store($data, Resource $resource);",
"public function store()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'storeValidations')) {\n $this->request->validate($this->storeValidations());\n }\n\n /* Create a new resource */\n $resource = $this->model::create(Input::all());\n\n /* Redirect to newly created resource page */\n return redirect()\n ->route($this->name . '.edit', $resource->id)\n ->with(\n 'success',\n Lang::has($this->name . '.resource-created') ?\n $this->name . '.resource-created' :\n 'messages.alert.resource-created'\n );\n }",
"public function store(CreateStorageRequest $request)\n {\n $this->storage->create($request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource created', ['name' => trans('product::storages.title.storages')]));\n }",
"public function createStorage();",
"public function store(StoreStorage $request)\n {\n $storage = Storage::create($request->all());\n $request->session()->flash('alert-success', 'Запись успешно добавлена!');\n return redirect()->route('storage.index');\n }",
"public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }",
"public function store(Request $request, NebulaResource $resource): RedirectResponse\n {\n $this->authorize('create', $resource->model());\n\n $validated = $request->validate($resource->rules(\n $resource->createFields()\n ));\n\n $resource->storeQuery($resource->model(), $validated);\n\n $this->toast(__(':Resource created', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }",
"function storeAndNew() {\n $this->store();\n }",
"public function store(Request $request)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $validator = Validator::make($request->all(), [\n 'content' => 'required|string',\n 'image_link' => 'sometimes|url',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), [], 400);\n }\n\n $resource = new Resource;\n $resource->user_id = $currentUser['id'];\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->image_link = $request->get('imageLink');\n $resource->video_link = $request->get('videoLink');\n $resource->file_link = $request->get('fileLink');\n $resource->audio_link = $request->get('audioLink');\n $resource->tags = collect($request->get('tags'))->implode('text', ',');\n $resource->is_public = 0;\n $resource->save();\n $data['resource'] = $resource;\n\n if ($request->get('programId')) {\n $this->addToProgram($resource, $request->programId);\n // event(new NewLearningPathResourcePublished($resource, $invitee));\n }\n\n User::find($currentUser['id'])->increment('points', 2);\n\n return APIHandler::response(1, \"New resource has been created\", $data, 201);\n }",
"public function store()\n {\n if (!$this->id) { // Insert\n $this->insertObject();\n } else { // Update\n $this->updateObject();\n }\n }",
"public function store()\n\t{\n\t\t\n\t\t//\n\t}",
"public function store()\r\n\t{\r\n\t\t//\r\n\t}",
"public function store()\r\n\t{\r\n\t\t//\r\n\t}",
"public function store()\r\n\t{\r\n\t\t//\r\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}"
] | [
"0.72865677",
"0.7145327",
"0.71325725",
"0.6640912",
"0.66209733",
"0.65685713",
"0.652643",
"0.65095705",
"0.64490104",
"0.637569",
"0.63736665",
"0.63657933",
"0.63657933",
"0.63657933",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437"
] | 0.0 | -1 |
Display the specified resource. | public function show(User $user)
{
//
} | {
"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(User $user)
{
$roles=Role::all(['id','display_name']);
return view('users.edit',compact('user','roles'));
} | {
"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, User $user)
{
$data=request()->validate([
'name'=>'string|required',
'role_id'=>'integer',
'dni'=>'string|size:8',
'email'=>'email|required',
]);
if ($request->password) {
$user->update([
'role_id'=> $data['role_id'],
'name' => $data['name'],
'dni'=> $data['dni'],
'email'=> $data['email'],
'placa'=> request('placa'),
'password'=>
Hash::make($request->password),
]);
}else{
$user->update([
'role_id'=> $data['role_id'],
'name' => $data['name'],
'dni'=> $data['dni'],
'email'=> $data['email'],
'placa'=> request('placa'),
]);
}
return redirect()->route('users.index')->withSuccess('El usuario fue actualizado');
} | {
"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(User $user)
{
$user->delete();
return redirect()->route('users.index')->withSuccess("El usuario {$user->name} fue eliminado" );
} | {
"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 |
Everytime the service call fails, increment the number of failures. | public function incrementFailures(): bool; | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function incrementErrorCount();",
"public function increaseFailedAttemptsCount()\n {\n $this->failedAttemptsCount++;\n }",
"function incrementOfflineFails() {\n\t\t\t$numFails = $this->settings[\"numbervalidatefails\"];\n\t\t\tif ($numFails == \"\") {\n\t\t\t\t$this->updateSetting(\"numbervalidatefails\", 0);\n\t\t\t\t$numFails = 0;\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t if ($this->maxDaysOffline <> 0) {\n\t\t\t\t// There is a limit\n\t\t\t\tif ($this->debug) echo \"<BR>There is a limit on the number of offline fails. Checking limit.\";\n\t\t\t\t// Is it more than 24 hours since last fail?\n\t\t\t\t$lastFail = $this->settings[\"lastvalidateattempt\"];\n\t\t\t\t\n\t\t\t\tif ((time()-$lastFail) > (24*60*60)) {\n\t\t\t\t\tif ($this->debug) echo \"<BR>More than 24 hours since last fail\";\n\t\t\t\t\t// Yes\n\t\t\t\t\t$numFails++;\n\t\t\t\t\t$this->updateSetting(\"numbervalidatefails\", $numFails);\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t// If it's failed more times than the limit, set the license to inactive\n\t\t\t\t\tif ($numFails > $this->maxDaysOffline) {\n\t\t\t\t\t\tif ($this->debug) echo \"<BR>More than max number of allowed fails, so license is to be made inactive\";\n\t\t\t\t\t\t$this->setLicenseInactive();\n\t\t\t\t\t} \n\t\t\t\t} else {\n\t\t\t\t\tif ($this->debug) echo \"<BR>Less than 24 hours since last fail\";\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif ($this->debug) echo \"<BR>No limit on the number of offline fails.\";\n\t\t\t}\n\t\t\treturn $numFails;\n\t\t}",
"function try_failure($count, $s, $e=\"\") {\n print \"> \". $s .\"*** failure ***<br />> Message: \". $e .\"<br />\";\n return ++$count;\n }",
"public function getFailedCount()\n {\n return $this->failed_count;\n }",
"public function incrementError() {\n\t\tapc_add($this->prefix.'error', 0);\n\t\tapc_inc($this->prefix.'error', 1);\n\t}",
"public function getNumFailures()\n {\n return $this->num_failures;\n }",
"public function testFailedCount()\n {\n $this->mockHandler->append(new Response(503));\n\n $issueCount = $this->issueCounter->getCounts(\n [],\n [\n 'test' => [],\n ]\n );\n\n $this->assertNull($issueCount['test']);\n }",
"public function getFailureCount(): int\n {\n return (int) $this->_getEntity()->getFailureCount();\n }",
"public function getReturnedErrorCount()\n {\n $errors = 0;\n foreach ($this->data['calls'] as $call) {\n $errors += ($call['statusCode'] != 200) ? 1 : 0;\n }\n\n return $errors;\n }",
"public function getFailed(): int\n {\n return $this->failed;\n }",
"public function attempts() {\n\t\treturn 0;\n\t}",
"public function getErrorCount();",
"public function runFailed();",
"public function incrementFailedCount($job_url)\n\t{\n\t\t// get the current failed count\n\t\t$sql = sprintf('SELECT id, failed_attempts, closed, deleted\n\t\t\t\t\t\tFROM ats_jobs\n\t\t\t\t\t\tWHERE job_url = %s\n\t\t\t\t\t\tLIMIT 1',\n\t\t\t\t\t\t$this->_db->quote($job_url));\n\n\t\t$result = $this->_db->query($sql)->fetch();\n\t\tif ($result && isset($result['failed_attempts'])) {\n\t\t\t// skip if already closed or deleted\n\t\t\tif ($result['closed'] == 1 || $result['deleted'] == 1) {\n\t\t\t\treturn FALSE;\n\t\t\t}\n\n\t\t\t// increment failed attempts\n\t\t\t$failed_attempts = (int) $result['failed_attempts'];\n\t\t\tif (++$failed_attempts >= self::MAX_FAIL_ATTEMPTS) {\n\t\t\t\t// we need to close the matching job\n\t\t\t\t$sql = sprintf('UPDATE ats_jobs\n\t\t\t\t\t\t\t\tSET closed = 1,\n\t\t\t\t\t\t\t\tfailed_attempts = %d,\n\t\t\t\t\t\t\t\tmodified_ts = %d\n\t\t\t\t\t\t\t\tWHERE id = %d',\n\t\t\t\t\t\t\t\t$failed_attempts,\n\t\t\t\t\t\t\t\ttime(),\n\t\t\t\t\t\t\t\t$result['id']);\n\n\t\t\t\t$this->_db->query($sql);\n\n\t\t\t\t// return the job to remove it from the search index\n\t\t\t\treturn $result['id'];\n\t\t\t} else {\n\t\t\t\t// we need to increment the failed attempts counter\n\t\t\t\t$sql = sprintf('UPDATE ats_jobs\n\t\t\t\t\t\t\t\tSET failed_attempts = %d,\n\t\t\t\t\t\t\t\tmodified_ts = %d\n\t\t\t\t\t\t\t\tWHERE id = %d',\n\t\t\t\t\t\t\t\t$result['id'],\n\t\t\t\t\t\t\t\ttime());\n\n\t\t\t\t$this->_db->query($sql);\n\t\t\t}\n\t\t}\n\n\t\t// no need to increment or do anything else, no match found\n\t\treturn FALSE;\n\t}",
"public function incActualCalls() {\n $this->actualCalls+= 1;\n }",
"protected function _handle_count_fail()\n\t{\n\t\t$count_max = mod('deposit_card')->setting('fail_count_max');\n\t\t$block_timeout = mod('deposit_card')->setting('fail_block_timeout') * 60;\n\n\t\tif (!$count_max) return;\n\n\t\t$count = model('ip')->action_count_change('deposit_card_fail', 1);\n\n\t\tif ($count >= $count_max) {\n\t\t\t$ip = t('input')->ip_address();\n\n\t\t\tmodel('ip_block')->set($ip, $block_timeout);\n\t\t\tmodel('ip')->action_count_set('deposit_card_fail', 0);\n\t\t}\n\t}",
"public function setFailedDeviceCount(?int $value): void {\n $this->getBackingStore()->set('failedDeviceCount', $value);\n }",
"function increment_failed($username = \"\") {\n\t\tglobal $wpdb;\n\n\t\t$ip = $this->get_user_ip();\n\n\t\t$username = sanitize_user($username);\n\n\t\t$user = get_user_by( 'login', $username );\n\n\t\tif ( !$user ) { \n\t\t\t$user = new stdClass();\n\t\t\t$user->ID = 0;\n\t\t}\n\n\t\t$sql = \"insert into \" . $this->fail_table . \" (user_id, login_attempt_date, login_attempt_IP) \" .\n\t\t\t\"values ('\" . $user->ID . \"', now(), '\" . $wpdb->escape($ip) . \"')\";\n\n\t\t$wpdb->query($sql);\n\n\t}",
"public function getItemsFailed() : int\n {\n return $this->itemsFailed;\n }",
"private function get_failed_rows() {\n\t\treturn $this->failed_rows;\n\t}",
"public function getFailedAttemptsCount()\n {\n return $this->failedAttemptsCount;\n }",
"public function getErrorcount() : int\n {\n return count($this->errors);\n }",
"public function countErrors()\n {\n return isset($this->data['error_count']) ? $this->data['error_count'] : 0;\n }",
"public function test_set_delivery_failure() {\n\n\t\t$webhook = LLMS_REST_API()->webhooks()->create( array(\n\t\t\t'delivery_url' => 'https://mock.tld',\n\t\t\t'topic' => 'student.created',\n\t\t\t'status' => 'active',\n\t\t) );\n\n\t\t$i = 1;\n\t\twhile ( $i <= 6 ) {\n\n\t\t\t$webhook = LLMS_Unit_Test_Util::call_method( $webhook, 'set_delivery_failure' );\n\n\t\t\t$this->assertEquals( $i, $webhook->get( 'failure_count' ) );\n\t\t\t$this->assertEquals( 6 === $i ? 'disabled' : 'active', $webhook->get( 'status' ) );\n\t\t\t$i++;\n\n\t\t}\n\n\t}",
"public function errorCount() {\n $query = $this->connection->select($this->mapTable);\n $query->addExpression('COUNT(*)', 'count');\n $query->condition('needs_update', MigrateMap::STATUS_FAILED);\n $count = $query->execute()->fetchField();\n return $count;\n }",
"public function failedLoginAttempts() : int\n {\n return (isset($this->data['failed_login_attempts'])) ? (int)$this->data['failed_login_attempts'] : 0;\n }",
"public function updateFailedCount($feed_id, $startTime)\n\t{\n\t\t$sql = sprintf('UPDATE ats_jobs\n\t\t\t\t\t\tSET failed_attempts = failed_attempts + 1\n\t\t\t\t\t\tWHERE feed_id = %d\n\t\t\t\t\t\tAND modified_ts < %d\n\t\t\t\t\t\tAND closed = 0',\n\t\t\t\t\t\t$feed_id,\n\t\t\t\t\t\t$startTime);\n\n\t\treturn $this->_db->getConnection()->exec($sql);\n\t}",
"public function hasFailed();",
"public function retryAttempted()\n {\n $this->attempts++;\n }",
"private function count_attempts( $ttl = 300 ) {\n\n\t\tif ( isset( $this->attempts ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$this->sniff_ip();\n\t\t$ip = $this->ip_data[ 0 ];\n\n\t\t$attempts = get_site_transient( self::TRANSIENT_NAME );\n\t\tis_array( $attempts ) or $attempts = [];\n\n\t\t// Seems the first time a failed attempt for this IP\n\t\tif ( ! $attempts || ! array_key_exists( $ip, $attempts ) ) {\n\t\t\t$attempts[ $ip ] = [ 'count' => 0, 'last_logged' => 0, ];\n\t\t}\n\n\t\t$attempts[ $ip ][ 'count' ] ++;\n\t\t$this->attempts_data = $attempts;\n\n\t\t$count = $attempts[ $ip ][ 'count' ];\n\t\t$last_logged = $attempts[ $ip ][ 'last_logged' ];\n\n\t\t/**\n\t\t * During a brute force attack, logging all the failed attempts can be so expensive to put the server down.\n\t\t * So we log:\n\t\t *\n\t\t * - 3rd attempt\n\t\t * - every 20 when total attempts are > 23 && < 100 (23rd, 43rd...)\n\t\t * - every 100 when total attempts are > 182 && < 1182 (183rd, 283rd...)\n\t\t * - every 200 when total attempts are > 1182 (1183rd, 1383rd...)\n\t\t */\n\t\t$do_log =\n\t\t\t$count === 3\n\t\t\t|| ( $count < 100 && ( $count - $last_logged ) === 20 )\n\t\t\t|| ( $count < 1000 && ( $count - $last_logged ) === 100 )\n\t\t\t|| ( ( $count - $last_logged ) === 200 );\n\n\t\t$do_log and $attempts[ $ip ][ 'last_logged' ] = $count;\n\t\tset_site_transient( self::TRANSIENT_NAME, $attempts, $ttl );\n\n\t\t$this->attempts = $do_log ? $count : 0;\n\t}",
"public function testFailed(\\unittest\\TestFailure $failure) {\n $this->status= false;\n $this->stats['failed']++;\n $this->writeFailure($failure);\n }",
"public function errorCount()\n\t{\n\t\treturn count($this->errors);\n\t}",
"public function getErrorCount()\n {\n return $this->errorCount;\n }",
"public function markAsFailed();",
"public function count()\r\n {\r\n return count($this->errors);\r\n }",
"public function count()\r\n {\r\n return count($this->errors);\r\n }",
"private function count_errors($testResults) {\n $errors = 0;\n foreach ($testResults as $tr) {\n if (!$tr->isCorrect) {\n $errors++;\n }\n }\n return $errors;\n }",
"public function testGetErrorMessagesAfterFailure()\n {\n $validator = new Integer();\n $validator->isValid(\"23\");\n $this->assertCount(1, $validator->errors());\n }",
"private function row_failed( $row ) {\n\t\t$this->failed_rows[] = $row + 1;\n\t}",
"public function count()\n {\n return count($this->errors);\n }",
"public function count() {\n return count($this->_errors);\n }",
"public function setFailedUserCount(?int $value): void {\n $this->getBackingStore()->set('failedUserCount', $value);\n }",
"public function failed();",
"protected function increaseFailedLogins($login)\n {\n $sql = '\n UPDATE\tuser\n SET\t\tloginfailed = loginfailed+1\n WHERE\tlogin = %s\n ';\n $sql = sprintf($sql, $login);\n Frapi_Database::getInstance()->query($sql);\n }",
"public function attempts()\n {\n return (int) $this->job->getDequeueCount();\n }",
"public function getErrorsCount()\n {\n return $this->count(self::ERRORS);\n }",
"public function fail($msg) {\n $this->tests++;\n $this->fail++;\n echo \"[FAIL] {$msg}\\n\";\n }",
"public function getErrorsCount()\n {\n return $this->errors_count;\n }",
"public function getErrorsCount()\n {\n return $this->errors_count;\n }",
"public function updateFailed();",
"public function attempts(): int\n {\n return $this->attempts;\n }",
"public function countErrors()\n {\n return count($this->errors);\n }",
"public function incrFailed(Task $task)\n {\n if (!$task->getId())\n {\n throw new QueueException(\"Impossible to increment failure count for Task '$task'.\");\n }\n\n return $this->client->incr(self::PREFIX.\"task:failed:{$task->getId()}\");;\n }",
"public function getRetries(): int\n {\n return $this->retries;\n }",
"private function IncreaseFailedLoginAttempts($UserID)\n\t{\n\t\tj::SQL(\"UPDATE jfp_xuser SET FailedLoginAttempts=FailedLoginAttempts+1 WHERE ID=? LIMIT 1\",$UserID);\n\t}",
"public function attempts();",
"public function setNumFailures($var)\n {\n GPBUtil::checkInt32($var);\n $this->num_failures = $var;\n\n return $this;\n }",
"public function getFailedIngestCount()\n {\n return $this->failed_ingest_count;\n }",
"public function incrementStripeAttempts()\n {\n $this->stripe_attempts += 1;\n $this->save();\n }",
"public function increment()\n {\n $this->record->attempts++;\n\n return $this->record->attempts;\n }",
"public function getErrorsCount()\n {\n return $this->_errorsCount;\n }",
"public function test_if_failed_update()\n {\n }",
"public function attempts()\n {\n return $this->job->getDeliveryCount();\n }",
"function resubmitFailures() {\n\tglobal $gStatusTable, $gErrBase;\n\t$cmd = \"update $gStatusTable set status=0, wptid='', wptRetCode='', medianRun=0 where status >= $gErrBase;\";\n\tdoSimpleCommand($cmd);\n}",
"public function addFailures($failures) {\n $total = $this->getFailures()\n + $failures;\n $this->setFailures($total);\n }",
"public function incResponseCount()\n {\n $incResponse = (int) $this->attribute( 'response_count' );\n $incResponse++;\n $this->setAttribute( 'response_count', $incResponse );\n $this->store();\n }",
"protected function statusCodeFail(): int\n {\n return 401;\n }",
"public function getNumberOfErroredFiles(): int\n {\n return count($this->files->filter(function (File $file) {\n return $file->getStatus() === File::FILE_ERROR;\n }));\n }",
"public function setFailedUsersCount($val)\n {\n $this->_propDict[\"failedUsersCount\"] = intval($val);\n return $this;\n }",
"public function getErrorCount()\r\n {\r\n return sizeof($this->errors);\r\n }",
"public function fails();",
"public function fails();",
"public function getRequestsWithErrorsCount()\n {\n return $this->requests_with_errors_count;\n }",
"public function getRequestsWithErrorsCount()\n {\n return $this->requests_with_errors_count;\n }",
"public function getFailedLogins() : int\n {\n return $this->failed_logins;\n }",
"public function setFailedTasksCount($val)\n {\n $this->_propDict[\"failedTasksCount\"] = intval($val);\n return $this;\n }",
"function test_with_retries() {\n $retries = 3;\n while ($retries--) {\n if ($retries !== 0) {\n echo \"Retrying\\n\";\n }\n }\n}",
"function getTotalFaliures()\n {\n $data = [];\n $output = $this->queryData('//QueryGetTotalFailures','', $data);\n $number = $output[0]['number'];\n return $number;\n }",
"public function getSuccessful(): int\n {\n return $this->successful;\n }",
"public function getLastFailedBuildsCount()\n {\n return count($this->builds) - $this->getLastSuccessfullBuildsCount();\n }",
"public function count(): int\n {\n return count($this->violations);\n }",
"public function getErrorNo()\n {\n return curl_errno($this->ch);\n }",
"public function getErrorNumber() {\n return curl_errno($this->_getCommHandler());\n }",
"public function testGetErrorMessagesAfterValidationFailure()\n {\n $this->validator->isValid(-211);\n $this->assertCount(1, $this->validator->errors());\n }",
"public function countFailed(Task $task)\n {\n if (!$task->getId())\n {\n throw new QueueException(\"Impossible to count failures for Task '$task'.\");\n }\n\n return (int) $this->client->get(self::PREFIX.\"task:failed:{$task->getId()}\");;\n }",
"public function countAuthAttempts()\n {\n $previous = Mage::getSingleton('core/session')->getCCAttempts();\n\n if(!$previous)\n {\n $previous = 1;\n } else {\n $previous++;\n }\n\n Mage::getSingleton('core/session')->setCCAttempts($previous);\n }",
"public function attempts()\n {\n return $this->sportevent ? $this->sportevent->attempts() : 1;\n }",
"protected function statusCodeFail(): int\n {\n return $this->statusCodeFail ?? 400;\n }",
"private function setNumResults()\n\t{\n\t\t$this->numResults = (int) count($this->data);\n\t}",
"public function attempts()\n {\n return (int) ($this->job->getAttributes()['ApproximateReceiveCount'] ?? 0);\n }",
"public function isFailed()\r\n {\r\n return $this->status < 0;\r\n }",
"public function setFailed()\n {\n $this->update(['status' => static::STATUS_FAILED]);\n }",
"public function attempts()\n\t{\n\t\treturn request()->header('X-AppEngine-TaskExecutionCount');\n\t}",
"public function attempts()\n {\n if (array_key_exists('Attributes', $this->job)) {\n return (int) $this->job['Attributes']['ApproximateReceiveCount'];\n }\n\n return (int) $this->job['attributes']['ApproximateReceiveCount'];\n }",
"public function error429()\n {\n }",
"public function getFailedHookStats();",
"public function insertOrIncrementFailureCount(\\DateTime $dateTime, $username, $ipAddress, $cookieToken, Rejection $rejection=null);",
"private function failedReciept($failures) {\n $failAddress = '';\n\n if (isset($failures)):\n $failAddress = $failures[0];\n else:\n $failAddress = $failures[1];\n endif;\n\n $this->mailist->updateFailures($failAddress);\n }",
"public function failed()\n {\n // Called when the job is failing...\n }"
] | [
"0.7752025",
"0.7104863",
"0.69175553",
"0.66704667",
"0.66452307",
"0.6602998",
"0.6569537",
"0.6559374",
"0.651982",
"0.65142584",
"0.6465794",
"0.63345015",
"0.62893945",
"0.61700314",
"0.61354864",
"0.60970974",
"0.60760504",
"0.60430217",
"0.6014288",
"0.6009468",
"0.5951421",
"0.5938738",
"0.59384346",
"0.59244233",
"0.5915729",
"0.5913245",
"0.5900909",
"0.5874319",
"0.5805506",
"0.57690126",
"0.57659954",
"0.5754494",
"0.57542294",
"0.5727841",
"0.57269907",
"0.5723408",
"0.5723408",
"0.57179815",
"0.5717421",
"0.5710233",
"0.5697265",
"0.5692951",
"0.56911695",
"0.56754875",
"0.5665338",
"0.563545",
"0.5622307",
"0.56167746",
"0.56151384",
"0.56151384",
"0.5601927",
"0.5600802",
"0.5588525",
"0.5568097",
"0.5554466",
"0.5537441",
"0.553307",
"0.5532611",
"0.5532188",
"0.55272526",
"0.55254793",
"0.5520768",
"0.55152804",
"0.5513386",
"0.551074",
"0.55033183",
"0.5503209",
"0.54952306",
"0.54926246",
"0.5492369",
"0.5481896",
"0.547302",
"0.547302",
"0.5468513",
"0.5468513",
"0.54684895",
"0.54555386",
"0.5452363",
"0.54491377",
"0.5442618",
"0.54413635",
"0.54388356",
"0.5417933",
"0.5413744",
"0.5412787",
"0.54119",
"0.54003483",
"0.5398893",
"0.5394682",
"0.5379049",
"0.5375681",
"0.53752774",
"0.5372107",
"0.5371357",
"0.53546417",
"0.5319772",
"0.5316606",
"0.53133166",
"0.5313109",
"0.5307988"
] | 0.6836392 | 3 |
Display a listing of the resource. | public function home(Request $request)
{
$post = Page::with('sections', 'sliders')->where('code', 'home')->first();
$news = Post::latest()->take(5)->get();
$events = Event::latest()->take(5)->get();
return view('index', compact('post', 'news', 'events'));
} | {
"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 a listing of the resource. | public function msg_from_dg(Request $request)
{
$post = Page::with('sections', 'sliders')->where('code', 'msg_from_dg')->first();
return view('msg_from_dg', compact('post'));
} | {
"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 a listing of the resource. | public function institutional_presentation(Request $request)
{
$post = Page::with('sections', 'sliders')->where('code', 'institutional_presentation')->first();
return view('institutional_presentation', compact('post'));
} | {
"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 a listing of the resource. | public function org_chart(Request $request)
{
$post = Page::with('sections', 'sliders')->where('code', 'org_chart')->first();
return view('org_chart', compact('post'));
} | {
"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 a listing of the resource. | public function mission_vision_values(Request $request)
{
$post = Page::with('sections', 'sliders')->where('code', 'mission_vision_values')->first();
return view('mission_vision_values', compact('post'));
} | {
"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 a listing of the resource. | public function history(Request $request)
{
$post = Page::with('sections', 'sliders')->where('code', 'history')->first();
return view('history', compact('post'));
} | {
"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 a listing of the resource. | public function infrastructure(Request $request)
{
$post = Page::with('sections', 'sliders')->where('code', 'infrastructure')->first();
return view('infrastructure', compact('post'));
} | {
"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 a listing of the resource. | public function legislation(Request $request)
{
$post = Page::with('sections', 'sliders')->where('code', 'legislation')->first();
return view('legislation', compact('post'));
} | {
"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 a listing of the resource. | public function aggr_protocols(Request $request)
{
$post = Page::with('sections', 'sliders')->where('code', 'aggr_protocols')->first();
$partnerships = collect(Partnership::with('category')->get())->map(function($item){
return [
'id' => $item->id,
'name' => $item->name,
'description' => $item->descriptipn,
'category' => $item->category->name,
'img' => $item->getFirstMediaUrl('featured_image'),
'link' => $item->link
];
})->groupBy('category')->all();
return view('aggr_protocols', compact('post', 'partnerships'));
} | {
"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 a listing of the resource. | public function social_wellfare(Request $request)
{
$post = Page::with('sections', 'sliders')->where('code', 'social_wellfare')->first();
return view('social_wellfare', compact('post'));
} | {
"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 a listing of the resource. | public function social_support(Request $request)
{
$post = Page::with('sections', 'sliders')->where('code', 'social_support')->first();
return view('social_support', compact('post'));
} | {
"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 a listing of the resource. | public function extracurricular_activities(Request $request)
{
$post = Page::with('sections', 'sliders')->where('code', 'extracurricular_activities')->first();
return view('extracurricular_activities', compact('post'));
} | {
"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 a listing of the resource. | public function health(Request $request)
{
$post = Page::with('sections', 'sliders')->where('code', 'health')->first();
return view('health', compact('post'));
} | {
"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 a listing of the resource. | public function acad_calendar(Request $request)
{
$post = Page::with('sections', 'sliders')->where('code', 'acad_calendar')->first();
return view('acad_calendar', compact('post'));
} | {
"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 a listing of the resource. | public function regulations(Request $request)
{
$post = Page::with('sections', 'sliders')->where('code', 'regulations')->first();
return view('regulations', compact('post'));
} | {
"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 a listing of the resource. | public function edicts(Request $request)
{
$post = Page::with('sections', 'sliders')->where('code', 'edicts')->first();
return view('edicts', compact('post'));
} | {
"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 a listing of the resource. | public function student_mobility(Request $request)
{
$post = Page::with('sections', 'sliders')->where('code', 'student_mobility')->first();
return view('student_mobility', compact('post'));
} | {
"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 a listing of the resource. | public function education_det(Request $request)
{
$post = Page::with('sections', 'sliders')->where('code', 'education_det')->first();
return view('education_det', compact('post'));
} | {
"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 a listing of the resource. | public function education_dgc(Request $request)
{
$post = Page::with('sections', 'sliders')->where('code', 'education_dgc')->first();
return view('education_dgc', compact('post'));
} | {
"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 a listing of the resource. | public function education_teachers(Request $request)
{
$post = Page::with('sections', 'sliders')->where('code', 'education_teachers')->first();
return view('education_teachers', compact('post'));
} | {
"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 a listing of the resource. | public function education_library_presentation(Request $request)
{
$post = Page::with('sections', 'sliders')->where('code', 'education_library_presentation')->first();
return view('education_library_presentation', compact('post'));
} | {
"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 a listing of the resource. | public function education_library_rules(Request $request)
{
$post = Page::with('sections', 'sliders')->where('code', 'education_library_rules')->first();
return view('education_library_rules', compact('post'));
} | {
"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 a listing of the resource. | public function scientific_research_aasr_center(Request $request)
{
$post = Page::with('sections', 'sliders')->where('code', 'scientific_research_aasr_center')->first();
return view('scientific_research_aasr_center', compact('post'));
} | {
"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 a listing of the resource. | public function scientific_research_lec_cycles(Request $request)
{
$post = Page::with('sections', 'sliders')->where('code', 'scientific_research_lec_cycles')->first();
return view('scientific_research_lec_cycles', compact('post'));
} | {
"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 a listing of the resource. | public function scientific_research_innovation_award(Request $request)
{
$post = Page::with('sections', 'sliders')->where('code', 'scientific_research_innovation_award')->first();
return view('scientific_research_innovation_award', compact('post'));
} | {
"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 a listing of the resource. | public function scientific_research_events(Request $request)
{
$post = Page::with('sections', 'sliders')->where('code', 'scientific_research_events')->first();
return view('scientific_research_events', compact('post'));
} | {
"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 a listing of the resource. | public function scientific_research_project_guide(Request $request)
{
$post = Page::with('sections', 'sliders')->where('code', 'scientific_research_project_guide')->first();
return view('scientific_research_project_guide', compact('post'));
} | {
"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 a listing of the resource. | public function scientific_research_policy(Request $request)
{
$post = Page::with('sections', 'sliders')->where('code', 'scientific_research_policy')->first();
return view('scientific_research_policy', compact('post'));
} | {
"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 a listing of the resource. | public function extension_services_policy(Request $request)
{
$post = Page::with('sections', 'sliders')->where('code', 'extension_services_policy')->first();
return view('extension_services_policy', compact('post'));
} | {
"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 a listing of the resource. | public function extension_services_trans_knowledge(Request $request)
{
$post = Page::with('sections', 'sliders')->where('code', 'extension_services_trans_knowledge')->first();
return view('extension_services_trans_knowledge', compact('post'));
} | {
"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 a listing of the resource. | public function extension_services_non_curricular_internships(Request $request)
{
$post = Page::with('sections', 'sliders')->where('code', 'extension_services_non_curricular_internships')->first();
return view('extension_services_non_curricular_internships', compact('post'));
} | {
"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 a listing of the resource. | public function extension_services_entrepreneurship_program(Request $request)
{
$post = Page::with('sections', 'sliders')->where('code', 'extension_services_entrepreneurship_program')->first();
return view('extension_services_entrepreneurship_program', compact('post'));
} | {
"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 a listing of the resource. | public function extension_services_olympiads(Request $request)
{
$post = Page::with('sections', 'sliders')->where('code', 'extension_services_olympiads')->first();
return view('extension_services_olympiads', compact('post'));
} | {
"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 a listing of the resource. | public function extension_services_employment_careers(Request $request)
{
$post = Page::with('sections', 'sliders')->where('code', 'extension_services_employment_careers')->first();
return view('extension_services_employment_careers', compact('post'));
} | {
"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 a listing of the resource. | public function extension_services_ltc(Request $request)
{
$post = Page::with('sections', 'sliders')->where('code', 'extension_services_ltc')->first();
return view('extension_services_ltc', compact('post'));
} | {
"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 a listing of the resource. | public function extension_services_cu_program(Request $request)
{
$post = Page::with('sections', 'sliders')->where('code', 'extension_services_cu_program')->first();
return view('extension_services_cu_program', compact('post'));
} | {
"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 a listing of the resource. | public function isptecmedia(Request $request)
{
$posts = ISPTECMedia::filter($request->only('search'))
->latest()
->paginate(5)->withQueryString();
$latest_posts = ISPTECMedia::latest()->take(5)->get();
return view('isptecmedia', compact('posts', 'latest_posts'));
} | {
"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 |
Store a newly created resource in storage. j | public function storesubmitedcontent(Request $request)
{
DB::transaction(function () use ($request) {
$contentsubmission = ContentSubmission::create([
'title' => $request->title,
'category' => $request->category,
'name' => $request->name,
'email' => $request->email,
'contact' => $request->contact,
'description_pt' => $request->description_pt,
'description_en' => $request->description_en,
'obs' => $request->obs,
]);
// Add Possible Featured Image
if(isset($request->featured_image)){
$fileAdders = $contentsubmission
->addMultipleMediaFromRequest(['featured_image'])
->each(function ($fileAdder) {
$fileAdder->toMediaCollection('featured_image');
});
}
// Add Possible Documets
if(isset($request->documents)){
$fileAdders = $contentsubmission
->addMultipleMediaFromRequest(['documents'])
->each(function ($fileAdder) {
$fileAdder->toMediaCollection('documents');
});
}
});
return back();
} | {
"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 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()\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}",
"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.7178853",
"0.67819184",
"0.6687476",
"0.66094834",
"0.6596175",
"0.6549892",
"0.6526514",
"0.6526514",
"0.6526514",
"0.6507489",
"0.6507489",
"0.6507489",
"0.6507489",
"0.6507489",
"0.6507489",
"0.6507489",
"0.6507489",
"0.6507489",
"0.6507489",
"0.6507489",
"0.6507489",
"0.6507489",
"0.6507489",
"0.6507489",
"0.6507489",
"0.6507489",
"0.6507489",
"0.6507489",
"0.6507489",
"0.6507489",
"0.6507489",
"0.6507489",
"0.6507489",
"0.6507489",
"0.6507489",
"0.6507489",
"0.6507489",
"0.6507489",
"0.6507489",
"0.6507489",
"0.6507489",
"0.6507489",
"0.6507489",
"0.6507489",
"0.6507489",
"0.6507489",
"0.6507489",
"0.6507489",
"0.6507489",
"0.6507489",
"0.6507489",
"0.6507489",
"0.6507489",
"0.6507489",
"0.6507489",
"0.6507489",
"0.6507489",
"0.6507489",
"0.6507489",
"0.6507489",
"0.6507489",
"0.6507489",
"0.6507489",
"0.6507489",
"0.6507489",
"0.6507489",
"0.6507489",
"0.6507489",
"0.6507489",
"0.6507489",
"0.6507489",
"0.6507489",
"0.6507489",
"0.6507489",
"0.6507489",
"0.6507489",
"0.6507489",
"0.6507489",
"0.6507489",
"0.6507489",
"0.6507489",
"0.6507489",
"0.6507489",
"0.6507489",
"0.6507489",
"0.6507489",
"0.6507489",
"0.6507489",
"0.6507489",
"0.6507489",
"0.6507489",
"0.6507489",
"0.6507489",
"0.6507489",
"0.6507489",
"0.6507489",
"0.6507489",
"0.6507489",
"0.6507489",
"0.6507489",
"0.6507489"
] | 0.0 | -1 |
This class can be added as child only to Streamwide_Introspection_Method which doesn't set itself as a parent of the child, meaning that an instance of this class will never have a parent | public function setParent( Streamwide_Introspection_Composite_Interface $parent )
{
return null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function __construct($parent) {\r\n parent::__construct($parent, 'invoke');\r\n }",
"public function __construct()\n {\n //to be extended by children\n }",
"protected function processParent(IReflection $parent, Stream $tokenStream)\n\t{\n\t\t// To be defined in child classes\n\t\treturn $this;\n\t}",
"abstract public function inherit($parent);",
"protected function __construct( &$_parent ) {\n\t\t$this -> parent\t=&\t$_parent;\n\t}",
"function preflight( $type, $parent )\n\t{\n\t}",
"public function parent() { }",
"function runkit_class_adopt($classname, $parentname)\n{\n}",
"function __construct() {\r\n parent ::__construct();\r\n }",
"function __construct(){parent::__construct();}",
"public function __construct()\n {\n // Hide the parent arguments from the public signature\n parent::__construct();\n }",
"public function __construct(){parent::__construct();}",
"public function _onAdd($parent) {\r\n\t\t/* Intentionally empty */\r\n\t}",
"public function getParentClass() {}",
"abstract public function parent();",
"public function abc(){\r\n\t\techo 'abc method from child class';\r\n\t}",
"protected function _ensureInheritedAttributes() {}",
"function __construct(self $parent = null)\n {\n $parent || $parent = __CLASS__ === get_class($this) ? $this : new self;\n\n $this->serviceName || $this->serviceName = get_class($this);\n $this->dependencies = (array) $this->dependencies;\n $this->parent = $parent;\n\n $php_version_id = $this->targetPhpVersionId;\n\n // Link shared properties of $parent and $this by reference\n\n if ($parent !== $this)\n {\n $v = array(\n 'index',\n 'tokens',\n 'types',\n 'texts',\n 'line',\n 'inString',\n 'prevType',\n 'penuType',\n 'headParser',\n 'tokenRegistry',\n 'parents',\n 'errors',\n 'nextRegistryIndex',\n 'targetEol',\n 'targetPhpVersionId',\n );\n\n foreach ($v as $v) $this->$v =& $parent->$v;\n }\n else\n {\n $this->nextRegistryIndex = -1 - PHP_INT_MAX;\n $this->targetPhpVersionId = PHP_VERSION_ID;\n }\n\n // Verify and set $this->dependencies to the (serviceName => service provider object) map\n\n foreach ($this->dependencies as $k => $v)\n {\n unset($this->dependencies[$k]);\n\n if (is_string($k))\n {\n $c = (array) $v;\n $v = $k;\n }\n else $c = array();\n\n $k = strtolower('\\\\' !== $v[0] ? __CLASS__ . '\\\\' . $v : substr($v, 1));\n\n if (!isset($this->parents[$k]))\n {\n throw new \\Exception(get_class($this) . \" failed dependency: {$v}\", E_USER_WARNING);\n }\n\n $parent = $this->dependencies[$v] = $this->parents[$k];\n\n foreach ($c as $c => $k)\n {\n is_int($c) and $c = $k;\n\n if (!property_exists($parent, $c)) user_error(get_class($this) . \" undefined parent property: {$v}->{$c}\", E_USER_WARNING);\n if (!property_exists($this, $k)) user_error(get_class($this) . \" undefined property: \\$this->{$k}\", E_USER_NOTICE);\n\n $this->$k =& $parent->$c;\n }\n }\n\n // Keep track of parents chained parsers\n\n $k = strtolower($this->serviceName);\n $this->parents[$k] = $this;\n\n // Keep parsers chaining order for callbacks ordering\n\n $this->registryIndex = $this->nextRegistryIndex;\n $this->nextRegistryIndex += 1 << (PHP_INT_SIZE << 2);\n\n if ( 0 > $php_version_id\n ? $this->targetPhpVersionId < -$php_version_id\n : $this->targetPhpVersionId >= $php_version_id )\n {\n $this->register($this->callbacks);\n }\n }",
"public function __contruct(){\r\n parent::__contruct();\r\n }",
"protected function __init__() { }",
"public function parent()\n {\n }",
"function __construct()\n\t{\n\t\tparent::__construct();\n\t\t$this->__resTraitConstruct();\n\t}",
"function parentfunc($paramie)\n {\n return new myclass;\n }",
"public function _construct(){\n parent::_construct();\n }",
"public function __construct()\n {\n $this->extendableConstruct();\n }",
"public function __construct( $parent ) {\n\n\t\t\t$this->parent = $parent;\n\n\t\t\tif ( empty( $this->extension_dir ) ) {\n\t\t\t\t$this->_extension_dir = trailingslashit( str_replace( '\\\\', '/', dirname( __FILE__ ) ) );\n\t\t\t\t$this->_extension_url = site_url( str_replace( trailingslashit( str_replace( '\\\\', '/', ABSPATH ) ), '', $this->_extension_dir ) );\n\t\t\t}\n\n\t\t\t// Allow users to extend if they want\n\t\t\tdo_action( 'redux/search/' . $parent->args['opt_name'] . '/construct' );\n\n\t\t\tglobal $pagenow;\n\t\t\tif ( isset( $_GET['page'] ) && $_GET['page'] && $_GET['page'] == $this->parent->args['page_slug'] ) {\n\t\t\t\tadd_action( 'admin_enqueue_scripts', array( $this, '_enqueue' ), 0 );\n\t\t\t}\n\n\t\t\tadd_action( \"redux/metaboxes/{$this->parent->args['opt_name']}/enqueue\", array( $this, '_enqueue' ), 10 );\n\n\t\t}",
"public function _construct()\n {\n parent::_construct();\n }",
"protected function childLoad() {}",
"function __Construct()\n {\n parent::__Construct();\n }",
"public function __construct()\n\t{\n\t\t// Initialize reflectionClass with information about the target class\n\t\t$this->reflectionClass = new \\ReflectionClass($this);\n\t}",
"public function testParentWithPrivatePropertyMapping(): void\n {\n }",
"public function __construct()\n {\n parent::__construct('callable');\n }",
"public function __construct($childPolicy) { }",
"public function onBeforeWrite()\n {\n parent::onBeforeWrite();\n if (isset($_REQUEST[\"ParentID\"])) {\n $this->ParentID = $_REQUEST[\"ParentID\"];\n }\n if (isset($_REQUEST['SubClass']) && ClassInfo::exists($_REQUEST['SubClass'])) {\n $this->setClassName($_REQUEST['SubClass']);\n }\n }",
"public function preflight($type, $parent)\n {\n }",
"public function init() {\n\t\t// Overwrite/Extend in Sub-classes do not add anything here!\n\t\t// Use __constructor() or another method in __constructor().\n\t}",
"public function handledClass();",
"protected function parentSetup() {\n }",
"protected function makeWrapper()\n {\n parent::makeWrapper();\n }",
"protected function __construct(){\n\t\t\tparent::__construct();\n\t\t}",
"function addParentClass($accessModifier, $parentClassName) {\n\t\t$this->parentClassName[$parentClassName] = array(\"modifier\" => $accessModifier, \"name\" => $parentClassName);\n\t}",
"function __construct(){\n parent::__construct();\n \t \t\n }",
"public function __construct() {\n\n\t\tparent::__construct();\n\t\t\n\t}",
"protected function fixSelf() {}",
"protected function fixSelf() {}",
"function __construct() {\n\t\tparent::__construct();\n\t\t\n\t}",
"public function __construct() {\n\t\n\t\tparent::__construct();\n\t}",
"abstract protected function setMethod();",
"public function testExtendingOwnClass()\n {\n // It is actually possible to have a type which extends itself. This is caused by the poor understanding of PHP\n // namespaces. Two types with the same name but in different namespaces will have the same identifier.\n $config = new Config([\n 'inputFile' => null,\n 'outputDir' => null,\n ]);\n\n $type = new ComplexType($config, 'ExtendOwn');\n $type->setBaseType($type);\n\n $this->generateClass($type);\n\n $object = new \\ExtendOwn();\n $class = new \\ReflectionClass($object);\n $this->assertEmpty($class->getParentClass());\n }",
"public function preflight($type, $parent)\n\t{\n\t}",
"function __construct() {\n\t\t\tparent::__construct();\n\t\t}",
"function __construct() {\n\t\t\tparent::__construct();\n\t\t}",
"function __construct($noun, $parent = null, $link = RESTASSURED_ROOT) {\n\t\t$this->noun = $noun;\n\t\t$this->reflection = new ReflectionClass($noun);\n\n\t\t// Store the parent & link from parent to here, used to get URL & ID)\n\t\t$this->parent = $parent;\n\t\t$this->link = $link;\n\n\t\t// Parse the main class block\n\t\t$this->classBlock = RESTDocblockParser::parse($this->reflection);\n\t\t\n\t\t// Parse the method blocks\n\t\t$this->methodBlocks = array();\n\t\tforeach ($this->getPropertyMethodReflections() as $name => $methodReflection) {\n\t\t\t$this->methodBlocks[$name] = RESTDocblockParser::parse($methodReflection);\n\t\t}\n\n\t\tparent::__construct();\n\t}",
"protected function __construct()\n\t{\n\t\tparent::__construct();\n\t}",
"public function hasParent()\n {\n }",
"function __construct() {\n\t\tparent::__construct();\n\t\techo \"<p>Die Konstruktormethode der Subklasse wurde abgearbeitet.</p>\";\n\t}",
"public function __contruct()\n {\n parent::__construct();\n }",
"public function __construct( $parent ) {\n\n\t\t\t$this->parent = $parent;\n\t\t\tif ( empty( $this->extension_dir ) ) {\n\t\t\t\t$this->extension_dir = trailingslashit( str_replace( '\\\\', '/', dirname( __FILE__ ) ) );\n\t\t\t}\n\t\t\t$this->field_name = 'license';\n\n\t\t\tself::$theInstance = $this;\n\n\t\t\tadd_filter( 'redux/' . $this->parent->args['opt_name'] . '/field/class/' . $this->field_name, array(\n\t\t\t\t&$this,\n\t\t\t\t'overload_field_path',\n\t\t\t) );\n\n\t\t\tadd_action( 'wp_ajax_wowmall_activate_license', array(\n\t\t\t\t$this,\n\t\t\t\t'wowmall_activate_license',\n\t\t\t) );\n\t\t}",
"function __construct() {\n\t\tparent::__construct();\n\t}",
"function __construct() {\n\t\tparent::__construct();\n\t}",
"function __construct() {\n\t\tparent::__construct();\n\t}",
"function __construct() {\n\t\tparent::__construct();\n\t}",
"function __construct() {\n\t\tparent::__construct();\n\t}",
"function __construct() {\n\t\tparent::__construct();\n\t}",
"public function __construct(){\n\t\t/* calling parent construct */\n\t\tparent::__construct();\n\t}",
"public function __construct(){\n\t\t/* calling parent construct */\n\t\tparent::__construct();\n\t}",
"public function __construct() {\n\t\t\tparent::__construct();\n\t\t}",
"public function __construct() {\n\t\t\tparent::__construct();\n\t\t}",
"public function __construct() {\n\t\t\tparent::__construct();\n\t\t}",
"public function __construct() {\n\t\t\tparent::__construct();\n\t\t}",
"public function __construct() {\r\n\t\tparent::__construct();\r\n\t}",
"public function __construct() {\r\n\t\tparent::__construct();\r\n\t}",
"public function onInheritanceFromRequest($req) {\n\t}",
"protected function retrieveParent()\n {\n }",
"public function __construct() {\n\t\tparent::__construct();\n\t}",
"public function __construct() {\n\t\tparent::__construct();\n\t}",
"public function __construct() {\n\t\tparent::__construct();\n\t}",
"public function __construct() {\n\t\tparent::__construct();\n\t}",
"public function __construct() {\n\t\tparent::__construct();\n\t}",
"public function __construct() {\n\t\tparent::__construct();\n\t}",
"public function __construct() {\n\t\tparent::__construct();\n\t}",
"public function __construct() {\n\t\tparent::__construct();\n\t}",
"public function __construct() {\n\t\tparent::__construct();\n\t}",
"public function __construct() {\n\t\tparent::__construct();\n\t}",
"public function __construct() {\n\t\tparent::__construct();\n\t}",
"public function __construct() {\n\t\tparent::__construct();\n\t}",
"public function __construct() {\n\t\tparent::__construct();\n\t}",
"public function __construct() {\n\t\tparent::__construct();\n\t}",
"public function __construct() {\n\t\tparent::__construct();\n\t}",
"public function __construct() {\n\t\tparent::__construct();\n\t}",
"public function __construct() {\n\t\tparent::__construct();\n\t}",
"public function __construct() {\n\t\tparent::__construct();\n\t}",
"public function __construct() {\n\t\tparent::__construct();\n\t}",
"public function __construct()\n {\n $fullClassName = explode('\\\\', get_class($this));\n $this->type = (string)array_pop($fullClassName);\n }",
"function __construct(){\n\t\t\n\t\tparent::__construct();\n\t\t\n\t}",
"public function __construct(){\n\t\n\t\tparent::__construct();\n\t}",
"protected function __construct() {\n // contain shared code in its constructor\n parent::__construct();\n }",
"public function withAccessCheck(): self\n {\n // @see https://phpstan.org/developing-extensions/backward-compatibility-promise\n // @phpstan-ignore-next-line\n $type = new static(\n $this->getClassName(),\n $this->getSubtractedType(),\n $this->getClassReflection()\n );\n $type->hasAccessCheck = true;\n $type->isCount = $this->isCount;\n return $type;\n }",
"public function __construct() {\r\n\t\tparent::__construct();\t\t\r\n\t}",
"function _deprecated_constructor($class_name, $version, $parent_class = '')\n {\n }"
] | [
"0.6595307",
"0.59433913",
"0.5877253",
"0.5862638",
"0.56591415",
"0.56152594",
"0.560291",
"0.5589412",
"0.5583067",
"0.5582157",
"0.5521054",
"0.55173177",
"0.5515445",
"0.5513885",
"0.5489359",
"0.547169",
"0.54481554",
"0.54134643",
"0.5397555",
"0.5385925",
"0.53722125",
"0.5350263",
"0.5314706",
"0.529169",
"0.52901256",
"0.5266251",
"0.5263438",
"0.5242741",
"0.52396524",
"0.52232397",
"0.5211458",
"0.5183336",
"0.5171433",
"0.5161413",
"0.5157992",
"0.5156045",
"0.5129715",
"0.5127655",
"0.51198006",
"0.5114754",
"0.5114103",
"0.51094174",
"0.5104125",
"0.5101047",
"0.5101047",
"0.5090682",
"0.5088994",
"0.5083878",
"0.50835454",
"0.507944",
"0.507884",
"0.507884",
"0.5076729",
"0.5074402",
"0.50698656",
"0.50684196",
"0.5055034",
"0.50522256",
"0.5051548",
"0.5051548",
"0.5051548",
"0.5051548",
"0.5051548",
"0.5051548",
"0.50369215",
"0.50369215",
"0.50362545",
"0.50362545",
"0.50362545",
"0.50362545",
"0.50293064",
"0.50293064",
"0.50238836",
"0.5022117",
"0.5021826",
"0.5021826",
"0.5021826",
"0.5021826",
"0.5021826",
"0.5021826",
"0.5021826",
"0.5021826",
"0.5021826",
"0.5021826",
"0.5021826",
"0.5021826",
"0.5021826",
"0.5021826",
"0.5021826",
"0.5021826",
"0.5021826",
"0.5021826",
"0.5021826",
"0.50215274",
"0.5021217",
"0.50196993",
"0.501574",
"0.501305",
"0.5002983",
"0.49996153"
] | 0.5064934 | 56 |
An instance of this class cannot be a method parameter, return value or error | public function setType( $type )
{
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function method()\n {\n\n }",
"public function method() {\n\t}",
"public function create()\n {\n throw new NotImplementedException();\n }",
"public function method();",
"public function method();",
"public function method();",
"public function method();",
"public function ex4()\n {\n }",
"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()\r\n {}",
"public function __invoke()\n {\n }",
"public function someStuff()\n {\n \n }",
"final private function __construct() {}",
"final private function __construct() {}",
"private function __construct () {}",
"final private function __construct() { }",
"final private function __construct() { }",
"final private function __construct() { }",
"public function __construct (){}",
"protected function __construct(){}",
"protected function __construct(){}",
"protected 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() {}",
"private function __construct() {}",
"private function __construct(){ }",
"private function __construct(){ }",
"private function __construct() { }",
"private function __construct() { }"
] | [
"0.66836953",
"0.6483904",
"0.6455636",
"0.63999355",
"0.63999355",
"0.63999355",
"0.63999355",
"0.63067335",
"0.62954026",
"0.62954026",
"0.62954026",
"0.62954026",
"0.62954026",
"0.62954026",
"0.62954026",
"0.62954026",
"0.62954026",
"0.62954026",
"0.62954026",
"0.62954026",
"0.62954026",
"0.62954026",
"0.62954026",
"0.62954026",
"0.62954026",
"0.6268669",
"0.6231855",
"0.6225906",
"0.62053096",
"0.62053096",
"0.6168832",
"0.61688185",
"0.61688185",
"0.61688185",
"0.6155281",
"0.6150159",
"0.6150159",
"0.6150159",
"0.6146599",
"0.6146599",
"0.6146599",
"0.6146599",
"0.6146599",
"0.6146599",
"0.6146599",
"0.6146599",
"0.6146599",
"0.6146599",
"0.6146599",
"0.6146599",
"0.6146599",
"0.6146599",
"0.6146599",
"0.6146599",
"0.6146599",
"0.6146599",
"0.6146599",
"0.6146599",
"0.6146599",
"0.6146599",
"0.6146599",
"0.6146599",
"0.6146599",
"0.6146599",
"0.6146599",
"0.6146599",
"0.6146599",
"0.6146599",
"0.6146599",
"0.6146599",
"0.6146599",
"0.6146599",
"0.6146599",
"0.6146599",
"0.6146599",
"0.6146599",
"0.6146599",
"0.6146599",
"0.6146599",
"0.6146599",
"0.6146599",
"0.6146599",
"0.6146599",
"0.6146599",
"0.6146599",
"0.6146599",
"0.6146599",
"0.6146599",
"0.6146599",
"0.6146599",
"0.6146599",
"0.6146599",
"0.6146599",
"0.6146599",
"0.6144296",
"0.6142361",
"0.6142361",
"0.6131982",
"0.6131982",
"0.61289614",
"0.61289614"
] | 0.0 | -1 |
Construct the parent class | function __construct()
{
parent::__construct();
$this->load->model('user_model');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function __construct() {\r\n parent ::__construct();\r\n }",
"function __construct(){parent::__construct();}",
"public function construct()\n\t\t{\n\t\t}",
"protected abstract function __construct();",
"public function __construct(){\n\t\t/* calling parent construct */\n\t\tparent::__construct();\n\t}",
"public function __construct(){\n\t\t/* calling parent construct */\n\t\tparent::__construct();\n\t}",
"public function _construct()\n {\n parent::_construct();\n }",
"public function __contruct(){\r\n parent::__contruct();\r\n }",
"public function __construct(){parent::__construct();}",
"protected function __construct( &$_parent ) {\n\t\t$this -> parent\t=&\t$_parent;\n\t}",
"function _construct() {\n\t\tparent::_construct();\n\t}",
"public function __contruct()\n {\n parent::__construct();\n }",
"public function __construct()\n {\n //to be extended by children\n }",
"protected function construct(){\n\n }",
"public function __construct()\r\n\t{\r\n\t\t// Call the parent class constructor\r\n\t\tparent::__construct();\r\n\t}",
"public function __construct() {\n\n\t\tparent::__construct();\n\t\t\n\t}",
"function __Construct()\n {\n parent::__Construct();\n }",
"abstract protected function __construct();",
"public function construct() {\n\n }",
"public function __construct()\n\t {\n\t parent::__construct();\n\t }",
"public function __construct($parent) {\r\n parent::__construct($parent, 'invoke');\r\n }",
"function __construct(){\n\t\t// Call parent constructor\n\t\tparent::__construct();\n\t}",
"public function _construct(){\n parent::_construct();\n }",
"public function __construct() {\n\t\t\tparent::__construct();\n\t\t}",
"public function __construct() {\n\t\t\tparent::__construct();\n\t\t}",
"public function __construct() {\n\t\t\tparent::__construct();\n\t\t}",
"public function __construct() {\n\t\t\tparent::__construct();\n\t\t}",
"function __construct() {\n\t\tparent::__construct();\n\t\t\n\t}",
"function __construct() {\n\t\t\tparent::__construct();\n\t\t}",
"function __construct() {\n\t\t\tparent::__construct();\n\t\t}",
"abstract function __construct();",
"public function __contruct()\n {\n parent::__construct();\n\n }",
"function __construct(){\n\t\t\n\t\tparent::__construct();\n\t\t\n\t}",
"public function __construct()\n\t {\n\t\t parent::__construct();\n\t }",
"public function __construct()\n\t{\n\t parent::__construct();\n\t}",
"public function __construct()\n\t{\n\t\tparent::__construct();\n\t\t// ben duoi nay se la cac logic cua __construct lop con ma chung ta can dinh nghia - xu ly\n\t}",
"abstract public function __construct();",
"abstract public function __construct();",
"abstract public function __construct();",
"function __construct() {\n\t\t\tparent::__construct();\n\t\t\t\n\t\t}",
"public function __construct()\n\t{\n\t parent::__construct();\n\t}",
"public function __construct()\n\t{\n\t parent::__construct();\n\t}",
"public function __construct()\n\t\t{\n\t\t\tparent::__construct();\n\t\t}",
"public function __construct()\n\t\t{\n\t\t\tparent::__construct();\n\t\t}",
"public function __construct()\n\t\t{\n\t\t\tparent::__construct();\n\t\t}",
"public function __construct() {\n\t\tparent::__construct();\n\t}",
"public function __construct() {\n\t\tparent::__construct();\n\t}",
"public function __construct() {\n\t\tparent::__construct();\n\t}",
"public function __construct() {\n\t\tparent::__construct();\n\t}",
"public function __construct() {\n\t\tparent::__construct();\n\t}",
"public function __construct() {\n\t\tparent::__construct();\n\t}",
"public function __construct() {\n\t\tparent::__construct();\n\t}",
"public function __construct() {\n\t\tparent::__construct();\n\t}",
"public function __construct() {\n\t\tparent::__construct();\n\t}",
"public function __construct() {\n\t\tparent::__construct();\n\t}",
"public function __construct() {\n\t\tparent::__construct();\n\t}",
"public function __construct() {\n\t\tparent::__construct();\n\t}",
"public function __construct() {\n\t\tparent::__construct();\n\t}",
"public function __construct() {\n\t\tparent::__construct();\n\t}",
"public function __construct() {\n\t\tparent::__construct();\n\t}",
"public function __construct() {\n\t\tparent::__construct();\n\t}",
"public function __construct() {\n\t\tparent::__construct();\n\t}",
"public function __construct() {\n\t\tparent::__construct();\n\t}",
"public function __construct() {\n\t\tparent::__construct();\n\t}",
"public function __construct()\n\t\t{\n\t\t\tparent::__construct();\n }",
"public function __construct() {\r\n\t\tparent::__construct();\r\n\t}",
"public function __construct() {\r\n\t\tparent::__construct();\r\n\t}",
"function __construct() {\n\t\tparent::__construct();\n\t}",
"function __construct() {\n\t\tparent::__construct();\n\t}",
"function __construct() {\n\t\tparent::__construct();\n\t}",
"function __construct() {\n\t\tparent::__construct();\n\t}",
"function __construct() {\n\t\tparent::__construct();\n\t}",
"function __construct() {\n\t\tparent::__construct();\n\t}",
"function __construct() \n\t\t{\n\t\t\tparent::__construct();\n\t\t}",
"public function __construct () {\n\t\tparent::__construct();\n\t}",
"function _construct() {\n \t\n\t\t\n\t}",
"protected function __construct() {\n // contain shared code in its constructor\n parent::__construct();\n }",
"protected function __construct(){\n\t\t\tparent::__construct();\n\t\t}",
"public function __construct()\n\t{\n\t\t// DO NOT! call parent::__construct(); as otherwise we will end up having references in this class.\n\t}",
"function __construct() {\n\t\tparent::__construct();\n\t\t\t\n\t\t}",
"public function __construct() {\n\t\n\t\tparent::__construct();\n\t}",
"public function __construct()\n \t{\n \t\tparent::__construct();\n \t}",
"public function __construct()\n\t{\n\t\t// Make sure that parent constructor is always invoked, since that\n\t\t// is where any default values for this object are set.\n\t\tparent::__construct();\n\t}",
"public function __construct()\n\t{\n\t\t// Make sure that parent constructor is always invoked, since that\n\t\t// is where any default values for this object are set.\n\t\tparent::__construct();\n\t}",
"public function __construct()\n\t{\n\t\t// Make sure that parent constructor is always invoked, since that\n\t\t// is where any default values for this object are set.\n\t\tparent::__construct();\n\t}",
"public function __construct()\n\t{\n\t\t// Make sure that parent constructor is always invoked, since that\n\t\t// is where any default values for this object are set.\n\t\tparent::__construct();\n\t}",
"public function __construct()\n\t{\n\t\t// Make sure that parent constructor is always invoked, since that\n\t\t// is where any default values for this object are set.\n\t\tparent::__construct();\n\t}",
"public function __construct()\n\t{\n\t\t// Make sure that parent constructor is always invoked, since that\n\t\t// is where any default values for this object are set.\n\t\tparent::__construct();\n\t}",
"public function __construct()\n\t{\n\t\t// Make sure that parent constructor is always invoked, since that\n\t\t// is where any default values for this object are set.\n\t\tparent::__construct();\n\t}",
"public function __construct()\n\t{\n\t\t// Make sure that parent constructor is always invoked, since that\n\t\t// is where any default values for this object are set.\n\t\tparent::__construct();\n\t}",
"public function __construct()\n\t{\n\t\t// Make sure that parent constructor is always invoked, since that\n\t\t// is where any default values for this object are set.\n\t\tparent::__construct();\n\t}",
"public function __construct()\n\t{\n\t\t// Make sure that parent constructor is always invoked, since that\n\t\t// is where any default values for this object are set.\n\t\tparent::__construct();\n\t}",
"public function __construct()\n\t{\n\t\t// Make sure that parent constructor is always invoked, since that\n\t\t// is where any default values for this object are set.\n\t\tparent::__construct();\n\t}",
"public function __construct()\n\t{\n\t\t// Make sure that parent constructor is always invoked, since that\n\t\t// is where any default values for this object are set.\n\t\tparent::__construct();\n\t}",
"public function __construct()\n\t{\n\t\t// Make sure that parent constructor is always invoked, since that\n\t\t// is where any default values for this object are set.\n\t\tparent::__construct();\n\t}",
"public function __construct()\n {\n // Hide the parent arguments from the public signature\n parent::__construct();\n }",
"function __construct()\n\t\t {\n\t\t\t parent::__construct();\n\t\t }",
"function __construct()\n\t\t {\n\t\t\t parent::__construct();\n\t\t }",
"protected function __construct() {\n parent::__construct();\n\t\t\n }",
"protected function __construct() {\n parent::__construct();\n\t\t\n }",
"public function __construct() {\n parent::__construct(self::NAME);\n }"
] | [
"0.7643312",
"0.74787474",
"0.74146986",
"0.7409193",
"0.73898953",
"0.73898953",
"0.73697597",
"0.7348418",
"0.7304807",
"0.7286535",
"0.7263903",
"0.7253645",
"0.7250888",
"0.7242071",
"0.72346395",
"0.7217846",
"0.72123235",
"0.7200422",
"0.7196681",
"0.7184869",
"0.71745",
"0.71613914",
"0.7149229",
"0.7132446",
"0.7132446",
"0.7132446",
"0.7132446",
"0.71222734",
"0.7122214",
"0.7122214",
"0.7103648",
"0.7102965",
"0.7096499",
"0.70865417",
"0.70826495",
"0.7075455",
"0.70732486",
"0.70732486",
"0.70732486",
"0.70692796",
"0.70635456",
"0.70635456",
"0.7042854",
"0.7042854",
"0.7042854",
"0.70355606",
"0.70355606",
"0.70355606",
"0.70355606",
"0.70355606",
"0.70355606",
"0.70355606",
"0.70355606",
"0.70355606",
"0.70355606",
"0.70355606",
"0.70355606",
"0.70355606",
"0.70355606",
"0.70355606",
"0.70355606",
"0.70355606",
"0.70355606",
"0.70355606",
"0.70270646",
"0.7025666",
"0.7025666",
"0.70223665",
"0.70223665",
"0.70223665",
"0.70223665",
"0.70223665",
"0.70223665",
"0.7020645",
"0.7011912",
"0.7007605",
"0.7001674",
"0.69997156",
"0.6997652",
"0.699675",
"0.6993961",
"0.69896215",
"0.6989438",
"0.6989438",
"0.6989438",
"0.6989438",
"0.6989438",
"0.6989438",
"0.6989438",
"0.6989438",
"0.6989438",
"0.6989438",
"0.6989438",
"0.6989438",
"0.6989438",
"0.69867665",
"0.6984526",
"0.6984526",
"0.69821435",
"0.69821435",
"0.6980853"
] | 0.0 | -1 |
Users from a data store e.g. database | public function users_get()
{
// $users = [
// ['id' => 0, 'name' => 'John', 'email' => '[email protected]'],
// ['id' => 1, 'name' => 'Jim', 'email' => '[email protected]'],
// ];
$id = $this->get( 'id' );
if ( $id === null )
{
$users = $this->user_model->get();
// Check if the users data store contains users
if ( $users )
{
// Set the response and exit
$this->response( $users, 200 );
}
else
{
// Set the response and exit
$this->response( [
'status' => false,
'message' => 'No users were found'
], 404 );
}
}
else
{
$user = $this->user_model->users($id);
if ($user)
{
$this->response( $user, 200 );
}
else
{
$this->response( [
'status' => false,
'message' => 'No such user found'
], 404 );
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function user() {\r\r\r\n\t\t$this->_dao = DB_DataObject::factory('Users');\r\r\r\n\t}",
"private function get_user_data()\n {\n $sql_query = \"select * from users\";\n $users = DB::select($sql_query);\n return $users;\n }",
"public function getUsers();",
"public function getUsers();",
"public function getUsers();",
"public function findUsers();",
"public function findUsers();",
"public function users();",
"public function users();",
"public function users();",
"public function users();",
"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 }",
"abstract public function user();",
"function getUser(){\n $db=new connect();\n $select=\"select * from users\";\n return $db->getList($select);\n }",
"public function getUsers()\n\t{\t\n\t\t//Prepare the statement...\n\t\t$stmt = $this->database->prepare(\"SELECT * FROM \" . self::$table);\n\t\tif ($stmt === FALSE) {\n\t\t\tthrow new Exception($this->database->error);\n\t\t}\n\n\t\t//Execute and bind with params.\n\t\t$stmt->execute();\n\t \t\n\t $stmt->bind_result($id, $userName, $password);\n\n\t /*Iterates through result, creates and adds user(s)\n\t\t* to user catalog.\n\t\t*/\n\t while ($stmt->fetch())\n\t {\t\n\t \t$user = new User($userName, $password,$id);\n\t \t$this->userCatalog->add($user);\n\t\t}\n\n\t\treturn $this->userCatalog;\t\n\t}",
"function getUsers(){\n }",
"function getUsers(){\n }",
"public function getUsers(){\n return self::getModel(\"users\", \"*\");\n }",
"public static function getAllUsers() {\r\n // Create a User object\r\n $user = new User();\r\n // Return an array of user objects from the database, ordered by firstname\r\n return $user->getCollection([\"ORDER\" => ['firstname' => 'ASC']]);\r\n }",
"function get_users()\n {\n //Unimplemented\n }",
"function d4os_io_db_070_os_user_load_all() {\n $users = array();\n d4os_io_db_070_set_active('os_robust');\n $result = db_query(\"SELECT *, ua.FirstName AS username, ua.LastName AS lastname, ua.PrincipalID AS UUID, ua.Email AS email, CONCAT_WS(' ', FirstName, LastName) AS name FROM {UserAccounts} AS ua\");\n while ($user = db_fetch_object($result)) {\n $users[] = $user;\n }\n d4os_io_db_070_set_active('default');\n return $users;\n}",
"public function retrieveAllUsers () {\n return $this->usersDB;\n }",
"function getUser() {\n $DBA = new DatabaseInterface();\n $fields = array(0 => 'username', 1 => 'title', 2 => 'first_name', 3 => 'last_name', 4 => 'password', 5 => 'contactemail', 6 => 'contacttelephone', 7 => 'newsletter', 8 =>'pcode', 9 => 'store_owner', 10 => 'house', 11 => 'street', 12 => 'town', 13 => 'county', 14 => 'geolong', 15 => 'geolat', 16 => 'avatar', 17 => 'mobile', 18 => 'optout');\n $idfields = array(0 => 'id');\n $idvals = array(0 => $this->ID);\n $rs = $DBA->selectQuery(DBUSERTABLE, $fields, $idfields, $idvals);\n\n if (!isset($rs[2]))\n {\n while ($res = mysql_fetch_array($rs[0]))\n {\n $this->setUserVar('Username', $res['username']);\n $this->setUserVar('Title', $res['title']);\n $this->setUserVar('FirstName', $res['first_name']);\n $this->setUserVar('LastName', $res['last_name']);\n $this->setUserVar('ContactEmail', $res['contactemail']);\n $this->setUserVar('ContactTelephone', $res['contacttelephone']);\n $this->setUserVar('NewsletterSubscriber', $res['newsletter']);\n $this->setUserVar('Area', $res['pcode']);\n $this->setUserVar('StoreOwner', $res['store_owner']);\n $this->setUserVar('House', $res['house']);\n $this->setUserVar('Street', $res['street']);\n $this->setUserVar('Town', $res['town']);\n $this->setUserVar('County', $res['county']);\n $this->setUserVar('PCode', $res['pcode']);\n $this->setUserVar('Long', $res['geolong']);\n $this->setUserVar('Lat', $res['geolat']);\n $this->setUserVar('Avatar', $res['avatar']);\n $this->setUserVar('Mobile', $res['mobile']);\n $this->setUserVar('DMOptOut', $res['optout']);\n $this->formatAddress();\n $this->formatEmail();\n if ($this->Lat == '')\n {\n $this->GeoLocate();\n }\n }\n }\n }",
"function get_users()\n\t{\n\t\tglobal $db;\n\t\t\n\t\t$query = $db->query(\"SELECT * FROM users\");\n\t\t\n\t\treturn $db->results($query);\n\t}",
"public function getUsers()\n {\n $title = \"Users\";\n $view = $this->di->get(\"view\");\n $pageRender = $this->di->get(\"pageRender\");\n\n // Get all the users from db\n $users = $this->di->get(\"user\")->getAllUsers();\n\n $data = [\n //\"items\" => $book->findAll(),\n \"users\" => $users,\n ];\n\n $view->add(\"pages/users\", $data);\n //$view->add(\"blocks/footer\", $data);\n\n $pageRender->renderPage([\"title\" => $title]);\n }",
"public function readUserAuth(){\n $user = new \\Filebase\\Database([\n 'dir' => $this->getDataSource()\n ]);\n\n if ($user->has($this->username)) {\n $item = $user->get($this->username);\n $data = [\n 'result' => $item->auth,\n 'attribute' => [\n 'username' => $this->username\n ],\n 'status' => 'success',\n 'message' => 'Data found!'\n ];\n } else {\n $data = [\n 'status' => 'error',\n 'message' => 'User not found!'\n ];\n }\n return $data;\n }",
"public function user($store = null);",
"public function getAllUsers()\n {\n return \"users from mongo\";\n }",
"public function getUsers() {\n $sql = \"SELECT * from usertable\";\n foreach (parent::$this->db_connect->query($sql) as $row) {\n $dataSet[] = new user_model($row);\n }\n\n if (!empty($dataSet))\n return $dataSet;\n else\n return null;\n }",
"abstract protected function getUser();",
"protected function readUsers() {\n\t\t// get user ids\n\t\t$userIDs = array();\n\t\t$sql = \"SELECT\t\tuser_table.userID\n\t\t\tFROM\t\twcf\".WCF_N.\"_user user_table\n\t\t\t\".(isset($this->options[$this->sortField]) ? \"LEFT JOIN wcf\".WCF_N.\"_user_option_value USING (userID)\" : '').\"\n\t\t\t\".(!empty($this->sqlConditions) ? 'WHERE '.$this->sqlConditions : '').\"\n\t\t\tORDER BY\t\".(($this->sortField != 'email' && isset($this->options[$this->sortField])) ? 'userOption'.$this->options[$this->sortField]['optionID'] : $this->sortField).\" \".$this->sortOrder;\n\t\t$result = WCF::getDB()->sendQuery($sql, $this->itemsPerPage, ($this->pageNo - 1) * $this->itemsPerPage);\n\t\twhile ($row = WCF::getDB()->fetchArray($result)) {\n\t\t\t$userIDs[] = $row['userID'];\n\t\t}\n\n\t\t// get user data\n\t\tif (count($userIDs)) {\n\t\t\t$sql = \"SELECT\t\toption_value.*, user_table.*,\n\t\t\t\t\t\tGROUP_CONCAT(groupID SEPARATOR ',') AS groupIDs\n\t\t\t\tFROM\t\twcf\".WCF_N.\"_user user_table\n\t\t\t\tLEFT JOIN\twcf\".WCF_N.\"_user_option_value option_value\n\t\t\t\tON\t\t(option_value.userID = user_table.userID)\n\t\t\t\tLEFT JOIN\twcf\".WCF_N.\"_user_to_groups groups\n\t\t\t\tON\t\t(groups.userID = user_table.userID)\n\t\t\t\tWHERE\t\tuser_table.userID IN (\".implode(',', $userIDs).\")\n\t\t\t\tGROUP BY\tuser_table.userID\n\t\t\t\tORDER BY\t\".(($this->sortField != 'email' && isset($this->options[$this->sortField])) ? 'option_value.userOption'.$this->options[$this->sortField]['optionID'] : 'user_table.'.$this->sortField).\" \".$this->sortOrder;\n\t\t\t$result = WCF::getDB()->sendQuery($sql);\n\t\t\twhile ($row = WCF::getDB()->fetchArray($result)) {\n\t\t\t\t$accessible = Group::isAccessibleGroup(explode(',', $row['groupIDs']));\n\t\t\t\t$row['accessible'] = $accessible;\n\t\t\t\t$row['deletable'] = ($accessible && WCF::getUser()->getPermission('admin.user.canDeleteUser') && $row['userID'] != WCF::getUser()->userID) ? 1 : 0;\n\t\t\t\t$row['editable'] = ($accessible && WCF::getUser()->getPermission('admin.user.canEditUser')) ? 1 : 0;\n\t\t\t\t$row['isMarked'] = intval(in_array($row['userID'], $this->markedUsers));\n\t\t\t\t\n\t\t\t\t$this->users[] = new User(null, $row);\n\t\t\t}\n\t\t\t\n\t\t\t// get special columns\n\t\t\tforeach ($this->users as $key => $user) {\n\t\t\t\tforeach ($this->columns as $column) {\n\t\t\t\t\tif (isset($this->options[$column])) {\n\t\t\t\t\t\tif ($this->options[$column]['outputClass']) {\n\t\t\t\t\t\t\t$outputObj = $this->getOutputObject($this->options[$column]['outputClass']);\n\t\t\t\t\t\t\t$this->columnValues[$user->userID][$column] = $outputObj->getOutput($user, $this->options[$column], $user->{$column});\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t$this->columnValues[$user->userID][$column] = StringUtil::encodeHTML($user->{$column});\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\tswitch ($column) {\n\t\t\t\t\t\t\tcase 'email':\n\t\t\t\t\t\t\t\t$this->columnValues[$user->userID][$column] = '<a href=\"mailto:'.StringUtil::encodeHTML($user->email).'\">'.StringUtil::encodeHTML($user->email).'</a>';\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'registrationDate':\n\t\t\t\t\t\t\t\t$this->columnValues[$user->userID][$column] = DateUtil::formatDate(null, $user->{$column});\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public function allUsers()\n {\n // $sql = 'SELECT * FROM '.$db_name;\n return $this->queryAll();\n }",
"public function getAllUsers() {\n $conn = new DBConnect();\n $dbObj = $conn->getDBConnect();\n $this->DAO = new SecurityDAO($dbObj);\n return $this->DAO->getAllUsers();\n }",
"public function getUser();",
"public function getUser();",
"public function getUser();",
"public function getUser();",
"public function getUser();",
"public function getUser();",
"public function getUser();",
"public function user();",
"public function user();",
"public function user();",
"public function user();",
"public function user();",
"public function user();",
"public function user();",
"public function user();",
"public function getUsers() {\n\n $users = $this->users_model->getallusers();\n exit;\n }",
"public function getUsers()\n {\n $sql = \"SELECT * FROM users\";\n return $this->get($sql, array());\n }",
"public function getuserAction()\r\n {\r\n $User = $this->getUser();\r\n $data = $User;\r\n return $data;\r\n }",
"private function loadUsers() {\n\t\t\n\t\t\t$sql = \"SELECT usr_id FROM usr_cmp WHERE cmp_id='$companyID'\";\n\t\t\t\n\t\t\t$rawResult = $gremlin->query($sql);\n\t\t\t\n\t\t\tforeach($rawResult as $newCont) {\n\t\t\t\n\t\t\t\t$newUser = new User($newCont);\n\t\t\t\n\t\t\t\t$this->usersInCompany[] = $newUser;\n\t\t\t\n\t\t\t}\n\t\t\n\t\t}",
"public function users() {\n\t\t// most specifically the select() method.\n\n\t\t// In order to access the database instance that exists in our init.php file,\n\t\t// we need to define the variable as global.\n\t\tglobal $database;\n\t\t// To save a little on resource power, we only connect to the database when we\n\t\t// need a database connection. That might change as our software expands.\n\t\t// To test our database class's select() method, we need a database connection,\n\t\t// so let's connect to our database now using the handy connect() method we created.\n\t\t$database->connect();\n\t\t// Let's run our select query pulling anything that matches the requested email address\n\t\t// from the users table and save it in a variable called $users.\n\t\t$users = $database->select(['*'], 'users', ['email' => '[email protected]']);\n\n\t\t// Now render the view and pass to it our matches from the database in the form of the\n\t\t// $users variable.\n\t\t$this->view('home/users', ['header-view' => 'home/header', 'footer-view' => 'home/footer', 'users' => $users]);\n\t}",
"public function users(){\n\t\t$user = $this->ion_auth->user()->row();\n\n\t\t$query = $this->db->select()\n\t\t\t\t\t\t\t\t\t\t\t ->from('users')\n\t\t\t\t\t\t\t\t\t\t\t ->where('admin_id',$user->id)\n\t\t\t\t\t\t\t\t\t\t\t ->order_by('id', 'asc')\n\t\t\t\t\t\t\t\t\t\t\t ->get();\n\t\t\treturn $query;\n\t}",
"public function retrieve_users()\n {\n $search_query = Request::post(self::PARAM_SEARCH_QUERY);\n \n // Set the conditions for the search query\n if ($search_query && $search_query != '')\n {\n $conditions[] = Utilities::query_to_condition(\n $search_query, \n array(\n new PropertyConditionVariable(User::class_name(), User::PROPERTY_USERNAME), \n new PropertyConditionVariable(User::class_name(), User::PROPERTY_FIRSTNAME), \n new PropertyConditionVariable(User::class_name(), User::PROPERTY_LASTNAME)));\n }\n \n // Only include active users\n $conditions[] = new EqualityCondition(\n new PropertyConditionVariable(User::class_name(), User::PROPERTY_ACTIVE), \n new StaticConditionVariable(1));\n \n // Combine the conditions\n $count = count($conditions);\n if ($count > 1)\n {\n $condition = new AndCondition($conditions);\n }\n \n if ($count == 1)\n {\n $condition = $conditions[0];\n }\n \n $this->user_count = DataManager::count(User::class_name(), $condition);\n $parameters = new DataClassRetrievesParameters(\n $condition, \n 100, \n $this->get_offset(), \n array(\n new OrderBy(new PropertyConditionVariable(User::class_name(), User::PROPERTY_LASTNAME)), \n new OrderBy(new PropertyConditionVariable(User::class_name(), User::PROPERTY_FIRSTNAME))));\n \n return DataManager::retrieves(User::class_name(), $parameters);\n }",
"public function getUsers(){\n\t\t\t$users = $this->db->get(\"users\");\n\t\t\treturn $users;\n\t\t}",
"function getUsers() {\n\t\t$users = json_decode(\n\t\t\t\t\tfile_get_contents(\"data/users.json\"),\n\t\t\t\t\ttrue\n\t\t\t\t);\n\t\treturn $users;\n\t}",
"protected function loadUsers() {\r\n $this->users = new \\App\\Table\\UserTable(App::getInstance()->getDb());\r\n }",
"public function users_get()\n\t{\n\t\t$users = [\n\t\t\t['id' => 0, 'name' => 'John', 'email' => '[email protected]'],\n\t\t\t['id' => 1, 'name' => 'Jim', 'email' => '[email protected]'],\n\t\t];\n\n\t\t$id = $this->get('id');\n\n\t\tif ($id === null) {\n\t\t\t// Check if the users data store contains users\n\t\t\tif ($users) {\n\t\t\t\t// Set the response and exit\n\t\t\t\t$this->response($users, 200);\n\t\t\t} else {\n\t\t\t\t// Set the response and exit\n\t\t\t\t$this->response([\n\t\t\t\t\t'status' => false,\n\t\t\t\t\t'message' => 'No users were found'\n\t\t\t\t], 404);\n\t\t\t}\n\t\t} else {\n\t\t\tif (array_key_exists($id, $users)) {\n\t\t\t\t$this->response($users[$id], 200);\n\t\t\t} else {\n\t\t\t\t$this->response([\n\t\t\t\t\t'status' => false,\n\t\t\t\t\t'message' => 'No such user found'\n\t\t\t\t], 404);\n\t\t\t}\n\t\t}\n\t}",
"public static function get_user_data()\n {\n }",
"public function getData(){\n\t\t$db = new Database();\n\t\t$dbConnect = $db->connect();\n\t\t$sql = \"SELECT * FROM user\";\n\t\t$data = $dbConnect->query($sql);\n\t\t$dbConnect = $db->close();\n\t\treturn $data;\n\t}",
"public function userIndex()\n {\n return Serie::with([\n 'genre1',\n 'genre2'\n ])->ownedBy(auth()->user()->id)\n ->get();\n }",
"public function GetAllUsers()\n {\n $data = $this->db()->run(\"SELECT * FROM users\")->fetchall(PDO::FETCH_ASSOC);\n return $data;\n }",
"public function getUsers(){\n $query = \"SELECT * FROM usuario \";\n return self::getInstance()->consulta($query);\n }",
"function findAllUsers() {\r\n\r\n\t\treturn ($this->query('SELECT * FROM users;'));\r\n\r\n\t}",
"public function listUsers()\n {\n global $db;\n $user_db_data = array();\n $cache = Cache::getInstance();\n // $cache->flush();\n if($cache->exists(\"user_info_data\"))\n {\n $user_db_data = $cache->get(\"user_info_data\");\n } else { \n $e = $db->prepare(\"SELECT * FROM user_info\");\n $e->execute();\n $user_data = $e->fetchAll(); \n // cache will clear in every 1 min.\n $cache->set(\"user_info_data\", $user_data, 60 * 60 * 0.1);\n $user_db_data = $user_data;\n }\n return $user_db_data;\n }",
"public function index()\n {\n // return collection of all users\n return UserIndexResource::collection(User::info()->get());\n }",
"public function getUsers() {\n $userDAO = new UserDAO();\n return $userDAO->retrieveUsers();\n }",
"public function getAllUsers()\n {\n $result = self::$dbInterface -> query(\"SELECT userID, userName, email FROM user\");\n return $result;\n }",
"public function getUsers()\n {\n $st = $this->execute('SELECT * FROM '. self::$prefix .'user ORDER BY `userid`;');\n\n $rs = $st->fetchAll(PDO::FETCH_ASSOC);\n\n $users = array();\n foreach($rs AS $row) {\n $user = new sspmod_janus_User($this->_config->getValue('store'));\n $user->setUid($row['uid']);\n $user->load();\n $users[] = $user;\n }\n \n return $users;\n }",
"public function getUsers() {\n $user= \\DB::table('users')\n ->pluck('name', 'id');\n return $user;\n \n \n }",
"public function read()\n {\n // show all users\n return User::with('handset')->get();\n }",
"function UserModel()\n\t\t{\n\t\t\t$this->QueryTool = new UserModelDataBasic(DB_NAME);\n\t\t}",
"public function getUserData()\n {\n exit(json_encode(['data' => $this->users_model->get_users()]));\n }",
"function fetchUsers()\r\n {\r\n $users = $this->DB->database_select('users', array('username', 'uid'));\r\n return $users;\r\n }",
"public function getUserData($userId);",
"public function getUsersList()\n {\n }",
"private function getUserBatch() {\n\t\t// Include also hidden (disabled) users to the export\n\t\t$hidden_status = access_get_show_hidden_status();\n\t\taccess_show_hidden_entities(true);\n\n\t\t// Ignore access settings to get all users\n\t\telgg_set_ignore_access(true);\n\n\t\t$users = elgg_get_entities(array(\n\t\t\t'type' => 'user',\n\t\t\t'limit' => $this->limit,\n\t\t\t'offset' => $this->offset,\n\t\t));\n\n\t\t// Set access level to normal\n\t\telgg_set_ignore_access(false);\n\n\t\t// Set hidden status to normal\n\t\taccess_show_hidden_entities($hidden_status);\n\n\t\treturn $users;\n\t}",
"public function index()\n {\n return $this->user->all();\n }",
"function getUsers()\n {\n $sql = \"SELECT * FROM \" . DB_NAME . \".`customers`\";\n\n try {\n $result = $this->connexion->prepare($sql);\n $var = $result->execute();\n $users = [];\n\n while ($data = $result->fetch(PDO::FETCH_OBJ)) {\n $user = new UserEntity();\n $user->setIdUser($data->idUser);\n $user->setNom_societe($data->Nom_societe);\n $user->setAbreviations($data->Abreviations);\n $user->setAdresse($data->Adresse);\n $user->setTel($data->Tel);\n $user->setEmail($data->Email);\n $user->setSecteur($data->Secteur);\n $user->setCreatedAt($data->createdat);\n\n $users[] = $user;\n }\n\n if ($users) {\n return $users;\n } else {\n return FALSE;\n }\n } catch (PDOException $th) {\n return NULL;\n }\n }",
"function getUsers(){\n\t\t$this->users = $this->fileHandler->parseRows($this->userFile, '^', '|');\n\t\t$this->logMsg(SUCCESS, 'users generated');\n\t}",
"public function getUsers(){\n try{\n $this->openDatabase();\n $query=$this->database->prepare(\"SELECT * FROM users\");\n $query->execute();\n $result=$query->get_result();\n $query->close();\n $this->closeDatabase();\n return $result;\n }\n catch(Exception $exception){\n $this->closeDatabase();\n\t\t\t\tthrow $exception;\n }\n }",
"public function users()\n {\n $sql = \"SELECT *\n FROM user\";\n\n $query = $this->db->prepare($sql);\n $query->execute();\n return $query->fetchAll();\n }",
"public function getUsers() {\n\t\ttry {\n\t\t\treturn $this->getBounded1MInstance(\"XTUsersRecords\", $filter, $order, $limit, $whereAdd);\n\t\t}\n\t\tcatch (Exception $e) {\n\t\t\tthrow $e;\n\t\t}\n\t}",
"public function getUsers()\n {\n $users = [];\n $request = $this->_db->query('SELECT * FROM user');\n while ($data = $request->fetch(PDO::FETCH_ASSOC)) {\n $users[] = new User($data);\n }\n return $users;\n }",
"public function getUsers() {\n $this->checkValidUser();\n\n $this->db->sql = 'SELECT id, username FROM '.$this->db->dbTbl['users'].' ORDER BY username';\n\n $res = $this->db->fetchAll();\n\n if($res === false) {\n $this->output = array(\n 'success' => false,\n 'key' => 'sdop6'\n );\n } else {\n $this->output = array(\n 'success' => true,\n 'key' => 'ffUI8',\n 'users' => $res\n );\n }\n\n $this->renderOutput();\n }",
"function getUsers(){\n $this->users = array();\n foreach($this->userIds as $userId){\n array_push($this->users, new user($userId));\n }\n }",
"public function getUsers()\n {\n $stmt = $this->DB->prepare(\"select user, hash from users\");\n $stmt->execute();\n // fetchall returns all records in the set as an array\n return $stmt->fetchAll(PDO::FETCH_ASSOC);\n }",
"public function selectuser(){\r\n\t\t$query = \"SELECT * FROM users\";\r\n\t\t$add_query = parent::get_results($query);\r\n\t\t\r\n\t\treturn $add_query;\r\n\t\t// echo '<pre>';\r\n\t\t// print_r( $add_query );\r\n\t\t// echo '</pre>';\r\n\t\t// exit;\r\n\t}",
"function d4os_io_db_070_os_user_load($data = array()) {\n\n if (is_numeric($data)) {\n\n // get the user by uid\n $UUID = db_result(db_query(\"SELECT UUID FROM {d4os_ui_users} WHERE uid = %d\", array($data)));\n\n if (!$UUID) {\n return FALSE;\n }\n\n $query = \"SELECT * FROM {UserAccounts} AS ua\"\n . \" LEFT JOIN {auth} AS a ON a.UUID=ua.PrincipalID\"\n . \" LEFT JOIN {GridUser} AS gu ON gu.UserID=ua.PrincipalID\"\n . \" WHERE ua.PrincipalID='%s'\";\n\n d4os_io_db_070_set_active('os_robust');\n $user = db_fetch_object(db_query($query, $UUID));\n d4os_io_db_070_set_active('default');\n \n if ($user) {\n $user = _d4os_io_db_070_os_070_to_grid($user);\n d4os_io_db_070_users_add_extra_fields($user);\n return $user;\n }\n else {\n return FALSE;\n }\n }\n\n // get only inworld fields\n $user_fields = d4os_ui_users_get_grid_fields();\n\n // Dynamically compose a SQL query:\n $query = array();\n $values = array();\n\n // get the user by keys\n foreach ($data as $key => $value) {\n if (in_array($key, $user_fields)) {\n switch ($key) {\n case 'UUID':\n $query[]= \"ua.PrincipalID = '%s'\";\n $values[] = $value;\n break;\n case 'username':\n $query[]= \"ua.FirstName = '%s'\";\n $values[] = $value;\n break;\n case 'lastname':\n $query[]= \"ua.LastName = '%s'\";\n $values[] = $value;\n break;\n case 'email':\n $query[]= \"ua.Email = '%s'\";\n $values[] = $value;\n break;\n case 'created':\n $query[]= \"ua.Created = %d\";\n $values[] = $value;\n break;\n case 'godLevel':\n $query[]= \"ua.UserLevel = %d\";\n $values[] = $value;\n break;\n }\n }\n }\n $sql = \"SELECT * FROM {UserAccounts} AS ua\"\n . \" LEFT JOIN {auth} AS a ON a.UUID=ua.PrincipalID\"\n . \" LEFT JOIN {GridUser} AS gu ON gu.UserID=ua.PrincipalID\"\n . \" WHERE \". implode(' AND ', $query);\n\n d4os_io_db_070_set_active('os_robust');\n $user = db_fetch_object(db_query($sql, $values));\n d4os_io_db_070_set_active('default');\n \n if ($user) {\n $uid = db_result(db_query(\"SELECT uid FROM {d4os_ui_users} WHERE UUID = '%s'\", array($user->PrincipalID)));\n $user->uid = $uid;\n $user = _d4os_io_db_070_os_070_to_grid($user);\n d4os_io_db_070_users_add_extra_fields($user);\n return $user;\n }\n else {\n return FALSE;\n }\n}",
"protected function fetchUserSessionFromDB() {}",
"function findUsers($key){\r\n // echo \"SELECT * FROM categorie WHERE cat_title LIKE '%$key%'\";\r\n $result = $this->connector->query(\"SELECT * FROM `users` WHERE full_name LIKE '%$key%'\");\r\n $x = 0;\r\n while ($row = $this->connector->fetchArray($result)) {\r\n $x++;\r\n $user[$x] = new User();\r\n $user[$x]->setId($row['id']);\r\n $user[$x]->setFull_name($row['full_name']);\r\n $user[$x]->setUsername($row['username']);\r\n $user[$x]->setPassword($row['password']);\r\n $user[$x]->setEmail($row['email']);\r\n $user[$x]->setDate($row['date']);\r\n $user[$x]->setRandom($row['random']);\r\n $user[$x]->setActivated($row['activated']);\r\n $user[$x]->setUserlevel($row['userlevel']);\r\n \r\n \t}\r\n return $user;\r\n }",
"function all_users()\r\n\t{\r\n\t\t//$this->mongo_db->select('*');\r\n\t\t//$this->mongo_db->from('users');\r\n\t\t// \r\n\t\t//$query = $this->mongo_db->get();\r\n\t\t//return $query->result_array();\r\n\t\t\r\n\t\t//connect to mongodb collection (i.e., table) named as ‘surfinme_index’\r\n\t\t$collection \t= $this->mongo_db->db->selectCollection('settings');\r\n \t//selecting records from the collection - surfinme_index\r\n \t$result\t\t= $collection->find();\r\n\t\tforeach($result as $data) \r\n\t\t{ \r\n\t\t\t//display the records \r\n\t\t\tvar_dump($data);\r\n\t\t} \r\n\t\t\r\n\t}",
"public function getGroupUsersFromDatabase() {\n $db = \\Helper::getDB();\n $db->where('g.groupId', $db->escape($this->getId()));\n $db->join('users u', 'u.id = g.userId', 'LEFT');\n $results = $db->get('group_users g', NULL, 'u.*');\n // Process all users\n foreach($results as $user) {\n $user = new \\Models\\User($user['id'], $user['username'], $user['email'], $user['firstName'], $user['lastName'], $user['lastLogin']);\n $this->addUser($user);\n }\n }",
"public function data_user()\n {\n return new Data\\User;\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 users()\n {\n return User::join('group_user', 'group_user.user_id', '=', 'users.id')\n ->join('groups', 'group_user.group_id', '=', 'groups.id')\n ->join('stores', 'stores.group_id', '=', 'groups.id')\n ->where('stores.id', $this->id)\n ->select('users.*')\n ->get();\n }",
"Public Function getAllUsers()\n\t{\n\t\t$Output = array();\n\t\t$Users = $this->_db->fetchAll('SELECT * FROM bevomedia_user');\n\t\tforeach($Users as $User)\n\t\t\t$Output[] = new User($User->id);\n\t\t\t\n\t\treturn $Output;\n\t}",
"function get_users()\n\t{\n\n\t\trequire_once('modules/Users/User.php');\n\t\t\n\t\t$query = \"SELECT user_id as id FROM roles_users WHERE role_id='$this->id' AND deleted=0\";\n\t\t\n\t\treturn $this->build_related_list($query, new User());\n\t}",
"public function index()\n {\n return user::get();\n }"
] | [
"0.66895264",
"0.6674247",
"0.66375715",
"0.66375715",
"0.66375715",
"0.6632698",
"0.6632698",
"0.6598248",
"0.6598248",
"0.6598248",
"0.6598248",
"0.6487167",
"0.6467601",
"0.64530045",
"0.6424622",
"0.6421809",
"0.6421809",
"0.63342935",
"0.6304717",
"0.62866527",
"0.6285769",
"0.627961",
"0.62434304",
"0.6232339",
"0.6230842",
"0.6223433",
"0.6215762",
"0.6203147",
"0.6167476",
"0.6161305",
"0.61447316",
"0.61439675",
"0.611027",
"0.61073977",
"0.61073977",
"0.61073977",
"0.61073977",
"0.61073977",
"0.61073977",
"0.61073977",
"0.61013067",
"0.61013067",
"0.61013067",
"0.61013067",
"0.61013067",
"0.61013067",
"0.61013067",
"0.61013067",
"0.61005586",
"0.60948586",
"0.60500723",
"0.6045244",
"0.60358906",
"0.6028467",
"0.60284567",
"0.6026642",
"0.60250133",
"0.6018943",
"0.60029536",
"0.60024565",
"0.5995147",
"0.5993421",
"0.5990911",
"0.5985963",
"0.5985863",
"0.5980944",
"0.5974657",
"0.5967414",
"0.5966862",
"0.5960655",
"0.5958934",
"0.59566885",
"0.5944864",
"0.5943805",
"0.59385484",
"0.59345144",
"0.59317714",
"0.5927326",
"0.59192836",
"0.5916951",
"0.5915493",
"0.59134144",
"0.5908686",
"0.590735",
"0.59063613",
"0.5900049",
"0.5899452",
"0.5898893",
"0.5896979",
"0.58933336",
"0.5884265",
"0.58822834",
"0.5880892",
"0.58807474",
"0.5879215",
"0.58770883",
"0.5876882",
"0.5863703",
"0.58635443",
"0.5862323"
] | 0.5932056 | 76 |
Magic method for converting an object to a string. | public function __toString()
{
return (string) $this->message;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"abstract function objectAsString($object);",
"public function objectToString($obj);",
"private static function objToStr($obj)\n {\n return method_exists($obj, '__toString') ? (string)$obj : get_class($obj) . '@' . spl_object_hash($obj);\n }",
"function toString ($object)\n{\n\treturn get_class($object);\n}",
"function objectToString( &$object ) {\n\n\t}",
"static function objectToString($obj)\n {\n if (is_object($obj) && method_exists($obj, 'toString')) {\n return $obj->toString();\n } else if (is_object($obj) && method_exists($obj, '__toString')) {\n return $obj->__toString();\n } else {\n return $obj;\n }\n }",
"abstract function to_str();",
"function dataToString($object=null) {\r\n\t\treturn $object->__toString();\r\n\t}",
"protected static function objToStr(object $obj): string\n {\n return method_exists($obj, '__toString') ? (string) $obj : get_class($obj) . '@' . spl_object_id($obj);\n }",
"public function __tostring();",
"static function toString($var){\n\t\tif(self::isString($var)){\n\t\t\treturn $var;\n\t\t}else if(self::isObject($var)){\n\t\t\tif(self::isStringObject($var) || self::isFileObject($var)){\n\t\t\t\treturn $var->val();\n\t\t\t}\n\t\t}\n\n\t\treturn (string) $var;\n\t}",
"function __toString();",
"function __toString();",
"function __toString();",
"public function __toString()\n {\n $type = gettype($this->value);\n\n switch ($type) {\n case 'boolean':\n return $this->boolean($this->value);\n break;\n case 'integer':\n return $this->int($this->value);\n break;\n case 'double':\n return $this->float($this->value);\n break;\n case 'string':\n return $this->string($this->value);\n break;\n case 'array':\n return $this->array($this->value);\n break;\n case 'object':\n return $this->object($this->value);\n break;\n case 'resource':\n return $this->resource($this->value);\n break;\n case 'NULL':\n return 'NULL';\n break;\n default:\n return '(unknown type)';\n break;\n };\n }",
"protected static function _prepare($obj)\n {\n if (false === is_scalar($obj)) {\n $string = self::_dump($obj);\n } else if (is_numeric($obj)) {\n $string = (string) $obj;\n } else {\n $string = $obj;\n }\n return $string;\n }",
"public function __toString(): string\n {\n return (string) $this->call('__toString');\n }",
"public function __toString();",
"public function __toString();",
"public function __toString();",
"public function __toString();",
"public function __toString();",
"public function __toString();",
"public function __toString();",
"public function __toString();",
"public function __toString();",
"public function __toString();",
"public function __toString();",
"public function __toString();",
"public function __toString();",
"public function __toString();",
"public function __toString();",
"public function __toString();",
"public function __toString();",
"public function __toString();",
"public function __toString();",
"public function __toString();",
"public function __toString();",
"public function __toString();",
"public function __toString();",
"public function __toString();",
"public function __toString();",
"public function __toString();",
"public function __toString();",
"public function __toString();",
"public function __toString();",
"public function __toString();",
"public function __toString();",
"public function __toString();",
"public function __toString();",
"public function __toString();",
"public function __toString();",
"public function __toString();",
"public function __toString();",
"public function __toString()\n {\n notice('Object: \"'.get_class($this).'\" is used as string');\n\n return 'Object('.get_class($this).')';\n }",
"public function __toString() : string;",
"final public function __toString(): string {}",
"public function __tostring() {\r\n return (string) $this->object->getId();\r\n }",
"public function toString(): string;",
"public function toString(): string;",
"public function toString(): string;",
"public function toString(): string;",
"public function toString(): string;",
"public function toString(): string;",
"function toString ($value) {\n assert(count(func_get_args()) == 1);\n if (is_string($value) || is_int($value) || is_float($value))\n return (string) $value;\n if (is_object($value) && hasMember($value, 'toString'))\n return toString($value->toString());\n throw new RuntimeException('Unable to convert to string.');\n}",
"public function toString()\n {\n $data = $this->origin->data();\n $out = '';\n if (is_scalar($data) || is_null($data)) {\n $out = (string) $data;\n } elseif (is_object($data) && method_exists($data, '__toString')) {\n $out = (string) $data;\n }\n return $out;\n }",
"function __toString() ;",
"function __toString() ;",
"public function __toString(): string;",
"public function __toString(): string;",
"public function __toString(): string;",
"public function __toString(): string;",
"public function __toString(): string;",
"public function __toString(): string;",
"public function __toString(): string;",
"public function __toString(): string;",
"public function __toString(): string;",
"public function __toString(): string;",
"public function __toString(): string;",
"public function __toString(): string;",
"public function __toString(): string;",
"public abstract function __toString();",
"public function __toString(){\n return $this->convert();\n }",
"public function toString(mixed $value): string;",
"public function toString();",
"public function toString();",
"public function toString();",
"public function toString();",
"public function toString();",
"public function toString();",
"public function toString();",
"public function __toString(): string\n {\n return (string)$this->value;\n }",
"public function __toString() { return $this->as_string(); }",
"public function toString() {}",
"public function toString() {}",
"public function toString() {}",
"public function toString() {}",
"public function toString() {}",
"public function toString() {}",
"public function to_string() { return $this->__toString(); }",
"function __toString() {\n return $this->string();\n }"
] | [
"0.82403433",
"0.81319857",
"0.7758182",
"0.7649948",
"0.75657123",
"0.75203985",
"0.73557496",
"0.721492",
"0.7170935",
"0.7062359",
"0.6975547",
"0.69601506",
"0.69601506",
"0.69601506",
"0.6926244",
"0.6902784",
"0.68270826",
"0.6811338",
"0.6811338",
"0.6811338",
"0.6811338",
"0.6811338",
"0.6811338",
"0.6811338",
"0.6811338",
"0.6811338",
"0.6811338",
"0.6811338",
"0.6811338",
"0.6811338",
"0.6811338",
"0.6811338",
"0.6811338",
"0.6811338",
"0.6811338",
"0.6811338",
"0.6811338",
"0.6811338",
"0.6811338",
"0.6811338",
"0.6811338",
"0.6811338",
"0.6811338",
"0.6811338",
"0.6811338",
"0.6811338",
"0.6811338",
"0.6811338",
"0.6811338",
"0.6811338",
"0.6811338",
"0.6811338",
"0.6811338",
"0.6811338",
"0.6779085",
"0.675508",
"0.6747939",
"0.67413557",
"0.6740408",
"0.6740408",
"0.6740408",
"0.6740408",
"0.6740408",
"0.6740408",
"0.671963",
"0.6678019",
"0.66758823",
"0.6675164",
"0.66622096",
"0.66622096",
"0.66622096",
"0.66622096",
"0.66622096",
"0.66622096",
"0.66622096",
"0.66622096",
"0.66622096",
"0.66622096",
"0.66622096",
"0.66622096",
"0.66622096",
"0.6651231",
"0.6613477",
"0.6607391",
"0.66045797",
"0.66045797",
"0.66045797",
"0.66045797",
"0.66045797",
"0.66045797",
"0.66045797",
"0.65724707",
"0.6569402",
"0.65533996",
"0.65533996",
"0.65523374",
"0.65523374",
"0.65523374",
"0.65502256",
"0.65388393",
"0.65348756"
] | 0.0 | -1 |
Disable guarded array if creating new objects | public function setSkipGuarded($skip = true)
{
if ($skip && count($this->guarded)) {
$this->defaultGuarded = $this->guarded;
$this->guarded = [];
} else {
$this->guarded = $this->defaultGuarded;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getGuarded()\n {\n return $this->guarded === false\n ? []\n : $this->guarded;\n }",
"public function isGuarded()\n {\n return $this->guarded;\n }",
"public function getGuarded();",
"public function keepItemsInArrayCanUseClosure() {}",
"public function getGuarded()\n {\n return $this->guarded;\n }",
"public static function reguard()\n {\n static::$unguarded = false;\n }",
"public static function reguard()\n {\n static::$unguarded = false;\n }",
"public function totallyGuarded()\n {\n return count($this->fillable) == 0 && $this->guarded == ['*'];\n }",
"public function totallyGuarded()\n {\n return count($this->fillable) == 0 && $this->guarded == ['*'];\n }",
"public static function isUnguarded()\n {\n return static::$unguarded;\n }",
"public static function isUnguarded()\n {\n return static::$unguarded;\n }",
"function __constructor() {\n $arr = array();\n }",
"public function guard(array $guarded)\n {\n $this->guarded = $guarded;\n\n return $this;\n }",
"public function guard(array $guarded)\n {\n $this->guarded = $guarded;\n\n return $this;\n }",
"protected function allowed(): array\n {\n return [];\n }",
"function make()\n{\n return [];\n}",
"public function invalidArrayForArrayConfigurationProvider() {}",
"public function instance_allow_multiple() {\n return false;\n }",
"public function instance_allow_multiple() {\n return false;\n }",
"public function instance_allow_multiple() {\n return false;\n }",
"public function instance_allow_multiple() {\n return false;\n }",
"public function instance_allow_multiple() {\n return false;\n }",
"private function createArrayable()\n {\n $this->data = $this->data->toArray();\n\n $this->createArray();\n }",
"public function mergeGuarded(array $guarded)\n {\n $this->guarded = array_merge($this->guarded, $guarded);\n\n return $this;\n }",
"public abstract function retain_array(Array $array);",
"public function retainObjectOrder()\n {\n return false;\n }",
"public function publicArrayWhitelist() {\r\n\t\treturn $this->publicArrayWhitelist;\r\n\t}",
"function instance_allow_multiple() {\n return false;\n }",
"function instance_allow_multiple() {\n return false;\n }",
"function instance_allow_multiple() {\n return false;\n }",
"public function keysOnlyUsedDuringCreation()\n {\n \treturn $this->keysOnlyUsedDuringCreation;\n }",
"public function totallyGuarded()\n {\n return count($this->getFillable()) === 0 && $this->getGuarded() == ['*'];\n }",
"public function validArrayForArrayConfigurationProvider() {}",
"private function newSortVectorForUnowned() {\n return array(\n 0,\n );\n }",
"public function testAppendToOverMaxSizeWithoutAccess()\n {\n $array = new \\ComplexPie\\CacheArray();\n $max = \\ComplexPie\\CacheArray::MAX_CACHE_SIZE + 1;\n for ($i = 0; $i < $max; $i++)\n {\n $array[] = $i;\n }\n $this->assertSame(1, count($array));\n }",
"public function isGuarded($key)\n {\n return in_array($key, $this->guarded) || $this->guarded == ['*'];\n }",
"public function getGuardeds()\n {\n return $this->filterDatas(function ($data) {\n return isset($data->guarded) && $data->guarded;\n });\n }",
"protected function getGuarded($record)\n {\n return $this->guarded;\n }",
"public function keepItemsInArrayWorksWithOneArgumentDataProvider() {}",
"protected function removeGuardedFields(array $original): array\n {\n // Removes any guarded attribute from $json array.\n foreach ($this->guarded as $guarded) {\n if (\\array_key_exists($guarded, $original)) {\n unset($original[$guarded]);\n }\n }\n\n return $original;\n }",
"public function testNoArrayMetaAccess()\n\t{\n\t\t$bean = R::dispense( 'bean' );\n\t\t$bean->setMeta( 'greet', 'hello' );\n\t\tasrt( isset( $bean['greet'] ), FALSE );\n\t\tasrt( isset( $bean['__info']['greet'] ), FALSE );\n\t\tasrt( isset( $bean['__info'] ), FALSE );\n\t\tasrt( isset( $bean['meta'] ), FALSE );\n\t\tasrt( count( $bean ), 1 );\n\t}",
"protected function _getReadonlyProperties()\n {\n return array();\n }",
"private function __construct()\n {\n // disabled method\n }",
"public function allowMultiple() {\n return false;\n }",
"public function onlyEmptyInstance()\n {\n return false;\n }",
"public function useAllFields() {\n $this->__onlyFields = array();\n }",
"protected function always() {\n return [];\n }",
"public function unsetEnabled(): void\n {\n $this->enabled = [];\n }",
"public function maker(): array;",
"private function get_object_array($array){\n \n }",
"public function setIgnore($array)\n {\n $this->Ignore = $array;\n }",
"public function safe_array()\n\t{\n\t\t// Load choices\n\t\t$choices = func_get_args();\n\t\t$choices = empty($choices) ? NULL : array_combine($choices, $choices);\n\n\t\t// Get field names\n\t\t$fields = $this->field_names();\n\n\t\t$safe = array();\n\t\tforeach ($fields as $field)\n\t\t{\n\t\t\tif ($choices === NULL OR isset($choices[$field]))\n\t\t\t{\n\t\t\t\tif (isset($this[$field]))\n\t\t\t\t{\n\t\t\t\t\t$value = $this[$field];\n\n\t\t\t\t\tif (is_object($value))\n\t\t\t\t\t{\n\t\t\t\t\t\t// Convert the value back into an array\n\t\t\t\t\t\t$value = $value->getArrayCopy();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t// Even if the field is not in this array, it must be set\n\t\t\t\t\t$value = NULL;\n\t\t\t\t}\n\n\t\t\t\t// Add the field to the array\n\t\t\t\t$safe[$field] = $value;\n\t\t\t}\n\t\t}\n\n\t\treturn $safe;\n\t}",
"protected function safe()\n {\n $safe = (array)$this->data;\n unset($safe[$this->primary_key]);\n return $safe;\n }",
"public function testAppendToOverMaxSizeWithAccessToSpecific()\n {\n $array = new \\ComplexPie\\CacheArray();\n $max = \\ComplexPie\\CacheArray::MAX_CACHE_SIZE;\n for ($i = 0; $i < $max; $i++)\n {\n $array[] = $i;\n }\n $array[1];\n $array[2];\n $array[3];\n $array[] = $i;\n $this->assertSame(4, count($array));\n }",
"public function testConstructNoWritableFile()\n {\n new SerializedArray('/noWritableFile');\n }",
"public function as_object( array $exclusions = array() ){\n\n return new Array_Object( $this->as_array( $exclusions ) );\n }",
"function createObject() {\n\t\t// must be implemented by sub-classes\n\t\tassert(false);\n\t}",
"function canCreate() {\r\n\t\treturn !DataObject::get_one($this->class);\r\n\t}",
"public function unsetEnforceUniqueness(): void\n {\n $this->enforceUniqueness = [];\n }",
"public function getInternalArray() {}",
"public function __construct()\n\t{\n $this->soft_deletes = TRUE;\n\t\t$this->return_as = 'array';\n\t\tparent::__construct();\n\t}",
"public function __construct()\n\t{\n $this->soft_deletes = TRUE;\n\t\t$this->return_as = 'array';\n\t\tparent::__construct();\n\t}",
"public function array_forget()\n {\n throw new Exception('Not implemented');\n }",
"public function testAppendToOverMaxSizeWithAccess()\n {\n $array = new \\ComplexPie\\CacheArray();\n $max = \\ComplexPie\\CacheArray::MAX_CACHE_SIZE + 1;\n for ($i = 0; $i < $max; $i++)\n {\n $array[] = $i;\n $array[$i];\n }\n $this->assertSame(1, count($array));\n }",
"public function generateEmptyObjectArray($num = 1)\n {\n $item = ObjectUtil::createEmptyObject ($this->_objType);\n if ($item) {\n $data = array();\n for ($i = 0; $i < $num; $i++) {\n $data[] = $item;\n }\n $this->_objData = $data;\n } \n\n return $this->_objData;\n }",
"public function testArrayAccess()\n\t{\n\t\t$book = R::dispense( 'book' );\n\t\t$book->isAwesome = TRUE;\n\t\tasrt( isset( $book->isAwesome ), TRUE );\n\t\t$book = R::dispense( 'book' );\n\t\t$book['isAwesome'] = TRUE;\n\t\tasrt( isset( $book->isAwesome ), TRUE );\n\n\t\t$book = R::dispense( 'book' );\n\t\t$book['xownPageList'] = R::dispense( 'page', 2 );\n\t\tasrt( isset( $book->ownPage ), TRUE );\n\t\tasrt( isset( $book->xownPage ), TRUE );\n\t\tasrt( isset( $book->ownPageList ), TRUE );\n\t\tasrt( isset( $book->xownPageList ), TRUE );\n\n\t\t$book = R::dispense( 'book' );\n\t\t$book['ownPageList'] = R::dispense( 'page', 2 );\n\t\tasrt( isset( $book->ownPage ), TRUE );\n\t\tasrt( isset( $book->xownPage ), TRUE );\n\t\tasrt( isset( $book->ownPageList ), TRUE );\n\t\tasrt( isset( $book->xownPageList ), TRUE );\n\n\t\t$book = R::dispense( 'book' );\n\t\t$book['xownPage'] = R::dispense( 'page', 2 );\n\t\tasrt( isset( $book->ownPage ), TRUE );\n\t\tasrt( isset( $book->xownPage ), TRUE );\n\t\tasrt( isset( $book->ownPageList ), TRUE );\n\t\tasrt( isset( $book->xownPageList ), TRUE );\n\n\t\t$book = R::dispense( 'book' );\n\t\t$book['ownPage'] = R::dispense( 'page', 2 );\n\t\tasrt( isset( $book->ownPage ), TRUE );\n\t\tasrt( isset( $book->xownPage ), TRUE );\n\t\tasrt( isset( $book->ownPageList ), TRUE );\n\t\tasrt( isset( $book->xownPageList ), TRUE );\n\n\t\t$book = R::dispense( 'book' );\n\t\t$book['sharedTag'] = R::dispense( 'tag', 2 );\n\t\tasrt( isset( $book->sharedTag ), TRUE );\n\t\tasrt( isset( $book->sharedTagList ), TRUE );\n\n\t\t$book = R::dispense( 'book' );\n\t\t$book['sharedTagList'] = R::dispense( 'tag', 2 );\n\t\tasrt( isset( $book->sharedTag ), TRUE );\n\t\tasrt( isset( $book->sharedTagList ), TRUE );\n\n\t}",
"abstract protected static function defineComparableAttributes(): array;",
"public function testAppendToMaxSizeWithoutAccess()\n {\n $array = new \\ComplexPie\\CacheArray();\n $max = \\ComplexPie\\CacheArray::MAX_CACHE_SIZE;\n for ($i = 0; $i < $max; $i++)\n {\n $array[] = $i;\n }\n $this->assertSame($max, count($array));\n }",
"public function aArray() {}",
"function queue_initialize() { \n // In this case, just return a new array \n $new = array(); \n return $new; \n}",
"protected abstract function doCreateObject(array $array);",
"static function ensure(&$array, $value){\n\t\tif(array_search($value, $array) === false){\n\t\t\t$array[] = $value;\n\t\t}\n\t\treturn $array;\n\t}",
"public function __construct(){\n if(count($this->fillable) == 0){\n foreach($this->attributes as $key => $attr){\n array_push($this->fillable, $key);\n }\n }\n }",
"public function safeToArray()\n {\n return array(\n 'id' => $this->getId(),\n 'name' => $this->getName(),\n 'counts' => $this->getCounts()->toArray(),\n 'settings' => $this->getSettings()->safeToArray(),\n 'hasCuratorRole' => $this->hasRole('ROLE_CURATOR'),\n );\n }",
"public function __construct()\n {\n $this->timestamps = TRUE;\n $this->soft_deletes = FALSE;\n $this->return_as = 'object'; //array\n parent::__construct();\n }",
"public function useArrayUnShift()\n {\n $this->push = false;\n return $this;\n }",
"public function isMutable();",
"protected static function _isMutable()\n {\n return false;\n }",
"public function create($array) {\n \n }",
"function whitelist($array, $whitelist) {\r\n $new_array = array();\r\n foreach ($array as $key => $value) {\r\n if (isset($whitelist[$key]))\r\n $new_array[$key] = $value;\r\n }\r\n return $new_array;\r\n}",
"public function enabled(): array;",
"public function isFrozen() {}",
"public function __clone()\n {\n return false;\n }",
"function isFrozen() ;",
"public function nonArray()\n {\n $inCriterion = new stubInCriterion('foo', 'bar');\n }",
"public function __construct(protected bool $isArray = true)\n {\n }",
"protected function canCreate() {}",
"public function enforceIsNew($value = TRUE);",
"public static function isMutable()\n {\n return false;\n }",
"protected function beforeStore(array &$data)\n {\n return true;\n }",
"function protected_attributes() {\n\t\treturn array();\n\n\t}",
"public function testOrderedQueueArrayAccess_implementation() {\n\t\t\t$this->assertTrue($this->oq InstanceOf \\ArrayAccess);\n\t\t}",
"public function disabled();",
"public function disabled();",
"public function testAssignWrongTypedValueToArray()\n {\n $array = new TypedObjectArray(ArrayObject::class);\n $array[] = new SplStack();\n }",
"final private function __construct()\r\n\t{\r\n\t\treturn false;\r\n\t}",
"function isProtectionEnabled()\n {\n return $this->_sheet || $this->_objects || $this->_scenarios || $this->_formatCells || $this->_formatColumns || $this->_formatRows || $this->_insertColumns || $this->_insertRows || $this->_insertHyperlinks || $this->_deleteColumns || $this->_deleteRows || $this->_selectLockedCells || $this->_sort || $this->_autoFilter || $this->_pivotTables || $this->_selectUnlockedCells;\n }",
"public function limpaArrayIdsObjetosManipulados()\n {\n \t// limpando o array de ids de objetos manipulados\n \t$this->_arrayObjetosManipulados = array();\n }",
"private function __wakeup() {\n\t\t\treturn false;\n\t\t}",
"private function __construct()\n {\n return false;\n }"
] | [
"0.65131515",
"0.60556614",
"0.60292006",
"0.58722013",
"0.58119655",
"0.5698145",
"0.5698145",
"0.5681387",
"0.5681387",
"0.5611363",
"0.5611363",
"0.55928594",
"0.5579042",
"0.5579042",
"0.5500739",
"0.54388034",
"0.54219395",
"0.541735",
"0.541735",
"0.541735",
"0.541735",
"0.541735",
"0.539243",
"0.5377199",
"0.53110695",
"0.52642924",
"0.52613235",
"0.52543974",
"0.52543974",
"0.52543974",
"0.51898766",
"0.5187113",
"0.5174582",
"0.51389635",
"0.51356786",
"0.5132337",
"0.5127795",
"0.5088031",
"0.50603986",
"0.5059821",
"0.5048162",
"0.50073147",
"0.49951163",
"0.49756142",
"0.49738517",
"0.49660462",
"0.49481186",
"0.4940677",
"0.4925707",
"0.4914279",
"0.49130479",
"0.49068975",
"0.49002266",
"0.48980507",
"0.48946115",
"0.48923087",
"0.48819497",
"0.48780057",
"0.4869213",
"0.486806",
"0.48576367",
"0.48576367",
"0.48550615",
"0.48542455",
"0.4852724",
"0.48392043",
"0.48296463",
"0.48199782",
"0.48162478",
"0.4813592",
"0.48002997",
"0.47952655",
"0.47810668",
"0.47745532",
"0.47738424",
"0.47602007",
"0.47557718",
"0.47521192",
"0.47516426",
"0.47488388",
"0.4738993",
"0.4738601",
"0.47382155",
"0.4730068",
"0.47268385",
"0.47259113",
"0.47230297",
"0.47163498",
"0.4710808",
"0.47104147",
"0.4709285",
"0.4708705",
"0.47074458",
"0.47074458",
"0.47065815",
"0.4701792",
"0.46997145",
"0.46946615",
"0.46934858",
"0.4692203"
] | 0.56649584 | 9 |
Uncomment the below to wipe the table clean before populating | public function run()
{
// DB::table('policesignups')->truncate();
$policesignups = array(
);
// Uncomment the below to run the seeder
// DB::table('policesignups')->insert($policesignups);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function clean(): void\n {\n $this->truncateJournalTable();\n $this->output(\"<success>Table {$this->internalTable} truncated</success>\");\n }",
"public function clean() {\n $this->data = \"\";\n $this->currentRow = 1;\n $this->curPosition = 0;\n }",
"private function getCleanTables() {\n\t\tunset($this->_vm_product);\n\t\tunset($this->product_id);\n\t\tunset($this->product_sku);\n\t\tunset($this->product_in_stock);\n\t}",
"public function resetTable();",
"public function clear()\n {\n $this->sql = '';\n $this->columns = array();\n $this->values = array();\n }",
"public function clean()\n {\n // Set to default values\n $this->sSql = '';\n $this->aValues = [];\n }",
"function Clean()\n\t{\n\t\t$this->_arrRows\t\t\t\t= Array();\n\t\t$this->_arrHeader\t\t\t= Array();\n\t\t$this->_arrWidths\t\t\t= Array();\n\t\t$this->_arrAlignments\t\t= Array();\n\t\t$this->_arrLinkedTables\t\t= Array();\n\t\t$this->_bolRowHighlighting\t= FALSE;\n\t\t$this->_bolDetails\t\t\t= FALSE;\n\t\t$this->_bolToolTips\t\t\t= FALSE;\n\t\t$this->_bolLinked\t\t\t= FALSE;\n\t\t$this->_intCurrentRow\t\t= NULL;\n\t}",
"public function clear()\r\n\t{\r\n\t\t$this->db->runQuery(\"TRUNCATE TABLE `\" . $this->name . \"`\");\r\n\t}",
"private function truncate()\n {\n // Désactivation des contraintes FK\n $this->co->executeQuery('SET foreign_key_checks = 0');\n // On tronque\n $this->co->executeQuery('TRUNCATE TABLE casting');\n $this->co->executeQuery('TRUNCATE TABLE department');\n $this->co->executeQuery('TRUNCATE TABLE genre');\n $this->co->executeQuery('TRUNCATE TABLE job');\n $this->co->executeQuery('TRUNCATE TABLE movie');\n $this->co->executeQuery('TRUNCATE TABLE movie_genre');\n $this->co->executeQuery('TRUNCATE TABLE person');\n $this->co->executeQuery('TRUNCATE TABLE review');\n $this->co->executeQuery('TRUNCATE TABLE team');\n $this->co->executeQuery('TRUNCATE TABLE user');\n }",
"private function clear_dummy_data()\n {\n $this->adapter->query('DELETE FROM ' . RUCKUSING_TS_SCHEMA_TBL_NAME);\n }",
"function _reset()\n {\n foreach ($this->_cols as $col => $val) {\n if (isset($val['default'])) {\n $this->_data[$col] = $val['default'];\n } else {\n $this->_data[$col] = '';\n }\n }\n }",
"public function uninitialize()\n {\n $table_name = $this->get_table_name();\n $sql = \"DROP TABLE IF EXISTS $table_name;\";\n\n if (!is_null($this->wpdb)) {\n $this->wpdb->query($sql);\n }\n }",
"function doempty()\r\n\t{\r\n\t\t$model\t= &$this->getModel( 'table' );\r\n\t\t$model->truncate();\r\n\t\t$this->display();\r\n\t}",
"private function reset(){\n\n\t\tforeach($this as $k=>$v) unset($this->$k);\n\n\t\t$this::$map = $this->maper();\n\n\t\t$this->name = \"\";\n\n\t\t$this->address = [];\n\n\t\t$this->tableclass();\n\n\t}",
"function emptyIndexTable(){\n\t\t$this->ecmDBhandle->truncateTable($this->dfs_db-> table_name);\n\t}",
"private function cleanDatabase()\n {\n\n DB::statement('SET FOREIGN_KEY_CHECKS=0');\n\n foreach($this->tables as $table)\n {\n\n DB::table($table)->truncate();\n\n }\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1');\n\n\n }",
"private function populateDummyTable() {}",
"protected function getCleanableTableList() {}",
"public function truncateTable() {\n Schema::disableForeignKeyConstraints();\n DB::table('missed_calls')->truncate();\n Schema::enableForeignKeyConstraints();\n }",
"private function purgeTables()\n\t{\t\n\t\t$this->db->query(\"DELETE FROM categories\");\n\t\t$this->db->query(\"DELETE FROM album_art\");\n\t\t$this->db->query(\"TRUNCATE TABLE albums\");\n\t\t\n\t}",
"public function Clear() {\n $this->_row = '';\n $this->_table = '';\n $this->_itemcount = 0;\n $this->_rown = 0;\n }",
"public function truncateTable() {\n Schema::disableForeignKeyConstraints();\n DB::table('questions')->truncate();\n DB::table('answers')->truncate();\n Schema::enableForeignKeyConstraints();\n }",
"protected function cleanTableNames() {}",
"protected function truncateTables()\n {\n \\DB::table('cities')->truncate();\n \\DB::table('states')->truncate();\n }",
"function clearwatson(){\n\t\t$connection = Database::getConnection();\n\t\t//Empty watson table\n\t\t$query=\"TRUNCATE TABLE watson\";\n\t\tif (!$connection->query($query)){\n\t\t\techo \"Error :\" .$query . \"<br>\" . $connection->error;\n\t\t}\n\t\t//Empty watson_country table\n\t\t$query=\"TRUNCATE TABLE watson_country\";\n\t\tif (!$connection->query($query)){\n\t\t\techo \"Error :\" .$query . \"<br>\" . $connection->error;\n\t\t}\n\t}",
"private function prepareTables() {}",
"private function clear() {\n $this->select = null;\n $this->where = null;\n $this->order_by = array();\n $this->group_by = '';\n $this->join = array();\n $this->limit = '';\n $this->where_in = null;\n }",
"function base_clear(){\n $tables = array(\n 'oc_product',\n 'oc_product_image',\n 'oc_manufacturer',\n 'oc_manufacturer_description',\n 'oc_product_description',\n 'oc_product_to_category',\n 'oc_product_attribute',\n 'oc_attribute',\n 'oc_attribute_description',\n // 'oc_attribute_value',\n // 'oc_category',\n // 'oc_category_description',\n 'oc_product_to_store',\n // 'oc_category_to_store',\n 'oc_manufacturer_to_store',\n 'oc_product_to_layout',\n // 'oc_category_to_layout',\n );\n foreach ($tables as $table)\n {\n sDb::query(\"TRUNCATE TABLE $table\");\n echo \"Таблица $table очищена\\n\";\n }\n}",
"function reset(){\n\t\t$this->__columns = array();\n\t\t$this->__actions = array();\n\t}",
"protected function resetTableInfo()\n {\n $this->constraintLoader = null;\n $this->columnLoader = null;\n $this->identityLoader = null;\n }",
"public function reset()\n {\n $db = PDOController::getInstance();\n \n $req = $db->prepare(\"TRUNCATE TABLE `executedtask` \");\n $req->execute([]);\n }",
"public function resetInitial()\n {\n // drop column\n DB::query()->selectRaw('SET SQL_SAFE_UPDATES = 0;');\n QueryProfile::query()->where('initial_avg_position', '!=', 0)->update(['initial_avg_position' => 0]);\n QueryProfile::query()->where('initial_ctr_value', '!=', 0)->update(['initial_ctr_value' => 0]);\n QueryProfile::query()->where('initial_impressions', '!=', 0)->update(['initial_impressions' => 0]);\n DB::query()->selectRaw('SET SQL_SAFE_UPDATES = 1;');\n }",
"public function reset()\n {\n $this->_metaData = array();\n $this->_columnMap = array();\n }",
"public function clear()\n {\n self::foreignChecks(false);\n $this->model->truncate();\n self::foreignChecks(true);\n }",
"public function truncateTables()\n {\n $tables = [\n 'properties',\n 'users',\n ];\n\n DB::unprepared('TRUNCATE TABLE ' . implode(',', $tables) . ' RESTART IDENTITY CASCADE');\n }",
"public function cleanRoleAndPermissionTables() : void\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n DB::table('roles')->truncate();\n DB::table('permissions')->truncate();\n DB::table('role_has_permissions')->truncate();\n DB::table('model_has_roles')->truncate();\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }",
"public function remove_all_data()\n\t{\n\t\t$this->_data = array();\n\t}",
"function clearAllClicks()\n {\n global $wpdb;\n $query = \"TRUNCATE TABLE \" . $this->table_name;\n return $wpdb->query($query);\n }",
"private function cleanCoreTables() {\n\n $core_tables = [\n 'glpi_datacenters',\n 'glpi_dcrooms',\n 'glpi_items_racks',\n 'glpi_pdus',\n 'glpi_racks',\n 'glpi_rackmodels',\n 'glpi_racktypes',\n 'glpi_passivedcequipments',\n 'glpi_passivedcequipmenttypes',\n 'glpi_passivedcequipmentmodels',\n ];\n\n foreach ($core_tables as $table) {\n $result = $this->db->query('TRUNCATE ' . DB::quoteName($table));\n\n if (!$result) {\n throw new RuntimeException(\n sprintf('Unable to truncate table \"%s\"', $table)\n );\n }\n }\n }",
"public function cleanRecords(){\n\t\tOpendocs::model()->deleteAll(\" createTime<=(NOW()-1)\");//oracle\n\t}",
"public function run()\n {\n DB::table('companies')->truncate();\n }",
"public function reset() {\n\t\t\tforeach ( $this->dbFields as $property ) {\n\t\t\t\t$this->$property = '';\n\t\t\t}\n\t\t\t$this->pageData = null;\n\t\t\t$this->attributes = null;\n\t\t\t// TODO: set exdata to array()?\n\t\t}",
"function truncateData(){\n\t\t$userid=$GLOBALS['username'];\n mysql_query(\"SET FOREIGN_KEY_CHECKS=0;\");\n\t\t$truncateSource = mysql_query(\"TRUNCATE TABLE \".$userid.\"nertag\") or die(mysql_error());\n\t\t$truncateTarget = mysql_query(\"TRUNCATE TABLE \".$userid.\"sentences\") or die(mysql_error());\n mysql_query(\"SET FOREIGN_KEY_CHECKS=1;\");\n}",
"private function reset()\n\t{\t\t\n\t\t$this->limit = null;\n\t\t\n\t\t$this->table = null;\n\t\t\n\t\t$this->offset = null;\n\t\t\n\t\t$this->data = [];\n\t\t\n\t\t$this->joins = [];\n\t\t\n\t\t$this->wheres = [];\n\t\t\n\t\t$this->orderBy = [];\n\t\t\n\t\t$this->selects = [];\n\t\t\n\t\t$this->bindings = [];\n\t\t\t\n\t}",
"protected function _prepareColumns()\n {\n \tparent::_prepareColumns();\n \tunset($this->_columns['actionColumn']);\n }",
"protected function _clearSchema()\n {\n\n // Show all tables in the installation.\n foreach (get_db()->query('SHOW TABLES')->fetchAll() as $row) {\n\n // Extract the table name.\n $rv = array_values($row);\n $table = $rv[0];\n\n // If the table is a Neatline table, drop it.\n if (in_array('neatline', explode('_', $table))) {\n $this->db->query(\"DROP TABLE $table\");\n }\n\n }\n\n }",
"public function clean()\n {\n\n $this->model = null;\n $this->value = null;\n $this->attribute = null;\n $this->data = [];\n\n $this->fkTable = null;\n\n $this->fkQuery = null;\n $this->fkAndQuery = null;\n $this->fkOrQuery = null;\n\n }",
"public function refreshRows(){\n if (count($this->rows) > 0){\n foreach ($this->rows as $row){\n $this->removeRow($row);\n }\n }\n }",
"public function clear_tables()\n\t{\n\t\tglobal $wpdb;\n\t\t$wpdb->query( 'DELETE FROM '.self::$site_table.';' );\n\t}",
"protected function resetExistingTables()\n {\n $this->existingTables = null;\n }",
"function revert_table() {\r\n $this->_table = $this->_table_org;\r\n $this->_table_org = NULL;\r\n }",
"public function clean()\n\t{\n\t\tforeach ($this->dirtyFields AS $field)\n\t\t\t$this->cleanField($field);\n\t}",
"public function purgeUndoTable()\n\t{\n\t\t$objDatabase = \\Database::getInstance();\n\n\t\t// Truncate the table\n\t\t$objDatabase->execute(\"TRUNCATE TABLE tl_undo\");\n\n\t\t// Add a log entry\n\t\t$this->log('Purged the undo table', __METHOD__, TL_CRON);\n\t}",
"public function unpopulate();",
"function ReInitTableColumns()\n {\n if ($this->debug_mode)\n echo $this->ClassName . \"::ReInitTableColumns();\" . \"<HR>\";\n foreach ($this->form_fields as $prefix => $form) {\n foreach ($form as $i => $field) {\n foreach ($field as $param => $value) {\n //if found database parameters\n if (strpos($param, \"dbfield_\") !== false) {\n $columnparam = substr($param, strlen(\"dbfield_\"), strlen($param));\n $this->Storage->setColumnParameter($field[\"field_name\"], trim($columnparam), $value);\n }\n }\n }\n }\n }",
"public function wipeAll() {\n\t\tforeach($this->getTables() as $t) {\n\t\t\tforeach($this->getKeys($t) as $k) {\n\t\t\t\t$this->adapter->exec(\"ALTER TABLE \\\"{$k['FKTABLE_NAME']}\\\" DROP FOREIGN KEY \\\"{$k['FK_NAME']}\\\"\");\n\t\t\t}\n\t\t\t$this->adapter->exec(\"DROP TABLE \\\"$t\\\"\");\n\t\t}\n\t\tforeach($this->getTables() as $t) {\n\t\t\t$this->adapter->exec(\"DROP TABLE \\\"$t\\\"\");\n\t\t}\n\t}",
"private function resetQuery()\n {\n $this->cols('*');\n }",
"static function clearContact( $table='mapContact' ) {\n $sql = \"DROP TABLE IF EXISTS {$table}\";\n return $sql;\n }",
"function clearSQL() {}",
"public function clear() {\n\t\t$this->_where\t\t= array();\n\t\t$this->_order\t\t= array();\n\t\t$this->_isAddingNew\t= false;\n\t\t$this->_currentRow\t= 0;\n\t\t$this->_relationship\t= array();\n\t\t$this->_recordset\t= array();\n\t\t$this->_updateBuffer\t= array();\n\t\t$this->_limit\t\t= NULL;\n\t\t$this->_offset\t\t= NULL;\n\t\t$this->isDirty( false );\n\t}",
"public function deleteAll()\n {\n $query = 'TRUNCATE TABLE `'. $this->getTableName() .'`';\n $this->db->sql_query($query);\n }",
"public function deleteTable(){\n\t \n\t\tglobal $wpdb;\n\n\t\t$wpdb->query('DELETE FROM wp_nouveautes_test WHERE datep_nouveaute > \"2014-04-13\"');\n\n\t\t$wpdb->query('DELETE FROM wp_custom_categories_test WHERE term_id > 247');\n\t\t\t\t \n\t\t$wpdb->query('TRUNCATE TABLE wp_subcategories_test');\n\t\t\n\t\t$wpdb->query('TRUNCATE TABLE wp_extracategories_test');\n\t\t\n\t\t$wpdb->query('TRUNCATE TABLE wp_updated');\n\t\t \t\t \n\t}",
"function truncateTable() {\n\t\t$dbh=$this->getdbh();\n\t\treturn $dbh->query('TRUNCATE TABLE '.$this->enquote($this->tablename));\n\t\t\n\t}",
"function clear() {\r\n /* clear datasource. you should call this before calling another populate() to avoid datasource gets appended\r\n */\r\n $this->ds = new DataSource;\r\n $this->db_count = 0;\r\n }",
"public function dropAllData()\n {\n $database_name = $this->conn->getDatabase();\n\n $tables = $this->conn->query(\"SELECT concat('DROP TABLE IF EXISTS ', table_name, ';') FROM information_schema.tables WHERE table_schema = '$database_name';\")->fetchAll();\n\n $queries = \"SET FOREIGN_KEY_CHECKS=0;\\n\";\n\n foreach ($tables as $aTable){\n $queries .= reset($aTable);\n }\n\n $this->conn->executeQuery($queries);\n\n $editora_structure = file_get_contents(__DIR__ .'/../../../../data/editora.sql');\n\n $this->conn->executeQuery($editora_structure);\n }",
"public function run()\n {\n DB::table('messages')->truncate();\n DB::table('medicinal_plants_history')->truncate();\n DB::table('medicinal_plants_reports')->truncate();\n DB::table('medicinal_plants_reviews')->truncate();\n DB::table('remedies_history')->truncate();\n DB::table('remedies_reports')->truncate();\n DB::table('remedies_reviews')->truncate();\n DB::table('store_prescriptions')->truncate();\n }",
"public function clean(){\n\t\t$sql = 'DELETE FROM ano_letivo';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\treturn $this->executeUpdate($sqlQuery);\n\t}",
"public function clean(){\n\t\t$sql = 'DELETE FROM compra_coletiva';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\treturn $this->executeUpdate($sqlQuery);\n\t}",
"protected function _resetData()\n\t{\n\n\t\t// clean data, total and pagination, as we need them rebuilt\n\t\t$this->_data = null;\n\t\t$this->_total = null;\n\t\t$this->_pagination = null;\n\t}",
"function clear($table){\n\t\t$r=mysql_query(\"TRUNCATE `$table`\");\n\t}",
"public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS = 0;');\n DB::table('usuario')->truncate();\n DB::table('rol')->truncate();\n DB::table('rol_usuario')->truncate();\n DB::table('permiso')->truncate();\n DB::table('permiso_rol')->truncate();\n DB::table('permiso_usuario')->truncate();\n DB::statement('SET FOREIGN_KEY_CHECKS = 1;');\n }",
"public function clean() {\n \t$result = '';\n\n\t foreach($this->tables as $table) {\n\t\t $ret = $table->clean();\n\t\t if($ret !== null) {\n\t\t \t$result .= $ret;\n\t\t }\n\t }\n\n\t if(strlen($result) > 0) {\n\t \treturn $result;\n\t }\n\n \treturn \"No cleaning specified for this table type\\n\";\n }",
"public function cleanRecordVersions()\n\t{\n \t\t$this -> db -> query(\"DELETE FROM `\".$this -> table.\"` \n \t\t\t\t\t\t\t WHERE `model`='\".$this -> model.\"' \n \t\t\t\t\t\t\t AND `row_id`='\".$this -> row_id.\"'\");\n \t\treturn $this;\n \t}",
"public function run()\n {\n echo PHP_EOL , 'cleaning old data....', PHP_EOL;\n\n DB::statement(\"SET foreign_key_checks=0\");\n\n User::truncate();\n Role::truncate();\n UserRole::truncate();\n Permission::truncate();\n DB::table('roles_permissions')->truncate();\n DB::table('users_permissions')->truncate();\n\n DB::statement(\"SET foreign_key_checks=1\");\n\n $this->call(RolesTableSeeder::class);\n $this->call(PermissionTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n }",
"public function clearTable()\r\n {\r\n $write = $this->getResource()->cleanTable();\r\n return $this;\r\n }",
"protected function _after()\n {\n $this->_adapter->execute('drop table if exists comments;\n drop table if exists posts_tags;\n drop table if exists posts;\n drop table if exists tags;\n drop table if exists profiles;\n drop table if exists credentials;\n drop table if exists people;\n ');\n parent::_after();\n }",
"public function Upkeep() {\n \n $this->_Upkeep_Entry_Notes_Table();\n }",
"public static function clear_schema()\n {\n }",
"protected function _prepareRowsAction() {\n \n }",
"public function clean(){\n\t\t$sql = 'DELETE FROM aluno';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\treturn $this->executeUpdate($sqlQuery);\n\t}",
"public function clean(){\n\t\t$sql = 'DELETE FROM grupo_usuario_tabelas';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\treturn $this->executeUpdate($sqlQuery);\n\t}",
"public function clear()\n\t{\n\t\t$this->uniqid = '';\n\t\t$this->base_url = '';\n\t\t$this->no_result = '';\n\t\t$this->pagination_tmpl = '';\n\n\t\t$this->sort = array();\n\t\t$this->column_config = array();\n\n\t\t$this->jq_template = FALSE;\n\n\t\t$this->rows\t\t\t\t= array();\n\t\t$this->heading\t\t\t= array();\n\t\t$this->auto_heading\t\t= TRUE;\n\t}",
"function reset_rows()\n{\n}",
"function cleanVisitorTable($database = \"\"){\n\t\t\n\t\t$sql = \"TRUNCATE TABLE visitor\"; \n\t\t\n\t\ttry{\n\t\t\t\n\t\t\t$query = $database->exec($sql);\n\t\t\t\n\t\t\techo 'Succesfully ran rhe clean up operation.';\n\t\t\t\n\t\t} catch(PDOException $error){\n\t\t\n\t\t\techo 'Error with query. '.$error->getMessage();\n\t\t\n\t\t}\n\t\t\n\t}",
"public function delete() {\n\t\tglobal $wpdb;\n\t\t$wpdb->query( 'TRUNCATE TABLE ' . $wpdb->prefix . 'woocommerce_tax_rates' );// phpcs:ignore\n\t\t$wpdb->query( 'TRUNCATE TABLE ' . $wpdb->prefix . 'wc_tax_rate_classes' );// phpcs:ignore\n\t\t$wpdb->query( 'TRUNCATE TABLE ' . $wpdb->prefix . 'woocommerce_order_items' );// phpcs:ignore\n\t\t$wpdb->query( 'TRUNCATE TABLE ' . $wpdb->prefix . 'woocommerce_order_itemmeta' );// phpcs:ignore\n\t\t$this->order = null;\n\t\t$this->product = null;\n\t\t$this->tax_rate_ids = array();\n\t}",
"public function clean(){\n\t\t$sql = 'DELETE FROM conta_a_pagar';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\treturn $this->executeUpdate($sqlQuery);\n\t}",
"public function unsetProperty()\n\t{\n\t\t$this -> tableName = '';\n\t\t$this -> databaseName = '';\n\t\t$this -> arrNewData = array();\n\t\t$this -> arrOldData = array();\n\t}",
"function cleanTables($test = false) {\n\n\t\t$this->cleanForeignKey('sotf_blobs', 'id', 'sotf_node_objects', 'id');\n\n\t\t$this->cleanForeignKey('sotf_blobs', 'object_id', 'sotf_node_objects', 'id');\n\n\t\t$this->cleanForeignKey('sotf_nodes', 'id', 'sotf_node_objects', 'id');\n\n\t\t$this->cleanForeignKey('sotf_user_permissions', 'permission_id', 'sotf_permissions', 'id');\n\n\t\t$this->cleanForeignKey('sotf_stations', 'id', 'sotf_node_objects', 'id');\n\n\t\t$this->cleanForeignKey('sotf_contacts', 'id', 'sotf_node_objects', 'id');\n\n\t\t$this->cleanForeignKey('sotf_contacts', 'station_id', 'sotf_stations', 'id');\n\n\t\t$this->cleanForeignKey('sotf_series', 'id', 'sotf_node_objects', 'id');\n\n\t\t$this->cleanForeignKey('sotf_series', 'station_id', 'sotf_stations', 'id');\n\n\t\t$this->cleanForeignKey('sotf_object_roles', 'id', 'sotf_node_objects', 'id');\n\n\t\t$this->cleanForeignKey('sotf_object_roles', 'contact_id', 'sotf_contacts', 'id');\n\n\t\t$this->cleanForeignKey('sotf_object_roles', 'object_id', 'sotf_node_objects', 'id');\n\n\t\t$this->cleanForeignKey('sotf_programmes', 'id', 'sotf_node_objects', 'id');\n\n\t\t$this->cleanForeignKey('sotf_programmes', 'station_id', 'sotf_stations', 'id');\n\n\t\t//// series field is not compulsory! \n\t\t//// $this->cleanForeignKey('sotf_programmes', 'series_id', 'sotf_series', 'id');\n\n\t\t$this->cleanForeignKey('sotf_rights', 'id', 'sotf_node_objects', 'id');\n\n\t\t$this->cleanForeignKey('sotf_rights', 'prog_id', 'sotf_programmes', 'id');\n\n\t\t$this->cleanForeignKey('sotf_extradata', 'id', 'sotf_node_objects', 'id');\n\n\t\t$this->cleanForeignKey('sotf_extradata', 'prog_id', 'sotf_programmes', 'id');\n\n\t\t$this->cleanForeignKey('sotf_other_files', 'id', 'sotf_node_objects', 'id');\n\n\t\t$this->cleanForeignKey('sotf_other_files', 'prog_id', 'sotf_programmes', 'id');\n\n\t\t$this->cleanForeignKey('sotf_media_files', 'id', 'sotf_node_objects', 'id');\n\n\t\t$this->cleanForeignKey('sotf_media_files', 'prog_id', 'sotf_programmes', 'id');\n\n\t\t$this->cleanForeignKey('sotf_links', 'id', 'sotf_node_objects', 'id');\n\n\t\t$this->cleanForeignKey('sotf_links', 'prog_id', 'sotf_programmes', 'id');\n\n\t\t$this->cleanForeignKey('sotf_topic_tree_defs', 'id', 'sotf_node_objects', 'id');\n\n\t\t$this->cleanForeignKey('sotf_topic_trees', 'id', 'sotf_node_objects', 'id');\n\n\t\t$this->cleanForeignKey('sotf_topics', 'id', 'sotf_node_objects', 'id');\n\n\t\t$this->cleanForeignKey('sotf_topics', 'topic_id', 'sotf_topic_tree_defs', 'id');\n\n\t\t$this->cleanForeignKey('sotf_prog_topics', 'id', 'sotf_node_objects', 'id');\n\n\t\t$this->cleanForeignKey('sotf_prog_topics', 'prog_id', 'sotf_programmes', 'id');\n\n\t\t$this->cleanForeignKey('sotf_genres', 'id', 'sotf_node_objects', 'id');\n\n\t\t$this->cleanForeignKey('sotf_roles', 'id', 'sotf_node_objects', 'id');\n\n\t\t$this->cleanForeignKey('sotf_role_names', 'id', 'sotf_node_objects', 'id');\n\n\t\t$this->cleanForeignKey('sotf_role_names', 'role_id', 'sotf_roles', 'role_id');\n\n\t\t$this->cleanForeignKey('sotf_deletions', 'id', 'sotf_node_objects', 'id');\n\n\t\t$this->cleanForeignKey('sotf_playlists', 'prog_id', 'sotf_programmes', 'id');\n\n\t\t$this->cleanForeignKey('sotf_ratings', 'prog_id', 'sotf_programmes', 'id');\n\n\t\t$this->cleanForeignKey('sotf_prog_rating', 'id', 'sotf_node_objects', 'id');\n\n\t\t$this->cleanForeignKey('sotf_prog_rating', 'prog_id', 'sotf_programmes', 'id');\n\n\t\t$this->cleanForeignKey('sotf_prog_refs', 'id', 'sotf_node_objects', 'id');\n\n\t\t$this->cleanForeignKey('sotf_prog_refs', 'prog_id', 'sotf_programmes', 'id');\n\n\t\t$this->cleanForeignKey('sotf_prog_stats', 'id', 'sotf_node_objects', 'id');\n\n\t\t$this->cleanForeignKey('sotf_prog_stats', 'prog_id', 'sotf_programmes', 'id');\n\t\t\n\t\t$this->cleanForeignKey('sotf_prog_stats', 'station_id', 'sotf_stations', 'id');\n\n\t\t$this->cleanForeignKey('sotf_stats', 'prog_id', 'sotf_programmes', 'id');\n\n\t\t$this->cleanForeignKey('sotf_stats', 'station_id', 'sotf_stations', 'id');\n\n\t\t$this->cleanForeignKey('sotf_comments', 'prog_id', 'sotf_programmes', 'id');\n\n\t\t$this->cleanForeignKey('sotf_to_forward', 'prog_id', 'sotf_programmes', 'id');\n\n\t\t$this->cleanForeignKey('sotf_unique_access', 'prog_id', 'sotf_programmes', 'id');\n\n\t\t$this->cleanForeignKey('sotf_user_progs', 'prog_id', 'sotf_programmes', 'id');\n\n\t\t$this->cleanForeignKey('sotf_portals', 'id', 'sotf_node_objects', 'id');\n\n\t\t$this->cleanForeignKey('sotf_station_mappings', 'id_at_node', 'sotf_node_objects', 'id');\n\n\t\t$this->cleanForeignKey('sotf_station_mappings', 'station', 'sotf_stations', 'id');\n\n\t\t// very important! for syncing!!\n\t\t$this->cleanForeignKey('sotf_object_status', 'id', 'sotf_node_objects', 'id');\n\n\t\t$this->cleanNodeObjects();\n\n\t}",
"function purgeSeedings() {\n\n $this->db->empty_table( \"TournamentSeeds\" );\n \n/* ... time to go */\n return;\n }",
"protected function prepareDetailsTables()\n\t{\n\t}",
"public static function dbClear(){\n\t\tif (App::runningUnitTests()) {\n\t\t\tself::clearModelTables(TestSettings::$modelTables);\n\t\t\tself::clearTables(TestSettings::$pivotTables);\n\t\t}\n\t}",
"public function Clear() {\n\t\t$this->sql = \"SELECT 1, 2, 3, 4, 5, 6, 7\";\n }",
"public function reset() {\n $this->databasefieldcount = 0;\n $this->databaserecordcount = 0;\n\n parent::reset();\n }",
"protected function _clear()\n\t{\n\t\t$this->_query = null;\n\t\t$this->_set = null;\n\t\t$this->_where = null;\n\t\t$this->_limit = null;\n\t}",
"protected function reset() {\n //query builder reset\n $this->queryBuilder->reset();\n $this->numRows = 0;\n $this->insertId = null;\n $this->query = null;\n $this->result = array();\n $this->data = array();\n $this->queryCount = 0;\n }",
"function flush() {\n\n\t\t\t// Get rid of these\n\t\t\t$this->last_result = null;\n\t\t\t$this->col_info = null;\n\n\t\t}",
"public function clean();",
"public function clean();",
"public function clean();",
"public function clean();",
"public function clean();"
] | [
"0.72845",
"0.7246547",
"0.7113251",
"0.70214254",
"0.70022357",
"0.69601506",
"0.69232076",
"0.68886465",
"0.687494",
"0.6865221",
"0.67039084",
"0.6687502",
"0.66790766",
"0.66769564",
"0.6674517",
"0.6666366",
"0.66458136",
"0.66273004",
"0.6609333",
"0.6593146",
"0.6583523",
"0.65831316",
"0.65739596",
"0.65692216",
"0.65600634",
"0.6525228",
"0.6501476",
"0.6487529",
"0.6463049",
"0.64295095",
"0.64262146",
"0.64184153",
"0.64135337",
"0.64023924",
"0.6397063",
"0.6359472",
"0.6337076",
"0.6319438",
"0.6312397",
"0.63080806",
"0.63079107",
"0.63065356",
"0.62968844",
"0.62859666",
"0.6280056",
"0.627935",
"0.6255009",
"0.6249112",
"0.6245288",
"0.6244537",
"0.6238349",
"0.623592",
"0.6229931",
"0.6227864",
"0.62086034",
"0.6204537",
"0.62010604",
"0.6190162",
"0.6183847",
"0.6177526",
"0.61728764",
"0.61363846",
"0.61330706",
"0.6132064",
"0.61196524",
"0.6118562",
"0.611795",
"0.6117731",
"0.61144525",
"0.61118686",
"0.610812",
"0.6105609",
"0.60924304",
"0.6091573",
"0.60913974",
"0.60898626",
"0.60841554",
"0.6084091",
"0.60755426",
"0.6069706",
"0.6068874",
"0.6048419",
"0.60398966",
"0.60309714",
"0.60244685",
"0.60234356",
"0.60222554",
"0.60174817",
"0.6016821",
"0.60147184",
"0.60035634",
"0.5995712",
"0.59941024",
"0.59937954",
"0.5993049",
"0.5985363",
"0.59727633",
"0.59727633",
"0.59727633",
"0.59727633",
"0.59727633"
] | 0.0 | -1 |
Get list of unique fields. | public function getUniqueActiveFields(): array
{
return ['field', 'otherfield'];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function getUniqeFields()\n\t{\n\t\treturn array('meetingid');\n\t}",
"public function uniquedata()\n {\n $required = self::config()->required_fields; //TODO: also combine with all ancestors of this->class\n $unique = [];\n $hasOnes = $this->hasOne();\n //reduce record to only required fields\n if ($required) {\n foreach ($required as $field) {\n if ($hasOnes === $field || isset($hasOnes[$field])) {\n $field = $field . 'ID'; //add ID to hasones\n }\n $unique[$field] = $this->$field;\n }\n }\n return $unique;\n }",
"public static function getListOfUserFields()\n {\n // so, list needs to be manually updated\n return array(\n \"morgid\",\n \"garageid\",\n \"talkid\",\n \"username\",\n \"password\",\n \"joindate\",\n \"title\",\n \"firstname\",\n \"lastname\",\n \"birthdate\",\n \"street\",\n \"postcode\",\n \"city\",\n \"country\",\n \"ccode\",\n \"email\",\n \"phone\",\n \"fax\",\n \"homepage\",\n \"jabber\",\n \"icq\",\n \"aim\",\n \"yahoo\",\n \"msn\",\n \"skype\",\n );\n }",
"public function getUniqueFields(Model $Model) {\n\t\tif (!$this->_options[$Model->alias]['unique']) {\n\t\t\t$fields = $Model->schema();\n\t\t\tunset($fields[$Model->primaryKey]);\n\t\t\t$this->_options[$Model->alias]['unique'] = array_keys($fields);\n\t\t}\n\t\treturn $this->_options[$Model->alias]['unique'];\n\t}",
"public function getFieldsAttribute(): Collection\n {\n if (! $repeatable = $this->getRepeatable()) {\n return collect([]);\n }\n\n return $repeatable->getRegisteredFields();\n }",
"final public function getAllFields()\r\n {\r\n return array($this->_field);\r\n }",
"public function getFields() {\n return array_keys($this->_fields);\n }",
"public function listFields()\n {\n return array_keys($this->fields);\n }",
"public function getListFields();",
"public function getFields()\r\n {\r\n return array_keys($this->fields);\r\n }",
"private static function fields()\n {\n $fields = static::$fields;\n $primary_key = static::$primary_key;\n\n $rows = [$primary_key, ...$fields];\n\n if(!count($rows)) {\n return ['*'];\n }\n\n return $rows;\n }",
"public function getFields() {\n\t\treturn array(\n\t\t\tself::FIELD_ID,\n\t\t\tself::FIELD_PHRASE_ID,\n\t\t\tself::FIELD_LANGUAGE_ID,\n\t\t\tself::FIELD_TRANSLATION,\n\t\t\tself::FIELD_CREATED_AT,\n\t\t\tself::FIELD_USER_ID,\n\t\t);\n\t}",
"public function getFields() {\n\t\treturn array(\n\t\t\tself::FIELD_ID,\n\t\t\tself::FIELD_NAME,\n\t\t\tself::FIELD_CREATED_AT,\n\t\t);\n\t}",
"public function getFields()\n {\n return array_keys($this->fields);\n }",
"public function getFields() {\n return array_keys($this->fields);\n }",
"static public function getFieldsList () {\n return self::_getInstance()->_fieldsList;\n }",
"public function getUsableFormFields()\n {\n $fields = array();\n\n // Get all form fields which can be used for MailChimp values\n $objFields = Database::getInstance()->prepare(\"SELECT id,name,label FROM tl_form_field WHERE pid=? AND (type=? OR type=? OR type=? OR type=? OR type=?) ORDER BY name ASC\")\n ->execute(Input::get('id'), 'text', 'hidden', 'select', 'radio', 'checkbox');\n\n $fields[] = '-';\n while ($objFields->next())\n {\n $k = $objFields->name;\n $v = $objFields->label;\n $v = strlen($v) ? $v.' ['.$k.']' : $k;\n $fields[$k] =$v;\n }\n\n return $fields;\n }",
"public function fields()\n {\n return array_map(\n function (array $field) {\n return Field::fromArray($field);\n },\n $this->client->get('field')\n );\n }",
"public function getFields()\n\t{\n\t\treturn [];\n\t}",
"final public function getFields(): array\n {\n return array_keys($this->fields);\n }",
"protected function __fields() {\n $Fields = array_keys(get_object_vars($this));\n if (!empty ($this->__onlyFields)) {\n $Fields = $this->__onlyFields;\n }\n $NewFields = array();\n foreach ($Fields as $field) {\n if (in_array ($field, array ('__bound', '__Data', 'cleaned_data', 'label_suffix', 'required_suffix', 'is_editable', 'suppress_errors'))) continue;\n if (!is_object($this->$field)) continue;\n if (!empty ($this->disabled[$field])) continue;\n if (in_array ($field, $this->__Exclude)) continue;\n $NewFields[] = $field;\n }\n return $NewFields;\n }",
"function GetFieldsList()\n\t{\n\t\tglobal $dal_info;\n\t\treturn array_keys( $dal_info[ $this->infoKey ] );\n\t}",
"public function getFieldsList(){\n return $this->_get(1);\n }",
"public function getUserFields()\r\n {\r\n return CrugeFactory::get()->getICrugeFieldListModels();\r\n }",
"private function getFacetFields()\n {\n $fields = [];\n\n foreach ($this->getConfig()->getFacetConfig() as $facet) {\n $fields[] = $facet['field'];\n }\n\n return array_unique($fields);\n }",
"public function fields()\n {\n return [];\n }",
"public function fields()\n {\n return [];\n }",
"public function fields()\n {\n return [];\n }",
"public function fields()\n {\n return [];\n }",
"public function fields()\n {\n return [];\n }",
"public static function fields()\n {\n return array_keys(Scholarship::validations());\n }",
"public function getFieldsList()\n {\n return $this->table_fields_names;\n }",
"function _get_field_names()\n {\n return array();\n }",
"public static function getFields() {\n return self::$fields;\n }",
"public function getFieldValues() {\n return array_values($this->_fields);\n }",
"public function all_fields()\n {\n $allfields = array();\n foreach (array_values($this->CLASS_CONTAINER) as $val){\n $allfields = array_merge($allfields, $this->{$val});\n }\n foreach (array_values($this->singular_fields) as $val){\n if($this->{$val}) {\n $allfields[] = $this->{$val};\n }\n }\n\n return $allfields;\n }",
"public function fields()\n {\n $fields = array();\n\n foreach ($this->_data as $field => $row)\n {\n $fields[$field] = $row['value'];\n }\n\n return $fields;\n }",
"function list_fields()\n\t{\n\t\t$field_names = array();\n\t\twhile ($field = mysqli_fetch_field($this->result_id))\n\t\t{\n\t\t\t$field_names[] = $field->name;\n\t\t}\n\n\t\treturn $field_names;\n\t}",
"public function getFieldNames(){\n $names=[];\n if (!empty($this->dbFields)){\n foreach($this->dbFields as $dbField){\n $names[$dbField->id]=$dbField->name;\n }\n }\n return $names;\n }",
"function _get_fields()\n\t{\n\t\tglobal $DB;\n\t\n\t\tif ( ! isset($this->cache['fields']))\n\t\t{\n\t\t\t$this->cache['fields'] = array();\n\n\t\t\t$query = $DB->query('SELECT field_id FROM exp_weblog_fields\n\t\t\t WHERE field_type = \"ftype_id_'.$this->_fieldtype_id.'\"');\n\t\t\tif ($query->num_rows)\n\t\t\t{\n\t\t\t\tforeach($query->result as $row)\n\t\t\t\t{\n\t\t\t\t\t$this->cache['fields'][] = 'field_id_'.$row['field_id'];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $this->cache['fields'];\n\t}",
"public function fields(): array\n {\n return [\n ID::make(),\n DateTime::make('createdAt')->sortable()->readOnly()->hidden(),\n DateTime::make('updatedAt')->sortable()->readOnly()->hidden(),\n Str::make('slug'),\n Str::make('name'),\n ];\n }",
"private function _fields() {\n if ($this->_table() && empty($this->fields)) {\n $this->fields = $this->db->list_fields($this->_table());\n }\n return $this->fields;\n }",
"private function getFields()\n {\n return [\n [\n \"field_type\" => \"text\",\n \"field_name\" => \"first_name\",\n \"field_editable\" => rand(0,1000) % 2 === 0 ? true : false,\n \"field_values\" => null,\n ],\n [\n \"field_type\" => \"text\",\n \"field_name\" => \"last_name\",\n \"field_editable\" => rand(0,1000) % 2 === 0 ? true : false,\n \"field_values\" => null,\n ],\n [\n \"field_type\" => \"checkbox\",\n \"field_name\" => \"happy\",\n \"field_editable\" => rand(0,1000) % 2 === 0 ? true : false,\n \"field_values\" => null,\n ],\n [\n \"field_type\" => \"select\",\n \"field_name\" => \"character\",\n \"field_editable\" => rand(0,1000) % 2 === 0 ? true : false,\n \"field_values\" => [\n [\"value\" => \"biff\", \"label\" => \"Biff\"],\n [\"value\" => \"marty\", \"label\" => \"Marty\"],\n [\"value\" => \"doc\", \"label\" => \"Doc Brown\"],\n [\"value\" => \"jennifer\", \"label\" => \"Jennifer\"],\n [\"value\" => \"needles\", \"label\" => \"Needles\"],\n ]\n ],\n [\n \"field_type\" => \"checkbox\",\n \"field_name\" => \"kids\",\n \"field_editable\" => rand(0,1000) % 2 === 0 ? true : false,\n \"field_values\" => null,\n ],\n ];\n }",
"public function getAllFields()\n {\n return $this->fields;\n }",
"public function getFieldsNames(): array\n {\n return array_keys($this->fields);\n }",
"public function list_fields()\r\n {\r\n $field_names = array();\r\n $this->resultID->field_seek(0);\r\n while ($field = $this->resultID->fetch_field())\r\n {\r\n $field_names[] = $field->name;\r\n }\r\n\r\n return $field_names;\r\n }",
"public function getFields();",
"public function getFields();",
"public function getFields();",
"public function getFields();",
"public function getFields();",
"public function getFields();",
"public function unique()\n {\n $array = $this->toArray();\n $array = array_unique($array, SORT_REGULAR);\n return static::createFormArray($array, false);\n }",
"private function getCheckableFields()\n {\n return ['index', 'city', 'countryIso', 'text', 'region'];\n }",
"static function custom_get_creatable_fields() {\n # use this functionality to get a list of all field in the table\n return self::default_get_updatable_fields();\n }",
"public function getAllFields();",
"public function fields()\n {\n $fields = parent::fields();\n\n unset($fields['time_sent'], $fields['time_read'], $fields['time_archived'], $fields['uid']);\n\n $fields['timeSent'] = 'time_sent';\n $fields['wasRead'] = 'wasRead';\n $fields['wasArchived'] = 'wasArchived';\n\n return $fields;\n }",
"public function Fields()\n {\n foreach ($this->getExtraFields() as $field) {\n if (!$this->fields->fieldByName($field->getName())) {\n $this->fields->push($field);\n }\n }\n\n return $this->fields;\n }",
"protected function getBareRequiredFieldList()\n {\n $requiredFields = array_keys(singleton('NewsletterSubscription')->stat('db'));\n\n $this->extend('updateBareRequiredFieldList', $requiredFields);\n\n return $requiredFields;\n }",
"public function getFieldNames() {\n return array_keys($this->_fields);\n }",
"public function getFields() {\r\n\t\tif($this->_fields === null) {\r\n\t\t\t$this->_fields = $this->activeDataProvider->model->attributeNames();\r\n\t\t}\r\n\t\treturn $this->_fields;\r\n\t}",
"public function getFields() {\n $field = $this->get('field');\n return null !== $field ? $field : array();\n }",
"protected function getFields()\n {\n $fields = parent::getFields();\n unset($fields['unread']);\n unset($fields['total']);\n unset($fields['outdated']);\n\n return $fields;\n }",
"public function getFields()\n {\n if ($this->fields) {\n return $this->fields;\n }\n\n $this->fields = array(\n 'data_type_id',\n 'name',\n 'aliases',\n 'description',\n 'driver',\n );\n\n return $this->fields;\n }",
"public function getFields(): array\n {\n $fields = [];\n\n foreach ($this->getGroups() as $group) {\n foreach ($group->fields as $field) {\n $fields[$field->id ?? \\count($fields)] = $field;\n }\n }\n\n return $fields;\n }",
"public static function getFields(){\n\t\treturn self::$fields;\n\t}",
"public function getFieldNames() {\n $fields = array();\n foreach ($this->getFields() as $field) {\n $fields[] = $this->getFieldName($field);\n }\n return $fields;\n }",
"function get_fields( ) {\n\t\treturn $this->fields_list;\n\t\t}",
"public static function fields()\n\t{\n\t\t$array = self::$fields;\n\n\t\tfor($g = 0; $g < sizeof(self::$genders); $g++)\n\t\t\t$array[] = 'interested_'.$g;\n\n\t\tfor($i = 0; $i < sizeof(self::$questions); $i++)\n\t\t\t$array[] = 'question_'.$i;\n\n\t\treturn $array;\n\t}",
"protected function getQuickUpdateFields(){\n\t\t/** @var CI $this */\n\t\t$support_list = $this->supportCRUDList();\n\t\t$fields = $support_list[CI::OP_QUICK_UPDATE]['fields'];\n\t\tif(!$fields){\n\t\t\treturn array();\n\t\t}\n\n\t\tif(in_array('*', $fields)){\n\t\t\t/** @var Model $model */\n\t\t\t$model = $this->getModelClass();\n\t\t\t$ins = $model::meta();\n\t\t\t$fields = $ins->getAllPropertiesKey();\n\t\t}\n\t\treturn $fields;\n\t}",
"public function getFields() : FieldCollection;",
"public function field_names()\n\t{\n\t\t// All the fields that are being validated\n\t\t$fields = array_keys(array_merge\n\t\t(\n\t\t\t$this->pre_filters,\n\t\t\t$this->rules,\n\t\t\t$this->callbacks,\n\t\t\t$this->post_filters\n\t\t));\n\n\t\t// Remove wildcard fields\n\t\t$fields = array_diff($fields, array('*'));\n\n\t\treturn $fields;\n\t}",
"public function fields() : DeepList {\n return $this->_fields;\n }",
"public function fields_names(){\n $table_meta = array();\n // get fields in the database table\n\n foreach ($this->_meta() as $meta) {\n array_push($table_meta, $meta->name);\n }\n\n return $table_meta;\n }",
"abstract public function getAllFieldsRealNames(): array;",
"function get_field_ids() {\n\t\t$field_ids = array(\n\t\t\t'all' => array(), // array of all field_ids\n\t\t\t'extra' => array(), // array of all non-whitelisted field IDs\n\n\t\t\t// Whitelisted \"standard\" field IDs:\n\t\t\t// 'email' => field_id,\n\t\t\t// 'name' => field_id,\n\t\t\t// 'url' => field_id,\n\t\t\t// 'subject' => field_id,\n\t\t\t// 'textarea' => field_id,\n\t\t);\n\n\t\tforeach ( $this->fields as $id => $field ) {\n\t\t\t$field_ids['all'][] = $id;\n\n\t\t\t$type = $field->get_attribute( 'type' );\n\t\t\tif ( isset( $field_ids[$type] ) ) {\n\t\t\t\t// This type of field is already present in our whitelist of \"standard\" fields for this form\n\t\t\t\t// Put it in extra\n\t\t\t\t$field_ids['extra'][] = $id;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tswitch ( $type ) {\n\t\t\tcase 'email' :\n\t\t\tcase 'name' :\n\t\t\tcase 'url' :\n\t\t\tcase 'subject' :\n\t\t\tcase 'textarea' :\n\t\t\t\t$field_ids[$type] = $id;\n\t\t\t\tbreak;\n\t\t\tdefault :\n\t\t\t\t// Put everything else in extra\n\t\t\t\t$field_ids['extra'][] = $id;\n\t\t\t}\n\t\t}\n\n\t\treturn $field_ids;\n\t}",
"public function getFields() {\n $fields = $this->_fields;\n\n if ($this->getJoins() && !$fields && $this->getType() === self::SELECT) {\n return array_keys($this->getRepository()->getSchema()->getColumns());\n }\n\n return $fields;\n }",
"public function getUniqueKeyedItems()\r\n {\r\n return $this->uniqueKeyedItems;\r\n }",
"public function getFields()\r\n {\r\n return $this->fields;\r\n }",
"public function getFields()\n {\n return $this->_fields;\n }",
"public function getFields()\n {\n return $this->_fields;\n }",
"public function getFieldList()\n {\n $sObjectName = $this->getShopObjectName();\n\n if ($sObjectName) {\n $oShopObject = oxNew($sObjectName);\n } else {\n $oShopObject = oxNew('oxbase');\n $oShopObject->init($this->getTableName());\n }\n\n if ($oShopObject instanceof oxI18n) {\n $oShopObject->setLanguage(0);\n $oShopObject->setEnableMultilang(false);\n }\n\n $sViewName = $oShopObject->getViewName();\n $sFields = str_ireplace('`' . $sViewName . \"`.\", \"\", strtoupper($oShopObject->getSelectFields()));\n $sFields = str_ireplace(array(\" \", \"`\"), array(\"\", \"\"), $sFields);\n $this->_aFieldList = explode(\",\", $sFields);\n\n return $this->_aFieldList;\n }",
"public function getUniqueId ()\n {\n $this->requireUniqueIdDefined();\n\n // is our primary key one field, or several?\n if (count($this->primaryKey) == 1)\n {\n // it is one field\n return $this->getField(current($this->primaryKey));\n }\n\n // if we get here, then the primary key is several fields\n $return = array();\n foreach ($this->primaryKey as $field)\n {\n $return[$field] = $this->getField($field);\n }\n\n return $return;\n }",
"public function fields()\n {\n return [ \n ];\n }",
"public function getFields() {\n if($this->cachedFields == null) {\n $this->cachedFields = $this->createFields();\n }\n\n return $this->cachedFields;\n }",
"public function getFields()\n {\n return $this->fields;\n }",
"public function getFields()\n {\n return $this->fields;\n }",
"public function getFields()\n {\n return $this->fields;\n }",
"public function getFields()\n {\n return $this->fields;\n }",
"public function getFields()\n {\n return $this->fields;\n }",
"public function getFields()\n {\n return $this->fields;\n }",
"public function getFields()\n {\n return $this->fields;\n }",
"public function getFields()\n {\n return $this->fields;\n }",
"public function getFields()\n {\n return $this->fields;\n }",
"public function getFields()\n {\n return $this->fields;\n }",
"public function getFields()\n {\n return $this->fields;\n }",
"public function getChangedFields()\n {\n\n $fields = [];\n\n if ($this->synchronized || !static::$track) {\n return $fields;\n }\n\n foreach ($this->savedData as $key => $value) {\n\n if ($value != $this->data[$key]) {\n $fields[] = $key;\n }\n }\n\n return $fields;\n\n }",
"public function getFields(): array;",
"public function getFields(): array;",
"public function getFields(): array;"
] | [
"0.747499",
"0.717189",
"0.6844661",
"0.6718805",
"0.66224754",
"0.6542607",
"0.64352566",
"0.6399557",
"0.63964283",
"0.63916385",
"0.63719267",
"0.6371753",
"0.63638735",
"0.6354911",
"0.634861",
"0.6311455",
"0.6302151",
"0.6298277",
"0.6291804",
"0.6288652",
"0.62648344",
"0.6244264",
"0.62258655",
"0.6204392",
"0.6200985",
"0.61992854",
"0.61992854",
"0.61992854",
"0.61992854",
"0.61992854",
"0.618944",
"0.61759",
"0.61626047",
"0.61603403",
"0.61602914",
"0.6153114",
"0.6144241",
"0.61428934",
"0.6137236",
"0.6134882",
"0.6131636",
"0.6124179",
"0.6119577",
"0.60964596",
"0.6082454",
"0.60798866",
"0.60755974",
"0.60755974",
"0.60755974",
"0.60755974",
"0.60755974",
"0.60755974",
"0.60731184",
"0.60578084",
"0.6057342",
"0.60571474",
"0.60539824",
"0.6038778",
"0.60334533",
"0.6027362",
"0.6018686",
"0.60147846",
"0.6012917",
"0.59900856",
"0.5989102",
"0.5978821",
"0.59759456",
"0.5962346",
"0.5958499",
"0.5944353",
"0.5940027",
"0.5922284",
"0.5919496",
"0.5918794",
"0.5914075",
"0.5908669",
"0.5905214",
"0.5904981",
"0.58939195",
"0.58935374",
"0.58935374",
"0.5890318",
"0.5886274",
"0.5884279",
"0.587572",
"0.586924",
"0.586924",
"0.586924",
"0.586924",
"0.586924",
"0.586924",
"0.586924",
"0.586924",
"0.586924",
"0.586924",
"0.586924",
"0.5868918",
"0.586639",
"0.586639",
"0.586639"
] | 0.7211656 | 1 |
Render icon by template | public static function icon($params)
{
$name = isset($params[0]) ? $params[0] : '';
$template = isset($params[1]) ? $params[1] : 'base/_icon.tpl';
return self::renderTemplate($template, [
'name' => $name
]);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function _renderIcon()\n {\n return !empty($this->_icon) ? '<i class=\"' . $this->_icon . '\"></i>' : '';\n }",
"static function icon($icon) {\n\t\treturn self::tag('i', 'glyphicon glyphicon-' . $icon);\n\t}",
"public abstract function render_pix_icon(renderer_base $output, pix_icon $icon);",
"public function render()\n {\n $style = $this->getStyle();\n $text = $this->getText();\n $id = $this->objectName;\n $func = $this->getFunction();\n\n switch ($this->getValue()) {\n case \"0\":\n $image_url = $this->myPrivateImg;\n break;\n case \"1\":\n $image_url = $this->mySharedImg;\n break;\n case \"2\":\n $image_url = $this->groupSharedImg;\n break;\n case \"3\":\n $image_url = $this->otherSharedImg;\n break;\n case \"4\":\n $image_url = $this->myAssignedImg;\n break;\n case \"5\":\n $image_url = $this->myDistributedImg;\n break;\n default:\n if ($this->defaultImg == '{OPENBIZ_RESOURCE_URL}/common/images/icon_data_shared_other.gif') {\n $this->defaultImg = $this->otherSharedImg;\n }\n $image_url = $this->defaultImg;\n break;\n }\n\n if (preg_match(\"/\\{.*\\}/si\", $image_url)) {\n $formobj = $this->getFormObj();\n $image_url = Expression::evaluateExpression($image_url, $formobj);\n } else {\n $image_url = Openbizx::$app->getImageUrl() . \"/\" . $image_url;\n }\n if ($this->width) {\n $width = \"width=\\\"$this->width\\\"\";\n }\n if ($this->link) {\n $link = $this->getLink();\n $target = $this->getTarget();\n $sHTML = \"<a id=\\\"$id\\\" href=\\\"$link\\\" $target $func $style><img $width src='$image_url' /></a>\";\n } else {\n $sHTML = \"<img id=\\\"$id\\\" alt=\\\"\" . $text . \"\\\" title=\\\"\" . $text . \"\\\" $width src='$image_url' />\";\n }\n return $sHTML;\n }",
"public function icon($icon);",
"function i($code){\n $icon = '<i class=\"fa fa-'.$code.'\"></i>';\n return $icon;\n }",
"protected function establish_icon() {\n\t\t$this->icon = \"<i class='sw swp_{$this->key}_icon'></i>\";\n\t}",
"public function getIconTag() {\n\t\treturn '<img class=\"languageIcon jsTooltip\" src=\"' . $this->getIconPath() . '\" title=\"' . $this->getTitle() . '\" alt=\"' . $this->getTitle() . '\" />';\n\t}",
"public function getAuthenticationTypeIconHTML()\n {\n $svgData = file_get_contents(DIR_BASE_CORE . '/images/authentication/community/concrete.svg');\n $publicSrc = '/concrete/images/authentication/community/concrete.svg';\n\n return \"<div class='ccm-concrete-authentication-type-svg' data-src='{$publicSrc}'>{$svgData}</div>\";\n }",
"public function icon(): string;",
"public function render()\n {\n return <<<'blade'\n<{{$tag}} {!! $isButton($tag)?'type=\"button\"':'' !!} {{$attributes->merge(['class'=>'close'])}} data-dismiss=\"{{$dismiss}}\" aria-label=\"{{$ariaLabel}}\">\n <span aria-hidden=\"true\">{!! $icon !!}</span>\n</{{$tag}}>\nblade;\n }",
"protected function getIcon()\n {\n /** @var IconFactory $iconFactory */\n $iconFactory = GeneralUtility::makeInstance(IconFactory::class);\n return $iconFactory->getIcon('px-shopware-clear-cache', Icon::SIZE_SMALL)->render();\n }",
"public function getIcon() {}",
"public static function icon($type)\n {\n $path = __DIR__.'/images/'.$type.'.png';\n if ( ! file_exists($path)) {\n $path = __DIR__.'/images/file.png';\n }\n\n return Response::RAW(\\mime_content_type($path), file_get_contents($path));\n }",
"public function Render()\n {\n return \"<span class='\".$this->Icone.\"' title='\".$this->Title.\"' onclick=\".$this->OnClick.\" > </span>\";\n }",
"public function renderTemplate();",
"public function render(DataObject $row)\n {\n $file = $row->getFile();\n $fileExt = pathinfo($file, PATHINFO_EXTENSION);\n if ($fileExt) {\n $iconImage = $this->assetRepo->getUrl('Ecomteck_ProductAttachment::images/'.$fileExt.'.png');\n $fileIcon = \"<a href=\".$this->dataHelper->getBaseUrl().'/'.$file.\" target='_blank'>\n <img src='\".$iconImage.\"' /></a>\";\n } else {\n $iconImage = $this->assetRepo->getUrl('Ecomteck_ProductAttachment::images/unknown.png');\n $fileIcon = \"<img src='\".$iconImage.\"' />\";\n }\n \n return $fileIcon;\n }",
"public function get_icon()\n {\n return 'fa fa-image';\n }",
"public function iconFunction($icon)\n {\n return sprintf('<span class=\"fa fa-%s\"></span>', $icon);\n }",
"public static function icon()\n {\n return '<i class=\"fas fa-plane-departure sidebar-icon\"></i>';\n }",
"public function icon(): string\n {\n return 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAACYSURBVEhLYxgFJIHU1FSjtLS0i0D8AYj7gEKMEBkqAaAFF4D4ERCvAFrwH4gDoFIMKSkpFkB+OTEYqgUTACXfA/GqjIwMQyD9H2hRHlQKJFcBEiMGQ7VgAqCBvUgK32dmZspCpagGGNPT0/1BLqeF4bQHQJePpiIwhmrBBEADR1MRfgB0+WgqAmOoFkwANHA0FY0CUgEDAwCQ0PUpNB3kqwAAAABJRU5ErkJggg==';\n }",
"function icon() {\n global $CFG;\n\n return \"<img src='$CFG->wwwroot/blocks/ilp/pix/graphicon.jpg' height='24' width='24' />\";\n }",
"public function icon(): string\n {\n return 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAADLSURBVEhL5ZRLCsIwGAa7UkE9gd5HUfEoekxxJx7AhXoCca/fhESkJiQxBHwMDG3S/9EmJc0n0JMruZVXK/fMdWQRY7mXt4A7OZJvwZu74hRayIEc2nv3jGtXZrOWrnifiRY0OkhiWK5sWGeS52bkZymJ2ZhRJmwmySxLCL6CmIsZZUIixkiNezCRR+kSUyWH3Cgn6SuQIk2iuOBckvN+t8FMnq1TJloUN3jefN9mhvJeCAVWb8CyUDj0vxc3iPFHDaofFdUPu2+iae7nYJMCY/1bpAAAAABJRU5ErkJggg==';\n }",
"function sIcon($icon, $class = null)\n {\n return '<svg xmlns=\"http://www.w3.org/2000/svg\" class=\"' . $class . '\"><use xlink:href=\"#' . $icon . '\"></use></svg>';\n }",
"public function getIcon();",
"public function getIcon();",
"public function get_icon() {\n\t\treturn 'eicon-image';\n\t}",
"public function icon($service)\n {\n return '<i class=\"icon-'.$service.'\"></i>';\n }",
"function icon($which, $alt='', $url=false, $print_alt = false, $class=false) {\n return new Icon($which, $alt, $url, $print_alt, $class);\n}",
"public function render()\n {\n return (new Button($this->attributes, [\n new Italic(['class' => 'icon ' . $this->icon]),\n $this->content,\n ]))->render();\n }",
"private function renderActionsIcon(ilTemplate $tpl, $iconSrc, $label, $cssClass)\n\t{\n\t\t$tpl->setCurrentBlock(\"actions_icon\");\n\t\t$tpl->setVariable(\"ICON_SRC\", $iconSrc);\n\t\t$tpl->setVariable(\"ICON_TEXT\", $label);\n\t\t$tpl->setVariable(\"ICON_CLASS\", $cssClass);\n\t\t$tpl->parseCurrentBlock();\n\t}",
"protected function renderImage(){\n \n return sprintf(\n '<img src=\"%s\" title=\"%s\" alt=\"%s\">',\n $this->getField('url'),\n $this->getField('title',''),\n $this->getField('alt','')\n );\n \n }",
"function fa_icon( $icon = 'user' ) {\n\t\treturn \"<i class=\\\"fa fa-{$icon}\\\"></i>\";\n\t}",
"function icon($icons = null, $options = array()) {\n\t\t// At least one icon is needed\n\t\tif (empty($icons)) return false;\n\t\t// If one icon specified, we convert it to an array\n\t\tif (is_string($icons)) $icons = array($icons);\n\n\t\t// Default options\n\t\t$options = array_merge(array(\n\t\t\t'class' => ''\n\t\t), $options);\n\n\t\t// We get an array of classnames\n\t\t$class = array_values(array_filter(explode(' ', $options['class'])));\n\t\t// We add the icons\n\t\t$class[] = 'icon';\n\t\tforeach($icons as &$icon) {\n\t\t\t$class[] = 'icon'.ucfirst($icon);\n\t\t}\n\t\t$options['class'] = implode(' ', $class);\n\n\t\t// Returning a span with icon class added\n\t\treturn $this->Html->tag('span','', $options);\n\t}",
"public function render()\n\t{\n\t\t$template = $this->template\n\t\t\t? '<div class=\"wkm-template\" for=\"' .$this->id. '\">' .$this->template. '</div>'\n\t\t\t: '';\n\n\t\treturn parent::render().$template;\n\t}",
"function format_icon($p_icon, $p_color = '', $p_space_right = '5px'){\n\treturn '<i class=\"ace-icon fa ' . $p_icon . ' ' . $p_color . '\"></i>' . format_hspace($p_space_right);\n}",
"final public function render() : View\n {\n $svg = $this->getSvg($this->path, $this->style, $this->name);\n\n $inlineSvgClasses = $this->getInlineSvgClasses($this->name, $svg['width'], $svg['height']);\n\n return view('fontawesome-blade::components.fa-icon', [\n // 'name' => $this->name,\n 'viewBox' => $svg['viewBox'],\n 'inlineSvgClasses' => $inlineSvgClasses,\n 'style' => $svg['style'],\n 'paths' => $svg['paths'],\n ]);\n }",
"public function create()\n {\n return view('backend.icons.create');\n }",
"protected function render_template()\n {\n }",
"protected function render_template()\n {\n }",
"protected function render_template()\n {\n }",
"protected function render_template()\n {\n }",
"public static function getIcon(): string\n {\n }",
"public static function getIcon(): string\n {\n }",
"function emc_get_cpt_icon() {\r\n\r\n\t$cpt = get_post_type();\r\n\r\n\tswitch ( $cpt ) {\r\n\t\tcase 'emc_big_idea':\r\n\t\t\t$icon = 'key';\r\n\t\t\t$alt = __( 'Key icon for Big Ideas', 'emc' );\r\n\t\t\tbreak;\r\n\t\tcase 'emc_content_focus':\r\n\t\t\t$icon = 'key';\r\n\t\t\t$alt = __( 'Key icon for Foundational Math Concepts', 'emc' );\r\n\t\t\tbreak;\r\n\t\tcase 'emc_common_core':\r\n\t\t\t$icon = 'star';\r\n\t\t\t$alt = __( 'Star icon for Common Core Alignment', 'emc' );\r\n\t\t\tbreak;\r\n\t\tdefault:\r\n\t\t\treturn false;\r\n\t}\r\n\r\n\t$url = get_template_directory_uri() . '/img/' . $icon . '.png';\r\n\t$html = sprintf( '<div class=\"emc-format\"><img class=\"emc-format-icon\" src=\"%1$s\" alt=\"%2$s\"/></div><!-- .emc-format -->',\r\n\t\tesc_url( $url ),\r\n\t\tesc_attr( $alt )\r\n\t);\r\n\r\n\treturn $html;\r\n\r\n}",
"public function getIcon()\n {\n }",
"public function getIcon() {\r\n \r\n $mime = explode(\"/\", $this->mime); \r\n \r\n switch ($mime[0]) {\r\n case \"video\" : \r\n return [\r\n \"label\" => \"Video\",\r\n \"icon\" => '<i class=\"fa fa-file-video-o\"></i>'\r\n ];\r\n \r\n break;\r\n \r\n case \"image\" : \r\n return [\r\n \"label\" => \"Image\",\r\n \"icon\" => '<i class=\"fa fa-file-image-o\"></i>'\r\n ];\r\n \r\n break;\r\n \r\n }\r\n \r\n switch ($this->mime) {\r\n case \"application/msword\":\r\n case \"application/vnd.openxmlformats-officedocument.wordprocessingml.document\":\r\n return [ \r\n \"label\" => \"Microsoft Word\",\r\n \"icon\" => '<i class=\"fa fa-file-word-o\"></i>'\r\n ];\r\n \r\n break;\r\n \r\n case \"application/vnd.ms-excel\":\r\n case \"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\":\r\n return [ \r\n \"label\" => \"Microsoft Excel\",\r\n \"icon\" => '<i class=\"fa fa-file-excel-o\"></i>'\r\n ];\r\n \r\n break;\r\n \r\n case \"application/pdf\":\r\n case \"application/x-pdf\":\r\n return [ \r\n \"label\" => \"PDF\",\r\n \"icon\" => '<i class=\"fa fa-file-pdf-o\"></i>'\r\n ];\r\n \r\n break;\r\n \r\n }\r\n \r\n return [\r\n \"label\" => \"Unknown\",\r\n \"icon\" => '<i class=\"fa fa-file-o\"></i>'\r\n ];\r\n \r\n }",
"public function getIcon() {\r\n\t\r\n\t$fileType = $this->getType();\r\n\t\r\n\t$image = array(\r\n\t 'image/gif',\r\n\t 'image/png',\r\n\t 'image/jpg',\r\n\t 'image/jpeg'\r\n\t);\r\n\t\r\n\t$rarZip = array(\r\n\t 'application/zip',\r\n 'application/x-rar-compressed'\r\n\t);\r\n\t\r\n\t$audio = array(\r\n\t 'audio/mpeg'\r\n\t);\r\n\t\r\n\t$video = array(\r\n\t 'video/quicktime',\r\n\t 'video/mp4'\r\n\t);\r\n\t\r\n\t$pdf = array(\r\n\t 'application/pdf'\r\n\t);\r\n\t\r\n\t$wordExcelPptx = array(\r\n\t 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',\r\n\t 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',\r\n\t 'application/vnd.openxmlformats-officedocument.presentationml.presentation',\r\n\t 'application/msword',\r\n\t 'application/vnd.ms-excel',\r\n\t 'application/vnd.ms-powerpoint'\r\n\t);\r\n\t\r\n\tif (in_array($fileType, $image)) {\r\n\t return \"image.png\";\r\n\t} elseif (in_array($fileType, $audio)) {\r\n\t return \"audio.png\";\r\n\t} elseif (in_array($fileType, $video)) {\r\n\t return \"video.png\";\r\n\t} elseif (in_array($fileType, $rarZip)) {\r\n\t return \"rarZip.png\";\r\n\t} elseif (in_array($fileType, $pdf)) {\r\n\t return \"pdf.png\";\r\n\t} elseif (in_array($fileType, $wordExcelPptx)) {\r\n\t return \"wordExcelPptx.png\";\r\n\t} else {\r\n\t return \"default.png\";\r\n\t}\r\n\t\r\n }",
"public function get_icon() {\n\t\tglobal $wc_authorize_sim;\n\n\t\t$icon = '';\n\n\t\t$icon = '<img src=\"' . esc_url( $wc_authorize_sim->force_ssl( $wc_authorize_sim->plugins_url('assets/images/authorize-net-co.png') ) ) . '\" alt=\"' . esc_attr( $this->title ) . '\" />';\n\n\t\treturn apply_filters( 'woocommerce_authorize_sim_icon', $icon, $this->id );\n\t}",
"protected function render() {}",
"protected function render() {}",
"protected function render() {}",
"function category_products_view_icon($key = false)\n{\n $output = '';\n\n switch ($key) {\n case 'grids':\n $output = '<i class=\"ri-grid-fill\"></i>';\n break;\n\n default:\n $output = '<i class=\"ri-list-check\"></i>';\n break;\n }\n\n return $output;\n}",
"function research_glyph($image, $label){\n return '<div class=\"glyph\">\n <div class=\"glyph-image\" style=\"background-image: url(\\'' . get_static_uri($image) . '\\');\"></div>\n <div class=\"glyph-label\">' . $label . '</div>\n </div>';\n}",
"public function makeHtmlForIconAction($icon, $basePath, $action, $val, $askConfirm);",
"function social_icons_html_output( $format ) {\n\n\t\t\t$format = '<li class=\"%1$s\"><a href=\"%2$s\" target=\"_blank\"><i class=\"fa fa-%1$s\"></i></a></li>';\n\t\t\treturn $format;\n\t\t\n\t\t}",
"public function create()\n {\n return view('icons.create');\n }",
"function emc_get_content_icon() {\r\n\r\n\t$format = get_the_terms( get_the_ID(), 'emc_content_format' );\r\n\r\n\tif ( $format && ! is_wp_error( $format ) ) {\r\n\r\n\t\t$format = array_shift( $format );\r\n\t\t$url = get_template_directory_uri() . '/img/' . $format->slug . '.png';\r\n\t\t$title = sprintf( __( 'View all %s posts', 'emc' ), $format->name );\r\n\t\t$alt = sprintf( __( '%s icon', 'emc' ), $format->name );\r\n\t\t$html = sprintf( __( '<a href=\"%1$s\" title=\"%2$s\"><img class=\"emc-format-icon\" src=\"%3$s\" alt=\"%4$s\"/></a>', 'emc' ),\r\n\t\t\tesc_url( get_term_link( $format ) ),\r\n\t\t\tesc_attr( $title ),\r\n\t\t\tesc_url( $url ),\r\n\t\t\tesc_attr( $alt )\r\n\t\t);\r\n\t\treturn $html;\r\n\r\n\t}\r\n\r\n\treturn false;\r\n\r\n}",
"public function renderStatic()\n {\n return $this->template;\n }",
"static function frontend_icon($icon, $font = false, $return = 'string')\n\t{\n\t\t//if we got no font passed use the default font\n\t\tif(empty($font)) $font = key(AviaBuilder::$default_iconfont); \n\t\t\n\t\t//fetch the character to display\n\t\t$display_char = self::get_display_char($icon, $font);\n\t\n\t\t//return the html string that gets attached to the element. css classes for font display are generated automatically\n\t\tif($return == 'string')\n\t\t{\n\t\t\treturn \"aria-hidden='true' data-av_icon='{$display_char}' data-av_iconfont='{$font}'\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn $display_char;\n\t\t}\n\t}",
"function av_icon_display($char, $extra_class = \"\")\n{\n\treturn \"<span class='av-icon-display {$extra_class}' \".av_icon_string($char).\"></span>\";\n}",
"public function GetPlainFileTypeIcon()\n {\n $fileType = $this->GetFileType();\n\n return '<span class=\"'.$this->getFileTypeIconCssStyle().TGlobalBase::OutHTML($fileType->sqlData['file_extension']).'\"></span>';\n }",
"protected function renderFeedbackIcon()\n {\n if (!$this->_hasFeedback) {\n return '';\n }\n $config = $this->feedbackIcon;\n $type = ArrayHelper::getValue($config, 'type', 'icon');\n $prefix = ArrayHelper::getValue($config, 'prefix', $this->form->getDefaultIconPrefix());\n $id = Html::getInputId($this->model, $this->attribute);\n\n return $this->getFeedbackIcon($config, 'default', $type, $prefix, $id).\n $this->getFeedbackIcon($config, 'success', $type, $prefix, $id).\n $this->getFeedbackIcon($config, 'error', $type, $prefix, $id);\n }",
"protected function get__icon()\n\t{\n\t\treturn 'coffee';\n\t}",
"public function icon ( )\n\t{\n\t\treturn Array( 'id' => $this->id,\t// shoud be consistent with what is passed to _uicmp_stuff_fold class\n\t\t\t\t\t 'title' => $this->messages['icon'] );\n\t}",
"public function forTemplate()\n {\n return $this->renderWith($this->defaultTemplate());\n }",
"public function render() {\n return $this->getRenderer()->render($this->getLayout() . $this->getContainer()->get('config')->get('template.extension'), $this->getData());\n }",
"public static function iconButton($icon, $text, $controller, $action=\"index\", $array=array()) {\n\t\t$type = $text == false ? \"notext\" : \"text\";\n\t\treturn \"<a href=\\\"\" . self::href($controller, $action, $array) . \"\\\" class=\\\"button $type $icon\\\">$text</a>\";\n\t}",
"protected function createIcon($item)\n {\n $output = '';\n\n if (array_key_exists('icon', $item)) {\n $output .= sprintf(\n '<i class=\"fa fa-lg fa-fw fa-%s\"></i> ',\n $item['icon']\n );\n }\n\n return $output;\n }",
"public function render(): string\n {\n $image_attributes = '';\n foreach ($this->attributes as $attribute => $value) {\n if (\n is_string($attribute) &&\n is_string($value) &&\n in_array($attribute, Settings::ignoredCustomAttributes()) === false\n ) {\n $image_attributes .= \"{$attribute}=\\\"{$value}\\\" \";\n }\n }\n return \"<img src=\\\"{$this->insert}\\\" {$image_attributes}/>\";\n }",
"function av_icon($icon, $font = false, $string = 'string')\n{\t\n\treturn avia_font_manager::frontend_icon($icon, $font, $string);\n}",
"public function get_icon()\n {\n return 'fa fa-heading';\n }",
"public function getIconForResourceWithPngFileReturnsIcon() {}",
"public function getRublonIcon() {\n\t $rublonIconImg = Mage::getDesign()->getSkinBaseUrl() . 'Rublon/img/rublon_logo_16x16.png';\n\t\treturn sprintf('<span title=\"%s\"\n\t\t\tstyle=\"width:16px;height:16px;background:url(%s) 0px 0px no-repeat;vertical-align:middle;display:inline-block;\"\n\t\t\tclass=\"rublon-protected-icon\"></span>',\n\t\t\thtmlspecialchars($this->__('Your account is protected by Rublon')),\n\t\t\t$rublonIconImg\n\t\t);\n\t}",
"public static function renderTemplate()\n {\n echo self::$template;\n }",
"public function get_icon()\n {\n $image_file_name_str = false;\n if(isset($this->sub_payment_method_image_file_names_str_final)){\n $image_file_name_str = $this->sub_payment_method_image_file_names_str_final;\n } else if (isset($this->sub_payment_method_image_file_names_str)){\n $image_file_name_str = $this->sub_payment_method_image_file_names_str;\n }\n\n $image_tag = '';\n if( isset($image_file_name_str) && is_string($image_file_name_str) ){\n $image_file_names = explode(',', $image_file_name_str);\n foreach ($image_file_names as $image_file_name) {\n if(strlen($image_file_name)<=0){ continue; }\n // remove whitespaces\n $image_file_name = str_replace(' ', '', $image_file_name);\n // prefix with internal image url\n $image_url = MIDTRANS_PLUGIN_DIR_URL.'public/images/payment-methods/'.$image_file_name;\n if(strpos($image_file_name, '://') !== false){\n // image is absolute url, external, don't prefix.\n $image_url = $image_file_name;\n }\n $image_tag .= '<img src=\"'.$image_url.'\" alt=\"Midtrans\" style=\"max-height: 2em; max-width: 4em; background-color: #ffffffdd; padding: 0.2em 0.3em; border-radius: 0.3em; border: 0.5px solid #ccccccdd;\"/> ';\n }\n }\n\n // allow merchant-defined custom filter function to modify $image_tag\n $image_tag_after_filter = \n apply_filters( 'midtrans_gateway_icon_before_render', $image_tag);\n // default filter from WC\n $image_tag_after_filter = \n apply_filters('woocommerce_gateway_icon', $image_tag_after_filter, $this->id);\n return $image_tag_after_filter;\n }",
"public function getIcon(): string\n {\n return $this->icon ?: static::DEFAULT_ICON;\n }",
"function av_backend_icon($params)\n{\n\treturn avia_font_manager::backend_icon($params);\n}",
"protected function render_template() {\n\t\t?>\n\t\t<li id=\"accordion-section-{{ data.id }}\" class=\"accordion-section control-section control-section-{{ data.type }} cannot-expand\">\n\t\t\t<h3 class=\"accordion-section-title\">\n\t\t\t\t{{ data.title }}\n\t\t\t\t<a href=\"{{ data.button_url }}\" class=\"button alignright\" target=\"_blank\" rel=\"nofollow\">{{ data.button_text }}</a>\n\t\t\t</h3>\n\t\t</li>\n\t\t<?php\n\t}",
"public function testAdminBSBIconBasicFunction() {\n\n $obj = new IconTwigExtension($this->twigEnvironment);\n\n $arg = [\"name\" => \"person\", \"style\" => \"margin: 4px;\"];\n $res = '<i class=\"material-icons\" style=\"margin: 4px;\">person</i>';\n $this->assertEquals($res, $obj->adminBSBIconBasicFunction($arg));\n }",
"public static function getFactoryIconUseIt() {\n }",
"public function get_icon()\r\n {\r\n return 'eicon-posts-justified';\r\n }",
"function font_awesome($icon){\n\treturn \"<span class='fa fa-fw $icon'></span>\";\n}",
"public function getIcon() {\n\t\t//regex is used to check if there's a filename within the iconFile string\n\t\treturn preg_replace('/^.*\\/([^\\/]+\\.(gif|png))?$/i', '\\1', $this->iconFile) ? $this->iconFile : '';\n\t}",
"public static function type_return_icon($type_id)\n {\n switch($type_id):\n case '101';\n return \"<i class=\\\"fa fa-beer fa-1x\\\"></i>\";\n break;\n case '102';\n return \"<i class=\\\"fa fa-thumbs-o-up fa-1x\\\"></i>\";\n break;\n case '103';\n break;\n case '200';\n return \"<i class=\\\"fa fa-picture-o fa-1x\\\"></i>\";\n break;\n case '300';\n return \"<i class=\\\"fa fa-map-marker fa-1x\\\"></i>\";\n break;\n endswitch;\n }",
"public static function post_format_icon($format) {\n\t\t?>\n\t\t<a class=\"single-post-format\" href=\"<?php echo esc_attr( add_query_arg( 'format_filter',$format, home_url()) ) ?>\" title=\"<?php echo get_post_format_string($format) ?>\">\n\t\t\t<?php echo do_shortcode('[icon name=\"'.WpvPostFormats::get_post_format_icon($format).'\"]') ?>\n\t\t</a>\n\t\t<?php\n\t}",
"public function show()\n {\n return $this->render('OpenOrchestraMediaAdminBundle:Block/DisplayMedia:showIcon.html.twig');\n }",
"public function get_icon()\n {\n return 'fa fa-filter';\n }",
"protected function getIcon($skinPath, $attr = '') {\n\n\t\tif (version_compare(TYPO3_version, '4.4', '<')) {\n\t\t\t$source = t3lib_iconWorks::skinImg($this->doc->backPath, $skinPath);\n\t\t\t$match = array();\n\t\t\tif (preg_match('/src=\"(\\S+)\"/', $source, $match) && !is_file($match[1])) {\n\t\t\t\t$source = 'src =\"' . $this->getTplSubpath() . $skinPath . '\"';\n\t\t\t}\n\t\t\treturn \"<img \" . $source . ($attr ? ' ' . $attr : '') . \" />\";\n\t\t} else {\n\t\t\treturn '<span ' . $attr . '>' . t3lib_iconWorks::getSpriteIcon(self::$icon2Sprite[$skinPath]) . '</span>';\n\t\t}\n\t}",
"function iconlink($id = '', $class = '', $title = '', $href = '')\n{\n return '<a id=\"' . $id . '\" href=\"' . URI . '/' . $href . '\" class=\"btn mini green-stripe ' . $class . '\" data-href=\"\">Güncelle</a>';\n}",
"public static function svgIcon()\n {\n return '<svg class=\"sidebar-icon icon-location\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path fill=\"var(--sidebar-icon)\" d=\"M5.64 16.36a9 9 0 1 1 12.72 0l-5.65 5.66a1 1 0 0 1-1.42 0l-5.65-5.66zm11.31-1.41a7 7 0 1 0-9.9 0L12 19.9l4.95-4.95zM12 14a4 4 0 1 1 0-8 4 4 0 0 1 0 8zm0-2a2 2 0 1 0 0-4 2 2 0 0 0 0 4z\" /></svg>';\n }",
"public function get_icon() {\n\t\treturn 'eicon-icon-box';\n\t}",
"public function Icon()\n {\n $ext = strtolower($this->getExtension());\n if (!Director::fileExists(FRAMEWORK_DIR . \"/images/app_icons/{$ext}_32.gif\")) {\n $ext = $this->appCategory();\n }\n\n if (!Director::fileExists(FRAMEWORK_DIR . \"/images/app_icons/{$ext}_32.gif\")) {\n $ext = \"generic\";\n }\n\n return FRAMEWORK_DIR . \"/images/app_icons/{$ext}_32.gif\";\n }",
"public function getImage()\n\t{\n\t\treturn $this->generator->render($this->generateCode(), $this->params);\n\t}",
"protected function imageIcon(): string\n {\n $types = [\n 'image' => 'file-image',\n 'video' => 'file-video',\n 'document' => 'file-document',\n 'audio' => 'file-audio',\n 'code' => 'file-code',\n 'archive' => 'file-zip'\n ];\n\n $extensions = [\n 'xls' => 'file-spreadsheet',\n 'xlsx' => 'file-spreadsheet',\n 'csv' => 'file-spreadsheet',\n 'docx' => 'file-word',\n 'doc' => 'file-word',\n 'rtf' => 'file-word',\n 'mdown' => 'file-text',\n 'md' => 'file-text'\n ];\n\n return $extensions[$this->model->extension()] ??\n $types[$this->model->type()] ??\n parent::imageDefaults()['color'];\n }",
"public function icon()\n {\n return $this->icon;\n }",
"public function getIcon()\n {\n return ' fa fa-lock';\n }",
"function fa($icon, $element = null, $attr = null) {\n\t$render = '';\n\t\n\tif (is_null($element) && is_null($attr)) {\n\t\t$render = '<i class=\"fa fa-' . $icon . '\"></i>';\n\t} else {\n\t\tif (!is_null($element)) {\n\t\t\t$render = '<' . $element;\n\t\t} else {\n\t\t\t$render = '<i';\n\t\t}\n\t\tif (!is_null($attr)) {\n\t\t\tif (is_array($attr)) {\n\t\t\t\tif (!empty($attr['class'])) {\n\t\t\t\t\t$render .= ' class=\"fa fa-' . $icon . ' ' . $attr['class'] . '\"';\n\t\t\t\t} else {\n\t\t\t\t\t$render .= ' class=\"fa fa-' . $icon . '\"';\n\t\t\t\t}\n\t\t\t\tforeach ($attr as $index => $val) {\n\t\t\t\t\tif ($index != 'class') {\n\t\t\t\t\t\t$render .= ' ' . $index . '=\"' . $val . '\"';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$render .= ' ' . $attr;\n\t\t\t}\n\t\t} else {\n\t\t\t$render .= ' class=\"fa fa-' . $icon . '\"';\n\t\t}\n\t\tif (!is_null($element)) {\n\t\t\t$render .= '></' . $element . '>';\n\t\t} else {\n\t\t\t$render .= '></i>';\n\t\t}\n\t}\n\t\n\treturn $render;\n}",
"protected function buildCssAndRegisterIcons() {}",
"private function userIconType() {\n $firstInitial = substr($this->get('username'),0,1);\n if (strlen($firstInitial) > 0) {\n echo '<i class=\"first-initial\" aria-hidden=\"true\">'.$firstInitial.'</i><span class=\"sr-only\">My User</span>';\n } else {\n echo '<i class=\"fa fa-user\" aria-hidden=\"true\"></i><span class=\"sr-only\">My User</span>';\n }\n }"
] | [
"0.7290025",
"0.6731128",
"0.6456609",
"0.6395131",
"0.6386907",
"0.63747764",
"0.63634074",
"0.6340896",
"0.6331907",
"0.6284307",
"0.6179238",
"0.60740733",
"0.6062905",
"0.6011117",
"0.59929127",
"0.59907794",
"0.59824675",
"0.5955866",
"0.59497607",
"0.5914404",
"0.5909157",
"0.5897993",
"0.58847344",
"0.58812743",
"0.58722556",
"0.58722556",
"0.5837562",
"0.5836979",
"0.5820483",
"0.58016753",
"0.5796536",
"0.57909644",
"0.5790646",
"0.57677984",
"0.5767491",
"0.5759205",
"0.57432866",
"0.572582",
"0.57122296",
"0.5710836",
"0.5710836",
"0.5710836",
"0.57033926",
"0.57033926",
"0.56995976",
"0.5694483",
"0.56852186",
"0.5672432",
"0.5660758",
"0.5646801",
"0.5645904",
"0.5645904",
"0.56144446",
"0.5608499",
"0.5607956",
"0.5604507",
"0.559908",
"0.5597657",
"0.5587732",
"0.556742",
"0.55581206",
"0.55532575",
"0.5553063",
"0.55530566",
"0.55530417",
"0.55499214",
"0.5548166",
"0.553373",
"0.552464",
"0.55192506",
"0.55170417",
"0.5509324",
"0.5507399",
"0.5505449",
"0.549467",
"0.5492227",
"0.54908776",
"0.54874754",
"0.5487185",
"0.54869866",
"0.5486684",
"0.5471941",
"0.5466488",
"0.5466315",
"0.5466193",
"0.5464815",
"0.5462792",
"0.5451714",
"0.54460496",
"0.54418623",
"0.5431569",
"0.5430698",
"0.5430643",
"0.54286134",
"0.5425569",
"0.54249847",
"0.5406699",
"0.5402753",
"0.5399575",
"0.5396664"
] | 0.69961137 | 1 |
Build current url with required GET parameters | public static function buildUrl($params)
{
/** @var HttpRequestInterface $request */
$request = self::fetchComponent(HttpRequestInterface::class);
if ($request) {
$data = isset($params['data']) ? $params['data'] : [];
$query = $request->getQueryArray();
foreach ($data as $key => $value) {
$query[$key] = $value;
}
return $request->getPath() . '?' . http_build_query($query);
}
return "";
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function url()\r\n {\r\n return $this->get_base_url() . http_build_query($this->get_query_params());\r\n }",
"protected static function get_new_url()\n {\n return parse_url($_SERVER['REQUEST_URI'])['path'] . '?' . $_SERVER['QUERY_STRING'];\n }",
"function get_current_url() {\n $get = $_GET;\n unset($get['request_uri']);\n $qs = http_build_query($get);\n return Router::$page_url . (!empty($qs) ? \"?$qs\" : null);\n}",
"function _build_url() {\n\t\t// Add transaction ID for better detecting double requests in AUTH server\n\t\tif($GLOBALS['config']['application']['tid'] == '') $GLOBALS['config']['application']['tid'] = rand(0, 10000);\n\n\t\t$url = $this->url.'&action='.$this->action.'&tid='.$GLOBALS['config']['application']['tid'];\n\t\t\n\t\treturn $url;\n\t}",
"function current_url(array $params = array())\n{\n // Get the URL before the ?.\n $request = Zend_Controller_Front::getInstance()->getRequest();\n $urlParts = explode('?', $request->getRequestUri());\n $url = $urlParts[0];\n if ($params) {\n // Merge $_GET and passed parameters to build the complete query.\n $query = array_merge($_GET, $params);\n $queryString = http_build_query($query);\n $url .= \"?$queryString\";\n }\n return $url;\n}",
"private function generateURL()\n\t{\n\t\t// Is there's a query string, strip it from the URI\n\t\t$sURI\t= ($iPos = strpos($_SERVER['REQUEST_URI'], '?')) ?\n\t\t\t\t\tsubstr($_SERVER['REQUEST_URI'], 0, $iPos) :\n\t\t\t\t\t$_SERVER['REQUEST_URI'];\n\n\t\t// Is there's a ampersand string, strip it from the URI\n\t\t$sURI\t= ($i = strpos($sURI, '&')) ?\n\t\t\t\t\tsubstr($sURI, 0, $i) :\n\t\t\t\t\t$sURI;\n\n\t\t// Is there's a hash string, strip it from the URI\n\t\t$sURI\t= ($i = strpos($sURI, '#')) ?\n\t\t\t\t\tsubstr($sURI, 0, $i) :\n\t\t\t\t\t$sURI;\n\n\t\t// If we're on page 1\n\t\tif($this->iPage == 1)\n\t\t{\n\t\t\t$this->sURL\t\t= $sURI;\n\t\t}\n\t\t// Else we need to pull off the current page\n\t\telse\n\t\t{\n\t\t\t// Split the URI by / after trimming them off the front and end\n\t\t\t$aURI\t= explode('/', trim($sURI, '/'));\n\n\t\t\t// If the last part doesn't match the current page\n\t\t\t$iPage\t= array_pop($aURI);\n\t\t\tif($iPage != $this->iPage) {\n\t\t\t\ttrigger_error(__METHOD__ . ' Error: Invalid page passed. ' . $iPage . ' / ' . $this->iPage, E_USER_ERROR);\n\t\t\t}\n\n\t\t\t// If there is no other parts\n\t\t\tif(count($aURI) == 0) {\n\t\t\t\t$this->sURL = '/';\n\t\t\t} else {\n\t\t\t\t$this->sURL = '/' . implode('/', $aURI) . '/';\n\t\t\t}\n\t\t}\n\n\t\t// Set the query string\n\t\t$this->sQuery\t= ($iPos) ? substr($_SERVER['REQUEST_URI'], $iPos) : '';\n\t}",
"private function getUrl() {\n $queryArr = array();\n\n $uri = filter_input(INPUT_SERVER, 'REQUEST_URI');\n\n //get uri as a array\n $uriArr = parse_url($uri);\n\n //get query parameter string\n $queryStr = isset($uriArr['query']) ? $uriArr['query'] : '';\n\n //get query parameters as a array\n parse_str($queryStr, $queryArr);\n\n //remove 'page' parameter if it is set\n if (isset($queryArr['page'])) {\n unset($queryArr['page']);\n }\n\n //rebuild the uri and return \n $returnUri = $uriArr['path'] . '?' . http_build_query($queryArr);\n\n return $returnUri;\n }",
"protected function getUrl()\n {\n return str_replace('?' . $_SERVER['QUERY_STRING'], '', $_SERVER['REQUEST_URI']);\n }",
"private function _buildUri(): string {\n return !empty($this->query) ? $this->uri.'?'.http_build_query($this->query) : $this->uri;\n }",
"function getCurrentURL() {\r\n\t$currentURL = basename($_SERVER[\"PHP_SELF\"]);\r\n\t$i = 0;\r\n\tforeach($_GET as $key => $value) {\r\n\t\t$i++;\r\n\t\tif($i == 1) { $currentURL .= \"?\"; }\r\n\t\telse { $currentURL .= \"&\"; }\r\n\t\t$currentURL .= $key.\"=\".$value;\r\n\t}\r\n\treturn $currentURL;\r\n}",
"function url_build(string $base, string $params = ''): string\n{\n if ($params) {\n $params = ((false === strpos($base, '?')) ? '?' : '&') . $params;\n }\n return \\get_site_url() . '/' . $base . $params;\n}",
"function current_request_with_params($params) {\n\t\t$all_params = $_GET;\n\t\tforeach ($params as $key => $value) {\n\t\t\t$all_params[$key] = $value;\n\t\t}\n\t\t$request = $_SERVER['REQUEST_URI'];\n\t\t$query = $_SERVER['QUERY_STRING'];\n\t\tif (strlen($query)) {\n\t\t\t$request = str_replace( $query, \"\", $request);\n\t\t}\n\t\t$sep = \"\";\n\t\tforeach ($all_params as $key => $value) {\n\t\t\t$request = $request . $sep;\n\t\t\t$sep = '&';\n\t\t\t$request = $request . $key . \"=\" . $value;\n\t\t}\n\n\t\treturn $request;\n\t}",
"protected function _build_url() {\n\n $params = array_filter([\n 'name' => $this->_names,\n 'country_id' => $this->_country_id,\n 'language_id' => $this->_language_id,\n ], function($v) {\n if (!is_array($v)) {\n return strlen(trim($v)) > 0;\n } else {\n return $v;\n }\n });\n //Only pass apikey if there is one set\n if ($api_key = $this->get_api_key()) {\n $params['apikey'] = trim($api_key);\n }\n\n return self::BASE . '?' . http_build_query($params);\n }",
"protected function _getUrl() {\n\t\t\t$this->_url =\timplode('/', array(\n\t\t\t\t$this->_baseUrlSegment,\n\t\t\t\t$this->_apiSegment,\n\t\t\t\timplode('_', array(\n\t\t\t\t\t$this->_type,\n\t\t\t\t\t$this->_language,\n\t\t\t\t\t$this->_locale,\n\t\t\t\t)),\n\t\t\t\t$this->_apiVersionSegment,\n\t\t\t\t$this->controller,\n\t\t\t\t$this->function\t\n\t\t\t));\n\n\t\t\tempty($this->_getFields) ?: $this->_url .= '?' . http_build_query($this->_getFields);\n\t\t}",
"protected function addToCurrentUrl($arrParams)\r\n\t{\r\n\t\t$strUrl = $this->Environment->request;\r\n\t\t\r\n\t\tforeach($arrParams as $arrParam)\r\n\t\t{\r\n\t\t\t$strUrl .= (strpos($strUrl, '?') !== false) ? '&' : '?';\t\r\n\t\t\t$strUrl .= $arrParam[0] . '=' . $arrParam[1];\r\n\t\t}\r\n\t\t\r\n\t\treturn $strUrl;\r\n\t}",
"function build_url($base_url, $params) {\r\n $url = $base_url;\r\n if (!empty($params)) {\r\n $url .= '?' . implode('&', $params);\r\n }\r\n return $url;\r\n }",
"abstract protected function buildSpecificRequestUri();",
"private function getParamsUrlFormat() {\n $urlParams = \"\";\n\n if ($this->getMethod() == 'GET') {\n $urlParams .= ($this->getPaging()) ? \n \"?_paging=1\" : \n \"\";\n $urlParams .= ($this->getPaging()) ? \n \"&_return_as_object=1\" : \n \"\";\n $urlParams .= ($this->getPaging()) ? \n \"&_max_results=\" . $this->getMaxResults() : \n \"\";\n }\n\n if ($this->getMethod() == 'POST') {\n $function = $this->getFuction();\n $urlParams .= (isset($function) and $function != \"\") ?\n \"?_function=\" . $this->getFuction() :\n \"\";\n }\n\n return $urlParams;\n }",
"function formatCurrentUrl() ;",
"public function getUrl() {\n $url = $this->request->get_normalized_http_url() . '?';\n $url .= http_build_query($this->request->get_parameters(), '', '&');\n\n return $url;\n }",
"private function getUrl() {\r\n if(!$this->markActive)\r\n return '';\r\n $mid = Yii::$app->controller->module->id == Yii::$app->id ? '' : Yii::$app->controller->module->id;\r\n $cid = Yii::$app->controller->id;\r\n $aid = Yii::$app->controller->action->id;\r\n $id = isset($_GET['slug']) ? $_GET['slug'] : (isset($_GET['id']) ? $_GET['id'] : '');\r\n $rubric = isset($_GET['rubric']) ? $_GET['rubric'] : '';\r\n $tag = isset($_GET['tag']) ? $_GET['tag'] : '';\r\n return ($mid ? $mid. '/' : '') . \r\n $cid . '/' . \r\n ($aid == 'index' \r\n ? ($rubric \r\n ? 'rubric/' . $rubric . ($tag \r\n ? '/tag/' . $tag \r\n : '') \r\n : 'index') \r\n : ($aid == 'view' ? $id : $aid)\r\n );\r\n }",
"function currentUrl() {\r\n $protocol = strpos(strtolower($_SERVER['SERVER_PROTOCOL']),'https') === FALSE ? 'http' : 'https';\r\n $host = $_SERVER['HTTP_HOST'];\r\n $script = $_SERVER['SCRIPT_NAME'];\r\n $params = $_SERVER['QUERY_STRING'];\r\n\r\n //if there is already one colour selected it must be saved on the params so we control it:\r\n if (preg_match('/\\bcolour\\b/', $params)) {\r\n //we separate 2 parts by colour and save them as a list p1 and p2\r\n list($p1,$p2) = explode('colour', $params);\r\n $params = $p1;\r\n }\r\n // if params include & we separate it correspondingly\r\n if(strpos($params, '&' )!=false){\r\n list($part1, $part2) = explode('&', $params);\r\n $params = $part1;\r\n }\r\n\r\n return $protocol . '://' . $host . $script . '?' . $params;\r\n }",
"public static function current_url()\n {\n $config = cmsms()->GetConfig();\n $uri_parts = explode('/',$_SERVER['REQUEST_URI']);\n $uri_parts = cge_array::remove_by_value($uri_parts);\n $tmp = parse_url($config['root_url']);\n $root_parts = array();\n if( isset($tmp['path']) )\n {\n\t$root_parts = explode('/',$tmp['path']);\n\t$root_parts = cge_array::remove_by_value($root_parts);\n }\n \n $newdata = array();\n for($i = 0; $i < max(count($uri_parts),count($root_parts)); $i++ )\n {\n\tif( ($i < count($uri_parts)) && \n\t ($i < count($root_parts)) && \n\t ($root_parts[$i] == $uri_parts[$i]) )\n\t {\n\t continue;\n\t }\n\t$newdata[] = $uri_parts[$i];\n }\n $url = $config['root_url'].'/'.implode('/',$newdata);\n return $url;\n }",
"public function formatCurrentUrl() {}",
"public function formatCurrentUrl() {}",
"public function formatCurrentUrl() {}",
"public function formatCurrentUrl() {}",
"public function formatCurrentUrl() {}",
"public function formatCurrentUrl() {}",
"function url_current()\n{\n return url(@$_GET['GET_VARS']);\n}",
"protected function prepareURL() {\n $request = trim($_SERVER['REQUEST_URI'], '/');\n if( !empty($request)) {\n $url = explode('/', $request); // split the request into an array of controller, action, parameters\n \n // is controller is given, then set that name as controller\n // if this is empty, then make homeController as default controller\n $this->controller = isset($url[0]) ? $url[0].'Controller' : 'accountController';\n \n // action to be performed\n // it is specified after the controller name in the url\n // \n $this->action = isset($url[1]) ? $url[1]: 'index';\n \n unset($url[0], $url[1]); // delete this values from the url so that we can have parameters only\n \n // now add the parameters passed, to the prams array\n $this->prams = !empty($url) ? array_values($url) : [];\n }\n }",
"private function _url($par = array()) {\n\t\t$get = $_GET;\n\t\t\n\t\tforeach ((array) $par AS $key => $val) { //overide value\n\t\t\tif ($key == 'path') //if path, encode\n\t\t\t\t$get['path'] = \\Crypt::encrypt($val);\n\t\t\telse\n\t\t\t\t$get[$key] = $val;\n\t\t}\n\t\t\n\t\t$url = '//';\n\t\t\n\t\t$url .= $this->_sanitize(g($_SERVER, 'HTTP_HOST').'/'.strtok(g($_SERVER, 'REQUEST_URI'), '?'));\n\t\t\n\t\treturn $url.'?'.http_build_query($get);\n\t}",
"public function url() {\n if (empty($this->parameters)) {\n return $this->url;\n }\n\n return $this->url . '?' . http_build_query($this->parameters);\n }",
"public function getUrl() {\r\n\r\n // removing GET parameters from URL.\r\n return strtolower(rtrim(explode('?', $_SERVER['REQUEST_URI'], 2)[0], '/'));\r\n \r\n }",
"private function buildCurrentPageURI() {\n $protocol = is_ssl() ? 'https' : 'http';\n $site = $_SERVER['SERVER_NAME'];\n $slug = $_SERVER['REQUEST_URI'];\n\n return urlencode($protocol.'://'.$site.$slug);\n }",
"public static function current_url()\r\n\t{\r\n\t\t$url = Request::factory()->uri();\r\n\t\tif($_GET)\r\n\t\t{\r\n\t\t\t$url .= '/?' . $_SERVER['QUERY_STRING'];\r\n\t\t}\r\n\t\t$url = URL::site( $url, TRUE);\r\n\t\treturn $url;\r\n\t}",
"public static function current_url()\r\n\t{\r\n\t\t$url = Request::factory()->uri();\r\n\t\tif($_GET)\r\n\t\t{\r\n\t\t\t$url .= '/?' . $_SERVER['QUERY_STRING'];\r\n\t\t}\r\n\t\t$url = URL::site( $url, TRUE);\r\n\t\treturn $url;\r\n\t}",
"protected function initCurrentUrl() {}",
"protected function initCurrentUrl() {}",
"public function buildCurrentPageURI() {\n $protocol = is_ssl() ? 'https' : 'http';\n $site = $_SERVER['SERVER_NAME'];\n $slug = $_SERVER['REQUEST_URI'];\n\n return urlencode( $protocol . '://' . $site . $slug );\n }",
"public function getFullUrl(){\n return 'http://'. $_SERVER['HTTP_HOST'] .'/'. implode('/', self::$_request_vars);\n }",
"public function build() {\n return implode('&', $this->uriParams);\n }",
"protected function getUrl() {\n\t\treturn $this->getQueryParam ( self::URL_PARAM );\n\t}",
"private function rebuildGet()\n {\n $url = $_SERVER['REQUEST_URI'];\n $pos = strpos($url, '?');\n \n if ($pos !== false)\n {\n parse_str(substr($url, $pos+1, (strlen($url)-($pos+1))), $_GET);\n }\n }",
"public function get_url_params()\n {\n }",
"public function buildQueryString();",
"public function buildFrontendUri() {}",
"public function getUrl()\n {\n return trim(implode('/', $this->path), '/').$this->getParams();\n }",
"private function buildQueryString(){\n if(count($this->querystrings) == 0){\n return \"\";\n }\n else{\n $querystring = \"?\";\n\n foreach($this->querystrings as $index => $value){\n if($index > 0){\n $querystring .= \"&\";\n }\n $querystring .= $value;\n }\n\n return $querystring;\n }\n }",
"private function getCurrentURL() {\n $currentURL = (isset($_SERVER[\"HTTPS\"]) && $_SERVER[\"HTTPS\"] == \"on\") ? \"https://\" : \"http://\";\n $currentURL .= $_SERVER[\"SERVER_NAME\"];\n\n if ($_SERVER[\"SERVER_PORT\"] != \"80\" && $_SERVER[\"SERVER_PORT\"] != \"443\") {\n $currentURL .= \":\" . $_SERVER[\"SERVER_PORT\"];\n }\n\n // $currentURL .= $_SERVER[\"REQUEST_URI\"];\n // Ignore Query String\n if (isset($_SERVER[\"SCRIPT_NAME\"])) {\n $currentURL .= $_SERVER[\"SCRIPT_NAME\"];\n }\n if (isset($_SERVER[\"PATH_INFO\"])) {\n $currentURL .= $_SERVER[\"PATH_INFO\"];\n }\n return $currentURL;\n }",
"public function getUrl() {\n\t\t$url = $this->getBaseUrl().$this->getBasePath().$this->getOperation();\n\t\t$params = http_build_query($this->getUrlParameters());\n\t\tif ($params) {\n\t\t\t$url .= '?'.$params;\n\t\t}\n\t\treturn $url;\n\t}",
"public function getRequestUri() {\n\t\t$final = '';\n\t\tif($this->path) {\n\t\t\t$final .= $this->path;\n\t\t}\n\t\tif($this->query) {\n\t\t\t$final .= '?' . $this->query;\n\t\t}\n\t\treturn $final;\n\t}",
"public function url()\n {\n if (empty($this->parameters)) {\n return $this->url;\n }\n $total = array();\n foreach ($this->parameters as $k => $v) {\n if (is_array($v)) {\n foreach ($v as $va) {\n $total[] = HttpClient::urlencodeRFC3986($k).\"[]=\".HttpClient::urlencodeRFC3986($va);\n }\n } else {\n $total[] = HttpClient::urlencodeRFC3986($k).\"=\".HttpClient::urlencodeRFC3986($v);\n }\n }\n $out = implode(\"&\", $total);\n\n return $this->url.'?'.$out;\n }",
"private function getThisPageFullURL()\n {\n return 'http' . ( ! empty($_SERVER['HTTPS']) ? 's' : '' ) . '://' . $_SERVER['SERVER_NAME'] . $_SERVER['PHP_SELF'] . ( ( empty($_GET) ) ? '' : '?' . http_build_query($_GET) );\n }",
"function getLink () {\n\t\t$baseLink = 'index.php';\n\t\tif ($this->getAction ()) {\n\t\t\treturn $baseLink .= '?action='.$this->getAction ();\n\t\t}\n\t\telseif ($this->isAdminPage ()) {\n\t\t\treturn $baseLink .= '?action=admin&pageID='.$this->getID ();\n\t\t} else {\n\t\t\treturn $baseLink .= '?action=viewPage&pageID='.$this->getID ();\n\t\t}\n\t}",
"static function currentURL(){\n $protocol = strpos(strtolower($_SERVER['SERVER_PROTOCOL']),'https') === FALSE ? 'http' : 'https';\n $host = $_SERVER['HTTP_HOST'];\n $script = $_SERVER['SCRIPT_NAME'];\n $params = $_SERVER['QUERY_STRING'];\n\n return $protocol . '://' . $host . $script . '?' . $params;\n }",
"public function getCurrentUrl();",
"public static function buildUrl($parameters) {\n\t \n\t $url='';\n\t \n\t // set the base url\n\t if(isset($parameters['baseUrl'])) {\n\t $url .= $parameters['baseUrl'];\n\t unset($parameters['baseUrl']);\n\t } else {\n\t $url .= self::getBaseUrl();\n\t }\n\t \n\t // set the kiosk\n\t if(isset($parameters['kiosk'])) {\n\t $kiosk = $parameters['kiosk'];\n\t unset($parameters['kiosk']);\n\t } else {\n\t $kiosk = self::getKiosk();\n\t }\n\t if(!empty($kiosk)) {\n\t $url .= '/'.$kiosk;\n\t }\n\t \n\t // set the scope\n\t if(isset($parameters['scope'])) {\n\t $url .= '/'.$parameters['scope'];\n\t unset($parameters['scope']);\n\t } else {\n\t $url .= '/'.self::getScope();\n\t }\n\t \n\t if(isset($parameters['action'])) {\n\t $url .= '/'. $parameters['action'].'.do';\n\t unset($parameters['action']);\n\t } else {\n\t $url .= '/'. self::getAction().'.do';\n\t }\n\t \n\t if(count($parameters)) {\n\t $url .= '?'.http_build_query($parameters);\n\t }\n\t \n\t return $url;\n\t}",
"private function _getURL()\n {\n\n $url = $this->_ect . '?';\n foreach ($this as $name => $var) {\n if ($name == 'ect') {\n continue;\n }\n $url .= \"$name=$var&\";\n }\n\n $this->url = $url;\n\n return $this->url;\n }",
"public function getRequestUri()\n {\n $prefix = '';\n if (isset($this->pageRules['prefix'])) {\n $prefix = $this->pageRules['prefix'];\n }\n\n $request = $this->getRequest();\n $requestUri = $request->getPathInfo();\n\n if ($this->forcedPageName !== null) {\n $requestUri = $this->forcedPageName;\n\n } elseif (isset($this->pageRules['rules']) && count($this->pageRules['rules']) > 0) {\n foreach ($this->pageRules['rules'] as $rule) {\n if (preg_match('~' . $rule['path'] . '~', $requestUri)) {\n $requestUri = $rule['name'];\n break;\n }\n }\n }\n\n $params = array();\n if (isset($this->pageRules['add_params']) && $this->pageRules['add_params'] === true) {\n $params = $request->query->all();\n if (!empty($this->whitelist) && !empty($params)) {\n $whitelist = array_flip($this->whitelist);\n $params = array_intersect_key($params, $whitelist);\n }\n }\n if (count($this->forcedPageParams) > 0) {\n $params = array_merge($params, $this->forcedPageParams);\n }\n if (count($params) > 0) {\n $query = http_build_query($params);\n\n if (isset($query) && '' != trim($query)) {\n $requestUri .= '?'. $query;\n }\n }\n\n return $prefix . $requestUri;\n }",
"function rebuildURL($remove){\n\t\t$curl = preg_replace('/\\?.*/', '', curPageURL()); //get current URL and remove the query string\n\t\t$query = constructQuery(removeURLQuery($remove));\n\t\treturn $curl.$query;\n\t\t\n\t\t\n\t}",
"private function _getUrl()\n\t{\n\t\t$url = isset($_GET['url']) ? $_GET['url'] : null;\n\t\t$url = rtrim($url, '/');\n\t\t$url = filter_var($url, FILTER_SANITIZE_URL);\n\t\t$this->_url = explode('/', $url);\n\t}",
"private function _getUrl()\n\t{\n\t\t$url = isset($_GET['url']) ? $_GET['url'] : null;\n\t\t$url = rtrim($url, '/');\n\t\t$url = filter_var($url, FILTER_SANITIZE_URL);\n\t\t$this->_url = explode('/', $url);\n\t}",
"public static function requestedURL()\n\t{\n\t\t$url = new SMURL;\n\t\t\n\t\t// set scheme\n\t\t$scheme = ( isset( $_SERVER['HTTPS'] ) && $_SERVER['HTTPS'] == 'on' ) ? 'https' : 'http';\n\t\t$url->setScheme( $scheme );\n\t\t\n\t\t// set host\n\t\t$url->setHost( $_SERVER['HTTP_HOST'] );\n\t\t\n\t\t// set path and query\n\t\tif( isset( $_SERVER['REQUEST_URI'] ) )\n\t\t{\n\t\t\tpreg_match( '/\\/([^\\?]*)(?:\\?(.*))?$/', $_SERVER['REQUEST_URI'], $match );\n\t\t\t$url->setPath( $match[1] );\n\t\t\t$url->setQueryString( $match[2] );\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$url->setPath( $_SERVER['SCRIPT_NAME'] );\n\t\t\t$url->setQueryString( $_SERVER['QUERY_STRING'] );\n\t\t}\n\n\t\t// set port\n\t\t$url->setPort( $_SERVER['SERVER_PORT'] );\n\t\t\n\t\treturn $url;\n\t}",
"private function getQueryUrl(): string\n {\n return $this->getBaseUrl() . 'query';\n }",
"function current_url()\n{\n if (empty($_SERVER['QUERY_STRING'])) {\n $query_string = '';\n } else {\n $query_string = '?' . $_SERVER['QUERY_STRING'];\n }\n\n return $_SERVER['PHP_SELF'] . $query_string;\n}",
"public function getRequestUrl() {\n\t}",
"function rebuild($to_unset=\"block\"){\n\t\t\tglobal $_GET;\n\t\t\tunset($_GET[$to_unset]);\n\t\t\t\t\n\t\t\t$glue = \"?\";\n\t\t\treset($_GET);\n\t\t\twhile(list($key,$val)=each($_GET)){\n\t\t\t\t$val = str_replace(\" \",\"%20\",$val);\n\t\t\t\t$glue .= $key . \"=\" . $val . \"&\";\n\t\t\t}\n\t\t\treturn $glue;\n\t\t}",
"protected function calculateUrlWithParams()\n {\n // Get the absolute URL to the page including the site domain.\n // Get the Url parameter records for this page.\n // Also include the project coordinator field values in the URL parameters.\n $pageUrl = $this->AbsoluteLink();\n\n $parameters = \"\";\n\n // If values for the project code, Project Manager, Project Coordinator, or Project Coordinator\n // email fields have been specified include them as parameters in the URL.\n if ($this->ProjectName) {\n $parameters .= '&Project_Name=' . urlencode($this->ProjectName);\n }\n\n if ($this->ProjectCode) {\n $parameters .= '&Project_Code=' . urlencode($this->ProjectCode);\n }\n\n if ($this->ProjectManager) {\n $parameters .= '&Project_Manager=' . urlencode($this->ProjectManager);\n }\n\n if ($this->ProjectManagerEmail) {\n $parameters .= '&Project_Manager_email=' . urlencode($this->ProjectManagerEmail);\n }\n\n if ($this->ProjectCoordinator) {\n $parameters .= '&Project_Coordinator=' . urlencode($this->ProjectCoordinator);\n }\n\n if ($this->ProjectCoordinatorEmail) {\n $parameters .= '&Project_Coordinator_email=' . urlencode($this->ProjectCoordinatorEmail);\n }\n\n // Get the URL parameters specified for this page. Loop and add them.\n $parameterFields = $this->UrlParams()->sort('SortOrder', 'Asc');\n\n foreach($parameterFields as $field) {\n $parameters .= '&' . str_replace(' ', '_', $field->PostcardMetadataField()->Label) . '=' . urlencode($field->Value);\n }\n\n // Remove first & and replace with ?.\n $parameters = ltrim($parameters, '&');\n\n // Put together the URL of the page with the params.\n $pageUrl .= '?' . $parameters;\n\n return $pageUrl;\n }",
"private function _buildUrl() {\n $url = OPENDIGI_API_ENDPOINT;\n $url .= '?Vcollection=' . implode('+', $this->_collections);\n if ($this->_languages)\n $url .= '&Vlanguages=' . implode('+', $this->_languages);\n if ($this->_subjectIds)\n $url .= '&Vsubjectids=' . implode('+', $this->_subjectIds);\n\n return $url;\n }",
"protected function get_endpoint_url() {\n\n\t\t$args = http_build_query( array( 'apikey' => $this->api_key ) );\n\t\t$base = $this->route . $this->app_id;\n\t\t$url = \"$base?$args\";\n\n\t\treturn $url;\n\t}",
"private function generate_url($params) {\n $s = ($_SERVER['HTTPS'] == 'on') ? 's' : '';\n $protocol = $this->strleft(strtolower($_SERVER['SERVER_PROTOCOL']), '/') . $s;\n $port = (($_SERVER['SERVER_PORT'] == '80' && $_SERVER['HTTPS'] != 'on') ||\n ($_SERVER['SERVER_PORT'] == '443' && $_SERVER['HTTPS'] == 'on')) ? \n '' : (':' .$_SERVER['SERVER_PORT']);\n $path = $this->strleft($_SERVER['REQUEST_URI'], '?');\n $parsed_params = '';\n $delm = '?';\n foreach (array_reverse($params) as $key => $val) {\n if (!empty($val)) {\n $parsed_key = $key[0] == '_' ? $key : '_' . $key;\n $parsed_params .= $delm . urlencode($parsed_key) . '=' . urlencode($val);\n $delm = '&';\n }\n }\n $cfg = rcmail::get_instance()->config->all();\n if ( $cfg['cas_webmail_server_name'] ) {\n $serverName = $cfg['cas_webmail_server_name'];\n } else {\n $serverName=$_SERVER['SERVER_NAME'];\n }\n return $protocol . '://' . $serverName . $port . $path . $parsed_params;\n }",
"function addURLQuery($query){\n\t\t$query = \"?\".$query.\"&\";\n\t\tforeach($_GET as $k=>$v){\n\t\t\t$query .= \"$k=$v\".\"&\";\n\t\t}\n\t\t$query = substr($query, 0, -1);//chop last ampersand off\n\t\t$curl = preg_replace('/\\?.*/', '', curPageURL()); //get current URL and remove the query string\n\t\treturn $curl.$query;\n\t}",
"public static function getCurrentURL($remove = null) {\n self::getAll();\n $out = array();\n if(!empty($remove)) {\n $remove = !is_array($remove) ? array($remove) : $remove;\n foreach(self::$_params as $key => $value) {\n if(in_array($key, $remove)) {\n unset(self::$_params[$key]);\n }\n }\n }\n foreach(self::$_params as $key => $value) {\n $out[] = $key . \"=\" . $value; \n }\n return \"?\" . implode(\"&\", $out);\n }",
"function set_page_link($newqs = array(), $newpath = null) {\n $get = $_GET;\n unset($get['request_uri']);\n $allqet = array_merge($get, $newqs);\n if (empty($newpath)) {\n $qs = http_build_query($allqet);\n return Router::$page_url . (!empty($qs) ? \"?$qs\" : null);\n }\n $qs = http_build_query($allqet);\n return \"$newpath\" . (!empty($qs) ? \"?$qs\" : null);\n}",
"function current_url()\n{\n $now_url = '';\n $url = get_url();\n if (!empty($url)) {\n foreach ($url as $route) {\n $now_url .= $route . '/';\n }\n return URL . $now_url;\n } else {\n return URL . $now_url;\n }\n}",
"private function getURL(){\n if(!empty($_SERVER['REQUEST_URI'])){\n return trim($_SERVER['REQUEST_URI'],'/');\n }\n }",
"protected function buildRequestUri()\n {\n $requestParameters = array();\n\n // add entity\n if (!empty($this->defaultOptions['entity'])) {\n $tmp = array_keys($this->defaultOptions['entity']);\n $key = array_pop($tmp);\n $requestParameters[] = 'entity=' . $this->defaultOptions['entity'][$key];\n }\n\n // add media type\n if (!empty($this->defaultOptions['mediaType'])) {\n $requestParameters[] = 'media=' . $this->defaultOptions['mediaType'];\n }\n\n // add attribute\n if (!empty($this->defaultOptions['attribute'])) {\n $requestParameters[] = 'attribute=' . $this->defaultOptions['attribute'];\n }\n\n // add language\n if (!empty($this->defaultOptions['language'])) {\n $requestParameters[] = 'lang=' . $this->defaultOptions['language'];\n }\n\n // add limit\n if ($this->defaultOptions['limit'] <> 100) {\n $requestParameters[] = 'limit=' . $this->defaultOptions['limit'];\n }\n\n // add country\n if ($this->defaultOptions['country'] != 'us') {\n $requestParameters[] = 'country=' . $this->defaultOptions['country'];\n }\n\n // add callback\n if (!empty($this->defaultOptions['callback'])) {\n $requestParameters[] = 'callback=' . $this->defaultOptions['callback'];\n }\n\n // add version\n if ($this->defaultOptions['version'] <> 2) {\n $requestParameters[] = 'version=' . $this->defaultOptions['version'];\n }\n\n // add explicity\n if ($this->defaultOptions['explicit'] != 'yes') {\n $requestParameters[] = 'explicit=' . $this->defaultOptions['explicit'];\n }\n\n return implode('&', $requestParameters);\n }",
"public static function getUrl() {\n\t\tif(!isset(self::$url)) {\n\t\t\tself::$url = self::getUrlBase();\n\t\t\tif(isset($_SERVER['REQUEST_URI'])) {\n\t\t\t\tself::$url .= $_SERVER['REQUEST_URI'];\n\t\t\t}\n\t\t}\n\t\treturn self::$url;\n\t}",
"function build_url($controller=null, $action=null, $params='', $includeDomain=false, $module=null)\r\n{\r\n if ($module == null) {\r\n $ctrl = Zend_Controller_Front::getInstance();\r\n \t$request = $ctrl->getRequest();\r\n \t/* @var $request Zend_Controller_Request_Abstract */\r\n \t$name = null;\r\n \tif ($request) {\r\n \t $name = $request->getModuleName();\r\n \t}\r\n \r\n if ($name && $name != 'default') {\r\n $module = $name;\r\n }\r\n } else if ($module == 'default') {\r\n $module = '';\r\n }\r\n \r\n\t$paramStr = '';\r\n\t// The appendage is for any # based params passed in\r\n\t$appendage = '';\r\n\tif (is_array($params)) {\r\n\t\t$sep = '';\r\n\t\tforeach ($params as $k => $v) {\r\n\t\t if ($v instanceof ArrayObject || is_array($v)) {\r\n\t\t continue;\r\n\t\t }\r\n\t\t\tif (!strlen($v)) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\tif (strpos($v, '#') === 0) {\r\n\t\t\t $appendage = $v;\r\n\t\t\t continue;\r\n\t\t\t}\r\n\t\t\t$paramStr .= $sep.urlencode($k).'/'.urlencode($v);\r\n\t\t\t$sep = '/';\r\n\t\t}\r\n\t} else {\r\n\t\t$paramStr = $params;\r\n\t}\r\n\t// $url = $this->getContextPath().\r\n\t$url = context_path($includeDomain).\r\n\t ($module != null ? '/'.$module : '') .\r\n\t ($controller != '' ? '/'.$controller : '') .\r\n\t\t($action != '' ? '/'.$action : '') . \r\n\t\t($paramStr != '' ? '/'.$paramStr : '');\r\n\t\t\r\n\t// Many browsers require the / on the end when working with\r\n\t// url rewrites, so lets make sure it has one. \r\n\tif (strrpos($url, '/') != (strlen($url) - 1) && strpos($url, '?') === false) {\r\n\t\t$url .= '/';\r\n\t}\r\n\r\n\t$url .= $appendage;\r\n\r\n\t$protocol = get_protocol(ifset($_SERVER, 'SERVER_PROTOCOL'));\r\n\r\n\treturn $url;\r\n}",
"protected function renderCurrentUrl() {}",
"protected function renderCurrentUrl() {}",
"public static function generateURL()\n {\n return $_SERVER['REQUEST_SCHEME'].'://'.$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'];\n }",
"private function _getUrl()\n {\n // Explode url to the array Variabels (url)\n $url = isset($_GET['url']) ? $_GET['url'] : null;;\n $url = rtrim($url, '/');\n $url = filter_var($url,FILTER_SANITIZE_URL);\n $this->_url = explode('/', $url);\n }",
"protected function buildQueryString()\n {\n $parameters = $this->_queryParameters;\n $parameters['USER'] = $this->_username;\n $parameters['PWD'] = $this->_password;\n $parameters['SIGNATURE'] = $this->_signature;\n $parameters['VERSION'] = self::VERSION;\n $parameters['METHOD'] = $this::METHOD;\n return http_build_query($parameters);\n }",
"private static function generateUrlPrams(){\n\t\t$url = [] ;\n\t\tif ( isset($_GET['urlFromHtaccess']) ){\n\t\t\t$url = explode('/' , trim($_GET['urlFromHtaccess']) );\n\t\t}\n\t\tself::$url = $url ;\n\t}",
"private function urlWithoutPageKey(): string\n {\n $queryString = http_build_query($this->query_without_page_key);\n\n return $this->request->url().$this->withQuestion($queryString);\n }",
"public function getCurrentUrl(array $params, Smarty_Internal_Template $template): string\n {\n $currentUrl = $this->basePath.$this->uri->getPath();\n $query = $this->uri->getQuery();\n\n if (($params['withQueryString'] ?? false) && !empty($query)) {\n $currentUrl .= '?'.$query;\n }\n\n return $currentUrl;\n }",
"private static function loadUrl(){\n\n $uri = $_SERVER['REQUEST_URI'];\n\n if (ENCRYPTURL == '1')\n $uri = CR::decrypt($uri);\n\n BASEDIR == '/' || $uri = str_replace(BASEDIR,'', $uri);\n $uri = explode('/', $uri);\n\n array_walk($uri, function(&$item){\n strpos($item, '?') == false ||\n $item = substr($item, 0, strpos($item, '?'));\n });\n\n return $uri;\n }",
"protected function get_url()\n {\n return $this->base_url + $this->api_version; \n }",
"public function toString(): string\n\t{\n\t\t$url = $this->base();\n\t\t$slash = true;\n\n\t\tif (empty($url) === true) {\n\t\t\t$url = '/';\n\t\t\t$slash = false;\n\t\t}\n\n\t\t$path = $this->path->toString($slash) . $this->params->toString(true);\n\n\t\tif ($this->slash && $slash === true) {\n\t\t\t$path .= '/';\n\t\t}\n\n\t\t$url .= $path;\n\t\t$url .= $this->query->toString(true);\n\n\t\tif (empty($this->fragment) === false) {\n\t\t\t$url .= '#' . $this->fragment;\n\t\t}\n\n\t\treturn $url;\n\t}",
"function add_query( $key, $value ) {\r\n\t\t\t$this->current_url = add_query_arg( $key, $value, $this->get_current_url() );\r\n\t\t\treturn $this->current_url;\r\n\t\t}",
"private function getUrlRequests(): string\n {\n $arrRequests = [];\n if ('' != $this->states['title']) {\n $arrRequests[] = 'title=' . $this->states['title'];\n }\n // if(''!=$this->states['action']) $arrRequests[]='action='.$this->states['action'];\n return implode('&', $arrRequests);\n }",
"public static function curURL() {\n\t\t\t$pageURL = 'http';\n\t\t\tif ($_SERVER[\"HTTPS\"] == \"on\") {$pageURL .= \"s\";}\n\t\t\t\t$pageURL .= \"://\";\n\t\t\tif ($_SERVER[\"SERVER_PORT\"] != \"80\") {\n\t\t\t\t$pageURL .= $_SERVER[\"SERVER_NAME\"].\":\".$_SERVER[\"SERVER_PORT\"].$_SERVER['PHP_SELF'];\n\t\t\t} else {\n\t\t\t\t$pageURL .= $_SERVER[\"SERVER_NAME\"].\"/\";\n\t\t\t}\n\t\t\treturn $pageURL;\n\t\t}",
"private function get_current_url() {\n\n\t\t$url = set_url_scheme(\n\t\t\t'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']\n\t\t);\n\n\t\t// We use 'msg' as parameter internally. Not needed for pagination.\n\t\treturn remove_query_arg( 'msg', $url );\n\t}",
"public function splitUrl() {\n if (isset($_GET['url'])) {\n\n // split URL\n $url = trim($_GET['url'], '/');\n $url = filter_var($url, FILTER_SANITIZE_STRING);\n $url = explode('/', $url);\n\n // parse custom urls\n $url = $this->parseRoutes($url);\n\n if ($this->app->language->enabled) {\n // set lang key\n $this->lang_key = isset($url[0]) ? $url[0] : null;\n // set controller\n $this->url_controller = isset($url[1]) ? $url[1] : null;\n // and action\n $this->url_action = isset($url[2]) ? $url[2] : null;\n\n // store URL parts\n $this->url_parts = array_values($url);\n\n // remove controller and action from URL parts\n unset($url[0], $url[1], $url[2]);\n } else {\n // set controller\n $this->url_controller = isset($url[0]) ? $url[0] : null;\n // and action\n $this->url_action = isset($url[1]) ? $url[1] : null;\n\n // store URL parts\n $this->url_parts = array_values($url);\n\n // remove controller and action from URL parts\n unset($url[0], $url[1]);\n }\n\n // store action params\n $this->action_params = array_values($url);\n\n }\n }",
"private function url_params()\n {\n return \"?user={$this->login}&password={$this->password}&answer=json\";\n }",
"public static function getPageUrl()\n {\n $db = DataAccess::getInstance();\n $url = $db->get_site_setting('classifieds_file_name') . '?';\n $gets = array();\n foreach ($_GET as $key => $val) {\n if (in_array($key, array('filterValue','setFilter','resetFilter', 'resetAllFilters', 'page'))) {\n //don't add this -- it's part of the filters\n //also don't add \"page\" so that adding a new filter always forces the user to \"page one\"\n continue;\n }\n $gets[] = \"$key=$val\";\n }\n $url .= implode('&', $gets);\n return $url;\n }",
"public function get_current_admin_url($params = '')\n {\n }",
"function buildLinkWithQueryString($userName, $firstName, $lastName, $email) {\t\n\t$linkWithQueryString = 'index.php?userName=' . $userName . '&firstName=' . $firstName . '&lastName=' . $lastName . \n\t'&email=' . $email;\t\n\treturn $linkWithQueryString;\t\t\n}",
"function current_url()\r\n{\r\n if (!isset($_SERVER['REQUEST_URI'])) {\r\n return '/';\r\n }\r\n\t$pathIndex = dirname($_SERVER['SCRIPT_NAME']);\r\n\r\n\t// SubDirectoryRouter: remove $pathIndex from $_SERVER['REQUEST_URI']\r\n\t$path = str_replace($pathIndex, '', $_SERVER['REQUEST_URI']);\r\n\t$path = $_SERVER['REQUEST_URI'];\r\n\tif (strstr($path, '?')) {\r\n\t\t$path = substr($path, 0, strpos($path, '?'));\r\n\t}\r\n\t\r\n\treturn $path;\r\n}"
] | [
"0.73821956",
"0.72704273",
"0.7240689",
"0.7238629",
"0.71037394",
"0.70705056",
"0.7033035",
"0.6929706",
"0.69200855",
"0.68948627",
"0.6894579",
"0.6886055",
"0.68766373",
"0.6822219",
"0.68215984",
"0.68160695",
"0.6790336",
"0.6770909",
"0.6756915",
"0.6712185",
"0.6697389",
"0.6690547",
"0.6688241",
"0.66654783",
"0.66654783",
"0.66654783",
"0.66654783",
"0.66654783",
"0.66654783",
"0.66443443",
"0.66248626",
"0.6621699",
"0.6617075",
"0.6613216",
"0.66096956",
"0.65696615",
"0.65696615",
"0.65548515",
"0.65548515",
"0.6538475",
"0.65236115",
"0.65137863",
"0.6508453",
"0.6507547",
"0.6506449",
"0.64667565",
"0.6429807",
"0.64296395",
"0.64235675",
"0.6415699",
"0.6404949",
"0.6382564",
"0.6379956",
"0.63669753",
"0.63420475",
"0.6334924",
"0.63337725",
"0.632821",
"0.6320916",
"0.6306085",
"0.62966114",
"0.62909186",
"0.62909186",
"0.6281246",
"0.62765723",
"0.62684065",
"0.6263846",
"0.6262334",
"0.6262216",
"0.6261097",
"0.62609607",
"0.62311375",
"0.6225489",
"0.6220948",
"0.6219916",
"0.6213465",
"0.62130415",
"0.6211754",
"0.62046677",
"0.6203882",
"0.62028885",
"0.62028885",
"0.62003464",
"0.61925584",
"0.6181939",
"0.61813974",
"0.6178338",
"0.6164561",
"0.61645305",
"0.61491954",
"0.61369884",
"0.6128666",
"0.61016965",
"0.60979176",
"0.60924244",
"0.6083957",
"0.6074965",
"0.60696423",
"0.6069418",
"0.60661995",
"0.60605913"
] | 0.0 | -1 |
Uploads a file to location | function upload($path) {
$ok = false;
$this->uploadpath .= $path . '/';
if ($this->validate()) {
$this->filename = $this->params['form']['Filedata']['name'];
$ok = $this->write();
}
if (!$ok) {
header("HTTP/1.0 500 Internal Server Error"); //this should tell SWFUpload what's up
$this->setError(); //this should tell standard form what's up
}
return ($ok);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function upload_file() {\n upload_file_to_temp();\n }",
"public function upload();",
"public function upload($file, $local_file);",
"public function upload()\n {\n App::import('Lib', 'Uploads.file_receiver/FileReceiver');\n App::import('Lib', 'Uploads.file_dispatcher/FileDispatcher');\n App::import('Lib', 'Uploads.file_binder/FileBinder');\n App::import('Lib', 'Uploads.UploadedFile');\n\n $this->cleanParams();\n $Receiver = new FileReceiver($this->params['url']['extensions'], $this->params['url']['limit']);\n $Dispatcher = new FileDispatcher(\n Configure::read('Uploads.base'),\n Configure::read('Uploads.private')\n );\n $Binder = new FileBinder($Dispatcher, $this->params['url']);\n try {\n $File = $Receiver->save(Configure::read('Uploads.tmp'));\n $Binder->bind($File);\n $this->set('response', $File->getResponse());\n file_put_contents(LOGS.'mh-uploads.log', date('Y-m-d H:i > ').'Uploaded '.$File->getName().chr(10), FILE_APPEND);\n } catch (RuntimeException $e) {\n file_put_contents(LOGS.'mh-uploads.log', date('Y-m-d H:i > ').$e->getMessage().chr(10), FILE_APPEND);\n $this->set('response', $this->failedResponse($e));\n }\n $this->layout = 'ajax';\n $this->RequestHandler->respondAs('js');\n }",
"public function upload_local_file()\n\t{\n if ($this->local_file) {\n \t$s3 = AWS::createClient('s3');\n $s3->putObject(\n array(\n 'Bucket' => $this->bucket,\n 'Key' => $this->location,\n 'SourceFile' => $this->local_file,\n 'ContentType' => $this->mime,\n 'StorageClass' => $this->storage,\n 'ServerSideEncryption' => $this->encryption\n )\n );\n }\n\t}",
"public function upload()\n {\n if (null === $this->getFile()) {\n return;\n }\n\n // use the original file name here but you should\n // sanitize it at least to avoid any security issues\n\n // move takes the target directory and then the\n // target filename to move to\n\n $filePath = md5(uniqid($this->getIdUser().\"_profil\",true)).\".\".\n $this->getFile()->guessClientExtension();\n\n $this->getFile()->move(\n $this->getUploadRootDir(),$filePath\n );\n\n // set the path property to the filename where you've saved the file\n $this->path = $filePath;\n\n // clean up the file property as you won't need it anymore\n $this->file = null;\n }",
"public function upload()\n {\n if (null === $this->file) {\n return;\n }\n\n // si on avait un ancien fichier on le supprime\n if (null !== $this->tempFilename) {\n $oldFile = $this->getUploadRootDir().'/'.$this->id.'.'.$this->tempFilename;\n if (file_exists($oldFile)) {\n unlink($oldFile);\n }\n }\n\n // déplace le fichier envoyé dans le répertoire de notre choix\n $this->file->move(\n $this->getUploadRootDir(), // répertoire de destination\n $this->id.'.'.$this->url // nom du fichier à créer \"id.extension\"\n );\n\n }",
"public function upload()\n {\n if (null === $this->getFile()) {\n return;\n }\n\n // use the original file name here but you should\n // sanitize it at least to avoid any security issues\n $filename = substr( md5(rand()), 0, 15).'.'.$this->getFile()->guessExtension();\n // move takes the target directory and then the\n // target filename to move to\n\n\n\t\t\t\tif(!file_exists($this->getUploadRootDir())) mkdir($this->getUploadRootDir(), 0777, true);\n $this->getFile()->move(\n $this->getUploadRootDir(),\n $filename\n );\n\n // set the path property to the filename where you've saved the file\n $this->path = $filename;\n\n // clean up the file property as you won't need it anymore\n $this->file = null;\n }",
"public function actionUpload()\n\t{\n\n\t\t$input = craft()->request->getPost();\n\n\t\t$file = UploadedFile::getInstanceByName('file');\n\n\t\t$folder = craft()->assets->findFolder(array(\n\t\t 'id' => $input['id']\n\t\t));\n\n\t\tif ($folder) {\n\t\t\t$folderId = $input['id'];\n\t\t}\n\n\t\tcraft()->assets->insertFileByLocalPath(\n\t\t $file->getTempName(),\n\t\t $file->getName(),\n\t\t $folderId,\n\t\t AssetConflictResolution::KeepBoth);\n\n\t\tcraft()->end();\n\t}",
"public function upload()\n\t{\n\t}",
"public function upload()\n {\n if (null === $this->getFile()) {\n return;\n }\n\n // use the original file name here but you should\n // sanitize it at least to avoid any security issues\n $filename = substr( md5(rand()), 0, 15).'.'.$this->getFile()->guessExtension();\n // move takes the target directory and then the\n // target filename to move to\n $this->getFile()->move(\n $this->getUploadRootDir(),\n $filename\n );\n\n // set the path property to the filename where you've saved the file\n $this->path = $filename;\n\n // clean up the file property as you won't need it anymore\n $this->file = null;\n }",
"public function upload()\n {\n // the file property can be empty if the field is not required\n if (null === $this->getFile()) {\n return;\n }\n $filename = time().'_'.$this->getFile()->getClientOriginalName();\n\n // we use the original file name here but you should\n // sanitize it at least to avoid any security issues\n\n // move takes the target directory and target filename as params\n $this->getFile()->move(\n self::$SERVER_PATH_TO_VIDEO_FOLDER,\n $filename\n );\n\n // set the path property to the filename where you've saved the file\n $this->filename = $filename;\n\n // clean up the file property as you won't need it anymore\n $this->setFile(null);\n }",
"public function upload_foto_file()\n\t{\n\t\tif (!$this->is_allowed('m_ads_add', false)) {\n\t\t\techo json_encode([\n\t\t\t\t'success' => false,\n\t\t\t\t'message' => cclang('sorry_you_do_not_have_permission_to_access')\n\t\t\t\t]);\n\t\t\texit;\n\t\t}\n\n\t\t$uuid = $this->input->post('qquuid');\n\n\t\techo $this->upload_file([\n\t\t\t'uuid' \t\t \t=> $uuid,\n\t\t\t'table_name' \t=> 'm_ads',\n\t\t]);\n\t}",
"public function upload()\n {\n if (null === $this->getFile()) {\n return;\n }\n\n // use the original file name here but you should\n // sanitize it at least to avoid any security issues\n $partes_ruta = pathinfo($this->getFile()->getClientOriginalName());\n $this->nombre = md5(uniqid()) . '.' . $partes_ruta['extension'];\n\n // move takes the target directory and then the\n // target filename to move to\n $this->getFile()->move(\n $this->getUploadRootDir(),\n $this->nombre\n );\n\n $this->url = $this->getWebPath();\n\n // clean up the file property as you won't need it anymore\n $this->file = null;\n }",
"public function upload()\n {\n if (null === $this->file) {\n return;\n }\n\n // use the original file name here but you should\n // sanitize it at least to avoid any security issues\n\n // move takes the target directory and then the\n // target filename to move to\n $this->file->move(\n $this->getUploadRootDir(),\n $this->id . '.' .$this->ext\n );\n\n // set the ext property to the filename where you've saved the file\n //$this->ext = $this->file->getClientOriginalName();\n\n // clean up the file property as you won't need it anymore\n $this->file = null;\n }",
"public function upload()\n {\n // The file property can be empty if the field is not required\n if (null === $this->file) {\n return;\n }\n\n // Use the original file name here but you should\n // sanitize it at least to avoid any security issues\n\n // move takes the target directory and then the\n // target filename to move to\n $this->file->move(\n $this->getUploadRootDir(),\n $this->path\n );\n\n // Set the path property to the filename where you've saved the file\n $this->path = $this->file->getClientOriginalName();\n\n // Clean up the file property as you won't need it anymore\n $this->file = null;\n }",
"public function upload()\n\t{\n\t if (null === $this->getFile()) {\n\t return;\n\t }\n\t\n\t // use the original file name here but you should\n\t // sanitize it at least to avoid any security issues\n\t\n\t // move takes the target directory and then the\n\t // target filename to move to\n\t \n\t $this->getFile()->move($this->getWebPath(),$this->imagen);\n\t \n\t \n\t // set the path property to the filename where you've saved the file\n\t $this->path = $this->getFile()->getClientOriginalName();\n\t\t//$this->temp = \n\t // clean up the file property as you won't need it anymore\n\t $this->file = null;\n\t}",
"public function upload()\n {\n }",
"public function upload($file) {\n /*\n ** is there some file to upload\n */\n if (isset($file))\n FileLoaderController::setFiles($file);\n else\n API::error('No file found.');\n\n /*\n ** Upload the current media\n */\n FileLoaderController::upload($this);\n\n }",
"public function upload() {\n // the file property can be empty if the field is not required\n if (null === $this->getFile()) {\n return;\n }\n\n // we use the original file name here but you should\n // sanitize it at least to avoid any security issues\n\n // move takes the target directory and target filename as params\n $this->getFile()->move(\n self::SERVER_PATH_TO_IMAGE_FOLDER,\n $this->getFile()->getClientOriginalName()\n );\n\n // set the path property to the filename where you've saved the file\n $this->filename = $this->getFile()->getClientOriginalName();\n\n // clean up the file property as you won't need it anymore\n $this->setFile(null);\n }",
"public function upload($file, $dest)\n\t{\n\t}",
"abstract protected function doUpload();",
"public function upload()\n {\n if (null === $this->getFile()) {\n return;\n }\n\n // use the original file name here but you should\n // sanitize it at least to avoid any security issues\n\n // move takes the target directory and then the\n // target filename to move to\n \n\n $this->getFile()->move(\n $this->getUploadRootDir(),\n $this->getFile()->getClientOriginalName()\n );\n\n // set the path property to the filename where you've saved the file\n $this->path = $this->getFile()->getClientOriginalName();\n\n // clean up the file property as you won't need it anymore\n $this->file = null;\n }",
"public function upload()\n {\n if (null === $this->getFile()) {\n return;\n }\n\n // use the original file name here but you should\n // sanitize it at least to avoid any security issues\n\n // move takes the target directory and then the\n // target filename to move to\n $this->getFile()->move(\n $this->getUploadRootDir(),\n $this->getFile()->getClientOriginalName()\n );\n\n // set the path property to the filename where you've saved the file\n $this->path = $this->getFile()->getClientOriginalName();\n\n // clean up the file property as you won't need it anymore\n $this->file = null;\n }",
"public function upload()\n {\n if (null === $this->getFile()) {\n return;\n }\n\n // use the original file name here but you should\n // sanitize it at least to avoid any security issues\n\n // move takes the target directory and then the\n // target filename to move to\n $this->getFile()->move(\n $this->getUploadRootDir(),\n $this->getFile()->getClientOriginalName()\n );\n\n // set the path property to the filename where you've saved the file\n $this->path = $this->getFile()->getClientOriginalName();\n\n // clean up the file property as you won't need it anymore\n $this->file = null;\n }",
"public function upload()\n {\n if (null === $this->getFile()) {\n return;\n }\n\n // use the original file name here but you should\n // sanitize it at least to avoid any security issues\n\n // move takes the target directory and then the\n // target filename to move to\n $this->getFile()->move(\n $this->getUploadRootDir(),\n $this->getFile()->getClientOriginalName()\n );\n\n // set the path property to the filename where you've saved the file\n $this->path = $this->getFile()->getClientOriginalName();\n\n // clean up the file property as you won't need it anymore\n $this->file = null;\n }",
"public function upload()\n {\n if (null === $this->getFile()) {\n return;\n }\n\n // use the original file name here but you should\n // sanitize it at least to avoid any security issues\n\n // move takes the target directory and then the\n // target filename to move to\n $this->getFile()->move(\n $this->getUploadRootDir(),\n $this->getFile()->getClientOriginalName()\n );\n\n // set the path property to the filename where you've saved the file\n $this->path = $this->getFile()->getClientOriginalName();\n\n // clean up the file property as you won't need it anymore\n $this->file = null;\n }",
"public function upload()\n {\n if (null === $this->file) {\n return;\n }\n\n if(!is_dir($this->getTargetUploadRootDir())){\n mkdir($this->getTargetUploadRootDir(), 0777, true);\n }\n\n // move takes the target directory and then the\n // target filename to move to\n $this->file->move(\n $this->getTargetUploadRootDir(),\n $this->file->getClientOriginalName()\n );\n\n // set the path property to the filename where you've saved the file\n $this->path = date('Y-m-d').DIRECTORY_SEPARATOR.$this->id.DIRECTORY_SEPARATOR.$this->file->getClientOriginalName();\n\n // clean up the file property as you won't need it anymore\n $this->file = null;\n }",
"public function upload()\n {\n //Checks if the path is null\n if (null === $this->file) {\n return;\n }\n\n $hash = uniqid('', true);\n $extension = $this->file->getClientOriginalExtension();\n $newFilename = $hash.'.'.$extension;\n\n $this->file->move($this->getUploadRootDir(), $newFilename);\n $this->path = $newFilename;\n\n // Clean the path file\n $this->file = null;\n }",
"public function uploadPath();",
"public function uploadFile(){\n\n if (!$this->request->is('post'))\n {\n $this->setErrorMessage('Post method required');\n return;\n }\n\n if (!isset($this->request->data['currentPath']) ||\n !isset($this->request->params['form']) ||\n !isset($this->request->params['form']['idia'])\n ){\n $this->setErrorMessage('Invalid parameters');\n return;\n }\n\n $path = ltrim(trim($this->request->data['currentPath']), DS);\n $tokens = explode(DS, strtolower($path));\n\n ($tokens[0] == 'root') && ($tokens = array_slice($tokens, 1, null, true));\n\n $path = implode(DS, $tokens);\n $fullPath = WWW_FILE_ROOT . strtolower($path);\n\n if(!is_dir($fullPath)){\n $this->setErrorMessage('Invalid path');\n return;\n }\n\n if(is_file($fullPath . DS . strtolower($this->request->params['form']['idia']['name']))){\n $this->setErrorMessage('File with similar name already exist');\n return;\n }\n\n $newFile = new File($fullPath . DS . strtolower($this->request->params['form']['idia']['name']), true );\n $newFile->close();\n\n $tempFile = new File(($this->request->params['form']['idia']['tmp_name']));\n $tempFile->copy($fullPath . DS .$this->request->params['form']['idia']['name']);\n $tempFile->delete();\n\n $this->set(array(\n 'status' => 'ok',\n \"message\" => 'successful',\n \"_serialize\" => array(\"message\", \"status\")\n ));\n }",
"public function upload()\n {\n // the file property can be empty if the field is not required\n if (null === $this->getFile()) {\n return;\n }\n\n // we use the original file name here but you should\n // sanitize it at least to avoid any security issues\n\n // move takes the target directory and target filename as params\n $this->getFile()->move(\n Image::SERVER_PATH_TO_IMAGE_FOLDER,\n $this->path\n );\n\n // set the path property to the filename where you've saved the file\n $this->filename = $this->getFile()->getClientOriginalName();\n\n // clean up the file property as you won't need it anymore\n $this->setFile(null);\n }",
"private function submitFile()\n {\n\n $encoded_url = urlencode($this->getFileUrl());\n\n wp_remote_get(self::GOOGLE_WEBMASTER_TOOLS_URL . $encoded_url);\n wp_remote_get(self::BING_WEBMASTER_TOOLS_URL . $encoded_url);\n\n }",
"public function upload()\n {\n if (null === $this->getFile()) {\n return;\n }\n\n // use the original file name here but you should\n // sanitize it at least to avoid any security issues\n\n // move takes the target directory and then the\n // target filename to move to\n $this->getFile()->move(\n $this->getUploadRootDir(),\n $this->getFile()->getClientOriginalName()\n );\n\n // set the path property to the filename where you've saved the file\n $this->setImageName($this->getFile()->getClientOriginalName());\n // clean up the file property as you won't need it anymore\n $this->file = null;\n }",
"public function upload()\n {\n if (null === $this->getFile()) {\n return;\n }\n\n // use the original file name here but you should\n // sanitize it at least to avoid any security issues\n\n // move takes the target directory and then the\n // target filename to move to\n $this->getFile()->move(\n $this->getUploadRootDir(),\n $this->getFile()->getClientOriginalName()\n );\n\n // set the path property to the filename where you've saved the file\n $this->backgroundImage = $this->getFile()->getClientOriginalName();\n\n // clean up the file property as you won't need it anymore\n $this->file = null;\n }",
"public function actionUpload()\n {\n if (isset($_GET['department_id_from_url'])) {\n $filename = $_FILES['file']['name'];\n /* Location */\n $location = \"C:/OpenServer/domains/localhost/application/photo/\".$_GET['department_id_from_url'].\"/\" . $filename;\n $uploadOk = 1;\n $imageFileType = pathinfo($location, PATHINFO_EXTENSION);\n /* Valid Extensions */\n $valid_extensions = array(\"jpg\", \"jpeg\", \"png\");\n /* Check file extension */\n if (!in_array(strtolower($imageFileType), $valid_extensions)) {\n $uploadOk = 0;\n echo 0;\n }\n if ($uploadOk == 0) {\n echo 0;\n } else {\n /* Upload file */\n if (move_uploaded_file($_FILES['file']['tmp_name'], $location)) {\n echo $filename;\n } else {\n echo 0;\n }\n }\n }\n }",
"#[Post('/upload', name: 'upload')]\n public function upload(Request $request)\n {\n if (! ($file = $request->file('file'))) {\n abort(400);\n }\n\n $path = $file->store('upload', 'files');\n\n return [\n 'location' => Storage::disk('files')->url($path),\n ];\n }",
"public function upload() {\n if (null === $this->getFile()) {\n return;\n }\n\n // use the original file name here but you should\n // sanitize it at least to avoid any security issues\n // move takes the target directory and then the\n // target filename to move to\n $this->getFile()->move(\n $this->getUploadRootDir(), $this->getFile()->getClientOriginalName()\n );\n\n // set the path property to the filename where you've saved the file\n $this->photo = $this->getFile()->getClientOriginalName();\n\n // clean up the file property as you won't need it anymore\n $this->file = null;\n }",
"public function uploadAction()\n {\n // default file URI\n $defaultUri = $this->_config->urlBase . 'files/';\n\n // store for sparql queries\n $store = $this->_owApp->erfurt->getStore();\n\n // DMS NS var\n $dmsNs = $this->_privateConfig->DMS_NS;\n\n // check if DMS needs to be imported\n if ($store->isModelAvailable($dmsNs) && $this->_privateConfig->import_DMS) {\n $this->_checkDMS();\n }\n\n $url = new OntoWiki_Url(\n array('controller' => 'files', 'action' => 'upload'),\n array()\n );\n\n // check for POST'ed data\n if ($this->_request->isPost()) {\n $event = new Erfurt_Event('onFilesExtensionUploadFile');\n $event->request = $this->_request;\n $event->defaultUri = $defaultUri;\n // process upload in plugin\n $eventResult = $event->trigger();\n if ($eventResult === true) {\n if (isset($this->_request->setResource)) {\n $this->_owApp->appendMessage(\n new OntoWiki_Message('File attachment added', OntoWiki_Message::SUCCESS)\n );\n $resourceUri = new OntoWiki_Url(array('route' => 'properties'), array('r'));\n $resourceUri->setParam('r', $this->_request->setResource, true);\n $this->_redirect((string)$resourceUri);\n } else {\n $url->action = 'manage';\n $this->_redirect((string)$url);\n }\n }\n }\n\n $this->view->placeholder('main.window.title')->set($this->_owApp->translate->_('Upload File'));\n OntoWiki::getInstance()->getNavigation()->disableNavigation();\n\n $toolbar = $this->_owApp->toolbar;\n $url->action = 'manage';\n $toolbar->appendButton(\n OntoWiki_Toolbar::SUBMIT, array('name' => 'Upload File')\n );\n $toolbar->appendButton(\n OntoWiki_Toolbar::EDIT, array('name' => 'File Manager', 'class' => '', 'url' => (string)$url)\n );\n\n $this->view->defaultUri = $defaultUri;\n $this->view->placeholder('main.window.toolbar')->set($toolbar);\n\n $url->action = 'upload';\n $this->view->formActionUrl = (string)$url;\n $this->view->formMethod = 'post';\n $this->view->formClass = 'simple-input input-justify-left';\n $this->view->formName = 'fileupload';\n $this->view->formEncoding = 'multipart/form-data';\n if (isset($this->_request->setResource)) {\n // forward URI to form so we can redirect later\n $this->view->setResource = $this->_request->setResource;\n }\n\n if (!is_writable($this->_privateConfig->path)) {\n $this->_owApp->appendMessage(\n new OntoWiki_Message('Uploads folder is not writable.', OntoWiki_Message::WARNING)\n );\n return;\n }\n\n // FIX: http://www.webmasterworld.com/macintosh_webmaster/3300569.htm\n header('Connection: close');\n }",
"public function upload()\n {\n if (null === $this->getFile()) {\n return;\n }\n\n // if there is an error when moving the file, an exception will\n // be automatically thrown by move(). This will properly prevent\n // the entity from being persisted to the database on error\n $this->getFile()->move($this->getUploadRootDir(), $this->fileName);\n\n // check if we have an old image\n if (isset($this->temp)) {\n // delete the old image\n unlink($this->getUploadRootDir().'/'.$this->temp);\n // clear the temp image path\n $this->temp = null;\n }\n $this->file = null;\n }",
"public function upload()\n {\n // the file property can be empty if the field is not required\n if (null === $this->avatar)\n {\n return;\n }\n\n //Lastname du fichier\n $file = $this->id_user.'.'.$this->avatar->guessExtension();\n // move takes the target directory and then the target filename to move to\n $this->avatar->move($this->getUploadRootDir(), $file);\n //Suppression des thumbnail déjà en cache\n @unlink(__DIR__.'/../../../../../web/imagine/thumbnail/avatars/'.$file);\n @unlink(__DIR__.'/../../../../../web/imagine/avatar_thumbnail/avatars/'.$file);\n @unlink(__DIR__.'/../../../../../web/imagine/moyen_thumbnail/avatars/'.$file);\n @unlink(__DIR__.'/../../../../../web/imagine/mini_thumbnail/avatars/'.$file);\n\n // set the path property to the filename where you'ved saved the file\n $this->avatar = $file;\n }",
"public function upload(): void\n {\n // the file property can be empty if the field is not required\n if (null === $this->getFile()) {\n return;\n }\n\n // we use the original file name here but you should\n // sanitize it at least to avoid any security issues\n\n // move takes the target directory and target filename as params\n $this->getFile()->move(\n self::SERVER_PATH_TO_IMAGE_FOLDER,\n $this->getFile()->getClientOriginalName()\n );\n\n // set the path property to the filename where you've saved the file\n $this->logo = $this->getFile()->getClientOriginalName();\n\n // clean up the file property as you won't need it anymore\n $this->setFile(null);\n }",
"public function uploadAction()\n\t{\n\t\t$chunkSize = $this->getSizeTempFile();\n\n\t\t$isUploadStarted = ($this->uploadedPart > 0);\n\t\tif (!$isUploadStarted)\n\t\t{\n\t\t\t$reservedSize = round($chunkSize * ceil($this->totalItems / $this->pageSize) * 1.5);\n\n\t\t\t$this->uploadPath = $this->generateUploadDir(). $this->fileName;\n\n\t\t\t$this->findInitBucket(array(\n\t\t\t\t'fileSize' => $reservedSize,\n\t\t\t\t'fileName' => $this->uploadPath,\n\t\t\t));\n\n\t\t\tif ($this->checkCloudErrors())\n\t\t\t{\n\t\t\t\t$this->saveProgressParameters();\n\n\t\t\t\tif ($this->bucket->FileExists($this->uploadPath))\n\t\t\t\t{\n\t\t\t\t\tif(!$this->bucket->DeleteFile($this->uploadPath))\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->addError(new Error('File exists in a cloud.'));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->instanceBucket();\n\n\t\t\t$this->checkCloudErrors();\n\t\t}\n\n\n\t\tif (!file_exists($this->filePath))\n\t\t{\n\t\t\t$this->addError(new Error('Uploading file not exists.'));\n\t\t}\n\n\t\tif (count($this->getErrors()) > 0)\n\t\t{\n\t\t\treturn AjaxJson::createError($this->errorCollection);\n\t\t}\n\n\n\t\t$isSuccess = false;\n\n\t\tif ($this->isExportCompleted && !$isUploadStarted)\n\t\t{\n\t\t\t// just only one file\n\t\t\t$uploadFile = array(\n\t\t\t\t'name' => $this->fileName,\n\t\t\t\t'size' => $this->fileSize,\n\t\t\t\t'type' => $this->fileType,\n\t\t\t\t'tmp_name' => $this->filePath,\n\t\t\t);\n\n\t\t\tif ($this->bucket->SaveFile($this->uploadPath, $uploadFile))\n\t\t\t{\n\t\t\t\t$this->uploadedPart ++;\n\t\t\t\t$this->uploadedSize += $chunkSize;\n\t\t\t\t$isSuccess = true;\n\t\t\t\t$this->isUploadFinished = true;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->addError(new Error('Uploading error.'));\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$uploader = new \\CCloudStorageUpload($this->uploadPath);\n\t\t\tif (!$uploader->isStarted())\n\t\t\t{\n\t\t\t\tif (!$uploader->Start($this->bucketId, $reservedSize, $this->fileType))\n\t\t\t\t{\n\t\t\t\t\t$this->addError(new Error('Start uploading error.'));\n\n\t\t\t\t\treturn AjaxJson::createError($this->errorCollection);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$part = $this->getContentTempFile();\n\n\t\t\twhile ($uploader->hasRetries())\n\t\t\t{\n\t\t\t\tif ($uploader->Next($part, $this->bucket))\n\t\t\t\t{\n\t\t\t\t\t$this->uploadedPart ++;\n\t\t\t\t\t$this->uploadedSize += $chunkSize;\n\t\t\t\t\t$isSuccess = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tunset($part);\n\n\t\t\t// finish\n\t\t\tif ($isSuccess && $this->isExportCompleted)\n\t\t\t{\n\t\t\t\tif ($uploader->Finish())\n\t\t\t\t{\n\t\t\t\t\t$this->isUploadFinished = true;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$this->addError(new Error('FILE_UNKNOWN_ERROR'));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ($isSuccess)\n\t\t{\n\t\t\t$this->dropTempFile();\n\t\t}\n\n\t\t// Save progress\n\t\t$this->saveProgressParameters();\n\n\t\t// continue export into temporally file\n\t\t$result = $this->preformAnswer(self::ACTION_UPLOAD);\n\t\t$result['STATUS'] = self::STATUS_PROGRESS;\n\n\t\treturn $result;\n\t}",
"function media_upload_file()\n {\n }",
"public function upload(): void\n {\n // check if we have an old image\n if ($this->oldFileName !== null) {\n $this->removeOldFile();\n }\n\n if (!$this->hasFile()) {\n return;\n }\n\n $this->writeFileToDisk();\n\n $this->file = null;\n }",
"public function upload()\n {\n if (null === $this->getFile()) {\n return;\n }\n\n $this->picture = file_get_contents($this->getFile());\n\n if (isset($this->temp)) {\n $this->temp = null;\n }\n\n $this->file = null;\n }",
"public function upload()\n {\n if (null === $this->getFile()) {\n return;\n }\n\n // use the original file name here but you should\n // sanitize it at least to avoid any security issues\n\n // move takes the target directory and then the\n // target filename to move to\n $this->getFile()->move(\n $this->getUploadRootDir(),\n $this->getFile()->getClientOriginalName()\n );\n\n // set the path property to the filename where you've saved the file\n $this->path = '/'.$this->getUploadDir().'/'.$this->getFile()->getClientOriginalName();\n //get the file name\n// $file = $this->getFile()->getClientOriginalName();\n// $info = pathinfo($file);\n// $file_name = basename($file,'.'.$info['extension']);\n// $this->name = $file_name ;\n// $this->setName($file_name);\n// // clean up the file property as you won't need it anymore\n// $this->file = null;\n }",
"private function uploadFile()\n {\n $uid = $this->param[2];\n $src = $_FILES['Filedata']['tmp_name'];\n $dst = TEMP_DIR . '/' . $uid . $_FILES['Filedata']['name'];\n \n if(@move_uploaded_file($src, $dst))\n {\n $data = \"{$_FILES['Filedata']['name']}:$dst:{$_FILES['Filedata']['size']}\";\n echo $data;\n }\n exit;\n }",
"public function upload_file_file()\n\t{\n\t\tif (!$this->is_allowed('dokumentasi_tol_add', false)) {\n\t\t\techo json_encode([\n\t\t\t\t'success' => false,\n\t\t\t\t'message' => cclang('sorry_you_do_not_have_permission_to_access')\n\t\t\t\t]);\n\t\t\texit;\n\t\t}\n\n\t\t$uuid = $this->input->post('qquuid');\n\n\t\techo $this->upload_file([\n\t\t\t'uuid' \t\t \t=> $uuid,\n\t\t\t'table_name' \t=> 'dokumentasi_tol',\n\t\t]);\n\t}",
"public function upload()\n {\n if (null === $this->getFile()) {\n return;\n }\n// use the original file name here but you should\n// sanitize it at least to avoid any security issues\n// move takes the target directory and then the\n// target filename to move to\n $this->getFile()->move(\n $this->getUploadRootDir(),\n $this->getFile()->getClientOriginalName()\n );\n// set the path property to the filename where you've saved the file\n $this->logo = $this->getFile()->getClientOriginalName();\n// clean up the file property as you won't need it anymore\n $this->file = null;\n\n\n }",
"public function upload()\n {\n if (null === $this->image) {\n return;\n }\n\n // we use the original file name here but you should\n // sanitize it at least to avoid any security issues\n\n // move takes the target directory and then the target filename to move to\n $this->file->move($this->getUploadRootDir(), $this->image->getClientOriginalName());\n\n // set the path property to the filename where you'ved saved the file\n $this->path = $this->image->getClientOriginalName();\n\n // clean up the file property as you won't need it anymore\n $this->file = null;\n }",
"public function upload()\n {\n $path = $this->file_path;\n if (!file_exists($path)) {\n mkdir($path, 0777, true);\n }\n\n // Upload file. \n $file_name = strtolower(basename($_FILES['uploaded_file']['name']));\n $file_name = str_replace(' ', '-', $file_name); // Replace spaces with dashes.\n $path = $path . $file_name;\n\n $acceptable = array(\n 'image/jpeg',\n 'image/jpg',\n 'image/gif',\n 'image/png'\n );\n\n if(in_array($_FILES['uploaded_file']['type'], $acceptable)) {\n\n if(move_uploaded_file($_FILES['uploaded_file']['tmp_name'], $path)) {\n\n $file_msg = 'The file '. $path . ' has been uploaded';\n \n // Not ideal but good for now\n \n // Refresh parent on upload.\n echo \"<script>window.parent.location.reload(true);</script>\";\n\n } else {\n\n $file_msg = 'There was a problem with the upload.';\n }\n }\n else {\n\n $file_msg = 'Bad file uploaded.';\n }\n return $file_msg;\n }",
"public function upload()\n {\n if (null === $this->getImg()) {\n return;\n }\n\n // we use the original file name here but you should\n // sanitize it at least to avoid any security issues\n\n // move takes the target directory and target filename as params\n $this->getImg()->move(\n self::SERVER_PATH_TO_PRESS_IMAGE_FOLDER,\n $this->getImg()->getClientOriginalName()\n );\n\n // set the path property to the filename where you've saved the file\n $this->imageUrl = $this->getImg()->getClientOriginalName();\n\n // clean up the file property as you won't need it anymore\n $this->setImg(null);\n }",
"public function upload($input);",
"public function uploadFile(RemoteFileRequest $request)\n {\n $file = $request->file('file');\n\n $name = $file->getClientOriginalName();\n $path = 'uploads/' . date('Y') . '/' . date('m');\n\n // Upload file to server\n $s3 = $this->createS3Service->make($request->bucket);\n\n // putFile automatically controls the streaming of this file to the storage\n $s3->putFileAs($path, $file, $name, $this->createS3Service->getFileVisibility($request->is_public));\n\n // Add a new entry to the database\n RemoteFile::create([\n 'name' => $name,\n 'path' => $path,\n 'bucket' => $request->bucket,\n 'created_by' => admin()->id,\n 'is_public' => $request->is_public,\n ]);\n\n return back()->with('success', 'File Uploaded successfully');\n }",
"public function uploadFile($object, $file, $path){\n $fileName = md5(uniqid()).'.'.$file->guessExtension();\n // Move the file to the directory where brochures are stored\n $picDir = $_SERVER['DOCUMENT_ROOT'].'/uploads/'.$path;\n $file->move($picDir, $fileName);\n // Update the 'screenshot' property to store the file name instead of the file\n return $object->setPic($fileName);\n}",
"public function upload()\n {\n if (null === $this->getFile()) {\n return;\n }\n\n // use the original file name here but you should\n // sanitize it at least to avoid any security issues\n\n $path = ($this->isPublic()) ? 'public' : 'sections' . '/' . strtolower($this->getSection()->getCode());\n\n if (!is_dir($this->getUploadRootDir(). '/' .$path)){\n if (!mkdir($this->getUploadRootDir(). '/' .$path)){\n throw new \\Exception('Create dir exception');\n }\n }\n\n $filename = sha1(uniqid(mt_rand(), true)).'.'.$this->getFile()->guessExtension();\n\n // move takes the target directory and then the\n // target filename to move to\n $this->getFile()->move(\n $this->getUploadRootDir(). '/' .$path,\n $filename\n );\n\n // set the path property to the filename where you've saved the file\n $this->path = $path . '/' . $filename;\n\n // clean up the file property as you won't need it anymore\n $this->file = null;\n }",
"public function uploadAction()\n {\n $logedUser = $this->getServiceLocator()\n ->get('user')\n ->getUserSession();\n $permission = $this->getServiceLocator()\n ->get('permissions')\n ->havePermission($logedUser[\"idUser\"], $logedUser[\"idWebsite\"], $this->moduleId);\n if ($this->getServiceLocator()\n ->get('user')\n ->checkPermission($permission, \"edit\")) {\n $request = $this->getRequest();\n if ($request->isPost()) {\n // Get Message Service\n $message = $this->getServiceLocator()->get('systemMessages');\n \n $files = $request->getFiles()->toArray();\n $temp = explode(\".\", $files[\"file\"][\"name\"]);\n $newName = round(microtime(true));\n $newfilename = $newName . '.' . end($temp);\n $image = new Image();\n $image->exchangeArray(array(\n \"website_id\" => $logedUser[\"idWebsite\"],\n \"name\" => $newName,\n \"extension\" => end($temp)\n ));\n if ($image->validation()) {\n if (move_uploaded_file($_FILES[\"file\"][\"tmp_name\"], \"public/files_database/\" . $logedUser[\"idWebsite\"] . \"/\" . $newfilename)) {\n $result = $this->getImageTable()->saveImage($image);\n $message->setCode($result);\n // Log\n $this->getServiceLocator()\n ->get('systemLog')\n ->addLog(0, $message->getMessage(), $message->getLogPriority());\n die('uploadSucess');\n } else {\n die('uploadError');\n }\n } else {\n die('Invalid extension');\n }\n }\n die(\"forbiden\");\n } else {\n die(\"forbiden - without permission\");\n }\n }",
"public function upload()\n\t{\n\t\t$field \t\t = $this->getUploadField();\n\t\t$newName \t = $this->getUploadNewName();\n\t\t//$destination = 'assets/images/location';\t\n\t\t$destination = $this->getUploadDestination();\n\n\t\tif (\\Input::hasFile($field))\n\t\t{\n\t\t \\Input::file($field)->move($destination, $newName);\n\t\t}\n\t\t\n\t\t$this->entity->fill([$field => $newName]);\n\t\t$this->entity->save();\n\n\t\treturn true;\n\t}",
"public function upload($sTempFileName,$sPath)\n { \n copy($sTempFileName,$sPath);\n }",
"abstract function upload($locpath, $rempath, $mode = 'auto', $permissions = NULL);",
"public static function upload_file($file,$path){\n\t\t\t $filename = $file['name'];\n $source = $file['tmp_name'];\n\t\t\t $ext = pathinfo($filename,PATHINFO_EXTENSION);\n\t\t\t $size = $file['size'] / 1000000;\n\t\t\t self::$filesize = number_format((float)$size, 2, '.', '');\n\t\t\t self::$filesize .= 'MB';\n\n\t\t\t if (self::$name)\n\t\t\t {\n\t\t\t\t $target = $path.self::$name.\".\".$ext;\n\t\t\t\t self::$filename = self::$name.\".\".$ext; \n\t\t\t } \n\t\t\t else \n\t\t\t {\n\t\t\t \t$target = $path.$filename; \n\t\t\t }\n move_uploaded_file($source, $target);\n\t\t}",
"public function upload_file_file()\n\t{\n\t\tif (!$this->is_allowed('dokumentasi_bendungan_add', false)) {\n\t\t\techo json_encode([\n\t\t\t\t'success' => false,\n\t\t\t\t'message' => cclang('sorry_you_do_not_have_permission_to_access')\n\t\t\t\t]);\n\t\t\texit;\n\t\t}\n\n\t\t$uuid = $this->input->post('qquuid');\n\n\t\techo $this->upload_file([\n\t\t\t'uuid' \t\t \t=> $uuid,\n\t\t\t'table_name' \t=> 'dokumentasi_bendungan',\n\t\t]);\n\t}",
"function upload($file, $end_path) {\n $auth = '';\n $date= getdate();\n $size = filesize($file);\n $path = $end_path.'/'.$date['year'].'-'.$date['mon'].'-'.$date['mday'].'/'.$file;\n $fp = fopen($file, 'r');\n $cheaders = array('Authorization: Bearer ' .$auth.'jMxNU5Ezc-gAAAAAAAAAAQLxvI0If8AV4wHpthpOmIRTKJr0otk_cUH7YiGw-_SU',\n 'Content-Type: application/octet-stream',\n 'Dropbox-API-Arg: {\"path\":\"/'.$path.'\", \"mode\":\"add\"}');\n\n $ch = curl_init('https://content.dropboxapi.com/2/files/upload');\n curl_setopt($ch, CURLOPT_HTTPHEADER, $cheaders);\n curl_setopt($ch, CURLOPT_PUT, true);\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');\n curl_setopt($ch, CURLOPT_INFILE, $fp);\n curl_setopt($ch, CURLOPT_INFILESIZE, $size);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n $response = curl_exec($ch);\n\n curl_close($ch);\n fclose($fp);\n }",
"public function uploadFile($file, $path)\n\t{\n\t\tStorage::makeDirectory($path);\n\t\tif($filename = $file->store($path)) {\n\t\t\treturn $filename;\n\t\t}\n\t\tabort(422, 'upload failed');\n\t}",
"public function uploadAction() {\n\t\t$imgId = $this->getInput('imgId');\n\t\t$this->assign('imgId', $imgId);\n\t\t$this->getView()->display('common/upload.phtml');\n\t\texit;\n\t}",
"public function uploadAction() {\n\t\t$imgId = $this->getInput('imgId');\n\t\t$this->assign('imgId', $imgId);\n\t\t$this->getView()->display('common/upload.phtml');\n\t\texit;\n\t}",
"public function uploadAction() {\n\t\t$imgId = $this->getInput('imgId');\n\t\t$this->assign('imgId', $imgId);\n\t\t$this->getView()->display('common/upload.phtml');\n\t\texit;\n\t}",
"public function uploadAction() {\n\t\t$imgId = $this->getInput('imgId');\n\t\t$this->assign('imgId', $imgId);\n\t\t$this->getView()->display('common/upload.phtml');\n\t\texit;\n\t}",
"public function uploadAction() {\n\t\t$imgId = $this->getInput('imgId');\n\t\t$this->assign('imgId', $imgId);\n\t\t$this->getView()->display('common/upload.phtml');\n\t\texit;\n\t}",
"public function uploadAction() {\n\t\t$imgId = $this->getInput('imgId');\n\t\t$this->assign('imgId', $imgId);\n\t\t$this->getView()->display('common/upload.phtml');\n\t\texit;\n\t}",
"function fileCommit(){\n\t\t// Target folder, make sure it is 777\n\t\t$target = \"uploads/\";\n\t\t\n\t\t// Appends the file name\n\t\t$target = $target . basename( $_FILES['file']['name']);\n\t\t\n\t\t// Moves the file to target\n\t\tmove_uploaded_file($_FILES['file']['tmp_name'], $target);\n\t\tif($_POST['sqlType'] == \"create\") {\n\t\t\t$result = mysql_query(createObject(getLangVar(\"userId\"), $_POST['objectText'], $_POST['parentId'], $_POST['objectTitle']));\n\t\t\t$result = mysql_query(createFile(fullURL($_FILES[\"file\"][\"name\"], \"uploads\"), $_FILES[\"file\"][\"size\"], $_FILES[\"file\"][\"type\"], mysql_insert_id()));\n\t\t\t$forwardId = mysql_insert_id();\n\t\t} else if($_POST['sqlType'] == \"edit\") {\n\t\t\t$result = mysql_query(editObject($_POST['objectText'], $_POST['parentId'], $_POST['objectTitle'], $_POST['objectId']));\n\t\t\t$result = mysql_query(editFile());\n\t\t\t$forwardId = $_POST['fileId'];\n\t\t}\n\t\theader('Location:' . fullURL(getLangVar(\"fileURL\") . $forwardId));\n\t}",
"public function test_uploadedfile_route() {\n global $CFG;\n list($user, , $talkpoint) = $this->_setup_single_user_in_single_talkpoint();\n\n // current time\n $now = time();\n\n // create a talkpoint\n $this->loadDataSet($this->createArrayDataSet(array(\n 'talkpoint_talkpoint' => array(\n array('id', 'instanceid', 'userid', 'title', 'uploadedfile', 'nimbbguid', 'mediatype', 'closed', 'timecreated', 'timemodified'),\n array(1, $talkpoint->id, $user->id, 'Talkpoint 001', 'mod_talkpoint_web_test.txt', null, 'file', 0, $now, $now),\n ),\n )));\n\n // spit a dummy existing file\n check_dir_exists($CFG->dataroot . '/into/mod_talkpoint/' . $talkpoint->id . '/1');\n file_put_contents($CFG->dataroot . '/into/mod_talkpoint/' . $talkpoint->id . '/1/mod_talkpoint_web_test.txt', 'dummy contents');\n\n // request the file\n $client = new Client($this->_app);\n $client->request('GET', '/uploadedfile/1');\n $this->assertTrue($client->getResponse()->isOk());\n }",
"function ft_hook_upload($dir, $file) {}",
"public function uploadFileToCloud() {\n\n\t\ttry {\n\n\t\t\tif (!Request::hasFile('file')) throw new \\Exception(\"File is not present.\");\n\n\t\t\t$attachmentType = Request::input('attachment_type');\n\n\t\t\tif (empty($attachmentType)) throw new \\Exception(\"Attachment type is missing.\");\n\n\t\t\t$file = Request::file('file');\n\n\t\t\tif (!$file->isValid()) throw new \\Exception(\"Uploaded file is invalid.\");\n\n\t\t\t$fileExtension = strtolower($file->getClientOriginalExtension());\n\t\t\t$originalName = $file->getClientOriginalName();\n\n\t\t\tif ($attachmentType == 'image' || $attachmentType == 'logo') {\n\t\t\t\tif (!in_array($fileExtension, array('jpg', 'png', 'tiff', 'bmp', 'gif', 'jpeg', 'tif'))) throw new \\Exception(\"File type is invalid.\");\n\t\t\t} else if ($attachmentType == 'audio') {\n\t\t\t\tif (!in_array($fileExtension, array('mp3', 'wav'))) throw new \\Exception(\"File type is invalid.\");\n\t\t\t}\n\n\t\t\t$additionalImageInfoString = Request::input('additionalImageInfo');\n\n\t\t\t$attachmentObj = ConnectContentAttachment::createAttachmentFromFile(\\Auth::User()->station->id, $file, $attachmentType, $originalName, $fileExtension, $additionalImageInfoString);\n\n\t\t\treturn response()->json(array('code' => 0, 'msg' => 'Success', 'data' => array('attachment_id' => $attachmentObj->id, 'filename' => $originalName, 'url' => $attachmentObj->saved_path)));\n\n\t\t} catch (\\Exception $ex) {\n\t\t\t\\Log::error($ex);\n\t\t\treturn response()->json(array('code' => -1, 'msg' => $ex->getMessage()));\n\t\t}\n\n\t}",
"public function uploadAction() {\r\n\t\t$imgId = $this->getInput('imgId');\r\n\t\t$this->assign('imgId', $imgId);\r\n\t\t$this->getView()->display('common/upload.phtml');\r\n\t\texit;\r\n\t}",
"public function uploadAction() {\r\n\t\t$imgId = $this->getInput('imgId');\r\n\t\t$this->assign('imgId', $imgId);\r\n\t\t$this->getView()->display('common/upload.phtml');\r\n\t\texit;\r\n\t}",
"abstract public function uploadFile($filename, $bucket = false);",
"function uploadObject();",
"public function upload()\n {\n set_time_limit(0);\n //Clear error messages\n Registry::getMessages();\n //Config\n $config = Registry::getConfig();\n //Upload Handler\n new UploadHandler(\n array(\n 'upload_dir' => $config->get(\"path\").\"/files/videos/\",\n 'upload_url' => Url::site(\"files/videos\").\"/\",\n \"maxNumberOfFiles\" => 1,\n \"accept_file_types\" => \"/\\.(mp4|mpg|flv|mpeg|avi)$/i\",\n )\n );\n }",
"public function upload(){\n if( NULL === $this->getFile()){\n return;\n }\n $filename= $this->getFile()->getClientOriginalName();\n\n // Move to the target directory\n \n $this->getFile()->move(\n $this->getAbsolutePath(), \n $filename);\n\n //Set the logo\n $this->setFilename($filename);\n\n $this->setFile();\n\n }",
"public function upload_file(){\n //return from method if file name is sample\n if($this->file_name == 'sample.jpg'){\n return;\n }\n\n $allowed_types = ['image/jpeg', 'image/gif', 'image/png'];\n //check file is an image\n if(!in_array($this->file_type, $allowed_types)){\n throw new Exception('File must be an image');\n exit;\n }\n\n //move from temp dir in to uploads folder\n move_uploaded_file($this->tmp_file_name, $this->dir_location . $this->file_name );\n }",
"function uploadFiles () {\n\n}",
"public function uploadAction() {\n $imgId = $this->getInput('imgId');\n $this->assign('imgId', $imgId);\n $this->getView()\n ->display('common/upload.phtml');\n }",
"public function upload()\n{\n // The file property can be empty if the field is not required\n if (null === $this->file) {\n return;\n }\n\n // Use the original file name here but you should\n // sanitize it at least to avoid any security issues\n\n // move takes the target directory and then the\n // target filename to move to\n $this->file->move(\n $this->getUploadRootDir(),\n $this->path\n );\n\n // Set the path property to the filename where you've saved the file\n //$this->path = $this->file->getClientOriginalName();\n\n // Clean up the file property as you won't need it anymore\n $this->file = null;\n}",
"public function upload(){\n if (null === $this->getProductsFileImage()) {\n return;\n }\n\n // use the original file name here but you should\n // sanitize it at least to avoid any security issues\n\n // move takes the target directory and then the\n // target filename to move to\n $this->getProductsFileImage()->move(\n $this->getUploadRootDir(),\n $this->getProductsFileImage()->getClientOriginalName()\n );\n\n // set the path property to the filename where you've saved the file\n $this->path = $this->getProductsFileImage()->getClientOriginalName();\n $this->productsImage = $this->getProductsFileImage()->getClientOriginalName();\n\n // clean up the file property as you won't need it anymore\n $this->productsFileImage = null;\n }",
"public function put($localFile, $remoteFile, $url);",
"public function UploadFile()\n {\n # ==============================================================================\n \n if (!empty($_FILES)) {\n $tempFile = $_FILES['Filedata']['tmp_name'];\n $targetPath = $_SERVER['DOCUMENT_ROOT'] . $_REQUEST['folder'] . '/';\n \n $original_name = $_FILES['Filedata']['name'];\n $name_parts = explode('.', $original_name);\n $parts_count = count($name_parts)-1;\n $extension = $name_parts[$parts_count];\n \n $new_name = \"{$this->Sessions_Id}.{$extension}\";\n $targetFile = str_replace('//','/',$targetPath) . $new_name;\n \n $result = move_uploaded_file($tempFile, $targetFile);\n if (!$result) {\n echo \"FAILED TO MOVE FILE\";\n }\n echo str_replace($_SERVER['DOCUMENT_ROOT'], '', $targetFile);\n $this->UpdateSessionChecklist();\n }\n }",
"protected function uploadFile()\n {\n return $this->getTelegram()->uploadFile(\n $this->method->apiEndpoint(),\n $this->method->toArray(),\n $this->method->fileUploadField()\n );\n }",
"public function uploadtoserver() {\r\n $targetDir = $_SERVER['DOCUMENT_ROOT'] . '/uploads/items/';\r\n\r\n //$cleanupTargetDir = false; // Remove old files\r\n //$maxFileAge = 60 * 60; // Temp file age in seconds\r\n // 5 minutes execution time\r\n @set_time_limit(5 * 60);\r\n\r\n // Uncomment this one to fake upload time\r\n // usleep(5000);\r\n // Get parameters\r\n $chunk = isset($_REQUEST[\"chunk\"]) ? $_REQUEST[\"chunk\"] : 0;\r\n $chunks = isset($_REQUEST[\"chunks\"]) ? $_REQUEST[\"chunks\"] : 0;\r\n $fileName = isset($_REQUEST[\"name\"]) ? $_REQUEST[\"name\"] : '';\r\n // Clean the fileName for security reasons\r\n $fileName = preg_replace('/[^\\w\\._]+/', '', $fileName);\r\n\r\n // Make sure the fileName is unique but only if chunking is disabled\r\n if ($chunks < 2 && file_exists($targetDir . DIRECTORY_SEPARATOR . $fileName)) {\r\n unlink($targetDir . DIRECTORY_SEPARATOR . $fileName);\r\n /*$ext = strrpos($fileName, '.');\r\n $fileName_a = substr($fileName, 0, $ext);\r\n $fileName_b = substr($fileName, $ext);\r\n\r\n $count = 1;\r\n while (file_exists($targetDir . DIRECTORY_SEPARATOR . $fileName_a . '_' . $count . $fileName_b))\r\n $count++;\r\n\r\n $fileName = $fileName_a . '_' . $count . $fileName_b;*/\r\n }\r\n\r\n // Create target dir\r\n if (!file_exists($targetDir))\r\n @mkdir($targetDir);\r\n\r\n if (isset($_SERVER[\"HTTP_CONTENT_TYPE\"]))\r\n $contentType = $_SERVER[\"HTTP_CONTENT_TYPE\"];\r\n\r\n if (isset($_SERVER[\"CONTENT_TYPE\"]))\r\n $contentType = $_SERVER[\"CONTENT_TYPE\"];\r\n\r\n // Handle non multipart uploads older WebKit versions didn't support multipart in HTML5\r\n if (strpos($contentType, \"multipart\") !== false) {\r\n if (isset($_FILES['file']['tmp_name']) && is_uploaded_file($_FILES['file']['tmp_name'])) {\r\n // Open temp file\r\n $out = fopen($targetDir . DIRECTORY_SEPARATOR . $fileName, $chunk == 0 ? \"wb\" : \"ab\");\r\n if ($out) {\r\n // Read binary input stream and append it to temp file\r\n $in = fopen($_FILES['file']['tmp_name'], \"rb\");\r\n\r\n if ($in) {\r\n while ($buff = fread($in, 4096))\r\n fwrite($out, $buff);\r\n }\r\n else\r\n die('{\"jsonrpc\" : \"2.0\", \"error\" : {\"code\": 101, \"message\": \"Failed to open input stream.\"}, \"id\" : \"id\"}');\r\n fclose($in);\r\n fclose($out);\r\n @unlink($_FILES['file']['tmp_name']);\r\n }\r\n else\r\n die('{\"jsonrpc\" : \"2.0\", \"error\" : {\"code\": 102, \"message\": \"Failed to open output stream.\"}, \"id\" : \"id\"}');\r\n }\r\n else\r\n die('{\"jsonrpc\" : \"2.0\", \"error\" : {\"code\": 103, \"message\": \"Failed to move uploaded file.\"}, \"id\" : \"id\"}');\r\n }\r\n else {\r\n // Open temp file\r\n $out = fopen($targetDir . DIRECTORY_SEPARATOR . $fileName, $chunk == 0 ? \"wb\" : \"ab\");\r\n if ($out) {\r\n // Read binary input stream and append it to temp file\r\n $in = fopen(\"php://input\", \"rb\");\r\n\r\n if ($in) {\r\n while ($buff = fread($in, 4096))\r\n fwrite($out, $buff);\r\n }\r\n else\r\n die('{\"jsonrpc\" : \"2.0\", \"error\" : {\"code\": 101, \"message\": \"Failed to open input stream.\"}, \"id\" : \"id\"}');\r\n\r\n fclose($in);\r\n fclose($out);\r\n }\r\n else\r\n die('{\"jsonrpc\" : \"2.0\", \"error\" : {\"code\": 102, \"message\": \"Failed to open output stream.\"}, \"id\" : \"id\"}');\r\n }\r\n // Return JSON-RPC response\r\n die('{\"jsonrpc\" : \"2.0\", \"result\" : null, \"id\" : \"id\"}');\r\n }",
"function upload(string $srcPath, string $destPath)\n {\n // Upload a file to the bucket.\n try {\n $this->bucket->upload(\n fopen($srcPath, 'r'),\n ['name' => $destPath]\n );\n } catch (Exception $e) {\n die('An error occurred uploading the file with exception: ' . $e->getMessage());\n }\n }",
"public function uploadFileAdmin(){\r\n $file = Input::file('file');\r\n $projectId = Input::get('PROJECT');\r\n $adminId = Input::get('CONSULTANT');\r\n $project = Project::find($projectId);\r\n if($project!=null){\r\n if($file){\r\n $fileName = $file->getClientOriginalName();\r\n $file->move(public_path().'/files/projects/'.$project->lead->fileno.'/'.$project->id.'/uploaded', $fileName);\r\n //create the row in upload file\r\n $uploadFile = new UploadedFiles();\r\n $uploadFile->project_id = $projectId;\r\n $uploadFile->url = \"files/projects/\".$project->lead->fileno.\"/\".$project->id.\"/uploaded/$fileName\";\r\n $uploadFile->fileName = $fileName;\r\n $uploadFile->admin_id = $adminId;\r\n $uploadFile->ip = $_SERVER[\"REMOTE_ADDR\"];\r\n $uploadFile->save();\r\n ToolsFunctions::notifyGeorgeOfFileUpload($project);\r\n }\r\n }\r\n }",
"public function Upload($path) { \n $filename = uniqid();\n\n if (!is_writable($path))\n throw new Exception(\"Sem permissões de escrita: \" . fileperms($path), 0);\n\n if ($_FILES[\"file\"][\"error\"] > 0)\n throw new Exception(\"Erro: \" . $_FILES[\"file\"][\"error\"] . \"<br/>\", 0);\n \n if (move_uploaded_file($_FILES[\"file\"][\"tmp_name\"], $path . \"{$filename}\"))\n return $path . $filename;\n else\n throw new Exception(\"Erro no upload!\", 0);\n }",
"public function testFileUpload() {\n $user1 = $this->drupalCreateUser([\n 'access content',\n \"create $this->referencingType content\",\n ]);\n $this->drupalLogin($user1);\n\n $test_file = current($this->getTestFiles('text'));\n $edit['files[file_field_0]'] = \\Drupal::service('file_system')->realpath($test_file->uri);\n $this->drupalGet('node/add/' . $this->referencingType);\n $this->submitForm($edit, 'Upload');\n $this->assertSession()->statusCodeEquals(200);\n $edit = [\n 'title[0][value]' => $this->randomMachineName(),\n 'test_field[0][target_id]' => $this->nodeId,\n ];\n $this->submitForm($edit, 'Save');\n $this->assertSession()->statusCodeEquals(200);\n }",
"public function uploadFile(UploadFileRequest $request): UploadFileResponse\n {\n }",
"public function postUpload(Request $request)\n {\n $file = $request->file('picture');\n Storage::disk('public')->put('uploadedPic.png', File::get($file));\n\n return redirect('/');\n }",
"function upload($file,$path){\n try{\n if($file->isValid() && $path){\n $clientName = $file->getClientOriginalName();\n\n $tmpName = $file->getFileName();\n //缓存路径\n $realPath = $file->getRealPath();\n //扩展名\n $entension = $file->getClientOriginalExtension();\n //文件类型\n $mimeType = $file->getMimeType();\n// $url = $file->move($path);\n $newName = md5(date(\"Y-m-d H:i:s\").$clientName).\".\".$entension;\n $url = $file -> move($path,$newName);\n }\n }catch (Exception $e){\n// Log::error(e);\n }\n\n\n return $url;\n}",
"public function step_2_manage_upload()\n {\n }",
"public function upload(UploadedFile $file){\n return $file->store('public/uploads', 'local');\n }",
"public function fileUpload($file,$url,$orderid)\n\t{\n\t\t$ext = pathinfo($file['name'], PATHINFO_EXTENSION);\n\t\tif ($file[\"error\"] > 0)\n \t\t{\n \t\t\treturn 0;\n \t\t}\n \t\telse\n \t\t{\n if(move_uploaded_file($file[\"tmp_name\"],$url . $orderid . '.' . $ext ))\n {\n return 1;\n }\n else\n {\n return 0;\n }\n\t\t}\n \t}"
] | [
"0.75979376",
"0.75442225",
"0.7241382",
"0.72078633",
"0.7200038",
"0.7185813",
"0.7140564",
"0.7125302",
"0.7096767",
"0.7060402",
"0.7050248",
"0.6927876",
"0.6927279",
"0.6925873",
"0.6908953",
"0.6891782",
"0.68663335",
"0.6850827",
"0.68356603",
"0.6822892",
"0.67903256",
"0.67792916",
"0.67769474",
"0.6756108",
"0.6756108",
"0.6756108",
"0.6756108",
"0.67528695",
"0.67476124",
"0.6734939",
"0.6728358",
"0.668794",
"0.6635686",
"0.6627327",
"0.66169107",
"0.660578",
"0.6576141",
"0.6565574",
"0.65316737",
"0.6523967",
"0.64950323",
"0.6476116",
"0.6472518",
"0.6449093",
"0.64385146",
"0.6422302",
"0.6421736",
"0.64208096",
"0.6415913",
"0.64064854",
"0.64006495",
"0.639632",
"0.6385499",
"0.63761616",
"0.6374639",
"0.6369207",
"0.63439775",
"0.6332241",
"0.63270354",
"0.63080907",
"0.62984407",
"0.6296051",
"0.62784934",
"0.62687457",
"0.6261163",
"0.62535614",
"0.62535614",
"0.62535614",
"0.62535614",
"0.62535614",
"0.62535614",
"0.625282",
"0.6246988",
"0.6246654",
"0.6242995",
"0.62400913",
"0.62400913",
"0.62376684",
"0.6229688",
"0.6221982",
"0.6220828",
"0.6211475",
"0.621059",
"0.62028104",
"0.6190023",
"0.61859494",
"0.6181325",
"0.6179344",
"0.6165056",
"0.61621356",
"0.6127707",
"0.6115247",
"0.6108821",
"0.61073947",
"0.61005837",
"0.60912097",
"0.60846156",
"0.6081831",
"0.6076222",
"0.606522"
] | 0.623412 | 78 |
finds a unique name for the file for the current directory | function findUniqueFilename($existing_files = null) {
// append a digit to the end of the name
$filenumber = 0;
$filesuffix = '';
$fileparts = explode('.', $this->filename);
$fileext = '.' . array_pop($fileparts);
$filebase = implode('.', $fileparts);
if( !eregi("jpeg|jpg|png|gif",$fileext) ){
$this->savefilename = md5($this->filename.$this->microtime_float()).$fileext.'_';
}else{
$this->savefilename = md5($this->filename.$this->microtime_float()).$fileext;
}
if (is_array($existing_files)) {
do {
$newfile = $filebase . $filesuffix . $fileext;
$filenumber++;
$filesuffix = '(' . $filenumber . ')';
} while (in_array($newfile, $existing_files));
}
return $newfile;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function generateUniqueFileName()\n {\n // uniqid(), which is based on timestamps\n return md5(uniqid());\n }",
"private function generateUniqueFileName()\n {\n // uniqid(), which is based on timestamps\n return md5(uniqid());\n }",
"private function generateUniqueFileName()\n {\n // uniqid(), which is based on timestamps\n return md5(uniqid());\n }",
"private function generateUniqueFileName()\n {\n // uniqid(), which is based on timestamps\n return md5(uniqid());\n }",
"private function generateUniqueFileName()\n {\n // uniqid(), which is based on timestamps\n return md5(uniqid());\n }",
"private function generateUniqueFileName()\n {\n // uniqid(), which is based on timestamps\n return md5(uniqid());\n }",
"private function generateUniqueFileName()\n {\n // uniqid(), which is based on timestamps\n return md5(uniqid());\n }",
"private function generateUniqueFileName() {\r\n \r\n return md5(uniqid());\r\n }",
"private function generateUniqueFileName()\n {\n // md5() reduces the similarity of the file names generated by\n // uniqid(), which is based on timestamps\n return md5(uniqid());\n }",
"private function generateUniqueFileName() :string\n {\n // md5() reduces the similarity of the file names generated by\n // uniqid(), which is based on timestamps\n return md5(uniqid());\n }",
"function generate_unique_file_name($dir, $filename)\n{\n if (!$filename)\n return;\n \n $extension = pathinfo($filename, PATHINFO_EXTENSION);\n\n $new_filename = '';\n for (;;)\n {\n $new_filename = get_random_string(8, 8) . '.' . $extension;\n if (!file_exists($dir . '/' . $new_filename))\n break;\n }\n\n return $new_filename;\n}",
"function getUnique($fileName,$path)\n{\n $baseName = preg_replace('/^(.*)\\.[^.]+$/', '\\\\1', $fileName);\n $extension = preg_replace('/^.*(\\.[^.]+$)/', '\\\\1', $fileName);\n $i = 1;\n \n while (file_exists($path.$fileName)) {\n $fileName = $baseName . '_' . $i . $extension;\n $i++;\n }\n \n return $fileName;\n}",
"private function returnUniqueFileName($name) {\n\t\t\t\twhile(file_exists($this->dir.'/'.$name) == true) {\n\t\t\t\t\t$name = rand(1000).$name;\n\t\t\t\t}\n\t\t\t\treturn $name;\n\t\t\t}",
"private function generateUniqueFileName()\n {\n return md5(base64_encode(pack('N6', mt_rand(), mt_rand(), mt_rand(), mt_rand(), mt_rand(), uniqid())));\n }",
"public static function getRandomFileName()\r\n\t{\r\n\t\treturn uniqid(rand(), true);\r\n\t}",
"private function genereteFilename(){\n return strtolower(md5(uniqid($this->document->baseName)) . '.' . $this->document->extension);\n }",
"public function new_local_file_name()\n\t{\n\t\t$name = sys_get_temp_dir().'/'.str_random(32);\n\t\treturn $name;\n\t}",
"protected function setFileName($unique)\n {\n return substr(hash('md5', \"_bingo_{$unique}\"), 0, 16);\n }",
"function wp_unique_filename($dir, $filename, $unique_filename_callback = \\null)\n {\n }",
"private function getFilename()\n {\n if ($this->uniqueFile) {\n return $this->filename;\n }\n\n return $this->filename . self::SEPARATOR . $this->getCurrentSitemap();\n }",
"function get_new_file_name(){\n $user_id = $_COOKIE[\"UserId\"];\n $Upload_Path = \"../../uploads/\";\n $file_name = rand(1, 1000000);\n if (!file_exists($file_name)){\n return $file_name;\n }else {\n get_new_file_name();\n }\n}",
"function _getFileName()\r\n\t{\r\n\t\t$f = $this->pathHomeDir . '/' . $this->pathLocale . '/' . $this->pathFile . \".\" . $this->pathEx;\r\n\t\treturn $f;\r\n\t}",
"public function getUniqFilename()\n\t{\n\t\tif (empty($this->_uniqFilename)) {\n\t\t\t$this->_uniqFilename = sprintf('%s_%s', uniqid(), $this->_uploadedFile->getClientFilename());\n\t\t}\n\n\t\treturn $this->_uniqFilename;\n\t}",
"public function geraNomeArquivo()\n {\n return sha1(uniqid(mt_rand(), true));\n }",
"protected function getFileName($id)\n {\n $directory = $this->getDirectory($id);\n $hash = sha1($id, false);\n $file = $directory . DIRECTORY_SEPARATOR . $hash . '.cache';\n return $file;\n }",
"protected function getFileName($id)\n {\n $directory = $this->getDirectory($id);\n $hash = sha1($id, false);\n $file = $directory . DIRECTORY_SEPARATOR . $hash . '.cache';\n return $file;\n }",
"private function getFilename(string $name): string\n {\n return \\sprintf('%s/../../../var/%s.hash', __DIR__, $name);\n }",
"public function getFilename() {\n\t\t\n\t\t$filename = $this->filename;\n\t\t\n\t\tif(file_exists($this->path . $filename) && $this->rename_if_exists === true) {\n\t\t\n\t\t\t//Explode the filename, pop off the extension and put it back together\n\t\t\t$parts = explode('.', $filename);\n\n\t\t\t$extension = array_pop($parts);\n\n\t\t\t$base_filename = implode('.', $parts);\n\t\t\t\n\t\t\t$count = 1;\n\t\t\t\n\t\t\tdo {\n\t\t\t\t$count++;\n\t\t\t} while(file_exists($this->path . $base_filename . '_' . $count . '.' . $extension));\n\t\t\t\n\t\t\t$filename = $base_filename . '_' . $count . '.' . $extension;\n\t\t\n\t\t}\n\t\t\n\t\treturn $filename;\n\t\t\n\t}",
"public function filename(): string\n {\n return Str::random(6) . '_' . $this->type . $this->fileExtension();\n }",
"protected function filename()\n {\n return 'compras_' . time();\n }",
"protected function _getFileName() {\n\n\t\t\treturn \t$this->_cacheFolder.$this->_getHash($this->_cacheFile).$this->_cacheExtension;\n\n\t\t}",
"private function get_filename() {\n \n $md5 = md5($_SERVER[\"HTTP_HOST\"] . $_SERVER[\"REQUEST_URI\"]);\n return CACHE_DIR . \"/\" . $md5;\n }",
"public static function randomFilename() {\n $name = self::randomString();\n return substr($name, 0, 2) . '/' . substr($name, 2, 2)\n . '/' . substr($name, 4, 2) . '/' . substr($name, 6);\n }",
"public static function getFileName( $file ){\n\t\t$pathinfo \t\t\t= pathinfo( $file );\n\t\tlist( $name, $dir ) = array( $pathinfo['filename'], $pathinfo['dirname'] );\n\t\t$files \t\t\t\t= glob( $dir . '/' . $name . '*.log' );\n\t\tif( count( $files ) ){\t\t\t\n\t\t\tif( filesize( end( $files ) ) > self::MAX_SIZE ){\n\t\t\t\t$no = str_pad( count( $files ), 4, '0', STR_PAD_LEFT );\n\t\t\t\treturn $dir . '/' . $name . '_' . $no . '.log';\n\t\t\t}\n\t\t\treturn end( $files );\n\t\t}\n\t\treturn $file;\n\t}",
"function filename($file)\n{\n\tglobal $DATA_PATH;\n\t$cnt = strlen(__FILE__);\n\t$cnt -= strlen('script/main.php');\n\t$cnt += strlen($DATA_PATH);\n\treturn substr($file, $cnt);\n}",
"private function getNextFilename(){\n\n\t\t// Get the current file count\n\t\t$cacheFilesCount = iterator_count(new FilesystemIterator($this->cache_folder, FilesystemIterator::SKIP_DOTS));\n\n\t\t// Ensure no clashes\n\t\t$potentialFilename = $cacheFilesCount + 1;\n\t\twhile(file_exists($this->cache_folder . \"/\" . $potentialFilename)) {\n\t\t\t$potentialFilename++;\n\t\t}\n\n\t\t// Prepare and reserve the next filename\n\t\ttouch($this->cache_folder . \"/\" . $potentialFilename);\n\n\t\t// Return this name in good faith\n\t\treturn $potentialFilename;\n\t}",
"function unique_name($folder, $name, $extension)\n{\n $result = \"$folder/$name.$extension\";\n\n $i = 2;\n while (file_exists($result))\n {\n $result = \"$folder/$name-$i.$extension\";\n $i++;\n }\n\n return $result;\n}",
"public function encrypt_name(){\n $filename = md5(uniqid(mt_rand()));\n return $filename;\n }",
"protected function makeFilename()\n {\n return getcwd().'/bolt_'.md5(time().uniqid()).'.zip';\n }",
"public static function getTempFileName()\r\n\t{\r\n\t\treturn self::_normalizeDirectorySeparators(tempnam(self::getTempDirectory(), self::getRandomFileName()));\r\n\t}",
"protected function makeFilename()\n {\n return getcwd().'/october_installer_'.md5(time().uniqid()).'.zip';\n }",
"protected function filename()\n {\n return 'ticket_' . time();\n }",
"protected function filename()\n {\n return 'users_' . date('YmdHis');\n }",
"protected function filename()\n {\n return 'ctcommunicationsocialmediadatatable_' . time();\n }",
"protected function filename()\n {\n return 'User_' . date('YmdHis');\n }",
"protected function filename()\n {\n return 'User_' . date('YmdHis');\n }",
"protected function filename()\n {\n return 'User_' . date('YmdHis');\n }",
"protected function filename()\n {\n return 'User_' . date('YmdHis');\n }",
"protected function filename()\n {\n return 'User_' . date('YmdHis');\n }",
"function randomFile() {\n\tglobal $communityPaths;\n\n\treturn tempnam($communityPaths['tempFiles'],\"CA-Temp-\");\n}",
"public function generateFilename()\n {\n $filename = str_replace(\" \", \"_\", strtolower($this->getOriginalName()));\n\n if(!file_exists(\"http://\".$_SERVER['HTTP_HOST'].\"/uploads/docs/\".$filename))\n {\n return $filename;\n }\n else\n {\n $extension = $this->getExtension($this->getOriginalExtension());\n $filename = str_replace($extension, '', $filename) . '_';\n\n $i = 2;\n\n while(true)\n {\n if(file_exists($this->getPath().$filename.$i.$extension))\n {\n $i++;\n continue;\n }\n break;\n }\n\n return $filename.$i.$extension;\n }\n }",
"function file_name ($url) {\n $filename = md5( $url );\n return join( DIRECTORY_SEPARATOR, array( $this->BASE_CACHE, $filename ) );\n }",
"function getFilename()\n {\n return __FILE__;\n }",
"private function getUniqueFilePath($fileName, $directory) {\n return FileService::getInstance()->getUniqueFilePath(\n $fileName . '.' . $this->getExtension(),\n $directory,\n $this->getLocalPath()\n );\n }",
"private function generateUniqueFileName(UploadedFile $file): string\n {\n $originFileName = pathinfo($file->getClientOriginalName(), PATHINFO_FILENAME);\n $originFileNameSlugged = $this->slugger->slug(strtolower($originFileName));\n $randomId = uniqid();\n return \"{$originFileNameSlugged}-{$randomId}.{$file->guessExtension()}\";\n }",
"function randomFileNameGenerator($prefix){\n\t$r=substr(str_replace(\".\",\"\",uniqid($prefix,true)),0,20);\n\tif(file_exists(\"../uploads/$r\")) randomFileNameGenerator($prefix);\n\telse return $r;\n}",
"function randomFileNameGenerator($prefix){\n\t$r=substr(str_replace(\".\",\"\",uniqid($prefix,true)),0,20);\n\tif(file_exists(\"../uploads/$r\")) randomFileNameGenerator($prefix);\n\telse return $r;\n}",
"function uniqFile($id,$filename,$ext) {\n $file = md5($filename).\"\".uniqid($filename, true);\n return \"pro\".$id.\"\".md5($file).\"le.\".$ext ;\n }",
"public function GetRealFileName()\n {\n $oFileType = $this->GetFileType();\n\n return $this->id.'.'.$oFileType->sqlData['file_extension'];\n }",
"function getFileFullPath($fileName) {\n\tglobal $GrunPath;\n\treturn $GrunPath.\"/\".$fileName;\n}",
"public static function generateFileName($fileName)\n {\n return substr(md5(time()), 0, 10) . '.' . pathinfo($fileName, PATHINFO_EXTENSION);\n }",
"public function getLocalReadmeName() {\n\t\t\tstatic $fileName = null;\n\t\t\tif ( $fileName !== null ) {\n\t\t\t\treturn $fileName;\n\t\t\t}\n\n\t\t\t$fileName = 'readme.txt';\n\t\t\tif ( isset($this->localDirectory) ) {\n\t\t\t\t$files = scandir($this->localDirectory);\n\t\t\t\tif ( !empty($files) ) {\n\t\t\t\t\tforeach ($files as $possibleFileName) {\n\t\t\t\t\t\tif ( strcasecmp($possibleFileName, 'readme.txt') === 0 ) {\n\t\t\t\t\t\t\t$fileName = $possibleFileName;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $fileName;\n\t\t}",
"public static function uniqueFilename($directory)\n\t{\n\t\t$ds = DIRECTORY_SEPARATOR;\n\t\t$i = 0;\n\t\tdo{\n\t\t\t$filename = uniqid($i++);\n\t\t} while (file_exists($directory . $ds . $filename));\n\t\t\n\t\treturn $filename;\n\t}",
"function random_file_name($keyname = '')\n{\n // config generate auto uniq\n /* A uniqid, like: 4b3403665fea6 */\n\n // nama file\n $getNama = $keyname;\n\n // delete space\n $removeSpace = preg_replace('/\\s+/', '', $getNama);\n\n // pisahkan dgn extentionnya\n $explodeFile = explode('.', $removeSpace);\n\n $namaFiles = $explodeFile[0];\n $extFiles = end($explodeFile);\n\n // buat nama baru \n $file = md5(uniqid($namaFiles));\n\n // gabung kembali menjadi file baru\n $new_file = $file . '.' . $extFiles;\n return $new_file;\n}",
"function getMDNameFile($file)\r\n {\r\n static $ext = false;\r\n if (!$ext) $ext = preg_replace('|\\?.*?|is', '', pathinfo($file, PATHINFO_EXTENSION));\r\n $file = $this->rootPath . $this->config->get('imgPath') . $this->imageDir . md5(microtime() + mt_rand(1, 100)) . \".$ext\";\r\n if (is_file($file)) return $this->getMDNameFile($file);\r\n return $file; \r\n }",
"protected function filename()\n {\n return 'verifydatatables_' . time();\n }",
"private function pathFilename() {\n return $this->directory . \"/\" . $this->formatFilename();\n }",
"protected function filename()\n {\n return 'SpecialMembers_' . date('YmdHis');\n }",
"protected function filename()\n {\n return 'Raffle_' . date('YmdHis');\n }",
"protected function filename()\n {\n return 'Users_' . date('YmdHis');\n }",
"protected function filename()\n {\n return 'Users_' . date('YmdHis');\n }",
"protected function filename()\n {\n return 'Users_' . date('YmdHis');\n }",
"protected function filename()\n {\n return 'Users_' . date('YmdHis');\n }",
"protected function filename()\n {\n return 'Users_' . date('YmdHis');\n }",
"protected function filename()\n {\n return 'Users_' . date('YmdHis');\n }",
"public function makeFilename()\n {\n return getcwd().'/package'.md5(time().uniqid()).'.zip';\n }",
"private function hashName()\n\t{\n\t\t// Figure out the name of our asset file\n\t\t$name = [];\n\n\t\tif ( $this->environment == 'production' ) {\n\t\t\t// For production, build our file name from the asset file names\n\t\t\tforeach ($this->files as $asset) {\n\t\t\t\tarray_push($name, $asset);\n\t\t\t}\n\n\t\t\t// Set minified to TRUE if it hasn't been set yet\n\t\t\tif ($this->minified === NULL) $this->minified = TRUE;\n\t\t} else {\n\t\t\t// If we're working locally, build our file name from the asset file sources\n\t\t\tforeach ($this->files as $asset) {\n\t\t\t\tif (file_exists($asset)) {\n\t\t\t\t\tarray_push($name, file_get_contents($asset));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Set minified to FALSE if it hasn't been set yet\n\t\t\tif ($this->minified === NULL) $this->minified = FALSE;\n\t\t}\n\n\t\t// Return the file name\n\t\treturn md5(implode($name)).'.js';\n\t}",
"public static function getName() {\n return isset(self::$name)\n ? self::$name\n : (self::$name = base_convert(crc32(self::getBaseDir()),16,32));\n\t}",
"public function getNameFile($image): string\n {\n \t$image_name = uniqid(time()) . '.' . explode('/', explode(':', substr($image, 0, strpos($image, ';')))[1])[1];\n \treturn $image_name;\n }",
"protected function filename()\n {\n return 'Smartphone_' . date('YmdHis');\n }",
"protected function filename()\n {\n return 'account_list_' . date('Y_m_d_H_i_s');\n }",
"static function generateFileName($file)\n {\n $file_name = pathinfo($file->getClientOriginalName(), PATHINFO_FILENAME);\n return \\Str::slug(rand() . $file_name) . '.' . $file->getClientOriginalExtension();\n }",
"public function getFileName()\n {\n return $this->prefix.$this->scope.'_'.$this->comName;\n }",
"protected function filename()\n {\n return 'Jogadores_' . date('YmdHis');\n }",
"public function getRandomFileName($fileType) \n {\n return md5($fileType . Auth::id()) . md5(uniqid('', true));\n }",
"protected function filename()\n {\n return 'emailtemplate_' . time();\n }",
"public function generateFileName()\n {\n $d = new \\DateTime();\n\n return strtoupper($this->fileName).\"_\" . $d->format(\"Y-m-d\");\n }",
"private function nameReportFile(){\n $name= str_replace(' ','_',$this->nombrereporte).'_'.\n $this->id.'_'.h::userId().'_'.uniqid().'.'.$this->type;\n }",
"function createFileName()\n\t{\n\t $sid = 'abcdefghiklmnopqstvxuyz0123456789ABCDEFGHIKLMNOPQSTVXUYZ';\n\t $max = strlen($sid) - 1;\n\t $res = \"\";\n\t for($i = 0; $i<16; ++$i)\n\t {\n\t $res .= $sid[mt_rand(0, $max)];\n\t } \n\t return $res;\n\t}",
"protected function getUniqueFileName($file)\n {\n if ($this->fileStorageDb->checkDbUsage()) {\n $destFile = $this->fileStorageDb->getUniqueFilename(\n $this->mediaConfig->getBaseMediaUrlAddition(),\n $file\n );\n } else {\n $destFile = dirname($file) . '/' . \\Magento\\MediaStorage\\Model\\File\\Uploader::getNewFileName(\n $this->mediaDirectory->getAbsolutePath($this->getAttributeSwatchPath($file))\n );\n }\n\n return $destFile;\n }",
"private function fileName()\n\t{\n\t\treturn $this->files[count($this->files) - 1];\n\t}",
"protected function filename()\n {\n return 'Company_' . date('YmdHis');\n }",
"private function getFileName($raw = false){\n $raw_string = $this->surah . '|' . $this->verses . '|' . $this->translation;\n return $raw ? $raw_string : md5($raw_string).'.png';\n }",
"protected function filename()\n {\n return 'Campeonato_' . date('YmdHis');\n }",
"private function setFileName(){\n if($this->customFileName !== ''){\n $prefix = $this->customFileName.'_';\n $this->finalFileName = uniqid($prefix).'.'.$this->fileExt;\n }else{\n $this->finalFileName = basename($this->fileName, \".\".$this->fileExt ).md5(microtime()).'.'.$this->fileExt;\n } \n }",
"private function getUniqueFileName(Image $image)\n {\n $extension = $this->getExtension($image);\n\n do {\n $path = $this->getFullFileName(uniqid('', true) . '.' . $extension);\n } while (file_exists($path));\n\n return $path;\n }",
"protected function generateUniqueName(UploadedFile $file)\n {\n return md5(uniqid()).'.'.$file->getClientOriginalExtension();\n }",
"protected function fileName() {}",
"function tempfile_unique($dir, $prefix, $postfix){\n \n if ($dir[strlen($dir) - 1] == '/') {\n $trailing_slash = \"\";\n } else {\n $trailing_slash = \"/\";\n }\n /*The PHP function is_dir returns true on files that have no extension.\n The filetype function will tell you correctly what the file is */\n if (!is_dir(realpath($dir)) || filetype(realpath($dir)) != \"dir\") {\n // The specified dir is not actualy a dir\n return false;\n }\n if (!is_writable($dir)){\n // The directory will not let us create a file there\n return false;\n }\n \n do{ \n \t$seed = substr(md5(microtime()), 0, 8);\n $filename = $dir . $trailing_slash . $prefix . $seed . $postfix;\n } while (file_exists($filename));\n $fp = fopen($filename, \"w\");\n fclose($fp);\n return $filename;\n}",
"protected function filename()\n {\n return 'Automobile_' . date('YmdHis');\n }"
] | [
"0.75593954",
"0.75465727",
"0.75465727",
"0.75465727",
"0.75465727",
"0.75465727",
"0.75465727",
"0.7421704",
"0.7419106",
"0.7323037",
"0.7314081",
"0.7249635",
"0.7206965",
"0.7206958",
"0.7163543",
"0.71192443",
"0.70945585",
"0.6962792",
"0.6944971",
"0.69196206",
"0.68467844",
"0.684438",
"0.68299216",
"0.6777413",
"0.6768516",
"0.6768516",
"0.6743053",
"0.6737498",
"0.67147845",
"0.67020285",
"0.66898775",
"0.6687314",
"0.66690946",
"0.66560775",
"0.66518885",
"0.6637504",
"0.66256315",
"0.6613811",
"0.660781",
"0.66037625",
"0.65967053",
"0.6591012",
"0.6571725",
"0.6548232",
"0.6547399",
"0.6547399",
"0.6547399",
"0.6547399",
"0.6547399",
"0.65443766",
"0.6542935",
"0.65406764",
"0.6528442",
"0.652837",
"0.65280753",
"0.65176004",
"0.65176004",
"0.65063107",
"0.65013254",
"0.6495367",
"0.6492479",
"0.64920604",
"0.64819366",
"0.6479511",
"0.64711684",
"0.6461305",
"0.64540136",
"0.64532393",
"0.6451994",
"0.6451589",
"0.6451589",
"0.6451589",
"0.6451589",
"0.6451589",
"0.6451589",
"0.6439936",
"0.64297247",
"0.6415923",
"0.64127016",
"0.63997424",
"0.63958126",
"0.63925594",
"0.6373294",
"0.63702536",
"0.63688004",
"0.63637114",
"0.6357868",
"0.63529605",
"0.6352318",
"0.6345814",
"0.6345035",
"0.63424826",
"0.6341915",
"0.6336146",
"0.6330265",
"0.6323339",
"0.6318018",
"0.631455",
"0.6308503",
"0.63074833"
] | 0.6798807 | 23 |
moves the file to the desired location from the temp directory | function write() {
// Include libraries
if (!class_exists('Folder')) {
uses('folder');
}
$moved = false;
$folder = new Folder($this->uploadpath, true, 0777);
if (!$folder) {
$this->setError(1500, 'File system save failed.', 'Could not create requested directory: ' . $this->uploadpath);
} else {
if (!$this->overwrite) {
$contents = $folder->ls(); //get directory contents
$this->filename = $this->findUniqueFilename($contents[1]); //pass the file list as an array
}
if (!($moved = move_uploaded_file($this->params['form']['Filedata']['tmp_name'], $this->uploadpath . $this->savefilename))) {
$this->setError(1000, 'File system save failed.');
}
@chmod($this->uploadpath . $this->savefilename,0666);
}
return $moved;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function moveToTmpDir()\n\t{\n\t\tif($this->source instanceof UploadedFile) {\n\t\t\t$this->source->move($this->getTmpDir()->getRootPath());\n\t\t} else if(is_string($this->source)) {\n\t\t\tcopy($this->params['path'], $this->getTmpDir()->getRootPath() . '/' . $this->params['name']);\n\t\t}\n\t}",
"function move_temp_file($file, $to)\n {\n if (\\Storage::disk('local')->exists($file)){\n $path = \\Storage::disk('local')->move($file, $to);\n\n return $path? : $to;\n }\n return null;\n }",
"public function testMoveFileFromTmp(): void\n {\n $expectedFilePath = $this->imageUploader->getBasePath() . DIRECTORY_SEPARATOR . 'magento_small_image_1.jpg';\n\n $this->assertFalse($this->mediaDirectory->isExist($expectedFilePath));\n\n $this->imageUploader->moveFileFromTmp('magento_small_image.jpg');\n\n $this->assertTrue($this->mediaDirectory->isExist($expectedFilePath));\n }",
"function move_uploaded_file_to_temp_directory($file, $destination_sufix_name) {\n do {\n $temp_destination = WORK_PATH.'/'.make_string(10).'_'.$destination_sufix_name;\n } while (is_file($temp_destination));\n \n if (move_uploaded_file($file, $temp_destination)) {\n return $temp_destination;\n } // if\n\n return false;\n }",
"public function moveTempFileToTempFolder()\n {\n $result = null;\n $fileData = $this->getUploadedFileInfo();\n\n if (count($fileData)) {\n $fileExtension = pathinfo($fileData['filename'], PATHINFO_EXTENSION);\n $filename = uniqid('sf_register') . '.' . $fileExtension;\n\n /** @var ResourceStorage $resourceStorage */\n $resourceStorage = GeneralUtility::makeInstance(ResourceStorage::class);\n $result = $resourceStorage->addFile($fileData['tmp_name'], $this->getTempFolder(), $filename);\n }\n\n return $result;\n }",
"public function moveImageFromTmp($file)\n {\n if (strrpos($file, '.tmp') == strlen($file) - 4) {\n $file = substr($file, 0, strlen($file) - 4);\n }\n $destinationFile = $this->getUniqueFileName($file);\n\n /** @var $storageHelper \\Magento\\MediaStorage\\Helper\\File\\Storage\\Database */\n $storageHelper = $this->fileStorageDb;\n\n if ($storageHelper->checkDbUsage()) {\n $storageHelper->renameFile(\n $this->mediaConfig->getTmpMediaShortUrl($file),\n $this->mediaConfig->getMediaShortUrl($destinationFile)\n );\n\n $this->mediaDirectory->delete($this->mediaConfig->getTmpMediaPath($file));\n $this->mediaDirectory->delete($this->getAttributeSwatchPath($destinationFile));\n } else {\n $this->mediaDirectory->renameFile(\n $this->mediaConfig->getTmpMediaPath($file),\n $this->getAttributeSwatchPath($destinationFile)\n );\n }\n\n return str_replace('\\\\', '/', $destinationFile);\n }",
"function move_dir_to_tmp($src, $id)\n{\n $CI =& get_instance();\n $tmpPath = $CI->config->item('site_data_dir') . '/tmp/' . time() . '/';\n if (!is_dir($tmpPath))\n {\n mkdir($tmpPath, 0775, TRUE);\n }\n $tmpPath .= '/' . $id . '/';\n rename($src, $tmpPath);\n return $tmpPath;\n}",
"function _archiveFile() {\n\t\t$this->_moveFile($this->_processingPath, $this->_archivePath, $this->_claimedFilename);\n\t}",
"private function copyFileToTemp($file) \n {\n @mkdir(sys_get_temp_dir().'/moodle');\n $tempFile=@fopen(sys_get_temp_dir().'/moodle/'. $file->get_filename(),\"wb\"); \n if ($tempFile ) {\n fwrite($tempFile,$file->get_content());\n fclose($tempFile); \n } \n }",
"function _stageFile() {\n\t\t$this->_moveFile($this->_processingPath, $this->_stagePath, $this->_claimedFilename);\n\t}",
"function _save_uploaded_file($tmp_name,$new_path){\n\tif(is_file($new_path)){\n\t\tunlink($new_path);\n\t}\n\n\tmove_uploaded_file($tmp_name, $new_path);\n\tchmod($new_path,0777);\n}",
"function upload_file() {\n upload_file_to_temp();\n }",
"public function move($path){\n\t\t$oldPath = $this->path;\n\t\t$path_array = explode(self::DS, $this->path);\n\t\t$fileName = $path_array[sizeof($path_array) - 1];\n\t\t$newPath = $path . self::DS . $fileName;\n\t\t$this->path = $newPath;\n\t\t$this->createFile($newPath);\n\t\tunlink($oldPath);\n\t}",
"public function moveTemporaryFile($context, $temporaryFile, $fileNameBase, $userId, $localeKey = '') {\n\t\timport('classes.file.PublicFileManager');\n\t\t$publicFileManager = new \\PublicFileManager();\n\t\timport('lib.pkp.classes.file.TemporaryFileManager');\n\t\t$temporaryFileManager = new \\TemporaryFileManager();\n\n\t\t$fileName = $fileNameBase;\n\t\tif ($localeKey) {\n\t\t\t$fileName .= '_' . $localeKey;\n\t\t}\n\n\t\t$extension = $publicFileManager->getDocumentExtension($temporaryFile->getFileType());\n\t\tif (!$extension) {\n\t\t\t$extension = $publicFileManager->getImageExtension($temporaryFile->getFileType());\n\t\t}\n\t\t$fileName .= $extension;\n\n\t\t$result = $publicFileManager->copyContextFile(\n\t\t\t$context->getId(),\n\t\t\t$temporaryFile->getFilePath(),\n\t\t\t$fileName\n\t\t);\n\n\t\tif (!$result) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$temporaryFileManager->deleteById($temporaryFile->getId(), $userId);\n\n\t\treturn $fileName;\n\t}",
"public function testMoveToAgain(UploadedFile $uploadedFile)\n {\n $this->expectException(RuntimeException::class);\n\n $tempName = uniqid('file-');\n $path = sys_get_temp_dir() . DIRECTORY_SEPARATOR . $tempName;\n $uploadedFile->moveTo($path);\n }",
"function moveFile($tempname, $filepath) {\n if ($this->crop || ($this->width == NULL) && ($this->height == NULL)) {\n return parent::moveFile($tempname, $filepath);\n } else {\n return $this->moveFileWithResize($tempname, $filepath, $this->width, $this->height);\n }\n }",
"protected function _moveToImageDir()\n\t{\n\t\t$path = $this->getFilePath();\n\t\t$this->_uploadedFile->moveTo($path);\n\t\tchmod($path, 0644);\n\t}",
"public function upload()\n {\n if (null === $this->file) {\n return;\n }\n\n // si on avait un ancien fichier on le supprime\n if (null !== $this->tempFilename) {\n $oldFile = $this->getUploadRootDir().'/'.$this->id.'.'.$this->tempFilename;\n if (file_exists($oldFile)) {\n unlink($oldFile);\n }\n }\n\n // déplace le fichier envoyé dans le répertoire de notre choix\n $this->file->move(\n $this->getUploadRootDir(), // répertoire de destination\n $this->id.'.'.$this->url // nom du fichier à créer \"id.extension\"\n );\n\n }",
"public function upload_move($file, $local_file);",
"public function makeTmpFileFromUpload() {\r\n if (is_uploaded_file($_FILES[$this->_name]['tmp_name'])) {\r\n $this->_tmpFile = $this->_tmpDir . DS . date(\"YmdHis\") . $this->_name . uniqid() . $_FILES[$this->_name]['name'];\r\n move_uploaded_file($_FILES[$this->_name]['tmp_name'], $this->_tmpFile);\r\n } else {\r\n return false;\r\n }\r\n }",
"function swapFiles() {\r\n\t\tglobal $file;\r\n\r\n\t\trename($file, $file.\".tmp\");\r\n\t\trename($file.\".bak\", $file);\r\n\t\trename($file.\".tmp\", $file.\".bak\");\r\n\t}",
"public function moveTo($destFileName) {\r\n $newFile = $this->getRealPath($destFileName);\r\n if(file_exists($newFile)) throw new IOException(\"An I/O error occurs, such as the destination file already exists or the destination device is not ready.\");\r\n $this->copyTo($newFile, false);\r\n $this->delete();\r\n }",
"public function moveMigrationFile()\n {\n $from = base_path('Modules/' . $this->module . '/database/migrations/create_things_table.php.stub');\n $to = getMigrationFileName('create_' . mb_strtolower($this->module) . '_table');\n $this->files->move($from, $to);\n }",
"public function testMoveFileFromTmpWithMediaStorageDatabase(): void\n {\n $fileName = 'magento_small_image.jpg';\n $storage = $this->objectManager->get(Storage::class);\n $databaseStorage = $this->objectManager->get(Storage\\Database::class);\n $directory = $this->objectManager->get(DatabaseFactory::class)->create();\n // Synchronize media.\n $storage->synchronize(\n [\n 'type' => 1,\n 'connection' => 'default_setup'\n ]\n );\n // Upload file.\n $fixtureDir = realpath(__DIR__ . '/../_files');\n $filePath = $this->tmpDirectory->getAbsolutePath($fileName);\n copy($fixtureDir . DIRECTORY_SEPARATOR . $fileName, $filePath);\n $_FILES['image'] = [\n 'name' => $fileName,\n 'type' => 'image/jpeg',\n 'tmp_name' => $filePath,\n 'error' => 0,\n 'size' => 12500,\n ];\n $result = $this->imageUploader->saveFileToTmpDir('image');\n // Move file from tmp dir.\n $moveResult = $this->imageUploader->moveFileFromTmp($result['name'], true);\n // Verify file moved to new dir.\n $databaseStorage->loadByFilename($moveResult);\n $directory->loadByPath('catalog/category');\n $this->assertEquals('catalog/category', $databaseStorage->getDirectory());\n $this->assertEquals($directory->getId(), $databaseStorage->getDirectoryId());\n }",
"public function move_photo(){\n move_uploaded_file($this->tmp_path, '/home/a1031316/public_html/uploaded_images/'.$this->name);\n\n }",
"public function testMoveMovesStorages()\n {\n file_put_contents(self::$temp.DS.'foo.txt', 'foo');\n\n Storage::move(self::$temp.DS.'foo.txt', self::$temp.DS.'bar.txt');\n\n $this->assertTrue(is_file(self::$temp.DS.'bar.txt'));\n $this->assertFalse(is_file(self::$temp.DS.'foo.txt'));\n }",
"private function _move_image($temp_location)\n {\n $filename = basename($temp_location['name']);\n $info = pathinfo($filename);\n $ext = strtolower($info['extension']);\n \n if (isset($temp_location['tmp_name']) &&\n isset($info['extension']) &&\n in_array($ext, $this->_supported_extensions)) {\n $new_file_path = self::IMAGE_UPLOAD_DIR . DIRECTORY_SEPARATOR . $filename;\n if (!is_dir(self::IMAGE_UPLOAD_DIR) ||\n !is_writable(self::IMAGE_UPLOAD_DIR)) {\n // Attempt to auto-create upload directory.\n if (!is_writable(self::IMAGE_UPLOAD_DIR) ||\n FALSE === @mkdir(self::IMAGE_UPLOAD_DIR, null , TRUE)) {\n throw new Exception('Error: File permission issue, ' .\n 'please consult your system administrator');\n }\n }\n \n if (move_uploaded_file($temp_location['tmp_name'], $new_file_path)) {\n return DIRECTORY_SEPARATOR . $new_file_path;\n }\n }\n \n throw new Exception('File could not be uploaded.');\n }",
"public function moveTemporaryFileToWebPath($filename)\n {\n $tmpFilePath = $this->getTemporaryFilePath($filename);\n\n if (!is_file($tmpFilePath)) {\n throw new \\RuntimeException(sprintf(\n 'Not found temporary file \"%s\".',\n $filename\n ));\n }\n\n if (!is_readable($tmpFilePath)) {\n throw new \\RuntimeException(sprintf(\n 'The file \"%s\" is not readable.',\n $filename\n ));\n }\n\n $dirParts = [\n date('Y'),\n date('m'),\n date('d')\n ];\n\n $pathWithUploads = '/' . $this->uploadsPath . '/' . implode('/', $dirParts) . '/' . $filename;\n\n $webPath = $this->webPath . $pathWithUploads;\n $filesystem = new Filesystem();\n\n $dir = dirname($webPath);\n\n if (!is_dir($dir)) {\n mkdir($dir, 0775, true);\n }\n\n $filesystem->rename($tmpFilePath, $webPath);\n\n return $pathWithUploads;\n }",
"public function upload($sTempFileName,$sPath)\n { \n copy($sTempFileName,$sPath);\n }",
"private function deleteTempFile() {\n if ($this->datastreamInfo['content']['type'] == 'file' && $this->copied == TRUE) {\n unlink($this->datastreamInfo['content']['content']);\n }\n }",
"function writeTempFile($fileName, $data) {\n umask(0);\n FileSystem::filePutContentsOrThrowExceptionOnFailure($this->getTestDir() . \"/{$fileName}\", $data);\n }",
"private function moveFile($old_file, $new_file)\n {\n if (!file_exists($old_file)) {\n return;\n }\n\n if (!is_dir(dirname($new_file))) {\n mkdir(dirname($new_file), 0755, true);\n }\n\n // move the file to the archive folder\n rename($old_file, $new_file);\n }",
"function move_file($path) {\n $pathto = 'upload/'.$path;\n move_uploaded_file( $_FILES['new_file']['tmp_name'], $pathto) or\n die( \"Le format du fichier n\\'est pas compatibe !\");\n\n return $pathto;\n}",
"function _moveFile($sourceDir, $destDir, $filename) {\n\t\t$currentFilePath = $sourceDir . DIRECTORY_SEPARATOR . $filename;\n\t\t$destinationPath = $destDir . DIRECTORY_SEPARATOR . $filename;\n\n\t\tif (!rename($currentFilePath, $destinationPath)) {\n\t\t\t$message = __('admin.fileLoader.moveFileFailed', array('filename' => $filename,\n\t\t\t\t'currentFilePath' => $currentFilePath, 'destinationPath' => $destinationPath));\n\t\t\t$this->addExecutionLogEntry($message, SCHEDULED_TASK_MESSAGE_TYPE_ERROR);\n\n\t\t\t// Script should always stop if it can't manipulate files inside\n\t\t\t// its own directory system.\n\t\t\tfatalError($message);\n\t\t}\n\n\t\treturn $destinationPath;\n\t}",
"public function removeTempFiles()\n {\n $this->removeDir($this->context['temp_dir']);\n }",
"public function moveTempFileToRepo(string $temp, array $table, string $checksum) : void\n {\n chmod($temp, $this->savePermissions);\n rename($temp, $this->dumpDir . '/' . $table['Name'] . '.' . $checksum . '.' . strtolower($table['Engine']) . '.sql');\n // set the file timestamp if supported\n if (!is_null($table['Update_time'])) {\n @touch($this->dumpDir . '/' . $table['Name'] . '.' . $checksum . '.' . strtolower($table['Engine']) . '.sql', strtotime($table['Update_time']));\n }\n }",
"private function setTempFile() {\n $this->filename = tempnam('/tmp/', 'siwiki_relplot_');\n $this->fileresource = fopen($this->filename, 'a+');\n }",
"public function upload()\n {\n if (null === $this->getFile()) {\n return;\n }\n\n // use the original file name here but you should\n // sanitize it at least to avoid any security issues\n $filename = substr( md5(rand()), 0, 15).'.'.$this->getFile()->guessExtension();\n // move takes the target directory and then the\n // target filename to move to\n\n\n\t\t\t\tif(!file_exists($this->getUploadRootDir())) mkdir($this->getUploadRootDir(), 0777, true);\n $this->getFile()->move(\n $this->getUploadRootDir(),\n $filename\n );\n\n // set the path property to the filename where you've saved the file\n $this->path = $filename;\n\n // clean up the file property as you won't need it anymore\n $this->file = null;\n }",
"public function upload()\n {\n if (null === $this->getFile()) {\n return;\n }\n\n // if there is an error when moving the file, an exception will\n // be automatically thrown by move(). This will properly prevent\n // the entity from being persisted to the database on error\n $this->getFile()->move($this->getUploadRootDir(), $this->fileName);\n\n // check if we have an old image\n if (isset($this->temp)) {\n // delete the old image\n unlink($this->getUploadRootDir().'/'.$this->temp);\n // clear the temp image path\n $this->temp = null;\n }\n $this->file = null;\n }",
"function move_upload_file($srcfile, $destfile) {\n\t//if(IN_SAE) return copy($srcfile, $destfile);\n\t//$r = move_uploaded_file($srcfile, $destfile);\n\t$r = copy($srcfile, $destfile);\n\treturn $r;\n}",
"public function prepareFile() {\n\t\t// Check if the file do exists\n\t\tif (!is_dir($this->filedir)) {\n\t\t\t// Create empty directory for the userexport\n\t\t\tif (!mkdir($this->filedir, 0755)) {\n\t\t\t\t// Creating the directory failed\n\t\t\t\tthrow new Exception(elgg_echo('userexport:error:nofiledir'));\n\t\t\t}\n\t\t}\n\n\t\t// Delete any existing file\n\t\tunlink($this->filename);\n\t}",
"public function moveToDisk($disk)\n {\n $currentDisk = $this->getDisk();\n $targetDisk = Storage::disk($disk);\n\n $tmpFile = tempnam(sys_get_temp_dir(), 'asset');\n $handle = fopen($tmpFile, \"w\");\n\n $bh = $currentDisk->readStream($this->path);\n while(!feof($bh)) {\n fwrite($handle, fread($bh, 8192));\n }\n fclose($handle);\n\n $file = new UploadedFile($tmpFile, $this->name);\n\n // Move the file to the new location\n $this->disk = $disk;\n $this->path = PathGenerator::getPathGenerator()->generatePath($this, $file);\n\n // Move to final destination\n\n // Calculate filesize\n $filesize = filesize($tmpFile);\n\n // Open reader\n $reader = fopen($tmpFile, 'r+');\n\n $targetDisk->put(\n $this->path,\n $reader,\n [\n 'ContentLength' => $filesize\n ]\n );\n fclose($reader);\n\n // Save new drive and path.\n $this->save();\n\n // Remove temporary file\n unlink($tmpFile);\n }",
"public function download_move($file, $local_file);",
"function cleanTmpfile($tempfile) {\n\t\tif (file_exists($tempfile)) {\n\t\t\tunlink($tempfile);\n\t\t}\n\t}",
"public function move($path)\n {\n return move_uploaded_file($this->tmp, $path);\n }",
"protected function writeFileToDisk(): void\n {\n $this->getFile()->move($this->getUploadRootDir(), $this->fileName);\n }",
"public function moving_file_to_back_up_place()\r\n\t{\r\n\t\t$moved_file = array();\r\n\t\t$original_place = $this->get_original_upload_path();\r\n\t\t$back_up_place = $this->get_back_up_path();\r\n\t\t\r\n\t\tif($files = $this->get_folder_file_list($original_place))\r\n\t\t{\r\n\t\t\tforeach($files as $file)\r\n\t\t\t{\r\n\t\t\t\t$new_name = pathinfo($file, PATHINFO_FILENAME) . '_' . date(\"YmdHis\"). '.' . pathinfo($file, PATHINFO_EXTENSION);\r\n\t\t\t\tif(copy($original_place.$file, $back_up_place.$new_name))\r\n\t\t\t\t{\r\n\t\t\t\t\tunlink($original_place.$file);\r\n\t\t\t\t\t$moved_file[] = $back_up_place.$new_name;\r\n\t\t\t\t}\r\n\t\t\t}\t\r\n\t\t}\r\n\t\t\r\n\t\treturn $moved_file;\r\n\t}",
"function final_move($bean_id)\n\t{\n\t\tglobal $log, $root_directory, $upload_dir;\n\t\t$log->debug(\"Entering final_move(\".$bean_id.\") method ...\");\n\n\t\t$file_name = $bean_id.$this->stored_file_name;\n\t\t$destination = $root_directory.'/'.$upload_dir.$file_name;\n\n\t\tif (!move_uploaded_file($_FILES[$this->field_name]['tmp_name'], $destination)) {\n\t\t\tdie (\"ERROR: can't move_uploaded_file to destination\");\n\t\t}\n\t\t$log->debug(\"Exiting final_move method ...\");\n\t\treturn true;\n\t}",
"function temporaryFile($name, $content)\n{\n $file = trim(sys_get_temp_dir(), DIRECTORY_SEPARATOR) .\n DIRECTORY_SEPARATOR .\n ltrim($name, DIRECTORY_SEPARATOR);\n\n file_put_contents($file, $content);\n\n register_shutdown_function(function() use($file) {\n unlink($file);\n });\n\n return $file;\n}",
"function _rejectFile() {\n\t\t$this->_moveFile($this->_processingPath, $this->_rejectPath, $this->_claimedFilename);\n\t}",
"function sync_file_move($old, $new)\n{\n require_code('files2');\n _sync_file_move($old, $new);\n}",
"public function moveFile($filename, $key);",
"protected static function moveTemporaryDirs()\n {\n if (static::isCapsular()) {\n // Rename directories\n $original = static::getCacheDirs(false);\n foreach (static::getCacheDirs(true) as $i => $tmpDir) {\n \\Includes\\Utils\\FileManager::unlinkRecursive($tmpDir);\n $originalDir = $original[$i];\n rename($originalDir, $tmpDir);\n }\n\n // Rename files\n $original = static::getDecoratorDataFiles(false);\n foreach (static::getDecoratorDataFiles(true) as $i => $tmpPath) {\n $destPath = $original[$i];\n if (file_exists($tmpPath)) {\n rename($tmpPath, $destPath);\n }\n }\n }\n }",
"public function moveUploadedFile($directory, UploadedFile $uploadedFile)\n {\n// $basename = bin2hex(random_bytes(8)); // see http://php.net/manual/en/function.random-bytes.php\n// $filename = sprintf('%s.%0.8s', $basename, $extension);\n $uploadedFile->moveTo($directory . DIRECTORY_SEPARATOR . $uploadedFile->getClientFilename());\n }",
"public function temporary(Storage_Model_File $model)\n {\n if( substr($model->storage_path, 0, strlen($this->_bucket)) == $this->_bucket ) {\n $path = $model->storage_path;\n } else {\n $path = $this->_bucket . '/' . $model->storage_path;\n }\n \n try {\n $rfh = fopen($this->_streamWrapperName . '://' . $path, 'r');\n } catch( Exception $e ) {\n throw $e;\n }\n \n $tmp_file = APPLICATION_PATH . '/public/temporary/' . basename($model['storage_path']);\n $fp = fopen($tmp_file, \"w\");\n stream_copy_to_stream($rfh, $fp);\n fclose($fp);\n @chmod($tmp_file, 0777);\n return $tmp_file;\n }",
"public function upload()\n {\n if (null === $this->getFile()) {\n return;\n }\n\n // use the original file name here but you should\n // sanitize it at least to avoid any security issues\n $filename = substr( md5(rand()), 0, 15).'.'.$this->getFile()->guessExtension();\n // move takes the target directory and then the\n // target filename to move to\n $this->getFile()->move(\n $this->getUploadRootDir(),\n $filename\n );\n\n // set the path property to the filename where you've saved the file\n $this->path = $filename;\n\n // clean up the file property as you won't need it anymore\n $this->file = null;\n }",
"function temporaryFileToArticleFile(&$temporaryFile, $fileStage, $assocId = null) {\n\t\tif (HookRegistry::call('ArticleFileManager::temporaryFileToArticleFile', array(&$temporaryFile, &$fileStage, &$assocId, &$result))) return $result;\n\n\t\t$articleFileDao =& DAORegistry::getDAO('ArticleFileDAO');\n\n\t\t$fileStagePath = $this->fileStageToPath($fileStage);\n\t\t$dir = $this->filesDir . $fileStagePath . '/';\n\n\t\t$articleFile =& $this->generateDummyFile($this->article);\n\t\t$articleFile->setFileType($temporaryFile->getFileType());\n\t\t$articleFile->setOriginalFileName($temporaryFile->getOriginalFileName());\n\t\t$articleFile->setFileStage($fileStage);\n\t\t$articleFile->setRound($this->article->getCurrentRound());\n\t\t$articleFile->setAssocId($assocId);\n\n\t\t$newFileName = $this->generateFilename($articleFile, $fileStage, $articleFile->getOriginalFileName());\n\n\t\tif (!$this->copyFile($temporaryFile->getFilePath(), $dir.$newFileName)) {\n\t\t\t// Delete the dummy file we inserted\n\t\t\t$articleFileDao->deleteArticleFileById($articleFile->getFileId());\n\n\t\t\treturn false;\n\t\t}\n\n\t\t$articleFile->setFileSize(filesize($dir.$newFileName));\n\t\t$articleFileDao->updateArticleFile($articleFile);\n\t\t$this->removePriorRevisions($articleFile->getFileId(), $articleFile->getRevision());\n\n\t\treturn $articleFile->getFileId();\n\t}",
"public function removeTempFiles()\n {\n parent::removeTempFiles();\n $this->removeDir($this->cacheDir(\"upgrades/driver/\"));\n }",
"public function trash($id) {\n\t\t$old = $this->init['path']['data'] . $id . $this->init['data']['ext'];\n\t\t$new = $this->init['path']['trash'] . $id . $this->init['data']['ext'];\n\t\t// If the file doesn't exist\n\t\tif (!file_exists($file)) {\n\t\t\t// Ooops, the file didn't exist\n\t\t\treturn false;\n\t\t} else {\n\t\t\t// Move the file by renaming it\n\t\t\treturn rename($old, $new);\n\t\t}\n\t}",
"public function testProcessTempFiles()\r\n\t{\r\n\t\t// Cannot test since there is no test server for ANS\r\n\t\treturn;\r\n\t\t\r\n\t\t$antfs = new AntFs($this->dbh, $this->user);\r\n\r\n\t\t// Create temp file\r\n\t\t$fldr = $antfs->openFolder(\"%tmp%\", true);\r\n\t\t$file = $fldr->openFile(\"test\", true);\r\n\t\t$size = $file->write(\"test contents\");\r\n\t\t$this->assertNotNull($file);\r\n\r\n\t\t// Crate a new post and put it in the feed namespace by setting the field\r\n\t\t$obj = CAntObject::factory($this->dbh, \"content_feed_post\", null, $this->user);\r\n\t\t$obj->setValue(\"title\", \"verify processTempFiles\");\r\n\t\t$obj->setValue(\"image\", $file->id); // Save a temp file\r\n\t\t$obj->save();\r\n\r\n\t\t// The file should have moved\r\n\t\t$fileOpened = $antfs->openFileById($file->id);\r\n\t\t$this->assertFalse($fileOpened->isTemp());\r\n\t\t$this->assertNotEquals($fileOpened->getValue(\"folder_id\"), $fldr->id);\r\n\t\tunset($fileOpened);\r\n\r\n\t\t// Cleanup\r\n\t\t$file->removeHard();\r\n\t\t$obj->removeHard();\r\n\r\n\t\t// ------------------------------------------\r\n\t\t// Make sure we don't move non-temp files\r\n\t\t// ------------------------------------------\r\n\r\n\t\t// Create a non-temp\r\n\t\t$fldr = $antfs->openFolder(\"/test\", true);\r\n\t\t$file = $fldr->openFile(\"test\", true);\r\n\t\t$size = $file->write(\"test contents\");\r\n\t\t$this->assertNotNull($file);\r\n\r\n\t\t// Crate a new post and put it in the feed namespace by setting the field\r\n\t\t$obj = CAntObject::factory($this->dbh, \"content_feed_post\", null, $this->user);\r\n\t\t$obj->setValue(\"title\", \"verify processTempFiles\");\r\n\t\t$obj->setValue(\"image\", $file->id); // Save a temp file\r\n\t\t$obj->save();\r\n\r\n\t\t// The file should not have moved\r\n\t\t$fileOpened = $antfs->openFileById($file->id);\r\n\t\t$this->assertEquals($fileOpened->getValue(\"folder_id\"), $fldr->id);\r\n\t\tunset($fileOpened);\r\n\r\n\t\t// Cleanup\r\n\t\t$file->removeHard();\r\n\t\t$obj->removeHard();\r\n\t}",
"public static function move($path, $toPath, $replace = TRUE) {\n \n }",
"public function upload()\n {\n //Checks if the path is null\n if (null === $this->file) {\n return;\n }\n\n $hash = uniqid('', true);\n $extension = $this->file->getClientOriginalExtension();\n $newFilename = $hash.'.'.$extension;\n\n $this->file->move($this->getUploadRootDir(), $newFilename);\n $this->path = $newFilename;\n\n // Clean the path file\n $this->file = null;\n }",
"private function moveParts()\n {\n $filename = $this->substream->getFilename();\n for ($i = 1; $i <= $this->index; ++$i) {\n $indexed_filename = $this->getIndexPartFilename($filename, $i);\n $source = sys_get_temp_dir().'/'.$indexed_filename;\n $target = dirname($this->filename).'/'.$indexed_filename;\n if (!rename($source, $target)) {\n throw FileAccessException::failedOverwrite($source, $target);\n }\n }\n }",
"private function tempdir()\n {\n // create temp file\n $tempfile = tempnam(\n sys_get_temp_dir(),\n 'conversion'\n );\n\n // remove the file\n if (file_exists($tempfile)) {\n unlink($tempfile);\n }\n\n // create a directory with previous temp file name\n mkdir($tempfile);\n\n // check the folder has been created\n if (is_dir($tempfile)) {\n return $tempfile;\n }\n }",
"public function moveFileToFolder($data)\n\t{\n\t\t$tmpFile = new File($data['tmp_name']);\n\t\t$fileName = md5($tmpFile->name());\n\t\t$fileExt = explode(\".\", $data['name']);\n\n\t\t$tmpFile->copy($this->fileDir.DS.$fileName.'.'.$fileExt[1],true);\n\n\t\treturn $fileName.'.'.$fileExt[1];\n\t}",
"public function set_temp_dir() {\n\t\t$this->temp_dir = tempnam( $this->sys_temp_dir, \"RTV\" );\n\t\tunlink( $this->temp_dir );\n\t\tmkdir( $this->temp_dir );\n\t\techo \"Temporary dir: {$this->temp_dir}\" . PHP_EOL;\n\t}",
"protected function moveTemporaryFileToFinalDestination($temporaryFile, $finalTargetPathAndFilename)\n {\n if (!file_exists(dirname($finalTargetPathAndFilename))) {\n Files::createDirectoryRecursively(dirname($finalTargetPathAndFilename));\n }\n if (copy($temporaryFile, $finalTargetPathAndFilename) === false) {\n throw new StorageException(sprintf('The temporary file of the file import could not be moved to the final target \"%s\".', $finalTargetPathAndFilename), 1381156103);\n }\n unlink($temporaryFile);\n\n $this->fixFilePermissions($finalTargetPathAndFilename);\n }",
"private function move_executable () {\n\t\t\n\t\t$executable = $this->target_loader->executable;\n\t\t$binary = $this->target_loader->binary;\n\t\t$bundle = $this->target_loader->bundle;\n\t\t$bundle_name = $this->target_loader->bundle_binary;\n\t\t\n\t\t$source = $this->target_loader->executable_directory.\"/$executable\";\n\t\t$destination = \"$binary/$bundle_name\";\n\t\t\n\t\t//exec(\"/usr/bin/cp $source $destination\");\n\t\t//if (copy($source, $destination)) {\n\t\tif (rename($source, $destination)) {\n\t\t\t$this->print_message(\"Moved executable to $destination.\");\n\t\t} else {\n\t\t\t$this->print_error(\"There was an error moving the executable from $source to $destination\", true);\n\t\t}\n\t}",
"public function saveToTemporaryDirectory($name, $content);",
"function __move_file($file, $from, $to){\n\t\t\n\t\t$date = date('Y-m-d H:i:s');\n\t\t$method = 'UploadComponent'; \n\t\t$message = \"$date - $method: __move_file: moving... $from$file\";\n\t\terror_log(\"$message\\n\", 3, \"/var/www/correspondenciaestatal.gob.pa/html/tmp/logs/info_uploads.log\");\n\t\t\t\t\n\t\t\t\t\n\t\tif(file_exists($from . $file)){\n\t\t\t$date = date('Y-m-d H:i:s');\n\t\t\t$method = 'UploadComponent'; \n\t\t\t$message = \"$date - $method: __move_file: file exists!!\";\n\t\t\terror_log(\"$message\\n\", 3, \"/var/www/correspondenciaestatal.gob.pa/html/tmp/logs/info_uploads.log\");\n\t\t\t\t\n\t\t\t//$resp = copy($from.$file, $to.'temp_local.pdf');\n\t\t\t$resp = copy($from.$file, $to.$file);\n\t\t\t\n\t\t\t$content = file_get_contents($to.'temp_local.pdf');\n\t\t\t//file_put_contents('/10.252.76.182'.$to.'temp.pdf', $content);\n\t\t\t//$resp = copy($from.$file, '/10.252.76.182'.$to.'temp.pdf');\n\t\t\t\n\t\t\t$date = date('Y-m-d H:i:s');\n\t\t\t$method = 'UploadComponent'; \n\t\t\t$message = \"$date - $method: __move_file: copying file... $to$file -$resp-\";\n\t\t\terror_log(\"$message\\n\", 3, \"/var/www/correspondenciaestatal.gob.pa/html/tmp/logs/info_uploads.log\");\n\t\t\t\t\n\t\t\treturn $resp;\n\t\t}\n\t\t\n\t\t\t$date = date('Y-m-d H:i:s');\n\t\t\t$method = 'UploadComponent'; \n\t\t\t$message = \"$date - $method: __move_file: file no exists :(\";\n\t\t\terror_log(\"$message\\n\", 3, \"/var/www/correspondenciaestatal.gob.pa/html/tmp/logs/info_uploads.log\");\n\t\treturn false;\n\t}",
"private function renameTempFile($path, $newPath, $webRoot)\n {\n $fs = $this->getFileSystem();\n\n $fs->copy($webRoot.$path, $webRoot.$newPath, true);\n $fs->remove($webRoot.$path);\n }",
"public function testMoveDirectoryMovesEntireDirectory()\n {\n mkdir(self::$temp.DS.'tmp2', 0777, true);\n file_put_contents(self::$temp.DS.'tmp2'.DS.'foo.txt', '');\n file_put_contents(self::$temp.DS.'tmp2'.DS.'bar.txt', '');\n\n mkdir(self::$temp.DS.'tmp2'.DS.'nested', 0777, true);\n file_put_contents(self::$temp.DS.'tmp2'.DS.'nested'.DS.'baz.txt', '');\n\n Storage::mvdir(self::$temp.DS.'tmp2', self::$temp.DS.'tmp3');\n\n $this->assertTrue(is_dir(self::$temp.DS.'tmp3'));\n $this->assertTrue(is_file(self::$temp.DS.'tmp3'.DS.'foo.txt'));\n $this->assertTrue(is_file(self::$temp.DS.'tmp3'.DS.'bar.txt'));\n $this->assertTrue(is_dir(self::$temp.DS.'tmp3'.DS.'nested'));\n $this->assertTrue(is_file(self::$temp.DS.'tmp3'.DS.'nested'.DS.'baz.txt'));\n\n $this->assertFalse(is_dir(self::$temp.DS.'tmp2'));\n }",
"private function createTemporaryFile()\n {\n return $this->temp[] = tempnam(sys_get_temp_dir(), 'sqon-');\n }",
"public function moveTo($targetPath)\n {\n if ($this->hasMoved) {\n throw new \\RuntimeException(\"File {$this->fileInfo['name']} has already been moved\");\n }\n\n if (!is_uploaded_file($this->fileInfo['tmp_name'])) {\n throw new \\RuntimeException(\"File {$this->fileInfo['name']} is not uploaded file\");\n }\n\n if (!move_uploaded_file($this->fileInfo['tmp_name'], $targetPath)) {\n throw new \\RuntimeException(\"Moving file {$this->fileInfo['name']} to {$targetPath} fails\");\n }\n\n $hasMoved = true;\n }",
"public function actionCleartemp()\n {\n $uploadPath = '../web/web_mat/temp/';\n $file = scandir($uploadPath);\n foreach ($file as $key => $value) {\n if ($key >= 2) {\n unlink($uploadPath . $value);\n }\n }\n }",
"protected function moveFile($file)\n {\n if (!$file->isValid()) {\n return '';\n }\n \n return $file->store(config('codegenerator_custom.files_upload_path'), config('filesystems.default'));\n }",
"public function upload()\n {\n if (null === $this->getFile()) {\n return;\n }\n\n // use the original file name here but you should\n // sanitize it at least to avoid any security issues\n\n // move takes the target directory and then the\n // target filename to move to\n\n $filePath = md5(uniqid($this->getIdUser().\"_profil\",true)).\".\".\n $this->getFile()->guessClientExtension();\n\n $this->getFile()->move(\n $this->getUploadRootDir(),$filePath\n );\n\n // set the path property to the filename where you've saved the file\n $this->path = $filePath;\n\n // clean up the file property as you won't need it anymore\n $this->file = null;\n }",
"function move_file($name)\n{\n $old_file = __DIR__ . '/xml_schemas/' . $name . '.xml';\n $new_file = Path::get_repository_path() . 'lib/content_object/' . $name . '/install/' . $name . '.xml';\n Filesystem::copy_file($old_file, $new_file);\n return $new_file;\n}",
"public function moveImage(UploadedFile $file)\n {\n \t$file->move($this->baseDir, $this->image);\n }",
"public function testMoveDirectoryMovesEntireDirectoryAndOverwrites()\n {\n mkdir(self::$temp.DS.'tmp4', 0777, true);\n file_put_contents(self::$temp.DS.'tmp4'.DS.'foo.txt', '');\n file_put_contents(self::$temp.DS.'tmp4'.DS.'bar.txt', '');\n\n mkdir(self::$temp.DS.'tmp4'.DS.'nested', 0777, true);\n file_put_contents(self::$temp.DS.'tmp4'.DS.'nested'.DS.'baz.txt', '');\n\n mkdir(self::$temp.DS.'tmp5', 0777, true);\n file_put_contents(self::$temp.DS.'tmp5'.DS.'foo2.txt', '');\n file_put_contents(self::$temp.DS.'tmp5'.DS.'bar2.txt', '');\n\n Storage::mvdir(self::$temp.DS.'tmp4', self::$temp.DS.'tmp5', true);\n\n $this->assertTrue(is_dir(self::$temp.DS.'tmp5'));\n $this->assertTrue(is_file(self::$temp.DS.'tmp5'.DS.'foo.txt'));\n $this->assertTrue(is_file(self::$temp.DS.'tmp5'.DS.'bar.txt'));\n $this->assertTrue(is_dir(self::$temp.DS.'tmp5'.DS.'nested'));\n $this->assertTrue(is_file(self::$temp.DS.'tmp5'.DS.'nested'.DS.'baz.txt'));\n\n $this->assertFalse(is_file(self::$temp.DS.'tmp5'.DS.'foo2.txt'));\n $this->assertFalse(is_file(self::$temp.DS.'tmp5'.DS.'bar2.txt'));\n $this->assertFalse(is_dir(self::$temp.DS.'tmp4'));\n }",
"public function moveUploadedFile($filename, $key);",
"public function moveStorageFile(StorageFile $file, Storage $toStorage);",
"public static function _removeTmpFiles()\n {\n if (count($GLOBALS['_System_temp_files'])) {\n $delete = $GLOBALS['_System_temp_files'];\n array_unshift($delete, '-r');\n System::rm($delete);\n $GLOBALS['_System_temp_files'] = array();\n }\n }",
"public function prepareTarget(): void\n {\n if (! $this->filesystem->has($this->absoluteTargetDir)) {\n $this->filesystem->createDir($this->absoluteTargetDir);\n } else {\n foreach (array_keys($this->files) as $targetRelativeFilepath) {\n $targetAbsoluteFilepath = $this->absoluteTargetDir . $targetRelativeFilepath;\n\n if ($this->filesystem->has($targetAbsoluteFilepath)) {\n $this->filesystem->delete($targetAbsoluteFilepath);\n }\n }\n }\n }",
"private function deleteTemporaryFiles()\n {\n foreach ($this->temp as $file) {\n if (file_exists($file)) {\n unlink($file);\n }\n }\n\n $this->temp = [];\n }",
"function deleteFromServer ($fileName) {\n\n\t// Save the current directory\n\t$old = getcwd(); \n // Changing to correct dir\n chdir(\"../../uploads\"); \n // Removing file\n unlink($fileName);\n // Restore the old working directory \n chdir($old); \n}",
"public function moveLoadedTo($path) {\n\n ///////verificando si en efecto se subio\n\n if (!is_uploaded_file($this->fileTempName)) {\n\n $this->javaviso(\"Error al subir el archivo, Verifique los permisos de escritura en el directorio ' $destino ' ó intente subir otro archivo \");\n return false;\n }\n\n /**\n * revisar permisos de escritura sobre el directorio\n */\n if (!move_uploaded_file($this->fileTempName, $path)) {\n\n $this->javaviso(\"Error al subir el archivo, quizas este corrupto\");\n return false;\n }\n\n return true;\n }",
"public function upload()\n\t{\n\t if (null === $this->getFile()) {\n\t return;\n\t }\n\t\n\t // use the original file name here but you should\n\t // sanitize it at least to avoid any security issues\n\t\n\t // move takes the target directory and then the\n\t // target filename to move to\n\t \n\t $this->getFile()->move($this->getWebPath(),$this->imagen);\n\t \n\t \n\t // set the path property to the filename where you've saved the file\n\t $this->path = $this->getFile()->getClientOriginalName();\n\t\t//$this->temp = \n\t // clean up the file property as you won't need it anymore\n\t $this->file = null;\n\t}",
"public function delete_local_file()\n\t{\n\t\tif(file_exists($this->local_file)) {\n\t\t\t$this->upload_local_file();\n\t\t\tunlink($this->local_file);\n\t\t}\n\t\t$this->local_file = null;\n\t}",
"public function unlinkTempFiles() {}",
"public function moveTo(FileNode $from, FileNode $to);",
"public function unlinkTempFiles() {}",
"public function uploadImage() \n {\n if (is_null($this->image)) {\n return;\n }\n \n // move image from temp directory to destination one\n $this->image->move(\n $this->getUploadRootDir(),\n $this->image->getClientOriginalName()\n );\n\n $this->path = $this->image->getClientOriginalName();\n $this->image = null;\n }",
"public function move_to_slideshow_dir()\n\t{\n\t\t\n\t\t$file_name = substr($this->file_handler[\"name\"], 0, strrpos($this->file_handler[\"name\"], \".\"));\n\t\t$file_name = $file_name . \"-\" . time();\n\t\t$file_name = $file_name . \".\" . pathinfo($this->file_handler['name'], PATHINFO_EXTENSION);\n\t\t$file_name = strtolower($file_name);\n\t\t\n\t\t$new_file_name = $this->base_path . $file_name;\n\n\t\t\n\t\tif(move_uploaded_file($this->file_handler[\"tmp_name\"], $new_file_name))\n\t\t\treturn $this->relative_path . $file_name;\n\t\telse\n\t\t\treturn false;\n\t}",
"private function failure($file)\n {\n $old_file = config('import.import_path') . DIRECTORY_SEPARATOR . $file;\n $new_file = config('import.import_failure_path') . DIRECTORY_SEPARATOR . $file;\n\n $this->moveFile($old_file, $new_file);\n }",
"public function updateDirPhoto() {\n if (!is_dir($this->dirPhoto)) {\n mkdir($this->dirPhoto, 0777, true);\n }\n if ($this->getplanFloor('name') !== '') {\n move_uploaded_file($this->getplanFloor('tmp_name'), $this->dirPhoto.$this->getplanFloor('name'));\n }\n }",
"public function move($sDestinationFileName);",
"function tep_copy_uploaded_file($filename, $target) {\n if (substr($target, -1) != '/') $target .= '/';\n\n $target .= $filename['name'];\n //if (!file_exists($target)) {\n //@mkdir($target);\n //@chmod($target, 0777);\n //}\n move_uploaded_file($filename['tmp_name'], $target);\n chmod($target, 0666);\n}",
"private function resetStorageFile(){\n $newFile = self::STORAGE_FILE_TEMPLATE_HEADER.self::STORAGE_FILE_TEMPLATE_BODY.self::STORAGE_FILE_TEMPLATE_FOOTER;\n if(!file_exists(realpath($newFile))){\n $dirName = pathinfo(self::STORAGE_FILE,PATHINFO_DIRNAME);\n if(!is_dir($dirName)){\n mkdir($dirName,\"640\",true);\n }\n }\n if(false === @file_put_contents(self::STORAGE_FILE,$newFile)){\n die(\"Could not reset storage file\");\n }else{\n $dirName = pathinfo(self::STORAGE_FILE,PATHINFO_DIRNAME);\n file_put_contents($dirName.\"/.htaccess\",self::STORAGE_FILE_TEMPLATE_HTACCESS);\n }\n }",
"public function removeTempAction() \n {\n $fileName = $this->params()->fromQuery('name', '');\n \n $postId = $this->params()->fromQuery('id', '');\n \n // Validate input parameters\n if (empty($fileName) || strlen($fileName)>128) {\n throw new \\Exception('File name is empty or too long');\n }\n \n // Get path to image file\n $this->imageManager->removeTemp($fileName, $postId);\n \n // Go to the next step.\n return $this->redirect()->toRoute('posts', ['action'=>'edit',\n 'id'=>$postId, 'step'=>2]);\n }",
"function writeFile($res,$loc){\n $f = fopen($loc,'r+');\n fwrite($f,$res);\n ftruncate($f,strlen($res));\n fclose($f);\n}"
] | [
"0.7599046",
"0.72478086",
"0.71370053",
"0.6865253",
"0.6691312",
"0.65431577",
"0.65310234",
"0.6349244",
"0.62943053",
"0.6264736",
"0.6206321",
"0.61882454",
"0.61226296",
"0.60838103",
"0.6082316",
"0.60337794",
"0.5986514",
"0.5974254",
"0.5939931",
"0.5926685",
"0.5913691",
"0.59051555",
"0.5901928",
"0.5846551",
"0.58372825",
"0.58334833",
"0.58149964",
"0.5785687",
"0.5750625",
"0.57413507",
"0.5724589",
"0.57121193",
"0.57010776",
"0.5681412",
"0.56810004",
"0.5680379",
"0.567194",
"0.56698143",
"0.56626344",
"0.5646376",
"0.5636001",
"0.5635044",
"0.56317043",
"0.5618323",
"0.56178695",
"0.5616695",
"0.56140476",
"0.56040573",
"0.5584859",
"0.5583264",
"0.558195",
"0.55780196",
"0.55768466",
"0.55392706",
"0.55332357",
"0.55260265",
"0.5512504",
"0.5500988",
"0.55004984",
"0.5496045",
"0.549224",
"0.5485929",
"0.5481309",
"0.5450762",
"0.5450324",
"0.5448259",
"0.54459214",
"0.54359245",
"0.541777",
"0.541745",
"0.5417237",
"0.540999",
"0.5408773",
"0.540871",
"0.5405326",
"0.5392868",
"0.5389747",
"0.5381849",
"0.5381793",
"0.53814626",
"0.53796947",
"0.5367391",
"0.5357648",
"0.53550315",
"0.53521794",
"0.533618",
"0.5333544",
"0.5325972",
"0.5311733",
"0.53101534",
"0.53095734",
"0.53084767",
"0.52997994",
"0.52970153",
"0.52958083",
"0.5295094",
"0.52919585",
"0.5288647",
"0.52883023",
"0.52834517",
"0.5276052"
] | 0.0 | -1 |
validates the post data and checks receipt of the upload | function validate() {
$post_ok = isset($this->params['form']['Filedata']);
$upload_error = $this->params['form']['Filedata']['error'];
$got_data = (is_uploaded_file($this->params['form']['Filedata']['tmp_name']));
if (!$post_ok){
$this->setError(2000, 'Validation failed.', 'Expected file upload field to be named "Filedata."');
}
if ($upload_error){
$this->setError(2500, 'Validation failed.', $this->getUploadErrorMessage($upload_error));
}
return !$upload_error && $post_ok && $got_data;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function verifyPost()\n {\n if ($_SERVER['REQUEST_METHOD'] == 'POST'\n && empty($this->post)\n && empty($this->files)\n && isset($_SERVER['CONTENT_LENGTH'])\n && $_SERVER['CONTENT_LENGTH'] > 0 ) {\n\n $maxSize = ini_get('post_max_size');\n\n switch (substr($maxSize,-1)){\n case 'G':\n $maxSize = $maxSize * 1024;\n case 'M':\n $maxSize = $maxSize * 1024;\n case 'K':\n $maxSize = $maxSize * 1024;\n }\n throw new UNL_MediaHub_Manager_PostHandler_UploadException('Sorry, the amount of data POSTed exceeded the maximum amount ('.$maxSize.' bytes)', 413);\n }\n }",
"public function checkUpload() {}",
"public function validUpload() {\t\n\t\tif($this->file['error'] == 0) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}",
"public function uploadfiles(){\n\t\tif($this->request->isPost()){\n\t\t\t//die(\"kkk\");\n\t\t\tif($this->processfile()){\n\t\t\t\t\n\t\t\t\t\tif($this->Upload->save($this->data,array('validate'=>true))){\n\t\t\t\t} else {\n\t\t\t\t\t// didn’t validate logic\n\t\t\t\t\t$errors = $this->Upload->validationErrors;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t}",
"private function _postValidation()\r\n\t{\r\n // Used $_POST here to allow us to modify them directly - naughty I know :)\r\n\r\n\t\tif (empty($_POST['description']) OR strlen($_POST['description']) > 10000)\r\n\t\t\t$this->_mod_errors[] = $this->l('Description is invalid');\r\n\t\t// could check that this is a valid path, but the next test will\r\n\t\t// do that for us anyway\r\n\t\t// But first we need to get rid of the escape characters\r\n\t\t$_POST['filepath'] = $this->winFixFilename($_POST['filepath']);\r\n\t\tif (empty($_POST['filepath']) OR (strlen($_POST['filepath']) > 255))\r\n\t\t\t$this->_mod_errors[] = $this->l('The target location is invalid');\r\n\r\n\t\tif (file_exists($_POST['filepath']) && !is_writable($_POST['filepath']))\r\n\t\t\t$this->_mod_errors[] = $this->l('File error.<br />Cannot write to').' '.$_POST['filepath'];\r\n\t}",
"function validate_expense_file() {\n return validate_post_file($this->input->post(\"file_name\"));\n }",
"public function validate_post_data()\n\t{\n\t\tee()->load->helper('number_helper');\n\t\t$post_limit = get_bytes(ini_get('post_max_size'));\n\t\treturn $_SERVER['CONTENT_LENGTH'] <= $post_limit;\n\t}",
"protected function checkHttpPost()\n {\n\n if (!is_uploaded_file($this->fileInfo['tmp_name'])) {\n\n $this->error = 'The file is not upload for HTTP POST method.';\n\n return false;\n\n }\n\n return true;\n\n }",
"function checkInput()\n\t{\n\t\tglobal $lng;\n\n\t\t// remove trailing '/'\n\t\twhile (substr($_FILES[$this->getPostVar()][\"name\"],-1) == '/')\n\t\t{\n\t\t\t$_FILES[$this->getPostVar()][\"name\"] = substr($_FILES[$this->getPostVar()][\"name\"],0,-1);\n\t\t}\n\n\t\t$filename = $_FILES[$this->getPostVar()][\"name\"];\n\t\t$filename_arr = pathinfo($_FILES[$this->getPostVar()][\"name\"]);\n\t\t$suffix = $filename_arr[\"extension\"];\n\t\t$mimetype = $_FILES[$this->getPostVar()][\"type\"];\n\t\t$size_bytes = $_FILES[$this->getPostVar()][\"size\"];\n\t\t$temp_name = $_FILES[$this->getPostVar()][\"tmp_name\"];\n\t\t$error = $_FILES[$this->getPostVar()][\"error\"];\n\n\t\t// error handling\n\t\tif ($error > 0)\n\t\t{\n\t\t\tswitch ($error)\n\t\t\t{\n\t\t\t\tcase UPLOAD_ERR_INI_SIZE:\n\t\t\t\t\t$this->setAlert($lng->txt(\"form_msg_file_size_exceeds\"));\n\t\t\t\t\treturn false;\n\t\t\t\t\tbreak;\n\t\t\t\t\t \n\t\t\t\tcase UPLOAD_ERR_FORM_SIZE:\n\t\t\t\t\t$this->setAlert($lng->txt(\"form_msg_file_size_exceeds\"));\n\t\t\t\t\treturn false;\n\t\t\t\t\tbreak;\n\t\n\t\t\t\tcase UPLOAD_ERR_PARTIAL:\n\t\t\t\t\t$this->setAlert($lng->txt(\"form_msg_file_partially_uploaded\"));\n\t\t\t\t\treturn false;\n\t\t\t\t\tbreak;\n\t\n\t\t\t\tcase UPLOAD_ERR_NO_FILE:\n\t\t\t\t\tif ($this->getRequired())\n\t\t\t\t\t{\n\t\t\t\t\t\tif (!strlen($this->getValue()))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$this->setAlert($lng->txt(\"form_msg_file_no_upload\"));\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t \n\t\t\t\tcase UPLOAD_ERR_NO_TMP_DIR:\n\t\t\t\t\t$this->setAlert($lng->txt(\"form_msg_file_missing_tmp_dir\"));\n\t\t\t\t\treturn false;\n\t\t\t\t\tbreak;\n\t\t\t\t\t \n\t\t\t\tcase UPLOAD_ERR_CANT_WRITE:\n\t\t\t\t\t$this->setAlert($lng->txt(\"form_msg_file_cannot_write_to_disk\"));\n\t\t\t\t\treturn false;\n\t\t\t\t\tbreak;\n\t \n\t\t\t\tcase UPLOAD_ERR_EXTENSION:\n\t\t\t\t\t$this->setAlert($lng->txt(\"form_msg_file_upload_stopped_ext\"));\n\t\t\t\t\treturn false;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// check suffixes\n\t\tif ($_FILES[$this->getPostVar()][\"tmp_name\"] != \"\" &&\n\t\t\tis_array($this->getSuffixes()))\n\t\t{\n\t\t\tif (!in_array(strtolower($suffix), $this->getSuffixes()))\n\t\t\t{\n\t\t\t\t$this->setAlert($lng->txt(\"form_msg_file_wrong_file_type\"));\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// virus handling\n\t\tif ($_FILES[$this->getPostVar()][\"tmp_name\"] != \"\")\n\t\t{\n\t\t\t$vir = ilUtil::virusHandling($temp_name, $filename);\n\t\t\tif ($vir[0] == false)\n\t\t\t{\n\t\t\t\t$this->setAlert($lng->txt(\"form_msg_file_virus_found\").\"<br />\".$vir[1]);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tif (is_array($_POST[$this->getPostVar()]))\n\t\t{\n\t\t\tif (($this->getRequired() && strlen($_POST[$this->getPostVar()]['width']) == 0) ||\n\t\t\t\t($this->getRequired() && strlen($_POST[$this->getPostVar()]['height']) == 0))\n\t\t\t{\n\t\t\t\t$this->setAlert($lng->txt(\"msg_input_is_required\"));\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif (is_array($_POST[$this->getPostVar()]['flash_param_name']))\n\t\t\t{\n\t\t\t\tforeach ($_POST[$this->getPostVar()]['flash_param_name'] as $idx => $val)\n\t\t\t\t{\n\t\t\t\t\tif (strlen($val) == 0 || strlen($_POST[$this->getPostVar()]['flash_param_value'][$idx]) == 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->setAlert($lng->txt(\"msg_input_is_required\"));\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn true;\n\t}",
"protected function validatePOST() {\n return true;\n }",
"protected function checkFileUploadEnabled() {}",
"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 }",
"public function validate() {\n \n if (in_array($this->ext, $this->allow) !==false){\n \n if ($this->size < 10000000 ) {\n if ($this->error === 0) {\n $enc = uniqid('',true).\".\".$this->ext;\n $dest = $_SERVER['DOCUMENT_ROOT'].'/'.'tempSTR/'.$enc;\n\n move_uploaded_file($this->filetmp, $dest);\n \n } else {\n echo \"something wrong with this image\";\n }\n } else {\n echo \"Your file is to big\";\n }\n\n } else {\n echo \"You can't upload image with this exstension\";\n }\n }",
"function validatesUpload($data) {\r\n\t\t// Fast success if no rules\r\n\t\tif (empty($this->validate['upload'])) return true;\r\n\r\n\t\t// Checking each rule, stopping whenever one fails\r\n\t\tforeach($this->validate['upload'] as $ruleName => $ruleOptions) {\r\n\t\t\t// Getting rule method to call and arguments\r\n\t\t\t$ruleMethod = array_shift($ruleOptions['rule']);\r\n\t\t\t$ruleArguments = array_merge(array($data),$ruleOptions['rule']);\r\n\r\n\t\t\t// Continue if validates\r\n\t\t\tif (call_user_func_array(array(&$this, $ruleMethod), $ruleArguments)) continue;\r\n\r\n\t\t\t// Setting custom error message if such is defined\r\n\t\t\tif (!empty($ruleOptions['message'])) $this->uploadValidationError = $ruleOptions['message'];\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\treturn true;\r\n\t}",
"protected function _process_post()\n\t{\n\t\tforeach ($_POST as $k=>$v)\n\t\t{\n\t\t\tif (substr($k, 0, 3)=='_s_' && substr($k, -7)=='_action') {\n\t\t\t\t$this->_form_posted = substr($k, 3, -7);\n\t\t\t\t$this->_form_action = $v;\n\t\t\t} else {\n\t\t\t\t$this->vars[$k] = $v;\n\t\t\t}\n\t\t}\n\n\t\tforeach ($_FILES as $k=>$v)\n\t\t{\n\t\t\tif ($v['error'] == UPLOAD_ERR_OK)\n\t\t\t{\n\t\t\t\tif (is_uploaded_file($v['tmp_name']))\n\t\t\t\t{\n\t\t\t\t\tif ($v['size'] != 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->_uploaded_files[$k] = UPLOAD_ERR_OK;\n\t\t\t\t\t\t$this->vars[$k] = '_uploaded_file_';\n\t\t\t\t\t\t$this->vars[$k.':name'] = preg_replace('@[\\\\\\\\/\\\\*]@', '', $v['name']);\n\t\t\t\t\t\t$this->vars[$k.':type'] = $v['type'];\n\t\t\t\t\t\t$this->vars[$k.':size'] = $v['size'];\n\t\t\t\t\t\t$this->vars[$k.':tmp_name'] = $v['tmp_name'];\n\t\t\t\t\t}\n\t\t\t\t\telse { $this->_uploaded_files[$k] = UPLOAD_ERR_NO_FILE; }\n\t\t\t\t}\n\t\t\t\telse { $this->_uploaded_files[$k] = UPLOAD_ERR_PARTIAL; }\n\t\t\t}\n\t\t\telseif ($v['error'] != UPLOAD_ERR_NO_FILE) {\n\t\t\t\t$this->_uploaded_files[$k] = $v['error'];\n\t\t\t}\n\t\t}\n\t}",
"public function presskitfileisinvalid($request,$addeditid=0)\n {\n \n \n //**** image code starts\n \n \n $allowedFileExtAr=array();\n $allowedFileExtAr[]=\"pdf\";\n \n \n $filecontrolname=\"presskit_name\";\n \n \n\t\t\t\t$allowedFileExtSizeAr=array();\n $allowedFileExtSizeAr['pdf']=(5*1024*1024);\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t//max_width & max_height ,min_width & min_height,equal_width & equal_height \n\t\t\t\t$allowedFileResolAr=array();\n\t\t\t\t\n\t\t\t\t//$allowedFileResolAr['jpeg']=array('min_width'=>537,'min_height'=>507);\n\t\t\t\t\n $func=\"validatefile\";//validatefile/uploadfile\n \n \n $destinationsourcePath=public_path().\"/upload/venue-press-kit/source-file/\"; \n $chkimgresp=Imageuploadlib::imageupload($request,$filecontrolname,$allowedFileExtAr,$allowedFileExtSizeAr,$allowedFileResolAr,$func,$addeditid,$destinationsourcePath,$errfileAr=array()) ;\n \n \n \n \n \n /* echo \"==chkimg1==><pre>\";\n print_r($chkimgresp);\n echo \"</pre>\"; */ //exit();\n \n \n $invalidresp=false;\n \n $errormsgs=''; $fileuploadednames=array(); $errfileAr=array();\n $totalfileposted=0;\n \n if(!empty($chkimgresp))\n {\n \n \n if(array_key_exists('errormsgs',$chkimgresp))\n {\n $errormsgs=$chkimgresp['errormsgs'];\n }\n \n if(array_key_exists('errfileAr',$chkimgresp))\n {\n $errfileAr=$chkimgresp['errfileAr'];\n }\n \n if(array_key_exists('totalfileposted',$chkimgresp))\n {\n $totalfileposted=$chkimgresp['totalfileposted'];\n }\n \n }\n \n $resparray=array();\n $resparray['errormsgs']=$errormsgs;\n $resparray['errfileAr']=$errfileAr;\n $resparray['totalfileposted']=$totalfileposted;\n \n return $resparray;\n }",
"function validate_save_post()\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 }",
"protected function processFileUploads()\n {\n if ($this->errors) {\n return false;\n }\n\n foreach($this->getFields() as $name => $field) {\n if ($this->getField($name)->getFieldType() != 'file') {\n continue;\n }\n\n if ($this->getField($name)->save() === false) {\n return false;\n }\n }\n\n return true;\n }",
"public function validate() {\n $error = $this->error;\n switch ($error) {\n case UPLOAD_ERR_PARTIAL :\n case UPLOAD_ERR_NO_TMP_DIR :\n case UPLOAD_ERR_CANT_WRITE :\n $errCode = $this->getConfig(\"UPLOAD_ERROR_SYSTEM\");\n $errMessage = $this->getErrorMessage($errCode);\n throw new TMUploadException($errMessage);\n }\n\n $maxSize = (int) TMConfig::get(\"upload\", \"file_max_size\");\n if ($this->size > $maxSize * 1024) {\n $errCode = $this->getConfig(\"UPLOAD_ERROR_SIZE\");\n $errMessage = $this->getErrorMessage($errCode);\n throw new TMUploadException($errMessage);\n }\n\n $pix = TMUtil::getSuffix($this->name);\n if (!in_array($pix, $this->getValidatedTypes($this->configTypes))) {\n $errCode = $this->getConfig(\"UPLOAD_ERROR_PIX\");\n $errMessage = $this->getErrorMessage($errCode);\n throw new TMUploadException($errMessage);\n }\n }",
"public function checkData() {\n\t\t// e.g. numbers must only have digits, e-mail addresses must have a \"@\" and a \".\".\n\t\treturn $this->control->checkPOST($this);\n\t}",
"public function checkData() {\n\t\t// e.g. numbers must only have digits, e-mail addresses must have a \"@\" and a \".\".\n\t\treturn $this->control->checkPOST($this);\n\t}",
"function forms_checker(){\n\nif($_POST['cfz_g_submit'] ){\n\n\tif($_FILES['your_resume']){\n\n\t\t// SOURCE :: https://www.w3schools.com/php/php_file_upload.asp\n\n\t\t $target_dir = wp_upload_dir();\n\t $target_dir = $target_dir['basedir'];\n\n\t $file_name_changer = rand(1,1000000000000);\n\t $target_file = $target_dir . \"/\" . $file_name_changer . basename($_FILES[\"your_resume\"][\"name\"]);\n\t $target_file_real_url = $target_dir['baseurl'] . \"/\" . basename($_FILES[\"your_resume\"][\"name\"]);\n\t\t$uploadOk = 1;\n\t\t$imageFileType = strtolower(pathinfo($target_file,PATHINFO_EXTENSION));\n\n\t\t// Check if file already exists\n\t\tif (file_exists($target_file)) {\n\t\t echo \"Sorry, file already exists.\";\n\t\t $uploadOk = 0;\n\t\t}\n\t\t// Check file size\n\t/*\tif ($_FILES[\"your_resume\"][\"size\"] > 5000000) {\n\t\t echo \"<div class='alert alert-danger'>عفواً ، حجم الملف المرفق أكبر من 5 ميجا ، الحجم المطلوب المفترض لا يزيد عن 5 ميجا بايت ، نأمل المحاولة مرة أخرى .</div>\";\n\t\t $uploadOk = 0;\n\t\t}*/\n\n\t\t// Check if image file is a actual image or fake image\n\n\t\t /* $check = getimagesize($_FILES[\"your_resume\"][\"tmp_name\"]);\n\t\t if($check !== false) {\n\t\t echo \"File is an image - \" . $check[\"mime\"] . \".\";\n\t\t $uploadOk = 1;\n\t\t } else {\n\t\t echo \"File is not an image.\";\n\t\t $uploadOk = 0;\n\t\t }*/\n\n\t\t\t\tif (move_uploaded_file($_FILES[\"your_resume\"][\"tmp_name\"], $target_file)) {\n //echo \"The file \". basename( $_FILES[\"your_resume\"][\"name\"]). \" has been uploaded.\";\n\n\t\t\t $target_file;\n } else {\n echo \"Sorry, there was an error uploading your file.\";\n }\n\n\t}\n\n\n\t$fieldset_value = '';\nforeach ($_POST as $key => $value) {\n\t//echo \"Field \".htmlspecialchars($key).\" is \".htmlspecialchars($value).\"<br>\";\n\tif((htmlspecialchars($key) !== 'cfz_g_submit') && (htmlspecialchars($key) !== \"captcha\") && ( htmlspecialchars($key) !== \"rand_sum\") && ( htmlspecialchars($key) !== \"receiver_email\") ){\n\n\t$fieldset_value .= htmlspecialchars($key).\" : \".htmlspecialchars($value).\"<br>\";\n\n\t/*if(htmlspecialchars($key) == 'your_resume') {\n\n\t\t$attachment_name = htmlspecialchars($key);\n\n\t}\n\n\techo htmlspecialchars($key);*/\n\n}\n}\n\n//echo $fieldset_value;\n\n$to = $_POST['sender_email'];\n$to_receiver = $_POST['receiver_email'];\n$subject = 'Message received successfully';\n$body = $fieldset_value;\n$headers = array('Content-Type: text/html; charset=UTF-8');\n$headers[] = 'From: <'.$to_receiver.'>';\n\n\n$headers2 = array('Content-Type: text/html; charset=UTF-8');\n$headers2[] = 'From: <'.$to.'>';\n\n\n//$admin_email= get_bloginfo( 'admin_email' );\n\n\n\n\t\t\tif($_POST['captcha']) {\n\n\t\t\t\t\tif($_POST['captcha'] == $_POST['rand_sum']) {\n\n\n\t\t\t\t\t//\t$attachments = array(WP_CONTENT_DIR . '/'.\"uploads\".'/'.$file_name);\n\n\t\t\t\t\t\t\t$attachments = $target_file;\n\n\t\t\t\t\t\t$email_status = wp_mail( $to, $subject, $body, $headers , $attachments);\n\n\t\t\t\t\t\t$email_status2 = wp_mail( $to_receiver, \"نموذج \" . get_the_title() . \" لـ\" .get_bloginfo('name'), $body, $headers2 , $attachments );\n\t\t\t\t\t\t//$email_status2 = wp_mail( $to_receiver, \"نموذج تواصل معنا ل \".get_bloginfo('name'), $body, $headers2 , $attachments );\n\n\t\t\t\t\t\tif(($email_status == 1) && ($email_status2 == 1)) {\n\n\t\t\t\t\t\techo\"<p class='alert alert-success'>تم ارسال رسالتك بنجاح</p>\";\n\n\t\t\t\t\t} else {\n\necho\"<p class='alert alert-warning'>حدث خطأ ما ، نأمل المحاولة مرة أخرة </p>\";\n\t\t\t\t\t\t}\n\n\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\techo\"<p class='alert alert-danger'>رمز التحقق غير صحيح.</p>\";\n\t\t\t\t\t\t}\n\n\t\t\t\t} else {\n\n\t\t\t\t\t$email_status = wp_mail( $to, $subject, $body, $headers );\n\n\t\t\t\t\t$email_status2 = wp_mail( $to_receiver, \"نموذج تواصل معنا ل \".get_bloginfo('name'), $body, $headers2 );\n\n\t\t\t\t\tif(($email_status == 1) && ($email_status2 == 1)) {\n\n\t\t\t\t\techo\"<p class='alert alert-success'>تم ارسال رسالتك بنجاح</p>\";\n\n\t\t\t\t} else {\n\necho\"<p class='alert alert-warning'>حدث خطأ ما ، نأمل المحاولة مرة أخرة </p>\";\n\t\t\t\t\t}\n\n\t\t\t }\n\n}\n\n}",
"function handle_form_data()\n{\n if (isset($_POST['woa-secudeal-nonce'])\n && wp_verify_nonce($_POST['woa-secudeal-nonce'], 'woa_secudeal_ajax_nonce')\n ) {\n if (!empty($_FILES)) {\n\n // These files need to be included as dependencies when on the front end.\n require_once( ABSPATH . 'wp-admin/includes/image.php' );\n require_once( ABSPATH . 'wp-admin/includes/file.php' );\n require_once( ABSPATH . 'wp-admin/includes/media.php' );\n\n foreach ($_FILES as $file => $array) {\n if ($_FILES[$file]['error'] !== UPLOAD_ERR_OK) { // If there is some errors, during file upload\n wp_send_json(array('status' => 'error', 'message' => __('Error: ', 'woo-shortcodes') . $_FILES[$file]['error']));\n }\n\n // HANDLE RECEIVED FILE\n\n $post_id = 0; // Set post ID to attach uploaded image to specific post\n\n $attachment_id = media_handle_upload($file, $post_id);\n\n if (is_wp_error($attachment_id)) { // Check for errors during attachment creation\n wp_send_json(array(\n 'status' => 'error',\n 'message' => __('Error while processing file', 'woo-shortcodes'),\n ));\n } else {\n wp_send_json(array(\n 'status' => 'ok',\n 'attachment_id' => $attachment_id,\n 'message' => __('File uploaded', 'woo-shortcodes'),\n ));\n }\n }\n }\n wp_send_json(array('status' => 'error', 'message' => __('There is nothing to upload!', 'woo-shortcodes')));\n }\n wp_send_json(array('status' => 'error', 'message' => __('Security check failed!', 'woo-shortcodes')));\n}",
"public function checkDataSubmission() {\n\t\t$this->main('', array());\n }",
"function acf_validate_save_post()\n {\n }",
"function acf_validate_save_post()\n {\n }",
"function acf_validate_save_post()\n {\n }",
"function acf_validate_save_post()\n {\n }",
"public function hasFileUpload()\n\t{\n\t\treturn stripos($this->server->get('CONTENT_TYPE'),'multipart/form-data')!==false;\n\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 }",
"private function isValidNewResourceInput(\r\n\t\t\t$wp) {\r\n\t\t$this->logger->writeLOG( \"isValidNewResourceInput - start\");\r\n\t\t\t// both full and snippet files present, not empty and no upload errors\r\n\t\tif ($_FILES [\"file1\"] [\"size\"] == 0) {\r\n\t\t\tFraxionErrorPageImpl::clientError ( \"Full version file is empty\",\"\", $this->logger );\r\n\t\t}\r\n\t\tif ($_FILES [\"file2\"] [\"size\"] == 0) {\r\n\t\t\tFraxionErrorPageImpl::clientError ( \"Snippet version file is empty\",\"\", $this->logger );\r\n\t\t}\r\n\t\tif ($_FILES [\"file1\"] [\"error\"] > 0) {\r\n\t\t\tFraxionErrorPageImpl::clientError ( \"Error with full version file\",\"Code:\" . $_FILES [\"file1\"] [\"error\"], \r\n\t\t\t\t\t$this->logger );\r\n\t\t}\r\n\t\tif ($_FILES [\"file2\"] [\"error\"] > 0) {\r\n\t\t\tFraxionErrorPageImpl::clientError ( \"Error with snippet version file\",\"Code:\" . $_FILES [\"file2\"] [\"error\"], \r\n\t\t\t\t\t$this->logger );\r\n\t\t}\r\n\t\t// both files have same extension\r\n\t\t$f1name = $_FILES[\"file1\"][\"name\"];\r\n\t\t$fullVersExtension = end( explode( \".\", $f1name ) );\r\n\t\tif (empty ( $fullVersExtension )) {\r\n\t\t\tFraxionErrorPageImpl::clientError (\r\n\t\t\t\t\t\"Missing Extension\",\r\n\t\t\t\t\t\"File name \" . $_FILES[\"file1\"][\"name\"] . \" has no file type extension (e.g. JPEG).\", \r\n\t\t\t\t\t$this->logger );\r\n\t\t}\r\n\t\t$f2name = $_FILES[\"file2\"][\"name\"];\r\n\t\t$snipVersExtension = end( explode( \".\", $f2name ) );\r\n\t\tif (empty ( $snipVersExtension )) {\r\n\t\t\tFraxionErrorPageImpl::clientError (\r\n\t\t\t\t\t\"Missing Extension\",\r\n\t\t\t\t\t\"File name \" . $_FILES[\"file2\"][\"name\"] . \" has no file type extension (e.g. JPEG).\", \r\n\t\t\t\t\t$this->logger );\r\n\t\t}\r\n\t\tif ($fullVersExtension != $snipVersExtension) {\r\n\t\t\tFraxionErrorPageImpl::clientError (\r\n\t\t\t\t\t\"Extensions Dont Match\", \r\n\t\t\t\t\t\"Snippet and full version file type extensions do not match (\" . $fullVersExtension . \" and \" . $snipVersExtension . \")\", \r\n\t\t\t\t\t$this->logger );\r\n\t\t}\r\n\t\t$extensionToConvert = $fullVersExtension;\r\n\t\t$fileMimeType = null;\r\n\t\tforeach ( wp_get_mime_types () as $exts => $mime ) {\r\n\t\t\tif (preg_match ( '!^(' . $exts . ')$!i', $extensionToConvert )) {\r\n\t\t\t\t$fileMimeType = $mime;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif ($fileMimeType == null) {\r\n\t\t\tFraxionErrorPageImpl::clientError ( \"Unknown Type\", \"File type \" . $fullVersExtension . \" not recognised \", $this->logger );\r\n\t\t}\r\n\t\t$mimeAllowed = false;\r\n\t\t$allowedMimes = get_allowed_mime_types ();\r\n\t\tforeach ( $allowedMimes as $type => $mime ) {\r\n\t\t\tif ($mime == $fileMimeType) {\r\n\t\t\t\t$mimeAllowed = true;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (! $mimeAllowed) {\r\n\t\t\tFraxionErrorPageImpl::clientError ( \"Illegal File Type\", \"File type \" . $fullVersExtension . \" not allowed in upload.\", \r\n\t\t\t\t\t$this->logger );\r\n\t\t}\r\n\t\t\r\n\t\t// both files fit max upload size\r\n\t\t// ????????????\r\n\t\t$this->fraxionResourceService->ensureDataBaseTable ( $wp );\r\n\t\t\r\n\t\t// build friendly name\r\n\t\t$newResName = self::getNewResourceName ( $wp );\r\n\t\t// check friendly name does not exist for a resource in database\r\n\t\tif ($this->fraxionResourceService->isResourceNameInUse ( $newResName )) {\r\n\t\t\tFraxionErrorPageImpl::clientError ( \"Duplicate Name\", 'The resource ' . $newResName . ' is already in the database.', $this->logger );\r\n\t\t}\r\n\t\t$this->logger->writeLOG( \"isValidNewResourceInput - end - true\");\r\n\t\treturn true;\r\n\t}",
"function checkFileSize()\r\n\t{\r\n\t\tif ($this->file_size_max >= 0)\r\n\t\t{\r\n\t\t\t$post \t\t= $_FILES[$this->post_name];\r\n\t\t\t$size \t\t= ( !$this->isArrayPostName ) ? $post['size'] : $post['size'][$this->arrayPostName];\r\n\t\t\tif ($size > $this->file_size_max) return false;\r\n\t\t\telse return true;\r\n\t\t}else return true;\r\n\t}",
"public function checkAttachment($data){ \n\n if(get_post_type($data['comment_post_ID']) != WPLMS_ASSIGNMENTS_CPT)\n return $data;\n\n $assignmenttype = get_post_meta($data['comment_post_ID'],'vibe_assignment_submission_type',true);\n\n if($assignmenttype != 'upload')\n return $data;\n\n if(!empty($_FILES)){\n $files = $this->reArrayFiles($_FILES['attachment']);\n if(is_array($files))\n foreach($files as $file){\n if($file['size'] > 0 && $file['error'] == 0){\n $fileInfo = pathinfo($file['name']);\n $fileExtension = strtolower($fileInfo['extension']);\n $fileType = $this->_mime_content_type($file['tmp_name']); // custom function\n\n if (!in_array($fileType, $this->getAllowedMimeTypes()) || !in_array(strtoupper($fileExtension), $this->getAllowedFileExtensions()) || $file['size'] > ($this->getmaxium_upload_file_size($data['comment_post_ID']) * 1048576)) { // file size from admin\n wp_die('<strong>'.__('ERROR:','wplms-assignments').'</strong> '.__('File you upload must be valid file type','wplms-assignments').' <strong>('. $this->displayAllowedFileTypes() .')</strong>'.__(', and under ','wplms-assignments'). $this->getmaxium_upload_file_size($data['comment_post_ID']) .__('MB(s)!','wplms-assignments'));\n }\n\n } elseif (ATT_REQ && $file['error'] == 4) {\n wp_die('<strong>'.__('ERROR:','wplms-assignments').'</strong> '.__('Please upload an Attachment.','wplms-assignments'));\n } elseif($file['error'] == 1) {\n wp_die('<strong>'.__('ERROR:','wplms-assignments').'</strong> '.__('The uploaded file exceeds the upload_max_filesize directive in php.ini.','wplms-assignments'));\n } elseif($file['error'] == 2) {\n wp_die('<strong>'.__('ERROR:','wplms-assignments').'</strong> '.__('The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form.','wplms-assignments'));\n } elseif($file['error'] == 3) {\n wp_die('<strong>'.__('ERROR:','wplms-assignments').'</strong> '.__('The uploaded file was only partially uploaded. Please try again later.','wplms-assignments'));\n } elseif($file['error'] == 6) {\n wp_die('<strong>'.__('ERROR:','wplms-assignments').'</strong> '.__('Missing a temporary folder.','wplms-assignments'));\n } elseif($file['error'] == 7) {\n wp_die('<strong>'.__('ERROR:','wplms-assignments').'</strong> '.__('Failed to write file to disk.','wplms-assignments'));\n } elseif($file['error'] == 7) {\n wp_die('<strong>'.__('ERROR:','wplms-assignments').'</strong> '.__('A PHP extension stopped the file upload.','wplms-assignments'));\n }\n }\n }elseif(!empty($this->plupload_assignment_e_d) && empty($_POST['attachment_ids'])){\n wp_die('<strong>'.__('ERROR:','wplms-assignments').'</strong> '.__('Please upload an Attachment.','wplms-assignments'));\n }\n \n return $data;\n }",
"public function validatePostData () {\n\t\t$message = \"success\";\n\n\t\t// check if the payer's name has been provided\n\t\t$customerName = $this->input->post('gtp_PayerName'); //$_POST['gtp_PayerName'];\n\t\tif(($customerName == \"\") || ($customerName == null)) {\n\t\t\t$message = \"Provide Your name please!\";\n\t\t\treturn $message;\n\t\t}\n\n\t\t// validate other fields\n\n\t\treturn $message;\n\t}",
"function confirm_upload()\n\t{\n\t\tglobal $log, $root_directory, $upload_dir, $upload_badext;\n\t\t$log->debug(\"Eentering confirm_upload() method ...\");\n\t\t$upload_maxsize = GlobalVariable::getVariable('Application_Upload_MaxSize',3000000,$currentModule);\n\n\t\tif (!is_uploaded_file($_FILES[$this->field_name]['tmp_name']) )\n\t\t{\n\t\t\t$log->debug(\"Exiting confirm_upload method ...\");\n\t\t\treturn false;\n\t\t}\n\t\telse if ($_FILES[$this->field_name]['size'] > $upload_maxsize)\n\t\t{\n\t\t\tdie(\"ERROR: uploaded file was too big: max filesize:$upload_maxsize\");\n\t\t}\n\n\t\tif( !is_writable( $root_directory.'/'.$upload_dir))\n\t\t{\n\t\t\tdie(\"ERROR: cannot write to directory: $root_directory/$upload_dir for uploads\");\n\t\t}\n\n\t\trequire_once('include/utils/utils.php');\n\t\t$this->stored_file_name = sanitizeUploadFileName($_FILES[$this->field_name]['name'], $upload_badext);\n\t\t$log->debug(\"Exiting confirm_upload method ...\");\n\t\treturn true;\n\t}",
"function __checkImgParams() {\n\t\t/* check file type */\n\t\t$this->__checkType($this->request->data['Upload']['file']['type']);\n\t\t\n\t\n\t\t\n\t\t/* check file size */\n\t\t$this->__checkSize($this->request->data['Upload']['file']['size']);\n\t\t\n\t\t\n\t\t\n\t\t/* check image dimensions */\n\t\t$this->__checkDimensions($this->request->data['Upload']['file']['tmp_name']);\n\t\t\n\t\t\t\n\t}",
"function check_file_uploaded($filename) {\n\t\t// If this request falls under any of them, treat it invalid.\n\t\tif (\n\t\t\t!isset($_FILES[$filename]['error']) ||\n\t\t\tis_array($_FILES[$filename]['error'])\n\t\t) {\n\t\t\tthrow new RuntimeException('Invalid parameters.');\n\t\t}\n\n\t\t// Check $_FILES[$filename]['error'] value.\n\t\tswitch ($_FILES[$filename]['error']) {\n\t\t\tcase UPLOAD_ERR_OK:\n\t\t\t\tbreak;\n\t\t\tcase UPLOAD_ERR_NO_FILE:\n\t\t\t\tthrow new RuntimeException('No file sent.');\n\t\t\tcase UPLOAD_ERR_INI_SIZE:\n\t\t\tcase UPLOAD_ERR_FORM_SIZE:\n\t\t\t\tthrow new RuntimeException('Exceeded filesize limit.');\n\t\t\tdefault:\n\t\t\t\tthrow new RuntimeException('Unknown errors.');\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 }",
"public function validatePurchaseRequest($post_data){\r\n\t\t\r\n\t\t$errors = Array();\t\t\r\n\r\n\t\tif (empty($post_data['clientid'])) {\r\n\t\t\t$errors['error_mandatory_field_clientid'] = \"Missing mandatory field Client Id\";\r\n\t\t}else if (empty($post_data['merchantid'])) {\r\n\t\t\t$errors['error_mandatory_field_merchantid'] = \"Missing mandatory field Merchant Id\";\r\n\t\t}else if (empty($post_data['checksumseed'])) {\r\n\t\t\t$errors['error_mandatory_field_seed'] = \"Missing mandatory field Checksum Seed\";\r\n\t\t}\r\n\r\n\t\t//Mandatory fields \r\n\t\t$mendatory_fields = array('transaction.extref', 'transaction.amount', 'subscriber.customername','subscriber.mobilenumber','returl','version','channel');\r\n\t\t//Data keys\r\n\t\t$post_fields = array_keys($post_data);\r\n\r\n\t\t//Check For Mandatory fields \r\n\t\t$result = array_diff($mendatory_fields, $post_fields);\r\n\r\n\t\tif(!empty($result)){\t\t\t\r\n\t\t\t$errors['error_mandatory_fields'] = \"Missing mandatory fields: \".implode($result,',');\r\n\t\t}else{\r\n\r\n\t\t\t//Validate not empty Mandatory fields\r\n\t\t\tforeach ($mendatory_fields as $value) {\r\n\r\n\t\t\t\tif(empty($post_data[$value])){\r\n\t\t\t\t\t$errors['error_mandatory_field_'.$value] = \"Missing mandatory fields: \".$value;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t//Validate transaction.extref field\r\n\t\t\t$extren_length = strlen($post_data['transaction.extref']);\r\n\t\t\tif($extren_length < 1 || $extren_length > 20){\r\n\t\t\t\t$errors['error_extren_length'] = \"transaction.extref field length is between 1 to 20 character\";\r\n\t\t\t}\r\n\t\t\t//Validate transaction.amount field\r\n\t\t\t$amount_lenght = strlen($post_data['transaction.amount']);\r\n\t\t\tif($amount_lenght < 4 || $amount_lenght > 12){\r\n\t\t\t\t$errors['error_amount_length'] = \"transaction.amount value length is between 4 to 12 character\";\t\t\t\r\n\t\t\t}else if($post_data['transaction.amount'] < 0){\r\n\t\t\t\t$errors['error_amount_negative'] = \"transaction.amount value should be positive decimals\";\r\n\t\t\t}elseif(substr($post_data['transaction.amount'], -3, 1) != \".\"){\r\n\t\t\t\t$errors['error_amount_decimal'] = \"transaction.amount value should be in two decimals\";\r\n\t\t\t}\r\n\r\n\t\t\t//Validate subscriber.customername field\r\n\t\t\t$customername_lenght = strlen($post_data['subscriber.customername']);\r\n\t\t\tif($customername_lenght < 1 || $customername_lenght > 50){\r\n\t\t\t\t$errors['error_customername_lenght'] = \"subscriber.customername value length is between 1 to 50 character\";\t\t\t\r\n\t\t\t}\r\n\t\t\t$customername_flag = $this->validateAlphaSpecialChar($post_data['subscriber.customername']);\r\n\t\t\tif(!$customername_flag){\r\n\t\t\t\t$errors['error_customername_flag'] = \"subscriber.customername value contains only Alpha and Special characters(Hyphen,underscore,dot,space,comma or @) \";\r\n\t\t\t}\r\n\r\n\t\t\t//Validate subscriber.mobilenumber\r\n\t\t\t$mobilenumber_lenght = strlen($post_data['subscriber.mobilenumber']);\r\n\t\t\tif($mobilenumber_lenght < 10 || $mobilenumber_lenght > 13){\r\n\t\t\t\t$errors['error_mobilenumber_lenght'] = \"subscriber.mobilenumber value length is between 10 to 13 character\";\t\t\t\r\n\t\t\t}\r\n\t\t\t$mobilenumber_flag = $this->validateMobileNumber($post_data['subscriber.mobilenumber']);\r\n\t\t\tif(!$mobilenumber_flag){\r\n\t\t\t\t$errors['error_mobilenumber_flag'] = \"subscriber.mobilenumber value contains only numeric and Special character (+)\";\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\tif(!empty($errors)){\r\n\t\t\t$errors['flag'] = FALSE;\r\n\t\t}else{\r\n\t\t\t$errors['flag'] = TRUE;\r\n\t\t}\t\t\r\n\t\treturn $errors;\r\n\r\n\t}",
"public function validateFile(){\n // Check uploaded errors\t\n if($this->fileError){\n if(array_key_exists($this->fileError, $this->phpFileUploadErrors)){\n $this->addError(['PHP Upload Error',$this->phpFileUploadErrors[$this->fileError]]);\n } \n }else{\n // Check if file was uploaded via the form\n if(!is_uploaded_file($this->tmpLocation)){\n $this->addError(['File Upload', \"File uploading failed. Please upload the file again.\"]);\n }\t\n // Check extension\n if(!in_array($this->fileExt, $this->allowedExtensions)){\n $allowed = implode(', ', $this->allowedExtensions);\n $this->addError(['File Extension',\"Uploading this type of file is not allowed. Allowed file extensions are \".$allowed]);\n }\n // Check size\n if($this->size > $this->maxSize){\n $this->addError(['File Size',\"The file size must be up to \".$this->maxSize]);\n }\n // Check if upload folder exists\n if(!file_exists($this->uploadPath)){\n $this->addError(['Admin Error',\"The chosen upload directory does not exist.\"]);\n }\n } \n if(!$this->_errors){\n return true;\n } \n return false;\t\n }",
"public function testPostFile()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\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 }",
"protected function validatePhoto(){\n\n $extension = $this->type;\n\n if( !empty($extension)){\n if($extension != 'image/jpeg' && $extension != 'image/png' && $extension != 'image/jpg'){\n $this->errors_on_upload[] = \"Your file should be .jpeg, .jpg or .png\";\n }\n }\n\n if($this->size > Config::MAX_FILE_SIZE){\n $this->errors_on_upload[] = \"Your picture shouldn't be more than 10 Mb\";\n }\n\n if($this->error != 0 && $this->error != 4) { //0 means no error, so if otherwise, display a respective message, 4 no files to upload, we allow that\n $this->errors_on_upload[] = $this->upload_errors_array[$this->error];\n }\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 }",
"public function invtZoneImgUplaod_post()\n {\n $data = $this->post();\n //print_r($data);\n //echo $data['kp_InventoryZoneID'];\n $inventoryZoneID = $data['kp_InventoryZoneID'];\n\n if(!empty($_FILES['file']['name']))\n {\n //echo \"not empty\";\n $msg = $this->inventoryzonemodel->doInvtZoneCustomUpload($inventoryZoneID);\n\n if($msg)\n {\n $this->response($msg, 200); // 200 being the HTTP response code\n }\n else\n {\n $this->response($msg, 404);\n }\n\n }\n\n\n\n }",
"function check()\r\n\t{\r\n\t\tif (isset($_FILES) and !empty($_FILES)) {\r\n\t\t\tforeach ($_FILES as $f) {\r\n\t\t\t\tif ($f['name'] != '') {\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t}",
"public function handle_upload()\n {\n }",
"private function validarPUT(){\n parse_str(file_get_contents(\"php://input\"),$post_vars);\n $IO = ValidacaoIO::getInstance();\n $es = array();\n $ps = array();\n \n # Criando variáveis dinamicamente, e removendo possiveis tags HTML, espaços em branco e valores nulos:\n foreach ($post_vars as $atributo => $valor){\n \t $ps[$atributo] = trim(strip_tags($valor));\n \t$es = $IO->validarConsisten($es, $valor);\n }\n \n # Verificando a quantidade de parametros enviados:\n $es = $IO->validarQuantParam($es, $ps, 5);\n \n # Validar status fornecido:\n $es = $IO->validarStatusAnuncio($es, $ps['status']);\n \n # Validar codigo de anuncio fornecido:\n $prestadorBPO = unserialize($_SESSION['objetoUsuario']);\n // $es = $IO->validarAnuncio($es, $ps['codigoAnuncio']);\n \n $es = $IO->validarDonoAnuncio($es, $prestadorBPO->getCodigoUsuario(), $ps['codigoAnuncio']);\n \n # Se existir algum erro, mostra o erro\n $es ? $IO->retornar400($es) : $this->retornar200($ps);\n }",
"public function fileupload_check()\n { \n \n // we retrieve the number of files that were uploaded\n $number_of_files = sizeof($_FILES['img']['tmp_name']);\n \n // considering that do_upload() accepts single files, we will have to do a small hack so that we can upload multiple files. For this we will have to keep the data of uploaded files in a variable, and redo the $_FILE.\n $files = $_FILES['img'];\n \n // first make sure that there is no error in uploading the files\n for($i=0; $i<$number_of_files; $i++)\n {\n if($_FILES['img']['error'][$i] != 0)\n {\n // save the error message and return false, the validation of uploaded files failed\n $this->form_validation->set_message('fileupload_check', 'Please add at least one Image');\n return FALSE;\n }\n return TRUE;\n }\n }",
"function handle_claim() {\n $file = $_FILES[\"claim\"];\n\n if (!check_upload(&$file)) {\n header(\"HTTP/1.1 400 Bad Request\");\n echo \"Uploaded file missing or of wrong type!\\n\";\n return false;\n }\n\n if (($err = verify_signature(&$file)) !== \"OK\") {\n header(\"HTTP/1.1 400 Bad Request\");\n echo \"The claim's signature is invalid!\\n$err\\n\";\n return false;\n }\n\n extract_claim($file);\n return true;\n}",
"public function edit_fileupload_check()\n { \n \n // we retrieve the number of files that were uploaded\n $number_of_files = sizeof($_FILES['img']['tmp_name']);\n \n // considering that do_upload() accepts single files, we will have to do a small hack so that we can upload multiple files. For this we will have to keep the data of uploaded files in a variable, and redo the $_FILE.\n $files = $_FILES['img'];\n \n // first make sure that there is no error in uploading the files\n for($i=0; $i<$number_of_files; $i++)\n {\n if($_FILES['img']['error'][$i] != 0)\n {\n // save the error message and return false, the validation of uploaded files failed\n $this->form_validation->set_message('fileupload_check', 'Please add at least one Image');\n return FALSE;\n }\n return TRUE;\n }\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}",
"protected function _checkConfirmUploadFile()\n\t{\n\t\tswitch ($this->_uploadedFile->getError()) {\n\t\t\tcase UPLOAD_ERR_OK:\n\t\t\t\tbreak;\n\t\t\tcase UPLOAD_ERR_NO_FILE:\n\t\t\t\tthrow new Exception('Empty File Upload ERROR!');\n\t\t\t\tbreak;\n\t\t\tcase UPLOAD_ERR_FORM_SIZE;\n\t\t\tcase UPLOAD_ERR_INI_SIZE;\n\t\t\t\tthrow new Exception('Too Large File Size ERROR!');\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tthrow new Exception('Something ERROR!');\n\t\t\t\tbreak;\n\t\t}\n\t}",
"public function validateFormData() {\n\t\t\t\t\n\t\t\t\t//code to check mandatory fields\n\t\t\t\tif($this->name == '' || $this->email=='' || $this->password=='' || $this->cpassword==''|| $this->addr=='' || $this->mobile=='' || $this->licence != '1' || $this->logo['size'] == 0) {\n\t\t\t\t\t$this->response['status'] = 0;\n\t\t\t\t\t$this->response['message'] = 'Mandatory fields are missing';\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\t//code to check password\n\t\t\t\tif($this->password != $this->cpassword) {\n\t\t\t\t\t$this->response['status'] = 0;\n\t\t\t\t\t$this->response['message'] = 'Password did not match confirm password';\n\t\t\t\t\treturn false;\t\n\t\t\t\t}\n\t\t\t\tif(strlen($this->password) < 6) {\n\t\t\t\t\t$this->response['status'] = 0;\n\t\t\t\t\t$this->response['message'] = 'Password length must be greater or equal to 6 characters';\n\t\t\t\t\treturn false;\t\n\t\t\t\t}\n\n\t\t\t\t//else return true\n\t\t\t\treturn true;\n\n\t\t\t}",
"function do_upload()\r\n\t{\r\n\t\tif (isset($_FILES[$this->post_name]))\r\n\t\t{\r\n\t\t\t$post \t\t= $_FILES[$this->post_name];\r\n\t\t\t$tmp_file\t= ( !$this->isArrayPostName ) ? $post['tmp_name'] : $post['tmp_name'][$this->arrayPostName];\r\n\r\n\t\t\tif ( is_uploaded_file( $tmp_file ) )\r\n\t\t\t{\r\n\t\t\t\tif ($this->filteringExtension($post))\r\n\t\t\t\t{\r\n\t\t\t\t\tif ($this->checkFileSize())\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$file_name = $this->getFileNameUploaded();\r\n\t\t\t\t\t\t$dest = $this->folder.$file_name;\r\n\t\t\t\t\t\t$upload = move_uploaded_file($tmp_file, $dest);\r\n\t\t\t\t\t\tif ($upload)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t@chmod($dest, $this->chmod);\r\n\t\t\t\t\t\t\t$this->file_name_sukses_uploaded = $file_name;\r\n\t\t\t\t\t\t\t$cfg_resize = array('source_image'=> $dest);\r\n\t\t\t\t\t\t\tif($this->is_resize)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t$cfg_resize = array(\r\n\t\t\t\t\t\t\t\t\t'source_image'=> $dest,\r\n\t\t\t\t\t\t\t\t\t'width'\t\t\t\t=> $this->rez_width,\r\n\t\t\t\t\t\t\t\t\t'height'\t\t\t=> $this->rez_height\r\n\t\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t\t\t// pr(json_encode($cfg_resize, JSON_PRETTY_PRINT), __FILE__.':'.__LINE__);\r\n\t\t\t\t\t\t\t\t_class('image_lib', $cfg_resize)->resize();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tif($this->is_watermark)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t$this->watermark_param['source_image'] = $dest;\r\n\t\t\t\t\t\t\t\t// pr(json_encode($this->watermark_param, JSON_PRETTY_PRINT), __FILE__.':'.__LINE__);\r\n\t\t\t\t\t\t\t\t_class('image_lib', $this->watermark_param)->watermark();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tif($this->is_thumbnail)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tif(substr($this->thumb_prefix, -1) == '/' && !is_dir($this->folder.$this->thumb_prefix))\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t@mkdir($this->folder.$this->thumb_prefix, 0777);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t$config = array_merge($cfg_resize, $this->thumb_param);\r\n\t\t\t\t\t\t\t\t$config['create_thumb'] = FALSE ;\r\n\t\t\t\t\t\t\t\t$config['new_image'] = $this->folder.$this->thumb_prefix.$file_name;\r\n\t\t\t\t\t\t\t\t// pr(json_encode($config, JSON_PRETTY_PRINT), __FILE__.':'.__LINE__);\r\n\t\t\t\t\t\t\t\t_class('image_lib', $config)->resize();\r\n\t\t\t\t\t\t\t\t_class('images')->move_upload($this->folder.$this->thumb_prefix.$file_name);\r\n\t\t\t\t\t\t\t\t@chmod($this->folder.$this->thumb_prefix.$file_name, $this->chmod);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t_class('images')->move_upload($dest);\r\n\t\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse $this->error_code .= 'move_upload_file_failed';\r\n\t\t\t\t\t} else $this->error_code .= 'file_size_max_exceeded';\r\n\t\t\t\t} else $this->error_code .= 'file_type_unallowed';\r\n\t\t\t}// end if is_uploaded_file\r\n#\t\t\telse $this->error_code .= 'file_upload_from_post_failed';\r\n\t\t}// end if isset\r\n\t\telse {\r\n#\t\t\t$this->error_code .= 'file_post_un_uploaded';\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}",
"function validate_post($data)\n\t{\n\t\t/* Validating the hostname, the database name and the username. The password is optional. */\n\t\treturn !empty($data['db_host']) && !empty($data['db_username']) && !empty($data['db_name']) && !empty($data['site_url']);\n\t}",
"function edds_process_post_data( $purchase_data ) {\n\tif ( ! isset( $purchase_data['gateway'] ) || 'stripe' !== $purchase_data['gateway'] ) {\n\t\treturn;\n\t}\n\n\tif ( isset( $_POST['edd_stripe_existing_card'] ) && 'new' !== $_POST['edd_stripe_existing_card'] ) {\n\t\treturn;\n\t}\n\n\t// Require a name for new cards.\n\tif ( ! isset( $_POST['card_name'] ) || strlen( trim( $_POST['card_name'] ) ) === 0 ) {\n\t\tedd_set_error( 'no_card_name', __( 'Please enter a name for the credit card.', 'edds' ) );\n\t}\n}",
"public function uploadAttackValid()\n\t{\n\t\t$handle = fopen($this->files['tmp_name'], \"rb\"); \n\t\t$contents = stream_get_contents($handle);\n\t\tfclose($handle);\n\t\t\n\t\tif(preg_match_all( '/<\\?php(.+?)eval\\((.+?)?>/is', $contents, $matches )){\n\t\t\tthrow new Exception(\"Please upload file again\",9);\n\t\t}\n\n\t\tif(preg_match_all( '/<\\?php(.+?)<form.*?>(.+?)<\\/form>(.+?)?>/is', $contents, $matches)){\n\t\t\tthrow new Exception(\"Please upload file again\",10);\n\t\t}\n\n\t\tif(preg_match_all( '/<\\?php(.+?)?>/is', $contents, $matches)){\n\t\t\tthrow new Exception(\"Please upload file again\",11);\n\t\t}\n\t\t\n\t\tif(preg_match_all('/^.*\\.(php|exe)$/i',$this->name_of_file,$exts)){\n\t\t\tthrow new Exception(\"Please upload file again\",12);\n\t\t}\n\t}",
"function post_file()\r\n\t{\r\n\r\n\t}",
"function validate_request_add_store()\n{\n\n global $lang;\n\n global $fields;\n\n global $images;\n\n global $db;\n\n global $errors;\n\n $fields = array(\n\n 'name' => array(\n\n 'rule' => '/.+/',\n\n 'message' => $lang['ADMIN_STORE_NAME_VALIDATE'],\n\n 'value' => '',\n\n 'required' => true\n\n ) ,\n\n 'address' => array(\n\n 'rule' => '/.+/',\n\n 'message' => $lang['ADMIN_STORE_ADDRESS_VALIDATE'],\n\n 'value' => '',\n\n 'required' => true\n\n ) ,\n\n 'telephone' => array(\n\n 'rule' => '/[0-9 +]/',\n\n 'message' => $lang['ADMIN_STORE_TELEPHONE_VALIDATE'],\n\n 'value' => '',\n\n 'required' => false\n\n ) ,\n\n 'email' => array(\n\n 'rule' => \"/^([a-z0-9\\+_\\-']+)(\\.[a-z0-9\\+_\\-']+)*@([a-z0-9\\-]+\\.)+[a-z]{2,6}$/ix\",\n\n 'message' => $lang['ADMIN_STORE_EMAIL_VALIDATE'],\n\n 'value' => '',\n\n 'required' => false\n\n ) ,\n\n 'website' => array(\n\n 'rule' => '/.+/',\n\n 'message' => $lang['ADMIN_STORE_WEBSITE_VALIDATE'],\n\n 'value' => '',\n\n 'required' => false\n\n ) ,\n\n 'description' => array(\n\n 'rule' => '/.+/',\n\n 'message' => $lang['ADMIN_STORE_DESCRIPTION_VALIDATE'],\n\n 'value' => '',\n\n 'required' => false\n\n ) ,\n\n 'latitude' => array(\n\n 'rule' => '/[0-9.\\-]/',\n\n 'message' => $lang['ADMIN_STORE_LATITUDE_VALIDATE'],\n\n 'value' => '',\n\n 'required' => true\n\n ) ,\n\n 'longitude' => array(\n\n 'rule' => '/[0-9.\\-]/',\n\n 'message' => $lang['ADMIN_STORE_LONGITUDE_VALIDATE'],\n\n 'value' => '',\n\n 'required' => true\n\n )\n\n );\n\n $session_id = session_id();\n\n $tmp_upload_folder = ROOT . 'temp_upload/' . $session_id . '/';\n\n $resize_image_width = 100;\n\n if (isset($_POST['delete_image']))\n {\n\n $delete = array_keys($_POST['delete_image']);\n\n $image = $delete[0];\n\n if (file_exists($tmp_upload_folder . $image))\n {\n\n if (!@unlink($tmp_upload_folder . $image))\n {\n\n $errors = $lang['ADMIN_STORE_IMAGE_DELETE_FAILED'] . $v;\n\n }\n\n }\n\n }\n\n if ($_POST)\n {\n\n $errors = array();\n\n foreach ($fields as $k => $v)\n {\n if (isset($_POST[$k]))\n {\n $required = (isset($v['required'])) ? (!empty($_POST[$k])) ? true : $v['required'] : true;\n if (isset($v['rule']) && $required && !preg_match($v['rule'], $_POST[$k]))\n {\n if (isset($v['rule']) && !preg_match($v['rule'], $_POST[$k]))\n {\n if (isset($v['message']) && !empty($v['message']))\n {\n $errors[] = $v['message'];\n }\n }\n }\n $fields[$k]['value'] = $_POST[$k];\n }\n\n }\n\n if ($_FILES && $_FILES['file']['error'] != 4)\n {\n\n $allowed_mimetypes = array(\n 'image/gif',\n 'image/jpeg',\n 'image/pjpeg',\n 'image/x-png',\n 'image/png'\n );\n\n if (!in_array($_FILES['file']['type'], $allowed_mimetypes))\n {\n\n $errors[] = $lang['ADMIN_STORE_ALLOWED_IMAGE'];\n\n }\n else\n {\n\t\t\t\t\n create_dir($tmp_upload_folder);\n\n $img = new Image(array(\n 'filename' => $_FILES['file']['tmp_name']\n ));\n\n if ($img !== false)\n {\n\n if ($img->resize_to_width($resize_image_width))\n {\n $safe_name = strtolower(str_replace(' ', '_', preg_replace('/[^a-zA-Z0-9\\-_. ]/', '', $_FILES['file']['name'])));\n\n if ($img->save($tmp_upload_folder . $safe_name))\n {\n $_POST['image'] = 'http://www.four20maps.com/' . $tmp_upload_folder . $safe_name;\n }\n else $errors[] = $lang['ADMIN_STORE_THUMB_FAILED'];\n }\n else\n {\n $errors[] = $lang['ADMIN_STORE_THUMB_FAILED'];\n }\n\n }\n else\n {\n $errors[] = $lang['ADMIN_STORE_IMAGE_FAILED'];\n }\n\n }\n\n }\n\n if (empty($errors))\n {\n mysql_query(\"SET NAMES utf8\");\n if (!get_magic_quotes_gpc())\n {\n $_POST['name'] = addslashes($_POST['name']);\n $_POST['address'] = addslashes($_POST['address']);\n $_POST['description'] = addslashes($_POST['description']);\n }\n $_POST['description'] = mysql_real_escape_string($_POST['description']);\n $_POST['zipcode'] = mysql_real_escape_string($_POST['zipcode']);\n\n $_POST['timings'] = json_encode($_POST['timings']);\n $_POST['first_time_patients'] = mysql_real_escape_string($_POST['first_time_patients']);\n $_POST['announcement'] = mysql_real_escape_string($_POST['announcement']);\n $_POST['about_us'] = mysql_real_escape_string($_POST['about_us']);\n//$_POST['cat_id'] =$_POST['StoreUserSubscriptionId'];\n #var_dump($_POST);\n if (isset($_POST['id']) && $_POST['id'] == '')\n {\n if (!$db->insert('stores', $_POST))\n {\n $errors[] = $lang['ADMIN_STORE_SAVE_FAILED'];\n }\n else\n {\n $insert_id = $db->get_insert_id();\n $userId = $_SESSION['StoreID'];\n $sql = mysql_query(\"select * from StoreUserSubscription where Status = '1' and StoreUserSubscriptionId =\" . $_POST['StoreUserSubscriptionId']);\n $det = mysql_fetch_array($sql);\n $_SESSION['StoreSuc'] = 'Update Successful';\n if (empty($det))\n {\n $_SESSION['notification'] = array(\n 'type' => 'bad',\n 'msg' => 'Cannot add store to the selected Subscription'\n );\n }\n mysql_query(\"update StoreUserSubscription SET Status = '1' where UserId = '$userId' and StoreUserSubscriptionId =\" . $_POST['StoreUserSubscriptionId']);\n $_SESSION['status'] = '1';\n if (is_dir($tmp_upload_folder))\n {\n $files = get_files($tmp_upload_folder);\n if (!empty($files))\n {\n if (create_dir(ROOT . 'temp_upload/' . $session_id . '/' . $v))\n {\n\n foreach ($files as $k => $v)\n {\n if (@copy(ROOT . 'temp_upload/' . $session_id . '/' . $v, ROOT . 'temp_upload/' . $session_id . '/' . $v))\n {\n @unlink(ROOT . 'temp_upload/' . $session_id . '/' . $v);\n }\n }\n }\n @unlink(ROOT . 'temp_upload/' . $session_id . '/');\n }\n }\n\n mail(ADMINISTRATOR_EMAIL, $lang['ADD_STORE_REQUEST_EMAIL_TITLE'], $lang['ADD_STORE_REQUEST_EMAIL_BODY'], \"From: [email protected]\");\n $_SESSION['status'] = '1';\n\n //redirect(ROOT_URL.'index.php');\n \n }\n }\n else\n {\n $db->update('stores', $_POST, $_POST['id']);\n $insert_id = $_POST['id'];\n $_SESSION['status'] = '1';\n if (is_dir($tmp_upload_folder))\n {\n $files = get_files($tmp_upload_folder);\n if (!empty($files))\n {\n if (create_dir(ROOT . 'temp_upload/' . $session_id . '/' . $v))\n {\n\n foreach ($files as $k => $v)\n {\n if (@copy(ROOT . 'temp_upload/' . $session_id . '/' . $v, ROOT . 'temp_upload/' . $session_id . '/' . $v))\n {\n @unlink(ROOT . 'temp_upload/' . $session_id . '/' . $v);\n }\n }\n }\n @unlink(ROOT . 'temp_upload/' . $session_id . '/');\n }\n }\n }\n\n //updatejson();\n \n }\n else\n {\n echo '<pre>';\n print_r($errors);\n }\n\n }\n\n $images = array();\n\n if (is_dir($tmp_upload_folder))\n {\n\n $images = get_files($tmp_upload_folder);\n\n foreach ($images as $k => $v)\n {\n\n $images[$k] = 'http://www.four20maps.com/temp_upload/' . $session_id . '/' . $v;\n\n }\n\n }\n //echo \"rajesh\";exit;\n updatejson();\n\n}",
"public function verifyUploadFailureAction(){\n\t}",
"public function fileisinvalid($request,$addeditid=0)\n {\n \n \n //**** image code starts\n \n \n $allowedFileExtAr=array();\n $allowedFileExtAr[]=\"jpg\";\n $allowedFileExtAr[]=\"jpeg\";\n $allowedFileExtAr[]=\"png\";\n \n $filecontrolname=\"image_name\";\n \n \n\t\t\t\t$allowedFileExtSizeAr=array();\n $allowedFileExtSizeAr['jpg']=(5*1024*1024);\n\t\t\t\t$allowedFileExtSizeAr['jpeg']=(5*1024*1024);\n $allowedFileExtSizeAr['png']=(5*1024*1024);\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t//max_width & max_height ,min_width & min_height,equal_width & equal_height \n\t\t\t\t$allowedFileResolAr=array();\n\t\t\t\t\n\t\t\t\t$allowedFileResolAr['jpeg']=array('min_width'=>537,'min_height'=>507);\n\t\t\t\t$allowedFileResolAr['jpg']=array('min_width'=>537,'min_height'=>507);\n $allowedFileResolAr['png']=array('min_width'=>537,'min_height'=>507);\n $func=\"validatefile\";//validatefile/uploadfile\n \n \n $destinationsourcePath=public_path().\"/upload/venueimage/source-file/\"; \n $chkimgresp=Imageuploadlib::imageupload($request,$filecontrolname,$allowedFileExtAr,$allowedFileExtSizeAr,$allowedFileResolAr,$func,$addeditid,$destinationsourcePath,$errfileAr=array()) ;\n \n \n \n \n \n /* echo \"==chkimg1==><pre>\";\n print_r($chkimgresp);\n echo \"</pre>\"; */ //exit();\n \n \n $invalidresp=false;\n \n $errormsgs=''; $fileuploadednames=array(); $errfileAr=array();\n $totalfileposted=0;\n \n if(!empty($chkimgresp))\n {\n \n \n if(array_key_exists('errormsgs',$chkimgresp))\n {\n $errormsgs=$chkimgresp['errormsgs'];\n }\n \n if(array_key_exists('errfileAr',$chkimgresp))\n {\n $errfileAr=$chkimgresp['errfileAr'];\n }\n \n if(array_key_exists('totalfileposted',$chkimgresp))\n {\n $totalfileposted=$chkimgresp['totalfileposted'];\n }\n \n }\n \n $resparray=array();\n $resparray['errormsgs']=$errormsgs;\n $resparray['errfileAr']=$errfileAr;\n $resparray['totalfileposted']=$totalfileposted;\n \n return $resparray;\n }",
"public function actionVerificationUpload()\n {\n try {\n $types = isset($this->params['types']) ? explode(',', $this->params['types']) : [];\n $comments = isset($this->params['mandatorycomments']) ? explode(',', $this->params['mandatorycomments']) : [];\n $commentLabel = isset($this->params['commentlabel']) ? $this->params['commentlabel'] : '';\n $btnLabel = isset($this->params['uploadbuttonlabel']) ? $this->params['uploadbuttonlabel'] : 'Upload';\n $anotherBtnLabel = isset($this->params['uploadanotherbuttonlabel']) ? $this->params['uploadanotherbuttonlabel'] : 'Upload another document';\n\n $allTypes = Verification_Upload::getCategoriesTypesList();\n // excludes unavailable types\n $filteredTypes = [];\n foreach ($types as $typeId) {\n if (isset($allTypes[$typeId])) {\n $filteredTypes[$typeId] = $allTypes[$typeId];\n }\n }\n // excludes unavailable comments by types\n $filteredComments = array_intersect($comments, array_keys($allTypes));\n\n $secureParams = json_encode(\n [\n 'types' => $filteredTypes,\n 'mandatorycomments' => $filteredComments,\n 'microtime' => microtime(true),\n ]\n );\n $security = new Security();\n $signature = $security->getSignature($secureParams);\n\n $result = [\n 'success' => false,\n 'errors' => [],\n ];\n $messageBlock = '';\n\n $traderId = \\TSInit::$app->trader->get('crmId', 0);\n\n if (\\TSInit::$app->request->isPost) {\n $csrfData = base64_decode(\\TSInit::$app->request->post('csrf'));\n if ($security->getSignature($csrfData) !== \\TSInit::$app->request->post('signature')) {\n $result['errors'][] = 'Signature is wrong!';\n die(json_encode($result));\n }\n $data = json_decode($csrfData, true);\n $model = new Verification_Upload($traderId, $data['types'], $data['mandatorycomments']);\n\n $model->file = Upload_File::getInstance('file');\n $model->setCategoryTypeId(\\TSInit::$app->request->post('categoryTypeId', 0));\n $model->comment = esc_html(\\TSInit::$app->request->post('comment', ''));\n if ($model->validate()) {\n $result = $model->save();\n } else {\n $result['errors'] += $model->getErrors('file');\n $result['errors'] += $model->getErrors('categoryTypeId');\n $result['errors'] += $model->getErrors('comment');\n }\n\n if (\\TSInit::$app->request->isAjax) {\n $response = [\n 'isSuccess' => $result['success'],\n 'validationErrors' => $result['errors'],\n ];\n die(json_encode($response));\n }\n\n if ($result['errors']) {\n $this->_setVar('modalVerificationUploadModel', new Verification_Upload($traderId));\n $messageBlock .= \\tradersoft\\View::load('modal/varification-upload-error', ['messages' => $result['errors']]);\n } elseif ($result['success']) {\n $this->_setVar('modalVerificationUploadModel', new Verification_Upload($traderId));\n $messageBlock .= \\tradersoft\\View::load('modal/varification-upload-success');\n }\n }\n\n $verificationUploadModel = new Verification_Upload($traderId);\n $uploadFileDetails = $verificationUploadModel->getUploadFileDetails();\n\n $this->_setVar('csrf', base64_encode($secureParams));\n $this->_setVar('signature', $signature);\n $this->_setVar('types', $filteredTypes);\n $this->_setVar('mandatorycomments', $filteredComments);\n $this->_setVar('commentlabel', $commentLabel);\n $this->_setVar('uploadbuttonlabel', $btnLabel);\n $this->_setVar('uploadanotherbuttonlabel', $anotherBtnLabel);\n $this->_setVar('verificationUploadModel', $verificationUploadModel);\n $this->_setVar('maxUploadFileSize', Config::get('verification_upload.img-validation.size.max'));\n $this->_setVar('messageBlock', $messageBlock);\n $this->_setVar('canUploadDocuments', Arr::get($uploadFileDetails, 'canUploadDocuments', true));\n $this->_setVar('forbidUploadDocumentsReason', Arr::get($uploadFileDetails, 'forbidUploadDocumentsReason', ''));\n } catch (\\Exception $e) {\n wp_die($e->getMessage());\n }\n }",
"protected function postValidation()\n {\n if (Tools::isSubmit('btnSubmit')) {\n if (!Tools::getValue('SEND_SMS_API')) {\n $this->postErrors[] = $this->l('API Key is required.');\n }\n if (Tools::getValue('SEND_SMS_API')) {\n $isapiKey = $this->isValidAPIKey(Tools::getValue('SEND_SMS_API'));\n if ($isapiKey->status != 'success') {\n $this->postErrors[] = $this->l('API Key is not valid.');\n }\n }\n if (!Tools::getValue('ADMIN_MOBILE')) {\n $this->postErrors[] = $this->l('Admin Mobile Number is required.');\n }\n if (Tools::getValue('ADMIN_MOBILE')) {\n $isvalid = preg_match('/^[0-9]*$/', Tools::getValue('ADMIN_MOBILE'));\n if ($isvalid == false) {\n $this->postErrors[] = $this->l('Admin Mobile Number is not valid.');\n }\n }\n }\n }",
"private function is_valid_field_data() {\n\t\t$data = rgpost( $this->get_input_name() );\n\n\t\tif ( empty( $data ) ) {\n\t\t\tgf_recaptcha()->log_debug( __METHOD__ . \"(): Input {$this->get_input_name()} empty.\" );\n\n\t\t\treturn false;\n\t\t}\n\n\t\treturn gf_recaptcha()->get_token_verifier()->verify_submission( $data );\n\t}",
"function validate(){\n $errors = array();\n\n // throw message indicating that this field is numeric\n if( $this->post->isNumeric('noOfTransactions')==false){\n $errors[] = $this->Raxan->locale(\"request.missing.transcount\");\n }\n // throw message indicating that this field is date\n if( $this->post->isDate(\"startDate\",\"Y-m-d\" )==false){\n $errors[] = $this->Raxan->locale(\"request.missing.startdate\");\n }\n // throw message indicating that this field is date\n if( $this->post->isDate( \"endDate\",\"Y-m-d\" )==false ){\n $errors[] = $this->Raxan->locale(\"request.missing.enddate\");\n }\n\n if(!empty ($errors)) {\n $this->postMessage($errors, \"Request History\");\n }\n return (count($errors) == 0);\n }",
"function file_upload_successful()\n{\n $uploadSuccessful = true;\n\n foreach ($_FILES as $file)\n {\n //var_dump($file);\n if($file['name'])\n {\n if ($file['error'] > 0)\n {\n $uploadSuccessful = false;\n print_error_message('<p>Error uploading file ' . $file['name'] . ' !\n Please try again later or report a bug using the link in the Help menu.');\n }/*\n elseif ($file['type'] != 'text/plain')\n {\n $uploadSuccessful = false;\n print_error_message('Uploaded file ' . $file['name'] . ' type not supported!');\n }\n elseif (($file['size'] / 1024) > 20)\n {\n $uploadSuccessful = false;\n print_error_message('Uploaded file ' . $file['name'] . ' must be smaller than 10 MB!');\n }*/\n }\n\n\n }\n\n return $uploadSuccessful;\n}",
"public function isValid() : bool\n {\n return $this->status === UPLOAD_ERR_OK;\n }",
"abstract function check_data($formdata);",
"private function wasFileSent() : bool\n {\n return isset($_FILES[$this->fieldName]['name']) && !empty($_FILES[$this->fieldName]['name']);\n }",
"private function _handleFormPost()\n {\n // see submit.php\n // 'FILE_OBJECTS' => 'handle_file_post',\n // 'BASE64_ENCODED_FILE_OBJECTS' => 'handle_base64_encoded_file_post',\n // 'TRANSFER_IDS' => 'handle_transfer_ids_post'\n }",
"public function testUploadErrors() {\n\t\t$this->data['tmp_name'] = null;\n\n\t\ttry {\n\t\t\t$transit = new Transit($this->data);\n\t\t\t$transit->upload();\n\n\t\t\t$this->assertTrue(false);\n\n\t\t} catch (Exception $e) {\n\t\t\t$this->assertTrue(true);\n\t\t}\n\n\t\t$this->data['tmp_name'] = $this->tempFile;\n\t\t$this->data['error'] = 3;\n\n\t\ttry {\n\t\t\t$transit = new Transit($this->data);\n\t\t\t$transit->upload();\n\n\t\t\t$this->assertTrue(false);\n\n\t\t} catch (Exception $e) {\n\t\t\t$this->assertTrue(true);\n\t\t}\n\t}",
"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 isUploadedFile() {}",
"function check_file_error($file_error) {\nif ($file_error === 0) {\nreturn true;\n}else {\necho \"There is an error uploading the file\";\n}\n}",
"public function validate()\n\t{\n\t\tphpbb::$user->add_lang('posting');\n\n\t\t$error = array();\n\n\t\tif (utf8_clean_string($this->post_subject) === '')\n\t\t{\n\t\t\t$error[] = phpbb::$user->lang['EMPTY_SUBJECT'];\n\t\t}\n\n\t\t$this->post_subject = truncate_string($this->post_subject);\n\n\t\t$message_length = utf8_strlen($this->post_text);\n\n\t\tif ($message_length < (int) phpbb::$config['min_post_chars'])\n\t\t{\n\t\t\tif ($message_length)\n\t\t\t{\n\t\t\t\t$error[] = phpbb::$user->lang('CHARS_POST_CONTAINS', $message_length) . '<br />' .\n\t\t\t\t\tphpbb::$user->lang('TOO_FEW_CHARS_LIMIT', (int) phpbb::$config['min_post_chars']);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$error[] = phpbb::$user->lang['TOO_FEW_CHARS'];\n\t\t\t}\n\t\t}\n\t\telse if (phpbb::$config['max_post_chars'] != 0 && $message_length > (int) phpbb::$config['max_post_chars'])\n\t\t{\n\t\t\t$error[] = sprintf(phpbb::$user->lang['TOO_MANY_CHARS_POST'], $message_length, (int) phpbb::$config['max_post_chars']);\n\t\t}\n\n\t\treturn $error;\n\t}",
"function mvpm_upload_file(){\n check_ajax_referer( 'mvpm_system', 'security' );\n // && current_user_can( 'edit_post', $_POST['post_id']\n\n require_once( ABSPATH . 'wp-admin/includes/image.php' );\n require_once( ABSPATH . 'wp-admin/includes/file.php' );\n require_once( ABSPATH . 'wp-admin/includes/media.php' );\n \n\n // $file = $_REQUEST['entity'];\n\n // var_dump($_FILES['file']);\n\n // Undefined | Multiple Files | $_FILES Corruption Attack\n // If this request falls under any of them, treat it invalid.\n if (\n !isset($_FILES['file']['error']) ||\n is_array($_FILES['file']['error'])\n ) {\n throw new RuntimeException('Invalid parameters.');\n }\n\n // Check $_FILES['upfile']['error'] value.\n switch ($_FILES['file']['error']) {\n case UPLOAD_ERR_OK:\n break;\n case UPLOAD_ERR_NO_FILE:\n throw new RuntimeException('No file sent.');\n case UPLOAD_ERR_INI_SIZE:\n case UPLOAD_ERR_FORM_SIZE:\n throw new RuntimeException('Exceeded filesize limit.');\n default:\n throw new RuntimeException('Unknown errors.');\n }\n\n // You should also check filesize here. \n if (filesize($pdf_final) > 1000000) {\n throw new RuntimeException('Exceeded filesize limit.');\n }\n\n $attachment_id = media_handle_upload( 'file', 0 );\n \n if ( is_wp_error( $attachment_id ) ) {\n \n // There was an error uploading the image.\n echo '$attachement_id error';\n\n } else {\n \n // The image was uploaded successfully!\n $returnObj = [];\n $returnObj['file_id'] = $attachment_id;\n $returnObj['file_url'] = wp_get_attachment_url( $attachment_id );\n echo json_encode($returnObj);\n \n }\n\n wp_die();\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}",
"function validateFile($fieldname)\n{\n $error = '';\n if (!empty($_FILES[$fieldname]['error'])) {\n switch ($_FILES[$fieldname]['error']) {\n case '1':\n $error = 'Upload maximum file is 4 MB.';\n break;\n case '2':\n $error = 'File is too big, please upload with smaller size.';\n break;\n case '3':\n $error = 'File uploaded, but only halef of file.';\n break;\n case '4':\n $error = 'There is no File to upload';\n break;\n case '6':\n $error = 'Temporary folder not exists, Please try again.';\n break;\n case '7':\n $error = 'Failed to record File into disk.';\n break;\n case '8':\n $error = 'Upload file has been stop by extension.';\n break;\n case '999':\n default:\n $error = 'No error code avaiable';\n }\n } elseif (empty($_FILES[$fieldname]['tmp_name']) || $_FILES[$fieldname]['tmp_name'] == 'none') {\n $error = 'There is no File to upload.';\n } elseif ($_FILES[$fieldname]['size'] > FILE_UPLOAD_MAX_SIZE) {\n $error = 'Upload maximum file is '.number_format(FILE_UPLOAD_MAX_SIZE/1024,2).' MB.';\n } else {\n //$get_ext = substr($_FILES[$fieldname]['name'],strlen($_FILES[$fieldname]['name'])-3,3);\t\n $cekfileformat = check_file_type($_FILES[$fieldname]);\n if (!$cekfileformat) {\n $error = 'Upload File only allow (jpg, gif, png, pdf, doc, xls, xlsx, docx)';\n }\n }\n\n return $error;\n}",
"function validateUploadField(&$model, $fieldData, $fieldName) {\n if (empty($fieldData[$fieldName]) || !is_array($fieldData[$fieldName])) return false;\n return true;\n }",
"public function validate_post() {\n $validation = Validator::make($this->attributes, $this->rules);\n if ($validation->passes()) {\n return TRUE;\n }\n $this->errors = $validation->messages();\n return FALSE;\n }",
"private function _parseForm()\n {\n if( !empty( $this->boundary ) )\n {\n $chunks = @preg_split( '/[\\-]+'.$this->boundary.'(\\-\\-)?/', $this->input, -1, PREG_SPLIT_NO_EMPTY );\n $request = array();\n $files = array();\n $nd = 0;\n $nf = 0;\n\n if( is_array( $chunks ) )\n {\n foreach( $chunks as $index => $chunk )\n {\n $chunk = ltrim( $chunk, \"-\\r\\n\\t\\s \" );\n $lines = explode( \"\\r\\n\", $chunk );\n $levels = '';\n $name = '';\n $file = '';\n $type = '';\n $value = '';\n $path = '';\n $copy = false;\n\n // skip empty chunks\n if( empty( $chunk ) || empty( $lines ) ) continue;\n\n // extract name/filename\n if( strpos( $lines[0], 'Content-Disposition' ) !== false )\n {\n $line = $this->_line( array_shift( $lines ) );\n $name = $this->_value( @$line['name'], '', true );\n $file = $this->_value( @$line['filename'], '', true );\n }\n // extract content-type\n if( strpos( $lines[0], 'Content-Type' ) !== false )\n {\n $line = $this->_line( array_shift( $lines ) );\n $type = $this->_value( @$line['content'], '', true );\n }\n // rebuild value\n $value = trim( implode( \"\\r\\n\", $lines ) );\n\n // FILES data\n if( !empty( $type ) )\n {\n if( !empty( $value ) )\n {\n $path = str_replace( '\\\\', '/', sys_get_temp_dir() .'/php'. substr( sha1( rand() ), 0, 6 ) );\n $copy = file_put_contents( $path, $value );\n }\n if( preg_match( '/(\\[.*?\\])$/', $name, $tmp ) )\n {\n $name = str_replace( $tmp[1], '', $name );\n $levels = preg_replace( '/\\[\\]/', '['.$nf.']', $tmp[1] );\n }\n $files[ $name.'[name]'.$levels ] = $file;\n $files[ $name.'[type]'.$levels ] = $type;\n $files[ $name.'[tmp_name]'.$levels ] = $path;\n $files[ $name.'[error]'.$levels ] = !empty( $copy ) ? 0 : UPLOAD_ERR_NO_FILE;\n $files[ $name.'[size]'.$levels ] = !empty( $copy ) ? filesize( $path ) : 0;\n $nf++;\n }\n else // POST data\n {\n $name = preg_replace( '/\\[\\]/', '['.$nd.']', $name );\n $request[ $name ] = $value;\n $nd++;\n }\n }\n // finalize arrays\n $_REQUEST = array_merge( $_GET, $this->_data( $request ) );\n $_FILES = $this->_data( $files );\n return true;\n }\n }\n return false;\n }",
"public function store(Request $request)\n { /* إنشاء منشور جديد */\n\n\n $this->validate($request,[ // هذي داله فلديت تتحقق من انه لابد ان يكون الحقول في الاستمارة لاتكون فاضية\n // كل ماتعملة هذي الدالة هي إعادة صفحة عندما تكون الحقول فاضية محدد في مصفوفة\n 'body' => 'required', // الحد الاقصى للاحرف max:150\n ],\n [\n \n 'body.required'=>'لم يتم كتابة شيئاً',\n ]\n );\n $Post= new Post();\n $Post->body=$request->get('body'); \n $Post->user_id=auth()->user()->id;\n $Post->image_path=$request->get('filename');\n $Post->save();\n \n return redirect('post/'.$Post->id);\n \n \n\n// /* ----------------------------------------------------------------- */\n\n// // حفظ البيانات في قاعدة البيانات\n// if($request->hasfile('filename')) /* إذا تمتلك ملف مرفق شرط يعبر عن ذلك */\n// { // علشان عدل ع اسم صورة \n// $file = $request->file('filename');\n// $name=time().$file->getClientOriginalName();\n// //getClientOriginalName هذي الدالة تخلي اسم صورة حسب اللحظة الزمنية الذي ارتفع فيها صورة علشان لايوحد تشابهة \n// $file->move(public_path().'/images/posts', $name);\n// // خاص بالتطبيق يعني نقل صوره لهذا الاسم بعد التعديلات ع اسمها public الى مسار public_path الدالة \n// } \n// /* تعني اني بنشئ بيانات جديدة في قاعدة البيانات برسلها عبر نموذج البيانات */\n// $Post= new Post();\n// // كاني اقول له القيمة القديم اسندها لقيمة الجديدة في الحقل الجديد بستخدام مساواة \n// $Post->body=$request->get('body'); \n// /* name=\"\" هو نفسة الذي يكون اسم الحقل get('body') الذي يكون في هذي */\n// $Post->user_id=auth()->user()->id;\n// $Post->image_path=$name;\n// $Post->save();\n \n// return redirect('post/'.$Post->id);\n// /* new Post();: شرح ماذا عملت : عملت انا سجلت انشئ لي شيء جديد في نموذج البيانات عبر التالي : مع متغير\n// name=\"body\" ولازم يكون اسم الحقل get('body') ضيف له قيمة جديدة لاني في البداية سجلت نيو والقيمة الجديدة باتجي لك من حقل اسمة body بعدها قلت من نموذج البيانات عمود اسمة \n// */ \n }",
"public function validateFormData($data) {\n\n $errors = array();\n\n // twitter name\n if (strlen($data['twitterName']) < 1 || strlen($data['twitterName']) > 100) {\n $errors['twitterName'] = 'Full name is required and must be less than 100 characters.';\n }\n\n // twitter username\n if (!preg_match(\"/^[a-zA-Z0-9_]+$/\", $data['twitterUsername']) || strlen($data['twitterUsername']) < 1 || strlen($data['twitterUsername']) > 15) {\n $errors['twitterUsername'] = 'Username must only use letters, numbers, underscores, and be 15 or fewer characters in length.';\n }\n\n // cron key\n if (!preg_match(\"/^[a-zA-Z0-9_]+$/\", $data['cronKey']) || strlen($data['cronKey']) < 1 || strlen($data['cronKey']) > 50) {\n $errors['cronKey'] = 'The cron key must only use letters, numbers, underscores, and be 50 or fewer characters in length.';\n }\n\n // timezone\n if (!date_default_timezone_set($data['timezone'])) {\n $errors['timezone'] = 'Not a valid timezone.';\n }\n\n // database prefix\n if (!preg_match(\"/^[a-zA-Z0-9_]+$/\", $data['databasePrefix']) || strlen($data['databasePrefix']) < 1 || strlen($data['databasePrefix']) > 15) {\n $errors['databasePrefix'] = 'The database prefix must only use letters, numbers, underscores, and be 15 or fewer characters in length.';\n }\n\n // do one last check to require all fields without a specific check\n $requiredFields = array('twitterName', 'twitterUsername', 'consumerKey', 'consumerSecret', 'oauthToken', 'oauthSecret', 'baseUrl', 'timezone', 'cronKey', 'databaseHost', 'databaseDatabase', 'databaseUsername', 'databasePassword', 'databasePrefix');\n foreach ($requiredFields as $field) {\n if (!isset($errors[$field]) && strlen(trim($data[$field])) < 1) {\n $errors[$field] = 'This field is required.';\n }\n }\n\n return (count($errors)) ? $errors : false;\n\n }",
"public function step_2_manage_upload()\n {\n }",
"private function _hasPostContents($input)\n {\n return isset($_FILES[$input]) || isset($_POST[$input]);\n }",
"function _request_pj_valid(){\n\tif(isset($_FILES[\"piec_j\"])){\n\t\tif($_FILES[\"piec_j\"][\"name\"]){\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}",
"public function check(){\n\t\t\t//Inform the user that the file is being checked for validity\n\t\t\techo \"-->Checking for file validity.<br/>\";\n\t\t\t$allowed_extensions = array('csv','CSV');\t//Array containing valid csv extensions\t\n\t\t\t$csv_filename\t= $this->csv_file['name'];\t//Variable containing the name of the file\n\t\t\t$csv_size \t= $this->csv_file['size'];\t//Variable containing the size of the file\n\t\t\t$csv_extension \t= explode(\".\",$csv_filename);\t//Variable containing the extension of the file\n\t\t\t$max_file_size = 20; //MB\t\t\t//Variable containing the maximum allowed file size\n\t\t\t//Check if the file was posted, if it's less than 20MB, and if it has an allowed CSV extension\n\t\t\tif(empty($this->csv_file) || $csv_size > (20 * MB) || !in_array($csv_extension[1], $allowed_extensions)){\n\t\t\t\t//If the combined check fails\t\n\t\t\t\t$errors = \"\";\t//We create an error variable\n\t\t\t\tif(empty($this->csv_file)){\n\t\t\t\t\t//We check that a file was indeed selected for upload, and if not we append an error message\n\t\t\t\t\t//to the errors variable detailing the problem\n\t\t\t\t\t$errors .= \"Please make sure you select a CSV file for upload before attempting to upload.<br/>\";\n\t\t\t\t}\n\t\t\t\tif($csv_size > (20 * MB)){\n\t\t\t\t\t//We then check that the file is within the 20MB upload limit, and it it is not we append \n\t\t\t\t\t//a message detailing the problem to the error variable.\n\t\t\t\t\t$errors .= \"The maximum allowed filesize is \" . $max_file_size . \"MB, please select a smaller file.</br>\";\n\t\t\t\t}\n\t\t\t\tif(!in_array($csv_extension[1], $allowed_extensions)){\n\t\t\t\t\t//We then check that the file's extension is contained in the allowed extensions array\n\t\t\t\t\t//And if it is not, we advice the user that the extension is invalid and display the \n\t\t\t\t\t//allowed extensions for reference.\n\t\t\t\t\t$errors .= \"The file you are trying to upload has the extension '.\" . $csv_extension[1] . \"'.\";\n\t\t\t\t\t$errors .= \"The allowed extensions are:<br/>\";\n\t\t\t\t\tforeach($allowed_extensions as $ext){\n\t\t\t\t\t\t$errors .= \"<font color='orange'>.\" . $ext . \"</font><br/>\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//Then we display the combined error messages.\n\t\t\t\techo $errors;\n\t\t\t\t//And return false to indicate the file is invalid\n\t\t\t\treturn false;\n\t\t\t}else{\n\t\t\t\t//If the file passes all the checks, we inform the user that the file is a valid one\n\t\t\t\techo \"-->File is valid.<br/>\";\n\t\t\t\t//And return true to indicate the file is a valid one\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}",
"function attemptUpload() {\n\t\tif (isset($_POST['upload']) && $_POST['upload'] = 'true') {\n\t\t\techoBSAlertBox(2, \"\\t\", 'success', 'glyphicon-upload', 'Upload Started', 'We attempted an upload, details displayed bellow.');\n\t\t\t//for every file we attempted to upload, we build a alert box\n\t\t\tforeach($_FILES['myfile']['name'] as $key=>$name) {\n\t\t\t\tif (empty($name))\n\t\t\t\t\tcontinue;\n\t\t\t\t$result = handleUpload($key);\n\t\t\t\tif ($result['success'] == true) {\n\t\t\t\t\t//add to queue\n\t\t\t\t\t$addedToQueue = queue_add($result['result']);\n\t\t\t\t\techoBSAlertBox(2, \"\\t\", 'success', 'glyphicon-ok', 'Success', 'We successfully uploaded <a href=\"../../browse/image/source/?id='.$result['result'].'\">'.$name.\n\t\t\t\t\t\t\t'</a>, '.($addedToQueue ? 'added to processing queue' : 'not added to processing queue').'! <a href=\"../../browse/\">Click here to view the processing queue.</a>');\n\t\t\t\t} else {\n\t\t\t\t\techoBSAlertBox(2, \"\\t\", 'danger', 'glyphicon-exclamation-sign', 'Error', 'Unable to upload '.$name.', we had error: '.$result['result']);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public function upload_postAction() {\n\t\t$ret = Common::upload('img', 'qualification');\n\t\t$imgId = $this->getPost('imgId');\n\t\t$this->assign('imgId', $imgId);\n\t\t$this->assign('code', $ret['data']);\n\t\t$this->assign('msg', $ret['msg']);\n\t\t$this->assign('data', $ret['data']);\n\t\t$this->getView()->display('common/upload.phtml');\n\t\texit;\n\t}",
"function _device_can_upload()\n {\n }",
"function checkSize(){\n global $postpath;\n return (filesize($postpath) / 1000000) < 1;\n }",
"private function process_multimedia($post_data)\n {\n if($post_data[\"file_size\"] <= 1000000){\n $post_pic_upload_path = POST_PIC_UPLOAD_DIR.$post_data[\"file_name\"];\n try{\n file_put_contents($post_pic_upload_path,$post_data[\"file\"]);\n }catch(Exception $er){\n $this->stdout($er->getMessage());\n }\n\n //set the url for the uploaded picture\n $post_data[\"pic_url\"] = POST_PIC_UPLOAD_URL.$post_data[\"file_name\"];\n try{\n unset($post_data[\"file_size\"]);\n unset($post_data[\"file_name\"]);\n unset($post_data[\"file_type\"]);\n }catch(Exception $er){\n $this->stdout($er->getMessage());\n }\n\n return $post_data;\n }else{\n return false;\n }\n\n }",
"protected function checkPostUploadSizeIsHigherOrEqualMaximumFileUploadSize() {}",
"public function listingValidate($form){\n \n //verify form only in case it was posted\n //via \"create button\"\n \n if (!$form[\"add_postage\"]->submittedBy){\n $this->lHelp->formValidateValues($form);\n $images = $form->values['image'];\n $this->lHelp->imgUpload($images, $form);\n }\n }",
"protected function checkValidations($postData = false){\n\t\treturn true;\n\t}",
"function learndash_upload_essay() {\n\n\tif ( ! isset( $_POST['nonce'] ) || ! isset( $_POST['question_id'] ) || ! isset( $_FILES['essayUpload'] ) ) {\n\t\twp_send_json_error();\n\t\tdie();\n\t}\n\n\t$nonce = $_POST['nonce'];\n\t$question_id = intval( $_POST['question_id'] );\n\tif ( empty( $question_id ) ) {\n\t\twp_send_json_error();\n\t\tdie();\n\t}\n\n\t/**\n\t * Changes in v2.5.4 to include the question_id as part of the nonce\n\t */\n\tif ( ! wp_verify_nonce( $nonce, 'learndash-upload-essay-'. $question_id ) ) {\n\t\twp_send_json_error();\n\t\tdie( 'Security check' );\n\t} else {\n\n\t\tif ( !is_user_logged_in() ) {\n\t\t\tif ( !apply_filters('learndash_essay_upload_user_check', false, $question_id ) ) {\n\t\t\t\twp_send_json_error();\n\t\t\t\tdie();\n\t\t\t}\n\t\t}\n\n\t\t$file_desc = learndash_essay_fileupload_process( $_FILES['essayUpload'], $question_id );\n\n\t\tif ( ! empty( $file_desc ) ) {\n\t\t\twp_send_json_success( $file_desc );\n\t\t} else {\n\t\t\twp_send_json_error();\n\t\t}\n\t\tdie();\n\t}\n}",
"public function isUploaded() {\n\t\t$this->msg = '';\n\t\t\t//\tcheck if the name of the file uploaded is not available\n\t\tif (!$_FILES[$this->fileName]['name'])\t{\n\t\t\t$this->msg .= 'File name not available';\n\t\t\treturn false;\n\t\t}\n\n\t\t\n\t\t\t// tests for an error in uploading\n\t\tif ($_FILES[$this->fileName]['error']) {\t\n\t\t\tswitch($_FILES[$this->fileName]['error']) {\n\t\t\t\tcase 1: $this->msg .= 'Your image is too big!'; // exceeds PHP\\'s maximun upload size\n\t\t\t\t\treturn false;\n\t\t\t\tcase 2: $this->msg .= 'Your image is too large!'; // File exceeds maximum upload file size set in the form\n\t\t\t\t\treturn false;\n\t\t\t\tcase 3: $this->msg .= 'That only partially worked!'; // File partially uploaded\n\t\t\t\t\treturn false;\n\t\t\t\tcase 4: $this->msg .= 'Your file wasn\\'t uploaded!'; // No file upload\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t\n\t\t\t// check if file type is invalid\n\t\t$type = $_FILES[$this->fileName]['type'];\t//\tget the type of the uploaded file\n\t\tif (!in_array($type, $this->fileTypes)) {\n\t\t\t$this->msg .= 'Wrong file type';\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t\t// check if file did not reach the server\n\t\tif (!is_uploaded_file($_FILES[$this->fileName]['tmp_name'])) {\n\t\t\t$this->msg .= 'File did not reach the temporary location on the server';\n\t\t\treturn false;\n\t\t}\n\t\t$fleName = $_FILES[$this->fileName]['name'];\n\t\t$flePath = $this->folderPath ? $this->folderPath.'/'.$fleName : $fleName;\n\t\t\n\t\t\t// test if a file with the same name exists and rename it using a random generated (uniqid) if it does\n\t\tif (file_exists($flePath)) {\n\t\t\t$newName = uniqid('art').$fleName;\n\t\t\t$flePath = $this->folderPath ? $this->folderPath.'/'.$newName : $newName;\n\t\t}\n\n\t\t\t//move file from temporary location to the path specified and test if it's not successful\n\t\tif (!move_uploaded_file($_FILES[$this->fileName]['tmp_name'], $flePath)) {\t\n\t\t\t$this->msg .= 'Error in moving file to the specified location';\n\t\t\treturn false;\n\t\t}\n\t\t\t// check if new file does not exists in the destination folder\n\t\tif (!file_exists($flePath)) {\n\t\t\t$this->msg .= 'File did not reach the destination folder';\n\t\t\treturn false;\n\t\t}\n\t\t\t\t// all worked fine and returns the filepath\n\t\t\t$this->msg .= 'File '.$_FILES[$this->fileName]['name'].' uploaded successfully ';\n\t\t\treturn $flePath;\n\t\t}",
"public function menuuploadsavevenue(Request $request)\n {\n //press-kit\n \n //echo \"<pre>\"; print_r($_FILES);echo \"</pre>\";\n \n \n $id=0;\n $chkvalidimage=$this->menufileisinvalid($request,$id);\n \n $err_resp_msg=''; $respflg=0; $uploadedsuccnames=array(); $user_master_img_db=array();\n $slider_contents=''; $default_image_name='';\n $venuecretaeOredit=0;\n $nicknmres =0;\n $errormsgs=$chkvalidimage['errormsgs'];\n $errfileAr=$chkvalidimage['errfileAr'];\n $totalfileposted=$chkvalidimage['totalfileposted'];\n \n if ( empty($errormsgs) || (!empty($errormsgs) && (count($errfileAr)<$totalfileposted)) )\n {\n \n //**** file upload code starts\n \n \n $allowedFileExtAr=array();\n $allowedFileExtAr[]=\"pdf\";\n \n \n $filecontrolname=\"menu_name\";\n \n \n $allowedFileExtSizeAr=array();\n $allowedFileExtSizeAr['pdf']=(5*1024*1024); \n \n \n //max_width & max_height ,min_width & min_height,equal_width & equal_height \n $allowedFileResolAr=array();\n \n // $allowedFileResolAr['jpeg']=array('min_width'=>537,'min_height'=>507);\n \n $func=\"uploadfile\";//validatefile/uploadfile\n \n \n $destinationsourcePath=public_path().\"/upload/venue-menu/source-file/\"; \n \n $chkimgresp=Imageuploadlib::imageupload($request,$filecontrolname,$allowedFileExtAr,$allowedFileExtSizeAr,$allowedFileResolAr,$func,$addeditid=0,$destinationsourcePath,$errfileAr) ;\n \n \n //echo \"==Imcommonpath=>\".$Imcommonpath;\n //echo \"==chkimg1==><pre>\";\n //print_r($chkimgresp);\n //echo \"</pre>\"; //exit();\n \n if(!empty($chkimgresp))\n {\n $errormsgs=''; $fileuploadednames=array();\n \n if(array_key_exists('errormsgs',$chkimgresp))\n {\n $errormsgs=$chkimgresp['errormsgs'];\n }\n \n if(array_key_exists('fileuploadednames',$chkimgresp))\n {\n $fileuploadednames=$chkimgresp['fileuploadednames'];\n }\n \n if(!empty($fileuploadednames))\n {\n \n \n foreach($fileuploadednames as $fileuploadednameAr)\n {\n $presskitfileName=$fileuploadednameAr['filenamedata'];\n $uploadedsuccnames[]=$presskitfileName;\n } \n \n }\n \n }\n \n //**** file upload code ends\n \n \n //***** insert into user_presskit table starts\n \n //$uploadedsuccnames\n \n if(!empty($uploadedsuccnames))\n {\n $user_id=1;\n if ($request->session()->has('front_id_sess'))\n {\n $user_id=$request->session()->get('front_id_sess'); // get session \n $venueID = $this->getseo_name($user_id);\n }\n //**********check modifying date starts here\n $r = $this->check_modifying_date($venueID,$user_id);\n //IF MODIFYING DATE IS 1 THEN THIS IS FIRST TIME EDIT //*** update user_master table ends\n \n //*** check whether any prev presskit present starts\n $selectstr=\" upk.* \";\n \n $user_presskit_db=DB::table('venue_menu as upk'); \n $user_presskit_db=$user_presskit_db->select(DB::raw($selectstr)); \n $user_presskit_db=$user_presskit_db->where('upk.venue_id', $venueID); $user_presskit_db=$user_presskit_db->where('upk.v_creator_id', $user_id);\n \n $user_presskit_db = $user_presskit_db->skip(0)->take(1);\n $user_presskit_db=$user_presskit_db->first();\n $presskit_name='';\n if(!empty($user_presskit_db))\n {\n $presskit_name=stripslashes($user_presskit_db->menu_name);\n }\n \n //*** check whether any prev presskit present ends\n \n foreach($uploadedsuccnames as $user_presskit_name)\n {\n \n \n \n if(!empty($user_presskit_db))\n {\n //**** update qry\n \n $updtusrmstr= DB::table('venue_menu');\n $updtusrmstr= $updtusrmstr->where('venue_id',$venueID);\n $updtusrmstr= $updtusrmstr->where('v_creator_id',$user_id);\n $updtusrmstr=$updtusrmstr->update(\n ['menu_name' =>addslashes($user_presskit_name),\n 'create_date'=>date('Y-m-d H:i:s') \n ]\n );\n \n //*** unlink previous presslit file\n \n $srcpresskit=public_path().\"/upload/venue-menu/source-file/\".$presskit_name;\n \n @unlink($srcpresskit);\n \n \n }\n else\n {\n //**** insert qry\n \n $presskit_array=array(); \n \n $presskit_array['menu_name']=addslashes($user_presskit_name);\n $presskit_array['venue_id']=$venueID;\n $presskit_array['v_creator_id']=$user_id;\n $presskit_array['create_date']=date('Y-m-d H:i:s'); \n $chkupd= DB::table('venue_menu')->insert($presskit_array );\n $last_insert_id=DB::getPdo()->lastInsertId(); \n \n }\n \n \n \n \n \n }\n \n \n //if($r == 1)\n //{\n // $request->session()->flash('front_successmsgdata_sess', 'Your venue has been created successfully .');\n // //return redirect('/');\n // $venuecretaeOredit=1;\n // //**get nickname starts here\n // $nicknmres = $this->getnicknm($venueID,$user_id);\n // //**get nickname ends here\n // \n //}\n DB::table('venue_master')\n ->where('id', $venueID)\n ->update(['modified_date'=>date('Y-m-d H:i:s') ]); \n \n \n }\n \n \n //***** insert into user_presskit table ends\n \n \n \n }\n else\n {\n if(!empty($id))\n {\n \n //return redirect(ADMINSEPARATOR.'/banneradd/'.$id)\n //->withErrors($chkvalid)\n //->withInput();\n \n $err_resp_msg= $errormsgs;\n \n }\n else\n {\n //return redirect(ADMINSEPARATOR.'/banneradd')\n //->withErrors($chkvalid)\n //->withInput();\n \n $err_resp_msg= $errormsgs;\n }\n }\n \n \n if ( empty($errormsgs) || (!empty($errormsgs) && (count($errfileAr)<$totalfileposted)) )\n {\n $respflg=1;\n }\n if($r == 1)\n {\n $request->session()->flash('front_successmsgdata_sess', 'Your venue has been created successfully .');\n //return redirect('/');\n $venuecretaeOredit=1;\n //**get nickname starts here\n $nicknmres = $this->getnicknm($venueID,$user_id);\n //**get nickname ends here\n \n }\n \n \n \n $respAr=array();\n $respAr['venuecretaeedit']=$venuecretaeOredit;\n $respAr['nicknmdata']= $nicknmres;\n $respAr['flag']=$respflg;\n $respAr['errorespmsg']=$err_resp_msg;\n $respAr['errfileAr']=$errfileAr;\n $respAr['totalfileposted']=$totalfileposted;\n $respAr['uploadedsuccnames']=$uploadedsuccnames;\n \n //$respAr['user_master_img_db']=$user_master_img_db;\n // $respAr['chkimgresp']=$chkimgresp;\n echo json_encode($respAr);\n \n \n }"
] | [
"0.7506143",
"0.7306994",
"0.7103445",
"0.69544554",
"0.68072027",
"0.68011403",
"0.6665905",
"0.66209584",
"0.6618249",
"0.65432394",
"0.65400326",
"0.6499689",
"0.64729905",
"0.64278793",
"0.6414973",
"0.63373697",
"0.6299794",
"0.6289786",
"0.62694323",
"0.6243412",
"0.6231134",
"0.6231134",
"0.6214384",
"0.62076795",
"0.6179877",
"0.61773884",
"0.61773884",
"0.61773884",
"0.61773884",
"0.6173959",
"0.6172978",
"0.6170887",
"0.61685276",
"0.61660856",
"0.6160482",
"0.6151142",
"0.61490023",
"0.61363465",
"0.6125559",
"0.61184317",
"0.61117756",
"0.6107532",
"0.60889196",
"0.60850805",
"0.6084801",
"0.60810435",
"0.60718155",
"0.60327965",
"0.60204184",
"0.60049176",
"0.6003125",
"0.5976076",
"0.5958033",
"0.5950159",
"0.5949093",
"0.59481466",
"0.5942091",
"0.59375983",
"0.5926904",
"0.5922906",
"0.5906103",
"0.59031165",
"0.59030455",
"0.58972985",
"0.5895283",
"0.5892911",
"0.5877699",
"0.5876319",
"0.58721983",
"0.58587873",
"0.58576196",
"0.585664",
"0.58533907",
"0.5845059",
"0.58394015",
"0.5831057",
"0.5830357",
"0.5823701",
"0.58194655",
"0.58023614",
"0.58017683",
"0.5779732",
"0.57777905",
"0.5776563",
"0.5772613",
"0.57726073",
"0.57677037",
"0.5741335",
"0.5740458",
"0.5737484",
"0.57272947",
"0.5721775",
"0.57147217",
"0.5713544",
"0.5709373",
"0.5707891",
"0.5706036",
"0.570552",
"0.5703698",
"0.5701659"
] | 0.7168975 | 2 |
parses file upload error code into humanreadable phrase. | function getUploadErrorMessage($err) {
$msg = null;
switch ($err) {
case UPLOAD_ERR_OK:
break;
case UPLOAD_ERR_INI_SIZE:
$msg = ('The uploaded file exceeds the upload_max_filesize directive ('.ini_get('upload_max_filesize').') in php.ini.');
break;
case UPLOAD_ERR_FORM_SIZE:
$msg = ('The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form.');
break;
case UPLOAD_ERR_PARTIAL:
$msg = ('The uploaded file was only partially uploaded.');
break;
case UPLOAD_ERR_NO_FILE:
$msg = ('No file was uploaded.');
break;
case UPLOAD_ERR_NO_TMP_DIR:
$msg = ('The remote server has no temporary folder for file uploads.');
break;
case UPLOAD_ERR_CANT_WRITE:
$msg = ('Failed to write file to disk.');
break;
default:
$msg = ('Unknown File Error. Check php.ini settings.');
}
return $msg;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function get_upload_error_message($error_code) {\n switch ($error_code) {\n case UPLOAD_ERR_OK:\n $error_message = lang('File uploaded successfully');\n break;\n \n case UPLOAD_ERR_INI_SIZE:\n $error_message = lang('The uploaded file exceeds the upload_max_filesize directive in php.ini');\n break;\n \n case UPLOAD_ERR_FORM_SIZE:\n $error_message = lang('The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form');\n break;\n \n case UPLOAD_ERR_PARTIAL:\n $error_message = lang('The uploaded file was only partially uploaded');\n break;\n \n case UPLOAD_ERR_NO_FILE:\n $error_message = lang('No file was uploaded');\n break;\n \n case UPLOAD_ERR_NO_TMP_DIR:\n $error_message = lang('Missing a temporary folder');\n break;\n \n case UPLOAD_ERR_CANT_WRITE:\n $error_message = lang('Failed to write file to disk');\n break;\n \n case UPLOAD_ERR_EXTENSION:\n $error_message = lang('A PHP extension stopped the file upload');\n break;\n \n default:\n $error_message = lang('Unknown upload error occurred');\n break;\n }\n \n return $error_message;\n }",
"protected function file_upload_error_message($error_code) \n {\n switch ($error_code) { \n case UPLOAD_ERR_INI_SIZE: \n return 'The uploaded file exceeds the upload_max_filesize directive in php.ini'; \n case UPLOAD_ERR_FORM_SIZE: \n return 'The uploaded file exceeds the maximum file size (MAX_FILE_SIZE).'; \n case UPLOAD_ERR_PARTIAL: \n return 'The uploaded file was only partially uploaded'; \n case UPLOAD_ERR_NO_FILE: \n return 'No file was uploaded'; \n case UPLOAD_ERR_NO_TMP_DIR: \n return 'Missing a temporary folder'; \n case UPLOAD_ERR_CANT_WRITE: \n return 'Failed to write file to disk'; \n case UPLOAD_ERR_EXTENSION: \n return 'File upload stopped by extension'; \n default: \n return 'Unknown upload error'; \n } \n }",
"public function getError() : string {\n\t\t\treturn match ($this->error) {\n\t\t\t\tUPLOAD_ERR_OK => \"Upload completed successfully.\",\n\t\t\t\tUPLOAD_ERR_INI_SIZE => \"Upload exceeded maximum file size on server\",\n\t\t\t\tUPLOAD_ERR_FORM_SIZE => \"Upload exceeded maximum file size in browser\",\n\t\t\t\tUPLOAD_ERR_PARTIAL => \"Upload didn't complete\",\n\t\t\t\tUPLOAD_ERR_NO_FILE => \"No file was uploaded\",\n\t\t\t\tUPLOAD_ERR_NO_TMP_DIR => \"Missing temporary folder on server\",\n\t\t\t\tUPLOAD_ERR_CANT_WRITE => \"Failed to write upload to disk\",\n\t\t\t\tUPLOAD_ERR_EXTENSION => \"A server extension stopped the upload\",\n\t\t\t\tdefault => \"Unknown error code during file upload\",\n\t\t\t};\n\t\t}",
"protected function getUploadError($code)\n {\n switch ($code) {\n case UPLOAD_ERR_INI_SIZE:\n case UPLOAD_ERR_FORM_SIZE:\n return 'File too large.';\n case UPLOAD_ERR_PARTIAL:\n return 'File upload was not completed.';\n case UPLOAD_ERR_NO_FILE:\n return 'No file was uploaded.';\n case UPLOAD_ERR_NO_TMP_DIR:\n return 'Temporary folder missing.';\n case UPLOAD_ERR_CANT_WRITE:\n return 'Failed to write to disk';\n case UPLOAD_ERR_EXTENSION:\n return 'A PHP extension stopped the file upload.';\n case UPLOAD_ERR_OK:\n default:\n return 'OK';\n }\n }",
"public function getErrorMessage() {\n $message = \"File uploaded without errors\";\n $errCode = $this->getErrorCode();\n if ( $errCode == UPLOAD_ERR_OK ) {\n $message = \"File uploaded without errors\";\n } elseif ( $errCode == UPLOAD_ERR_INI_SIZE ) {\n $message = \"File size exceeds the max file size defined in php.ini \";\n } elseif ( $errCode == UPLOAD_ERR_FORM_SIZE ) {\n $message = \"File size exceeds the MAX_FILE_SIZE defined in form\";\n } elseif ( $errCode == UPLOAD_ERR_PARTIAL ) {\n $message = \"The file was partially uploaded\";\n } elseif ( $errCode == UPLOAD_ERR_NO_FILE ) {\n $message = \"No file was uploaded, you probably clicked upload without pointing to a file first\";\n } elseif ( $errCode == UPLOAD_ERR_NO_TMP_DIR ) {\n $message = \"Missing a temp directory. Check if php.ini defines an upload_tmp_dir\";\n } elseif ( $errCode == UPLOAD_ERR_CANT_WRITE ) {\n $message = \"PHP was unable to write file to disk. Check destination folder's file permissions. You should enable read & write.\";\n } elseif ( $errCode == UPLOAD_ERR_EXTENSION ) {\n $message = \"A PHP extension stopped the file upload. It's probably time to consult google and the php forums...\";\n } elseif ( $errCode == self::$TYPE_ERROR ) {\n $message = \"The supplied filetype is not accepted for upload\";\n }\n return $message;\n }",
"function getErrorString()\r\n\t{\r\n\t\tswitch( $this->error ) {\r\n\t\tcase UPLOAD_ERR_INI_SIZE: return \"The uploaded file exceeds the upload_max_filesize directive in php.ini\";\r\n\t\tcase UPLOAD_ERR_FORM_SIZE: return \"The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form.\";\r\n\t\tcase UPLOAD_ERR_PARTIAL: return \"The uploaded file was only partially uploaded.\";\r\n\t\tcase UPLOAD_ERR_NO_FILE: return \"No file was uploaded.\";\r\n\t\tcase UPLOAD_ERR_NO_TMP_DIR: return \"Missing a temporary folder. Introduced in PHP 4.3.10 and PHP 5.0.3.\";\r\n\t\tcase UPLOAD_ERR_CANT_WRITE: return \"Failed to write file to disk. Introduced in PHP 5.1.0.\";\r\n\t\tcase UPLOAD_ERR_EXTENSION: return \"File upload stopped by extension. Introduced in PHP 5.2.0.\";\r\n\t\t}\r\n\t\treturn \"Success\";\r\n\t}",
"function php_upload_error($code)\n{\n\t $message = \"\";\n\t \n switch ($code) {\n case UPLOAD_ERR_INI_SIZE:\n $message = \"The uploaded file exceeds the upload_max_filesize directive in php.ini\";\n break;\n case UPLOAD_ERR_FORM_SIZE:\n $message = \"The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form\";\n break;\n case UPLOAD_ERR_PARTIAL:\n $message = \"The uploaded file was only partially uploaded\";\n break;\n case UPLOAD_ERR_NO_FILE:\n $message = \"No file was uploaded\";\n break;\n case UPLOAD_ERR_NO_TMP_DIR:\n $message = \"Missing a temporary folder\";\n break;\n case UPLOAD_ERR_CANT_WRITE:\n $message = \"Failed to write file to disk\";\n break;\n case UPLOAD_ERR_EXTENSION:\n $message = \"File upload stopped by extension\";\n break;\n\n default:\n $message = \"Unknown upload error\";\n break;\n }\n return \"<p class='alert alert-danger'>$message</p>\";\n}",
"private function codeToMessage($code)\r\n {\r\n switch ($code) {\r\n case UPLOAD_ERR_INI_SIZE:\r\n $message = 'Max file size is '. ini_get(\"upload_max_filesize\");\r\n break;\r\n case UPLOAD_ERR_FORM_SIZE:\r\n $message = \"The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form\";\r\n break;\r\n case UPLOAD_ERR_PARTIAL:\r\n $message = \"The uploaded file was only partially uploaded\";\r\n break;\r\n case UPLOAD_ERR_NO_FILE:\r\n $message = \"No file was uploaded\";\r\n break;\r\n case UPLOAD_ERR_NO_TMP_DIR:\r\n $message = \"Missing a temporary folder\";\r\n break;\r\n case UPLOAD_ERR_CANT_WRITE:\r\n $message = \"Failed to write file to disk\";\r\n break;\r\n case UPLOAD_ERR_EXTENSION:\r\n $message = \"File upload stopped by extension\";\r\n break;\r\n\r\n default:\r\n $message = \"Unknown upload error\";\r\n break;\r\n }\r\n return $message;\r\n }",
"protected static function getError($code) {\n\n\t\tswitch ($code) {\n\t\t\tcase UPLOAD_ERR_OK:\n\t\t\t\treturn false;\n\t\t\tcase UPLOAD_ERR_NO_FILE:\n\t\t\t\treturn elgg_echo('upload:error:no_file');\n\t\t\tcase UPLOAD_ERR_INI_SIZE:\n\t\t\tcase UPLOAD_ERR_FORM_SIZE:\n\t\t\t\treturn elgg_echo('upload:error:file_size');\n\t\t\tdefault:\n\t\t\t\treturn elgg_echo('upload:error:unknown');\n\t\t}\n\t}",
"function upload_errors($err_code) {\r\n switch ($err_code) {\r\n case UPLOAD_ERR_INI_SIZE:\r\n return 'The uploaded file exceeds the upload_max_filesize directive in php.ini';\r\n case UPLOAD_ERR_FORM_SIZE:\r\n return 'The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form';\r\n case UPLOAD_ERR_PARTIAL:\r\n return 'The uploaded file was only partially uploaded';\r\n case UPLOAD_ERR_NO_FILE:\r\n return 'No file was uploaded';\r\n case UPLOAD_ERR_NO_TMP_DIR:\r\n return 'Missing a temporary folder';\r\n case UPLOAD_ERR_CANT_WRITE:\r\n return 'Failed to write file to disk';\r\n case UPLOAD_ERR_EXTENSION:\r\n return 'File upload stopped by extension';\r\n default:\r\n return 'Unknown upload error';\r\n }\r\n}",
"function defineErrorCode(int $errorCode) : string {\n $errors = [\n 0 => 'There is no error, the file uploaded with success',\n 1 => 'The uploaded file exceeds the upload_max_filesize directive in php.ini',\n 2 => 'The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form',\n 3 => 'The uploaded file was only partially uploaded',\n 4 => 'No file was uploaded',\n 6 => 'Missing a temporary folder',\n 7 => 'Failed to write file to disk.',\n 8 => 'A PHP extension stopped the file upload.',\n ];\n\n return $errors[$errorCode];\n}",
"public function getErrorMessage(): string\n {\n static $errors = [\n UPLOAD_ERR_OK => 'No error found.',\n UPLOAD_ERR_INI_SIZE => 'The file \"%s\" exceeds your upload_max_filesize ini directive (limit is %d kb).',\n UPLOAD_ERR_FORM_SIZE => 'The file \"%s\" exceeds the upload limit defined in your form.',\n UPLOAD_ERR_PARTIAL => 'The file \"%s\" was only partially uploaded.',\n UPLOAD_ERR_NO_FILE => 'No file was uploaded.',\n UPLOAD_ERR_CANT_WRITE => 'The file \"%s\" could not be written on disk.',\n UPLOAD_ERR_NO_TMP_DIR => 'File could not be uploaded: missing temporary directory.',\n UPLOAD_ERR_EXTENSION => 'File upload was stopped by a PHP extension.',\n ];\n\n $errorCode = $this->error;\n $maxFilesize = $errorCode === UPLOAD_ERR_INI_SIZE ? self::getMaxFilesize() / 1024 : 0;\n $message = $errors[$errorCode] ?? 'The file \"%s\" was not uploaded due to an unknown error.';\n\n return sprintf($message, $this->getOriginalName(), $maxFilesize);\n }",
"public function checkError($code)\n {\n $message = null;\n switch ($code) {\n case UPLOAD_ERR_INI_SIZE:\n $message = \"The uploaded file exceeds the upload_max_filesize directive in php.ini\";\n break;\n case UPLOAD_ERR_FORM_SIZE:\n $message = \"The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form\";\n break;\n case UPLOAD_ERR_PARTIAL:\n $message = \"The uploaded file was only partially uploaded\";\n break;\n case UPLOAD_ERR_NO_FILE:\n $message = \"No file was uploaded\";\n break;\n case UPLOAD_ERR_NO_TMP_DIR:\n $message = \"Missing a temporary folder\";\n break;\n case UPLOAD_ERR_CANT_WRITE:\n $message = \"Failed to write file to disk\";\n break;\n case UPLOAD_ERR_EXTENSION:\n $message = \"File upload stopped by extension\";\n break;\n\n }\n return $message;\n }",
"public function errorToMessage() {\n\t\t if($_FILES[$this->fileName]['error'] == 3) {\n\t\t\tif (file_exists($this->imgRoot . $_FILES[$this->fileName]['name'])) {\n\t\t\t\t//Remove the wrong file that is not completed.\n\t\t\t\tunlink($this->imgRoot . $_FILES[$this->fileName]['name']);\n\t\t\t}\t\n\t\t\treturn self::$ErrorUPLOAD_ERR_NO_TMP_DIR;\n\t\t }\n\t\t\t// error message 2 & 3 for the file is big or the file length is bigger than is php ini supported.\n\t else if($_FILES[$this->fileName]['error'] == 2 || $_FILES[$this->fileName]['error'] == 1) {\n\t\t\t\treturn self::$ErrorUPLOAD_ERR_FORM_SIZE;\n\t\t\t}\n\t\t\t// error file 4 is that the user trying to upload widthout file.\n\t else if($_FILES[$this->fileName]['error'] == 4) {\n\t\t \treturn self::$ErrorUPLOAD_ERR_NO_FILE;\n\t\t }\n\t\n \t}",
"public function file_error_message( $key ) {\n\t\tif ( $this->file_info( $key ) ) {\n\t\t\treturn '';\n\t\t} elseif ( ! isset( $_FILES[ $key ] ) ) {\n\t\t\treturn $this->__( 'File is not specified.' );\n\t\t} else {\n\t\t\tswitch ( $_FILES[ $key ]['error'] ) {\n\t\t\t\tcase UPLOAD_ERR_FORM_SIZE:\n\t\t\t\tcase UPLOAD_ERR_INI_SIZE:\n\t\t\t\t\treturn $this->__( 'Uploaded file size exceeds allowed limit.' );\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\treturn $this->__( 'Failed to upload' );\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}",
"function getErrorText($code){\n $errorText = array(\"good\",\"account not existed\",\"insufficient fund\",\"invalid account format\",\"duplicate account record\",\"invalid tranzaction format\",\"unknown error\");\n return $errorText[$code];\n }",
"protected function message(int $code): string\n {\n switch ($code) {\n case 0:\n return 'No error';\n case 1:\n return 'Multi-disk zip archives not supported';\n case 2:\n return 'Renaming temporary file failed';\n case 3:\n return 'Closing zip archive failed';\n case 4:\n return 'Seek error';\n case 5:\n return 'Read error';\n case 6:\n return 'Write error';\n case 7:\n return 'CRC error';\n case 8:\n return 'Containing zip archive was closed';\n case 9:\n return 'No such file';\n case 10:\n return 'File already exists';\n case 11:\n return 'Can\\'t open file';\n case 12:\n return 'Failure to create temporary file';\n case 13:\n return 'Zlib error';\n case 14:\n return 'Malloc failure';\n case 15:\n return 'Entry has been changed';\n case 16:\n return 'Compression method not supported';\n case 17:\n return 'Premature EOF';\n case 18:\n return 'Invalid argument';\n case 19:\n return 'Not a zip archive';\n case 20:\n return 'Internal error';\n case 21:\n return 'Zip archive inconsistent';\n case 22:\n return 'Can\\'t remove file';\n case 23:\n return 'Entry has been deleted';\n default:\n return 'An unknown error has occurred(' . intval($code) . ')';\n }\n }",
"function error($code) {\n\tswitch ($code) {\n\t\tcase 'EntityExists':\n\t\t\t$str = 'Cannot complete that action because the entity already exists';\n\t\t\tbreak;\n\t\tcase 'EntityDoesNotExist':\n\t\t\t$str = 'Cannot complete that action because that entity does not exist';\n\t\t\tbreak;\n\t\tcase 'InvalidPassword':\n\t\t\t$str = 'The password supplied is not valid';\n\t\t\tbreak;\n\t\tdefault:\n\t\t\t$str = $code;\n\t}\n\treturn $str;\n}",
"function get_error( $errorCode )\n {\n switch ( $errorCode ) {\n case 'ERRORSAVE':\n $error = 'There was a problem adding or updating the record(s)';\n break;\n case 'ERRORDELETE':\n $error = 'There was a problem deleting the record(s).';\n break;\n case 'ERRORPAGEEXISTS':\n $error = 'The page already exists.';\n break;\n case 'ERRORPAGENOTFOUND':\n $error = 'The selected page cannot be found.';\n break;\n default:\n $error = 'An error has occurred.';\n\n }\n\n return $error;\n }",
"public function message()\n {\n return 'The uploaded encode document string is invalid.';\n }",
"public static function get_error($p_file)\r\n {\r\n switch ($_FILES[$p_file]['error'])\r\n {\r\n case UPLOAD_ERR_INI_SIZE:\r\n return _L('LC__UNIVERSAL__FILE_UPLOAD__FILE_SIZE_TOO_BIG');\r\n\r\n case UPLOAD_ERR_FORM_SIZE:\r\n return _L('LC__UNIVERSAL__FILE_UPLOAD__FILE_SIZE_TOO_BIG');\r\n\r\n case UPLOAD_ERR_PARTIAL:\r\n return _L('LC__UNIVERSAL__FILE_UPLOAD__FILE_UPLOADED_PARTIALLY');\r\n\r\n case UPLOAD_ERR_NO_FILE:\r\n return _L('LC__UNIVERSAL__FILE_UPLOAD__NO_FILE_SELECTED');\r\n\r\n case UPLOAD_ERR_NO_TMP_DIR:\r\n return _L('LC__UNIVERSAL__FILE_UPLOAD__NO_TMP_DIR');\r\n\r\n case UPLOAD_ERR_CANT_WRITE:\r\n return _L('LC__UNIVERSAL__FILE_UPLOAD__NO_WRITE_PERMISSIONS');\r\n\r\n case UPLOAD_ERR_EXTENSION:\r\n return _L('LC__UNIVERSAL__FILE_UPLOAD__EXTENSION_ERROR');\r\n\r\n default:\r\n case UPLOAD_ERR_OK:\r\n return false;\r\n } // switch\r\n }",
"function massattach_error($error_code, $filepath = '')\n{\n\tglobal $txt, $language;\n\n\tif (!empty($filepath))\n\t\t@unlink($filepath);\n\n\tloadLanguage(array('Errors', 'Post'), $language);\n\techo json_encode(array('valid' => false, 'error' => isset($txt[$error_code]) ? $txt[$error_code] : $error_code));\n\texit;\n}",
"protected function getErrorMessage($file) {\n switch ($file['error']) {\n case 1:\n case 2:\n $this->_messages[] = '3' . $file['name'] . ' exceeds the max upload size: (max: ' .\n $this->getMaxSize() . ').';\n break;\n case 3:\n $this->_messages[] = '4' . $file['name'] . ' was only partially uploaded.';\n break;\n case 4:\n $this->_messages[] = '4 No file submitted.';\n break;\n default:\n $this->_messages[] = '4 There was a problem uploading ' . $file['name'];\n break;\n }\n }",
"public function errorString($code) {\n \n if(!is_numeric($code)) {\n return false;\n }\n\n $code = (int)$code;\n \n switch($code) {\n case 0: \n return \"Operation was successful\";\n case 247: \n return \"The userid provided is absent, or incorrect\";\n case 250: \n return \"The provided userid and/or Oauth credentials do not match\";\n case 286: \n return \"No such subscription was found\";\n case 293: \n return \"The callback URL is either absent or incorrect\";\n case 294: \n return \"No such subscription could be deleted\";\n case 304: \n return \"The comment is either absent or incorrect\";\n case 305: \n return \"Too many notifications are already set\";\n case 342: \n return \"The signature (using Oauth) is invalid\";\n case 343: \n return \"Wrong Notification Callback Url don't exist\";\n case 601: \n return \"Too Many Request\";\n case 2554: \n return \"Wrong action or wrong webservice\";\n case 2555: \n return \"An unknown error occurred\";\n case 2556: \n return \"Service is not defined\";\n }\n \n return false;\n }",
"public function getErrorMessageByCode($code): string\n {\n switch ($code) {\n case 400:\n {\n return 'Requisição Mal Formada';\n }\n case 401:\n {\n return 'Usuário não autorizado';\n }\n case 403:\n {\n return 'Acesso não autorizado';\n }\n case 404:\n {\n return 'Recurso não Encontrado';\n }\n case 405:\n {\n return 'Operação não suportada';\n }\n case 408:\n {\n return 'Tempo esgotado para a requisição';\n }\n case 409:\n {\n return 'Recurso em conflito';\n }\n case 413:\n {\n return 'Requisição excede o tamanho máximo permitido';\n }\n case 415:\n {\n return 'Content-type inválido';\n }\n case 422:\n {\n return 'Não foi possível processar as instruções contidas na requisição';\n }\n case 429:\n {\n return 'Requisição excede a quantidade máxima de chamadas permitidas à API.';\n }\n case 500:\n {\n return 'Erro na API';\n }\n }\n }",
"public function errorcode();",
"public function wrongTypeFile()\n {\n return 'This type of file is not allowed';\n }",
"function check_file_error($file_error) {\nif ($file_error === 0) {\nreturn true;\n}else {\necho \"There is an error uploading the file\";\n}\n}",
"function _uc_parsian_error_translate($code) {\n switch ($code) {\n case 20:\n case 22:\n return t('@code - Invalid PIN or IP.', array(\n '@code' => $code,\n ));\n\n case 30:\n return t('@code - The operation has been done previously.', array(\n '@code' => $code,\n ));\n\n case 34:\n return t('@code - Invalid transaction number.', array(\n '@code' => $code,\n ));\n\n default:\n return t('@code - Unknown status code. Refer to your technical documentation or contact Parsian bank support.', array(\n '@code' => $code,\n ));\n }\n}",
"final public function error_get() : string{\r\n return (string) ($this->code != 0) ? \"[<b>{$this->code}</b>]: \".$this->message : $this->message;\r\n }",
"public function message()\n {\n return '资源mime类型错误';\n }",
"function wp_show_heic_upload_error($plupload_settings)\n {\n }",
"function _getValidationCode()\n {\n $code = \"$('#error_file').html('').parent().hide();\\n\";\n $code .= \"if(!$('#imgFile').val()) {\";\n $code .= \"$('#error_file').html('You must select an image file');\\n\";\n $code .= \"$('#error_file').parent().show();\\n\";\n $code .= \"error = true;}\\n\";\n\n //TODO: Make this a setting in an essay\n //$code .= \"$('#error_text').html('').parent().hide();\\n\";\n // $code .= \"if(getWordCount('textEdit') > 150) {\";\n // $code .= \"$('#error_text').html('Your text can not be longer than 100 words. (Note: Some editors add phantom characters to your document, try cleaning the text by copying it into a program like notepad then pasting it in if you feel you receive this message in error)');\\n\";\n // $code .= \"$('#error_text').parent().show();\\n\";\n // $code .= \"error = true;}\";\n return $code;\n }",
"public static function getErrorMessage(int $code): string\n {\n return sprintf(\n '%s - Error Code = [%d]'\n , self::$errors[$code]\n , $code\n );\n }",
"public function message()\n {\n return 'Must upload file.';\n }",
"function get_error()\n\t{\n\t\t$errorfile = @fopen($this->srfile, 'r');\n\n\t\t// read status file\n\t\tif (!$errorfile)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\telse\n\t\t{\n\t\t\twhile (false === feof($errorfile))\n\t\t\t{\n\t\t\t\t$errorcodes .= fread($errorfile, 1024);\n\t\t\t}\n\n\t\t\tfclose($errorfile);\n\t\t}\n\n\t\tif ($errorcodes)\n\t\t{\n\t\t\tif ($this->engine->db->gpg_debug)\n\t\t\t{\n\t\t\t\treturn nl2br(\"WackoWiki-GPG terminated, error output follows:\\n------\\n\" .\n\t\t\t\tstr_replace(\"\\r\", '', $errorcodes));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn GPG_GENERAL_ERROR;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}",
"public function errorCode();",
"public function errorCode();",
"public function get_error_code()\n {\n }",
"function _upload_error($error_message, $file_info = array())\n\t{\n\t\tif (isset($file_info['file_id']))\n\t\t{\n\t\t\tee()->load->model('file_model');\n\t\t\tee()->file_model->delete_files($file_info['file_id']);\n\t\t}\n\t\telse if (isset($file_info['file_name']) AND isset($file_info['directory_id']))\n\t\t{\n\t\t\tee()->load->model('file_model');\n\t\t\tee()->file_model->delete_raw_file($file_info['file_name'], $file_info['directory_id']);\n\t\t}\n\n\t\treturn array('error' => $error_message);\n\t}",
"public function errorCode() {}",
"public static function getErrorString( $message, $code = 0, $file = 'Unknown', $line = 'Unknown' ) { \n if( self::$_debug ) {\n\t\t\treturn $message .= ' ( DEBUG: Error code[' . $code . '], traced to file '.$file.' on line '.$line.' )';\n\t\t}\n\t\treturn $message;\n }",
"public function errorCode(): string\n {\n $error = $this->errorInfo();\n\n return $error[0];\n }",
"public function getErrorCode()\n {\n return $this->getInput('error_code');\n }",
"function upload_error($error)\n{\n\techo json_encode(array(\"error\"=>$error));\n}",
"public function message()\n {\n if ($this->error['type'] === 'custom') {\n return $this->error['message'];\n }\n\n $messages = null;\n\n if ($this->request) {\n $messages = $this->request->messages();\n }\n\n $message = $messages[\"{$this->error['attribute']}.check_file_{$this->error['type']}\"] ??\n trans(\"validation.check_file_{$this->error['type']}\");\n\n [$keys, $values] = Arr::divide($this->error['payload'] ?? []);\n\n $keys = \\array_map(function (string $key) {\n return \":{$key}\";\n }, $keys);\n\n return \\str_replace($keys, $values, $message);\n }",
"public static function type( $code ) {\n\t\t// -- Get the proper message based on HTTP status code\n\t\tswitch( $code ) {\n\t\t\tcase Error::$not_found: \n\t\t\t\treturn Error::missing(); \n\t\t\tbreak;\n\n\t\t\tcase Error::$internal: \n\t\t\t\treturn Error::internal(); \n\t\t\tbreak;\n\t\t}\n\t}",
"public function errorType($code)\n {\n switch($code)\n {\n case E_ERROR: // 1 //\n return 'E_ERROR';\n case E_WARNING: // 2 //\n return 'E_WARNING';\n case E_PARSE: // 4 //\n return 'E_PARSE';\n case E_NOTICE: // 8 //\n return 'E_NOTICE';\n case E_CORE_ERROR: // 16 //\n return 'E_CORE_ERROR';\n case E_CORE_WARNING: // 32 //\n return 'E_CORE_WARNING';\n case E_COMPILE_ERROR: // 64 //\n return 'E_COMPILE_ERROR';\n case E_COMPILE_WARNING: // 128 //\n return 'E_COMPILE_WARNING';\n case E_USER_ERROR: // 256 //\n return 'E_USER_ERROR';\n case E_USER_WARNING: // 512 //\n return 'E_USER_WARNING';\n case E_USER_NOTICE: // 1024 //\n return 'E_USER_NOTICE';\n case E_STRICT: // 2048 //\n return 'E_STRICT';\n case E_RECOVERABLE_ERROR: // 4096 //\n return 'E_RECOVERABLE_ERROR';\n case E_DEPRECATED: // 8192 //\n return 'E_DEPRECATED';\n case E_USER_DEPRECATED: // 16384 //\n return 'E_USER_DEPRECATED';\n }\n return \"\";\n }",
"static public function errorCode($code)\n {\n http_response_code($code);\n\n $filename = APP . '/views/errors/' . $code . '.php';\n\n if (file_exists($filename)) require $filename;\n else if (IS_DEV) throw new \\Exception('file [$filename] is not found!');\n\n exit;\n }",
"function error(string $code): string\n{\n header('HTTP/1.0 404 Not Found');\n $fileName = $code . '.view.php';\n $path = ERROR_VIEWS_PATH . $fileName;\n return getContent($path);\n}",
"function http_get_response_code_error($code)\n\t{\n\t\t$errors = array(\n\t\t200 => 'Success - The request was successful',\n\t\t201 => 'Created (Success) - The request was successful. The requested object/resource was created.',\n\t\t400 => 'Invalid Request - There are many possible causes for this error, but most commonly there is a problem with the structure or content of XML your application provided. Carefully review your XML. One simple test approach is to perform a GET on a URI and use the GET response as an input to a PUT for the same resource. With minor modifications, the input can be used for a POST as well.',\n\t\t401 => 'Unauthorized - This is an authentication problem. Primary reason is that the API call has either not provided a valid API Key, Account Owner Name and Associated Password or the API call attempted to access a resource (URI) which does not match the same as the Account Owner provided in the login credientials.',\n\t\t404 => 'URL Not Found - The URI which was provided was incorrect. Compare the URI you provided with the documented URIs. Start here.',\n\t\t409 => 'Conflict - There is a problem with the action you are trying to perform. Commonly, you are trying to \"Create\" (POST) a resource which already exists such as a Contact List or Email Address that already exists. In general, if a resource already exists, an application can \"Update\" the resource with a \"PUT\" request for that resource.',\n\t\t415 => 'Unsupported Media Type - The Media Type (Content Type) of the data you are sending does not match the expected Content Type for the specific action you are performing on the specific Resource you are acting on. Often this is due to an error in the content-type you define for your HTTP invocation (GET, PUT, POST). You will also get this error message if you are invoking a method (PUT, POST, DELETE) which is not supported for the Resource (URI) you are referencing.\n\t\tTo understand which methods are supported for each resource, and which content-type is expected, see the documentation for that Resource.',\n\t\t500 => 'Server Error',\n\t\t);\n\n\t\tif(array_key_exists($code, $errors)):\n\t\t\treturn $errors[$code];\n\t\tendif;\n\n\t\treturn '';\n\t}",
"public function errorInfo()\n {\n return $this->tarArchive->error_object->getMessage();\n }",
"private function getCodeMsg($code)\n\t{\n\t\t$codeMsg = [\n\t\t\t/* 100+ */\n\t\t\t100 => 'Continue', 101 => 'Switching Protocols',\n\n\t\t\t/* 200+ */\n\t\t\t200 => 'OK', 201 => 'Created', 202 => 'Accepted', 203 => 'Non-Authoritative Information',\n\t\t\t204 => 'No Content', 205 => 'Reset Content', 206 => 'Partial Content',\n\n\t\t\t/* 300+ */\n\t\t\t300 => 'Multiple Choices', 301 => 'Moved Permanently', 302 => 'Found', 303 => 'See Other',\n\t\t\t304 => 'Not Modified', 305 => 'Use Proxy', 306 => '(Unused)', 307 => 'Temporary Redirect',\n\n\t\t\t/* 400+ */\n\t\t\t400 => 'Bad Request', 401 => 'Unauthorized', 402 => 'Payment Required', 403 => 'Forbidden',\n\t\t\t404 => 'Not Found', 405 => 'Method Not Allowed', 406 => 'Not Acceptable',\n\t\t\t407 => 'Proxy Authentication Required', 408 => 'Request Timeout', 409 => 'Conflict', 410 => 'Gone',\n\t\t\t411 => 'Length Required', 412 => 'Precondition Failed', 413 => 'Request Entity Too Large',\n\t\t\t414 => 'Request-URI Too Long', 415 => 'Unsupported Media Type', 416 => 'Requested Range Not Satisfiable',\n\t\t\t417 => 'Expectation Failed',\n\n\t\t\t/* 500+ */\n\t\t\t500 => 'Internal Server Error', 501 => 'Not Implemented', 502 => 'Bad Gateway',\n\t\t\t503 => 'Service Unavailable', 504 => 'Gateway Timeout', 505 => 'HTTP Version Not Supported'\n\t\t];\n\n\t\treturn $codeMsg[$code];\n\t}",
"public function formatErrorMessage($code, $message) {\n global $output_format;\n global $method; //Using non-object as could be used before request object is created.\n if($method == 'GET') {\n \t$formatted = constant(strtoupper($output_format->getFormat()) . \"_GET_ERROR_TEMPLATE\");\n } else { //All other formats\n $formatted = constant(strtoupper($output_format->getFormat()) . \"_ERROR_TEMPLATE\");\n $formatted = str_replace(\"{{request}}\", $method, $formatted);\n }\n $formatted = str_replace(\"{{code}}\", $code, $formatted);\n $formatted = str_replace(\"{{message}}\", $message, $formatted);\n return $formatted;\n }",
"public static function getStatusCodeMessage($status)\n {\n// via parse_ini_file()... however, this will suffice\n// for an example\n $codes = Array(\n 100 => 'Continue',\n 101 => 'Switching Protocols',\n 200 => 'OK',\n 201 => 'Created',\n 202 => 'Accepted',\n 203 => 'Non-Authoritative Information',\n 204 => 'No Content',\n 205 => 'Reset Content',\n 206 => 'Partial Content',\n 300 => 'Multiple Choices',\n 301 => 'Moved Permanently',\n 302 => 'Found',\n 303 => 'See Other',\n 304 => 'Not Modified',\n 305 => 'Use Proxy',\n 306 => '(Unused)',\n 307 => 'Temporary Redirect',\n 400 => 'Bad Request',\n 401 => 'Unauthorized',\n 402 => 'Payment Required',\n 403 => 'Forbidden',\n 404 => 'Not Found',\n 405 => 'Method Not Allowed',\n 406 => 'Not Acceptable',\n 407 => 'Proxy Authentication Required',\n 408 => 'Request Timeout',\n 409 => 'Conflict',\n 410 => 'Gone',\n 411 => 'Length Required',\n 412 => 'Precondition Failed',\n 413 => 'Request Entity Too Large',\n 414 => 'Request-URI Too Long',\n 415 => 'Unsupported Media Type',\n 416 => 'Requested Range Not Satisfiable',\n 417 => 'Expectation Failed',\n 500 => 'Internal Server Error',\n 501 => 'Not Implemented',\n 502 => 'Bad Gateway',\n 503 => 'Service Unavailable',\n 504 => 'Gateway Timeout',\n 505 => 'HTTP Version Not Supported'\n );\n\n return (isset($codes[$status])) ? $codes[$status] : '';\n }",
"function upload_error($error)\n{\n echo json_encode(array(\"error\"=>$error));\n}",
"function errorCode()\n {\n }",
"function get_error_msg()\n\t{\n\t\t//$this->error_no=curl_errno($this->ch);\n\t\techo \"Error: \" .curl_errno($this->ch) .\"\\n\";\n\t\techo \"Message3: \" .curl_error($this->ch).\"\\n\";\n\n\t\treturn $err;\n\t}",
"private function _getStatusCodeMessage($status){\n\t\t// via parse_ini_file()... however, this will suffice\n\t\t// for an example\n\t\t$codes = Array(\n\t\t\t200 => 'OK',\n\t\t\t400 => 'Bad Request',\n\t\t\t401 => 'Unauthorized',\n\t\t\t402 => 'Payment Required',\n\t\t\t403 => 'Forbidden',\n\t\t\t404 => 'Not Found',\n\t\t\t500 => 'Internal Server Error',\n\t\t\t501 => 'Not Implemented',\n\t\t);\n\t\treturn (isset($codes[$status])) ? $codes[$status] : '';\n\t}",
"abstract protected function _getErrorString();",
"private function _getStatusCodeMessage($status)\n{\n // via parse_ini_file()... however, this will suffice\n // for an example\n $codes = Array(\n 200 => 'OK',\n 400 => 'Bad Request',\n 401 => 'Unauthorized',\n 402 => 'Payment Required',\n 403 => 'Forbidden',\n 404 => 'Not Found',\n 500 => 'Internal Server Error',\n\n 501 => 'Not Implemented',\n );\n return (isset($codes[$status])) ? $codes[$status] : '';\n}",
"public function lastError(): string\n {\n $errno = smbclient_state_errno($this->state);\n return 'SMB: ' .$this->errorCode[$errno]?? \"error code $errno\";\n }",
"public function getErrorText(){\n return $this->error;\n }",
"public function message()\n {\n return ':attribute 文件格式不正确,只支持' . implode(',', $this->extensions) . '格式';\n }",
"protected function errorMessage(int $filesFailed): string\n {\n return '<error>Error: ' . $filesFailed . ' files failed</error>';\n }",
"public function getError()\n {\n return $this->fileInfo['error'];\n }",
"public function getCode(): int\n\t{\n\t\treturn $this->err->getCode();\n\t}",
"public function getErrorCode();",
"public function message()\n {\n return \"File not found!\";\n }",
"private function _dispatchError ($errorCode)\r\n {\r\n echo str_replace('{$mesaj}', self::$_mesaje[$errorCode], file_get_contents(\"_accesBlocat.html\"));\r\n exit();\r\n }",
"public function getErrorsAsString()\n {\n if (!$this->hasErrors()) {\n return '';\n }\n $errors[] = \"There are errors in the file. Please correct inconsistencies in line/s and re-upload the file to display the products.\";\n foreach ($this->getErrors() as $key => $error) {\n $lineNumber = (is_numeric($key) ? '#' . $key . ': ' : '');\n $errors[] = $lineNumber . implode(' ', $error);\n }\n return implode('<br>', $errors);\n }",
"abstract public function getErrorType(): string;",
"static function error( $code, $desc ) {\n\t\t$codes = array();\n\t\t$codes[400] = 'Bad Request';\n\t\t$codes[401] = 'Unauthorized';\n\t\t$codes[403] = 'Forbidden';\n\t\t$codes[404] = 'Not Found';\n\t\t$codes[405] = 'Method Not Allowed';\n\t\t$codes[406] = 'Not Acceptable';\n\t\t$codes[501] = 'Not Implemented';\n\t\t$codes[503] = 'Service unavailable';\n\t\t\n\t\theader('Content-Type: text/html');\n\t\theader( 'HTTP/1.1 '. $code . ' '. @$codes[$code] );\n\t\tdie( $desc );\n\t}",
"function errorCode($inc_errstr)\n{\n\techo \"<p><b>ERROR! \".$inc_errstr.\"</b></p>\";\n}",
"public function getError(){\n if (empty($this->getErrorCode())) {\n return null;\n }\n return $this->getErrorCode().': '.$this->getErrorMessage();\n }",
"public static function getStatusCodeMessage($status)\n\t\t{\n\t\t\t// via parse_ini_file()... however, this will suffice\n\t\t\t// for an example\n\t\t\t$codes = Array(\n\t\t\t\t100 => 'Continue',\n\t\t\t\t101 => 'Switching Protocols',\n\t\t\t\t200 => 'OK',\n\t\t\t\t201 => 'Created',\n\t\t\t\t202 => 'Accepted',\n\t\t\t\t203 => 'Non-Authoritative Information',\n\t\t\t\t204 => 'No Content',\n\t\t\t\t205 => 'Reset Content',\n\t\t\t\t206 => 'Partial Content',\n\t\t\t\t300 => 'Multiple Choices',\n\t\t\t\t301 => 'Moved Permanently',\n\t\t\t\t302 => 'Found',\n\t\t\t\t303 => 'See Other',\n\t\t\t\t304 => 'Not Modified',\n\t\t\t\t305 => 'Use Proxy',\n\t\t\t\t306 => '(Unused)',\n\t\t\t\t307 => 'Temporary Redirect',\n\t\t\t\t400 => 'Bad Request',\n\t\t\t\t401 => 'Unauthorized',\n\t\t\t\t402 => 'Payment Required',\n\t\t\t\t403 => 'Forbidden',\n\t\t\t\t404 => 'Not Found',\n\t\t\t\t405 => 'Method Not Allowed',\n\t\t\t\t406 => 'Not Acceptable',\n\t\t\t\t407 => 'Proxy Authentication Required',\n\t\t\t\t408 => 'Request Timeout',\n\t\t\t\t409 => 'Conflict',\n\t\t\t\t410 => 'Gone',\n\t\t\t\t411 => 'Length Required',\n\t\t\t\t412 => 'Precondition Failed',\n\t\t\t\t413 => 'Request Entity Too Large',\n\t\t\t\t414 => 'Request-URI Too Long',\n\t\t\t\t415 => 'Unsupported Media Type',\n\t\t\t\t416 => 'Requested Range Not Satisfiable',\n\t\t\t\t417 => 'Expectation Failed',\n\t\t\t\t500 => 'Internal Server Error',\n\t\t\t\t501 => 'Not Implemented',\n\t\t\t\t502 => 'Bad Gateway',\n\t\t\t\t503 => 'Service Unavailable',\n\t\t\t\t504 => 'Gateway Timeout',\n\t\t\t\t505 => 'HTTP Version Not Supported',\n\t\t\t\t600 => 'OK',\n\t\t\t\t601 => 'Bad request',\n\t\t\t\t602 => 'You must be authorized to view this page.',\n\t\t\t\t603 => 'The requested URL ' . $_SERVER['REQUEST_URI'] . ' was not found.',\n\t\t\t\t604 => 'The server encountered an error processing your request.',\n\t\t\t\t605 => 'The requested method is not implemented.',\n\t\t\t\t606 => 'You have exceeded api call limit for the hour',\n\t\t\t\t607 => 'You have exceeded api call limit for the day'\n\t\t\t);\n\t\n\t\t\treturn (isset($codes[$status])) ? $codes[$status] : '';\n\t\t}",
"public function _getStatusCodeMessage($status) {\n // via parse_ini_file()... however, this will suffice\n // for an example\n $codes = Array(\n 100 => 'Continue',\n 101 => 'Switching Protocols',\n 200 => 'OK',\n 201 => 'Created',\n 202 => 'Accepted',\n 203 => 'Non-Authoritative Information',\n 204 => 'No Content',\n 205 => 'Reset Content',\n 206 => 'Partial Content',\n 300 => 'Multiple Choices',\n 301 => 'Moved Permanently',\n 302 => 'Found',\n 303 => 'See Other',\n 304 => 'Not Modified',\n 305 => 'Use Proxy',\n 306 => '(Unused)',\n 307 => 'Temporary Redirect',\n 400 => 'Bad Request',\n 401 => 'Unauthorized',\n 402 => 'Payment Required',\n 403 => 'Forbidden',\n 404 => 'Oops! Something has gone wrong and the page you were looking for could not be found! Try the <a href=\"\" class=\"color-blue\">home page.</a>',\n 405 => 'Method Not Allowed',\n 406 => 'Not Acceptable',\n 407 => 'Proxy Authentication Required',\n 408 => 'Request Timeout',\n 409 => 'Conflict',\n 410 => 'Gone',\n 411 => 'Length Required',\n 412 => 'Precondition Failed',\n 413 => 'Request Entity Too Large',\n 414 => 'Request-URI Too Long',\n 415 => 'Unsupported Media Type',\n 416 => 'Requested Range Not Satisfiable',\n 417 => 'Expectation Failed',\n 500 => \"We're sorry because something went wrong, please try again!\",\n 501 => 'Not Implemented',\n 502 => 'Bad Gateway',\n 503 => 'Service Unavailable',\n 504 => 'Gateway Timeout',\n 505 => 'HTTP Version Not Supported',\n );\n return (isset($codes[$status])) ? $codes[$status] : 'Unknown Result';\n }",
"function get_error()\n\t{\n\t\tif ($this->error != \"\") {\n\t\t\treturn \"Error:\".$this->error;\n\t\t}\n\t\treturn \"\";\n\t}",
"public static function errorCode($code)\n {\n http_response_code($code);\n $path = 'application/views/errors/' . $code . '.php';\n if (file_exists($path)) {\n require $path;\n }\n exit;\n }",
"public function getMessage() {\n\n\t\t\tswitch($this->getCode()) {\n\t\t\t\tcase 100: return 'Continue';\n\t\t\t\tcase 101: return 'Switching Protocols';\n\t\t\t\tcase 102: return 'Processing';\n\t\t\t\tcase 200: return 'OK';\n\t\t\t\tcase 201: return 'Created';\n\t\t\t\tcase 202: return 'Accepted';\n\t\t\t\tcase 203: return 'Non-Authoritative Information';\n\t\t\t\tcase 204: return 'No Content';\n\t\t\t\tcase 205: return 'Reset Content';\n\t\t\t\tcase 206: return 'Partial Content';\n\t\t\t\tcase 207: return 'Multi-Status';\n\t\t\t\tcase 208: return 'Already Reported';\n\t\t\t\tcase 226: return 'IM Used';\n\t\t\t\tcase 300: return 'Multiple Choices';\n\t\t\t\tcase 301: return 'Moved Permanently';\n\t\t\t\tcase 302: return 'Found';\n\t\t\t\tcase 303: return 'See Other';\n\t\t\t\tcase 304: return 'Not Modified';\n\t\t\t\tcase 305: return 'Use Proxy';\n\t\t\t\tcase 306: return 'Switch Proxy';\n\t\t\t\tcase 307: return 'Temporary Redirect';\n\t\t\t\tcase 308: return 'Permanent Redirect';\n\t\t\t\tcase 400: return 'Bad Request';\n\t\t\t\tcase 401: return 'Unauthorized';\n\t\t\t\tcase 402: return 'Payment Required';\n\t\t\t\tcase 403: return 'Forbidden';\n\t\t\t\tcase 404: return 'Not Found';\n\t\t\t\tcase 405: return 'Method Not Allowed';\n\t\t\t\tcase 406: return 'Not Acceptable';\n\t\t\t\tcase 407: return 'Proxy Authentication Required';\n\t\t\t\tcase 408: return 'Request Timeout';\n\t\t\t\tcase 409: return 'Conflict';\n\t\t\t\tcase 410: return 'Gone';\n\t\t\t\tcase 411: return 'Length Required';\n\t\t\t\tcase 412: return 'Precondition Failed';\n\t\t\t\tcase 413: return 'Request Entity Too Large';\n\t\t\t\tcase 414: return 'Request-URI Too Long';\n\t\t\t\tcase 415: return 'Unsupported Media Type';\n\t\t\t\tcase 416: return 'Requested Range Not Satisfiable';\n\t\t\t\tcase 417: return 'Expectation Failed';\n\t\t\t\tcase 418: return 'I\\'m a teapot';\n\t\t\t\tcase 419: return 'Authentication Timeout';\n\t\t\t\tcase 420: return 'Enhance Your Calm';\n\t\t\t\tcase 420: return 'Method Failure';\n\t\t\t\tcase 422: return 'Unprocessable Entity';\n\t\t\t\tcase 423: return 'Locked';\n\t\t\t\tcase 424: return 'Failed Dependency';\n\t\t\t\tcase 424: return 'Method Failure';\n\t\t\t\tcase 425: return 'Unordered Collection';\n\t\t\t\tcase 426: return 'Upgrade Required';\n\t\t\t\tcase 428: return 'Precondition Required';\n\t\t\t\tcase 429: return 'Too Many Requests';\n\t\t\t\tcase 431: return 'Request Header Fields Too Large';\n\t\t\t\tcase 444: return 'No Response';\n\t\t\t\tcase 449: return 'Retry With';\n\t\t\t\tcase 450: return 'Blocked by Windows Parental Controls';\n\t\t\t\tcase 451: return 'Redirect';\n\t\t\t\tcase 451: return 'Unavailable For Legal Reasons';\n\t\t\t\tcase 494: return 'Request Header Too Large';\n\t\t\t\tcase 495: return 'Cert Error';\n\t\t\t\tcase 496: return 'No Cert';\n\t\t\t\tcase 497: return 'HTTP to HTTPS';\n\t\t\t\tcase 499: return 'Client Closed Request';\n\t\t\t\tcase 500: return 'Internal Server Error';\n\t\t\t\tcase 501: return 'Not Implemented';\n\t\t\t\tcase 502: return 'Bad Gateway';\n\t\t\t\tcase 503: return 'Service Unavailable';\n\t\t\t\tcase 504: return 'Gateway Timeout';\n\t\t\t\tcase 506: return 'Variant Also Negotiates';\n\t\t\t\tcase 507: return 'Insufficient Storage';\n\t\t\t\tcase 508: return 'Loop Detected';\n\t\t\t\tcase 509: return 'Bandwidth Limit Exceeded';\n\t\t\t\tcase 510: return 'Not Extended';\n\t\t\t\tcase 511: return 'Network Authentication Required';\n\t\t\t\tcase 598: return 'Network read timeout error';\n\t\t\t\tcase 599: return 'Network connect timeout error';\n\t\t\t\tdefault: return 'Unknown Response';\n\t\t\t}\n\n\t\t}",
"private function _getStatusCodeMessage($status)\n {\n // via parse_ini_file()... however, this will suffice\n // for an example\n $codes = Array(\n 200 => 'OK',\n 400 => 'Bad Request',\n 401 => 'Unauthorized',\n 402 => 'Payment Required',\n 403 => 'Forbidden',\n 404 => 'Not Found',\n 500 => 'Internal Server Error',\n 501 => 'Not Implemented',\n );\n return (isset($codes[$status])) ? $codes[$status] : '';\n }",
"public function messages()\n {\n return [\n 'file.mimes' => trans('common.file.ext.error')\n ];\n }",
"public function get_error();",
"public function get_error();",
"public function getMessageInfo($error_code)\n {\n return 'Error ' . $error_code . ': ' . RedsysErrorInfo::getErrorInfo($error_code);\n }",
"public function errorCode()\r\n\t{\r\n\t\treturn $this->errorCode;\r\n\t}",
"public function getErrorMessage()\n {\n // then re-apply the error code:\n if(($this->error_code !== 0) && empty($this->error_msg))\n {\n $this->setError($this->error_code);\n }\n return $this->error_msg;\n }",
"function errorInfo($p_full=false)\n {\n if (PCLZIP_ERROR_EXTERNAL == 1) {\n return(PclErrorString());\n }\n else {\n if ($p_full) {\n return($this->errorName(true).\" : \".$this->error_string);\n }\n else {\n return($this->error_string.\" [code \".$this->error_code.\"]\");\n }\n }\n }",
"public function errorInfo();",
"public function errorInfo();",
"private function _getErrorsMessages() : array\n\t{\n\t\t$messages = [\n\t __\\UploadedFilesHandler::ERROR_MOVE_UPLOADED_FILE => 'Przenoszenie pliku z folderu tymczasowego nie powiodło się.',\n\t __\\UploadedFilesHandler::ERROR_FILE_STILL_EXISTS => 'Plik o tej samej nazwie już istnieje pomimo próby zmiany nazwy.',\n\t __\\UploadedFilesHandler::ERROR_FILE_TOO_BIG => 'Przesłany plik jest zbyt duży.',\n\n\t \\UPLOAD_ERR_INI_SIZE => 'Przesłany plik jest zbyt duży (rozmiar określa konfiguracja PHP).',\n\t \\UPLOAD_ERR_FORM_SIZE => 'Przesłany plik jest zbyt duży.',\n\t \\UPLOAD_ERR_PARTIAL => 'Plik został przesłany tylko częściowo.',\n\t \\UPLOAD_ERR_NO_FILE => 'Nie przesłano żadnego pliku.',\n\t \\UPLOAD_ERR_NO_TMP_DIR => 'Nie określono folderu tymczasowego do przesyłania plików.',\n\t \\UPLOAD_ERR_CANT_WRITE => 'Zapis przesyłanego pliku do folderu tymczasowego jest niemożliwy.',\n\t \\UPLOAD_ERR_EXTENSION => 'Przesyłanie pliku nie powiodło się z powodu rozszerzenia PHP.',\n\n\t 'unknown' => 'Wystąpił błąd PHP podczas przesyłania pliku.',\n\t\t];\n\n\t\t$errors = $this->_handler->getErrors();\n\n\t\tforeach ($errors as $fileName => $errorCode) {\n\t\t\t$errors[$fileName] = $messages[$errorCode] ?? $messages['unknown'];\n\t\t}\n\n\t\treturn $errors;\n\t}",
"function ts3client_getErrorMessage($errorCode, &$error) {}",
"function error_message(int &$code = null, bool $format = false, bool $extract = false, bool $clear = false): string|null\n{\n $error = error_get_last();\n if (!$error) {\n return null;\n }\n\n $code = $error['type'];\n $clear && error_clear($code);\n\n // Format with name.\n if ($format) {\n $error['name'] = match ($error['type']) {\n E_NOTICE, E_USER_NOTICE => 'NOTICE',\n E_WARNING, E_USER_WARNING => 'WARNING',\n E_DEPRECATED, E_USER_DEPRECATED => 'DEPRECATED',\n default => 'ERROR'\n };\n\n return vsprintf('%s(%d): %s at %s:%s', array_select(\n $error, ['name', 'type', 'message', 'file', 'line']\n ));\n }\n // Extract message only dropping caused function.\n elseif ($extract && ($pos = strpos($error['message'], '):'))) {\n return ucfirst(substr($error['message'], $pos + 3));\n }\n\n return $error['message'];\n}",
"function _getStatusMessage(){\n $status = array(\n 200 => 'Ok' ,\n 201 => 'Created' ,\n 202 => 'deleted' ,\n 204 => 'No Content' ,\n 400 => 'Bad Request',\n 404 => 'Not Found' ,\n 405 => 'Not Allowed' ,\n 406 => 'Not Acceptable',\n\n );\n return ($status[$this->CodeHTTP] ? $status[$this->CodeHTTP] : $status[500]);\n }",
"public function error(): string{\n return curl_error($this->handler);\n }",
"public function fileCode() { return $this->_m_fileCode; }",
"public function get_error_message() {\n\t\treturn $this->error_message;\n\t}",
"private function http_status_code_string($code, $include_code = false)\n {\n switch ($code) {\n // 1xx Informational\n case 100:\n $string = 'Continue';\n break;\n case 101:\n $string = 'Switching Protocols';\n break;\n case 102:\n $string = 'Processing';\n break; // WebDAV\n case 122:\n $string = 'Request-URI too long';\n break; // Microsoft\n\n // 2xx Success\n case 200:\n $string = 'OK';\n break;\n case 201:\n $string = 'Created';\n break;\n case 202:\n $string = 'Accepted';\n break;\n case 203:\n $string = 'Non-Authoritative Information';\n break; // HTTP/1.1\n case 204:\n $string = 'No Content';\n break;\n case 205:\n $string = 'Reset Content';\n break;\n case 206:\n $string = 'Partial Content';\n break;\n case 207:\n $string = 'Multi-Status';\n break; // WebDAV\n\n // 3xx Redirection\n case 300:\n $string = 'Multiple Choices';\n break;\n case 301:\n $string = 'Moved Permanently';\n break;\n case 302:\n $string = 'Found';\n break;\n case 303:\n $string = 'See Other';\n break; //HTTP/1.1\n case 304:\n $string = 'Not Modified';\n break;\n case 305:\n $string = 'Use Proxy';\n break; // HTTP/1.1\n case 306:\n $string = 'Switch Proxy';\n break; // Depreciated\n case 307:\n $string = 'Temporary Redirect';\n break; // HTTP/1.1\n\n // 4xx Client Error\n case 400:\n $string = 'Bad Request';\n break;\n case 401:\n $string = 'Unauthorized';\n break;\n case 402:\n $string = 'Payment Required';\n break;\n case 403:\n $string = 'Forbidden';\n break;\n case 404:\n $string = 'Not Found';\n break;\n case 405:\n $string = 'Method Not Allowed';\n break;\n case 406:\n $string = 'Not Acceptable';\n break;\n case 407:\n $string = 'Proxy Authentication Required';\n break;\n case 408:\n $string = 'Request Timeout';\n break;\n case 409:\n $string = 'Conflict';\n break;\n case 410:\n $string = 'Gone';\n break;\n case 411:\n $string = 'Length Required';\n break;\n case 412:\n $string = 'Precondition Failed';\n break;\n case 413:\n $string = 'Request Entity Too Large';\n break;\n case 414:\n $string = 'Request-URI Too Long';\n break;\n case 415:\n $string = 'Unsupported Media Type';\n break;\n case 416:\n $string = 'Requested Range Not Satisfiable';\n break;\n case 417:\n $string = 'Expectation Failed';\n break;\n case 422:\n $string = 'Unprocessable Entity';\n break; // WebDAV\n case 423:\n $string = 'Locked';\n break; // WebDAV\n case 424:\n $string = 'Failed Dependency';\n break; // WebDAV\n case 425:\n $string = 'Unordered Collection';\n break; // WebDAV\n case 426:\n $string = 'Upgrade Required';\n break;\n case 449:\n $string = 'Retry With';\n break; // Microsoft\n case 450:\n $string = 'Blocked';\n break; // Microsoft\n\n // 5xx Server Error\n case 500:\n $string = 'Internal Server Error';\n break;\n case 501:\n $string = 'Not Implemented';\n break;\n case 502:\n $string = 'Bad Gateway';\n break;\n case 503:\n $string = 'Service Unavailable';\n break;\n case 504:\n $string = 'Gateway Timeout';\n break;\n case 505:\n $string = 'HTTP Version Not Supported';\n break;\n case 506:\n $string = 'Variant Also Negotiates';\n break;\n case 507:\n $string = 'Insufficient Storage';\n break; // WebDAV\n case 509:\n $string = 'Bandwidth Limit Exceeded';\n break; // Apache\n case 510:\n $string = 'Not Extended';\n break;\n\n // Unknown code:\n default:\n $string = 'Unknown';\n break;\n }\n if ($include_code)\n return $code . ' ' . $string;\n return $string;\n }",
"function errorCode()\n {\n if (PCLZIP_ERROR_EXTERNAL == 1) {\n return(PclErrorCode());\n }\n else {\n return($this->error_code);\n }\n }",
"function error_handler($severity, $msg, $filename, $linenum) {\n\techo $severity . \" \" . $msg . \" ($filename:$linenum)<br>\";\n}"
] | [
"0.7758391",
"0.7631293",
"0.7395082",
"0.7352648",
"0.7288007",
"0.72413474",
"0.7226651",
"0.72228336",
"0.7053228",
"0.7047845",
"0.7041998",
"0.6895223",
"0.6846237",
"0.6753732",
"0.6731508",
"0.6630773",
"0.6569733",
"0.6552705",
"0.6507374",
"0.64691716",
"0.63845754",
"0.6342161",
"0.62832975",
"0.62343866",
"0.6169315",
"0.6151011",
"0.61351234",
"0.6114794",
"0.6106072",
"0.6105447",
"0.61007345",
"0.6055246",
"0.60409516",
"0.6034147",
"0.6019623",
"0.6015661",
"0.60153216",
"0.60153216",
"0.5989539",
"0.5987957",
"0.5961638",
"0.59606844",
"0.59603846",
"0.59508646",
"0.59416574",
"0.5932387",
"0.59295934",
"0.5890901",
"0.58613455",
"0.5824344",
"0.58129853",
"0.5812804",
"0.5789246",
"0.57815427",
"0.57757276",
"0.57697856",
"0.5768795",
"0.5747861",
"0.5745634",
"0.5745568",
"0.57442546",
"0.57422113",
"0.57396156",
"0.5729196",
"0.57140446",
"0.5709201",
"0.5708938",
"0.5702903",
"0.56940675",
"0.56901485",
"0.5681729",
"0.5661588",
"0.566013",
"0.5653619",
"0.5649951",
"0.56462604",
"0.5645764",
"0.56440616",
"0.5636165",
"0.5635831",
"0.56338334",
"0.56235546",
"0.56194746",
"0.56194746",
"0.56135595",
"0.5607793",
"0.5607681",
"0.5600707",
"0.5588448",
"0.5588448",
"0.5575461",
"0.5571676",
"0.55690444",
"0.55619144",
"0.5555905",
"0.55531883",
"0.55513865",
"0.5548565",
"0.5547406",
"0.5543833"
] | 0.6685272 | 15 |
sets an error code which can be referenced if failure is detected by controller. note: the amount of info stored in message depends on debug level. | function setError($code = 1, $message = 'An unknown error occured.', $debug = '') {
$this->errorCode = $code;
$this->errorMessage = $message;
if (DEBUG) {
$this->errorMessage .= $debug;
}
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function setError($message, $code)\n {\n $this->errorMsg\n = $this->errorMsg\n ? $this->errorMsg\n : $message;\n $this->errorIdentifier\n = $this->errorIdentifier\n ? $this->errorIdentifier\n : \"$this->moduleName / $code\";\n }",
"protected function set_error( $code, $message) {\n\t\t$this->errors->add($code, $message);\n\t}",
"protected function setError($message, $code)\n\t{\n\t\t$this->error = true;\n\t\t$this->errorMessage = $message;\n\t\t$this->errorCode = $code;\n\t}",
"function setStatusCode($code,$message = null){\n\t\tif(preg_match('/^([0-9]{3}) (.+)/',$code,$matches)){\n\t\t\t$code = $matches[1];\n\t\t\t$message = $matches[2];\n\t\t}\n\n\t\tsettype($code,\"integer\");\n\t\t$this->_StatusCode_Redefined = true;\n\t\t$this->_StatusCode = $code;\n\t\t$this->_StatusMessage = $message;\n\t}",
"public function setError($message, $code = 0) {\n\t\tif (!empty($message)) {\n\t\t\t$this->err_message = $message;\n\t\t\t$this->err_code = $code;\n\t\t\treturn TRUE;\n\t\t} else {\n\t\t\treturn FALSE;\n\t\t}\n\t}",
"function setErrorCode($error_code){\r\n\t\t$this->error_code = $error_code;\r\n\t}",
"public function errorcode();",
"public function setCode($code, $message);",
"public function setErrorCode($value)\n {\n $this->_errorCode = $value;\n }",
"public static function _errorHandler($code, $message)\n\t{\n\t\trestore_error_handler();\n\n\t\tif (ini_get('html_errors')) {\n\t\t\t$message = strip_tags($message);\n\t\t\t$message = html_entity_decode($message);\n\t\t}\n\n\t\tself::$errorMsg = $message;\n\t}",
"public static function errorCode($code)\n {\n http_response_code($code);\n $path = 'application/views/errors/' . $code . '.php';\n if (file_exists($path)) {\n require $path;\n }\n exit;\n }",
"protected function setError($message, $detail = '', $smtp_code = '', $smtp_code_ex = '')\n {\n }",
"function errorHandler($message, $code){\n echo '{\"errors\":\"'.$message.'\"}';\n http_response_code($code);\n return false;\n }",
"protected static function error($code, $message) {\n\t\theader('Content-Type: text/html', true, $code);\n\t\theader('Content-Length: ' . strlen($message));\n\n\t\techo $message;\n\t}",
"protected function setResponsesError(int $code, string $message = '')\n {\n foreach ($this->responses as $response) {\n $response->setError($code, $message);\n }\n }",
"protected function error($message) { \n\t\t$this->error_found = true; \n\t\t$this->error_message = $message; \n\t}",
"public function get_error_code()\n {\n }",
"public function setError($error, $code, $msg){\n $this->errors[$error] = array('code'=>$code, 'message'=>$msg);\n }",
"public static function error (int $code, string $msg) : bool {\n\t\tself::$error_code = $code;\n\t\tself::$error = $msg;\n\t\treturn false;\n\t}",
"private function _setErrorMessage($errorCode = '')\n {\n $this->errorMessage = trans('evatr::messages.'.$errorCode);\n }",
"function error($code) {\n\tswitch ($code) {\n\t\tcase 'EntityExists':\n\t\t\t$str = 'Cannot complete that action because the entity already exists';\n\t\t\tbreak;\n\t\tcase 'EntityDoesNotExist':\n\t\t\t$str = 'Cannot complete that action because that entity does not exist';\n\t\t\tbreak;\n\t\tcase 'InvalidPassword':\n\t\t\t$str = 'The password supplied is not valid';\n\t\t\tbreak;\n\t\tdefault:\n\t\t\t$str = $code;\n\t}\n\treturn $str;\n}",
"function setStatusCode($code);",
"static public function errorCode($code)\n {\n http_response_code($code);\n\n $filename = APP . '/views/errors/' . $code . '.php';\n\n if (file_exists($filename)) require $filename;\n else if (IS_DEV) throw new \\Exception('file [$filename] is not found!');\n\n exit;\n }",
"public static function setError($message) {\n self::$_class = \"Example\\\\Excel\\\\Controllers\\\\Error\";\n throw new \\Exception($message);\n }",
"private function Error($error_code, $error_message = \"\"){\n $string = \"\\nERROR[line\".$this->InstructionCounter.\"]>>\".$error_message.\"\\n\";\n fwrite(STDERR, $string); \n exit($error_code);\n\t\t}",
"public static function setError($message)\n {\n self::put(\"error\", $message);\n }",
"private function _setMetaMessage( $msg, $code = 0 ) {\n if ( is_array($this->settings['errors']) === false ) { $this->settings['errors'] = array(); }\n if ( NoNull($msg) != '' ) { $this->settings['errors'][] = NoNull($msg); }\n if ( $code > 0 && nullInt($this->settings['status']) == 0 ) { $this->settings['status'] = nullInt($code); }\n }",
"function __set_error($error_code = null, $error_message = null,\n $error_details = null) {\n\n $this->error_code = $error_code;\n $this->error_message = $error_message;\n $this->error_details = $error_details;\n\n}",
"Public static function validationError($message, $code){\n\n throw new \\yii\\web\\HttpException(500, $message, $code);\n\n\n }",
"private function errorHandler($code,$message,$file=NULL,$line=NULL){\n $error = new ErrorHandler();\n $error->setErrorArray(['code'=>$code, \n 'message'=>$message\n ],$file, $line\n );\n }",
"public function setStatusCodeMsg($msg)\r\n {\r\n $this->_statusCodeMsg = $msg;\r\n }",
"public function error($message = null, $code = null)\n {\n $this->runEvent('onError', [$this, $message, $code]);\n\n $this->message($message ?: $this->getMessage('error'));\n\n $this->error = true;\n\n if ( $code ) {\n $this->code = $code;\n }\n\n return $this;\n }",
"public function setErrorResponse($message)\r\n {\r\n $this->setResponse(self::STATUS_CODE_ERROR, $message);\r\n }",
"public function errorCode() {}",
"public function setStatusCode($code, $text);",
"public static function sendError($status_code,$message=null) {\n\t\thttp_response_code($status_code);\n\t\techo $message;\n\t}",
"private function exceptionWithResponseCode($code, $message) {\n $this->httpResponseCode = $code;\n throw new \\Exception($message);\n }",
"public function set_status($code)\n {\n }",
"public function set_status($code)\n {\n }",
"protected function setError($message, $detail = '', $smtp_code = '', $smtp_code_ex = '')\n {\n $this->error = array(\n 'error' => $message,\n 'detail' => $detail,\n 'smtp_code' => $smtp_code,\n 'smtp_code_ex' => $smtp_code_ex\n );\n }",
"function errorCode()\n {\n }",
"protected function connectionErrorHandler(int $code, string $message): void\n {\n $this->smtpLog[] = $message;\n }",
"protected function set_status($code)\n {\n }",
"function setFailedValidationStatusCode();",
"protected function setError($msg)\n {\n }",
"public function setStatusCode($code)\r\n {\r\n http_response_code($code);\r\n }",
"public function setError($msg) {\n $this->__isError = true;\n $this->__errorMsg = $msg;\n }",
"private function setErrorResponse($message, $errorCode = 200)\n {\n $this->_response->setHttpResponseCode($errorCode);\n $this->_helper->json(array(\n 'message' => $message\n ));\n }",
"public static function RequestError($code, $msg, $file, $line) {\n\t\tself::$error = true;\n\t\treturn true;\n\t}",
"function setError ($msg) {\r\n $this->errors[]=$msg;\r\n }",
"public function setErrorMessage($message)\n {\n $this->message = $message;\n }",
"public function getCode(): int\n\t{\n\t\treturn $this->err->getCode();\n\t}",
"public function getStatusError($code = false)\n {\n switch ($code) {\n case 204:\n return 204;\n break;\n case 400: //Bad Request\n return 400;\n break;\n case 401:\n return 401;\n break;\n case 403:\n return 403;\n break;\n case 404:\n return 404;\n break;\n case 502:\n return 502;\n break;\n case 504:\n return 504;\n break;\n default:\n return 500;\n break;\n }\n }",
"public function failed()\n {\n $msg = self::class;\n $msg .= ' - Código: '.$this->$code;\n\n app('LogExtract')->error($msg);\n }",
"public function errorAction()\n {\n $code = $this->_request->getParam('errorCode');\n $this->view->errorCode = $code;\n $this->getResponse()->setRawHeader('HTTP/1.1 500 Internal Server Error');\n }",
"public function error($message) {}",
"public static function validationFailed($code, $message){\n\n throw new \\yii\\web\\HttpException(401, $message, $code);\n }",
"function setErrorCode($errorCode) {\n\t\t$this->errorCode = $errorCode;\n\t}",
"public function setCode(int $code)\n {\n if (!array_key_exists($code, self::STATUS_TEXTS)) {\n throw new OutOfBoundsException(sprintf(\"%d is not a valid HTTP code\", $code));\n }\n \n $this->code = $code;\n }",
"public static function type( $code ) {\n\t\t// -- Get the proper message based on HTTP status code\n\t\tswitch( $code ) {\n\t\t\tcase Error::$not_found: \n\t\t\t\treturn Error::missing(); \n\t\t\tbreak;\n\n\t\t\tcase Error::$internal: \n\t\t\t\treturn Error::internal(); \n\t\t\tbreak;\n\t\t}\n\t}",
"function HTTPFailWithCode($code,$message)\n{\n\theader(reasonForCode($code));\n\texit($message);\n}",
"public function error ( $message, $code, array $data = array() )\n {\n $this->dispatch( new \\r8\\Log\\Message(\n $message, \\r8\\Log\\Level::ERROR, $code, $data\n ));\n return $this;\n }",
"public function setStatusCode($code)\n {\n $this->statusCode = $code;\n }",
"public function errorCode();",
"public function errorCode();",
"public function errorCode()\n {\n }",
"public function errorString($code) {\n \n if(!is_numeric($code)) {\n return false;\n }\n\n $code = (int)$code;\n \n switch($code) {\n case 0: \n return \"Operation was successful\";\n case 247: \n return \"The userid provided is absent, or incorrect\";\n case 250: \n return \"The provided userid and/or Oauth credentials do not match\";\n case 286: \n return \"No such subscription was found\";\n case 293: \n return \"The callback URL is either absent or incorrect\";\n case 294: \n return \"No such subscription could be deleted\";\n case 304: \n return \"The comment is either absent or incorrect\";\n case 305: \n return \"Too many notifications are already set\";\n case 342: \n return \"The signature (using Oauth) is invalid\";\n case 343: \n return \"Wrong Notification Callback Url don't exist\";\n case 601: \n return \"Too Many Request\";\n case 2554: \n return \"Wrong action or wrong webservice\";\n case 2555: \n return \"An unknown error occurred\";\n case 2556: \n return \"Service is not defined\";\n }\n \n return false;\n }",
"public function client_error($status_code = 404)\n {\n $data = array('status_code' => $status_code);\n\n view('error/client_error', $data);\n }",
"public static function error($code = 500, $data = null)\n {\n self::make(View::load(\"error.$code\", $data), $code);\n }",
"protected static function setStatusCode($code)\n {\n return self::$statusCode = $code;\n\n }",
"function setError($message) {\n global $error;\n $error = (object) array(\n 'message' => $message\n );\n }",
"public function error($str, $code = Response::STATUS_ERROR)\n {\n $this->addError(new Error($str, $code));\n Container::get('response')->setStatus($code);\n if (!Container::get('response')->isStatus(Response::STATUS_OK)) {\n $this->serve();\n }\n }",
"public function setErrorCode(?int $value): void {\n $this->getBackingStore()->set('errorCode', $value);\n }",
"protected function setErrorHeader() {\n\t\tif ($this->response_code >= 400 && $this->response_code < 500) {\n\t\t\theader('HTTP/1.1 ' . $this->response_code . \" \" . SVException::g($this->response_code));\n\t\t\texit(0);\n\t\t}\n\t}",
"protected function setStatusCode($code)\n {\n $this->statusCode = (int) $code;\n }",
"public function setErrors($error) {\n\t\t$params = $this->controller->request->params; \n\t\t$message = $error->getMessage();\n\t\t$url = $this->controller->request->here();\n\t\t$code = ($error->getCode() > 500 && $error->getCode() < 506) ? $error->getCode() : 500;\n\t\t$this->controller->response->statusCode($code);\n\t\t$this->controller->set(array(\n\t\t\t'name' => $message,\n\t\t\t'message' => h($url),\n\t\t\t'error' => $error,\n\t\t));\n\t\tif(isset($params['admin'])){\n\t\t\t$this->controller->render('/Errors/admin_error','admin_login');\n\t\t}else{\n\t\t\techo \"asdsadsadsa\"; die;\n\t\t\t$this->controller->render('/Errors/error','error');\n\t\t}\n\t}",
"public function setErrMsg($value) {\n return $this->set(self::ERR_MSG, $value);\n }",
"public static function message( $error, $code = null ) {\n\t\t// -- Check if a status code was defined, if not use a 404 status code\n\t\tif( $code == null ) {\n\t\t\t$code = Error::$not_found;\n\t\t}\n\n\t\t// -- Set the HTTP status code\n\t\t$code = Error::http_code( $code );\n\n\t\t// -- Make sure a log path is defined in the configuration\n\t\tif( LOGS_PATH ) {\n\n\t\t\t// -- Check if logging is enabled\n\t\t\tif( LOGGING ) {\n\n\t\t\t\t// -- Log the error before it is thrown\n\t\t\t\tLogging::error_log( $error, $code );\n\t\t\t}\n\n\t\t}\n\n\t\t// -- Check if the application is in development mode and return the proper error\n\t\tif( Environment::is_development( Environment::type() ) ) {\n\t\t\treturn Error::trace( $error, $code );\n\t\t} else {\n\t\t\treturn Error::type( $code );\n\t\t}\n\n\t}",
"public function setResponseCode($code) {}",
"public function setErrorCode($errorCode)\n\t{\n\t\t$this->errorCode = $errorCode;\n\t}",
"protected function setError($msg)\n {\n $this->error_count++;\n if ($this->Mailer == 'smtp' and !is_null($this->smtp)) {\n $lasterror = $this->smtp->getError();\n if (!empty($lasterror['error'])) {\n $msg .= $this->lang('smtp_error') . $lasterror['error'];\n if (!empty($lasterror['detail'])) {\n $msg .= ' Detail: '. $lasterror['detail'];\n }\n if (!empty($lasterror['smtp_code'])) {\n $msg .= ' SMTP code: ' . $lasterror['smtp_code'];\n }\n if (!empty($lasterror['smtp_code_ex'])) {\n $msg .= ' Additional SMTP info: ' . $lasterror['smtp_code_ex'];\n }\n }\n }\n $this->ErrorInfo = $msg;\n }",
"public static function setErrorMessage($msg){\n $_SESSION[UtilMessage::ERROR_REGISTER] = $msg;\n }",
"public function setCode($code)\n {\n $this->code = $this->getApiErrorCode($code);\n }",
"private function error($msg)\n {\n\t\t$this->error = true;\n\t\t$this->error_message .= $msg;\n }",
"function setFailMsg($msg) { $this->_failMsg = $msg; }",
"protected static function getError($code) {\n\n\t\tswitch ($code) {\n\t\t\tcase UPLOAD_ERR_OK:\n\t\t\t\treturn false;\n\t\t\tcase UPLOAD_ERR_NO_FILE:\n\t\t\t\treturn elgg_echo('upload:error:no_file');\n\t\t\tcase UPLOAD_ERR_INI_SIZE:\n\t\t\tcase UPLOAD_ERR_FORM_SIZE:\n\t\t\t\treturn elgg_echo('upload:error:file_size');\n\t\t\tdefault:\n\t\t\t\treturn elgg_echo('upload:error:unknown');\n\t\t}\n\t}",
"public function error($message)\n {\n }",
"public function error($message)\n {\n }",
"public function getErrorMessage()\n {\n // then re-apply the error code:\n if(($this->error_code !== 0) && empty($this->error_msg))\n {\n $this->setError($this->error_code);\n }\n return $this->error_msg;\n }",
"protected function _setError($errorCode) {\n $this->errorCode = $errorCode;\n switch ($this->errorCode) {\n default:\n case static::ERROR_UNKNOWN_IDENTITY:\n $this->errorMessage = \\yii::t('app', 'Email or password is invalid');\n break;\n case static::ERROR_NONE:\n $this->errorMessage = '';\n break;\n case static::ERROR_USERNAME_INVALID:\n $this->errorMessage = \\yii::t('app', 'E-mail is invalid');\n break;\n case static::ERROR_PASSWORD_INVALID:\n $this->errorMessage = \\yii::t('app', 'Password is invalid');\n break;\n case static::ERROR_EMAIL_NOT_CONFIRMED:\n $this->errorMessage = \\yii::t('app', 'E-mail is not confirmed');\n break;\n }\n }",
"private function _error() {\n\t\trequire $this->_controllerPath . $this->_errorFile;\n\t\t$this->_controller = new Error();\n\t\t$this->_controller->index('Esta página no existe');\n\t\texit;\n\t}",
"public function setMsgError($error) {\r\n $this->msg_error = $error;\r\n }",
"public function setCode(int $code)\n{\n self::$stored['codes'][] = $code;\n http_response_code($code);\n}",
"function error( $code = 100, $debug_message = null, $secret = null, $addtl_data = array() ) {\n\t\tswitch ($code) :\n\t\t\tcase '101' :\n\t\t\t\t$error = array( 'error' => __( 'Invalid License Key', 'jigoshop-software' ), 'code' => '101' );\n\t\t\tbreak;\n\t\t\tcase '102' :\n\t\t\t\t$error = array( 'error' => __( 'Software has been deactivated', 'jigoshop-software' ), 'code' => '102' );\n\t\t\tbreak;\n\t\t\tcase '103' :\n\t\t\t\t$error = array( 'error' => __( 'Exceeded maximum number of activations', 'jigoshop-software' ), 'code' => '103' );\n\t\t\tbreak;\n\t\t\tcase '104' :\n\t\t\t\t$error = array( 'error' => __( 'Invalid Instance ID', 'jigoshop-software' ), 'code' => '104' );\n\t\t\tbreak;\n\t\t\tcase '105' :\n\t\t\t\t$error = array( 'error' => __( 'Purchase has been upgraded', 'jigoshop-software' ), 'code' => '105' );\n\t\t\tbreak;\n\t\t\tcase '106' :\n\t\t\t\t$error = array( 'error' => __( 'License key for different product. Please check the product for this license key, then download and install the correct product.', 'jigoshop-software' ), 'code' => '106' );\n\t\t\tbreak;\n\t\t\tdefault :\n\t\t\t\t$error = array( 'error' => __( 'Invalid Request', 'jigoshop-software' ), 'code' => '100' );\n\t\t\tbreak;\n\t\tendswitch;\n\t\tif ( isset($this->debug) && $this->debug ) {\n\t\t\tif ( !isset( $debug_message ) || !$debug_message) $debug_message = __( 'No debug information available', 'jigoshop-software' );\n\t\t\t$error['additional info'] = $debug_message;\n\t\t}\n\t\tif ( isset( $addtl_data['secret'] ) ) {\n\t\t\t$secret = $addtl_data['secret'];\n\t\t\tunset( $addtl_data['secret'] );\n\t\t}\n\t\tforeach ( $addtl_data as $k => $v ) {\n\t\t\t$error[$k] = $v;\n\t\t}\n\t\t$secret = ( $secret ) ? $secret : 'null';\n\t\t$error['timestamp'] = time();\n\t\tforeach ( $error as $k => $v ) {\n\t\t\tif ( $v === false ) $v = 'false';\n\t\t\tif ( $v === true ) $v = 'true';\n\t\t\t$sigjoined[] = \"$k=$v\";\n\t\t}\n\t\t$sig = implode( '&', $sigjoined );\n\t\t$sig = 'secret=' . $secret . '&' . $sig;\n\t\tif ( !$this->debug ) $sig = md5( $sig );\n\t\t$error['sig'] = $sig;\n\t\t$json = $error;\n\t\theader( 'Cache-Control: no-store' );\n\t\tif ( function_exists( 'header_remove' ) ) {\n\t\t\theader_remove( 'Cache-Control' );\n\t\t\theader_remove( 'Pragma' );\n\t\t\theader_remove( 'Expires' );\n\t\t\theader_remove( 'Last-Modified' );\n\t\t\theader_remove( 'X-Pingback' );\n\t\t\theader_remove( 'X-Powered-By' );\n\t\t\theader_remove( 'Set-Cookie' );\n\t\t} else {\n\t\t\theader( 'Cache-Control: ' );\n\t\t\theader( 'Pragma: ' );\n\t\t\theader( 'Expires: ' );\n\t\t\theader( 'X-Pingback: ' );\n\t\t\theader( 'X-Powered-By: ' );\n\t\t\theader( 'Set-Cookie: ' );\n\t\t}\n\t\theader( 'Content-Type: application/json' );\n\t\tdie( json_encode( $json ) );\n\t\texit;\n\t}",
"private function errMsgForgetPassword($code_error){\n // 0 = Email Berhasil Diganti.\n // 1 = Email Belum Diisi.\n // 2 = Format Email Tidak Valid.\n // 3 = Email Tidak Ditemukan.\n // 4 = Pengiriman Email Gagal.\n $this->data[\"err_msg\"] = \"\";\n switch ($code_error) {\n case '1':\n $this->data[\"err_msg\"] = \"Silahkan Mengisi Email pada Field yang Disediakan.\";\n break;\n case '2':\n $this->data[\"err_msg\"] = \"Format Email yang Anda Isikan Tidak Valid.\";\n break;\n case '3':\n $this->data[\"err_msg\"] = \"Email Anda Tidak Terdaftar.\";\n break;\n case '4':\n $this->data[\"err_msg\"] = \"Maaf, Pengiriman Email Gagal. Silahkan Hubungi Pihak PT Semen Baturaja (Persero) Tbk.\";\n break;\n case '5':\n $this->data[\"err_msg\"] = \"Password Baru Telah Dikirimkan ke Alamat Email Anda.\";\n break;\n default:\n $this->data[\"err_msg\"] = \"-\";\n break;\n }\n }",
"public function error($code = 500)\n {\n $view = view('errors/'.$code);\n\n return $this->respond($view, $code);\n }",
"private function message($code = NULL){\n $returnResult = false;\n if($code != NULL || $code != ''){\n $message = [\n \"401\" => \"Parameter mismatch\",\n \"402\" => \"Content Not Found\",\n \"403\" => \"Ran into exception\",\n \"200\" => \"Created Successfully\",\n \"201\" => \"Successfully Updated\",\n \"202\" => \"Successfully deleted\",\n \"203\" => \"User not present\",\n \"204\" => \"Group Deleted\",\n \"205\" => \"Group cannot be deleted, user present\"\n ];\n $returnResult = $message[$code];\n }\n return $returnResult;\n }",
"public function getErrorCode(): int;",
"public function checkError($code)\n {\n $message = null;\n switch ($code) {\n case UPLOAD_ERR_INI_SIZE:\n $message = \"The uploaded file exceeds the upload_max_filesize directive in php.ini\";\n break;\n case UPLOAD_ERR_FORM_SIZE:\n $message = \"The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form\";\n break;\n case UPLOAD_ERR_PARTIAL:\n $message = \"The uploaded file was only partially uploaded\";\n break;\n case UPLOAD_ERR_NO_FILE:\n $message = \"No file was uploaded\";\n break;\n case UPLOAD_ERR_NO_TMP_DIR:\n $message = \"Missing a temporary folder\";\n break;\n case UPLOAD_ERR_CANT_WRITE:\n $message = \"Failed to write file to disk\";\n break;\n case UPLOAD_ERR_EXTENSION:\n $message = \"File upload stopped by extension\";\n break;\n\n }\n return $message;\n }",
"public function setErrorCode(?string $value): void {\n $this->getBackingStore()->set('errorCode', $value);\n }"
] | [
"0.7832279",
"0.7753181",
"0.76046777",
"0.7274896",
"0.715935",
"0.70206666",
"0.68635154",
"0.686114",
"0.68537945",
"0.6839175",
"0.67791873",
"0.6759666",
"0.67230093",
"0.6699119",
"0.6651393",
"0.6636664",
"0.6607126",
"0.6603758",
"0.65847623",
"0.65840334",
"0.6582935",
"0.6528517",
"0.64812624",
"0.6471578",
"0.6441674",
"0.64383805",
"0.6435801",
"0.6431692",
"0.6413636",
"0.6398242",
"0.63919467",
"0.63876235",
"0.6387124",
"0.6380746",
"0.6379421",
"0.6379367",
"0.6364124",
"0.63592684",
"0.63591105",
"0.6349716",
"0.63445896",
"0.63173306",
"0.63160616",
"0.63011366",
"0.6282736",
"0.6277213",
"0.6264024",
"0.62536585",
"0.62521017",
"0.62281895",
"0.6224644",
"0.62218916",
"0.6219347",
"0.62152493",
"0.6197894",
"0.6182594",
"0.61667264",
"0.61654645",
"0.61646086",
"0.61508465",
"0.61455953",
"0.61449724",
"0.6143905",
"0.6142184",
"0.6142184",
"0.61150074",
"0.6108833",
"0.6105793",
"0.61039823",
"0.6061434",
"0.6054652",
"0.6053922",
"0.6052887",
"0.60520196",
"0.60486704",
"0.60482484",
"0.60473824",
"0.6042998",
"0.6033965",
"0.60338104",
"0.6032717",
"0.6029054",
"0.6023611",
"0.6021021",
"0.60022485",
"0.59965503",
"0.59868515",
"0.59868515",
"0.59818876",
"0.59771657",
"0.5971268",
"0.59697706",
"0.596462",
"0.59532094",
"0.5945863",
"0.594256",
"0.59403825",
"0.5938878",
"0.5936756",
"0.59255904"
] | 0.7302513 | 3 |
Perform sign up process. | public function signUp()
{
switch ($_SERVER['REQUEST_METHOD'])
{
case 'GET':
parent::view("Sign Up", "signup.php");
break;
case 'POST':
$newUser = new SignUpViewModel();
$newUser->setEmail($_POST['email']);
$newUser->setUsername($_POST['username']);
$newUser->setPassword($_POST['password']);
$newUser->setPassword2($_POST['password2']);
$userManager = new UserManager($this->userRepository);
$result = $userManager->signUp($newUser);
if($result)
{
header("location:/". APP_HOST . "account/login");
}
else
{
parent::view("Sign Up","signup.php",
$newUser, null, $userManager->getMessages());
}
break;
default:
break;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function sign_up()\n\t{\n\t\t$post = $this->input->post();\n\t\t$return = $this->accounts->register($post, 'settings'); /*this will redirect to settings page */\n\t\t// debug($this->session);\n\t\t// debug($return, 1);\n\t}",
"public function p_signup(){\n\t\tforeach($_POST as $field => $value){\n\t\t\tif(empty($value)){\n\t\t\t\tRouter::redirect('/users/signup/empty-fields');\n\t\t\t}\n\t\t}\n\n\t\t#check for duplicate email\n\t\tif ($this->userObj->confirm_unique_email($_POST['email']) == false){\n\t\t\t#send back to signup page\n\t\t\tRouter::redirect(\"/users/signup/duplicate\");\n\t\t}\n\n\t\t#adding data to the user\n\t\t$_POST['created'] = Time::now();\n\t\t$_POST['modified'] = Time::now();\n\n\t\t#encrypt password\n\t\t$_POST['password'] = sha1(PASSWORD_SALT.$_POST['password']);\n\n\t\t#create encrypted token via email and a random string\n\t\t$_POST['token'] = sha1(TOKEN_SALT.$_POST['email'].Utils::generate_random_string());\n\n\t\t#Insert into the db\n\t\t$user_id = DB::instance(DB_NAME)->insert('users', $_POST);\n\n\t\t# log in the new user\n\n\t\tsetcookie(\"token\", $_POST['token'], strtotime('+2 weeks'), '/');\n\n\t\t# redirect to home\n\t\tRouter::redirect('/users/home');\n\t\t\n\t}",
"private static function signup() {\r\n\t\t$user = new User($_POST);\r\n\t\t$_SESSION['badUser'] = new User($user->getParameters()); // used by view to temporarily store signup form input\r\n\t\t$_SESSION['badUser']->setErrors($user->getErrors());\r\n\t\t$_SESSION['badUser']->clearPassword();\r\n\r\n\t\t// check for validation errors\r\n\t\tif ($user->getErrorCount() > 0) {\r\n\t\t\tself::alertMessage('danger', 'One or more fields contained errors. Check below for details. Make any needed corrections and try again.');\r\n\t\t\tSignupView::show();\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// make sure user name is not already taken\r\n\t\tif (UsersDB::userExists($user->getUserName())) {\r\n\t\t\tself::alertMessage('danger', 'User name already exists. You must choose another.');\r\n\t\t\tSignupView::show();\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// make sure main character name is not already taken\r\n\t\tif (UsersDB::mainExists($user->getMainName())) {\r\n\t\t\tself::alertMessage('danger', 'The main character name is already associated with another user.');\r\n\t\t\tSignupView::show();\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// user name available. send add request to database and check for success\r\n\t\tUsersDB::addUser($user);\r\n\t\tif ($user->getErrorCount() > 0) {\r\n\t\t\tself::alertMessage('danger', 'Failed to add user to database. Contact support.');\r\n\t\t\tSignupView::show();\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// user is valid and should be logged in at this point\r\n\t\tunset($_SESSION['badUser']);\r\n\t\t$_SESSION['user'] = $user;\r\n\r\n\t\t// create a random verification code, text it to the user's phone, and display verification page\r\n\t\tTextMessageController::sendVerificationCode();\r\n\t\tVerificationView::show();\r\n\t}",
"public function signup()\n {\n if (isset($_POST['signUp'])) {\n $userExist = $this->checkIfUserExist($_POST['login']);\n $userPassword = $_POST['password'];\n \n if ($userExist === false) {\n if ($userPassword === $_POST['passwordConfirm']) {\n $hashPassword = password_hash($userPassword, PASSWORD_DEFAULT);\n \n $affectedUser = $this->usersManager->setNewUser($_POST['firstName'], $_POST['lastName'], $_POST['login'], $hashPassword, $_POST['email'], 'reader');\n \n if ($affectedUser === false) {\n header('Location: auth&alert=signup');\n exit();\n } else {\n header('Location: auth&alert=success');\n exit();\n }\n } else {\n header('Location: auth&alert=passwords');\n exit();\n }\n } else {\n header('Location: auth&alert=userSignup');\n exit();\n }\n } else {\n throw new Exception($this->datasError);\n }\n\n }",
"public function signupAction()\n {\n $this->tag->setTitle(__('Sign up'));\n $this->siteDesc = __('Sign up');\n\n if ($this->request->isPost() == true) {\n $user = new Users();\n $signup = $user->signup();\n\n if ($signup instanceof Users) {\n $this->flash->notice(\n '<strong>' . __('Success') . '!</strong> ' .\n __(\"Check Email to activate your account.\")\n );\n } else {\n $this->view->setVar('errors', new Arr($user->getMessages()));\n $this->flash->warning('<strong>' . __('Warning') . '!</strong> ' . __(\"Please correct the errors.\"));\n }\n }\n }",
"public function p_signup() {\n\t#print_r($_POST);\n\n\t# Prevent SQL injection attacks by sanitizing user entered data\n\t$_POST = DB::instance(DB_NAME)->sanitize($_POST);\n\n\t#encrypt\n\t$_POST['password'] = sha1(PASSWORD_SALT.$_POST['password']);\n\t#can override password salt in application version in core config\n\n\t$_POST['token'] = sha1(TOKEN_SALT.$_POST['email'].Utils::generate_random_string());\n\t#token salt, users email, random string then hashed\n\n\t$_POST['created'] = Time::now(); #could mimic different time\n\t$_POST['modified'] = Time::now(); #time stamp\n\n\t#check if the address is not in use in the system\n\t$q = \"SELECT email\n\tFROM users WHERE email = '\".$_POST['email'].\"'\";\n\n\t$email = DB::instance(DB_NAME)->select_field($q);\n\n\tif($email == $_POST['email'] && $_POST['email' != \"\"]){\t\n\n\t\t$address_in_use = \"The email address you have entered is already in use. Please pick another.\";\n\t\tRouter::redirect(\"/users/signup/error=$address_in_use\");\n\t}\n\n\tif($_POST['email'] == \"\" || $_POST['first_name'] == \"\" || $_POST['last_name'] == \"\" || $_POST['password'] == \"\" ){\n\n\t\t$required = \"All fields on this form are required.\";\n\t\tRouter::redirect(\"/users/signup/error: $required\");\n\t}\n\telse{\n\n\t\t$user_id = DB::instance(DB_NAME)->insert(\"users\", $_POST);\n\n\n\t\t# For now, just confirm they've signed up - we can make this fancier later\n\t\techo \"You're registered! Now go <a href='/users/login'>add issue</a>\";\n\t\tRouter::redirect(\"/users/login\");\n\t}\t\n}",
"public function signup()\n\t{\n\t\t$data = $this->check($this->as_array());\n\t\t\n\t\t$user = Sprig::factory('user');\n\t\t$user->values($data);\n\t\treturn $user->signup();\n\t}",
"public function sign_up()\n {\n\n }",
"public function handleSignUp()\n {\n $data = \\Request::all();\n $result = \\DB::transaction(function() use($data) {\n $data['type'] = Member::USER_TYPE_ID;\n // honeypot checking for valid submission\n $this->companyService->honeypotCheck($data);\n // get the plan\n $plan = Plan::findOrFail($data['plan_id']);\n // create the company\n list($company, $role) = $this->companyService->create($data);\n // create the user\n $data['company_id'] = $company->id;\n $data['roles'] = [$role->id];\n $data['is_owner'] = true;\n $user = $this->userService->create($data);\n // send confirmation email\n $mail_data = [\n 'plan' => $plan->name,\n 'price_month' => \\Format::currency($plan->price_month),\n 'price_year' => \\Format::currency($plan->price_year),\n 'trial_end_date' => \\Carbon::now()->addDays(14)->toFormattedDateString()\n ];\n \\Mail::to($company->email)->send(new SignUpConfirmation($mail_data));\n // find the user and log them in\n $auth_user = \\Auth::findById($user->id);\n \\Auth::login($auth_user, true);\n // set message and redirect\n \\Msg::success('Thank you for signing up with Tellerr!');\n return [\n 'route' => 'account'\n ];\n });\n return redir($result['route']);\n }",
"public function signup()\n {\n $id = (int) Input::get(\"id\");\n $md5 = Input::get(\"secret\");\n if (!$id || !$md5) {\n Redirect::autolink(URLROOT, Lang::T(\"INVALID_ID\"));\n }\n $row = Users::getPasswordSecretStatus($id);\n if (!$row) {\n $mgs = sprintf(Lang::T(\"CONFIRM_EXPIRE\"), Config::TT()['SIGNUPTIMEOUT'] / 86400);\n Redirect::autolink(URLROOT, $mgs);\n }\n if ($row['status'] != \"pending\") {\n Redirect::autolink(URLROOT, Lang::T(\"ACCOUNT_ACTIVATED\"));\n die;\n }\n if ($md5 != $row['secret']) {\n Redirect::autolink(URLROOT, Lang::T(\"SIGNUP_ACTIVATE_LINK\"));\n }\n $secret = Helper::mksecret();\n $upd = Users::updatesecret($secret, $id, $row['secret']);\n if ($upd == 0) {\n Redirect::autolink(URLROOT, Lang::T(\"SIGNUP_UNABLE\"));\n }\n Redirect::autolink(URLROOT . '/login', Lang::T(\"ACCOUNT_ACTIVATED\"));\n }",
"public function p_signup() {\n\n $q= 'Select email \n From users \n WHERE email=\"'.$_POST['email'].'\"';\n # see if the email exists\n $emailexists= DB::instance(DB_NAME)->select_field($q);\n \n # email exists, throw an error\n if($emailexists){ \n \n Router::redirect(\"/users/signup/error\"); \n \n }\n \n #requires all fields to be entered if java script is disabled, otherwise thow a different error\n \n elseif (!$_POST['email'] OR !$_POST['last_name'] OR !$_POST['first_name'] OR !$_POST['password']) {\n Router::redirect(\"/users/signup/error2\"); \n }\n # all is well , proceed with signup\n else{\n \n $_POST['created']= Time::now();\n $_POST['password']= sha1(PASSWORD_SALT.$_POST['password']); \n $_POST['token']= sha1(TOKEN_SALT.$_POST['email'].Utils::generate_random_string()); \n\n # add user to the database and redirect to users login page \n $user_id=DB::instance(DB_NAME)->insert_row('users',$_POST);\n # Create users first Notebook\n $notebook['name']= $_POST['first_name'].' Notebook';\n $notebook['user_id']= $user_id;\n $notebook['created']= Time::now(); \n $notebook['modified']= Time::now(); \n DB::instance(DB_NAME)->insert_row('notebooks',$notebook); \n\n Router::redirect('/users/login');\n }\n \n }",
"function process_signup_params($db)\n{\n // Check if we should login the user\n if (isset($_POST['signup'])) {\n create_account($db, $_POST['signup_name'], $_POST['signup_username'], $_POST['signup_password'], $_POST['signup_confirm_password']);\n }\n}",
"public function onSignUp()\n {\n $data = post();\n $data['requires_confirmation'] = $this->requiresConfirmation;\n\n if (app(SignUpHandler::class)->handle($data, (bool)post('as_guest'))) {\n if ($this->requiresConfirmation) {\n return ['.mall-signup-form' => $this->renderPartial($this->alias . '::confirm.htm')];\n }\n\n return $this->redirect();\n }\n }",
"public function signup()\n {\n if ($this->model->signup())\n $this->redirect(\"home\");\n }",
"public function signUp(): void\n {\n $request_method = filter_input(INPUT_SERVER, \"REQUEST_METHOD\");\n if ('GET' === $request_method) {\n $profile = (new ProfileDao())->getInfo();\n // Guard against registration if already an admin\n if (!empty($profile)) {\n header(\"Location: /admin/signin\");\n }\n // If no admin exists allows the form\n else {\n require implode(DIRECTORY_SEPARATOR, [TEMPLATES, 'admin', 'signup.html.php']);\n }\n //POST a admin\n } elseif ('POST' === $request_method) {\n\n $args = [\n \"email\" => [],\n \"passwordOne\" => [],\n \"passwordTwo\" => [],\n ];\n\n $admin = filter_input_array(INPUT_POST, $args);\n\n if (empty($admin['email']) || empty($admin['passwordOne']) || empty($admin['passwordTwo'])) {\n $error_messages = \"Merci de completer tous les champs !\";\n } elseif ($_POST['passwordOne'] !== $_POST['passwordTwo']) {\n $error_messages = \"Merci de mettre les memes mots de passe !\";\n } else {\n $passwordHash = password_hash($_POST['passwordOne'], PASSWORD_DEFAULT);\n $error_messages = \"\";\n $admin = (new Profile())->setFirstName(\"John\")\n ->setLastName(\"Doe\")\n ->setGender(1)\n ->setAdress(null)\n ->setCp(69000)\n ->SetCity(\"Lyon\")\n ->setEmail($admin['email'])\n ->setPhone(null)\n ->setLinkedinUrl(null)\n ->setGithubUrl(null)\n ->setTwitterUrl(null)\n ->setPassword($passwordHash)\n ->setDriveLicence(null)\n ->setCatchphrase(null)\n ->setBirthdate(null);\n }\n if (empty($error_messages)) {\n try {\n (new PortfolioDao())->signUp($admin);\n header(\"Location: /admin/signin\");\n exit;\n } catch (PDOException $e) {\n echo $e->getMessage();\n }\n } else {\n //ERROR 404\n }\n }\n }",
"public function signup() {\n $this->template->content = View::instance(\"v_users_signup\");\n \n # Render the view\n echo $this->template;\n }",
"public function createUser()\r\n {\r\n // use sign up in AuthController\r\n }",
"public function createUser()\r\n {\r\n // use sign up in AuthController\r\n }",
"public static function signUp()\n {\n global $cont;\n $name = $_POST['name'];\n $email = $_POST['email'];\n $password = SHA1($_POST['password']);\n\n $signup = $cont->prepare(\"INSERT INTO users(`name`, `email`, `password` , `role`) VALUES (? , ? , ? , ?) \");\n $signup->execute([$name , $email , $password , 0]);\n\n session_start();\n $_SESSION['message'] = \"Data entering correctly\";\n header(\"location:../login.php\");\n }",
"public function action_signup()\r\n\t{\r\n\t\t$this->title = 'Sign Up';\r\n\t\t$user = ORM::factory('user');\r\n\t\t$errors = array();\r\n\t\tif ($_POST)\r\n\t\t{\r\n\t\t\t$user->values($_POST);\r\n\t\t\t$user->level_id = Model_User::DEFAULT_LEVEL;\r\n\t\t\tif ($user->check())\r\n\t\t\t{\r\n\t\t\t\t$user->save(); // must save before adding relations\r\n\t\t\t\t$user->add('roles', ORM::factory('role', array('name'=>'login')));\r\n\t\t\t\t$this->session->set($this->success_session_key, \"Your account is set up.\");\r\n\t\t\t\t$user->login($_POST);\r\n\t\t\t\t$user->create_sample_form();\r\n\t\t\t\t$this->request->redirect('account');\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$errors = $user->validate()->errors('validate');\r\n\t\t\t}\r\n\t\t}\r\n\t\t$view = 'account/signup';\r\n\t\t$vars = array(\r\n\t\t\t'user' => $user,\r\n\t\t\t'errors' => $errors,\r\n\t\t);\r\n\t\t$this->template->content = View::factory($view)->set($vars);\r\n\t}",
"public function signup(){\n \n $this->data[\"title_tag\"]=\"Lobster | Accounts | Signup\";\n \n $this->view(\"accounts/signup\",$this->data);\n }",
"public function signup()\n\t{\n $user = new User();\n\n // If user can succesfully signup then signin\n if ($user->signup(Database::connection(), $_POST['username'], $_POST['password']))\n {\n $_SESSION['id'] = $user->id;\n return True;\n }\n\n return False;\n }",
"function signUp() {\n\t\tif (isset($_REQUEST['username'])) {\n\t\t\t$username = $_REQUEST['username'];\n\t\t\t$password = $_REQUEST['password'];\n\t\t\t$email = $_REQUEST['email'];\n\t\t\t$phone = $_REQUEST['phone'];\n\t\t\t\n\t\t\tinclude_once(\"users.php\");\n\n\t\t\t$userObj=new users();\n\t\t\t$r=$userObj->addUser($username,$password,$email,$phone);\n\t\t\t\n\t\t\tif(!$r){\n\t\t\t\techo '{\"result\":0, \"message\":\"Error signing up\"}';\n\t\t\t\treturn;\n\t\t\t} else {\n\t\t\t\techo '{\"result\":1,\"message\": \"You have successfully signed up for Proximity\"}'; \n\t\t\t}\n\t\t}\n\t}",
"function signUp() {\n if ($this->getRequestMethod() != 'POST') {\n $this->response('', 406);\n }\n \n $user = json_decode(file_get_contents('php://input'),true);\n if (!self::validateUser($user['username'], $user['password'])) {\n $this->response('', 406);\n }\n\t \n\t // check if user already exists\n\t $username_to_check = $user['username'];\n\t $query = \"select * from users where username='$username_to_check'\";\n\t $r = $this->conn->query($query) or die($this->conn->error.__LINE__);\t\n\t if ($r->num_rows > 0) {\n\t \t$this->response('', 406);\n\t }\t\n\t\n $user['password'] = self::getHash($user['username'], $user['password']);\n $keys = array_keys($user);\n $columns = 'username, password';\n $values = \"'\" . $user['username'] . \"','\" . $user['password'] . \"'\"; \n $query = 'insert into users (' . $columns . ') values ('. $values . ');';\n \n if(!empty($user)) {\n $r = $this->conn->query($query) or die($this->conn->error.__LINE__);\n $success = array('status' => 'Success', 'msg' => 'User Created Successfully.', 'data' => $user);\n $this->response(json_encode($success),200);\n } else {\n $this->response('',204);\n }\n }",
"public function signupAction()\n {\n $form = new SignUpForm();\n\n if ($this->request->isPost()) {\n\n if ($form->isValid($this->request->getPost()) != false) {\n\n $user = new Users();\n\n $user->assign(array(\n 'name' => $this->request->getPost('name', 'striptags'),\n 'email' => $this->request->getPost('email'),\n 'password' => $this->security->hash($this->request->getPost('password')),\n 'profilesId' => 2\n ));\n\n if ($user->save()) {\n return $this->dispatcher->forward(array(\n 'controller' => 'index',\n 'action' => 'index'\n ));\n }\n\n $this->flash->error($user->getMessages());\n }\n }\n\n $this->view->form = $form;\n }",
"public function signupAction()\n {\n $form = new SignUpForm();\n\n if ($this->request->isPost()) {\n\n if ($form->isValid($this->request->getPost()) != false) {\n\n $user = new Users();\n\n $user->assign(array(\n 'name' => $this->request->getPost('name', 'striptags'),\n 'email' => $this->request->getPost('email'),\n 'password' => $this->security->hash($this->request->getPost('password')),\n 'profilesId' => 2\n ));\n\n if ($user->save()) {\n return $this->dispatcher->forward(array(\n 'controller' => 'index',\n 'action' => 'index'\n ));\n }\n\n $this->flash->error($user->getMessages());\n }\n }\n\n $this->view->form = $form;\n }",
"public function signUp() {\n if ($this->request->is('post')) {\n\n $this->User->create();\n\n if ($this->User->save($this->request->data['signUp'])) {\n $this->Flash->set(__(\"Your user has been created\"),array(\n 'element' => 'success'\n ));\n return $this->redirect(array('action' => 'index'));\n }\n $this->Flash->set(\n __('The user could not be saved. Please, try again.',\n array(\n 'element' => 'error.ctp'\n ))\n );\n }\n\n $this->autoRender = false;\n }",
"abstract protected function _queueSignup($signup);",
"public function signup(){\n\t\t\trequire 'models/Login_model.php';\n\t\t\t$model = new Login_model();\n\t\t\t$model->signup();\n\t\t\theader('location:'.URL);\n\t\t}",
"function signup() {\n\n $results = array();\n $results['errorReturnAction'] = \"signup\";\n\n if ( isset( $_POST['signup'] ) ) {\n\n // User has posted the signup form: attempt to register the user\n $emailAddress = isset( $_POST['emailAddress'] ) ? $_POST['emailAddress'] : \"\";\n $password = isset( $_POST['password'] ) ? $_POST['password'] : \"\";\n $passwordConfirm = isset( $_POST['passwordConfirm'] ) ? $_POST['passwordConfirm'] : \"\";\n\n if ( !$emailAddress || !$password || !$passwordConfirm ) {\n $results['errorMessage'] = \"Please fill in all the fields in the form.\";\n require( TEMPLATE_PATH . \"/errorDialog.php\" );\n return;\n }\n\n if ( $password != $passwordConfirm ) {\n $results['errorMessage'] = \"The two passwords you entered didn't match. Please try again.\";\n require( TEMPLATE_PATH . \"/errorDialog.php\" );\n return;\n }\n\n if ( User::getByEmailAddress( $emailAddress ) ) {\n $results['errorMessage'] = \"You've already signed up using that email address!\";\n require( TEMPLATE_PATH . \"/errorDialog.php\" );\n return;\n }\n\n $user = new User( array( 'emailAddress' => $emailAddress, 'plaintextPassword' => $password ) );\n $user->encryptPassword();\n $user->insert();\n $user->createLoginSession();\n header( \"Location: \" . APP_URL );\n\n } else {\n\n // User has not posted the signup form yet: display the form\n require( TEMPLATE_PATH . \"/signupForm.php\" );\n }\n}",
"function handleSignUpRequest() {\n if (connectToDB()) {\n if (array_key_exists('signUp', $_POST)) {\n signUpRequest();\n }\n disconnectFromDB();\n }\n}",
"public function p_signup() {\n\t\t$email_a = $_POST['email'];\n\n\t\t//check to ensure there is not already a user with that email (a duplicate)\n\t\t$q = \"SELECT users.email\n\t\t\t\tFROM users \n\t \tWHERE users.email = '\".$_POST['email'].\"'\n\t \t\";\n\t\t\t\n\t\t$email_validation = DB::instance(DB_NAME)->select_field($q);\n\n\t\t//validation of empty fields\n\n\t\tif (empty($_POST['first_name'])) {\n\t\t\tRouter::redirect(\"/users/signup/signup_error\");\n\n \t} elseif (empty($_POST['last_name'])) {\n \t\tRouter::redirect(\"/users/signup/signup_error\");\n \t\n \t} elseif (empty($_POST['email'])) {\n \tRouter::redirect(\"/users/signup/signuperror\");\n \t\n \t} elseif (empty($_POST['password'])) {\n \tRouter::redirect(\"/users/signup/signup_error\");\n \n //check for valid email syntax\t\n \t} elseif (!filter_var($email_a, FILTER_VALIDATE_EMAIL)) {\n \t\n\t\t\tRouter::redirect(\"/users/signup_invalid/signup_invalid\");\n\t\t\n \t} \n \t//check duplicate\n \telseif ($email_validation) {\n\t\t\t\t\n\t\t\tRouter::redirect(\"/users/signup_duplicate/signup_duplicate\");\n\t\t\n\t\t//signup the user and send info to DB\t\n\t\t} else {\n\n\t\t\t\t//1. insert the data into the DB\n\n\t\t\t\t$_POST['created'] = Time::now();\n\t\t\t\t$_POST['modified'] = Time::now();\n\t\t\t\t$_POST['password'] = sha1(PASSWORD_SALT.$_POST['password']);\n\t\t\t\t$_POST['token'] = sha1(TOKEN_SALT.$_POST['email'].Utils::generate_random_string());\n\n\t\t\t\t$user_id = DB::instance(DB_NAME)->insert('users', $_POST);\n\n\t\t\t\t//2. get the user id in order to upload the default photo for the user\n\t\t\t\t//(Currently this is not working. Please see the open items and review items explanation in github readme).\n\n\t\t\t\t\t$q_userID = \"SELECT users.user_id\n\t\t\t\t\tFROM users \n\t\t \tWHERE users.email = '\".$_POST['email'].\"'\n\t\t \t\";\n\t\t\t\t\n\t\t\t\t\t$user_validation = DB::instance(DB_NAME)->select_field($q_userID);\n\t\t\t\t\n\t\t\t\t//2a. Insert a default pic for user. See error note in item 2 above.\n\t\t\t\t//This uploads a \"broken link. Since INNER JOIN is used on posts, \n\t\t\t\t//a profile picture is needed (even if the link is broken in the view).\n\n\t\t\t\t\t$data = Array('pic_id' => $user_validation,\n\t\t\t\t\t\t\t'user_id' => $user_validation,\n\t\t\t\t\t\t\t'created' => Time::now(),\n\t\t\t\t\t\t\t'picture' => \"/uploads/profiles/blank_profile.jpg\");\n\n\t\t\t\t\t$user_id = DB::instance(DB_NAME)->update_or_insert_row('profilePics', $data);\n\n\t\t\t\t\n\t\t\t\t//3. upon signup, give the user a token to continue directly to their page\n\n\t\t\t\t$q2 = \"SELECT token\n\t\t\t\t\tFROM users \n\t\t \tWHERE email = '\".$_POST['email'].\"'\n\t\t \tAND password = '\".$_POST['password'].\"'\";\n\n\t\t\t\t$token = DB::instance(DB_NAME)->select_field($q2);\n\n\t\t\t\tsetcookie(\"token\", $token, strtotime('+1 year'), '/');\n\n\t\t\t\tRouter::redirect(\"/users/profile\");\n\t\t}\t\t\n\t\n\t}",
"public function signupAction()\n {\n $realm = $this->_getParam('realm', null);\n\n if (is_null($realm)) {\n throw new Ot_Exception_Input('msg-error-realmNotFound');\n }\n\n // Set up the auth adapter\n $authAdapter = new Ot_Model_DbTable_AuthAdapter();\n $adapter = $authAdapter->find($realm);\n\n if (is_null($adapter)) {\n\n throw new Ot_Exception_Data(\n $this->view->translate('ot-login-signup:realmNotFound', array('<b>' . $realm . '</b>'))\n );\n }\n \n if ($adapter->enabled == 0) {\n throw new Ot_Exception_Access('msg-error-authNotSupported');\n }\n\n $className = (string)$adapter->class;\n $auth = new $className();\n\n if (!$auth->manageLocally()) {\n throw new Ot_Exception_Access('msg-error-authNotSupported');\n }\n\n if (!$auth->allowUserSignUp()) {\n throw new Ot_Exception_Access('msg-error-authNotAllowed');\n }\n\n $form = new Ot_Form_Signup();\n $form->removeElement('realm');\n\n if ($this->_request->isPost()) {\n if ($form->isValid($_POST)) {\n if ($form->getValue('password') == $form->getValue('passwordConf')) {\n\n $accountData = array(\n 'username' => $form->getValue('username'),\n 'password' => md5($form->getValue('password')),\n 'realm' => $realm,\n 'role' => $this->_helper->configVar('newAccountRole'),\n 'emailAddress' => $form->getValue('emailAddress'),\n 'firstName' => $form->getValue('firstName'),\n 'lastName' => $form->getValue('lastName'), \n 'timezone' => $form->getValue('timezone'),\n );\n\n $account = new Ot_Model_DbTable_Account();\n if ($account->accountExists($accountData['username'], $accountData['realm'])) {\n $this->_helper->messenger->addError('msg-error-usernameTaken');\n } else {\n\n $dba = Zend_Db_Table::getDefaultAdapter();\n $dba->beginTransaction();\n\n try {\n $accountData['accountId'] = $account->insert($accountData);\n\n $aar = new Ot_Account_Attribute_Register();\n\n $vars = $aar->getVars($accountData['accountId']);\n\n $values = $form->getValues();\n\n foreach ($vars as $varName => $var) {\n if (isset($values['accountAttributes'][$varName])) {\n $var->setValue($values['accountAttributes'][$varName]);\n\n $aar->save($var, $accountData['accountId']);\n }\n }\n\n $cahr = new Ot_CustomAttribute_HostRegister();\n\n $thisHost = $cahr->getHost('Ot_Profile');\n\n if (is_null($thisHost)) {\n throw new Ot_Exception_Data('msg-error-objectNotSetup');\n }\n\n $customAttributes = $thisHost->getAttributes($accountData['accountId']);\n\n foreach ($customAttributes as $attributeName => $a) {\n\n if (array_key_exists($attributeName, $values['customAttributes'])) {\n\n $a['var']->setValue($values['customAttributes'][$attributeName]);\n\n $thisHost->saveAttribute($a['var'], $accountData['accountId'], $a['attributeId']);\n }\n }\n } catch (Exception $e) {\n $dba->rollback();\n throw $e;\n }\n\n\n $dba->commit();\n\n $loggerOptions = array(\n 'attributeName' => 'accountId',\n 'attributeId' => $accountData['accountId'],\n );\n\n $this->_helper->log(\n Zend_Log::INFO, 'User ' . $accountData['username'] . ' created an account.', $loggerOptions\n );\n\n $dt = new Ot_Trigger_Dispatcher();\n $dt->setVariables($accountData);\n $dt->password = $form->getValue('password');\n $dt->loginMethod = $realm;\n $dt->dispatch('Login_Index_Signup');\n \n $authAdapterModel = new Ot_Model_DbTable_AuthAdapter();\n $adapter = $authAdapterModel->find($realm);\n $className = (string)$adapter->class;\n\n // Set up the authentication adapter\n $authAdapter = new $className($accountData['username'], $form->getValue('password'));\n\n $auth = Zend_Auth::getInstance();\n\n $authRealm = new Zend_Session_Namespace('authRealm'); \n $authRealm->setExpirationHops(1);\n $authRealm->realm = $realm;\n $authRealm->autoLogin = $authAdapter->autoLogin();\n\n // Attempt authentication, saving the result\n $result = $auth->authenticate($authAdapter);\n\n $authRealm->unsetAll();\n \n $req = new Zend_Session_Namespace(Zend_Registry::get('siteUrl') . '_request');\n \n $this->_helper->messenger->addSuccess('msg-info-accountCreated');\n \n if ($result->isValid()) { \n \n $account = new Ot_Model_DbTable_Account();\n $thisAccount = $account->getByUsername($accountData['username'], $realm);\n \n $auth->getStorage()->write($thisAccount);\n \n if (isset($req->uri) && $req->uri != '') {\n $uri = $req->uri;\n\n $req->unsetAll();\n \n $this->_helper->redirector->gotoUrl($uri);\n } else { \n \n $this->_helper->redirector->gotoRoute(array(), 'default', true);\n }\n } else { \n $this->_helper->redirector->gotoRoute(array('realm' => $realm), 'login', true);\n }\n }\n } else {\n $this->_helper->messenger->addError('msg-error-passwordsNotMatch');\n }\n } else {\n $this->_helper->messenger->addError('msg-error-invalidFormInfo');\n }\n }\n\n $this->_helper->pageTitle('ot-login-signup:title');\n $this->view->headScript()->appendFile($this->view->baseUrl() . '/scripts/ot/jquery.plugin.passStrength.js');\n\n $this->view->assign(array(\n 'realm' => $realm,\n 'form' => $form,\n ));\n }",
"public function signup() {\n $this->template->content = View::instance('v_users_signup');\n $this->template->title = \"Sign Up\";\n\n // Render the view\n echo $this->template;\n\n }",
"public function do_register_user() {\n\t\tif( $_SERVER['REQUEST_METHOD'] == 'POST' ) {\n\t\t\t$redirect_url = home_url( 'member-register' );\n\t\t\t\n\t\t\tif( !get_option( 'users_can_register' ) ) {\n\t\t\t\t// Reg closed\n\t\t\t\t$redirect_url = add_query_arg( 'register-errors', 'closed', $redirect_url );\n\t\t\t} else {\n\t\t\t\t$email = sanitize_email($_POST['email']);\n\t\t\t\t$company_name = sanitize_text_field( $_POST['company_name'] );\n\t\t\t\t$first_name = sanitize_text_field( $_POST['first_name'] );\n\t\t\t\t$last_name = sanitize_text_field( $_POST['last_name'] );\n\t\t\t\t$contact_phone = sanitize_text_field( $_POST['contact_phone'] );\n\t\t\t\t$mobile_phone = sanitize_text_field( $_POST['mobile_phone'] );\n\t\t\t\t$job_title = sanitize_text_field( $_POST['job_title'] );\n\t\t\t\t$sector = sanitize_text_field( $_POST['sector'] );\n\t\t\t\t$ftseIndex = sanitize_text_field( $_POST['ftseIndex'] );\n\t\t\t\t$invTrust = sanitize_text_field( $_POST['invTrust'] );\n\t\t\t\t$sec_name = sanitize_text_field( $_POST['sec_name'] );\n\t\t\t\t$sec_email = sanitize_text_field( $_POST['sec_email'] );\n\t\t\t\t\n\t\t\t\t$result = $this->register_user( $email, $company_name, $first_name, $last_name, $contact_phone, $mobile_phone, $job_title, $sector, $ftseIndex, $invTrust, $sec_name, $sec_email );\n\t\t\t\t\n\t\t\t\tif( is_wp_error( $result ) ) {\n\t\t\t\t\t// Parse errors into string and append as parameter to redirect\n\t\t\t\t\t$errors = join( ',', $result->get_error_codes() );\n\t\t\t\t\t$redirect_url = add_query_arg( 'register-errors', $errors, $redirect_url );\n\t\t\t\t} else {\n\t\t\t\t\t// Success\n\t\t\t\t\t$redirect_url = home_url( 'thank-you-for-registering' );\n//\t\t\t\t\t$redirect_url = add_query_arg( 'registered', $email, $redirect_url );\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\twp_redirect( $redirect_url );\n\t\t\texit;\n\t\t}\n\t}",
"public function doRegister()\n {\n\n //check if all the fields are filled\n if (!Request::checkVars(Request::postData(), array('username', 'password'))) {\n echo json_encode(array(\"swal\" => array(\"title\" => \"Oops!\", \"text\" => \"Complete all the fields!\", \"type\" => \"error\")));\n exit;\n }\n\n //create the user entity based on filled data\n $userEntity = new User(Request::postData());\n\n //check if the user exists and get it as entity if exists\n if ($this->repository->findUser($userEntity)) {\n echo json_encode(array(\"swal\" => array(\"title\" => \"Oops!\", \"text\" => \"The username/email already exists!\", \"type\" => \"error\")));\n exit;\n }\n\n //add the user into DB\n $this->repository->addUser($userEntity);\n\n echo json_encode(\n array(\n \"swal\" => array(\"title\" => \"Success!\", \"text\" => \"Your account has been created!\", \"type\" => \"success\", \"hideConfirmButton\" => true),\n \"redirect\" => array(\"url\" => BASE_URL . '/index.php?page=home', 'time' => 1)\n )\n );\n }",
"public function signup()\n {\n if ($this->validate()) {\n $user = new User();\n $user->username = $this->username;\n $user->first_name = $this->firstName;\n $user->last_name = $this->lastName;\n $user->email = $this->email;\n $user->setPassword($this->password);\n $user->generateAuthKey();\n $user->ip = Yii::$app->request->getUserIP();\n $user->ua = Yii::$app->request->getUserAgent();\n if ($user->save()) {\n $this->user = $user;\n $this->sendMail();\n return $user;\n }\n }\n\n return false;\n }",
"public function postSignup()\n {\n \tif ($this->userForm->create(Input::all())) {\n \t\treturn Redirect::route('auth.getSignup')\n \t\t->with('message', 'Successfully registered. Please check your email and activate your account.')\n \t\t->with('messageType', \"success\");\n \t}\n \n \treturn Redirect::route('auth.getSignup')\n \t->withInput()\n \t->withErrors($this->userForm->errors());\n }",
"public function p_signup() {\n $duplicate = DB::instance(DB_NAME)->select_field(\"SELECT email FROM users WHERE email = '\" . $_POST['email'] . \"'\");\n \n //If email already exists \n if($duplicate){ \n //Redirect to error page \n Router::redirect('/users/login/?duplicate=true');\n }\n\n // Encrypt the password \n $_POST['password'] = sha1(PASSWORD_SALT.$_POST['password']); \n\n // Create an encrypted token via their email address and a random string\n $_POST['token'] = sha1(TOKEN_SALT.$_POST['email'].Utils::generate_random_string()); \n\n // Insert this user into the database\n $user_id = DB::instance(DB_NAME)->insert('users', $_POST);\n\n\n\n //Image Upload\n Upload::upload($_FILES, \"/uploads/avatars/\", array(\"JPG\", \"JPEG\", \"jpg\", \"jpeg\", \"gif\", \"GIF\", \"png\", \"PNG\"), $user_id);\n \n $filename = $_FILES['avatar']['name']; // original filename (i.e. picture.jpg)\n $extension = substr($filename, strrpos($filename, '.')); // filename format extension (i.e. .jpg)\n $avatar = $user_id.$extension; // user id + .jpg or .png or .gif (i.e. 26.png)\n\n // Add Image to DB in \"avatar\" column\n $data = Array(\"avatar\" => $avatar);\n DB::instance(DB_NAME)->update(\"users\", $data, \"WHERE id = '\".$user_id.\"'\"); \n\n // Send them back to the login page with a success message\n Router::redirect(\"/users/login/?success=true\"); \n\n \n }",
"function signUp() {\n // create query\n $query = 'INSERT INTO ' . $this->table . \n ' SET \n username = :name, \n email = :email,\n password = :pass';\n\n // prepare statement\n $stmt = $this->conn->prepare($query);\n\n /* // clean data\n $this->name = htmlspecialchars(strip_tags(this->name));\n $this->email = htmlspecialchars(strip_tags(this->name));\n $this->password = htmlspecialchars(strip_tags(this->password)); */\n\n // hash password\n $hashedPass = password_hash($this->password, PASSWORD_DEFAULT);\n\n // bind params\n $stmt->bindParam(':name', $this->username);\n $stmt->bindParam(':email', $this->email);\n $stmt->bindParam(':pass', $hashedPass);\n\n if ($stmt->execute()) {\n return true;\n }\n else {\n //printf(\"Error: %s.\\n\", $stmt->error);\n return false;\n }\n }",
"public function actionSignup()\n { \n // get setting value for 'Registration Needs Activation'\n $rna = Yii::$app->params['rna'];\n\n // if 'rna' value is 'true', we instantiate SignupForm in 'rna' scenario\n $model = $rna ? new SignupForm(['scenario' => 'rna']) : new SignupForm();\n\n // if validation didn't pass, reload the form to show errors\n if (!$model->load(Yii::$app->request->post()) || !$model->validate()) {\n return $this->render('signup', ['model' => $model]); \n }\n\n // try to save user data in database, if successful, the user object will be returned\n $user = $model->signup();\n\n if (!$user) {\n // display error message to user\n Yii::$app->session->setFlash('error', Yii::t('app', 'We couldn\\'t sign you up, please contact us.'));\n return $this->refresh();\n }\n\n // user is saved but activation is needed, use signupWithActivation()\n if ($user->status === User::STATUS_INACTIVE) {\n $this->signupWithActivation($model, $user);\n return $this->refresh();\n }\n\n // now we will try to log user in\n // if login fails we will display error message, else just redirect to home page\n \n if (!Yii::$app->user->login($user)) {\n // display error message to user\n Yii::$app->session->setFlash('warning', Yii::t('app', 'Please try to log in.'));\n\n // log this error, so we can debug possible problem easier.\n Yii::error('Login after sign up failed! User '.Html::encode($user->username).' could not log in.');\n }\n \n return $this->goHome();\n }",
"public function please_sign_up() {\n\t\t$this->infoAlert(\"You're not signed in, or not signed up, either way - head this way! <a href='\"\n\t\t\t.site_url('/wp-login.php?action=register&redirect_to='.get_permalink()).\n\t\t\t\"'>Login/Register</a>\");\n\t}",
"static function signup($app) {\n $result = AuthControllerNative::signup($app->request->post());\n if($result['registered']) {\n return $app->render(200, $result);\n } else {\n return $app->render(400, $result);\n }\n }",
"public function signup ()\n {\n $baseUrl = Config::get('app.baseUrl');\n\n /**\n * Daten validieren\n */\n $validator = new Validator();\n $validator->validate($_POST['firstname'], 'Firstname', true, 'text', 2, 255);\n $validator->validate($_POST['lastname'], 'Lastname', true, 'text', 2, 255);\n $validator->validate($_POST['email'], 'Email', true, 'email');\n $validator->validate($_POST['password'], 'Passwort', true, 'password');\n $validator->compare($_POST['password'], $_POST['password2']);\n\n /**\n * Fehler aus dem Validator holen\n */\n $errors = $validator->getErrors();\n\n /**\n * Nachdem die eingegebenen Daten nun Validiert sind, möchten wir wissen, ob die Email-Adresse schon in unserer\n * Datenbank existiert oder nicht. Dazu nutzen wir die findByEmail-Methode der User Klasse, die wir extra so\n * gebaut haben, dass sie false zurück gibt, wenn kein Eintrag gefunden wurde. Existiert die Email-Adresse schon\n * und kann somit nicht mehr verwendet werden, geben wir einen Fehler aus.\n */\n if (User::findByEmail($_POST['email']) !== false) {\n $errors[] = \"Diese Email-Adresse wird bereits verwendet.\";\n }\n\n /**\n * Wenn Validierungsfehler aufgetreten sind, speichern wir die Fehler zur späteren Anzeige in die Session und\n * leiten zurück zum Registrierungsformular, wo die Fehler aus der Session angezeigt werden.\n */\n if (!empty($errors)) {\n Session::set('errors', $errors);\n header(\"Location: $baseUrl/sign-up\");\n exit;\n }\n\n /**\n * Wenn kein Validierungsfehler auftritt, wollen wir den Account speichern\n */\n $user = new User();\n $user->firstname = $_POST['firstname'];\n $user->lastname = $_POST['lastname'];\n $user->email = $_POST['email'];\n $user->setPassword($_POST['password']);\n $user->save();\n\n /**\n * Hier müssten wir eigentlich Fehler, die beim Speichern in die Datenbank auftreten könnten, handeln. Wir\n * werden aber für Übersichtichkeit und Einfachheit darauf verzichten.\n */\n\n /**\n * Die PHPMailer Klasse ist eine externe Klasse, die wir als Anbieter von dem MVC für unsere Anwender\n * mitliefern. Sie unterstützt mehrere Methoden Emails zu verschicken, mehr dazu in der Dokumentation:\n * https://github.com/PHPMailer/PHPMailer\n *\n * Grundsätzlich werdet ihr am Anfang eurer Developer-Karriere selbst keine Emails verschicken müssen sondern\n * über das verwendete Framework (bspw. Laravel) Emails zusammenbauen.\n *\n * Zum Testen von Emails bieten sich dienste wie Ethereal an, die genau dafür entwickelt wurden:\n * https://ethereal.email/\n */\n if (PHPMailer::ValidateAddress($user->email)) {\n $mail = new PHPMailer();\n $mail->isMail();\n $mail->AddAddress($user->email);\n $mail->SetFrom('[email protected]');\n $mail->Subject = 'Herzlich Wilkommen!';\n $mail->Body = 'Sie haben sich erfolgreich registriert!\\n\\rDanke dafür! :*';\n\n $mail->Send();\n\n header(\"Location: $baseUrl/login\");\n exit;\n } else {\n /**\n * Erkennt PHPMailer keine gültige Email-Adresse, müsste hier ein besserer Fehler ausgegeben werden. Wir\n * könnten beispielsweise einen eigenen Fehler-View bauen (ähnlich wie 404.view.php), werden das aber\n * vorerst einmal noch nicht machen und uns auf die wesentlicheren Dinge konzentrieren.\n */\n die('PHPMailer Error');\n }\n }",
"public function signupAction()\n {\n // check request method\n if (Router::getMethod() == 'POST') {\n $username = Router::getParam('username');\n $password = Router::getParam('password');\n\n // fill user object with data and try to save\n $user = new User($username, $password, Router::getIp());\n if (!$user->save()) {\n // add errors to display\n $this->setMessage($user->getErrors(), 'error');\n $this->setVar('username', $user->getUsername());\n } else {\n Router::redirect('index', 'signin');\n }\n } elseif (isset($_SESSION['userId'])) {\n Router::redirect('index', 'index');\n }\n\n $this->setVar('title', 'Sign up page');\n $this->render('signup');\n }",
"public function postSignup()\n\t{\n\t\t$v = Validator::make($input = Input::all(), $this->rules->signupRules);\n\t\tif($v->fails())\n\t\t\treturn Redirect::back()->withInput()->withErrors($v);\n\n\t\tif($this->user->createNewUser($input)) {\n\t\t\treturn Redirect::action('UsersController@index');\n\t\t}\t\t\n\t\telse {\n\t\t\treturn Redirect::back()-withInput();\n\t\t}\n\t}",
"public function signup() {\n\t\t//$this->set('title_for_layout','Sign Up');\n\t\t//$this->layout = 'clean';\n\t\t\n\t\tif ($this->request->is('post')) {\n\t\t\t$this->request->data['User']['username'] = strip_tags($this->request->data['User']['username']);\n\t\t\t$this->request->data['User']['fullname'] = strip_tags($this->request->data['User']['fullname']);\n\t\t\t$this->request->data['User']['location'] = strip_tags($this->request->data['User']['location']);\n\t\t\t//$this->request->data['User']['slug'] = $this->toSlug($this->request->data['User']['username']); //Should happen automagically with the Sluggable plugin\n\t\t\t\n\t\t\t//Register the user\n\t\t\t$user = $this->User->register($this->request->data,true,false);\n\t\t\tif (!empty($user)) {\n\t\t\t\t//Generate a public key that the user can use to login later (without username and password)\n\t\t\t\t//$this->User->generateAndSavePublicKey($user);\n\t\t\t\t\n\t\t\t\t//Send the user their activation email\n\t\t\t\t$options = array(\n\t\t\t\t\t\t\t\t\t'layout'=>'signup_activate',\n\t\t\t\t\t\t\t\t\t'subject'=>__('Activate your account at Prept!', true),\n\t\t\t\t\t\t\t\t\t'view'=>'default'\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t$viewVars = array('user'=>$user,'token'=>$user['User']['email_token']);\n\t\t\t\t$this->_sendEmail($user['User']['email'],$options,$viewVars);\n\t\t\t\t$this->User->id = $user['User']['id'];\n\t\t\t\t$this->request->data['User']['id'] = $this->User->id; \n\t\t\t\t$this->Auth->autoRedirect = false;\n\t\t\t\tif($this->Auth->login($this->request->data['User'])){\n\t\t\t\t\t//The login was a success\n\t\t\t\t\tunset($this->request->data['User']);\n\t\t\t\t\t$this->Session->setFlash(__('You have successfully created an account — now get to studying.', true));\n\t\t\t\t\t$this->Auth->loginRedirect = array('admin'=>false,'controller'=>'users','action'=>'backpack');\n\t\t\t\t\treturn $this->redirect($this->Auth->loginRedirect);\n\t\t\t\t}else{\n\t\t\t\t\t$this->Session->setFlash(__(\"There was an error logging you in.\", true));\n\t\t\t\t\t$this->redirect(array('admin'=>false,'action' => 'login'));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t}",
"private function _signUpPageRequested()\n {\n $this->utility->redirect('signup');\n }",
"public function testSignup()\n\t{\n\t\t$crawler = $this->client->request('post', 'account/sigup');\n\n\t\t$this->assertTrue($this->client->getResponse()->isOk());\n\t}",
"public function process_signup_form($txn) {\n\n\t}",
"public function postSignUp(){\n\t\t$this->_loader();\n\t\t\n\t\t// get email and password from sign_in form\n\t\t$fname = $this->input->post('fname');\n\t\t$lname = $this->input->post('lname');\n\t\t$email = $this->input->post('email');\n\t\t$password = $this->input->post('password');\n\n\t\t/*\n\t\t*\n\t\t* Check the validation of submitting form\n\t\t* Server side validation is need since\n\t\t*\t\t Client side validation can be modified by {Hacker}\n\t\t*\n\t\t*/\n\t\t$this->form_validation->set_rules('fname','First Name','required|min_length[1]');\n\t\t$this->form_validation->set_rules('lname','Last Name','required|min_length[1]');\n\t\t$this->form_validation->set_rules('email','Email','required|valid_email|is_unique[users.email]',\n\t\t\t[\n 'required' => 'You have not provided %s.',\n 'is_unique' => 'This %s already exists.'\n \t]\n\t\t);\n\t\t$this->form_validation->set_rules('password','Password','required|min_length[4]');\n\n\t\t// check the validation error\n\t\tif ($this->form_validation->run() == FALSE){\n\t\t\t$this->parser->parse('pages/login',['title'=> 'Social Site | Login']);\n\t\t}else{\n\t\t\t// create data object to insert in database\n\t\t\t$data = new stdClass;\n\t\t\t$data->fname = $fname;\n\t\t\t$data->lname = $lname;\n\t\t\t$data->email = $email;\n\t\t\t$data->password = $password;\n\n\t\t\t// check if data is inserted\n\t\t\tif($this->user->save('users', $data)){\n\t\t\t\t$this->session->set_flashdata('successmessage', 'Account has been created!!');\n\t\t\t\treturn redirect('login');\t\t\t\n\t\t\t}else{\n\t\t\t\t$this->session->set_flashdata('errormessage', 'Something went wrong!!');\n\t\t\t}\n\t\t\t\n\t\t}\n\t}",
"public function doSingUp(SignupRequest $request)\n {\n $user = User::create([\n 'name' => $request->input('displayname'),\n 'email' => $request->input('email'),\n 'password' => bcrypt($request->input('password')),\n 'active' => 0\n ]);\n\n return redirect()->back()->withSuccess('User created');\n }",
"function sign_up($user_post_data)\n\t{\n\t\t$salted_password = hash_pbkdf2(\"sha1\", $user_post_data[\"password\"], $user_post_data[\"salt\"], $user_post_data[\"iteration_count\"], 40);\n\t\t$client_key = hash_hmac(\"sha1\", $salted_password, \"'Client Key'\");\n\t\t$server_key = hash_hmac(\"sha1\", $salted_password, \"'Server Key'\");\n\t\t$hashed_password = sha1($client_key);\n\t\t$user_post_data[\"password\"] = $hashed_password;\n\n\t\t$query_builder= $this->db->db_connect();\n\t\t$query = $query_builder->prepare(\"insert into user(name,lastname,email,password,server_key,salt,iteration_count,user_created) values(?,?,?,?,?,?,?,?)\");\n\t\t$query->execute(array($user_post_data[\"name\"], $user_post_data[\"lastname\"], $user_post_data[\"email\"], $user_post_data[\"password\"],$server_key, $user_post_data[\"salt\"], $user_post_data[\"iteration_count\"], $user_post_data[\"user_signed_up\"]));\n\t\treturn true;\n\t\t$this->db->db_disconnect();\n\t\t\n\t}",
"public function signup(){\n /* echo \"Signup called.\";*/\n\t# First, set the content of the template with a view file\n\t$this->template->content = View::instance('v_users_signup');\n\n\t# Now set the <title> tag\n\t$this->template->title = \"OPA! Signup\";\n\n\t# Render the view\n\techo $this->template;\n }",
"public function create()\n {\n // TODO: Algún parámetro para no permitir el registro.\n \n // Es ya un usuario?\n if (Core::isUser())\n {\n $this->call('window.location.href = \\'' . Core::getLib('url')->makeUrl('') . '\\';');\n return;\n }\n \n // Tenemos datos?\n if ($this->request->is('email'))\n {\n // Validamos los datos\n $form = Core::getLib('form.validator');\n $form->setRules(Core::getService('account.signup')->getValidation());\n \n // Si no hay errores procedemos a capturar los datos.\n if ($form->validate())\n {\n // Agregamos usuario\n if (Core::getService('account.process')->add($this->request->getRequest()))\n {\n if (Core::getParam('user.verify_email_at_signup'))\n {\n // Vamos a que verifique su email\n Core::getLib('session')->set('email', $this->request->get('email'));\n $this->call('window.location.href = \\'' . Core::getLib('url')->makeUrl('account.verify') . '\\';');\n }\n else\n {\n // Iniciamos sesión\n $this->call('window.location.href = \\'' . Core::getLib('url')->makeUrl('account.login') . '\\';');\n }\n \n return;\n }\n }\n }\n \n $this->call('window.location.href = \\'' . Core::getLib('url')->makeUrl('account.signup') . '\\';');\n }",
"function user_signup($Oau_postgrads)\n\t{\n\n\t\tglobal $Oau_auth;\n\n\t\tarray_walk($Oau_postgrads, 'array_sanitize');\n\t\t$Oau_postgrads['password'] = md5($Oau_postgrads['password']);\n\t\t$fields = '`' .implode('`, `', array_keys($Oau_postgrads)) . '`';\n\t\t$data = '\\'' .implode('\\', \\'', $Oau_postgrads) . '\\'';\n\t\t$query = \"INSERT INTO `student` ($fields) VALUES ($data)\";\n\t\t$run_query = mysqli_query($Oau_auth, $query);\n\n\t\temail($Oau_postgrads['email'], 'Activate your account', \"\n\t\tHello \" . $Oau_postgrads['fname'] .\", \\n\\n\n\n\t\tYou need to activate your student login account, so use the link below:\\n\\n\n\n\t\thttp://www.oau-pgtranscript.senttrigg.com/activate.php?email=\" .$Oau_postgrads['email']. \"&email_code=\" .$Oau_postgrads['email_code']. \"\\n\\n\n\n\t\t--Oau PG Transcript\\n\\n\n\t\thttps://wwww.oau-pgtranscript.senttrigg.com\n\t\t\");\n\n\t}",
"public function completeSignup($optParams = [])\n {\n $params = [];\n $params = array_merge($params, $optParams);\n return $this->call('completeSignup', [$params], Enterprise::class);\n }",
"function validate_user_signup()\n {\n }",
"public function run() {\n\t\t//If the user just submitted his\n\t\t//credentials.\n\t\tif($this->registerView->isPOSTSubmit()) {\n\t\t\ttry {\n\t\t\t\t//Get the user from our view.\n\t\t\t\t$user = $this->registerView->getUser();\n\n\t\t\t\t/** \n\t\t\t\t * Register a LoginModel as an observer\n\t\t\t\t * to the RegisterModel so when a user\n\t\t\t\t * successfuly registers he will be automtically\n\t\t\t\t * logged in.\n\t\t\t\t**/\n\n\t\t\t\t//First create a loginModel.\n\t\t\t\t$loginModel = new \\login\\model\\Login();\n\n\t\t\t\t//Then register it.\n\t\t\t\t$this->registerModel->registerObserver($loginModel);\n\t\t\t\t\n\n\t\t\t\t//Send them to the model class to be saved.\n\t\t\t\t$this->registerModel->registerUser($user);\n\n\t\t\t\t//When we are done, redirect user to the\n\t\t\t\t//front page.\n\t\t\t\t$this->appView->redirectToFrontPage();\n\t\t\t}\n\n\t\t\tcatch(\\Exception $e) {\n\t\t\t\t//Call registerFailure() on our view.\n\t\t\t\t$this->registerView->registerFailure();\n\t\t\t}\n\t\t}\n\t}",
"public function onUserSignUp($event) \n {\n $event->user->notify(new NotifyUser($event->user, 'signup'));\n }",
"public function signupAction()\n {\n $form = new SignUpForm();\n\n if ($this->request->isPost()) {\n if($this->security->checkToken())\n {\n if ($form->isValid($this->request->getPost()) != false) {\n $tampemail = $this->request->getPost('email');\n $user = new Users([\n 'name' => $this->request->getPost('name', 'striptags'),\n 'lastname' => $this->request->getPost('lastname', 'striptags'),\n 'email' => $this->request->getPost('email'),\n 'password' => $this->security->hash($this->request->getPost('password')),\n 'profilesId' => 2,\n 'type' => $this->request->getPost('type'),\n 'skype' => $this->request->getPost('skype'),\n 'phone' => $this->request->getPost('phone'),\n 'company' => $this->request->getPost('company'),\n 'address' => $this->request->getPost('address'),\n 'city' => $this->request->getPost('city'),\n 'country' => $this->request->getPost('country'),\n ]);\n\n if ($user->save()) {\n $this->flashSess->success(\"A confirmation mail has been sent to \".$tampemail);\n $this->view->disable();\n return $this->response->redirect('');\n }\n\n $this->flash->error($user->getMessages());\n }\n }\n else {\n $this->flash->error('CSRF Validation is Failed');\n }\n }\n\n $this->view->form = $form;\n }",
"public function signUpAction() {\n //initialize an emtpy message string\n $message = '';\n //check if we have a logged in user\n if ($this->has('security.context') && $this->getUser() && TRUE === $this->get('security.context')->isGranted('ROLE_NOTACTIVE')) {\n //set a hint message for the user\n $message = $this->get('translator')->trans('you will be logged out and logged in as the new user');\n }\n //initialize the form validation groups array\n $formValidationGroups = array('signup');\n $container = $this->container;\n //get the login name configuration\n $loginNameRequired = $container->getParameter('login_name_required');\n //check if the login name is required\n if ($loginNameRequired) {\n //add the login name group to the form validation array\n $formValidationGroups [] = 'loginName';\n }\n //get the request object\n $request = $this->getRequest();\n //create an emtpy user object\n $user = new User();\n //this flag is used in the view to correctly render the widgets\n $popupFlag = FALSE;\n //check if this is an ajax request\n if ($request->isXmlHttpRequest()) {\n //create a signup form\n $formBuilder = $this->createFormBuilder($user, array(\n 'validation_groups' => $formValidationGroups\n ))\n ->add('email')\n ->add('firstName', null, array('required' => false))\n ->add('userPassword');\n //use the popup twig\n $view = 'ObjectsUserBundle:User:signup_popup.html.twig';\n $popupFlag = TRUE;\n } else {\n //create a signup form\n $formBuilder = $this->createFormBuilder($user, array(\n 'validation_groups' => $formValidationGroups\n ))\n ->add('email', 'email')\n ->add('firstName', null, array('required' => false))\n ->add('userPassword', 'repeated', array(\n 'type' => 'password',\n 'first_name' => 'Password',\n 'second_name' => 'RePassword',\n 'invalid_message' => \"The passwords don't match\",\n ));\n //use the signup page\n $view = 'ObjectsUserBundle:User:signup.html.twig';\n }\n //check if the login name is required\n if ($loginNameRequired) {\n //add the login name field\n $formBuilder->add('loginName');\n }\n //create the form\n $form = $formBuilder->getForm();\n //check if this is the user posted his data\n if ($request->getMethod() == 'POST') {\n //fill the form data from the request\n $form->handleRequest($request);\n //check if the form values are correct\n if ($form->isValid()) {\n //get the user object from the form\n $user = $form->getData();\n if (!$loginNameRequired) {\n $user->setLoginName($this->suggestLoginName($user->__toString()));\n }\n //user data are valid finish the signup process\n return $this->finishSignUp($user);\n }\n }\n $twitterSignupEnabled = $container->getParameter('twitter_signup_enabled');\n $facebookSignupEnabled = $container->getParameter('facebook_signup_enabled');\n $linkedinSignupEnabled = $container->getParameter('linkedin_signup_enabled');\n $googleSignupEnabled = $container->getParameter('google_signup_enabled');\n return $this->render($view, array(\n 'form' => $form->createView(),\n 'loginNameRequired' => $loginNameRequired,\n 'message' => $message,\n 'popupFlag' => $popupFlag,\n 'twitterSignupEnabled' => $twitterSignupEnabled,\n 'facebookSignupEnabled' => $facebookSignupEnabled,\n 'linkedinSignupEnabled' => $linkedinSignupEnabled,\n 'googleSignupEnabled' => $googleSignupEnabled\n ));\n }",
"function SignUpUser()\n {\n if (functions\\CheckFormat::CheckUsername($this->mUsername) && functions\\CheckFormat::CheckPassword($this->mPassword))\n $mAvailableUsername = $this->GetUsernameAvailability($this->mUsername);\n else {\n echo \"<script type = \\\"text/JavaScript\\\">\n\t\t\t\t\t\t\tdocument.getElementById('password').innerHTML = \\\"Your username/password does not match the required format.\\\";\n\t\t\t\t\t\t</script>\";\n return -1;\n }\n\n if (!$mAvailableUsername) {\n echo \"<script type = \\\"text/JavaScript\\\">\n\t\t\t\t\t\t\t\tdocument.getElementById('password').innerHTML = \\\"Username already exists\\\";\n\t\t\t\t\t\t\t\t</script>\";\n return -2;\n }\n if (!$this->CheckPasswordMatch($this->mPassword, $this->mPasswordConfirm)) {\n echo \"<script type = \\\"text/JavaScript\\\">\n\t\t\t\t\t\t\t\tdocument.getElementById('password').innerHTML = \\\"Passwords don't match\\\";\n\t\t\t\t\t\t\t\t</script>\";\n return -3;\n }\n $this->mUserId = $this->NewUserToDb($this->mUsername, $this->mPassword);\n return $this->mUserId;\n }",
"public function signup($params = null)\n\t{\n\t\t// On set la variable a afficher sur dans la vue\n\t\t$this->set('title', 'Sign up');\n\t\t// On fait le rendu de la vue signup.php\n\t\t$this->render('signup');\n\t}",
"function process_signup()\n\t{\n\t\t$parameter = file_get_contents(\"php://input\");\n\t\t\n\t\t// Decode data\n\t\t$decode_param = json_decode($parameter);\n\t\t\n\t\t// Validation format parameter\n\t\tif(! isset($decode_param->Name) ||\n\t\t\t! isset($decode_param->Username) ||\n\t\t\t! isset($decode_param->Password)\n\t\t){\n\t\t\techo json_encode(array('Status' => 500, 'Message' => 'Your format parameter is wrong')); // 500 = Internal Server Error\n\t\t\texit;\n\t\t}\n\t\t\n\t\t// Validation of null value\n\t\tif($decode_param->Name == '' ||\n\t\t\t$decode_param->Username == '' ||\n\t\t\t$decode_param->Password == ''\n\t\t){\n\t\t\techo json_encode(array('Status' => 500, 'Message' => 'Your format parameter must be filled')); // 500 = Internal Server Error\n\t\t\texit;\n\t\t}\n\t\t\n\t\t// Set variable\n\t\t$name = $decode_param->Name;\n\t\t$username = $decode_param->Username;\n\t\t$password = $decode_param->Password;\n\t\t\n\t\t// Check to database\n\t\t// Duplicate email or not\n\t\t$duplicate_email = $this->db->query(\"SELECT COUNT(*) AS count_data FROM tbl_user WHERE username = '\". $username .\"'\")->row()->count_data;\n\t\tif($duplicate_email > 0){\n\t\t\techo json_encode(array('Status' => 500, 'Message' => 'Your email have exist at database. Please, choose another email or recover your password.')); // 500 = Internal Server Error\n\t\t\texit;\n\t\t}\n\t\t\n\t\t// Save data\n\t\t$date_now = date('Y-m-d H:i:s', strtotime(\"now\"));\n\t\t$data = array(\n\t\t\t'username' => $username,\n\t\t\t'password' => md5($password),\n\t\t\t'name' => $name,\n\t\t\t'email' => $username,\n\t\t\t'last_login_time' => '0000-00-00 00:00:00',\n\t\t\t'created_on' => $date_now,\n\t\t\t'last_modified_on' => $date_now\n\t\t);\n\t\tif($this->db->insert('tbl_user', $data)){\n\t\t\t// 200 = OK - Save success\n\t\t\techo json_encode(array('Status' => 200, 'Message' => 'Save Success. You can login now'));\n\t\t} else {\n\t\t\t// 500 = Internal Server Error - Save failed\n\t\t\techo json_encode(array('Status' => 500, 'Message' => 'Save Failed. Please try again'));\n\t\t}\n\t\t\n\t}",
"public function api_entry_signup() {\n\n parent::validateParams(array(\"username\", \"email\", \"password\", \"fullname\", \"church\", \"province\", \"city\", \"bday\"));\n\n $qbToken = $this->qbhelper->generateSession();\n\n if ($qbToken == null || $qbToken == \"\") parent::returnWithErr(\"Generating QB session has been failed.\");\n\n $qbSession = $this->qbhelper->signupUser(\n $qbToken,\n $_POST['username'],\n $_POST['email'],\n QB_DEFAULT_PASSWORD\n );\n /*\n\n */\n if ($qbSession == null)\n parent::returnWithErr($this->qbhelper->latestErr);\n\n $newUser = $this->Mdl_Users->signup(\n $_POST['username'],\n $_POST['email'],\n md5($_POST['password']),\n $_POST['fullname'],\n $_POST['church'],\n $_POST['province'],\n $_POST['city'],\n $_POST['bday'],\n $qbSession\n );\n\n if ($newUser == null) {\n parent::returnWithErr($this->qbhelper->latestErr);\n }\n\n $hash = hash('tiger192,3', $newUser['username'] . date(\"y-d-m-h-m-s\"));\n $baseurl = $this->config->base_url();\n\n $this->load->model('Mdl_Tokens');\n $this->Mdl_Tokens->create(array(\n \"token\" => $hash,\n \"user\" => $newUser['id']\n ));\n\n $content = '<html><head><base target=\"_blank\">\n <style type=\"text/css\">\n ::-webkit-scrollbar{ display: none; }\n </style>\n <style id=\"cloudAttachStyle\" type=\"text/css\">\n #divNeteaseBigAttach, #divNeteaseBigAttach_bak{display:none;}\n </style>\n <style type=\"text/css\">\n .ReadMsgBody{ width: 100%;} \n .ExternalClass {width: 100%;} \n .ExternalClass, .ExternalClass p, .ExternalClass span, .ExternalClass font, .ExternalClass td, .ExternalClass div {line-height: 100%;} \n p { margin: 1em 0;} \n table td { border-collapse: collapse;} \n _-ms-viewport{ width: device-width;}\n _media screen and (max-width: 480px) {\n html,body { width: 100%; overflow-x: hidden;}\n table[class=\"container\"] { width:320px !important; padding: 0 !important; }\n table[class=\"content\"] { width:100% !important; }\n td[class=\"mobile-center\"] { text-align: center !important; }\n td[class=\"content-center\"] { text-align: center !important; padding: 0 !important; }\n td[class=\"frame\"] {padding: 0 !important;}\n [class=\"mobile-hidden\"] {display:none !important;}\n table[class=\"cta\"]{width: 100% !important;}\n table[class=\"cta\"] td{display: block !important; text-align: center !important;}\n *[class=\"daWrap\"] {padding: 20px 15px !important;}\n }\n </style>\n\n\n </head><body><table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">\n <tbody><tr><td class=\"frame\" bgcolor=\"#f3f3f3\">\n <table width=\"576\" border=\"0\" cellpadding=\"10\" cellspacing=\"0\" class=\"container\" align=\"center\">\n <tbody><tr><td style=\"padding-left:5px;border-bottom: solid 2px #dcdcdc;\" class=\"mobile-center\"><font face=\"Helvetica, Arial, sans-serif\" size=\"3\" color=\"black\" style=\"font-size: 16px;\">\n <font size=\"4\" color=\"#3db01a\" style=\"font-size:40px;\"><b>iPray</b></font>\n </td></tr>\n </tbody></table>\n </td></tr>\n <tr><td class=\"frame\" bgcolor=\"#f3f3f3\"><div align=\"center\">\n \n <table border=\"0\" cellpadding=\"40\" cellspacing=\"0\" width=\"576\" class=\"container\" align=\"center\"> \n <tbody><tr><td class=\"daWrap\">\n <table width=\"80%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\" align=\"center\" class=\"content\">\n <tbody><tr>\n <td align=\"left\" valign=\"top\" style=\"padding-top:15px;\" class=\"content-center\"><font face=\"Helvetica, Arial, sans-serif\" size=\"3\" color=\"black\" style=\"font-size: 16px;\">\n <font size=\"4\" color=\"#3db01a\" style=\"font-size:22px;\"><b>You are almost verified.</b></font><br><br>\n People are looking for someone they can trust. With a verified email, you\"ll be instantly more approachable. Just click the link to finish up.</font>\n <br><br>\n <table cellspacing=\"0\" cellpadding=\"0\" align=\"left\" class=\"cta\">\n <tbody><tr><td style=\"font-size: 17px; color: white; background: #1a6599; background-image: -moz-linear-gradient(top, #2b88c8, #1a6599); background-image: -ms-linear-gradient(top, #2b88c8, #1a6599); background-image: -o-linear-gradient(top, #2b88c8, #1a6599); background-image: -webkit-gradient(linear, center top, center bottom, from(#2b88c8), to(#1a6599)); background-image: -webkit-linear-gradient(top, #2b88c8, #1a6599); background-image: linear-gradient(top, #2b88c8, #1a6599); text-decoration: none; font-weight: normal; display: inline-block; line-height: 25px; border-radius: 4px; -moz-border-radius: 4px; -webkit-border-radius: 4px; padding: 10px 40px; \">\n <font face=\"Helvetica, Arial, sans-serif\"><a href=\"'. $baseurl .'AdminLogin/verify?token=' . $hash . '\" style=\"color: #FFFFFF; text-decoration: none; text-shadow: 0px -1px 2px #333333; letter-spacing: 1px; display: block;\">Verify Your Email</a></font>\n </td></tr>\n </tbody></table>\n </td></tr>\n </tbody></table>\n <table width=\"80%\" cellpadding=\"5\" cellspacing=\"0\" border=\"0\" align=\"center\" class=\"content\">\n <tbody><tr><td> </td></tr>\n <tr><td align=\"center\" style=\"border-bottom: solid 1px #dcdcdc;\"><font face=\"Helvetica, Arial, sans-serif\" size=\"2\" color=\"#777\" style=\"font-size: 13px;\">\n <b>Questions?</b> Take a look at our <a href=\"http://www.match.com/help/help.aspx?emailid=b8ba94ac-4dfc-4b5d-9cff-165003e5e85c\" target=\"_blank\" style=\"color:#488ac9;\">FAQs</a>, or contact<a href=\"http://www.match.com/help/help.aspx?emailid=b8ba94ac-4dfc-4b5d-9cff-165003e5e85c\" target=\"_blank\" style=\"color:#488ac9;\"> Customer Care</a>.</font>\n </td></tr>\n </tbody></table>\n </td></tr>\n <tr><td align=\"center\" style=\"padding:15px;\"><font face=\"Arial, sans-serif\" size=\"2\" color=\"#333333\" style=\"font-size:12px;\">\n <em>Please add <a href=\"mailto:[email protected]\">[email protected]</a> to your address book to ensure our emails reach your inbox.</em><br><br>\n Please do not reply to this email. Replies will not be received. If you have a question, or need assistance, please contact<a href=\"http://www.match.com/help/help.aspx?emailid=b8ba94ac-4dfc-4b5d-9cff-165003e5e85c\" target=\"_blank\" style=\"color:#8a8a8a;\"> Customer Service</a>.</font></td>\n </tr>\n </tbody></table>\n \n </div></td></tr>\n </tbody></table>\n\n <img src=\"http://www.match.com/email/open.aspx?EmailID=b8ba94ac-4dfc-4b5d-9cff-165003e5e85c&SrcSystem=3\" width=\"1\" height=\"1\" border=\"0\">\n <span style=\"padding: 0px;\"></span>\n\n \n\n <style type=\"text/css\">\n body{font-size:14px;font-family:arial,verdana,sans-serif;line-height:1.666;padding:0;margin:0;overflow:auto;white-space:normal;word-wrap:break-word;min-height:100px}\n td, input, button, select, body{font-family:Helvetica, \"Microsoft Yahei\", verdana}\n pre {white-space:pre-wrap;white-space:-moz-pre-wrap;white-space:-pre-wrap;white-space:-o-pre-wrap;word-wrap:break-word;width:95%}\n th,td{font-family:arial,verdana,sans-serif;line-height:1.666}\n img{ border:0}\n header,footer,section,aside,article,nav,hgroup,figure,figcaption{display:block}\n </style>\n\n <style id=\"ntes_link_color\" type=\"text/css\">a,td a{color:#064977}</style>\n </body></html>';\n\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);\n curl_setopt($ch, CURLOPT_USERPWD, 'api:key-061710f7633b3b2e2971afade78b48ea');\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');\n curl_setopt($ch, CURLOPT_URL, \n 'https://api.mailgun.net/v3/sandboxa8b6f44a159048db93fd39fc8acbd3fa.mailgun.org/messages');\n curl_setopt($ch, CURLOPT_POSTFIELDS, \n array('from' => '[email protected] <[email protected]>',\n 'to' => $newUser['username'] . ' <' . $newUser['email'] . '>',\n 'subject' => \"Please verify your account.\",\n 'html' => $content));\n $result = curl_exec($ch);\n curl_close($ch);\n\n /*\n Now we should register qb user at first.....\n */\n parent::returnWithoutErr(\"User has been created successfully. Please verfiy your account from verification email.\", $newUser);\n }",
"function userSignUp ( $_email ) {\n\t\t$_sql_statement = '';\n\t\t$_bind_parameters = array ();\n\t\t$_duplicateEmailCheck;\n\t\t$_createUserInfo;\n\t\t$_resultVerification ;\n\t\t$_emailVerificationKey = '';\n\t\t$_accountPassword = '';\n\t\t\n\t\t$this->gframeDatabase = new GframeDatabase($this->db_info);\n\t\t\n\t\t$_query_request = array();\n\t\t$_query_result = array();\n\n\t\tif ( ($connection_result = $this->gframeDatabase->connect_database ()) !== TRUE ) {\n\t\t\treturn $this->gframeDatabase->returnAjaxResponseArray(false,'Failed @ connect_database',$connection_result);\n\t\t} else {\n\t\t\t// duplicate email check\n\t\t\t$_duplicateEmailCheck = $this->duplicateEmailCheck( $_email );\n\t\t\tif ($_duplicateEmailCheck['response']===FALSE) {\n\t\t\t\t$this->gframeDatabase->close_database_connection();\n\t\t\t\treturn $_duplicateEmailCheck; // error then exit\n\t\t\t}\n\n\t\t\t// generate account password \n\t\t\t$_accountPassword = $this->returnGeneratedPassword(8);\n\t\t\t\n\t\t\t// create user record\n\t\t\t$_createUserInfo = $this->createUserInfo( $_email,$_accountPassword );\n\t\t\t\n\t\t\t$_resultVerification = $this->queryResultVerification ($_createUserInfo,'createUserInfo');\n\t\t\tif($_resultVerification['response'] === FALSE) {\n\t\t\t\t$this->gframeDatabase->close_database_connection();\n\t\t\t\treturn $_resultVerification; // error then exit\n\t\t\t}\n\t\t\t\n\t\t\t// generate e mail verification key\n\t\t\t$_emailVerificationKey = $this->returnGeneratedPassword(32);\n\n\t\t\t// create user meta and email verification key\n\t\t\t// $_createUserInfo['result']['result'] has the last insert ID\n\t\t\t$_createUserInfoMeta = $this->createUserRecordMeta( $_createUserInfo['result']['result'],$_emailVerificationKey);\n\t\t\t$_resultVerification = $this->queryResultVerification ($_createUserInfoMeta,'createUserRecordMeta');\n\t\t\tif($_resultVerification['response'] === FALSE) {\n\t\t\t\t$this->gframeDatabase->close_database_connection();\n\t\t\t\treturn $_resultVerification; // error then exit\n\t\t\t}\n\t\t\t\n\t\t\t// closing the connection\n\t\t\t$this->gframeDatabase->close_database_connection();\n\t\t\t\n\t\t\t// send out \n\t\t\tif($this->sendOutVerificationEmail ( $_email,$_accountPassword,$_emailVerificationKey )) {\n\t\t\t\treturn $this->gframeDatabase->returnAjaxResponseArray(true,'OK',null);\n\t\t\t} else {\n\t\t\t\treturn $this->gframeDatabase->returnAjaxResponseArray(false,'failedAtSendingEmail',null);\n\t\t\t}\t\t\t\n\t\t}\n\t}",
"public function signUp()\n\t{\n\t\t$user_name = Request::input('user_name');\n\n\t\treturn view('sign-up');\n\t}",
"public function page_register() {\n\n\t\tif(isset($_POST['submit'])) {\n\n\t\t\t$validate = new validate();\n\n\t\t\t/**\n\t\t\t * setup custom allback text\n\t\t\t */\n\t\t\t$validate->errors_text['account_action::_pwdntmatch'] = 'Password fields do not match!';\n\t\t\t$validate->errors_text['account_action::_userexists'] = 'User already exists!';\n\n\t\t\t/**\n\t\t\t* setup form validation rules\n\t\t\t*/\n\t\t\t$validate->set_rules('username', array(\n\t\t\t\t'empty', \n\t\t\t\tarray(\n\t\t\t\t\t'callback' => array(&$this, '_userexists')\n\t\t\t\t)\n\t\t\t));\n\n\t\t\t$validate->set_rules('password', array(\n\t\t\t\t'empty',\n\t\t\t\tarray(\n\t\t\t\t\t'callback' => array($this, '_pwdntmatch'),\n\t\t\t\t\t'params' => array('password_again')\n\t\t\t\t)\n\t\t\t), true);\n\n\t\t\t/**\n\t\t\t * lets attempt to save user into the database\n\t\t\t */\n\t\t\tif(!$validate->check()) {\n\n\t\t\t\t/**\n\t\t\t\t * register user\n\t\t\t\t */\n\t\t\t\tif(account_model::register()) {\n\t\t\t\t\t$this->data->message = \"Account created successful\";\n\t\t\t\t} else {\n\t\t\t\t\t$this->data->message = \"Something went wrong when attempting to create this account!\";\n\t\t\t\t}\n\n\n\t\t\t} else {\n\t\t\t\t$this->data->message = validate::errors();\n\t\t\t}\n\t\t}\n\t}",
"abstract public function newSignup($name);",
"public function signupAction()\n {\n $form = new \\RTB\\Core\\ShopFrontOffice\\Forms\\RegisterForm;\n if ($this->request->isPost()) {\n $email = $this->request->getPost('email', 'email');\n $password = $this->request->getPost('password', 'string');\n $repeatPassword = $this->request->getPost('repeatPassword', 'string');\n $response = $this->userService->createContact($email, $password, $repeatPassword);\n if($response == UserServices::SIGNUPSUCCESS){\n if ($this->request->isAjax()) {\n return $response;\n }\n $this->flash->success((string) $response);\n return $this->response->redirect('login');\n }else{\n if ($this->request->isAjax()) {\n return $response;\n }\n $this->flash->error($response);\n }\n }\n $this->view->form = $form;\n }",
"function signup($fname,$lname,$phone,$email,$pwd){\n\t\tif(isset($_SESSION['user'])){\n\t\t\t$encrypted_pass = $pwd;\n\t\t}else{\n\t\t\t$encrypted_pass = md5($pwd);\n\t\t}\n\t\t//end\n\n\t\t//this is to check if email already exists\n\t\t$checkifemailexists = $this->getdetailswithemail($email,'vendors');\n\n\t\tif(!empty($checkifemailexists)){\n\n\t\t\t$_SESSION['emailalreadyexists'] = \"emailalreadyexists\";\n\t\t\t$_SESSION['fname'] = $fname;\n\t\t\t$_SESSION['lname'] = $lname;\n\t\t\t$_SESSION['phone'] = $phone;\n\t\t\t$_SESSION['email'] = $email;\n\n\t\t\theader(\"location: becomeavendor.php\");\n\n\t\t\treturn;\n\t\t}\n\t\t//end\n\n\t\t$sql = \" INSERT INTO vendors SET v_fname = '$fname', v_lname = '$lname', v_phone = '$phone', v_email = '$email', v_password = '$encrypted_pass' \";\n\n\t\t$this->conn->query($sql);\n\n\t\t$id = $this->conn->insert_id;\n\n\t\tif($id > 0){\n\t\t\t\n\t\t\t$reg_id = \"VEN/\".date(\"Y.m.d\").\"/\".$id;\n\n\t\t\t$this->conn->query(\" UPDATE vendors SET v_user_id = '$reg_id' WHERE vendor_id = '$id' \");\n\n\t\t\t\n\t\t\tif(isset($_SESSION['user'])){\n\n\t\t\t$_SESSION['user'] = $id;\n\n\t\t\t$_SESSION['route'] = 'vendor';\n\n\t\t\t}else{\n\n\t\t\t$_SESSION['user'] = $id;\n\n\t\t\t$_SESSION['route'] = 'vendor';\n\n\t\t\t//this is to fetch email and assign to session\n\t\t\t$emailfetch = $this->getdetails($_SESSION['user'],'vendors');\n\n\t\t\t$_SESSION['useremail'] = $emailfetch['v_email'];\n\t\t\t//end\n\n\t\t\theader(\"location: complete_registration.php\");\n\n\t\t\t}\n\n\n\t\t}else{\n\n\t\t\t$_SESSION['error'] = \"failedsignup\";\n\n\t\t\theader(\"location: signup.php\");\n\t\t}\n\n\n\t}",
"private function signup_user($table, $fields) {\n\t\tif ($this->request['signupEmail'] && $this->request['signupPassword'] && $this->request['signupName']) {\n\t\t\t\n\t\t\t$request['email'] = is_email($this->request['signupEmail']) ? $this->request['signupEmail'] : NULL;\n\t\t\tif (is_null($request['email']))\n\t\t\t\tthrow new Exception('Not a valid email address!');\n\n\t\t\t\n\t\t\t$request['name'] = trim($this->request['signupName']);\n\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\tif ($request['name']) {\n\t\t\t\tif (!ctype_alnum($request['name'])) throw new Exception(INVALID_CHARACTERS_IN_NAME);\n\t\t\t\t\n\t\t\t\tglobal $wpdb;\n\t\t\t\t$wpdb->query(\n\t\t\t\t\t$wpdb->prepare(\n\t\t\t\t\t\t\"SELECT email, name FROM labelgen_users WHERE email = %s OR name = %s\", \n\t\t\t\t\t\tarray($request['email'], $request['name'])\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\t$result = $wpdb->last_result[0];\n\t\t\t\tif ($result) {\n\t\t\t\t\tif ($result->email == $request['email']) {\n\t\t\t\t\t\tthrow new Exception(EMAIL_ALREADY_REGISTERED);\n\t\t\t\t\t} else if ($result->name == $request['name']) {\n\t\t\t\t\t\tthrow new Exception(NAME_ALREADY_REGISTERED);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tthrow new Exception(INVALID_USER_NAME);\n\t\t\t}\n\t\t\t\n\t\t\t$request['password'] = $this->encrypt(trim($this->request['signupPassword']));\n\t\t\t$request['secret'] = sha1(microtime(true).mt_rand(22222,99999));\n\t\t\t\n\t\t} else {\n\t\t\tthrow new Exception('Missing Vital Sign Up Information.');\n\t\t}\n\t\t\t\t\t\t\t\t\n\t\t$return = $this->parse_post_request($table, $request, true);\n\t\t\n\t\tif ($return) {\n\t\t\t\n\t\t\treturn array('success'=>true, 'id'=>$return['id'], 'secret'=>$return['secret'], 'email'=>$return['email'], 'name'=>$return['name']);\n\t\t} else {\n\t\t\tthrow new Exception('Something went wrong. We were not able to sign you up at this time.');\t\t\t\t\n\t\t}\n\n\t}",
"function doSignup(){\n\t\t$data = $_POST;\n\t\t//Stop sign-up if the user does not check the chebox\n\t\tif(!isset($data['Agreement']))\n\t\t\treturn \"inlineMsg5\";\n\t\tif($this->isCCUsedForTrial(\"{$data['CreditCardNumber']}\") && ($data['SubscriptionType'] == 1))\n\t\t\treturn \"inlineMsg1\";\n\t\t$currentYear = date('Y');\n\t\t$currentMonth = date('n');\n\t\t//Stop sign-up when the credit card is expired\n\t\tif($data['ExpirationYear'] < $currentYear){\n\t\t\treturn \"inlineMsg4\";\n\t\t}\n\t\tif ($data['ExpirationYear'] == $currentYear){\n\t\t\tif($data['ExpirationMonth'] < $currentMonth)\n\t\t\t\treturn \"inlineMsg4\";\n\t\t}\n\t\t//Get InfusionSoft Api\n\t\t$app = $this->getInfusionSoftApi();\n\t\t//Get current date\n\t\t$curdate = $app->infuDate(date('j-n-Y'));\n\t\t//Get the registration form from session\n\t\t$regFormData = Session::get('RegistrationFormData');\n\t\t// Get country text from code\n\t\t$country = Geoip::countryCode2name($data['Country']);\n\t\t// Get InfusionSoft Contact ID\n\t\t$returnFields = array('Id','Leadsource');\n\t\t$conInfo = $app->findByEmail($regFormData['Email'], $returnFields);\n\t\tif(empty($conInfo)){\n\t\t\t// If IS contact doesn't exist create one\n\t\t\t$conDat = array(\n\t\t\t\t\t'FirstName' => $data['FirstName'],\n\t\t\t\t\t'LastName' => $data['LastName'],\n\t\t\t\t\t'Company' => $data['Company'],\n\t\t\t\t\t'StreetAddress1' => $data['StreetAddress1'],\n\t\t\t\t\t'StreetAddress2' => $data['StreetAddress2'],\n\t\t\t\t\t'City' => $data['City'],\n\t\t\t\t\t'State' => $data['State'],\n\t\t\t\t\t'PostalCode' => $data['PostalCode'],\n\t\t\t\t\t'Country' => $country,\n\t\t\t\t\t'Email' => $regFormData['Email']\n\t\t\t);\n\t\t\tif(empty($conInfo))\n\t\t\t\t$conDat['Leadsource'] = 'AttentionWizard';\n\t\t\t$isConID = $app->addCon($conDat);\n\t\t}else{\n\t\t\t$isConID = $conInfo[0]['Id'];\n\t\t}\n\t\t// Locate existing credit card\n\t\t$ccID = $app->locateCard($isConID,substr($data['CreditCardNumber'],-4,4));\n\t\t$creditCardType = $this->getISCreditCardType($data['CreditCardType']);\n\t\tif(!$ccID){\n\t\t\t//Validate the credit card\n\t\t\t$card = array(\n\t\t\t\t'CardType' => $creditCardType,\n\t\t\t\t'ContactId' => $isConID,\n\t\t\t\t'CardNumber' => $data['CreditCardNumber'],\n\t\t\t\t'ExpirationMonth' => sprintf(\"%02s\", $data['ExpirationMonth']),\n\t\t\t\t'ExpirationYear' => $data['ExpirationYear'],\n\t\t\t\t'CVV2' => $data['CVVCode']\n\t\t\t);\n\t\t\t$result = $app->validateCard($card);\n\t\t\tif($result['Valid'] == 'false')\n\t\t\t\treturn \"inlineMsg3\";\n\t\t\t$ccData = array(\n\t\t\t\t\t'ContactId' => $isConID,\n\t\t\t\t\t'FirstName' => $data['FirstName'],\n\t\t\t\t\t'LastName' => $data['LastName'],\n\t\t\t\t\t'BillAddress1' => $data['StreetAddress1'],\n\t\t\t\t\t'BillAddress2' => $data['StreetAddress2'],\n\t\t\t\t\t'BillCity' => $data['City'],\n\t\t\t\t\t'BillState' => $data['State'],\n\t\t\t\t\t'BillZip' => $data['PostalCode'],\n\t\t\t\t\t'BillCountry' => $country,\n\t\t\t\t\t'CardType' => $creditCardType,\n\t\t\t\t\t'NameOnCard' => $data['NameOnCard'],\n\t\t\t\t\t'CardNumber' => $data['CreditCardNumber'],\n\t\t\t\t\t'CVV2' => $data['CVVCode'],\n\t\t\t\t\t'ExpirationMonth' => sprintf(\"%02s\", $data['ExpirationMonth']),\n\t\t\t\t\t'ExpirationYear' => $data['ExpirationYear']\n\t\t\t);\n\t\t\t$ccID = $app->dsAdd(\"CreditCard\", $ccData);\n\t\t}\n\t\t// Create AttentionWizard member\n\t\t$member = new Member();\n\t\t$member->FirstName = $data['FirstName'];\n\t\t$member->Surname = $data['LastName'];\n\t\t$member->Email = $regFormData['Email'];\n\t\t$member->Password = $regFormData['Password']['_Password'];\n\t\t$member->ISContactID = $isConID;\n\t\t$memberID = $member->write();\n\t\t//Find or create the 'user' group and add the member to the group\n\t\tif(!$userGroup = DataObject::get_one('Group', \"Code = 'customers'\")){\n\t\t\t$userGroup = new Group();\n\t\t\t$userGroup->Code = \"customers\";\n\t\t\t$userGroup->Title = \"Customers\";\n\t\t\t$userGroup->Write();\n\t\t\t$userGroup->Members()->add($member);\n\t\t}else{\n\t\t\t$userGroup->Members()->add($member);\n\t\t}\n\t\t//Get product details\n\t\t$product = Product::get()->byID($data['SubscriptionType']);\n\t\t$credits = $product->Credits;\n\t\tif($data['SubscriptionType'] == 1){\n\t\t\t$orderAmount = $product->TrialPrice;\n\t\t\t$productName = \"30 days 1-dollar Trial\";\n\t\t\t$isProductID = 38;\n\t\t}else{\n\t\t\t$productName = $product->Name;\n\t\t\t$orderAmount = $product->RecurringPrice;\n\t\t\t$isProductID = $product->ISInitialProductID;\n\t\t}\n\t\t// Store credit card info\n\t\t$creditCard = new CreditCard();\n\t\t$creditCard->CreditCardType = $data['CreditCardType'];\n\t\t$creditCard->CreditCardNumber = $data['CreditCardNumber'];\n\t\t$creditCard->NameOnCard = $data['NameOnCard'];\n\t\t$creditCard->CreditCardCVV = $data['CVVCode'];\n\t\t$creditCard->ExpiryMonth = $data['ExpirationMonth'];\n\t\t$creditCard->ExpiryYear = $data['ExpirationYear'];\n\t\t$creditCard->Company = $data['Company'];\n\t\t$creditCard->StreetAddress1 = $data['StreetAddress1'];\n\t\t$creditCard->StreetAddress2 = $data['StreetAddress2'];\n\t\t$creditCard->City = $data['City'];\n\t\t$creditCard->State = $data['State'];\n\t\t$creditCard->PostalCode = $data['PostalCode'];\n\t\t$creditCard->Country = $data['Country'];\n\t\t$creditCard->Current = 1;\n\t\t$creditCard->ISCCID = $ccID;\n\t\t$creditCard->MemberID = $memberID;\n\t\t$creditCardID = $creditCard->write();\n\t\t// Create an order\n\t\t$order = new Order();\n\t\t$order->OrderStatus = 'P';\n\t\t$order->Amount = $orderAmount;\n\t\t$order->MemberID = $memberID;\n\t\t$order->ProductID = $data['SubscriptionType'];\n\t\t$order->CreditCardID = $creditCardID;\n\t\t$orderID = $order->write();\n\t\t//Create the Infusionsoft subscription\n\t\t$subscriptionID = $this->createISSubscription($isConID, $product->ISProductID, $product->RecurringPrice, $ccID, 30);\n\t\tif($subscriptionID && is_int($subscriptionID)){\n\t\t\t//Create an infusionsoft order\n\t\t\t$config = SiteConfig::current_site_config();\n\t\t\t$invoiceId = $app->blankOrder($isConID,$productName, $curdate, 0, 0);\n\t\t\t$orderItem = $app->addOrderItem($invoiceId, $isProductID, 9, floatval($orderAmount), 1, $productName, $productName);\n\t\t\t$result = $app->chargeInvoice($invoiceId,$productName,$ccID,$config->MerchantAccount,false);\n\t\t\tif($result['Successful']){\n\t\t\t\t// Create a Subscription record\n\t\t\t\t$nextBillDate = $this->getSubscriptionNextBillDate($subscriptionID);\n\t\t\t\t$expireDate= date('Y-m-d H:i:s', strtotime($nextBillDate));\n\t\t\t\t$startDate= date('Y-m-d H:i:s', strtotime($expireDate. \"-30 days\"));\n\t\t\t\t$subscription = new Subscription();\n\t\t\t\t$subscription->StartDate = $startDate;\n\t\t\t\t$subscription->ExpireDate = $expireDate;\n\t\t\t\t$subscription->MemberID = $memberID;\n\t\t\t\t$subscription->ProductID = $data['SubscriptionType'];\n\t\t\t\t$subscription->OrderID = $orderID;\n\t\t\t\t$subscription->Status = 1;\n\t\t\t\t$subscription->SubscriptionID = $subscriptionID;\n\t\t\t\t$subscription->write();\n\t\t\t\t// Create a MemberCredits record\n\t\t\t\t$memberCredits = new MemberCredits();\n\t\t\t\t$memberCredits->Credits = $credits;\n\t\t\t\t$memberCredits->ExpireDate = $expireDate;\n\t\t\t\t$memberCredits->MemberID = $memberID;\n\t\t\t\t$memberCredits->ProductID = $data['SubscriptionType'];\n\t\t\t\t$memberCredits->SubscriptionID = $subscription->ID;\n\t\t\t\t$memberCredits->write();\n\t\t\t\t// Update order\n\t\t\t\t$order->OrderStatus = 'c';\n\t\t\t\t$order->write();\n\t\t\t\t// If product selected is bronze do a trial signup\n\t\t\t\tif($data['SubscriptionType'] == 1){\n\t\t\t\t\t//Add the InfusionSoft tag\n\t\t\t\t\t$app->grpAssign($isConID, 2216);\n\t\t\t\t\t//Update the InfusionSoft contact details\n\t\t\t\t\t$conDat = array(\n\t\t\t\t\t\t\t'ContactType' => 'AW Customer',\n\t\t\t\t\t\t\t'_AWstartdate' => $curdate,\n\t\t\t\t\t\t\t'_AttentionWizard' => 'Free'\n\t\t\t\t\t);\n\t\t\t\t\t$app->updateCon($isConID, $conDat);\n\t\t\t\t\t// Update Subscription\n\t\t\t\t\t$subscription->IsTrial = 1;\n\t\t\t\t\t$subscription->SubscriptionCount = 0;\n\t\t\t\t\t$subscription->write();\n\t\t\t\t\t// Update Member\n\t\t\t\t\t$member->SignUpTrial = 1;\n\t\t\t\t\t$member->write();\n\t\t\t\t\t// Update Order\n\t\t\t\t\t$order->IsTrial = 1;\n\t\t\t\t\t$order->write();\n\t\t\t\t\t// Update credit card\n\t\t\t\t\t$creditCard->UsedForTrial = 1;\n\t\t\t\t\t$creditCard->write();\n\t\t\t\t}else{\n\t\t\t\t\t// Update Subscription\n\t\t\t\t\t$subscription->SubscriptionCount = 1;\n\t\t\t\t\t$subscription->write();\n\t\t\t\t\t// Add the InfusionSoft tag\n\t\t\t\t\t$isTagId = $this->getISTagIdByProduct($data['SubscriptionType']);\n\t\t\t\t\t$app->grpAssign($isConID, $isTagId);\n\t\t\t\t\t//Update the InfusionSoft contact details\n\t\t\t\t\t$returnFields = array('_AWofmonths');\n\t\t\t\t\t$conDat1 = $app->loadCon($isConID,$returnFields);\n\t\t\t\t\tif(!isset($conDat1['_AWofmonths']))\n\t\t\t\t\t\t$conDat1['_AWofmonths'] = 0;\n\t\t\t\t\t$conDat = array(\n\t\t\t\t\t\t\t'_AWofmonths' => $conDat1['_AWofmonths']+1,\n\t\t\t\t\t\t\t'ContactType' => 'AW Customer',\n\t\t\t\t\t\t\t'_AttentionWizard' => 'Paid and Current',\n\t\t\t\t\t\t\t'_AWstartdate' => $curdate\n\t\t\t\t\t);\n\t\t\t\t\t$app->updateCon($isConID, $conDat);\n\t\t\t\t\t//Add a note\n\t\t\t\t\t$conActionDat = array('ContactId' => $isConID,\n\t\t\t\t\t\t\t'ActionType' => 'UPDATE',\n\t\t\t\t\t\t\t'ActionDescription' => \"Payment made for AW service\",\n\t\t\t\t\t\t\t'CreationDate' => $curdate,\n\t\t\t\t\t\t\t'ActionDate' => $curdate,\n\t\t\t\t\t\t\t'CompletionDate' => $curdate,\n\t\t\t\t\t\t\t'CreationNotes' => \"{$product->Name} Subscription\",\n\t\t\t\t\t\t\t'UserID' => 1\n\t\t\t\t\t);\n\t\t\t\t\t$app->dsAdd(\"ContactAction\", $conActionDat);\n\t\t\t\t}\n\t\t\t\t$member->logIn();\n\t\t\t\t$this->setMessage('Success', 'You have signed-up & the Subscription is created successfully');\n\t\t\t\treturn 'url1';\n\t\t\t}else{\n\t\t\t\t//Set the subscription to Inactive\n\t\t\t\t$this->setSubscriptionStatus($subscriptionID, 'Inactive');\n\t\t\t\t//Update InfusionSoft contact\n\t\t\t\tif($data['SubscriptionType'] == 1){\n\t\t\t\t\t$aw = 'Unsuccessful trial sign-up';\n\t\t\t\t}else{\n\t\t\t\t\t$aw = 'Unsuccessful paid sign-up';\n\t\t\t\t}\n\t\t\t\t$conDat = array(\n\t\t\t\t\t\t'ContactType' => 'AW Prospect',\n\t\t\t\t\t\t'_AttentionWizard' => $aw\n\t\t\t\t);\n\t\t\t\t\n\t\t\t\t$app->updateCon($isConID, $conDat);\n\t\t\t\t// Add an AW prospect tag\n\t\t\t\t//$app->grpAssign($isConID, $this->getISTagIdByPaymentCode(strtoupper($result['Code'])));\n\t\t\t\t$app->grpAssign($isConID, $this->getISTagIdByPaymentCode('DECLINED'));\n\t\t\t\t// Add a note\n\t\t\t\t$conActionDat = array('ContactId' => $isConID,\n\t\t\t\t\t\t'ActionType' => 'UPDATE',\n\t\t\t\t\t\t'ActionDescription' => \"Unsuccessful attempt to sign-up for AW\",\n\t\t\t\t\t\t'CreationDate' => $curdate,\n\t\t\t\t\t\t'ActionDate' => $curdate,\n\t\t\t\t\t\t'CompletionDate' => $curdate,\n\t\t\t\t\t\t'UserID' => 1\n\t\t\t\t);\n\t\t\t\t$conActionID = $app->dsAdd(\"ContactAction\", $conActionDat);\n\t\t\t\t$member->logIn();\n\t\t\t\t$this->setMessage('Error', 'Sorry,the payment failed due to some reason.please update your credit card');\n\t\t\t\treturn \"url2\";\n\t\t\t}\n\t\t}else{\n\t\t\t$member->logIn();\n\t\t\t// Add an AW prospect tag\n\t\t\t$app->grpAssign($isConID, 3097);\n\t\t\t//Update InfusionSoft contact\n\t\t\tif($data['SubscriptionType'] == 1){\n\t\t\t\t$aw = 'Unsuccessful trial sign-up';\n\t\t\t}else{\n\t\t\t\t$aw = 'Unsuccessful paid sign-up';\n\t\t\t}\n\t\t\t$conDat = array(\n\t\t\t\t\t'ContactType' => 'AW Prospect',\n\t\t\t\t\t'_AttentionWizard' => $aw\n\t\t\t);\n\t\t\t$app->updateCon($isConID, $conDat);\n\t\t\t// Add a note\n\t\t\t$conActionDat = array('ContactId' => $isConID,\n\t\t\t\t\t'ActionType' => 'UPDATE',\n\t\t\t\t\t'ActionDescription' => \"Unsuccessful attempt to sign-up for AW\",\n\t\t\t\t\t'CreationDate' => $curdate,\n\t\t\t\t\t'ActionDate' => $curdate,\n\t\t\t\t\t'CompletionDate' => $curdate,\n\t\t\t\t\t'UserID' => 1\n\t\t\t);\n\t\t\t$conActionID = $app->dsAdd(\"ContactAction\", $conActionDat);\n\t\t\t$this->setMessage('Error', 'You have signed-up successfully but the Subscription is not created,please try again.');\n\t\t\treturn \"url3\";\n\t\t}\n\t}",
"public function signup()\n\t{\n\t\t$id_telefono = $this->session->userdata('username');\n\t\t$data['estado'] = $this->plataforma_model->getEstado($id_telefono); \n\t\t$data['saldo'] = $this->plataforma_model->getSaldo($id_telefono); \n\t\t$data['usuario'] = $this->plataforma_model->getUserInfo($id_telefono); \n\t\t$this->load->view('signup',$data);\n\t}",
"public function guest_completed_registration_form_Successfully_registered_and_checked_in_DB()\n {\n $this->visit('/register')\n ->seePageIs('/register')\n ->type($this->user->name, 'name')\n ->type($this->user->email, 'email')\n ->type($this->user->password, 'password')\n ->type($this->user->password, 'password_confirmation')\n ->press('Register');\n\n\n $this->seeInDatabase('users', ['name' => $this->user->name]);\n }",
"public function signUpUser($name, $phone, $email, $zip, $password) {\n\tif (isset($_POST['submit'])) {\n\n\t\t//Then we include the database connection\n\t\tinclude_once '../Core/database.php';\n\t\trequire_once '../Core/database.php';\n\n\t\t// then get the data from the signup form\n\t\t$phone = $_POST['phone'];\n\t\t$zip = $_POST['zip'];\n\t\t$email = $_POST['email'];\n\t\t$name = $_POST['name'];\n\t\t$password = $_POST['password'];\n\n\t\t//Error handlers\n\t\t//Error handlers are important to avoid any mistakes the user might have made when filling out the form!\n\t\t//Check for empty fields\n\t\tif (empty($name) || empty($phone) || empty($email) || empty($zip) || empty($password)) {\n\t\t\theader(\"Location: ../views/home/signupView.php?signup=empty\");\n\t\t\texit();\n\n\t\t} else {\n\t\t\tif (\n\t\t\t\t!preg_match(\"/[\\w\\s]+/\", $name) || !preg_match(\"/^(\\\\+)[0-9]{8,30}$/\", $phone) ||\n\t\t\t\t!preg_match(\"/[^@]+@[^@]+\\.[^@]+/\", $email) || !preg_match(\"/^[0-9]{4}$/\", $zip) ||\n\t\t\t\t!preg_match(\"/^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9]).{8,}$/\", $password)\n\t\t\t) {\n\t\n\t\t\t\theader(\"Location: ../views/home/signupView.php?signup=invalid\");\n\t\t\t\texit();\n\t\t\t} else {\n\t\t\t\t//Check email\n\t\t\t\tif (!filter_var($email, FILTER_VALIDATE_EMAIL)) {\n\t\t\t\t\theader(\"Location: ../views/home/signupView.php?signup=emailInvalid\");\n\t\t\t\t\texit();\n\t\t\t\t} else {\n\t\t\t\t\t\n\t\t\t\t\t$stmt = $this->conn->prepare(\"SELECT * FROM users WHERE user_id=:user_id\"); \n\t\t\t\t\t$stmt->bindParam(':user_id', $user_id, PDO::PARAM_STR);\n\t\n\t\n\t\t\t\t\tif (!$stmt->execute()) {\n\t\t\t\t\t\theader(\"Location: ../views/home/signupView.php?signup=usertaken\");\n\t\t\t\t\t\texit();\n\t\t\t\t\t} else {\n\t\t\t\t\t\t//Hashing of the Password\n\t\t\t\t\t\t$hashedPwd = password_hash($password, PASSWORD_DEFAULT);\n\t\t\t\t\t\t//Insert user to database\n\t\t\t\t\t\t$sql = \"INSERT INTO users (username, user_phone, user_email, user_zip, password) \n \t\t\t\t\t\tVALUES (:name, :phone, :email, :zip, :hashedPwd)\";\n\n\t\n\t\t\t\t\t\t$stmt= $this->conn->prepare($sql);\n\t\t\t\t\t\t$stmt->execute([':name' => $name, \n\t\t\t\t\t\t\t\t\t':phone' => $phone, \n\t\t\t\t\t\t\t\t\t':email' => $email, \n\t\t\t\t\t\t\t\t\t':zip' => $zip, \n\t\t\t\t\t\t\t\t\t':hashedPwd'=> $hashedPwd \n\t\t\t\t\t\t\t\t\t]);\n\t\t\t\t\t\theader(\"Location: ../views/home?signup=success\");\n\t\t\t\t\t\texit();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}}\n\n }\n\n}",
"function checkUserSignUp() {\n //Define variables and set to empty values\n $FName = $LName = $birthday = $Email = $Password = $Password2 = $ProfilePicURl = \"\";\n\n $errorString = \"\";\n //Verify that none are empty. If they are, echo it on the screen using a massive string\n //Check the first name\n if(empty($_POST[\"firstName\"])){\n $errorString = $errorString . \"First Name is required.<br>\";\n }else{\n $FName = test_input($_POST[\"firstName\"]);\n if (!preg_match(\"/^[a-zA-Z'-]+$/\", $FName)){\n $errorString = $errorString . \"Invalid first name format: letters only<br>\";\n }\n }\n\n //Check the last name\n if(empty($_POST[\"lastName\"])){\n $errorString = $errorString . \"Last Name is required.<br>\";\n }else{\n $LName = test_input($_POST[\"lastName\"]);\n if (!preg_match(\"/^[a-zA-Z'-]+$/\", $LName)){\n $errorString = $errorString . \"Invalid last name format: letters only<br>\";\n }\n }\n\n //Check the birthday\n if(empty($_POST[\"DOB\"])){\n $errorString = $errorString . \"A birthday is required (21+ Only)<br>\";\n }else{\n //Do the parsing here for dob\n $birthday = test_input($_POST[\"DOB\"]);\n $age = 21;\n //Checks to make sure date is inputted in mm-dd-yyyy\n if (!preg_match(\"/^\\d{1,2}\\-\\d{1,2}\\-\\d{4}/\", $birthday)){\n $errorString = $errorString . \"Expected date format is: 01-01-1950<br>\";\n }\n\n //Converts the birthday to UNIX timestamp\n $birthdayTime = strtotime($birthday);\n\n //Verifies that birthday is 21+ years ago\n if(time() - $birthdayTime < $age * 31536000) {\n $errorString = $errorString . \"You must be 21+ to sign up<br>\";\n }\n\n //Converts birthday if valid from UNIX timestamp to MySQL compatible format\n $birthdayFinal = date(\"Y-m-d H:i:s\", $birthdayTime);\n }\n\n //Check the email.. This is imperative\n if(empty($_POST[\"email\"])){\n $errorString = $errorString . \"Email is required. We will not SPAM.<br>\";\n }else{\n $Email = test_input($_POST[\"email\"]);\n if (!filter_var($Email, FILTER_VALIDATE_EMAIL)) {\n $errorString = $errorString . \"Invalid email format<br>\";\n }\n }\n\n //Verify the password. They must also be equal\n if(empty($_POST[\"password\"])){\n $errorString = $errorString . \"Password is required.<br>\";\n }else{\n $Password = test_input($_POST[\"password\"]);\n }\n if(empty($_POST[\"re_enter_password\"])){\n $errorString = $errorString . \"Verify your password<br>\";\n }else{\n $Password2 = test_input($_POST[\"re_enter_password\"]);\n }\n if(strcmp($Password,$Password2) != 0){\n $errorString = $errorString . \"Passwords do not match<br>\";\n }\n\n\n //Get the profile pic url (optional)\n if(empty($_POST[\"ProfilePicURL\"])){\n //$ProfilePicURl = \"https://pbs.twimg.com/profile_images/1665394718/image.jpg\";\n $ProfilePicURl = \"http://gagnons.com/media/wysiwyg/blank-profile-_bowtie.png\";\n }else{\n $ProfilePicURl = test_input($_POST[\"ProfilePicURL\"]);\n }\n\n //Display the error string\n echo \"<p style=\\\"text-align:center; color:red; width:100%; font-size:18px;\\\">\" . $errorString . \"</p>\";\n\n //If the length of the error string is 0, create user.\n if(strlen($errorString) == 0){\n // calls user that creates user in the db\n createUser($FName, $LName, $birthdayFinal, $Email, $Password, $ProfilePicURl);\n echo $Email;\n }\n\n}",
"public function signUp(array $attributes)\n\t{\n\t\treturn $this->perform('signUp', $this->getNew(), $attributes);\n\t}",
"public function doRegister(){\n\t\t\t$requestUser = $this->registerView->getRequestUserName();\n\t\t\t$requestPassword = $this->registerView->getRequestPassword();\n\t\t\t$requestRePassword = $this->registerView->getRequestRePassword();\n\t\t\t\n\t\t\tif($this->registerView->didUserPressRegister() ){\n\t\t\t\ttry{\n\t\t\t\tif($this->checkUsername($requestUser) && $this->checkPassword($requestPassword,$requestRePassword)){\n\t\t\t\t\t//create and add new user\n\t\t\t\t\t$newUser = new User($requestUser,$requestPassword);\n\t\t\t\t\t$this->userList->add($newUser);\n\t\t\t\t\t\n\t\t\t\t\t$this->model->toggleJustRegistered();\n\t\t\t\t\t$this->model->setSessionUsername($requestUser);\n\t\t\t\t\t$this->navView->clearURL();\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\tcatch (UserFewCharException $ufce){\n\t\t\t\t\t$this->registerView->setErrorUsernameFewChar();\n\t\t\t\t\t$this->registerView->setUsernameField($requestUser);\n\t\t\t\t} \n\t\t\t\tcatch (UserBadCharException $udce){\n\t\t\t\t\t$this->registerView->setErrorUsernameInvalidChar();\n\t\t\t\t\t$this->registerView->setUsernameField(strip_tags($requestUser));\n\t\t\t\t} \n\t\t\t\tcatch (UserExistsException $uee){\n\t\t\t\t\t$this->registerView->setErrorUsernameExists();\n\t\t\t\t\t$this->registerView->setUsernameField($requestUser);\n\t\t\t\t} \n\t\t\t\tcatch (PasswordLenException $ple){\n\t\t\t\t\t$this->registerView->setErrorPasswordFewChar();\n\t\t\t\t\t$this->registerView->setUsernameField($requestUser);\n\t\t\t\t} \n\t\t\t\tcatch (PasswordMissmatchException $pme){\n\t\t\t\t\t$this->registerView->setErrorPasswordMatch();\n\t\t\t\t\t$this->registerView->setUsernameField($requestUser);\n\t\t\t\t}\n\t\t\t\tif(empty($requestUser) && empty($requestPassword) && empty($requestRePassword))\n\t\t\t\t\t$this->registerView->setErrorMissingFields();\t\t\n\t\t\t}\n\t\t}",
"public function formSubmit() {\n\n check_admin_referer('ncstate-wrap-authentication');\n\n $newOptions = array(\n 'autoCreateUser' => (bool)$_POST['nwa_autoCreateUser'],\n );\n\n update_option('ncstate-wrap-authentication', $newOptions);\n\n wp_safe_redirect(add_query_arg('updated', 'true', wp_get_referer()));\n }",
"public function addSignup(&$info)\n {\n // Perform any preprocessing if requested.\n $this->_preSignup($info);\n\n // Attempt to add the user to the system.\n $GLOBALS['auth']->addUser($info['user_name'], array('password' => $info['password']));\n\n // Attempt to add/update any extra data handed in.\n if (!empty($info['extra'])) {\n try {\n Horde::callHook('signup_addextra', array($info['user_name'], $info['extra'], $info['password']));\n } catch (Horde_Exception_HookNotSet $e) {\n }\n }\n }",
"public function signup_post() {\n\n\n $post_data = $this->post();\n $final_user_array = array();\n $insert = array();\n $return_arr = array();\n\n /*\n * Mandatory fields for sign up as look into the config signup_key file to add mandatory fields \n */\n $required_fields_arr = array(\n array(\n 'field' => 'email',\n 'label' => 'Email',\n 'rules' => 'trim|required|valid_email|is_unique[ai_user.email]'\n ),\n array(\n 'field' => 'password',\n 'label' => 'Password',\n 'rules' => 'trim|required'\n ),\n array(\n 'field' => 'first_name',\n 'label' => 'First Name',\n 'rules' => 'trim|required'\n ),\n array(\n 'field' => 'device_id',\n 'label' => 'Device ID',\n 'rules' => 'required'\n ),\n array(\n 'field' => 'phone',\n 'label' => 'Phone Number',\n 'rules' => 'callback_validate_phone'\n ),\n array(\n 'field' => 'dob',\n 'label' => 'Dob',\n 'rules' => 'callback_validate_dob'\n ),\n );\n\n $this->form_validation->set_rules($required_fields_arr);\n $this->form_validation->set_message('regex_match[/^[0-9]{10}$/]', 'The %s is not valid');\n $this->form_validation->set_message('is_unique', 'The %s is already registered with us');\n $this->form_validation->set_message('required', 'Please enter the %s');\n\n\n if ($this->form_validation->run()) {\n\n $pArray = $this->config->item('sign_keys');\n /*\n * load possible sign-up data from the configuration sign_key file\n */\n $data = $this->defineDefaultValue($pArray, $post_data);\n /*\n * empty unnecessay fields \n */\n try {\n /*\n * upload profile pic option \n */\n if (isset($_FILES['profile_image']) && !empty($_FILES['profile_image'])) {\n\n $this->load->library('commonfn');\n $config = [];\n $config['upload_path'] = UPLOAD_IMAGE_PATH;\n $config['allowed_types'] = 'jpeg|jpg|png';\n $config['max_size'] = 3000;\n $config['max_width'] = 1024;\n $config['max_height'] = 768;\n $config['encrypt_name'] = TRUE;\n\n $this->load->library('upload', $config);\n\n if ($this->upload->do_upload('profile_image')) {\n\n $upload_data = $this->upload->data();\n\n $insert['image'] = $upload_data['file_name'];\n $filename = $upload_data['file_name'];\n $filesource = UPLOAD_IMAGE_PATH . $filename;\n $targetpath = UPLOAD_THUMB_IMAGE_PATH;\n $isSuccess = $this->commonfn->thumb_create($filename, $filesource, $targetpath);\n if ($isSuccess) {\n $insert['image_thumb'] = $upload_data['file_name'];\n }\n } else {\n $this->response_data([], ERROR_UPLOAD_FILE, '', strip_tags($this->upload->display_errors()));\n }\n }\n\n // fetch db user key and map data with it \n $this->db->trans_begin();\n $final_user_array = $this->GET_user_arr($insert, $data);\n\n $session_arr = $this->GET_session_arr($data);\n $return_arr = $this->User_model->Insert_userData($final_user_array, $session_arr);\n\n if ($this->db->trans_status() === TRUE) {\n $this->db->trans_commit();\n } else {\n $this->db->trans_rollback();\n throw new Exception(\"account_creation_unsuccessful || \" . ERROR_INSERTION);\n }\n } catch (Exception $e) {\n\n $error = $e->getMessage();\n list($msg, $code) = explode(\" || \", $error);\n $this->response_data([], $code, $msg);\n }\n\n $this->response_data($return_arr, SUCCESS_REGISTRATION, 'account_creation_successful');\n // pass data,code,extrainfo and language key\n } else {\n $err = $this->form_validation->error_array();\n $arr = array_values($err);\n $this->response_data([], PARAM_REQ, '', $arr[0]);\n }\n }",
"function sign_up($conn){\r\n\tif (isset($_POST['signupSubmit'])){\r\n\t\t$uid = $_POST['uid'];\r\n\t\t$pwd = $_POST['pwd'];\r\n\t\t$sql1 = \"SELECT * FROM users WHERE uid='$uid'\";\r\n\t\t$result1 = pg_query($conn, $sql1);\r\n\t\tif (pg_num_rows($result1)>0) {\r\n\t\t\techo \"<div class='alert alert-danger alert-dismissible' role='alert'>\r\n\t\t\t This username has been used. Please try again.\r\n\t\t\t</div>\";\r\n\t\t} else {\r\n\t\t\t$sql = \"INSERT INTO users VALUES ('$uid', '$pwd', 500)\";\r\n\t\t\t$result = pg_query($conn, $sql);\r\n\t\t\t//header(\"Location: index.php\");\r\n\t\t\techo \"<div class='alert alert-success alert-dismissible' role='alert'>\r\n\t\t\t You have signed up successfully!\r\n\t\t\t</div>\";\r\n\t\t}\r\n\t\t\r\n\t}\r\n}",
"private static function register() {\n if ( !self::validatePost() ) {\n return;\n }\n\n if ( !self::validEmail($_POST['email']) ) {\n self::setError('E-Mail Adresse ist nicht gültig!<br>');\n return;\n }\n \n $_POST['email'] = strtolower($_POST['email']);\n \n $password = Helper::hash($_POST['password'].$_POST['email']);\n \n $verified = md5($_POST['email'].$password.microtime(true));\n \n $result = Database::createUser($_POST['email'],$password,$verified);\n \n if ( $result === false || !is_numeric($result) ) {\n return;\n }\n \n $_SESSION['user']['id'] = $result;\n $_SESSION['user']['email'] = $_POST['email'];\n $_SESSION['user']['verified'] = $verified;\n $_SESSION['loggedin'] = true;\n self::$loggedin = true;\n \n self::registerMail($verified);\n }",
"protected function performSignUp($entity, array $attributes)\n\t{\n\t\t$entity->active = (bool) array_get($attributes, 'active');\n\n\t\treturn $this->perform('create', $entity, $attributes, false);\n\t}",
"public function postRegister()\n\t{\n\t\t$rules = array(\n\t\t\t'username' => 'required|unique:users',\n\t\t\t'email' => 'required|email|unique:users|confirmed',\n\t\t\t'password' => 'required|min:8',\n\t\t\t'checkbox' => 'accepted',\n\t\t\t);\n\t\t\n\t\t//validate form input with validation rules\n\t\t$validator = Validator::make(Input::all(),$rules);\n\n\t\t// if validator failed\n\t\tif($validator->fails()){\n\n\t\t\t// redirect back to form with errors from validator\n\t\t\treturn Redirect::route('login')->withErrors($validator)->withInput();\n\t\t}\n\t\telse{\n\t\t\t$user = Sentry::createUser(array(\n\t\t\t\t'username' => Input::get('username'),\n\t\t\t\t'email' => Input::get('email'),\n\t\t\t\t'password' => Input::get('password'),\n\t\t\t\t));\n\n\t\t\t$membergroup = Sentry::findGroupByName('Members');\n\t\t\t$user->addGroup($membergroup);\n\n\t\t\t// get activation code\n\t\t\t$activationCode = $user->getActivationCode();\n\n\t\t\t// send activation code to user so that he can activate account\n\t\t\t// link should be shopcaddy.com/verify-activate/{token}\n\t\t\t// http://shopcaddy.localhost/verify-activate/wk2dJHluf7GzO1uG0P04gSfTm9NdqE5DBc3vNBGHOe\n\n\t\t\t// redirect back\n\t\t\treturn Redirect::to('login')->with('message',\"Thanks for signing up.<br>You will receive a verification email to confirm your email address.<br>If you don't see the email in your inbox, please check your spam folder or <a href='/contact-us'>contact support</a>.\");\n\t\t}\n\t}",
"public function signup(/* $acct_type = 'standard' */)\n {\n // They can't be logged in!\n\t\tif ( Auth::logged_in() )\n {\n set_error('You can\\'t be logged in!');\n redirect(site_url());\n return;\n }\n \n if (isset($_POST['first-name'])) :\n \n $this->form_validation->set_rules('first-name', 'First Name', 'required|alpha');\n $this->form_validation->set_rules('last-name', 'Last Name', 'required|alpha');\n $this->form_validation->set_rules('your-email', 'Email', 'required|valid_email');\n \n // Login Details\n $this->form_validation->set_rules('login-name', 'Login Name', 'required');\n $this->form_validation->set_rules('your-password', 'Password', 'required');\n \n // About School\n $this->form_validation->set_rules('district-name', 'District Name', 'required');\n $this->form_validation->set_rules('school-name', 'School Name', 'required');\n $this->form_validation->set_rules('daily_student_funding', 'Daily Student Funding', 'required');\n $this->form_validation->set_rules('initial_truancy_rate', 'Initial Truancy Rate', 'required|numeric');\n $this->form_validation->set_rules('timezones', 'Timezone', 'required');\n \n // Do the Validating\n if ($this->form_validation->run() == FALSE)\n {\n set_error(validation_errors());\n }\n else\n {\n // Register the user\n $user_id = Auth::create_user_automagically(array(\n 'user_slug' =>\tstrtolower($_POST['login-name']),\n 'user_email' =>\tstrtolower($_POST['your-email']),\n 'user_pass' =>\t$_POST['your-password'],\n 'user_first_name' =>\t$_POST['first-name'],\n 'user_last_name' =>\t$_POST['last-name'],\n 'role' => 'district_admin',\n 'create_time' =>\tcurrent_datetime(),\n 'update_user' => 0,\n 'district_id' => 2, // This is the internal demo district\n 'isDeleted' => 0,\n 'school_id' => 1, // This is an internal demo school\n 'student_id' => 0,\n ));\n \n // In error?\n if (is_simple_error($user_id)) :\n set_error($user_id);\n redirect('signup');\n return;\n endif;\n \n // Create the District\n $this->db->set('district_name', $_POST['district-name']);\n $this->db->set('timezone', $_POST['timezones']);\n $this->db->set('create_time', current_datetime());\n $this->db->set('isDeleted', 0);\n $this->db->set('status', 'pending');\n $this->db->insert('district');\n \n $district_id = $this->db->insert_id();\n \n // Create the school\n $this->db->set('district_id', $district_id);\n $this->db->set('school_name', $_POST['school-name']);\n $this->db->set('daily_student_funding', $_POST['daily_student_funding']);\n $this->db->set('initial_truancy_rate', $_POST['initial_truancy_rate']);\n $this->db->set('current_truancy_rate', 0);\n $this->db->set('create_time', current_datetime());\n $this->db->set('isDeleted', 0);\n $this->db->insert('school');\n \n $school_id = $this->db->insert_id();\n \n // Update the user\n Auth::update('district_id', $district_id, $user_id);\n Auth::update('school_id', $school_id, $user_id);\n \n // Log them in\n Auth::do_auth($user_id);\n \n set_good('Your account has been created.');\n \n redirect(site_url());\n return;\n\t\t}\n \n endif; // On Post\n $this->Core->set_title('Register!');\n \n $this->load->view('shared/header');\n\t\t$this->load->view('signup/register');\n\t\t$this->load->view('shared/footer');\n\n }",
"public function run(): void\n {\n $this->createUser(\n self::DEFAULT_USER_ID,\n 'test',\n self::DEFAULT_USER_EMAIL,\n self::DEFAULT_USER_PASSWORD\n );\n\n $this->createUser(\n self::USER_ID_2,\n 'user',\n self::USER_EMAIL_2,\n self::DEFAULT_USER_PASSWORD\n );\n }",
"public function doAction() {\n if ($this->request->isPost() === false) {\n\n $this->flashSession->error('Invalid request');\n return $this->response->redirect('signup', false, 302);\n }\n\n // Validate the form\n $form = new \\Aiden\\Forms\\RegisterForm();\n if (!$form->isValid($this->request->getPost())) {\n foreach ($form->getMessages() as $message) {\n $this->flashSession->error($message);\n return $this->response->redirect('/#form-response', 302);\n }\n }\n\n $name = $this->request->getPost(\"name\", \"string\");\n $email = $this->request->getPost(\"email\", \"string\");\n $password = $this->request->getPost(\"password\");\n $websiteUrl = $this->request->getPost(\"websiteUrl\", \"string\");\n $companyName = $this->request->getPost(\"companyName\", \"string\");\n $companyCountry = $this->request->getPost(\"companyCountry\", \"string\");\n $companyCity = $this->request->getPost(\"companyCity\", \"string\");\n $checkfirst = \\Aiden\\Models\\Users::findFirst(array(\n \"email = ?1\",\n \"bind\" => array(\n 1 => $email,\n )));\n\n if ($checkfirst) {\n $errorMessage = 'Email is already existed, please try another.';\n $this->flashSession->error($errorMessage);\n return $this->response->redirect('signup', false, 302);\n }\n $user = new \\Aiden\\Models\\Users();\n $user->setName($name);\n $user->setEmail($email);\n $user->setWebsiteUrl($websiteUrl);\n $user->setCompanyName($companyName);\n $user->setCompanyCountry($companyCountry);\n $user->setCompanyCity($companyCity);\n $user->setPasswordHash($this->security->hash($password));\n $user->setLevel(\\Aiden\\Models\\Users::LEVEL_USER);\n $user->setCreated(new \\DateTime());\n $user->setLastLogin(new \\DateTime());\n $user->setImageUrl(BASE_URI.\"dashboard_assets/images/avatars/avatar.jpg\");\n $user->setSeenModal(0);\n $user->setPhraseDetectEmail(0);\n $user->setSubscriptionStatus('trial');\n\n if ($user->save()) {\n\n $this->session->set('auth', [\n 'user' => $user\n ]);\n\n // Log message\n $message = sprintf('User with email [%s] has successfully registered.', $email);\n $this->logger->info($message);\n\n return $this->response->redirect('leads', false, 302);\n }\n else {\n\n // Client message\n $errorMessage = 'Something went wrong, please try again.';\n $this->flashSession->error($errorMessage);\n\n // Log message\n $message = sprintf('Could not signup user [%s]. (Model error: %s)', $email, print_r($user->getMessages(), true));\n $this->logger->error($message);\n\n return $this->response->redirect('signup', false, 302);\n }\n\n }",
"function sign_up2($lname, $fname, $birthday, $gender, $age)\n{\n\t$db = user_db();\n\t$sql = \"INSERT INTO userprofile( profLName, profFName, profBirthday, profSex, profAge) VALUES(?,?,?,?,?) \";\n\t$cmd = $db->prepare($sql);\n\t$cmd->execute(array($lname, $fname, $birthday, $gender,$age));\n\t$db = null;\n\t\n\treturn true;\n}",
"function SignupAction($data, $form) {\n \n\t\t\n\t\t// Create a new object and load the form data into it\n\t\t$entry = new SearchContestEntry();\n\t\t$form->saveInto($entry);\n \n\t\t// Write it to the database.\n\t\t$entry->write();\n\t\t\n\t\tSession::set('ActionStatus', 'success'); \n\t\tSession::set('ActionMessage', 'Thanks for your entry!');\n\t\t\n\t\t//print_r($form);\n\t\tDirector::redirectBack();\n \n\t}",
"public function registration() {\r\n \r\n if (isset($_GET[\"submitted\"])) {\r\n $this->registrationSubmit();\r\n } else {\r\n \r\n }\r\n }",
"function signUp($post)\n{\n $email = $post['email'];\n $password = $post['password'];\n $password_confirm = $post['password_confirm'];\n // for showing error when input are empty or mail doesn't match\n if (!preg_match(\"/^[_a-z0-9-]+(\\.[_a-z0-9-]+)*@[a-z0-9-]+(\\.[a-z0-9-]+)*(\\.[a-z]{2,})$/i\", $email))\n {\n $error_msg = \"Format de mail non valide.\";\n }\n // If password input length is less than 6 chars, show error.\n elseif (strlen($password) < 6)\n {\n $error_msg = \"Mot de passe incorrect. Min. 6 caractères.\";\n }\n // If both password don't match, show error.\n elseif ($password != $password_confirm)\n {\n $error_msg = \"Les mots de passes ne correspondent pas.\";\n }\n else {\n $data = new stdClass();\n $data->email = $email;\n $data->password = $password;\n $user = new User( $data );\n $userData = $user->getUserByEmail();\n if ($userData && sizeof( $userData ) > 0) // If email address is already in used, show error.\n {\n $error_msg = \"Cette adresse mail est déjà utilisée.\";\n }\n elseif (strlen($password) < 5) // If password input length is less than 6 chars, show error.\n {\n $error_msg = \"Mot de passe incorrect. Min. 5 caractères.\";\n }\n elseif ($password != $password_confirm) // If both password don't match, show error.\n {\n $error_msg = \"Les mots de passes ne correspondent pas.\";\n }\n else\n {\n // Create new user.\n $password = hash('sha256', $password);\n $user = new User();\n $user->setEmail($email);\n $user->setPassword($password);\n $user->createUser();\n $success_msg = \"Votre inscription s'est déroulée avec succès, vous allez recevoir un mail d'activation.\";\n }\n\n }\n\n //require ('view/auth/signupView.php');\n}",
"public function p_signup() \n {\n $_POST = DB::instance(DB_NAME)->sanitize($_POST);\n $q = 'SELECT user_id\n FROM users \n WHERE email = \"'.$_POST['email'].'\"';\n $user_id = DB::instance(DB_NAME)->select_field($q);\n if ($user_id!=NULL)\n {\n $error=\"User account already exists.\";\n $this->template->content = View::instance('v_users_signup');\n $this->template->content->error=$error;\n echo $this->template;\n }\n else\n {\n\t\t\n //Inserting the user into the database\n\t\t\t$_POST['created']=Time::now();\n\t\t\t$_POST['modified']=Time::now();\n\t\t\t$_POST['password']=sha1(PASSWORD_SALT.$_POST['password']);\n\t\t\t$_POST['token']=sha1(TOKEN_SALT.$_POST['email'].Utils::generate_random_string());\n\t\t\t$_POST['activation_key']=str_shuffle($_POST['password'].$POST['token']);\n\t\t\t$activation_link=\"http://\".$_SERVER['SERVER_NAME'].\"/users/p_activate/\".$_POST['activation_key'];\n\t\t\t$name=$_POST['first_name'];\n\t\t\t$name.=\" \";\n\t\t\t$name.=$_POST['last_name'];\n\t\t\t$user_id = DB::instance(DB_NAME)->insert('users', $_POST);\n\t\t\t\n\t\t//Sending the confirmation mail\n\t\t\t$to[]=Array(\"name\"=>$name, \"email\"=>$_POST['email']);\n\t\t\t$subject=\"Confirmation letter\";\n\t\t\t$from=Array(\"name\"=>APP_NAME, \"email\"=>APP_EMAIL); \n $body = View::instance('signup_email');\n $body->name=$name;\n $body->activation_link=$activation_link;\n\n\n\t\t\t$email = Email::send($to, $from, $subject, $body, false, $cc, $bcc);\n\t\t\t\n\t\t\tRouter::redirect('/');\n } \n }",
"protected function postsignup(Request $request)\n {\n dd($request);\n exit(1);\n $account = new Account();\n $account->email = $request['email'];\n $account->password = $request['password'];\n $account->save();\n\n return redirect()->back();\n }",
"public function createTask()\n\t{\n\t\tif (!User::isGuest() && !User::get('tmp_user'))\n\t\t{\n\t\t\tApp::redirect(\n\t\t\t\tRoute::url('index.php?option=' . $this->_option . '&task=myaccount'),\n\t\t\t\tLang::txt('COM_MEMBERS_REGISTER_ERROR_NONGUEST_SESSION_CREATION'),\n\t\t\t\t'warning'\n\t\t\t);\n\t\t}\n\n\t\tif (!isset($this->_taskMap[$this->_task]))\n\t\t{\n\t\t\t$this->_task = 'create';\n\t\t\tRequest::setVar('task', 'create');\n\t\t}\n\n\t\t// If user registration is not allowed, show 403 not authorized.\n\t\t$usersConfig = Component::params('com_members');\n\t\tif ($usersConfig->get('allowUserRegistration') == '0')\n\t\t{\n\t\t\treturn App::abort(404, Lang::txt('JGLOBAL_RESOURCE_NOT_FOUND'));\n\t\t}\n\n\t\t$hzal = null;\n\t\tif (User::get('auth_link_id'))\n\t\t{\n\t\t\t$hzal = \\Hubzero\\Auth\\Link::find_by_id(User::get('auth_link_id'));\n\t\t}\n\n\t\t// Instantiate a new registration object\n\t\t$xregistration = new \\Components\\Members\\Models\\Registration();\n\n\t\tif (Request::getMethod() == 'POST')\n\t\t{\n\t\t\t// Check for request forgeries\n\t\t\tRequest::checkToken();\n\n\t\t\t// Load POSTed data\n\t\t\t$xregistration->loadPost();\n\n\t\t\t// Perform field validation\n\t\t\t$result = $xregistration->check('create');\n\n\t\t\t// Incoming profile edits\n\t\t\t$profile = Request::getArray('profile', array(), 'post');\n\n\t\t\t// Compile profile data\n\t\t\tforeach ($profile as $key => $data)\n\t\t\t{\n\t\t\t\tif (isset($profile[$key]) && is_array($profile[$key]))\n\t\t\t\t{\n\t\t\t\t\t$profile[$key] = array_filter($profile[$key]);\n\t\t\t\t}\n\t\t\t\tif (isset($profile[$key . '_other']) && trim($profile[$key . '_other']))\n\t\t\t\t{\n\t\t\t\t\tif (is_array($profile[$key]))\n\t\t\t\t\t{\n\t\t\t\t\t\t$profile[$key][] = $profile[$key . '_other'];\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$profile[$key] = $profile[$key . '_other'];\n\t\t\t\t\t}\n\n\t\t\t\t\tunset($profile[$key . '_other']);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Validate profile data\n\t\t\t$fields = \\Components\\Members\\Models\\Profile\\Field::all()\n\t\t\t\t->including(['options', function ($option){\n\t\t\t\t\t$option\n\t\t\t\t\t\t->select('*');\n\t\t\t\t}])\n\t\t\t\t->where('action_create', '!=', \\Components\\Members\\Models\\Profile\\Field::STATE_HIDDEN)\n\t\t\t\t->ordered()\n\t\t\t\t->rows();\n\n\t\t\t// Validate profile fields\n\t\t\tif ($fields->count())\n\t\t\t{\n\t\t\t\t$form = new \\Hubzero\\Form\\Form('profile', array('control' => 'profile'));\n\t\t\t\t$form->load(\\Components\\Members\\Models\\Profile\\Field::toXml($fields, 'create', $profile));\n\t\t\t\t$form->bind(new \\Hubzero\\Config\\Registry($profile));\n\n\t\t\t\tif (!$form->validate($profile))\n\t\t\t\t{\n\t\t\t\t\t$result = false;\n\n\t\t\t\t\tforeach ($form->getErrors() as $key => $error)\n\t\t\t\t\t{\n\t\t\t\t\t\tif ($error instanceof \\Hubzero\\Form\\Exception\\MissingData)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$xregistration->_missing[$key] = $error;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$xregistration->_invalid[$key] = $error;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Passed validation?\n\t\t\tif ($result)\n\t\t\t{\n\t\t\t\t// Get required system objects\n\t\t\t\t$user = clone(User::getInstance());\n\n\t\t\t\t// Initialize new usertype setting\n\t\t\t\t$newUsertype = $usersConfig->get('new_usertype');\n\t\t\t\tif (!$newUsertype)\n\t\t\t\t{\n\t\t\t\t\t$db = App::get('db');\n\t\t\t\t\t$query = $db->getQuery()\n\t\t\t\t\t\t->select('id')\n\t\t\t\t\t\t->from('#__usergroups')\n\t\t\t\t\t\t->whereEquals('title', 'Registered');\n\t\t\t\t\t$db->setQuery($query->toString());\n\t\t\t\t\t$newUsertype = $db->loadResult();\n\t\t\t\t}\n\n\t\t\t\t$user->set('username', $xregistration->get('login', ''));\n\t\t\t\t$user->set('name', $xregistration->get('name', ''));\n\t\t\t\t$user->set('givenName', $xregistration->get('givenName', ''));\n\t\t\t\t$user->set('middleName', $xregistration->get('middleName', ''));\n\t\t\t\t$user->set('surname', $xregistration->get('surname', ''));\n\t\t\t\t$user->set('email', $xregistration->get('email', ''));\n\t\t\t\t$user->set('usageAgreement', (int)$xregistration->get('usageAgreement', 0));\n\t\t\t\t$user->set('sendEmail', -1);\n\t\t\t\tif ($xregistration->get('sendEmail') >= 0)\n\t\t\t\t{\n\t\t\t\t\t$user->set('sendEmail', (int)$xregistration->get('sendEmail'));\n\t\t\t\t}\n\n\t\t\t\t// Set home directory\n\t\t\t\t$hubHomeDir = rtrim($this->config->get('homedir'), '/');\n\t\t\t\tif (!$hubHomeDir)\n\t\t\t\t{\n\t\t\t\t\t// try to deduce a viable home directory based on sitename or live_site\n\t\t\t\t\t$sitename = strtolower(Config::get('sitename'));\n\t\t\t\t\t$sitename = preg_replace('/^http[s]{0,1}:\\/\\//', '', $sitename, 1);\n\t\t\t\t\t$sitename = trim($sitename, '/ ');\n\t\t\t\t\t$sitename_e = explode('.', $sitename, 2);\n\t\t\t\t\tif (isset($sitename_e[1]))\n\t\t\t\t\t{\n\t\t\t\t\t\t$sitename = $sitename_e[0];\n\t\t\t\t\t}\n\t\t\t\t\tif (!preg_match(\"/^[a-zA-Z]+[\\-_0-9a-zA-Z\\.]+$/i\", $sitename))\n\t\t\t\t\t{\n\t\t\t\t\t\t$sitename = '';\n\t\t\t\t\t}\n\t\t\t\t\tif (empty($sitename))\n\t\t\t\t\t{\n\t\t\t\t\t\t$sitename = strtolower(Request::base());\n\t\t\t\t\t\t$sitename = preg_replace('/^http[s]{0,1}:\\/\\//', '', $sitename, 1);\n\t\t\t\t\t\t$sitename = trim($sitename, '/ ');\n\t\t\t\t\t\t$sitename_e = explode('.', $sitename, 2);\n\t\t\t\t\t\tif (isset($sitename_e[1]))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$sitename = $sitename_e[0];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!preg_match(\"/^[a-zA-Z]+[\\-_0-9a-zA-Z\\.]+$/i\", $sitename))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$sitename = '';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t$hubHomeDir = DS . 'home';\n\n\t\t\t\t\tif (!empty($sitename))\n\t\t\t\t\t{\n\t\t\t\t\t\t$hubHomeDir .= DS . $sitename;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$user->set('homeDirectory', $hubHomeDir . DS . $user->get('username'));\n\t\t\t\t$user->set('loginShell', '/bin/bash');\n\t\t\t\t$user->set('ftpShell', '/usr/lib/sftp-server');\n\n\t\t\t\t// Set some initial user values\n\t\t\t\t$user->set('id', 0);\n\t\t\t\t$user->set('accessgroups', array($newUsertype));\n\t\t\t\t$user->set('registerDate', Date::toSql());\n\n\t\t\t\t// Check user activation setting\n\t\t\t\t// 0 = automatically confirmed\n\t\t\t\t// 1 = require email confirmation (the norm)\n\t\t\t\t// 2 = require admin confirmation\n\t\t\t\t$useractivation = $usersConfig->get('useractivation', 1);\n\n\t\t\t\t// If requiring admin approval, set user to block\n\t\t\t\tif ($useractivation == 2)\n\t\t\t\t{\n\t\t\t\t\t$user->set('approved', 0);\n\t\t\t\t}\n\n\t\t\t\t$user->set('access', 5);\n\t\t\t\t$user->set('activation', -rand(1, pow(2, 31)-1));\n\n\t\t\t\tif (is_object($hzal))\n\t\t\t\t{\n\t\t\t\t\tif ($user->get('email') == $hzal->email)\n\t\t\t\t\t{\n\t\t\t\t\t\t$user->set('activation', 3);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if ($useractivation == 0)\n\t\t\t\t{\n\t\t\t\t\t$user->set('activation', 1);\n\t\t\t\t\t$user->set('access', (int)$this->config->get('privacy', 1));\n\t\t\t\t}\n\n\t\t\t\t$user->set('password', \\Hubzero\\User\\Password::getPasshash($xregistration->get('password')));\n\n\t\t\t\t// Do we have a return URL?\n\t\t\t\t$regReturn = Request::getString('return', '');\n\n\t\t\t\tif ($regReturn)\n\t\t\t\t{\n\t\t\t\t\t$user->setParam('return', $regReturn);\n\t\t\t\t}\n\n\t\t\t\t// If we managed to create a user\n\t\t\t\tif ($user->save())\n\t\t\t\t{\n\t\t\t\t\t$access = array();\n\t\t\t\t\tforeach ($fields as $field)\n\t\t\t\t\t{\n\t\t\t\t\t\t$access[$field->get('name')] = $field->get('access');\n\t\t\t\t\t}\n\n\t\t\t\t\t$profile = $xregistration->_registration['_profile'];\n\n\t\t\t\t\t// Save profile data\n\t\t\t\t\t$member = Member::oneOrNew($user->get('id'));\n\t\t\t\t\t$orcidID = Session::get('orcid');\n\t\t\t\t\tif ($orcidID != null)\n\t\t\t\t\t{\n\t\t\t\t\t\t$profile['orcid'] = $orcidID;\n\t\t\t\t\t}\n\t\t\t\t\tif (!$member->saveProfile($profile, $access))\n\t\t\t\t\t{\n\t\t\t\t\t\t\\Notify::error($member->getError());\n\t\t\t\t\t\t// Don't stop the registration process!\n\t\t\t\t\t\t// At this point, the account was successfully created.\n\t\t\t\t\t\t// The profile info, however, may have issues. But, it's not crucial.\n\t\t\t\t\t\t//$result = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t\\Notify::error($user->getError());\n\t\t\t\t\t$result = false;\n\t\t\t\t}\n\n\t\t\t\t// If everything is OK so far...\n\t\t\t\tif ($result)\n\t\t\t\t{\n\t\t\t\t\t$result = \\Hubzero\\User\\Password::changePassword($user->get('id'), $xregistration->get('password'));\n\n\t\t\t\t\t// Set password back here in case anything else down the line is looking for it\n\t\t\t\t\t$user->set('password', $xregistration->get('password'));\n\n\t\t\t\t\t// Did we successfully create/update an account?\n\t\t\t\t\tif (!$result)\n\t\t\t\t\t{\n\t\t\t\t\t\treturn App::abort(500, Lang::txt('COM_MEMBERS_REGISTER_ERROR_CREATING_ACCOUNT'));\n\t\t\t\t\t}\n\n\t\t\t\t\t// Send confirmation email\n\t\t\t\t\tif ($user->get('activation') < 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t\\Components\\Members\\Helpers\\Utility::sendConfirmEmail($user, $xregistration);\n\t\t\t\t\t}\n\n\t\t\t\t\t// Instantiate a new view\n\t\t\t\t\t$this->view\n\t\t\t\t\t\t->set('title', Lang::txt('COM_MEMBERS_REGISTER_CREATE_ACCOUNT'))\n\t\t\t\t\t\t->set('sitename', Config::get('sitename'))\n\t\t\t\t\t\t->set('xprofile', $user)\n\t\t\t\t\t\t->setErrors($this->getErrors())\n\t\t\t\t\t\t->setLayout('create')\n\t\t\t\t\t\t->display();\n\n\t\t\t\t\tif (is_object($hzal))\n\t\t\t\t\t{\n\t\t\t\t\t\t$hzal->set('user_id', $user->get('id'));\n\n\t\t\t\t\t\tif ($hzal->user_id > 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$hzal->update();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tUser::set('auth_link_id', null);\n\t\t\t\t\tUser::set('tmp_user', null);\n\t\t\t\t\tUser::set('username', $xregistration->get('login'));\n\t\t\t\t\tUser::set('email', $xregistration->get('email'));\n\t\t\t\t\tUser::set('id', $user->get('id'));\n\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (Request::method() == 'GET')\n\t\t{\n\t\t\tif (User::get('tmp_user'))\n\t\t\t{\n\t\t\t\t$xregistration->loadAccount(User::getInstance());\n\n\t\t\t\t$username = $xregistration->get('login');\n\t\t\t\t$email = $xregistration->get('email');\n\t\t\t\tif (is_object($hzal))\n\t\t\t\t{\n\t\t\t\t\t$xregistration->set('login', $hzal->username);\n\t\t\t\t\t$xregistration->set('email', $hzal->email);\n\t\t\t\t\t$xregistration->set('confirmEmail', $hzal->email);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Set the pathway\n\t\t$this->_buildPathway();\n\n\t\t// Set the page title\n\t\t$this->_buildTitle();\n\n\t\treturn $this->_show_registration_form($xregistration, 'create');\n\t}",
"public function post()\n\t{\n// \t\t$this->viewParams->signupErrors = ['New accounts are not accepted at this time.'];\n// \t\treturn $this->renderView('home');\n\t\t\n\t\t$orgTitle = $this->trimPostVar('title');\n\t\t$orgName = $this->trimPostVar('name');\n\t\t$username = $this->trimPostVar('username');\n\t\t$password = $this->postVar('password');\n\t\t$confirmPass = $this->postVar(\"confirm-password\");\n\t\t\n\t\t$errors = [];\n\t\t\n\t\tif(strlen($password) < 8){\n\t\t\t$errors[] = \"Password must be at least 8 characters long.\";\n\t\t}\n\t\tif($password !== $confirmPass){\n\t\t\t$errors[] = \"Passwords did not match.\";\n\t\t}\n\t\t\n\t\tif(Org::findByName($orgName)){\n\t\t\t$errors[] = \"Identifier is already taken. Please choose another.\";\n\t\t}\n\t\t\n\t\tif(!filter_var($username, FILTER_VALIDATE_EMAIL)){\n\t\t\t$errors[] = \"Invalid email address provided.\";\n\t\t}\n\t\t\n\t\tif(!count($errors)){\n\t\t\tif($admin = Admin::signup($username, $password)){\n\t\t\t\tif($org = Org::create($admin, $orgName, $orgTitle)){\n\t\t\t\t\tLogin::adminLogin($admin);\n\t\t\t\t\t$this->localRedirect(\"orgs/\".$org->getName());\n\t\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$errors[] = \"Organization could not be created.\";\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$errors[] = \"Admin email is already taken.\";\n\t\t\t}\n\t\t}\n\t\t\n\t\t$this->viewParams->signupOrgTitle = $orgTitle;\n\t\t$this->viewParams->signupOrgName = $orgName;\n\t\t$this->viewParams->signupUsername = $username;\n\t\t$this->viewParams->signupErrors = $errors;\n\t\t\n\t\treturn $this->renderView('Home');\n\t\t\n\t\t\n\t\t\n\t}",
"public function testSignUpForALarabookAccount()\n {\n $this->asGuest();\n\n $this->visit('/')\n ->click('Sign Up!')\n ->seePageIs('/register');\n\n $this->submitForm([\n 'name' => 'John Doe',\n 'email' => '[email protected]',\n 'password' => 'secret',\n 'password_confirmation' => 'secret'\n ]);\n\n $this->seePageIs('/')\n ->see('Welcome to Larabook');\n\n $this->seeInDatabase('users', [\n 'name' => 'John Doe',\n 'email' => '[email protected]'\n ]);\n\n $this->assertTrue(Auth::check());\n }",
"function registerUser()\n {\n $DBA = new DatabaseInterface();\n $fields = array(0 => 'title', 1 => 'first_name', 2 => 'last_name', 3 => 'contacttelephone', 4 => 'contactemail', 5 => 'password', 6 => 'username', 7 => 'dob', 8 => 'house', 9 => 'street', 10 => 'town', 11 => 'county', 12 => 'pcode', 13 => 'optout', 14 => 'newsletter', 15 => 'auth_level', 16 => 'store_owner');\n $fieldvals = array(0 => $this->Title, 1 => $this->FirstName, 2 => $this->LastName, 3 => $this->ContactTelephone, 4 => $this->ContactEmail, 5 => $this->Password, 6 => $this->Username, 7 => $this->DOB, 8 => $this->House, 9 => $this->Street, 10 => $this->Town, 11 => $this->County, 12 => $this->PCode, 13 => $this->Optout, 14 => $this->NewsletterSubscriber, 15 => $this->AuthLevel, 16 => 1);\n $rs = $DBA->insertQuery(DBUSERTABLE, $fields, $fieldvals);\n if ($rs == 1)\n {\n $this->RegistrationSuccess = 1;\n }\n if (isset($this->PCode))\n {\n $this->geoLocate();\n }\n }"
] | [
"0.7345849",
"0.73162985",
"0.70593095",
"0.69968945",
"0.69467527",
"0.69442546",
"0.6936163",
"0.68931097",
"0.6863485",
"0.6817463",
"0.67973375",
"0.6774363",
"0.6771701",
"0.67567515",
"0.6718661",
"0.6707706",
"0.66762197",
"0.66762197",
"0.66753584",
"0.6653744",
"0.6648395",
"0.66367143",
"0.662819",
"0.66267014",
"0.6622923",
"0.6622923",
"0.6606318",
"0.6564846",
"0.654152",
"0.65392244",
"0.65251786",
"0.65210897",
"0.6515224",
"0.6481416",
"0.6450503",
"0.64497685",
"0.6425945",
"0.6414793",
"0.63964176",
"0.6386932",
"0.6366614",
"0.6353261",
"0.63431895",
"0.6315695",
"0.6313696",
"0.6311845",
"0.62872237",
"0.62751764",
"0.6261419",
"0.62425125",
"0.6235038",
"0.62109715",
"0.6186139",
"0.6182449",
"0.6159333",
"0.61555785",
"0.6143181",
"0.61249375",
"0.6122393",
"0.6114031",
"0.6106496",
"0.6088361",
"0.60858274",
"0.6079927",
"0.6064446",
"0.60621",
"0.6047789",
"0.6004007",
"0.60028505",
"0.5994563",
"0.5990442",
"0.597879",
"0.59566057",
"0.5948949",
"0.5941816",
"0.5941341",
"0.59358674",
"0.59327114",
"0.5931096",
"0.5927433",
"0.5922015",
"0.592128",
"0.59212095",
"0.5917043",
"0.5910888",
"0.59090847",
"0.590585",
"0.5901179",
"0.58996415",
"0.5892036",
"0.58798",
"0.5879209",
"0.5867467",
"0.58534443",
"0.5847555",
"0.5845881",
"0.5841752",
"0.58388656",
"0.5836457",
"0.5827034"
] | 0.6805705 | 10 |
Run the database seeds. | public function run()
{
DB::table('book_types')->insert([
'book_id' => 1,
'type_id' => 1,
'price' => '188.65',
'pages' => 288,
'isbn10' => '0062674676',
'isbn13' => '978-0062674678',
'serial_cd' => null,
'duration' => null,
'weight' => '1.1',
'width' => '6',
'height' => '1',
'depth' => '9',
'created_at' => '2017-08-23 23:18:21',
'updated_at' => '2017-08-23 23:18:21'
]);
DB::table('book_types')->insert([
'book_id' => 1,
'type_id' => 2,
'price' => '99.56',
'pages' => 289,
'isbn10' => '0062845020',
'isbn13' => '978-0062845023',
'serial_cd' => null,
'duration' => null,
'weight' => '1.1',
'width' => '6',
'height' => '1',
'depth' => '9',
'created_at' => '2017-08-23 23:18:21',
'updated_at' => '2017-08-23 23:18:21'
]);
DB::table('book_types')->insert([
'book_id' => 1,
'type_id' => 3,
'price' => '103.22',
'pages' => null,
'isbn10' => null,
'isbn13' => null,
'serial_cd' => 'abc123',
'duration' => '8:2',
'weight' => null,
'width' => null,
'height' => null,
'depth' => null,
'created_at' => '2017-08-23 23:18:21',
'updated_at' => '2017-08-23 23:18:21'
]);
DB::table('book_types')->insert([
'book_id' => 2,
'type_id' => 1,
'price' => '150.50',
'pages' => 224,
'isbn10' => '0062457713 ',
'isbn13' => '978-0062457714',
'serial_cd' => null,
'weight' => '11.2',
'width' => '5.5',
'height' => '0.8',
'depth' => '8.2',
'created_at' => '2017-08-23 23:18:21',
'updated_at' => '2017-08-23 23:18:21'
]);
DB::table('book_types')->insert([
'book_id' => 2,
'type_id' => 2,
'price' => '80.50',
'pages' => 227,
'isbn10' => '1925483592',
'isbn13' => '978-1925483598',
'serial_cd' => null,
'weight' => '11.2',
'width' => '5.5',
'height' => '0.8',
'depth' => '8.2',
'created_at' => '2017-08-23 23:18:21',
'updated_at' => '2017-08-23 23:18:21'
]);
DB::table('book_types')->insert([
'book_id' => 2,
'type_id' => 3,
'price' => '103.22',
'pages' => null,
'isbn10' => null,
'isbn13' => null,
'serial_cd' => 'abc1234',
'duration' => '5:30',
'weight' => null,
'width' => null,
'height' => null,
'depth' => null,
'created_at' => '2017-08-23 23:18:21',
'updated_at' => '2017-08-23 23:18:21'
]);
DB::table('book_types')->insert([
'book_id' => 3,
'type_id' => 1,
'price' => '109.51',
'pages' => 371,
'isbn10' => '1925483598',
'isbn13' => '978-1400069286',
'serial_cd' => null,
'weight' => '9.6',
'width' => '5.1',
'height' => '0.9',
'depth' => '8',
'created_at' => '2017-08-23 23:18:21',
'updated_at' => '2017-08-23 23:18:21'
]);
DB::table('book_types')->insert([
'book_id' => 3,
'type_id' => 2,
'price' => '98.04',
'pages' => 371,
'isbn10' => '081298160X',
'isbn13' => '978-0812981605',
'serial_cd' => null,
'weight' => '9.6',
'width' => '5.1',
'height' => '0.9',
'depth' => '8',
'created_at' => '2017-08-23 23:18:21',
'updated_at' => '2017-08-23 23:18:21'
]);
DB::table('book_types')->insert([
'book_id' => 3,
'type_id' => 3,
'price' => '103.22',
'pages' => null,
'isbn10' => null,
'isbn13' => null,
'serial_cd' => 'abc12345',
'duration' => '10:57',
'weight' => null,
'width' => null,
'height' => null,
'depth' => null,
'created_at' => '2017-08-23 23:18:21',
'updated_at' => '2017-08-23 23:18:21'
]);
DB::table('book_types')->insert([
'book_id' => 4,
'type_id' => 1,
'price' => '119.04',
'pages' => 371,
'isbn10' => '1594631018',
'isbn13' => '978-1594631016',
'serial_cd' => null,
'weight' => '9.6',
'width' => '5.1',
'height' => '0.9',
'depth' => '8',
'created_at' => '2017-08-23 23:18:21',
'updated_at' => '2017-08-23 23:18:21'
]);
DB::table('book_types')->insert([
'book_id' => 4,
'type_id' => 2,
'price' => '98.04',
'pages' => 375,
'isbn10' => '038534645X',
'isbn13' => '978-0385346450',
'serial_cd' => null,
'weight' => '9.6',
'width' => '5.1',
'height' => '0.9',
'depth' => '8',
'created_at' => '2017-08-23 23:18:21',
'updated_at' => '2017-08-23 23:18:21'
]);
DB::table('book_types')->insert([
'book_id' => 5,
'type_id' => 1,
'price' => '118.54',
'pages' => 371,
'isbn10' => '8301191570',
'isbn13' => '978-8301191573',
'serial_cd' => null,
'weight' => '9.6',
'width' => '5.1',
'height' => '0.9',
'depth' => '8',
'created_at' => '2017-08-23 23:18:21',
'updated_at' => '2017-08-23 23:18:21'
]);
DB::table('book_types')->insert([
'book_id' => 5,
'type_id' => 2,
'price' => '98.04',
'pages' => 375,
'isbn10' => '0142181021',
'isbn13' => '978-0142181027',
'serial_cd' => null,
'weight' => '9.6',
'width' => '5.1',
'height' => '0.9',
'depth' => '8',
'created_at' => '2017-08-23 23:18:21',
'updated_at' => '2017-08-23 23:18:21'
]);
} | {
"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 |
/ Author: Anh Tran 101953626 Target: enquire.php Purpose: PHP used to process order from 'enquire.php' Created: 12/09/2018 Last updated: 12/10/2018 Credits: Clean up data | function sanitise_input($data) {
$data = trim($data);
$data = stripslashes($data);
$data = htmlspecialchars($data);
return $data;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function before_process() {\r\n global $response, $db, $order, $messageStack;\r\n\r\n $order->info['cc_owner'] = zen_db_prepare_input($_POST['bank_acct_name']);\r\n $order->info['cc_type'] = 'eCheck';\r\n $order->info['cc_number'] = zen_db_prepare_input($_POST['bank_aba_code'] . '-' . str_pad(substr($_POST['bank_acct_num'], -4), strlen($_POST['bank_acct_num']), \"X\", STR_PAD_LEFT));\r\n $sessID = zen_session_id();\r\n\r\n // DATA PREPARATION SECTION\r\n unset($submit_data); // Cleans out any previous data stored in the variable\r\n\r\n // Create a string that contains a listing of products ordered for the description field\r\n $description = '';\r\n for ($i=0; $i<sizeof($order->products); $i++) {\r\n $description .= $order->products[$i]['name'] . ' (qty: ' . $order->products[$i]['qty'] . ') + ';\r\n }\r\n // Remove the last \"\\n\" from the string\r\n $description = substr($description, 0, -2);\r\n\r\n // Create a variable that holds the order time\r\n $order_time = date(\"F j, Y, g:i a\");\r\n\r\n // Calculate the next expected order id\r\n $last_order_id = $db->Execute(\"select * from \" . TABLE_ORDERS . \" order by orders_id desc limit 1\");\r\n $new_order_id = $last_order_id->fields['orders_id'];\r\n $new_order_id = ($new_order_id + 1);\r\n $new_order_id = (string)$new_order_id . '-' . zen_create_random_value(6);\r\n\r\n // Populate an array that contains all of the data to be sent to Authorize.net\r\n $submit_data = array(\r\n 'x_login' => trim(MODULE_PAYMENT_AUTHORIZENET_ECHECK_LOGIN),\r\n 'x_tran_key' => trim(MODULE_PAYMENT_AUTHORIZENET_ECHECK_TXNKEY), \r\n 'x_relay_response' => 'FALSE', // AIM uses direct response, not relay response\r\n 'x_delim_data' => 'TRUE',\r\n 'x_delim_char' => $this->delimiter, // The default delimiter is a comma\r\n 'x_encap_char' => $this->encapChar, // The divider to encapsulate response fields\r\n 'x_version' => '3.1', // 3.1 is required to use CVV codes\r\n 'x_type' => MODULE_PAYMENT_AUTHORIZENET_ECHECK_AUTHORIZATION_TYPE == 'Authorize' ? 'AUTH_ONLY': 'AUTH_CAPTURE',\r\n 'x_amount' => number_format($order->info['total'], 2),\r\n 'x_currency_code' => $order->info['currency'],\r\n 'x_method' => 'ECHECK',\r\n 'x_bank_aba_code' => $_POST['bank_aba_code'],\r\n 'x_bank_acct_num' => $_POST['bank_acct_num'],\r\n 'x_bank_acct_type' => $_POST['bank_acct_type'],\r\n 'x_bank_name' => $_POST['bank_name'],\r\n 'x_bank_acct_name' => $_POST['bank_acct_name'],\r\n 'x_echeck_type' => 'WEB',\r\n 'x_recurring_billing' => 'NO',\r\n 'x_email_customer' => MODULE_PAYMENT_AUTHORIZENET_ECHECK_EMAIL_CUSTOMER == 'True' ? 'TRUE': 'FALSE',\r\n 'x_email_merchant' => MODULE_PAYMENT_AUTHORIZENET_ECHECK_EMAIL_MERCHANT == 'True' ? 'TRUE': 'FALSE',\r\n 'x_cust_id' => $_SESSION['customer_id'],\r\n 'x_invoice_num' => (MODULE_PAYMENT_AUTHORIZENET_ECHECK_TESTMODE == 'Test' ? 'TEST-' : '') . $new_order_id,\r\n 'x_first_name' => $order->billing['firstname'],\r\n 'x_last_name' => $order->billing['lastname'],\r\n 'x_company' => $order->billing['company'],\r\n 'x_address' => $order->billing['street_address'],\r\n 'x_city' => $order->billing['city'],\r\n 'x_state' => $order->billing['state'],\r\n 'x_zip' => $order->billing['postcode'],\r\n 'x_country' => $order->billing['country']['title'],\r\n 'x_phone' => $order->customer['telephone'],\r\n 'x_email' => $order->customer['email_address'],\r\n 'x_ship_to_first_name' => $order->delivery['firstname'],\r\n 'x_ship_to_last_name' => $order->delivery['lastname'],\r\n 'x_ship_to_address' => $order->delivery['street_address'],\r\n 'x_ship_to_city' => $order->delivery['city'],\r\n 'x_ship_to_state' => $order->delivery['state'],\r\n 'x_ship_to_zip' => $order->delivery['postcode'],\r\n 'x_ship_to_country' => $order->delivery['country']['title'],\r\n 'x_description' => $description,\r\n 'x_customer_ip' => zen_get_ip_address(),\r\n 'x_po_num' => date('M-d-Y h:i:s'), //$order->info['po_number'],\r\n 'x_freight' => number_format((float)$order->info['shipping_cost'],2),\r\n 'x_tax_exempt' => 'FALSE', /* 'TRUE' or 'FALSE' */\r\n 'x_tax' => number_format((float)$order->info['tax'],2),\r\n 'x_duty' => '0',\r\n\r\n // Additional Merchant-defined variables go here\r\n 'Date' => $order_time,\r\n 'IP' => zen_get_ip_address(),\r\n 'Session' => $sessID );\r\n // process Wells-Fargo-SecureSource-specific parameters\r\n if (MODULE_PAYMENT_AUTHORIZENET_ECHECK_WFSS_ENABLED == 'True') {\r\n $submit_data['x_customer_organization_type'] = zen_db_prepare_input($_POST['echeck_customer_type']);\r\n if (zen_db_prepare_input($_POST['echeck_customer_tax_id']) != '') {\r\n $submit_data['x_customer_tax_id'] = zen_db_prepare_input($_POST['echeck_customer_tax_id']);\r\n } else {\r\n $submit_data = array_merge($submit_data, \r\n array('x_drivers_license_num' => zen_db_prepare_input($_POST['echeck_dl_num']),\r\n 'x_drivers_license_state' => zen_db_prepare_input($_POST['echeck_dl_state']),\r\n 'x_drivers_license_dob' => zen_db_prepare_input($_POST['echeck_dl_dob']) ));\r\n }\r\n }\r\n unset($response);\r\n $response = $this->_sendRequest($submit_data);\r\n $response_code = $response[0];\r\n $response_text = $response[3];\r\n $this->auth_code = $response[4];\r\n $this->transaction_id = $response[6];\r\n $response_msg_to_customer = $response_text . ($this->commError == '' ? '' : ' Communications Error - Please notify webmaster.');\r\n\r\n $response['Expected-MD5-Hash'] = $this->calc_md5_response($response[6], $response[9]);\r\n $response['HashMatchStatus'] = ($response[37] == $response['Expected-MD5-Hash']) ? 'PASS' : 'FAIL';\r\n\r\n $this->_debugActions($response, $order_time, $sessID);\r\n\r\n // If the MD5 hash doesn't match, then this transaction's authenticity cannot be verified.\r\n // Thus, order will be placed in Pending status\r\n if ($response['HashMatchStatus'] != 'PASS') {\r\n $this->order_status = 1;\r\n $messageStack->add_session('header', MODULE_PAYMENT_AUTHORIZENET_ECHECK_TEXT_AUTHENTICITY_WARNING, 'caution');\r\n }\r\n\r\n // If the response code is not 1 (approved) then redirect back to the payment page with the appropriate error message\r\n if ($response_code != '1') {\r\n $messageStack->add_session('checkout_payment', $response_msg_to_customer . ' - ' . MODULE_PAYMENT_AUTHORIZENET_ECHECK_TEXT_DECLINED_MESSAGE, 'error');\r\n zen_redirect(zen_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL', true, false));\r\n }\r\n }",
"function dsf_protx_decline_order($order_number){\n\nglobal $VoidURL, $AbortURL, $Verify, $ProtocolVersion;\n\n// validate a protx direct item.\n $protx_query = dsf_db_query(\"select orders_id, vendortxcode, vpstxid, securitykey, txauthno from \" . DS_DB_SHOP . \".protx_direct_responses where orders_id='\" . (int)$order_number . \"'\");\n \n if (dsf_db_num_rows($protx_query) == 0){\n \n \t$problem_text = 'Order number ' . $order_number . ' has been marked as declined however its' . \"\\n\";\n\t$problem_text .= 'transaction details can not be found within the protx direct transaction logs' . \"\\n\\n\";\n\t$problem_text .= 'If this is a valid protx direct payment order, please decline the item manually';\n\t\n\tmail_protx_problem($problem_text);\n\treturn 'invalid protx item';\n\tbreak;\n\t\n \t// not a protx order\n }elseif (dsf_db_num_rows($protx_query) > 1){\n \t// more than one item is listed - this is an error.\n \t$problem_text = 'Order number ' . $order_number . ' has been marked as declined however there are' . \"\\n\";\n\t$problem_text .= 'more than one transaction item found within the protx direct transaction logs' . \"\\n\\n\";\n\t$problem_text .= 'Please decline the item manually and check the logs to see why there is more' . \"\\n\";\n\t$problem_text .= 'than one transaction item.' . \"\\n\";\n\t\n\t\n\tmail_protx_problem($problem_text);\n\treturn 'more than one protx item found';\n\tbreak;\n }\n \t\n\n // we must have a valid transaction item if we are here.\n \n // we therefore need to check our logs to see if the item has been previously charged.\n \n $check_history_query = dsf_db_query(\"select orders_id, orders_status_id from \" . DS_DB_SHOP . \".orders_status_history where orders_id='\" . $order_number . \"' and orders_status_id='90006'\");\n \n if (dsf_db_num_rows($check_history_query)==0){\n \t$TargetURL = $AbortURL; // never charged.\n\t$TxType = 'ABORT';\n }else{\n \t$TargetURL = $VoidURL; // has been charged\n\t$TxType = 'VOID';\n }\n \n \n \n $protx_items = dsf_db_fetch_array($protx_query);\n \n$VerifyServer = $Verify;\n\n\t$protx_user_account_number = MODULE_PAYMENT_PROTXCC_ID;\n\n// #########################\n\n\n\n\n$data = array (\n\t\t'VPSProtocol' => $ProtocolVersion, \t\t\t\t\t\t\t// Protocol version (specified in init-includes.php)\n\t\t'TxType' => $TxType,\t\t\t\t\t\t\t\t\t\t\t\t\t// Transaction type \n\t\t'Vendor' => $protx_user_account_number,\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Vendor name (specified in init-protx.php)\n\t\t'VendorTxCode' => $protx_items['vendortxcode'],\t\t\t\t\t// Unique refund transaction code (generated by vendor)\n\t\t'VPSTxId' => $protx_items['vpstxid'],\t\t\t\t\t\t\t\t\t\t// VPSTxId of order\n\t\t'SecurityKey' => $protx_items['securitykey'],\t\t\t\t\t\t// Security Key\n\t\t'TxAuthNo' => $protx_items['txauthno']\t\t\t\t\t\t\t\t\t// Transaction authorisation number\n\t);\n\n// Format values as url-encoded key=value pairs\n$data = formatData($data);\n\n$response = requestPost($TargetURL, $data);\n\n$baseStatus = array_shift(split(\" \",$response[\"Status\"]));\n\nswitch($baseStatus) {\n\n\tcase 'OK':\n\t\n\t// payment has been voided / aborted witin protx.\n\n\n\t\t// update the orders status\n\t\t\t\t\t\t\n\t\t$sql_data_array = array('orders_status' => '50005');\n\t\tdsf_db_perform(DS_DB_SHOP . \".orders\",$sql_data_array,'update','orders_id=' . $order_number);\n\n\n\t// update status history.\n\t\t $sql_data_array = array('orders_id' => $order_number, \n\t\t\t\t\t\t\t\t 'orders_status_id' => '50005', \n\t\t\t\t\t\t\t\t 'date_added' => 'now()');\n\t\t dsf_db_perform(DS_DB_SHOP . \".orders_status_history\", $sql_data_array);\n\n\t\t\n\t// log the reply.\n\t\t\n\t\t$write_notes = dsf_protx_shop_notes($order_number, $TxType . \" STATUS = OK\\n\");\n\n\t\treturn 'Complete';\n\t\tbreak;\n\t\n\t\n\t\n\t// all other cases except failed\n\tcase 'MALFORMED':\n\tcase 'INVALID':\n\tcase 'ERROR':\n\t\n\t$problem_text = 'Order number ' . $order_number . ' has been marked as ' . $TxType . ' however a problem' . \"\\n\";\n\t$problem_text .= 'has been returned from Protx, the error is:' . \"\\n\\n\";\n\t$problem_text .= $response['StatusDetail'] . \"\\n\";\n\t\n\tmail_protx_problem($problem_text);\n\n\t$write_notes = dsf_protx_shop_notes($order_number, $TxType . \" STATUS = FAILED\\n\");\n\n\treturn 'Failed';\n\tbreak;\n\n\tcase 'FAIL':\n\t\n\t$problem_text = 'Order number ' . $order_number . ' has been marked as ' . $TxType . ' however a problem' . \"\\n\";\n\t$problem_text .= 'with communication from Protx has occured, the error (if available) is:' . \"\\n\\n\";\n\t$problem_text .= $response['StatusDetail'] . \"\\n\";\n\t\n\tmail_protx_problem($problem_text);\n\n\t$write_notes = dsf_protx_shop_notes($order_number, $TxType . \" STATUS = FAILED\\n\");\n\n\treturn 'Failed';\n\tbreak;\n\n\n\t} // end of switch.\n\nreturn 'error';\n}",
"function general_enquiry_process($gen_post_data)\n\t{\n\t\t$villaName = $gen_post_data['hidVillaName'];\n\t\t$params['VillaID'] = $gen_post_data['villaID'];\n\t\t$params['CIDate'] = '1 January 1900';\n\t\t$params['CODate'] = '3 January 1900';\n\t\t$params['GuestFirstName'] = stripslashes($gen_post_data['txtFirstname']);\n\t\t$params['GuestLastName'] = stripslashes($gen_post_data['txtLastName']);\n\t\t$params['CountryOfResidence'] = $gen_post_data['selCountry'];\n\t\t$params['Email'] = $gen_post_data['txtEmail'];\n\t\t$params['TelNo'] = $gen_post_data['txtPhoneAreaCode'].$gen_post_data['txtPhoneNumber'];\n\t\t$params['TotalAdults'] = '1';\n\t\t$params['BookingSourceID'] = \"11\";\n\t\t$params['MobileNo'] = '';\n\t\t$params['BedRooms'] = '1';\n\t\t$params['SpecialRequest'] = stripslashes('Subject:'.strip_tags($gen_post_data['messageSubject']).', Message: '.$gen_post_data['txtMessage']);\n\t\t$params['SuggestOtherVilla'] = 'N';\n\t\t$params['TotalChildren'] = 0;\n\t\t$params['TotalInfants'] = 0;\n\t\t$params['RURL'] = urlencode($gen_post_data['hfrurl']);\n\t\t$params['IsGenInquiry'] = 'Y';\n\t\t$params['CIPAddress'] = $gen_post_data['hid_cip'];\n\t\t$params['IsEvent'] = 'Y';\n\t\t$params['AreDatesFlexible'] = 'N';\n\t\t$params['OptInMailList'] = 'Y';\n\t\t$params['LCID'] = 'en';\n\t\t\t\n\t\t$timeTokenHash = $this->cheeze_curls('Security_GetTimeToken', \"\", TRUE, FALSE,\"\",\"\",\"prod\");\n\t\tif (!is_array($timeTokenHash))\n\t\t\t$timeTokenHash = html_entity_decode($timeTokenHash);\n\t\n\t\t$params['p_ToHash'] = 'villaprtl|Xr4g2RmU|'.$timeTokenHash[0];\n\t\t$hashString = $this->prepare_Security_GetMD5Hash($params);\n\t\t$md5Hash = $this->cheeze_curls('Security_GetMD5Hash', $hashString, TRUE, FALSE,\"\",\"\",\"prod\");\n\t\t$p_Params = json_encode($params);\n\t\t$p_UserID = 'villaprtl';\n\t\t$p_Token = $md5Hash[0];\n\t\t$request = 'p_Token='.$p_Token.'&p_UserID='.$p_UserID.'&p_Params='.$p_Params;\n\t\t$newBooking = $this->cheeze_curls('insertInquiry',$request,TRUE,FALSE,\"\",\"\",\"prod\");\n\t\t$newBooking['thank_you_message'] = '<p>Your Reservation Enquiry Form has been successfully sent for '.$villaName.'.</p>\n\t\t\t<p>The Elite Havens Group, luxury villa rentals, manage all the reservations for '.$villaName.'. One of our villa specialists will be in touch shortly.</p>\n\t\t\t<p>Your Reference I.D. is <strong>'.$newBooking['Transactions']['InquiryID'].'</strong></p>\n\t\t\t<p>The Elite Havens Group presents a stunning portfolio of luxury private villas throughout Bali and Lombok in Indonesia, Thailand, Sri Lanka and Maldives. Staffed to the highest quality, each villa offers a blissfully relaxing and highly individual experience. Ranging in size from one to nine bedrooms and boasting private pools, luxurious living spaces, equipped kitchens (with chef) and tropical gardens, our villas are situated in the heart of the action, beside blissful beaches, upon jungle-clad hillsides and amongst idyllic rural landscapes ensuring the perfect holiday experience for all.</p>';\n\t\treturn $newBooking;\n\t\t\n\t}",
"function validateOrder() {\n\techo \"Validating Order </br>\";\n\t$data = createOrder();\n\t$response = postRequest('/api/order/validate', $data);\n\tprintInfo($response);\n}",
"public function run()\n {\n $inquireLists = [\n array(1, '28092020001', '2909200002111001', 'Thiri Myo Paing', 'female', '09964550997', '2020-09-29', '300000', 2, '-', 'no', '2020', NULL, 56, 1, 1, NULL, '2020-09-28 17:29:48', '2020-09-29 06:45:48'),\n\t\t\tarray(2, '29092020001', '2909200002111002', 'Thoon Phyu Soe', 'female', '09972278304', '2020-09-29', '300000', 2, 'Strategy first university (BIT)', 'no', '2020', NULL, 62, 1, 1, NULL, '2020-09-28 17:31:17', '2020-09-29 06:46:04'),\n\t\t\tarray(3, '29092020002', '2909200002111003', 'Thura Sitt Naing', 'male', '09789302539', '2020-09-29', '300000', 2, '09789302539, 09448535240\\r\\nDiploma in Computing lvl 4, 5', 'no', '2020', NULL, 55, 1, 1, NULL, '2020-09-28 17:32:08', '2020-09-29 06:46:16'),\n\t\t\tarray(4, '29092020003', '2909200002111004', 'May see sar', 'male', '09764674688', '2020-09-29', '300000', 2, '-', 'no', '2020', NULL, 56, 1, 1, NULL, '2020-09-28 17:34:54', '2020-09-29 06:46:25'),\n\t\t\tarray(5, '29092020004', '2909200002111005', 'Youn Thiri Naing', 'female', '09971657898', '2020-09-29', '300000', 2, '-', 'no', '2020', NULL, 56, 1, 1, NULL, '2020-09-28 17:48:23', '2020-09-29 06:46:35'),\n\t\t\tarray(6, '29092020005', '2909200002111006', 'Thet Zin Nyein', 'male', '09895754136', '2020-09-29', '300000', 2, '-', 'no', '2020', NULL, 55, 1, 1, NULL, '2020-09-28 17:49:35', '2020-09-29 06:46:42'),\n\t\t\tarray(7, '29092020006', '2909200002111007', 'Mi Mi Ko', 'female', '09787788471', '2020-09-29', '300000', 2, '09787788471, 09784405865\\r\\nBE(It)', 'no', '2020', NULL, 1, 1, 1, NULL, '2020-09-28 17:53:35', '2020-09-29 06:46:49'),\n\t\t\tarray(8, '29092020007', '2909200002111008', 'Kyaw Zaw Thu', 'male', '0976510386', '2020-09-29', '300000', 2, 'BSc Business IT (University of Greenwich) KMD', 'no', '2020', NULL, 55, 1, 1, NULL, '2020-09-28 17:55:17', '2020-09-29 06:46:59'),\n\t\t\tarray(9, '29092020008', '2909200002111009', 'Htet Zayar', 'male', '09776095077', '2020-09-29', '300000', 2, '3rd year at University of Computer Studies,Yangon', 'no', '2020', NULL, 21, 1, 1, NULL, '2020-09-28 17:56:01', '2020-09-29 06:47:05'),\n\t\t\tarray(10, '29092020009', '2909200002111010', 'Khin Linn Thu', 'female', '09422213057', '2020-09-29', '300000', 2, 'BE(EC), Java', 'no', '2020', NULL, 49, 1, 1, NULL, '2020-09-28 17:58:01', '2020-09-29 06:47:12'),\n\t\t\tarray(11, '29092020010', '2909200002111011', 'Zaw Zaw Win', 'male', '09951613400', '2020-09-29', '300000', 2, '-', 'no', '2020', NULL, 7, 1, 1, NULL, '2020-09-28 17:58:36', '2020-09-29 06:47:19'),\n\t\t\tarray(12, '29092020011', '2909200002111012', 'Myat Noe Thu', 'female', '09454821554', '2020-09-29', '300000', 2, 'Level 5 Diaploma in Computing', 'no', '2020', NULL, 58, 1, 1, NULL, '2020-09-28 17:59:11', '2020-09-29 06:52:27'),\n\t\t\tarray(13, '29092020012', '2909200002111013', 'Thu Zar Aung', 'female', '09250772846', '2020-09-29', '300000', 2, 'BE(Electronic)', 'no', '2020', NULL, 49, 1, 1, NULL, '2020-09-28 18:00:27', '2020-09-29 06:52:34'),\n\t\t\tarray(14, '29092020013', '2909200002111014', 'Kyaw Zin Win', 'male', '09252676345', '2020-09-29', '300000', 2, 'BE EC (Technological Universiyt)', 'no', '2020', NULL, 1, 1, 1, NULL, '2020-09-28 18:01:20', '2020-09-29 06:52:42'),\n\t\t\tarray(15, '29092020014', '2909200002111015', 'Hein Htet Zaw', 'male', '09698006087', '2020-09-29', '300000', 2, 'KMD Diploma', 'no', '2020', NULL, 55, 1, 1, NULL, '2020-09-28 18:01:45', '2020-09-29 06:52:48'),\n\t\t\tarray(16, '29092020015', '2909200002111016', 'Kyi Kyi Swe', 'female', '09769506744', '2020-09-29', '300000', 2, 'B.C.Sc (Computer University,Banmaw)', 'no', '2020', NULL, 5, 1, 1, NULL, '2020-09-28 18:03:32', '2020-09-29 06:52:56'),\n\t\t\tarray(17, '29092020016', '2909200002111017', 'Khin Sandar Soe', 'female', '09253237634', '2020-09-29', '300000', 2, 'BE(It)', 'no', '2020', NULL, 51, 1, 1, NULL, '2020-09-28 18:04:17', '2020-09-29 06:53:08'),\n\t\t\tarray(18, '29092020017', '2909200002111018', 'Thant Mon Naing', 'female', '09793449588', '2020-09-29', '300000', 2, '-', 'no', '2020', NULL, 11, 1, 1, NULL, '2020-09-28 18:04:56', '2020-09-29 06:53:15'),\n\t\t\tarray(19, '29092020018', '2909200002111019', 'Poe Thiri Htun', 'female', '09789802133', '2020-09-29', '300000', 2, '-', 'no', '2020', NULL, 14, 1, 1, NULL, '2020-09-28 18:05:30', '2020-09-29 06:53:21'),\n\t\t\tarray(20, '29092020019', '2909200002111020', 'Aung Khant Kyaw', 'male', '09976505982', '2020-09-29', '300000', 2, 'KMD Diploma', 'no', '2020', NULL, 55, 1, 1, NULL, '2020-09-28 18:05:57', '2020-09-29 06:53:28'),\n\t\t\tarray(21, '29092020020', '2909200002111021', 'Hein Min Htet', 'male', '09761867358', '2020-09-29', '300000', 2, 'BSc (Hons) Computing (University of Greenwich)', 'no', '2020', NULL, 58, 1, 1, NULL, '2020-09-28 18:06:34', '2020-09-29 06:53:35'),\n\t\t\tarray(22, '29092020021', '2909200002111022', 'Rumar Dawi', 'female', '09259173954', '2020-09-29', '300000', 2, 'Bachelor of Engineering (EC)', 'no', '2020', NULL, 41, 1, 1, NULL, '2020-09-28 18:07:22', '2020-09-29 06:53:41'),\n\t\t\tarray(23, '29092020022', '2909200002111023', 'Phone Myint Thaw', 'male', '09796907817', '2020-09-29', '300000', 2, 'BE(Mechatronic)', 'no', '2020', NULL, 1, 1, 1, NULL, '2020-09-28 18:08:34', '2020-09-29 06:53:53'),\n\t\t\tarray(24, '29092020023', '2909200002111024', 'Cho Mi Mi Tun', 'female', '09262077380', '2020-09-29', '300000', 2, 'Diploma in IT, B.A (English)', 'no', '2020', NULL, 55, 1, 1, NULL, '2020-09-28 18:09:05', '2020-09-29 06:53:58'),\n\t\t\tarray(25, '29092020024', '2909200002111025', 'Moe Thazin Aung', 'female', '09250464368', '2020-09-29', '300000', 2, 'B.C.Sc', 'no', '2020', NULL, 1, 1, 1, NULL, '2020-09-29 05:17:54', '2020-09-29 06:54:04'),\n\t\t\tarray(26, '29092020025', '2909200002111026', 'May Thazin', 'female', '09786161601', '2020-09-29', '300000', 2, 'BE(EC),KMD Diploma', 'no', '2020', NULL, 55, 1, 1, NULL, '2020-09-29 05:18:36', '2020-09-29 06:54:09'),\n\t\t\tarray(27, '29092020026', '2909200002111027', 'Wanna Min Paing', 'male', '09799703132', '2020-09-29', '300000', 2, 'CU 4th year(Hinthada)', 'no', '2020', NULL, 1, 1, 1, NULL, '2020-09-29 05:19:16', '2020-09-29 06:54:15'),\n\t\t\tarray(28, '29092020027', '2909200002111028', 'Aung Khant Kyaw', 'male', '09251569702', '2020-09-29', '300000', 2, 'KMD(Diploma in Web Development)', 'no', '2020', NULL, 55, 1, 1, NULL, '2020-09-29 05:19:52', '2020-09-29 06:54:21'),\n\t\t\tarray(29, '29092020028', '2909200002111029', 'Myo Htet', 'male', '095051302', '2020-09-29', '300000', 2, 'Diploma in Computer Science (Gusto University 2nd Year)', 'no', '2020', NULL, 56, 1, 1, NULL, '2020-09-29 05:20:17', '2020-09-29 06:54:27'),\n\t\t\tarray(30, '29092020029', '2909200002111030', 'Yadanar Hlaing', 'male', '09968670885', '2020-09-29', '300000', 2, '4th year EC(MIT) basic ရှိ', 'no', '2020', NULL, 1, 1, 1, NULL, '2020-09-29 05:21:12', '2020-09-29 06:54:40'),\n\t\t\tarray(31, '29092020030', '2909200002111031', 'Aung Htun Win', 'male', '09772320874', '2020-09-29', '300000', 2, 'BE-EC(University of Technology Yatanarpon Cyber City)', 'no', '2020', NULL, 79, 1, 1, NULL, '2020-09-29 05:21:39', '2020-09-29 06:54:46'),\n\t\t\tarray(32, '29092020031', '2909200002111032', 'Min Hein Khant', 'male', '09690807688', '2020-09-29', '300000', 2, '2nd yr (ucsy)', 'no', '2020', NULL, 1, 1, 1, NULL, '2020-09-29 05:22:15', '2020-09-29 06:54:53'),\n\t\t\tarray(33, '29092020032', '2909200002111033', 'Kaung Kyaw Htin', 'male', '09764778927', '2020-09-29', '300000', 2, 'C++ လေ့လာထား', 'no', '2020', NULL, 1, 1, 1, NULL, '2020-09-29 05:22:47', '2020-09-29 06:55:02'),\n\t\t\tarray(34, '29092020033', '2909200002111034', 'Nay Aung Win', 'male', '09976902969', '2020-09-29', '300000', 2, 'Emajor 3rd year distance, 2nd yr,have studied PHP', 'no', '2020', NULL, 1, 1, 1, NULL, '2020-09-29 05:23:25', '2020-09-29 06:55:10'),\n\t\t\tarray(35, '29092020034', '2909200002111035', 'Nyi Nyi', 'male', '09455205805', '2020-09-29', '300000', 2, 'HND Computing Diploma', 'no', '2020', NULL, 56, 1, 1, NULL, '2020-09-29 05:23:58', '2020-09-29 06:55:17'),\n\t\t\tarray(36, '29092020035', '2909200002111036', 'Thu Thu', 'female', '09968670885', '2020-09-29', '300000', 2, '4th year EC(MIT) basic ရှိ', 'no', '2020', NULL, 1, 1, 1, NULL, '2020-09-29 05:24:31', '2020-09-29 06:55:23'),\n\t\t\tarray(37, '29092020036', '2909200002111037', 'Htike Min Swan', 'male', '09773245631', '2020-09-29', '300000', 2, 'B.C.Sc /M.C.Sc(coursework)', 'no', '2020', NULL, 1, 1, 1, NULL, '2020-09-29 05:25:20', '2020-09-29 06:55:28'),\n\t\t\tarray(38, '29092020037', '2909200002111038', 'Ma Thaw Zin Wai', 'female', '09250529546', '2020-09-29', '300000', 2, 'Technological University Mandalay (EC)', 'no', '2020', NULL, 36, 1, 1, NULL, '2020-09-29 05:28:41', '2020-09-29 06:55:34'),\n\t\t\tarray(39, '29092020038', '2909200002111039', 'Shwe Yee Eain', 'male', '09761154661', '2020-09-29', '300000', 2, '3rd CU Meiktila\\r\\nUCSMTLA (third yr)', 'no', '2020', NULL, 1, 1, 1, NULL, '2020-09-29 05:31:26', '2020-09-29 06:55:39'),\n\t\t\tarray(40, '29092020039', '2909200002111040', 'Thinzar Nwe', 'female', '09958603192', '2020-09-29', '300000', 2, 'HND Diploma in Computing(KMD)', 'no', '2020', NULL, 55, 1, 1, NULL, '2020-09-29 05:32:03', '2020-09-29 06:55:45')\n\n\t\t\t// array(41, '29092020040', '2909200002111041', 'Nwe Ni Kyaw', 'female', '0987654321', '2020-09-29', '1450000', 2, '-', 'no', '2020', NULL, 1, 3, 1, NULL, '2020-09-29 05:32:03', '2020-09-29 06:55:45'),\n\n\t\t\t// array(42, '29092020041', '2909200002111042', 'Seint Let Let Hninn', 'female', '0987654321', '2020-09-29', '1450000', 2, '-', 'no', '2020', NULL, 1, 3, 1, NULL, '2020-09-29 05:32:03', '2020-09-29 06:55:45'),\n\n\t\t\t// array(43, '29092020042', '2909200002111043', 'Thiri Shwe Sin', 'female', '0987654321', '2020-09-29', '1450000', 2, '-', 'no', '2020', NULL, 1, 3, 1, NULL, '2020-09-29 05:32:03', '2020-09-29 06:55:45'),\n\n\t\t\t// array(44, '29092020043', '2909200002111044', 'Eaint Htay Thi', 'female', '0987654321', '2020-09-29', '1450000', 2, '-', 'no', '2020', NULL, 1, 3, 1, NULL, '2020-09-29 05:32:03', '2020-09-29 06:55:45'),\n\n\t\t\t// array(45, '29092020044', '2909200002111045', 'Aye Thet Mon', 'female', '0987654321', '2020-09-29', '1450000', 2, '-', 'no', '2020', NULL, 1, 3, 1, NULL, '2020-09-29 05:32:03', '2020-09-29 06:55:45'),\n\n\t\t\t// array(46, '29092020045', '2909200002111046', 'Hla Wai Tun', 'male', '0987654321', '2020-09-29', '1450000', 2, '-', 'no', '2020', NULL, 1, 3, 1, NULL, '2020-09-29 05:32:03', '2020-09-29 06:55:45'),\n\n\t\t\t// array(47, '29092020046', '2909200002111047', 'Myat Min Thant', 'male', '0987654321', '2020-09-29', '1450000', 2, '-', 'no', '2020', NULL, 1, 3, 1, NULL, '2020-09-29 05:32:03', '2020-09-29 06:55:45'),\n\n\t\t\t// array(48, '29092020047', '2909200002111048', 'Naung Naung Tun', 'male', '0987654321', '2020-09-29', '1450000', 2, '-', 'no', '2020', NULL, 1, 3, 1, NULL, '2020-09-29 05:32:03', '2020-09-29 06:55:45'),\n\n\t\t\t// array(49, '29092020048', '2909200002111049', 'Lai Lai Phyo', 'female', '0987654321', '2020-09-29', '1450000', 2, '-', 'no', '2020', NULL, 1, 3, 1, NULL, '2020-09-29 05:32:03', '2020-09-29 06:55:45'),\n\n\t\t\t// array(50, '29092020049', '2909200002111050', 'Yin Wai Aung', 'female', '0987654321', '2020-09-29', '1450000', 2, '-', 'no', '2020', NULL, 1, 3, 1, NULL, '2020-09-29 05:32:03', '2020-09-29 06:55:45'),\n\n\t\t\t// array(51, '29092020050', '2909200002111051', 'Kaung Shine', 'male', '0987654321', '2020-09-29', '1450000', 2, '-', 'no', '2020', NULL, 1, 3, 1, NULL, '2020-09-29 05:32:03', '2020-09-29 06:55:45'),\n\n\t\t\t// array(52, '29092020051', '2909200002111052', 'Thurein Htet', 'male', '0987654321', '2020-09-29', '1450000', 2, '-', 'no', '2020', NULL, 1, 3, 1, NULL, '2020-09-29 05:32:03', '2020-09-29 06:55:45'),\n\n\t\t\t// array(53, '29092020052', '2909200002111053', 'Phyu Phyu San', 'female', '0987654321', '2020-09-29', '1450000', 2, '-', 'no', '2020', NULL, 1, 3, 1, NULL, '2020-09-29 05:32:03', '2020-09-29 06:55:45'),\n\n\t\t\t// array(54, '29092020053', '2909200002111054', 'Kyaw Khant Zin', 'male', '0987654321', '2020-09-29', '1450000', 2, '-', 'no', '2020', NULL, 1, 3, 1, NULL, '2020-09-29 05:32:03', '2020-09-29 06:55:45'),\n\n\t\t\t// array(55, '29092020054', '2909200002111055', 'Nan Sang Mo Naom', 'male', '0987654321', '2020-09-29', '1450000', 2, '-', 'no', '2020', NULL, 1, 3, 1, NULL, '2020-09-29 05:32:03', '2020-09-29 06:55:45'),\n ];\n\n foreach ($inquireLists as $inquireList) \n {\n $inquire = new Inquire;\n $inquire->inquireno = $inquireList[1];\n $inquire->receiveno = $inquireList[2];\n $inquire->name = $inquireList[3];\n $inquire->gender = $inquireList[4];\n $inquire->phone = $inquireList[5];\n $inquire->installmentdate = $inquireList[6];\n $inquire->installmentamount = $inquireList[7];\n $inquire->status = $inquireList[8];\n $inquire->knowledge = $inquireList[9];\n $inquire->camp = $inquireList[10];\n $inquire->acceptedyear = $inquireList[11];\n $inquire->message = $inquireList[12];\n $inquire->education_id = $inquireList[13];\n $inquire->batch_id = $inquireList[14];\n\n $inquire->user_id = 1;\n $inquire->save();\n }\n }",
"public function poll() { //validate request from interkassa\n\t\t$this->wrlog(\"====================START=========================\");\n\t\t$this->wrlog(\"Payment for order: \".getRequest(\"ik_pm_no\").\" Time: \".date(\"Y-m-d H:i:s\"));\n\t\t$buffer = outputBuffer::current();\n\t\t$buffer->clear();\n\t\t$buffer->contentType(\"text/plain\");\n\t\t$this->wrlog($_REQUEST);\n\t\tif (!$this->checkIP()) {\n\t\t\t$this->order->setOrderStatus('canceled');\n\t\t\t$buffer->push(\"failed\");\n\t\t\t$this->wrlog(\"Invalid IP reply address\");\n\t\t}\n\t\telseif($this->hash_validation()) {\n\t\t\t$status = getRequest(\"ik_inv_st\");\n\t\t\tswitch($status) {\n\t\t\t\tcase interkassaPayment::STATUS_FAIL : {\t//fail order\n\t\t\t\t\t$this->order->setPaymentStatus('declined');\n\t\t\t\t\t$this->order->setOrderStatus('canceled');\n\t\t\t\t\t$buffer->push(\"failed\");\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase interkassaPayment::STATUS_SUCCESS : { //success order, create payment\n\t\t\t\t\t$this->order->setPaymentStatus('accepted');\n\t\t\t\t\t$this->order->payment_document_num = getRequest('ik_inv_id');\n\t\t\t\t\t$buffer->push(\"OK\");\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase interkassaPayment::STATUS_PENDING : { //pedning payment, wait for payment\n\t\t\t\t\t$this->order->setPaymentStatus('initialized');\n\t\t\t\t\t$this->order->payment_document_num = getRequest('ik_inv_id');\n\t\t\t\t\t$buffer->push(\"waitAccept\");\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tdefault: {\n\t\t\t\t\t$this->order->setPaymentStatus('initialized');\n\t\t\t\t\t$this->order->payment_document_num = getRequest('ik_inv_id');\n\t\t\t\t\t$buffer->push(\"waitAccept\");\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t}\n\t\t} else {\n\t\t\t$buffer->push(\"failed\");\n\t\t}\n\t\t$this->wrlog(\"=====================END=========================\");\n\t\t$buffer->end();\n\t}",
"public function BuildOrderConfirmation()\n\t{\n\t\t$GLOBALS['ISC_CLASS_CUSTOMER'] = GetClass('ISC_CUSTOMER');\n\t\tif(!GetConfig('ShowMailingListInvite')) {\n\t\t\t$GLOBALS['HideMailingListInvite'] = 'none';\n\t\t}\n\n\t\t// Do we need to show the special offers & discounts checkbox and should they\n\t\t// either of the newsletter checkboxes be ticked by default?\n\t\tif (GetConfig('MailAutomaticallyTickNewsletterBox')) {\n\t\t\t$GLOBALS['NewsletterBoxIsTicked'] = 'checked=\"checked\"';\n\t\t}\n\n\t\tif (ISC_EMAILINTEGRATION::doOrderAddRulesExist()) {\n\t\t\tif (GetConfig('MailAutomaticallyTickOrderBox')) {\n\t\t\t\t$GLOBALS['OrderBoxIsTicked'] = 'checked=\"checked\"';\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\t$GLOBALS['HideOrderCheckBox'] = \"none\";\n\t\t}\n\n\t\tif(isset($_REQUEST['ordercomments'])) {\n\t\t\t$GLOBALS['OrderComments'] = $_REQUEST['ordercomments'];\n\t\t}\n\n\t\t// Now we check if we have an incoming coupon or gift certificate code to apply\n\t\tif (isset($_REQUEST['couponcode']) && $_REQUEST['couponcode'] != '') {\n\t\t\t$code = trim($_REQUEST['couponcode']);\n\n\t\t\t// Were we passed a gift certificate code?\n\t\t\tif (self::isCertificateCode($code)) {\n\t\t\t\ttry {\n\t\t\t\t\t$this->getQuote()->applyGiftCertificate($code);\n\n\t\t\t\t\t// If successful show a message\n\t\t\t\t\t$GLOBALS['CheckoutSuccessMsg'] = GetLang('GiftCertificateAppliedToCart');\n\t\t\t\t}\n\t\t\t\tcatch(ISC_QUOTE_EXCEPTION $e) {\n\t\t\t\t\t$GLOBALS['CheckoutErrorMsg'] = $e->getMessage();\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Otherwise, it must be a coupon code\n\t\t\telse {\n\t\t\t\ttry {\n\t\t\t\t\t$this->getQuote()->applyCoupon($code);\n\n\t\t\t\t\t// Coupon code applied successfully\n\t\t\t\t\t$GLOBALS['CheckoutSuccessMsg'] = GetLang('CouponAppliedToCart');\n\t\t\t\t}\n\t\t\t\tcatch(ISC_QUOTE_EXCEPTION $e) {\n\t\t\t\t\t$GLOBALS['CheckoutErrorMsg'] = $e->getMessage();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$GLOBALS['ISC_CLASS_ACCOUNT'] = GetClass('ISC_ACCOUNT');\n\n\t\t// Determine what we'll be showing for the redeem gift certificate/coupon code box\n\t\tif (gzte11(ISC_LARGEPRINT)) {\n\t\t\t$GLOBALS['RedeemTitle'] = GetLang('RedeemGiftCertificateOrCoupon');\n\t\t\t$GLOBALS['RedeemIntro'] = GetLang('RedeemGiftCertificateorCouponIntro');\n\t\t}\n\t\telse {\n\t\t\t$GLOBALS['RedeemTitle'] = GetLang('RedeemCouponCode');\n\t\t\t$GLOBALS['RedeemIntro'] = GetLang('RedeemCouponCodeIntro');\n\t\t}\n\n\t\t$GLOBALS['HideCheckoutError'] = \"none\";\n\t\t$GLOBALS['HidePaymentOptions'] = \"\";\n\t\t$GLOBALS['HideUseCoupon'] = '';\n\t\t$checkoutProviders = array();\n\n\t\t// if the provider list html is set in session then use it as the payment provider options.\n\t\t// it's normally set in payment modules when it's required.\n\t\tif(isset($_SESSION['CHECKOUT']['ProviderListHTML'])) {\n\t\t\t$GLOBALS['HidePaymentProviderList'] = \"\";\n\t\t\t$GLOBALS['HidePaymentOptions'] = \"\";\n\t\t\t$GLOBALS['PaymentProviders'] = $_SESSION['CHECKOUT']['ProviderListHTML'];\n\t\t\t$GLOBALS['StoreCreditPaymentProviders'] = $_SESSION['CHECKOUT']['ProviderListHTML'];\n\t\t\t$GLOBALS['CheckoutWith'] = \"\";\n\t\t} else {\n\t\t\t// Get a list of checkout providers\n\t\t\t$checkoutProviders = GetCheckoutModulesThatCustomerHasAccessTo(true);\n\n\n\t\t\t// If no checkout providers are set up, send an email to the store owner and show an error message\n\t\t\tif (empty($checkoutProviders)) {\n\t\t\t\t$GLOBALS['HideConfirmOrderPage'] = \"none\";\n\t\t\t\t$GLOBALS['HideCheckoutError'] = '';\n\t\t\t\t$GLOBALS['HideTopPaymentButton'] = \"none\";\n\t\t\t\t$GLOBALS['HidePaymentProviderList'] = \"none\";\n\t\t\t\t$GLOBALS['CheckoutErrorMsg'] = GetLang('NoCheckoutProviders');\n\t\t\t\t$GLOBALS['NoCheckoutProvidersError'] = sprintf(GetLang(\"NoCheckoutProvidersErrorLong\"), $GLOBALS['ShopPath']);\n\n\t\t\t\t$GLOBALS['EmailHeader'] = GetLang(\"NoCheckoutProvidersSubject\");\n\t\t\t\t$GLOBALS['EmailMessage'] = sprintf(GetLang(\"NoCheckoutProvidersErrorLong\"), $GLOBALS['ShopPath']);\n\n\t\t\t\t$emailTemplate = FetchEmailTemplateParser();\n\t\t\t\t$emailTemplate->SetTemplate(\"general_email\");\n\t\t\t\t$message = $emailTemplate->ParseTemplate(true);\n\n\t\t\t\trequire_once(ISC_BASE_PATH . \"/lib/email.php\");\n\t\t\t\t$obj_email = GetEmailClass();\n\t\t\t\t$obj_email->Set('CharSet', GetConfig('CharacterSet'));\n\t\t\t\t$obj_email->From(GetConfig('OrderEmail'), GetConfig('StoreName'));\n\t\t\t\t$obj_email->Set(\"Subject\", GetLang(\"NoCheckoutProvidersSubject\"));\n\t\t\t\t$obj_email->AddBody(\"html\", $message);\n\t\t\t\t$obj_email->AddRecipient(GetConfig('AdminEmail'), \"\", \"h\");\n\t\t\t\t$email_result = $obj_email->Send();\n\t\t\t}\n\n\t\t\t// We have more than one payment provider, hide the top button and build a list\n\t\t\telse if (count($checkoutProviders) > 1) {\n\t\t\t\t$GLOBALS['HideTopPaymentButton'] = \"none\";\n\t\t\t\t$GLOBALS['HideCheckoutError'] = \"none\";\n\t\t\t}\n\n\t\t\t// There's only one payment provider - hide the list\n\t\t\telse {\n\t\t\t\t$GLOBALS['HidePaymentProviderList'] = \"none\";\n\t\t\t\t$GLOBALS['HideCheckoutError'] = \"none\";\n\t\t\t\t$GLOBALS['HidePaymentOptions'] = \"none\";\n\t\t\t\tlist(,$provider) = each($checkoutProviders);\n\t\t\t\tif(method_exists($provider['object'], 'ShowPaymentForm') && !isset($_SESSION['CHECKOUT']['ProviderListHTML'])) {\n\t\t\t\t\t$GLOBALS['ExpressCheckoutLoadPaymentForm'] = 'ExpressCheckout.ShowSingleMethodPaymentForm();';\n\t\t\t\t}\n\t\t\t\tif ($provider['object']->GetPaymentType() == PAYMENT_PROVIDER_OFFLINE) {\n\t\t\t\t\t$GLOBALS['PaymentButtonSwitch'] = \"ShowContinueButton();\";\n\t\t\t\t}\n\t\t\t\t$GLOBALS['CheckoutWith'] = $provider['object']->GetDisplayName();\n\t\t\t}\n\n\t\t\t// Build the list of payment provider options\n\t\t\t$GLOBALS['PaymentProviders'] = $GLOBALS['StoreCreditPaymentProviders'] = \"\";\n\t\t\tforeach ($checkoutProviders as $provider) {\n\t\t\t\t$GLOBALS['ProviderChecked'] = '';\n\t\t\t\tif(count($checkoutProviders) == 1) {\n\t\t\t\t\t$GLOBALS['ProviderChecked'] = 'checked=\"checked\"';\n\t\t\t\t}\n\t\t\t\t$GLOBALS['ProviderId'] = $provider['object']->GetId();\n\t\t\t\t$GLOBALS['ProviderName'] = isc_html_escape($provider['object']->GetDisplayName());\n\t\t\t\t$GLOBALS['ProviderType'] = $provider['object']->GetPaymentType(\"text\");\n\t\t\t\tif(method_exists($provider['object'], 'ShowPaymentForm')) {\n\t\t\t\t\t$GLOBALS['ProviderPaymentFormClass'] = 'ProviderHasPaymentForm';\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$GLOBALS['ProviderPaymentFormClass'] = '';\n\t\t\t\t}\n\t\t\t\t$GLOBALS['PaymentFieldPrefix'] = '';\n\t\t\t\t$GLOBALS['PaymentProviders'] .= $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet(\"CheckoutProviderOption\");\n\t\t\t\t$GLOBALS['PaymentFieldPrefix'] = 'credit_';\n\t\t\t\t$GLOBALS['StoreCreditPaymentProviders'] .= $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet(\"CheckoutProviderOption\");\n\t\t\t}\n\n\t\t}\n\n\t\t// Are we coming back to this page for a particular reason?\n\t\tif (isset($_SESSION['REDIRECT_TO_CONFIRMATION_MSG'])) {\n\t\t\t$GLOBALS['HideCheckoutError'] = '';\n\t\t\t$GLOBALS['CheckoutErrorMsg'] = $_SESSION['REDIRECT_TO_CONFIRMATION_MSG'];\n\t\t\tunset($_SESSION['REDIRECT_TO_CONFIRMATION_MSG']);\n\t\t}\n\n\t\t$displayIncludingTax = false;\n\t\tif(getConfig('taxDefaultTaxDisplayCart') != TAX_PRICES_DISPLAY_EXCLUSIVE) {\n\t\t\t$displayIncludingTax = true;\n\t\t}\n\n\t\t$items = $this->getQuote()->getItems();\n\n\t\t// Start building the summary of all of the items in the order\n\t\t$GLOBALS['SNIPPETS']['CartItems'] = '';\n\t\tforeach ($items as $item) {\n\t\t\t$GLOBALS['ProductQuantity'] = $item->getQuantity();\n\n\t\t\t$price = $item->getPrice($displayIncludingTax);\n\t\t\t$total = $item->getTotal($displayIncludingTax);\n\t\t\t$GLOBALS['ProductPrice'] = currencyConvertFormatPrice($price);\n\t\t\t$GLOBALS['ProductTotal'] = currencyConvertFormatPrice($total);\n\n\t\t\tif($item instanceof ISC_QUOTE_ITEM_GIFTCERTIFICATE) {\n\t\t\t\t$GLOBALS['GiftCertificateName'] = isc_html_escape($item->getName());\n\t\t\t\t$GLOBALS['GiftCertificateTo'] = isc_html_escape($item->getRecipientName());\n\t\t\t\t$GLOBALS['SNIPPETS']['CartItems'] .= $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet(\"CheckoutCartItemGiftCertificate\");\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$GLOBALS['ProductAvailability'] = $item->getAvailability();\n\t\t\t$GLOBALS['ItemId'] = $item->getProductId();\n\n\t\t\t// Is this product a variation?\n\t\t\t$GLOBALS['ProductOptions'] = '';\n\t\t\t$options = $item->getVariationOptions();\n\t\t\tif(!empty($options)) {\n\t\t\t\t$GLOBALS['ProductOptions'] .= \"<br /><small>(\";\n\t\t\t\t$comma = '';\n\t\t\t\tforeach($options as $name => $value) {\n\t\t\t\t\tif(!trim($name) || !trim($value)) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\t$GLOBALS['ProductOptions'] .= $comma.isc_html_escape($name).\": \".isc_html_escape($value);\n\t\t\t\t\t$comma = ', ';\n\t\t\t\t}\n\t\t\t\t$GLOBALS['ProductOptions'] .= \")</small>\";\n\t\t\t}\n\t\t\t$GLOBALS['EventDate'] = '';\n\t\t\t$eventDate = $item->getEventDate(true);\n\t\t\tif(!empty($eventDate)) {\n\t\t\t\t$GLOBALS['EventDate'] = '\n\t\t\t\t\t<div style=\"font-style: italic; font-size:10px; color:gray\">(' .\n\t\t\t\t\t\t$item->getEventName() . ': ' . isc_date('M jS Y', $eventDate) .\n\t\t\t\t\t')</div>';\n\t\t\t}\n\n\t\t\t$GLOBALS['HideGiftWrapping'] = 'display: none';\n\t\t\t$GLOBALS['GiftWrappingName'] = '';\n\t\t\t$GLOBALS['GiftMessagePreview'] = '';\n\t\t\t$GLOBALS['HideGiftMessagePreview'] = 'display: none';\n\n\t\t\t$wrapping = $item->getGiftWrapping();\n\t\t\tif($wrapping !== false) {\n\t\t\t\t$GLOBALS['HideGiftWrapping'] = '';\n\t\t\t\t$GLOBALS['GiftWrappingName'] = isc_html_escape($wrapping['wrapname']);\n\t\t\t\tif(!empty($wrapping['wrapmessage'])) {\n\t\t\t\t\tif(isc_strlen($wrapping['wrapmessage']) > 30) {\n\t\t\t\t\t\t$wrapping['wrapmessage'] = substr($wrapping['wrapmessage'], 0, 27).'...';\n\t\t\t\t\t}\n\t\t\t\t\t$GLOBALS['GiftMessagePreview'] = isc_html_escape($wrapping['wrapmessage']);\n\t\t\t\t\t$GLOBALS['HideGiftMessagePreview'] = '';\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//create configurable product fields on order confirmation page with the data posted from add to cart page\n\t\t\t$GLOBALS['CartProductFields'] = '';\n\t\t\t$configuration = $item->getConfiguration();\n\t\t\tif (!empty($configuration)) {\n\t\t\t\trequire_once ISC_BASE_PATH.'/includes/display/CartContent.php';\n\t\t\t\tISC_CARTCONTENT_PANEL::GetProductFieldDetails($configuration, $item->getId());\n\t\t\t}\n\n\t\t\t$GLOBALS['ProductName'] = isc_html_escape($item->getName());\n\t\t\t$GLOBALS['ProductImage'] = imageThumb($item->getThumbnail(), prodLink($item->getName()));\n\n\t\t\t$GLOBALS['HideExpectedReleaseDate'] = 'display: none;';\n\t\t\tif($item->isPreOrder()) {\n\t\t\t\t$GLOBALS['ProductExpectedReleaseDate'] = $item->getPreOrderMessage();\n\t\t\t\t$GLOBALS['HideExpectedReleaseDate'] = '';\n\t\t\t}\n\n\t\t\t$GLOBALS['SNIPPETS']['CartItems'] .= $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet(\"CheckoutCartItem\");\n\t\t}\n\n\t\t// Do we have a shipping price to show?\n\t\tif(!$this->getQuote()->isDigital()) {\n\t\t\t$shippingAddresses = $this->getQuote()->getShippingAddresses();\n\t\t\t$numShippingAddresses = count($shippingAddresses);\n\t\t\tif($numShippingAddresses == 1) {\n\t\t\t\t$shippingAddress = $this->getQuote()->getShippingAddress();\n\t\t\t\t$GLOBALS['ShippingAddress'] = $GLOBALS['ISC_CLASS_ACCOUNT']->FormatShippingAddress($shippingAddress->getAsArray());\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$GLOBALS['ShippingAddress'] = '<em>(Order will be shipped to multiple addresses)</em>';\n\t\t\t}\n\n\t\t\t// Show the shipping details\n\t\t\t$GLOBALS['HideShippingDetails'] = '';\n\t\t}\n\t\t// This is a digital order - no shipping applies\n\t\telse {\n\t\t\t$GLOBALS['HideShippingDetails'] = 'display: none';\n\t\t\t$GLOBALS['HideShoppingCartShippingCost'] = 'none';\n\t\t\t$GLOBALS['ShippingAddress'] = GetLang('NotRequiredForDigitalDownloads');\n\t\t\t$GLOBALS['ShippingMethod'] = GetLang('ShippingImmediateDownload');\n\t\t}\n\n\t\t$billingAddress = $this->getQuote()->getBillingAddress();\n\t\t$GLOBALS['BillingAddress'] = getClass('ISC_ACCOUNT')\n\t\t\t->formatShippingAddress($billingAddress->getAsArray());\n\n\t\t$totalRows = self::getQuoteTotalRows($this->getQuote());\n\t\t$templateTotalRows = '';\n\t\tforeach($totalRows as $id => $totalRow) {\n\t\t\t$GLOBALS['ISC_CLASS_TEMPLATE']->assign('label', $totalRow['label']);\n\t\t\t$GLOBALS['ISC_CLASS_TEMPLATE']->assign('classNameAppend', ucfirst($id));\n\t\t\t$value = currencyConvertFormatPrice($totalRow['value']);\n\t\t\t$GLOBALS['ISC_CLASS_TEMPLATE']->assign('value', $value);\n\t\t\t$templateTotalRows .= $GLOBALS['ISC_CLASS_TEMPLATE']->getSnippet('CheckoutCartTotal');\n\t\t}\n\t\t$GLOBALS['ISC_CLASS_TEMPLATE']->assign('totals', $templateTotalRows);\n\n\t\t$grandTotal = $this->getQuote()->getGrandTotal();\n\t\t$GLOBALS['GrandTotal'] = formatPrice($grandTotal);\n\t\tif($grandTotal == 0) {\n\t\t\t$GLOBALS['HidePaymentOptions'] = \"none\";\n\t\t\t$GLOBALS['HideUseCoupon'] = 'none';\n\t\t\t$GLOBALS['HidePaymentProviderList'] = \"none\";\n\t\t\t$GLOBALS['PaymentButtonSwitch'] = \"ShowContinueButton(); ExpressCheckout.UncheckPaymentProvider();\";\n\t\t}\n\n\t\t// Does the customer have any store credit they can use?\n\t\t$GLOBALS['HideUseStoreCredit'] = \"none\";\n\t\t$GLOBALS['HideRemainingStoreCredit'] = \"none\";\n\t\t$customer = $GLOBALS['ISC_CLASS_CUSTOMER']->GetCustomerDataByToken();\n\t\tif ($customer['custstorecredit'] > 0) {\n\t\t\t$GLOBALS['HidePaymentOptions'] = \"\";\n\t\t\t$GLOBALS['StoreCredit'] = CurrencyConvertFormatPrice($customer['custstorecredit']);\n\t\t\t$GLOBALS['HideUseStoreCredit'] = \"\";\n\t\t\t$GLOBALS['HidePaymentProviderList'] = \"none\";\n\t\t\t// The customer has enough store credit to pay for the entirity of this order\n\t\t\tif ($customer['custstorecredit'] >= $grandTotal) {\n\t\t\t\t$GLOBALS['PaymentButtonSwitch'] = \"ShowContinueButton();\";\n\t\t\t\t$GLOBALS['HideLimitedCreditWarning'] = \"none\";\n\t\t\t\t$GLOBALS['HideLimitedCreditPaymentOption'] = \"none\";\n\t\t\t\t$GLOBALS['HideCreditPaymentMethods'] = \"none\";\n\t\t\t\t$GLOBALS['RemainingCredit'] = $customer['custstorecredit'] - $grandTotal;\n\t\t\t\tif ($GLOBALS['RemainingCredit'] > 0) {\n\t\t\t\t\t$GLOBALS['HideRemainingStoreCredit'] = '';\n\t\t\t\t\t$GLOBALS['RemainingCredit'] = CurrencyConvertFormatPrice($GLOBALS['RemainingCredit']);\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Customer doesn't have enough store credit to pay for the order\n\t\t\telse {\n\t\t\t\t$GLOBALS['Remaining'] = CurrencyConvertFormatPrice($grandTotal-$customer['custstorecredit']);\n\n\t\t\t\tif(count($checkoutProviders) == 1) {\n\t\t\t\t\t$GLOBALS['CheckoutStoreCreditWarning'] = sprintf(GetLang('CheckoutStoreCreditWarning2'), $GLOBALS['Remaining'], $GLOBALS['CheckoutWith']);\n\t\t\t\t\t$GLOBALS['HideLimitedCreditPaymentOption'] = \"none\";\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$GLOBALS['CheckoutStoreCreditWarning'] = GetLang('CheckoutStoreCreditWarning');\n\t\t\t\t}\n\t\t\t\t$GLOBALS['ISC_LANG']['CreditPaymentMethod'] = sprintf(GetLang('CreditPaymentMethod'), $GLOBALS['Remaining']);\n\t\t\t}\n\n\t\t\tif (count($checkoutProviders) > 1) {\n\t\t\t\t$GLOBALS['CreditAlt'] = GetLang('CheckoutCreditAlt');\n\t\t\t}\n\t\t\telse if (count($checkoutProviders) <= 1 && isset($GLOBALS['CheckoutWith'])) {\n\t\t\t\t$GLOBALS['CreditAlt'] = sprintf(GetLang('CheckoutCreditAltOneMethod'), $GLOBALS['CheckoutWith']);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif ($customer['custstorecredit'] >= $grandTotal) {\n\t\t\t\t\t$GLOBALS['HideCreditAltOptionList'] = \"none\";\n\t\t\t\t\t$GLOBALS['HideConfirmOrderPage'] = \"\";\n\t\t\t\t\t$GLOBALS['HideTopPaymentButton'] = \"none\";\n\t\t\t\t\t$GLOBALS['HideCheckoutError'] = \"none\";\n\t\t\t\t\t$GLOBALS['CheckoutErrorMsg'] = '';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Customer has hit this page before. Delete the existing pending order\n\t\t// The reason we do a delete is if they're hitting this page again, something\n\t\t// has changed with their order or something has become invalid with it along the way.\n\t\tif (isset($_COOKIE['SHOP_ORDER_TOKEN']) && IsValidPendingOrderToken($_COOKIE['SHOP_ORDER_TOKEN'])) {\n\t\t\t$query = \"\n\t\t\t\tSELECT orderid\n\t\t\t\tFROM [|PREFIX|]orders\n\t\t\t\tWHERE ordtoken='\".$GLOBALS['ISC_CLASS_DB']->Quote($_COOKIE['SHOP_ORDER_TOKEN']).\"' AND ordstatus=0\n\t\t\t\";\n\t\t\t$result = $GLOBALS['ISC_CLASS_DB']->Query($query);\n\t\t\twhile($order = $GLOBALS['ISC_CLASS_DB']->Fetch($result)) {\n\t\t\t\t$entity = new ISC_ENTITY_ORDER();\n\t\t\t\t/** @todo ISC-1141 check to see if this needs changing to ->purge() */\n\t\t\t\t/** @todo ISC-860 this is relying on another bugfix, I'm leaving this as ->delete() for now so that orders remain in the db somewhere at least -gwilym */\n\t\t\t\tif ($entity->delete($order['orderid'], true)) {\n\t\t\t\t\t$GLOBALS['ISC_CLASS_LOG']->LogSystemNotice('general', GetLang('OrderDeletedAutomatically', array('order' => $order['orderid'])));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Are we showing an error message?\n\t\tif (isset($GLOBALS['CheckoutErrorMsg']) && $GLOBALS['CheckoutErrorMsg'] != '') {\n\t\t\t$GLOBALS['HideCheckoutError'] = '';\n\t\t}\n\t\telse {\n\t\t\t$GLOBALS['HideCheckoutError'] = \"none\";\n\t\t}\n\n\t\t// Is there a success message to show?\n\t\tif (isset($GLOBALS['CheckoutSuccessMsg']) && $GLOBALS['CheckoutSuccessMsg'] != '') {\n\t\t\t$GLOBALS['HideCheckoutSuccess'] = '';\n\t\t}\n\t\telse {\n\t\t\t$GLOBALS['HideCheckoutSuccess'] = \"none\";\n\t\t}\n\n\t\tif(GetConfig('EnableOrderComments') == 1) {\n\t\t\t$GLOBALS['HideOrderComments'] = \"\";\n\t\t} else {\n\t\t\t$GLOBALS['HideOrderComments'] = \"none\";\n\t\t}\n\n\t\tif(GetConfig('EnableOrderTermsAndConditions') == 1) {\n\n\t\t\t$GLOBALS['HideOrderTermsAndConditions'] = \"\";\n\n\t\t\tif(GetConfig('OrderTermsAndConditionsType') == \"link\") {\n\t\t\t\t$GLOBALS['AgreeTermsAndConditions'] = GetLang('YesIAgree');\n\n\t\t\t\t$GLOBALS['TermsAndConditionsLink'] = \"<a href='\".GetConfig('OrderTermsAndConditionsLink').\"' target='_BLANK'>\".strtolower(GetLang('TermsAndConditions')).\"</a>.\";\n\n\t\t\t\t$GLOBALS['HideTermsAndConditionsTextarea'] = \"display:none;\";\n\n\t\t\t} else {\n\t\t\t\t$GLOBALS['HideTermsAndConditionsTextarea']= '';\n\t\t\t\t$GLOBALS['OrderTermsAndConditions'] = GetConfig('OrderTermsAndConditions');\n\t\t\t\t$GLOBALS['AgreeTermsAndConditions'] = GetLang('AgreeTermsAndConditions');\n\t\t\t\t$GLOBALS['TermsAndConditionsLink'] = '';\n\t\t\t}\n\t\t} else {\n\t\t\t$GLOBALS['HideOrderTermsAndConditions'] = \"display:none;\";\n\t\t}\n\n\t\t// BCSIXBETA-372 - mail format preferences removed/disabled for now\n\t\t// %%SNIPPET_CheckoutMailFormatPreference%% references also need to be added back into the checkout panels/snippets to re-enable this if needed\n//\t\t$GLOBALS['MailFormatPreferenceOptions'] = $this->GenerateMailFormatPreferenceOptions();\n//\t\t$GLOBALS['SNIPPETS']['CheckoutMailFormatPreference'] = $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet('CheckoutMailFormatPreference');\n\t}",
"function process_orders($orders)\n{\n $display = '';\n\n $order_instance = new Order();\n $item_instance = new Item();\n $fulfillment_instance = new Fulfillment();\n\n\n $order_count = 0;\n\n foreach ($orders as $o) {\n $order_count++;\n /** ------------\n * PARSE ORDERS\n * ------------ */\n $order_shopify_id = $o['id'];\n log_error('order_shopify_id: ' . $order_shopify_id);\n\n $customer_email = trim($o['email']);\n $customer_phone = (!empty($o['shipping_address']['phone'])) ? trim(strval($o['shipping_address']['phone'])) : trim(strval($o['billing_address']['phone']));\n $order_tcreate = date(\"Y-m-d H:i:s\", strtotime($o['created_at']));\n $order_tmodified = !empty($o['updated_at'])?date(\"Y-m-d H:i:s\", strtotime($o['updated_at'])):null;\n $order_tclose = !empty($o['closed_at'])?date(\"Y-m-d H:i:s\", strtotime($o['closed_at'])):null;\n $order_is_closed = empty($o['closed_at']) ? true : false;\n $order_total_cost = $o['total_price'];\n $order_receipt_id = $o['name'];\n $order_currency = $o['currency'];\n $order_vendor = '';\n $order_alert_status = NOTIFICATION_STATUS_NONE;\n\n\n\n\n\n\n if (!empty($o['gateway'])) {\n if (stripos($o['gateway'], 'stripe') > -1) $order_gateway = GATEWAY_PROVIDER_STRIPE;\n elseif (stripos($o['gateway'], 'paypal') > -1 ) $order_gateway = GATEWAY_PROVIDER_PAYPAL;\n elseif (stripos($o['gateway'], 'shopify_payments') > -1 ) $order_gateway = GATEWAY_PROVIDER_PAYPAL;\n else $order_gateway = GATEWAY_PROVIDER_UNKNOWN;\n }\n\n $order_fulfillment_status = $o['fulfillment_status'];\n $order_is_dropified = (!empty($o['note']) && stripos($o['note'], 'dropified') > -1 );\n \n /**\n * Check if note has 'Aliexpress' or 'Dropified'.\n * \n * If has then: \n * - get events related to order\n * - check if Dropified created fulfillments\n * - return array of ids of fulfillments created by Dropified\n * \n * If not then:\n * - return empty array\n * \n * Added by Rafal - 2018-03-13\n */\n \n $dropified_fulfillmets_ids = (stripos($o['note'], 'dropified') > -1 || stripos($o['note'], 'aliexpress') > -1)?getDropifiedEvents(getOrderEvents($order_shopify_id)):array();\n \n /** --------------\n * PARSE CUSTOMER\n * -------------- */\n $order_customer_fn = $o['shipping_address']['first_name'];\n $order_customer_ln = $o['shipping_address']['last_name'];\n $order_customer_address1 = $o['shipping_address']['address1'];\n $order_customer_address2 = $o['shipping_address']['address2'];\n $order_customer_city = $o['shipping_address']['city'];\n $order_customer_zip = $o['shipping_address']['zip'];\n $order_customer_province = $o['shipping_address']['province'];\n $order_customer_country_code = $o['shipping_address']['country_code'];\n $order_customer_province_code = $o['shipping_address']['province_code'];\n $order_customer_phone = $o['shipping_address']['phone'];\n $order_tags = strtolower($o['tags']);\n\n /** -----------------------------------\n * CUSTOMER BILLING - ADDED 02-06-2018\n * ----------------------------------- */\n $order_customer_billing_fn = $o['billing_address']['first_name'];\n $order_customer_billing_ln = $o['billing_address']['last_name'];\n $order_customer_billing_address1 = $o['billing_address']['address1'];\n $order_customer_billing_address2 = $o['billing_address']['address2'];\n $order_customer_billing_city = $o['billing_address']['city'];\n $order_customer_billing_zip = $o['billing_address']['zip'];\n $order_customer_billing_province = $o['billing_address']['province'];\n $order_customer_billing_country_code = $o['billing_address']['country_code'];\n $order_customer_billing_province_code = $o['billing_address']['province_code'];\n $order_customer_billing_phone = $o['billing_address']['phone'];\n\n \n /** -------------------------------------\n * CANCELLED - ADDED BY RAFAL 2018-03-20\n * ------------------------------------- */\n $order_tcancel = !empty($o['cancelled_at'])?date(\"Y-m-d H:i:s\", strtotime($o['cancelled_at'])):'0000-00-00 00:00:00';\n\n\n $order_is_ocu = (stripos($order_tags,'ocu') > -1)?1:0;\n\n $_refund_status = trim($o['financial_status']);\n\n //print 'REFUND STATUS: ' . $_refund_status . PHP_EOL;\n\n switch(strtolower($_refund_status))\n {\n case 'partially_refunded':\n $order_refund_status = 2;\n //print 'REFUND!!: ' . $order_refund_status;\n break;\n case 'refunded':\n $order_refund_status = 1;\n //print 'REFUND!!: ' . $order_refund_status;\n break;\n default: case 'paid':\n $order_refund_status = 0;\n //print 'REFUND!!: ' . $order_refund_status;\n break;\n }\n \n /** --------------------------------------------\n * FINANCIAL STATUS - ADDED BY RAFAL 2018-03-20\n * -------------------------------------------- */\n \n $_financial_status = trim($o['financial_status']);\n \n switch(strtolower($_financial_status))\n {\n case 'pending':\n $order_financial_status = 1;\n break;\n case 'authorized':\n $order_financial_status = 2;\n break;\n case 'partially_paid':\n $order_financial_status = 3;\n break;\n case 'paid':\n $order_financial_status = 4;\n break;\n case 'partially_refunded':\n $order_financial_status = 5;\n break;\n case 'refunded':\n $order_financial_status = 6;\n break;\n case 'voided':\n $order_financial_status = 7;\n break;\n default: case '':\n $order_financial_status = 0;\n break;\n }\n \n $order_is_fulfilled = false; //has the fulfillment process started or not\n $order_is_delivered = false; //has the order been completed and delivered\n $order_is_tracking = false; //whether we should track the order\n\n $order_array = Array(\n 'order_customer_email' => $customer_email,\n 'order_customer_fn' => $order_customer_fn,\n 'order_customer_ln' => $order_customer_ln,\n 'order_customer_address1' => $order_customer_address1,\n 'order_customer_address2' => $order_customer_address2,\n 'order_customer_city' => $order_customer_city,\n 'order_customer_country' => $order_customer_country_code,\n 'order_customer_province' => $order_customer_province,\n\n /** -----------------------------------\n * CUSTOMER BILLING - ADDED 02-06-2018\n * ----------------------------------- */\n 'order_customer_billing_fn'=> $order_customer_billing_fn,\n 'order_customer_billing_ln'=> $order_customer_billing_ln,\n 'order_customer_billing_address1'=> $order_customer_billing_address1,\n 'order_customer_billing_address2'=> $order_customer_billing_address2,\n 'order_customer_billing_city'=> $order_customer_billing_city,\n 'order_customer_billing_zip'=> $order_customer_billing_zip,\n 'order_customer_billing_province'=> $order_customer_billing_province,\n 'order_customer_billing_country'=> $order_customer_billing_country_code,\n 'order_customer_billing_phone'=> $order_customer_billing_phone,\n\n 'order_currency' => $order_currency,\n 'order_tags' => $order_tags,\n 'order_is_ocu'=>$order_is_ocu,\n 'order_customer_zip' => $order_customer_zip,\n 'order_customer_phone' => $customer_phone,//$order_customer_phone,\n 'order_fulfillment_status' => $order_fulfillment_status,\n 'order_is_refunded' => $order_refund_status,\n 'order_shopify_id' => $order_shopify_id,\n 'order_gateway' => $order_gateway,\n 'order_receipt_id'=>$order_receipt_id,\n 'order_total_cost' => $order_total_cost,\n 'order_topen' => $order_tcreate,\n 'order_tclose' => $order_tclose,\n\n \n /** --------------------------------------------\n * FINANCIAL STATUS - ADDED BY RAFAL 2018-03-20\n * -------------------------------------------- */\n 'order_financial_status' => $order_financial_status,\n \n /** -------------------------------------\n * CANCELLED - ADDED BY RAFAL 2018-03-20\n * ------------------------------------- */\n 'order_tcancel' => $order_tcancel,\n\n );\n \n /** ----------------------------------------\n * _ORDER_ARRAY - ADDED BY RAFAL 2018-03-20\n * \n * This is added to update only order if \n * is cancel order status\n * --------------------------------------- */\n \n\n /** -----------------------------------\n * LOOKUP ORDERS BY SHOPIFY'S ORDER ID\n * ----------------------------------- */\n if (isset($order_object)) unset($order_object);\n $order_object = $order_instance->fetch_order_by_order_shopify_id($order_shopify_id);\n \n /** ------------------------------\n * IF IT DOESN'T EXIST, CREATE IT\n * ------------------------------ */\n if (!$order_object) {\n $order_object = new Order($order_array);\n $order_id = $order_object->save();\n } else {\n $order_id = $order_object->id;\n }\n\n\n /** --------------------------\n * PARSE REFUNDED LINE ITEMS\n * ------------------------- */\n\n\n\n if(!empty($o['refunds']))\n {\n $refund_list = Array();\n $refund_check = Array();\n foreach($o['refunds'] as $refund)\n {\n $refund_date =date(\"Y-m-d H:i:s\", strtotime($refund['created_at']));\n foreach($refund['refund_line_items'] as $item)\n {\n $refund_list[$item['line_item_id']]=$refund_date;\n $refund_check[] = $item['line_item_id'];\n }\n }\n //print 'refund! ' . print_r($refund_list,true);\n //print 'refund! ' . print_r($refund_check,true);\n }\n\n\n\n\n /** ----------------\n * PARSE LINE ITEMS\n * ---------------- */\n\n foreach ($o['line_items'] as $p) {\n $_fulfillment_status = $p['fulfillment_status'];\n switch(strtolower($_fulfillment_status))\n {\n case 'fulfilled': $item_fulfillment_status = 1;break;\n case 'partial': $item_fulfillment_status = 2; break;\n default: case null: $item_fulfillment_status = 0;break;\n }\n $item_shopify_id = $p['id'];\n $item_shopify_product_id = $p['product_id'];\n $item_shopify_variant_id = $p['variant_id'];\n $item_name = $p['name'];\n $item_quantity = $p['quantity'];\n $item_sku = $p['sku'];\n $item_price = $p['price'];\n $item_is_refunded = 0;\n //$item_refund_tcreate = null;\n if(!empty($o['refunds'])) {\n if (in_array(trim($item_shopify_id), $refund_check)) {\n $item_is_refunded = 1;\n $item_refund_tcreate = $refund_list[$item_shopify_id];\n //print 'FOUND REFUND!';\n }\n }\n\n $item_array = Array(\n 'order_id' => $order_id,\n 'order_shopify_id' => $order_shopify_id,\n 'item_shopify_id' => $item_shopify_id,\n 'item_quantity' => $item_quantity,\n 'item_sku' => $item_sku,\n 'item_price'=>floatval($item_price),\n 'item_shopify_product_id' => $item_shopify_product_id,\n 'item_shopify_variant_id' => $item_shopify_variant_id,\n 'item_name' => $item_name,\n 'item_is_refunded' => $item_is_refunded,\n 'item_is_fulfilled'=>$item_fulfillment_status\n );\n\n if(isset($item_refund_tcreate)) $item_array['item_refund_tcreate']=$item_refund_tcreate;\n\n /** -------------------------\n * STORE / UPDATE LINE ITEMS\n * ------------------------- */\n if (isset($item_object)) unset($item_object);\n\n $item_object = $item_instance->fetch_item_by_shopify_item_id($item_shopify_id);\n if (!$item_object) {\n $item_object = new Item($item_array);\n $item_id = $item_object->save();\n } else {\n $item_id = $item_object->id;\n $item_object->save($item_array);\n }\n $order_object->order_items[] = $item_object;\n\n }\n\n\n /** ------------\n * FULFILLMENTS\n * ------------ */\n if (!empty($o['fulfillments'])) {\n foreach ($o['fulfillments'] as $fulfillment) {\n \n \n /**\n * Added by Rafal 2018-04-12\n * \n * Prevent added cancelled, error or failure\n * fulfillments\n */\n if($fulfillment['status'] == 'cancelled' || $fulfillment['status'] == 'error' || $fulfillment['status'] == 'failure'){\n continue;\n }\n \n \n $fulfillment_shopify_id = $fulfillment['id'];\n $fulfillment_shipment_status = strtolower(trim($fulfillment['shipment_status']));\n $fulfillment_topen = date(\"Y-m-d H:i:s\", strtotime($fulfillment['created_at']));\n //$fulfillment_tmodified = date(\"Y-m-d H:i:s\", strtotime($fulfillment['updated_at']));\n \n $fulfillment_tracking_company = strtolower($fulfillment['tracking_company']);\n \n $fulfillment_tracking_number = $fulfillment['tracking_number'];\n $fulfillment_tracking_url = $fulfillment['tracking_url'];\n\n $order_is_fulfilled = true;\n\n\n $fulfillment_array = Array(\n 'order_id' => $order_id,\n 'order_shopify_id' => $order_shopify_id,\n 'fulfillment_shipment_status' => trim(strtolower($fulfillment_shipment_status)),\n 'fulfillment_topen'=>$fulfillment_topen,\n 'fulfillment_shopify_id' => $fulfillment_shopify_id,\n 'fulfillment_tracking_number' => $fulfillment_tracking_number,\n 'fulfillment_tracking_company' => $fulfillment_tracking_company,\n 'fulfillment_tracking_url' => $fulfillment_tracking_url,\n 'order_is_fulfilled' => $order_is_fulfilled,\n );\n \n if ($fulfillment_tracking_company !== 'usps') $is_tracking = true;\n else $is_tracking = false;\n\n $order_delivery_status = false;\n\n //Normally USPS is the only courier that updates this appropriately. If its delivered set status\n switch ($fulfillment_shipment_status) {\n case 'delivered':\n $order_delivery_status = DELIVERY_STATUS_DELIVERED;\n $order_is_delivered = true;\n $fulfillment_array['fulfillment_delivery_status'] = $order_delivery_status;\n $order_array['order_delivery_status'] = $order_delivery_status;\n $fulfillment_array['fulfillment_status_delivered_tcreate'] = current_timestamp();\n if($is_tracking) $fulfillment_array['fulfillment_is_tracking'] = 0;\n break;\n\n case 'confirmed':\n $order_delivery_status = DELIVERY_STATUS_CONFIRMED;\n $fulfillment_array['fulfillment_delivery_status'] = $order_delivery_status;\n $order_array['order_delivery_status'] = $order_delivery_status;\n $fulfillment_array['fulfillment_status_confirmed_tcreate'] = current_timestamp();\n if($is_tracking) $fulfillment_array['fulfillment_is_tracking'] = 1;\n break;\n\n case 'in_transit':\n $order_delivery_status = DELIVERY_STATUS_IN_TRANSIT;\n $fulfillment_array['fulfillment_delivery_status'] = $order_delivery_status;\n $order_array['order_delivery_status'] = $order_delivery_status;\n $fulfillment_array['fulfillment_status_in_transit_tcreate'] = current_timestamp();\n if($is_tracking) $fulfillment_array['fulfillment_is_tracking'] = 1;\n break;\n\n case 'out_for_delivery':\n $order_delivery_status = DELIVERY_STATUS_OUT_FOR_DELIVERY;\n $fulfillment_array['fulfillment_delivery_status'] = $order_delivery_status;\n $order_array['order_delivery_status'] = $order_delivery_status;\n $fulfillment_array['fulfillment_status_out_for_delivery_tcreate'] = current_timestamp();\n if($is_tracking) $fulfillment_array['fulfillment_is_tracking'] = 1;\n break;\n\n case 'failure':\n $order_delivery_status = DELIVERY_STATUS_FAILURE;\n $fulfillment_array['fulfillment_delivery_status'] = $order_delivery_status;\n $order_array['order_delivery_status'] = $order_delivery_status;\n $fulfillment_array['fulfillment_status_failure_tcreate'] = current_timestamp();\n if($is_tracking) $fulfillment_array['fulfillment_is_tracking'] = 0;\n $order_array['order_alert_status'] = DELIVERY_STATUS_FAILURE;\n $fulfillment_array['fulfillment_alert_status'] = DELIVERY_STATUS_FAILURE;\n break;\n\n default:\n $order_delivery_status = DELIVERY_STATUS_UNKNOWN;\n $fulfillment_array['fulfillment_delivery_status'] = $order_delivery_status;\n if($is_tracking) $fulfillment_array['fulfillment_is_tracking'] = 1;\n\n break;\n }\n/*\n if ($order_delivery_status)\n $order_array['delivery_status'] = $order_delivery_status;*/\n \n \n /**\n * 'status_delivered_tcreate'=>'',\n * 'status_confirmed_tcreate'=>'',\n * 'status_in_transit_tcreate'=>'',\n * 'status_out_for_delivery_tcreate'=>'',\n * 'status_failure_tcreate'=>'',\n * 'status_not_found_tcreate'=>'',\n * 'status_customer_pickup_tcreate'=>'',\n * 'status_alert_tcreate'=>'',\n * 'status_expired_tcreate'=>'',\n */\n /** -----------------------------------\n * CREATE AND STORE FULFILLMENT OBJECT\n * ----------------------------------- */\n \n //Lets see if the order exists\n if (isset($fulfillment_object)) unset($fulfillment_object);\n\n $fulfillment_object = $fulfillment_instance->fetch_fulfillment_by_shopify_fulfillment_id($fulfillment_shopify_id);\n\n\n if (!$fulfillment_object) {\n $fulfillment_array['fulfillment_tracking_number_tcreate'] = current_timestamp();\n $fulfillment_object = new Fulfillment($fulfillment_array);\n $fulfillment_object->save();\n\n } else {\n\n if($fulfillment_object->tracking_number == \"\" || $fulfillment_object->tracking_number == null)\n $fulfillment_array['fulfillment_tracking_number_tcreate'] = current_timestamp();\n\n $fulfillment_object->save($fulfillment_array);\n }\n \n $order_object->order_fulfillments[] = $fulfillment_object;\n \n \n /** Added by Rafal - 2018-03-13 */\n if(sizeof($dropified_fulfillmets_ids) > 0 && in_array($fulfillment_shopify_id,$dropified_fulfillmets_ids) === true){\n $dropified_array = Array(\n 'tracking_number' => $fulfillment_tracking_number,\n 'fulfillment_shopify_id' => $fulfillment_shopify_id,\n 'order_id' => $order_id,\n 'vendor_id' => VENDOR_DROPIFIED,\n 'order_receipt_id'=>$order_receipt_id,\n 'tracking_tcreate' => current_timestamp(),\n 'tracking_tmodified'=>current_timestamp()\n );\n set_dropified_tracking($dropified_array);\n }\n }\n\n /** -----------------------\n * UPDATE THE ORDER OBJECT\n * ----------------------- */\n $order_object->save($order_array);\n } else {\n /** -------------------------------------\n * ADDED BY RAFAL 2018-03-20\n * \n * This allow to update cancell date and\n * financial status if it is different\n * than in table\n * ------------------------------------- */\n $cancel_array = Array();\n \n if(isset($order_object -> financial_status) && $order_object -> financial_status != $order_financial_status){\n $cancel_array['order_financial_status'] = $order_financial_status;\n }\n \n if(isset($order_object -> tcancel) && $order_object -> tcancel != $order_financial_status){\n $cancel_array['order_tcancel'] = $order_tcancel;\n }\n \n if (sizeof($cancel_array) > 0) {\n \n $db_conditions = Array('order_id' => $order_id);\n \n if (isset($db_instance)) unset($db_instance); \n $db_instance = new Database;\n $db_instance -> db_update('orders',$cancel_array,$db_conditions,$isOr=false);\n }\n }\n\n if ($order_count >= ORDER_COUNT_LIMIT_MANUAL && ORDER_COUNT_LIMIT_MANUAL != 0) exit('ORIGINAL DATA: ' . PHP_EOL . print_r($order_count, true));\n\n }\n log_error('total orders: ' . $order_count);\n\n\n}",
"function dsf_protx_release_order($order_number){\n\nglobal $ReleaseURL, $Verify, $ProtocolVersion;\n\n\n// validate a protx direct item.\n $protx_query = dsf_db_query(\"select orders_id, vendortxcode, vpstxid, securitykey, txauthno from \" . DS_DB_SHOP . \".protx_direct_responses where orders_id='\" . (int)$order_number . \"'\");\n \n if (dsf_db_num_rows($protx_query) == 0){\n \n \t$problem_text = 'Order number ' . $order_number . ' has been marked as released however its' . \"\\n\";\n\t$problem_text .= 'transaction details can not be found within the protx direct transaction logs' . \"\\n\\n\";\n\t$problem_text .= 'If this is a valid protx direct payment order, please release the item manually';\n\t\n\tmail_protx_problem($problem_text);\n\treturn 'Protx Item not Found';\n\tbreak;\n\t\n \t// not a protx order\n }elseif (dsf_db_num_rows($protx_query) > 1){\n \t// more than one item is listed - this is an error.\n \t$problem_text = 'Order number ' . $order_number . ' has been marked as released however there are' . \"\\n\";\n\t$problem_text .= 'more than one transaction item found within the protx direct transaction logs' . \"\\n\\n\";\n\t$problem_text .= 'Please release the item manually and check the logs to see why there is more' . \"\\n\";\n\t$problem_text .= 'than one transaction item.' . \"\\n\";\n\t\n\t\n\tmail_protx_problem($problem_text);\n\treturn 'More than one protx item found';\n\tbreak;\n }\n \t\n\n\t$protx_user_account_number = MODULE_PAYMENT_PROTXCC_ID;\n\n// #########################\n\n\n\n\n\n // we must have a valid transaction item if we are here, get the array of items.\n \n $protx_items = dsf_db_fetch_array($protx_query);\n \n$TargetURL = $ReleaseURL;\n$VerifyServer = $Verify;\n\n// echo 'URL = ' . $TargetURL;\n$data = array (\n\t\t'VPSProtocol' => $ProtocolVersion, \t\t\t\t\t\t\t// Protocol version (specified in init-includes.php)\n\t\t'TxType' => 'RELEASE',\t\t\t\t\t\t\t\t\t\t\t\t\t// Transaction type \n\t\t'Vendor' => $protx_user_account_number,\t\t\t\t\t\t\t\t\t// Vendor name (specified in init-protx.php)\n\t\t'VendorTxCode' => $protx_items['vendortxcode'],\t\t\t\t\t// Unique refund transaction code (generated by vendor)\n\t\t'VPSTxId' => $protx_items['vpstxid'],\t\t\t\t\t\t\t\t\t\t// VPSTxId of order\n\t\t'SecurityKey' => $protx_items['securitykey'],\t\t\t\t\t\t// Security Key\n\t\t'TxAuthNo' => $protx_items['txauthno']\t\t\t\t\t\t\t\t\t// Transaction authorisation number\n\t);\n\n// Format values as url-encoded key=value pairs\n$data = formatData($data);\n\n$response ='';\n\n$response = requestPost($TargetURL, $data);\n\n$baseStatus = array_shift(split(\" \",$response[\"Status\"]));\n\nswitch($baseStatus) {\n\n\tcase 'OK':\n\t\n\t// payment has been released witin protx.\n\t\t\n\t\t// update the orders status\n\t\t\t\t\t\t\n\t\t$sql_data_array = array('orders_status' => '13');\n\t\tdsf_db_perform(DS_DB_SHOP . \".orders\",$sql_data_array,'update','orders_id=' . $order_number);\n\n\n\t// update status history.\n\t\t $sql_data_array = array('orders_id' => $order_number, \n\t\t\t\t\t\t\t\t 'orders_status_id' => '13', \n\t\t\t\t\t\t\t\t 'date_added' => 'now()');\n\t\t dsf_db_perform(DS_DB_SHOP . \".orders_status_history\", $sql_data_array);\n\n\t// log the reply.\n\t\t\n\t\t$write_notes = dsf_protx_shop_notes($order_number, \"RELEASE STATUS = OK\\n\");\n\n\t\treturn 'Complete';\n\t\tbreak;\n\t\n\t\n\t\n\t// all other cases\n\tcase 'MALFORMED':\n\tcase 'INVALID':\n\tcase 'ERROR':\n\t\n\t$problem_text = 'Order number ' . $order_number . ' has been marked as released however a problem' . \"\\n\";\n\t$problem_text .= 'has been returned from Protx, the error is:' . \"\\n\\n\";\n\t$problem_text .= $response['StatusDetail'] . \"\\n\";\n\t\n\tmail_protx_problem($problem_text);\n\n\t$write_notes = dsf_protx_shop_notes($order_number, \"RELEASE STATUS = FAILED\\n\");\n\n\treturn 'Failed';\n\tbreak;\n\n\n\tcase 'FAIL':\n\t\n\t$problem_text = 'Order number ' . $order_number . ' has been marked as ' . $TxType . ' however a problem' . \"\\n\";\n\t$problem_text .= 'with communication from Protx has occured, the error (if available) is:' . \"\\n\\n\";\n\t$problem_text .= $response['StatusDetail'] . \"\\n\";\n\t\n\tmail_protx_problem($problem_text);\n\n\t$write_notes = dsf_protx_shop_notes($order_number, $TxType . \" STATUS = FAILED\\n\");\n\n\treturn 'Failed';\n\tbreak;\n\n\n\t} // end of switch.\n\nreturn $response;\n}",
"function before_process() {\n global $order, $db, $currencies, $messageStack;\n\n\t// if the card number has the blanked out middle number fields, it has been processed, the message that \n\t// the charges were not processed were set in pre_confirmation_check, just return to continue without processing.\n\tif (strpos($_POST['paymentech_field_1'], '*') !== false) {\n\t\treturn false;\n\t}\n\n $order->info['cc_expires'] = $_POST['paymentech_field_2'] . $_POST['paymentech_field_3'];\n $order->info['cc_owner'] = $_POST['paymentech_field_0'];\n\t$this->cc_card_owner = $_POST['paymentech_field_0'];\n $order->info['cc_cvv'] = $_POST['paymentech_field_4'];\n\n // Create a string that contains a listing of products ordered for the description field\n $description = $order->description;\n\n\t// Generate the XML file to be sent to Paymentech\n\tif (MODULE_PAYMENT_PAYMENTECH_TESTMODE == 'Test') {\n\t\t$MerchantID = MODULE_PAYMENT_PAYMENTECH_MERCHANT_ID_TEST;\n\t} else {\n\t\tswitch (DEFAULT_CURRENCY) {\n\t\t\tcase 'USD': $MerchantID = MODULE_PAYMENT_PAYMENTECH_MERCHANT_ID_USD; break;\n\t\t\tcase 'CAD': $MerchantID = MODULE_PAYMENT_PAYMENTECH_MERCHANT_ID_CAD; break;\n\t\t}\n\t}\n\n\t$post_string = \"\n\t\t<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\n\t\t<Request>\n\t\t\t<NewOrder>\n\t\t\t\t<IndustryType>EC</IndustryType>\n\t\t\t\t<MessageType>\" . (MODULE_PAYMENT_PAYMENTECH_AUTHORIZATION_TYPE == 'Authorize' ? 'A' : 'AC') . \"</MessageType>\n\t\t\t\t<BIN>\" . MODULE_PAYMENT_PAYMENTECH_BIN . \"</BIN>\n\t\t\t\t<MerchantID>\" . $MerchantID . \"</MerchantID>\n\t\t\t\t<TerminalID>\" . MODULE_PAYMENT_PAYMENTECH_TERMINAL_ID . \"</TerminalID>\n\t\t\t\t<AccountNum>\" . $_POST['paymentech_field_1'] . \"</AccountNum>\n\t\t\t\t<Exp>\" . $order->info['cc_expires'] . \"</Exp>\n\t\t\t\t<CurrencyCode>\" . (DEFAULT_CURRENCY == 'USD' ? '840' : '124') . \"</CurrencyCode>\n\t\t\t\t<CurrencyExponent>2</CurrencyExponent>\n\t\t\t\t<CardSecValInd>\" . ($this->cc_cvv2 ? 1 : 9 ) . \"</CardSecValInd>\n\t\t\t\t<CardSecVal>\" . ($this->cc_cvv2 ? $this->cc_cvv2 : '') . \"</CardSecVal>\n\t\t\t\t<AVSzip>\" . preg_replace(\"/[^A-Za-z0-9]/\", \"\", $order->bill_postal_code) . \"</AVSzip>\n\t\t\t\t<AVSaddress1>\" . substr($order->bill_address1, 0, 20) . \"</AVSaddress1>\"\n\t\t\t\t. ( $order->bill_address2 ? '\n\t\t\t\t<AVSaddress2>' . $order->bill_address2 . '</AVSaddress2>' : '' ) . \"\n\t\t\t\t<AVScity>\" . $order->bill_city_town . \"</AVScity>\n\t\t\t\t<AVSstate>\" . $order->bill_state_province . \"</AVSstate>\n\t\t\t\t<AVSphoneNum>\" . $order->bill_telephone . \"</AVSphoneNum>\n\t\t\t\t<AVSname>\" . $this->cc_card_owner . \"</AVSname>\n\t\t\t\t<AVScountryCode>\" . gen_get_country_iso_2_from_3($order->bill_country_code) . \"</AVScountryCode>\n\t\t\t\t<AVSDestzip>\" . preg_replace(\"/[^A-Za-z0-9]/\", \"\", $order->ship_postal_code) . \"</AVSDestzip>\n\t\t\t\t<AVSDestaddress1>\" . $order->ship_address1 . \"</AVSDestaddress1>\"\n\t\t\t\t . ( $order->ship_address2 ? '\n\t\t\t\t<AVSDestaddress2>' . $order->ship_address2 . '</AVSDestaddress2>' : '' ) . \"\n\t\t\t\t<AVSDestcity>\" . $order->ship_city_town . \"</AVSDestcity>\n\t\t\t\t<AVSDeststate>\" . $order->ship_state_province . \"</AVSDeststate>\n\t\t\t\t<AVSDestphoneNum>\" . $order->ship_telephone . \"</AVSDestphoneNum>\n\t\t\t\t<AVSDestname>\" . $order->ship_primary_name . \"</AVSDestname>\n\t\t\t\t<AVSDestcountryCode>\" . gen_get_country_iso_2_from_3($order->ship_country_code) . \"</AVSDestcountryCode>\n\t\t\t\t<OrderID>\" . $order->purchase_invoice_id . \"</OrderID>\n\t\t\t\t<Amount>\" . ($order->total_amount * pow(10, $currencies->currencies[DEFAULT_CURRENCY]['decimal_places'])) . \"</Amount>\n\t\t\t</NewOrder>\n\t\t</Request>\n\t\";\n\n\t$header = \"POST /AUTHORIZE HTTP/1.0\\r\\n\"; //HTTP/1.1 should work fine also\n\t$header .= \"MIME-Version: 1.0\\r\\n\";\n\t$header .= \"Content-type: application/PTI41\\r\\n\";\n\t$header .= \"Content-length: \" . strlen($post_string) . \"\\r\\n\";\n\t$header .= \"Content-transfer-encoding: text\\r\\n\";\n\t$header .= \"Request-number: 1\\r\\n\";\n\t$header .= \"Document-type: Request\\r\\n\";\n\t$header .= \"Merchant-id: \" . $MerchantID . \"\\r\\n\\r\\n\";\n//\t$header .= \"Connection: close \\r\\n\\r\\n\"; //Must have two CR/LF's here\n\t$header .= $post_string;\n\n // SEND DATA BY CURL SECTION\n // Post order info data to Paymentech gateway, make sure you have cURL support installed\n\n if (MODULE_PAYMENT_PAYMENTECH_TESTMODE == 'Test') {\n\t\t$url = MODULE_PAYMENT_PAYMENTECH_TEST_URL_PRIMARY;\n\t} else {\n\t\t$url = MODULE_PAYMENT_PAYMENTECH_PRODUCTION_URL_PRIMARY;\n\t}\n\n//echo 'transmit xml = '; echo htmlspecialchars($header); echo '<br><br>';\n\n\t$GetPost = 'POST';\n $ch = curl_init();\n\n curl_setopt($ch, CURLOPT_URL, $url);\n\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\tcurl_setopt($ch, CURLOPT_TIMEOUT, 20);\n\tcurl_setopt($ch, CURLOPT_HEADER, false); // You are providing a header manually so turn off auto header generation\n curl_setopt($ch, CURLOPT_VERBOSE, false);\n\n\n//*\n\tcurl_setopt($ch, CURLOPT_CUSTOMREQUEST, $header); // The following two options are necessary to properly set up SSL\n\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, true);\n//*/\n\n/*\n\tcurl_setopt($ch, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']);\n\tcurl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);\n\tif ($GetPost == 'POST') {\n\t curl_setopt($ch, CURLOPT_POST, 1);\n\t curl_setopt($ch, CURLOPT_POSTFIELDS, $header);\n }\n*/\n\n if (CURL_PROXY_REQUIRED == 'True') {\n curl_setopt ($ch, CURLOPT_HTTPPROXYTUNNEL, true);\n curl_setopt ($ch, CURLOPT_PROXYTYPE, CURLPROXY_HTTP);\n curl_setopt ($ch, CURLOPT_PROXY, CURL_PROXY_SERVER_DETAILS);\n }\n\n\t$authorize = curl_exec($ch); \n\t// Check for curl errors\n\t$curlerrornum = curl_errno($ch);\n\t$curlerror = curl_error($ch);\n\tcurl_close ($ch);\n\tif ($curlerrornum) { \n\t\t$messageStack->add('XML Read Error (cURL) #' . $curlerrornum . '. Description = ' . $curlerror,'error');\n\t\treturn true;\n\t}\n\n//echo 'response xml = ' . htmlspecialchars($authorize) . '<br><br>';\n\n\t// since the response is only one level deep, we can do a simple parse\n\t$authorize = trim($authorize);\n\t$authorize = substr($authorize, strpos($authorize, '<NewOrderResp>') + 14); // remove up to and including the container tag\n\t$authorize = substr($authorize, 0, strpos($authorize, '</NewOrderResp>')); // remove from end container tag on\n\t$results = array();\n\t$runaway_loop_counter = 0;\n\twhile ($authorize) {\n\t\t$key = substr($authorize, strpos($authorize, '<') + 1, strpos($authorize, '>') - 1);\n\t\t$authorize = substr($authorize, strpos($authorize, '>') + 1); // remove start tag\n\t\t$value = substr($authorize, 0, strpos($authorize, '<')); // until start of end tag\n\t\t$authorize = substr($authorize, strpos($authorize, '>') + 1); // remove end tag\n\t\t$results[$key] = $value;\n\t\tif ($runaway_loop_counter++ > 1000) break;\n\t}\n\n//echo 'RespCode = ' . $results['RespCode'] . '<br>';\n//echo 'AVSRespCode = ' . $results['AVSRespCode'] . '<br>';\n//echo 'CVV2RespCode = ' . $results['CVV2RespCode'] . '<br>';\n//echo 'TxRefNum = ' . $results['TxRefNum'] . '<br><br>';\n\n\tif ($results['ProcStatus'] == 0) { //initial gateway test passed\n\t\tif ($results['ApprovalStatus'] == 1) { //Gateway returned approved\n\t\t\t$this->auth_code = $results['AuthCode'];\n\t\t\t$this->transaction_id = $results['TxRefNum'];\n\t\t $messageStack->add($results['StatusMsg'] . ' - Approval code: ' . $this->auth_code . ' --> CVV2 results: ' . $this->CVV2RespCode[$results['CVV2RespCode']], 'success');\n\t\t $messageStack->add('Address verification results: ' . $this->AVSRespCode[$results['AVSRespCode']], 'success');\n/* DELETE ME */ return true; // force a fail to not post\n\t\t return false;\n\t\t} else {\n\t\t\t\n\t\t\t$messageStack->add(sprintf(MODULE_PAYMENT_PAYMENTECH_TEXT_DECLINED_MESSAGE, $results['StatusMsg']), 'error');\n\t\t\treturn true;\n\t\t}\n\t}\n\t//gateway test failed\n\t$messageStack->add(MODULE_PAYMENT_PAYMENTECH_TEXT_GATEWAY_ERROR, 'error');\n\treturn true;\n }",
"function dispatch_licenses(){\n\t\n//1get all unfinished orders which are paid\n//2fetch all available licences\n\n//if 1 > 0 \n\t//loop for (unfinished orders)\n \t\t//compare ordered product id with available licences\n\t\t//if available\n\t\t\t//fetch email of buyer + send email + add buyer to database\n\t\t//else \n\t\t\t//mail not available to admin\n\t//loop end\n\t\n}",
"public function reprocessOrders()\n {\n if (\n !$this->configuration->getEnableDeclineReprocessing() ||\n CrmPayload::get('meta.isSplitOrder') === true ||\n Request::attributes()->get('action') === 'prospect'\n ) {\n return;\n }\n \n $response = CrmResponse::all();\n \n if(!empty($response['success'])) {\n return;\n }\n \n if(\n \tpreg_match(\"/Prepaid.+Not Accepted/i\", $response['errors']['crmError']) &&\n \t!empty($response['errors']['crmError'])\n \t) {\n \treturn;\n \t}\n\n $cbCampaignId = $this->configuration->getDeclineReprocessingCampaign();\n $campaignInfo = Campaign::find($cbCampaignId);\n $products = array();\n if(!empty($campaignInfo['product_array']))\n { \n foreach ($campaignInfo['product_array'] as $childProduct) {\n unset($campaignInfo['product_array']);\n array_push($products, array_merge($campaignInfo, $childProduct));\n }\n }\n CrmPayload::set('products', $products);\n CrmPayload::set('campaignId', $campaignInfo['campaignId']);\n \n $crmInfo = $this->configuration->getCrm();\n $crmType = $crmInfo['crm_type'];\n $crmClass = sprintf(\n '\\Application\\Model\\%s', $crmType\n );\n\n $crmInstance = new $crmClass($this->configuration->getCrmId());\n call_user_func_array(array($crmInstance, CrmPayload::get('meta.crmMethod')), array());\n \n }",
"protected function computeIncompleteHandlingOrders(){\r\n\t \t$incompleteOrders = $this->_orderInstance->getIncompleteHandlingOrders();\r\n\t \t//divide incomplete orders into 4 divisions and amazon orders.\r\n\t \t\r\n\t \t$amazonOrders = array();\r\n\t \t$ommitedOrders = array();\r\n\t \t$arrangedOrders = array();\r\n\t \t//$stockLockedOrders = array();\r\n\t \t$needComputingOrders = array();\r\n\t \t$readyOrders = array();\r\n\t \t$stockLockedItems = array();\r\n\t\r\n\t \tforeach ($incompleteOrders as $k=>$v){\r\n\t \t\t$v->lack_qty = 0;\r\n\t \t\tif($v->status_handling == '3'){\r\n\t \t\t\t//amazon stock.\r\n\t \t\t\t$amazonOrders[$k] = $v;\r\n\t \t\t\t$orderItems = $this->_orderInstance->getOrderItemsDetailByOid($v->oid);\r\n\t \t\t\tif($orderItems == false) $orderItems = array();\r\n\t \t\t\t$v->items = $orderItems;\r\n\t \t\t}else if($v->status_handling == '-1'){\r\n\t \t\t\t//回收站\r\n\t \t\t\t$ommitedOrders[$k] = $v;\r\n\t \t\t\t$orderItems = $this->_orderInstance->getOrderItemsWithStockInfo($v->oid);\r\n\t \t\t\tif($orderItems == false) $orderItems = array();\r\n\t \t\t\t$v->items = $orderItems;\r\n\t \t\t}else if($v->status_handling == '2'){\r\n\t \t\t\t//缺货\r\n\t \t\t\tif($v->status_locking == '1'){\r\n\t \t\t\t\t//已锁定(已安排)\r\n\t\t \t\t\t//this order was locked. Need except from stock.\r\n\t\t \t\t\t//get order items.\r\n \t \t\t\t$orderItems = $this->_orderInstance->getOrderItemsWithStockInfo($v->oid);\r\n \t\t \t\t$v->items = $orderItems;\r\n \t\t \t\tforeach($orderItems as $k2=>$v2){\r\n \t\t \t\t\tif(key_exists($v2->p_sn, $stockLockedItems)){\r\n \t\t \t\t\t\tif(key_exists($v2->avid, $stockLockedItems[$v2->p_sn])){\r\n \t\t \t\t\t\t\t$curStockItemQty = $stockLockedItems[$v2->p_sn][$v2->avid];\r\n \t\t \t\t\t\t\tif($v2->stock_qty < $curStockItemQty){\r\n \t\t \t\t\t\t\t\t//recount the stock qty.\r\n \t\t \t\t\t\t\t\t$v2->current_qty = 0;\r\n \t\t \t\t\t\t\t\t//$make the stock locked items as the stock qty.\r\n \t\t \t\t\t\t\t\t$stockLockedItems[$v2->p_sn][$v2->avid] = $v2->stock_qty;\r\n \t\t \t\t\t\t\t}else if($v2->stock_qty < $curStockItemQty + $v2->current_qty){\r\n \t\t \t\t\t\t\t\t$v2->current_qty = $v2->stock_qty - $curStockItemQty;\r\n \t\t \t\t\t\t\t\t$stockLockedItems[$v2->p_sn][$v2->avid] = $v2->stock_qty;\r\n \t\t \t\t\t\t\t}else{\r\n \t\t \t\t\t\t\t\t//库存充足\r\n \t\t \t\t\t\t\t\t$stockLockedItems[$v2->p_sn][$v2->avid] += intval($v2->current_qty);\r\n \t\t \t\t\t\t\t}\r\n \t\t \t\t\t\t}else{\r\n \t\t \t\t\t\t\tif($v2->stock_qty < $v2->current_qty){\r\n \t\t \t\t\t\t\t\t$v2->current_qty = $v2->stock_qty;\r\n \t\t \t\t\t\t\t}\r\n \t\t \t\t\t\t\t$stockLockedItems[$v2->p_sn][$v2->avid] = intval($v2->current_qty);\r\n \t\t \t\t\t\t}\r\n \t\t \t\t\t}else{\r\n \t\t \t\t\t\tif($v2->stock_qty < $v2->current_qty){\r\n \t\t \t\t\t\t\t\t$v2->current_qty = $v2->stock_qty;\r\n \t\t \t\t\t\t}\r\n \t\t \t\t\t\t$stockLockedItems[$v2->p_sn] = array($v2->avid=>intval($v2->current_qty));\r\n \t\t \t\t\t}\r\n \t\t \t\t\t$v->lack_qty += intval($v2->qty - $v2->current_qty);\r\n \t\t \t\t}\r\n\t \t\t\t \tif($v->export_decision == '0'){\r\n\t\t \t\t\t\t$arrangedOrders[$k] = $v;\r\n\t \t\t\t\t}else{\r\n\t \t\t\t\t\t$readyOrders[$k] = $v;\r\n\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$needComputingOrders[$k] = $v;\r\n\t \t\t\t}\r\n\t \t\t}else if($v->status_handling == '1'){\r\n\t \t\t\t//不缺货\r\n\t \t\t\t//if($v->status_locking == '1'){\r\n\t \t\t\t\t//this item was locked. Need except from stock.\r\n\t\t \t\t\t$orderItems = $this->_orderInstance->getOrderItemsWithStockInfo($v->oid);\r\n\t\t \t\t\tif($orderItems == false) $orderItems = array();\r\n\t\t \t\t\t$v->items = $orderItems;\r\n\t\t \t\t\tforeach($orderItems as $k2=>$v2){\r\n\t\t \t\t\t\tif(key_exists($v2->p_sn, $stockLockedItems)){\r\n\r\n\t\t \t\t\t\t\tif(key_exists($v2->avid, $stockLockedItems[$v2->p_sn])){\r\n\t\t \t\t\t\t\t\t$curStockItemQty = $stockLockedItems[$v2->p_sn][$v2->avid];\r\n\t\t \t\t\t\t\t\tif($v2->stock_qty < $curStockItemQty){\r\n\t\t \t\t\t\t\t\t\t//recount the stock qty.\r\n\t\t \t\t\t\t\t\t\t$v2->current_qty = 0;\r\n\t\t \t\t\t\t\t\t\t//$make the stock locked items as the stock qty.\r\n\t\t \t\t\t\t\t\t\t$stockLockedItems[$v2->p_sn][$v2->avid] = $v2->stock_qty;\r\n\t\t \t\t\t\t\t\t}else if($v2->stock_qty < $curStockItemQty + $v2->current_qty){\r\n\t\t \t\t\t\t\t\t\t$v2->current_qty = $v2->stock_qty - $curStockItemQty;\r\n\t\t \t\t\t\t\t\t\t$stockLockedItems[$v2->p_sn][$v2->avid] = $v2->stock_qty;\r\n\t\t \t\t\t\t\t\t}else{\r\n\t\t \t\t\t\t\t\t\t//库存充足\r\n\t\t \t\t\t\t\t\t\t$stockLockedItems[$v2->p_sn][$v2->avid] += intval($v2->current_qty);\r\n\t\t \t\t\t\t\t\t}\r\n\t\t \t\t\t\t\t}else{\r\n\t\t \t\t\t\t\t\tif($v2->stock_qty < $v2->current_qty){\r\n\t\t \t\t\t\t\t\t\t$v2->current_qty = $v2->stock_qty;\r\n\t\t \t\t\t\t\t\t}\r\n\t\t \t\t\t\t\t\t$stockLockedItems[$v2->p_sn][$v2->avid] = intval($v2->current_qty);\r\n\t\t \t\t\t\t\t}\r\n\t\t \t\t\t\t}else{\r\n\t\t \t\t\t\t\tif($v2->stock_qty < $v2->current_qty){\r\n\t\t \t\t\t\t\t\t\t$v2->current_qty = $v2->stock_qty;\r\n\t\t \t\t\t\t\t}\r\n\t\t \t\t\t\t\t$stockLockedItems[$v2->p_sn] = array($v2->avid=>intval($v2->current_qty));\r\n\t\t \t\t\t\t}\r\n\t\t \t\t\t\t$v->lack_qty += intval($v2->qty - $v2->current_qty);\r\n\t\t \t\t\t}\r\n\t\t \t\t\t$readyOrders[$k] = $v;\r\n\t \t\t//}else{\r\n\t \t\t\t\t//$needComputingOrders[$k] = $v;\r\n\t \t\t\t//}\r\n\t \t\t}else{\r\n\t \t\t\t$needComputingOrders [$k] = $v;\r\n\t \t\t}\r\n\t \t\t//now we already get the 3 arrays\r\n\t \t}\r\n\t \t\r\n\t \t$this->_orderInstance->updateArrangedOrderItemsLackState($arrangedOrders, $readyOrders, $stockLockedItems);\r\n\t \t\r\n\t \t//now we need compute amazon store.\r\n\t \t//$this->computeAmazonOrders($amazonOrders, $needComputingOrders);\r\n\t \t\r\n\t \t//$this->view->assign('amazonOrders', $amazonOrders);\r\n\t \t\r\n\t \t$orders_pools = $this->_orderInstance->calculateOrderItemsLackState($needComputingOrders, $stockLockedItems);\r\n\t \t$this->sortArrangedOrders($arrangedOrders);\r\n\t \t$orders_pools['arrangedOrders'] = $arrangedOrders;\r\n\t \t$orders_pools['ommitedOrders'] = $ommitedOrders;\r\n\t \t\r\n\t \tforeach ($readyOrders as $oid=>$order){\r\n\t \t\t$orders_pools['readyExportOrders'][$oid] = $order;\r\n\t \t}\r\n\t \t\r\n\t \treturn array($orders_pools, $stockLockedItems);\r\n }",
"function recommends_req_wizard_verification($form, &$form_state) {\n \n $output_info = array(\n 'prefix' => $form_state['prefix'],\n 'firstname' => $form_state['firstname'],\n 'lastname' => $form_state['lastname'],\n 'initial' => $form_state['initial'],\n 'suffix' => $form_state['suffix'],\n 's_email' => $form_state['s_email'],\n 's_school' => $form_state['s_school'],\n 's_req_date' => $form_state['s_req_date'],\n 's_master_doc' => $form_state['s_master_doc'],\n 's_comments' => $form_state['s_comments'],\n \t);\n \t\n \t $email_values = array(\n 'email' => $form_state['s_email'],\n 'message' => \"\\n\" . \"\\n\" .\n \"Name Prefix: \" . $output_info['prefix'] . \"\\n\" .\n \"First Name: \" . $output_info['firstname'] . \"\\n\" .\n \"Initial: \" . $output_info['initial'] . \"\\n\" .\n \"Last Name: \" . $output_info['lastname'] . \"\\n\" .\n \"Name Suffix: \" . $output_info['suffix'] . \"\\n\" .\n \"Student Email: \" . $output_info['s_email'] . \"\\n\" .\n \"Statement of intent, Point of view : \" . \"\\n\" . $output_info['s_comments'] . \"\\n\"\n );\n \n for ($i = 1; $i <= $form_state['num_schools']; $i++) {\n\t\t\n\t\t$output_schools[$i] = array(\n \t'r_email'=> $form_state['s_email'],\n \t'num_schools'=> $form_state['num_schools'],\n \t'r_school'=> $form_state['schoolname'][$i],\n \t'r_program'=> $form_state['schoolprogram'][$i],\n \t'r_program'=> $form_state['schoolprogram'][$i],\n \t 'r_school_contact_email' => $form_state['r_school_contact_email'][$i],\n \t 'r_school_contact_postal' => $form_state['r_school_contact_postal'][$i],\n \t'r_school_contact'=> $form_state['r_school_contact_postal'][$i],\n \t'r_date_due_month' => $form_state['r_date_due'][$i]['month'],\n 'r_date_due_day' => $form_state['r_date_due'][$i]['day'],\n 'r_date_due_year' => $form_state['r_date_due'][$i]['year'],\n \t'r_status'=> \"Initial\",\n\t\t\n \t);\n }\n $email_values['message'] = $email_values['message'] .\n \"\\n\" . \"Schools to receive recommendation.\" . \"\\n\\n\";\n \n $school_values = array(array());\n \n for ($i = 1; $i <= $output_schools[1]['num_schools']; $i++) {\t\n \t\n \t$email_values['message'] = $email_values['message'] . $output_schools[$i]['r_school'] . \"\\n\" .\n \t\"School Program/Position: \" .\n \t\n \t$output_schools[$i]['r_program'] . \"\\n\" .\n \t\"School contact postal: \" .\n \t$output_schools[$i]['r_school_contact_postal'] . \"\\n\" . \n \t\"School contact email: \" .\n \t$output_schools[$i]['r_school_contact_email'] . \"\\n\" . \t\n \t\"Final Date required by school: \" . \n \t$output_schools[$i]['r_date_due_month'] . \"/\" . \n \t$output_schools[$i]['r_date_due_day'] . \"/\" . \n \t$output_schools[$i]['r_date_due_year'] . \"\\n\\n\";\n \n };\n \n for ($i = 1; $i <= $form_state['num_courses']; $i++) {\n\t\t\n\t\t$pid = $form_state['input']['crsname'][$i]['i_pid'];\n\t\t\n\t\t$output_courses[$i] = array(\n \t'c_email' => $form_state['s_email'],\n \t'num_courses' => $form_state['num_courses'],\n \t'c_course' => $form_state['coursenum'][$i],\n \t'c_semester' => $form_state['coursesemester'][$i],\n \t'c_year' => $form_state['courseyear'][$i],\n \t'c_other' => $form_state['courseother'][$i],\n \t);\n \t\n }\n \n $email_values['message'] = $email_values['message'] .\n \"\\n\" . \"Courses in which enrolled with the professor.\" . \"\\n\";\n \n $course_values = array(array());\n \n for ($i = 1; $i <= $output_courses[1]['num_courses']; $i++) {\t\n \t\n \t$email_values['message'] = $email_values['message'] . \n \t\"\\n\" . \"Course: \" .\n \t\n \t$output_courses[$i]['c_course'] . \" \" .\n \t\"Semester: \" . \n \t$output_courses[$i]['c_semester'] .\n \t\" Year: \" . \n \t$output_courses[$i]['c_year'] . \"\\n\\n\" . $output_courses[$i]['c_other'] ;\n \n }; \n \n \n $msg = \"Please review the following information that you entered. Press Finish to send the information or cancel to abort the operation\";\n drupal_set_message('<pre id=rqmsgsize>' . print_r($msg, TRUE) . print_r($email_values['message'], TRUE) . '</pre>');\n \n // We will have many fields with the same name, so we need to be able to\n // access the form hierarchically.\n $form['#tree'] = TRUE;\n\n $form['description'] = array(\n '#type' => 'item',\n );\n\n if (empty($form_state['num_courses'])) {\n $form_state['num_courses'] = 1;\n }\n\n \n\n // Adds \"Add another course\" button\n $form['add_course'] = array(\n '#type' => 'submit',\n '#value' => t('Cancel'),\n '#submit' => array('recommends_req_intro'),\n );\n\n\n return $form;\n}",
"public function actualize()\n {\n\n $orders = $this->gdaxService->getOpenOrders();\n if (count($orders)) {\n $this->msg[] = $this->timestamp . ' .... <info>actualize orders</info>';\n $this->orderService->fixUnknownOrdersFromGdax($orders);\n }\n }",
"private function ThanksForYourOrder()\n\t\t{\n\t\t\t// Reload all fo the information about the order as there's a good chance\n\t\t\t// a fair bit of it has changed now\n\t\t\t$this->SetOrderData();\n\n\t\t\t$GLOBALS['ISC_CLASS_CART'] = GetClass('ISC_CART');\n\t\t\t$GLOBALS['ISC_CLASS_CUSTOMER'] = GetClass('ISC_CUSTOMER');\n\n\t\t\t$GLOBALS['HideError'] = \"none\";\n\t\t\t$GLOBALS['HidePaidOrderConfirmation'] = '';\n\t\t\t$GLOBALS['HideAwaitingPayment'] = \"none\";\n\n\t\t\t$GLOBALS['HideStoreCreditUse'] = 'none';\n\n\t\t\tif($this->pendingData['storecreditamount'] > 0) {\n\t\t\t\t$GLOBALS['HideStoreCreditUse'] = '';\n\t\t\t\t$GLOBALS['StoreCreditUsed'] = CurrencyConvertFormatPrice($this->pendingData['storecreditamount']);\n\n\t\t\t\t$GLOBALS['StoreCreditBalance'] = CurrencyConvertFormatPrice($GLOBALS['ISC_CLASS_CUSTOMER']->GetCustomerStoreCredit($this->pendingData['customerid']));\n\t\t\t\t$GLOBALS['ISC_LANG']['OrderCreditDeducted'] = sprintf(GetLang('OrderCreditDeducted'), GetConfig('CurrencyToken') . $GLOBALS['StoreCreditUsed']);\n\t\t\t}\n\n\t\t\t// If it was an offline payment method, show the post-purchase message and hide other messages\n\t\t\tif(is_object($this->paymentProvider) && $this->paymentProvider->GetPaymentType() == PAYMENT_PROVIDER_OFFLINE && method_exists($this->paymentProvider, 'GetOfflinePaymentMessage')) {\n\t\t\t\t$defaultCurrency = GetDefaultCurrency();\n\t\t\t\t$GLOBALS['OrderTotal'] = FormatPrice($this->pendingData['gatewayamount'], false, true, false, $defaultCurrency, true);\n\n\t\t\t\t$GLOBALS['HidePaidOrderConfirmation'] = \"none\";\n\t\t\t\t$GLOBALS['PaymentMessage'] = $this->paymentProvider->GetOfflinePaymentMessage();\n\t\t\t\t$GLOBALS['SNIPPETS']['OfflinePaymentMessage'] = $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet(\"OfflinePaymentMessage\");\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// Was the order declined?\n\t\t\t\tif($this->pendingData['status'] == 6) {\n\t\t\t\t\t$GLOBALS['HideError'] = '';\n\t\t\t\t\t$GLOBALS['ErrorMessage'] = sprintf(GetLang('ErroOrderDeclined'), GetConfig('OrderEmail'), GetConfig('OrderEmail'));\n\t\t\t\t\t$GLOBALS['HidePaidOrderConfirmation'] = 'none';\n\t\t\t\t\t$GLOBALS['ISC_LANG']['ThanksForYourOrder'] = GetLang('YourPaymentWasDeclined');\n\t\t\t\t}\n\t\t\t\t// Order is still awaiting payment\n\t\t\t\telse if($this->pendingData['status'] == 7) {\n\t\t\t\t\t$GLOBALS['HidePaidOrderConfirmation'] = \"none\";\n\t\t\t\t\t$GLOBALS['HideAwaitingPayment'] = \"\";\n\t\t\t\t}\n\t\t\t\t// Otherwise, order was successful\n\t\t\t\telse {\n\t\t\t\t\t// Is it a physical or digital order?\n\t\t\t\t\tif($this->pendingData['isdigital'] == 100) {\n\n\t\t\t\t\t\t// If this order has no customer ID associated with it (guest checkout with no account creation) then display an alternative text with no download link\n\t\t\t\t\t\tif (!isId($this->pendingData['customerid'])) {\n\t\t\t\t\t\t\t$GLOBALS['DigitalOrderConfirmation'] = GetLang('DigitalOrderConfirmationGuestCheckout');\n\t\t\t\t\t\t\t$GLOBALS['HideDigitalOrderDownloadLink'] = 'none';\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// Otherwise display nthe normal text with the download link in it\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t$GLOBALS['DigitalOrderConfirmation'] = GetLang('DigitalOrderConfirmation');\n\t\t\t\t\t\t\t$GLOBALS['HideDigitalOrderDownloadLink'] = '';\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$GLOBALS['HidePhysicalOrderConfirmation'] = \"none\";\n\t\t\t\t\t\t$GLOBALS['HidePhysicalViewOrderLink'] = \"none\";\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\n\t\t\t\t\t\t// If this order has no customer ID associated with it (guest checkout with no account creation) then display an alternative text with no view order link\n\t\t\t\t\t\tif (!isId($this->pendingData['customerid'])) {\n\t\t\t\t\t\t\t$GLOBALS['PhysicalOrderConfirmation'] = GetLang('PhysicalOrderConfirmationGuestCheckout');\n\t\t\t\t\t\t\t$GLOBALS['HidePhysicalViewOrderLink'] = 'none';\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// Otherwise display nthe normal text with the download link in it\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t$GLOBALS['PhysicalOrderConfirmation'] = GetLang('PhysicalOrderConfirmation');\n\t\t\t\t\t\t\t$GLOBALS['HidePhysicalViewOrderLink'] = '';\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$GLOBALS['HideDigitalOrderConfirmation'] = \"none\";\n\t\t\t\t\t\t$GLOBALS['HideDigitalOrderDownloadLink'] = \"none\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$this->CreateCupons();\n\t\t\t\n\t\t\t// Include the conversion code for each analytics module\n\t\t\t$GLOBALS['ConversionCode'] = '';\n\t\t\t$analyticsModules = GetAvailableModules('analytics', true, true);\n\t\t\tforeach($analyticsModules as $module) {\n\t\t\t\t$module['object']->SetOrderData($this->pendingData);\n\t\t\t\t$trackingCode = $module['object']->GetConversionCode();\n\t\t\t\tif($trackingCode != '') {\n\t\t\t\t\t$GLOBALS['ConversionCode'] .= \"\n\t\t\t\t\t\t<!-- Start conversion code for \".$module['id'].\" -->\n\t\t\t\t\t\t\".$trackingCode.\"\n\t\t\t\t\t\t<!-- End conversion code for \".$module['id'].\" -->\n\t\t\t\t\t\";\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Include the conversion tracking code for affiliates\n\t\t\tforeach($this->pendingData['orders'] as $order) {\n\t\t\t\tif(strlen(GetConfig('AffiliateConversionTrackingCode')) > 0) {\n\t\t\t\t\t$converted_code = GetConfig('AffiliateConversionTrackingCode');\n\t\t\t\t\t$subTotalColumn = 'subtotal_ex_tax';\n\t\t\t\t\t$totalColumn = 'total_inc_tax';\n\t\t\t\t\tif(getConfig('taxDefaultTaxDisplayOrders') == TAX_PRICES_DISPLAY_INCLUSIVE) {\n\t\t\t\t\t\t$subTotalColumn = 'subtotal_inc_tax';\n\t\t\t\t\t}\n\n\t\t\t\t\t$discountedSubTotal = $_SESSION['LAST_ORDER_DISCOUNTED_SUBTOTAL'];\n\t\t\t\t\tunset($_SESSION['LAST_ORDER_DISCOUNTED_SUBTOTAL']);\n\n\t\t\t\t\t$replacements = array(\n\t\t\t\t\t\t'%%ORDER_SUBTOTAL%%' => $order[$subTotalColumn] / 1,\n\t\t\t\t\t\t'%%ORDER_SUBTOTAL_IN_CENTS%%' => ($order[$subTotalColumn] / 1) * 100,\n\t\t\t\t\t\t'%%ORDER_SUBTOTAL_DISCOUNTED%%' => $discountedSubTotal / 1,\n\t\t\t\t\t\t'%%ORDER_SUBTOTAL_DISCOUNTED_IN_CENTS%%' => ($discountedSubTotal / 1) * 100,\n\t\t\t\t\t\t'%%ORDER_AMOUNT%%' => $order['total_inc_tax'] / 1,\n\t\t\t\t\t\t'%%ORDER_AMOUNT_IN_CENTS%%' => ($order['total_inc_tax'] / 1) * 100,\n\t\t\t\t\t\t'%%ORDER_ID%%' => $order['orderid'],\n\t\t\t\t\t);\n\t\t\t\t\t$converted_code = str_ireplace(array_keys($replacements), $replacements, $converted_code);\n\t\t\t\t\t$GLOBALS['ConversionCode'] .= $converted_code;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// leave this in for outdated templates: hide the product updates div\n\t\t\t$GLOBALS['HideProductUpdates'] = \"none\";\n\n\t\t\tif(method_exists($this->paymentProvider, 'ShowOrderConfirmation')) {\n\t\t\t\t$GLOBALS['OrderConfirmationDetails'] = $this->paymentProvider->ShowOrderConfirmation($this->pendingData);\n\t\t\t}\n\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t// Show the order confirmation screen\n\t\t\t$GLOBALS['ISC_CLASS_TEMPLATE']->SetPageTitle(GetLang('ThanksForYourOrder'));\n\t\t\t$GLOBALS['ISC_CLASS_TEMPLATE']->SetTemplate(\"order\");\n\t\t\t$GLOBALS['ISC_CLASS_TEMPLATE']->ParseTemplate();\n\t\t}",
"function _postPayment($data) {\r\n\t\t// Process the payment\r\n\t\t$app = JFactory::getApplication ();\r\n\t\t$vars = new JObject ();\r\n\t\t$html = '';\r\n\t\t$order_id = $_POST[\"order_id\"];\r\n\t\t\r\n\t\t/* APC Code */\r\nif ($_POST[\"order_id\"] != \"\"){\r\n// Payment confirmation from http post \r\nini_set(\"SMTP\",\"mail.nochex.com\" ); \r\n$header = \"From: [email protected]\";\r\n\r\n$your_email = $_POST[\"from_email\"]; // your merchant account email address\r\n \r\n// uncomment below to force a DECLINED response \r\n//$_POST['order_id'] = \"1\"; \r\n\r\n$url = \"https://secure.nochex.com/apc/apc.aspx\";\r\n$postvars = http_build_query($_POST);\r\n\r\n$ch = curl_init ();\r\ncurl_setopt ($ch, CURLOPT_URL, $url);\r\ncurl_setopt ($ch, CURLOPT_POST, true); \r\ncurl_setopt ($ch, CURLOPT_POSTFIELDS, $postvars);\r\ncurl_setopt ($ch, CURLOPT_RETURNTRANSFER, true);\r\ncurl_setopt ($ch, CURLOPT_TIMEOUT, 60);\r\n//curl_setopt ($ch, CURLOPT_SSLVERSION, 0);\r\ncurl_setopt ($ch, CURLOPT_SSL_VERIFYHOST, false);\r\ncurl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, 0);\r\n$response = curl_exec ($ch);\r\ncurl_close ($ch);\r\n\r\n// stores the response from the Nochex server \r\n$debug = \"IP -> \" . $_SERVER['REMOTE_ADDR'] .\"\\r\\n\\r\\nPOST DATA:\\r\\n\"; \r\nforeach($_POST as $Index => $Value) \r\n$debug .= \"$Index -> $Value\\r\\n\"; \r\n$debug .= \"\\r\\nRESPONSE:\\r\\n$response\";\r\n// Retrieves the order_id and save it as a variable which can be used in the update query to find a particular record in a database or datatable.\t\r\n\t $order_ID = $_POST['order_id']; \r\n// An email to check the order_ID\r\n\t$order = F0FTable::getInstance ( 'Order', 'J2StoreTable' )->getClone ();\r\n\t\tif ($order->load ( array (\r\n\t\t\t\t'order_id' => $order_id\r\n\t\t) )) {\r\n\t\t\r\n\t$order->transaction_id = $_POST[\"transaction_id\"];\r\n\t$order->transaction_status = $response;\r\n\t\t\t\t\t\r\nif (!strstr($response, \"AUTHORISED\")) { // searches response to see if AUTHORISED is present if it isnt a failure message is displayed\r\n $msg = \"APC was not AUTHORISED.\\r\\n\\r\\n$debug\"; // displays debug message\t\r\n\t\r\n\t$order->transaction_details = $msg . \", and this was a \" . $_POST[\"status\"] . \" transaction\";\r\n\t$order_state_id = $this->params->get ( 'payment_status', 4 );\r\n\t$order->update_status ( $order_state_id, true );\t\t\r\n\t\r\n} else { \r\n\t$msg = \"APC was AUTHORISED\";\r\n\r\n\t$order->transaction_details = $msg . \", and this was a \" . $_POST[\"status\"] . \" transaction\";\r\n\t\r\n\t$order_state_id = $this->params->get ( 'payment_status', 4 );\r\n\t$order->update_status ( $order_state_id, true );\t\t\r\n\t\r\n\t$order->reduce_order_stock();\r\n\t$order->payment_complete();\r\n\t$order->empty_cart();\r\n\t}\r\n}\r\n}else{\r\n\r\n$html = \"<div style=\\\"padding:20px;box-shadow:1px 1px 1px #666;border:1px solid #666;margin:20px;\\\"><i class=\\\"icon-star\\\" style=\\\"color:gold;float:right\\\"></i><h3>Congratulation's</h3><p>Your order: \" . $data['order_id'] . \" has been successful</p></div>\";\r\n\r\nreturn $html;\r\n\t \r\n\t}\r\n}",
"function submitOrder() {\n\techo \"Submitting Order </br>\";\n\t$data = createOrder();\n\t$response = postRequest('/api/order', $data);\n\tprintInfo($response);\n}",
"function showForm()\n{# shows form so user can enter their name. Initial scenario\n global $config;\n\tget_header(); #defaults to header_inc.php\t\n\t\n\techo \n\t'<script type=\"text/javascript\" src=\"' . VIRTUAL_PATH . 'include/util.js\"></script>\n\t<script type=\"text/javascript\">\n\t\tfunction checkForm(thisForm)\n\t\t{//check form data for valid info\n\t\t\tif(empty(thisForm.YourName,\"Please enter the quantity you would like to order\")){return false;}\n\t\t\treturn true;//if all is passed, submit!\n\t\t}\n\t</script>\n\t<h3 align=\"center\">' . smartTitle() . '</h3>\n\t<p align=\"center\">Please enter the quantity you would like to order</p> \n\t<form action=\"' . THIS_PAGE . '\" method=\"post\" onsubmit=\"return checkForm(this);\">\n\t\t<table align=\"center\">\n\t\t\t<tr>\n\t\t\t\t\n\t\t\t\t<td>\n ';\n /*\n ' . XXX . '\n */\n \n \n $checkCount = 1;\n \n foreach($config->items as $item)\n {\n //initialize checkboxes \n $cbox1 = \"cbox1\" . strval($checkCount);\n $cbox2 = \"cbox2\" . strval($checkCount);\n $cbox3 = \"cbox3\" . strval($checkCount);\n echo '<p>' . $item->Name . ' Description: ' . $item->Description . '</p><p>Price : $' . $item->Price . ' Extra Toppings ( $0.50 extra each): \n <label><input type=\"checkbox\" name=\"' . $cbox1 . '\" value=\"mushroom\"> Mushroom</label>\n <label><input type=\"checkbox\" name=\"' . $cbox2 . '\" value=\"peppers\"> Peppers</label>\n <label><input type=\"checkbox\" name=\"' . $cbox3 . '\" value=\"avocado\"> Avocado</label></p>\n <p>Quantity: <input type=\"text\" name=\"item_' . $item->ID . '\"/></p>';\n \n //adds count to checkboxes to verify which checkbox is checked\n $checkCount = $checkCount + 1;\n\n \n }\n echo ' \n <!--\n\t\t\t\t\t<input type=\"text\" name=\"YourName\" /><font color=\"red\"><b>*</b></font> <em>(alphabetic only)</em>\n -->\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td align=\"center\" colspan=\"2\">\n\t\t\t\t\t<input type=\"submit\" value=\"Submit Your Order\">\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t</table>\n\t\t<input type=\"hidden\" name=\"act\" value=\"display\" />\n\t</form>\n\t';\n\tget_footer(); #defaults to footer_inc.php\n}",
"function submit_library_order() {\n\t\n\t$current_user = wp_get_current_user();\n\t\n\t$mailing_address = $current_user->school\n\t\t\t\t. \"<br>\"\n\t\t\t\t. $current_user->address_type\n\t\t\t\t. \"<br>\"\n\t\t\t\t. $current_user->addr1\n\t\t\t\t. \" \"\n\t\t\t\t. $current_user->addr2\n\t\t\t\t. \"<br>\" \n\t\t\t\t. $current_user->city\n\t\t\t\t. \", \"\n\t\t\t\t. $current_user->thestate\n\t\t\t\t. \" \"\n\t\t\t\t. $current_user->zip;\n\t\n\t$contact_info = $current_user->user_email\n\t\t\t\t. \"<br>\"\n\t\t\t\t. $current_user->phone1;\n\t\t\t\t\n\t// Send email notification\n\t$content = \"<h2>Library Order Details</h2><p><strong>Library User:</strong><br>\" \n\t\t\t\t. $current_user->user_firstname \n\t\t\t\t. \" \" \n\t\t\t\t. $current_user->user_lastname\n\t\t\t\t. \"<br>\"\n\t\t\t\t. $current_user->county\n\t\t\t\t. \"<br><br>\" \n\t\t\t\t. \"<strong>Mailing Address:</strong><br>\"\n\t\t\t\t. $mailing_address\n\t\t\t\t. \"<br><br>\"\n\t\t\t\t. \"<strong>Contact Information:</strong><br>\"\n\t\t\t\t. $contact_info\t\n\t\t\t\t. \"</p>\"\t\t\t\t\t\t\n\t\t\t\t. \"<table border='0' cellpadding='10' style='border: 1px solid #ccc;'>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td><strong>Resource Name</strong></td>\n\t\t\t\t\t\t<td><strong>Branch</strong></td>\n\t\t\t\t\t\t<td><strong>Quantity</strong></td>\n\t\t\t\t\t\t<td><strong>Arrival</strong></td>\n\t\t\t\t\t\t<td><strong>Return</strong></td>\n\t\t\t\t\t\t<td><strong>Link</strong></td>\n\t\t\t\t\t</tr>\";\n\t\n\t$headers = array( 'Content-Type: text/html; charset=UTF-8', 'From: Oregon Agriculture in the Classroom <[email protected]>', 'Reply-To: Oregon Agriculture in the Classroom <[email protected]>');\n\t\n\t$order = array();\n\t\n\t// Run through order\n\tforeach( $_SESSION['cart'] as $id=>$value ) {\n\t\t\n\t\t$resource = get_field_object( 'resource_name', $id );\n\t\n\t\t$name = $resource['value'];\n\t\n\t\t$branch = $value['branch'];\n\t\n\t\t$link = get_permalink($id);\t\n\t\n\t\t$arrival_date = $_POST[$id];\n\t\n\t\t$return_date = $_POST['return-date-picker-' . $id];\t\t\n\t\t\n\t\t// Update quantity available and checkout total\n\t\t\n\t\tif ( ! get_field('unlimited_quantity', $id) ) {\n\t\t\t\n\t\t\t$available = get_field_object( 'total_available', $id );\n\t\t\t\n\t\t}\n\t\t\t\n\t\t$total = get_field_object( 'checked_out_total', $id );\n\t\n\t\t$types = get_the_terms( $id, 'resource_type' );\n\t\n\t\t$quantity = 1;\n\t\t\n\t\tforeach( $types as $type ) {\n\n\t\t\t$t = $total['value'] + $_POST['q'.$id];\n\t\t\t\n\t\t\t$quantity = $_POST['q'.$id];\n\t\t\t\n\t\t\t$a = $available['value'] - $quantity;\t\t\n\t\t}\n\t\t\n\t\t$usertotal = get_user_meta( $current_user->ID, 'total_library_checkouts' ); \n\t\t\n\t\t$ut = (int) $usertotal + 1;\n\t\t\n\t\tupdate_field( 'total_available', $a, $id );\n\t\t\n\t\tupdate_field( 'checked_out_total', $t, $id );\n\t\t\n\t\t// Update user checkout total\n\t\tupdate_user_meta( $current_user->ID, 'total_library_checkouts', $ut );\n\t\t\n\t\t// Add to content string\n\t\t$content .= \"<tr><td>$name</td><td>$branch</td><td>$quantity</td><td>$arrival_date</td><td>$return_date</td><td><a href='$link' target='_blank'>Resource Link</a></td></tr>\";\n\t\t\n\t\t$item = array (\n\t\t\t'url' => $link,\n\t\t\t'target' => '_blank',\n\t\t\t'title' => $name\t\n\t\t);\n\t\t\n\t\t// Add to order array\n\t\t$order[] = array (\n\t\t\t'item' => $item,\n\t\t\t'branch' => $branch,\n\t\t\t'quantity' => $quantity,\n\t\t\t'arrival' => $arrival_date,\n\t\t\t'return' => $return_date,\n\t\t);\n\t\t\n\t}\n\t\n\t$content .= \"</table>\";\n\t\n\t// Check if there is a comment\n\tif ( isset( $_POST['comment'] ) ) {\n\t\t\n\t\t$comment = $_POST['comment'];\n\t\t\n\t\t$content .= '<p><strong>Comments</strong><br>' . $comment . '</p>';\n\t\t\t\n\t} \n\t\n\t$content .= '<p><strong>Students Reached: </strong>' . $_POST['students'] . '</p>';\n\t\n\t// Create new Order post\t\t\n\t$post_data = array(\n\t\t'post_type' => 'resource_order',\n\t\t'post_status' => 'publish',\n\t\t'post_author' => 1,\n\t\t'post_title' => 'temp',\n\t);\n\t\n\t// Insert the post into Wordpress\n \t$post_id = wp_insert_post( $post_data, true );\n \t\n\tif ( $post_id ) {\t\t\n\t\t\n\t\t$title = 'Order #' . $post_id;\n\t\t\n\t\t$post = array(\n\t\t\t'ID' => $post_id,\n\t\t\t'post_title' => $title,\t\n\t\t);\n\t\t\n\t\twp_update_post( $post );\n\t\t\n\t\tforeach( $order as $o ) {\n\t\t\t\n\t\t\t// Add row to repeater field\n\t\t\tadd_row( 'order', $o, $post_id );\n\t\t\n\t\t}\n\t\t\n\t\tupdate_field( 'user', $current_user, $post_id );\n\t\t\n\t\tupdate_field( 'order_number', $post_id, $post_id );\n\t\t\n\t\tupdate_field( 'order_name', $current_user->user_firstname . ' ' . $current_user->user_lastname, $post_id );\n\t\t\n\t\tupdate_field( 'order_email', $current_user->user_email, $post_id );\n\t\n\t\tupdate_field( 'mailing_address', $mailing_address, $post_id );\n\t\n\t\tupdate_field( 'contact_information', $contact_info, $post_id );\n\t\t\n\t\tupdate_field( 'students_reached', $_POST['students'], $post_id );\n\t\t\n\t\tif ( $comment ) {\n\t\t\t\n\t\t\tupdate_field( 'comment', $comment, $post_id );\n\t\t\n\t\t}\n\t\n\t} \n\t\n\t// Send notification\n\twp_mail( get_field('library_order_email', 'options'), 'Library Hold Placed - #' . $post_id, $content, $headers );\n\t\n\twp_mail( $current_user->user_email, 'Library Order Confirmation - #' . $post_id, $content, $headers );\n\t\n\tunset( $_SESSION['cart'] );\n\t\n}",
"public function execute()\r\n\t{\r\n\t\t\t\t\r\n\t\t$src = $this->request->getParam('src');\r\n\t\t$prc = $this->request->getParam('prc');\r\n\t\t$ord = $this->request->getParam('Ord');\r\n\t\t$holder = $this->request->getParam('Holder');\r\n\t\t$successCode = $this->request->getParam('successcode');\r\n\t\t$ref = $this->request->getParam('Ref');\r\n\t\t$payRef = $this->request->getParam('PayRef');\r\n\t\t$amt = $this->request->getParam('Amt');\r\n\t\t$cur = $this->request->getParam('Cur');\r\n\t\t$remark = $this->request->getParam('remark');\r\n\t\t$authId = $this->request->getParam('AuthId');\r\n\t\t$eci = $this->request->getParam('eci');\r\n\t\t$payerAuth = $this->request->getParam('payerAuth');\r\n\t\t$sourceIp = $this->request->getParam('sourceIp');\r\n\t\t$ipCountry = $this->request->getParam('ipCountry');\r\n\t\t//explode reference number and get the value only\r\n\t\t$flag = preg_match(\"/-/\", $ref);\r\n\t\t\r\n\t\techo \"OK! \" . \"Order Ref. No.: \". $ref . \" | \";\r\n\t\t\t\r\n\t\tif ($flag == 1){\r\n\t\t\t$orderId = explode(\"-\",$ref);\r\n\t\t\t$orderNumber = $orderId[1];\r\n\t\t}else{\r\n\t\t\t$orderNumber = $ref;\r\n\t\t}\r\n\r\n\t\tdate_default_timezone_set('Asia/Hong_Kong');\r\n\t\t$phperrorPath = 'log'.$ord.'.txt';\r\n\t\tif($this->request->getParam('secureHash')!=null){\r\n\t\t\t$secureHash = $this->request->getParam('secureHash');\r\n\t\t}else{\r\n\t\t\t$secureHash = \"\";\r\n\t\t}\r\n\t\t\r\n\t\t$objectManager = \\Magento\\Framework\\App\\ObjectManager::getInstance();\r\n\t\t\r\n\t\t$order_object = $objectManager->create('\\Magento\\Sales\\Model\\Order')->loadByIncrementId($orderNumber);\r\n\r\n\t\t$logger = $objectManager->create('\\Psr\\Log\\LoggerInterface');\r\n\t\t\r\n\t\t$secureHashSecret = \"\";\r\n\t\tif(!empty($orderNumber)){\r\n\t\t\t$payment_method = $order_object->getPayment()->getMethodInstance();\r\n\t\t\t$secureHashSecret = $payment_method->getConfigData('secure_hash_secret');\r\n\t\t}else{\r\n\t\t\texit;\r\n\t\t}\r\n\t\t\r\n\t\t$dbCurrency = $order_object->getBaseCurrencyCode();\r\n\t\t/* convert currency type into numerical ISO code start*/\r\n\r\n\t\t$dbCurrencyIso = $this->_getIsoCurrCode($dbCurrency);\r\n\t\t/* convert currency type into numerical ISO code end*/\r\n\t\t\t\r\n\t\t//get grand total amount from Magento's sales order data for this order id (for comparison with the gateway's POSTed amount)\r\n\t\t$dbAmount = sprintf('%.2f', $order_object->getBaseGrandTotal());\r\n\t\t\r\n\t\tif(trim($secureHashSecret) != \"\"){\t\r\n\t\t\t$secureHashs = explode ( ',', $secureHash );\r\n\t\t\t// while ( list ( $key, $value ) = each ( $secureHashs ) ) {\r\n\t\t\tforeach($secureHashs as $key => $value) {\r\n\t\t\t\t$verifyResult = $this->_verifyPaymentDatafeed($src, $prc, $successCode, $ref, $payRef, $cur, $amt, $payerAuth, $secureHashSecret, $value);\r\n\t\t\t\tif ($verifyResult) {\r\n\t\t\t\t\tbreak ;\r\n\t\t\t\t}\r\n\t\t\t}\t\r\n\t\t\tif (! $verifyResult) {\r\n\t\t\t\texit(\"Secure Hash Validation Failed\");\r\n\t\t\t}\r\n\t\t}\r\n\t\t/* secureHash validation end*/ \r\n\t\tif ($successCode == 0 && $prc == 0 && $src == 0){\r\n\t\t\tif ($dbAmount == $amt && $dbCurrencyIso == $cur){\t\r\n\t\t\t\t$error = \"\";\r\n\t\t\t\ttry {\t\r\n\t\t\t\t\t//update order status to processing\r\n\t\t\t\t\t\t$comment = \"Payment was Accepted. Payment Ref: \" . $payRef ;\r\n\t\t\t\t\t\t$order_object->setState(\\Magento\\Sales\\Model\\Order::STATE_PROCESSING); \r\n\t\t\t\t\t\t$order_object->setStatus(\\Magento\\Sales\\Model\\Order::STATE_PROCESSING); \r\n\t\t\t\t\t\t$order_object->addStatusToHistory(\\Magento\\Sales\\Model\\Order::STATE_PROCESSING, $comment, true)->save();\r\n\t\t\t\t\t\t$orderCommentSender = $objectManager->create('Magento\\Sales\\Model\\Order\\Email\\Sender\\OrderCommentSender');\r\n\t\t\t\t\t\t$orderCommentSender->send($order_object, $notify='1' , $comment);// $comment yout comment\r\n\t\t\t\t\t\t//add payment record for the order\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t$payment = $order_object->getPayment()\r\n\t\t\t\t\t\t\t\t\t\t\t\t->setMethod('pdcptb')\r\n\t\t\t\t\t\t\t\t\t\t\t\t->setTransactionId($payRef)\r\n\t\t\t\t\t\t\t\t\t\t\t\t->setIsTransactionClosed(true);\r\n\t\t\t\t\t\t$order_object->setPayment($payment);\r\n\t\t\t\t\t\t$payment->addTransaction(\\Magento\\Sales\\Model\\Order\\Payment\\Transaction::TYPE_PAYMENT);\r\n\t\t\t\t\t\t$order_object->save();\r\n\t\t\t\t\t\t//create invoice\r\n\t\t\t\t\t\t//Instantiate ServiceOrder class and prepare the invoice \r\n\t\t\t\t\t\tif($order_object->canInvoice()){\r\n\t\t\t\t\t\t\t$invoice_object = $objectManager->create('Magento\\Sales\\Model\\Service\\InvoiceService')->prepareInvoice($order_object);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t// Make sure there is a qty on the invoice\t\t\t\r\n\t\t\t\t\t\t\tif (!$invoice_object->getTotalQty()) {\r\n\t\t\t\t\t\t\t\tthrow new \\Magento\\Framework\\Exception\\LocalizedException(\r\n\t\t\t\t\t\t\t\t__('You can\\'t create an invoice without products.'));\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t// Register as invoice item\r\n\t\t\t\t\t\t\t$invoice_object->setRequestedCaptureCase(\\Magento\\Sales\\Model\\Order\\Invoice::CAPTURE_OFFLINE);\r\n\t\t\t\t\t\t\t$invoice_object->register();\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t// Save the invoice to the order\r\n\t\t\t\t\t\t\t$transaction = $objectManager->create('Magento\\Framework\\DB\\Transaction')\r\n\t\t\t\t\t\t\t\t\t\t\t\t->addObject($invoice_object)\r\n\t\t\t\t\t\t\t\t\t\t\t\t->addObject($invoice_object->getOrder());\r\n\r\n\t\t\t\t\t\t\t$transaction->save();\r\n\t\t\t\t\t\t\t// Magento\\Sales\\Model\\Order\\Email\\Sender\\InvoiceSender\r\n\t\t\t\t\t\t\t//$this->\r\n\t\t\t\t\t\t\t$objectManager->create('Magento\\Sales\\Model\\Order\\Email\\Sender\\InvoiceSender')->send($invoice_object);\r\n\t\t\t\t\t\t\t$comment = \"Invoice sent.\" ;\r\n\t\t\t\t\t\t\t$order_object->addStatusHistoryComment(\r\n\t\t\t\t\t\t\t\t\t\t\t\t__($comment, $invoice_object->getId()))\r\n\t\t\t\t\t\t\t\t\t\t\t\t->setIsCustomerNotified(true)\r\n\t\t\t\t\t\t\t\t\t\t\t\t->save();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\tcatch (\\Exception $e){\r\n\t\t\t\t\techo $e->getMessage();\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif (!$error){\r\n\t\t\t\t\techo \"Order status (processing) update successful\";\r\n\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif (($dbAmount != $amt)){ \r\n\t\t\t\t\t\techo \"Amount value: DB \" . (($dbAmount == '') ? 'NULL' : $dbAmount) . \" is not equal to POSTed \" . $amt . \" | \";\r\n\t\t\t\t\t\techo \"Possible tamper - Update failed\";\r\n\t\t\t\t\t}else if (($dbCurrencyIso != $cur)){\r\n\t\t\t\t\t\techo \"Currency value: DB \" . (($dbCurrency == '') ? 'NULL' : $dbCurrency) . \" (\".$dbCurrencyIso.\") is not equal to POSTed \" . $cur . \" | \";\r\n\t\t\t\t\t\techo \"Possible tamper - Update failed\";\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\techo \"Other unknown error - Update failed\";\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\t/* WRAPPED WITH IF/ELSE STATEMENT TO PREVENT CHANGING OF STATUS TO CANCELED WHEN ALREADY GOT ACCEPTED TRANSACTION */\r\n\t\t\t$dbState = $order_object->getData('state');\r\n\t\t\tif($dbState == \\Magento\\Sales\\Model\\Order::STATE_PROCESSING || $dbState == \\Magento\\Sales\\Model\\Order::STATE_COMPLETE){\r\n\t\t\t\t//do nothing here\r\n\t\t\t\techo \"The order state is already set to \\\"\".dbState.\"\\\", so we cannot set it to \\\"\".\\Magento\\Sales\\Model\\Order::STATE_CANCELED.\"\\\" anymore\";\r\n\t\t\t}else{\r\n\t\t\t\t//update order status to canceled\r\n\t\t\t\t$comment = \"Payment was Rejected. Payment Ref: \" . $payRef ;\t\r\n\t\t\t\t$order_object->cancel()->save();\r\n\t\t\t\t$order_object->addStatusToHistory(\\Magento\\Sales\\Model\\Order::STATE_CANCELED, $comment, true)->save();\r\n\t\t\t\techo \"Order Status (cancelled) update successful \";\r\n\t\t\t\techo \"Transaction Rejected / Failed.\";\r\n\t\t\t}\t\r\n\t\t}\r\n\t}",
"public function process()\n {\n // check order configurations for funny PT case\n foreach ($this->order_configurations as $config) {\n $products = $config->getProductArray(true);\n $hasPreceptorTraining = in_array(\"9\", $products);\n\n // we found preceptor training and other products\n //(we need an addtional serial number, therefor an additional config)\n if (count($products) > 1 && $hasPreceptorTraining && !$this->upgrade_purchase) {\n $this->addPreceptorTrainingConfig($config->quantity);\n }\n }\n\n //Mark order as completed\n $this->completed = true;\n $this->order_date = new \\DateTime();\n\n //Either apply upgrades or generate new serial numbers\n if ($this->upgrade_purchase) {\n $this->applyUpgradesAndDowngrades();\n } else {\n $this->generateSerialNumbers();\n }\n\n //Send email to interested parties, unless this is an instant order by Staff\n if ($this->order_type->id != 3) {\n $this->emailSerialNumbers();\n }\n\n //Generate invoice number and email the invoice if appropriate\n if ($this->payment_method->id == 1 && !$this->isFreeOrder()) {\n $this->generateInvoiceNumber();\n $this->emailInvoicePdf();\n }\n \n $session = new \\Zend_Session_Namespace(\"OrdersController\");\n $session->unsetAll();\n }",
"function CallOrder()\n {\n global $USER, $CONF, $UNI;\n\n $this->amount = str_replace(\".\",\"\",HTTP::_GP('amount',0));\n $this->amountbis = HTTP::_GP('amount',0);\n\t\t\t\t\n\t\t\t\tif($this->amount < 10000){\n\t\t\t\t$this->printMessage('You have to buy minimum 10.000 AM!', true, array('game.php?page=donate', 3)); \n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tif($this->amount >= 10000 && $this->amount < 20000)\t\t$this->amount *= 1.05;\n\t\t\t\telseif($this->amount >= 20000 && $this->amount < 50000) $this->amount *= 1.10;\n\t\t\t\telseif($this->amount >= 50000 && $this->amount < 100000) $this->amount *= 1.20;\n\t\t\t\telseif($this->amount >= 100000 && $this->amount < 150000) $this->amount *= 1.30;\n\t\t\t\telseif($this->amount >= 150000 && $this->amount < 200000) $this->amount *= 1.40;\n\t\t\t\telseif($this->amount >= 200000) $this->amount *= 1.50;\n\t\t\t\t\n\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t$this->amount = round($this->amount + ($this->amount / 100 * 0));\n\t\t\t\t$this->amount = $this->amount + ($this->amount / 100 * 0);\n\t\t\t\t$this->cost = round($this->amountbis * 0.00011071);\n \n\n \n\t\t\t\t\n\t\t\t\t$this_p = new paypal_class;\n\t\t\t\t\n \n $this_p->add_field('business', $this::MAIL);\n \n\t\t\t\t\n\t\t\t $this_p->add_field('return', 'http://'.$_SERVER['HTTP_HOST'].'/game.php?page=overview');\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t$this_p->add_field('cancel_return', 'http://'.$_SERVER['HTTP_HOST'].'/ipns.php');\n $this_p->add_field('notify_url', 'http://'.$_SERVER['HTTP_HOST'].'/ipns.php');\n\t\t\t\t\n $this_p->add_field('item_name', $this->amount.' AM-User('.$USER['username'].').');\n $this_p->add_field('item_number', $this->amount.'_AM');\n $this_p->add_field('amount', $this->cost);\n //$this_p->add_field('action', $action); ?\n $this_p->add_field('currency_code', 'EUR');\n $this_p->add_field('custom', $USER['id']);\n $this_p->add_field('rm', '2');\n //$this_p->dump_fields(); \n\t\t\t\t foreach ($this_p->fields as $name => $value) {\n\t\t\t\t\t$field[] = array('text'=>'<input type=\"hidden\" name=\"'.$name.'\" value=\"'.$value.'\">');\n\t\t\t\t}\n\t\t\t $this->tplObj->assign_vars(array(\n\t\t\t\t'fields' => $field,\n\t\t\t ));\n\t\t\t$this->display('paypal_class.tpl');\n }",
"public function validateOrder();",
"public function fetchPrepInstructions()\n {\n if (! array_key_exists('SellerSKUList.Id.1', $this->options) &&\n ! array_key_exists('ASINList.Id.1', $this->options)) {\n $this->log('Product IDs must be set in order to get prep instructions!', 'Warning');\n\n return false;\n }\n\n if (! array_key_exists('ShipToCountryCode', $this->options)) {\n $this->log('Country Code must be set in order to get prep instructions!', 'Warning');\n\n return false;\n }\n\n $this->preparePrep();\n\n $url = $this->urlbase.$this->urlbranch;\n\n $query = $this->genQuery();\n\n $path = $this->options['Action'].'Result';\n if ($this->mockMode) {\n $xml = $this->fetchMockFile();\n } else {\n $response = $this->sendRequest($url, ['Post'=>$query]);\n\n if (! $this->checkResponse($response)) {\n return false;\n }\n\n $xml = simplexml_load_string($response['body']);\n }\n\n $this->parseXml($xml->$path);\n }",
"function buyPackage(){\n $unparsed_tickets = file_get_contents('http://127.0.0.1:5000/searchFlights');\n $unparsed_hotels = file_get_contents('http://127.0.0.1:5000/searchHotels');\n $json_tickets = json_decode($unparsed_tickets);\n $json_hotels = json_decode($unparsed_hotels);\n\n echo \"\\t\\t--FLIGHT TICKETS--\\n\";\n foreach ($json_tickets as $key => $value){\n echo \"\\t\\t--*--\\n\";\n // there are no rooms available\n if($key == 'Status'){\n echo \"$value\\n\";\n return;\n }\n else{\n foreach ($value as $k => $v){\n if($k != 'quantity')\n echo \"\\t\\t$k: $v\\n\";\n };\n echo \"\\t\\t--*--\\n\\n\";\n }\n };\n echo \"\\t\\t--HOTEL OPENINGS--\\n\";\n foreach ($json_hotels as $key => $value){\n echo \"\\t\\t--*--\\n\";\n // there are no rooms available\n if($key == 'Status'){\n echo \"$value\\n\";\n return;\n }\n else{\n foreach ($value as $k => $v){\n if($k != 'quantity')\n echo \"\\t\\t$k: $v\\n\";\n };\n echo \"\\t\\t--*--\\n\\n\";\n }\n };\n $ticket = readline(\"Enter the ID of flight ticket you wish to purchase: \");\n $hotel = readline(\"Enter the ID of hotel you wish to book: \");\n\n $request = 'http://127.0.0.1:5000/buyPackage'.'/'.$ticket.'/'.$hotel;\n $unparsed_json = file_get_contents($request);\n $json = json_decode($unparsed_json);\n\n // prints options on the screen\n foreach ($json as $key => $value){\n echo \"\\t\\t--*--\\n\";\n // there are no rooms available\n if($key == 'Status'){\n echo \"$value\\n\";\n return;\n }\n else{\n foreach ($value as $k => $v){\n if($k != 'quantity')\n echo \"\\t\\t$k: $v\\n\";\n };\n echo \"\\t\\t--*--\\n\\n\";\n }\n };\n}",
"function main($orders) {\n $inventory = get_initial_inventory();\n $product_ids = array_keys($inventory);\n\n $headers_found = [];\n $lines_stats = [];\n \n foreach ($orders as $order_json) {\n list (\n $demands_for_line, \n $allocations_for_line, \n $backorders_for_line\n ) = reset_line_stats($product_ids);\n \n if ($order = json_decode($order_json, true)) {\n if (is_valid_order($order)) {\n $header = $order[HEADER];\n\n // check that header is unique\n if (!is_valid_header($header, $headers_found)) {\n continue;\n }\n $headers_found[] = $header;\n foreach ($order[LINES] as $line) {\n $product_id = $line[PRODUCT];\n $quantity = $line[QUANTITY];\n if (!array_key_exists($product_id, $inventory)) {\n error_log(\"ERROR: invalid product ordered: ${product_id}\");\n }\n else {\n $demands_for_line[$product_id] = $quantity;\n $allocations_for_line[$product_id] = $inventory[$product_id] >= $quantity ? $quantity : $inventory[$product_id];\n $backorders_for_line[$product_id] = $quantity - $allocations_for_line[$product_id];\n $inventory[$product_id] = $inventory[$product_id] - $allocations_for_line[$product_id] > 0 ? \n $inventory[$product_id] - $allocations_for_line[$product_id] : 0;\n }\n }\n\n $lines_stats[] = [\n HEADER => $header,\n DEMANDS_FOR_LINE => join(',', $demands_for_line),\n ALLOCATIONS_FOR_LINE => join(',', $allocations_for_line),\n BACKORDERS_FOR_LINE => join(',', $backorders_for_line) \n ];\n\n // check inventory total; if == 0, break out and print stats\n if (inventory_total($inventory) === 0) {\n print_lines_stats($lines_stats);\n break;\n }\n }\n }\n else {\n error_log(\"ERROR: could not parse order json: ${order_json}\");\n }\n }\n return true;\n}",
"function before_process() {\n\n global $order, $order_total_modules, $db;\n\n $myAction = '';\n\n if(isset($_GET['Action'])){\n\n $myAction = $_GET['Action'];\n if($myAction == 'CheckoutSuccess'\n && isset($_SESSION['CCBILL_AMOUNT'])\n && strlen('' . $_SESSION['CCBILL_AMOUNT']) > 2){\n\n $myDigest = $_SESSION['CCBILL_AMOUNT'];\n\n $tcSql = \"SELECT * FROM ccbill WHERE email = '\" . $order->customer['email_address'] . \"' AND amount = '\" . $myDigest . \"' AND success = 1 AND order_created = 0\";\n\n //die('sql: ' . $tcSql);\n\n $check_query = $db->Execute($tcSql);\n $rowCount = $check_query->RecordCount();\n\n //die('record count: ' . $rowCount);\n\n if($rowCount > 0){\n\n $tcSql = \"UPDATE ccbill SET order_created = 1 WHERE email = '\" . $order->customer['email_address'] . \"' AND amount = '\" . $myDigest . \"'\";\n\n $db->Execute($tcSql);\n\n unset($_SESSION['CCBILL_AMOUNT']);\n return true;\n }\n else{\n $this->notify('NOTIFY_PAYMENT_CCBILL_CANCELLED_DURING_CHECKOUT');\n zen_redirect(zen_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));\n }// end if/else\n }\n else{\n $this->notify('NOTIFY_PAYMENT_CCBILL_CANCELLED_DURING_CHECKOUT');\n zen_redirect(zen_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));\n }// end if/else\n\n }\n else{\n $this->notify('NOTIFY_PAYMENT_CCBILL_CANCELLED_DURING_CHECKOUT');\n zen_redirect(zen_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));\n }// end if response is included\n\n\n }",
"function SendConfirmation($computer, $cancel_data)\n// Send a confirmation message to customers\n// who have been suspended, UNLESS suspention\n// is due to AUP violation or non-payment.\n{\n // I would have passed these as parameters,\n // but it looks like the other functions\n // in this file use a lot of global data too.\n GLOBAL $db;\n\n $is_AUP = $db->GetVal(\"\n select 1\n from offline_reasons\n where reason_number = $cancel_data[reason_number]\n and category_group in ( 500, 2900)\n limit 1\n \");\n\n $is_NonPay = $db->GetVal(\"\n select 1\n from offline_reasons\n where reason_number = $cancel_data[reason_number]\n and category_group in ( 400, 3000 )\n limit 1\n \");\n\n // Set up Mail Message\n $parser = new core_parser;\n $mailer = new core_mailer;\n $mailer->SetAccountNumber( $computer->customer_number );\n $mailer->AddAccountAddress(ONYX_ACCOUNT_ROLE_PRIMARY);\n $mailer->SetAccountFrom(ACCOUNT_ROLE_ACCOUNT_EXECUTIVE);\n\n $target_date = $cancel_data[\"sec_due_offline\"];\n $target_date = date(\"D F j, Y\", $target_date);\n $parser->AddVar('target_date', $target_date);\n\n $parser->SetAccount($computer->account);\n $parser->SetComputer($computer);\n\n if( $is_NonPay ) {\n // this call actually set variables inside th parser\n //hence it needs to come before access to \"subject\"\n $mailer->Body = $parser->ParseTextMessage( 27 );\n $mailer->Subject = $parser->subject; // \"Device Cancellation: Failure to Pay\";\n\n // pseudo: SUBJECT: \"Device Cancellation: Failure to Pay\"\n // pseudo:+ FROM: AE\n // pseudo:+ TO: Primary Contact\n // pseudo:+ BODY: Prefab(27)\n // pseudo:+ is NonPay\n // pseudo:+ Send a confirmation message to customers who have been suspended, unless nonpay\n\n $mailer->Send();\n } elseif ( $is_AUP ) {\n // Do Nothing\n } else { // Normal Cancellation\n error_log(\"**normal cancellation\\n\");\n $mailer->Body = $parser->ParseTextMessage( 12 );\n $mailer->Subject = $parser->subject; // \"Device Cancellation Confirmation\";\n\n // pseudo: SUBJECT: \"Device Cancellation Confirmation\"\n // pseudo:+ FROM: AE\n // pseudo:+ TO: Primary Contact\n // pseudo:+ BODY: Prefab(12)\n // pseudo:+ is AUP\n // pseudo:+ Send a confirmation message to customers who have been suspended, unless AUP\n $mailer->Send();\n }\n}",
"public function processPayment();",
"function main() {\n $groups = [ 'group_id:52560', 'group:\"SE-*\"' ];\n foreach ($groups as $group) {\n\n // Build the query.\n // Only recent tickets...\n $query = ' created>=' . gmdate('Y-m-d\\TH:00:00\\Z', time() - (3600 * HOURS_BACK));\n // Ticket types we want...\n $query .= ' status<solved type:ticket priority>=normal -gc:fs -tags:notification -tags:bulk_created -tags:waiting:ops_maint -tags:p:mautic -tags:p:agilone -tags:agilone -tags:agilone_legacy_user';\n // Queue we want...\n $query .= \" \" . $group;\n // Omit tickets that we've already touched.\n $query .= ' -@xvr10000';\n\n run_process_on_matching_tickets($query);\n }\n\n // Run on manual invocations that mention $magic_words, but created <$days ago.\n $magic_words = [ '@makeitso OR @alejandrobot', '+tags:assist_req'];\n $days = 15;\n foreach ($magic_words as $magic_word) {\n $query = $magic_word . ' status<=closed -@xvr10000 created>=' . gmdate('Y-m-d\\TH:00:00\\Z', time() - (3600 * 24 * $days));\n run_process_on_matching_tickets($query);\n }\n}",
"function _process($data)\n {\t\t\n\t\t$post = JFactory::getApplication()->input->get($_POST);\n \t\n \t$orderpayment_id = @$data['ssl_invoice_number'];\n \t\n \t$errors = array();\n \t$send_email = false;\n \t\n \t// load the orderpayment record and set some values\n JTable::addIncludePath( JPATH_ADMINISTRATOR.'/components/com_tienda/tables' );\n $orderpayment = JTable::getInstance('OrderPayments', 'TiendaTable');\n $orderpayment->load( $orderpayment_id );\n if (empty($orderpayment_id) || empty($orderpayment->orderpayment_id))\n {\n $errors[] = JText::_('VIRTUALMERCHANT MESSAGE INVALID ORDERPAYMENTID');\n return count($errors) ? implode(\"\\n\", $errors) : '';\n }\n $orderpayment->transaction_details = $data['ssl_result_message'];\n $orderpayment->transaction_id = $data['ssl_txn_id'];\n $orderpayment->transaction_status = $data['ssl_result'];\n \n // check the stored amount against the payment amount \n \tTienda::load( 'TiendaHelperBase', 'helpers._base' );\n $stored_amount = TiendaHelperBase::number( $orderpayment->get('orderpayment_amount'), array( 'thousands'=>'' ) );\n $respond_amount = TiendaHelperBase::number( $data['ssl_amount'], array( 'thousands'=>'' ) );\n if ($stored_amount != $respond_amount ) {\n \t$errors[] = JText::_('VIRTUALMERCHANT MESSAGE AMOUNT INVALID');\n \t$errors[] = $stored_amount . \" != \" . $respond_amount;\n }\n \n // set the order's new status and update quantities if necessary\n Tienda::load( 'TiendaHelperOrder', 'helpers.order' );\n Tienda::load( 'TiendaHelperCarts', 'helpers.carts' );\n $order = JTable::getInstance('Orders', 'TiendaTable');\n $order->load( $orderpayment->order_id );\n if (count($errors)) \n {\n // if an error occurred \n $order->order_state_id = $this->params->get('failed_order_state', '10'); // FAILED\n }\n\t\telse\n {\n $order->order_state_id = $this->params->get('payment_received_order_state', '17');; // PAYMENT RECEIVED\n\n // do post payment actions\n $setOrderPaymentReceived = true;\n \n // send email\n $send_email = true;\n }\n\n // save the order\n if (!$order->save())\n {\n \t$errors[] = $order->getError();\n }\n \n // save the orderpayment\n if (!$orderpayment->save())\n {\n \t$errors[] = $orderpayment->getError(); \n }\n \n if (!empty($setOrderPaymentReceived))\n {\n $this->setOrderPaymentReceived( $orderpayment->order_id );\n }\n \n if ($send_email)\n {\n // send notice of new order\n Tienda::load( \"TiendaHelperBase\", 'helpers._base' );\n $helper = TiendaHelperBase::getInstance('Email');\n $model = Tienda::getClass(\"TiendaModelOrders\", \"models.orders\");\n $model->setId( $orderpayment->order_id );\n $order = $model->getItem();\n $helper->sendEmailNotices($order, 'new_order');\n }\n\n return count($errors) ? implode(\"\\n\", $errors) : ''; \n\n \treturn true;\n }",
"public function execute(){\n// $test = '2-SG-1040,2-SG-1021,2-SG-1027,2-SG-234,2-SG-1037,disable,disable,disable,disable,disable,disable,disable,disable,disable,disable';\n// $this->_logger->addDebug(print_r($this->getRequest()->getParam('orders'), true));\n $orders = $this->getModifiedOrders($this->getRequest()->getParam('orders'));\n // construct Argument 2: user info\n $weight = $this->getRequest()->getParam('weight');\n $user = $this->getCustomerInfo($weight);\n // construct argument 3: nutrition goal definition\n $goal = $this->getNutritionGoal($user);\n $result = $this->nutritionAlgorithm($orders, $user, $goal);\n echo $result;\n }",
"function processPaymentFieldsSpecialEvents($entry)\n{\n global $dbPriceSingleTicket;\n global $dbPricePartHigh;\n global $dbPricePartHighBtw;\n global $dbTicketPricePart;\n global $dbTicketPricePartBtw;\n global $dbTicketPricePartTotal;\n global $dbBtwHigh;\n\n global $dbFoodPrice;\n $price_ticket_ex_food = $dbPriceSingleTicket - $dbFoodPrice;\n\n // If there is a reduction price which is smaller than the food price the price part high will be below zero\n if ($price_ticket_ex_food < 0) {\n $price_ticket_ex_food = 0;\n }\n\n global $dbParticipants;\n $dbTicketPricePart = $price_ticket_ex_food * count($dbParticipants);\n\n $dbTicketPricePartBtw = $dbTicketPricePart * $dbBtwHigh;\n $dbTicketPricePartTotal = $dbTicketPricePart + $dbTicketPricePartBtw;\n\n $dbPricePartHigh = $dbTicketPricePart + $dbParkingPricePart;\n $dbPricePartHighBtw = $dbPricePartHigh * $dbBtwHigh;\n\n global $dbPricePartHighTotal;\n $dbPricePartHighTotal = $dbPricePartHigh + $dbPricePartHighBtw;\n \n // Calculate low btw\n // When the reduction price is smaller than the food price take the reduction price\n global $dbPricePartLow;\n $dbPricePartLow = $dbFoodPrice;\n if ($dbTicketPrice < $dbFoodPrice) {\n $dbPricePartLow = $dbTicketPrice;\n }\n\n global $dbPricePartLowBtw;\n global $dbPricePartLowTotal;\n global $dbFoodPartPriceLow;\n global $dbFoodPartPriceLowBtw;\n global $dbFoodPartPriceLowTotal;\n\n global $dbBtwLow;\n\n $dbPricePartLow = count($dbParticipants) * $dbPricePartLow;\n $dbFoodPartPriceLow = $dbPricePartLow;\n $dbPricePartLowBtw = $dbPricePartLow * $dbBtwLow;\n $dbFoodPartPriceLowBtw = $dbPricePartLowBtw;\n $dbPricePartLowTotal = $dbPricePartLow + $dbPricePartLowBtw;\n $dbFoodPartPriceLowTotal = $dbPricePartLowTotal;\n\n // Payment details\n global $dbTotalBtw;\n $dbTotalBtw = $dbPricePartLowBtw + $dbPricePartHighBtw;\n global $dbTotalPrice;\n $dbTotalPrice = ($dbPriceSingleTicket * count($dbParticipants)) + $dbParkingPricePart + $dbMembershipPricePart;\n\n $rounded_total_price = number_format($dbTotalPrice * 100, 0, ',', '');\n $rounded_btw_part_low = number_format(($dbPricePartLowBtw) * 100, 0, ',', '');\n $rounded_btw_part_high = number_format(($dbPricePartHighBtw) * 100, 0, ',', '');\n\n global $dbTotalPriceBtw;\n $dbTotalPriceBtw = ($rounded_total_price + $rounded_btw_part_low + $rounded_btw_part_high) / 100;\n}",
"function showData()\n{#form submits here we show entered name\n global $config;\n \n echo \n\t'<script type=\"text/javascript\" src=\"' . VIRTUAL_PATH . 'include/util.js\"></script>\n\t<script type=\"text/javascript\">\n\t\tfunction checkForm(thisForm)\n\t\t{//check form data for valid info\n\t\t\tif(empty(thisForm.YourName,\"\")){return false;}\n\t\t\treturn true;//if all is passed, submit!\n\t\t}\n\t</script>\n\t<h3 align=\"center\">' . smartTitle() . '</h3> \n\t<form action=\"' . THIS_PAGE . '\" method=\"post\" onsubmit=\"return checkForm(this);\">\n\t\t<table align=\"center\">\n\t\t\t<tr>\n\t\t\t\t\n\t\t\t\t<td>\n ';\n /*\n ' . XXX . '\n */\n \n \n\n echo ' \n <!--\n\t\t\t\t\t<input type=\"text\" name=\"YourName\" /><font color=\"red\"><b>*</b></font> <em>(alphabetic only)</em>\n -->\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td align=\"center\" colspan=\"2\">\n\t\t\t\t\t<!--<input type=\"submit\" value=\"Submit Your Order\"><em>(<font color=\"red\"><b>*</b> required field</font>)</em>\n -->\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t</table>\n\t\t<input type=\"hidden\" name=\"act\" value=\"display\" />\n\t</form>\n\t';\n //initializing variables\n $counter = 1;\n $subTotal = 0;\n $checkCount = 1;\n \n //looping through items\n foreach($config->items as $item){\n \n //adds count to item\n $itemCount = \"item_\" . strval($counter);\n foreach($_POST as $name => $value)\n {\n //if string contains name and item count\n if(strstr($name, $itemCount)) \n {\n //checks for numerical input\n if (is_numeric($value) || empty($value))\n {\n //adds quanity input to variable\n $quantity = intval($value);\n //tells user only numbers are allowed and redirects back to page \n } else\n {\n feedback(\"Only numbers are allowed. Please re-enter your quantity.\"); #will feedback to submitting page via session variable\n myRedirect(THIS_PAGE);\n }\n \n }\n \n }\n //calculations for item total\n $itemTotal = $item->Price * $quantity;\n \n //subtotal calculation\n $subTotal += $itemTotal;\n \n $cbox1 = \"cbox1\" . strval($checkCount);\n $cbox2 = \"cbox2\" . strval($checkCount);\n $cbox3 = \"cbox3\" . strval($checkCount);\n \n //adds extra values if checked\n if(isset($_POST[$cbox1]))\n {\n $subTotal += (.5 * $quantity);\n }\n if(isset($_POST[$cbox2]))\n {\n $subTotal += (.5 * $quantity);\n }\n if(isset($_POST[$cbox3]))\n {\n $subTotal += (.5 * $quantity);\n }\n \n $counter = $counter + 1;\n $checkCount = $checkCount + 1;\n \n }\n //figueres out tax amount\n $tax = $subTotal * .095;\n \n //calculates total plus tax\n $total = $subTotal + $tax;\n \n if ($total == 0){\n feedback(\"Please make a selection.\"); #will feedback to submitting page via session variable\n\t\tmyRedirect(THIS_PAGE);\n }\n //prints out receipt total\n echo '<p align=\"center\">Subtotal: $' . $subTotal . '</p>';\n echo '<p align=\"center\">Tax: $' . number_format($tax, 2) . '</p>';\n echo '<p align=\"center\">Total: $' . number_format($total, 2) . '</p>';\n \n echo '<p align=\"center\"><a href=\"' . THIS_PAGE . '\">Place another order</a></p>';\n \n\tget_header(); #defaults to footer_inc.php\n\tget_footer(); #defaults to footer_inc.php\n}",
"private function fetchOrder()\n {\n $this->oOrder = Mage::getSingleton('sales/order');\n try {\n $this->oOrder->load($this->getParameter('orderid',self::REGEX_INTEGER));\n } catch (Exception $e) {\n $this->returnMessage = self::MESSAGE_INVALID_ORDER_ID;\n $this->returnStatus = self::STATUS_ERROR;\n $this->sendStatus();\n }\n\n if(!$this->oOrder->getPayment() || substr($this->oOrder->getPayment()->getMethod(),0,3) != 'mcp') {\n $this->returnMessage = self::MESSAGE_NOT_MICROPAYMENT_ORDER;\n $this->returnStatus = self::STATUS_ERROR;\n $this->sendStatus();\n }\n }",
"public function FinishOrder()\n\t\t{\n\t\t\t// Orders are still incomplete, so we need to validate them\n\t\t\tif($this->pendingData['status'] == ORDER_STATUS_INCOMPLETE) {\n\t\t\t\t// Verify the pending order\n\t\t\t\t$newStatus = VerifyPendingOrder($this->orderToken);\n\n\t\t\t\t// Order was declined and we're rejecting all declined payments\n\t\t\t\tif($newStatus == ORDER_STATUS_DECLINED) {\n\t\t\t\t\t$Msg = sprintf(GetLang('ErroOrderDeclined'), GetConfig('OrderEmail'), GetConfig('OrderEmail'));\n\t\t\t\t\t$this->BadOrder(GetLang('YourPaymentWasDeclined'), $Msg);\n\t\t\t\t}\n\t\t\t\t// This order is valid\n\t\t\t\telseif($newStatus !== false) {\n\n\t\t\t\t\t$prodOrdered = array();\n\t\t\t\t\t$items = getCustomerQuote()->getItems();\n\t\t\t\t\tforeach($items as $item) {\n\t\t\t\t\t\t$productId = $item->getProductId();\n\t\t\t\t\t\tif($productId > 0) {\n\t\t\t\t\t\t\t$prodOrdered[] = $productId;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$_SESSION['ProductJustOrdered'] = implode(',',$prodOrdered);\n\t\t\t\t\t}\n\t\t\t\t\tif(CompletePendingOrder($this->orderToken, $newStatus)) {\n\t\t\t\t\t\t// Order was saved. Show the confirmation screen and email an invoice to the customer\n\t\t\t\t\t\t$this->ThanksForYourOrder();\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// If we're still here, either the order didnt complete or the order was invalid\n\t\t\t\t$this->BadOrder();\n\t\t\t}\n\t\t\t// Order is already complete - there's a good chance the customer has refreshed the page,\n\t\t\t// or they've come back from somewhere like PayPal who in the mean time has already sent\n\t\t\t// us a ping back to validate and begin processing the order - show the thank you page\n\t\t\telse if($this->pendingData['status'] == ORDER_STATUS_DECLINED) {\n\t\t\t\t\t$Msg = sprintf(GetLang('ErroOrderDeclined'), GetConfig('OrderEmail'), GetConfig('OrderEmail'));\n\t\t\t\t\t$this->BadOrder(GetLang('YourPaymentWasDeclined'), $Msg);\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$this->ThanksForYourOrder();\n\t\t\t\treturn;\n\t\t\t}\n\t\t}",
"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 before_process() {\r\n global $order_total_modules;\r\n if (isset($_GET['referer']) && $_GET['referer'] == 'nochex_apc') {\r\n $this->notify('NOTIFY_PAYMENT_NOCHEX_RETURN_TO_STORE');\r\n if (MODULE_PAYMENT_NOCHEX_TESTING == 'Harness') {\r\n // simulate call to ipn_handler.php here\r\n nochex_simulate_apc_handler((int)$_GET['count']);\r\n }\r\n $_SESSION['cart']->reset(true);\r\n unset($_SESSION['sendto']);\r\n unset($_SESSION['billto']);\r\n unset($_SESSION['shipping']);\r\n unset($_SESSION['payment']);\r\n unset($_SESSION['comments']);\r\n unset($_SESSION['cot_gv']);\r\n $order_total_modules->clear_posts();//ICW ADDED FOR CREDIT CLASS SYSTEM\r\n zen_redirect(zen_href_link(FILENAME_CHECKOUT_SUCCESS, '', 'SSL'));\r\n } else {\r\n $this->notify('NOTIFY_PAYMENT_NOCHEX_CANCELLED_DURING_CHECKOUT');\r\n zen_redirect(zen_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));\r\n }\r\n }",
"public function process()\n {\n //If they don't order 7 days after sign up, the points disappear\n //send sms before 1-2days if not order placed\n $orderTable = $this->getServiceLocator()->get('Api\\Table\\LoyaltyPointTable');\n $accounts = $orderTable->getAccountsForCreditExpiry();\n if (!$accounts) {\n echo $msg = 'CreditsExpiryController: Not orders available, skipping '. $this->orderId .\"\\n\";\n $this->logger->debug($msg);\n return;\n }\n \n foreach ($accounts['list'] as $account) {\n if ($account['no_order_days_since_signup'] == 5) {\n $this->sendSms($account['contact_no']);\n } else if ($account['no_order_days_since_signup'] >= 7) {\n $this->removeCredits($account['account_id'], $account['points']);\n } \n }\n }",
"function purchaseTicket($ar){\n\nif (isset($GLOBALS['RRTESTSTA'])){\n XLogs::critical(get_class($this), '::purchaseTicket RRTESTSTA');\n throw new Exception('Coucou');\n $ta = new StdClass();\n $ta->NPOSNO = 0;\n $ta->NJOURNALNO = sprintf('%05d', '1'.date('ms'));\n $ta->NSERIALNO = sprintf('%05d', '2'.date('ms'));\n $ta->NPROJECTNO = 444;\n return $ta;\n}\n\n $wtpsi = $this->getAWTPSI();\n $pt= $ar['tapt'];\n $pool = $ar['pool'];\n $tt = $ar['tatt'];\n $prj = $ar['projectno'];\n $firstname = $ar['firstname'];\n $lastname = $ar['lastname'];\n $dob = $ar['dob'];\n\n $pur = array();\n\n list($chipid, $crc, $accno) = explode('-', $ar['wtpno']);\n $pur[0]['NPERSONTYPENO'] = $pt;\n $pur[0]['NPOOLNO'] = $pool;\n $pur[0]['NTICKETTYPENO'] = $tt;\n $pur[0]['NPROJECTNO'] = $prj;\n $pur[0]['SZVALIDFROM'] = $ar['validfrom'];\n\n // jcp 28/12/11, preco support TA : ne transmettre que le CHIPID\n // $pur[1]['SZACCEPTANCENO'] = $accno;\n // $pur[1]['SZCHIPIDCRC'] = $crc;\n $pur[1]['SZCHIPID'] = $chipid;\n \n // person data\n $pur[2]['SZLASTNAME'] = $lastname;\n $pur[2]['SZFIRSTNAME'] = $firstname;\n $pur[2]['SZDATEOFBIRTH'] = $dob;\n $pur[2]['SZSEX'] = NULL;\n $pur[2]['SZTITLE'] = NULL;\n $pur[2]['SZSALUTATION'] = NULL;\n \n // pas d'adress data\n $pur[3] = NULL; // adress data\n \n // articles -> faire un purchaseProduct\n if (isset($ar['articlesData'])){\n $pur[4] = $ar['articlesData'];\n $soapfunc = 'doPurchaseProduct';\n } else {\n $soapfunc = 'doPurchaseTicket';\n }\n\n $cc = '';\n foreach($pur as $foo=>$block){\n $c = $foo . ' : ';\n if (isset($block)){\n foreach($block as $name=>$value){\n $c .= ' '.$name.'=>'.$value;\n }\n }\n $cc .= $c;\n XLogs::notice(get_class($this), get_class($this).\"::purchaseTicket $c\");\n }\n // purchaseProduct / purchaseTicket\n $r = $wtpsi->$soapfunc(array('purchasedata'=>$pur));\n\n return $r;\n }",
"function ProcessNewOrderNotification($dom_response_obj) {\n /*\n * +++ CHANGE ME +++\n * New order notifications inform you of new orders that have\n * been submitted through Google Checkout. A <new-order-notification>\n * message contains a list of the items in an order, the tax\n * assessed on the order, the shipping method selected for the\n * order and the shipping address for the order.\n *\n * If you are implementing the Notification API, you need to\n * modify this function to relay the information in the\n * <new-order-notification> to your internal systems that\n * process this order data.\n */\n // Get Google order ID and customer email from XML response\n $dom_data_root = $dom_response_obj->document_element();\n $google_order_number = $dom_data_root->get_elements_by_tagname(\"google-order-number\");\n $number = $google_order_number[0]->get_content();\n $shop_order_id = $dom_data_root->get_elements_by_tagname(\"order-id\");\n $order_id = $shop_order_id[0]->get_content();\n //echo PROCESS . \"\\n\";\n //print_r($order_id);\n if($order_id > 0)\n {\n // Update order by Google order ID\n tep_db_query(\"update \" . TABLE_ORDERS . \" set google_orders_id='\" . $number . \"' where orders_id='\" . $order_id . \"'\");\n }\n else\n {\n CreateNewOrder($dom_response_obj);\n }\n SendNotificationAcknowledgment();\n}",
"function show_requirements( $coursesTaken )\n{\n/*\n\t$reqs = file(\"reqs.txt\");\n\techo \"<br/>Here is the progress on required courses:<br/>\";\n\t\n\t$electives = array();\n\tfor ($i = 0; $i < count( $reqs ); $i++ ):\n\t\n\t\t$reqFields = explode ( \":\" , $reqs[$i] ); // separate class name from classes\n\t\t$classFields = explode (\"|\", $reqFields[1] ); // separate classes (for electives)\n\t\t\n\t\t$again = true;\n\t\tfor ($j = 0; $j < count( $classFields ) && $again == true; $j++ ):\n\t\t\n\t\t\t$class = explode ( \",\", $classFields[$j] );\n\t\t\t\n\t\t\t\n\t\t\tfor ($k = 0; $k < count($coursesTaken) && $again == true; $k++):\n\t\n\t\t\t\t$studentClassInfo = explode( \":\" ,$coursesTaken[$k] );\n\t\t\t\t\n\t\t\t\t$classNumber1 = trim( $studentClassInfo[1] );\n\t\t\t\t$classNumber2 = trim( $class[1] );\n\n\t\t\t\t\n\t\t\t\t//for handling repeated electives\n\t\t\t\tif ( ( strcmp( $class[0], $studentClassInfo[0] ) == 0 ) && ( $classNumber1 == $classNumber2 ) )\n\t\t\t\t{\n\t\t\t\t\t//match class\n\t\t\t\t\t$again = false;\n\t\t\t\t\tif ( preg_match( \"/Elec/\", $reqFields[0] ) )\n\t\t\t\t\t{\n\t\t\t\t\t\tif ( in_array( $classNumber1, $electives ) )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$again = true;\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\tarray_push( $electives, $classNumber1 );\n\t\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\tendfor;\n\t\t\t\n\t\tendfor;\n\t\t\n\t\tif ( $again == true )\n\t\t{\n\t\t\techo \"N - $reqFields[0]<br/>\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif ( strcmp( $studentClassInfo[4][0], \"C\" ) < 0 )\n\t\t\t{\n\t\t\t\techo \"S - Class: $studentClassInfo[0]$studentClassInfo[1] Term: $studentClassInfo[2] Grade: $studentClassInfo[4] - $reqFields[0]<br/>\";\n\t\t\t}\n\t\t\telseif ( strcmp( $studentClassInfo[4][0], \"C\" ) == 0 )\n\t\t\t{\n\t\t\t\tif ( strcmp( $studentClassInfo[4][1], \"-\") == 0 )\n\t\t\t\t{\n\t\t\t\t\techo \"N - $reqFields[0]<br/>\";\n\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\techo \"S - Class: $studentClassInfo[0]$studentClassInfo[1] Term: $studentClassInfo[2] Grade: $studentClassInfo[4] - $reqFields[0]<br/>\";\n\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\techo \"N - $reqFields[0]<br/>\";\n\t\t\t}\n\t\t}\n\tendfor;\n\t*/\n\n}",
"function fill($args) {\n global $_lib;\n\n $status = $args['status'];\n\n $query = \"select * from invoicein as i\";\n $query .= \" where i.RemittanceAmount > 0 and \";\n #$query .= \" RemittanceStatus ='sent' and\"; #Remember this in production to avoid duplicate payments\n $query .= \" PaymentMeans ='42' and\"; #Only pay invoices that is not already marked as payed by cash or card\n\n #Should check that the status is such that this invoice should be payed (ref payment meny, cash and credit card payed invoices should not be listed here.\n\n if($this->RemittanceStatus) {\n $query .= \" i.RemittanceStatus='$this->RemittanceStatus' and \";\n }\n if($this->InvoiceNumber) {\n $query .= \" i.InvoiceNumber like '%$this->InvoiceNumber%' and \";\n }\n if($this->FromDate) {\n $query .= \" i.InvoiceDate >= '$this->FromDate' and \";\n }\n if($this->ToDate) {\n $query .= \" i.InvoiceDate <= '$this->ToDate' and \";\n }\n if($this->IName) {\n $query .= \" i.IName like '%$this->IName%' and \";\n }\n\n $query = substr($query, 0, -4);\n $query .= \" order by i.InvoiceDate asc\";\n\n #print $query;\n $result = $_lib['db']->db_query($query);\n while($row = $_lib['db']->db_fetch_object($result)) {\n\n $row->run = true;\n if($row->RemittanceAmount < 0) {\n $row->Status .= 'Remitteringsbel¿p kan ikke v¾re negativt';\n $row->run = false;\n }\n \n $old_pattern = array(\"/[^0-9]/\", \"/_+/\", \"/_$/\");\n $new_pattern = array(\"\", \"\", \"\");\n $row->SupplierBankAccount = preg_replace($old_pattern, $new_pattern, $row->SupplierBankAccount); \n $row->CustomerBankAccount = preg_replace($old_pattern, $new_pattern, $row->CustomerBankAccount); \n \n if(strlen($row->SupplierBankAccount) != 11) {\n $row->Status .= 'Mottaker bankkonto inneholder ikke 11 siffer';\n $row->run = false;\n } elseif(!$this->isValidBankAccount($row->SupplierBankAccount)) {\n $row->Status .= 'Mottaker bankkonto er tastet feil';\n $row->run = false; \n }\n \n if(strlen($row->CustomerBankAccount) != 11) {\n $row->Status .= 'Betaler bankkonto inneholder ikke 11 siffer';\n $row->run = false;\n } elseif(!$this->isValidBankAccount($row->CustomerBankAccount)) {\n $row->Status .= 'Betaler bankkonto er tastet feil';\n $row->run = false; \n }\n if(!$row->IZipCode || !$row->ICity) {\n $row->run = false;\n $row->Status .= \"Leverandør postnummer eller poststed mangler\";\n }\n if(!$row->InvoiceNumber) {\n $row->Status .= 'Fakturanummer mangler';\n $row->run = false;\n }\n if(!$row->InvoiceDate) {\n $row->Status .= 'Fakturadato mangler';\n $row->run = false;\n }\n if(!$row->DueDate) {\n $row->Status .= 'Forfallsdato mangler';\n $row->run = false;\n }\n \n if(!$row->run) {\n $row->Class = 'red';\n }\n \n $this->iteratorH[] = $row;\n }\n }",
"function decline_order_get()\n {\n $order_id = $this->get('order_id');\n $driver_id = $this->get('driver_id');\n \n if(empty($order_id) || empty($driver_id))\n {\n $message = ['status' => FALSE,'message' => $this->lang->line('text_rest_invalidparam')];\n $this->response($message, REST_Controller::HTTP_BAD_REQUEST); // BAD_REQUEST (400)\n }\n else\n {\n $order_data = $this->Common_model->getOrderDetails($order_id);\n\n if($order_data['driver_id'] != $driver_id){\n $message = ['status' => FALSE,'message' => 'This ride is not assigned to you'];\n $this->response($message, REST_Controller::HTTP_BAD_REQUEST); // BAD_REQUEST (400)\n }\n else if($order_data['status'] == 'Completed'){\n $message = ['status' => FALSE,'message' => 'This ride is already completed'];\n $this->response($message, REST_Controller::HTTP_BAD_REQUEST); // BAD_REQUEST (400)\n }\n else if($order_data['status'] == 'Cancelled'){\n $message = ['status' => FALSE,'message' => 'This ride is already cancelled'];\n $this->response($message, REST_Controller::HTTP_BAD_REQUEST); // BAD_REQUEST (400)\n }\n else if($order_data['status'] == 'Processing'){\n $message = ['status' => FALSE,'message' => 'This ride is in progress'];\n $this->response($message, REST_Controller::HTTP_BAD_REQUEST); // BAD_REQUEST (400)\n }\n else{\n $message = $this->Common_model->findDrivers($order_id);\n $this->response($message, REST_Controller::HTTP_OK); // OK (200)\n }\n } \n }",
"function expected_orders($data)\n{\n global $user;\n $expected_orders = [];\n $user_id = $user->uid;\n $account_products_ids = [];\n if (!isset($data['accounts'])) {\n return services_error('accounts is not defined!', 500);\n } elseif (!isset($data['therapeutic'])) {\n return services_error('therapeutic area is not defined!', 500);\n } else {\n if (!isset($data['year'])) {\n $date = get_year_dates();\n } else {\n $date = get_year_dates($data['year']);\n }\n if (!isset($data['quarter'])) {\n $data['quarter'] = 1;\n }\n if (is_array($data['quarter'])) {\n $data['quarter'] = $data['quarter'][0];\n }\n if (is_array($data['therapeutic'])) {\n $data['therapeutic'] = $data['therapeutic'][0];\n }\n // Get reps;\n if (is_rep($user)) {\n $data['reps'] = (is_array($user_id)) ? $user_id : [$user_id];\n } elseif (is_sales_manager($user)) {\n $data['reps'] = ppt_resources_get_sales_manager_reps($user_id);\n $data['reps'] = (is_array($data['reps'])) ? $data['reps'] : [$data['reps']];\n } elseif (is_comm_lead($user)) {\n if (isset($data['team'])) {\n if (is_array($data['team'])) {\n $data['team'] = $data['team'][0];\n $data['reps'] = array_keys(ppt_resources_get_team_reps($data['team']));\n }\n $data['reps'] = (is_array($data['reps'])) ? $data['reps'] : [$data['reps']];\n }\n } else {\n $data['reps'] = ppt_resources_get_users_per_role($user);\n $data['reps'] = (is_array($data['reps'])) ? $data['reps'] : [$data['reps']];\n }\n // Get products belong to selected account.\n $account_info = node_load_multiple($data['accounts']);\n foreach ($account_info as $info) {\n $account_products_array = $info->field_products['und'];\n foreach ($account_products_array as $product) {\n $account_products_ids[] = $product['target_id'];\n }\n }\n // Get products belong to theraputic area.\n $thermatic_area_products_ids = get_thermatic_area_products_ids($data[\"therapeutic\"]);\n // Get match products with account and thermatic area .\n if (!empty($thermatic_area_products_ids) && !empty($account_products_ids)) {\n foreach ($account_products_ids as $product_id) {\n if (in_array($product_id, $thermatic_area_products_ids)) {\n $data['products'][] = $product_id;\n }\n }\n if (!empty($data['products'])) {\n // Match current user products.\n if (is_rep($user)) {\n $final_products = [];\n $user_products = get_products_for_current_user($user_id, FALSE, FALSE);\n if (isset($user_products) && !empty($user_products)) {\n foreach ($user_products as $product_id) {\n if (in_array($product_id, $data['products'])) {\n $final_products[] = $product_id;\n }\n }\n }\n if (!empty($final_products)) {\n $data['products'] = $final_products;\n } else {\n return [];\n }\n }\n }\n } else {\n return [];\n }\n // return $data['products'];\n if (empty($data['products'])) {\n return [];\n }\n\n // Planned orders.\n $orders = get_planned_orders($data['reps'], $data['accounts'], $data['products'], $date);\n if (isset($orders) && !empty($orders)) {\n foreach ($orders as $order) {\n // Load product.\n $product_id = $order->field_planned_product['und'][0]['target_id'];\n // Create array of product planned_orders .\n $expected_orders[$product_id]['planned_orders'][] = [\n 'planned_period' => $order->field_planned_period['und'][0]['value'],\n 'acutal_period' => $order->field_planned_actual_period['und'][0]['value'],\n 'planned_quantity' => $order->field_planned_quantity['und'][0]['value'],\n 'delivered_quantity' => $order->field_planned_delivered_quantity['und'][0]['value']\n ];\n }\n }\n if (isset($data['products']) && isset($data['accounts']) && isset($data['reps'])) {\n foreach ($data['accounts'] as $account) {\n foreach ($data['products'] as $product) {\n $entries = ppt_resources_get_entries($account, [$product], $data['reps']);\n $entries_records = get_entries_records_for_year($entries, $data['year'], 'consumption_stock_entry');\n if (isset($entries_records)) {\n foreach ($entries_records as $entry => $records) {\n $records_loaded = entity_load(\"entry_month_record\", $records);\n foreach ($records_loaded as $record) {\n // Create array of product stocks .\n $expected_orders[$product][\"stocks\"][] = [\n 'consumption' => $record->field_consumption['und'][0]['value'],\n 'stocks' => $record->field_stocks['und'][0]['value'],\n 'entry_date' => $record->field_entry_date['und'][0]['value']\n ];\n }\n }\n }\n }\n }\n }\n $total_expected = [];\n if (isset($expected_orders)) {\n foreach ($expected_orders as $key => $orders) {\n // Intialize array with each month and values for each month = 0 .\n $final_array = [\n \"Dec\" => [\n 'stocks' => 0,\n 'consumption' => 0,\n 'planned_quantity' => 0,\n 'delivered_quantity' => 0\n ],\n \"Jan\" => [\n 'stocks' => 0,\n 'consumption' => 0,\n 'planned_quantity' => 0,\n 'delivered_quantity' => 0\n ],\n \"Feb\" => [\n 'stocks' => 0,\n 'consumption' => 0,\n 'planned_quantity' => 0,\n 'delivered_quantity' => 0\n ],\n \"Mar\" => [\n 'stocks' => 0,\n 'consumption' => 0,\n 'planned_quantity' => 0,\n 'delivered_quantity' => 0\n ],\n \"Apr\" => [\n 'stocks' => 0,\n 'consumption' => 0,\n 'planned_quantity' => 0,\n 'delivered_quantity' => 0\n ],\n \"May\" => [\n 'stocks' => 0,\n 'consumption' => 0,\n 'planned_quantity' => 0,\n 'delivered_quantity' => 0\n ],\n \"Jun\" => [\n 'stocks' => 0,\n 'consumption' => 0,\n 'planned_quantity' => 0,\n 'delivered_quantity' => 0\n ],\n \"Jul\" => [\n 'stocks' => 0,\n 'consumption' => 0,\n 'planned_quantity' => 0,\n 'delivered_quantity' => 0\n ],\n \"Aug\" => [\n 'stocks' => 0,\n 'consumption' => 0,\n 'planned_quantity' => 0,\n 'delivered_quantity' => 0\n ],\n \"Sep\" => [\n 'stocks' => 0,\n 'consumption' => 0,\n 'planned_quantity' => 0,\n 'delivered_quantity' => 0\n ],\n \"Oct\" => [\n 'stocks' => 0,\n 'consumption' => 0,\n 'planned_quantity' => 0,\n 'delivered_quantity' => 0\n ],\n \"Nov\" => [\n 'stocks' => 0,\n 'consumption' => 0,\n 'planned_quantity' => 0,\n 'delivered_quantity' => 0\n ]\n ];\n if (isset($orders['planned_orders'])) {\n foreach ($orders['planned_orders'] as $order) {\n $final_array[date(\"M\", strtotime($order['planned_period']))]['planned_quantity'] += $order['planned_quantity'];\n $final_array[date(\"M\", strtotime($order['acutal_period']))]['delivered_quantity'] += $order['delivered_quantity'];\n }\n }\n if (isset($orders['stocks'])) {\n foreach ($orders['stocks'] as $order) {\n $final_array[date(\"M\", strtotime($order['entry_date']))]['consumption'] += $order['consumption'];\n $final_array[date(\"M\", strtotime($order['entry_date']))]['stocks'] += $order['stocks'];\n }\n }\n $product_name = taxonomy_term_load($key)->name;\n // Add final array to its product .\n $total_expected[$product_name] = $final_array;\n }\n }\n // Set products matched with 0 values if not have values.\n foreach ($data['products'] as $product_id) {\n $product_name = taxonomy_term_load($product_id)->name;\n if (!in_array($product_name, array_keys($total_expected))) {\n $total_expected[$product_name] = [\n \"Dec\" => [\n 'stocks' => 0,\n 'consumption' => 0,\n 'planned_quantity' => 0,\n 'delivered_quantity' => 0\n ],\n \"Jan\" => [\n 'stocks' => 0,\n 'consumption' => 0,\n 'planned_quantity' => 0,\n 'delivered_quantity' => 0\n ],\n \"Feb\" => [\n 'stocks' => 0,\n 'consumption' => 0,\n 'planned_quantity' => 0,\n 'delivered_quantity' => 0\n ],\n \"Mar\" => [\n 'stocks' => 0,\n 'consumption' => 0,\n 'planned_quantity' => 0,\n 'delivered_quantity' => 0\n ],\n \"Apr\" => [\n 'stocks' => 0,\n 'consumption' => 0,\n 'planned_quantity' => 0,\n 'delivered_quantity' => 0\n ],\n \"May\" => [\n 'stocks' => 0,\n 'consumption' => 0,\n 'planned_quantity' => 0,\n 'delivered_quantity' => 0\n ],\n \"Jun\" => [\n 'stocks' => 0,\n 'consumption' => 0,\n 'planned_quantity' => 0,\n 'delivered_quantity' => 0\n ],\n \"Jul\" => [\n 'stocks' => 0,\n 'consumption' => 0,\n 'planned_quantity' => 0,\n 'delivered_quantity' => 0\n ],\n \"Aug\" => [\n 'stocks' => 0,\n 'consumption' => 0,\n 'planned_quantity' => 0,\n 'delivered_quantity' => 0\n ],\n \"Sep\" => [\n 'stocks' => 0,\n 'consumption' => 0,\n 'planned_quantity' => 0,\n 'delivered_quantity' => 0\n ],\n \"Oct\" => [\n 'stocks' => 0,\n 'consumption' => 0,\n 'planned_quantity' => 0,\n 'delivered_quantity' => 0\n ],\n \"Nov\" => [\n 'stocks' => 0,\n 'consumption' => 0,\n 'planned_quantity' => 0,\n 'delivered_quantity' => 0\n ]\n ];\n }\n }\n $quarter_array = [];\n switch ($data['quarter']) {\n case 1:\n foreach ($total_expected as $key => $product_arr) {\n $quarter_array[$key] = array_slice($product_arr, 0, 3);\n }\n break;\n case 2:\n foreach ($total_expected as $key => $product_arr) {\n $quarter_array[$key] = array_slice($product_arr, 3, 3);\n }\n break;\n case 3:\n foreach ($total_expected as $key => $product_arr) {\n $quarter_array[$key] = array_slice($product_arr, 6, 3);\n }\n break;\n case 4:\n foreach ($total_expected as $key => $product_arr) {\n $quarter_array[$key] = array_slice($product_arr, 9, 3);\n }\n break;\n }\n // Return YTD by current Month .\n foreach ($total_expected as $product_name => $months) {\n $counter = 0;\n $temp = [];\n $ytd = [\n \"delivered_quantity\" => 0,\n \"consumption\" => 0,\n \"stocks\" => 0 ,\n \"moh\" => 0\n ];\n $current_month = date('m');\n $current_year = date('Y');\n foreach ($months as $month => $total) {\n $nmonth = date('m', strtotime($month));\n // calculate Consumption avarage .\n if ($current_year == ($data['year']-1)){\n if ($current_month == 12) {\n // get the value of Dec only .\n if ($nmonth == $current_month) {\n $ytd['delivered_quantity'] += $total['delivered_quantity'];\n $ytd['consumption'] += $total['consumption'];\n $ytd['stocks'] += $total['stocks'];\n }\n }\n }\n else {\n // get months from 12 till months less than or equall current month .\n if ($nmonth <= $current_month || $nmonth == 12) {\n if( $total['consumption'] > 0){\n $counter+=1 ;\n }\n // Ytd DQ value.\n $ytd['delivered_quantity'] += $total['delivered_quantity'];\n $ytd['consumption'] += $total['consumption'];\n// $ytd['stocks'] += $total['stocks'];\n }\n }\n // Calculate latest available stock .\n if (empty($temp)) {\n $temp['value'] = (empty($total['stocks']))?0:$total['stocks'];\n $temp['month'] = ($nmonth == 12)?0:$nmonth ;\n }else{\n if (!empty($total['stocks']) && $nmonth > $temp['month'] ){\n $temp['value'] = $total['stocks'];\n $temp['month'] = $nmonth;\n }\n }\n }\n // Ytd stocks value .\n $ytd['stocks'] = $temp['value'];\n // Ytd consumption value.\n if ($counter!=0){\n $ytd['consumption'] = number_format($ytd['consumption']/$counter,2,'.','')+0;\n }\n // Ytd moh vale.\n if ($ytd['consumption'] == 0){\n $ytd['moh'] = 0;\n }\n else {\n $moh_value = $ytd['stocks']/$ytd['consumption'] ;\n if (fmod($moh_value,1) !== 0.00) {\n $ytd['moh'] = number_format($moh_value,2,'.','') + 0;\n } else {\n $ytd['moh'] = $moh_value;\n }\n }\n $quarter_array[$product_name]['ytd'] = $ytd;\n }\n $ytd = array_column($quarter_array, 'ytd');\n $consumption = array_column($ytd, 'consumption');\n array_multisort($consumption, SORT_DESC, $quarter_array);\n return $quarter_array;\n }\n}",
"public function orderCommitEtProcess($order_data, $bid)\r\n {\r\n $sysUtil = new SysUtility();\r\n $orderSet = new Order1InfoSet($bid);\r\n $result = array();\r\n\r\n $orderSet->setBusinessId($bid);\r\n $orderSet->setProductName($order_data->product_name_id);\r\n $orderSet->setMonthTerm($order_data->service_term_id);\r\n $orderSet->setStoreQuantity($order_data->store_quantity_id);\r\n $orderSet->setTotalAmount($order_data->amount_id);\r\n $orderSet->setTaxRate(CommonDefinition::TAX_RATE_CANADA);\r\n $orderSet->setAmountPaid(CommonDefinition::ZERO_NUM); // Assume no payment received yet\r\n $orderSet->setPaymentMethod(CommonDefinition::PAY_METHOD_EMAIL); // paid by email\r\n // transfer\r\n $orderSet->setOrderStatus(NeoDefinition::ORDER_STATUS_EMAIL_COMMIT); // set order status\r\n\r\n $temp = $sysUtil->generateDb1OrderId($bid);\r\n\r\n // Set the order ID\r\n $orderSet->setOrderId($temp);\r\n $orderSet->setOrderNote(NeoDefinition::ET_ORDER_NOTE_1);\r\n $orderSet->setPaymentInfo(NeoDefinition::ET_ORDER_PAYMENT_INFO_1);\r\n\r\n $tblName = $sysUtil->getNeoDb1OrderTblName();\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($tblName);\r\n $queryResult = $neoModel->addDashboard1OrderById($orderSet);\r\n\r\n if ($queryResult) {\r\n $result[\"status\"] = CommonDefinition::SUCCESS;\r\n $result[\"info\"] = NeoDefinition::ET_ORDER_ADD_SUCCESS . NeoDefinition::EMAIL_INTERAC_LINK;\r\n\r\n // get the total order number after this submit if add order success\r\n\r\n $queryResult = $neoModel->getDashboard1OrderNumberByBid($bid);\r\n if (! is_bool($queryResult)) {\r\n session_start();\r\n $_SESSION[\"total_order\"] = $queryResult;\r\n }\r\n } else {\r\n $result[\"status\"] = CommonDefinition::ERROR;\r\n $result[\"info\"] = NeoDefinition::ET_ORDER_ADD_FAIL;\r\n }\r\n\r\n $neoModel->close();\r\n return ($result);\r\n }",
"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}",
"function SchedullerPO(){\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Cek --> Update PO List, Update Quantity PO Open\n\t\t// echo \"hahah\";\t\t\n\t\trequire_once APPPATH.'third_party/sapclasses/sap.php';\n\t\t$sap = new SAPConnection();\n\t\t$sap->Connect(APPPATH.\"third_party/sapclasses/logon_dataDev.conf\");\n\t\tif ($sap->GetStatus() == SAPRFC_OK ) $sap->Open ();\n\t\tif ($sap->GetStatus() != SAPRFC_OK ) {\n\t\t\techo $sap->PrintStatus();\n\t\t\texit;\n\t\t}\n\n\t\t$fce = &$sap->NewFunction (\"Z_ZCMM_VMI_PO_DETAILC\");\n\t\t\n\t\tif ($fce == false) {\n\t\t\t$sap->PrintStatus();\n\t\t\texit;\n\t\t}\n\t\t\n\t\t$start \t= date(\"20170101\");\t\t\t\t\t// Date start VMI apps\n\t\t$end \t= date(\"Ymd\");\t\t\t\t\t\t// Date Now\n\t\t$opco\t\t\t\t\t= '7000';\n\t\t$fce->COMPANY \t\t\t= \"$opco\";\t\t// BUKRS\n\t\t// $fce->PO_TYPE \t\t= 'ZK17';\n\t\t// $fce->VENDOR \t\t= ;\n\t\t$fce->DATE['SIGN'] \t= 'I';\n\t\t$fce->DATE['OPTION']\t= 'BT';\n\t\t$fce->DATE['LOW'] \t= $start;\n\t\t$fce->DATE['HIGH'] \t= $end;\n\t\t\n\t\t$fce->PO_TYPE->row['SIGN'] \t= 'I';\n\t\t$fce->PO_TYPE->row['OPTION'] \t= 'EQ';\n\t\t$fce->PO_TYPE->row['LOW'] \t= 'ZK10';\n\t\t$fce->PO_TYPE->row['HIGH'] \t= '';\n\t\t$fce->PO_TYPE->Append($fce->PO_TYPE->row);\n\t\t\n\t\t$fce->PO_TYPE->row['SIGN'] \t= 'I';\n\t\t$fce->PO_TYPE->row['OPTION'] \t= 'EQ';\n\t\t$fce->PO_TYPE->row['LOW'] \t= 'ZK17';\n\t\t$fce->PO_TYPE->row['HIGH'] \t= '';\n\t\t$fce->PO_TYPE->Append($fce->PO_TYPE->row);\n\t\t\t\n $fce->call();\n\n if ($fce->GetStatus() == SAPRFC_OK) {\n $fce->T_ITEM->Reset();\n $data=array();\n $empty=0;\n $tampildata=array();\n while ($fce->T_ITEM->Next()) {\n\t\t\t\t$matnr \t\t= $fce->T_ITEM->row[\"MATNR\"];\t// Kode Material\n\t\t\t\t$lifnr \t\t= $fce->T_ITEM->row[\"LIFNR\"];\t// Kode Vendor\n\t\t\t\t$ebeln \t\t= $fce->T_ITEM->row[\"EBELN\"];\t// No PO\n\t\t\t\t$menge \t\t= intval($fce->T_ITEM->row[\"MENGE\"]);\t// Quantity PO\n\t\t\t\t$sisaqty\t= intval($fce->T_ITEM->row[\"DELIV_QTY\"]);\t// Quantity PO Open\n\t\t\t\t$werks \t\t= $fce->T_ITEM->row[\"WERKS\"];\t// Plant\n\t\t\t\t$vendor\t\t= $fce->T_ITEM->row[\"VENDNAME\"];\t// Nama Vendor\n\t\t\t\t$material \t= $fce->T_ITEM->row[\"MAKTX\"];\t// Nama Material\n\t\t\t\t$potype \t= $fce->T_ITEM->row[\"BSART\"];\t// Type PO\n\t\t\t\t// $mins \t\t= $fce->T_ITEM->row[\"EISBE\"];\t// Safety Stock\n\t\t\t\t$mins \t\t= $fce->T_ITEM->row[\"MINBE\"];\t// Re Order Point\n\t\t\t\t$maxs \t\t= $fce->T_ITEM->row[\"MABST\"];\t// Max\n\t\t\t\t$statuspo\t= $fce->T_ITEM->row[\"ELIKZ\"];\t// Max\n\t\t\t\t$start \t\t= date_format(date_create($fce->T_ITEM->row[\"BEDAT\"]),'d M Y');\n\t\t\t\t$end \t\t= date_format(date_create($fce->T_ITEM->row[\"EINDT\"]),'d M Y');\n\t\t\t\t\n\t\t\t\tif($statuspo == 'X' || $statuspo == 'x')\n\t\t\t\t{\n\t\t\t\t\t$sts = 0;\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$sts = 1;\n\t\t\t\t}\n\t\t\t\t$sqlread= \"SELECT count(id_list) ADA\n\t\t\t\t\t\t\tFROM VMI_MASTER \n\t\t\t\t\t\t\twhere NO_PO = '$ebeln' and\n\t\t\t\t\t\t\tKODE_MATERIAL = '$matnr' and \n\t\t\t\t\t\t\tKODE_VENDOR = '$lifnr' and\n\t\t\t\t\t\t\tPLANT = '$werks' \n\t\t\t\t\t\t\t\";\n\t\t\t\t\t\t\t//and QUANTITY = '$menge'\n\t\t\t\t$jum \t= $this->db->query($sqlread)->row();\n\t\t\t\t$nilai \t= $jum->ADA;\n\t\t\t\t// echo $nilai.\"->\".$matnr.\" | \".$lifnr.\" | \".$ebeln.\" | \".$menge.\" | \".$werks.\" | \".$vendor.\" | \".$material.\" | \".$start.\" | \".$end.\" ==> \".$potype.\"<br/>\";\n\t\t\t\t// $ebeln == \"6310000038\" || $ebeln == \"6310000039\" || $ebeln == \"6310000040\" || $ebeln == \"6310000041\" || $ebeln == \"6310000042\" || $ebeln == \"6310000043\")\n\t\t\t\t\n\t\t\t\tif($nilai < 1){\n\t\t\t\t\tif($ebeln == \"6310000038\" || $ebeln == \"6310000039\" || $ebeln == \"6310000040\" || $ebeln == \"6310000041\" || $ebeln == \"6310000042\" || $ebeln == \"6310000043\"\n\t\t\t\t\t\t|| $lifnr == \"0000113004\" || $lifnr == \"0000110091\" || $lifnr == \"0000110253\" || $lifnr == \"0000110015\" || $lifnr == \"0000112369\" || $lifnr == \"0000110016\"){\t\t\t\t\t\t\n\t\t\t\t\t\t$sqlcount \t= \"SELECT max(ID_LIST) MAXX FROM VMI_MASTER\";\n\t\t\t\t\t\t$maxid \t\t= $this->db->query($sqlcount)->row();\t\t\n\t\t\t\t\t\t$max_list \t= $maxid->MAXX+1;\n\t\t\t\t\t\t$insert\t\t= \"insert into VMI_MASTER(ID_LIST,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tPLANT,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tKODE_MATERIAL,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tNAMA_MATERIAL,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tUNIT,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tKODE_VENDOR,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tNAMA_VENDOR,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tNO_PO,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tPO_ITEM,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tCONTRACT_ACTIVE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tCONTRACT_END,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tDOC_DATE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSLOC,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tMIN_STOCK,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tMAX_STOCK,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSTOCK_AWAL,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSTOCK_VMI,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tQUANTITY,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tID_COMPANY,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSTATUS)\n\t\t\t\t\t\t\t\t\t\t\t\tvalues('$max_list',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'$werks',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'$matnr',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'$material',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'\".$fce->T_ITEM->row[\"MEINS\"].\"',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'$lifnr',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'$vendor',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'$ebeln',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'\".$fce->T_ITEM->row[\"EBELP\"].\"',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tTO_DATE('\".date_format(date_create($start),'Y-m-d').\"','YYYY-MM-DD'),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tTO_DATE('\".date_format(date_create($end),'Y-m-d').\"','YYYY-MM-DD'),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tTO_DATE('\".date_format(date_create($start),'Y-m-d').\"','YYYY-MM-DD'),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'\".$fce->T_ITEM->row[\"LGORT\"].\"',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'\".$fce->T_ITEM->row[\"EISBE\"].\"',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'\".$fce->T_ITEM->row[\"MABST\"].\"',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'0',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'0',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'$sisaqty',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'$opco',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'$sts'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\";\n\t\t\t\t\t\t$save \t= $this->db->query($insert);\n\t\t\t\t\t\techo \"Baru ==> $ebeln | $material | $vendor | $opco | $werks | $potype<br/>\";\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\techo \"Skip ==> $ebeln | $material | $vendor | $opco | $werks | $potype<br/>\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telseif($nilai >= 1){\n\t\t\t\t\t$sqlread1 = \"SELECT ID_LIST\n\t\t\t\t\t\t\tFROM VMI_MASTER \n\t\t\t\t\t\t\twhere NO_PO = '$ebeln' and\n\t\t\t\t\t\t\tKODE_MATERIAL = '$matnr' and \n\t\t\t\t\t\t\tKODE_VENDOR = '$lifnr' and\n\t\t\t\t\t\t\tPLANT = '$werks' \n\t\t\t\t\t\t\t\";\n\t\t\t\t\t\t\t//and QUANTITY = '$menge'\n\t\t\t\t\t$getlist= $this->db->query($sqlread1)->row();\n\t\t\t\t\t$idlist = $getlist->ID_LIST;\n\t\t\t\t\t$update\t\t= \"update VMI_MASTER set quantity = '$sisaqty',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tmin_stock = '$mins',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tmax_stock = '$maxs',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSTATUS = '$sts'\n\t\t\t\t\t\t\t\t\t\t\t\t\twhere ID_LIST = '$idlist'\n\t\t\t\t\t\t\t\t\";\n\t\t\t\t\t$update_data\t= $this->db->query($update);\n\t\t\t\t\t\techo \"$update <br/>\";\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t\techo \"Skip ==> $ebeln | $material | $vendor | $opco| $werks | $potype<br/>\";\n\t\t\t\t}\n\t\t\t\t// echo \"<hr/>\"; \n\t\t\t}\n\t\t// echo \"<pre>\";\n\t\t// print_r($fce);\n\t\t// echo \"hahaha\";\n $fce->Close();\n\t\t}\n }",
"function emailUserOrder($email, $orderid)\n{\n if(!isset($email)) { return \"<p>Email for sending was empty</p>\"; }\n $validateEmail = validateEmail($email);\n if (!is_bool($validateEmail) || $validateEmail != 1) { return $validateEmail; }\n\n if(!isset($orderid)) { return \"<p>No order id was given to the server in sending a receipt to $email.</p>\"; }\n\n //Need to get order\n $order = getOrder($orderid);\n if(!isset($order) || !is_array($order) || !isset($order['orderid'])) { return \"<p>Couldn't get order details when trying to create email to send receipt to $email.</p>\"; }\n\n //Need to get each inorder of the order:\n $inorders = getAllInOrderForOrder($order['orderid']);\n if(!isset($inorders) || !is_array($inorders)) { return \"<p>Couldn't get ordered products when trying to create email to send receipt to $email.</p>$inorders\"; }\n\n\n //Now generate email\n\n global $siteURL;\n\n //We have a valid email to send a first time hello to\n $subject = \"Order Reciept at H.E.L.P. for order {$order['orderid']}\";\n\n $body = \"<html><body><h1>Hello {$_SESSION['fullName']},</h1>\n\n <p>This email concludes your order with H.E.L.P.</p>\n <p>Below is your receipt:</p>\";\n\n $body .= \"<table><thead><th>Item #</th><th>Product Description</th><th>Quantity</th><th>Price Per</th></thead>\";\n $i = 1;\n foreach($inorders as $inorder)\n {\n $product = getProduct($inorder[1]);\n if(!isset($product) || !is_array($product)) { return \"<p>Couldn't find an item when creating order receipt to send to $email.</p>\"; }\n //print_r($product);\n $body .= \"<tr><td>Item $i: </td><td>\\\"{$product['drugName']}\\\"<td>{$inorder[2]}</td><td>\\${$inorder[3]}</td></tr>\";\n $i++;\n }\n\n //Add order total:\n $body .= \"<tr></tr><tr><td>Total: </td><td>\\$${order['totalPrice']}</td></tr></table>\\n\\n\";\n\n $body .= \"<p>If you did not make this order, please contact the H.E.L.P. support immediately! (Do not reply to this email)</p>\n\n <p>Thank you for shopping at H.E.L.P.! Your order should be shipped within the next few business days.</p>\n <br>\n <p>Sincerely,</p>\n <p>Customer Service at \" . $siteURL .\"</p></body></html>\";\n\n $from = \"[email protected]\";\n $headers = 'MIME-Version: 1.0' . \"\\r\\n\";\n $headers .= 'Content-Type: text/html; charset=ISO-8859-1' . \"\\r\\n\";\n $headers .= \"From:$from\\r\\n\";\n\n ini_set('display_errors', 1);\n mail($email, $subject, $body, $headers);\n //echo $body;\n return true;\n}",
"public function run()\n {\n $reasons = [ \n \"Annual Physical\",\n \"General Consultation\",\n \"Illness\",\n \"Infection Consultation\",\n \"New Patient Visit\",\n \"Acid Reflux / Heartburn\",\n \"Anemia\",\n \"Back Problems\",\n \"Bleeding Disorder\",\n \"Blood Pressure Testing\",\n \"Blood Work\",\n \"Bronchitis\",\n \"COVID-19 Antibody Test\",\n \"Chlamydia\",\n \"Cholesterol / Lipids Checkup\",\n \"Cholesterol Management\",\n \"Chronic Cough\",\n \"Chronic Illness\",\n \"Cold\",\n \"Cold Sores / Herpes Labialis\",\n \"Constipation\",\n \"Cough\",\n \"Diabetes Consultation\",\n \"ECG / EKG\",\n \"Ear Infection\",\n \"Electrocardiogram\",\n \"Elevated PSA\",\n \"Enlarged Lymph Nodes\",\n \"Erectile Dysfunction / Impotence / Male Sexual Dysfunction\",\n \"Eye Infection\",\n \"Fainting / Syncope\",\n \"Fatty Liver Disease\",\n \"Flu\",\n \"Frequent Urination\",\n \"General Follow Up\",\n \"Headache\",\n \"High Blood Pressure / Hypertension\",\n \"High Blood Sugar / Hyperglycemia\",\n \"High Cholesterol / Lipid Problem\",\n \"Hospital Discharge/Follow Up\",\n \"Hyperlipidemia\",\n \"Hyperthyroidism / Overactive Thyroid\",\n \"Hypogonadism\",\n \"Hypothyroidism / Underactive Thyroid\",\n \"Immigration Medical Examination\",\n \"Immunization\",\n \"Immunodeficiency\",\n \"Infection Follow Up\",\n \"Insomnia\",\n \"Iron Deficiency\",\n \"Kidney Stones\",\n \"Medication Review\",\n \"Migraine\",\n \"Nasal Congestion\",\n \"Pre-Surgery Checkup / Pre-Surgical Clearance\",\n \"Prescription / Refill\",\n \"Preventive Medicine Consultation\",\n \"Sexually Transmitted Disease (STD)\",\n \"Sleep Disorder\",\n \"Sore Throat\",\n \"Swelling in Neck\",\n \"Thyroid Evaluation\",\n \"Tiredness / Fatigue\",\n \"Type 2 Diabetes\",\n \"Urinary Urgency / Urge Incontinence\",\n ];\n \n \n foreach ($reasons as $reason) {\n DB::table('reasons')->insert([\n 'name' => $reason,\n 'created_at'=>date('Y-m-d H:i:s'),\n 'updated_at'=>date('Y-m-d H:i:s'), \n ]); \n }\n }",
"function AddPurchaseReplacementRmaOrder($arryDetails)\r\n\t\t\t{ \r\n\t\t\t\tglobal $Config;\r\n\t\t\t\textract($arryDetails);\r\n\t\r\n\t\t\t\tif(empty($Currency)) $Currency = $Config['Currency'];\r\n\t\t\t\tif(empty($ClosedDate)) $ClosedDate = $Config['TodayDate'];\r\n\t\r\n\t if($OrderType == 'Dropship'){ $CustCode=$CustCode;} else{ $CustCode = ''; }\r\n\t \r\n\t\t\t\t$strSQLQuery = \"insert into p_order(Module, OrderType, OrderDate, PurchaseID, QuoteID, InvoiceID, CreditID, wCode, Approved, Status, DropShip, DeliveryDate, ClosedDate, Comment, SuppCode, SuppCompany, SuppContact, Address, City, State, Country, ZipCode, Currency, SuppCurrency, Mobile, Landline, Fax, Email, wName, wContact, wAddress, wCity, wState, wCountry, wZipCode, wMobile, wLandline, wEmail, TotalAmount, Freight, CreatedBy, AdminID, AdminType, PostedDate, UpdatedDate, ReceivedDate, InvoicePaid, InvoiceComment, PaymentMethod, ShippingMethod, PaymentTerm, AssignedEmpID, AssignedEmp, Taxable, SaleID, taxAmnt , tax_auths, TaxRate,CustCode) values('Order', '\".$OrderType.\"', '\".$OrderDate.\"', '\".$PurchaseID.\"', '\".$QuoteID.\"', '\".$InvoiceID.\"', '\".$CreditID.\"', '\".$wCode.\"', '\".$Approved.\"','\".$Status.\"', '\".$DropShip.\"', '\".$DeliveryDate.\"', '\".$ClosedDate.\"', '\".addslashes(strip_tags($Comment)).\"', '\".addslashes($SuppCode).\"', '\".addslashes($SuppCompany).\"', '\".addslashes($SuppContact).\"', '\".addslashes($Address).\"' , '\".addslashes($City).\"', '\".addslashes($State).\"', '\".addslashes($Country).\"', '\".addslashes($ZipCode).\"', '\".$Currency.\"', '\".addslashes($SuppCurrency).\"', '\".addslashes($Mobile).\"', '\".addslashes($Landline).\"', '\".addslashes($Fax).\"', '\".addslashes($Email).\"' , '\".addslashes($wName).\"', '\".addslashes($wContact).\"', '\".addslashes($wAddress).\"' , '\".addslashes($wCity).\"', '\".addslashes($wState).\"', '\".addslashes($wCountry).\"', '\".addslashes($wZipCode).\"', '\".addslashes($wMobile).\"', '\".addslashes($wLandline).\"', '\".addslashes($wEmail).\"', '\".addslashes($TotalAmount).\"', '\".addslashes($Freight).\"', '\".addslashes($_SESSION['UserName']).\"', '\".$_SESSION['AdminID'].\"', '\".$_SESSION['AdminType'].\"', '\".$Config['TodayDate'].\"', '\".$Config['TodayDate'].\"', '\".$ReceivedDate.\"', '\".$InvoicePaid.\"', '\".addslashes(strip_tags($InvoiceComment)).\"', '\".addslashes($PaymentMethod).\"', '\".addslashes($ShippingMethod).\"', '\".addslashes($PaymentTerm).\"', '\".addslashes($EmpID).\"', '\".addslashes($EmpName).\"', '\".addslashes($Taxable).\"', '\".addslashes($SaleID).\"', '\".addslashes($taxAmnt).\"', '\".addslashes($tax_auths).\"', '\".addslashes($MainTaxRate).\"','\".$CustCode.\"')\";\r\n\t //echo $strSQLQuery;\r\n\t\t\t\t\r\n\t\t\t\t$this->query($strSQLQuery, 0);\r\n\t\t\t\t$OrderID = $this->lastInsertId();\r\n\t\r\n\t\t\t\tif(empty($arryDetails[$ModuleID])){\r\n\t\t\t\t\t$ModuleIDValue = $PrefixPO.'000'.$OrderID;\r\n\t\t\t\t\t$strSQL = \"update p_order set \".$ModuleID.\"='\".$ModuleIDValue.\"' where OrderID='\".$OrderID.\"'\"; \r\n\t\t\t\t\t$this->query($strSQL, 0);\r\n\t\t\t\t}\r\n\t \r\n\t\t\t\treturn $OrderID;\r\n\t\r\n\t\t\t}",
"function declineJob($postData)\n\t\t{\n\t\t\t//update the accept flag\n\t\t\t$update_1 = $this->manageContent->updateValueWhere(\"award_info\",\"is_declined\",1,\"bid_id\",$postData['bid']);\n\t\t\t$update_2 = $this->manageContent->updateValueWhere(\"award_info\",\"result_date\",date('Y-m-d g:i:s'),\"bid_id\",$postData['bid']);\n\t\t\t\n\t\t\tif( $update_1 == 1 && $update_2 == 1 )\n\t\t\t{\n\t\t\t\t//get the bid information\n\t\t\t\t$bid_details = $this->manageContent->getValue_where('bid_info','*','bid_id',$postData['bid']);\n\t\t\t\t\n\t\t\t\t//get the project details on which bid is made\n\t\t\t\t$project_details = $this->manageContent->getValue_where(\"project_info\",\"*\",\"project_id\",$bid_details[0]['project_id']);\n\t\t\t\t\n\t\t\t\t//get contractor details\n\t\t\t\t$con_details = $this->manageContent->getValue_where('user_info', '*', 'user_id', $bid_details[0]['user_id']);\n\t\t\t\t//getting employer details\n\t\t\t\t$emp_details = $this->getEmailIdFromUserId($project_details[0]['user_id']);\n\t\t\t\t//sending mail to employer\n\t\t\t\t$this->mailSent->mailForDecliningJob($emp_details[0], $emp_details[1], $con_details[0]['name'], $project_details[0]['title']);\n\t\t\t\t\n\t\t\t\techo \"Successfully declined.\";\n\t\t\t}\n\t\t}",
"function after_process() {\n\t\t $requestParamList = array(\"MID\" => MODULE_PAYMENT_PAYTM_MERCHANT_ID , \"ORDERID\" => $_POST['ORDERID']);\n\n\t\t $paytmParamsStatus = array();\n /* body parameters */\n $paytmParamsStatus[\"body\"] = array(\n /* Find your MID in your Paytm Dashboard at https://dashboard.paytm.com/next/apikeys */\n \"mid\" => $requestParamList['MID'],\n /* Enter your order id which needs to be check status for */\n \"orderId\" => $requestParamList['ORDERID'],\n );\n $checksumStatus = PaytmChecksum::generateSignature(json_encode($paytmParamsStatus[\"body\"], JSON_UNESCAPED_SLASHES), MODULE_PAYMENT_PAYTM_MERCHANT_KEY);\n /* head parameters */\n $paytmParamsStatus[\"head\"] = array(\n /* put generated checksum value here */\n \"signature\" => $checksumStatus\n );\n /* prepare JSON string for request */\n $post_data_status = json_encode($paytmParamsStatus, JSON_UNESCAPED_SLASHES);\n $paytstsusmurl = $this->paytmurl.PaytmConstants::ORDER_STATUS_URL; \n $ch = curl_init($paytstsusmurl);\n curl_setopt($ch, CURLOPT_POST, 1);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data_status);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));\n $responseJson = curl_exec($ch);\n $responseStatusArray = json_decode($responseJson, true);\n\t\t if($responseStatusArray['body']['resultInfo']['resultStatus']=='TXN_SUCCESS' && $responseStatusArray['body']['txnAmount']==$_POST['TXNAMOUNT'])\n\t\t {\n\t\t \tglobal $insert_id;\n\t\t\t $status_comment=array();\n\t\t\t if(isset($_POST)){\n\t\t\t\t if(isset($_POST['ORDERID'])){\n\t\t\t\t \t$status_comment[]=\"Order Id: \" . $_POST['ORDERID'];\n\t\t\t\t }\n\t\t\t\t\n\t\t\t\t if(isset($_POST['TXNID'])){\n\t\t\t\t\t $status_comment[]=\"Paytm TXNID: \" . $_POST['TXNID'];\n\t\t\t\t }\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t$sql_data_array = array('orders_id' => $insert_id,\n 'orders_status_id' => MODULE_PAYMENT_PAYTM_ORDER_STATUS_ID,\n 'date_added' => 'now()',\n 'customer_notified' => '0',\n 'comments' => implode(\"\\n\", $status_comment));\n\n\t\t\tzen_db_perform(TABLE_ORDERS_STATUS_HISTORY, $sql_data_array);\n\t\t}\n\t\telse{\n\t\t\tzen_redirect(zen_href_link(FILENAME_CHECKOUT_SHIPPING, 'error_message=' . urlencode(\"It seems some issue in server to server communication. Kindly connect with administrator.\"), 'SSL', true, false));\n\t\t}\n }",
"function SAP_set_order($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\t\n\t//THESE PARAMS ARE FIXED NOW\n\t$cond_type='ZPR0';\t\n\t//$cond_value='10';\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,decade,month,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$decade=$i_data[4];\n\t\t\t$month=$i_data[5];\n\t\t\t$year=$i_data[6];\n\t\t\t//SERVICE DATE\n\t\t\t$service_date='';\n\t\t\tswitch($month)\n\t\t\t{\n\t\t\t\tcase 1:\n\t\t\t\t\t$service_date='-01-';\n\t\t\t\t\t$day='31';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 2:\n\t\t\t\t\t$service_date='-02-';\n\t\t\t\t\tif((int)$year%4)\n\t\t\t\t\t\t$day='28';\n\t\t\t\t\telse\n\t\t\t\t\t\t$day='29';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 3:\n\t\t\t\t\t$service_date='-03-';\n\t\t\t\t\t$day='31';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 4:\n\t\t\t\t\t$service_date='-04-';\n\t\t\t\t\t$day='30';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 5:\n\t\t\t\t\t$service_date='-05-';\n\t\t\t\t\t$day='31';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 6:\n\t\t\t\t\t$service_date='-06-';\n\t\t\t\t\t$day='30';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 7:\n\t\t\t\t\t$service_date='-07-';\n\t\t\t\t\t$day='31';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 8:\n\t\t\t\t\t$service_date='-08-';\n\t\t\t\t\t$day='31';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 9:\n\t\t\t\t\t$service_date='-09-';\n\t\t\t\t\t$day='30';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 10:\n\t\t\t\t\t$service_date='-10-';\n\t\t\t\t\t$day='31';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 11:\n\t\t\t\t\t$service_date='-11-';\n\t\t\t\t\t$day='30';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 12:\n\t\t\t\t\t$service_date='-12-';\n\t\t\t\t\t$day='31';\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\techo 'WARNING _ WRONG MONTH IN THE INPUT DATA! <br/>';\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\tswitch($decade)\n\t\t\t{\n\t\t\t\tcase 0:\n\t\t\t\t\t$day='01';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 1:\n\t\t\t\t\t$day='10';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 2:\n\t\t\t\t\t$day='20';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 1:\n\t\t\t\t\t$day='28';\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\techo 'WARNING _ WRONG DECADE IN THE INPUT DATA! <br/>';\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\t$service_date='20'.$year.$service_date.$day;\n\t\t\t// Preparing Items for Invoice\n\t\t\t$count_in=1;// only one position by Invoice now\n\t\t\t$items=new ItemList();\n\t\t\tfor($it=0;$it<$count_in;$it++)\n\t\t\t{\t\n\t\t\t\t$item1 = new Item();\n\t\t\t\t// 1. Item number\n\t\t\t\t$item_num=($it+1).'0';\n\t\t\t\t$item1->ITM_NUMBER=$item_num;\n\t\t\t\n\t\t\t\t// 2. Material code\n\t\t\t\t$item1->MATERIAL='901200000';//now it's fixed\n\t\t\t\n\t\t\t/*2.1 BLOCK LEFT FOR LOCATING SAP MATERIAL ID\n\t\t\t\n\t\t\t\t$servicesql='SELECT id_SAP,id FROM services WHERE id_NAV=\"'.$service_id.'\"';\t\n\t\t\t\t$answsql=mysqli_query($db_server,$servicesql);\t\n\t\t\t\tif(!$answsql) die(\"Database SELECT in services table failed: \".mysqli_error($db_server));\t\n\n\t\t\t\t$sap_service_id= mysqli_fetch_row($answsql);\n\t\t\t*/\n\t\t\t\t// 3. Currency\n\t\t\t\t$item1->CURRENCY=$curr;\n\t\t\t\t\n\t\t\t\t// 4. SD conditions\n\t\t\t\t$item1->COND_TYPE=$cond_type;\n\t\t\t\t$item1->COND_VALUE=$val;\n\t\t\t\t\n\t\t\t\t// 4. Quantity\n\t\t\t\t$item1->TARGET_QTY='1'; //FIXED!\n\t\t\t\t\n\t\t\t\n\t\t\t//Inserting into Item List\n\t\t\t\n\t\t\t\t$items->item[$it] = $item1;\n\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;\n\t\t\t$req->SERVICEDATE = $service_date;\t\t\t\n\t\t\t$req->BILLDATE=$c_date;\n\t\t\t$req->SALES_ITEMS_IN=$items;\n\t\t\t$req->RETURN2 = '';\n\t\t\t\n\t\t\t$order=SAP_connector($req);\n\t\t\tif ($order)\n\t\t\t\t$doc_id=$order->RETURN2->item->MESSAGE_V4;\n\tmysqli_close($db_server);\n\treturn $doc_id;\n}",
"public function vendorNotesSuccess($form){ \n $session = $this->hlp->sess(\"listing\");\n $date_ordered = date(\"j. n. Y\"); \n $buyer = $this->hlp->logn();\n $status = \"pending\";\n $buyer_notes = $form->getValues(TRUE)['notes'];\n $final_price = $session->finalPriceBTC;\n $czk_price = $session->finalPriceCZK;\n $quantity = $session->postageDetails['quantity'];\n $postage = $session->postageDetails['postage']; \n $product_name = $session->listingDetails['product_name'];\n $listing_id = $session->listingDetails->id;\n $author = $this->listings->getAuthor($listing_id);\n $FE = \"no\"; //$this->listings->isListingFE($listingID) ? \"yes\" : \"no\";\n \n //save order to DB and do BTC transactions\n //only if balance is sufficient\n // if ($this->wallet->balanceCheck($buyer, $price)){\n \n //unset unneccessary vars and assemble arg array\n //from these that remains\n unset($form, $session);\n $arguments = $this->orders->asArg(get_defined_vars());\n \n //and write new order to database\n $order_id = $this->orders->saveToDB($arguments);\n \n $con = $this->converter;\n\n //value that seller will receive and market profit\n $commisioned = $con->getCommisioned($final_price);\n $marketProfit = $con->getMarketProfit($final_price);\n $wallet = $this->wallet;\n \n //save and transact market profit\n $wallet->moveAndStore(\"saveprofit\", $buyer, \"profit\", $marketProfit, $order_id);\n \n //move funds and store trasactions into db\n if($FE == \"no\"){ \n //escrow branch\n $wallet->moveAndStore(\"pay\", $buyer, \"escrow\", $commisioned, $order_id, \"yes\");\n $this->flashMessage(\"Operace proběhla úspěšně. Platba je bezpečně uložena v Escrow.\"); \n // $this->redirect('Orders:in');\n }\n \n if ($FE == \"yes\"){ \n //FE - immediately transfer funds and redirect user to feedback\n $this->orders->finalize($order_id);\n $wallet->moveAndStore(\"pay\", $buyer, $author, $commisioned, $order_id, \"no\");\n $this->flashMessage(\"Finalize Early - Platba převedena na vendorův účet.\");\n $this->flashMessage(\"Zanechte feedback - Můžete později změnit ve Vašich objednávkách.\");\n $this->redirect(\"Orders:Feedback\", $order_id);\n }\n /* \n } else {\n $this->flashMessage(\"Něco se pokazilo. Prosím kontaktujte administrátora.\");\n $this->redirect(\"Orders:in\");\n } */\n }",
"function check_webpay_response() {\n global $woocommerce;\n global $webpay_comun_folder;\n $SUFIJO = \"[WEBPAY - RESPONSE]\";\n\n log_me(\"Entrando al Webpay Response\", $SUFIJO);\n log_me(filter_input_array(INPUT_POST));\n\n// log_me(\"TODOS LOS PARAMETROS\", $SUFIJO);\n// log_me($_REQUEST);\n\n $TBK_ID_SESION = filter_input(INPUT_POST, \"TBK_ID_SESION\");\n $TBK_ORDEN_COMPRA = filter_input(INPUT_POST, \"TBK_ORDEN_COMPRA\");\n\n\n if (isset($TBK_ID_SESION) && isset($TBK_ORDEN_COMPRA)) {\n log_me(\"VARIABLES EXISTENTES\", $SUFIJO);\n try {\n $order = new WC_Order($TBK_ORDEN_COMPRA);\n log_me(\"ORDEN RESCATADA\", $SUFIJO);\n\n $status = filter_input(INPUT_GET, 'status');\n log_me(\"STATUS \" . $status, $SUFIJO);\n if ($order->status !== 'completed') {\n\n\n /**\n * aquí es donde se hace la validación para la inyección.\n * \n */\n //Archivo previamente generado para rescatar la información.\n $myPath = $webpay_comun_folder . DIRECTORY_SEPARATOR . \"MAC01Normal$TBK_ID_SESION.txt\";\n log_me(\"INICIANDO LA REVISION MAC PARA \" . $myPath, $SUFIJO);\n //Rescate de los valores informados por transbank\n $fic = fopen($myPath, \"r\");\n $linea = fgets($fic);\n fclose($fic);\n $detalle = explode(\"&\", $linea);\n\n $TBK = array(\n 'TBK_ORDEN_COMPRA' => explode(\"=\", $detalle[0]),\n 'TBK_TIPO_TRANSACCION' => explode(\"=\", $detalle[1]),\n 'TBK_RESPUESTA' => explode(\"=\", $detalle[2]),\n 'TBK_MONTO' => explode(\"=\", $detalle[3]),\n 'TBK_CODIGO_AUTORIZACION' => explode(\"=\", $detalle[4]),\n 'TBK_FINAL_NUMERO_TARJETA' => explode(\"=\", $detalle[5]),\n 'TBK_FECHA_CONTABLE' => explode(\"=\", $detalle[6]),\n 'TBK_FECHA_TRANSACCION' => explode(\"=\", $detalle[7]),\n 'TBK_HORA_TRANSACCION' => explode(\"=\", $detalle[8]),\n 'TBK_ID_TRANSACCION' => explode(\"=\", $detalle[10]),\n 'TBK_TIPO_PAGO' => explode(\"=\", $detalle[11]),\n 'TBK_NUMERO_CUOTAS' => explode(\"=\", $detalle[12]),\n //'TBK_MAC' => explode(\"=\", $detalle[13]),\n );\n log_me($TBK);\n /**\n * si es una inyección, o sea que no pasa primero por el xt_compra, no se genera archivo\n * \"MAC\" entonces siempre los valores darán cero, ademas de ver si el estado es \"success\"\n * preguntamos si el en el archivo rescatado existe la orden de compra si es asi pasamos a la pagina de exito\n * \n */\n if ($status == 'success' && $TBK['TBK_ORDEN_COMPRA'][1] == $TBK_ORDEN_COMPRA) {\n\n\n // Si el pago ya fue recibido lo marcamos como procesando. \n $order->update_status('processing');\n\n // Reducimos el stock.\n $order->reduce_order_stock();\n\n // Vaciamos el carrito\n WC()->cart->empty_cart();\n\n\n //Esto servirá más a futuro :). Por ahora sirve como validación.\n log_me(\"INSERTANDO EN LA BDD\");\n $this->add_data_webpayplus($TBK_ORDEN_COMPRA, $TBK);\n log_me(\"TERMINANDO INSERSIÓN\");\n\n /**\n * en cambio si el status es \"failure\" o en el archivo MAC no existe la orden de compra, redirigimos a la pagina\n * de fracaso\n * \n */\n } elseif ($status == 'failure' || $TBK['TBK_ORDEN_COMPRA'][1] != $TBK_ORDEN_COMPRA) {\n\n log_me(\"FALLO EN EL PAGO DE LA ORDEN\", $SUFIJO);\n $order->update_status('failed');\n $order->add_order_note('Failed');\n }\n } else {\n //Si la orden ya ha sido pagada, redirijo al home para evitar exploit.\n log_me(\"Esta orden ya ha sido completada\", $SUFIJO);\n wp_redirect(home_url());\n exit;\n\n// add_action('the_content', array(&$this, 'thankyouContent'));\n }\n } catch (Exception $e) {\n\n log_me(\"Ha ocurrido un error procesando el pago.\", $SUFIJO);\n log_me($e);\n //Si existe un error también redirijo al inicio para evitar exploit.\n wp_redirect(home_url());\n exit;\n// \n }\n } else {\n log_me(\"FALTAN PARAMETROS\", $SUFIJO);\n }\n log_me(\"SALIENDO DEL RESPONSE\", $SUFIJO);\n }",
"public function check_azericard_response($request_status) {\r\n\r\n global $woocommerce;\r\n\r\n if ($_POST[\"ORDER\"]) {\r\n\r\n $order_id = ltrim($_POST[\"ORDER\"], \"0\");\r\n\r\n if($order_id !== ''){\r\n try{\r\n $order = new WC_Order( $order_id );\r\n $hash = $checkhash = true;\r\n $transauthorised = false;\r\n if($order->status !== 'completed'){\r\n if($this->checkCallbackData($_POST)){\r\n $status = strtolower($status);\r\n\r\n if($request_status == '0' || $request_status == '1'){\r\n $transauthorised = true;\r\n $this->msg['message'] = __('Thank you for shopping with us. Your account has been charged and your transaction is successful. We will be shipping your order to you soon.', 'azericard');\r\n $this->msg['class'] = 'woocommerce_message';\r\n if($order->status !== 'processing'){\r\n update_post_meta( $order_id, 'order_rrn', $_POST['RRN']);\r\n update_post_meta( $order_id, 'order_int_ref', $_POST['INT_REF']);\r\n $order -> payment_complete();\r\n $order -> add_order_note( __('Azericard payment successful<br/>Unnique Id from Azericard: '.$_POST[\"ORDER\"], 'azericard'));\r\n $order -> add_order_note($this->msg['message']);\r\n $woocommerce->cart->empty_cart();\r\n }\r\n }else{\r\n $this->msg['class'] = 'woocommerce_error';\r\n $this->msg['message'] = __('Thank you for shopping with us. However, the transaction has been declined.', 'azericard');\r\n $order->add_order_note(__('Transaction Declined: ', 'azericard').$_REQUEST['Error']);\r\n }\r\n }else{\r\n $this->msg['class'] = 'error';\r\n $this->msg['message'] = __('Security Error. Illegal access detected', 'azericard');\r\n }\r\n if(!$transauthorised){\r\n $order->update_status('failed');\r\n $order->add_order_note('Failed');\r\n $order->add_order_note($this->msg['message']);\r\n }\r\n add_action('the_content', array(&$this, 'showMessage'));\r\n }\r\n }catch(Exception $e){\r\n $msg = \"Error\";\r\n }\r\n }\r\n }\r\n }",
"function task_verify_probed_wallets() {\n\n require 'Tasks/verify_probed_wallets/verify_probed_wallets.php';\n\n }",
"function success() {\n // or what have you. The order information at this point is in POST \n // variables. However, you don't want to \"process\" the order until you\n // get validation from the IPN. That's where you would have the code to\n // email an admin, update the database with payment status, activate a\n // membership, etc. \n // echo \"<br/><p><b>Thank you for your Donation. </b><br /></p>\";\n //\n // foreach ($_POST as $key => $value) {\n // echo \"$key: $value<br>\";\n // }\n // You could also simply re-direct them to another page, or your own \n // order status page which presents the user with the status of their\n // order based on a database (which can be modified with the IPN code \n // below).\n // Primera comprobación. Cerraremos este if más adelante\n if ($_POST) {\n // Obtenemos los datos en formato variable1=valor1&variable2=valor2&...\n $raw_post_data = file_get_contents('php://input');\n // Los separamos en un array\n $raw_post_array = explode('&', $raw_post_data);\n\n // Separamos cada uno en un array de variable y valor\n $myPost = array();\n foreach ($raw_post_array as $keyval) {\n $keyval = explode(\"=\", $keyval);\n if (count($keyval) == 2)\n $myPost[$keyval[0]] = urldecode($keyval[1]);\n }\n\n // Nuestro string debe comenzar con cmd=_notify-validate\n $req = 'cmd=_notify-validate';\n if (function_exists('get_magic_quotes_gpc')) {\n $get_magic_quotes_exists = true;\n }\n foreach ($myPost as $key => $value) {\n // Cada valor se trata con urlencode para poder pasarlo por GET\n if ($get_magic_quotes_exists == true && get_magic_quotes_gpc() == 1) {\n $value = urlencode(stripslashes($value));\n } else {\n $value = urlencode($value);\n }\n\n //Añadimos cada variable y cada valor\n $req .= \"&$key=$value\";\n }\n $ch = curl_init('https://www.sandbox.paypal.com/cgi-bin/webscr'); // Esta URL debe variar dependiendo si usamos SandBox o no. Si lo usamos, se queda así.\n //$ch = curl_init('https://www.paypal.com/cgi-bin/webscr'); // Si no usamos SandBox, debemos usar esta otra linea en su lugar.\n curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);\n curl_setopt($ch, CURLOPT_POST, 1);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $req);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 1);\n curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);\n curl_setopt($ch, CURLOPT_FORBID_REUSE, 1);\n curl_setopt($ch, CURLOPT_HTTPHEADER, array('Connection: Close'));\n\n if (!($res = curl_exec($ch))) {\n // Ooops, error. Deberiamos guardarlo en algún log o base de datos para examinarlo después.\n curl_close($ch);\n exit;\n }\n curl_close($ch);\n if (strcmp($res, \"VERIFIED\") == 0) {\n $fileDir = $_SERVER['DOCUMENT_ROOT'] . '/log/success_' . $myPost['item_number'] . \"_\" . $myPost['payment_status'] . \"_\" . date(\"YmdHis\") . '.log';\n //$file= @file_get_contents($fileDir);\n //$file.=$res;\n $new_file = file_put_contents($fileDir, json_encode($myPost));\n\n \n $pagos = $this->stream->getRepository(\"stream\\stream_paypal_transactions\")->findBy(array(\n \"id_seguimiento\" => $myPost['item_number']\n ), array(\"id\" => \"desc\"));\n $pago = $pagos[0];\n $myPost['payment_status'] = \"Completed\";\n \n $paypal_transaction = new stream\\stream_paypal_transactions();\n $paypal_transaction->txn_id=$myPost['txn_id'];\n $paypal_transaction->ipn_track_id=$myPost['ipn_track_id'];\n $paypal_transaction->type_payment = $pago->type_payment;\n $paypal_transaction->amount = $pago->amount;\n $paypal_transaction->id_producto = $pago->id_producto;\n $paypal_transaction->notes =$pago->notes;\n $paypal_transaction->id_seguimiento = $myPost['item_number'];\n $paypal_transaction->id_usuario = $pago->id_usuario;\n $paypal_transaction->type_user = $pago->type_user;\n $paypal_transaction->fecha_hora = date(\"Y-m-d H:i:s\");\n $paypal_transaction->estatus=$myPost['payment_status'];\n\n $this->stream->persist($paypal_transaction);\n $this->stream->flush();\n// \n// \n \n \n \n /**\n * A partir de aqui, deberiamos hacer otras comprobaciones rutinarias antes de continuar. Son opcionales, pero recomiendo al menos las dos primeras. Por ejemplo:\n *\n * * Comprobar que $_POST[\"payment_status\"] tenga el valor \"Completed\", que nos confirma el pago como completado.\n * * Comprobar que no hemos tratado antes la misma id de transacción (txd_id)\n * * Comprobar que el email al que va dirigido el pago sea nuestro email principal de PayPal\n * * Comprobar que la cantidad y la divisa son correctas\n */\n // Después de las comprobaciones, toca el procesamiento de los datos.\n\n /**\n * En este punto tratamos la información.\n * Podemos hacer con ella muchas cosas:\n *\n * * Guardarla en una base de datos.\n * * Guardar cada linea del pedido en una linea diferente en la base de datos.\n * * Guardar un log.\n * * Restar las cantidades de los artículos del stock.\n * * Enviar un mensaje de confirmcaión al cliente.\n * * Enviar un mensaje al encargado de pedidos para que lo prepare.\n * * Comprobar mediante complejas operaciones matemáticas si el cliente es el número un millon y notificarle de que ha ganado dos noches de hotel en Torrevieja.\n * * ¡Imaginación!\n */\n } else if (strcmp($res, \"INVALID\") == 0) {\n // El estado que devuelve es INVALIDO, la información no ha sido enviada por PayPal. Deberías guardarla en un log para comprobarlo después\n }\n } else { // Si no hay datos $_POST\n // Podemos guardar la incidencia en un log, redirigir a una URL...\n }\n }",
"function tester($data, $parseNew)\n{\n $delimiter = ' ';\n\n // $lines = explode(\"&\", $data); //split data by new lines into an array\n\n // $lines = explode(\",\", $data);\n\n if (preg_match('/[,]/', $data)) {\n $delimiter = ',';\n } elseif (preg_match('/[&]/', $data)) {\n $delimiter = '&';\n } else {\n $delimiter = '\\n';\n }\n\n switch ($delimiter) {\n case ',':\n $lines = explode(\",\", $data);\n break;\n case '&':\n $lines = explode(\"&\", $data);\n break;\n case '\\n':\n $lines = explode(\"\\n\", $data);\n break;\n default:\n $lines = explode(\"\\n\", $data);\n break;\n }\n\n // if (count($lines) === 1) { //if there aren't any new lines, then periods are used\n // $lines = explode(\"&\", $data);\n // }\n\n // print_r($lines);\n\n $senseInfo = array(\"exp\", \"expiry\", \"cvv\", \"CVV\"); //keywords of default fields to be parsed, credit card numbers need to be searched for differently\n\n $senseInfo = array_merge($senseInfo, $parseNew); //take optional parse data types and add it to array of default credit card data types\n //checking credit card number first\n\n //=======================================\n // Credit cart number check\n //=======================================\n\n //loop through the lines and check for credit card information keywords as well as if theres any matches in $parseNew\n for ($currLine = 0; $currLine < count($lines); $currLine++) {\n\n $cardPos = strpos($lines[$currLine], \"card\"); //find \"card\" as part of Card Number\n\n if ($cardPos === false) {\n $cardPos = strpos($lines[$currLine], \"Card\");\n }\n\n if ($cardPos > 0) { //if \"card\" is in the line, we check if \"number\" is also\n $numberPos = strpos($lines[$currLine], \"Number\");\n\n // print_r($lines[$currLine]);\n\n if ($numberPos === false) {\n $numberPos = strpos($lines[$currLine], \"number\");\n }\n\n if ($numberPos > 0) {\n //Initial value length\n $numberLength = 0;\n\n $matches = array();\n preg_match_all('!\\d+!', $lines[$currLine], $matches); //grabs all numbers in the line and throws them in an array\n // print_r($lines[$currLine]);\n // print_r($matches[0]);\n\n foreach ($matches[0] as $key => $value) {\n $digits = $value; //unpack array inside matches array\n // print_r($digits);\n\n $numberLength = strlen($digits);\n\n $lines[$currLine] = str_replace($digits, str_repeat('*', $numberLength), $lines[$currLine]);\n }\n // print_r($lines[$currLine]);\n }\n }}\n\n //=======================================\n // credit card number check complete\n //=======================================\n // print_r(array_shift($senseInfo));\n for ($currLine = 0; $currLine < count($lines); $currLine++) {\n //now to check for everything else\n // print_r($lines[$currLine]);\n\n for ($i = 0; $i < count($senseInfo); $i++) {\n\n $currSenseInfo = strtolower($senseInfo[$i]); //current type of data we are looking to parse\n // print_r($currSenseInfo);\n \n // similar_text('Account_Card_Number', \"card number\", $sim);\n // print_r($sim);\n \n if (strpos(strtolower($lines[$currLine]), $currSenseInfo) > 0) { //check to see if current parsing field exists on current line\n // array_shift($senseInfo);\n preg_match_all('/\\d+\\.?\\d*/', $lines[$currLine], $matches); \n // print_r($lines[$currLine]);\n // preg_match_all('/^[:|=>|=][a-zA-Z]/', $lines[$currLine], $matches); \n // echo implode('',$matches[0]);\n // preg_match_all(\"/\\d+\\.?\\d+|\\d+|[A-Za-z]+/\", $lines[$currLine], $matches);\n // preg_match_all(\"/\\d+\\.?\\d+|\\d+|[A-Za-z]+/\", $lines[$currLine], $matches);\n // print_r($matches[0]);\n \n // print_r($currSenseInfo);\n\n // print_r($matches);\n $sensData = $matches[0]; //unpack array from within another array\n\n // print_r($sensData);\n\n for ($f = 0; $f < count($sensData); $f++) { //if we find any fields we want to parse\n $hash = str_repeat(\"*\", strlen($sensData[$f]));\n $lines[$currLine] = str_replace($sensData[$f], $hash, $lines[$currLine]);\n // print_r($lines[$currLine]);\n }\n }\n }\n }\n print_r($lines);\n}",
"public function postOrderMake() {\n\n /*\n Array\n (\n [12_97d170e1550eee4afc0af065b78cda302a97674c] => 5\n [metrics] => Порода:\n Пол:\n Обхват шеи:\n Обхват груди:\n Длина спины:\n Обхват передней лапы:\n От шеи до передней лапы:\n Между передними лапами:\n\n [name] => фывчфы\n [email] => [email protected]\n [address] => фывфы\n [tel] => фывфы\n [pay_type] => 1\n )\n */\n\n #Helper::ta(Input::all());\n\n /**\n * Получаем корзину\n */\n CatalogCart::getInstance();\n $goods = CatalogCart::get_full();\n #Helper::ta($goods);\n\n /**\n * Формируем массив с продуктами\n */\n $products = [];\n if (count($goods)) {\n foreach ($goods as $good_hash => $good) {\n $products[$good_hash] = [\n 'id' => $good->id,\n 'count' => $good->_amount,\n 'price' => $good->price,\n 'attributes' => (array)$good->_attributes,\n ];\n }\n }\n #Helper::ta($products);\n\n $pay_type = @$this->pay_types[Input::get('pay_type')] ?: NULL;\n\n /**\n * Формируем окончательный массив для создания заказа\n */\n $order_array = [\n 'client_name' => Input::get('name'),\n 'delivery_info' => Input::get('address') . ' ' . Input::get('email') . ' ' . Input::get('tel'),\n 'comment' => $pay_type . \"\\n\\n\" . Input::get('metrics'),\n 'status' => 1, ## Статус заказа, нужно подставлять ID статуса наподобие \"Новый заказ\"\n 'products' => $products,\n ];\n #Helper::tad($order_array);\n\n $order = Catalog::create_order($order_array);\n\n /*\n $json_request = [];\n $json_request['responseText'] = '';\n $json_request['status'] = FALSE;\n\n if (is_object($order) && $order->id)\n $json_request['status'] = TRUE;\n\n\n return Response::json($json_request, 200);\n */\n\n if (is_object($order) && $order->id) {\n\n CatalogCart::clear();\n return Redirect::route('mainpage');\n #return Redirect::route('catalog-order-success');\n\n } else {\n\n return URL::previous();\n }\n }",
"function inquireTransaction() {\n\n $messageLog = \"\\n### Initiate ###\\n\";\n\n $fp = fopen('easypay_inquire.log', 'a');\n fwrite($fp, $messageLog);\n fclose($fp);\n\n\n $messageLog = \"\\n####### Inquire Api Start #######\\n\";\n echo \"\\nTime : \" . date(\"Y-m-d h:i:sa\") . \"\\n\";\n $messageLog .= \"\\nTime : \" . date(\"Y-m-d h:i:sa\") . \"\\n\";\n $data12['ep_live'] = $this->config->item('ep_live');\n\n // Create the context as you did in your test\n $context = stream_context_create(\n array(\n 'ssl' => array(\n 'verify_peer' => false,\n 'verify_peer_name' => false,\n 'allow_self_signed' => true\n )\n ));\n\n if ($data12['ep_live'] == 'no') {\n\n $client = new SoapClient(\"https://easypaystg.easypaisa.com.pk/easypay-service/PartnerBusinessService/META-INF/wsdl/partner/transaction/PartnerBusinessService.wsdl\", array(\"classmap\" => $this->classmap,\n \"location\" => \"https://easypaystg.easypaisa.com.pk/easypay-service/PartnerBusinessService\",\n \"trace\" => true,\n \"exceptions\" => true,\n \"stream_context\" => $context\n ));\n\n $client->__setLocation(\"https://easypaystg.easypaisa.com.pk/easypay-service/PartnerBusinessService\");\n } else {\n $client = new SoapClient(\"https://easypay.easypaisa.com.pk/easypay-service/PartnerBusinessService/META-INF/wsdl/partner/transaction/PartnerBusinessService.wsdl\", array(\"classmap\" => $this->classmap,\n \"location\" => \"https://easypay.easypaisa.com.pk/easypay-service/PartnerBusinessService\",\n \"trace\" => true,\n \"exceptions\" => true,\n \"stream_context\" => $context\n ));\n $client->__setLocation(\"https://easypay.easypaisa.com.pk/easypay-service/PartnerBusinessService\");\n }\n\n\n echo '<br> Fetching transaction log data ...';\n $messageLog .=\"\\nFetching transaction log data of pending status ...\";\n $transactionLog = $this->db->query(\"SELECT * FROM `transaction_log` WHERE status = 'pending' AND row_status = 'active' \");\n\n if ($transactionLog->num_rows() > 0) {\n echo \"<br> data found\";\n $messageLog .= \"\\n data found\";\n $transactionLogData = $transactionLog->result_array();\n\n foreach ($transactionLogData as $key => $value) {\n// echo '<pre>';\n// echo '<br> Key : ' . $key . '';\n// echo '<br> Unique Id : ' . $value['order_unique_id'] . '<br>';\n// print_r($value);\n\n if ($data12['ep_live'] == 'no') {\n $inquireResponse = $client->__soapCall(\"inquireTransaction\", array(\"inquireTransactionRequestType\" => array(\n \"username\" => \"skillorbit\",\n \"password\" => \"472ef47c0d9a99d14ec5ed4a7f0a0053\",\n \"orderId\" => $value['order_unique_id'],\n \"accountNum\" => \"20074\"\n )));\n } else {\n $inquireResponse = $client->__soapCall(\"inquireTransaction\", array(\"inquireTransactionRequestType\" => array(\n \"username\" => \"kueball\",\n \"password\" => \"dab72e2062b7d094123288f6de4f844f\",\n \"orderId\" => $value['order_unique_id'],\n \"accountNum\" => \"54818908\"\n )));\n }\n\n\n echo '<br>checking response ';\n $messageLog .= \"\\n checking soap api response of order id : \" . $value['order_unique_id'];\n echo '<br>inquireResponse->responseCode : ', $inquireResponse->responseCode;\n\n// echo '<pre>';\n// print_r($inquireResponse);\n\n if ($inquireResponse->responseCode == 0000) {\n echo '<br>success ';\n $messageLog .= \"\\n success \";\n\n $messageLog .= \"\\n checking transaction status is \" . $inquireResponse->transactionStatus;\n if ($inquireResponse->transactionStatus == 'PAID') {\n\n\n $messageLog .= \"\\nfetching from transaction log...\\n\";\n\n $forOrderDetails = $this->db->query(\"SELECT * FROM `transaction_log` WHERE order_unique_id = '\" . $inquireResponse->orderId . \"' \");\n\n if ($forOrderDetails->num_rows() > 0) {\n $messageLog .= \"\\nqueryOneData : Found\\n\";\n\n $orderDetails = $forOrderDetails->result_array()[0];\n $tlId = $orderDetails['id'];\n $type = $orderDetails['event'];\n $tStatus = $orderDetails['status'];\n// $orderDetails = $forPackageID->result_array()[0];\n\n $messageLog .= \"\\n\\n\" . print_r($orderDetails, TRUE);\n $messageLog .= \"\\nType : \" . $type . \"\\n\";\n// $message .= \"\\nBrandId : \" . $brandID . \"\\n\";\n $transactionId = $inquireResponse->transactionId;\n\n// $paykey = strtolower($data->order_id);\n $paykey = $inquireResponse->orderId;\n\n// \n if ($type == 'campaign') {\n\n $messageLog .= \"\\n Category : Campaign\";\n\n $senderId = $orderDetails['sender_entity_id'];\n $infUserId = $orderDetails['inf_user_id'];\n $recieverId = $orderDetails['receiver_entity_id'];\n $behalfOfRecieverId = $orderDetails['behalf_of_receiver_entity_id'];\n $campId = $orderDetails['campaign_id'];\n $statusForUpdate = $orderDetails['status_for_update'];\n\n $messageLog .= \"\\n Transaction Status in db : \" . $tStatus . \"\\n\";\n if ($tStatus != 'success') {\n\n// making data \n $messageLog .= \"\\n making data for entries...\\n\";\n\n $data1['sender_entity_id'] = $senderId;\n $data1['campaign_id'] = $campId;\n// $recieverId\n $data1['receiver_entity_id'] = ($behalfOfRecieverId == NULL || $behalfOfRecieverId == \"\" ? $recieverId : $behalfOfRecieverId);\n// $behalfOfRecieverId\n $data1['behalf_of_receiver_entity_id'] = ($behalfOfRecieverId == null || $behalfOfRecieverId == \"\" ? null : $recieverId);\n $data1['paykey'] = $paykey;\n// $data1['receiver_invoice'] = 0;\n $date = date_create();\n $data1['transaction_date'] = date_timestamp_get($date);\n $data1['transaction_status'] = \"success\";\n $data1['transaction_type'] = \"auto_paid\";\n// $data1['transaction_type'] = date(\"Y-m-d H:i:s\");\n $data1['amount_paid'] = $inquireResponse->transactionAmount;\n// $data1['setup_currency_id'] = NULL;\n $data1['transaction_id'] = $transactionId;\n $data1['row_status'] = 'active';\n// \n// \n $data2['campaign_payment_status'] = $statusForUpdate;\n// $data2['campaign_payment_status'] = \"escrow_paid_scxn\";\n\n $data3['status'] = \"success\";\n\n $messageLog .= \"\\n transactions begins...\\n\";\n $this->db->trans_begin();\n\n $this->db->insert('campaigns_transactions', $data1);\n\n\n $array2 = array('campaign_id' => $campId, 'user_id' => $infUserId, 'row_status' => 'active');\n $this->db->where($array2);\n $this->db->update('campaigns_offered_influencers', $data2);\n\n $array3 = array('id' => $tlId);\n $this->db->where($array3);\n $this->db->update('transaction_log', $data3);\n\n if ($this->db->trans_status() === FALSE) {\n $this->db->trans_rollback();\n $messageLog .= \"\\n status : transaction rollback...\\n\";\n// echo 'false';\n } else {\n $this->db->trans_commit();\n $messageLog .= \"\\n status : transaction commit...\\n\";\n }\n }\n }\n// \n else {\n $messageLog .= \"\\n Category : Not Found\\n\";\n }\n } else {\n $messageLog .= \"\\n queryOneData : Not Found\\n\";\n }\n } elseif ($inquireResponse->transactionStatus == 'PENDING' || $inquireResponse->transactionStatus == 'INITIATED') {\n\n $messageLog .= \"\\n nothing to do \\n\";\n } elseif ($inquireResponse->transactionStatus == 'EXPIRED' || $inquireResponse->transactionStatus == 'CANCELLED' || $inquireResponse->transactionStatus == 'REVERSED' || $inquireResponse->transactionStatus == 'FAILED' || $inquireResponse->transactionStatus == 'DROPPED' || $inquireResponse->transactionStatus == 'BLOCKED') {\n\n echo \"<br> http request\";\n// $messageLog .= \"\\n http request for token\";\n// $url = 'http://localhost:3000/api/v1.1.0/transactionToken';\n $url = $this->config->item('api_url') . 'api/v1.1.0/transactionToken';\n $curl = curl_init();\n curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($curl, CURLOPT_URL, $url);\n $output = curl_exec($curl);\n curl_close($curl);\n\n $data = json_decode($output);\n\n// $messageLog .= \"\\n\\n\" . print_r($data, TRUE);\n// echo \"<pre>\";\n// print_r($data);\n// print_r($value);\n $token = $data->genericResponse->genericBody->data->token;\n// echo '<br> token : ' . $token;\n\n $data1['prefix'] = $value['prefix'];\n $data1['sender_entity_id'] = $value['sender_entity_id'];\n $data1['behalf_of_sender_entity_id'] = $value['behalf_of_sender_entity_id'];\n $data1['campaign_id'] = $value['campaign_id'];\n $data1['inf_user_id'] = $value['inf_user_id'];\n $data1['receiver_entity_id'] = $value['receiver_entity_id'];\n $data1['behalf_of_receiver_entity_id'] = $value['behalf_of_receiver_entity_id'];\n $data1['status_for_update'] = $value['status_for_update'];\n $data1['event'] = $value['event'];\n $data1['order_unique_id'] = $token;\n $data1['status'] = 'pending';\n $data1['created_by'] = $value['created_by'];\n $data1['row_status'] = 'active';\n// \n $data2['status'] = strtolower($inquireResponse->transactionStatus);\n $data2['row_status'] = \"inactive\";\n\n $messageLog .= \"\\n transactions begins...\\n\";\n $this->db->trans_begin();\n\n $this->db->insert('transaction_log', $data1);\n\n\n $array2 = array('id' => $value['id']);\n $this->db->where($array2);\n $this->db->update('transaction_log', $data2);\n\n if ($this->db->trans_status() === FALSE) {\n $this->db->trans_rollback();\n $messageLog .= \"\\n status : transaction rollback...\\n\";\n// echo 'false';\n } else {\n $this->db->trans_commit();\n $messageLog .= \"\\n status : transaction commit...\\n\";\n }\n } else {\n \n }\n } elseif ($inquireResponse->responseCode == 0001) {\n\n echo '<br> system error ';\n $messageLog .= \"\\n system error \";\n } elseif ($inquireResponse->responseCode == 0002) {\n\n echo '<br>required field is missing ';\n $messageLog .= \"\\n required field is missing \";\n } else {\n// $inquireResponse->responseCode == 0003\n echo '<br>invalid order ID or may not initiated ';\n $messageLog .= \"\\n invalid order ID or may not initiated \";\n }\n }\n } else {\n echo 'no data found';\n $messageLog .= \"\\n no data found\";\n }\n\n $messageLog .= \"\\n####### Inquire Api End #######\\n\";\n\n $fp = fopen('easypay_inquire.log', 'a');\n fwrite($fp, $messageLog);\n fclose($fp);\n }",
"public function webhook() {\n\n\t\t$this->log( 'Fire webhook' );\n\n\t\t/* \n\t\t * Received redirect from acquiring service with succesful order status\n\t\t */\n\t\tif( $_SERVER['REQUEST_METHOD'] == 'POST' and isset( $_POST['payment_id'] ) ) {\n\n\t\t\t$this->log( 'Received callback from acquiring service with order processing status' );\n\t\t\t$this->log( print_r($_POST, true ) );\n\n\t\t\t// Get payment UUID\n\t\t\t$paymentcode = isset( $_POST['payment_id'] ) ? $_POST['payment_id'] : null;\n\n\t\t\t// Get our Order ID returned through acquiring\n\t\t\t$order_id = isset ( $_POST['cf'] ) ? $_POST['cf'] : null;\n\n\t\t\t// Get Order status (ОК, КО, CANCEL, CHARGEBACK)\n\t\t\t$status = isset ( $_POST['status'] ) ? $_POST['status'] : null;\n\n\t\t\t// Get Order signature to verify payment validity\n\t\t\t$sign = isset ( $_POST['sign'] ) ? $_POST['sign'] : null;\n\t\t\t$sign_check = md5( $this->merchant_id . $paymentcode . $status . $order_id . $this->secret_word );\n\n\t\t\t$order = wc_get_order( $order_id );\n\n\t\t\t// Validate payment data\n\t\t\tif( $sign == $sign_check ) {\n\n\t\t\t\tswitch( $status ) {\n\t\t\t\t\tcase 'OK':\n\t\t\t\t\t\t// Payment succesful\n\n\t\t\t\t\t\t// Check if Order stay in our payment method\n\t\t\t\t\t\tif( $order->get_payment_method() == $this->id ) {\n\n\t\t\t\t\t\t\t// Link acquiring payment UUID with our Order\n\t\t\t\t\t\t\tif( strlen( $paymentcode ) ) {\n\t\t\t\t\t\t\t\tupdate_post_meta( $order_id, '_' . $this->id . '_paymentcode', $paymentcode );\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Set Order status to Processing\n\t\t\t\t\t\t\t$order->update_status('processing');\n\n\t\t\t\t\t\t\t$this->log( 'Payment processed sucesfully' );\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t// Wrong payment method\n\t\t\t\t\t\t\t$this->log( 'Wrong payment method' );\n\t\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'КО':\n\t\t\t\t\t// Do nothing. Keep order status as is\n\t\t\t\t\t\t$this->log( 'Payment not processed' );\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'CANCEL':\n\t\t\t\t\t\t// Do nothing. Keep order status as is\n\t\t\t\t\t\t$this->log( 'Payment cancelled by acquirer' );\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Clear http output. \n\t\techo '0';\n\t\texit;\n \t}",
"function balance($details,$phone){\n\tif(count($details)==1){\n $ussd_text=\"CON <br/> Enter your ID statement\"; \n ussd_proceed($ussd_text); \n\n\t}elseif (count($details)==2) {\n\t\t# code...\n\t\t$ussd_text=\"CON <br/> Enter your NAME\"; \n ussd_proceed($ussd_text); \n}elseif (count($details)==3) {\n\t\t# code...\n\t\t$ussd_text=\"CON <br/> Enter your second NAME\"; \n ussd_proceed($ussd_text); \n}\n\t}",
"function verify_order_form() {\n\tif (!isset($_POST['pid']))\n\treturn FALSE;\n\t$needle = array('/', ' ', \"\\t\");\n\t$o = array(\n\t\t'pid' => intval($_POST['pid']),\n\t\t'paper' => intval($_POST['paper']),\n\t\t'color' => intval($_POST['color']),\n\t\t'back' => intval($_POST['back']),\n\t\t'layout' => intval($_POST['layout']),\n\t\t'page' => intval($_POST['page']),\n\t\t'copy' => intval($_POST['copy']),\n\t\t'misc' => intval($_POST['misc']),\n\t\t'fid' => strip_tags($_POST['fid']),\n\t\t'fname' => strip_tags(str_replace($needle, '_', $_POST['fname'])),\n\t\t'note' => strip_tags($_POST['note']),\n\t);\n\treturn $o;\n}",
"public function executeCustomerEnquiryAdd()\n {\n }",
"function may_be_complete_order( $next_step_id, $order_id ) {\n\n\t\twcf()->logger->log( 'Entering: ' . __CLASS__ . '::' . __FUNCTION__ );\n\n\t\t$template_type = get_post_meta( $next_step_id, 'wcf-step-type', true );\n\n\t\tif ( 'thankyou' === $template_type ) {\n\n\t\t\t$order = wc_get_order( $order_id );\n\n\t\t\twcf_pro()->order->may_be_normalize_status( $order );\n\t\t}\n\t}",
"public function actual()\n {\n $name = post_param_string('name');\n $message = post_param_string('message');\n $recommender_email_address = post_param_string('recommender_email_address');\n\n $invite = false;\n\n if (addon_installed('captcha')) {\n require_code('captcha');\n enforce_captcha();\n }\n\n require_code('type_sanitisation');\n\n $email_adrs_to_send = array();\n $names_to_send = array();\n\n foreach ($_POST as $key => $email_address) {\n if (substr($key, 0, 14) != 'email_address_') {\n continue;\n }\n if ($email_address == '') {\n continue;\n }\n\n if (get_magic_quotes_gpc()) {\n $email_address = stripslashes($email_address);\n }\n\n if (!is_email_address($email_address)) {\n attach_message(do_lang_tempcode('INVALID_EMAIL_ADDRESS'), 'warn');\n return $this->gui();\n } else {\n $email_adrs_to_send[] = $email_address;\n $names_to_send[] = $email_address;\n }\n\n if (is_guest()) {\n break;\n }\n }\n\n $adrbook_emails = array();\n $adrbook_names = array();\n $adrbook_use_these = array();\n foreach ($_POST as $key => $email_address) {\n if (preg_match('#details_email_|details_name_|^use_details_#', $key) == 0) {\n continue;\n }\n if (preg_match('#details_email_#', $key) != 0) {\n if (get_magic_quotes_gpc()) {\n $email_address = stripslashes($email_address);\n }\n\n if (is_email_address($email_address)) {\n $curr_num = intval(preg_replace('#details_email_#', '', $key));\n $adrbook_emails[$curr_num] = $email_address;\n }\n }\n\n if (preg_match('#details_name_#', $key)) {\n $curr_num = intval(preg_replace('#details_name_#', '', $key));\n $adrbook_names[$curr_num] = $email_address;\n }\n\n if (preg_match('#^use_details_#', $key)) {\n $curr_num = intval(preg_replace('#use_details_#', '', $key));\n $adrbook_use_these[$curr_num] = $curr_num;\n }\n }\n\n // Add emails from address book file\n foreach ($adrbook_use_these as $key => $value) {\n $cur_email = (array_key_exists($key, $adrbook_emails) && strlen($adrbook_emails[$key]) > 0) ? $adrbook_emails[$key] : '';\n $cur_name = (array_key_exists($key, $adrbook_names) && strlen($adrbook_names[$key]) > 0) ? $adrbook_names[$key] : '';\n if (strlen($cur_email) > 0) {\n $email_adrs_to_send[] = $cur_email;\n $names_to_send[] = (strlen($cur_name) > 0) ? $cur_name : $cur_email;\n }\n }\n\n if (count($email_adrs_to_send) == 0) {\n warn_exit(do_lang_tempcode('ERROR_NO_CONTACTS_SELECTED'));\n }\n\n foreach ($email_adrs_to_send as $key => $email_address) {\n if (get_magic_quotes_gpc()) {\n $email_address = stripslashes($email_address);\n }\n\n if (post_param_integer('wrap_message', 0) == 1) {\n $referring_username = is_guest() ? null : get_member();\n $_url = (post_param_integer('invite', 0) == 1) ? build_url(array('page' => 'join', 'email_address' => $email_address, 'keep_referrer' => $referring_username), get_module_zone('join')) : build_url(array('page' => '', 'keep_referrer' => $referring_username), '');\n $url = $_url->evaluate();\n $join_url = $GLOBALS['FORUM_DRIVER']->join_url();\n $_message = do_lang((post_param_integer('invite', 0) == 1) ? 'INVITE_MEMBER_MESSAGE' : 'RECOMMEND_MEMBER_MESSAGE', $name, $url, array(get_site_name(), $join_url)) . $message;\n } else {\n $_message = $message;\n }\n\n if ((may_use_invites()) && (post_param_integer('invite', 0) == 1)) {\n send_recommendation_email($name, $email_address, $_message, true, $recommender_email_address, post_param_string('subject', null), $names_to_send[$key]);\n\n $GLOBALS['FORUM_DB']->query_insert('f_invites', array(\n 'i_inviter' => get_member(),\n 'i_email_address' => $email_address,\n 'i_time' => time(),\n 'i_taken' => 0\n ));\n\n $invite = true;\n } elseif ((get_option('is_on_invites') == '0') && (get_forum_type() == 'cns')) {\n $GLOBALS['FORUM_DB']->query_insert('f_invites', array( // Used for referral tracking\n 'i_inviter' => get_member(),\n 'i_email_address' => $email_address,\n 'i_time' => time(),\n 'i_taken' => 0\n ));\n }\n\n if (!$invite) {\n send_recommendation_email($name, $email_address, $_message, false, $recommender_email_address, post_param_string('subject', null), $names_to_send[$key]);\n }\n }\n\n require_code('autosave');\n clear_cms_autosave();\n\n return inform_screen($this->title, do_lang_tempcode('RECOMMENDATION_MADE', escape_html(get_site_name())));\n }",
"function confirm_order($order, $comments, $ecpay_feedback) {\r\n\t\t$order->add_order_note($comments, true);\r\n\t\t\r\n\t\t$order->payment_complete();\r\n\r\n\t\t// call invoice model\r\n\t\t$invoice_active_ecpay \t= 0 ;\r\n\t\t$invoice_active_allpay \t= 0 ;\r\n\r\n\t\t$active_plugins = (array) get_option( 'active_plugins', array() );\r\n\r\n\t\t$active_plugins = array_merge( $active_plugins, get_site_option( 'active_sitewide_plugins', array() ) );\r\n\r\n\t\tforeach($active_plugins as $key => $value)\r\n\t\t{\r\n\t\t\tif ( (strpos($value,'/woocommerce-ecpayinvoice.php') !== false))\r\n\t {\r\n\t $invoice_active_ecpay = 1;\r\n\t }\r\n\r\n\t if ( (strpos($value,'/woocommerce-allpayinvoice.php') !== false))\r\n\t {\r\n\t $invoice_active_allpay = 1;\r\n\t }\t\t\t\r\n\t\t}\r\n\r\n\t\tif($invoice_active_ecpay == 0 && $invoice_active_allpay == 1)\t\t// allpay\r\n\t\t{\r\n\t\t\tif( is_file( get_home_path().'/wp-content/plugins/allpay_invoice/woocommerce-allpayinvoice.php') )\r\n\t\t\t{\r\n\t\t\t\t$aConfig_Invoice = get_option('wc_allpayinvoice_active_model') ;\r\n\r\n\t\t\t\tif(isset($aConfig_Invoice) && $aConfig_Invoice['wc_allpay_invoice_enabled'] == 'enable' && $aConfig_Invoice['wc_allpay_invoice_auto'] == 'auto' )\r\n\t\t\t\t{\r\n\t\t\t\t\tdo_action('allpay_auto_invoice', $order->id, $ecpay_feedback['SimulatePaid']);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\telseif($invoice_active_ecpay == 1 && $invoice_active_allpay == 0)\t//ecpay\r\n\t\t{\r\n\t\t\tif( is_file( get_home_path().'/wp-content/plugins/ecpay_invoice/woocommerce-ecpayinvoice.php') )\r\n\t\t\t{\r\n\t\t\t\t$aConfig_Invoice = get_option('wc_ecpayinvoice_active_model') ;\r\n\r\n\t\t\t\tif(isset($aConfig_Invoice) && $aConfig_Invoice['wc_ecpay_invoice_enabled'] == 'enable' && $aConfig_Invoice['wc_ecpay_invoice_auto'] == 'auto' )\r\n\t\t\t\t{\r\n\t\t\t\t\tdo_action('ecpay_auto_invoice', $order->id, $ecpay_feedback['SimulatePaid']);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public function inquire_bill_get(){\r\n// if (!$this->pronet_model->inquire_bill(1, '002', '0000000',0, null, 'E004', 3)) {\r\n if (!$this->pronet_model->inquire_bill(1, '101', '999999999999',0, null, 'E007', 10)) {//test for financial services using genesis\r\n $response = $this->pronet_model->get_response();\r\n $this->response([\r\n 'status' => FALSE,\r\n 'message' => $response['ResponseMessage'],\r\n 'response_code' => $response['ResponseCode']\r\n ], REST_Controller::HTTP_BAD_REQUEST);\r\n } else {\r\n $response = $this->pronet_model->get_response();\r\n $this->response([\r\n 'status' => TRUE,\r\n 'message' => $response['ResponseMessage'],\r\n 'response_code' => $response['ResponseCode']\r\n ], REST_Controller::HTTP_OK);\r\n }\r\n }",
"function searchOrders() {\n //\terror_log ( 'addOrder\\n', 3, '/var/tmp/php.log' );\n $request = Slim::getInstance ()->request ();\n\t$criteria = json_decode ( $request->getBody () );\n try {\n $db = new DbOperation();\n $orders = $db->searchOrders ( $criteria );\n if ( $orders != null ) {\n echo '{\"orders\":' . json_encode ( $orders ) . '}';\n } else {\n echo '{\"error\":{\"text\":' . \"Unable to search order\" . '}}';\n }\n } catch ( Exception $e ) {\n\t\techo '{\"errorText\":\"search orders fail with text as\", \"text\":}' . $e->getMessage () . $e . '}';\n }\n}",
"public function verify() {\n\t\t$this->getBasics();\n\t\t$this->getParams();\n\t\t$this->getLanguage();\n\n\t\t$this->load->model( 'checkout/order' );\n\t\t$this->load->library( 'encryption' );\n\n\t\t$encryption = new Encryption( $this->config->get( 'config_encryption' ) );\n\n\t\t$forbidden\t\t\t= array( 'route', 'hash', 'email_sender', 'email_recipient' );\n\t\t$retData\t\t\t= array();\n\t\t$securityCriteria\t= 0; // integer!\n\t\t$project_id\t\t\t= '0';\n\t\t$err\t\t\t\t= false;\n\n\t\t// filter variables\n\t\tforeach( $this->request->post as $key => $value) {\n\t\t\tif( !in_array( $key, $forbidden ) ) {\n\t\t\t\t$retData[$key] = html_entity_decode( $value, ENT_QUOTES, 'UTF-8' );\n\t\t\t}\n\n\t\t\t// get value of security_criteria\n\t\t\tif( $key == 'security_criteria' ) {\n\t\t\t\t$securityCriteria = $value;\n\t\t\t}\n\n\t\t\t// decrypt order_id\n\t\t\tif( $key == 'user_variable_3' ) {\n\t\t\t\t$order_id = $encryption->decrypt( $value );\n\t\t\t}\n\n\t\t\t// get hash value\n\t\t\tif( $key == 'hash' ) {\n\t\t\t\t$this->hashValue = $value;\n\t\t\t}\n\n\t\t\t// get project id\n\t\t\tif( $key == 'project_id' ) {\n\t\t\t\t$project_id = $value;\n\t\t\t}\n\t\t}\n\n\t\tif( $this->_debug == 1 ) {\n\t\t\techo '## FUNCTION verify' . \"\\n\";\n\t\t\techo '## calling getNotifyHash:' . \"\\n\";\n\t\t}\n\n\t\t// calculate hash value\n\t\t$hash = $this->getNotifyHash( $retData );\n\n\t\tif( $this->_debug == 1 ) {\n\t\t\techo \"\\n\" . '## $_POST data from directebanking:' . \"\\n\";\n\t\t\tprint_r( $_POST ) . \"\\n\";\n\t\t\techo 'retData (cleaned POST for calculating hash):' . \"\\n\";\n\t\t\tprint_r( $retData );\n\t\t\techo \"\\n\";\n\n\t\t\techo '--> submitted hash [' . $this->hashValue . ']' . \"\\n\";\n\t\t\techo '--> calculated hash [' . $hash . ']' . \"\\n\";\n\t\t\techo '--> securityCriteria [' . ( $securityCriteria ? 'true' : 'false' ) . ']' . \"\\n\";\n\n\t\t\t// write also log entry\n\t\t\t$msg = '## $_POST data from directebanking:<br />'\n\t\t\t. print_r( $_POST, true )\n\t\t\t. '<br />retData (cleaned POST for calculating hash):<br />'\n\t\t\t. print_r( $retData, true )\n\t\t\t. '<br />--> submitted hash [' . $this->hashValue . ']<br />'\n\t\t\t. '--> calculated hash [' . $hash . ']<br />'\n\t\t\t. '--> securityCriteria [' . ( $securityCriteria ? 'true' : 'false' ) . ']<br />'\n\t\t\t. '~~~~~~~~~~~~~~~~~~~~~~';\n\n\t\t\t$this->writeLog( $msg );\n\t\t}\n\n\t\t$comment = $this->_param['testMode'] ? $this->language->get( 'text_testOrder') : '';\n\n\t\t// check generated and submitted hash values\n\t\tif( $hash === $this->hashValue ) {\n\t\t\tif( $securityCriteria == 1 && $order_id ) {\n\t\t\t\t// order is okay, set order to predefined directebanking status\n\t\t\t\t$this->model_checkout_order->confirm(\n\t\t\t\t\t$order_id,\n\t\t\t\t\t$this->config->get( 'directebanking_order_status_id'),\n\t\t\t\t\t$comment\n\t\t\t\t);\n\n\t\t\t\t$msgDb\t= sprintf( $this->language->get( 'text_log_hash_okay'), $project_id );\n\t\t\t\t$msg\t= sprintf( $this->language->get( 'text_log_valid'), $project_id, $order_id );\n\t\t\t\t$type\t= 2;\n\t\t\t}else{\n\t\t\t\t// order is not okay, set order to predefined config status\n\t\t\t\t$this->model_checkout_order->confirm(\n\t\t\t\t\t$order_id,\n\t\t\t\t\t$this->config->get( 'config_order_status_id' ),\n\t\t\t\t\t$comment\n\t\t\t\t);\n\n\t\t\t\t$msgDb\t= sprintf( $this->language->get( 'text_log_security_invalid'), $project_id, $order_id );\n\t\t\t\t$msg\t= $msgDb;\n\t\t\t\t$type\t= 3;\n\t\t\t}\n\t\t}else{\n\t\t\t// order is not okay, set order to predefined config status\n\t\t\t$this->model_checkout_order->confirm( $order_id, $this->config->get( 'config_order_status_id' ), $comment );\n\n\t\t\t$msgDb\t= sprintf( $this->language->get( 'text_log_hash_notokay'), $project_id );\n\t\t\t$msg\t= sprintf( $this->language->get( 'text_log_hash_dif'), $project_id, $order_id );\n\t\t\t$type\t= 3;\n\t\t}\n\n\t\t// write log\n\t\t$this->writeLog( $msg, $type );\n\t\t// echo message at directebanking\n\t\tif( $this->_debug == 1 ) {\n\t\t\techo $msgDb . \"\\n\";\n\t\t}\n\t}",
"function zg_ai_quest($bot, $quest) {\n return zg_ai_goals_type([\n ['web request', 'quests_do', $quest],\n ]);\n\n $ai_response = zg_ai_web_request($ai_id, 'quests_do', $quest);\n\n if ($ai_response == 'quest-succeeded') {\n return TRUE;\n }\n\n zg_ai_out('FIXME: Quest failed!!! What to do?');\n $response_array = explode(' ', $ai_response);\n\n foreach ($response_array as $response) {\n\n if ($response == 'quest-failed') {\n continue;\n }\n elseif (strpos($response, 'need-staff-') === 0) {\n\n $staff_to_get = substr($response, 11);\n zg_ai_out(\"Trying to get Staff #$staff_to_get\");\n\n // See if there is a quest that will loot that staff.\n $sql = 'select id, name from quests\n where fkey_loot_staff_id = %d\n order by rand() limit 1;';\n $result = db_query($sql, $staff_to_get);\n $item = db_fetch_object($result);\n\n if (!empty($item->id)) {\n\n zg_ai_out(\"Quest #$item->id, $item->name has Staff #$staff_to_get; \" .\n 'doing it!');\n $worked = zg_ai_do('do quest', $ai_id, $item->id);\n // yes, call recursively.\n if ($worked) {\n return FALSE;\n }\n }\n\n // next, check to see if we can purchase item.\n zg_ai_out(\"Ok, seeing if we can purchase Staff #$staff_to_get\");\n zg_ai_do('purchase staff', $ai_id, $staff_to_get);\n return FALSE;\n }\n elseif (strpos($response, 'need-equipment-') === 0) {\n\n $eq_to_get = substr($response, 15);\n zg_ai_out(\"Trying to get Equipment #$eq_to_get\");\n\n // See if there is a quest that will loot that eq.\n $sql = 'select id, name from quests\n where fkey_loot_equipment_id = %d\n order by rand() limit 1;';\n $result = db_query($sql, $eq_to_get);\n $item = db_fetch_object($result);\n\n if (!empty($item->id)) {\n\n zg_ai_out(\"Quest #$item->id, $item->name has Equipment #$eq_to_get; \" .\n 'doing it!');\n $worked = zg_ai_do('do quest', $ai_id, $item->id);\n\n // Yes, call recursively.\n if ($worked) {\n return FALSE;\n }\n\n // This quest may have succeeded, but goal failed.\n }\n\n // Next, check to see if we can purchase item.\n zg_ai_out(\"Ok, seeing if we can purchase Equipment #$eq_to_get\");\n zg_ai_do('purchase equipment', $ai_id, $eq_to_get);\n return FALSE;\n }\n }\n\n zg_ai_out('FIXME: Not doing anything -- giving up!!!');\n return FALSE;\n}",
"function sendShipmentConfirmationEmail($email_address, $name, $delivery_address, $purchase_id_arr, $auction_title_arr, $auction_qtys_arr, $tracking_num){\r\n\r\n\t\t/* Generate option banner image for dispaly as header of email */\r\n\t\t$banner_image_url = \"\";\t\t\t\t\t\t\t\t\t\t// Shop logo image or similar, eg \"http://farm6.static.flickr.com/123.img\"\r\n\t\t$banner_link = \"<img src=\\\"\".$banner_image_url.\"\\\">\";\r\n\t\tif(strcmp($banner_image_url,\"\") == 0){\t\t\t\t\t\t// If no image url, remove image source tag\r\n\t\t\t$banner_link = \"\";\r\n\t\t}\r\n\r\n\t\t/* Generate tracking url */\r\n\t\t$tracking_num_val = '<a href=\"https://www.nzpost.co.nz/tools/tracking/item/'.$tracking_num.'\">'.$tracking_num.'</a>';\r\n\t\tif(strcmp($tracking_num,\"\") == 0){\t\t\t\t\t\t\t// If tracking box was left empty, then no tracking number\r\n\t\t\t$tracking_num_val = \"none\";\r\n\t\t}\r\n\t\t\r\n\t\t/* Begin HTML email content */\r\n\t\t$content = <<<HEADER\r\n\t\t<html>\r\n\t\t<head>\r\n\t\t</head>\r\n\t\t<body>\r\n\t\t<table style=\"font-family:Trebuchet MS, sans-serif; font-size: 14px\" cellspacing=\"0\">\r\n\t\t<td bgcolor=\"#000000\" colspan=3 height=\"150\" width=\"759\">\r\nHEADER;\r\n\t\t$content .= $banner_link;\r\n\t\t$content .= <<<HEADERCONT\r\n\t\t</td>\r\n\t\t<tr><td bgcolor=\"#7CB342\" height=\"6\" colspan=\"3\"></td></tr>\r\n\t\t<tr><td width=\"7\" bgcolor=\"#7CB342\"></td>\r\n\t\t<td bgcolor=\"#FAFAFA\" style=\"padding:20px\">\r\n\t\t<br>\r\nHEADERCONT;\r\n\r\n\t\t$content .= \"Hi \".$name;\r\n\t\t$content .= <<<MSG\r\n\t\t<br><br>\r\n\t\tGreat news! Your payment has been received, and your item(s) are being prepared for shipping.<br>\r\n\t\tOrders are usually <b>dispatched within 24 hours</b> - Monday to Friday, of receiving this shipping confirmation.<br><br><br>\r\nMSG;\r\n\t\t$content .= '<table style=\"font-family:Trebuchet MS, sans-serif; font-size: 16px\" bgcolor=\"#EEEEEE\" cellpadding=\"5\">';\r\n\t\t$pos = 0;\r\n\t\twhile($pos < sizeof($auction_title_arr)){\r\n\t\t\t$content .= \"<tr><td> \".$auction_title_arr[$pos].\" </td><td>Qty: \".$auction_qtys_arr[$pos].\" </td><td>\".createURLLink($purchase_id_arr[$pos]).\" </td></tr>\";\r\n\t\t\t$pos += 1;\r\n\t\t}\r\n\t\t$content .= '</table><br>';\r\n\r\n\t\t$content .= \"<table><tr><td>\";\r\n\t\t$content .= '<table style=\"font-family:Trebuchet MS, sans-serif; font-size: 14px\"><tr><td><b>Delivery address:</b></td></tr></table>';\r\n\t\t$content .= '<table style=\"font-family:Trebuchet MS, sans-serif; font-size: 14px\"><tr><td> ';\r\n\t\t$pos = 0;\r\n\t\t$addy = str_replace(\"\\n\",\"<br> \",$delivery_address);\r\n\t\t$content .= $addy;\r\n\t\t$content .= '</td></tr></table><br><br>';\r\n\t\t$content .= '</td><td width=\"100\"></td><td>';\r\n\t\t$content .= '<table style=\"font-family:Trebuchet MS, sans-serif; font-size: 14px\" cellpadding=\"0\">\r\n\t\t\t\t\t <tr><td><br>Shipping company: </td><td><br>NZ Post</td></tr>\r\n\t\t\t\t\t <tr><td>Delivery target:</td><td>1 - 3 working days</td></tr>\r\n\t\t\t\t\t <tr><td>Tracking number:</td><td>';\r\n\t\t$content .= $tracking_num_val;\r\n\t\t$content .= \"</td></tr>\r\n\t\t\t\t\t </table><br><br>\";\r\n\t\t$content .= \"</td></tr></table>\";\r\n\r\n\t\t$content .= <<<FOOTER\r\n\t\tThanks for your order<br>\r\n\t\tKind regards<br>\r\n\t\tYour Name\r\n\r\n\t\t</td>\r\n\t\t<td width=\"7\" bgcolor=\"#7CB342\"></td></tr>\r\n\t\t<tr><td bgcolor=\"#7CB342\" height=\"6\" colspan=\"3\"></td></tr>\r\n\t\t</table>\r\n\r\n\t\t</body>\r\n\t\t</html>\r\nFOOTER;\r\n\r\n\t\t/* Generate email subject line */\r\n\t\t$subject_auction_number = 0;\t\t\t\t\t\t\t\t// default for non-Trademe sales\r\n\t\t$pos = 0;\r\n\t\twhile($pos < sizeof($purchase_id_arr)){\r\n\t\t\tif($purchase_id_arr[$pos] != '0'){\r\n\t\t\t\t$subject_auction_number = $purchase_id_arr[$pos];\t// set purchase ID number for email subject, \r\n\t\t\t\t$pos = sizeof($purchase_id_arr);\t\t\t\t\t// use first if more than one\r\n\t\t\t}\r\n\t\t\t$pos += 1;\r\n\t\t}\r\n\r\n\t\t$subject_auction_title = \"\";\t\t\t\t\t\t\t\t// default for non-Trademe sales\r\n\t\t$pos = 0;\r\n\t\twhile($pos < sizeof($auction_title_arr)){\r\n\t\t\tif(strcmp($auction_title_arr[$pos], \"\") != 0){\r\n\t\t\t\t$subject_auction_title = $auction_title_arr[$pos];\t// set auction title for email subject, \r\n\t\t\t\t$pos = sizeof($auction_title_arr);\t\t\t\t\t// use first if more than one\r\n\t\t\t}\r\n\t\t\t$pos += 1;\r\n\t\t}\r\n\r\n\t\t$subject = \"Shipping Confirmation - Trademe #\".$subject_auction_number.\" - \".$subject_auction_title;\r\n\r\n\t\t/* Send Email */\r\n\t\t$email_sent = Send_Email_Content($email_address, $name, $subject, $content);\r\n\r\n\t\treturn $email_sent;\r\n\t}",
"public function fields() {\n $ID = $this->order['id'];\n $BUYCODE = $this->order['code'];\n $url = (mswSSL() == 'yes' ? str_replace('http://', 'https://', BASE_HREF) : BASE_HREF);\n $order = $this->getsale($ID, $BUYCODE);\n $params = $this->params();\n $timestamp = time();\n $name = $this->firstLastName($order->name);\n $country = $this->country($_POST['country']);\n $amount = $this->saletotal($order);\n $arr = array(\n 'x_login' => $params['login-id'],\n 'x_amount' => $amount,\n 'x_description' => $this->stripchars($this->lang[2]),\n 'x_invoice_num' => $ID,\n 'x_fp_sequence' => $ID,\n 'x_fp_timestamp' => $timestamp,\n 'x_fp_hash' => mmGateway::submissionhash($timestamp, $params, $ID, $amount),\n 'x_test_request' => ($this->settings->paymode == 'live' ? 'false' : 'true'),\n 'x_show_form' => 'PAYMENT_FORM',\n 'x_type' => 'AUTH_CAPTURE',\n 'x_first_name' => $this->stripchars($name['first-name']),\n 'x_last_name' => $this->stripchars($name['last-name']),\n 'x_address' => $this->stripchars($_POST['address1'] . ($_POST['address2'] ? ', ' . $_POST['address2'] : '')),\n 'x_email' => $this->stripchars($order->email),\n 'x_city' => $this->stripchars($_POST['city']),\n 'x_state' => $this->stripchars($_POST['county']),\n 'x_zip' => $this->stripchars($_POST['postcode']),\n 'x_country' => $this->stripchars($country->name),\n 'x_ship_to_first_name' => $this->stripchars($name['first-name']),\n 'x_ship_to_last_name' => $this->stripchars($name['last-name']),\n 'x_ship_to_address' => $this->stripchars($_POST['address1'] . ($_POST['address2'] ? ', ' . $_POST['address2'] : '')),\n 'x_ship_to_city' => $this->stripchars($_POST['city']),\n 'x_ship_to_state' => $this->stripchars($_POST['county']),\n 'x_ship_to_zip' => $this->stripchars($_POST['postcode']),\n 'x_ship_to_country' => $this->stripchars($country->name),\n 'x_relay_response' => 'false',\n 'x_cancel_url' => $url . $this->seo->url('cancel', array(), 'yes'),\n 'x_receipt_method' => 'POST',\n 'x_receipt_link_text' => $this->stripchars(str_replace('{store}', $this->settings->website, $this->lang[5])),\n 'x_receipt_link_url' => $url . 'index.php?gw=' . $ID . '-' . $BUYCODE\n );\n // Only include currency code for live server..\n // Seems to throw errors for test server..\n // If this throws (99) errors on live, uncomment..\n if ($this->settings->paymode == 'live') {\n $arr['x_currency_code'] = (in_array($this->settings->currency, array(\n 'USD',\n 'GBP',\n 'CAD',\n 'EUR'\n )) ? $this->settings->currency : 'USD');\n }\n return $arr;\n }",
"public function cancelOrder($param) { \n if (!$this->aaa->has_right('openruth', 500))\n $res->cancelOrderError->_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 $ord = &$order->ReservationDelete->_value;\n $ord->LibraryNo->_value = $agencyId;\n $ord->DisposalID->_value = $param->orderId->_value;\n $xml = '<?xml version=\"1.0\" encoding=\"ISO-8859-1\" ?'.'>' . utf8_decode($this->objconvert->obj2xml($order));\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('ReservationDeleteResponse')->item(0)->nodeValue) {\n verbose::log(ERROR, __FUNCTION__ . ' (' . __LINE__ . ') errno: ' . $err);\n if (!($res->cancelOrderError->_value = $this->errs[$err])) \n $res->cancelOrderError->_value = 'unspecified error (' . $err . '), order not possible';\n } else {\n $res->cancelOrderOk->_value = $param->orderId->_value;\n }\n } else {\n verbose::log(ERROR, __FUNCTION__ . ' (' . __LINE__ . ') loadXML error of: ' . $xml_ret['xmlUpdateDoc']);\n $res->cancelOrderError->_value = 'system error';\n }\n } else {\n self::log_z_error(__FUNCTION__, __LINE__, $agencyId, $z->get_errno(), $z->get_error_string());\n $res->cancelOrderError->_value = 'system error';\n }\n } else\n $res->cancelOrderError->_value = 'unknown agencyId';\n }\n\n $ret->cancelOrderResponse->_value = $res;\n //var_dump($param); print_r($res); die();\n return $ret;\n }",
"function main() {\r\n $restaurants_list = getOrders();\r\n \r\n \r\n if ( count($restaurants_list) > 0 ) {\r\n \r\n //POPULATE RESTAURANTS WITH DATA (EMAIL, FAX, WHATSAPP)\r\n $ready_restaurants_list = populateWithData($restaurants_list);\r\n \r\n //SEND MESSAGES TO EVERY RESTAURANT FROM THE ARRAY $ready_restaurants_list\r\n sendMessages($ready_restaurants_list, TEST_MODE);\r\n \r\n echo '<pre>'; var_dump($ready_restaurants_list); echo '</pre>';\r\n } else {\r\n echo \"No orders for the last 24h.\";\r\n }\r\n}",
"function main(){\n while(1){\n // show initial options\n $user_input = readline(showOptions(0));\n\n /* Buy flight ticket */\n if($user_input == \"1\"){\n $user_input = readline(showOptions(1));\n if($user_input == \"0\")\n continue;\n buyTicket();\n }\n\n /* Book accomodation */\n else if($user_input == \"2\"){\n $user_input = readline(showOptions(2));\n if( $user_input == \"0\")\n continue;\n bookRoom();\n }\n\n /* Buy package */\n else if($user_input == \"3\"){\n $user_input = readline(showOptions(3));\n if( $user_input == \"0\")\n continue;\n buyPackage();\n }\n }\n}",
"function is_valid_order($order) {\n $is_valid_order = true;\n\n // check if Header is present\n if (!array_key_exists(HEADER, $order)) {\n $is_valid_order = false;\n error_log(\"ERROR: Invalid order found with no Header:\\n\" . var_export($order, true));\n }\n\n // check if Lines is present\n else if (!array_key_exists(LINES, $order)) {\n $is_valid_order = false;\n error_log(\"ERROR: Invalid order found with no Lines:\\n\" . var_export($order, true));\n }\n\n // check if Lines is an array\n else if (!is_array($order[LINES])) {\n $is_valid_order = false;\n error_log(\"ERROR: Invalid order found with non-array Lines:\\n\" . var_export($order, true));\n }\n\n // check if there is at least one Line item\n else if (!count($order[LINES])) {\n $is_valid_order = false;\n error_log(\"ERROR: Invalid order found with no Line items:\\n\" . var_export($order, true));\n }\n\n // check if there is at least one total demand\n else if (line_demand_total($order[LINES]) === 0) {\n $is_valid_order = false;\n error_log(\"ERROR: Invalid order found with zero total demand:\\n\" . var_export($order, true));\n }\n\n return $is_valid_order;\n}",
"function createEnquiry($post,$deviceType,$appVersion,$OSVersion,$browserVersion)\n{\n $CustomerTitle = $post['title'];\n $CustomerName = $post['fname'];\n $CustomerSurname = $post['sname'];\n $CustomerMiddleName = $post['mname'];\n $DateOfBirth = $post['dob'];\n $NHSNumber = $post['nhsno'];\n $Gender = $post['gender'];\n $Ethnicity=$post['ethnicity'];\n $Address1=$post['address1'];\n $Address2=$post['address2'];\n $PostCode=strtoupper($post['postcode1'].' '.$post['postcode2']);\n $City=$post['city'];\n $Landline=$post['landline'];\n $ContactNo=$post['mobile'];\n $OtherDetails=$post['otherinfo'];\n $CareInfo=$post['desc'];\n $OutcomesInfo=$post['outcomes'];\n $SupportInfo=$post['support'];\n $MakeEnq=$post['makeenq'];\n $CreatedDateTime = date('Y-m-d H:i:s');\n $ModifyDateTime = date('Y-m-d H:i:s');\n $AccessLevelID='5';\n //$RightsID='9';\n\t$RightsID='8';\n // $UserTypeID='6';\n $UserTypeID='6';\n $StatusID='1';\n session_start();\n $OrgID=$_SESSION['OrgID'];\n\n $con=connectToDB(); //connect to the DB\n\n $result = mysql_query(\"call createEnquiry('\".$OrgID.\"','\".$CustomerTitle.\"','\".$CustomerName.\"','\".$CustomerSurname.\"','\".$CustomerMiddleName.\"','\".$DateOfBirth.\"','\".$NHSNumber.\"','\".$Gender.\"','\".$Ethnicity.\"','\".$Address1.\"','\".$Address2.\"','\".$PostCode.\"','\".$City.\"','\".$Landline.\"','\".$ContactNo.\"','\".$OtherDetails.\"','\".$CareInfo.\"','\".$OutcomesInfo.\"','\".$SupportInfo.\"','\".$MakeEnq.\"','\".$RightsID.\"','\".$AccessLevelID.\"','\".$UserTypeID.\"','\".$CreatedDateTime.\"','\".$ModifyDateTime.\"','\".$StatusID.\"')\")or die(mysql_error());\n if($result) {\n $data['responseData'] = '';\n $data['message'] = \"Created successfully\";\n $data['responseCode'] = \"200\";\n $data['status'] = \"1\";\n } else {\n $data['responseData'] = '';\n $data['message'] = \"Error in Creation\";\n $data['responseCode'] = \"200\";\n $data['status'] = \"0\";\n }\n print json_encode($data);\n mysql_close($con); //close the connection\n}",
"function after_process() {\r\n global $insert_id, $db;\r\n $sql = \"insert into \" . TABLE_ORDERS_STATUS_HISTORY . \" (comments, orders_id, orders_status_id, date_added) values (:orderComments, :orderID, :orderStatus, now() )\";\r\n $sql = $db->bindVars($sql, ':orderComments', 'eCheck payment. AUTH: ' . $this->auth_code . '. TransID: ' . $this->transaction_id . '.', 'string');\r\n $sql = $db->bindVars($sql, ':orderID', $insert_id, 'integer');\r\n $sql = $db->bindVars($sql, ':orderStatus', $this->order_status, 'integer');\r\n $db->Execute($sql);\r\n return false;\r\n }",
"function find_prior_customer_process($c,$qaction,$user,$pass,$conn,$db)\n{\n $out=array();\n \n $link = mssql_connect($conn, $user, $pass);\n\n if (!$link)\n {\n die('Error! Unable to connect to database! ('. __LINE__ .')');\n }\n \n $dselect= mssql_select_db($db, $link);\n \n if (!$dselect)\n {\n die('Error! Unable to select database! ('. __LINE__ .')');\n }\n \n //$action_map=action_map($qaction);\n\n $qry = mssql_query(\"select [quickbooks_queue_id],[qb_status],[msg] from [quickbooks_queue] where qb_action='\". trim($qaction) .\"' and [ident]=\". $c .\";\");\n $row = mssql_fetch_array($qry);\n $nrow = mssql_num_rows($qry);\n \n if ($nrow > 0)\n {\n if ($row['qb_status']=='s')\n {\n $qry1 = mssql_query(\"select [quickbooks_ident_id],[qb_ident],[map_datetime] from [quickbooks_ident] where qb_object='\". action_map($qaction) .\"' and [unique_id]=\". $c .\";\");\n $row1 = mssql_fetch_array($qry1);\n $nrow1 = mssql_num_rows($qry1);\n \n if ($nrow1 > 0)\n {\n return $out=array(true,$row['quickbooks_queue_id'],$row['qb_status'],$row1['qb_ident']);\n }\n else\n {\n return $out=array(false,$row['quickbooks_queue_id'],$row['qb_status'],'QB ListID Error');\n }\n }\n else\n {\n return $out=array(false,$row['quickbooks_queue_id'],$row['qb_status'],$row['msg']);\n }\n }\n else\n {\n return $out=array(false,'','','Process Not Found');\n }\n}",
"private function PayForOrder()\n\t{\n\t\t// If guest checkout is not enabled and the customer isn't signed in then send the customer\n\t\t// back to the beginning of the checkout process.\n\t\tif(!GetConfig('GuestCheckoutEnabled') && !CustomerIsSignedIn() && !isset($_SESSION['CHECKOUT']['CREATE_ACCOUNT'])) {\n\t\t\t@ob_end_clean();\n\t\t\theader(\"Location: \".GetConfig('ShopPath').'/checkout.php');\n\t\t\texit;\n\t\t}\n\n\t\tif (GetConfig('EnableOrderTermsAndConditions')==1 && !isset($_POST['AgreeTermsAndConditions'])) {\n\t\t\t@ob_end_clean();\n\t\t\t$_SESSION['REDIRECT_TO_CONFIRMATION_MSG'] = GetLang('TickArgeeTermsAndConditions');\n\t\t\theader(\"Location: \".$GLOBALS['ShopPath'].\"/checkout.php?action=confirm_order\");\n\t\t\texit;\n\t\t}\n\n\t\t// ensure products are in stock\n\t\t$this->CheckStockLevels();\n\n\t\t// Customer actually chose to apply a gift certificate or coupon code to this order so\n\t\t// we actually show the confirm order page again which does all of the magic.\n\t\tif (isset($_REQUEST['apply_code'])) {\n\t\t\t$this->ConfirmOrder();\n\t\t\treturn;\n\t\t}\n\n\t\t// Attempt to create the pending order with the selected details\n\t\t$pendingResult = $this->SavePendingOrder();\n\n\t\t// There was a problem creating the pending order\n\t\tif(!is_array($pendingResult)) {\n\t\t\t@ob_end_clean();\n\t\t\theader(\"Location: \".$GLOBALS['ShopPath'].\"/checkout.php?action=confirm_order\");\n\t\t\texit;\n\t\t}\n\n\t\t// There was a problem creating the pending order but we have an actual error message\n\t\tif(isset($pendingResult['error'])) {\n\t\t\tif(isset($pendingResult['errorDetails'])) {\n\t\t\t\t$this->BadOrder('', $pendingResult['error'], $pendingResult['errorDetails']);\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$this->BadOrder('', $pendingResult['error']);\n\t\t\t}\n\t\t}\n\n\t\t// We've been told all we need to do is redirect to the finish order page, so do that\n\t\tif(isset($pendingResult['redirectToFinishOrder']) && $pendingResult['redirectToFinishOrder']) {\n\t\t\t@ob_end_clean();\n\t\t\theader(\"Location: \".$GLOBALS['ShopPath'].\"/finishorder.php\");\n\t\t\tdie();\n\t\t}\n\n\t\t// Otherwise, the gateway want's to do something\n\t\tif(!empty($pendingResult['provider']) && ($pendingResult['provider']->GetPaymentType() == PAYMENT_PROVIDER_ONLINE || method_exists($pendingResult['provider'], \"ShowPaymentForm\"))) {\n\t\t\t// ProviderListHTML is stored in the session when the provider requires that it can only be the only payment provider during checkout, disable the other checkout method.\n\t\t\tif(isset($_SESSION['CHECKOUT']['ProviderListHTML']) && method_exists($pendingResult['provider'], 'DoExpressCheckoutPayment')) {\n\t\t\t\t$pendingResult['provider']->DoExpressCheckoutPayment();\n\t\t\t\tdie();\n\t\t\t}\n\n\t\t\t// If we have a payment form to show then show that\n\t\t\tif(isset($pendingResult['showPaymentForm']) && $pendingResult['showPaymentForm']) {\n\t\t\t\t$this->ShowPaymentForm($pendingResult['provider']);\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$pendingResult['provider']->TransferToProvider();\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\t// It's an offline payment method, no need to accept payment now\n\t\t\tif(!empty($pendingResult['provider']))\n\t\t\t\t$providerId = $pendingResult['provider']->GetId();\n\t\t\telse\n\t\t\t\t$providerId = '';\n\n\t\t\t@ob_end_clean();\n\t\t\theader(sprintf(\"Location:%s/finishorder.php?provider=%s\", $GLOBALS['ShopPath'], $providerId));\n\t\t\tdie();\n\t\t}\n\t}",
"function check_response()\n {\n\n $sp_recepcion = new seguripagoRecepcionDiferido($this->sp_idSocio, $this->sp_key, $this->sp_modo);\n $data = $sp_recepcion->recibir();\n if(!is_array($data)) {\n switch($data) {\n case '01': echo \"Error al recepcionar datos.\"; break;\n case '02': echo \"Error en número de pedido.\"; break;\n case '03': echo \"Error en validación de hash.\"; break;\n }\n exit();\n }\n\n /**\n * ---------------------- PROCESANDO PAGO APROBADO ---------------------------\n */\n if($data[\"resultado\"] == \"1\") {\n /**\n * Informar al usuario, por correo, informando de la aprobación de su pago,\n * indicar información adicional para que acceda al producto o servicio.\n */\n\n $id_order = ltrim($data['num_pedido'], '0');\n\n $id_order = (int) $id_order;\n\n $order = new WC_Order( $id_order );\n\n // Mark order complete\n //$order->payment_complete();\n // Mark order processing\n $order->update_status( 'processing' );\n }\n\n /**\n * Enviando confirmación de recibo de datos\n */\n $sp_recepcion->confirmar();\n\n }",
"function ExecutePayment ($ccardno,$exp_m,$exp_y,$cvv2,$total) {\n\n if (strlen($exp_y)!=2) $exp_y=substr($exp_y,-2);\n if (strlen($exp_m)!=2) $exp_m=str_repeat(\"0\",(2-strlen($exp_m))).$exp_m;\n\n $data=\"DATA=<?xml version=\\\"1.0\\\" encoding=\\\"ISO-8859-9\\\"?>\n<CC5Request>\n<Name>\".VP_FORTIS_NAME.\"</Name>\n<Password>\".VP_FORTIS_PASSWORD.\"</Password>\n<ClientId>\".VP_FORTIS_CLIENTID.\"</ClientId>\n<IPAddress>\".$_SERVER['REMOTE_ADDR'].\"</IPAddress>\n<Email></Email>\n<Mode>\".VP_FORTIS_MODE.\"</Mode>\n<OrderId></OrderId>\n<GroupId></GroupId>\n<TransId></TransId>\n<UserId></UserId>\n<Type>\".VP_FORTIS_TYPE.\"</Type>\n<Number>$ccardno</Number>\n<Expires>$exp_m/$exp_y</Expires>\n<Cvv2Val>$cvv2</Cvv2Val>\n<Total>$total</Total>\n<Currency>\".VP_FORTIS_CURRENCY.\"</Currency>\n<Taksit></Taksit>\n<BillTo>\n<Name></Name>\n<Street1></Street1>\n<Street2></Street2>\n<Street3></Street3>\n<City></City>\n<StateProv></StateProv>\n<PostalCode></PostalCode>\n<Country></Country>\n<Company></Company>\n<TelVoice></TelVoice>\n</BillTo>\n<ShipTo>\n<Name></Name>\n<Street1></Street1>\n<Street2></Street2>\n<Street3></Street3>\n<City></City>\n<StateProv></StateProv>\n<PostalCode></PostalCode>\n<Country></Country>\n</ShipTo>\n<Extra></Extra>\n</CC5Request>\";\n\n\n\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 1);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);\n curl_setopt($ch, CURLOPT_URL, VP_FORTIS_URL);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $data);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_TIMEOUT, 90);\n $result = curl_exec($ch);\n curl_close($ch);\n\n\n $response_tag=\"Response\";\n $posf = strpos ( $result, (\"<\" . $response_tag . \">\") );\n $posl = strpos ( $result, (\"</\" . $response_tag . \">\") ) ;\n $posf = $posf+ strlen($response_tag) +2 ;\n $Response = substr ( $result, $posf, $posl - $posf) ;\n\n $response_tag=\"OrderId\";\n $posf = strpos ( $result, (\"<\" . $response_tag . \">\") );\n $posl = strpos ( $result, (\"</\" . $response_tag . \">\") ) ;\n $posf = $posf+ strlen($response_tag) +2 ;\n $OrderId = substr ( $result, $posf , $posl - $posf ) ;\n\n $response_tag=\"AuthCode\";\n $posf = strpos ( $result, \"<\" . $response_tag . \">\" );\n $posl = strpos ( $result, \"</\" . $response_tag . \">\" ) ;\n $posf = $posf+ strlen($response_tag) +2 ;\n $AuthCode = substr ( $result, $posf , $posl - $posf ) ;\n\n $response_tag=\"TransId\";\n $posf = strpos ( $result, \"<\" . $response_tag . \">\" );\n $posl = strpos ( $result, \"</\" . $response_tag . \">\" ) ;\n $posf = $posf+ strlen($response_tag) +2 ;\n $TransId = substr ( $result, $posf , $posl - $posf ) ;\n\n if ($Response==\"Approved\") {\n return array(\"response\"=>true,\"order_id\"=>$OrderId,\"auth_id\"=>$AuthCode,\"trans_id\"=>$TransId);\n }\n else {\n return array(\"response\"=>false);\n }\n}",
"public function handle_result() {\n\t\t\t\tif ( ! isset( $_REQUEST['order-id'] ) || empty( $_REQUEST['order-id'] ) ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t$response = file_get_contents( 'php://input' );\n\t\t\t\t$jsonResponse = json_decode( $response );\n\t\t\t\t$responseArray = json_decode($response,true);\n\t\t\t\t\n\t\t\t\t$order = wc_get_order( $_REQUEST['order-id'] );\n\t\t\t\t\n\t\t\t $order->add_order_note( $this->generateTable($responseArray),'success' );\n\t\t\t // Only Log when test mode is enabled\n\t\t\t if( 'yes' == $this->get_option( 'test_enabled' ) ) {\n\t\t\t \t$order->add_order_note( $response );\n\t\t\t }\n\t\t\t \n\n\t\t\t\tif ( isset( $jsonResponse->transactionStatus ) && 'APPROVED' == $jsonResponse->transactionStatus ) {\n\t\t\t\t\t\t// Complete this order, otherwise set it to another status as per configurations\n\t\t\t\t\t\t$order->payment_complete();\n\t\t\t\t\t\t$order->update_status( $this->get_option( 'success_payment_status' ), __( 'Havano Payment was Successful.', 'havanao' ) );\t\n\t\t\t\t} else {\n\t\t\t\t\t$order->update_status( $this->get_option( 'errored_payment_status' ), __( 'Havano Payment was Successful.', 'havanao' ) );\t\n\t\t\t\t}\n\t\t\t}",
"public function makeOrderRequest()\n {\n //check if the user is logged and user permission\n if (UserManager::isUserLogged()) {\n if (UserManager::getPermission($_SESSION['email']) == BASE) {\n\n //check post variables\n if (isset($_POST['delivery_date']) && isset($_POST['article_id']) && isset($_POST['article_quantity']) && !empty($_POST['article_id']) && !empty($_POST['article_quantity']) && !empty($_POST['delivery_date'])) {\n\n //test input\n $article_id = Validator::testInput($_POST['article_id']);\n $article_quantity = Validator::testInput($_POST['article_quantity']);\n $delivery_date = Validator::testInput($_POST['delivery_date']);\n $article = ArticleManager::getArticleById($article_id);\n $expire_date = $article['data_scadenza'];\n $available_date = $article['disponibile_il'];\n\n if (Validator::isDeliveryDateValid($delivery_date, $expire_date, $available_date)) {\n\n //create order\n $order = new OrderModel($article_quantity, $article_id, UserManager::getUserByEmail($_SESSION['email'])['id'], $delivery_date);\n\n //try to make the order request\n if (OrderManager::addOrder($order)) {\n MessageManager::setSuccessMsg('Richiesta inviata. Il tuo ordine verrà visionato');\n MessageManager::unsetErrorMsg();\n } else {\n MessageManager::setErrorMsg('Impossibile richiedere questo articolo');\n }\n } else {\n MessageManager::setErrorMsg('La data di consegna non è valida');\n }\n }\n }\n header('Location: ' . URL . 'catalog');\n exit;\n }\n header('Location: ' . URL . 'home');\n }",
"function echeck_submit($form, $course)\n {\n global $CFG, $USER, $SESSION;\n require_once('authorizenetlib.php');\n\n prevent_double_paid($course);\n\n $useripno = getremoteaddr();\n $curcost = get_course_cost($course);\n $isbusinesschecking = ($form->acctype == 'BUSINESSCHECKING');\n\n // NEW ECHECK ORDER\n $timenow = time();\n $order = new stdClass();\n $order->paymentmethod = AN_METHOD_ECHECK;\n $order->refundinfo = $isbusinesschecking ? 1 : 0;\n $order->ccname = $form->firstname . ' ' . $form->lastname;\n $order->courseid = $course->id;\n $order->userid = $USER->id;\n $order->status = AN_STATUS_NONE; // it will be changed...\n $order->settletime = 0; // cron changes this.\n $order->transid = 0; // Transaction Id\n $order->timecreated = $timenow;\n $order->amount = $curcost['cost'];\n $order->currency = $curcost['currency'];\n $order->id = insert_record(\"enrol_authorize\", $order);\n if (!$order->id) {\n email_to_admin(\"Error while trying to insert new data\", $order);\n return \"Insert record error. Admin has been notified!\";\n }\n\n $extra = new stdClass();\n $extra->x_bank_aba_code = $form->abacode;\n $extra->x_bank_acct_num = $form->accnum;\n $extra->x_bank_acct_type = $form->acctype;\n $extra->x_echeck_type = $isbusinesschecking ? 'CCD' : 'WEB';\n $extra->x_bank_name = $form->bankname;\n $extra->x_currency_code = $curcost['currency'];\n $extra->x_amount = $curcost['cost'];\n $extra->x_first_name = $form->firstname;\n $extra->x_last_name = $form->lastname;\n $extra->x_country = $USER->country;\n $extra->x_address = $USER->address;\n $extra->x_city = $USER->city;\n $extra->x_state = '';\n $extra->x_zip = '';\n\n $extra->x_invoice_num = $order->id;\n $extra->x_description = $course->shortname;\n\n $extra->x_cust_id = $USER->id;\n $extra->x_email = $USER->email;\n $extra->x_customer_ip = $useripno;\n $extra->x_email_customer = empty($CFG->enrol_mailstudents) ? 'FALSE' : 'TRUE';\n $extra->x_phone = '';\n $extra->x_fax = '';\n\n $message = '';\n if (AN_REVIEW != authorize_action($order, $message, $extra, AN_ACTION_AUTH_CAPTURE)) {\n email_to_admin($message, $order);\n return $message;\n }\n\n $SESSION->ccpaid = 1; // security check: don't duplicate payment\n redirect($CFG->wwwroot, get_string(\"reviewnotify\", \"enrol_authorize\"), '30');\n }",
"private function process_input()\n\t{\n\t//\t$report_end_datetime = OurTime::js_to_datetime($this->f_report_end, 1);\n\t\t\n\t\t$this->m_product_info_arr = DB::get_all_rows_fq ('\n\t\t\tSELECT products.*\n\t\t\tFROM products\n\t\t');\n\t\t\n\t\t//TESTING: show how many rows we got:\n\t\t//echo count($this->m_obj_info_arr);*/\n\n\t}",
"function can_process() {\t\n\n\tif ($_POST['expd_percentage_amt'] == \"\"){\n\t\tdisplay_error(trans(\"You need to provide the maximum monthly pay limit percentage for employee loan.\"));\n\t\tset_focus('expd_percentage_amt');\n\t\treturn false;\n\t} \n\tif (!check_num('expd_percentage_amt'))\t{\n\t\tdisplay_error(trans(\"Maximum EMI Limit should be a positive number\"));\n\t\tset_focus('login_tout');\n\t\treturn false;\n\t}\n\tif (!check_num('ot_factor'))\t{\n\t\tdisplay_error(trans(\"OT Multiplication Factor should be a positive number\"));\n\t\tset_focus('ot_factor');\n\t\treturn false;\n\t}\n\tif($_POST['monthly_choice'] == 1 && ( $_POST['BeginDay'] != 1 || $_POST['EndDay'] != 31 )) {\n\t\tdisplay_error(trans(\"For Current Month the Begin Date should be 1 and end date should be 31.\"));\n\t\tset_focus('BeginDay');\n\t\tset_focus('EndDay');\n\t\treturn false;\n\t}\n\t\t\n\tif (strlen($_POST['salary_account']) > 0 || strlen($_POST['paid_from_account']) > 0) {\n\t\tif (strlen($_POST['salary_account']) == 0 && strlen($_POST['paid_from_account']) > 0) {\n\t\t\tdisplay_error(trans(\"The Net Pay Debit Code cannot be empty.\"));\n\t\t\tset_focus('salary_account');\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (strlen($_POST['salary_account']) > 0 && strlen($_POST['paid_from_account']) == 0 ) {\n\t\t\tdisplay_error(trans(\"The Net Pay Credit Code cannot be empty.\"));\n\t\t\tset_focus('paid_from_account');\n\t\t\treturn false;\n\t\t}\n\t}\n\t\n\tif (strlen($_POST['travel_debit']) > 0 || strlen($_POST['travel_credit']) > 0) {\n\t\tif (strlen($_POST['travel_debit']) == 0 && strlen($_POST['travel_credit']) > 0) {\n\t\t\tdisplay_error(trans(\"The Travel Debit Code cannot be empty.\"));\n\t\t\tset_focus('travel_debit');\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (strlen($_POST['travel_debit']) > 0 && strlen($_POST['travel_credit']) == 0 ) {\n\t\t\tdisplay_error(trans(\"The Travel Credit Code cannot be empty.\"));\n\t\t\tset_focus('travel_credit');\n\t\t\treturn false;\n\t\t}\n\t}\n\t\n\tif (strlen($_POST['petrol_debit']) > 0 || strlen($_POST['petrol_credit']) > 0) {\n\t\tif (strlen($_POST['petrol_debit']) == 0 && strlen($_POST['petrol_credit']) > 0) {\n\t\t\tdisplay_error(trans(\"The Petrol Debit Code cannot be empty.\"));\n\t\t\tset_focus('petrol_debit');\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (strlen($_POST['petrol_debit']) > 0 && strlen($_POST['petrol_credit']) == 0 ) {\n\t\t\tdisplay_error(trans(\"The Petrol Credit Code cannot be empty.\"));\n\t\t\tset_focus('petrol_credit');\n\t\t\treturn false;\n\t\t}\n\t}\n\t\n\tif (strlen($_POST['debit_encashment']) > 0 || strlen($_POST['credit_encashment']) > 0) {\n\t\tif (strlen($_POST['debit_encashment']) == 0 && strlen($_POST['credit_encashment']) > 0) {\n\t\t\tdisplay_error(trans(\"The Encashment Debit Code cannot be empty.\"));\n\t\t\tset_focus('debit_encashment');\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (strlen($_POST['debit_encashment']) > 0 && strlen($_POST['credit_encashment']) == 0 ) {\n\t\t\tdisplay_error(trans(\"The Encashment Credit Code cannot be empty.\"));\n\t\t\tset_focus('credit_encashment');\n\t\t\treturn false;\n\t\t}\n\t}\n\t\n\treturn true;\t\n}",
"private function calculateRequiredApprovals() {\r\n\r\n if($this->commitments->requiresApproval() == true) {\r\n require_once('classes/tracking/approvals/Commitments.php');\r\n $this->addApproval(new \\tracking\\approval\\Commitments($this->trackingFormId));\r\n }\r\n\r\n // If the form doesn't have commitments, then we still want the Dean to review it\r\n // so we add this approval.\r\n if(!$this->commitments->requiresApproval()) {\r\n require_once('classes/tracking/approvals/DeanReview.php');\r\n $this->addApproval(new \\tracking\\approval\\DeanReview($this->trackingFormId));\r\n }\r\n\r\n if($this->COIRequiresApproval() == true) {\r\n require_once('classes/tracking/approvals/COI.php');\r\n $this->addApproval(new \\tracking\\approval\\COI($this->trackingFormId));\r\n } else {\r\n // there are no COI, but ORS still needs to review so apply ORSReview\r\n require_once('classes/tracking/approvals/ORSReview.php');\r\n $this->addApproval(new \\tracking\\approval\\ORSReview($this->trackingFormId));\r\n }\r\n\r\n if($this->compliance->requiresBehavioural() == true) {\r\n require_once('classes/tracking/approvals/EthicsBehavioural.php');\r\n $this->addApproval(new \\tracking\\approval\\EthicsBehavioural($this->trackingFormId));\r\n }\r\n\r\n\r\n/* if($this->compliance->requiresHealth() == true) {\r\n require_once('classes/tracking/approvals/EthicsHealth.php');\r\n $this->addApproval(new \\tracking\\approval\\EthicsHealth($this->trackingFormId));\r\n }\r\n\r\n if($this->compliance->requiresAnimal() == true) {\r\n require_once('classes/tracking/approvals/EthicsAnimal.php');\r\n $this->addApproval(new \\tracking\\approval\\EthicsAnimal($this->trackingFormId));\r\n }\r\n\r\n require_once('classes/tracking/approvals/EthicsBiohazard.php');\r\n if($this->compliance->requiresBiohazard() == true) {\r\n $this->addApproval(new \\tracking\\approval\\EthicsBiohazard($this->trackingFormId));\r\n }*/\r\n }",
"function wp_aff_check_clickbank_transaction() {\n if (WP_AFFILIATE_ENABLE_CLICKBANK_INTEGRATION == '1') {\n if (isset($_REQUEST['cname']) && isset($_REQUEST['cprice'])) {\n $aff_id = wp_affiliate_get_referrer();\n if (!empty($aff_id)) {\n $sale_amt = strip_tags($_REQUEST['cprice']);\n $txn_id = strip_tags($_REQUEST['cbreceipt']);\n $item_id = strip_tags($_REQUEST['item']);\n $buyer_email = strip_tags($_REQUEST['cemail']);\n $debug_data = \"Commission tracking debug data from ClickBank transaction:\" . $aff_id . \"|\" . $sale_amt . \"|\" . $buyer_email . \"|\" . $txn_id . \"|\" . $item_id;\n wp_affiliate_log_debug($debug_data, true);\n wp_aff_award_commission_unique($aff_id, $sale_amt, $txn_id, $item_id, $buyer_email);\n }\n }\n }\n}",
"function requirement_get_test_details($req_id, $testset_id) {\n\n\t$tbl_test_req_assoc\t\t\t= TEST_REQ_ASSOC_TBL;\n\t$f_test_req_assoc_id\t\t= $tbl_test_req_assoc .\".\". TEST_REQ_ASSOC_ID;\n\t$f_test_req_assoc_test_id\t= $tbl_test_req_assoc .\".\". TEST_REQ_ASSOC_TEMPEST_TEST_ID;\n\t$f_test_req_assoc_req_id\t= $tbl_test_req_assoc .\".\". TEST_REQ_ASSOC_REQ_ID;\n\t$f_test_req_assoc_percent\t= $tbl_test_req_assoc .\".\". TEST_REQ_ASSOC_PERCENT_COVERED;\n\n\t$ts_assoc_tbl = TEST_TS_ASSOC_TBL;\n\t$f_ts_assoc_id = TEST_TS_ASSOC_TBL. \".\" .TEST_TS_ASSOC_ID;\n\t$f_ts_assoc_ts_id = TEST_TS_ASSOC_TBL. \".\" .TEST_TS_ASSOC_TS_ID;\n\t$f_ts_assoc_test_id = TEST_TS_ASSOC_TBL. \".\" .TEST_TS_ASSOC_TEST_ID;\n\t$f_ts_assoc_test_status = TEST_TS_ASSOC_TBL. \".\" .TEST_TS_ASSOC_STATUS;\n\t$f_ts_assoc_assigned_to = TEST_TS_ASSOC_TBL. \".\" .TEST_TS_ASSOC_ASSIGNED_TO;\n\t$f_ts_assoc_comments = TEST_TS_ASSOC_TBL. \".\" .TEST_TS_ASSOC_COMMENTS;\n\t$f_ts_assoc_timestamp = TEST_TS_ASSOC_TBL. \".\" .TEST_TS_ASSOC_TIMESTAMP;\n\n $tbl_test \t\t= TEST_TBL;\n\t$f_test_id\t\t\t\t= $tbl_test. \".\" .TEST_ID;\n\n\t$q = \"\tSELECT DISTINCT\n\t\t\t\t$f_test_req_assoc_test_id,\n\t\t\t\t$f_test_req_assoc_percent,\n\t\t\t\t$f_ts_assoc_test_status\n\t\t\tFROM $tbl_test_req_assoc\n\t\t\tINNER JOIN $tbl_test\n\t\t\t\tON $f_test_id = $f_test_req_assoc_test_id\n\t\t\tINNER JOIN $ts_assoc_tbl\n\t\t\t\tON $f_test_req_assoc_test_id = $f_ts_assoc_test_id\n\t\t\tWHERE $f_test_req_assoc_req_id = $req_id\n\t\t\t\tAND $f_ts_assoc_ts_id = $testset_id\";\n\n\tglobal $db;\n\n\t$rows = db_fetch_array($db, db_query($db, $q));\n\n\treturn $rows;\n}",
"function checkReqs($rank, $PID)\n{\n\t// Lets make sure we are dealing with the correct ranks!\n\t// Rank 7 is MSG, Rank 9 is MGYSG\n\tif($rank == 7 || $rank == 9)\n\t{\n\t\tswitch($rank)\n\t\t{\n\t\t\t// Rank is MSG\n\t\t\tcase 7:\n\t\t\t\t$award_list = array(\n\t\t\t\t\t'1031105' => 1, // Engineer Combat Badge\n\t\t\t\t\t'1031109' => 1, // Sniper Combat Badge\n\t\t\t\t\t'1031113' => 1, // Medic Combat Badge\n\t\t\t\t\t'1031115' => 1, // Spec Ops Combat Badge\n\t\t\t\t\t'1031119' => 1, // Assault Combat Badge\n\t\t\t\t\t'1031120' => 1, // Anti-tank Combat Badge\n\t\t\t\t\t'1031121' => 1, // Support Combat Badge\n\t\t\t\t\t'1031406' => 1, // Knife Combat Badge\n\t\t\t\t\t'1031619' => 1 // Pistol Combat Badge\n\t\t\t\t\t//'1032415' => 1, // Explosives Ordinance Badge\n\t\t\t\t\t//'1190507' => 1, // Engineer Badge\n\t\t\t\t\t//'1190601' => 1, // First Aid Badge\n\t\t\t\t\t//'1191819' => 1 // Resupply Badge\n\t\t\t\t);\n\t\t\tbreak;\n\t\t\t\n\t\t\t// Rank is MGYSG\n\t\t\tcase 9:\n\t\t\t\t$award_list = array(\n\t\t\t\t\t'1031923' => 1, // Ground Defense\n\t\t\t\t\t'1220104' => 1, // Air Defense\n\t\t\t\t\t'1220118' => 1, // Armor Badge\n\t\t\t\t\t'1220122' => 1, // Aviator Badge\n\t\t\t\t\t'1220803' => 1, // Helicopter Badge\n\t\t\t\t\t'1222016' => 1 // Transport Badge\n\t\t\t\t);\n\t\t\tbreak;\n\t\t}\n\t\t\n\t\t// Initiate an array of players earned awards\n\t\t$player_awards = array();\n\t\t\n\t\t// Start a query to get users awards\n\t\t$query = \"SELECT * FROM awards where id = $PID\";\n\t\t$result = mysql_query($query) or die('Query failed: ' . mysql_error());\n\t\t\n\t\t// Build the players earned awards to an array\n\t\twhile($row = mysql_fetch_assoc($result)) \n\t\t{\n\t\t\t$player_awards[$row['awd']] = $row['level'];\n\t\t}\n\t\t\n\t\t// Start a loop. For each required award, check to see 2 things:\n\t\t// 1) The player has the award\n\t\t// 2) The level of the award is equal to or greater then required\n\t\tforeach($award_list as $award => $level)\n\t\t{\n\t\t\t// Check if the award is in the list of players earned awards\n\t\t\tif(array_key_exists($award, $player_awards))\n\t\t\t{\n\t\t\t\t$lvl = $player_awards[$award];\n\t\t\t\t\n\t\t\t\t// Check to see if the level of the earned award is geater or equal\n\t\t\t\t// value of the required award\n\t\t\t\tif($lvl >= $level)\n\t\t\t\t{\n\t\t\t\t\t// Dont return false :p\n\t\t\t\t\t// The award is good, move to the next award in the loop\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t// return FALSE because the level is too low\n\t\t\t\t\treturn FALSE;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// Return FALSE because the user doesnt have the award\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// If the loop finished, then the player had all awards so return TRUE!\n\t\treturn TRUE;\n\t}\n\telse\n\t{\n\t\t// What an error this is lol\n\t\treturn FALSE;\n\t}\n}",
"public function checkOut($params = array())\r\n {\r\n $actionType = $params['actionType'];;\r\n $cancelUrl = $params['cancelUrl'];//\"http://localhost\"; \r\n $returnUrl = $params['returnUrl']; \r\n $startingDate = \"\"; \r\n \r\n $currencyCode = $params['currencyCode'];\r\n $receiverEmailArray = array();\r\n $receiverAmountArray = array();\r\n $receiverInvoiceIdArray = array();\r\n foreach($params['receivers'] as $rc)\r\n {\r\n $receiverEmailArray[] = $rc['email'];\r\n $receiverAmountArray[] = $rc['amount'];\r\n $receiverInvoiceIdArray[] = $rc['invoice'];\r\n }\r\n \r\n $receiverPrimaryArray = array();\r\n $senderEmail = $params['sender']; \r\n /**\r\n * feesPayer value {SENDER, PRIMARYRECEIVER, EACHRECEIVER}\r\n * \r\n * @var mixed\r\n */\r\n $feesPayer = $params['feesPayer']; \r\n $ipnNotificationUrl = $params['ipnNotificationUrl'];\r\n $memo = $params['memo']; \r\n $pin = $params['pin']; \r\n $preapprovalKey = $params['preapprovalKey'];\r\n //echo $preapprovalKey;\r\n $reverseAllParallelPaymentsOnError = $params['reverseAllParallelPaymentsOnError']; \r\n $trackingId = $this->generateTrackingID(); \r\n $resArray = $this->CallPay ($actionType, $cancelUrl, $returnUrl, $currencyCode, $receiverEmailArray,\r\n $receiverAmountArray, $receiverPrimaryArray, $receiverInvoiceIdArray,\r\n $feesPayer, $ipnNotificationUrl, $memo, $pin, $preapprovalKey,\r\n $reverseAllParallelPaymentsOnError, $senderEmail, $trackingId,$startingDate\r\n );\r\n \r\n\r\n \r\n $ack = strtoupper($resArray[\"responseEnvelope.ack\"]);\r\n \r\n if($ack==\"SUCCESS\")\r\n {\r\n if (\"\" == $preapprovalKey)\r\n {\r\n // redirect for web approval flow\r\n $cmd = \"cmd=_ap-payment&paykey=\" . urldecode($resArray[\"payKey\"]);\r\n //$cmd = \"cmd=_notify-validate&paykey=\" . urldecode($resArray[\"payKey\"]);\r\n \r\n $this->Redirect($cmd);\r\n }\r\n else\r\n {\r\n \r\n // payKey is the key that you can use to identify the result from this Pay call\r\n $payKey = urldecode($resArray[\"payKey\"]);\r\n // paymentExecStatus is the status of the payment\r\n $paymentExecStatus = urldecode($resArray[\"paymentExecStatus\"]);\r\n } \r\n \r\n }\r\n else\r\n {\r\n $ErrorCode = urldecode($resArray[\"error(0).errorId\"]);\r\n $ErrorMsg = urldecode($resArray[\"error(0).message\"]);\r\n $ErrorDomain = urldecode($resArray[\"error(0).domain\"]);\r\n $ErrorSeverity = urldecode($resArray[\"error(0).severity\"]);\r\n $ErrorCategory = urldecode($resArray[\"error(0).category\"]);\r\n $this->errors = $ErrorCode.':'.$ErrorMsg.' '.$ErrorDomain.' '.$ErrorSeverity.' '.$ErrorCategory;\r\n $this->logging('checkOut Error : '. $this->errors); \r\n return false;\r\n } \r\n \r\n }",
"public function cs_proress_request($params = array()) {\n global $post, $cs_gateway_options, $cs_form_fields2;\n extract($params);\n\n $cs_current_date = date('Y-m-d H:i:s');\n $output = '';\n $rand_id = $this->cs_get_string(5);\n $business_email = $cs_gateway_options['cs_paypal_email'];\n\n\n $currency = isset($cs_gateway_options['cs_currency_type']) && $cs_gateway_options['cs_currency_type'] != '' ? $cs_gateway_options['cs_currency_type'] : 'USD';\n $cs_opt_hidden1_array = array(\n 'id' => '',\n 'std' => '_xclick',\n 'cust_id' => \"\",\n 'cust_name' => \"cmd\",\n 'return' => true,\n );\n $cs_opt_hidden2_array = array(\n 'id' => '',\n 'std' => sanitize_email($business_email),\n 'cust_id' => \"\",\n 'cust_name' => \"business\",\n 'return' => true,\n );\n $cs_opt_hidden3_array = array(\n 'id' => '',\n 'std' => $cs_trans_amount,\n 'cust_id' => \"\",\n 'cust_name' => \"amount\",\n 'return' => true,\n );\n $cs_opt_hidden4_array = array(\n 'id' => '',\n 'std' => $currency,\n 'cust_id' => \"\",\n 'cust_name' => \"currency_code\",\n 'return' => true,\n );\n $cs_opt_hidden5_array = array(\n 'id' => '',\n 'std' => $cs_package_title,\n 'cust_id' => \"\",\n 'cust_name' => \"item_name\",\n 'return' => true,\n );\n $cs_opt_hidden6_array = array(\n 'id' => '',\n 'std' => sanitize_text_field($cs_job_id),\n 'cust_id' => \"\",\n 'cust_name' => \"item_number\",\n 'return' => true,\n );\n $cs_opt_hidden7_array = array(\n 'id' => '',\n 'std' => '',\n 'cust_id' => \"\",\n 'cust_name' => \"cancel_return\",\n 'return' => true,\n );\n $cs_opt_hidden8_array = array(\n 'id' => '',\n 'std' => '1',\n 'cust_id' => \"\",\n 'cust_name' => \"no_note\",\n 'return' => true,\n );\n $cs_opt_hidden9_array = array(\n 'id' => '',\n 'std' => sanitize_text_field($cs_order_id),\n 'cust_id' => \"\",\n 'cust_name' => \"invoice\",\n 'return' => true,\n );\n $cs_opt_hidden10_array = array(\n 'id' => '',\n 'std' => esc_url($this->listner_url),\n 'cust_id' => \"\",\n 'cust_name' => \"notify_url\",\n 'return' => true,\n );\n $cs_opt_hidden11_array = array(\n 'id' => '',\n 'std' => '',\n 'cust_id' => \"\",\n 'cust_name' => \"lc\",\n 'return' => true,\n );\n $cs_opt_hidden12_array = array(\n 'id' => '',\n 'std' => '2',\n 'cust_id' => \"\",\n 'cust_name' => \"rm\",\n 'return' => true,\n );\n $cs_opt_hidden13_array = array(\n 'id' => '',\n 'std' => sanitize_text_field($cs_order_id),\n 'cust_id' => \"\",\n 'cust_name' => \"custom\",\n 'return' => true,\n );\n $cs_opt_hidden14_array = array(\n 'id' => '',\n 'std' => esc_url(home_url('/')),\n 'cust_id' => \"\",\n 'cust_name' => \"return\",\n 'return' => true,\n );\n\n $output .= '<form name=\"PayPalForm\" id=\"direcotry-paypal-form\" action=\"' . $this->gateway_url . '\" method=\"post\"> \n ' . $cs_form_fields2->cs_form_hidden_render($cs_opt_hidden1_array) . '\n ' . $cs_form_fields2->cs_form_hidden_render($cs_opt_hidden2_array) . '\n ' . $cs_form_fields2->cs_form_hidden_render($cs_opt_hidden3_array) . '\n ' . $cs_form_fields2->cs_form_hidden_render($cs_opt_hidden4_array) . '\n ' . $cs_form_fields2->cs_form_hidden_render($cs_opt_hidden5_array) . '\n ' . $cs_form_fields2->cs_form_hidden_render($cs_opt_hidden6_array) . '\n ' . $cs_form_fields2->cs_form_hidden_render($cs_opt_hidden7_array) . '\n ' . $cs_form_fields2->cs_form_hidden_render($cs_opt_hidden8_array) . '\n ' . $cs_form_fields2->cs_form_hidden_render($cs_opt_hidden9_array) . '\n ' . $cs_form_fields2->cs_form_hidden_render($cs_opt_hidden10_array) . '\n ' . $cs_form_fields2->cs_form_hidden_render($cs_opt_hidden11_array) . '\n ' . $cs_form_fields2->cs_form_hidden_render($cs_opt_hidden12_array) . '\n ' . $cs_form_fields2->cs_form_hidden_render($cs_opt_hidden13_array) . '\n ' . $cs_form_fields2->cs_form_hidden_render($cs_opt_hidden14_array) . '\n </form>';\n\n\n $data = CS_FUNCTIONS()->cs_special_chars($output);\n $data .= '<script>\n\t\t\t\t\t \t jQuery(\"#direcotry-paypal-form\").submit();\n\t\t\t\t\t </script>';\n echo CS_FUNCTIONS()->cs_special_chars($data);\n }",
"public function enquiryStep2($formData) {\n\n $logMsg = \"Telling server the period we're looking for, requesting more cookies...<br>\";\n echo $logMsg;\n\n $url = \"https://ebiz.campbelltown.nsw.gov.au/ePathway/Production/Web/GeneralEnquiry/EnquirySearch.aspx\";\n\n $formData['ctl00$MainBodyContent$mGeneralEnquirySearchControl$mEnquiryListsDropDownList'] = 23;\n $formData['ctl00$MainBodyContent$mGeneralEnquirySearchControl$mSearchButton'] = \"Search\";\n $formData['ctl00$MainBodyContent$mGeneralEnquirySearchControl$mTabControl$ctl04$mStreetNameTextBox'] = null;\n $formData['ctl00$MainBodyContent$mGeneralEnquirySearchControl$mTabControl$ctl04$mStreetNumberTextBox'] = null;\n $formData['ctl00$MainBodyContent$mGeneralEnquirySearchControl$mTabControl$ctl04$mStreetTypeDropDown'] = null;\n $formData['ctl00$MainBodyContent$mGeneralEnquirySearchControl$mTabControl$ctl04$mSuburbTextBox'] = null;\n $formData['hiddenInputToUpdateATBuffer_CommonToolkitScripts'] = 1;\n $formData['ctl00$mHeight'] = 653;\n $formData['ctl00$mWidth'] = 786;\n\n $formData = http_build_query($formData);\n\n $requestHeaders = [\n \"Host: ebiz.campbelltown.nsw.gov.au\",\n \"Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\",\n \"Accept-Language: en-GB,en;q=0.5\",\n \"Accept-Encoding: none\",\n \"Referer: https://ebiz.campbelltown.nsw.gov.au/ePathway/Production/Web/GeneralEnquiry/EnquiryLists.aspx?ModuleCode=LAP\",\n \"Content-Type: application/x-www-form-urlencoded\"\n ];\n\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);\n curl_setopt($ch, CURLOPT_HTTPHEADER, $requestHeaders);\n curl_setopt($ch, CURLOPT_POST, true);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $formData);\n curl_setopt($ch, CURLOPT_HEADER, false);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);\n curl_setopt($ch, CURLOPT_TIMEOUT, 30);\n curl_setopt($ch, CURLOPT_COOKIEFILE, __DIR__ . '/../cookies/cookies.txt');\n curl_setopt($ch, CURLOPT_COOKIEJAR, __DIR__ . '/../cookies/cookies.txt');\n curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0');\n\n $output = curl_exec($ch);\n $errno = curl_errno($ch);\n $errmsg = curl_error($ch);\n curl_close($ch);\n\n if ($errno !== 0) {\n\n $logMsg = \"cURL error in enquiryStep2 function: \" . $errmsg . \" (\" . $errno . \")\";\n $this->logger->info($logMsg);\n return false;\n }\n\n return $output;\n\n }",
"public function run()\n {\n $policies = array(\n '1' => '1.\tImprove access & equity in higher education',\n '2' => '2.\tImprove internal efficiency in higher education',\n '3' => '3.\tImprove quality & relevance of higher education',\n '4' => '4.\tImprove gender diversity in higher education',\n '5' => '5.\tImprove internationalization',\n '6' => '6.\tImprove capacity and resources mobilization',\n );\n\n $descriptions = array(\n '1.1' => '1.1\tIncrease capacity to enroll new students',\n '1.2' => '1.2\tIncrease enrollment in STEM study fields',\n '1.3' => '1.3\tIncrease participation of female students',\n '1.4' => '1.4\tIncrease participation of female students in STEM subjects',\n '1.5' => '1.5\tIncrease participation of persons with disabilities',\n '1.6' => '1.6\tIncrease participation of students from emerging regions',\n '1.7' => '1.7\tIncrease participation of students from economically poor households',\n\n '2.1' => '2.1\tReduce dropout rate of male and female students',\n '2.2' => '2.2\tReduce dropout rate of female students',\n '2.3' => '2.3\tReduce academic dismissal rate of male and female students',\n '2.4' => '2.4\tReduce academic dismissal rate of female students',\n '2.5' => '2.5\tIncrease graduation rate of male and female students',\n '2.6' => '2.6\tIncrease graduation rate of female students',\n '2.7' => '2.7\tIncrease graduation rate of students with disabilities',\n '2.8' => '2.8\tIncrease graduation rate of students from emerging regions',\n '2.9' => '2.9\tIncrease graduation rate of students from economically poor households',\n\n '3.1' => '3.1\tImprove quality of instruction in HEIs',\n '3.2' => '3.2\tImprove performance of students in exit examinations',\n '3.3' => '3.3\tImprove employability of students in HEIs',\n '3.4' => '3.4\tImprove quality, relevance and accessibility of higher education research and research outputs',\n\n '4.1' => '4.1\t Improve gender diversity of academic staff',\n '4.2' => '4.2\t Improve gender diversity of technical support staff',\n '4.3' => '4.3\t Improve gender diversity of professional staff in teaching hospitals',\n '4.4' => '4.4\t Improve gender diversity of administrative support staff',\n '4.5' => '4.5\t Improve gender diversity of staff appointed at senior management positions',\n '4.6' => '4.6\t Improve gender diversity of staff appointed at middle management positions',\n '4.7' => '4.7\t Improve gender diversity of staff appointed at lower management positions',\n\n '5.1' => '5.1\tIncrease the contribution of Ethiopian diaspora in academic activities',\n '5.2' => '5.2\tIncrease student exchange between Ethiopian and foreign universities',\n\n '6.1' => '6.1\tIncrease funds for research and development',\n '6.2' => '6.2\tIncrease resources mobilized from sources other than the government subsidy budget',\n '6.3' => '6.3\tIncrease efficiency in utilizing funds',\n '6.4' => '6.4\tDecrease dependency on expatriate academic staff',\n '6.5' => '6.5\tReduce staff attrition rate',\n );\n\n $kpis = InstitutionReportCard::getEnum('kpi');\n\n $this->saveKpi($policies, $descriptions, $kpis, '1', '1.1', '1.1.1');\n $this->saveKpi($policies, $descriptions, $kpis, '1', '1.1', '1.1.2');\n $this->saveKpi($policies, $descriptions, $kpis, '1', '1.1', '1.1.3');\n $this->saveKpi($policies, $descriptions, $kpis, '1', '1.1', '1.1.4');\n\n $this->saveKpi($policies, $descriptions, $kpis, '1', '1.2', '1.2.1');\n $this->saveKpi($policies, $descriptions, $kpis, '1', '1.2', '1.2.2');\n $this->saveKpi($policies, $descriptions, $kpis, '1', '1.2', '1.2.3');\n\n $this->saveKpi($policies, $descriptions, $kpis, '1', '1.3', '1.3.1');\n $this->saveKpi($policies, $descriptions, $kpis, '1', '1.3', '1.3.2');\n $this->saveKpi($policies, $descriptions, $kpis, '1', '1.3', '1.3.3');\n $this->saveKpi($policies, $descriptions, $kpis, '1', '1.3', '1.3.4');\n\n $this->saveKpi($policies, $descriptions, $kpis, '1', '1.4', '1.4.1');\n $this->saveKpi($policies, $descriptions, $kpis, '1', '1.4', '1.4.2');\n $this->saveKpi($policies, $descriptions, $kpis, '1', '1.4', '1.4.3');\n\n $this->saveKpi($policies, $descriptions, $kpis, '1', '1.5', '1.5.1');\n $this->saveKpi($policies, $descriptions, $kpis, '1', '1.5', '1.5.2');\n $this->saveKpi($policies, $descriptions, $kpis, '1', '1.5', '1.5.3');\n $this->saveKpi($policies, $descriptions, $kpis, '1', '1.5', '1.5.4');\n\n $this->saveKpi($policies, $descriptions, $kpis, '1', '1.6', '1.6.1');\n $this->saveKpi($policies, $descriptions, $kpis, '1', '1.6', '1.6.2');\n $this->saveKpi($policies, $descriptions, $kpis, '1', '1.6', '1.6.3');\n $this->saveKpi($policies, $descriptions, $kpis, '1', '1.6', '1.6.4');\n\n $this->saveKpi($policies, $descriptions, $kpis, '1', '1.7', '1.7.1');\n $this->saveKpi($policies, $descriptions, $kpis, '1', '1.7', '1.7.2');\n $this->saveKpi($policies, $descriptions, $kpis, '1', '1.7', '1.7.3');\n $this->saveKpi($policies, $descriptions, $kpis, '1', '1.7', '1.7.4');\n\n // break\n\n $this->saveKpi($policies, $descriptions, $kpis, '2', '2.1', '2.1.1', true);\n $this->saveKpi($policies, $descriptions, $kpis, '2', '2.1', '2.1.2', true);\n $this->saveKpi($policies, $descriptions, $kpis, '2', '2.1', '2.1.3', true);\n $this->saveKpi($policies, $descriptions, $kpis, '2', '2.1', '2.1.4', true);\n\n $this->saveKpi($policies, $descriptions, $kpis, '2', '2.2', '2.2.1', true);\n $this->saveKpi($policies, $descriptions, $kpis, '2', '2.2', '2.2.2', true);\n $this->saveKpi($policies, $descriptions, $kpis, '2', '2.2', '2.2.3', true);\n $this->saveKpi($policies, $descriptions, $kpis, '2', '2.2', '2.2.4', true);\n\n $this->saveKpi($policies, $descriptions, $kpis, '2', '2.3', '2.3.1', true);\n $this->saveKpi($policies, $descriptions, $kpis, '2', '2.3', '2.3.2', true);\n $this->saveKpi($policies, $descriptions, $kpis, '2', '2.3', '2.3.3', true);\n $this->saveKpi($policies, $descriptions, $kpis, '2', '2.3', '2.3.4', true);\n\n $this->saveKpi($policies, $descriptions, $kpis, '2', '2.4', '2.4.1', true);\n $this->saveKpi($policies, $descriptions, $kpis, '2', '2.4', '2.4.2', true);\n $this->saveKpi($policies, $descriptions, $kpis, '2', '2.4', '2.4.3', true);\n $this->saveKpi($policies, $descriptions, $kpis, '2', '2.4', '2.4.4', true);\n\n $this->saveKpi($policies, $descriptions, $kpis, '2', '2.5', '2.5.1');\n $this->saveKpi($policies, $descriptions, $kpis, '2', '2.5', '2.5.2');\n $this->saveKpi($policies, $descriptions, $kpis, '2', '2.5', '2.5.3');\n $this->saveKpi($policies, $descriptions, $kpis, '2', '2.5', '2.5.4');\n\n $this->saveKpi($policies, $descriptions, $kpis, '2', '2.6', '2.6.1');\n $this->saveKpi($policies, $descriptions, $kpis, '2', '2.6', '2.6.2');\n $this->saveKpi($policies, $descriptions, $kpis, '2', '2.6', '2.6.3');\n $this->saveKpi($policies, $descriptions, $kpis, '2', '2.6', '2.6.4');\n\n $this->saveKpi($policies, $descriptions, $kpis, '2', '2.7', '2.7.1');\n $this->saveKpi($policies, $descriptions, $kpis, '2', '2.7', '2.7.2');\n $this->saveKpi($policies, $descriptions, $kpis, '2', '2.7', '2.7.3');\n $this->saveKpi($policies, $descriptions, $kpis, '2', '2.7', '2.7.4');\n\n $this->saveKpi($policies, $descriptions, $kpis, '2', '2.8', '2.8.1');\n $this->saveKpi($policies, $descriptions, $kpis, '2', '2.8', '2.8.2');\n $this->saveKpi($policies, $descriptions, $kpis, '2', '2.8', '2.8.3');\n $this->saveKpi($policies, $descriptions, $kpis, '2', '2.8', '2.8.4');\n\n $this->saveKpi($policies, $descriptions, $kpis, '2', '2.9', '2.9.1');\n $this->saveKpi($policies, $descriptions, $kpis, '2', '2.9', '2.9.2');\n $this->saveKpi($policies, $descriptions, $kpis, '2', '2.9', '2.9.3');\n $this->saveKpi($policies, $descriptions, $kpis, '2', '2.9', '2.9.4');\n\n // break\n\n $this->saveKpi($policies, $descriptions, $kpis, '3', '3.1', '3.1.1');\n $this->saveKpi($policies, $descriptions, $kpis, '3', '3.1', '3.1.2', true);\n $this->saveKpi($policies, $descriptions, $kpis, '3', '3.1', '3.1.3');\n $this->saveKpi($policies, $descriptions, $kpis, '3', '3.1', '3.1.4');\n\n $this->saveKpi($policies, $descriptions, $kpis, '3', '3.2', '3.2.1');\n $this->saveKpi($policies, $descriptions, $kpis, '3', '3.3', '3.3.1');\n\n $this->saveKpi($policies, $descriptions, $kpis, '3', '3.4', '3.4.1');\n $this->saveKpi($policies, $descriptions, $kpis, '3', '3.4', '3.4.2');\n $this->saveKpi($policies, $descriptions, $kpis, '3', '3.4', '3.4.3');\n\n // break\n\n $this->saveKpi($policies, $descriptions, $kpis, '4', '4.1', '4.1.1');\n $this->saveKpi($policies, $descriptions, $kpis, '4', '4.2', '4.2.1');\n $this->saveKpi($policies, $descriptions, $kpis, '4', '4.3', '4.3.1');\n $this->saveKpi($policies, $descriptions, $kpis, '4', '4.4', '4.4.1');\n $this->saveKpi($policies, $descriptions, $kpis, '4', '4.5', '4.5.1');\n $this->saveKpi($policies, $descriptions, $kpis, '4', '4.6', '4.6.1');\n $this->saveKpi($policies, $descriptions, $kpis, '4', '4.7', '4.7.1');\n\n // break\n\n $this->saveKpi($policies, $descriptions, $kpis, '5', '5.1', '5.1.1');\n\n $this->saveKpi($policies, $descriptions, $kpis, '5', '5.2', '5.2.1');\n $this->saveKpi($policies, $descriptions, $kpis, '5', '5.2', '5.2.2');\n\n // break\n\n $this->saveKpi($policies, $descriptions, $kpis, '6', '6.1', '6.1.1');\n $this->saveKpi($policies, $descriptions, $kpis, '6', '6.2', '6.2.1');\n $this->saveKpi($policies, $descriptions, $kpis, '6', '6.3', '6.3.1', true);\n $this->saveKpi($policies, $descriptions, $kpis, '6', '6.4', '6.4.1', true);\n\n $this->saveKpi($policies, $descriptions, $kpis, '6', '6.5', '6.5.1', true);\n $this->saveKpi($policies, $descriptions, $kpis, '6', '6.5', '6.5.2', true);\n $this->saveKpi($policies, $descriptions, $kpis, '6', '6.5', '6.5.3', true);\n $this->saveKpi($policies, $descriptions, $kpis, '6', '6.5', '6.5.4', true);\n $this->saveKpi($policies, $descriptions, $kpis, '6', '6.5', '6.5.5', true);\n $this->saveKpi($policies, $descriptions, $kpis, '6', '6.5', '6.5.6', true);\n }",
"function wcfm_wcpvendors_order_mark_fulfilled() {\r\n\t\tglobal $WCFM, $WCFMu, $woocommerce, $wpdb;\r\n\t\t\r\n\t\t$user_id = apply_filters( 'wcfm_current_vendor_id', get_current_user_id() );\r\n\t\t\r\n\t\tif ( !empty( $_POST['orderid'] ) ) {\r\n\t\t\t$order_id = $_POST['orderid'];\r\n\t\t\t$product_id = $_POST['productid'];\r\n\t\t\t$order_item_id = $_POST['orderitemid'];\r\n\t\t\t$tracking_url = $_POST['tracking_url'];\r\n\t\t\t$tracking_code = $_POST['tracking_code'];\r\n\t\t\t$order = wc_get_order( $order_id );\r\n\t\t\t\r\n\t\t\t$tracking_url = apply_filters( 'wcfm_tracking_url', $tracking_url, $tracking_code, $order_id );\r\n\t\t\t\r\n\t\t\tif( $order_item_id ) {\r\n\t\t\t\tif( wcfm_is_vendor() ) {\r\n\t\t\t\t\t$vendor_data = WC_Product_Vendors_Utils::get_vendor_data_from_user();\r\n\t\t\t\t\t\r\n\t\t\t\t\tWC_Product_Vendors_Utils::set_fulfillment_status( absint( $order_item_id ), 'fulfilled' );\r\n\t\t\t\r\n\t\t\t\t\tWC_Product_Vendors_Utils::send_fulfill_status_email( $vendor_data, 'fulfilled', $order_item_id );\r\n\t\t\t\t\t\r\n\t\t\t\t\tWC_Product_Vendors_Utils::clear_reports_transients();\r\n\t\t\t\t\t\r\n\t\t\t\t\t$shop_name = ! empty( $vendor_data['shop_name'] ) ? $vendor_data['shop_name'] : '';\r\n\t\t\t\t\t$wcfm_messages = sprintf( __( 'Vendor <b>%s</b> has shipped <b>%s</b> to customer.<br/>Tracking Code : %s <br/>Tracking URL : <a class=\"wcfm_dashboard_item_title\" target=\"_blank\" href=\"%s\">%s</a>', 'wc-frontend-manager-ultimate' ), $shop_name, get_the_title( $product_id ), $tracking_code, $tracking_url, $tracking_url );\r\n\t\t\t\t\t$WCFM->wcfm_notification->wcfm_send_direct_message( $user_id, 0, 0, 1, $wcfm_messages, 'shipment_tracking' );\r\n\t\t\t\t\t$comment_id = $order->add_order_note( $wcfm_messages, '1');\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$comment_id = $order->add_order_note( sprintf( __( 'Product <b>%s</b> has been shipped to customer.<br/>Tracking Code : %s <br/>Tracking URL : <a href=\"%s\">%s</a>', 'wc-frontend-manager-ultimate' ), get_the_title( $product_id ), $tracking_code, $tracking_url, $tracking_url ), '1');\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t// Update Shipping Tracking Info\r\n\t\t\t\t$this->updateShippingTrackingInfo( $order_id, $order_item_id, $tracking_code, $tracking_url, $product_id );\r\n\t\t\t\t\r\n\t\t\t\tdo_action( 'wcfm_after_order_mark_shipped', $order_id, $order_item_id, $tracking_code, $tracking_url, $product_id );\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\techo \"complete\";\r\n\t\tdie;\r\n\t}",
"public function completeorder($txtName,$txtCouponCode,$txtEmail,$txtPhone,$txtAddress1,$txtAddress2,$txtAddress3,$txtAddress4,$txtCity,$txtLandmark,$txtPin,$ddlState,$ddlPaymentType,$txtSpecialNote,$OrderDiscount,$shippingCharge,$totalAmount){\n\n\t\t$countCartItem = 0;//Count Cart Item Quantity\n\t\tforeach($this->cart->contents() as $items)\n\t\t{\n\t\t $countCartItem++;\n\t\t}\n\t\t$object=array(\n\t\t\t'OrderBY' => $txtName,\n\t\t\t'OrderDateTime' => date('Y/m/d H:i:s'),\n\t\t\t'OrderQuantity' => $countCartItem,\n\t\t\t'OrderCuponCode' => $txtCouponCode,\n\t\t\t'OrderDiscount' => $OrderDiscount,\n\t\t\t'OrderShipmentCharge' => $shippingCharge,\n\t\t\t'OrderTotAmount' => $totalAmount,\n\t\t\t'OrderShipName' => $txtName,\n\t\t\t'OrderShipAddressL1' => $txtAddress1,\n\t\t\t'OrderShipAddressL2' => $txtAddress2,\n\t\t\t'OrderShipAddressL3' => $txtAddress3,\n\t\t\t'OrderShipAddressL4' => $txtAddress4,\n\t\t\t'OrderLandmark' => $txtLandmark,\n\t\t\t'OrderCity' => $txtCity,\n\t\t\t'OrderState' => $ddlState,\n\t\t\t'OrderZip' => $txtPin,\n\t\t\t'OrderCountry' => 'India',\n\t\t\t'OrderPhone' => $txtPhone,\n\t\t\t'OrderEmail' => $txtEmail,\n\t\t\t'OrderStatus' => 'Pending',\n\t\t\t'PaymentMode' => $ddlPaymentType\n\t\t);\n\t\t$this->db->insert('tbl_order_summery', $object);\n\t\t$orderId=$this->db->insert_id();\n\t\t$this->inserOrderproduct($orderId);\n\t\tif($this->session->userdata('referaldiscount'))\n\t\t{\n\t\t\t$this->updatebivapoints();\t\n\t\t}\n\t\t//$this->insertBivapoints($txtEmail,$orderId);\n\t\treturn $orderId;\n\t}"
] | [
"0.6324829",
"0.61118466",
"0.60359365",
"0.59408474",
"0.5861035",
"0.58268744",
"0.58128995",
"0.577165",
"0.57151985",
"0.5704473",
"0.56338316",
"0.5615491",
"0.5503522",
"0.5475466",
"0.54356676",
"0.543047",
"0.5419993",
"0.53952205",
"0.53781676",
"0.5296162",
"0.528078",
"0.5276173",
"0.52561545",
"0.525066",
"0.52500814",
"0.5246688",
"0.52221394",
"0.5216113",
"0.5194683",
"0.5181531",
"0.51810426",
"0.51614666",
"0.51547915",
"0.51533455",
"0.5150813",
"0.51499003",
"0.5148776",
"0.51442206",
"0.51316464",
"0.5127218",
"0.51208824",
"0.5117547",
"0.51071715",
"0.5103527",
"0.51015544",
"0.50997984",
"0.5097505",
"0.50846225",
"0.5081368",
"0.50808704",
"0.50708073",
"0.50698686",
"0.5051016",
"0.50408757",
"0.5040533",
"0.5040208",
"0.5039052",
"0.50387514",
"0.50347936",
"0.5008331",
"0.5008215",
"0.5006056",
"0.5005938",
"0.49980733",
"0.49941885",
"0.4984377",
"0.49833754",
"0.49792048",
"0.49757132",
"0.49709344",
"0.4968738",
"0.49607047",
"0.4947464",
"0.4944872",
"0.4939963",
"0.49217775",
"0.49165732",
"0.49124318",
"0.49065334",
"0.4906154",
"0.48971823",
"0.4892811",
"0.48922423",
"0.48891214",
"0.48884982",
"0.4887969",
"0.488675",
"0.48843372",
"0.48837313",
"0.48816073",
"0.48808903",
"0.48769757",
"0.48692977",
"0.48669192",
"0.48644093",
"0.48544577",
"0.48542967",
"0.485375",
"0.48530912",
"0.48528475",
"0.48476478"
] | 0.0 | -1 |
Create a new aggregateMetricSpec. | public function post($args)
{
/** @var ApihelperComponent $apihelperComponent */
$apihelperComponent = MidasLoader::loadComponent('Apihelper');
$apihelperComponent->validateParams($args, array('producer_id'));
$apihelperComponent->requirePolicyScopes(array(MIDAS_API_PERMISSION_SCOPE_WRITE_DATA));
/** @var int $producerId */
$producerId = $args['producer_id'];
/** @var Tracker_ProducerModel $producerModel */
$producerModel = MidasLoader::loadModel('Producer', $this->moduleName);
/** @var Tracker_ProducerDao $producerDao */
$producerDao = $producerModel->load($producerId);
$userDao = $apihelperComponent->getUser($args);
if ($producerModel->policyCheck($producerDao, $userDao, MIDAS_POLICY_WRITE) === false) {
throw new Exception('The producer does not exist or you do not have the necessary permission', MIDAS_INVALID_POLICY);
}
/** @var Tracker_AggregateMetricSpecModel $aggregateMetricSpecModel */
$aggregateMetricSpecModel = MidasLoader::loadModel('AggregateMetricSpec', $this->moduleName);
/** @var Tracker_AggregateMetricSpecDao $aggregateMetricSpecDao */
$aggregateMetricSpecDao = $aggregateMetricSpecModel->initDao('AggregateMetricSpec', $args, $this->moduleName);
$aggregateMetricSpecModel->save($aggregateMetricSpecDao);
return $this->_toArray($aggregateMetricSpecDao);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function createAggregate(\n $aggregateIdentifier,\n DomainEventMessageInterface $firstEvent\n );",
"private function buildAggregation()\n {\n $aggregation = new TermsAggregation('test_agg');\n $aggregation->setField('description');\n $aggregation2 = new RangeAggregation('test_agg_2');\n $aggregation2->setField('price');\n $aggregation2->addRange(null, 20);\n $aggregation2->addRange(20, null);\n $aggregation->addAggregation($aggregation2);\n\n return $aggregation;\n }",
"public static function createFromDiscriminatorValue(ParseNode $parseNode): AggregatedInboundStatistics {\n return new AggregatedInboundStatistics();\n }",
"public function testOrgApacheJackrabbitOakPluginsMetricStatisticsProviderFactory()\n {\n $client = static::createClient();\n\n $path = '/system/console/configMgr/org.apache.jackrabbit.oak.plugins.metric.StatisticsProviderFactory';\n\n $crawler = $client->request('POST', $path);\n }",
"protected function getGroupCreateStructFixture()\n {\n $struct = new GroupCreateStruct();\n\n $struct->name = array(\n 'always-available' => 'eng-GB',\n 'eng-GB' => 'Media',\n );\n $struct->description = array(\n 'always-available' => 'eng-GB',\n 'eng-GB' => '',\n );\n $struct->identifier = 'Media';\n $struct->created = 1032009743;\n $struct->modified = 1033922120;\n $struct->creatorId = 14;\n $struct->modifierId = 14;\n\n return $struct;\n }",
"public function testAggregateRuleGroups()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"public function givenAUuidWhenAggregateIsCreatedThenItShouldGetIdProperly()\n {\n $aggregate = new class(Uuid::fromString('03ad41b9-25f2-4f1b-8104-74e99f5b9096')) extends AggregateRoot {\n public function __construct(Uuid $id)\n {\n parent::__construct($id);\n }\n };\n\n $this->assertEquals($aggregate->id()->toString(), '03ad41b9-25f2-4f1b-8104-74e99f5b9096');\n }",
"public function aggregate($aggregations) {\n\t\t$this->init_aggregations($aggregations);\n\t\treturn $this;\n\t}",
"public static function createFromDiscriminatorValue(ParseNode $parseNode): ManagementTemplateCollectionTenantSummary {\n return new ManagementTemplateCollectionTenantSummary();\n }",
"public function testAggregateRules()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"public function setAggregate($aggregate)\n {\n $this->aggregate = $aggregate;\n\n return $this;\n }",
"public function aggregate($value) {\n return $this->setProperty('aggregate', $value);\n }",
"public function aggregate($value) {\n return $this->setProperty('aggregate', $value);\n }",
"public function testAggregateMember()\n {\n }",
"public static function createInstance()\n {\n return new GroupingColumn('ISerializable', 'ISerializable');\n }",
"public function createSize()\n {\n $o = new SizeSelector();\n $this->appendSelector($o);\n\n return $o;\n }",
"public function __construct($spec);",
"public function givenAnAggregateWhenItIsCreatedThenEventStreamShouldBeEmpty()\n {\n $aggregate = new class(Uuid::fromString('03ad41b9-25f2-4f1b-8104-74e99f5b9096')) extends AggregateRoot {\n public function __construct(Uuid $id)\n {\n parent::__construct($id);\n }\n };\n\n $this->assertEmpty($aggregate->pullEvents());\n }",
"public static function create(array $parsedResponse)\n {\n $result = new Metrics();\n $result->setVersion($parsedResponse['Version']);\n $result->setEnabled(Utilities::toBoolean($parsedResponse['Enabled']));\n if ($result->getEnabled()) {\n $result->setIncludeAPIs(\n Utilities::toBoolean($parsedResponse['IncludeAPIs'])\n );\n }\n $result->setRetentionPolicy(\n RetentionPolicy::create($parsedResponse['RetentionPolicy'])\n );\n\n return $result;\n }",
"public function aggregateType();",
"public function createMetric($label, $fields = array(), $private = true, $writeable = false) {\n // Merge supplied properties with default values\n $data = array_merge(array(\n \"label\" => (string)$label, \n \"private\" => (bool)$private,\n \"writeable\" => (bool)$writeable\n ), $fields); \n $result = $this->post(\"/v2/metrics\", $data);\n return $result; \n }",
"public static function create($modelAlias = null, $criteria = null)\n\t{\n\t\tif ($criteria instanceof AchievementGroupQuery) {\n\t\t\treturn $criteria;\n\t\t}\n\t\t$query = new AchievementGroupQuery();\n\t\tif (null !== $modelAlias) {\n\t\t\t$query->setModelAlias($modelAlias);\n\t\t}\n\t\tif ($criteria instanceof Criteria) {\n\t\t\t$query->mergeWith($criteria);\n\t\t}\n\t\treturn $query;\n\t}",
"public function create($props = []) {\n $this->assignProperties($props);\n \n if ($this->id) {\n $this->modify($props);\n if (!empty($props['add_to_run'])) {\n $this->addToRun();\n }\n \n return $this;\n } else {\n $id = $this->db->insert('survey_units', array(\n 'type' => $this->type,\n 'created' => mysql_now(),\n 'modified' => mysql_now(),\n ));\n\n $this->valid = true;\n $this->id = $id;\n\n return $this->addToRun();\n }\n }",
"public function createItemmetric($metricName, $bmsName)\n {\n /** @var Batchmake_ItemmetricDao $itemmetric */\n $itemmetric = MidasLoader::newDao('ItemmetricDao', 'batchmake');\n\n // make sure one isn't already there by this name\n $found = $this->findBy('metric_name', $metricName);\n if (isset($found) && count($found) > 0) {\n // don't allow the creation, as we have a metric of this name already\n throw new Zend_Exception('An Itemmetric already exists with that name');\n }\n\n $itemmetric->setMetricName($metricName);\n $itemmetric->setBmsName($bmsName);\n $this->save($itemmetric);\n\n return $itemmetric;\n }",
"public function givenAggregate($aggregateIdentifier);",
"public function create()\n {\n return view('Products.metrica.newMetric');\n }",
"function testCreateCubeDimensionMeasures()\r\n\t{\r\n\t\t$olap = new Olap($this->dbh);\r\n\t\t$olap->deleteCube($this->testCubeName); // Purge cube if already exists\r\n\r\n\t\t// Get new cube\r\n\t\t$cube = $olap->getCube($this->testCubeName);\r\n\r\n\t\t// Now dynamically create dimension\r\n\t\t$dim = $cube->getDimension(\"country\");\r\n\t\t$this->assertTrue($dim->id > 0);\r\n\t\t$this->assertTrue($this->dbh->ColumnExists(\"facts_\".$cube->id, \"dim_\".$dim->id));\r\n\r\n\t\t// Now dynamically create measure\r\n\t\t$meas = $cube->getMeasure(\"count\");\r\n\t\t$this->assertTrue($meas->id > 0);\r\n\t\t$this->assertTrue($this->dbh->ColumnExists(\"facts_\".$cube->id, \"m_\".$meas->id));\r\n\r\n\t\t// Unload data just to make sure nothing is cached\r\n\t\tunset($cube);\r\n\t\t$cube = $olap->getCube($this->testCubeName);\r\n $dim = $cube->getDimension(\"country\", null, false);\r\n\t\t$this->assertTrue($dim->id > 0); // do not create it if it does not exist (second param)\r\n \r\n $meas = $cube->getMeasure(\"count\", false);\r\n\t\t$this->assertTrue($meas->id > 0); // do not create it if it does not exist (second param)\r\n\r\n\t\t$cube->remove();\r\n\t}",
"public function addAggregation($aggregate)\n {\n $aggregateQuery = new AggregateQuery(\n $this->connection,\n $this->parentName,\n [\n 'query' => $this->query,\n 'limitToLast' => $this->limitToLast\n ],\n $aggregate\n );\n\n return $aggregateQuery;\n }",
"public function getBaseSpec();",
"public function createAssetGroup(array $arguments)\n {\n return new \\Magento\\Framework\\View\\Asset\\PropertyGroup($arguments['properties']);\n }",
"public function testConvertToEloquentWithAggregates()\n {\n $queryString = 'sum=amount';\n list($eloquentConditions, $aggregates) = $this->parser->parse($queryString)->convertToEloquent();\n $expected = [\n 'function' => 'sum',\n 'field' => 'amount'\n ];\n $this->assertEquals($expected, $aggregates);\n }",
"public function construct_group($courseid, $timecreated, $timemodified) {\n global $DB;\n $group = new stdClass();\n $group->courseid = $courseid;\n $group->name = 'TestGroup1';\n $group->timecreated = $timecreated;\n $group->timemodified = $timemodified;\n $group->id = $DB->insert_record('groups', $group);\n return $group;\n }",
"public function testAggregateCount() {\n $this->setupTestEntities();\n\n $view = Views::getView('test_aggregate_count');\n $this->executeView($view);\n\n $this->assertCount(2, $view->result, 'Make sure the count of items is right.');\n\n $types = [];\n foreach ($view->result as $item) {\n // num_records is an alias for id.\n $types[$item->entity_test_name] = $item->num_records;\n }\n\n $this->assertEquals(4, $types['name1']);\n $this->assertEquals(3, $types['name2']);\n }",
"public static function create($modelAlias = null, $criteria = null)\n {\n if ($criteria instanceof CollectorProfileArchiveQuery)\n {\n return $criteria;\n }\n $query = new CollectorProfileArchiveQuery();\n if (null !== $modelAlias)\n {\n $query->setModelAlias($modelAlias);\n }\n if ($criteria instanceof Criteria)\n {\n $query->mergeWith($criteria);\n }\n return $query;\n }",
"public static function create($snapshotName = 'snapshot')\n {\n Schema::create($snapshotName, function (Blueprint $snapshot) use ($snapshotName) {\n // UUID4 of linked aggregate\n $snapshot->char('aggregate_id', 36);\n // Class of the linked aggregate\n $snapshot->string('aggregate_type', 150);\n // Version of the aggregate after event was recorded\n $snapshot->integer('last_version', false, true);\n // DateTime ISO8601 + microseconds UTC stored as a string e.g. 2016-02-02T11:45:39.000000\n $snapshot->char('created_at', 26);\n $snapshot->binary('aggregate_root');\n\n $snapshot->index(['aggregate_id', 'aggregate_type'], $snapshotName . '_m_v_uix');\n });\n }",
"function __construct($id, $name, $golden_mean, $mr_rating)\n {\n $this->id = $id;\n $this->name = $name;\n $this->golden_mean = $golden_mean;\n $this->mr_rating = $mr_rating ?? 'NULL';\n $this->metrics = array();\n }",
"public function metricHit(): MetricHit\n {\n return new MetricHit($this->_provider);\n }",
"public function testGetNamedMetric(): void\n {\n $this->collection->setResult($this->timeResult);\n $this->assertEquals(1, $this->collection->getMetric(TimeResult::class, 'net'));\n }",
"public function create(Request $req)\n\t{\n\t\t$new = new Metric();\n\n\t\t$new->name = $req->input('name');\n\t\t$new->keywords = $req->input('keywords');\n\n\t\tif($new->save())\n\t\t{\n\t\t\treturn array('status'=>'Saved!');\n\t\t}\n\t\treturn array('status'=>'Not Saved!');\n\t}",
"public function testComAdobeGraniteSystemMonitoringImplSystemStatsMBeanImpl()\n {\n $client = static::createClient();\n\n $path = '/system/console/configMgr/com.adobe.granite.system.monitoring.impl.SystemStatsMBeanImpl';\n\n $crawler = $client->request('POST', $path);\n }",
"public function orderByAggregationAndMetric($aggName, string $metric, bool $asc): self\n {\n // {\n // \"aggs\" : {\n // \"genders\" : {\n // \"terms\" : {\n // \"field\" : \"gender\",\n // \"order\" : { \"height_stats.avg\" : \"desc\" }\n // },\n // \"aggs\" : {\n // \"height_stats\" : { \"stats\" : { \"field\" : \"height\" } }\n // }\n // }\n // }\n // }\n $this->order[] = new ElasticSearchAggregationTermsOrder($aggName . '.' . $metric, $asc);\n\n return $this;\n }",
"function create($name) {\r\n $measureunitObj = new MeasureUnit();\r\n $measureunitObj->setname($name);\r\n\t\t$measureunitObj->save();\r\n\t\treturn true;\r\n\t}",
"function testAutoAggregate() \r\n\t{\r\n\t\t$dbh = $this->dbh;\r\n\r\n\t\t// sum\r\n\t\t// ------------------------------------------------------\r\n\t\t$objTask = new CAntObject($dbh, \"task\", null, $this->user);\r\n\t\t$objTask->setValue(\"name\", \"utest - aggregate test\");\r\n\t\t$tid = $objTask->save();\r\n\t\tunset($objTest);\r\n\t\t$objTime1 = new CAntObject($dbh, \"time\", null, $this->user);\r\n\t\t$objTime1->setValue(\"hours\", 1);\r\n\t\t$objTime1->setValue(\"task_id\", $tid);\r\n\t\t$objTime1->save();\r\n\t\t$objTime2 = new CAntObject($dbh, \"time\", null, $this->user);\r\n\t\t$objTime2->setValue(\"task_id\", $tid);\r\n\t\t$objTime2->setValue(\"hours\", 1);\r\n\t\t$objTime2->save();\r\n\r\n\t\t// The task cost_action should be set to 2\r\n\t\t$objTask = new CAntObject($dbh, \"task\", $tid, $this->user);\r\n\t\t//$this->assertEquals($objTask->getValue(\"cost_actual\"), 2); 07/10/2012 Marl - Uncomment this test after fixing the \"Task Time Log\" bug issue\r\n\r\n\t\t// Cleanup\r\n\t\t$objTime1->removeHard();\r\n\t\t$objTime2->removeHard();\r\n\t\t$objTask->removeHard();\r\n\r\n\t\t// avg\r\n\t\t// ------------------------------------------------------\r\n\t\t$objPro = new CAntObject($dbh, \"product\", null, $this->user);\r\n\t\t$objPro->setValue(\"name\", \"ptest - aggregate test\");\r\n\t\t$pid = $objPro->save();\r\n\t\tunset($objTest);\r\n\t\t$objReview1 = new CAntObject($dbh, \"product_review\", null, $this->user);\r\n\t\t$objReview1->setValue(\"rating\", 1);\r\n\t\t$objReview1->setValue(\"product\", $pid);\r\n\t\t$objReview1->save();\r\n\t\t$objReview2 = new CAntObject($dbh, \"product_review\", null, $this->user);\r\n\t\t$objReview2->setValue(\"rating\", 3);\r\n\t\t$objReview2->setValue(\"product\", $pid);\r\n\t\t$objReview2->save();\r\n\r\n\t\t// The product rating should be an avg of 2\r\n\t\t$objPro = new CAntObject($dbh, \"product\", $pid, $this->user);\r\n\t\t//$this->assertEquals($objPro->getValue(\"rating\"), 2); 07/10/2012 Marl - Uncomment this test after fixing the \"Task Time Log\" bug issue\r\n\r\n\t\t// Cleanup\r\n\t\t$objReview1->removeHard();\r\n\t\t$objReview2->removeHard();\r\n\t\t$objPro->removeHard();\r\n\t}",
"public function testAggregateEvents()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"public static function createFromDiscriminatorValue(ParseNode $parseNode): UserExperienceAnalyticsBatteryHealthCapacityDetails {\n return new UserExperienceAnalyticsBatteryHealthCapacityDetails();\n }",
"public static function createMeasure(Measure $measure): bool;",
"public function testNamedMetricDoesNotExist(): void\n {\n $this->expectException(\\InvalidArgumentException::class);\n $this->expectExceptionMessage('Unknown metric \"foobar\" for result class \"PhpBench\\Model\\Result\\TimeResult\". Available metrics: \"net\"');\n $this->collection->setResult($this->timeResult);\n $this->assertEquals(1, $this->collection->getMetric(TimeResult::class, 'foobar'));\n }",
"public function create(DocumentGroupDefinition $definition);",
"public function add(MetricInterface $metric);",
"public function __construct($metrics, $dimensions)\n {\n $this->metrics = $metrics;\n $this->dimensions = $dimensions;\n }",
"public function getAggregateType();",
"public function testGroupByFieldWithCardinality() {\n $field_storage = FieldStorageConfig::create([\n 'type' => 'integer',\n 'field_name' => 'field_test',\n 'cardinality' => 4,\n 'entity_type' => 'entity_test_mul',\n ]);\n $field_storage->save();\n $field = FieldConfig::create([\n 'field_name' => 'field_test',\n 'entity_type' => 'entity_test_mul',\n 'bundle' => 'entity_test_mul',\n ]);\n $field->save();\n\n $entities = [];\n $entity = EntityTestMul::create([\n 'field_test' => [1, 1, 1],\n ]);\n $entity->save();\n $entities[] = $entity;\n\n $entity = EntityTestMul::create([\n 'field_test' => [2, 2, 2],\n ]);\n $entity->save();\n $entities[] = $entity;\n\n $entity = EntityTestMul::create([\n 'field_test' => [2, 2, 2],\n ]);\n $entity->save();\n $entities[] = $entity;\n\n $view = Views::getView('test_group_by_count_multicardinality');\n $this->executeView($view);\n $this->assertCount(2, $view->result);\n\n $this->assertEquals('3', $view->getStyle()->getField(0, 'id'));\n $this->assertEquals('1', $view->getStyle()->getField(0, 'field_test'));\n $this->assertEquals('6', $view->getStyle()->getField(1, 'id'));\n $this->assertEquals('2', $view->getStyle()->getField(1, 'field_test'));\n\n $entities[2]->field_test[0]->value = 3;\n $entities[2]->field_test[1]->value = 4;\n $entities[2]->field_test[2]->value = 5;\n $entities[2]->save();\n\n $view = Views::getView('test_group_by_count_multicardinality');\n $this->executeView($view);\n $this->assertCount(5, $view->result);\n\n $this->assertEquals('3', $view->getStyle()->getField(0, 'id'));\n $this->assertEquals('1', $view->getStyle()->getField(0, 'field_test'));\n $this->assertEquals('3', $view->getStyle()->getField(1, 'id'));\n $this->assertEquals('2', $view->getStyle()->getField(1, 'field_test'));\n $this->assertEquals('1', $view->getStyle()->getField(2, 'id'));\n $this->assertEquals('3', $view->getStyle()->getField(2, 'field_test'));\n $this->assertEquals('1', $view->getStyle()->getField(3, 'id'));\n $this->assertEquals('4', $view->getStyle()->getField(3, 'field_test'));\n $this->assertEquals('1', $view->getStyle()->getField(4, 'id'));\n $this->assertEquals('5', $view->getStyle()->getField(4, 'field_test'));\n\n // Check that translated values are correctly retrieved and are not grouped\n // into the original entity.\n $translation = $entity->addTranslation('it');\n $translation->field_test = [6, 6, 6];\n $translation->save();\n\n $view = Views::getView('test_group_by_count_multicardinality');\n $this->executeView($view);\n\n $this->assertCount(6, $view->result);\n $this->assertEquals('3', $view->getStyle()->getField(5, 'id'));\n $this->assertEquals('6', $view->getStyle()->getField(5, 'field_test'));\n }",
"public static function create($header = [], $payload = [], ?string $signature = null)\n {\n if (!is_array($header) && !is_object($header)) {\n throw new InvalidArgumentException('Invalid JWT header.');\n } else {\n $header = (array) $header;\n }\n\n if (isset($header['typ']) && $header['typ'] !== 'JWT') {\n throw new InvalidJwtException('Invalid JWT type.');\n }\n\n if (!is_array($payload) && !is_object($payload)) {\n throw new InvalidArgumentException('Invalid JWT payload.');\n } else {\n $payload = (array) $payload;\n }\n\n // Create, populate, and then return the resulting JWT object\n $jwt = new static(\n $header['alg'] ?? null,\n $header,\n $signature\n );\n\n foreach ($payload as $claim => $value) {\n $jwt->{$claim} = $value;\n }\n\n return $jwt;\n }",
"public function aggregate(string $column, string $aggregate)\n {\n $this->select = ['aggregate' => $aggregate, 'column' => $column];\n\n return $this;\n }",
"public function getAggregate()\n {\n return $this->aggregate;\n }",
"public function __construct()\r\n {\r\n if(1 == func_num_args())\r\n {\r\n $this->capacityGroup = func_get_arg(0);\r\n }\r\n }",
"public function testAggregation()\n {\n $statistics = json_decode(file_get_contents(base_path('tests/database/yrkesstatistik_aggregated.json')), true);\n\n // Compare with master\n foreach (YrkesstatistikAggregated::all() as $count => $agg) {\n //dd($statistics[$count]['statistics']['entries'][0], $agg->statistics['entries'][0]);\n $this->assertEqualsCanonicalizing($statistics[$count]['statistics'], $agg->statistics);\n }\n }",
"public function createEmptyMetadata();",
"public static function create($aggregateRootClass, DomainEventStreamInterface $eventStream) {\n\n\t\t/** @var AbstractEventSourcedAggregateRoot $aggregateRoot */\n\t\t$aggregateRoot = new $aggregateRootClass();\n\t\t$aggregateRoot->initialize($eventStream);\n\n\t\treturn $aggregateRoot;\n\t}",
"function albumSummary() {\n $ro = new AlbumSummaryRO();\n \n $files = glob('Pics/*');\n $ro->numAlbums = count($files);\n\n $ro->usedSpace = round(filesize_r('Pics') / 1000000); // space in MiB\n $ro->totalSpace = $ro->usedSpace + round(disk_free_space(\"/\") / 1000000); // space in GiB\n\n return $ro;\n}",
"function testCreateCubeDimensionTimeSeries()\r\n\t{\r\n\t\t$olap = new Olap($this->dbh);\r\n\t\t$olap->deleteCube($this->testCubeName); // Purge cube if already exists\r\n\r\n\t\t// Get new cube\r\n\t\t$cube = $olap->getCube($this->testCubeName);\r\n\r\n\t\t// Record an entry for each quarter\r\n\t\t$data = array(\r\n\t\t\t'page' => \"/index.php\",\r\n\t\t\t'country' => \"us\",\r\n\t\t\t'time' => \"1/1/2012\",\r\n\t\t);\r\n\t\t$measures = array(\"hits\" => 100);\r\n\t\t$cube->writeData($measures, $data);\r\n\t\t$data = array(\r\n\t\t\t'page' => \"/about.php\",\r\n\t\t\t'country' => \"us\",\r\n\t\t\t'time' => \"4/1/2012\",\r\n\t\t);\r\n\t\t$measures = array(\"hits\" => 75);\r\n\t\t$cube->writeData($measures, $data);\r\n\t\t$data = array(\r\n\t\t\t'page' => \"/about.php\",\r\n\t\t\t'country' => \"us\",\r\n\t\t\t'time' => \"7/1/2012\",\r\n\t\t);\r\n\t\t$measures = array(\"hits\" => 50);\r\n\t\t$cube->writeData($measures, $data);\r\n\t\t$data = array(\r\n\t\t\t'page' => \"/about.php\",\r\n\t\t\t'country' => \"us\",\r\n\t\t\t'time' => \"10/1/2012\",\r\n\t\t);\r\n\t\t$measures = array(\"hits\" => 25);\r\n\t\t$cube->writeData($measures, $data);\r\n\r\n\t\t// Pull data for each quarter\r\n\t\t$query = new Olap_Cube_Query();\r\n\t\t$query->addMeasure(\"hits\", \"sum\");\r\n\t\t$query->addDimension(\"time\", \"asc\", \"Q Y\");\r\n\t\t$data = $cube->getData($query);\r\n\t\t$this->assertEquals($data['Q1 2012']['hits'], 100);\r\n\t\t$this->assertEquals($data['Q2 2012']['hits'], 75);\r\n\t\t$this->assertEquals($data['Q3 2012']['hits'], 50);\r\n\t\t$this->assertEquals($data['Q4 2012']['hits'], 25);\r\n\r\n\t\t// Try with second dimension\r\n\t\t$query = new Olap_Cube_Query();\r\n\t\t$query->addMeasure(\"hits\", \"sum\");\r\n\t\t$query->addDimension(\"country\");\r\n\t\t$query->addDimension(\"time\", \"asc\", \"Q Y\");\r\n\t\t$data = $cube->getData($query);\r\n\t\t$this->assertEquals($data['us']['Q1 2012']['hits'], 100);\r\n\t\t$this->assertEquals($data['us']['Q2 2012']['hits'], 75);\r\n\t\t$this->assertEquals($data['us']['Q3 2012']['hits'], 50);\r\n\t\t$this->assertEquals($data['us']['Q4 2012']['hits'], 25);\r\n\r\n\t\t$cube->remove();\r\n\t}",
"public function start() {\n\t\ttry {\n\n\t\t\t// Make sure the previous one is stopped\n\t\t\tif (!empty($this->measurements) && !$this->measurements[sizeof($this->measurements) - 1]->isStopped()) {\n\t\t\t\tthrow new AggregatedMeasurementDoubleStartStopwatchException($this);\n\t\t\t}\n\n\t\t\t$this->measurements[] = new Measurement($this->count);\n\n\t\t} catch (StopwatchException $ex) {\n\t\t\tStopwatchException::handle($ex);\n\t\t}\n\n\t\treturn $this;\n\t}",
"public function setupBucket($property_short)\n\t{\n\t\t$space_def = self::getSpaceDefinition($property_short, TRUE);\n\t\treturn $this->createSpaceKey($space_def, FALSE);\n\t}",
"public function setMetricType($val)\n {\n $this->_propDict[\"metricType\"] = $val;\n return $this;\n }",
"public function create()\n {\n $definition = $this->definition->toArray();\n\n if (! isset($definition[$this->type]) || empty($definition[$this->type])) {\n return;\n }\n\n foreach (range(1, $definition[$this->type]['scale'] ?? 1) as $index) {\n $this->relation()->create(\n $this->baseAttributes($index, $definition[$this->type]) +\n $this->attributes($definition)\n );\n }\n }",
"function aggregate($object, $class_name)\n{\n}",
"public function handle(CreateComponentGroupCommand $command)\n {\n $group = ComponentGroup::create([\n 'name' => $command->name,\n 'order' => $command->order,\n 'collapsed' => $command->collapsed,\n 'visible' => $command->visible,\n ]);\n\n event(new ComponentGroupWasCreatedEvent($this->auth->user(), $group));\n\n return $group;\n }",
"public function deserialize($param)\n {\n if ($param === null) {\n return;\n }\n if (array_key_exists(\"AutoScalingGroupId\",$param) and $param[\"AutoScalingGroupId\"] !== null) {\n $this->AutoScalingGroupId = $param[\"AutoScalingGroupId\"];\n }\n\n if (array_key_exists(\"ScalingPolicyName\",$param) and $param[\"ScalingPolicyName\"] !== null) {\n $this->ScalingPolicyName = $param[\"ScalingPolicyName\"];\n }\n\n if (array_key_exists(\"ScalingPolicyType\",$param) and $param[\"ScalingPolicyType\"] !== null) {\n $this->ScalingPolicyType = $param[\"ScalingPolicyType\"];\n }\n\n if (array_key_exists(\"AdjustmentType\",$param) and $param[\"AdjustmentType\"] !== null) {\n $this->AdjustmentType = $param[\"AdjustmentType\"];\n }\n\n if (array_key_exists(\"AdjustmentValue\",$param) and $param[\"AdjustmentValue\"] !== null) {\n $this->AdjustmentValue = $param[\"AdjustmentValue\"];\n }\n\n if (array_key_exists(\"Cooldown\",$param) and $param[\"Cooldown\"] !== null) {\n $this->Cooldown = $param[\"Cooldown\"];\n }\n\n if (array_key_exists(\"MetricAlarm\",$param) and $param[\"MetricAlarm\"] !== null) {\n $this->MetricAlarm = new MetricAlarm();\n $this->MetricAlarm->deserialize($param[\"MetricAlarm\"]);\n }\n\n if (array_key_exists(\"PredefinedMetricType\",$param) and $param[\"PredefinedMetricType\"] !== null) {\n $this->PredefinedMetricType = $param[\"PredefinedMetricType\"];\n }\n\n if (array_key_exists(\"TargetValue\",$param) and $param[\"TargetValue\"] !== null) {\n $this->TargetValue = $param[\"TargetValue\"];\n }\n\n if (array_key_exists(\"EstimatedInstanceWarmup\",$param) and $param[\"EstimatedInstanceWarmup\"] !== null) {\n $this->EstimatedInstanceWarmup = $param[\"EstimatedInstanceWarmup\"];\n }\n\n if (array_key_exists(\"DisableScaleIn\",$param) and $param[\"DisableScaleIn\"] !== null) {\n $this->DisableScaleIn = $param[\"DisableScaleIn\"];\n }\n\n if (array_key_exists(\"NotificationUserGroupIds\",$param) and $param[\"NotificationUserGroupIds\"] !== null) {\n $this->NotificationUserGroupIds = $param[\"NotificationUserGroupIds\"];\n }\n }",
"function table_create_hourly (\n $readCapacity = 5,\n $writeCapacity = 5\n ) {\n global $db;\n\n $table = $db->prefixTable . 'Hourly';\n $db->client->createTable(array(\n 'TableName' => $table,\n 'AttributeDefinitions' => array(\n array(\n 'AttributeName' => 'name',\n 'AttributeType' => Type::STRING\n ),\n array(\n 'AttributeName' => 'epoch',\n 'AttributeType' => Type::NUMBER\n )\n ),\n 'KeySchema' => array(\n array(\n 'AttributeName' => 'name',\n 'KeyType' => 'HASH'\n ),\n array(\n 'AttributeName' => 'epoch',\n 'KeyType' => 'RANGE'\n )\n ),\n 'ProvisionedThroughput' => array(\n 'ReadCapacityUnits' => $readCapacity,\n 'WriteCapacityUnits' => $writeCapacity\n )\n ));\n \n // wait until the table is created and active\n $db->client->waitUntil('TableExists', array(\n 'TableName' => $table\n ));\n\n return true;\n }",
"public function getMassUnitAttribute()\n {\n return new Mass($this->weight, $this->weight_unit);\n }",
"public function mvcModelMetadataMemoryConstructManual(IntegrationTester $I)\n {\n $I->wantToTest('Mvc\\Model\\MetaData\\Memory - __construct() - manual');\n /** @var MetaDataInterface $metaData */\n $metaData = $this->container->getShared('modelsMetadata');\n\n $robotto = new Robotto();\n\n //Robots\n $pAttributes = [\n 0 => 'id',\n 1 => 'name',\n 2 => 'type',\n 3 => 'year',\n ];\n\n $attributes = $metaData->getAttributes($robotto);\n $I->assertEquals($attributes, $pAttributes);\n\n $ppkAttributes = [\n 0 => 'id',\n ];\n\n $pkAttributes = $metaData->getPrimaryKeyAttributes($robotto);\n $I->assertEquals($ppkAttributes, $pkAttributes);\n\n $pnpkAttributes = [\n 0 => 'name',\n 1 => 'type',\n 2 => 'year',\n ];\n\n $npkAttributes = $metaData->getNonPrimaryKeyAttributes($robotto);\n $I->assertEquals($pnpkAttributes, $npkAttributes);\n\n $I->assertEquals($metaData->getIdentityField($robotto), 'id');\n }",
"public function testBuildGroupByWithOneArgument()\n {\n $query = $this->getQuery()\n ->groupBy('param')\n ;\n\n $this->assertSame(\n 'GROUP BY param',\n $query->buildGroupBy()\n );\n }",
"public function aggregate(): void;",
"public function aggregateCollection(QueryInterface $query): ResultOfAggregateCollection\n {\n return new ResultOfAggregateCollection(\n $this->tonClient->request(\n 'net.aggregate_collection',\n [\n 'collection' => $query->getCollection(),\n 'filter' => $query->getFilters(),\n 'fields' => $query->getAggregation(),\n ]\n )->wait()\n );\n }",
"public function new_measure() {\r\n\r\n\t\t$this->_bodyData['watches'] = $this->watch->getWatches(\r\n\t\t\t$this->session->userdata('userId'));\r\n\r\n\t\t$this->event->add(MEASURE_LOAD);\r\n\r\n\t\tarray_push($this->_headerData['javaScripts'], \"input.time.logic\", \"time.api\");\r\n\r\n\t\t$this->_headerData['headerClass'] = 'blue';\r\n\t\t$this->load->view('header', $this->_headerData);\r\n\r\n\t\t$this->load->view('measure/new-measure', $this->_bodyData);\r\n\r\n\t\t$this->load->view('footer');\r\n\t}",
"public function testBuildGroupByEmpty()\n {\n $query = $this->getQuery();\n\n $this->assertSame(\n '',\n $query->buildGroupBy()\n );\n }",
"public static function createFromDiscriminatorValue(ParseNode $parseNode): EBookInstallSummary {\n return new EBookInstallSummary();\n }",
"public static function factory(array $params=array())\r\n {\r\n $bucket = SquirtUtil::validateParamClass('bucket', 'Riak\\Bucket', $params);\r\n\r\n $instance = new static($bucket);\r\n\r\n $namespace =\r\n SquirtUtil::validateStringParamWithDefault('namespace', $params, 'squirt');\r\n if (strlen($namespace) > 0) {\r\n $instance->setNamespace($namespace);\r\n }\r\n\r\n return $instance;\r\n }",
"public function __construct($weight, UnitOfMeasure $unitOfMeasure)\n {\n $this->weight = $weight;\n $this->unitOfMeasure = $unitOfMeasure;\n }",
"public function createCustomDimensions() {\n foreach($this->_ARRAY as $i => $v) {\n if($v && in_array($i, $this->custom_dimension_map) && strlen($v) > 0) {\n $index = array_search($i, $this->custom_dimension_map);\n $this->payload['cd' . $index] = $this->_ARRAY[\"$i\"] ;\n } \n }\n }",
"function create_reporting_block($reporting_block)\r\n {\r\n return $this->create($reporting_block);\r\n }",
"function statistics_extended_groups_property_count($property){\r\n\tglobal $CONFIG;\r\n\t$properties = $CONFIG->group;\r\n\t$labels = array();\r\n\t$totals = array();\r\n\tif(array_key_exists($property,$properties)){\r\n\t\tlist($type,$values) = $properties[$property];\r\n\t\tswitch($type){\r\n\t\t\tcase \"checkboxes\":\r\n\t\t\tcase \"radio\":\r\n\t\t\t\tforeach($values as $label=>$value){\r\n\t\t\t\t\t$options = array(\"types\"=>\"group\",\"count\"=>true,\"metadata_names\"=>$property,\"metadata_values\"=>$value);\r\n\t\t\t\t\t$total = elgg_get_entities_from_metadata($options);\r\n\t\t\t\t\t$labels[]=$value;\r\n\t\t\t\t\t$totals[$value]=$total;\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"organizational_unit\":\r\n\t\t\t\t$query = \"SELECT string FROM {$CONFIG->dbprefix}metastrings WHERE id IN \";\r\n\t\t\t\t$query.=\"(SELECT value_id FROM {$CONFIG->dbprefix}metadata WHERE name_id=\";\r\n\t\t\t\t$query.=\"(SELECT id FROM {$CONFIG->dbprefix}metastrings WHERE string='{$property}'))\";\r\n\t\t\t\t$categories = get_data($query);\r\n\t\t\t\tif(!empty($categories)){\r\n\t\t\t\t\tforeach($categories as $category){\r\n\t\t\t\t\t\t$category = $category->string;\r\n\t\t\t\t\t\t$options = array(\"types\"=>\"group\",\"count\"=>true,\"metadata_names\"=>$property,\"metadata_values\"=>$category);\r\n\t\t\t\t\t\t$total = elgg_get_entities_from_metadata($options);\r\n\t\t\t\t\t\tlist($section,$department,$unit) = explode(\"||\",$category);\r\n\r\n\t\t\t\t\t\t$labels[$section]=$section;\r\n\t\t\t\t\t\t$totals[$section]+=$total;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"status\":\r\n\t\t\t\t$options = array(\"types\"=>\"group\",\"count\"=>true);\r\n\t\t\t\t$all_groups = elgg_get_entities($options);\r\n\t\t\t\t$values = array(\"preparation\"=>\"groups:extras:status:preparation\",\r\n\t\t\t\t\t\t\t\t\"active\"=>\"groups:extras:status:active\",\r\n\t\t\t\t\t\t\t\t\"inactive\"=>\"groups:extras:status:inactive\",\r\n\t\t\t\t\t\t\t\t\"closed\"=>\"groups:extras:status:closed\");\r\n\t\t\t\tforeach($values as $value=>$label){\r\n\t\t\t\t\t$options = array(\"types\"=>\"group\",\"count\"=>true,\"metadata_names\"=>$property,\"metadata_values\"=>$value);\r\n\t\t\t\t\t$total = elgg_get_entities_from_metadata($options);\r\n\t\t\t\t\t$labels[]=$label;\r\n\t\t\t\t\t$totals[$label]=(int)$total;\r\n\t\t\t\t}\r\n\t\t\t\t$totals[\"groups:extras:status:active\"]=$all_groups-$totals[\"groups:extras:status:inactive\"]-$totals[\"groups:extras:status:closed\"];\r\n\r\n\t\t\t\tbreak;\r\n\r\n\t\t}\r\n\t}\r\n\telse{\r\n\t\tswitch($property){\r\n\t\t\tcase \"content_privacy\":\r\n\t\t\t\t$options = array(\"types\"=>\"group\",\"count\"=>true,\"metadata_names\"=>$property,\"metadata_values\"=>\"no\");\r\n\t\t\t\t$count_no = elgg_get_entities_from_metadata($options);\r\n\t\t\t\t$options = array(\"types\"=>\"group\",\"count\"=>true,);\r\n\t\t\t\t$all_groups = elgg_get_entities($options);\r\n\r\n\t\t\t\t// How content_privacy is a new feature it is no available for all groups\r\n\t\t\t\t$labels[]=\"yes\";\r\n\t\t\t\t$totals[\"yes\"]=$all_groups - $count_no;\r\n\t\t\t\t$labels[]=\"no\";\r\n\t\t\t\t$totals[\"no\"]=$count_no;\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"membership\":\r\n\t\t\t\t$values = array( ACCESS_PRIVATE => elgg_echo('groups:access:private'), ACCESS_PUBLIC => elgg_echo('groups:access:public'));\r\n\t\t\t\tforeach($values as $value=>$label){\r\n\t\t\t\t\t$options = array(\"types\"=>\"group\",\"count\"=>true,\"metadata_names\"=>$property,\"metadata_values\"=>$value);\r\n\t\t\t\t\t$total = elgg_get_entities_from_metadata($options);\r\n\t\t\t\t\t$labels[]=$value;\r\n\t\t\t\t\t$totals[$value]=$total;\r\n\t\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn array($labels,$totals);\r\n}",
"public function __construct()\n\t{\n\t\t$this->entity = new Entity(array(\n\t\t\t'name' => 'group_kind',\n\t\t\t'columns' => array('code', 'name', 'short_name', 'description', 'subkind_of', 'weight'),\n\t\t\t'pkey_columns' => array('code')\n\t\t));\n\t}",
"protected function prepareAggregateStatement($field = '', $alias = '', $type = '')\n {\n $SqlAggregateFunctions = [\n 'AVG' => 'AVG(%s)', // Returns the average value\n 'COUNT' => 'COUNT(%s)', // Returns the number of rows\n 'FIRST' => 'FIRST(%s)', // Returns the first value\n 'LAST' => 'LAST(%s)', // Returns the largest value\n 'MAX' => 'MAX(%s)', // Returns the largest value\n 'MIN' => 'MIN(%s)', // Returns the smallest value\n 'SUM' => 'SUM(%s)' // Returns the sum\n ];\n\n if ($field !== '*' && $this->conn->protectIdentifiers) {\n $field = $this->conn->protectIdentifiers($field);\n }\n\n $alias = empty($alias)\n ? strtolower($type) . '_' . $field\n : $alias;\n $sqlStatement = sprintf($SqlAggregateFunctions[ $type ], $field)\n . ' AS '\n . $this->conn->escapeIdentifiers($alias);\n\n $this->select($sqlStatement);\n\n return $this;\n }",
"public function testCreateObjectNoArgumentsMin()\n {\n $histogram = new \\Aisa\\Dice\\Histogram();\n $this->assertInstanceOf(\"\\Aisa\\Dice\\Histogram\", $histogram);\n $dice = new \\Aisa\\Dice\\DiceHistogram();\n $histogram->injectData($dice);\n $res = $histogram->min;\n $exp = 1;\n $this->assertEquals($exp, $res);\n }",
"protected function determineAggregateType(): void\n\t{\n\t\tif (defined('static::AGGREGATE_TYPE')) {\n\t\t\t/** @phpstan-ignore PHPStan.Rules */\n\t\t\t$this->aggregateType = static::AGGREGATE_TYPE;\n\t\t}\n\n\t\tif ($this instanceof AggregateTypeProviderInterface) {\n\t\t\t$this->aggregateType = $this->aggregateType();\n\t\t\treturn;\n\t\t}\n\n\t\tif (is_array($this->aggregateType)) {\n\t\t\t$this->aggregateType = AggregateType::fromMapping($this->aggregateType);\n\t\t\treturn;\n\t\t}\n\n\t\tif (!$this->aggregateType instanceof AggregateTypeInterface) {\n\t\t\tthrow new RuntimeException(sprintf(\n\t\t\t\t'%s::$aggregateType could not resolve to %s. %s was provided.',\n\t\t\t\tself::class,\n\t\t\t\tAggregateTypeInterface::class,\n\t\t\t\tis_object($this->aggregateType)\n\t\t\t\t\t? get_class($this->aggregateType)\n\t\t\t\t\t: gettype($this->aggregateType)\n\t\t\t));\n\t\t}\n\t}",
"public function createBuilder();",
"protected static function createSampleMediaSet(): void\n {\n /** @var Artist $artist */\n $artist = factory(Artist::class)->create();\n\n // Sample 3 albums\n /** @var Album[] $albums */\n $albums = factory(Album::class, 3)->create([\n 'artist_id' => $artist->id,\n ]);\n\n // 7-15 songs per albums\n foreach ($albums as $album) {\n factory(Song::class, random_int(7, 15))->create([\n 'album_id' => $album->id,\n 'artist_id' => $artist->id,\n ]);\n }\n }",
"public function addAggregate($rule): self\n\t{\n\t\tif ($rule instanceof AggregateRuleInterface) {\n\t\t\t$ruleEntity = new $rule();\n\t\t\tif ($aggregatePayload = $ruleEntity->buildAggregatePayload()) {\n\t\t\t\t$this->aggregates = array_merge($this->aggregates, $aggregatePayload);\n\t\t\t}\n\n\t\t\treturn $this;\n\t\t}\n\n\t\tif ($rule instanceof Closure) {\n\t\t\t$ruleEntity = call_user_func($rule);\n\t\t\tif (is_array($ruleEntity)) {\n\t\t\t\t$this->aggregates = array_merge($this->aggregates, $ruleEntity);\n\t\t\t\t;\n\t\t\t}\n\t\t}\n\n\t\treturn $this;\n\t}",
"public function testAggregateSensorTimeIntervalConfig() {\n $account = $this->drupalCreateUser(array('administer monitoring', 'monitoring reports', 'monitoring reports'));\n $this->drupalLogin($account);\n\n // Create some nodes.\n $node1 = $this->drupalCreateNode(array('type' => 'page'));\n $node2 = $this->drupalCreateNode(array('type' => 'page'));\n\n // Visit the overview and make sure the sensor is displayed.\n $this->drupalGet('admin/reports/monitoring');\n $this->assertText('2 druplicons in 1 day');\n\n // Visit the sensor edit form.\n $this->drupalGet('admin/config/system/monitoring/sensors/entity_aggregate_test');\n // Test for the default value.\n $this->assertFieldByName('settings[aggregation][time_interval_field]', 'created');\n $this->assertFieldByName('settings[aggregation][time_interval_value]', 86400);\n\n // Visit the sensor detail page with verbose output.\n $this->drupalGet('admin/reports/monitoring/sensors/entity_aggregate_test');\n // Check that there is no Save button on the detail page.\n $this->assertNoLink('Save');\n $this->drupalPostForm(NULL, array(), 'Run now');\n // The node labels should appear in verbose output.\n $this->assertText('label');\n $this->assertLink($node1->getTitle());\n $this->assertLink($node2->getTitle());\n\n // Check the sensor overview to verify that the sensor result is\n // calculated and the sensor message is displayed.\n $this->drupalGet('admin/reports/monitoring');\n $this->assertText('2 druplicons in 1 day');\n\n // Update the time interval and set value to no restriction.\n $this->drupalPostForm('admin/config/system/monitoring/sensors/entity_aggregate_test', array(\n 'settings[aggregation][time_interval_value]' => 0,\n ), t('Save'));\n\n // Visit the overview and make sure that no time interval is displayed.\n $this->drupalGet('admin/reports/monitoring');\n $this->assertText('2 druplicons');\n $this->assertNoText('2 druplicons in');\n\n // Update the time interval and empty interval field.\n $this->drupalPostForm('admin/config/system/monitoring/sensors/entity_aggregate_test', array(\n 'settings[aggregation][time_interval_field]' => '',\n 'settings[aggregation][time_interval_value]' => 86400,\n ), t('Save'));\n // Visit the overview and make sure that no time interval is displayed\n // which also make sures no change in time interval applies.\n $this->drupalGet('admin/reports/monitoring');\n $this->assertText('2 druplicons');\n $this->assertNoText('2 druplicons in');\n\n // Update the time interval field with an invalid value.\n $this->drupalPostForm('admin/config/system/monitoring/sensors/entity_aggregate_test', array(\n 'settings[aggregation][time_interval_field]' => 'invalid-field',\n ), t('Save'));\n // Assert the error message.\n $this->assertText('The specified time interval field invalid-field does not exist or is not type timestamp.');\n }",
"public function addAggregate($name, $field, $function, array $parameters = []);",
"public function registerMetrics(PrometheusExporter $exporter);",
"public function addGroupBy($expression)\n\t{\n\t\tif (!is_string($expression)) {\n\t\t\tthrow new InvalidArgumentException('Group by expression has to be a string.');\n\t\t}\n\t\t$this->dirty();\n\t\t$this->group[] = $expression;\n\t\t$this->pushArgs('group', array_slice(func_get_args(), 1));\n\t\treturn $this;\n\t}",
"public function testGroupByMin() {\n $this->groupByTestHelper('min', [1, 5]);\n }",
"public function testGroupByBaseField() {\n $this->setupTestEntities();\n\n $view = Views::getView('test_group_by_count');\n $view->setDisplay();\n // This tests that the GROUP BY portion of the query is properly formatted\n // to include the base table to avoid ambiguous field errors.\n $view->displayHandlers->get('default')->options['fields']['name']['group_type'] = 'min';\n unset($view->displayHandlers->get('default')->options['fields']['id']['group_type']);\n $this->executeView($view);\n $this->assertStringContainsString('GROUP BY entity_test.id', (string) $view->build_info['query'], 'GROUP BY field includes the base table name when grouping on the base field.');\n }",
"public function testGetMetricOrDefault(): void\n {\n $this->collection->setResult($this->timeResult);\n $this->assertEquals(100, $this->collection->getMetricOrDefault('UnknownClass', 'barbar', 100));\n }",
"public function testGroupingThrows(): void\n {\n try {\n new Grouping([], ['property1']);\n $this->fail('InvalidArgumentException not thrown');\n } catch (InvalidArgumentException $ex) {\n $this->assertStringContainsString(sprintf('expected %s', Property::class), $ex->getMessage());\n }\n }",
"public function createAffinityGroup($name, $label, $description = '', $location = '')\n {\n \tif ($name == '' || is_null($name)) {\n\t\t\trequire_once 'Zend/Service/WindowsAzure/Management/Exception.php';\n \t\tthrow new Zend_Service_WindowsAzure_Management_Exception('Affinity group name should be specified.');\n \t}\n \tif ($label == '' || is_null($label)) {\n\t\t\trequire_once 'Zend/Service/WindowsAzure/Management/Exception.php';\n \t\tthrow new Zend_Service_WindowsAzure_Management_Exception('Label should be specified.');\n \t}\n if (strlen($label) > 100) {\n\t\t\trequire_once 'Zend/Service/WindowsAzure/Management/Exception.php';\n \t\tthrow new Zend_Service_WindowsAzure_Management_Exception('Label is too long. The maximum length is 100 characters.');\n \t}\n if (strlen($description) > 1024) {\n\t\t\trequire_once 'Zend/Service/WindowsAzure/Management/Exception.php';\n \t\tthrow new Zend_Service_WindowsAzure_Management_Exception('Description is too long. The maximum length is 1024 characters.');\n \t}\n \tif ($location == '' || is_null($location)) {\n\t\t\trequire_once 'Zend/Service/WindowsAzure/Management/Exception.php';\n \t\tthrow new Zend_Service_WindowsAzure_Management_Exception('Location should be specified.');\n \t}\n\n $response = $this->_performRequest(self::OP_AFFINITYGROUPS, '',\n \t\tZend_Http_Client::POST,\n \t\t['Content-Type' => 'application/xml; charset=utf-8'],\n \t\t'<CreateAffinityGroup xmlns=\"http://schemas.microsoft.com/windowsazure\"><Name>' . $name . '</Name><Label>' . base64_encode($label) . '</Label><Description>' . $description . '</Description><Location>' . $location . '</Location></CreateAffinityGroup>');\n\n \tif (!$response->isSuccessful()) {\n\t\t\trequire_once 'Zend/Service/WindowsAzure/Management/Exception.php';\n\t\t\tthrow new Zend_Service_WindowsAzure_Management_Exception($this->_getErrorMessage($response, 'Resource could not be accessed.'));\n\t\t}\n }",
"public function new_measure_for_watch(){\r\n\r\n\t\tif($this->expectsPost(array('watchId'))){\r\n\r\n\t\t\t$this->_bodyData['selected_watch'] = $this->watchId;\r\n\r\n\t\t\t$this->new_measure();\r\n\r\n\t\t}\r\n\t}",
"public function create_aggregate($name, $step, $final, $arguments = -1)\n\t{\n\t\t$this->_connection or $this->connect();\n\n\t\treturn $this->_connection->sqliteCreateAggregate(\n\t\t\t$name, $step, $final, $arguments\n\t\t);\n\t}",
"public function newEventMonitor($webhook_endpoint, $event_type) {\n $body = [\n 'monitorType' => $event_type,\n 'webhookEndpoint' => $webhook_endpoint,\n ];\n $result = $this->newAPIRequest('POST', '/event_monitors', $body);\n return $result;\n }"
] | [
"0.49018076",
"0.46040216",
"0.45424724",
"0.44101572",
"0.4383036",
"0.42498538",
"0.42220205",
"0.420165",
"0.4197013",
"0.41755673",
"0.41584277",
"0.41441864",
"0.41441864",
"0.41269976",
"0.41112652",
"0.41109547",
"0.40939197",
"0.40472338",
"0.40448725",
"0.4022026",
"0.4009499",
"0.40069953",
"0.39915097",
"0.39897335",
"0.39733025",
"0.39726767",
"0.39660966",
"0.39090657",
"0.39049074",
"0.3887134",
"0.38837633",
"0.38594818",
"0.38421616",
"0.38414675",
"0.38239935",
"0.38178793",
"0.38078633",
"0.38071114",
"0.37750068",
"0.37648433",
"0.37627923",
"0.3752375",
"0.37494507",
"0.37468877",
"0.37407768",
"0.37248185",
"0.3701438",
"0.367202",
"0.36686724",
"0.36676764",
"0.36634228",
"0.3654107",
"0.365233",
"0.3650816",
"0.36413625",
"0.36403027",
"0.36392295",
"0.3628322",
"0.36242414",
"0.36210868",
"0.3619533",
"0.36180484",
"0.36129555",
"0.3608836",
"0.36034095",
"0.36007336",
"0.35903355",
"0.35896203",
"0.35882753",
"0.35857671",
"0.35789847",
"0.3567621",
"0.3555716",
"0.3554085",
"0.35534385",
"0.3551813",
"0.3548825",
"0.35444215",
"0.35408738",
"0.35406646",
"0.3535909",
"0.35329095",
"0.35288057",
"0.35282335",
"0.35181174",
"0.35177627",
"0.35158813",
"0.3507391",
"0.3507304",
"0.3501855",
"0.34997687",
"0.349744",
"0.34946743",
"0.34932244",
"0.34911698",
"0.3488806",
"0.34855935",
"0.34829953",
"0.34824574",
"0.34815645",
"0.34802127"
] | 0.0 | -1 |
Convert the given aggregateMetricSpec DAO to an array and prepend metadata. | protected function _toArray($aggregateMetricSpecDao)
{
$aggregateMetricSpecArray = array(
'_id' => $aggregateMetricSpecDao->getKey(),
'_type' => 'Tracker_AggregateMetricSpec',
);
return array_merge($aggregateMetricSpecArray, $aggregateMetricSpecDao->toArray());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function _get_metadata_as_array($metadata) {\n $metadata_array = array();\n \n foreach ($metadata as $m) {\n if (isset($metadata_array[$m->label])) {\n if (is_array($metadata_array[$m->label])) {\n array_push($metadata_array[$m->label], $m->value);\n } else {\n $metadata_array[$m->label] = array($metadata_array[$m->label], $m->value);\n }\n } else {\n $metadata_array[$m->label] = $m->value;\n }\n }\n\n return $metadata_array;\n}",
"public function armarArrayMetadata($metadata){\n $newMetadata = array();\n foreach($metadata as $key => $value){\n foreach($value as $k => $v){\n $newMetadata[$value['columna']][$k] = $v;\n }\n }\n return $newMetadata;\n }",
"protected function metaobj2array($metadata) {\r\n\t\t$arr = array();\r\n\t\t\r\n\t\tif (is_array($metadata)) {\r\n\t\t\tforeach ($metadata as $meta) {\r\n\t\t\t\t$arr[$meta->Name] = $meta->Value;\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t$arr[$metadata->Name] = $metadata->Value;\r\n\t\t}\r\n\t\treturn $arr;\r\n\t}",
"public function toMagicArray($dateFormat = null)\n\t{\n\t\t$metadata = $this->getTable()->info('metadata');\n\t\tforeach ($metadata as $column => $metadata) {\n\t\t\tif ($metadata['DATA_TYPE'] == 'timestamptz') {\n\t\t\t\tif ($this->$column) {\n\t\t\t\t\t$this->$column = $this->_isoToNormalDate($this->$column, $dateFormat);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $this->toArray();\n\t}",
"public function toArray()\n {\n $a = parent::toArray();\n if ($this->descriptionRef) {\n $a[\"description\"] = $this->descriptionRef;\n }\n if ($this->attribution) {\n $a[\"attribution\"] = $this->attribution->toArray();\n }\n if ($this->qualifiers) {\n $ab = array();\n foreach ($this->qualifiers as $i => $x) {\n $ab[$i] = $x->toArray();\n }\n $a['qualifiers'] = $ab;\n }\n return $a;\n }",
"public function toArray($prefix='') {\n $r = array();\n foreach($this as $field => $data) {\n if(! is_object($data) && ! is_array($data)) {\n $r[$field] = $data;\n }\n }\n return $r;\n }",
"public function toArray(): array\n {\n return [\n 'type' => 'quantilesDoublesSketchToQuantile',\n 'name' => $this->outputName,\n 'field' => $this->dimension->toArray(),\n 'fraction' => $this->fraction,\n ];\n }",
"public function toArray()\n {\n\n $claim_array = [];\n\n /**\n * @var $claim Claim\n */\n foreach ($this->claims as $claim) {\n\n $claim_array[] = [\n 'name' => $claim->getName(),\n 'value' => $claim->getValue()\n ];\n }\n\n return $claim_array;\n }",
"public function toArray() {\n\t\t$data\t= array(\n\t\t\t'hash'\t\t=> $this->getHash(),\n\t\t\t'dims'\t\t=> $this->dims,\n\t\t\t'measures'\t=> $this->measures\n\t\t);\n\n\t\tif (!is_null($this->time)){\n\t\t\t$data['time']\t= $this->time;\n\t\t}\n\n\t\treturn $data;\n\t}",
"static public function toArray(Milestone $milestone)\n {\n $array = self::objectToArray($milestone);\n \n $array['tickets'] = array();\n foreach($milestone->tickets as $ticket) {\n $array['tickets'][] = \\MongoDBRef::create('tickets', $ticket->id);\n }\n \n return $array;\n }",
"public function toArray(): array\n {\n $this->update();\n\n // Copied from DataObjectToArrayTrait. Do not modify here !!!\n $toArray = function($object) use (&$toArray) {\n $result = [];\n $vars = get_object_vars($object);\n foreach ($vars as $name => $value) {\n if ($name !== 'internalDataObjectData') {\n $reflectionProperty = new \\ReflectionProperty($object, $name);\n if ($reflectionProperty->isPublic()) {\n $result[$name] = null;\n }\n }\n }\n if (isset($object->internalDataObjectData)) {\n foreach ($object->internalDataObjectData as $name => $value) {\n $result[substr($name, 1)] = null;\n }\n }\n ksort($result);\n foreach ($result as $name => $null) {\n $value = $object instanceof \\ArrayAccess ? $object[$name] : (isset($object->$name) ? $object->$name : null);\n if (is_object($value)) {\n if (method_exists($value, 'toArray')) {\n $result[$name] = $value->toArray();\n } else {\n if ($value instanceof \\DateTime) {\n $result[$name] = $value->format('c');\n } else {\n $propertyVars = $toArray($value);\n foreach ($propertyVars as $propertyVarName => $propertyVarValue) {\n if (is_object($propertyVarValue)) {\n $propertyVars[$propertyVarName] = $toArray($propertyVarValue);\n }\n }\n $result[$name] = $propertyVars;\n }\n }\n } else {\n $result[$name] = $value;\n }\n }\n return $result;\n };\n\n $result = [];\n foreach ($this->data as $index => $object) {\n $object = $this->updateValueIfNeeded($this->data, $index);\n if (method_exists($object, 'toArray')) {\n $result[] = $object->toArray();\n } else {\n $result[] = $toArray($object);\n }\n }\n return $result;\n }",
"public function toArray()\n {\n $data = [];\n if (isset($this->descriptor)) {\n $data['descriptor'] = $this->descriptor;\n }\n if (isset($this->rowIndex)) {\n $data['rowIndex'] = $this->rowIndex;\n }\n if (isset($this->odd)) {\n $data['odd'] = $this->odd;\n }\n if (isset($this->even)) {\n $data['even'] = $this->even;\n }\n return $data;\n }",
"abstract protected function report_to_array_mapping();",
"abstract public function to_array();",
"public function as_array(){\n return isset($this->data[$this->alias])? $this->data[$this->alias] : $this->data;\n }",
"protected function stageToArray(&$metadata)\n {\n $metadata['stage'] = (array)$metadata['stage'];\n }",
"public function toArray()\n {\n $data = [];\n\n foreach ($this->fields as $fieldName) {\n if ($fieldName === 'shipmentLabels' && $this->shipmentLabels !== null) {\n foreach ($this->shipmentLabels as $shipmentLabel) {\n $data['shipmentLabels'][] = $shipmentLabel->toArray();\n }\n } elseif ($fieldName === 'lastStatusUpdateTime') {\n $data[$fieldName] = $this->lastStatusUpdateTime ? $this->lastStatusUpdateTime->getTimestamp() : null;\n } else {\n $data[$fieldName] = $this->$fieldName;\n }\n }\n\n return $data;\n }",
"public function toArray(): array\n {\n $result = parent::toArray();\n $result['type'] = 'parquet';\n\n return $result;\n }",
"public function toArray()\n\t{\n\t\treturn array_merge($this->data, [\n\t\t\t'__meta' => array_filter([\n\t\t\t\t'showAs' => $this->showAs,\n\t\t\t\t'title' => $this->title,\n\t\t\t\t'labels' => $this->labels\n\t\t\t])\n\t\t]);\n\t}",
"public function asArray() : array\n\t{\n\t\t$item = parent::toArray(TableMap::TYPE_FIELDNAME);\n\n\t\tif (array_key_exists('created_dt', $item))\n\t\t{\n\t\t\t$item['created_dt'] = $this->toW3cDate($item['created_dt']);\n\t\t}\n\n\t\tif (array_key_exists('updated_dt', $item))\n\t\t{\n\t\t\t$item['updated_dt'] = $this->toW3cDate($item['updated_dt']);\n\t\t}\n\n\t\tif (array_key_exists('modified_dt', $item))\n\t\t{\n\t\t\t$item['modified_dt'] = $this->toW3cDate($item['modified_dt']);\n\t\t}\n\n\t\tif (array_key_exists('expire_dt', $item))\n\t\t{\n\t\t\t$item['expire_dt'] = $this->toW3cDate($item['expire_dt']);\n\t\t}\n\n\t\treturn $item;\n\t}",
"public function toArray($params = array())\n\t{\n\t\t$metadata = self::em()->getRepository(static::class)->getMetadata();\n\t\t$columns = $metadata->getColumnsKeys();\n\t\t$data = array();\n\t\tforeach ($columns as $key) {\n\t\t\tif (array_key_exists($key, $this->_data) || array_key_exists($key, $this->_associations)) {\n\t\t\t\t$type = $metadata->getColumnType($key);\n\t\t\t\tif ($type == 'd' || $type == 't') {\n\t\t\t\t\t$d = $this->$key;\n\t\t\t\t\tif (!$d) {\n\t\t\t\t\t\t$value = NULL;\n\t\t\t\t\t}\n\t\t\t\t\telseif (isset($params['dateFormat'])) {\n\t\t\t\t\t\t$value = $d->format($params['dateFormat']);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t$value = (string)$d;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$value = $this->$key;\n\t\t\t\t}\n\n\t\t\t\t$data[$key] = $value;\n\t\t\t}\n\t\t}\n\t\treturn $data;\n\t}",
"public function toArray()\n {\n $a = parent::toArray();\n\n if ($this->shouldReturnIdAsToken()) {\n $unique_column = $this->getUniqueTokenColumn();\n\n unset($a[$unique_column]);\n $a['id'] = $this->getAttribute($unique_column);\n }\n\n return $a;\n }",
"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 // TODO: Implement toArray() method.\n return $this->claims->toPlainArray();\n }",
"public function toArray()\n {\n $array = [];\n if (! empty($this->data)) {\n $array['data'] = $this->data->toIdentifier();\n }\n if (! empty($this->meta)) {\n $array['meta'] = $this->meta;\n }\n if (! empty($this->links)) {\n $array['links'] = $this->links;\n }\n\n return $array;\n }",
"public function toArray()\n {\n $a = parent::toArray();\n if ($this->originalLabel) {\n $a[\"originalLabel\"] = $this->originalLabel;\n }\n if ($this->description) {\n $ab = array();\n foreach ($this->description as $i => $x) {\n $ab[$i] = $x->toArray();\n }\n $a['description'] = $ab;\n }\n if ($this->values) {\n $ab = array();\n foreach ($this->values as $i => $x) {\n $ab[$i] = $x->toArray();\n }\n $a['values'] = $ab;\n }\n\n return $a;\n }",
"public function toArray(): array\n {\n return array_map(function (PropertyExtract $propertyExtract) {\n return $propertyExtract->getValue();\n }, $this->propertyExtracts);\n }",
"public function mapToRow()\n {\n $rowData = [];\n\n $refPropertyList = static::_getReflectionPropertyList();\n $reader = static::_getAnnotationReader();\n foreach ($refPropertyList as $property) {\n /* @var $annotation \\Pley\\DataMap\\Annotations\\Meta\\Property */\n $annotation = $reader->getPropertyAnnotation($property, \\Pley\\DataMap\\Annotations\\Meta\\Property::class);\n if ($annotation && $annotation->getColumnName()) {\n $rowData[$annotation->getColumnName()] = $this->{$property->getName()};\n }\n }\n\n return $rowData;\n }",
"public function toArray($request)\n { \n return $this->collection->map(function($media) { \n return [\n 'id' => $media->id,\n 'name' => $media->name,\n 'label' => $media->label,\n 'group' => $media->group, \n 'gallery' => $media->getMedia('gallery')->map(function($image) use ($media) {\n return $media->getConversions($image, ['main', 'cover', 'thumbnail']);\n }),\n ];\n })->toArray();\n }",
"public function to_array()\r\n {\r\n $d = array();\r\n if (!empty($this->valid_since))\r\n {\r\n $d['@valid_since'] = PiplApi_Utils::piplapi_datetime_to_str($this->valid_since);\r\n }\r\n if (!empty($this->last_seen))\r\n {\r\n $d['@last_seen'] = PiplApi_Utils::piplapi_datetime_to_str($this->last_seen);\r\n }\r\n $newattr = array_map(array($this, \"internal_mapcb_attrsarr\"), $this->attributes);\r\n $newchild = array_map(array($this, \"internal_mapcb_childrenarr\"), $this->children);\r\n\r\n // $newattr and $newchild are multidimensionals- this is used to iterate over them\r\n // we first merge the two arrays and then create an iterator that flattens them\r\n $it = new RecursiveIteratorIterator(new RecursiveArrayIterator(array_merge($newattr, $newchild)));\r\n\r\n foreach ($it as $key => $prefix)\r\n {\r\n if (array_key_exists($key, $this->internal_params))\r\n {\r\n $value = $this->internal_params[$key];\r\n\r\n if (isset($value) && is_object($value) && method_exists($value, 'to_array'))\r\n {\r\n $value = $value->to_array();\r\n }\r\n\r\n if (isset($value))\r\n {\r\n $d[$prefix . $key] = $value;\r\n }\r\n }\r\n }\r\n\r\n return $d;\r\n }",
"public function toArray(): array {\n\n $data = array();\n $mappings = array_merge($this->mappings, self::$defaultMappings);\n\n foreach ($mappings as $dbColumn => $propertyName) {\n $method = $propertyName;\n $data[$dbColumn] = $this->$method() ?? null;\n }\n return $data;\n }",
"private function createArray()\n {\n $this->makeGroupBy()->makeSearch()->normalize();\n }",
"public function toArray() {\n\t\treturn array(\n\t\t\tself::FIELD_CODI_ESPECTACLE=>$this->getCodiEspectacle(),\n\t\t\tself::FIELD_DATA=>$this->getData(),\n\t\t\tself::FIELD_HORA=>$this->getHora());\n\t}",
"abstract protected function toArray();",
"public function getToArrayData()\n {\n $out = [];\n\n // Case #0 filter aggregation.\n $aggregation = new FilterAggregation('test_agg');\n\n $filter = $this->getMockBuilder('ONGR\\ElasticsearchBundle\\DSL\\BuilderInterface')\n ->setMethods(['toArray', 'getType'])\n ->getMockForAbstractClass();\n $filter->expects($this->any())\n ->method('getType')\n ->willReturn('test_filter');\n $filter->expects($this->any())\n ->method('toArray')\n ->willReturn(['test_field' => ['test_value' => 'test']]);\n\n $aggregation->setFilter($filter);\n\n $result = [\n 'agg_test_agg' => [\n 'filter' => [\n 'test_filter' => [\n 'test_field' => ['test_value' => 'test'],\n ],\n ],\n ],\n ];\n\n $out[] = [\n $aggregation,\n $result,\n ];\n\n // Case #1 nested filter aggregation.\n $aggregation = new FilterAggregation('test_agg');\n $aggregation->setFilter($filter);\n\n $aggregation2 = $this->getMockBuilder('ONGR\\ElasticsearchBundle\\DSL\\Aggregation\\AbstractAggregation')\n ->disableOriginalConstructor()\n ->setMethods(['toArray', 'getName'])\n ->getMockForAbstractClass();\n $aggregation2->expects($this->any())\n ->method('toArray')\n ->willReturn(['agg_test_agg2' => ['avg' => []]]);\n $aggregation2->expects($this->any())\n ->method('getName')\n ->willReturn('agg_test_agg2');\n\n $aggregation->addAggregation($aggregation2);\n\n $result = [\n 'agg_test_agg' => [\n 'filter' => [\n 'test_filter' => [\n 'test_field' => ['test_value' => 'test'],\n ],\n ],\n 'aggregations' => [\n 'agg_test_agg2' => [\n 'avg' => [],\n ],\n ],\n ],\n ];\n\n $out[] = [\n $aggregation,\n $result,\n ];\n\n return $out;\n }",
"public function toArray()\n {\n $result = array();\n\n if (!empty($this->getLogging())) {\n $result[Resources::XTAG_LOGGING] =\n $this->getLogging()->toArray();\n }\n\n if (!empty($this->getHourMetrics())) {\n $result[Resources::XTAG_HOUR_METRICS] =\n $this->getHourMetrics()->toArray();\n }\n\n if (!empty($this->getMinuteMetrics())) {\n $result[Resources::XTAG_MINUTE_METRICS] =\n $this->getMinuteMetrics()->toArray();\n }\n\n $corsesArray = $this->getCorsesArray();\n if (!empty($corsesArray)) {\n $result[Resources::XTAG_CORS] =$corsesArray;\n }\n\n if ($this->defaultServiceVersion != null) {\n $result[Resources::XTAG_DEFAULT_SERVICE_VERSION] = $this->defaultServiceVersion;\n }\n\n return $result;\n }",
"public function toArray()\n {\n return $this->transform();\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 testToArray($aggregation, $expectedResult)\n {\n $this->assertEquals($expectedResult, $aggregation->toArray());\n }",
"public function toArray() {\n $data = [];\n foreach ($this->config as $field => $c) {\n $data[$field] = $this->get($field);\n }\n return $data;\n }",
"public function toArray()\n {\n $return = array();\n foreach ( $this as $property => $value ) {\n if ( '__' == substr( $property, 0, 2 ) || '' === $value || is_null( $value ) || ( is_array( $value ) && empty( $value ) ) ) {\n continue;\n }\n $return[ $property ] = $value;\n }\n\n return $return;\n }",
"function getAdditionalValuesAsArray() {\n\t\t$values = parent::getAdditionalValuesAsArray ();\n\t\t$tables = array_keys ($this->owner);\n\t\t$values ['owner'] = Array ();\n\t\tforeach ($tables as $table) {\n\t\t\tforeach ($this->owner [$table] as $id) {\n\t\t\t\t$values ['owner'] [$table] [$id] = $id;\n\t\t\t}\n\t\t}\n\t\t$values ['headerstyle'] = $this->row ['headerstyle'];\n\t\t$values ['bodystyle'] = $this->row ['bodystyle'];\n\t\treturn $values;\n\t}",
"public function convertItemArray() {}",
"public function to_array()\r\n {\r\n $d = array();\r\n\r\n if (!empty($this->http_status_code)) {\r\n $d['@http_status_code'] = $this->http_status_code;\r\n }\r\n if (!empty($this->visible_sources)) {\r\n $d['@visible_sources'] = $this->visible_sources;\r\n }\r\n if (!empty($this->available_sources)) {\r\n $d['@available_sources'] = $this->available_sources;\r\n }\r\n if (!empty($this->search_id)) {\r\n $d['@search_id'] = $this->search_id;\r\n }\r\n if (!empty($this->persons_count)) {\r\n $d['@persons_count'] = $this->persons_count;\r\n }\r\n\r\n if (!empty($this->warnings)) {\r\n $d['warnings'] = $this->warnings;\r\n }\r\n if (!empty($this->query)) {\r\n $d['query'] = $this->query->to_array();\r\n }\r\n if (!empty($this->person)) {\r\n $d['person'] = $this->person->to_array();\r\n }\r\n if (!empty($this->possible_persons)) {\r\n $d['possible_persons'] = array();\r\n foreach ($this->possible_persons as $possible_person) {\r\n $d['possible_persons'][] = $possible_person->to_array();\r\n }\r\n }\r\n if (!empty($this->sources)) {\r\n $d['sources'] = array();\r\n foreach ($this->sources as $source) {\r\n $d['sources'][] = $source->to_array();\r\n }\r\n }\r\n\r\n if (!empty($this->available_data)) {\r\n $d['available_data'] = $this->available_data->to_array();\r\n }\r\n\r\n if (!empty($this->match_requirements)) {\r\n $d['match_requirements'] = $this->match_requirements;\r\n }\r\n\r\n return $d;\r\n }",
"public function toArray()\n {\n $array = parent::toArray();\n\n foreach ($array as $k => &$v) {\n $v['_count'] = $k;\n }\n\n return $array;\n }",
"abstract public function data2Array($data);",
"public function toArray(): array\n {\n /**\n * this needs to stay in close sync with PropertyGroupLeaseRollup\n */\n $TenantDetailObjArr = collect_waypoint(\n $this->suiteDetails\n ->map(\n function (SuiteDetail $SuiteDetailObj)\n {\n return $SuiteDetailObj->tenantDetails;\n }\n )->flatten()\n );\n\n $ActiveLeaseDetailObjArr = $this->getActiveLeaseDetailObjArr();\n $ActiveUniqueLeaseDetailObjArr = $this->getActiveUniqueLeaseDetailObjArr();\n\n $weighted_average_lease_expiration = $this->calculate_weighted_average_lease_expiration($ActiveUniqueLeaseDetailObjArr);\n\n $tenant_details_arr = $TenantDetailObjArr->toArray();\n\n return [\n \"id\" => $this->id,\n \"property_name\" => $this->name,\n \"square_footage\" => $this->square_footage,\n \"suite_id_arr\" => $this->suiteDetails->sortBy('id')->pluck('id')->toArray(),\n\n /** activeLease */\n \"activeLeaseDetails\" => $ActiveLeaseDetailObjArr->toArray(),\n \"active_num_leases\" => $ActiveLeaseDetailObjArr->count(),\n \"active_square_footage\" => $ActiveLeaseDetailObjArr->sum('square_footage'),\n \"active_monthly_rent_per_square_foot\" => $this->square_footage ? $ActiveLeaseDetailObjArr->sum('monthly_rent') / $this->square_footage : null,\n \"active_annual_rent_per_square_foot\" => $this->square_footage ? $ActiveLeaseDetailObjArr->sum('monthly_rent') * 12 / $this->square_footage : null,\n \"active_annual_rent\" => $ActiveLeaseDetailObjArr->sum('monthly_rent') * 12,\n \"active_monthly_rent\" => $ActiveLeaseDetailObjArr->sum('monthly_rent'),\n \"active_occupancy_rate\" => $this->square_footage ? ($ActiveLeaseDetailObjArr\n ->sum('square_footage') * 100 / $this->square_footage) : null,\n\n /** activeUniqueLease */\n \"activeUniqueLeaseDetails\" => $ActiveUniqueLeaseDetailObjArr->toArray(),\n \"active_unique_num_leases\" => $ActiveUniqueLeaseDetailObjArr->count(),\n \"active_unique_square_footage\" => $ActiveUniqueLeaseDetailObjArr->sum('square_footage'),\n \"active_unique_monthly_rent_per_square_foot\" => $this->square_footage ? $ActiveUniqueLeaseDetailObjArr->sum('monthly_rent') / $this->square_footage : null,\n \"active_unique_annual_rent_per_square_foot\" => $this->square_footage ? $ActiveUniqueLeaseDetailObjArr\n ->sum('monthly_rent') * 12 / $this->square_footage : null,\n \"active_unique_annual_rent\" => $ActiveUniqueLeaseDetailObjArr->sum('monthly_rent') * 12,\n \"active_unique_monthly_rent\" => $ActiveUniqueLeaseDetailObjArr->sum('monthly_rent'),\n \"active_unique_occupancy_rate\" => $this->square_footage ? ($ActiveUniqueLeaseDetailObjArr\n ->sum('square_footage') * 100 / $this->square_footage) : null,\n 'tenantIndustriesDetails' =>\n $TenantDetailObjArr\n ->map(\n function (TenantDetail $TenantDetailObj)\n {\n return $TenantDetailObj->tenantIndustryDetail;\n }\n )\n ->unique('id')\n ->toArray(),\n\n 'tenantDetails' => $tenant_details_arr,\n\n 'weighted_average_lease_expiration' => $weighted_average_lease_expiration,\n\n \"created_at\" => $this->perhaps_format_date($this->created_at),\n \"updated_at\" => $this->perhaps_format_date($this->updated_at),\n\n 'model_name' => self::class,\n ];\n }",
"public function toArray()\n {\n return array_merge([\n 'driver' => $this->driver,\n 'content' => $this->content,\n 'from' => $this->from,\n 'to' => $this->to,\n 'type' => $this->type,\n 'client_reference' => $this->clientReference,\n ], $this->extra);\n }",
"function domains_to_array($collection)\n {\n $result = $collection->map(function($item) {\n return $item->toArray();\n });\n\n return $result;\n }",
"public function toArray($renameColumns=null){ }",
"public function _getData(): array\n {\n $result = [\n ];\n\n return parent::normalizeData($result);\n }",
"public function toArray(): array\n {\n return [\n 'type' => 'arithmetic',\n 'name' => $this->outputName,\n 'fn' => $this->function,\n 'fields' => $this->fields->toArray(),\n 'ordering' => $this->floatingPointOrdering ? null : 'numericFirst',\n ];\n }",
"public function toArray(): array\n {\n $data = [];\n foreach ($this->limits as $testId => $limits) {\n $data[$testId] = $limits->toArray();\n }\n return $data;\n }",
"public function toArray(): array\n {\n $values = array();\n foreach ($this->getAllFieldsAliases() as $name) {\n $field = $this->{'field' . \\ucfirst($name)};\n $values[$name] = $field['value'];\n }\n\n return $values;\n }",
"public function to_array() {\n\n $output = [];\n\n foreach ($this::CONSTRAINTS as $key => $constraint) {\n\n $value = $this->$key;\n\n if (\n is_object($value) &&\n (\n $value instanceof TypedProperty ||\n $value instanceof TypedArray\n )\n ) {\n $output[$key] = $value->to_array();\n } else {\n if (is_array($value)) {\n foreach ($value as $k => $v) {\n if (\n is_object($v) &&\n (\n $v instanceof TypedProperty ||\n $v instanceof TypedArray\n )\n ) {\n $value[$k] = $v->to_array();\n }\n }\n }\n $output[$key] = $value;\n }\n }\n\n return $output;\n }",
"public function getCustomArrayFormatterCollection(): ArrayFormatterCollection;",
"public function & toArrayNative()\n\t{\n\t\t$x = new ArrayObject($this->data);\n\t\treturn $x->toArrayNative();\n\t}",
"public function toArray()\n {\n if (count($this->sorts) === 1) {\n $order = reset($this->sorts);\n $field = key($this->sorts);\n\n return [$this->prefix . '-' . SCT::toHyphen($field) => $order];\n }\n\n $sorts = [];\n $i = 1;\n\n foreach (array_slice($this->sorts, 0, 2) as $field => $order) {\n $sorts[$this->prefix . $i . '-' . SCT::toHyphen($field)] = $order;\n ++$i;\n }\n return $sorts;\n }",
"function &toArray($dateFormat = null) {\n if (empty($dateFormat)) {\n $dateFormat = Config::$dateFormat;\n }\n $a = array();\n foreach ($this->_data as $k => $v) {\n if ($v->dataType == DATATYPE_DATETIME || $v->dataType == DATATYPE_DATE) {\n if ($v->value == null || $v->value == '') {\n $a[$k] = null;\n } else {\n $a[$k] = date($dateFormat, $v->value);\n }\n } else if ($v->dataType == DATATYPE_BOOL) {\n $a[$k] = (bool)$v->value;\n } else if ($v->dataType <= DATATYPE_INT) {\n $a[$k] = (int)$v->value;\n } else if ($v->dataType <= DATATYPE_DOUBLE) {\n $a[$k] = (double)$v->value;\n } else {\n $a[$k] = $v->value;\n }\n }\n\n foreach ($this->_extra as $k => $v) {\n if (is_object($v) && is_subclass_of($v, 'DataObject')) {\n $a[$k] = $v->toArray($dateFormat);\n } else if (is_array($v)) {\n $a[$k] = self::objectListToArrayList($v, $dateFormat);\n } else {\n $a[$k] = $v;\n }\n }\n return $a;\n }",
"private function specImgParseArray($sSpecImg)\n {\n $aSpecImg = explode(';',$sSpecImg);\n $aData = array();\n foreach ( $aSpecImg as $v ) {\n $aSpecImgArr = explode(':',$v);\n $aData[$aSpecImgArr[0]] = $aSpecImgArr[1];\n }\n return $aData;\n }",
"public function toArray()\n {\n return [\n 'PDF_10x15_300dpi' => '10x15 300dpi',\n 'PDF_A4_300dpi' => 'A4 300dpi',\n ];\n }",
"function toArray()\n {\n $ary = array('name' => $this->_name, 'identifier' => $this->_identifier);\n if (count($this->indexes) > 0) {\n $ary['indexes'] = $this->indexes;\n }\n return $ary;\n }",
"public function toArray()\n {\n $a = parent::toArray();\n if ($this->accounts) {\n $ab = array();\n foreach ($this->accounts as $i => $x) {\n $ab[$i] = $x->toArray();\n }\n $a['accounts'] = $ab;\n }\n if ($this->addresses) {\n $ab = array();\n foreach ($this->addresses as $i => $x) {\n $ab[$i] = $x->toArray();\n }\n $a['addresses'] = $ab;\n }\n if ($this->emails) {\n $ab = array();\n foreach ($this->emails as $i => $x) {\n $ab[$i] = $x->toArray();\n }\n $a['emails'] = $ab;\n }\n if ($this->homepage) {\n $a[\"homepage\"] = $this->homepage->toArray();\n }\n if ($this->identifiers) {\n $ab = array();\n foreach ($this->identifiers as $i => $x) {\n $ab[$i] = array();\n foreach ($x as $j => $y) {\n $ab[$i][$j] = $y->getValue();\n }\n }\n $a['identifiers'] = $ab;\n }\n if ($this->names) {\n $ab = array();\n foreach ($this->names as $i => $x) {\n $ab[$i] = $x->toArray();\n }\n $a['names'] = $ab;\n }\n if ($this->openid) {\n $a[\"openid\"] = $this->openid->toArray();\n }\n if ($this->phones) {\n $ab = array();\n foreach ($this->phones as $i => $x) {\n $ab[$i] = $x->toArray();\n }\n $a['phones'] = $ab;\n }\n return $a;\n }",
"public function getAsArray(): array {\n\t\t$result = [];\n\t\tforeach ( self::FIELD_MAPPING as $field => $_ ) {\n\t\t\t$result[$field] = $this->$field;\n\t\t}\n\t\treturn $result;\n\t}",
"private function build_lines_aggregate_array(){\n\n\t\t$this->lines_aggregate_array = array();\n\t\tforeach($this->per_team_lines[0] as $key => $value){\n\t\t\t$line_play_type = null;\n\t\t\tif($key === 'women_doubles'){\n\t\t\t\t$line_play_type = 'wd';\n\t\t\t}\n\t\t\telse if($key === 'men_doubles'){\n\t\t\t\t$line_play_type = 'md';\n\t\t\t}\n\t\t\telse if($key === 'women_singles'){\n\t\t\t\t$line_play_type = 'ws';\n\t\t\t}\n\t\t\telse if($key === 'men_singles'){\n\t\t\t\t$line_play_type = 'ms';\n\t\t\t}\n\t\t\telse if($key === 'mixed_doubles'){\n\t\t\t\t$line_play_type = 'xd';\n\t\t\t}\n\t\t\telse if($key === 'mixed_singles'){\n\t\t\t\t$line_play_type = 'xs';\n\t\t\t}\n\t\t\tif($line_play_type !== null){\n\t\t\t\tarray_push($this->lines_aggregate_array, array(\n\t\t\t\t\t'line_play_type' => $line_play_type,\n\t\t\t\t\t'count' => $value\n\t\t\t\t));\n\t\t\t}\n\t\t}\n\n\t}",
"public function toArray($decodePrivileges = false) {\n foreach ($this->_rows as $i => $row) {\n $this->_data[$i] = $row->toArray($decodePrivileges);\n }\n return $this->_data;\n }",
"protected function adodb_recordset_to_array($rs) {\n /// this can not be removed even if we chane db defaults :-(\n if ($result = parent::adodb_recordset_to_array($rs)) {\n foreach ($result as $key=>$row) {\n $row = (array)$row;\n array_walk($row, 'onespace2empty');\n $result[$key] = (object)$row;\n }\n }\n\n return $result;\n }",
"public function toArray()\n {\n $result = [];\n foreach (array_keys($this->_properties) as $property) {\n $value = $this->get($property);\n if (is_array($value)) {\n $result[$property] = [];\n foreach ($value as $k => $entity) {\n $result[$property][$k] = $entity;\n }\n } else {\n $result[$property] = $value;\n }\n }\n\n return $result;\n }",
"public function toArray(): array\n {\n return array_merge(\n parent::toArray(),\n ['ranges' => $this->rangesToArray()]\n );\n }",
"public function toArray(): array\n {\n return array_merge(\n parent::toArray(),\n ['ranges' => $this->rangesToArray()]\n );\n }",
"public function toArray()\n {\n $result = $this->convertItemsToArray();\n $this->removeItemWithDefaultValue($result, self::DISABLE_META_PROPERTIES);\n $this->removeItemWithDefaultValue($result, self::DISABLE_INCLUSION);\n $this->removeItemWithDefaultValue($result, self::DISABLE_FIELDSET);\n $this->removeItemWithDefaultValue($result, self::DISABLE_SORTING);\n\n $fields = ConfigUtil::convertObjectsToArray($this->fields, true);\n if (!empty($fields)) {\n $result[self::FIELDS] = $fields;\n }\n\n return $result;\n }",
"public function toArray()\n {\n return array(\n 'article_number' => $this->_articleNumber,\n 'article_name' => $this->_articleName,\n 'quantity' => $this->_quantity,\n 'unit_price' => $this->_unitPrice,\n 'total_price' => $this->_totalPrice,\n 'tax' => $this->_tax\n );\n }",
"public function toArray($request): array\n {\n return $this->collection->map(function (BaseApiResource $resource) use ($request) {\n return $resource->columns($this->columns)->toArray($request);\n })->all();\n\n //return parent::toArray($request);\n }",
"public function toArray(): array\n\t{\n\t\t$array = [];\n\n\t\tforeach ($this->propertyData as $key => $value) {\n\t\t\t$value = $this->$key;\n\n\t\t\tif (is_object($value) === true) {\n\t\t\t\t$value = $value->toArray();\n\t\t\t}\n\n\t\t\t$array[$key] = $value;\n\t\t}\n\n\t\treturn $array;\n\t}",
"public function toArray() {\n\t\t\t$result = array();\n\t\t\tforeach (array_keys(static::$_fields) as $key) {\n\t\t\t\t$result[$key] = $this->getData($key);\n\t\t\t}\n\t\t\treturn $result;\n\t\t}",
"public function toArray() {\n\t\ttry {\n\t\t\t// Setup\n\t\t\t$result = array();\n\t\t\t\n\t\t\tforeach($this->_columns as $column) {\n\t\t\t\t$result[$column->name] = $this->_data[$column->name];\n\t\t\t}\n\t\t\treturn $result;\n\t\t}\n\t\tcatch(\\Exception $ex) {\n\t\t\t\\Bedrock\\Common\\Logger::exception($ex);\n\t\t\tthrow new \\Bedrock\\Model\\Record\\Exception('There was a problem converting the Record to an array.');\n\t\t}\n\t}",
"public function toArray($request)\n {\n return array_merge(\n parent::toArray($request),\n [\n 'maconomy_ids' => $this->maconomy,\n 'maconomy_ids_small' => $this->getMaconomyIdsFlat(),\n ]\n );\n }",
"public function asArray();",
"public function asArray();",
"public function asArray();",
"public function asArray();",
"public function asArray();",
"public function asArray();",
"public function toData() {\n\t\treturn array($this->_alias => $this->toArray());\n\t}",
"public function toArray($deep = true, $prefixKey = false)\n {\n $fields = $this->pubFields();\n\n $a = parent::toArray($deep, $prefixKey);\n $a = array_intersect_key($a, $fields);\n\n return $a;\n }"
] | [
"0.57619125",
"0.5387322",
"0.52578187",
"0.52412575",
"0.52331215",
"0.522505",
"0.5111105",
"0.5110191",
"0.51079065",
"0.50746644",
"0.50337565",
"0.49966332",
"0.49876633",
"0.4982592",
"0.49466473",
"0.49128163",
"0.49025548",
"0.48987418",
"0.48888054",
"0.48871",
"0.48776263",
"0.48767",
"0.48694634",
"0.48694634",
"0.48693597",
"0.48693597",
"0.48693597",
"0.48693597",
"0.48687795",
"0.48687795",
"0.48687795",
"0.48687795",
"0.48687795",
"0.48687795",
"0.48687795",
"0.48687795",
"0.48687795",
"0.48687795",
"0.48474064",
"0.48440203",
"0.48438928",
"0.48209584",
"0.4820449",
"0.48154634",
"0.481528",
"0.4812638",
"0.4797681",
"0.47966623",
"0.47894236",
"0.4780823",
"0.4776004",
"0.47673953",
"0.47618085",
"0.47608122",
"0.4746768",
"0.4741739",
"0.4739808",
"0.47346035",
"0.47294894",
"0.4726875",
"0.4725388",
"0.47092623",
"0.47030455",
"0.47006163",
"0.46967304",
"0.46937782",
"0.46930242",
"0.4692518",
"0.46892324",
"0.4687399",
"0.46779564",
"0.4676175",
"0.4676031",
"0.46731472",
"0.4658415",
"0.46553722",
"0.4653209",
"0.46516347",
"0.46514532",
"0.46512306",
"0.46468043",
"0.46463525",
"0.4645483",
"0.46449172",
"0.46449172",
"0.4640026",
"0.46392217",
"0.4637813",
"0.46358833",
"0.46334925",
"0.46333417",
"0.46326086",
"0.46319488",
"0.46319488",
"0.46319488",
"0.46319488",
"0.46319488",
"0.46319488",
"0.4630147",
"0.46205828"
] | 0.72863734 | 0 |
the number of records available for navigation depends on the user level. The employee himself can only see one record (his own). | private function getSQLCondition() {
// the manager can see everyone in the department
// the admin and everybody else can see everyone in the company.
switch ($this->page->config['user_level']) {
case lu_manager:
case lu_employee:
case lu_admin:
$sql = 'WHERE 1 = 2';
break; //nobody below GM can access this subject
case lu_gm:
case lu_owner:
$sql = ' WHERE c.company_id = '.$this->page->company['company_id'];
}
return $sql;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function countEmployee(){\n\t\t\t\t\t return count($this->listeEmployee());\n\t\t\t\t\t }",
"public function getNumberOfRecords() {}",
"public function count(){\n\t\t$this->initRecordSet();\n\t\treturn $this->recordSetSize;\n\t}",
"public function record_count() {\r\n return $this->db->count_all(\"administradores\");\r\n }",
"function ListRecordCount() {\n\t\t$filter = $this->getSessionWhere();\n\t\tew_AddFilter($filter, $this->CurrentFilter);\n\t\t$filter = $this->ApplyUserIDFilters($filter);\n\t\t$this->Recordset_Selecting($filter);\n\t\t$sql = ew_BuildSelectSql(\"SELECT * FROM \" . $this->getSqlFrom(), $this->getSqlWhere(), \"\", \"\", \"\", $filter, \"\");\n\t\t$cnt = $this->TryGetRecordCount($sql);\n\t\tif ($cnt == -1) {\n\t\t\t$conn = &$this->Connection();\n\t\t\tif ($rs = $conn->Execute($sql)) {\n\t\t\t\t$cnt = $rs->RecordCount();\n\t\t\t\t$rs->Close();\n\t\t\t}\n\t\t}\n\t\treturn intval($cnt);\n\t}",
"public function fetchNrRecordsToGet();",
"public function numberOfRecords(): int\n {\n return $this->number_of_records;\n }",
"public function getNbrecord(): int\n {\n return 5;\n }",
"public function listRecordCount()\n\t{\n\t\t$filter = $this->getSessionWhere();\n\t\tAddFilter($filter, $this->CurrentFilter);\n\t\t$filter = $this->applyUserIDFilters($filter);\n\t\t$this->Recordset_Selecting($filter);\n\t\t$select = $this->TableType == 'CUSTOMVIEW' ? $this->getSqlSelect() : \"SELECT * FROM \" . $this->getSqlFrom();\n\t\t$groupBy = $this->TableType == 'CUSTOMVIEW' ? $this->getSqlGroupBy() : \"\";\n\t\t$having = $this->TableType == 'CUSTOMVIEW' ? $this->getSqlHaving() : \"\";\n\t\t$sql = BuildSelectSql($select, $this->getSqlWhere(), $groupBy, $having, \"\", $filter, \"\");\n\t\t$cnt = $this->getRecordCount($sql);\n\t\treturn $cnt;\n\t}",
"public function listRecordCount()\n\t{\n\t\t$filter = $this->getSessionWhere();\n\t\tAddFilter($filter, $this->CurrentFilter);\n\t\t$filter = $this->applyUserIDFilters($filter);\n\t\t$this->Recordset_Selecting($filter);\n\t\t$select = $this->TableType == 'CUSTOMVIEW' ? $this->getSqlSelect() : \"SELECT * FROM \" . $this->getSqlFrom();\n\t\t$groupBy = $this->TableType == 'CUSTOMVIEW' ? $this->getSqlGroupBy() : \"\";\n\t\t$having = $this->TableType == 'CUSTOMVIEW' ? $this->getSqlHaving() : \"\";\n\t\t$sql = BuildSelectSql($select, $this->getSqlWhere(), $groupBy, $having, \"\", $filter, \"\");\n\t\t$cnt = $this->getRecordCount($sql);\n\t\treturn $cnt;\n\t}",
"public function size(){\n\t\treturn $this->recordSetSize;\n\t}",
"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 }",
"function record_count() {\n return $this->db->count_all($this->_student);\n }",
"function RecordCount()\n\t{\n\t\treturn $this->_numOfRows;\n\t}",
"public function filteredDataEmployees(){\n\t\t\t$this->ajaxEmployeeList();\n\t\t\t$query = $this->db->get();\n\t\t\treturn $query->num_rows();\n\t\t}",
"function countNavigation(){\n return $this->db->count_all('navigation');\n }",
"abstract public function recordCount(): int;",
"function pagination()\n {\n $qgroups = $this->db->query(\"SELECT COUNT(id) AS total FROM groups WHERE id_user='\".$this->general->id_user().\"'\");\n return $qgroups->row()->total;\n }",
"public function getRecordsCount()\n {\n return $this->count(self::_RECORDS);\n }",
"public function getCurrentNumberOfRecords()\n {\n return $this->pageMetaData['current_number_of_records'];\n }",
"public function size()\n\t{\n\t\treturn ceil($this->total_record_count / $this->page_size);\n\t}",
"public function partner_record_count() \n\t{\n\t $query = $this->db->query(\"SELECT * FROM award_tbl WHERE is_deleted=0\");\n return $query->num_rows();\n }",
"function number_of_elements() {\n return count($this->page_object);\n }",
"public function count()\n {\n return $this->pager->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}",
"function count_all(){\n\t $this->db->count_all($this->tbl_Employeeinfo);\n\t \n return $this->db->count_all($this->tbl_Employeeinfo);\n }",
"function RecordCount() {}",
"public function recordCount()\n {\n return sizeof($this->getRecords());\n }",
"public function getPageCount() \r\n { \r\n }",
"private function _count_page()\n {\n $count_career = $this->core_model->count('career');\n return ceil($count_career / 4);\n }",
"public function count()\n {\n return $this->model->paginate(1, $this->select)->total();\n }",
"public function record_count() {\r\n return $this->db->count_all(\"pessoafisica\");\r\n }",
"public function getRecordCount()\n {\n return $this->count(self::_RECORD);\n }",
"public function getNumberOfRecords ()\n {\n // hydrate\n if ( is_null ( $this->studentsCount ) )\n {\n $this->studentsCount = count ( $this->getStudents () );\n }\n \n return $this->studentsCount;\n }",
"public function getCount() {\n \treturn $this->count();\n }",
"public function getPageSize();",
"public function primaries()\n {\n return Menu::doesntHave('parent')->paginate(request('perpage') ?? 10);\n }",
"public function testCountRecords()\n {\n\n $exhibit = $this->_exhibit();\n $record1 = $this->_record($exhibit);\n $record2 = $this->_record($exhibit);\n $record3 = $this->_record($exhibit);\n\n // Limit to 2 records.\n $result = $this->_records->queryRecords(array(\n 'exhibit_id' => $exhibit->id, 'limit' => 2, 'offset' => 0\n ));\n\n $this->assertEquals(3, $result['numFound']);\n\n }",
"public function getLimit()\n {\n return Mage::getStoreConfig(Mage_Reports_Block_Product_Viewed::XML_PATH_RECENTLY_VIEWED_COUNT);\n }",
"function recordCount($table)\n {\n if(is_admin()):\n $queryResult = query(\"select * from \". $table);\n else:\n $queryResult = query(\"select * from \". $table .\" where user_id={$_SESSION['user_id']}\");\n endif; \n $result = mysqli_num_rows($queryResult);\n if(isset($result))\n {\n return $result;\n }\n else\n {\n return 0;\n }\n }",
"public function count(){\n return count($this->accounts);\n }",
"public function getCount()\n {\n if ($this->isValid()) {\n return isset($this['request']['records']) ? $this['request']['records'] : null;\n }\n }",
"function record_count() {\n\t\tif ($this->QueryID) {\n\t\t\treturn mysqli_num_rows($this->QueryID);\n\t\t}\n\t}",
"public function numberOfRecords(): int\n {\n return $this->lastResponse->numberOfRecords;\n }",
"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}",
"function gettotalpageno(){\n\t $qry = \"SELECT * FROM countries\";\n\t return $result = $this->modelObj->numRows($qry);\n\t}",
"public static function count()\n\t{\n\t\treturn self::new_instance_records()->count();\n\t}",
"function RecordCount() {\r\n return $this->result->numRows();\r\n }",
"function total_records($recordType)\n{\n return get_db()->getTable($recordType)->count();\n}",
"public function get_limit() {\n\t\t// This matches the maximum number of indexables created by this action.\n\t\treturn 4;\n\t}",
"public function record_count_activities() {\n return $this->db->count_all(\"page\");\n }",
"public function numOfPages(): int;",
"public function count(): int\n\t{\n\t\treturn $this->paginator->count();\n\t}",
"public function get_record_size() {\n return 0;\n }",
"public function getCount()\n {\n return $this->appUser->count();\n }",
"function countPages(){\n return $this->db->count_all('page_attributes');\n }",
"function TotalEmployee() {\n global $mysqli, $db_table_prefix;\n $stmt = $mysqli->prepare(\"SELECT \n\t\t\" . $db_table_prefix . \"users.id, \" . $db_table_prefix . \"user_permission_matches.permission_id\n\t\tFROM \" . $db_table_prefix . \"users LEFT JOIN \" . $db_table_prefix . \"user_permission_matches ON \n\t\t\" . $db_table_prefix . \"users.id = \" . $db_table_prefix . \"user_permission_matches.user_id where \" . $db_table_prefix . \"user_permission_matches.permission_id = '1'\");\n $stmt->execute();\n $stmt->store_result();\n $num_returns = $stmt->num_rows;\n $stmt->close();\n\n return $num_returns;\n}",
"function GetNumRecords($restr = null)\n {\n $cacheid = $restr;\n if ( is_array($restr) )\n $cacheid = implode(\"|\",$restr);\n if ( $restr == null )\n $cacheid = \" \";\n $cacheid = md5($cacheid);\n if ( isset($this->numrecordscache[$cacheid]) )\n {\n return $this->numrecordscache[$cacheid];\n }\n $c = count($this->GetRecords($restr,false,false,false,false,$this->primarykey));\n $this->numrecordscache[$cacheid] = $c;\n //dprint_r($this->numrecordscache);\n if ( $restr == null )\n $this->numrecords = $c;\n return $c;\n }",
"public function CountRow()\n\t{\n\treturn HDB::hus()->Hcount(H_SYSTEM_ACCESS);\t\n\t}",
"public function pagesize() { return 15; }",
"public function count()\n\t{\n\t\treturn $this->getParentObject()->count();\n\t}",
"function calcNumActiveUsers(){\r\n\t /* Calculate number of USERS at site */\r\n\t $sql = $this->connection->query(\"SELECT * FROM \".TBL_ACTIVE_USERS);\r\n\t $this->num_active_users = $sql->rowCount();\r\n }",
"public function getRecordCountPerPage()\n {\n return $this->_recordCountPerPage;\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 static function getCount()\n\t{\n\t\treturn self::find()->count();\n\t}",
"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 paginationAll() {\n\n $query = \"select * from `rental` ORDER BY id DESC\";\n $res = mysql_query($query);\n $num = mysql_num_rows($res);\n return (int) $num;\n }",
"public function getEmployeesCount() {\n return $this->getTable()->getEmployeesCount();\n }",
"public function getNbUsers(){\r\n $nb = 0 ;\r\n $q = \"select count(*) as nb from UserTab \";\r\n $res = execute($q) ;\r\n $l = mysql_fetch_assoc($res);\r\n $nb = $l['nb'];\r\n \r\n return $nb ;\r\n\r\n }",
"public function numberOfItems();",
"function countMembers() {\n\t\t$result = $this->MySQL->query(\"SELECT * FROM \".$this->MySQL->get_tablePrefix().\"members WHERE \".$this->strTableKey.\" = '\".$this->intTableKeyValue.\"'\");\n\t\t$num_rows = $result->num_rows;\n\t\t\n\t\t\n\t\treturn $num_rows;\n\t}",
"function getPageCount() {\n return $this->helper->getPageCount();\n }",
"function getPageCount() {\n return $this->helper->getPageCount();\n }",
"function more_data(){\t \t \n\t\t$page = $this->input->post('page');\n\t\tif(empty($page)){ $page=0; }\n\t\t$offset = 10*$page;\n\t\t$limit = 10;\n\t\t$user__list = $this->InteractModal->all__active_users_limit('client',$limit, $offset);\n\t\t$count_record = $this->InteractModal->count_users('client');\n\t\t$page_data['user__list']= $user__list;\n\t\t$page_data['page']= $page;\n\t\t$this->load->view('common/client_load_more', $page_data);\t\n\t\t\t\t\n\t\t\t\n\t}",
"public function hasPageSize(){\n return $this->_has(3);\n }",
"public function numberOfQuoteLoveByUser($userId)\n { \n $query = $this->fetchProfileDetails($userId);\n $query = mysqli_num_rows($query);\n return $query;\n }",
"function getNumMembers(){\r\n if($this->num_members < 0){\r\n $q = \"SELECT * FROM \".TBL_USERS;\r\n $result = mysql_query($q, $this->connection);\r\n $this->num_members = mysql_numrows($result);\r\n }\r\n return $this->num_members;\r\n }",
"function getNumMembers(){\r\n if($this->num_members < 0){\r\n $q = \"SELECT * FROM \".TBL_USERS;\r\n $result = mysql_query($q, $this->connection);\r\n $this->num_members = mysql_numrows($result);\r\n }\r\n return $this->num_members;\r\n }",
"public function pageCount()\n {\n return ($this->dbConnection->query('SELECT * FROM todos')->rowCount()/$this->numRecords);\n\n }",
"public function countFrontend(){\n\t\t\t\t\t return count($this->listeFrontend());\n\t\t\t\t\t }",
"function RecordCount() {\n return @mysql_num_rows($this->resource);\n }",
"public function getRecordsTotal(): int;",
"public function getPaginationCount()\n {\n return ceil(DB::count($this->table) / $this->paginationLimit);\n }",
"public function getTotalRecords()\n {\n return $this->pageMetaData['total_records'];\n }",
"public function getTotalCount();",
"public function getTotalCount();",
"public function getTotalCount();",
"function getPageCount() { return $this->m_pageCount; }",
"public function numUsers(){\n $query = \"SELECT count(*) FROM final_usuario\";\n return $this->con->action($query);\n }",
"private function getNumPages() {\n\n return $this->rowCount / $this->limit;\n }",
"function getUsersCount() {\n $company_id = $this->getId(); \n \treturn Users::count(\"company_id LIKE $company_id\");\n }",
"public function count_items() {\n\t\treturn SalesHistoryDetailQuery::create()->filterByOrdernumber($this->oehhnbr)->count();\n\t}",
"public function hasPageSize(){\n return $this->_has(5);\n }",
"public function hasPageSize(){\n return $this->_has(5);\n }",
"public function hasPageSize(){\n return $this->_has(5);\n }",
"public function count() {\n return $this->model->all()->count();\n }",
"public function record_count(){\n return $this->db->count_all(\"configuration\");\n }",
"public function getAllJoinLvUserCount()\n {\n $sql = \"SELECT COUNT(1) FROM casino_user_point \";\n return $this->_rdb->fetchOne($sql);\n }",
"function getNumOwnerResidents() {\r\n\t\t\" add_state, add_zip, add_country, u_type, u_priv, phone FROM user ORDER BY name\";\r\n\t\t\r\n\t\t$query = \"SELECT rowID FROM user WHERE u_type=2 AND u_priv != 6\";\r\n\r\n\t\t$this->mysqldb->query($query);\r\n\r\n\t\treturn($this->mysqldb->numRows());\r\n\t}",
"public function no_of_rows_user_services_list()\n\t{\n\t\t\n\t\t$sql=\"select * from user_services\t order by user_services_id DESC\";\n\t\t$query=$this->db->query($sql);\n\t\treturn $query->num_rows;\n\t}",
"public function record_count() {\n return $this->db->count_all(\"promotores\");\n }"
] | [
"0.6681935",
"0.65824986",
"0.65086836",
"0.63401145",
"0.6324877",
"0.63080955",
"0.6287296",
"0.6237324",
"0.62048316",
"0.62048316",
"0.6162602",
"0.60606897",
"0.6054204",
"0.6041318",
"0.6014622",
"0.59894276",
"0.5944308",
"0.58977294",
"0.5892454",
"0.5887577",
"0.5875543",
"0.58424294",
"0.58402103",
"0.5836632",
"0.5836003",
"0.5830599",
"0.58217317",
"0.58144355",
"0.58099383",
"0.58091956",
"0.5801491",
"0.57953596",
"0.57937896",
"0.5772239",
"0.5772003",
"0.5771956",
"0.57627076",
"0.5756771",
"0.575478",
"0.5739186",
"0.57380396",
"0.5737604",
"0.57300436",
"0.5720125",
"0.57149225",
"0.57066923",
"0.5694561",
"0.5692579",
"0.5689913",
"0.56852674",
"0.5679357",
"0.56716794",
"0.566524",
"0.56629556",
"0.5661226",
"0.56584513",
"0.56573087",
"0.5657052",
"0.56503683",
"0.5648692",
"0.56405133",
"0.563718",
"0.5623069",
"0.5614545",
"0.56133133",
"0.5610145",
"0.5607696",
"0.56062466",
"0.56055164",
"0.5603793",
"0.5599169",
"0.5594335",
"0.5594335",
"0.5592721",
"0.5586323",
"0.55854696",
"0.557613",
"0.557613",
"0.55684775",
"0.5564229",
"0.55628633",
"0.5562147",
"0.5562143",
"0.5560652",
"0.5544802",
"0.5544802",
"0.5544802",
"0.55445087",
"0.55328625",
"0.5531784",
"0.5529637",
"0.5522962",
"0.5522027",
"0.5522027",
"0.5522027",
"0.5521925",
"0.55203277",
"0.55174184",
"0.5515147",
"0.5515103",
"0.55106455"
] | 0.0 | -1 |
need to parse all the POST data through various checkers using the data_columns. String length is not a problem, though. | public function checkData() {
// e.g. numbers must only have digits, e-mail addresses must have a "@" and a ".".
return $this->control->checkPOST($this);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function ParsePostData() {}",
"public function parsePostData()\n {\n }",
"abstract public function parsePostData() : array;",
"private function processPostData() {\n\n if (isset($this->postDataArray['week']) && isset($this->postDataArray['year']))\n {\n\n $this->weekSelected = $this->cleanse_input($this->postDataArray['week']);\n $this->yearSelected = $this->cleanse_input($this->postDataArray['year']);\n }\n else\n {\n $this->weekSelected = $this->weeks[0];\n $this->yearSelected = $this->years[0];\n }\n }",
"public function validateFieldData($postArray) \n{\n //for each field - check maxLenth if set, and check required just in case. Required should already be set - but just in case it should be checked again before filing.\n $errorArray=array();\n \n foreach ($this->tableStructure as $index=>$fieldArray) {\n $columnName=$fieldArray['columnName'];\n $val= isset($postArray[$columnName]) ? $postArray[$columnName] : '';\n $maxLength=isset($fieldArray['maxLength']) ? $fieldArray['maxLength'] : '';\n \n if (($val != '') && ($maxLength != '')) {\n if (strlen($val) > $maxLength) {\n $errorArray[$columnName]=\"Exceeds maximum length of \".$maxLength.\".\";\n }\n }\n \n if ($val == '') {\n if (isset($fieldArray['required']) && $fieldArray['required'] == 1) {\n $errorArray[$columnName]=\"Required field.\";\n } \n }\n } \n \n return $errorArray; \n}",
"private function parsed_data()\n {\n $parsed_data = array();\r\n\r\n //post data\r\n $parsed_data['name'] = $this->input->post(\"name\", TRUE);\r\n $parsed_data['email'] = $this->input->post(\"email\", TRUE);\r\n $parsed_data['countryID'] = $this->input->post(\"country\", TRUE);\r\n $parsed_data['phone'] = $this->input->post(\"phone\", TRUE);\r\n $parsed_data['message'] = $this->input->post(\"message\", TRUE);\r\n $parsed_data['IP'] = $this->input->ip_address();\r\n $parsed_data['browser'] = $this->input->user_agent();\r\n //post data\r\n\r\n return $parsed_data;\n }",
"public function parsePostData() {\n\t\t$dataset = DB::getInstance()->query('SELECT `id` FROM `'.PREFIX.'dataset` WHERE accountid = '.SessionAccountHandler::getId())->fetchAll();\n\n\t\tforeach ($dataset as $set) {\n\t\t\t$id = $set['id'];\n\t\t\t$modus = isset($_POST[$id.'_modus']) && $_POST[$id.'_modus'] == 'on' ? 2 : 1;\n\t\t\tif (isset($_POST[$id.'_modus_3']) && $_POST[$id.'_modus_3'] == 3)\n\t\t\t\t$modus = 3;\n\n\t\t\t$columns = array(\n\t\t\t\t'modus',\n\t\t\t\t'summary',\n\t\t\t\t'position',\n\t\t\t\t'style',\n\t\t\t\t'class'\n\t\t\t);\n\t\t\t$values = array(\n\t\t\t\t$modus,\n\t\t\t\t(isset($_POST[$id.'_summary']) && $_POST[$id.'_summary'] == 'on' ? 1 : 0),\n\t\t\t\tisset($_POST[$id.'_position']) ? (int)$_POST[$id.'_position'] : '',\n\t\t\t\tisset($_POST[$id.'_style']) ? htmlentities($_POST[$id.'_style']) : '',\n\t\t\t\tisset($_POST[$id.'_class']) ? htmlentities($_POST[$id.'_class']) : ''\n\t\t\t);\n\n\t\t\tDB::getInstance()->update('dataset', $id, $columns, $values);\n\t\t}\n\n\t\tCache::delete('Dataset');\n\t\tAjax::setReloadFlag(Ajax::$RELOAD_DATABROWSER);\n\t}",
"protected function preprocessData() {}",
"function parsePostData($postArray) {\n //parse post data and then form a valid WHERE statement\n }",
"private function parseInputValues()\r\n {\r\n parse_str(file_get_contents(\"php://input\"),$data);\r\n\r\n $data = reset($data);\r\n \r\n $data = preg_split('/------.*\\nContent-Disposition: form-data; name=/', $data);\r\n \r\n $this->inputValues = array();\r\n \r\n foreach($data as $input)\r\n {\r\n // get key\r\n preg_match('/\"([^\"]+)\"/', $input, $key);\r\n \r\n // get data\r\n $input = preg_replace('/------.*--/', '', $input);\r\n \r\n // Store to an array\r\n $this->inputValues[$key[1]] = trim(str_replace($key[0], '', $input));\r\n }\r\n }",
"function parseFieldNames($data) {\n global $Language;\n \n $this->num_columns = count($data);\n\n for ($c=0; $c < $this->num_columns; $c++) {\n $field_label = SimpleSanitizer::sanitize($data[$c]);\n if (!array_key_exists($field_label,$this->used_fields)) {\n\t$this->setError($Language->getText('plugin_tracker_import_utils','field_not_known',array($field_label,$this->ath->getName())));\n\treturn false;\n }\n \n $field = $this->used_fields[$field_label];\n if ($field) {\n\t$field_name = $field->getName();\n\tif ($field_name == \"artifact_id\") $this->aid_column = $c; \n\tif ($field_name == \"submitted_by\") $this->submitted_by_column = $c;\n\tif ($field_name == \"open_date\") $this->submitted_on_column = $c;\n }\n $this->parsed_labels[$c] = $field_label;\n \n }\n\n if (!$this->checkMandatoryFields()) { \n return false;\n }\n\n \n return true;\n }",
"protected function process_field_lengths($data, $table)\n {\n }",
"private function collectData() {\n $this->Name = $this->sanitize($_POST['Name']);\n $this->Street1 = $this->sanitize($_POST['Street1']);\n $this->Street2 = $this->sanitize($_POST['Street2']);\n $this->CityName = $this->sanitize($_POST['CityName']);\n $this->StateOrProvince = $this->sanitize($_POST['StateOrProvince']);\n $this->Country = $this->sanitize($_POST['Country']);\n $this->PostalCode = $this->sanitize($_POST['PostalCode']);\n }",
"function HAA_parseFormData($form_data)\n{\n // Array containing parsed form parameters.\n $form_params = array();\n // List of valid column names.\n $column_whitelist = array(\n 'full_name',\n 'email'\n );\n\n // Name of corresponding fields.\n $fields = array(\n 'full_name' => 'Full Name',\n 'email' => 'Email',\n 'complaint_description' => 'Complaint Description'\n );\n\n // List of columns to be validated for email.\n $emails = array(\n 'email'\n );\n\n // List of columns to be validated for alphabets only.\n $names = array(\n 'full_name'\n );\n\n //Check that email and complaint are filled\n $error = false;\n if (! isset($form_data['complaint_description'])\n || empty($form_data['complaint_description'])\n ) {\n HAA_gotError(\n 'Complaint description was left blank.'\n );\n $error = true;\n }\n\n foreach ($form_data as $column => $value) {\n if (! empty($column) && in_array($column, $column_whitelist)) {\n if (in_array($column, $emails)) {\n if (! HAA_validateValue($value, 'email')) {\n HAA_inValidField($fields[$column]);\n } else {\n $form_params[':' . $column] = $value;\n }\n } elseif (in_array($column, $names)) {\n if (! HAA_validateValue($value, 'name')) {\n HAA_inValidField($fields[$column]);\n } else {\n $form_params[':' . $column] = $value;\n }\n } else {\n // Do nothing\n }\n\n // Remove matched element from white list.\n $column_whitelist = array_diff($column_whitelist, array($column));\n }\n }\n\n //If any error, exit\n if ($error==true) {\n return false;\n }\n\n $form_params[':complaint_description'] = $form_data['complaint_description'];\n\n // If faced any error.\n if (! empty($GLOBALS['error'])) {\n return false;\n }\n\n return $form_params;\n}",
"public function sanitiseData(): void\n {\n $this->firstLine = self::sanitiseString($this->firstLine);\n self::validateExistsAndLength($this->firstLine, 1000);\n $this->secondLine = self::sanitiseString($this->secondLine);\n self::validateExistsAndLength($this->secondLine, 1000);\n $this->town = self::sanitiseString($this->town);\n self::validateExistsAndLength($this->town, 255);\n $this->postcode = self::sanitiseString($this->postcode);\n self::validateExistsAndLength($this->postcode, 10);\n $this->county = self::sanitiseString($this->county);\n self::validateExistsAndLength($this->county, 255);\n $this->country = self::sanitiseString($this->country);\n self::validateExistsAndLength($this->country, 255);\n }",
"function _cleanup_input_data($data = array()) {\n\t\tif (empty($data) || !is_array($data)) {\n\t\t\treturn false;\n\t\t}\n\t\t// Cleanup data array\n\t\t$_tmp = array();\n\t\tforeach ((array)$data as $k => $v) {\n\t\t\t$k = trim($k);\n\t\t\tif (!strlen($k)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$_tmp[$k] = $v;\n\t\t}\n\t\t$data = $_tmp;\n\t\tunset($_tmp);\n\t\t// Remove non-existed fields from query\n\t\t$avail_fields = $this->_get_avail_fields();\n\t\tforeach ((array)$data as $k => $v) {\n\t\t\tif (!isset($avail_fields[$k])) {\n\t\t\t\tunset($data[$k]);\n\t\t\t}\n\t\t}\n\t\t// Last check\n\t\tif (empty($data) || !is_array($data)) {\n\t\t\treturn false;\n\t\t}\n\t\treturn $data;\n\t}",
"function unpack_post() {\n // Globals\n global $min_words;\n global $add_num;\n global $add_char;\n global $case_opt;\n global $separator;\n\n if (array_key_exists('min-words', $_POST)) {\n $min_words = $_POST['min-words'];\n }\n\n if (array_key_exists('add-num', $_POST)) {\n $add_num = True;\n }\n\n if (array_key_exists('add-char', $_POST)) {\n $add_char = True;\n }\n\n if (array_key_exists('separator', $_POST)) {\n $separator = $_POST['separator'];\n }\n\n if (array_key_exists('case-opt', $_POST)) {\n $case_opt = $_POST['case-opt'];\n }\n\n // Mostly just for testing\n return [$min_words, (int)$add_num, (int)$add_char, $separator, $case_opt];\n}",
"public function processData() {\r\r\n if ( is_array($this->data) && isset($this->data['args']) )\r\r\n $this->args = array_merge($this->args, $this->data['args']);\r\r\n\r\r\n if ( is_array($this->data) && isset($this->data['value']) ) {\r\r\n // If called from back-end non-post context\r\r\n $this->e_data = $this->decode_param($this->data['value']);\r\r\n $this->data = $this->encode_param($this->data['value']);\r\r\n } else {\r\r\n // POST method or something else\r\r\n $this->e_data = $this->decode_param($this->data);\r\r\n $this->data = $this->encode_param($this->data);\r\r\n }\r\r\n /**\r\r\n * At this point the this->data variable surely contains the encoded data, no matter what.\r\r\n */\r\r\n }",
"protected function validate_data_fields(){\n\t\tif(empty($this->RESPONSE)){throw new Exception(\"Response field not found\", 5);}\n\t\t\n\t\t// The remote IP address is also required\n\t\tif($this->validate_ip($this->REMOTE_ADDRESS)){throw new Exception(\"Renote IP address not set correctly\", 6);}\n\t}",
"public function processData() {\r\r\n if ( is_array($this->data) && isset($this->data['args']) )\r\r\n $this->args = array_merge($this->args, $this->data['args']);\r\r\n\r\r\n if ( is_array($this->data) && isset($this->data['value']) ) {\r\r\n // If called from back-end non-post context\r\r\n $this->e_data = $this->decode_param($this->data['value']);\r\r\n $this->data = $this->encode_param($this->data['value']);\r\r\n } else {\r\r\n // POST method or something else\r\r\n $this->e_data = $this->decode_param($this->data);\r\r\n $this->data = $this->encode_param($this->data);\r\r\n }\r\r\n // All keys are srings in array, merge it with defaults to override\r\r\n $this->e_data = array_merge($this->default_options, $this->e_data);\r\r\n /**\r\r\n * At this point the this->data variable surely contains the encoded data, no matter what.\r\r\n */\r\r\n }",
"public function getPostData(){\n for ($t=1; $t <3 ; $t++) {\n $str = \"team\".$t;\n if(!$this->checkPost($str)) return false;\n $str = \"score_team\".$t;\n if(!$this->checkPost($str)) return false;\n for ($p=1; $p <3 ; $p++) {\n $str = \"team\".$t.\"_player\".$p;\n if(!$this->checkPost($str)) return false;\n }\n }\n return true;\n }",
"private function prepareData(){\n\t\t\t$this->text = trim($this->text);\n\t\t\t$this->user_id = intval($this->user_id);\n\t\t\t$this->parent_id = intval($this->parent_id);\n\t\t}",
"private function _validData($data){\n\t\t$columnsLen = array(\n\t\t\t\t\t\t\t'nro_pedido' => 6,\n\t\t\t\t\t\t\t'id_factura_pagos' => 1,\n\t\t\t\t\t\t\t'valor' => 1,\n\t\t\t\t\t\t\t'concepto' => 1,\n\t\t\t\t\t\t\t'fecha_inicio' => 0,\n\t\t\t\t\t\t\t'fecha_fin' => 0,\n\t\t\t\t\t\t\t'id_user' => 1\n\t\t);\n\t\treturn $this->_checkColumnsData($columnsLen, $data);\n\t}",
"public function normalizeData()\n {\n if (is_numeric($this->Streetname2)) {\n $this->HouseNumber = $this->Streetname2;\n $this->Streetname2 = \"\";\n }\n\n// Sometimes people will input - To mean Idfk why are you asking me to input this?\n if ($this->Phone && strlen($this->Phone) < 3) {\n $this->addMessage($this->getFormatedMessage(\"Invalid Phone [$this->Phone] ignoring\"));\n $this->Phone = '';\n }\n\n if ($this->State && strlen($this->State) < 2) {\n $this->addMessage($this->getFormatedMessage(\"Invalid State [$this->State] ignoring\"));\n $this->State = '';\n }\n\n if ($this->CompanyName && strlen($this->CompanyName) < 3) {\n $this->addMessage($this->getFormatedMessage(\"Invalid CompanyName[$this->CompanyName] ignoring \"));\n $this->CompanyName = '';\n }\n\n $this->Description = $this->escapeTextData($this->Description);\n if ($this->Description && strlen($this->Description) > 255) {\n $this->Description = substr($this->Description, 0, 255);\n\n //Make sure we are not sending a broken special char\n $descChars = str_split($this->Description); \n for ($i = 254; $i > 251; --$i) {\n if ($descChars[$i] == '&') {\n $this->Description = substr($this->Description, 0, $i);\n }\n }\n }\n\n if($this->Description && strlen($this->Description) < 3) {\n $this->addMessage($this->getFormatedMessage(\"Invalid description $this->Description ignoring \"));\n $this->Description = ''; \n }\n }",
"private function formatData() {\n\t\t// Initialise arr variable\n\t\t$str = array();\n\n\t\t// Step through the fields\n\t\tforeach($this->data as $key => $value){\n\t\t\t// Stick them together as key=value pairs (url encoded)\n\t\t\t$str[] = $key . '=' . urlencode($value);\n\t\t}\n\n\t\t// Implode the arry using & as the glue and store the data\n\t\t$this->curl_str = implode('&', $str);\n\t}",
"function prepareAPIdataToSave(){\r\n\tglobal $dataBody;\r\n\t$strDebug = \"prepareAPIdataToSave<br/>\";\r\n\r\n\t\t//arrays storing the form data from each of the arrayed form fields\r\n\t$formOCLC_NUMBERS \t= $_REQUEST[\"OCLC_NUMBER\"];\r\n\t$formOCLCrequested \t= $_REQUEST[\"OCLCrequested\"];\r\n\t$formISSN\t\t\t\t\t\t= $_REQUEST[\"ISSN\"];\r\n\t$formTITLES\t\t\t\t \t= $_REQUEST[\"TITLE\"];\r\n\t$formNumHolders \t \t= $_REQUEST[\"numHolders\"];\r\n\t$formHoldingsData \t= str_replace(\"|\", \"\", $_REQUEST[\"holdingsData\"]); //remove our field separator from the data: ruins formatting\r\n\r\n\t//column titles in first line\r\n\t//$dataBody = \"OCLC_NUMBER|OCLCalternate|ISSN|title|numHolders|CRLholds|\";//see new columns 2012-08-14\r\n\t$dataBody = \"OCLC_NUMBER|OCLCalternate|ISSN|title|numHolders|CRLholds|memberHolds|\";\r\n\t\t//2011: now there will be 4 styles of holdingsData for various uses in XLS, MDB, etc.\r\n\t\t//2012-07-20: nobody needs allNamesList and allCodesList variants with line breaks; skip them\r\n\t$dataBody .= \"allNames|\"; \t\t//all data, no line breaks\r\n\t\t//$dataBody .= \"allNamesList|\"; //all data, add line breaks; see thisAllNamesList in code below\r\n\t$dataBody .= \"allCodes|\"; \t\t//library codes only, no line breaks; see thisAllCodes in code below\r\n\t\t//$dataBody .= \"allCodesList|\"; //library codes only, add line breaks;\r\n\t$dataBody .= \"memberNames|memberCodes|memberData|\";\r\n\t$dataBody .= \"\\n\";\r\n\t//end column titles\r\n\r\n\t$i = 0;\r\n\tforeach($_REQUEST[\"OCLC_NUMBER\"] as $OCLC_NUMBER){\r\n\t\t/*$strDebug .= \"<p>i='\" . $i . \"': \" . $OCLC_NUMBER . \" has title '\" . $formTITLES[$i] . \"', \";\r\n\t\t\t $strDebug .= \"with \" . $formNumHolders[$i] . \" holders, \";\r\n\t\t\t $strDebug .= \"details are <span class='important'>\" . $formHoldingsData[$i] . \"</span>\";\r\n\t\techo $strDebug;\r\n\t\t*/\r\n\r\n\t\t\t/*\r\n\t\t\t\t- $_REQUEST[\"OCLC_NUMBER\"] is array of OCLC numbers returned by API\r\n\t\t\t\t- $_REQUEST[\"OCLCrequested\"] is array of OCLC numbers submitted to API\r\n\t\t\t\t- OCLC_NUMBER and OCLCrequested may be different if API returned data for merged number\r\n\t\t\t*/\r\n\t\t$thisRecord = trim($OCLC_NUMBER) . \"|\";\r\n\t\tif(trim($formOCLCrequested[$i])){\r\n\t\t\t$thisRecord .= trim($formOCLCrequested[$i]) . \"|\";\r\n\t\t} else { // $formOCLCrequested[$i] was blank\r\n\t\t\t$thisRecord .= \"0|\";\r\n\t\t}\r\n\r\n\t\t$thisRecord .= trim($formISSN[$i]) . \"|\"; //Holdings.js function parseISSN fills these so no need to handle blanks here\r\n\r\n\t\t$thisTitle \t= trim($formTITLES[$i]);\r\n\t\t//echo \"<h3>thisTitle='\" . $formTITLES[$i] . \"'<br/> + is in the encoding '\" . mb_detect_encoding($thisTitle) . \"'</h3>\";\r\n\r\n\t\t$thisTitle = str_replace( \",\", \" \", $thisTitle);\r\n\t\t$thisRecord .= $thisTitle . \"|\";\r\n\r\n\t\t$thisRecord .= trim($formNumHolders[$i]) . \"|\"; //original line; just add number from form data\r\n\r\n\t\t\t//bgn CRLholds field: does CRL hold this item?\r\n\t\t$boolCRLholds \t\t\t= 0;\r\n\t\t$CRLstrpos = strpos($formHoldingsData[$i], \"Center for Research Libraries [CRL]\");\r\n\t\tif ($CRLstrpos > -1){\r\n\t\t\t$boolCRLholds = 1;\r\n\t\t}\r\n\t\t$thisRecord .= $boolCRLholds . \"|\";\r\n\t\t//echo \"<br/>after boolCRLholds, thisRecord = \" . $thisRecord;\r\n\t\t//end CRLholds field\r\n\r\n\r\n\t\t/*\r\n\t\t\tfields: memberHolds, memberNames, memberCodes, memberData\r\n\t\t\t\tall need to be filled in from the mySQL interface, not here: leave message to that effect.\r\n\t\t\t\tDefined here, ea. is added to $thisRecord in order they appear in database (see column titles at beginning of function)\r\n\t\t*/\r\n\t\t\t$memberHolds = \"0|\";\r\n\t\t\t$memberNames = \"[member names]|\";\r\n\t\t\t$memberCodes = \"[member codes]|\";\r\n\t\t\t$memberData = \"[member data]|\";\r\n\t\t$thisRecord .= $memberHolds;\r\n\r\n\t\t\t//allNames: all data, no line breaks, straight holdings data as submitted\r\n\t\t$thisHoldingsData = trim($formHoldingsData[$i]);\r\n\t\t$thisHoldingsData = str_replace( \",\", \"\", $thisHoldingsData);\r\n\t\t$thisHoldingsData = replaceDoubleSpaces($thisHoldingsData);\r\n\t\t$thisRecord .= $thisHoldingsData . \"|\";\r\n\t\t//echo '<h3>thisHoldingsData = \"' . $thisHoldingsData . '\"</h3>';\r\n\t\t//echo '<h3>thisHoldingsData is in the encoding \"' . mb_detect_encoding($thisHoldingsData) . '\"</h3>';\r\n\t\t//end allNames field\r\n\r\n\r\n\t\t/* this section of the file has been removed: see allNamesList_unused.php\r\n\t\t\t- no longer providing allNamesList column */\r\n\r\n\r\n\t\t/* allCodes: library codes only, no line breaks\r\n\t\t\tregex: PCRE in PHP manual: Perl-Compatible Regular Expressions\r\n\t\t\t\\w \t <-- means any \"word\" character (letter or digit or underscore)\r\n\r\n\t\t\tregexCodesWrap + preg_replace:\r\n\t\t\t\tstrips holdings library names, leaves brackets + codes\r\n\t\t\t\t'#[0-9]+\\) [A-Za-z0-9\\s\\w\\&\\%\\$\\#\\@\\-\\.\\:\\\"\\'\\(\\)]*#'\r\n\r\n\t\t\tfirst, replace all the accented characters with non-accented equivalents,\r\n\t\t\t\t\tso regexCodesWrap will match the entire repository names: see\r\n\t\t\t\t\thttp://php.net/manual/en/function.strtr.php\r\n\t\t\t\t\t\t$codes = strtr($thisHoldingsData, \"äåö\", \"aao\");\r\n\t\t\t\t\tbut user Anonymous 25-Nov-2009 08:09 posted even simpler solution (with our vars plugged in):\r\n\t\t\t\t\t\t$codes = preg_replace(\"/[^\\x9\\xA\\xD\\x20-\\x7F]/\", \"\", $thisHoldingsData);\r\n\t\t*/\r\n\t\t$regexAccentedChars = '#[^\\x9\\xA\\xD\\x20-\\x7F]#';\r\n\t\t$codes = preg_replace($regexAccentedChars, \"\", $thisHoldingsData); //replace accented characters\r\n\t\t$regexCodesWrap = '#[0-9]+\\) [\\s\\w\\&\\%\\$\\#\\@\\-\\.\\:\\\"\\'\\(\\)]*#';\r\n\t\t$codes = preg_replace($regexCodesWrap, \"\", $codes, -1, $matchCodes);\r\n\t\t$regexBracket = '#\\]\\.#';\r\n\t\t$codes = preg_replace($regexBracket, \"] \", $codes, -1, $matchBracket);\r\n\t\t$thisAllCodes = trim($codes);\r\n\t\t$thisAllCodes = replaceDoubleSpaces($thisAllCodes);\r\n\t\t$thisRecord .= $thisAllCodes . \"|\";\r\n\t\t//end allCodes field\r\n\r\n\t\t/* this section of the file has been removed: see allCodesList_unused.php\r\n\t\t\t- no longer providing allCodesList column */\r\n\r\n\t\t\t//add dummy columns that need to be filled depending on the returned data:\r\n\t\t\t//\tthat's done in the database\r\n\t\t$thisRecord .= $memberNames . $memberCodes . $memberData;\r\n\r\n\t\tif ($thisRecord != \"|||\") $dataBody .= $thisRecord . \"\\n\"; //if not empty record\r\n\r\n\t\t$i++;\r\n\t}//end foreach\r\n\r\n\t//echo $strDebug . \"<p>dataBody:<br/>\" . str_replace(\"\\n\", \"<br/>\", $dataBody) . \"</p><hr/>\";\r\n}",
"public static function checkPostData($data) {\n\t\t\t/* This method use the php function htmlentities for each values in $_POST and return an array with securised data */\n foreach ($data as $key => $value) {\n $data[$key] = htmlentities($value);\n }\n return $data;\n\t\t}",
"private function readPost(){\n\t\tIF(isset($_POST['eventName'])) { \n\t\t $this->eventName = trim(strip_tags($_POST['eventName']));\n\t\t}\n\t\tIF(isset($_POST['senderName'])) { \n\t\t $this->senderName = trim(strip_tags($_POST['senderName']));\n\t\t}\n\t\tIF(isset($_POST['senderEmail'])) {\n\t\t $this->senderEmail = trim(strip_tags(preg_replace(\"/[^0-9a-zA-ZäöüÄÖÜÈèÉéÂâáÁàÀíÍìÌâÂ@ \\-\\+\\_\\.]/\", \" \", $_POST['senderEmail'])));\n\t\t}\n\t\tIF(isset($_POST['validateEmail'])){\n\t\t $this->validateEmail = trim(strip_tags($_POST['validateEmail']));\n\t\t}\n\t\tIF(isset($_POST['senderPhone'])){\n\t\t $this->senderPhone = trim(strip_tags($_POST['senderPhone']));\n\t\t}\n\t\tIF(isset($_POST['numberOfTickets'])){\n\t\t $this->numberOfTickets = trim(strip_tags($_POST['numberOfTickets']));\n\t\t}\n\t\tIF(isset($_POST['paymentOption'])){\n\t\t $this->paymentOption = trim(strip_tags($_POST['paymentOption']));\n\t\t}\n\t\tIF(isset($_POST['otherPartyNames'])){\n\t\t $this->otherPartyNames = trim(strip_tags($_POST['otherPartyNames']));\n\t\t}\n\t\tIF(isset($_POST['pickupPoint'])){\n\t\t $this->pickupPoint = trim(strip_tags($_POST['pickupPoint']));\n\t\t} \n\t\tIF(isset($_POST['sittingNear'])){\n\t\t $this->sittingNear = trim(strip_tags($_POST['sittingNear']));\n\t\t}\n\t\tIF(isset($_POST['specialNeeds'])){\n\t\t $this->specialNeeds = trim(strip_tags($_POST['specialNeeds']));\n\t\t}\n\t}",
"function validate_post($data)\n\t{\n\t\t/* Validating the hostname, the database name and the username. The password is optional. */\n\t\treturn !empty($data['db_host']) && !empty($data['db_username']) && !empty($data['db_name']) && !empty($data['site_url']);\n\t}",
"protected function checkAlwaysPopulateRawPostDataSetting() {}",
"protected function validDataFromRequest()\n {\n return array_merge([\n 'obj_type',\n 'obj_id',\n 'rev_num',\n ], parent::validDataFromRequest());\n }",
"private function readFields( )\n {\n global $UNDERQL;\n\n $l_fs = @ mysql_list_fields( $UNDERQL['db']['name'], $this->table_name );\n $l_fq = @ mysql_query( 'SHOW COLUMNS FROM `' . $this->table_name . '`' );\n $l_fc = @ mysql_num_rows( $l_fq );\n @ mysql_free_result( $l_fq );\n $i = 0;\n\n $this->table_fields_names[$this->table_name] = array( );\n $this->string_fields = array( );\n\n while ( $i < $l_fc )\n {\n $l_f = mysql_fetch_field( $l_fs );\n if ( $l_f->numeric != 1 )\n $this->string_fields[@ count( $this->string_fields )] = $l_f->name;\n\n $this->table_fields_names[$this->table_name]\n [@count($this->table_fields_names[$this->table_name])] = $l_f->name;\n $i++;\n }\n }",
"protected function prepareForValidation()\n {\n \n //Filling uncaught parameters to blank default value\n foreach($this->columns_rules as $column => $rules){\n if(empty($this->get($column))) {\n $this->request->add([$column => '']); \n }\n }\n\n }",
"private function checkFields()\r\n {\r\n $vars = array('user', 'pass', 'numbers', 'message', 'date', 'ids', 'data_start', 'data_end',\r\n 'lido', 'status', 'entregue', 'data_confirmacao', 'return_format'\r\n );\r\n\r\n $final = array();\r\n foreach ($vars as $key => $value) {\r\n if ($this->$value !== '') {\r\n $final[$value] = $this->$value;\r\n }\r\n }\r\n return $final;\r\n }",
"function mf_init_max_input_vars(){\n\t\t$max_input_vars = (int) ini_get('max_input_vars');\n\t\t\n\t\t//if max_input_vars is 0 or empty, then most likely the PHP version is less than PHP 5.3.9\n\t\tif ($max_input_vars <= 0) {\n \treturn true;\n \t}\n\n \t//if max_input_vars already being set to a large value, no need to parse it further\n \tif($max_input_vars >= 10000){\n \t\treturn true;\n \t}\n\n \t//if the number of input is less than max_input_vars, no need to parse it further\n \tif (count($_POST, COUNT_RECURSIVE) < $max_input_vars) {\n \treturn true;\n \t}\n \t\n \t//read raw post data using php://input wrapper, since this one is not affected by max_input_vars\n \t$input_string = file_get_contents(\"php://input\");\n \tif($input_string === false or $input_string === '') {\n \treturn true;\n \t}\n\n\t\t$exploded_array = explode('&', $input_string);\n\t\t$chunked_array = array_chunk($exploded_array, $max_input_vars);\n \t$imploded_array = array_map('mf_implode_array_chuncks', $chunked_array);\n\n \tforeach ($imploded_array as $chunk_data) {\n\t $parsed_vars = array();\n\t parse_str($chunk_data, $parsed_vars);\n\t \n\t //merge parsed variables into POST\n\t mf_merge_parsed_vars_to_post($parsed_vars);\n\t }\n\t}",
"protected function parseData($data){\r\n $d = array();\r\n if(is_string($data)){\r\n try{\r\n parse_str($data,$arr);\r\n $d = $arr;\r\n }catch(Exception $e){\r\n //del lam gi ca\r\n }\r\n }elseif(is_array($data)){\r\n $d = $data;\r\n }\r\n if(!$d) return null;\r\n unset($d[$this->idField]);\r\n $r = array();\r\n foreach($d as $f => $v){\r\n if(in_array($f, $this->fields)) $r[$f] = $v;\r\n }\r\n return $r;\r\n }",
"function validateColums($POST) {\n if (isset( $POST['sName'] ) )\n return true;\n\n if ( (!isset($POST['label'])) &&\n (!isset($POST['asset_no'])) &&\n (!isset($POST['has_problems'])) &&\n (!isset($POST['comment'])) &&\n (!isset($POST['runs8021Q'])) &&\n (!isset($POST['location'])) &&\n (!isset($POST['MACs'])) &&\n (!isset($POST['label'])) &&\n (!isset($POST['attributeIDs'])) ) {\n return true;\n }\n\n}",
"public function getPostData($data) {\n return filter_var($data, FILTER_SANITIZE_STRING);\n }",
"public function validate_post_data()\n\t{\n\t\tee()->load->helper('number_helper');\n\t\t$post_limit = get_bytes(ini_get('post_max_size'));\n\t\treturn $_SERVER['CONTENT_LENGTH'] <= $post_limit;\n\t}",
"protected function _splitUpdateData($data) \n\t{\n\t\t$result = '';\n\n\t\t$this->_stringData($data);\n\n\t\tforeach ($data as $key => $value) {\n\t\t\tif (in_array($key, $this->_fields)) {\n\t\t\t\t$result .= '`' . $key . '`=' . $value . ',';\t\t\t\t\n\t\t\t}\n\t\t}\n\n\t\t$result = substr($result, 0, -1);\n\t\treturn $result;\n\t}",
"protected function getPostValues() {}",
"private function PREPARE_VALIDATION_RESULTS()\r\r {\r\r $this->PREPARE_OBJECT_VARIABLE_METHOD(); \r\r $this->READ_FIELDS();\r\r \r\r foreach($this->_ready_fields as $key => $fields)\r\r {\r\r # SET THE ALIAS FOR EACH FIELD\r\r $this->_object[$key]['ALIAS'] = (isset($fields['ALIAS'])) ? $fields['ALIAS'] : $key; \r\r \r\r # IF VALUE IS NOT NULL\r\r if(isset($fields['REQUIRED']) && $this->_object[$key]['VALUE']===''){\r\r $this->_results[$key]['REQUIRED'] = (strlen($fields['REQUIRED']) > 1 ) ? $fields['REQUIRED'] : $this->_object[$key]['ALIAS'].' '.$this->_error['REQUIRED'];\r\r }\r\r \r\r # IF VALUE IS NOT NUMERIC\r\r if( isset($fields['NUMERIC']) && !is_numeric($this->_object[$key]['VALUE']) ){\r\r $this->_results[$key]['NUMERIC'] = (strlen($fields['NUMERIC'])>1 ? $fields['NUMERIC'] :$this->_object[$key]['ALIAS'].' '.$this->_error['NUMERIC']);\r\r }\r\r \r\r # IF VALUE IS A VALID EMAIL\r\r if(isset($fields['EMAIL']) && !$this->checkEmail($this->_object[$key]['VALUE'])){\r\r $this->_results[$key]['EMAIL'] = (strlen($fields['EMAIL'])>1 ? $fields['EMAIL'] :$this->_object[$key]['ALIAS'].' '.$this->_error['EMAIL']);\r\r }\r\r \r\r # IF VALUE HAS A SPECIFIC LENGTH\r\r if(isset($fields['LENGTH'])){\r\r \r\r if(array_key_exists('EQUAL', $fields['LENGTH']) && !(($fields['LENGTH']['EQUAL']) == strlen($this->_object[$key]['VALUE'])))\r\r {\r\r $this->_results[$key]['LENGTH'] =isset($fields['LENGTH']['ERROR'])? $fields['LENGTH']['ERROR']:$this->_object[$key]['ALIAS'].' '.$this->_error['LENGTH']['EQUAL'].' '.$fields['LENGTH']['EQUAL'].' characters';\r\r }\r\r # GREATER THAN \r\r else if(array_key_exists('GREAT', $fields['LENGTH']) && !(strlen($this->_object[$key]['VALUE']) > ($fields['LENGTH']['GREAT'])))\r\r {\r\r $this->_results[$key]['LENGTH'] =isset($fields['LENGTH']['ERROR'])? $fields['LENGTH']['ERROR'] :$this->_object[$key]['ALIAS'].' '.$this->_error['LENGTH']['GREAT'].' '.$fields['LENGTH']['GREAT'].' characters';\r\r }\r\r # GREATER THAN EQUAL TO \r\r else if(array_key_exists('GREAT_E', $fields['LENGTH']) && !(strlen($this->_object[$key]['VALUE'])>=($fields['LENGTH']['GREAT_E'])))\r\r {\r\r $this->_results[$key]['LENGTH'] =isset($fields['LENGTH']['ERROR'])? $fields['LENGTH']['ERROR'] :$this->_object[$key]['ALIAS'].' '.$this->_error['LENGTH']['GREAT_E'].' '.$fields['LENGTH']['GREAT_E'].' characters';\r\r }\r\r # LESS THAN \r\r else if(array_key_exists('LESS', $fields['LENGTH']) && !(strlen($this->_object[$key]['VALUE'])<($fields['LENGTH']['LESS'])))\r\r {\r\r $this->_results[$key]['LENGTH'] =isset($fields['LENGTH']['ERROR'])? $fields['LENGTH']['ERROR'] :$this->_object[$key]['ALIAS'].' '.$this->_error['LENGTH']['LESS'].' '.$fields['LENGTH']['LESS'].' characters';\r\r }\r\r # LESS THAN EQUAL TO \r\r else if(array_key_exists('LESS_E', $fields['LENGTH']) && !(strlen($this->_object[$key]['VALUE'])<=($fields['LENGTH']['LESS_E'])))\r\r {\r\r $this->_results[$key]['LENGTH'] =isset($fields['LENGTH']['ERROR'])? $fields['LENGTH']['ERROR'] :$this->_object[$key]['ALIAS'].' '.$this->_error['LENGTH']['LESS_E'].' '.$fields['LENGTH']['LESS_E'].' characters';\r\r }\r\r }\r\r \r\r # IF A FIELD IS EQUAL TO ANOTHER FIELD \r\r if(isset($fields['COMPARE'])){\r\r \r\r if(is_array($fields['COMPARE']))\r\r {\r\r if($this->_object[$key]['VALUE']!==$this->_object[$fields['COMPARE']['WITH']]['VALUE']){ \r\r $this->_results[$key]['COMPARE'] = isset($fields['COMPARE']['ERROR']) ? $fields['COMPARE']['ERROR'] : $this->_object[$key]['ALIAS'] .' and '. $this->_ready_fields[$fields['COMPARE']['WITH']]['ALIAS'].' '. $this->_error['COMPARE'];\r\r }\r\r } \r\r else\r\r {\r\r if($this->_object[$key]['VALUE']!==$this->_object[$fields['COMPARE']]['VALUE']){\r\r $this->_results[$key]['COMPARE'] = $this->_object[$key]['ALIAS'] .' and '. $this->_ready_fields[$fields['COMPARE']]['ALIAS'].' '. $this->_error['COMPARE'];\r\r }\r\r }\r\r }\r\r \r\r } \r\r }",
"function processPostVars()\n {\n $this->id = $_POST['id'];\n $this->login = trimStrip($_POST['login']);\n $this->surname = trimStrip($_POST['surname']);\n $this->firstname = trimStrip($_POST['firstname']);\n $this->hash = trimStrip($_POST['hash']);\n $this->yearno = (integer)trimStrip($_POST['yearno']);\n $this->groupno = (integer)trimStrip($_POST['groupno']);\n $this->email = trimStrip($_POST['email']);\n $this->calendaryear = intval($_POST['calendaryear']);\n $this->coeff = (float)$_POST['coeff'];\n }",
"private function getPostData()\n {\n $postData = $this->request->getPostValue();\n\n /** Magento may adds the SID session parameter, depending on the store configuration.\n * We don't need or want to use this parameter, so remove it from the retrieved post data. */\n unset($postData['SID']);\n\n //Set original postdata before setting it to case lower.\n $this->originalPostData = $postData;\n\n //Create post data array, change key values to lower case.\n $postDataLowerCase = array_change_key_case($postData, CASE_LOWER);\n $this->postData = $postDataLowerCase;\n }",
"private function getPostData() {\n\t\t$data = null;\n\t\t\n\t\t// Get from the POST global first\n\t\tif (empty($_POST)) {\n\t\t\t// For API calls we need to look at php://input\n\t\t\tif (!empty(file_get_contents('php://input'))) {\n\t\t\t\t$data = @json_decode(file_get_contents('php://input'), true);\n\t\t\t\tif ($data === false || $data === null) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\t//TODO: What is this for? isn't 'php://input' always empty at this point?\n\t\t\t\t$dataStr = file_get_contents('php://input');\n\t\t\t\tparse_str($dataStr, $data);\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\t$data = $_POST;\n\t\t}\n\t\t\n\t\t// Normalize boolean values\n\t\tforeach ($data as $name => &$value) {\n\t\t\tif ($value === 'true') {\n\t\t\t\t$value = true;\n\t\t\t}\n\t\t\telse if ($value === 'false') {\n\t\t\t\t$value = false;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $data;\n\t}",
"private static function _parse()\n {\n $data = array();\n $data['tab-label'] = $_POST['tab-label'];\n $data['title-disabled'] = (bool) @$_POST['title-disabled'];\n $data['languages'] = $_POST['languages'];\n \n $data['languages'] = $_POST['languages'] ? explode(',',$_POST['languages']) : array(); \n $data['info'] = trim($_POST['info']); \n\t\t\n\t\t\n $data['required-width-comparator'] = $_POST['required-width-comparator']; \n $data['required-width'] = $_POST['required-width']; //do not cast to int\n\t\t$data['required-width-ranges'] = $_POST['required-width-ranges'] ? array_map('self::_explodeRangeRow', explode(';', $_POST['required-width-ranges'])) : array(); //twice explode\n\n\n\t\t$data['required-height-comparator'] = $_POST['required-height-comparator']; \n $data['required-height'] = $_POST['required-height']; //do not cast to int\n\t\t$data['required-height-ranges'] = $_POST['required-height-ranges'] ? array_map('self::_explodeRangeRow', explode(';', $_POST['required-height-ranges'])) : array(); //twice explode\n\n \n $data['fields'] = array();\n \n for ($i=0; isset($_POST['field-'.$i.'-type']); $i++) {\n $field = array();\n \n $field['label'] = $_POST['field-'.$i.'-label'];\n $field['type'] = $_POST['field-'.$i.'-type'];\n $field['required'] = (bool)@$_POST['field-'.$i.'-required'];\n \n if ($field['type'] == 'select')\n $field['options'] = preg_replace('/\\s\\s+/', ',', $_POST['field-'.$i.'-options']);\n \n $data['fields'][] = $field;\n } \n\n $data['thumbnails'] = array();\n \n //thumbs\n for ($i=0; $i <= 1; $i++) {\n $thumb = array();\n\n $thumb['enabled'] = (bool) @$_POST['thumb-'.$i.'-enabled'];\n $thumb['required'] = (bool) @$_POST['thumb-'.$i.'-required'];\n $thumb['label'] = @$_POST['thumb-'.$i.'-label'];\n $thumb['width'] = @$_POST['thumb-'.$i.'-width'];\n $thumb['height'] = @$_POST['thumb-'.$i.'-height'];\n $thumb['auto-crop'] = @$_POST['thumb-'.$i.'-auto-crop'];\n \n $data['thumbnails'][] = $thumb;\n }\n\n return $data;\n }",
"public function handleDataSubmission() {}",
"public function augmentDataFromRequest(&$fields_data) {\n //Do nothing for the majority of fields\n }",
"function validateData($request) {\n\tglobal $amessages;\n\tinclude_once(ROOT_PATH.'classes/data/validate.class.php');\n\t$error = array();\n\t$validate = new Validate();\n\t$error['INPUT']['module'] = $validate->validString($request->element('module'),$amessages['object']);\t\n\t$error['INPUT']['name'] = $validate->validString($request->element('name'),$amessages['name']);\n\t$error['INPUT']['title'] = $validate->validString($request->element('title'),$amessages['title']);\n\t$error['INPUT']['class'] = $validate->pasteString($request->element('class'));\n\t$error['INPUT']['type'] = $validate->validNumber($request->element('type'),$amessages['custom_field_type']);\n\t$error['INPUT']['value'] = $validate->pasteString($request->element('value'));\n\tif($request->element('type')>3) $error['INPUT']['value'] = $validate->validString($request->element('value'),$amessages['custom_field_value']);\n\t$error['INPUT']['position'] = $validate->pasteString($request->element('position'));\n\t$error['INPUT']['status'] = $validate->pasteString($request->element('status'));\n\t\n\tif($error['INPUT']['module']['error'] || $error['INPUT']['name']['error'] || $error['INPUT']['title']['error'] || $error['INPUT']['type']['error'] || $error['INPUT']['value']['error']) {\n\t\t$error['invalid'] = 1;\n\t\treturn $error;\n\t}\n\t$error['invalid'] = 0;\n\treturn $error;\n}",
"function processRequest(){\n\tglobal $muse; // App settings & database\n\tglobal $HTTP_RAW_POST_DATA;\n\t\n\t// Get the user's posted action\n\t$muse['actionRequestRaw'] = $HTTP_RAW_POST_DATA;\n\t$muse['actionRequest'] = $muse['db']->real_escape_string(trim($HTTP_RAW_POST_DATA));\n\t// First word of action request will be the action keyword.\n\t$muse['actionKeyword'] = strtolower(substr( $muse['actionRequest'], 0, strpos( $muse['actionRequest'], \" \" ) ) );\n\t\n\t// If it's only one word, through it back in. Capatlization issues?\n\tif ($muse['actionKeyword']==false) {\n\t\t$muse['actionKeyword'] = $muse['actionRequest'];\n\t}\n}",
"function parseData()\r\n\t{\r\n\t\treturn true;\r\n\t}",
"function theme_helper_import_sample_data($data, $length = 0) {\n $header = NULL;\n\n foreach ((array)$data as $i => $fields) {\n foreach ((array)$fields as $j => $value) {\n if ($length > 0 && strlen($value) > $length) {\n $data[$i][$j] = check_plain(substr($value, 0, $length)) .' '. theme('placeholder', format_plural(strlen($value) - $length, t('(1 more character)'), t('(@count more characters)')));\n }\n else {\n $data[$i][$j] = check_plain($value);\n }\n }\n }\n\n if (!empty($data) > 0) {\n $header = array_shift($data);\n }\n else {\n $data = array(t('Empty data set.'));\n }\n\n return theme('table', $header, $data);\n}",
"abstract public function validateData();",
"protected function getInputData ()\n {\n (new HCRivilePaymentsValidator())->validateForm();\n\n $_data = request()->all();\n\n if (array_has($_data, 'id'))\n array_set($data, 'record.id', array_get($_data, 'id'));\n\n array_set($data, 'record.COUNT', array_get($_data, 'COUNT'));\n array_set($data, 'record.I04_KODAS_CH', array_get($_data, 'I04_KODAS_CH'));\n array_set($data, 'record.I04_DOK_NR', array_get($_data, 'I04_DOK_NR'));\n array_set($data, 'record.I04_OP_RUSIS', array_get($_data, 'I04_OP_RUSIS'));\n array_set($data, 'record.I04_OP_TIPAS', array_get($_data, 'I04_OP_TIPAS'));\n array_set($data, 'record.I04_OP_STORNO', array_get($_data, 'I04_OP_STORNO'));\n array_set($data, 'record.I04_OP_DATA', array_get($_data, 'I04_OP_DATA'));\n array_set($data, 'record.I04_KODAS_SS', array_get($_data, 'I04_KODAS_SS'));\n array_set($data, 'record.I04_MOKETOJAS', array_get($_data, 'I04_MOKETOJAS'));\n array_set($data, 'record.I04_KODAS_KS', array_get($_data, 'I04_KODAS_KS'));\n array_set($data, 'record.I04_PAV', array_get($_data, 'I04_PAV'));\n array_set($data, 'record.I04_ADR', array_get($_data, 'I04_ADR'));\n array_set($data, 'record.I04_ATSTOVAS', array_get($_data, 'I04_ATSTOVAS'));\n array_set($data, 'record.I04_KODAS_VS', array_get($_data, 'I04_KODAS_VS'));\n array_set($data, 'record.I04_SUMA', array_get($_data, 'I04_SUMA'));\n array_set($data, 'record.I04_SUMA_DSK', array_get($_data, 'I04_SUMA_DSK'));\n array_set($data, 'record.I04_SUMA_PLK', array_get($_data, 'I04_SUMA_PLK'));\n array_set($data, 'record.I04_PASTABOS', array_get($_data, 'I04_PASTABOS'));\n array_set($data, 'record.I04_PERKELTA', array_get($_data, 'I04_PERKELTA'));\n array_set($data, 'record.I04_IMP_EXP', array_get($_data, 'I04_IMP_EXP'));\n array_set($data, 'record.I04_KODAS_VL', array_get($_data, 'I04_KODAS_VL'));\n array_set($data, 'record.I04_SUMA_VAL', array_get($_data, 'I04_SUMA_VAL'));\n array_set($data, 'record.I04_KOEF', array_get($_data, 'I04_KOEF'));\n array_set($data, 'record.I04_USERIS', array_get($_data, 'I04_USERIS'));\n array_set($data, 'record.I04_R_DATE', array_get($_data, 'I04_R_DATE'));\n array_set($data, 'record.I04_ADDUSR', array_get($_data, 'I04_ADDUSR'));\n array_set($data, 'record.I04_KODAS_SM', array_get($_data, 'I04_KODAS_SM'));\n array_set($data, 'record.I04_APRASYMAS', array_get($_data, 'I04_APRASYMAS'));\n array_set($data, 'record.I04_SUMA_PER', array_get($_data, 'I04_SUMA_PER'));\n array_set($data, 'record.I04_SUMA_WK', array_get($_data, 'I04_SUMA_WK'));\n array_set($data, 'record.I04_KODAS_LS_1', array_get($_data, 'I04_KODAS_LS_1'));\n array_set($data, 'record.I04_KODAS_LS_2', array_get($_data, 'I04_KODAS_LS_2'));\n array_set($data, 'record.I04_KODAS_LS_3', array_get($_data, 'I04_KODAS_LS_3'));\n array_set($data, 'record.I04_KODAS_LS_4', array_get($_data, 'I04_KODAS_LS_4'));\n array_set($data, 'record.I04_KODAS_ZN', array_get($_data, 'I04_KODAS_ZN'));\n array_set($data, 'record.I04_BUSENA', array_get($_data, 'I04_BUSENA'));\n\n return makeEmptyNullable($data);\n }",
"function processPostVars()\n {\n $this->id = $_POST['id'];\n $this->role = $_POST['role'];\n $this->firstname = trimStrip($_POST['firstname']);\n $this->surname = trimStrip($_POST['surname']);\n $this->email = trimStrip($_POST['email']);\n $this->login = trimStrip($_POST['login']);\n $this->password = trimStrip($_POST['pass1']);\n }",
"public function set_post_data($data){\n\t\t$this->postdata = http_build_query($data);\n\t\t$this->numpost = count($data);\n\t}",
"private function postData()\n {\n $post = array_filter($this->post);\n\n return http_build_query($post);\n }",
"public function ParsePostData() {\n\t\t\tif (array_key_exists($this->strControlId, $_POST)) {\n //$this->blnModified = true;\n\t\t\t\t// It was -- update this Control's value with the new value passed in via the POST arguments\n\t\t\t\t$strValue = $_POST[$this->strControlId];\n\n foreach($this->arrListItems as $objListItem){\n if($objListItem->Value == $strValue){\n $objListItem->Selected = true;\n }else{\n $objListItem->Selected = false;\n }\n }\n }\n }",
"protected function setPostData()\n\t{\n\t\t$this->request->addPostFields($this->query->getParams());\n\t}",
"public function validateFormData($data) {\n\n $errors = array();\n\n // twitter name\n if (strlen($data['twitterName']) < 1 || strlen($data['twitterName']) > 100) {\n $errors['twitterName'] = 'Full name is required and must be less than 100 characters.';\n }\n\n // twitter username\n if (!preg_match(\"/^[a-zA-Z0-9_]+$/\", $data['twitterUsername']) || strlen($data['twitterUsername']) < 1 || strlen($data['twitterUsername']) > 15) {\n $errors['twitterUsername'] = 'Username must only use letters, numbers, underscores, and be 15 or fewer characters in length.';\n }\n\n // cron key\n if (!preg_match(\"/^[a-zA-Z0-9_]+$/\", $data['cronKey']) || strlen($data['cronKey']) < 1 || strlen($data['cronKey']) > 50) {\n $errors['cronKey'] = 'The cron key must only use letters, numbers, underscores, and be 50 or fewer characters in length.';\n }\n\n // timezone\n if (!date_default_timezone_set($data['timezone'])) {\n $errors['timezone'] = 'Not a valid timezone.';\n }\n\n // database prefix\n if (!preg_match(\"/^[a-zA-Z0-9_]+$/\", $data['databasePrefix']) || strlen($data['databasePrefix']) < 1 || strlen($data['databasePrefix']) > 15) {\n $errors['databasePrefix'] = 'The database prefix must only use letters, numbers, underscores, and be 15 or fewer characters in length.';\n }\n\n // do one last check to require all fields without a specific check\n $requiredFields = array('twitterName', 'twitterUsername', 'consumerKey', 'consumerSecret', 'oauthToken', 'oauthSecret', 'baseUrl', 'timezone', 'cronKey', 'databaseHost', 'databaseDatabase', 'databaseUsername', 'databasePassword', 'databasePrefix');\n foreach ($requiredFields as $field) {\n if (!isset($errors[$field]) && strlen(trim($data[$field])) < 1) {\n $errors[$field] = 'This field is required.';\n }\n }\n\n return (count($errors)) ? $errors : false;\n\n }",
"abstract protected function prepareData( $data );",
"function prepareData()\r\n\t{\r\n\t\treturn true;\r\n\t}",
"private function setPostDataToDataArray()\n\t{\n\t\ttry\n\t\t{\n\t\t\t# Set the Database instance to a variable.\n\t\t\t$db=DB::get_instance();\n\n\t\t\t# Check if the form has been submitted.\n\t\t\tif(array_key_exists('_submit_check', $_POST) && (isset($_POST['register']) && ($_POST['register']==='Register')))\n\t\t\t{\n\t\t\t\t# Set the Validator instance to a variable.\n\t\t\t\t$validator=Validator::getInstance();\n\t\t\t\t# Set the data array to a local variable.\n\t\t\t\t$data=$this->getData();\n\n\t\t\t\t# Check if there was POST data sent.\n\t\t\t\tif(isset($_POST['email']))\n\t\t\t\t{\n\t\t\t\t\t# Clean it up and set it to the data array index.\n\t\t\t\t\t$data['Email']=$db->sanitize($_POST['email'], 2);\n\t\t\t\t}\n\n\t\t\t\t# Check if there was POST data sent.\n\t\t\t\tif(isset($_POST['email_conf']))\n\t\t\t\t{\n\t\t\t\t\t# Clean it up and set it to the data array index.\n\t\t\t\t\t$data['EmailConf']=$db->sanitize($_POST['email_conf'], 2);\n\t\t\t\t}\n\n\t\t\t\t# Check if there was POST data sent.\n\t\t\t\tif(isset($_POST['password']) && !empty($_POST['password']))\n\t\t\t\t{\n\t\t\t\t\t# If WordPress is installed add the user the the WordPress users table.\n\t\t\t\t\tif(WP_INSTALLED===TRUE)\n\t\t\t\t\t{\n\t\t\t\t\t\t$data['WPPassword']=trim($_POST['password']);\n\t\t\t\t\t}\n\t\t\t\t\t$data['Password']=trim($_POST['password']);\n\t\t\t\t}\n\n\t\t\t\t# Check if there was POST data sent.\n\t\t\t\tif(isset($_POST['password_conf']) && !empty($_POST['password_conf']))\n\t\t\t\t{\n\t\t\t\t\t$data['PasswordConf']=$_POST['password_conf'];\n\t\t\t\t}\n\n\t\t\t\t# Check if there was POST data sent.\n\t\t\t\tif(isset($_POST['username']))\n\t\t\t\t{\n\t\t\t\t\t# Clean it up and set it to the data array index.\n\t\t\t\t\t$data['Username']=$db->sanitize($_POST['username'], 2);\n\t\t\t\t}\n\n\t\t\t\t# Reset the data array to the data member.\n\t\t\t\t$this->setData($data);\n\t\t\t}\n\t\t}\n\t\tcatch(Exception $e)\n\t\t{\n\t\t\tthrow $e;\n\t\t}\n\t}",
"private function _parseFields()\n {\n // make a new array from the field_types array where all values are ZERO\n $num_types = array_fill_keys(array_keys($this->field_types), 0);\n\n // create a new fillable array\n $fillable = [];\n\n // loop fields\n foreach($this->fields as &$field_config){\n\n // DB FIELD NAME ---------------------------------------------------\n // get the schema type (eg: string, text etc.)\n $type = $this->field_types[$field_config['type']]['schema_type'];\n // create the field name based on the type and count\n $field_config['name'] = $type . (++$num_types[$type]);\n\n // FILLABLE ENTRIES ---------------------------------------------------\n // add a 'fillable' value like \"string1\", \"decimal3\" etc.\n $fillable[] = $field_config['name'];\n \n // VALIDATION RULES --------------------------------------------------\n // get the related rules from either the class fields or the field_types arrays\n $field_rules = isset($field_config['rules']) ? $field_config['rules'] : $this->field_types[$type]['rules']; \n // store\n $this->validation_rules[$field_config['name']] = $field_rules;\n\n // VALIDATION MESSAGES\n // copy all the validation messages from the lang file into a \n // FIELD specific array so we can swap all the attribute names out\n foreach(explode('|', $field_rules) as $field_rule){\n $rule_name = preg_replace('@:.*@','',$field_rule);\n $this->validation_messages[$field_config['name'].'.'.$rule_name] = $this->_swapValidationAttrs($rule_name, $field_config['label'], $field_rules);\n }\n\n }\n\n // merge the dynamic fillable fields with the defaults\n $merged_fillable = array_merge($this->fillable, $fillable);\n\n // set the fillable array using the appropriate parent method\n $this->fillable($merged_fillable);\n\n }",
"function parse_incoming()\n {\n\t\t//-----------------------------------------\n\t\t// Attempt to switch off magic quotes\n\t\t//-----------------------------------------\n\n\t\t@set_magic_quotes_runtime(0);\n\n\t\t$this->get_magic_quotes = @get_magic_quotes_gpc();\n\t\t\n \t//-----------------------------------------\n \t// Clean globals, first.\n \t//-----------------------------------------\n \t\n\t\t$this->clean_globals( $_GET );\n\t\t$this->clean_globals( $_POST );\n\t\t$this->clean_globals( $_COOKIE );\n\t\t$this->clean_globals( $_REQUEST );\n \t\n\t\t# GET first\n\t\t$input = $this->parse_incoming_recursively( $_GET, array() );\n\t\t\n\t\t# Then overwrite with POST\n\t\t$input = $this->parse_incoming_recursively( $_POST, $input );\n\t\t\n\t\t$this->input = $input;\n\t\t\n\t\t$this->define_indexes();\n\n\t\tunset( $input );\n\t\t\n\t\t# Assign request method\n\t\t$this->input['request_method'] = strtolower($this->my_getenv('REQUEST_METHOD'));\n\t}",
"protected function prepare_fields()\n {\n }",
"public function checkDataSubmission() {\n\t\t$this->main('', array());\n }",
"public function loadFieldsRegexps()\n {\n // prepare request\n $sth = self::$connection->prepare('SELECT field_name, validator FROM fields ORDER BY field_order ASC');\n // run it\n $sth->execute();\n\n // check if not empty or error\n if ($result = $sth->fetchAll(PDO::FETCH_ASSOC)) {\n // go with foreach create needed structure\n foreach ($result as $field => $val) {\n self::$data[$val['field_name']] = $val['validator'];\n }\n\n // return answer\n return self::$data;\n }\n\n return false;\n }",
"private function calculateInputData() {\n\t\t$this->inputValuesSetRawData();\n\t\t$this->explodeRowsToCells();\n\t\t$this->separateHeader();\n\t\t$this->validateValues();\n\t}",
"function detectColumns($data) {\n global $colCount, $schema;\n $colCount = count($data); \n $schema = $data;\n}",
"function get_fields_from_post(){\n\t\t$prefix=\"\";\n\t\t$this->id_corp=$_SESSION['ident_corp'];\n\t\t$this->name=htmlentities($_POST[$prefix.$this->ddbb_name]);\n\t\t$this->name_web=htmlentities($_POST[$prefix.$this->ddbb_name_web]);\n\t\t$this->pvp=$_POST[$prefix.$this->ddbb_pvp];\n\t\t$this->tax=$_POST[$prefix.$this->ddbb_tax];\n\t\t$this->pvp_tax=$_POST[$prefix.$this->ddbb_pvp_tax];\n\t\t$this->descrip=htmlentities($_POST[$prefix.$this->ddbb_descrip]);\n\t\t$this->path_photo = $_SESSION['ruta_photo'];\n\t\t\n\n\t\t\n\t\t$this->get_categories_from_post();\n\n\t\treturn 0;\n\t}",
"function _map_post_data_for_model()\n\t{\n\t\t// create map the abbreviate post data to database\n\t\t$post_data_map = array(\n 'id'\t=> 'device_id',\n 'h'\t\t=> 'heading',\n 'la'\t=> 'latitude',\n 'lo' \t=> 'longitude',\n 's' \t=> 'speed',\n 't' \t=> 'timestamp',\n \t);\n \t\n\t\t// create new array with full column names as keys to to be passed in\n\t\t// to model\n \t$event = array();\n \tforeach ($post_data_map as $key => $value) {\n \t\t$post_value = $this->input->post($key);\n\t\t\t\n\t\t\t// break and return NULL if any value is blank\n\t\t\tif (!isset($post_value) or $post_value == '') {\n\t\t\t\treturn NULL;\n\t\t\t} else {\n\t \t\t$event[$value] = $post_value;\n\t\t\t}\n\t\t}\n\t\treturn $event;\n\t}",
"public function data() {\n $request = $this->requestReader->getContents();\n\t\tif ($request) {\n if ($json_post = CJSON::decode($request)){\n\t\t\t\treturn $json_post;\n\t\t\t}else{\n\t\t\t\tparse_str($request,$variables);\n\t\t\t\treturn $variables;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}",
"function tt_validate_upload_columns(csv_import_reader $cir, $stdfields, moodle_url $returnurl) {\n $columns = $cir->get_columns();\n\n if (empty($columns)) {\n $cir->close();\n $cir->cleanup();\n print_error('cannotreadtmpfile', 'error', $returnurl);\n }\n if (count($columns) < 2) {\n $cir->close();\n $cir->cleanup();\n print_error('csvfewcolumns', 'error', $returnurl);\n }\n\n // test columns\n $processed = array();\n foreach ($columns as $key=>$unused) {\n $field = $columns[$key];\n $lcfield = textlib::strtolower($field);\n if (in_array($field, $stdfields) or in_array($lcfield, $stdfields)) {\n // standard fields are only lowercase\n $newfield = $lcfield;\n } else {\n $cir->close();\n $cir->cleanup();\n print_error('invalidfieldname', 'error', $returnurl, $field);\n }\n if (in_array($newfield, $processed)) {\n $cir->close();\n $cir->cleanup();\n print_error('duplicatefieldname', 'error', $returnurl, $newfield);\n }\n $processed[$key] = $newfield;\n }\n return $processed;\n}",
"public function collectData() {\n $dialog = new Application_Model_DbTable_Dialog();\n\n $this->getDialogLines();\n $ignore_list = array('',''\n /*,\n 'submit_button'*/\n );\n $this->error = array();\n $this->error[] = \"<table><tr><th colspan='2'>Fix the following errors and retry</td></tr>\";\n $errorct = 0;\n $this->data = array();\n $formData = $this->getRequest();\n foreach($this->drows as $row) {\n if ($row['position'] == 0)\n continue;\n $type = $row['field_type'];\n $varname = $row['field_name'];\n $field_label = $row['field_label'];\n $validate = $row['validate'];\n if (in_array($type, $ignore_list)) {\n continue;\n }\n // logit('IN: '. $formData->getPost($varname,''));\n $this->data[$varname] = $formData->getPost($varname, '');\n // VALIDATION HERE\n if ($validate) {\n $msg = call_user_func($validate, $this->data[$varname]);\n logit(\"VAL: {$varname} {$validate} {$this->data[$varname]} -- {$msg}\");\n\n if ($msg) {\n // Enter into error array\n $errorct ++;\n $this->error[] = \"<tr><td class=\\\"rpad\\\"><b>{$field_label}:</b></td>\" .\n \"<td> <Span class=\\\"error\\\">{$msg}</span></td></tr>\";\n }\n }\n }\n $this->error[] = \"</table>\";\n if ($errorct == 0)\n $this->error = array();\n $this->handleCancel();\n // logit(\"ECT: \" . count($this->error));\n if (count($this->error) > 0) {\n $this->echecklistNamespace->flash = 'Correct errors and retry';\n $this->makeDialog($this->data);\n return true;\n }\n }",
"public function validateAndParseData(Order $order, array $postData);",
"function parse_parameters($data)\n{\n $parameters = array();\n $body_params = array();\n //if we get a GET, then parse the query string\n if($_SERVER['REQUEST_METHOD'] == 'GET') {\n if (isset($_SERVER['QUERY_STRING'])) {\n // make this more defensive\n return $_GET;\n }\n } else {\n // Otherwise it is POST, PUT or DELETE.\n // At the moment, we only deal with JSON\n //$data = file_get_contents(\"php://input\");\n $body_params = json_decode($data, TRUE);\n print_r($body_params);\n }\n\n foreach ($body_params as $field => $value) {\n $parameters[$field]= $value;\n }\n return $parameters;\n}",
"abstract public function prepareData();",
"function _parse_raw_http_request_urlencoded($input)\n{\n $post_data = array();\n\n $pairs = explode('&', $input);\n foreach ($pairs as $pair) {\n $exploded = explode('=', $pair, 2);\n if (count($exploded) == 2) {\n $key = urldecode($exploded[0]);\n $val = urldecode($exploded[1]);\n if (get_magic_quotes_gpc()) {\n $val = addslashes($val);\n }\n\n if (substr($key, -2) == '[]') {\n $key = substr($key, 0, strlen($key) - 2);\n if (!isset($post_data[$key])) {\n $post_data[$key] = array();\n }\n $post_data[$key][] = $val;\n } else {\n $post_data[$key] = $val;\n }\n }\n }\n\n return $post_data;\n}",
"private function check_finish_inputs()\n {\n $output = [];\n if (!isset($_POST[\"token\"]) || !isset($_POST[\"exam_id\"]) || !isset($_POST[\"corrects\"]) || !isset($_POST[\"wrongs\"]) || !isset($_POST[\"emptys\"]))\n return false;\n\n if (empty($_POST[\"token\"]) || empty($_POST[\"exam_id\"]) || empty($_POST[\"corrects\"]) || empty($_POST[\"wrongs\"]) || empty($_POST[\"emptys\"]))\n return false;\n\n $output = [\n (string) \"token\" => $_POST[\"token\"],\n (int) \"exam_id\" => $_POST[\"exma_id\"],\n (array) \"corrects\" => json_decode($_POST[\"corrects\"]),\n (array) \"wrongs\" => json_decode($_POST[\"wrongs\"]),\n (array) \"emptys\" => json_decode($_POST[\"emptys\"]),\n ];\n\n return $output;\n }",
"function split_validationdataArray($validationData)\n{\n\tglobal $log;\n\t$log->debug(\"Entering split_validationdataArray() method ...\");\n\t$fieldName = '';\n\t$fieldLabel = '';\n\t$fldDataType = '';\n\t$rows = count($validationData);\n\tforeach($validationData as $fldName => $fldLabel_array)\n\t{\n\t\tif($fieldName == '')\n\t\t{\n\t\t\t$fieldName=\"'\".$fldName.\"'\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$fieldName .= \",'\".$fldName .\"'\";\n\t\t}\n\t\tforeach($fldLabel_array as $fldLabel => $datatype)\n\t\t{\n\t\t\tif($fieldLabel == '')\n\t\t\t{\n\t\t\t\t$fieldLabel = \"'\".$fldLabel .\"'\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$fieldLabel .= \",'\".$fldLabel .\"'\";\n\t\t\t}\n\t\t\tif($fldDataType == '')\n\t\t\t{\n\t\t\t\t$fldDataType = \"'\".$datatype .\"'\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$fldDataType .= \",'\".$datatype .\"'\";\n\t\t\t}\n\t\t}\n\t}\n\t$data['fieldname'] = $fieldName;\n\t$data['fieldlabel'] = $fieldLabel;\n\t$data['datatype'] = $fldDataType;\n\t$log->debug(\"Exiting split_validationdataArray method ...\");\n\treturn $data;\n}",
"function ltiExtractPost() {\n // Unescape each time we use this stuff - somedy we won't need this...\n $FIXED = array();\n foreach($_POST as $key => $value ) {\n if (get_magic_quotes_gpc()) $value = stripslashes($value);\n $FIXED[$key] = $value;\n }\n $retval = array();\n $retval['key'] = isset($FIXED['oauth_consumer_key']) ? $FIXED['oauth_consumer_key'] : null;\n $retval['context_id'] = isset($FIXED['context_id']) ? $FIXED['context_id'] : null;\n $retval['link_id'] = isset($FIXED['resource_link_id']) ? $FIXED['resource_link_id'] : null;\n $retval['user_id'] = isset($FIXED['user_id']) ? $FIXED['user_id'] : null;\n\n if ( $retval['key'] && $retval['context_id'] && $retval['link_id'] && $retval['user_id'] ) {\n // OK To Continue\n } else {\n return false;\n }\n \n $retval['service'] = isset($FIXED['lis_outcome_service_url']) ? $FIXED['lis_outcome_service_url'] : null;\n $retval['sourcedid'] = isset($FIXED['lis_result_sourcedid']) ? $FIXED['lis_result_sourcedid'] : null;\n\n $retval['context_title'] = isset($FIXED['context_title']) ? $FIXED['context_title'] : null;\n $retval['link_title'] = isset($FIXED['resource_link_title']) ? $FIXED['resource_link_title'] : null;\n $retval['user_email'] = isset($FIXED['lis_person_contact_email_primary']) ? $FIXED['lis_person_contact_email_primary'] : null;\n if ( isset($FIXED['lis_person_name_full']) ) {\n $retval['user_displayname'] = $FIXED['lis_person_name_full'];\n } else if ( isset($FIXED['lis_person_name_given']) && isset($FIXED['lis_person_name_family']) ) {\n $retval['user_displayname'] = $FIXED['lis_person_name_given'].' '.$FIXED['lis_person_name_family'];\n } else if ( isset($FIXED['lis_person_name_given']) ) {\n $retval['user_displayname'] = $FIXED['lis_person_name_given'];\n } else if ( isset($FIXED['lis_person_name_family']) ) {\n $retval['user_displayname'] = $FIXED['lis_person_name_given'];\n }\n $retval['role'] = 0;\n if ( isset($FIXED['roles']) ) {\n $roles = strtolower($FIXED['roles']);\n if ( ! ( strpos($roles,'instructor') === false ) ) $retval['role'] = 1;\n if ( ! ( strpos($roles,'administrator') === false ) ) $retval['role'] = 1;\n }\n return $retval;\n}",
"private function __parseRequestData() {\n\t\t$data = $this->data;\n\t\tif ($data['Block']['public_type'] === Block::TYPE_LIMITED) {\n\t\t\t//$data['Block']['from'] = implode('-', $data['Block']['from']);\n\t\t\t//$data['Block']['to'] = implode('-', $data['Block']['to']);\n\t\t} else {\n\t\t\tunset($data['Block']['from'], $data['Block']['to']);\n\t\t}\n\n\t\treturn $data;\n\t}",
"abstract function check_data($formdata);",
"private function _prepareUpdateString($data) {\n /**\n * @ Incoming $data looks like:\n * $data = array('field' => 'value', 'field2'=> 'value2');\n */\n $fieldDetails = NULL;\n foreach ($data as $key => $value) {\n $fieldDetails .= \"$key=:$key, \";/** Notice the space after the comma */\n }\n $fieldDetails = rtrim($fieldDetails, ', ');/** Notice the space after the comma */\n return $fieldDetails;\n }",
"private function checkData(){\n $this->datavalidator->addValidation('article_title','req',$this->text('e10'));\n $this->datavalidator->addValidation('article_title','maxlen=250',$this->text('e11'));\n $this->datavalidator->addValidation('article_prologue','req',$this->text('e12'));\n $this->datavalidator->addValidation('article_prologue','maxlen=3000',$this->text('e13'));\n $this->datavalidator->addValidation('keywords','regexp=/^[^,\\s]{3,}(,? ?[^,\\s]{3,})*$/',$this->text('e32'));\n $this->datavalidator->addValidation('keywords','maxlen=500',$this->text('e33'));\n if($this->data['layout'] != 'g' && $this->data['layout'] != 'h'){ //if article is gallery dont need content\n $this->datavalidator->addValidation('article_content','req',$this->text('e14'));\n }\n $this->datavalidator->addValidation('id_menucategory','req',$this->text('e15'));\n $this->datavalidator->addValidation('id_menucategory','numeric',$this->text('e16'));\n $this->datavalidator->addValidation('layout','req',$this->text('e17'));\n $this->datavalidator->addValidation('layout','maxlen=1',$this->text('e18'));\n if($this->languager->getLangsCount() > 1){\n $this->datavalidator->addValidation('lang','req',$this->text('e19'));\n $this->datavalidator->addValidation('lang','numeric',$this->text('e20'));\n }\n //if user cannot publish articles check publish values\n if($_SESSION[PAGE_SESSIONID]['privileges']['articles'][2] == '1') {\n $this->datavalidator->addValidation('published','req',$this->text('e21'));\n $this->datavalidator->addValidation('published','numeric',$this->text('e22'));\n $this->datavalidator->addValidation('publish_date','req',$this->text('e23'));\n }\n $this->datavalidator->addValidation('topped','req',$this->text('e24'));\n $this->datavalidator->addValidation('topped','numeric',$this->text('e25'));\n $this->datavalidator->addValidation('homepage','req',$this->text('e30'));\n $this->datavalidator->addValidation('homepage','numeric',$this->text('e31'));\n $this->datavalidator->addValidation('showsocials','req',$this->text('e26'));\n $this->datavalidator->addValidation('showsocials','numeric',$this->text('e27'));\n \n $result = $this->datavalidator->ValidateData($this->data);\n if(!$result){\n $errors = $this->datavalidator->GetErrors();\n return array('state'=>'error','data'=> reset($errors));\n }else{\n return true;\n }\n }",
"public function parse()\n {\n if( $this->method === 'post' )\n {\n $_REQUEST = array_merge( $_GET, $_POST );\n return true;\n }\n if( !empty( $this->ctype ) && !empty( $this->input ) )\n {\n if( strpos( $this->ctype, 'plain' ) !== false )\n {\n return $this->_parsePlain();\n }\n else if( strpos( $this->ctype, 'json' ) !== false )\n {\n return $this->_parseJson();\n }\n else if( strpos( $this->ctype, 'xml' ) !== false )\n {\n return $this->_parseXml();\n }\n else if( strpos( $this->ctype, 'html' ) !== false )\n {\n return $this->_parseXml();\n }\n else if( strpos( $this->ctype, 'form-urlencoded' ) !== false )\n {\n return $this->_parseEncoded();\n }\n else if( strpos( $this->ctype, 'form-data' ) !== false )\n {\n return $this->_parseForm();\n }\n }\n return false;\n }",
"public function processData() {}",
"function convPOSTCharset()\t{\n\t\tif ($this->renderCharset != $this->metaCharset && is_array($_POST) && count($_POST))\t{\n\t\t\t$this->csConvObj->convArray($_POST,$this->metaCharset,$this->renderCharset);\n\t\t\t$GLOBALS['HTTP_POST_VARS'] = $_POST;\n\t\t}\n\t}",
"public function checkInput($data) {\n\n if(strlen($data) >= 1){\n $data = trim($data); //remove \\n, \\r, \\t doesn't remove spaces between words, if wanted than use -> str_replace(\" \", \"\", trim($data));\n return $data;\n }else{\n return false;\n }\n\n }",
"private function _parseEncoded()\n {\n @parse_str( $this->input, $data );\n\n if( is_array( $data ) )\n {\n $_REQUEST = array_merge( $_GET, $data );\n return true;\n }\n return false;\n }",
"function _webform_table_data_email($data) {\r\n return check_plain(empty($data['value']['0']) ? '' : $data['value']['0']);\r\n}",
"function process_data($data) {\n }",
"protected function _readFormFields() {}",
"function split_validationdataArray($validationData) {\n\tglobal $log;\n\t$log->debug('> split_validationdataArray', $validationData);\n\t$fieldName = '';\n\t$fieldLabel = '';\n\t$fldDataType = '';\n\tforeach ($validationData as $fldName => $fldLabel_array) {\n\t\tif ($fieldName == '') {\n\t\t\t$fieldName=\"'\".$fldName.\"'\";\n\t\t} else {\n\t\t\t$fieldName .= \",'\".$fldName .\"'\";\n\t\t}\n\t\tforeach ($fldLabel_array as $fldLabel => $datatype) {\n\t\t\tif ($fieldLabel == '') {\n\t\t\t\t$fieldLabel = \"'\".addslashes($fldLabel).\"'\";\n\t\t\t} else {\n\t\t\t\t$fieldLabel .= \",'\".addslashes($fldLabel).\"'\";\n\t\t\t}\n\t\t\tif ($fldDataType == '') {\n\t\t\t\t$fldDataType = \"'\".$datatype .\"'\";\n\t\t\t} else {\n\t\t\t\t$fldDataType .= \",'\".$datatype .\"'\";\n\t\t\t}\n\t\t}\n\t}\n\t$data['fieldname'] = $fieldName;\n\t$data['fieldlabel'] = $fieldLabel;\n\t$data['datatype'] = $fldDataType;\n\t$log->debug('< split_validationdataArray');\n\treturn $data;\n}",
"protected function _splitAddData($data) \n\t{\n\t\t$result = array();\n\t\t//filp this fields \n\t\t$tableFields = array_flip($this->_fields);\n\n\t\t//add '' to string value\n\t\t$this->_stringData($data);\n\n\t\tforeach ($data as $key => $value) {\n\t\t\t//filter fields\n\t\t\tif (!in_array($key, $this->_fields)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t//sort the add data with this fields sort\n\t\t\t$result[$tableFields[$key]] = $value;\n\t\t}\n\n\t\tksort($result);\n\t\t$str = implode(',', $result);\n\t\treturn $str;\n\t}",
"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}",
"protected function buildNewRecordData()\n\t{\n\t\t// define temporary arrays. These are required for ASP conversion\n\t\t$evalues = array();\n\t\t$efilename_values = array();\n\t\t$blobfields = array();\n\t\t$keys = $this->keys;\n\t\t\n\t\t$newFields = array_intersect( $this->getpageFields(), $this->selectedFields );\n\t\tforeach($newFields as $f)\n\t\t{\n\t\t\t$control = $this->getControl( $f, $this->id );\n\t\t\t$control->readWebValue($evalues, $blobfields, NULL, NULL, $efilename_values);\n\t\t}\n\n\t\t$this->newRecordData = $evalues;\n\t\t$this->newRecordBlobFields = $blobfields;\n\t}",
"function import2ds() {\r\n $ok = 0;\r\n foreach ($this->properties as $colvar=>$col) {\r\n if (isset($_REQUEST['field'][$colvar]) and !isset($this->ds->$colvar)) { # i hazardously ignore action state (updatable, insertable...)\r\n # note: below hasbeen moved to import_suggest_field_to_ds()\r\n if ($this->action == 'new' and $col->parentkey) {# special case for detail-new, parent-linked field val only supplied by post as field[fieldname][0]=val. let's copied this to all indices\r\n $value = $_REQUEST['field'][$colvar][0];\r\n $this->ds->$colvar = array();\r\n for ($i=0; $i<$_REQUEST['num_row']; $i++) {\r\n $this->ds->{$colvar}[$i] = $value;\r\n }\r\n }\r\n else {\r\n $this->ds->$colvar = $_REQUEST['field'][$colvar];\r\n }\r\n $ok = 1;\r\n }\r\n elseif ($col->inputtype == 'checkbox' and !isset($_REQUEST['field'][$colvar][$i]) and !isset($this->ds->$colvar)) {\r\n # special case for checkbox. unchecked checkboxes do not generate empty key/val. so depending whether this is group checkboxes or single checkbox, we initialize it to correct value.\r\n # if we dont explicitly say its value is (ie, value=0), and the previous value in db is 1, then checkbox would never be saved as unchecked, since populate will passess current value in db.\r\n if ($col->enumerate != '') {\r\n $value = array(); # assign it to empty array. TODO: should test this.\r\n }\r\n else {\r\n $value = 0; # BOOLEAN 0/1\r\n }\r\n $this->ds->$colvar = array();\r\n for ($i=0; $i<$_REQUEST['num_row']; $i++) {\r\n $this->ds->{$colvar}[$i] = $value;\r\n }\r\n $ok = 1;\r\n }\r\n else {\r\n #~ echo 'not ok';\r\n }\r\n }\r\n\r\n $this->db_count = $ok;\r\n }"
] | [
"0.6818312",
"0.66517156",
"0.6167456",
"0.6071666",
"0.60086644",
"0.60060287",
"0.59942406",
"0.5986947",
"0.5958739",
"0.59528434",
"0.5932354",
"0.58805263",
"0.5868518",
"0.58657575",
"0.58657295",
"0.5840437",
"0.5825142",
"0.5722623",
"0.5680706",
"0.56365705",
"0.56258285",
"0.56065136",
"0.5580884",
"0.55739474",
"0.5559488",
"0.55568314",
"0.5525038",
"0.5510664",
"0.55102426",
"0.544323",
"0.542377",
"0.5422372",
"0.54065347",
"0.5395613",
"0.5395292",
"0.5391614",
"0.5385221",
"0.5370159",
"0.5366033",
"0.5361499",
"0.53607666",
"0.5344487",
"0.5342563",
"0.5336981",
"0.5329147",
"0.5317239",
"0.53019744",
"0.52889806",
"0.52636266",
"0.5253084",
"0.5244564",
"0.52387303",
"0.522686",
"0.52160144",
"0.52147204",
"0.52083933",
"0.5208031",
"0.5203231",
"0.52019286",
"0.51973295",
"0.5189474",
"0.51816773",
"0.5173158",
"0.51489013",
"0.5145223",
"0.51337457",
"0.512068",
"0.51162624",
"0.51063067",
"0.5103979",
"0.5101162",
"0.5086909",
"0.50823027",
"0.50781906",
"0.50775933",
"0.50756997",
"0.50723785",
"0.50569606",
"0.50550807",
"0.50537676",
"0.5051391",
"0.5047124",
"0.50308895",
"0.5030596",
"0.50305223",
"0.50262016",
"0.5022788",
"0.5016768",
"0.5013158",
"0.50092953",
"0.5002941",
"0.5001287",
"0.49977064",
"0.49965805",
"0.49956772",
"0.4995049",
"0.49844912",
"0.49804854",
"0.4979948"
] | 0.6327413 | 3 |
This header must be always in USASCII | public function setEncoding($encoding)
{
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function testCanBeEncoded()\n {\n $value = \"[#77675] New Issue:xxxxxxxxx xxxxxxx xxxxxxxx xxxxxxxxxxxxx xxxxxxxxxx xxxxxxxx, tähtaeg xx.xx, xxxx\";\n $res = Header::canBeEncoded($value);\n $this->assertTrue($res);\n\n $value = '';\n for ($i = 0; $i < 255; ++$i)\n $value .= chr($i);\n\n $res = Header::canBeEncoded($value);\n if ($res)\n var_Dump(Header::wrap($value));\n $this->assertFalse($res);\n }",
"protected function makeFileContentTransferEncodingHeaderString() {\n\t\treturn 'Content-transfer-encoding: ' . $this->_mailFileContentTransferEncoding . $this->_endString;\n\t}",
"function nc_quoted_printable_encode_header($input, $charset = MAIN_EMAIL_ENCODING) {\n $str = preg_replace_callback(\"/([^\\x09\\x21-\\x3C\\x3E-\\x7E])/\",\n 'nc_quoted_printable_encode_callback',\n rtrim($input));\n\n // add encoding to the beginning of each line\n $encoding = \"=?$charset?Q?\";\n $content_length = 72 - strlen($encoding);\n\n nc_preg_match_all(\"/.{1,$content_length}([^=]{0,2})?/\", $str, $regs);\n $str = $encoding . join(\"?=\\n\\t$encoding\", $regs[0]) . \"?=\";\n\n return $str;\n}",
"public static function setUtf8EncodingHeader() : void {\n if (!headers_sent()) {\n header('Content-Type: text/html; charset=utf-8');\n }\n }",
"protected function makeTextPlainContentTransferEncodingHeaderString() {\n\t\treturn 'Content-transfer-encoding: ' . $this->_mailTextPlainContentTransferEncoding . $this->_endString;\n\t}",
"public static function content_encoding()\n {\n }",
"protected function makeTextHtmlContentTransferEncodingHeaderString() {\n\t\treturn 'Content-transfer-encoding: ' . $this->_mailTextHtmlContentTransferEncoding . $this->_endString;\n\t}",
"function MimeHeaderEncode($string) {\n if (preg_match('/[^\\x20-\\x7E]/', $string)) {\n $chunk_size = 47; // floor((75 - strlen(\"=?UTF-8?B??=\")) * 0.75);\n $len = strlen($string);\n $output = '';\n while ($len > 0) {\n $chunk = $this->TruncateBytes($string, $chunk_size);\n $output .= ' =?UTF-8?B?' . base64_encode($chunk) . \"?=\\n\";\n $c = strlen($chunk);\n $string = substr($string, $c);\n $len -= $c;\n }\n return trim($output);\n }\n return $string;\n }",
"public function convPOSTCharset() {}",
"protected function _encodeHeader($value)\n {\n if (\\Zend_Mime::isPrintable($value)) {\n return $value;\n } else {\n /**\n * Next strings fixes the problems\n * According to RFC 1522 (http://www.faqs.org/rfcs/rfc1522.html)\n */\n $quotedValue = '';\n $count = 1;\n for ($i=0; strlen($value)>$i;$i++) {\n if ($value[$i] == '?' or $value[$i] == '_' or $value[$i] == ' ') {\n $quotedValue .= str_replace(array('?', ' ', '_'), array('=3F', '=20', '=5F'), $value[$i]);\n } else {\n $quotedValue .= $this->encodeQuotedPrintable($value[$i]);\n }\n if (strlen($quotedValue)>$count*\\Zend_Mime::LINELENGTH) {\n $count++;\n $quotedValue .= \"?=\\n =?\". $this->_charset . '?Q?';\n }\n }\n return '=?' . $this->_charset . '?Q?' . $quotedValue . '?=';\n }\n }",
"public function getName(): string\n {\n return \"ISO-8859-1\";\n }",
"function utf8_to_iso_8859_1() {\r\n\t\t$result = preg_match('/<meta http\\-equiv=\"[Cc]ontent\\-[Tt]ype\" content=\"text\\/html;\\s*charset\\s*=\\s*utf\\-8\"/is', $this->code, $encoding_matches);\r\n\t\tif($result) {\r\n\t\t\t$this->code = iconv(\"UTF-8\", \"CP1252\" . \"//TRANSLIT\", $this->code);\r\n\t\t\t$this->code = htmlspecialchars($this->code);\r\n\t\t\t$this->code = htmlentities($this->code);\r\n\t\t\t$this->code = htmlspecialchars_decode($this->code);\r\n\t\t\t$this->code = htmlspecialchars_decode($this->code);\r\n\t\t\t$this->code = preg_replace('/<meta http\\-equiv=\"[Cc]ontent\\-[Tt]ype\" content=\"text\\/html;\\s*charset\\s*=\\s*utf\\-8\"/is', '<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\"', $this->code);\r\n\t\t}\r\n\t}",
"public function getContentEncoding()\n {\n }",
"private function writeHeader(): void\n {\n $record = 0x0014; // Record identifier\n\n /* removing for now\n // need to fix character count (multibyte!)\n if (strlen($this->phpSheet->getHeaderFooter()->getOddHeader()) <= 255) {\n $str = $this->phpSheet->getHeaderFooter()->getOddHeader(); // header string\n } else {\n $str = '';\n }\n */\n\n $recordData = StringHelper::UTF8toBIFF8UnicodeLong($this->phpSheet->getHeaderFooter()->getOddHeader());\n $length = strlen($recordData);\n\n $header = pack('vv', $record, $length);\n\n $this->append($header . $recordData);\n }",
"public function getEncoding()\r\n\t{\r\n\t\t//TODO: Parse the raw response header info for content type\r\n\t\t//EXAMPLE OF RETURNED DATA FROM $this->_solrResponse->getRawResponseHeaders()\r\n\t\t/*\r\n\t\t\"HTTP/1.1 200 OK\r\n\t\tContent-Type: text/xml; charset=utf-8\r\n\t\tContent-Length: 764\r\n\t\tServer: Jetty(6.1.3)\r\n\r\n\t\t\"\r\n\t\t*/\r\n\t\treturn 'utf-8';\r\n\t}",
"function getHeader()\n {\n return (string) $this->_sHeader;\n }",
"function getHeader()\n {\n return (string) $this->_sHeader;\n }",
"public function fixCharsets() {}",
"public function setUTF()\n\t{\n\t\treturn true;\n\t}",
"protected function _parseHeader() {}",
"public function getHeader();",
"public function getHeader();",
"public function getHeader();",
"protected function encodeForHeader(string $text): string\n {\n if ($this->appCharset === null) {\n return $text;\n }\n\n $restore = mb_internal_encoding();\n mb_internal_encoding($this->appCharset);\n $return = mb_encode_mimeheader($text, $this->getHeaderCharset(), 'B');\n mb_internal_encoding($restore);\n\n return $return;\n }",
"abstract public function setUTF();",
"function getHeader($ch, $header) {\r\n\t\t$i = strpos($header, ':');\r\n\t\tif (!empty($i)) {\r\n\t\t\t$key = str_replace('-', '_', strtolower(substr($header, 0, $i)));\r\n\t\t\t$value = trim(substr($header, $i + 2));\r\n\t\t\t$this->http_header[$key] = $value;\r\n\t\t}\t\t\r\n\t\treturn strlen($header);\r\n\t}",
"function wp_set_internal_encoding()\n {\n }",
"abstract public function hasUTF();",
"function getHeader($ch, $header) {\n $i = strpos($header, ':');\n if (!empty($i)) {\n $key = str_replace('-', '_', strtolower(substr($header, 0, $i)));\n $value = trim(substr($header, $i + 2));\n $this->http_header[$key] = $value;\n }\n return strlen($header);\n }",
"public function setUTF()\n {\n return false;\n }",
"public function getHeaderString() {\n return $this->getPayload(FALSE);\n }",
"protected function dumpHeader() {}",
"public function SecureHeader($str) {\n\t $str = str_replace(\"\\r\", '', $str);\n\t $str = str_replace(\"\\n\", '', $str);\n\t return trim($str);\n\t}",
"public function getHeader()\n {\n return <<<EOF\n<info>\nWW WW UU UU RRRRRR FFFFFFF LL \nWW WW UU UU RR RR FF LL \nWW W WW UU UU RRRRRR FFFF LL \n WW WWW WW UU UU RR RR FF LL \n WW WW UUUUU RR RR FF LLLLLLL \n \n</info>\n\nEOF;\n\n}",
"function readUTF();",
"public function getContentEncoding();",
"function getHeader($ch, $header) {\r\n $i = strpos($header, ':');\r\n if (!empty($i)) {\r\n $key = str_replace('-', '_', strtolower(substr($header, 0, $i)));\r\n $value = trim(substr($header, $i + 2));\r\n $this->http_header[$key] = $value;\r\n }\r\n return strlen($header);\r\n }",
"public function encodeHeader($str, $position = 'text')\n {\n }",
"function TxtEncoding4Soap($txt){\r\n $to = $GLOBALS[\"POSTA_SECURITY\"]->Security->configuration['charset'];\r\n return iconv('UTF-8',$to, $txt);\r\n}",
"public function get_encoding()\n {\n }",
"function getHeader($ch, $header) {\n\t\t\t$i = strpos($header, ':');\n\t\t\tif (!empty($i)) {\n\t\t\t\t$key = str_replace('-', '_', strtolower(substr($header, 0, $i)));\n\t\t\t\t$value = trim(substr($header, $i + 2));\n\t\t\t\t$this->http_header[$key] = $value;\n\t\t\t}\n\t\t\treturn strlen($header);\n\t\t}",
"function getHeader($ch, $header) {\n $i = strpos($header, ':');\n if (!empty($i)) {\n $key = str_replace('-', '_', strtolower(substr($header, 0, $i)));\n $value = trim(substr($header, $i + 2));\n $this->http_header[$key] = $value;\n }\n return strlen($header);\n }",
"function getHeader($ch, $header) {\n\t\t$i = strpos($header, ':');\n\t\tif (!empty($i)) {\n\t\t\t$key = str_replace('-', '_', strtolower(substr($header, 0, $i)));\n\t\t\t$value = trim(substr($header, $i + 2));\n\t\t\t$this->http_header[$key] = $value;\n\t\t}\n\t\treturn strlen($header);\n\t}",
"function use8Bit() {\n\t\tparent::use8Bit();\n\t\tif ($this->flowedFormat) {\n\t\t\t$this->plain_text_header = 'Content-Type: text/plain; charset='.$this->charset.'; format=flowed'.$this->linebreak.'Content-Transfer-Encoding: 8bit';\n\t\t}\n\t}",
"public function getFullHeader()\n {\n }",
"public function getHeaderRaw(string $name): string;",
"function getHeader($ch, $header) {\n\t\t$i = strpos($header, ':');\n\t\tif (!empty($i)) {\n\t\t\t$key = str_replace('-', '_', strtolower(substr($header, 0, $i)));\n\t\t\t$value = trim(substr($header, $i + 2));\n\t\t\t$this->http_header[$key] = $value;\n\t\t}\n\t\t\n\t\treturn strlen($header);\n\t}",
"function si_mysql_client_encoding() {\r\n\t\tif (function_exists('mysql_client_encoding')) return mysql_client_encoding();\r\n\t\telse return \"\";\r\n\t}",
"public function format_for_header()\n {\n }",
"public static function B64Header($str,$charset='UTF-8')\n\t{\n\t\tif (!preg_match('/[^\\x00-\\x3C\\x3E-\\x7E]/',$str)) {\n\t\t\treturn $str;\n\t\t}\n\t\t\n\t\treturn '=?'.$charset.'?B?'.base64_encode($str).'?=';\n\t}",
"function sql_client_encoding($dbh=NULL)\n {\n //not implemented\n global $SQL_DBH;\n if (is_null($dbh))\n return '';\n else\n return '';\n }",
"public static function ascii() {}",
"function getHeader($ch, $header) {\n\t\t$i = strpos ( $header, ':' );\n\t\tif (! empty ( $i )) {\n\t\t\t$key = str_replace ( '-', '_', strtolower ( substr ( $header, 0, $i ) ) );\n\t\t\t$value = trim ( substr ( $header, $i + 2 ) );\n\t\t\t$this->http_header [$key] = $value;\n\t\t}\n\t\treturn strlen ( $header );\n\t}",
"function encodeRequestHeaders($headers) \n {\n return null;\n }",
"function mb_internal_encoding($charset='')\n {\n }",
"public function getAcceptEncoding(): string\n {\n $headers = $this->getHeaders();\n return isset($headers[HeadersInterface::ACCEPT_ENCODING])\n ? $headers[HeadersInterface::ACCEPT_ENCODING]\n : '';\n }",
"function getHeaderCharset($connection, $msgnum) {\n $headerString = imap_fetchheader($connection, $msgnum);\n $headers = explode(\"\\n\", $headerString);\n for($i = 0; $i < count($headers); $i++)\n if(preg_match(\"/charset=(.*)\\r/\", $headers[$i], $matches))\n\treturn $matches[1];\n\n return \"\";\n}",
"public function getHeaderString () {\n\t\t$headers = array();\n\t\tforeach ($this->_headers as $name => $value) {\n\t\t $headers[] = $name . \": \" . $value;\n\t\t}\n\t\treturn implode(\"\\r\\n\", $headers);\n\t}",
"private function normalizeHeader(string $header): string\n {\n return ucwords($header, '-');\n }",
"public function getHeader() {\n\t\tif (!empty($this->header)) {\n\t\t\t$this->header = preg_replace('%(\\r\\n|\\r|\\n)%', self::$crlf, $this->header);\n\t\t}\n\t\t\n\t\t$this->header .=\n\t\t\t'X-Priority: 3'.self::$crlf\n\t\t\t.'X-Mailer: WoltLab Community Framework Mail Package'.self::$crlf\t\t\t\t\t\t\t\t\t\n\t\t\t.'MIME-Version: 1.0'.self::$crlf\n\t\t\t.'From: '.$this->getFrom().self::$crlf\n\t\t\t.($this->getCCString() != '' ? 'CC:'.$this->getCCString().self::$crlf : '')\n\t\t\t.($this->getBCCString() != '' ? 'BCC:'.$this->getBCCString().self::$crlf : '');\t\t\t\t\t\n\t\t\t\n\t\tif (count($this->getAttachments())) {\n\t\t\t$this->header .= 'Content-Transfer-Encoding: 8bit'.self::$crlf;\n\t\t\t$this->header .= 'Content-Type: multipart/mixed;'.self::$crlf;\n\t\t\t$this->header .= \"\\tboundary=\".'\"'.$this->getBoundary().'\";'.self::$crlf;\n\t\t}\n\t\telse {\n\t\t\t$this->header .= 'Content-Transfer-Encoding: 8bit'.self::$crlf;\n\t\t\t$this->header .= 'Content-Type: '.$this->getContentType().'; charset='.CHARSET.self::$crlf;\n\t\t}\n\t\t\n\t\treturn $this->header;\n\t}",
"public static function QPHeader($str,$charset='UTF-8')\n\t{\n\t\tif (!preg_match('/[^\\x00-\\x3C\\x3E-\\x7E]/',$str)) {\n\t\t\treturn $str;\n\t\t}\n\t\t\n\t\treturn '=?'.$charset.'?Q?'.text::QPEncode($str).'?=';\n\t}",
"public function getHeader() {\n }",
"public function getEncoding(): string;",
"function seems_utf8($str)\n {\n }",
"public function getHeaderData() {}",
"public function testAscii3()\n {\n $this->assertEquals(Str::ascii('arrête'), 'arrete');\n }",
"function getContentCharset(){ return $this->_ContentCharset;}",
"private function setHeaders()\n\t{\n\t\theader(\"Cache-Control: must-revalidate, max-age=12000\");\n\t\theader(\"Vary: Accept-Encoding\");\n\t\theader('Content-Type: text/plain; charset=utf-8');\n\t}",
"public static function encode_mimeheader($str) {\n $length = 45;\n $pos = 0;\n $max = strlen($str);\n\n while ($pos < $max) {\n if ($pos + $length < $max) {\n $adjust = 0;\n\n while (intval(ord($str[$pos + $length + $adjust]) & 0xC0) == 0x80)\n $adjust--;\n\n $buffer .= ($buffer == '' ? '' : \"?=\\n =?UTF-8?B?\") . base64_encode(substr($str, $pos, $length + $adjust));\n $pos = $pos + $length + $adjust;\n } else {\n $buffer .= ($buffer == '' ? '' : \"?=\\n =?UTF-8?B?\") . base64_encode(substr($str, $pos));\n $pos = $max;\n }\n }\n\n return '=?UTF-8?B?' . $buffer . '?=';\n }",
"static public function headerValue($label, $value, $charset = 'utf-8',\n $crlf = \"\\r\\n\", $len = 75)\n {\n // remove all instances of newline-with-space to unwrap lines\n $value = preg_replace('/(\\r\\n|\\r|\\n)([ \\t]+)/m', '', $value);\n \n // remove all control chars from the unwrapped line, including newlines.\n $value = preg_replace('/[\\x00-\\x1F]/', '', $value);\n \n // also remove urlencode() equivalents.\n $value = preg_replace('/%[0-1][0-9A-Fa-f]/', '', $value);\n \n // now do the encoding\n $hdr_vals = preg_split(\"/(\\s)/\", $value, -1, PREG_SPLIT_DELIM_CAPTURE);\n \n $value_out = \"\";\n $previous = \"\";\n foreach ($hdr_vals as $hdr_val) {\n \n if (trim($hdr_val) == '') {\n // whitespace needs to be handled with another string, or it\n // won't show between encoded strings. Prepend this to the next\n // item.\n $previous .= $hdr_val;\n continue;\n } else {\n $hdr_val = $previous . $hdr_val;\n $previous = \"\";\n }\n \n // any non-ascii characters?\n if (preg_match('/[\\x80-\\xFF]{1}/', $hdr_val)){\n \n // Check if there is a double quote at beginning or end of the string to \n // prevent that an open or closing quote gets ignored because its encapsuled\n // by an encoding prefix or suffix. \n // \n // Remove the double quote and set the specific prefix or suffix variable\n // so later we can concat the encoded string and the double quotes back \n // together to get the intended string.\n $quotePrefix = $quoteSuffix = '';\n if ($hdr_val{0} == '\"') {\n $hdr_val = substr($hdr_val, 1);\n $quotePrefix = '\"';\n }\n \n if ($hdr_val{strlen($hdr_val)-1} == '\"') {\n $hdr_val = substr($hdr_val, 0, -1);\n $quoteSuffix = '\"';\n }\n \n // This header contains non ASCII chars and should be encoded\n // using quoted-printable. Dynamically determine the maximum\n // length of the strings.\n $prefix = '=?' . $charset . '?Q?';\n $suffix = '?=';\n \n // The -2 is here so the later regexp doesn't break any of\n // the translated chars. The -2 on the first line-regexp is\n // to compensate for the \": \" between the header-name and the\n // header value.\n $maxLength = $len - strlen($prefix . $suffix) - 2;\n $maxLength1stLine = $maxLength - strlen($label) - 2;\n \n // Replace all special characters used by the encoder.\n $search = array(\"=\", \"_\", \"?\", \" \");\n $replace = array(\"=3D\", \"=5F\", \"=3F\", \"_\");\n $hdr_val = str_replace($search, $replace, $hdr_val);\n \n // Replace all extended characters (\\x80-xFF) with their\n // ASCII values.\n $hdr_val = preg_replace_callback(\n '/([\\x80-\\xFF])/',\n array('Solar_Mime', '_qpReplace'),\n $hdr_val\n );\n \n // This regexp will break QP-encoded text at every $maxLength\n // but will not break any encoded letters.\n $reg1st = \"|(.{0,$maxLength1stLine})[^\\=]|\";\n $reg2nd = \"|(.{0,$maxLength})[^\\=]|\";\n \n // Concat the double quotes if existant and encoded string together\n $hdr_val = $quotePrefix . $hdr_val . $quoteSuffix;\n \n // Begin with the regexp for the first line.\n $reg = $reg1st;\n \n // Prevent lines that are just way too short.\n if ($maxLength1stLine > 1){\n $reg = $reg2nd;\n }\n \n $output = \"\";\n while ($hdr_val) {\n // Split translated string at every $maxLength.\n // Make sure not to break any translated chars.\n $found = preg_match($reg, $hdr_val, $matches);\n \n // After this first line, we need to use a different\n // regexp for the first line.\n $reg = $reg2nd;\n \n // Save the found part and encapsulate it in the\n // prefix & suffix. Then remove the part from the\n // $hdr_val variable.\n if ($found){\n $part = $matches[0];\n $hdr_val = substr($hdr_val, strlen($matches[0]));\n }else{\n $part = $hdr_val;\n $hdr_val = \"\";\n }\n \n // RFC 2047 specifies that any split header should be\n // separated by a CRLF SPACE. \n if ($output){\n $output .= \"$crlf \";\n }\n \n $output .= $prefix . $part . $suffix;\n }\n \n $hdr_val = $output;\n }\n \n $value_out .= $hdr_val;\n }\n \n return $value_out;\n }",
"public function secureHeader($str)\n {\n return trim(str_replace(array(\"\\r\", \"\\n\"), '', $str));\n }",
"protected function getCharsetConversion() {}",
"public function setCharsetAlsoUpdatesContentTypeHeaderIfSpaceIsMissing()\n {\n $message = $this->getAbstractMessageMock();\n\n $message->setHeader('Content-Type', 'text/plain;charset=UTF-16');\n $message->setCharset('ISO-8859-1');\n $this->assertEquals('text/plain; charset=ISO-8859-1', $message->getHeader('Content-Type'));\n }",
"protected function validateHeader(string $input = null): bool\n {\n return ($input === str_ireplace([\"\\r\", \"\\n\", '%0A', '%0D'], '', $input));\n }",
"private function canonicalizeHeaders() {\r\n\t\t$canonicalized_headers = [];\r\n\t\tforeach ($this->headers as $key => $value) {\r\n\t\t\t$canonicalized_headers[strtolower($key)] = preg_replace('/\\s+/', ' ', trim($value));\r\n\t\t}\r\n\r\n\t\tksort($canonicalized_headers);\r\n\r\n\t\t$serialized_header = '';\r\n\t\tforeach ($canonicalized_headers as $key => $value) {\r\n\t\t\t$serialized_header .= $key . ':' . $value . \"\\t\";\r\n\t\t}\r\n\t\t$this->verbose('headers', $this->headers);\r\n\t\t$this->verbose('canonicalized_headers', $canonicalized_headers);\r\n\t\t$this->verbose('serialized_header', str_replace(\"\\t\", \"\\\\t\", $serialized_header));\r\n\r\n\t\treturn $serialized_header;\r\n\t}",
"public function testEncodingAsciiCharactersProducesValidToken()\n {\n $string = '';\n foreach (range(0x00, 0x7F) as $octet) {\n $char = pack('C', $octet);\n $string .= $char;\n }\n $encoder = new Rfc2231Encoder();\n $encoded = $encoder->encodeString($string);\n\n foreach (explode(\"\\r\\n\", $encoded) as $line) {\n $this->assertMatchesRegularExpression($this->rfc2045Token, $line, 'Encoder should always return a valid RFC 2045 token.');\n }\n }",
"protected function _writeFileHeader() {}",
"function processName($name) {\n//\tUncomment the next two lines and change only ISO-8859-9 to your site encoding type\n\n//\t$name = iconv(\"UTF-8\", \"ISO-8859-1\", $name);\n//\t$name = iconv(\"ISO-8859-9\", \"UTF-8\", $name);\n\n\treturn $name;\n}",
"public function import_read_header()\n\t{\n // phpcs:enable\n\t\treturn 0;\n\t}",
"public function testEqualsAndQuestionAndUnderscoreAreEncoded()\n {\n $encoder = new QpMimeHeaderEncoder();\n $this->assertEquals('=3D=3F=5F', $encoder->encodeString('=?_'), 'Chars =, ? and _ (underscore) may not appear as per RFC 2047.');\n }",
"public function getHeaderString(): string\n {\n $parts = [\n $this->name . '=' . rawurlencode($this->value),\n $this->getMaxAgeString(),\n $this->getExpiresString(),\n $this->getDomainString(),\n $this->getPathString(),\n $this->getSecureString(),\n $this->getHttpOnlyString(),\n $this->getDomainString(),\n $this->getSameSiteString()\n ];\n \n // in this case, there is no callback supplied,\n // so all entries of array equal to FALSE will be removed\n $filteredParts = array_filter($parts);\n \n return implode('; ', $filteredParts);\n }",
"public static function encodeMIMEHeader($string) {\n\t\tif (function_exists('mb_encode_mimeheader')) {\n\t\t\t$string = mb_encode_mimeheader($string, CHARSET, 'Q', Mail::$crlf);\n\t\t}\n\t\telse {\n\t\t\t$string = '=?'.CHARSET.'?Q?'.preg_replace('/[^\\r\\n]{73}[^=\\r\\n]{2}/', \"$0=\\r\\n\", str_replace(\"%\", \"=\", str_replace(\"%0D%0A\", \"\\r\\n\", str_replace(\"%20\", \" \", rawurlencode($string))))).'?=';\n\t\t}\n\t\t\n\t\treturn $string;\n\t}",
"protected function headerAdditional() {\n return '';\n }",
"function _generateHeaderInfo()\n {\n return '0504';\n }",
"public function isUTF()\n {\n return $this->utf;\n }",
"function send_nosniff_header()\n {\n }",
"protected function dumpHeader() {\n\t\treturn trim('\n# TYPO3 Extension Manager dump 1.1\n#\n#--------------------------------------------------------\n');\n\t}",
"protected function makeTextPlainContentTypeWithCharsetHeaderString() {\n\t\treturn 'Content-type: text/plain; charset=\"' . $this->_mailCharset . '\" ' . $this->_endString;\n\t}",
"public function getHeader(): string\n {\n return $this->header;\n }",
"public abstract function getContentTransferEncoding();",
"public function getHeader(string $header): string;",
"public function testSpaceAndTabNeverAppear()\n {\n\n $encoder = new QpMimeHeaderEncoder();\n $this->assertDoesNotMatchRegularExpression('~[ \\t]~', $encoder->encodeString(\"a \\t b\"), 'encoded-words in headers cannot contain LWSP as per RFC 2047.');\n }",
"function encode_email_header($text, $charset = 'utf-8', $force_encode = false, $quoted_string = true)\n\t{\n\t\t$text = trim($text);\n\n\t\tif (!$charset)\n\t\t{\n\t\t\t// don't know how to encode, so we can't\n\t\t\treturn $text;\n\t\t}\n\n\t\tif ($force_encode == true)\n\t\t{\n\t\t\t$qp_encode = true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$qp_encode = false;\n\n\t\t\tfor ($i = 0; $i < strlen($text); $i++)\n\t\t\t{\n\t\t\t\tif (ord($text{$i}) > 127)\n\t\t\t\t{\n\t\t\t\t\t// we have a non ascii character\n\t\t\t\t\t$qp_encode = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ($qp_encode == true)\n\t\t{\n\t\t\t// see rfc 2047; not including _ as allowed here, as I'm encoding spaces with it\n\t\t\t$outtext = preg_replace('#([^a-zA-Z0-9!*+\\-/= ])#e', \"'=' . strtoupper(dechex(ord(str_replace('\\\\\\\"', '\\\"', '\\\\1'))))\", $text);\n\t\t\t$outtext = str_replace(' ', '_', $outtext);\n\t\t\t$outtext = \"=?$charset?q?$outtext?=\";\n\t\t\treturn $outtext;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif ($quoted_string)\n\t\t\t{\n\t\t\t\t$text = str_replace(array('\"', '(', ')'), array('\\\"', '\\(', '\\)'), $text);\n\t\t\t\treturn \"\\\"$text\\\"\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn preg_replace('#(\\r\\n|\\n|\\r)+#', ' ', $text);\n\t\t\t}\n\t\t}\n\t}",
"protected function makeUserAgentHeaderString() {\n\t\treturn 'User-Agent: ' . $this->_mailMailer . $this->_endString;\n\t}",
"public function getHeader($name = null) {}",
"function ezafi_form($s) {\n if (substr($s, -2) == \"\\xd9\\x87\") // HEH\n return $s.\"\\xe2\\x80\\x8c\\xdb\\x8c\"; // ZWNJ+YEH\n else\n return $s;\n}",
"private function detect_encoding( $str ) {\r\n }",
"public function secureHeader($str)\n {\n }",
"public static function getHeader($name = null) {}",
"public function isASCII() {\r\n return strlen($this->contents) === strlen(utf8_decode($this->contents));\r\n }",
"private static function encodeHeaderBase64($string, $charset)\n {\n if (! function_exists('mb_strlen') || ! function_exists('mb_substr')) {\n trigger_error('encodeHeaderBase64: Required mbstring functions are missing.', E_USER_WARNING);\n return false;\n }\n $aRet = array();\n /**\n * header length = 75 symbols max (same as in encodeHeader)\n * remove $charset length\n * remove =? ? ?= (5 chars)\n * remove 2 more chars (\\r\\n ?)\n */\n $iMaxLength = 75 - strlen($charset) - 7;\n // set first character position\n $iStartCharNum = 0;\n // loop through all characters. count characters and not bytes.\n $encoded_string = '';\n for ($iCharNum = 1; $iCharNum <= mb_strlen($string, $charset); $iCharNum ++) {\n // encode string from starting character to current character.\n $encoded_string = base64_encode(mb_substr($string, $iStartCharNum, $iCharNum - $iStartCharNum, $charset));\n // Check encoded string length\n if (strlen($encoded_string) > $iMaxLength) {\n // if string exceeds max length, reduce number of encoded characters and add encoded string part to array\n $aRet[] = base64_encode(mb_substr($string, $iStartCharNum, $iCharNum - $iStartCharNum - 1, $charset));\n // set new starting character\n $iStartCharNum = $iCharNum - 1;\n // encode last char (in case it is last character in string)\n $encoded_string = base64_encode(mb_substr($string, $iStartCharNum, $iCharNum - $iStartCharNum, $charset));\n } // if string is shorter than max length - add next character\n }\n // add last encoded string to array\n $aRet[] = $encoded_string;\n // set initial return string\n $sRet = '';\n foreach ($aRet as $string) {\n // TODO: Do we want to control EOL (end-of-line) marker\n if ($sRet != '')\n $sRet .= \" \";\n // add header tags and encoded string to return string\n $sRet .= '=?' . $charset . '?B?' . $string . '?=';\n }\n return $sRet;\n }"
] | [
"0.69946504",
"0.6603817",
"0.6535022",
"0.6458076",
"0.63613373",
"0.6360484",
"0.6315589",
"0.6218422",
"0.6179385",
"0.60419637",
"0.6038768",
"0.5962153",
"0.5947779",
"0.5932633",
"0.59303796",
"0.59114623",
"0.59114623",
"0.58985394",
"0.5868906",
"0.5862538",
"0.5848244",
"0.5848244",
"0.5848244",
"0.5840135",
"0.58334076",
"0.5832893",
"0.5828216",
"0.581547",
"0.58035254",
"0.5755722",
"0.5746712",
"0.57329255",
"0.57318336",
"0.57213414",
"0.57169145",
"0.5716635",
"0.57104725",
"0.571042",
"0.57081276",
"0.5694294",
"0.56807727",
"0.56736743",
"0.56716806",
"0.56672734",
"0.56626385",
"0.5657126",
"0.5644989",
"0.5641397",
"0.56400937",
"0.563282",
"0.5604259",
"0.5602039",
"0.5584407",
"0.5562023",
"0.55588436",
"0.5550978",
"0.5546733",
"0.55388945",
"0.5538063",
"0.55277526",
"0.55223894",
"0.5520852",
"0.55070126",
"0.549016",
"0.5489035",
"0.5487904",
"0.5468973",
"0.54662764",
"0.54542005",
"0.5444848",
"0.54424673",
"0.54359955",
"0.5432273",
"0.542671",
"0.54260373",
"0.54254043",
"0.54233366",
"0.54187816",
"0.54150075",
"0.54134506",
"0.5412817",
"0.5408532",
"0.539794",
"0.53949565",
"0.5388725",
"0.53853816",
"0.53826535",
"0.5381967",
"0.5379484",
"0.53787875",
"0.53787214",
"0.5378369",
"0.53766584",
"0.5372429",
"0.5372293",
"0.53697646",
"0.53684306",
"0.5358422",
"0.5351738",
"0.5349372",
"0.5344174"
] | 0.0 | -1 |
Set the content disposition. | public function setDisposition($disposition)
{
switch ($disposition) {
case 'inline':
case 'attachment':
break;
default:
throw new InvalidArgumentException(
sprintf(
'%s expects to be "inline" or "attachment". Received "%s"',
__METHOD__,
(string) $disposition
)
);
break;
}
$this->disposition = $disposition;
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setDisposition($disposition) {\n\t\t$this->disposition = $disposition;\n\t}",
"public static function getContentDisposition() {}",
"public abstract function getContentDisposition();",
"public function setContentDisposition($disposition, $filename)\n {\n $dispositionHeader = $this->headers->makeDisposition($disposition, $filename);\n $this->headers->set('Content-Disposition', $dispositionHeader);\n\n return $this;\n }",
"public static function setContentDisposition($filename, $inline = null) {}",
"public function setDisposition($disposition)\n {\n $this->disposition = strtolower($disposition);\n return $this;\n }",
"protected function getContentDispositionAttachment() {\n // Encode the filename according to RFC2047.\n return 'attachment; filename=\"' . mb_encode_mimeheader($this->getBasename()) . '\"';\n }",
"function http_send_content_disposition($filename, $inline = null) {}",
"public function setContentDisposition(string $type): ?ContentDisposition\n {\n if (!in_array(\n $type,\n [\n \"inline\",\n \"attachment\"\n ]\n )\n ) {\n throw new UserException(\"Invalid value for header: Content-Disposition\");\n }\n $contentDisposition = new ContentDisposition($type);\n $this->contentDisposition = $contentDisposition;\n return $contentDisposition;\n }",
"public function __construct(string $disposition)\n {\n parent::__construct('Content-Disposition', $disposition);\n }",
"public function setContentType($val){ return $this->setHeader('Content-Type',$val); }",
"public function getDisposition()\n {\n return $this->disposition;\n }",
"public function getDisposition()\n {\n return $this->disposition;\n }",
"public function getContentDisposition()\n\t{\n\t\t$contentDisposition = $this->get(\"Content-Disposition\");\n\t\tif ($contentDisposition !== null)\n\t\t{\n\t\t\t$parts = explode(\";\", $contentDisposition);\n\n\t\t\treturn trim($parts[0]);\n\t\t}\n\n\t\treturn null;\n\t}",
"public function setDownload($filename = false)\n {\n $download = \"attachment;\";\n if ($filename) {\n $download .= \"filename='\" . $filename . \"'\";\n }\n $this['response']->setHeader(\"Content-Disposition\", $download);\n }",
"public function set_content_type($mime);",
"public function set_content_type($mime);",
"public function getDisposition() {\n\t\treturn $this->disposition;\n\t}",
"public static function getContentDisposition( $disposition='attachment', $filename=NULL )\n\t{\n\t\tif( $filename === NULL )\n\t\t{\n\t\t\treturn $disposition;\n\t\t}\n\n\t\t$return\t= $disposition . '; filename';\n\n\t\tif ( !\\IPS\\Dispatcher::hasInstance() )\n\t\t{\n\t\t\t\\IPS\\Session\\Front::i();\n\t\t}\n\t\t\n\t\tswitch( \\IPS\\Session::i()->userAgent->useragentKey )\n\t\t{\n\t\t\tcase 'firefox':\n\t\t\tcase 'opera':\n\t\t\t\t$return\t.= \"*=UTF-8''\" . rawurlencode( $filename );\n\t\t\tbreak;\n\n\t\t\tcase 'explorer':\n\t\t\t//case 'chrome':\n\t\t\t\t$return\t.= '=\"' . rawurlencode( $filename ) . '\"';\n\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\t$return\t.= '=\"' . $filename . '\"';\n\t\t\tbreak;\n\t\t}\n\n\t\treturn $return;\n\t}",
"private function setHeaders($response)\n {\n $dispositionHeader = $response->headers->makeDisposition(\n ResponseHeaderBag::DISPOSITION_ATTACHMENT,\n $this->filename\n );\n $response->headers\n ->set('Content-Type', 'text/' . ($this->isCSVExport() ? 'csv' : 'vnd.ms-excel') . '; charset=utf-8');\n $response->headers->set('Pragma', 'public');\n $response->headers->set('Cache-Control', 'maxage=1');\n $response->headers->set('Content-Disposition', $dispositionHeader);\n }",
"public function addAttachment($content, $name, $content_type, $content_disposition);",
"public function setContentType($value)\n {\n $this->headers['Content-Type'] = $this->fixContentType($value);\n }",
"public static function setContentType($content_type) {}",
"function set_content_type($type) {\n $this->response->add_header('Content-Type', $type);\n }",
"protected function setHttpHeaders($type, $name, $mime, $encoding = 'utf-8')\n {\n Yii::$app->response->format = Response::FORMAT_RAW;\n if (strstr($_SERVER[\"HTTP_USER_AGENT\"], \"MSIE\") == false) {\n header(\"Cache-Control: no-cache\");\n header(\"Pragma: no-cache\");\n } else {\n header(\"Cache-Control: must-revalidate, post-check=0, pre-check=0\");\n header(\"Pragma: public\");\n }\n header(\"Expires: Sat, 26 Jul 1979 05:00:00 GMT\");\n header(\"Content-Encoding: {$encoding}\");\n header(\"Content-Type: {$mime}; charset={$encoding}\");\n header(\"Content-Disposition: attachment; filename={$name}.{$type}\");\n header(\"Cache-Control: max-age=0\");\n }",
"public static function setContentType($contentType, $charset = 'UTF-8') {\n self::replaceHeader(\"Content-type: $contentType; charset=$charset\");\n }",
"public function setCharset(string $charset): Attachment;",
"public function setContentType($content_type) {}",
"public function setRequestDisposition($v)\n\t{\n\t\tif ($v !== null) {\n\t\t\t$v = (string) $v;\n\t\t}\n\n\t\tif ($this->request_disposition !== $v) {\n\t\t\t$this->request_disposition = $v;\n\t\t\t$this->modifiedColumns[] = VpoRequestPeer::REQUEST_DISPOSITION;\n\t\t}\n\n\t\treturn $this;\n\t}",
"protected function makeFileContentDispositionHeaderString($fileName, $disposition='attachment') {\n\t\treturn 'Content-Disposition: ' . $disposition . '; filename=\"' . $fileName . '\" ' . $this->_endString;\n\t}",
"public function setContentType($contentType)\n {\n header(\"Content-Type: $contentType\");\n }",
"public function setContentType ($type) {\r\n\t\t$this->content_type = Headers::getMimeType($type) ?: $type;\r\n\t}",
"public function set_content_type($mime) {\n $this->content_type = $mime;\n }",
"public function setContentType($content_type);",
"private function sendHttpHeaders(): void\n {\n // grab content disposition\n $disposition = $this->contentDisposition;\n\n if ($this->outputName) {\n // Various different browsers dislike various characters here. Strip them all for safety.\n $safeOutput = trim(str_replace(['\"', \"'\", '\\\\', ';', \"\\n\", \"\\r\"], '', $this->outputName));\n\n // Check if we need to UTF-8 encode the filename\n $urlencoded = rawurlencode($safeOutput);\n $disposition .= \"; filename*=UTF-8''{$urlencoded}\";\n }\n\n $headers = [\n 'Content-Type' => $this->contentType,\n 'Content-Disposition' => $disposition,\n 'Pragma' => 'public',\n 'Cache-Control' => 'public, must-revalidate',\n 'Content-Transfer-Encoding' => 'binary',\n ];\n\n foreach ($headers as $key => $val) {\n ($this->httpHeaderCallback)(\"$key: $val\");\n }\n }",
"public function setCharsetSetsTheCharsetAndAlsoUpdatesContentTypeHeader()\n {\n $message = $this->getAbstractMessageMock();\n $message->setHeader('Content-Type', 'text/html; charset=UTF-8');\n\n $message->setCharset('UTF-16');\n $this->assertEquals('text/html; charset=UTF-16', $message->getHeader('Content-Type'));\n\n $message->setHeader('Content-Type', 'text/plain; charset=UTF-16');\n $message->setCharset('ISO-8859-1');\n $this->assertEquals('text/plain; charset=ISO-8859-1', $message->getHeader('Content-Type'));\n\n $message->setHeader('Content-Type', 'image/png');\n $message->setCharset('UTF-8');\n $this->assertEquals('image/png', $message->getHeader('Content-Type'));\n\n $message->setHeader('Content-Type', 'Text/Plain');\n $this->assertEquals('Text/Plain; charset=UTF-8', $message->getHeader('Content-Type'));\n }",
"public function setContentType($value)\n {\n $this->_headers[ODataConstants::HTTPRESPONSE_HEADER_CONTENTTYPE] \n = $value;\n }",
"public function setContentType(string $contentType): Attachment;",
"private function __set_backup_download_header()\n {\n header(\"Pragma: public\");\n header(\"Content-Type: application/octet-stream\");\n header(\"Content-Disposition: attachment; filename=\".$this->__requested_data[\"time\"].\".zip\");\n }",
"public function setContentType($type)\r\n {\r\n $this->repo['header']['Content-Type'] = $type;\r\n }",
"public function setContentType($contentType)\n {\n $this->app->response->headers->set('Content-Type', $contentType);\n }",
"public static function pdf_disposition_header($y_filename='file.pdf', $y_disp='inline') {\n\t//--\n\tswitch((string)$y_disp) {\n\t\tcase 'attachment':\n\t\t\t$y_disp = 'attachment';\n\t\t\tbreak;\n\t\tcase 'inline':\n\t\tdefault:\n\t\t\t$y_disp = 'inline';\n\t} //end switch\n\t//--\n\treturn (string) $y_disp.'; filename=\"'.Smart::safe_filename($y_filename).'\"';\n\t//--\n}",
"public function sendFile($fileName, $content, $mimeType = null, $terminate = true, $attachment = true)\n {\n if (!$attachment) {\n $removeDispositionHeaderFunc = function () {\n header_remove('Content-Disposition');\n };\n if ($terminate) {\n Yii::app()->response->attachEventHandler('onBeforeEndRequest', $removeDispositionHeaderFunc);\n }\n }\n\n if ($mimeType === null) {\n $mimeType = $this->detectMimeType($fileName, $content);\n }\n\n parent::sendFile($fileName, $content, $mimeType, $terminate);\n\n if (!$attachment) {\n $removeDispositionHeaderFunc();\n }\n }",
"public function setContentType($contentType);",
"public function setContentType($contentType);",
"protected function _setContentType() {\n\t\tif (in_array($this->_status, array(304, 204))) {\n\t\t\treturn;\n\t\t}\n\t\t$whitelist = array(\n\t\t\t'application/javascript', 'application/json', 'application/xml', 'application/rss+xml'\n\t\t);\n\n\t\t$charset = false;\n\t\tif ($this->_charset &&\n\t\t\t(strpos($this->_contentType, 'text/') === 0 || in_array($this->_contentType, $whitelist))\n\t\t) {\n\t\t\t$charset = true;\n\t\t}\n\n\t\tif ($charset) {\n\t\t\t$this->header('Content-Type', \"{$this->_contentType}; charset={$this->_charset}\");\n\t\t} else {\n\t\t\t$this->header('Content-Type', \"{$this->_contentType}\");\n\t\t}\n\t}",
"public function setContentType($mimeType = 'application/octet-stream', $charset = null)\n {\n $this->mimeType = $mimeType;\n $this->charset = $charset;\n return self::$downloadObj;\n }",
"function sentFile($nombre, $contenido, $mimetype=\"text/plain\"){\n\t\theader(\"Content-type: $mimetype; charset=UTF-8 \");\n\t\theader(\"Content-Disposition: attachment; filename=\".$nombre);\n\t\theader(\"Pragma: no-cache\");\n\t\theader(\"Expires: 0\");\n\t\t\n\t\texit($contenido);\n\t}",
"private function configureResponseForDownload($filename)\n {\n // For some reason, Zend won't allow me to remove these headers\n header('Pragma: ');\n header('Cache-Control: ');\n\n $this\n ->getResponse()\n ->setHeader('Content-Type', 'application/octet-stream')\n ->setHeader('Content-Disposition', sprintf('attachment; filename=\"%s\"', $filename))\n ;\n }",
"protected function getPartContentDisposition($part)\r\n\t{\r\n\t\tif (isset($part['content-disposition'])) {\r\n\t\t\treturn $part['content-disposition'];\r\n\t\t}\r\n\t\treturn false;\r\n\t}",
"public function setContentType( string $type ) : void\n {\n $this->headers->set( 'Content-Type', $type );\n }",
"function http_set_content_type($content_type)\n\t{\n\t\t$this->http_content_type = $content_type;\n\t}",
"public function pi_set_content_type(){\n \treturn \"text/html\";\n\t}",
"public function setHeaderAddsCharsetToMediaTypeIfNoneWasSpecifiedAndTypeIsText()\n {\n $message = $this->getAbstractMessageMock();\n\n $message->setHeader('Content-Type', 'text/plain', true);\n $this->assertEquals('text/plain; charset=UTF-8', $message->getHeader('Content-Type'));\n\n $message->setHeader('Content-Type', 'text/plain', true);\n $message->setCharset('Shift_JIS');\n $this->assertEquals('text/plain; charset=Shift_JIS', $message->getHeader('Content-Type'));\n $this->assertEquals('Shift_JIS', $message->getCharset());\n\n $message->setHeader('Content-Type', 'image/jpeg', true);\n $message->setCharset('Shift_JIS');\n $this->assertEquals('image/jpeg', $message->getHeader('Content-Type'));\n }",
"private function setContentType($type = \"html\") \n\t{\n\t\theader('Content-type: application/'.$type);\n\t}",
"public function testComAdobeGraniteRestAssetsImplAssetContentDispositionFilter()\n {\n $client = static::createClient();\n\n $path = '/system/console/configMgr/com.adobe.granite.rest.assets.impl.AssetContentDispositionFilter';\n\n $crawler = $client->request('POST', $path);\n }",
"public function setCharsetUpdatesContentTypeHeaderAndLeavesAdditionalInformationIntact()\n {\n $message = $this->getAbstractMessageMock();\n\n $message->setHeader('Content-Type', 'text/plain; charSet=UTF-16; x-foo=bar');\n $message->setCharset('ISO-8859-1');\n $this->assertEquals('text/plain; charset=ISO-8859-1; x-foo=bar', $message->getHeader('Content-Type'));\n }",
"public function setMIMEHeader($headers)\n\t{\n\t\t$this->MIMEHeader = $headers;\n\t}",
"private function __setHeaderNotify($filePath){\r\n $response = new Phalcon\\Http\\Response();\r\n //$response->setHeader('Content-Type','application/vnd.ms-excel');\r\n $response->setHeader('Content-Type','application/octet-stream');\r\n $response->setHeader(\"Content-Disposition\",\"attachment;filename=\".basename($filePath));\r\n \r\n // If you're serving to IE over SSL, then the following may be needed\r\n $response->setHeader('Expires','Mon, 26 Jul 1997 05:00:00 GMT'); // Date in the past\r\n $response->setHeader('Last-Modified',gmdate('D, d M Y H:i:s').' GMT'); // always modified\r\n $response->setHeader('Cache-Control','cache, must-revalidate'); // HTTP/1.1\r\n $response->setHeader('Content-Length', filesize($filePath));\r\n $response->setHeader('Pragma','public'); // HTTP/1.0\r\n $response->sendHeaders();\r\n }",
"public function addContentEncoding(string $contentEncoding): void\n {\n if (!in_array(\n $contentEncoding,\n [\n \"gzip\",\n \"compress\",\n \"deflate\",\n \"identity\",\n \"br\"\n ]\n )\n ) {\n throw new UserException(\"Invalid value for header: Content-Disposition\");\n }\n $this->contentEncoding[] = $contentEncoding;\n }",
"function _header( $filename )\r\n {\r\n if ( function_exists( 'mb_http_output' ) ) {\r\n mb_http_output( 'pass' );\r\n }\r\n header( 'Content-Type: ' . $this -> mimetype );\r\n if ( preg_match( \"/MSIE ([0-9]\\.[0-9]{1,2})/\", $_SERVER['HTTP_USER_AGENT'] ) ) {\r\n header( 'Content-Disposition: inline; filename=\"' . $filename . '\"' );\r\n header( 'Expires: 0' );\r\n header( 'Cache-Control: must-revalidate, post-check=0, pre-check=0' );\r\n header( 'Pragma: public' );\r\n } else {\r\n header( 'Content-Disposition: attachment; filename=\"' . $filename . '\"' );\r\n header( 'Expires: 0' );\r\n header( 'Pragma: no-cache' );\r\n }\r\n }",
"public function setCharset($charset)\n {\n $this->headers->setAttribute(\"Content-Type\", \"charset\", $charset);\n if (($this->getEncoding() == \"7bit\") && (strtolower($charset) == \"utf-8\" || strtolower($charset) == \"utf8\")) $this->setEncoding(\"8bit\");\n }",
"public function setAttachment($filename) {\n\t\t$this->data['attachment'] = $filename;\n\t}",
"public function setCharsetAlsoUpdatesContentTypeHeaderIfSpaceIsMissing()\n {\n $message = $this->getAbstractMessageMock();\n\n $message->setHeader('Content-Type', 'text/plain;charset=UTF-16');\n $message->setCharset('ISO-8859-1');\n $this->assertEquals('text/plain; charset=ISO-8859-1', $message->getHeader('Content-Type'));\n }",
"public function setContentType(string $mimeType, string $charset = null): void\n {\n if (preg_match(\"/^(application|audio|example|font|image|model|text|video)\\/(.*)$/\", $mimeType)!==1) {\n throw new UserException(\"Invalid value for header: Content-Type\");\n }\n $this->contentType = $mimeType.($charset ? \"; charset=\".$charset : \"\");\n }",
"function setContentType($contentType) {\n\t\t$this->setData('content_type', $contentType);\n\t}",
"protected function sendHeader($filename) {\n\t\t\n\t\t$downloadType = tx_pttools_div::getTS('plugin.tx_ptlist.view.csv_rendering.fileHandlingType');\n\t\t\n\t\tif ($downloadType == '') {\n\t\t\t$downloadType = 'I';\n\t\t}\n tx_pttools_assert::isInList($downloadType, 'D,I', array('message' => 'Invalid download type'));\n\t\t\n\t\tswitch($downloadType)\n {\n case 'I':\n //We send to a browser\n header('Content-Type: text/x-csv');\n if(headers_sent())\n $this->Error('Some data has already been output to browser, can\\'t send CSV file');\n header('Content-disposition: inline; filename=\"'.$filename.'\"');\n break;\n\n case 'D':\n //Download file\n if(isset($_SERVER['HTTP_USER_AGENT']) && strpos($_SERVER['HTTP_USER_AGENT'],'MSIE'))\n header('Content-Type: application/force-download');\n else\n header('Content-Type: application/octet-stream');\n header('Content-disposition: attachment; filename=\"'.$filename.'\"');\n break;\n\n default:\n throw new tx_pttools_exceptionInternal('No valid download handling set for CSV file!');\n }\n\t\t\n\t}",
"public function sendResponse(){\n\t\theader( 'Content-Type:' . $this->getMimeType() );\n\t\t\n\t\t$encodedName = rawurlencode($this->getFilename());\n\t\tif (preg_match(\"/MSIE/\", $_SERVER[\"HTTP_USER_AGENT\"])){\n\t\t\theader(\n\t\t\t\t\t'Content-Disposition: attachment; filepath=\"' . $encodedName . '\"'\n\t\t\t\t\t);\n\t\t} else {\n\t\t\theader('Content-Disposition: attachment; filepath*=UTF-8\\'\\'' . $encodedName\n\t\t\t\t\t. '; filepath=\"' . $encodedName . '\"');\n\t\t}\n\t\t\n\t\theader('Content-Length: ' . $this->view->filesize($this->filepath));\n\n\t\t\\OC_Util::obEnd();\n\t\t $this->view->readfile($this->filepath);\n\t}",
"private function setContentType($key, $val){\n $trimedKey = trim($key);\n if(strcasecmp($trimedKey, CoreConstants::CONTENT_TYPE) == 0){\n $this->contentType = trim($val);\n }\n }",
"public function setContentType($type) {\n\n if (isset($this->headers['content-type'])) {\n\n // Preserve the charset in the content type\n $h = $this->headers['content-type'];\n $pos = strpos($h['value'], ';');\n\n if ($pos !== false) {\n $type = $type . substr($h['value'], $pos);\n }\n }\n\n $this->headers['content-type'] = array(\n 'name' => 'Content-type',\n 'value' => $type\n );\n\n return $this;\n }",
"public static function setDownloadDialog($originalPath, $filetype, $filename, $charset = \"utf-8\") {\n self::setContentType($filetype, $charset);\n header(\"Content-Disposition: attachment; filename=\\\"$filename\\\"\");\n readfile($originalPath);\n }",
"public function content_type() {\n\t\treturn \"application/vnd.ms-excel\";\n\t}",
"public function setContentType(string $value): self\n {\n $this->setHeader(\"Content-Type\", $value);\n return $this;\n }",
"public function contentType($type)\n {\n $this['response']->setHeader('Content-Type', $type);\n }",
"public function headers() {\n\t\theader('Pragma: public');\n\t\theader('Expires: 0');\n\t\theader('Cache-Control: must-revalidate, post-check=0, pre-check=0');\n\t\theader('Content-Type: text/csv;charset=utf-8');\n\t\theader('Content-Disposition: inline; filename='.$this->filename.'.csv');\n\t\t}",
"private function sendFile($filename, $content, $type) {\n\t\tif ($type === 'unknown') {\n\t\t\treturn;\n\t\t}\n\n\t\t$content_type = '';\n\t\tif ($type === 'opml') {\n\t\t\t$content_type = 'application/xml';\n\t\t} elseif ($type === 'json_feed' || $type === 'json_starred') {\n\t\t\t$content_type = 'application/json';\n\t\t}\n\n\t\theader('Content-Type: ' . $content_type . '; charset=utf-8');\n\t\theader('Content-disposition: attachment; filename=' . $filename);\n\t\tprint($content);\n\t}",
"public static function get_filename_from_disposition($disposition_header)\n {\n }",
"public static function forceDownload($filename) {\n header('Content-Disposition: attachment; filename=\"'.$filename.'\"');\n }",
"public function download($filename) {\n\t\t$this->header('Content-Disposition', 'attachment; filename=\"' . $filename . '\"');\n\t}",
"public function getRequestDisposition()\n\t{\n\t\treturn $this->request_disposition;\n\t}",
"public function setHeaders(){\n header('Content-Type: text/cache-manifest');\n header('Cache-Control: no-cache');\n }",
"public static function setContentTypeHeader($cType)\r\n\t{\r\n\t\theader(\"Content-Type: $cType; charset=\".ENCTYPE_CHARSET);\r\n\t}",
"public function setContentTypeHeader($type)\n {\n switch($type) {\n case 'json':\n $this->app->response->headers->set('Content-Type', 'application/json');\n break;\n case 'javascript':\n $this->app->response->headers->set('Content-Type', 'application/javascript');\n break;\n default:\n // default is html..\n break;\n }\n }",
"public function setCharset($charset) {\n\n $this->checkNotStopped();\n\n $h = $this->getHeader('Content-type');\n if (!$h) {\n $this->headers['content-type'] = array(\n 'name' => 'Content-type',\n 'value' => ';charset=' . $charset\n );\n return $this;\n }\n\n $pos = strpos($h, ';');\n\n if ($pos === false) {\n $h .= '; charset=' . $charset;\n } else {\n $h = substr($h, 0, $pos) . '; charset=' . $charset;\n }\n\n $this->headers['content-type'] = array(\n 'name' => 'Content-type',\n 'value' => $h\n );\n\n return $this;\n\n }",
"public function setFlowed($flowed=true)\n {\n $value = null;\n if ($flowed) $value = \"flowed\";\n $this->headers->setAttribute(\"Content-Type\", \"format\", $value);\n }",
"public static function setContentType($type, $encoding = 'UTF-8') {\n header('Content-Type: ' . $type . '; charset=' . $encoding);\n }",
"public function file($file_path = null, $content_type = null, $cache_type = null, $cache_control = null)\n {\n // If null is passed then return the current file value\n // otherwise if a blank string then clear the current file\n // and return this Response object.\n if ($file_path === null) {\n return $this->response_file;\n } elseif ($file_path === '') {\n $this->response_file = null;\n return $this;\n }\n\n // Validate that the file exists\n if (!is_file($file_path)) {\n throw new \\Exception(sprintf('[%s->%s()] was called for a file that does not exist: %s', __CLASS__, __FUNCTION__, $file_path));\n }\n\n // Determine the Mime-type to send if not specified as a parameter\n if ($content_type === null) {\n $content_type = $this->fileTypeToMimeType($file_path);\n }\n\n // Set the 'Content-Type' Responder Header or if a 'Download' file is\n // specified then set Responder Headers so that the browswer will prompt\n // to download the file.\n if ($content_type === 'download' || $content_type === 'application/octet-stream') {\n // Get the file name and replace any double-quotes.\n // Note - [basename()] is not used because it doesn't always\n // work in some environments (often Linux or Unix) for Unicode\n // Characters unless calling [setlocale()]. Since the Locale\n // is not known this method is more reliable.\n // $file_name = str_replace('\"', '', basename($file_path));\n $data = explode(DIRECTORY_SEPARATOR, realpath($file_path));\n $file_name = $data[count($data)-1];\n\n // Headers [ 'Content-Description', 'Content-Type', 'Content-Disposition' ]\n // are related to the download while headers [ 'Cache-Control', 'Pragma', 'Expires' ]\n // are related to caching. These caching headers are similar to what is sent\n // from noCache() but vary slightly for 'Cache-Control'.\n $this\n ->header('Content-Description', 'File Transfer')\n ->header('Content-Type', 'application/octet-stream')\n ->header('Content-Disposition', 'attachment; filename=\"' . $file_name . '\"')\n ->header('Cache-Control', 'must-revalidate')\n ->header('Pragma', 'no-cache')\n ->header('Expires', '-1');\n } else {\n $this->contentType($content_type);\n }\n\n // If a cache type is specified then calculate either a\n // hash or last modified date from the file.\n if ($cache_type !== null) {\n switch (strtolower($cache_type)) {\n case 'etag:md5':\n $this->etag(md5_file($file_path));\n break;\n case 'etag:sha1':\n $this->etag(sha1_file($file_path));\n break;\n case 'last-modified':\n $this->lastModified(filemtime($file_path));\n break;\n default:\n throw new \\Exception('Invalid parameter for option $cache_type: ' . $cache_type);\n }\n }\n\n // Set a 'Cache-Control' header if one is defined from this function\n if ($cache_control !== null) {\n $this->cacheControl($cache_control);\n }\n\n // Set a private property to the file path and return the Response Object\n $this->response_file = $file_path;\n return $this;\n }",
"private function configureResponseForInline($filename)\n {\n // For some reason, Zend won't allow me to remove these headers\n header('Pragma: ');\n header('Cache-Control: ');\n\n $this\n ->getResponse()\n ->setHeader('Content-Type', 'application/pdf')\n ;\n }",
"public function setContentType($val)\n {\n $this->_propDict[\"contentType\"] = $val;\n return $this;\n }",
"public function setContentType( $ctype='' )\n {\n if( !empty( $ctype ) && is_string( $ctype ) )\n {\n $parts = explode( ';', trim( $ctype ) );\n $this->ctype = $this->_value( @$parts[0], '' );\n }\n }",
"function setContentType($content_type){\n\t\tsettype($content_type,\"string\");\n\t\tif(preg_match('/^([^;]+); charset=[\"\\']?([^\\s;]+)[\"\\']?$/',$content_type,$matches)){\n\t\t\t$content_type = $matches[1];\n\t\t\t$this->setContentCharset($matches[2]);\n\t\t}\n\t\t$this->_ContentType_Redefined = true;\n\t\t$this->_ContentType = $content_type;\n\t}",
"protected function header()\n {\n $data = date(\"Y-m-d\");\n $filename = $data . \"-\" . str_replace(\" \", \"-\", $this->title) . \".doc\";\n header(\"Content-type: application/vnd.ms-word\");\n header(\"Content-Disposition: attachment;Filename=$filename\");\n }",
"private function setHeader($excel_file_name)//this function used to set the header variable\r\n\t{\r\n\t\t\r\n\t\theader('Cache-Control: no-store, no-cache, must-revalidate'); // HTTP/1.1\r\n\t\theader('Cache-Control: pre-check=0, post-check=0, max-age=0'); // HTTP/1.1\r\n\t\theader (\"Pragma: no-cache\");\r\n\t\theader(\"Expires: 0\");\r\n\t\theader('Content-Transfer-Encoding: none');\r\n\t\theader('Content-Type: application/vnd.ms-excel;'); // This should work for IE & Opera\r\n\t\theader(\"Content-type: application/x-msexcel\"); // This should work for the rest\r\n\t\theader(\"Content-Disposition: attachment; filename=$excel_file_name\");\r\n\t\t\r\n\t\t/*header('Content-type: application/ms-excel');\r\n\t\theader('Content-Disposition: attachment; filename='.$excel_file_name);*/\r\n\t\r\n\t\r\n\t}",
"function provide_file($filename) {\n $ext = pathinfo($filename, PATHINFO_EXTENSION);\n $MODE = 'txt';\n $attachment = \"attachment; \";\n if ($ext != '') {\n $MODE = $ext;\n }\n switch ($MODE) {\n case \"bz2\": $ctype=\"application/x-bzip2\"; break;\n case \"css\": $ctype=\"text/css\"; break;\n case \"gz\": $ctype=\"application/x-gzip\"; break;\n case \"gzip\": $ctype=\"application/x-gzip\"; break;\n case \"java\": $ctype=\"text/x-java-source\"; $attachment=\"\"; break;\n case \"tgz\": $ctype=\"application/x-compressed\"; break;\n case \"pdf\": $ctype=\"application/pdf\"; $attachment=\"\"; break;\n case \"zip\": $ctype=\"application/zip\"; break;\n case \"doc\": $ctype=\"application/msword\"; break;\n case \"docx\": $ctype=\"application/vnd.openxmlformats-officedocument.wordprocessingml.document\"; break;\n case \"xls\": $ctype=\"application/vnd.ms-excel\"; break;\n case \"xlsx\": $ctype=\"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\"; break;\n case \"ppt\": $ctype=\"application/vnd.ms-powerpoint\"; break;\n case \"pptx\": $ctype=\"application/vnd.openxmlformats-officedocument.presentationml.presentation\"; break;\n case \"svg\": $ctype=\"image/svg+xml\"; $attachment=\"\"; break;\n case \"gif\": $ctype=\"image/gif\"; $attachment=\"\"; break;\n case \"png\": $ctype=\"image/png\"; $attachment=\"\"; break;\n case \"jpe\": case \"jpeg\":\n case \"jpg\": $ctype=\"image/jpg\"; $attachment=\"\"; break;\n case \"sql\":\n case \"txt\": $ctype=\"text/plain\"; $attachment=\"\"; break;\n case \"htm\": $ctype=\"text/html\"; $attachment=\"\"; break;\n case \"html\": $ctype=\"text/html\"; $attachment=\"\"; break;\n case \"htmls\": $ctype=\"text/html\"; $attachment=\"\"; break;\n default: $ctype=\"application/octet-stream\";\n }\n\n header(\"Content-Type: $ctype\");\n header('Content-Disposition: '.$attachment.'filename=\"'.basename($filename).'\"');\n header('Content-Transfer-Encoding: binary');\n header('Expires: 0');\n header('Cache-Control: must-revalidate, post-check=0, pre-check=0');\n\n echo file_get_contents($filename);\n\n }",
"public function setContentType(string $type): Header\n {\n\n $this->sentHeaders['Content-Type'] = $type;\n\n return $this;\n\n }",
"public function setContentType(string $type, string $charset = 'utf-8');",
"public function setContentType($contentType)\n {\n if (is_string($contentType)) {\n if (strpos($contentType, '/') !== false) {\n $contentType = Mad_Controller_Mime_Type::lookup($contentType);\n } else {\n $contentType = Mad_Controller_Mime_Type::lookupByExtension($contentType);\n }\n }\n \n $this->_contentType = $contentType;\n }",
"public static function Header() {\n header('Content-type: application/vnd.fdf');\n//header( \"Content-type: application/vnd.adobe.xfdf\");\n }",
"function exportFile($file, $filename,$mimetype=\"\", $detectmime=true)\n{\n\tinclude_once(atkconfig(\"atkroot\").\"atk/atkbrowsertools.inc\");\n\t$browser = getBrowserInfo();\n\tif (preg_match(\"/ie/i\", $browser[\"browser\"]))\n\t{\n\t\t$mime = \"application/octetstream\";\n\t\t$disp = 'attachment';\n\t}\n\telse if (preg_match(\"/opera/i\",$browser[\"browser\"]))\n\t{\n\t\t$mime = \"application/octetstream\";\n\t\t$disp = 'inline';\n\t}\n\telse\n\t{\n\t\t$mime = \"application/octet-stream\";\n\t\t$disp = 'attachment';\n\t}\n\tif($mimetype!=\"\") $mime=$mimetype;\n\telse if ($mimetype==\"\" && $detectmime && function_exists('mime_content_type'))\n\t$mime = mime_content_type($file);\n\n\t$fp = @fopen($file,\"rb\");\n\tif ($fp!=NULL)\n\t{\n\t\theader('Content-Type: '. $mime);\n\t\theader(\"Content-Length: \".filesize($file));\n\t\theader('Content-Disposition: '.$disp.'; filename=\"'.$filename.'\"');\n\t\tif(preg_match(\"/ie/i\", $browser[\"browser\"])) header('Cache-Control: must-revalidate, post-check=0, pre-check=0');\n\t\tif (($_SERVER[\"SERVER_PORT\"] == \"443\" || $_SERVER['HTTP_X_FORWARDED_PROTO' ]==='https') && preg_match(\"/msie/i\", $_SERVER[\"HTTP_USER_AGENT\"]))\n\t\t{\n\t\t\theader('Pragma: public');\n\t\t}\n\t\telse\n\t\t{\n\t\t\theader('Pragma: no-cache');\n\t\t}\n\t\theader('Expires: 0');\n\n\t\theader(\"Content-Description: File Transfer\");\n\t\theader(\"Content-Transfer-Encoding: binary\");\n\n\t\tfpassthru($fp);\n\t\treturn true;\n\t}\n\treturn false;\n}",
"public function disposition(){\n\t return view('admin.disposition.list_disposition');\n\t}"
] | [
"0.694687",
"0.6634056",
"0.643888",
"0.63623464",
"0.6298853",
"0.6256165",
"0.61654216",
"0.60790247",
"0.59117264",
"0.58500105",
"0.5751759",
"0.5608511",
"0.5608511",
"0.56075597",
"0.5590752",
"0.5587459",
"0.5587459",
"0.5553547",
"0.5551817",
"0.54345644",
"0.53029454",
"0.53008604",
"0.5294126",
"0.5275641",
"0.52577907",
"0.5245011",
"0.52402514",
"0.5231338",
"0.5227283",
"0.52120167",
"0.5194808",
"0.51875144",
"0.51667655",
"0.51592183",
"0.51397425",
"0.51332235",
"0.5117729",
"0.5049362",
"0.5043358",
"0.5031475",
"0.50224364",
"0.50206673",
"0.49992263",
"0.49911636",
"0.49911636",
"0.49802196",
"0.49422276",
"0.49129403",
"0.4908106",
"0.48918507",
"0.48909485",
"0.48796132",
"0.4860699",
"0.4848121",
"0.48038012",
"0.48009893",
"0.47938868",
"0.47922477",
"0.47771418",
"0.47721213",
"0.47624856",
"0.47594732",
"0.4748242",
"0.47338673",
"0.47292447",
"0.4711107",
"0.4710394",
"0.47095203",
"0.4708033",
"0.4690911",
"0.4669348",
"0.46688247",
"0.46589902",
"0.4656385",
"0.46527007",
"0.46505353",
"0.46432203",
"0.46429285",
"0.46377668",
"0.46349365",
"0.46348387",
"0.46156144",
"0.46100962",
"0.45961115",
"0.45884556",
"0.45830345",
"0.45808718",
"0.45770204",
"0.456949",
"0.45683327",
"0.45643717",
"0.45494646",
"0.4529986",
"0.45061126",
"0.4499022",
"0.44899154",
"0.44723096",
"0.44719717",
"0.44689554",
"0.4462527"
] | 0.6070586 | 8 |
Retrieve the content disposition. | public function getDisposition()
{
return $this->disposition;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function getContentDisposition() {}",
"public function getContentDisposition()\n\t{\n\t\t$contentDisposition = $this->get(\"Content-Disposition\");\n\t\tif ($contentDisposition !== null)\n\t\t{\n\t\t\t$parts = explode(\";\", $contentDisposition);\n\n\t\t\treturn trim($parts[0]);\n\t\t}\n\n\t\treturn null;\n\t}",
"public abstract function getContentDisposition();",
"public function getDisposition() {\n\t\treturn $this->disposition;\n\t}",
"protected function getContentDispositionAttachment() {\n // Encode the filename according to RFC2047.\n return 'attachment; filename=\"' . mb_encode_mimeheader($this->getBasename()) . '\"';\n }",
"public function getRequestDisposition()\n\t{\n\t\treturn $this->request_disposition;\n\t}",
"public static function getContentDisposition( $disposition='attachment', $filename=NULL )\n\t{\n\t\tif( $filename === NULL )\n\t\t{\n\t\t\treturn $disposition;\n\t\t}\n\n\t\t$return\t= $disposition . '; filename';\n\n\t\tif ( !\\IPS\\Dispatcher::hasInstance() )\n\t\t{\n\t\t\t\\IPS\\Session\\Front::i();\n\t\t}\n\t\t\n\t\tswitch( \\IPS\\Session::i()->userAgent->useragentKey )\n\t\t{\n\t\t\tcase 'firefox':\n\t\t\tcase 'opera':\n\t\t\t\t$return\t.= \"*=UTF-8''\" . rawurlencode( $filename );\n\t\t\tbreak;\n\n\t\t\tcase 'explorer':\n\t\t\t//case 'chrome':\n\t\t\t\t$return\t.= '=\"' . rawurlencode( $filename ) . '\"';\n\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\t$return\t.= '=\"' . $filename . '\"';\n\t\t\tbreak;\n\t\t}\n\n\t\treturn $return;\n\t}",
"protected function getPartContentDisposition($part)\r\n\t{\r\n\t\tif (isset($part['content-disposition'])) {\r\n\t\t\treturn $part['content-disposition'];\r\n\t\t}\r\n\t\treturn false;\r\n\t}",
"public function getFilename()\n\t{\n\t\t$contentDisposition = $this->get('Content-Disposition');\n\t\tif ($contentDisposition !== null)\n\t\t{\n\t\t\t$filename = null;\n\t\t\t$encoding = null;\n\n\t\t\t$contentElements = explode(';', $contentDisposition);\n\t\t\tforeach ($contentElements as $contentElement)\n\t\t\t{\n\t\t\t\t$contentElement = trim($contentElement);\n\t\t\t\tif (preg_match('/^filename\\*=(.+)\\'(.+)?\\'(.+)$/', $contentElement, $matches))\n\t\t\t\t{\n\t\t\t\t\t$filename = $matches[3];\n\t\t\t\t\t$encoding = $matches[1];\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\telseif (preg_match('/^filename=\"(.+)\"$/', $contentElement, $matches))\n\t\t\t\t{\n\t\t\t\t\t$filename = $matches[1];\n\t\t\t\t}\n\t\t\t\telseif (preg_match('/^filename=(.+)$/', $contentElement, $matches))\n\t\t\t\t{\n\t\t\t\t\t$filename = $matches[1];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ($filename <> '')\n\t\t\t{\n\t\t\t\t$filename = urldecode($filename);\n\n\t\t\t\tif ($encoding <> '')\n\t\t\t\t{\n\t\t\t\t\t$charset = Context::getCurrent()->getCulture()->getCharset();\n\t\t\t\t\t$filename = Encoding::convertEncoding($filename, $encoding, $charset);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn $filename;\n\t\t}\n\n\t\treturn null;\n\t}",
"public function setContentDisposition(string $type): ?ContentDisposition\n {\n if (!in_array(\n $type,\n [\n \"inline\",\n \"attachment\"\n ]\n )\n ) {\n throw new UserException(\"Invalid value for header: Content-Disposition\");\n }\n $contentDisposition = new ContentDisposition($type);\n $this->contentDisposition = $contentDisposition;\n return $contentDisposition;\n }",
"function http_send_content_disposition($filename, $inline = null) {}",
"public static function get_filename_from_disposition($disposition_header)\n {\n }",
"public function disposition(){\n\t return view('admin.disposition.list_disposition');\n\t}",
"public static function pdf_mime_header() {\n\t//--\n\treturn (string) 'application/pdf';\n\t//--\n}",
"public function getMime(): string\n {\n return $this->applicableFormat[$this->contentType];\n }",
"public static function pdf_disposition_header($y_filename='file.pdf', $y_disp='inline') {\n\t//--\n\tswitch((string)$y_disp) {\n\t\tcase 'attachment':\n\t\t\t$y_disp = 'attachment';\n\t\t\tbreak;\n\t\tcase 'inline':\n\t\tdefault:\n\t\t\t$y_disp = 'inline';\n\t} //end switch\n\t//--\n\treturn (string) $y_disp.'; filename=\"'.Smart::safe_filename($y_filename).'\"';\n\t//--\n}",
"function getMimeType() {\n\t\treturn $this->getParam(self::PARAM_DISTRIBUTOR_MIMETYPE);\n\t}",
"public function content_type() {\n\t\treturn \"application/vnd.ms-excel\";\n\t}",
"protected function parseContentDisposition($content)\n {\n if (strpos($content, 'filename') === false) {\n $content .= '; filename=\"\"';\n }\n\n $matches = [];\n preg_match('/.*name=\"(.*)\".*filename=\"(.*)\".*/', $content, $matches);\n\n $name = empty($matches[1]) ? '' : $matches[1];\n $filename = empty($matches[2]) ? '' : $matches[2];\n\n return [$name, $filename];\n }",
"public function getContentType()\n {\n $result = $this->getHeader('Content-Type');\n\n return $result ? $result[0] : null;\n }",
"public function contentType() {\n\t\treturn $this->getHeader('Content-Type');\n\t}",
"public function contentType()\n {\n return $this->header('Content-Type');\n }",
"public function getContentType()\n {\n return $this->getHeader(self::HEADER_CONTENT_TYPE);\n }",
"public function getContentType()\n\t{\n\t\treturn isset($this->_response['headers']['content-type']) ? $this->_response['headers']['content-type'] : null;\n\t}",
"public function getMimeType()\r\n {\r\n $this->caseClosedOrFail();\r\n\r\n return $this->mime;\r\n }",
"public static function validate_mime_disposition($y_disp) {\n\t//--\n\t$y_disp = (string) trim((string)$y_disp);\n\t//--\n\tif((string)$y_disp == '') {\n\t\treturn '';\n\t} //end if\n\t//--\n\tif(preg_match('/^[[:print:]]+$/', $y_disp)) { // mime types are only ISO-8859-1\n\t\t$disp = $y_disp;\n\t} else {\n\t\t$disp = '';\n\t} //end if\n\t//--\n\treturn (string) $disp;\n\t//--\n}",
"public function getContentType()\n {\n return $this->_headers[ODataConstants::HTTPRESPONSE_HEADER_CONTENTTYPE];\n }",
"public function get_content_type()\n {\n }",
"public function getContentType()\n {\n return $this->getHeaderFieldModel('Content-Type');\n }",
"public function getMime()\n {\n return $this->mime;\n }",
"public function getMime() {\n return $this->mime;\n }",
"function getMime () {\r\n return $this->sourceMime;\r\n }",
"public function validateAndParseContentDispositionHeader(Request $request) {\n // First, check the header exists.\n if (!$request->headers->has('content-disposition')) {\n throw new BadRequestHttpException('\"Content-Disposition\" header is required. A file name in the format \"filename=FILENAME\" must be provided.');\n }\n\n $content_disposition = $request->headers->get('content-disposition');\n\n // Parse the header value. This regex does not allow an empty filename.\n // i.e. 'filename=\"\"'. This also matches on a word boundary so other keys\n // like 'not_a_filename' don't work.\n if (!preg_match(static::REQUEST_HEADER_FILENAME_REGEX, $content_disposition, $matches)) {\n throw new BadRequestHttpException('No filename found in \"Content-Disposition\" header. A file name in the format \"filename=FILENAME\" must be provided.');\n }\n\n // Check for the \"filename*\" format. This is currently unsupported.\n if (!empty($matches['star'])) {\n throw new BadRequestHttpException('The extended \"filename*\" format is currently not supported in the \"Content-Disposition\" header.');\n }\n\n // Don't validate the actual filename here, that will be done by the upload\n // validators in validate().\n // @see \\Drupal\\file\\Plugin\\rest\\resource\\FileUploadResource::validate()\n $filename = $matches['filename'];\n\n // Make sure only the filename component is returned. Path information is\n // stripped as per https://tools.ietf.org/html/rfc6266#section-4.3.\n return $this->fileSystem->basename($filename);\n }",
"public function getContentType()\n {\n return $this->mediaFile->getContentType();\n }",
"public static function getContentType() {}",
"public function getHeaders()\n {\n $headers = parent::getHeaders();\n\n $headers->clearHeaders()\n ->addHeaderLine('Content-Type', $this->contentType)\n ->addHeaderLine('Content-Disposition', 'attachment')\n ->addHeaderLine('Content-Length', '' . strlen($this->getContent()));\n\n return $headers;\n }",
"protected function getContentType() : string\n {\n return implode(',', (array) $this->httpResponse->getHeader('Content-Type'));\n }",
"protected function makeFileContentDispositionHeaderString($fileName, $disposition='attachment') {\n\t\treturn 'Content-Disposition: ' . $disposition . '; filename=\"' . $fileName . '\" ' . $this->_endString;\n\t}",
"public function getMimeType() {}",
"public function getMimeType() {}",
"public function getMimeType() {}",
"public function getMimeType() {}",
"public function getContentType(): string\n {\n return $this->getHeaderClaim('cty');\n }",
"public function mime () {\n\t\treturn $this->mime;\n\t}",
"public function fcpoGetMandateFilename() \n {\n $sOxid = $this->getId();\n $sQuery = \"SELECT fcpo_filename FROM fcpopdfmandates WHERE oxorderid = '{$sOxid}'\";\n $sFile = $this->_oFcpoDb->GetOne($sQuery);\n\n return $sFile;\n }",
"public function getRfc2822ContentType(): string;",
"public function getMimeType();",
"public function getMimeType();",
"public function getMimeType();",
"public function getMimeType();",
"public function getMimeType();",
"public function getMimeType(){\n return (new \\finfo())->buffer($this->getContent(), FILEINFO_MIME_TYPE);\n }",
"public function getMimeEncoding()\n\t{\n\t\treturn $this->_mime;\n\t}",
"public function getAlteredHeaders()\n {\n return array('Content-Type', 'Content-Transfer-Encoding', 'Content-Disposition');\n }",
"public function getCharset()\n {\n if ($this->headers->hasAttribute(\"Content-Type\", \"charset\"))\n {\n return $this->headers->getAttribute(\"Content-Type\", \"charset\");\n }\n else\n {\n return null;\n }\n }",
"public function getContentType()\n {\n }",
"public function getContentType()\n {\n return $this->getHttpHeader('Content-Type', $this->options['content_type']);\n }",
"public function getMimeType()\n {\n $header = $this->getMimeTypes();\n $contentType = $header[0];\n return $contentType;\n }",
"public static function getContentType(): string\n {\n return static::CONTENT_TYPE;\n }",
"public function getResponseContentType(){\n return $this->contentType;\n }",
"public function getMimetype();",
"public function getMimeType()\n {\n return $this->mime_type;\n }",
"public function getMimeType()\n {\n return $this->mime_type;\n }",
"public function getMimeType()\n {\n return $this->mime_type;\n }",
"public function getContentType(): ?string\n {\n $header = $this->response->getHeaderLine('Content-Type');\n\n return $header === '' ? null : $header;\n }",
"abstract public function getMimeType();",
"public function getAttachFileContent() {\n return $this->file_content;\n }",
"public function contenttype() {\n return $this->info['content_type'];\n }",
"public function getContentType()\n {\n return $this->info->content_type;\n }",
"public function get_response_content_type()\n {\n // Return.\n \n return $this->response_content_type;\n }",
"public function getContentType(): string;",
"public function getFakedDispositions(): array;",
"protected function getContentType() {\n\t\tforeach ( headers_list() as $header ) {\n\t\t\tif ( preg_match( '#^content-type: (\\w+/\\w+);?#i', $header, $m ) ) {\n\t\t\t\treturn $m[1];\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}",
"public function getContentType() {\n\t \t return $this->contentType;\n\t }",
"public function getContentType(): string\n {\n return $this->contentType;\n }",
"public function getContentType(): string\n {\n return $this->contentType;\n }",
"public function mime() : string {\n return $this->file->type;\n }",
"public function getContentType()\n {\n return $this->contentType;\n }",
"public function getContentType()\n {\n return $this->contentType;\n }",
"function getContentType();",
"public function getContentType();",
"public function getContentType();",
"public function getContentType();",
"public function getContentType();",
"public function getContentType();",
"public function getContentType();",
"public function getContentType();",
"public function getContentType();",
"public function getContentType();",
"public function getContentType()\n {\n return $this->get(self::_CONTENT_TYPE);\n }",
"public function getMimeType() {\n return explode('/', $this->contentType)[0];\n }",
"public function getMIMEType()\n {\n return $this->mimetype;\n }",
"public function getMimeType(): string;",
"public function getContentType() : string\n {\n return $this->contentType;\n }",
"public function getMime()\n {\n $size = $this->getImageSize();\n\n return $size['mime'];\n }",
"public function setDisposition($disposition)\n {\n $this->disposition = strtolower($disposition);\n return $this;\n }",
"public function getMime(): string\n {\n return $this->getType();\n }",
"public function getContentCharset()\n {\n $mediaTypeParams = $this->getMediaTypeParams();\n if (isset($mediaTypeParams['charset'])) {\n return $mediaTypeParams['charset'];\n }\n\n return null;\n }",
"public function isAttachment() : bool\n {\n return $this->getDisposition() == 'attachment';\n }"
] | [
"0.828817",
"0.81995887",
"0.7946416",
"0.7659985",
"0.7403866",
"0.6922285",
"0.67363137",
"0.6727324",
"0.63390934",
"0.6272044",
"0.603378",
"0.5835792",
"0.58188796",
"0.57812715",
"0.57637006",
"0.5732078",
"0.57161486",
"0.56941617",
"0.567758",
"0.5667802",
"0.5630162",
"0.5602473",
"0.55695677",
"0.55550605",
"0.55331594",
"0.5525709",
"0.55045927",
"0.5499953",
"0.54998374",
"0.54982996",
"0.5468868",
"0.544388",
"0.5433637",
"0.542138",
"0.54175186",
"0.54080296",
"0.54079634",
"0.5385725",
"0.5357768",
"0.5357768",
"0.5357768",
"0.5357768",
"0.53544766",
"0.5342513",
"0.5332828",
"0.53184944",
"0.5309605",
"0.5309605",
"0.5309605",
"0.5309605",
"0.5309605",
"0.53095216",
"0.53028715",
"0.53022605",
"0.52999",
"0.5292358",
"0.52848375",
"0.528108",
"0.5277948",
"0.52715373",
"0.5260486",
"0.5242316",
"0.5242316",
"0.5242316",
"0.5240512",
"0.5230973",
"0.5227363",
"0.52204883",
"0.5210468",
"0.5207353",
"0.5207141",
"0.5184321",
"0.51834863",
"0.5179749",
"0.51790315",
"0.51790315",
"0.51710373",
"0.51688683",
"0.51688683",
"0.5165604",
"0.5156615",
"0.5156615",
"0.5156615",
"0.5156615",
"0.5156615",
"0.5156615",
"0.5156615",
"0.5156615",
"0.5156615",
"0.5155379",
"0.5150485",
"0.5147833",
"0.51457244",
"0.51441693",
"0.51376647",
"0.51358575",
"0.51327527",
"0.5132385",
"0.51290613"
] | 0.7693411 | 4 |
Add a parameter pair. | public function addParameter($name, $value)
{
$name = strtolower($name);
$value = (string) $value;
if (!HeaderValue::isValid($name)) {
throw new InvalidArgumentException('Invalid content-disposition parameter name detected');
}
if (!HeaderValue::isValid($value)) {
throw new InvalidArgumentException('Invalid content-disposition parameter value detected');
}
$this->parameters[$name] = $value;
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function addParam($name,$value)\n\t\t{\n\t\t\t$this->param[$name] = $value;\n\t\t}",
"public function addParam($key, $value)\n {\n $this->_params[$key] = $value;\n }",
"function addParam($name, $value) {\n if (!isset($this->params[$name])) {\n $this->setParam($name, $value);\n }\n else {\n $oldParam = $this->getParam($name);\n if (!is_array($oldParam)) {\n $oldParam = array($oldParam);\n }\n array_push($oldParam, $value);\n $this->setParam($name, $oldParam);\n }\n }",
"public function addParameter(string $name, $value): self;",
"public function AddParam(Param $param){\r\n\t\t$this->params[] = $param;\r\n\t}",
"function addParam($par)\n\t{\n\t\tif(is_object($par) && is_a($par, 'jmap_xmlrpcval'))\n\t\t{\n\t\t\t$this->params[]=$par;\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 addParam($param, $value){\n\t\t\tif(is_string($param)){\n\t\t\t\t$this->parameters[$param] = $value;\n\t\t\t}\n\t\t\treturn $this;\n\t\t}",
"public function addParam (string $key, $value)\n {\n if (!$this->paramExists($key))\n $this->params[$key] = $value;\n\n $this->save();\n\n return $this;\n }",
"public function add($name, $value = null)\n {\n $noName = false;\n if (null === $name) {\n $name = Parameter::guessParameterNameByValue($value);\n $noName = true;\n }\n\n if (isset($this->parameters[strtoupper($name)])) {\n $this->parameters[strtoupper($name)]->addValue($value);\n } else {\n $param = new Parameter($this->root, $name, $value);\n $param->noName = $noName;\n $this->parameters[$param->name] = $param;\n }\n }",
"function addParameter($name, $value) {\n\t\t$this->link->addParameter($name, $value);\n\t}",
"public function addParam($value, $type = null)\n {\n $this->_params[] = $value;\n if (null === $type) {\n // Detect type if not provided explicitly\n if ($value instanceof Zend_XmlRpc_Value) {\n $type = $value->getType();\n } else {\n $xmlRpcValue = Zend_XmlRpc_Value::getXmlRpcValue($value);\n $type = $xmlRpcValue->getType();\n }\n }\n $this->_types[] = $type;\n $this->_xmlRpcParams[] = ['value' => $value, 'type' => $type];\n }",
"public function addParam($name, $value){\n\t\tthrow new Exception(\"Method \".__CLASS__.\"::\".__METHOD__.\" not implemented yet!\");\n\t}",
"protected function addParam($key, $value, $method = self::SET_VALUE)\n {\n switch ($method) {\n case self::SET_VALUE:\n $this->params[$key] = $value;\n break;\n case self::ADD_VALUE:\n if (isset($this->params[$key])) {\n $this->params[$key] = array_merge_recursive($this->params[$key], $value);\n } else {\n $this->params[$key] = $value;\n }\n break;\n default:\n throw new InvalidArgumentException('Unknown method type.');\n }\n }",
"protected function add_parameter($name, $details)\n\t{\n\t\t$this->P->add_parameter($name, $details);\n\t}",
"function addPrivateParam($name, $value) {\n\t\t$this->privateParams[$name] = $value;\n\t}",
"public function add_parameter( $param_id, $type, $heading = NULL, $note = NULL )\n {\n $util_class_name = lib::get_class_name( 'util' );\n\n // add timezone info to the note if the parameter is a time or datetime\n if( 'time' == $type || 'datetime' == $type )\n {\n // build time time zone help text\n $date_obj = $util_class_name::get_datetime_object();\n $time_note = sprintf( 'Time is in %s\\'s time zone (%s)',\n lib::create( 'business\\session' )->get_site()->name,\n $date_obj->format( 'T' ) );\n $note = is_null( $note ) ? $time_note : $time_note.'<br>'.$note;\n }\n\n $this->parameters[$param_id] = array( 'type' => $type );\n if( !is_null( $heading ) ) $this->parameters[$param_id]['heading'] = $heading;\n if( !is_null( $note ) ) $this->parameters[$param_id]['note'] = $note;\n }",
"protected function add_parameters($params = array())\n\t{\n\t\tforeach ($params as $param)\n\t\t{\n\t\t\t$this->add_parameter($param['name'], $param);\n\t\t}\n\t}",
"public function addParam($name, $value)\n {\n $this->params[$name] = $value;\n return $this;\n }",
"public function addParameter(mixed $value): ParametersInterface;",
"public function addParameterByName(string $name, mixed $value): ParametersInterface;",
"public function add(array $parameters);",
"public function addPair($pair)\n {\n foreach ($pair as $f => $r) {\n if (is_array($r)) {\n $this->addPair($r);\n } else {\n $this->pair[$f] = $r;\n }\n }\n }",
"public function addParam ($key, $value) {\n\t\t$this->params->setParam($key, $value);\n\t\treturn $this;\n\t}",
"public final function addParameter($arg1, $arg2=null)\n {\n $this->setParameter($arg1, $arg2, false);\n }",
"public function addParam($value, $type = null) {\n\t\tif (is_null($type)) {\n\t\t\t$type = $this->_typecast($value);\n\t\t}\n\t\tif (is_array($value)) {\n\t\t\tforeach ($value as $k => $v) {\n\t\t\t\t$t = $this->_typecast($v);\n\t\t\t\t$value[$k] = array('value' => $v, 'type' => $t);\n\t\t\t}\n\t\t}\n\t\t$this->_data[] = array('type' => $type, 'value' => $value);\n\t}",
"public function addParameter(string $parameterName, $parameterValue): void\n {\n $this->parameters[$parameterName] = $parameterValue;\n }",
"public function addParameter(string $name, $value) : Method\n {\n if ($this->parameters->has($name)) {\n throw new InvalidArgumentException(\"The parameter {$name} has been added previously.\");\n }\n\n $this->parameters->add($name, $value);\n\n return $this;\n }",
"public function addParams(array $params)\n {\n foreach ($params as $key => $value) {\n $this->_params[$key] = $value;\n }\n }",
"function addExtraParameter($name) {\n\t\t$this->addParameter($name, Request::getParameter($name));\n\t}",
"public function addParams($parameters){\n\t\t\tif(is_array($parameters)){\n\t\t\t\tforeach ($parameters as $key=>$value) {\n\t\t\t\t\t$this->addParam($key, $value);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $this;\n\t\t}",
"public function addUrlParameter($key, $value)\n {\n $this->urlParameters[$key] = $value;\n }",
"public function addParams($data) {\n\t\tif (!is_array($data)) {\n\t\t\tthrow new \\InvalidArgumentException(\"Array required, got: \" . gettype($data));\n\t\t}\n\t\tforeach ($data as $key => $value) {\n\t\t\t$this->params[$key] = (string)$value;\n\t\t}\n\t}",
"public function putParam($key, $value)\n {\n $this->params[$key] = $value;\n }",
"public function addParams(): Params\n {\n $params = new Params();\n $this->batch[] = $params;\n\n return $params;\n }",
"public function addParameter( string $key, $value = null, ?string $sQuote = null ): self {\n\t\t$this->addParameterArray( [ $key => $value ], $key, $sQuote );\n\n\t\treturn $this;\n\t}",
"public function addParameter($key, $mandatory = false, $list = '', $default = '', $description = '')\n\t{\n\t\tif(!isset($key) || $key == '') {\n\t\t\ttrigger_error('Please specify a parameter name', E_USER_ERROR);\n\t\t\treturn FALSE;\n\t\t}\n\t\tif($mandatory != true && $mandatory != false) {\n\t\t\ttrigger_error('mandatory setting must either be true or false', E_USER_ERROR);\n\t\t\treturn FALSE;\n\t\t}\n\t\t$this->parameters[$key] = array('mandatory' => $mandatory, 'list' => $list, 'default' => $default, 'description' => $description);\n\t\treturn TRUE;\n\t}",
"public function addTransactionParam($name, $value)\n {\n newrelic_add_custom_parameter($name, $value);\n }",
"public function addParam($name, $value){\n $obj = $this->root->appendChild(new FianetXMLElement('obj'));\n $obj->appendChild(new FianetXMLElement('name', $name));\n $obj->appendChild(new FianetXMLElement('value', $value));\n return $obj;\n }",
"public function addIndividualParam($key, $value, $method)\n {\n $this->addParam($key, $value, $method);\n return $this;\n }",
"public function addParam($param, $raw = true)\n {\n if ($param instanceof PMA_Message) {\n $this->_params[] = $param;\n } elseif ($raw) {\n $this->_params[] = htmlspecialchars($param);\n } else {\n $this->_params[] = PMA_Message::notice($param);\n }\n }",
"public function addParam($key, $value)\n {\n if ($value !== null) {\n $this->params[$key] = (string) $value;\n }\n\n return $this;\n }",
"public function addParameters(array $parameters): ParametersInterface;",
"public function addParameter(string $id, $parameter): void\n {\n $this->addDefinition($id, $parameter, [], self::DEFINITION_PARAMETER);\n }",
"public function addParam($name, $value){\r\n $obj = $this->root->appendChild(new KwixoXMLElement('obj'));\r\n $obj->appendChild(new KwixoXMLElement('name', $name));\r\n $obj->appendChild(new KwixoXMLElement('value', $value));\r\n return $obj;\r\n }",
"public function addMoreInfo($param, $value)\n {\n $this->params[$param] = $value;\n\n return $this;\n }",
"public function addParameters(array $params)\n\t{\n\t\t$this->parameters = Helpers::merge($params, $this->parameters);\n\t\treturn $this;\n\t}",
"public function add($data)\n {\n foreach ($data as $k => $v) {\n $this->params[$k] = $v;\n }\n return $this;\n }",
"public function addQuerystringParameter($key, $value)\n {\n $this->querystringParams[$key] = $value;\n }",
"public function addCustomEventParam(string $name, string $value): ParamsInterface;",
"public function addRouteParameter($name, ProviderInterface $routeParameter)\n {\n $this->routeParameters[$name] = $routeParameter;\n }",
"public function param($param, $value)\n {\n // Add or overload a new parameter\n $this->_parameters[$param] = $value;\n\n return $this;\n }",
"function add_param($link, $param_name, $value) {\n\t$newlink = \"\";\n\t//verifica se ja existe ?\n\tif(stripos($link,\"?\")) {\n\t\t$newlink = $link.\"&\".$param_name.\"=\".$value;\n\t} else {\n\t\t$newlink = $link.\"?\".$param_name.\"=\".$value;\n\t}\n\treturn $newlink;\n}",
"function setParam($name, $value) {\n $this->params[$name] = $value;\n }",
"public function add(string $name, ?string $description = null): self\n {\n $this->parameters[] = new Parameter($name, $description);\n\n return $this;\n }",
"protected function addParameterToResult($result, $param)\n {\n // Commandline arguments must be strings, so ignore any\n // parameter that is typehinted to any non-primitive class.\n if ($param->getType() && (!$param->getType() instanceof \\ReflectionNamedType || !$param->getType()->isBuiltin())) {\n return;\n }\n $result->add($param->name);\n if ($param->isDefaultValueAvailable()) {\n $defaultValue = $param->getDefaultValue();\n if (!$this->isAssoc($defaultValue)) {\n $result->setDefaultValue($param->name, $defaultValue);\n }\n } elseif ($param->getType() && $param->getType()->getName() === 'array') {\n $result->setDefaultValue($param->name, []);\n }\n }",
"public function registerParamInfo(\n $name, \n $occurrence= self::OCCURRENCE_UNDEFINED,\n $default= NULL,\n $caster= NULL, \n $precheck= NULL, \n $postcheck= NULL,\n $type= 'core:string',\n $values= array()\n ) {\n $this->paraminfo[$name]= array(\n self::PARAM_OCCURRENCE => $occurrence,\n self::PARAM_DEFAULT => $default,\n self::PARAM_PRECHECK => $this->checkerInstanceFor($precheck),\n self::PARAM_CASTER => $this->checkerInstanceFor($caster),\n self::PARAM_POSTCHECK => $this->checkerInstanceFor($postcheck),\n self::PARAM_TYPE => $type,\n self::PARAM_VALUES => $values\n );\n }",
"public function addParameter($name, $description, $required = true)\n {\n $name = \"{$name}\";\n if (($required) && (!in_array($name, $this->_requiredParameterNames))) {\n $this->_requiredParameterNames[] = $name;\n }\n $this->_allParameters[$name] = $description;\n return $this;\n }",
"public function AddParameter($value)\n {\n throw new \\ErrorException('Parameters not suppered for groups. It is only for single directives.');\n }",
"public function add($param)\n {\n $sentence = new SentenceUtil();\n $sentence->addCommand('/ip/hotspot/add');\n foreach ($param as $name => $value) {\n $sentence->setAttribute($name, $value);\n }\n $this->talker->send($sentence);\n\n return 'Sucsess';\n }",
"public function addQueryParameter($name, ProviderInterface $queryParameter)\n {\n $this->queryParameters[$name] = $queryParameter;\n }",
"public function addServiceExtensionParameter($keyword, $value = null)\n\t{\n\t\t$this->_extparams[$keyword] = $value;\n\t}",
"public function addQueryParams($params) {}",
"public function AddParams($params = array()){\n\t\t\n\t\tif ($params && is_array($params)){\n\t\t\tforeach ($params as $k => $v){\n\t\t\t\tif (property_exists($this, '_'.$k)){\n\t\t\t\t\n\t\t\t\t\t$prop = '_'.$k;\n\t\t\t\t\t$this->$prop = $v;\n\n\t\t\t\t}\t\t\n\t\t\t}\n\t\t}\n\n\t\treturn $this;\n\t}",
"function setParameter($key, $value) {\n $this->parameters[$key] = $value;\n }",
"public function setParameter($param, $value)\n {\n $this->params[$param] = $value;\n }",
"public function setParam(string $name, $value): void\n {\n $this->params[$name] = $value;\n }",
"public function addTplParam($sPara, $sValue)\n {\n $this->_aViewData[$sPara] = $sValue;\n }",
"public static function add($parameters = array())\n {\n self::$config = array_merge(self::$config, $parameters);\n }",
"public function addParameters(\\Vitess\\Proto\\Automation\\EnqueueClusterOperationRequest\\ParametersEntry $value){\n return $this->_add(2, $value);\n }",
"public function add(array $params) {\n $this->_list[$params['option_id']][$params['store_id']] = $params;\n }",
"public function setAdditionalParam($key, $val)\n {\n $this->additionalParams[$key] = $this->interpretParam($val);\n \n return $this;\n }",
"function addURLParam() //strRule, strValue[,strRule, strValue...]\n{\n\t/*\n\taddURLParam([string $URL,] string $paramName1, string $paramValue1 [, string $paramName2, string $paramValue2 [, ...]]):\n\t\tThis function accepts a variable number of arguments. You must specify at least one pair of paramName and paramValue\n\t\targuments. You do not need to specify a URL parameter if you are affecting the current page's URL (obtained using\n\t\t$_SERVER['PHP_SELF']). However, if you do want to pass in a URL to use instead it must be the first parameter.\n\t\t\n\t\tURL: Optional String. String containing the URL to add, update, remove parameters from. If not specified then the current pages\n\t\t\tURL is assumed (obtained using $_SERVER['PHP_SELF'])\n\n\t\tparamName: Required String. A string containing the name of the parameter that you wish to affect in the querystring of the given URL.\n\t\t\tMust be coupled with a paramValue.\n\t\t\n\t\tparamValue: Required Mixed. The value that you want to set the parameter to in the querystring. If the paramName parameter already \n\t\t\texists in the given querystring then the current value will be replaced by paramValue. paramValue will be interpreted in the following\n\t\t\tway:\n\t\t\t\tIf paramValue is of type: It will return:\n\t\t\t\tArray A URL-encoded serialized representation\n\t\t\t\tNULL Nothing. The paramName parameter will be removed from the querystring (NULL was introduced in PHP Version 4)\n\t\t\t\tBoolean TRUE or FALSE The value TRUE or FALSE, respectively\n\t\t\t\tObject A byte-stream (serialized) representation (In PHP 3, serialized objects will lose their class association)\n\t\t\t\tString, Integer, Float, Etc. The URL-encoded value\n\t\t\t\t\n\t\tAs many paramName/paramValue pairs can be passed as requred, but you must always pass them as a name/value pair. An odd number of arguments will\n\t\tcause the first parameter to be interpreted as the URL and the rest to be interpreted as paramName/paramValue pairs. An even number of arguments \n\t\twill be interpreted as only paramName/paramValue pairs and will assume the current URL.\n\t*/\n\t\n\t//Set this to true to enable debugging messages\n\t$blnTesting = false;\n\t\n\t$args = func_get_args();\n\tif ($blnTesting) echo ('<br>' . (sizeof($args)) . ' arguments');\n\n\t//Get URL and QueryString values\t\n\t$URL = (((sizeof($args) % 2) == 1) \n\t\t? /* an odd number of args - get URL from first */ array_shift($args) \n\t\t: $_SERVER['PHP_SELF'] . \"?\" . ((sizeof($_GET)) ? rawurldecode(http_build_query($_GET)) : \"\"));\n\t$QS = \"\";\n\tif (strpos($URL, \"?\") !== FALSE) {\n\t\tlist($URL, $QS) = explode(\"?\", $URL, 2);\n\t}\n\tif ($blnTesting) echo ('<br>URL = ' . $URL);\n\tif ($blnTesting) echo ('<br>QS = ' . $QS);\n\n\t//Discover the servers preferred parameter delimiters. If empty, assume \"&\"\n\t$Delims = ((ini_get(\"arg_separator.input\") == \"\") ? \"&\" : ini_get(\"arg_separator.input\"));\n\tif ($blnTesting) echo ('<br>Delims = ' . $Delims);\n\tif (strlen($Delims) > 1) {\n\t\t$Delims = preg_split('//', $Delims, -1, PREG_SPLIT_NO_EMPTY);\n\t} else {\n\t\t$Delims = array($Delims);\n\t}\n\t$DelimsPregQuoted = array();\n\tforeach ($Delims as $Delim) {\n\t\t$DelimsPregQuoted[] = preg_quote($Delim);\n\t}\n\tif ($blnTesting) echo ('<br>DelimsPregQuoted = <pre>' . print_r($DelimsPregQuoted, TRUE) . '</pre>');\n\t\n\t//Explode QS into name=value pairs\n\tif (strlen($QS) > 0) {\n\t\t$QS = preg_split('/'.implode(\"|\", $DelimsPregQuoted).'/', $QS, -1);\n\t\t\n\t\t//Now explode QS into name/value arrays (split on \"=\")\n\t\t$QSTemp = array();\n\t\tforeach ($QS as $index => $QSParamPair) {\n\t\t\t@list($QSParamName, $QSParamValue) = explode(\"=\", $QSParamPair, 2);\n\t\t\t$QSTemp[$QSParamName] = $QSParamValue;\n\t\t}\n\t\t$QS = $QSTemp;\n\t} else {\n\t\t$QS = array();\n\t}\n\tif ($blnTesting) echo ('<br>QS = <pre>' . print_r($QS, TRUE) . '</pre>');\n\t\n\t//Loop through the paramName/paramValue argument pairs\n\tfor ($i=0; $i<sizeof($args); $i+=2) {\n\t\t$paramName = $args[$i];\n\t\tswitch (gettype($args[$i+1])) {\n\t\t\tcase \"array\":\n\t\t\tcase \"object\":\n\t\t\t\t$paramValue = serialize($args[$i+1]);\n\t\t\t\tbreak;\n\t\t\tcase \"boolean\":\n\t\t\t\t$paramValue = (($args[$i+1]) ? \"TRUE\" : \"FALSE\");\n\t\t\t\tbreak;\n\t\t\tcase \"NULL\":\n\t\t\t\t$paramValue = NULL;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$paramValue = (string) $args[$i+1];\n\t\t\t\tbreak;\n\t\t} //END: switch gettype($args[$i+1])\n\t\tif ($blnTesting) echo ('<br>paramValue #' . $i . ' type = ' . gettype($args[$i+1]));\n\t\tif ($blnTesting) echo ('<br>paramName/paramValue pair #' . $i . ' = ' . $paramName . '/' . $paramValue);\n\t\t\n\t\tif ($paramValue == NULL) {\n\t\t\tif (array_key_exists($paramName, $QS)) {\n\t\t\t\tif ($blnTesting) echo ('<br>NULL value specified - key is present - remove old key rule');\n\t\t\t\tunset($QS[$paramName]);\n\t\t\t} else {\n\t\t\t\tif ($blnTesting) echo ('<br>NULL value specified - key is not present - do nothing');\n\t\t\t} //END: if (array_key_exists($paramName, $QS))\n\t\t} else {\n\t\t\tif (array_key_exists($paramName, $QS)) {\n\t\t\t\tif ($blnTesting) echo ('<br>NULL value not specified - key is present - replace current key value');\n\t\t\t} else {\n\t\t\t\tif ($blnTesting) echo ('<br>NULL value not specified - key is not present - add new rule');\n\t\t\t} //END: if (array_key_exists($paramName, $QS))\n\t\t\t$QS[$paramName] = $paramValue;\n\t\t} //END: if ($paramValue == NULL)\n\t} //END: for ($i=0; $i<sizeof($args); $i+=2)\n\tif ($blnTesting) echo ('<br>QS = <pre>' . print_r($QS, TRUE) . '</pre>');\n\t\n\t$QSTemp = \"\";\n\tif (sizeof($QS)) {\n\t\t$Delim = $Delims[0];\n\t\tforeach ($QS as $QSParamName => $QSParamValue) {\n\t\t\tif (strlen($QSTemp) > 0) $QSTemp .= $Delim;\n\t\t\t$QSTemp .= rawurlencode($QSParamName) . \"=\" . rawurlencode($QSParamValue);\n\t\t}\n\t\t$QSTemp = \"?\" . $QSTemp;\n\t}\n\t$QS = $QSTemp;\n\n\tif ($blnTesting) echo ('<br>Returning ' . $URL . $QS);\n\treturn $URL . $QS;\n}",
"function add_param($argument, $type = 'string') {\n\n $allowed_types = array('none',\n 'empty',\n 'base64',\n 'boolean',\n 'datetime',\n 'double',\n 'int',\n 'i4',\n 'string',\n 'array',\n 'struct');\n if (!in_array($type, $allowed_types)) {\n return false;\n }\n\n if ($type != 'datetime' && $type != 'base64') {\n $this->params[] = $argument;\n return true;\n }\n\n // Note weirdness - The type of $argument gets changed to an object with\n // value and type properties.\n // bool xmlrpc_set_type ( string &value, string type )\n xmlrpc_set_type($argument, $type);\n $this->params[] = $argument;\n return true;\n }",
"public function addPair(Pair $pair) : void\n {\n //add candidates to graph or get them if they already exist\n $winnerVertex = $this->addCandidateToGraph($pair->getWinner());\n $loserVertex = $this->addCandidateToGraph($pair->getLoser());\n\n $newEdge = $winnerVertex->createEdgeTo($loserVertex);\n $newEdge->setWeight($pair->getVotes());\n //check for contradiction of stronger preferences\n if ($this->vertexIsInACycle($loserVertex)) {\n //don't contradict stronger preferences that have been locked in earlier\n $newEdge->destroy();\n }\n }",
"function addUrlParameters(array $parameters) {\n $this->CI = $this->CI ?: get_instance();\n $this->parameterSegment = $this->CI->config->item('parm_segment');\n $this->routerSegments = $segments = $this->CI->uri->router->segments;\n $firstKey = null;\n foreach($parameters as $key => $value) {\n $firstKey = $firstKey ?: $key;\n $segments[] = $key;\n $segments[] = $value;\n }\n $this->CI->uri->router->segments = $segments;\n if (!\\RightNow\\Utils\\Url::getParameter($firstKey)) {\n $this->CI->config->set_item('parm_segment', $this->parameterSegment - 1);\n }\n }",
"public static function parameter(string $key, $value): void\n {\n if (!static::hasNewRelic()) {\n return;\n }\n\n if (!is_scalar($value)) {\n $value = json_encode($value);\n }\n\n newrelic_add_custom_parameter($key, $value);\n }",
"public function add($request_param, $name) \n {\n $this->filters[$request_param] = $name;\n }",
"private function createParam()\n\t{\n\t\t$this->param = Array('http' => Array(), 'url' => null);\n\t}",
"public function addBodyParameter($key, $value)\n {\n $this->bodyParams[$key] = $value;\n }",
"public function add($param)\n {\n $sentence = new SentenceUtil();\n $sentence->addCommand(\"/ip/address/add\");\n foreach ($param as $name => $value) {\n $sentence->setAttribute($name, $value);\n }\n $this->talker->send($sentence);\n return \"Sucsess\";\n }",
"public function parameter(string $paramName, $paramValue);",
"public function add ($elType, $param = NULL, $place = 'head');",
"public function setParam($key, $value);",
"function param(string $name, string $value, string $type = 'ref', string $attributes = ''): string\n {\n return '<param name=\"' . $name\n . '\" type=\"' . $type\n . '\" value=\"' . $value\n . '\" ' . $attributes . _solidus() . '>';\n }",
"public function setParam($param, $value)\n {\n $this->_params[$param] = $value;\n }",
"public function setParam($param, $value)\n {\n $this->params[$param] = $value;\n }",
"public function add_argument ($key, $value)\n {\n $this->_args [$key] = $value;\n }",
"function set_parameter($name, $value)\r\n {\r\n //dump(get_class($this) . ' | ' . $name);\r\n $this->parameters[$name] = $value;\r\n }",
"public function setParam($name, $value) {\n $this->parameter[$name] = $value;\n }",
"public function setParam($key, $val) {\n $this->params[$key] = $val;\n }",
"public function setParam($name, $value){\n\t\t$this->params[(string)$name] = $value;\n\t}",
"public function setParam($name, $val) {\n $this->params[$name]= $val;\n }",
"function add($parameters, $action) {\n $place = count($this->map);\n $this->map[$place] = array();\n $this->map[$place]['params'] = new ParametersExpectation($parameters);\n $this->map[$place]['content'] = $action;\n }",
"public function add(string $key, mixed $value, mixed $type = null): void;",
"public function add($value);",
"public function add($value);",
"public function setParameter($name, $value) {\n $this->parameters[$name]= $value;\n }",
"public function addItem($key, $value);",
"function insertParamArray($array) {\n\t\tforeach ($array as $key => $param) {\n\t\t\t$name = $param['name'];\n\t\t\t$value = $param['value'];\n\t\t\t$type = $param['type'];\n\n\t\t\t$this->insertParam($name, $value, $type);\n\t\t}\n\t}",
"public function add($route, $params): void\n {\n $route = '#^' . $route . '$#';\n $this->routes[$route] = $params;\n }"
] | [
"0.7152448",
"0.7064654",
"0.7060896",
"0.70542115",
"0.6832317",
"0.67013854",
"0.6616837",
"0.66039044",
"0.65102607",
"0.65068847",
"0.6469885",
"0.6448919",
"0.6433823",
"0.6393969",
"0.6356064",
"0.63529557",
"0.6326513",
"0.63074493",
"0.63003445",
"0.6284794",
"0.6230519",
"0.6213401",
"0.6211282",
"0.6176234",
"0.6159091",
"0.61420083",
"0.604901",
"0.6045951",
"0.60214233",
"0.6012173",
"0.5965861",
"0.59503245",
"0.594885",
"0.5887924",
"0.58522046",
"0.58496124",
"0.5814755",
"0.57904387",
"0.5785553",
"0.57713",
"0.5764398",
"0.5735228",
"0.57228917",
"0.57130176",
"0.57050896",
"0.5703489",
"0.5690543",
"0.56771344",
"0.5675137",
"0.5671339",
"0.55587435",
"0.5533459",
"0.5526329",
"0.550052",
"0.5493059",
"0.5482469",
"0.54584396",
"0.5450181",
"0.54309446",
"0.54291373",
"0.5428814",
"0.5415803",
"0.54120547",
"0.54094976",
"0.54073054",
"0.5399379",
"0.53883797",
"0.5387983",
"0.53712124",
"0.5360483",
"0.5354587",
"0.5349794",
"0.5343199",
"0.5340555",
"0.53273517",
"0.5326959",
"0.53040284",
"0.5299292",
"0.52968085",
"0.52920973",
"0.5288321",
"0.5287697",
"0.5284389",
"0.52843034",
"0.5279343",
"0.52775687",
"0.52773464",
"0.5269753",
"0.5267148",
"0.5262699",
"0.52576524",
"0.525388",
"0.52527636",
"0.52395135",
"0.5234154",
"0.5234154",
"0.5218043",
"0.5211027",
"0.52101797",
"0.51996166"
] | 0.51914394 | 100 |
Get a parameter by name. | public function getParameter($name)
{
$name = strtolower($name);
if (isset($this->parameters[$name])) {
return $this->parameters[$name];
}
return null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getParam($name) {\n if (isset($this->parameter[$name])) {\n return $this->parameter[$name];\n }\n }",
"public function getParam($name);",
"function get_parameter($name)\r\n {\r\n if (array_key_exists($name, $this->parameters))\r\n return $this->parameters[$name];\r\n }",
"public function getParam($name) {\n return $this->params[$name];\n }",
"protected function get_parameter( $name ) {\n\t\treturn $this->has_parameter( $name ) ? $this->parameters[ $name ] : null;\n\t}",
"public function getParam($name)\n {\n return Tools::getValue($name);\n }",
"public function getParam(string $name)\n {\n return $this->params[$name] ?? null;\n }",
"public function getParam(string $name)\n {\n if (! isset($this->getParameters()[$name])) {\n throw (new \\Exception('Parameter ' . $name . ' was not found in route', - 1));\n }\n\n return $this->getParameters()[$name];\n }",
"public function getParam($name){\n\t\treturn array_key_exists($name, $this->params) ? $this->params[$name] : NULL;\n\t}",
"public function getParam($name)\n {\n // TODO: Implement getParam() method.\n }",
"public function getParameter($name)\n {\n return $this->parameters[$name] ?? null;\n }",
"public function getParam($name)\n {\n return isset($this->params[$name]) ? $this->params[$name] : null;\n }",
"public function getParameter($name);",
"public function getParameter($name);",
"public function getParameter($name);",
"function getParam($name) {\n if (isset($this->params[$name])) {\n return $this->params[$name];\n }\n return null;\n }",
"public function getParameter($name)\n {\n $name = strtolower($name);\n if (isset($this->parameters[$name])) {\n return $this->parameters[$name];\n }\n return null;\n }",
"protected function getParameter($name)\n {\n return $this->container->getParameter($name);\n }",
"function getParam($name) {\n\t\treturn isset($this->params[$name]) ? $this->params[$name] : null;\n\t}",
"public function getParam(string $name)\n {\n if (! array_key_exists($name, $this->params)) {\n return MissingDefaultParameter::getInstance();\n }\n\n return $this->params[$name];\n }",
"public function getParam($name)\n {\n if (isset($this->params[$name])) {\n return $this->params[$name];\n }\n return null;\n }",
"public function getParam($name) {\n return $this->app->getParam($name);\n }",
"public static function getParam($name) {\n return isset(static::$_params[$name]) ? static::$_params[$name] : null;\n }",
"public function getParameter($name)\n {\n return $this->container->getParameter($name);\n }",
"public function getParameter($name)\n {\n return $this->container->getParameter($name);\n }",
"public function getParam($name)\n {\n return $this->getResponseParam($name);\n }",
"public function getNamedParameter($name)\n {\n $name = strtolower($name);\n return isset($this->namedParameters[$name]) ? $this->namedParameters[$name] : null;\n }",
"public function getParameter(string $name): mixed\n {\n return $this->parameters[$name] ?? null;\n }",
"public function getParameter($name)\n {\n if (array_key_exists($name, $this->params)) {\n return $this->params[$name];\n }\n\n return null;\n }",
"public function getParameter($name){\n\t\treturn Registry::get('router')->get($name);\n\t}",
"public function get(string $name): Parameter\n {\n foreach ($this as $parameter) {\n if ($parameter->getName() === $name) {\n return $parameter;\n }\n }\n\n throw new FileGenException(sprintf(\n 'Can not find parameter \"%s\"',\n $name\n ));\n }",
"public function getParam($name)\n {\n if(isset($this->_invokeParams[$name])) {\n return $this->_invokeParams[$name];\n }\n\n return null;\n }",
"public function offsetGet($name)\n {\n if (is_int($name)) {\n return parent::offsetGet($name);\n }\n $name = strtoupper($name);\n\n if (!isset($this->parameters[$name])) {\n return;\n }\n\n return $this->parameters[$name];\n }",
"public function get( $name )\n\t{\n\t\tif( isset( $this->params[ $name ] ) ) return $this->params[ $name ];\n\t\treturn null;\n\t}",
"protected static function getParameter($name)\n {\n if (isset(self::$map[$name])) {\n $param = self::$map[$name];\n\n if ($param instanceof Closure || (is_array($param) && is_callable($param))) {\n $param = call_user_func($param);\n self::$map[$name] = $param;\n }\n\n return $param;\n }\n\n throw new InvalidArgumentException(sprintf('Parameter %s does not exist', $name));\n }",
"public function get(String $name)\n {\n return $this->has($name) ? $this->parameters[$name] : false;\n }",
"public function getParameter($name){\n\t\tif(!isset($this->inputParameters[$name])){\n\t\t\tthrow new ValidationException(\"Could not find parameter: {$name}\");\n\t\t}\n\t\treturn $this->inputParameters[$name];\n\t}",
"public function getParameter($name)\n {\n if (!array_key_exists($name, $this->config)) {\n throw new \\InvalidArgumentException(sprintf(\n 'Parameter \"%s\" has not been registered',\n $name\n ));\n }\n\n return $this->config[$name];\n }",
"public function getParamDirect($name = \"\");",
"public function getParam($name, $default = null)\n {\n if (isset($this->params[$name])) {\n return $this->params[$name];\n }\n $name = str_replace('.', '_', $name);\n return $this->request->get($name, $default);\n }",
"public function getParam($name)\n {\n return isset($_REQUEST[$name]) ? $_REQUEST[$name] : null;\n }",
"public function getParam($name, $default = null) {\n\t\t$name = (string)$name;\n\t\tif (isset($this->params[$name]))\n\t\t{\n\t\t\treturn $this->params[$name];\n\t\t}\n\n\t\treturn $default;\n\t}",
"final public function getParameter($name)\n {\n if (!isset($this->parameters[$name])) {\n throw new \\InvalidArgumentException(\"Filter parameter '\" . $name . \"' is not set.\");\n }\n return $this->parameters[$name];\n }",
"protected function getParam($name, $default = null)\n\t{\n\t\treturn $this->_params->get($name, $default);\n\t}",
"public function getTranslationParam(string $name);",
"public function parameter($name, $default = null)\n {\n return Arr::get($this->parameters(), $name, $default);\n }",
"public function getParameter(string $name): ?string\n {\n return $this->parameters[$this->sanitizeParameterName($name)] ?? null;\n }",
"public function getParam($name, $default = null)\n {\n if (isset($this->params[$name])) {\n return $this->params[$name];\n } else {\n return $default;\n }\n }",
"protected function getParameter($name, $default = null)\n {\n if (array_key_exists($name, $this->parameters))\n {\n return $this->parameters[$name];\n }\n\n return $default;\n }",
"public function __get($name)\n {\n return $this->getParam($name);\n }",
"public function getParam($param);",
"public function getParameter($name, $default = null, $ns = null)\r\n {\r\n return $this->parameterHolder->get($name, $default, $ns);\r\n }",
"public function param($name, $default = null)\n {\n return isset($this->parameters[$name]) ? $this->parameters[$name] : $default;\n }",
"public function getParameter($name, $default = null)\n {\n if (!(isset($this->parameters[$name]) || array_key_exists($name, $this->parameters))) {\n return $default;\n }\n\n return $this->parameters[$name];\n }",
"public function &getParam($name) {\n\t\tif (!isset($this->_params[$name]))\n\t\t\treturn null;\n\n\t\treturn $this->_params[$name];\n\t}",
"public function getParam($param_name){\n\t\tthrow new Exception(\"Method \".__CLASS__.\"::\".__METHOD__.\" not implemented yet!\");\n\t}",
"public function getParameter($name, $default = null)\n {\n return $this->getConfig()->getParameter($name, $default, $this->_parameters);\n }",
"public function getParam(string $name, bool $throw = true) : ?string\n {\n\n foreach ($this->params as $order => $param) {\n if ($param['name'] === $name) {\n return $param['value'];\n }\n }\n\n if ($throw === false) {\n return null;\n }\n\n try {\n throw new ParamOtosetException('routeParameterByName', $this->getParamsNames(), $name);\n } catch (ParamOtosetException $e) {\n throw new MethodFopException('getNonexistingParameterForRoute', $e);\n }\n }",
"static public function getParam($name, $defaultValue = null)\r\n\t{\r\n\t\tif (isset($_GET[$name])) {\r\n\t\t\treturn $_GET[$name];\r\n\t\t} elseif (isset($_POST[$name])) {\r\n\t\t\treturn $_POST[$name];\r\n\t\t}\r\n\t\t\r\n\t\treturn $defaultValue;\r\n\t}",
"public function getParameter($name, $default = null)\n {\n return PhandArr::get($this->getParameters(), $name, $default);\n }",
"public function getArgument(string $name);",
"public function get_parameter(Application $application, $name)\n {\n $parameters = &$this->determine_level($application);\n\n if (array_key_exists($name, $parameters))\n {\n return $parameters[$name];\n }\n }",
"public function getParam($name, $default = null)\n {\n return $this->params[$name] ?? $default;\n }",
"function _getParameter( $name, $default='' ) {\n\t\t$return = \"\";\n\t\t$return = $this->params->get( $name, $default );\n\t\treturn $return;\n\t}",
"public function param($name, $default= null) {\n return $this->params[$name] ?? $default;\n }",
"public function get($name, $default = null)\n {\n if (isset($this->params[$name])) {\n return $this->params[$name];\n } else {\n return $default;\n }\n }",
"public function getMinkParameter($name)\n {\n return isset($this->minkParameters[$name]) ? $this->minkParameters[$name] : null;\n }",
"final public function getParameter($name)\n {\n if (! isset($this->parameters[$name])) {\n throw new InvalidArgumentException(\"Parameter '\" . $name . \"' does not exist.\");\n }\n\n if ($this->parameters[$name]['is_list']) {\n throw FilterException::cannotConvertListParameterIntoSingleValue($name);\n }\n\n $param = $this->parameters[$name];\n\n return $this->em->getConnection()->quote($param['value'], $param['type']);\n }",
"public static function requireParam($name) {\n\t\tswitch($_SERVER['REQUEST_METHOD']) {\n\t\t\tcase 'GET': $parameters = $_GET; break;\n\t\t\tcase 'POST': $parameters = $_POST; break;\n\t\t\tcase 'PUT':\n\t\t\tcase 'DELETE': $parameters = static::getInputVars(); break;\n\t\t}\n\n\t\tif (isset($parameters[$name])) {\n\t\t\treturn $parameters[$name];\n\t\t} else {\n\t\t\tif (Application::inDevelopment()) {\n\t\t\t\tLog::debug(\"Missing {$name} parameter in {$_SERVER['REQUEST_METHOD']} request\");\n\t\t\t}\n\t\t\tApplication::error(400, 'Missing required parameter');\n\t\t}\n\t}",
"protected function loadParam($name)\n\t{\n\t\tif (!$this->caseSensitive)\n\t\t\t$name = strtolower($name);\n\t\t$db = $this->getDbConnection();\n\t\t$res = $db->createCommand('SELECT option_value FROM '.$this->paramsTableName.' WHERE option_name=\\''.$name.'\\'')->query();\n\t\tif ($res->rowCount == 1)\n\t\t{\n\t\t\t$row = $res->read();\n\t\t\t$this->add($name,$row['option_value']);\n\t\t\treturn $row['option_value'];\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthrow new CException(Yii::t('xparam','XDbParam->{name} does not exist!',\n\t\t\t\tarray('{name}'=>$name)));\n\t\t}\n\t}",
"public static function getParam($name, $default = null)\n\t{\n\t\t$params = ComponentHelper::getParams(self::$extension);\n\t\treturn trim($params->get($name, $default));\n\t}",
"public function getArgument($name)\n {\n $argument = null;\n if (isset($this->arguments[$name])) {\n $argument = $this->arguments[$name];\n }\n return $argument;\n }",
"public function __get($name)\n {\n $val = $this[$name];\n if ($val && $this->_params != null) {\n $val = $this->_params->replaceParameters($val);\n }\n return $val;\n }",
"public function getParam(string $name, $default = null)\r\n {\r\n return $this->request->getAttribute($name, $default);\r\n }",
"protected function getArgument(string $name)\n {\n $this->methodExpectsRequest(__METHOD__);\n $param_infos = $this->getArgumentInfos($name);\n\n if (null === $param_infos) {\n return null;\n }\n $arg = $this->getRequest()->getArg($param_infos['position']);\n return $this->getRequest()->getArg($param_infos['position']);\n }",
"public static function getParam($name, $default = null)\n {\n if (static::$params === null) {\n static::$params = require(__DIR__ . '/data/config.php');\n }\n\n return static::$params[$name] ?? $default;\n }",
"public function queryParam($name);",
"public static function routeParam($name)\n\t{\n\t\tif($route = Router::getCurrentRoute()) {\n\t\t\treturn $route->getParam($name);\n\t\t}\n\t\t\n\t\treturn null;\n\t}",
"public function getParam($key);",
"public function __get($param_name)\r\n {\r\n return $this->$param_name;\r\n }",
"public function get_param(string $param_name) {\r\n\t\t$record = $this->field(['*'])->table(['message_default_params'])->where(['id'=>1])->one();\r\n\t\treturn $record[$param_name] ?? null;\r\n\t}",
"public function getParameter($param)\n {\n return $this->params[$param];\n }",
"function get_param($name) {\n \n if (isset($_REQUEST[$name])) return $_REQUEST[$name];\n else return \"\";\n}",
"public function getParam (string $key)\n {\n return $this->params[$key];\n }",
"public function getNamedStringArgument($name);",
"public function __get($name)\n {\n if (array_key_exists($name, $this->params)) {\n return $this->params[$name];\n }\n\n return false;\n }",
"public function getParams($name)\n {\n if(isset($this->params[$name])){\n return $this->params[$name] ;\n }else{ return null; }\n\n }",
"public function get($name);",
"public function get($name);",
"public function get($name);",
"public function get($name);",
"public function get($name);",
"public function get($name);",
"public function get($name);",
"public function get($name);",
"public function get($name);",
"public function get($name);",
"public function get($name);",
"public function get($name);",
"public function getArgument($name, $default = null) {\n if (array_key_exists($name, $_GET)) {\n return $_GET[$name];\n }\n\n return $default;\n }"
] | [
"0.86368674",
"0.85698414",
"0.85641456",
"0.84794956",
"0.8332437",
"0.8322205",
"0.81541425",
"0.8142521",
"0.8104435",
"0.8088465",
"0.8057469",
"0.80327725",
"0.8028953",
"0.8028953",
"0.8028953",
"0.8018915",
"0.80011976",
"0.79990566",
"0.7998379",
"0.79971415",
"0.798534",
"0.796813",
"0.79600626",
"0.79549885",
"0.79549885",
"0.78591853",
"0.7849478",
"0.7834806",
"0.7769343",
"0.7745047",
"0.77184165",
"0.7669264",
"0.76352787",
"0.76329917",
"0.7630356",
"0.75400895",
"0.7521798",
"0.7470005",
"0.74558985",
"0.7444536",
"0.7404815",
"0.74008036",
"0.73933023",
"0.7379823",
"0.7347918",
"0.73476803",
"0.729455",
"0.7250721",
"0.72328085",
"0.72180086",
"0.7130479",
"0.71155035",
"0.7109853",
"0.7104313",
"0.71041906",
"0.70969445",
"0.7068912",
"0.7059576",
"0.7049663",
"0.70198977",
"0.70137995",
"0.7004316",
"0.69905955",
"0.6935436",
"0.69327444",
"0.69307905",
"0.69266534",
"0.6926515",
"0.6923374",
"0.69093573",
"0.69036514",
"0.68918514",
"0.68899757",
"0.6880493",
"0.68633986",
"0.68619686",
"0.68135583",
"0.6809733",
"0.6807711",
"0.68034905",
"0.6803042",
"0.67878395",
"0.67803866",
"0.67651576",
"0.67582214",
"0.67580956",
"0.6749091",
"0.67443365",
"0.67443365",
"0.67443365",
"0.67443365",
"0.67443365",
"0.67443365",
"0.67443365",
"0.67443365",
"0.67443365",
"0.67443365",
"0.67443365",
"0.67443365",
"0.67395914"
] | 0.7949045 | 25 |
Remove a named parameter. | public function removeParameter($name)
{
$name = strtolower($name);
if (isset($this->parameters[$name])) {
unset($this->parameters[$name]);
return true;
}
return false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function removeParameter($name)\n {\n $this->getParameters();\n unset($this->parameters[$name]);\n }",
"public function remove($parameter);",
"public function __unset($param)\r\n {\r\n $this->params_named->remove($param);\r\n }",
"public function removeParam($name)\n {\n if (isset($this->params[$name])) {\n unset($this->params[$name]);\n }\n return $this;\n }",
"public function forgetParameter($name)\n {\n $this->parameters();\n unset($this->parameters[$name]);\n }",
"public function __unset($name)\n {\n return $this->removeParam($name);\n }",
"public function removeParameter($name)\n {\n $name = strtolower($name);\n if (isset($this->parameters[$name])) {\n unset($this->parameters[$name]);\n return true;\n }\n return false;\n }",
"public function offsetUnset($name)\n {\n if (is_int($name)) {\n parent::offsetUnset($name);\n // @codeCoverageIgnoreStart\n // This will never be reached, because an exception is always\n // thrown.\n return;\n // @codeCoverageIgnoreEnd\n }\n\n unset($this->parameters[strtoupper($name)]);\n }",
"public function __unset($name)\n {\n unset($this->_params['args'][$name]);\n }",
"public function __unset($name)\n {\n unset($this->_params['args'][$name]);\n }",
"public function delete(String $name) : ParameterBag\n {\n if ($this->has($name)) {\n unset($this->parameters[$name]);\n }\n\n return $this;\n }",
"public function remove($name);",
"public function remove($name);",
"public function remove($name);",
"public function remove($name);",
"public function remove($name);",
"public function remove($name);",
"public function remove(string $name);",
"public function remove($name)\n {\n unset($this->values[$name]);\n\t}",
"public function offsetUnset($param)\n\t{\n\t\tunset($this->params[(string) $param]);\n\t}",
"public function removeParameter(string $name): Query\n {\n $name = $this->sanitizeParameterName($name);\n if (isset($this->parameters[$name])) {\n unset ($this->parameters[$name]);\n }\n return $this;\n }",
"public function removeParameter($key) {\n\t\tunset($this->parameters[$key]);\n\t\treturn $this;\n\t}",
"public static function Remove($name);",
"public function removeGetParameter($name)\n {\n if (isset($this->getParams[$name]))\n {\n unset($this->getParams[$name]);\n return true;\n }\n else return false;\n }",
"public function __unset($name)\n {\n if (! array_key_exists($name, $this->userParams)) {\n return;\n }\n\n unset($this->userParams[$name]);\n }",
"public function __unset($name)\n {\n $this->var_holder->remove($name);\n }",
"public function remove(string $name): void;",
"function remove($name = '')\n {\n }",
"public function __unset($name);",
"public function destroy($parameter)\n\t{\n\t\t$parameter->delete();\n\t}",
"public function variable_del($name) {\n // TODO\n variable_del($name);\n }",
"function remove($name) {\n if (isset($this->data[$name])) {\n unset($this->data[$name]);\n }\n }",
"public function removeNamedItem($name) { }",
"public function removePluginParameter( string $plugin_name, string $param_name ) : Asset\n {\n if( !in_array( $plugin_name, self::$plugin_names ) )\n throw new e\\NoSuchPluginException( \n S_SPAN . \"The plugin $name does not exist.\" . E_SPAN );\n \n $plugin = $this->getPlugin( $plugin_name );\n $plugin->removeParameter( $param_name );\n \n return $this->edit();\n }",
"public function __unset($name)\n {\n $this->varHolder->remove($name);\n }",
"public function removeOption($name);",
"public function removePostParameter($name)\n {\n if (isset($this->postParams[$name]))\n {\n unset($this->postParams[$name]);\n return true;\n }\n else return false;\n }",
"public function remove_query_var($name)\n {\n }",
"public function actionDelete($param)\n {\n $params = $this->getConfig($this->config);\n\n if (isset($params[$param])) {\n unset($params[$param]);\n $this->setConfig($this->config, $params);\n }\n }",
"public function parameterPassedByReference(&$param) {\n unset($param);\n }",
"static public function del($name) {}",
"public function remove($name)\n\t{\n\t\t$this->set($name, null);\n\t}",
"public function removeElement( $name ) {\n\t\tunset( $this->data[ $name ] );\n\t}",
"public function offsetUnset($name)\n {\n unset($this->vars[$name]);\n }",
"function remove($name) {\n\t\t$this->_settings->remove($name);\n\t}",
"public function __unset($name)\n {\n $vars = $this->vars();\n if (! isset($vars[$name])) {\n return;\n }\n unset($vars[$name]);\n }",
"public static function remove($name)\n {\n static::getInstance()->offsetUnset($name);\n }",
"public function removeAction(string $name)\n {\n // some logic\n }",
"abstract public function removeItem($name);",
"public function remove($value);",
"public function __unset($_name);",
"public function __unset($name)\n {\n }",
"public function __unset($name)\n {\n }",
"public function __unset($name)\n {\n }",
"public function __unset($name)\n {\n }",
"public function __unset($name)\n {\n }",
"public function __unset($name)\n {\n }",
"public function __unset($name)\n {\n }",
"public function __unset($name)\n {\n }",
"public function __unset(string $name) {\n\t\tunset($this->data[$name]);\n\t}",
"public function delete($name);",
"public function delete($name);",
"public function delete($name);",
"public function offsetUnset($name)\n\t{\n\t\t$this->remove ( $name );\n\t}",
"public function remove_var ($a_name) {\n\t\t\n\t\tif ($this->loaded == 0) {\n\t\t\t$this->load();\n\t\t}\n\t\t\n\t\tunset($this->data[$a_name]);\n\t\t\n\t}",
"public function delete($name)\n {\n unset($this->data[$name]);\n }",
"public function remove($name, $strict = false);",
"public function remove($name)\n {\n unset($this->bag[$name]);\n }",
"function deleteConfigParameter($name){\n try {\n global $db_table_prefix;\n\n $results = array();\n\n $db = pdoConnect();\n\n $query = \"DELETE\n\t\tFROM \".$db_table_prefix.\"configuration WHERE name = :name\";\n\n if (!$stmt = $db->prepare($query))\n return false;\n\n $sqlVars[\":name\"] = $name;\n\n if (!$stmt->execute($sqlVars)){\n // Error\n return false;\n }\n\n if ($stmt->rowCount() > 0)\n return true;\n else {\n addAlert(\"danger\", \"No configuration parameter '$name' exists.\");\n return false;\n }\n\n } catch (PDOException $e) {\n addAlert(\"danger\", \"Oops, looks like our database encountered an error.\");\n error_log(\"Error in \" . $e->getFile() . \" on line \" . $e->getLine() . \": \" . $e->getMessage());\n return false;\n } catch (ErrorException $e) {\n addAlert(\"danger\", \"Oops, looks like our server might have goofed. If you're an admin, please check the PHP error logs.\");\n return false;\n }\n}",
"public function deleteDBVar($name) {\n $name = strtolower($name);\n $configElement = R::findOne($this->_dbConfigTable, 'param = ?', array($name));\n if ($configElement !== NULL) {\n R::trash($configElement);\n }\n }",
"public function removeRoute($name);",
"public function delete($name) {\r\n\r\n $this->del($name);\r\n $this->loadSesionVars();\r\n }",
"public static function removeParam($paramName, $uri=null){\n if(is_null($uri)){\n $uri = $_SERVER['REQUEST_URI'];\n }\n\n $paramArr = [];\n parse_str( parse_url($uri, PHP_URL_QUERY), $paramArr);\n\n if( isset($paramArr[$paramName]) ){\n unset($paramArr[$paramName]);\n\n //rebuild the uri\n $uri = strtok($uri, '?');\n if (!empty($paramArr)) {\n $uri .= '?'.http_build_query($paramArr);\n }\n }\n\n return $uri;\n }",
"public function removeVariable($tv);",
"function __unset( $name ) {\n\t\tunset( $this->$name );\n\t}",
"public function __unset($name)\n {\n \tunset($this->_data[$name]);\n }",
"public function __unset($name)\n {\n return $this->delete($this->uri, $name);\n }",
"public function unset(string $name): void;",
"public function unset(string $name): void;",
"public function removeValue(string $name): bool;",
"public function getParamDirect($name = \"\");",
"public function offsetUnset(mixed $name): void\n {\n $this->remove($name);\n }",
"public function getParam($name);",
"public function delete($name = false);",
"public function __unset($name)\n {\n $this->unset($name);\n }",
"public function remove($domain = null, $path = null, $name = null);",
"public function offsetUnset($offset)\n {\n unset($this->params[$offset]);\n }",
"public function removeTag(string $name);",
"public function unsetParam($param = false)\n\t{\n\t\tif (($param) && (array_key_exists($param, $_SESSION))) {\n\t\t\tunset($_SESSION[$param]);\n\t\t}\n\t\tExceptions::throwNew(\n\t\t\t__CLASS__,\n\t\t\t__FUNCTION__,\n\t\t\t'Not a valid session parameter.'\n\t\t);\n\t}",
"public function removeFilter(string $name);",
"public function remove(string $key);",
"public function removeAttribute(string $name, int $scope);",
"public function __unset($name)\n {\n $this->unset();\n }",
"public function query_remove($key) {\n\t\t\t\\uri\\query::remove($this->object, $key);\n\t\t}",
"public function __unset( string $name ) {\n\t\t$this->data = array_diff_key( $this->data, [ $name => $this->data[ $name ] ] );\n\t}",
"public function deleteHeader ($param)\n {\n unset($this->header[$param]);\n }",
"public function removeLayer($name);",
"public function __unset($name)\n {\n $pos = & $this->_data;\n $name = explode($delimiter, $name);\n $cnt = count($name);\n for ($i = 0; $i < $cnt - 1; $i ++) {\n if (!isset($pos[$name[$i]])) return;\n $pos = & $pos[$name[$i]];\n }\n unset($pos);\n }",
"function __unset($name) {\n\t\tunset($this->object[$name]);\n\t}",
"public function getParameter($name);"
] | [
"0.82805955",
"0.7920392",
"0.7805897",
"0.738567",
"0.73496985",
"0.7329075",
"0.7242711",
"0.72359115",
"0.71234727",
"0.71234727",
"0.7111278",
"0.70172524",
"0.70172524",
"0.70172524",
"0.70172524",
"0.70172524",
"0.70172524",
"0.6875968",
"0.67135435",
"0.6667692",
"0.66255826",
"0.6619053",
"0.66049254",
"0.6541408",
"0.6471634",
"0.6465226",
"0.637449",
"0.6360539",
"0.63266766",
"0.62838984",
"0.6272698",
"0.6267681",
"0.6259496",
"0.6246605",
"0.617701",
"0.61711496",
"0.6170055",
"0.616528",
"0.6147926",
"0.61309505",
"0.610247",
"0.61010474",
"0.6089025",
"0.6065737",
"0.6051968",
"0.6023113",
"0.5995236",
"0.59748906",
"0.5880452",
"0.58709705",
"0.5864253",
"0.585667",
"0.585667",
"0.5856484",
"0.5856484",
"0.5856484",
"0.5856245",
"0.5856245",
"0.5856245",
"0.58345556",
"0.58330137",
"0.58330137",
"0.58330137",
"0.58301324",
"0.5827301",
"0.5821495",
"0.5816968",
"0.5806189",
"0.5782411",
"0.5770606",
"0.57702607",
"0.57580566",
"0.57576454",
"0.57388777",
"0.573745",
"0.5729165",
"0.5705009",
"0.5700565",
"0.5700565",
"0.5699274",
"0.569885",
"0.5696873",
"0.56959957",
"0.568956",
"0.5679842",
"0.5670183",
"0.56595874",
"0.56492704",
"0.564052",
"0.5632824",
"0.5624066",
"0.56218857",
"0.56217086",
"0.5616515",
"0.56129664",
"0.56100947",
"0.5600408",
"0.55967414",
"0.55936074",
"0.55897707"
] | 0.7182739 | 8 |
Link your VC elements's folder | function vc_before_init_actions() {
if ( function_exists( 'vc_set_shortcodes_templates_dir' ) ) {
vc_set_shortcodes_templates_dir( get_template_directory() . '/vc-elements' );
}
require_once( get_template_directory() . '/vc-elements/my_post_slider.php' );
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function immedia_vc_before_init_actions() {\n\ninclude( plugin_dir_path( __FILE__ ) . 'vc-directory-element.php');\n\n}",
"function vc_before_init_actions() {\n \n // Require new custom Element\n require_once( get_stylesheet_directory().'/vc-elements/vc-child-home-slider.php' ); \n require_once( get_stylesheet_directory().'/vc-elements/vc-child-category-blog.php' ); \n require_once( get_stylesheet_directory().'/vc-elements/vc-child-columns-blog.php' ); \n require_once( get_stylesheet_directory().'/vc-elements/vc-child-gallery.php' ); \n \n}",
"public function addRessources()\n {\n // $this->context->controller->addCss(($this->_path . '/views/css/tab.css'), 'all');\n // $this->context->controller->addJquery();\n // $this->context->controller->addJS(($this->_path . '/views/js/script.js'));\n // $this->context->controller->addJS(($this->_path . '/views/js/configuration.js'));\n }",
"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 intromvc()\n {\n $data['$option'] = \"doc/intromvc\";\n $this->loadContent('doc/home', $data);\n }",
"public function loadAssets() {\r\n\t\t$this->app->document->addScript('elements:relateditems/relateditems.js');\r\n\t}",
"public function includes()\n {\n require_once(__DIR__ . '/Widgets/SuperglobalsWidget.php');\n }",
"private function includeUIElements() {\r\n\r\n\t}",
"public function includeAssets()\n {\n $this->Html->script('CkTools.vendor/tinymce/jquery.tinymce.min.js', ['block' => true]);\n $this->Html->script('CkTools.vendor/moxiemanager/js/moxman.loader.min.js', ['block' => true]);\n }",
"private function include_widgets_files() {\n\t\trequire_once( __DIR__ . '/widgets/dropdown.php' );\n\t}",
"public function includes() {\n \n include_once( 'widgets/carousel.php' );\n include_once( 'widgets/fancy-text.php' );\n include_once( 'widgets/grid.php' );\n include_once( 'widgets/maps.php' );\n include_once( 'widgets/pricing-table.php' );\n include_once( 'widgets/progress-bar.php' );\n include_once( 'widgets/vertical-scroll.php' );\n \n }",
"private function viewCommon() {\n $m = $this->getViewModel();\n //$view->assets(['bootstrap','DateTime','SummerNote','links-edit']);\n\n $m->post = '/admin/link/post';\n $m->url = $this->url;\n $m->display = self::display();\n $m->urltypes = self::getUrlTypes();\n $id = $m->link->id ?? 'new';\n $m->title = 'Link#' . $id;\n return $this->render('links', 'edit');\n }",
"private function include_widgets_files() {\n\t\trequire_once( __DIR__ . '/widgets/ele-subcats.php' );\n\t}",
"public function includes() {\n\t\t\t//require_once(ABSPATH . 'wp-admin/includes/nav-menu.php');\n\t\t}",
"function addlinks(){\n Vtiger_Link::addLink(0, 'HEADERSCRIPT', 'LSWYSIWYG', 'modules/LSWYSIWYG/resources/WYSIWYG.js','','','');\n\n\t}",
"public function getGlazedElementsFolders();",
"public function includeAssets(): void\n {\n $this->Html->script('CkTools.vendor/tinymce/jquery.tinymce.min.js', ['block' => true]);\n }",
"static function adminSubMenuProjecten()\n {\n // include the view for this submenu page.\n include PROJECTEN_PLUGIN_ADMIN_VIEWS_DIR . '/pp_admin_projecten.php';\n }",
"public function index()\n { \n $this->locate(inlink('browse'));\n }",
"public function loadConfigAssets()\r\n {\r\n $this->app->document->addScript('elements:imagebox/assets/js/myimage.js');\r\n $this->app->document->addStylesheet('elements:imagebox/assets/css/editoption.css');\r\n $this->app->document->addScript('elements:imagebox/assets/js/myoption.js');\r\n $this->app->document->addStylesheet('elements:option/option.css');\r\n }",
"function link_controller( $element )\n\t\t{\n\t\t\t$output = \"\";\n\t\t\t$output .= '<div class=\"'.$element['class'].'\">';\n\t\t\t\n\t\t\tif(!empty($element['subtype']))\n\t\t\t{\n\t\t\t\t$counter = 0;\n\t\t\n\t\t\t\tforeach($element['subtype'] as $key=>$array)\n\t\t\t\t{\n\t\t\t\t\t$counter ++;\n\t\t\t\t\t$active = $style = $class = $data = \"\";\n\t\t\t\t\tif(isset($array[$element['id']]) && $array[$element['id']] == $element['std'] ) $active = \" ace_link_controller_active\";\n\t\t\t\t\tif(isset($array['style'])) { $style = \" style='\".$array['style'].\"' \"; unset($array['style']); }\n\t\t\t\t\tif(isset($array['class'])) { $class = \" \".$array['class']; unset($array['class']); }\n\t\t\t\t\t\n\t\t\t\t\tforeach($array as $datakey=> $datavalue)\n\t\t\t\t\t{\n\t\t\t\t\t\t$data .= \"data-\".$datakey.\"='\".$datavalue.\"' \";\n\t\t\t\t\t}\n\n\t\t\t\t\t$output .= \"<a href='#' \".$data.\" \".$style.\" class='ace_link_controller ace_link_controller_\".$counter.$active.$class.\"'>\".$key.\"</a>\";\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$output .= '<input type=\"hidden\" value=\"'.$element['std'].'\" id=\"'.$element['id'].'\" name=\"'.$element['id'].'\"/>';\n\t\t\t\n\t\t\t$output .= \"</div>\";\n\t\t\treturn $output;\n\t\t}",
"protected function registerViewLocation()\n {\n $folder = $this->active()->get('namespace');\n\n View::getFinder()->prependLocation(theme_path(\"{$folder}/resources/views\"));\n }",
"function vc_before_init_actions() {\n \t require_once( get_template_directory().'/vc-elements/my-first-custom-element.php' );\n require_once( get_template_directory().'/vc-elements/progressbar0.php' );\n\t require_once( get_template_directory().'/vc-elements/card-counter-card.php' );\t \n\t require_once( get_template_directory().'/vc-elements/Services.php' );\t\n require_once( get_template_directory().'/vc-elements/Carousel-Side-Caption.php' );\n\t require_once( get_template_directory().'/vc-elements/InteractiveSVG.php' );\n\t require_once( get_template_directory().'/vc-elements/piechart.php' );\n\t require_once( get_template_directory().'/vc-elements/OurServices.php' );\n\t require_once( get_template_directory().'/vc-elements/Timeline66.php' );\n\t require_once( get_template_directory().'/vc-elements/ServiceBox76.php' );\n\t require_once( get_template_directory().'/vc-elements/project.php' );\n\t require_once( get_template_directory().'/vc-elements/project1.php' );\n\t }",
"public function render(){\n require_once($_SERVER['DOCUMENT_ROOT'].\"//views/\".self::$page_name.\"/\".self::$page_name.\".php\");\n }",
"protected function getComponentsPath(): string\n {\n return resource_path('js/Components');\n }",
"public function addAssets()\n {\n $this->addJs('../../graphreport/assets/d3.js');\n $this->addJs('../../graphreport/assets/c3.js');\n $this->addCss('../../graphreport/assets/c3.css'); \n }",
"protected function addBackOfficeMedia()\n {\n /* CSS files */\n $this->context->controller->addCSS($this->_path . 'views/css/admin/kb_admin.css');\n \n /* JS files */\n $this->context->controller->addJS($this->_path . 'views/js/velovalidation.js');\n $this->context->controller->addJS($this->_path . 'views/js/admin/kb_admin.js');\n $this->context->controller->addJS($this->_path . 'views/js/admin/validation_admin.js');\n }",
"public function Executar() : void\n {\n include RAIZ.'/Module/Application/View/HTML/Layout/Elemento/Vendedor.php';\n }",
"function addLocations(){\n $l = $this->api->locate('addons', __NAMESPACE__, 'location');\n $addon = $this->api->locate('addons', __NAMESPACE__);\n $this->api->pathfinder->addLocation($addon, array(\n 'template' => 'templates',\n //'css' => 'templates/css',\n //'js' => 'js',\n ))->setParent($l);\n }",
"private function links()\n {\n foreach ($this->controller->links as $value)\n echo \"\\t<link rel='stylesheet' href='\" . DOMAIN . $value . \"' />\\n\";\n }",
"public function setPaths()\n\t{\n\t\t$this->componentURL = Request::base() . 'publications/';\n\t\t$this->resourceURL = $this->componentURL . $this->id;\n\n\t\t$database = \\App::get('db');\n\t\t$pub = new \\Components\\Publications\\Tables\\Publication($database);\n\t\t$publication = $pub->getPublication($this->id);\n\t\t$this->resourceSite = \\Components\\Publications\\Helpers\\Html::buildPubPath($this->id, $publication->version_id, '', $publication->secret, 1);\n\t}",
"private function includes() {\n\t\trequire_once( PRODUCT_LIST_DIR . 'classes/class-product_list.php' );\n\t\t//require_once( PRODUCT_LIST_DIR . 'classes/class-yc_admin_cursos-settings.php' );\n\t}",
"public function admin_includes()\n {\n\n }",
"public function index()\n {\n $this->locate(inlink('browse'));\n }",
"public function index()\n {\n $this->locate(inlink('browse'));\n }",
"public function linkController(\\Difra\\Controller $controller)\n {\n $controller->xml =& $this->xml;\n $controller->realRoot =& $this->realRoot;\n $controller->root =& $this->elements['content'];\n $controller->html =& $this->html;\n foreach (['header', 'footer'] as $element) {\n if (isset($this->elements['header'])) {\n $controller->{$element} =& $this->elements[$element];\n } else {\n $controller->{$element} =& $this->elements['content'];\n }\n }\n }",
"public function includes() {\n\t\trequire_once( 'metabox.php' );\n\t}",
"public static function getIDerButtonLink()\n {\n return static::getBasePath() . 'iderbutton';\n }",
"public function includes() {\n\n\t\t\tinclude_once $this->plugin_dir( 'admin/includes/class-monstroid-dashboard-interface.php' );\n\t\t\tinclude_once $this->plugin_dir( 'admin/includes/class-monstroid-dashboard-updater.php' );\n\t\t\tinclude_once $this->plugin_dir( 'admin/includes/class-monstroid-dashboard-notices.php' );\n\t\t\tinclude_once $this->plugin_dir( 'admin/includes/class-monstroid-dashboard-ui-handlers.php' );\n\t\t\tinclude_once $this->plugin_dir( 'admin/includes/class-monstroid-dashboard-filesystem.php' );\n\n\t\t}",
"public function addDependencies()\n {\n $this->Html->script('/attachments/js/vendor/jquery.ui.widget.js', ['block' => true]);\n $this->Html->script('/attachments/js/vendor/jquery.iframe-transport.js', ['block' => true]);\n $this->Html->script('/attachments/js/vendor/jquery.fileupload.js', ['block' => true]);\n $this->Html->script('/attachments/js/app/lib/AttachmentsWidget.js', ['block' => true]);\n $this->Html->css('/attachments/css/attachments.css', ['block' => true]);\n }",
"protected function registerNamespace() {\n // get the laravel view path\n $viewPath = Config::get('view.paths')[0];\n \n // set the view name space \n if (file_exists($viewPath . '/cms')) {\n $this->loadViewsFrom($viewPath . '/cms', 'cms');\n } else {\n $this->loadViewsFrom(__DIR__ . '/views', 'cms');\n }\n }",
"public function loadAssets()\r\n {\r\n $this->app->document->addStylesheet('elements:imagebox/assets/css/edit.css');\r\n return parent::loadAssets();\r\n }",
"function renderPage() {\n $parameters = explode(\"/\", $this->getCurrentPage());\n $folder = $parameters[1];\n if (!in_array($folder, $this->folders) && $folder !== \"api\") {\n $name = $this->getCurrentPage();\n require_once $this->getBlueprintPath();\n }\n }",
"protected function loadResourcesForRegisteredNavigationComponents() {}",
"public function setMedia()\n {\n $loadLibrary = false;\n\n if ($loadLibrary)\n {\n $activeTheme = $this->theme->active();\n $casset = \\Config::get('lb.theme.use_casset');\n $casset and \\Casset::add_path('theme', $activeTheme['asset_base']);\n \n \\Lb\\Backend::addAsset(array(\n 'jquery.min.js',\n 'jquery-ui.min.js',\n ), 'js', 'js_core', $this->theme, $casset);\n \n \\Lb\\Backend::addAsset(array(\n 'bootstrap/css/bootstrap.css',\n 'bootstrap/css/bootstrap-glyphicons.css',\n ), 'css', 'css_plugin', $this->theme, $casset);\n\n \\Lb\\Backend::addAsset(array(\n 'bootstrap.js',\n ), 'js', 'js_core', $this->theme, $casset);\n \n \\Lb\\Backend::addAsset(array(\n 'font-awesome/css/font-awesome.css',\n ), 'css', 'css_plugin', $this->theme, $casset);\n }\n }",
"public function plantilla(){\n //el include se utiliza para invocar el archivo que tiene el codigo html\n include \"View/template.php\";\n }",
"public function load_assets() {\n\n\t\t\twp_enqueue_style('wp-mediaelement');\n\t\n\t\t\twp_enqueue_style('dnd_icons_default', ILB_DIR_URL. 'public/assets/'.'css/icons-default.css', array(), $this->version);\n\n\t\t\t$options = get_option( 'dnd_settings' );\n\t\t\tif(isset($options['dnd_enable_fa']) && $options['dnd_enable_fa']==1){\n\t\t\t\twp_enqueue_style('dnd_icons_fa', ILB_DIR_URL. 'public/assets/'.'css/icons-fa.css', array(), $this->version);\n\t\t\t}\n\t\t\tif(isset($options['dnd_enable_whhg']) && $options['dnd_enable_whhg']==1){\n\t\t\t\twp_enqueue_style('dnd_icons_whhg', ILB_DIR_URL. 'public/assets/'.'css/icons-whhg.css', array(), $this->version);\n\t\t\t}\n\t\t\t\n\t\t\twp_enqueue_style('ABdev_animo-animate', ILB_DIR_URL. 'public/assets/'.'css/animo-animate.css', array(), $this->version);\n\t\t\twp_enqueue_style('ABdev_prettify', ILB_DIR_URL. 'public/assets/'.'css/prettify.css', array(), $this->version);\n\t\t\tif(is_file(get_stylesheet_directory().'/css/dnd-shortcodes.css')){\n\t\t\t\twp_enqueue_style('ABdev_shortcodes', get_stylesheet_directory_uri().'/css/dnd-shortcodes.css', array('ABdev_animo-animate', 'ABdev_prettify'), $this->version);\n\t\t\t}\n\t\t\telse{\n\t\t\t\twp_enqueue_style('ABdev_shortcodes', ILB_DIR_URL. 'public/assets/'.'css/shortcodes-default.css', array('ABdev_animo-animate', 'ABdev_prettify'), $this->version);\n\t\t\t}\n\t\t\twp_enqueue_style('ABdev_shortcodes_responsive', ILB_DIR_URL. 'public/assets/'.'css/responsive.css', array('ABdev_shortcodes'), $this->version);\n\t\t\twp_enqueue_script('wp-mediaelement');\n\t\t\twp_enqueue_script('prettify', ILB_DIR_URL. 'public/assets/'.'js/prettify.js', $this->version, true);\n\t\t\twp_enqueue_script('google_maps_api', 'http://maps.google.com/maps/api/js?sensor=false','','', true);\n\t\t\twp_enqueue_script('google_maps_jquery', ILB_DIR_URL. 'public/assets/'.'js/jquery.gmap.min.js', array('jquery', 'google_maps_api'), $this->version, true);\n\t\t\twp_enqueue_script('animo', ILB_DIR_URL. 'public/assets/'.'js/animo.js', array('jquery'), $this->version, true);\n\t\t\twp_enqueue_script('inview', ILB_DIR_URL. 'public/assets/'.'js/jquery.inview.js', array('jquery'), $this->version, true);\n\t\t\twp_enqueue_script('parallax', ILB_DIR_URL. 'public/assets/'.'js/jquery.parallax-1.1.3.js', array('jquery'), $this->version, true);\n\t\t\twp_enqueue_script('tipsy', ILB_DIR_URL. 'public/assets/'.'js/jquery.tipsy.js', array('jquery'), $this->version, true);\n\t\t\twp_enqueue_script('knob', ILB_DIR_URL. 'public/assets/'.'js/jquery.knob-custom.js', array('jquery'), $this->version, true);\n\n\t\t\t// $options = get_option( 'dnd_settings' );\n\t\t\t// $dnd_tipsy_opacity = (isset($options['dnd_tipsy_opacity'])) ? $options['dnd_tipsy_opacity'] : '0.8';\n\n\t\t\twp_enqueue_script('dnd-shortcodes', ILB_DIR_URL. 'public/assets/'.'js/init.js', array('jquery', 'jquery-ui-accordion', 'jquery-ui-tabs', 'jquery-effects-slide', 'animo', 'google_maps_jquery', 'parallax', 'inview' , 'tipsy' , 'knob' , 'prettify'), $this->version, true);\n\t\t\twp_localize_script( 'dnd-shortcodes', 'dnd_options', array( \n\t\t\t\t'dnd_tipsy_opacity' => '$dnd_tipsy_opacity', \n\t\t\t) );\n\n\t}",
"function wlwmanifest_link()\n {\n }",
"protected function addEmbeddedResources()\n {\n }",
"protected function commonViewData() {\n //print \"Hello\";\n $this->viewModel->set(\"mainMenu\", array(\"Home\" => \"home\", \"Help\" => \"help\"));\n $this->viewModel->set(\"Basepath\", \"http://localhost/~georginfanger/georginfanger/\");\n }",
"private function views()\n {\n $this->loadViewsFrom(__DIR__.'/../../resources/views', 'mage-bdd');\n\n $this->app['view']->addNamespace('mage-bdd', __DIR__.'/../../resources/views');\n }",
"public function ICT_director()\r\n\t{\r\n\t\t$this->load->view('inc/header');\r\n $this->load->view('site/ict_department');\r\n $this->load->view('inc/footer');\r\n\t}",
"function addCSSFiles()\n\t{\n\t\t$this->getContainer()->AddCSSFile(\"include/zoombox/zoombox.css\");\n\t}",
"public function includes() {\n\t\trequire_once( plugin_dir_path( __FILE__ ) . 'class-productflow-admin.php' );\n\t\trequire_once( plugin_dir_path( __FILE__ ) . 'class-productflow-filters.php' );\n\t}",
"protected function importView()\n {\n return 'common/import';\n }",
"public function Admin_Workspace_Menus()\n {\n view()->composer('workspace.admin.department.page_menu',function($view){\n $departments = Department::all();\n $view->with('departments',$departments);\n });\n }",
"public function includes() {\n\t\t\trequire_once( CHERRY_SITE_SHORTCODES_DIR . 'includes/public/tools.php' );\n\n\t\t\t$this->shortcodes();\n\t\t}",
"function addJSFiles()\n\t{\n\t\t\t\t$this->getContainer()->AddJSFile(\"include/zoombox/zoombox.js\");\n\t\t$this->getJSControl();\t\n\t}",
"static function addPath(string $controllersFolder) {\n\t\t$_paths[] = $controllersFolder;\n\t}",
"protected function setElementPartialPath() {}",
"public function injectJavascriptInView(): void\n {\n share([\n 'libraryMedia' => [\n 'clipboardCopy' => [\n 'route' => route('libraryMedia.file.clipboardContent', ['__ID__', '__TYPE__', '__LOCALE__']),\n ],\n ],\n ]);\n }",
"public function registerScripts() {\r\n\t\t$baseUrl = Yii::app()->assetManager->publish(dirname(__FILE__).\"/assets/\".__CLASS__);\r\n\t\tYii::app()->clientScript->registerScriptFile($baseUrl.\"/AFileBrowser.js\");\r\n\t\t\r\n\t}",
"public function index()\r\n\t{\r\n\t\t$this->addHook($this->i18n->languageDetector()); #jaki jest domyslny jezyk usera\r\n\t\t\r\n\t\t$this->main->metatags_helper; #do pliku main.php zostaje wczytany plik metatags_helper itd\r\n\t\t$this->main->head_helper;\r\n\t\t$this->main->loader_helper;\r\n\t\t$this->main->module_helper;\r\n\t\t$this->main->model_helper;\r\n\t\t$this->main->directory_helper;\r\n\t\t$this->main->translate_helper;\r\n\t}",
"protected function content() {\r\n\t\t$oClassAtual = get_class($this);\r\n\r\n\t\t$oClassAtual = str_replace('app\\\\controller\\\\', '', $oClassAtual);\r\n\r\n\t\t$oClassAtual = strtolower(str_replace('Controller', '', $oClassAtual));\r\n\r\n\t\trequire_once \"app/view/\".$oClassAtual.\"/\".$this->oView->cPage.\".phtml\";\r\n\t}",
"function controller()\n\t\t{\t\n\t\t\t$this->admin_page_header();\n\t\t\t$this->admin_menu();\n\t\t}",
"public function registerViews()\n {\n $paths = [];\n if (!$this->modules) {\n return $paths;\n }\n\n $modulesCollection = collect($this->modules);\n $activeModules = $modulesCollection->get(self::MODULE_VERSION);\n foreach ($activeModules as $module) {\n \\View::getFinder()->addLocation(base_path(\"App\\\\Modules\\\\\" . self::MODULE_VERSION . \"\\\\{$module}\\\\Resources\\\\Views\"));\n }\n\n }",
"public function plantilla(){\n\n\n include \"./vista/plantilla.php\";\n\n }",
"function autocargar($classname) {\n include './controllers/'.$classname . '.php';\n}",
"function includes() {\r\n\t\t\trequire_once( trailingslashit( RV_PORTFOLIO_DIR ) . 'inc/public/class-rv-portfolio-registration.php' );\r\n\t\t}",
"public function include_classes() {\n\t\trequire MOP__PLUGIN_DIR . 'includes/class-cpt-student.php';\n\t\trequire MOP__PLUGIN_DIR . 'includes/class-student-widget.php';\n\t}",
"public static function connect(){\n $pagetitle = 'Entrez vos informations';\n $controller = 'benevole';\n $view = 'connect';\n require_once (File::build_path(array('view','view.php'))); \n }",
"public function languages_director()\r\n\t{\r\n\t\t$this->load->view('inc/header');\r\n $this->load->view('site/languages_department');\r\n $this->load->view('inc/footer');\r\n\t}",
"public function stockIntegrateWithVC() {\n\t\tif ( !defined('WPB_VC_VERSION')){\n\t\t\tadd_action('admin_notices', array($this, 'stockShowVcVersionNotice'));\n\t\t}\n\t\t\n\t//visual composer addons\n\tinclude STOCK_ACC_PATH .'/vc-addons/vc-slides.php';\n\t\n\t}",
"public function Index(){\n require_once 'view/header.php';\n require_once 'view/categoria/categoria.php';\n require_once 'view/footer.php';\n\n \n }",
"private function link(string $filename): void\n {\n if ($this->loaded) {\n return;\n }\n\n /** @noinspection PhpIncludeInspection */\n $this->catalogue = include $filename;\n $this->loaded = true;\n }",
"function add_my_awesome_widgets_collection($folders){\n\t$folders[] = plugin_dir_path(__FILE__).'extra-widgets/';\n\treturn $folders;\n}",
"public function uxstockIntegratewithVC(){\n\t\tif(!defined(WPB_VC_VERSION)){\n\n\t\t\tadd_action('admin_notices',array($this,'uxstockshowVersionnotices'));\n\t\t}\n\n\t\t//Visual Composer Addons\n\t\t\n\t\tinclude UXSTOCK_ACC_PATH.'/vc-addons/vc-slide.php';\n\t\tinclude UXSTOCK_ACC_PATH.'/vc-addons/vc-logo-carosel.php';\n\t\tinclude UXSTOCK_ACC_PATH.'/vc-addons/vc-service.php';\n\t\t\n\t}",
"function linkToDomElement( $appctx )\n\t\t{\n\t\t$appctx->Indent() ; echo( \"cmsnodes[$this->idx].linkToDomElement() ;\\n\" ) ;\n\t\t}",
"protected function setupViewPath()\n\t{\n\t\tlist($packageName, $routeName) = [$this->packageName, \\Request::route()->getName()];\n\t\t$this->view = \"${packageName}::pages.$routeName\";\n\t}",
"function _develop_action__theme__include_files() {\n\tinclude_once __DIR__ . '/class-calyx-server-state.php';\n\tinclude_once __DIR__ . '/samples/class-calyx-cpt-sample.php';\n}",
"public function plantilla(){\n # se usa este include para incluir la vista que contiene el codigo html\n include \"view/template.php\";\n\n }",
"protected function kbSetMedia()\n {\n /* CSS files */\n $this->context->controller->addCSS($this->_path . 'views/css/front/kb_front.css');\n \n /* JS files */\n $this->context->controller->addJS($this->_path . 'views/js/velovalidation.js');\n $this->context->controller->addJS($this->_path . 'views/js/firebase/firebase-app.js');\n $this->context->controller->addJS($this->_path . 'views/js/firebase/firebase-storage.js');\n $this->context->controller->addJS($this->_path . 'views/js/firebase/firebase-auth.js');\n $this->context->controller->addJS($this->_path . 'views/js/firebase/firebase-database.js');\n $this->context->controller->addJS($this->_path . 'views/js/firebase/firebase-messaging.js');\n $this->context->controller->addJS($this->_path . 'views/js/firebase/firebase.js');\n $this->context->controller->addJS($this->_path . 'views/js/service_worker_registeration_template.js');\n $this->context->controller->addJS($this->_path . 'views/js/front/kb_front.js');\n }",
"function renderApplication(){\n\tinclude getApplicationSystemPath() . \"/public/layout/layout.php\";\t\n}",
"public function plantilla(){\n\n include \"views/template.php\";#include(): Se utiliza para invocar el archivo que contiene el código html (es decir, incluye el template que está en la carpeta views)\n }",
"protected function bootExtensionComponents()\n {\n $path = realpath(__DIR__.'/../resources');\n\n $this->publishOrchestraLang($path);\n $this->publishJavascriptTransformerView($path);\n $this->addLanguageComponent('threef/entree', 'threef/entree', $path.'/lang');\n $this->addConfigComponent('threef/entree', 'threef/entree', $path.'/config');\n $this->addViewComponent('threef/entree', 'threef/entree', $path.'/views');\n }",
"public function loadAssets() {\r\n\t\tparent::loadAssets();\r\n\t\t$this->app->document->addScript('elements:download/assets/js/download.js');\r\n\t}",
"public function add()\n\t{\n\t\t// Add a Sub-Nav Link\n\t\tEvent::add('ushahidi_action.nav_admin_settings', array($this, '_settings_link'));\n\t\tEvent::add('ushahidi_action.nav_main_top', array($this, '_top_nav_link'));\t\t\n\t\t// Only add the events if we are on the main controller\n\t\tif (Router::$controller == 'main')\n\t\t{\n\t\t\tswitch (Router::$method)\n\t\t\t{\n\n\t\t\t\t// Hook into the main dashboard\n\t\t\t\tcase 'index':\n\t\t\t\t\tplugin::add_stylesheet('flickrwijit/media/css/style');\n\t\t\t\t\tplugin::add_stylesheet('../media/css/picbox/picbox');\n\t\t\t\t\tplugin::add_javascript('../media/js/picbox');\n\t\t\t\t\tEvent::add('ushahidi_action.main_sidebar', array($this, '_display_flickrwiji'));\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\telseif (Router::$controller == 'flickrwijit')\n\t\t{ \t\n\t\t\t// Add Flickrwijit to settings page\n\t\t\tswitch(Router::$method) \n\t\t\t{\n\t\t\t\tcase 'index':\n\t\t\t\t\t\n\t\t\t\t\t//Hook js and css files into flickrwijit page\n\t\t\t\t\tplugin::add_stylesheet('flickrwijit/media/css/style');\n\t\t\t\t\tplugin::add_stylesheet('../media/css/picbox/picbox');\n\t\t\t\t\tplugin::add_javascript('../media/js/picbox');\n\t\t\t\t\tbreak;\t\t\t\t\t\n\t\t\t}\n\t\t}\n\t}",
"function _creative_include_layout_additional_assets($file_name) {\n foreach (array('css', 'js') as $type) {\n $file_relative_path = CREATIVE_THEME_PATH . \"/$type/includes/$file_name.$type\";\n\n if (file_exists(DRUPAL_ROOT . '/' . $file_relative_path)) {\n call_user_func(\"drupal_add_$type\", $file_relative_path, array(\n 'group' => constant(strtoupper($type) . '_THEME'),\n ));\n }\n }\n}",
"public static function ViewFolder()\n {\n return dirname(dirname(__DIR__)).DIRECTORY_SEPARATOR.Configuration::getApplicationFolder().DIRECTORY_SEPARATOR.'View';\n }",
"function registe_mobile_navwalker(){\n require_once get_template_directory().'/walker/class-wp-bootstrap-navwalker-mobile.php';\n}",
"public function afficheMenu()\r\n\t\t{\r\n\t\t//appel de la vue du menu\r\n\t\trequire 'Vues/menu.php';\r\n\t\t}",
"public function makeLinkButton() {}",
"private function addAssets()\n {\n foreach (config('asgard.media.assets.media-partial-assets', []) as $assetName => $path) {\n $path = $this->assetFactory->make($path)->url();\n $this->assetManager->addAsset($assetName, $path);\n }\n }",
"public function pagina(){\r\n include\"vies/template.php\";\r\n }",
"function autocarga_de_controladores($nombredelaClase){\n include 'controllers/' . $nombredelaClase .'.php';\n }",
"public function nav()\n {\n $PagesAdmin=new LaraPagesController;\n $PagesAdmin->modelId='media';\n return $PagesAdmin->nav();\n }",
"protected function registerPaths()\n {\n // start up the framework stuff\n $path = JPATH_ROOT . '/plugins/system/zlframework/zlframework';\n $media = JPATH_ROOT . '/media/com_zoolanders';\n $cuselms = JPATH_ROOT . '/media/zoo/custom_elements';\n\n // register paths\n $this->app->path->register($path, 'zlfw');\n $this->app->path->register($media, 'zlmedia');\n\n $this->app->path->register($path . '/zlfield', 'zlfield');\n $this->app->path->register($path . '/zlfield/fields/elements', 'zlfields'); // temporal until all ZL Extensions adapted\n $this->app->path->register($path . '/zlfield/fields/elements', 'fields'); // necessary since ZOO 2.5.13\n\n $this->app->path->register($path . '/elements', 'elements');\n $this->app->path->register($cuselms, 'elements');\n\n $this->app->path->register($path . '/helpers', 'helpers');\n $this->app->path->register($path . '/models', 'models');\n $this->app->path->register($path . '/controllers', 'controllers');\n $this->app->path->register($path . '/classes', 'classes');\n\n // register classes\n $this->app->loader->register('ZLModel', 'models:zl.php');\n $this->app->loader->register('ZLModelItem', 'models:item.php');\n $this->app->loader->register('ElementPro', 'elements:pro/pro.php');\n $this->app->loader->register('ElementRepeatablepro', 'elements:repeatablepro/repeatablepro.php');\n $this->app->loader->register('ElementFilespro', 'elements:filespro/filespro.php');\n $this->app->loader->register('zlHelper', 'helpers:zl.php'); // necesary because of ZLElements old helper, this one overrides it\n $this->app->loader->register('ZLStorage', 'classes:zlstorage/ZLStorage.php');\n $this->app->loader->register('ZlfieldHelper', 'zlfield:zlfield.php');\n\n // register plugin path\n if ($path = $this->app->path->path('root:plugins/system/zoo_zlelements/zoo_zlelements')) {\n $this->app->path->register($path, 'zlpath');\n }\n\n // register elements path\n if ($path = $this->app->path->path('zlpath:elements')) {\n $this->app->path->register($path, 'elements');\n }\n\n // register fields path\n if ($path = $this->app->path->path('zlpath:fields')) {\n $this->app->path->register($path, 'zlfields');\n }\n\n // register plugin path\n if ($path = $this->app->path->path('root:plugins/system/zlframework/zlframework')) {\n $this->app->path->register($path, 'zlfw');\n }\n\n if ($path = JPATH_ROOT . '/media/zoo/custom_elements') {\n $this->app->path->register($path, 'elements'); // register custom elements path\n }\n }",
"function sidetab_ui(){\r\n\tglobal $base_over_ride;\r\n\tglobal $login_domain;\r\n\tinclude_once 'admin/sidetab-ui.php';\r\n}",
"public function getIncludeFileMenu(){\r\n global $xoTheme;\r\n\r\n\r\n $xoTheme->addScript(\"$url/modules/simantz/include/validatetext.js\");\r\n $xoTheme->addStylesheet(\"$url/modules/simantz/include/popup.css\");\r\n $xoTheme->addScript(\"$url/modules/simantz/include/popup.js\");\r\n $xoTheme->addScript('browse.php?Frameworks/jquery/jquery.js');\r\n $xoTheme->addScript(\"$url/modules/simantz/include/nitobi/nitobi.toolkit.js\");\r\n\r\n $xoTheme->addScript(\"$url/modules/simantz/include/nitobi/nitobi.grid/paginator.js\");\r\n $xoTheme->addStylesheet(\"$url/modules/simantz/include/nitobi/nitobi.grid/paginator.css\");\r\n\r\n $xoTheme->addStylesheet(\"$url/modules/simantz/include/nitobi/nitobi.grid/nitobi.grid.css\");\r\n $xoTheme->addStylesheet(\"$url/modules/simantz/include/nitobi/nitobi.tabstrip/nitobi.tabstrip.css\");\r\n $xoTheme->addStylesheet(\"$url/modules/simantz/include/nitobi/nitobi.combo/nitobi.combo.css\");\r\n $xoTheme->addScript(\"$url/modules/simantz/include/nitobi/nitobi.grid/nitobi.grid.js\");\r\n $xoTheme->addScript(\"$url/modules/simantz/include/nitobi/nitobi.tabstrip/nitobi.tabstrip.js\");\r\n $xoTheme->addScript(\"$url/modules/simantz/include/nitobi/nitobi.combo/nitobi.combo.js\");\r\n\r\n $xoTheme->addScript(\"$url/modules/simantz/include/firefox3_6fix.js\");\r\n }",
"public function whole() {\n\t\t$this->load->view('cnavmenu_whole_ttv', $this->_Config());\n }",
"private function generateFrontend()\n {\n #-- add needed css an js files\n $GLOBALS['TL_CSS'][] = 'bundles/homekitee/uikit-3.6.21/css/uikit.min.css';\n $GLOBALS['TL_JAVASCRIPT'][] = 'bundles/homekitee/uikit-3.6.21/js/uikit.min.js';\n $GLOBALS['TL_JAVASCRIPT'][] = 'bundles/homekitee/uikit-3.6.21/js/uikit-icons.min.js';\n }"
] | [
"0.6140455",
"0.59649295",
"0.56523764",
"0.5638391",
"0.5519531",
"0.54613215",
"0.54513586",
"0.54446524",
"0.5433712",
"0.54241866",
"0.542357",
"0.54210687",
"0.54114443",
"0.53261906",
"0.5247608",
"0.5234319",
"0.5216533",
"0.51956105",
"0.5189781",
"0.51892",
"0.5176278",
"0.51626563",
"0.5162405",
"0.516028",
"0.51600754",
"0.5151214",
"0.51133615",
"0.5091069",
"0.5086026",
"0.50831217",
"0.507229",
"0.505378",
"0.5051526",
"0.5050933",
"0.5050933",
"0.50351626",
"0.50265765",
"0.502555",
"0.50236315",
"0.50091136",
"0.50055736",
"0.49957046",
"0.49858144",
"0.49783736",
"0.49704933",
"0.49679685",
"0.49575916",
"0.49574682",
"0.49553326",
"0.49547306",
"0.49495098",
"0.4947625",
"0.49441293",
"0.49383637",
"0.49364516",
"0.49305615",
"0.492358",
"0.4922223",
"0.4911804",
"0.4907399",
"0.4907291",
"0.48997366",
"0.48996356",
"0.48947367",
"0.48934406",
"0.48905042",
"0.4886106",
"0.4883974",
"0.4878091",
"0.4872816",
"0.48690295",
"0.4868613",
"0.48676783",
"0.48630404",
"0.48574582",
"0.48556778",
"0.48555264",
"0.485377",
"0.48536342",
"0.48501453",
"0.48483756",
"0.48480484",
"0.48473826",
"0.48389503",
"0.48385754",
"0.48382828",
"0.48360226",
"0.48354414",
"0.48314202",
"0.4828247",
"0.48261347",
"0.48245898",
"0.4815158",
"0.4814573",
"0.48111776",
"0.481013",
"0.48070988",
"0.48036912",
"0.48025945",
"0.47993633",
"0.4798191"
] | 0.0 | -1 |
Run the database seeds. | public function run()
{
Category::create([
'name' => 'Garrafones',
'description' => 'Descripción Garrafones',
]);
Category::create([
'name' => 'Insumos',
'description' => 'Descripción Insumos',
]);
Category::create([
'name' => 'Repuestos',
'description' => 'Descripción Repuestos',
]);
Category::create([
'name' => 'Tuberías',
'description' => 'Descripción Tuberías',
]);
} | {
"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 |
Clear all previous vars | public function addVars($form)
{
$this->_parser->clearAllVars();
$this->_parser->form = $form;
$app = JFactory::getApplication();
$db = JFactory::getDBO();
$dateFormat = str_replace('%', '', F2cFactory::getConfig()->get('date_format') . ' H:i:s');
$nullDate = $db->getNullDate();
$joomlaId = $form->reference_id;
$modifiedUnix = ''; // Unix timestamp
$modifiedDate = ($form->modified != '' && $form->modified != $nullDate) ? JHTML::_('date', $form->modified, $dateFormat) : '';
if($form->modified != $nullDate)
{
$tmp = new JDate($form->modified);
$modifiedUnix = $tmp->toUnix();
}
$slug = ($form->alias) ? $joomlaId.':'.$form->alias : $joomlaId;
$catslug = ($form->catAlias) ? $form->catid.':'.$form->catAlias : $form->catid;
$link = 'index.php?option=com_content&view=article&id='. $slug . '&catid=' . $catslug;
$this->_parser->addVar('JOOMLA_ID', $joomlaId);
$this->_parser->addVar('JOOMLA_ARTICLE_LINK', $link);
$this->_parser->addVar('JOOMLA_ARTICLE_LINK_SEF', '{plgContentF2cSef}'.$slug.','.$catslug.'{/plgContentF2cSef}');
$this->_parser->addVar('JOOMLA_MODIFIED', $modifiedDate);
$this->_parser->addVar('JOOMLA_MODIFIED_RAW', $modifiedUnix);
$this->_parser->addVar('JOOMLA_MODIFIED_BY', $form->modified_by);
// Add F2C parameters to template
$this->_parser->addVar('F2C_IMAGES_PATH_THUMBS_RELATIVE', F2cFieldImage::GetThumbnailsPath($form->projectid, $form->id, true));
$this->_parser->addVar('F2C_IMAGES_PATH_THUMBS_ABSOLUTE', F2cFieldImage::GetThumbnailsPath($form->projectid, $form->id, false));
$this->_parser->addVar('F2C_IMAGES_PATH_RELATIVE', F2cFieldImage::GetImagesPath($form->projectid, $form->id, true));
$this->_parser->addVar('F2C_IMAGES_PATH_ABSOLUTE', F2cFieldImage::GetImagesPath($form->projectid, $form->id, false));
foreach($form->fields as $field)
{
$this->_parser->addFormVar($field);
}
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function clearVars() {\n\t\t$this->_engine->clearAllAssign();\n\t}",
"private function clearvariables()\n {\n $this->pointer = 0;\n $this->index = 0;\n $this->imagedata = array();\n $this->imageinfo = array();\n $this->handle = 0;\n $this->parsedfiles = array();\n }",
"private function resetVars()\n {\n $this->response = $this->calls = array();\n $this->hasCalls = $this->isBatchCall = false;\n }",
"private function clear_variable()\n\t\t{\n\t\t\t$this->count_item_found = 'none';\t\t\t\t\t\t\t\t\t// No item found\n\t\t\t$this->fulllistexpand = Array();\t\t\t\t\t\t\t\t\t// No item list to expand\n\t\t\t$this->sqllistinvolved = '';\t\t\t\t\t\t\t\t\t\t// ??? TODO\n\t\t\t$this->listinvolved = Array();\n\t\t\t$this->html_result = '';\n\t\t}",
"public function resetVariables()\n {\n $this->score = 0;\n $this->savedScore = 0;\n $this->points = 0;\n $this->playerMessage = null;\n $this->hasWon = false;\n }",
"public function reset()\n {\n $this->values[self::contractorstatics] = null;\n $this->values[self::stores] = array();\n $this->values[self::visited] = array();\n $this->values[self::review_info] = array();\n $this->values[self::customer_info] = array();\n $this->values[self::mark_price_info] = array();\n $this->values[self::more_url] = null;\n $this->values[self::order_tracking] = array();\n }",
"public function reset()\n {\n $this->values[self::_INSTANCE_INFO] = null;\n $this->values[self::_RSEED] = null;\n $this->values[self::_LOOTS] = array();\n $this->values[self::_HP_DROP] = array();\n }",
"public static function reset()\n {\n self::$toLoad = array();\n }",
"private function resetVariables()\n {\n $this->score = 0;\n $this->savedScore = 0;\n $this->playerMessage = null;\n $this->hasWon = false;\n }",
"public function reset()\n {\n $this->values[self::_GUILDS] = null;\n $this->values[self::_RESULT] = null;\n $this->values[self::_CREATE_COST] = null;\n }",
"public static function reset()\n {\n self::$SEO = [];\n self::$Imagens = [];\n self::$Videos = [];\n self::$Sounds = [];\n self::$CSS = [];\n self::$JS = [];\n }",
"public function reset()\n {\n $this->values[self::_CUR_STAGE] = null;\n $this->values[self::_RESET_TIMES] = null;\n $this->values[self::_HEROES] = array();\n $this->values[self::_STAGES] = array();\n $this->values[self::_HIRE_HERO] = null;\n }",
"public function reset()\n {\n $this->values[self::_TEAM_ID] = null;\n $this->values[self::_PLAYER] = null;\n $this->values[self::_HERO_BASES] = array();\n $this->values[self::_HERO_DYNAS] = array();\n $this->values[self::_RES_GOT] = null;\n $this->values[self::_SVR_ID] = null;\n $this->values[self::_DISPLAY_SVR_ID] = null;\n $this->values[self::_SVR_NAME] = null;\n }",
"public function clearVars()\r\n {\r\n $this->_smarty->clearAllAssign();\r\n $this->assign('this', $this);\r\n }",
"public function reset() {\n $this->_property = false;\n $this->_interface = false;\n $this->_variable = false;\n }",
"public function reset() {\n $this->_property = false;\n $this->_interface = false;\n $this->_variable = false;\n }",
"function reset_data() {\n\t\t$this->data_layer()->clear();\n\t\t$this->log = null;\n\t\t$this->location = null;\n\t\t$this->tax_location = null;\n\t}",
"public function reset()\n {\n $this->env = array();\n $this->object_handlers = array();\n $this->pagetitle = '';\n }",
"public function reset()\n {\n $this->values[self::_RESULT] = null;\n $this->values[self::_STAGE_ID] = null;\n $this->values[self::_REWARDS] = array();\n $this->values[self::_HEROES] = array();\n }",
"function reset()\n {\n $this->mBlockHandles = array();\n $this->mBlockKeys = array();\n $this->mGlobalAssignArray = array();\n }",
"public function reset()\n {\n $this->values[self::_CURRENT_RAID_ID] = null;\n $this->values[self::_SUMMARY] = array();\n $this->values[self::_STAGE_PASS] = null;\n $this->values[self::_IS_CAN_JUMP] = null;\n }",
"public function reset()\n {\n $this->values[self::_GUILDS] = array();\n $this->values[self::_RESULT] = null;\n $this->values[self::_CREATE_COST] = null;\n }",
"public function reset()\n {\n $this->values[self::_RESULT] = null;\n $this->values[self::_LINEUP] = array();\n $this->values[self::_GS] = null;\n }",
"public function reset(){}",
"public function reset()\n {\n $this->values[self::_LADDER_NOTIFY] = null;\n $this->values[self::_NEW_MAIL] = null;\n $this->values[self::_GUILD_CHAT] = null;\n $this->values[self::_ACTIVITY_NOTIFY] = null;\n $this->values[self::_ACTIVITY_REWARD] = null;\n $this->values[self::_RELEASE_HEROES] = array();\n $this->values[self::_EXCAV_RECORD] = null;\n $this->values[self::_GUILD_DROP] = null;\n $this->values[self::_PERSONAL_CHAT] = null;\n $this->values[self::_SPLITABLE_HEROES] = null;\n }",
"public function reset()\n {\n $this->values[self::_RESULT] = null;\n $this->values[self::_GS] = null;\n }",
"public function reset()\n {\n $this->values[self::_RESULT] = null;\n $this->values[self::_GS] = null;\n }",
"private function reset(): void\n {\n $this->values = [];\n $this->bg_colors = [];\n $this->striped = false;\n $this->animate = false;\n $this->height = null;\n }",
"public function reset()\n {\n $this->values[self::_SUMMARY] = null;\n $this->values[self::_RESULT] = null;\n $this->values[self::_REWARDS] = array();\n $this->values[self::_APPLY_REWARDS] = array();\n $this->values[self::_STAGE_OLD_PROGRESS] = null;\n $this->values[self::_JOIN_TIMES] = null;\n $this->values[self::_BREAK_HISTORY] = null;\n }",
"public function reset()\n {\n $this->values[self::_RESULT] = null;\n $this->values[self::_RSEED] = null;\n $this->values[self::_SELF_HEROES] = array();\n $this->values[self::_HEROES] = array();\n $this->values[self::_IS_ROBOT] = null;\n }",
"public function reset()\r\n\t{\r\n\t\t$this->first = null;\r\n\t\t$this->alreadyIncluded = array();\r\n\t\t$this->depths = array();\r\n\t}",
"public function reset()\n {\n $this->values[self::_INFO] = null;\n $this->values[self::_WORSHIP] = null;\n $this->values[self::_DROP_INFO] = null;\n $this->values[self::_TO_CHAIRMAN] = null;\n }",
"public function reset()\n {\n $this->values[self::LIVETYPE_] = null;\n $this->values[self::CONTINUEFLAG_] = null;\n $this->values[self::DRESSINGFLAG_] = null;\n }",
"public function reset()\n {\n $this->values[self::_STAGE] = null;\n $this->values[self::_WAVE] = null;\n $this->values[self::_HP] = array();\n $this->values[self::_RECORD] = array();\n $this->values[self::_CHALLENGER] = null;\n $this->values[self::_CHALLENGER_STATUS] = null;\n }",
"public function reset();",
"public function reset();",
"public function reset();",
"public function reset();",
"public function reset();",
"public function reset();",
"public function reset();",
"public function reset();",
"public function reset();",
"public function reset();",
"public function reset();",
"public function reset();",
"public function reset()\n {\n $this->values[self::_RESULT] = null;\n $this->values[self::_RSEED] = null;\n $this->values[self::_HERO_BASES] = array();\n $this->values[self::_HERO_DYNAS] = array();\n }",
"protected function reset() {\n\t\t$this->data = array();\n\t}",
"public function reset()\n {\n $this->values[self::_RAID_ID] = null;\n $this->values[self::_STAGE_INDEX] = null;\n $this->values[self::_WAVE_INDEX] = null;\n $this->values[self::_HP_INFO] = array();\n }",
"public function reset()\n {\n $this->values[self::_BOX_TYPE] = null;\n $this->values[self::_LEFT_CNT] = null;\n $this->values[self::_LAST_GET_TIME] = null;\n $this->values[self::_HAS_FIRST_DRAW] = null;\n }",
"private function resetAll()\n {\n $this->title = null;\n $this->caption = null;\n $this->categories = null;\n $this->image = null;\n $this->tags = null;\n $this->imagePath = null;\n $this->postId = null;\n }",
"public function reset()\n {\n $this->values[self::_RESULT] = null;\n $this->values[self::_SHOP] = null;\n $this->values[self::_SSHOP] = null;\n }",
"public function reset()\n {\n $this->values[self::system] = null;\n $this->values[self::platform] = null;\n $this->values[self::channel] = null;\n $this->values[self::version] = null;\n }",
"public static function reset() {\n\t\tself::$objects = array();\n\t}",
"public function reset()\n {\n $this->values[self::_STAGE_ID] = null;\n $this->values[self::_DPS_RANK] = array();\n $this->values[self::_FIRST_PASS] = null;\n $this->values[self::_FAST_PASS] = null;\n }",
"public function reset() {\n $this->data = array(); \n $this->input = array();\n $this->missing = array();\n $this->invalid = array();\n $this->errors = array();\n $this->error = false;\n }",
"public static function reset(): void\n {\n self::$defined = null;\n self::$isChannel = false;\n }",
"public function reset()\n {\n $this->values[self::_DIAMOND] = null;\n $this->values[self::_GUILDPOINT] = null;\n $this->values[self::_DPS] = null;\n $this->values[self::_OLD_DPS] = null;\n $this->values[self::_OLD_SUMMARY] = null;\n }",
"public function clear() {\n\t\t$vars = get_object_vars($this);\n\t\tforeach ($vars as $key => $val) {\n\t\t\t$this->$key = null;\n\t\t}\n\t}",
"private function resetAll(){\n $this->score = ['heritage'=> 0,'relax'=> 0,'sightseeing'=> 0,'weather'=> 0,'populated'=> 0];\n $this->answeredQuestions = [];\n $this->answersId = [];\n }",
"protected function reset() {}",
"protected function reset() {}",
"protected function reset() {}",
"function clear_TLVs() {\r\n $this->tlvs = array();\r\n $this->tbt = array();\r\n }",
"public function reset()\n {\n $this->values[self::_MONEY] = null;\n $this->values[self::_RMB] = null;\n $this->values[self::_HEROES] = array();\n $this->values[self::_ITEMS] = array();\n }",
"public function reset()\n {\n $this->values[self::_BASE] = null;\n $this->values[self::_DYNA] = null;\n }",
"public function reset()\n {\n $this->values[self::_BASE] = null;\n $this->values[self::_DYNA] = null;\n }",
"public function reset()\n {\n $this->values[self::_BASE] = null;\n $this->values[self::_DYNA] = null;\n }",
"public function reset()\n {\n $this->values[self::_SUMMARY] = null;\n $this->values[self::_OPPOS] = array();\n $this->values[self::_IS_ROBOT] = null;\n }",
"public function reset()\n {\n $this->values[self::INIT_BU] = null;\n $this->values[self::BU] = null;\n $this->values[self::GOLD] = null;\n $this->values[self::VIGOUR] = null;\n }",
"public function reset()\n {\n $this->values[self::_OPEN_PANEL] = null;\n $this->values[self::_QUERY_OPPO] = null;\n $this->values[self::_START_BAT] = null;\n $this->values[self::_END_BAT] = null;\n $this->values[self::_RESET] = null;\n $this->values[self::_DRAW_REWARD] = null;\n }",
"function clear()\n {\n $this->meta_name = \"\";\n $this->vocab = \"\";\n $this->text = \"\";\n $this->lang = \"\";\n $this->attrs = array();\n }",
"public static function clear()\n\t\t{\n\t\t\tself::$data = [];\n\t\t\tself::$file = [];\n\t\t}",
"public function reset()\n {\n $this->values[self::_SELF_TEAM] = null;\n $this->values[self::_OPPO_TEAM] = null;\n $this->values[self::_RESULT] = null;\n $this->values[self::_RECORD_ID] = null;\n $this->values[self::_RECORD_SVRID] = null;\n }",
"public function reset() {\n $this->num_aliases = 0;\n $this->alias2class = array();\n $this->alias2table = array();\n }",
"public function reset() {\r\n $this->header = [];\r\n $this->cookie = [];\r\n $this->content = NULL;\r\n }",
"public function reset() {}",
"public function reset() {}",
"public function reset() {}",
"public function reset() {}",
"public function reset() {}",
"public function reset() {}",
"public function reset() {}",
"public function reset()\n {\n $this->values[self::_ID] = null;\n $this->values[self::_STAGE_ID] = null;\n $this->values[self::_LEFT_TIME] = null;\n $this->values[self::_START_TIME] = null;\n $this->values[self::_PROGRESS] = null;\n $this->values[self::_STAGE_PROGRESS] = null;\n $this->values[self::_BATTLE_USER_ID] = null;\n }",
"public function reset() {}",
"public function reset() {}",
"public function reset() {}",
"public function reset()\n {\n $this->values[self::_ID] = null;\n $this->values[self::_PROGRESS] = null;\n $this->values[self::_BEGIN_TIME] = null;\n $this->values[self::_REST_TIMES] = null;\n $this->values[self::_CUR_STAGE_ID] = null;\n }",
"public function reset()\n {\n $this->values[self::_RESULT] = null;\n $this->values[self::_INFO] = null;\n }",
"public function reset()\n {\n $this->values[self::BOXID] = null;\n $this->values[self::DRAFTID] = null;\n $this->values[self::TOBOXID] = null;\n $this->values[self::TODEPARTMENTID] = null;\n $this->values[self::DOCUMENTSIGNATURES] = array();\n $this->values[self::PROXYBOXID] = null;\n $this->values[self::PROXYDEPARTMENTID] = null;\n }",
"public function reset()\n {\n $this->values[self::_RESULT] = null;\n $this->values[self::_HERO] = null;\n }",
"public function reset()\n {\n $this->values[self::_RESULT] = null;\n $this->values[self::_HERO] = null;\n }",
"public function reset()\n {\n $this->values[self::_RESULT] = null;\n $this->values[self::_HERO] = null;\n }",
"public function reset() {\n $this->values[self::TOTAL] = null;\n $this->values[self::COUNT] = null;\n $this->values[self::TOTAL_BUSLINE_NUM] = null;\n $this->values[self::AREAID] = null;\n }",
"public function reset()\n {\n $this->values[self::RET] = null;\n $this->values[self::CMDLIST] = null;\n $this->values[self::CONTINUEFLAG] = null;\n $this->values[self::SYNC_KEY] = null;\n $this->values[self::STATUS] = null;\n $this->values[self::ONLINEVERSION] = null;\n $this->values[self::SVRTIME] = null;\n }",
"public function reset()\n {\n $this->values[self::_RANK] = null;\n $this->values[self::_LEFT_COUNT] = null;\n $this->values[self::_LAST_BT_TIME] = null;\n $this->values[self::_BUY_TIMES] = null;\n $this->values[self::_LINEUP] = array();\n $this->values[self::_GS] = null;\n $this->values[self::_OPPOS] = array();\n }",
"public function reset()\n {\n $this->values[self::_LOOT] = array();\n $this->values[self::_ITEMS] = array();\n $this->values[self::_SHOP] = null;\n $this->values[self::_SSHOP] = null;\n }",
"public function reset()\n {\n $this->values[self::RMB] = null;\n $this->values[self::CHARGE_SUM] = null;\n $this->values[self::HEROES] = array();\n $this->values[self::RECHARGE_LIMIT] = array();\n $this->values[self::_MONTH_CARD] = array();\n }",
"public function reset()\n {\n $this->values[self::_PLAYER] = null;\n $this->values[self::_HERO] = array();\n }",
"public function reset()\n {\n $this->values[self::_CURRENT] = null;\n $this->values[self::_LASTCHANGE] = null;\n $this->values[self::_TODAYBUY] = null;\n $this->values[self::_LASTBUY] = null;\n }",
"private function clear()\n {\n $this->files = [];\n $this->cdr_ofs = 0;\n $this->cdr_len = 0;\n $this->opt = [];\n }"
] | [
"0.81121385",
"0.79158586",
"0.784211",
"0.7645595",
"0.7581778",
"0.75516385",
"0.7506902",
"0.75064266",
"0.7485839",
"0.7473348",
"0.7461043",
"0.74526197",
"0.74505043",
"0.74421966",
"0.7433034",
"0.7433034",
"0.74244434",
"0.7412227",
"0.7401564",
"0.7395936",
"0.73899466",
"0.73754406",
"0.7368773",
"0.7367108",
"0.73664004",
"0.7357333",
"0.7357333",
"0.733059",
"0.73149675",
"0.7310535",
"0.7302285",
"0.7300475",
"0.7290346",
"0.72838545",
"0.7283306",
"0.7283306",
"0.7283306",
"0.7283306",
"0.7283306",
"0.7283306",
"0.7283306",
"0.7283306",
"0.7283306",
"0.7283306",
"0.7283306",
"0.7283306",
"0.7281702",
"0.72804534",
"0.72705203",
"0.7262288",
"0.7258653",
"0.72530156",
"0.7250754",
"0.724851",
"0.7239547",
"0.7236562",
"0.72359353",
"0.7232151",
"0.7229863",
"0.7229187",
"0.7228434",
"0.7227237",
"0.72269285",
"0.72213817",
"0.72198325",
"0.7209613",
"0.7209613",
"0.7209613",
"0.7209155",
"0.7207578",
"0.7204881",
"0.7193203",
"0.7189494",
"0.7183924",
"0.7178609",
"0.7171125",
"0.7169856",
"0.7169856",
"0.7169856",
"0.7169856",
"0.7169856",
"0.7169856",
"0.7169856",
"0.7169261",
"0.71690685",
"0.71690685",
"0.71690685",
"0.7165845",
"0.7165482",
"0.71652925",
"0.7156922",
"0.7156922",
"0.7156922",
"0.71559",
"0.71546936",
"0.71512336",
"0.7142838",
"0.7141453",
"0.71413064",
"0.71372837",
"0.7134897"
] | 0.0 | -1 |
Entry point for all webhook operations | public function indexAction()
{
$listToken = Mage::app()->getRequest()->getParam('t');
$data = $this->getInputStream();
$this->consumeEvents($listToken, $data);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function webhook()\n {\n $this->paymentSettings = $this->getPaymentSettings();\n $payload = file_get_contents(\"php://input\");\n $signature = (isset($_SERVER['HTTP_X_PAYSTACK_SIGNATURE']) ? $_SERVER['HTTP_X_PAYSTACK_SIGNATURE'] : '');\n /* It is a good idea to log all events received. Add code *\n * here to log the signature and body to db or file */\n if (!$signature) {\n // only a post with paystack signature header gets our attention\n exit();\n }\n // confirm the event's signature\n if ($signature !== hash_hmac('sha512', $payload, $this->paymentSettings['secret_key'])) {\n // silently forget this ever happened\n exit();\n }\n $webhook_response = json_decode($payload, true);\n if ('charge.success' != $webhook_response['event']) {\n exit;\n }\n try {\n $orderId = $this->updatePaymentStatus($webhook_response['data']['reference']);\n } catch (Exception $e) {\n // Invalid payload\n http_response_code(400);\n exit();\n }\n http_response_code(200);\n exit();\n }",
"public function handle_webhook() {\n\t\t$payload = file_get_contents( 'php://input' );\n\t\tif ( ! empty( $payload ) && $this->validate_webhook( $payload ) ) {\n\t\t\t$data = json_decode( $payload, true );\n\t\t\t$event_data = $data['event']['data'];\n\n\t\t\tself::log( 'Webhook received event: ' . print_r( $data, true ) );\n\n\t\t\tif ( ! isset( $event_data['metadata']['order_id'] ) ) {\n\t\t\t\t// Probably a charge not created by us.\n\t\t\t\texit;\n\t\t\t}\n\n\t\t\t$order_id = $event_data['metadata']['order_id'];\n\n\t\t\t$this->_update_order_status( wc_get_order( $order_id ), $event_data['timeline'] );\n\n\t\t\texit; // 200 response for acknowledgement.\n\t\t}\n\n\t\twp_die( 'Coinbase Webhook Request Failure', 'Coinbase Webhook', array( 'response' => 500 ) );\n\t}",
"public function webhookAction()\n {\n $modelWebhook = Mage::getModel('chargepayment/webhook');\n\n $isDebugCard = Mage::getModel('chargepayment/creditCard')->isDebug();\n $isDebugJs = Mage::getModel('chargepayment/creditCardJs')->isDebug();\n $isDebugKit = Mage::getModel('chargepayment/creditCardKit')->isDebug();\n $isDebugHosted = Mage::getModel('chargepayment/hosted')->isDebug();\n\n $isDebug = $isDebugCard || $isDebugJs || $isDebugKit || $isDebugHosted ? true : false;\n\n if ($isDebug) {\n Mage::log(file_get_contents('php://input'), null, CheckoutApi_ChargePayment_Model_Webhook::LOG_FILE);\n Mage::log(json_decode(file_get_contents('php://input')), null, CheckoutApi_ChargePayment_Model_Webhook::LOG_FILE);\n }\n\n if (!$this->getRequest()->isPost()) {\n $this->getResponse()->setHttpResponseCode(400);\n return;\n }\n\n $request = new Zend_Controller_Request_Http();\n $key = $request->getHeader('Authorization');\n\n if (!$modelWebhook->isValidPublicKey($key)) {\n $this->getResponse()->setHttpResponseCode(401);\n return;\n }\n\n $data = json_decode(file_get_contents('php://input'));\n\n if (empty($data)) {\n $this->getResponse()->setHttpResponseCode(400);\n return;\n }\n\n $eventType = $data->eventType;\n\n if (!$modelWebhook->isValidResponse($data)) {\n $this->getResponse()->setHttpResponseCode(400);\n return;\n }\n\n switch ($eventType) {\n case CheckoutApi_ChargePayment_Model_Webhook::EVENT_TYPE_CHARGE_CAPTURED:\n $result = $modelWebhook->captureOrder($data);\n break;\n case CheckoutApi_ChargePayment_Model_Webhook::EVENT_TYPE_CHARGE_REFUNDED:\n $result = $modelWebhook->refundOrder($data);\n break;\n case CheckoutApi_ChargePayment_Model_Webhook::EVENT_TYPE_CHARGE_VOIDED:\n $result = $modelWebhook->voidOrder($data);\n break;\n case CheckoutApi_ChargePayment_Model_Webhook::EVENT_TYPE_INVOICE_CANCELLED:\n $result = $modelWebhook->voidOrder($data);\n break;\n default:\n $this->getResponse()->setHttpResponseCode(500);\n return;\n }\n\n $httpCode = $result ? 200 : 400;\n\n $this->getResponse()->setHttpResponseCode($httpCode);\n }",
"public function run() {\n\t\t// If this particular request is not a hook, something is wrong.\n\t\tif (!isset($this->server[self::MERGADO_HOOK_AUTH_HEADER])) {\n\t\t\tthrow new \\RuntimeException(sprintf(\n\t\t\t\t\"%s is to be used only for handling hooks sent from Mergado.\n\t\t\t\tMergado-Apps-Hook-Auth is missing.\",\n\t\t\t\t__CLASS__\n\t\t\t));\n\t\t}\n\n\t\tif (!$decoded = json_decode($this->rawRequest, true)) {\n\t\t\tthrow new \\RuntimeException(sprintf(\n\t\t\t\t\"%s cannot handle request, because the data to be handled is empty.\",\n\t\t\t\t__CLASS__\n\t\t\t));\n\t\t} elseif (!isset($decoded['action'])) {\n\t\t\tthrow new \\RuntimeException(sprintf(\n\t\t\t\t\"%s cannot handle the hook, because the hook action is undefined.\",\n\t\t\t\t__CLASS__\n\t\t\t));\n\t\t};\n\n\t\t$this->handle($decoded['action'], $decoded);\n\n\t}",
"public function testPostWebhooks()\n {\n }",
"public function perform()\n {\n $hook = $this->args['hook'];\n $subscriber = $this->args['subscriber'];\n $event_data = $this->args['event_data'];\n $url = (array_key_exists('url', $subscriber['variables'])) ? $subscriber['variables']['url'] : '';\n\n $classname = 'AllPlayers\\\\Webhooks\\\\' . $hook['name'];\n $webhook = new $classname($subscriber['variables']);\n $webhook_data = array(\n 'event_name' => $hook['name'],\n 'event_data' => $event_data\n );\n if (!empty($this->test_url)) {\n $webhook_data['original_url'] = $url;\n $url = $this->test_url;\n }\n $webhook->post($url);\n $result = $webhook->send($webhook_data);\n }",
"public function webhook(Request $request)\n {\n $verified = Flutterwave::verifyWebhook();\n \n // if it is a charge event, verify and confirm it is a successful transaction\n if ($verified && $request->event == 'charge.completed' && $request->data->status == 'successful') {\n $verificationData = Flutterwave::verifyPayment($request->data['id']);\n if ($verificationData['status'] === 'success') {\n // process for successful charge\n \n }\n \n }\n \n // if it is a transfer event, verify and confirm it is a successful transfer\n if ($verified && $request->event == 'transfer.completed') {\n \n $transfer = Flutterwave::transfers()->fetch($request->data['id']);\n \n if($transfer['data']['status'] === 'SUCCESSFUL') {\n // update transfer status to successful in your db\n } else if ($transfer['data']['status'] === 'FAILED') {\n // update transfer status to failed in your db\n // revert customer balance back\n } else if ($transfer['data']['status'] === 'PENDING') {\n // update transfer status to pending in your db\n }\n \n }\n }",
"public function webHook()\n {\n// try\n// {\n\n $this->bodyObject = json_decode($this->bodyReceived);\n\n if (!is_object($this->bodyObject))\n {\n \\Log::error('[Parse Body Failed] invalid body');\n throw new \\Exception('Invalid request null');\n }\n\n return $this->bodyObject;\n\n// if ($this->TtgPaymentHistory->checkDuplicateWebHook($this->bodyObject->id))\n// {\n// throw new \\Exception('[NOTICE] web hook already saved, web hook id:' . $this->bodyObject->id);\n// }\n//\n// if ($this->TtgPaymentHistory->checkDuplicateAgreementPayment($this->bodyObject->resource))\n// {\n// throw new \\Exception('[NOTICE] agreement payment already saved, sub id:' . $this->bodyObject->resource->billing_agreement_id . \", trans id: \" . $this->bodyObject->resource->id);\n// }\n\n\n\n// } catch (\\Exception $e)\n// {\n \\Log::error('error web hook');\n// $this->PayPal->payPalLog('[Save Event Data Failed] event type:\"' . $this->bodyObject->event_type . '\" web hook id:\"' . $this->bodyObject->id . '\"', $e);\n// $this->response->statusCode(501);\n// $this->response->body($e->getMessage());\n// $this->response->send();\n// }\n // this is necessary\n// exit();\n }",
"public function webhook()\n {\n $bodyReceived = file_get_contents('php://input');\n\n // Receive HTTP headers that you received from PayPal webhook.\n $headers = getallheaders();\n\n /**\n * Uppercase all the headers for consistency\n */\n $headers = array_change_key_case($headers, CASE_UPPER);\n\n $signatureVerification = new \\PayPal\\Api\\VerifyWebhookSignature();\n $signatureVerification->setWebhookId(env('PAYPAL_WEBHOOK_ID'));\n $signatureVerification->setAuthAlgo($headers['PAYPAL-AUTH-ALGO']);\n $signatureVerification->setTransmissionId($headers['PAYPAL-TRANSMISSION-ID']);\n $signatureVerification->setCertUrl($headers['PAYPAL-CERT-URL']);\n $signatureVerification->setTransmissionSig($headers['PAYPAL-TRANSMISSION-SIG']);\n $signatureVerification->setTransmissionTime($headers['PAYPAL-TRANSMISSION-TIME']);\n\n $webhookEvent = new \\PayPal\\Api\\WebhookEvent();\n $webhookEvent->fromJson($bodyReceived);\n $signatureVerification->setWebhookEvent($webhookEvent);\n $request = clone $signatureVerification;\n\n try {\n $output = $signatureVerification->post($this->apiContext);\n } catch(\\Exception $ex) {\n print_r($ex->getMessage());\n exit(1);\n }\n\n $verificationStatus = $output->getVerificationStatus();\n $responseArray = json_decode($request->toJSON(), true);\n\n $event = $responseArray['webhook_event']['event_type'];\n\n if ($verificationStatus == 'SUCCESS')\n {\n switch($event)\n {\n case 'BILLING.SUBSCRIPTION.CANCELLED':\n case 'BILLING.SUBSCRIPTION.SUSPENDED':\n case 'BILLING.SUBSCRIPTION.EXPIRED':\n case 'BILLING_AGREEMENTS.AGREEMENT.CANCELLED':\n\n // $user = User::where('payer_id',$responseArray['webhook_event']['resource']['payer']['payer_info']['payer_id'])->first();\n $this->updateStatus($responseArray['webhook_event']['resource']['payer']['payer_info']['payer_id'], 0);\n break;\n }\n }\n echo $verificationStatus;\n exit(0);\n }",
"public function webhook_action ()\n\t{\n\t\ttry\n\t\t{\n\t\t\t$id = isset($_GET['order_id']) ? $_GET['order_id'] : 0;\n\n\t\t\tif (empty($id))\n\t\t\t{\n\t\t\t\theader(\"HTTP/1.0 404 Not Found\");\n\t\t\t\tdie(\"No order ID received\");\n\t\t\t}\n\n\t\t\t$transaction_id = $this->get_transaction_id_from_order_id($id);\n\t\t\t$payment = self::get_api()->payments->get($transaction_id);\n\n\t\t\t$this->update_status($id, $payment->status);\n\t\t\t$this->log($transaction_id, $payment->status, $id);\n\t\t}\n\t\tcatch (Mollie_API_Exception $e)\n\t\t{\n\t\t\techo \"API call failed: \" . htmlspecialchars($e->getMessage());\n\t\t}\n\n\t\tdie(\"OK\");\n\t}",
"public function invoke(PayPalApiStruct $webhook, Context $context): void;",
"public function webhook(){\r\n\t\t\r\n\t\t$json = array();\r\n\r\n\t\tif($this->request->server['REQUEST_METHOD'] == 'POST'){\r\n\t\t\t\r\n\t\t\t$post = array();\r\n\t\t\tif(isset($this->request->post['coin_short_name']) && $this->request->post['coin_short_name'] != '' && isset($this->request->post['address']) && $this->request->post['address'] != '' && isset($this->request->post['type']) && $this->request->post['type'] != ''){\r\n\t\t\t\t$post = $this->request->post;\r\n\t\t\t}else{\r\n\t\t\t\t$post_json = json_decode(file_get_contents('php://input'),TRUE);\r\n\r\n\t\t\t\tif(isset($post_json['coin_short_name']) && $post_json['coin_short_name'] != '' && isset($post_json['address']) && $post_json['address'] != '' && isset($post_json['type']) && $post_json['type'] != '' ){\r\n\t\t\t\t\t$post = $post_json;\r\n\t\t\t\t}else{\r\n\t\t\t\t\t$json['flag'] = 0;\r\n\t\t\t\t\t$json['msg'] = \"Required paramters are not found\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif(!empty($post)){\r\n\r\n\t\t\t\tif($post['type'] == 'receive'){\r\n\t\t\t\t\t$this->load->model('checkout/order');\r\n\r\n\t\t\t\t\t$address = $post['address'];\r\n\r\n\t\t\t\t\t/*** check if address exists in oc_coinremitter_order ***/\r\n\t\t\t\t\t$this->load->model('extension/coinremitter/payment/coinremitter');\r\n\t\t\t\t\t$order_info = $this->model_extension_coinremitter_payment_coinremitter->getOrderByAddress($address);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(!empty($order_info)){\r\n\r\n\t\t\t\t\t\tif($order_info['payment_status'] == 'pending' || $order_info['payment_status'] == 'under paid'){\r\n\r\n\t\t\t\t\t\t\t$orderId = $order_info['order_id'];\r\n\r\n\t\t\t\t\t\t\t$order_cart = $this->model_checkout_order->getOrder($orderId);\r\n\t\t\t\t\t\t\tif(!empty($order_cart)){\r\n\r\n\t\t\t\t\t\t\t\t/*** check if expired time of invoice is defined or not. If defined then check if invoice has any transaction or not. If no transaction is found and invoice time is expired then change invoice status as expired ***/\r\n\r\n\t\t\t\t\t\t\t\t/*** Get webhook by address***/\r\n\t\t\t\t\t\t\t\t$status = '';\r\n\t\t\t\t\t\t\t\tif(isset($order_info['expire_on']) && $order_info['expire_on'] != ''){\r\n\t\t\t\t\t\t\t\t\tif(time() >= strtotime($order_info['expire_on'])){\r\n\t\t\t\t\t\t\t\t\t\t$getWebhookByAddressRes = $this->model_extension_coinremitter_payment_coinremitter->getWebhookByAddress($address);\t\r\n\t\t\t\t\t\t\t\t\t\tif(empty($getWebhookByAddressRes)){\r\n\t\t\t\t\t\t\t\t\t\t\t//update payment_status,status as expired\r\n\t\t\t\t\t\t\t\t\t\t\t$status = 'expired';\r\n\t\t\t\t\t\t\t\t\t\t\t$update_arr = array('payment_status' => $status);\r\n\t\t\t\t\t\t\t\t\t\t\t$this->model_extension_coinremitter_payment_coinremitter->updateOrder($orderId,$update_arr);\r\n\t\t\t\t\t\t\t\t\t\t\t$update_arr = array('status' => ucfirst($status));\r\n\t\t\t\t\t\t\t\t\t\t\t$this->model_extension_coinremitter_payment_coinremitter->updatePaymentStatus($orderId,$update_arr);\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\tif($order_cart['order_status'] != 'Canceled'){\r\n\t\t\t\t\t\t\t\t\t\t\t\t/*** Update order history status to canceled, add comment ***/\r\n\t\t\t\t\t\t $comments = 'Order #'.$orderId;\r\n\t\t\t\t\t\t $is_customer_notified = true;\r\n\t\t\t\t\t\t $this->model_checkout_order->addHistory($orderId, 7, $comments, $is_customer_notified); // 7 = Canceled\t\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t}\t\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\tif($status == ''){\r\n\r\n\t\t\t\t\t\t\t\t\t$coin = $post['coin_short_name'];\r\n\t\t\t\t\t\t\t\t\t$trxId = $post['id'];\r\n\r\n\t\t\t\t\t\t\t\t\t/*** now get wallet data from oc_coinremitter_wallet with use of coin ***/\r\n\t\t\t\t\t\t\t\t\t$wallet_info = $this->model_extension_coinremitter_payment_coinremitter->getWallet($coin);\r\n\t\t\t\t\t\t\t\t\tif(!empty($wallet_info)){\r\n\r\n\t\t\t\t\t\t\t\t\t\t/*** now get transaction from coinremitter api call ***/\r\n\t\t\t\t\t\t\t\t\t\t$get_trx_params = array(\r\n\t\t\t\t\t\t\t\t\t\t\t'url'\t\t=> 'get-transaction',\r\n\t\t\t\t\t\t\t\t\t\t\t'api_key'\t=>\t$wallet_info['api_key'],\r\n\t\t\t\t\t\t 'password'\t=>\t$wallet_info['password'],\r\n\t\t\t\t\t\t 'id'\t\t=>\t$trxId,\r\n\t\t\t\t\t\t 'coin'\t\t=>\t$coin\r\n\t\t\t\t\t\t\t\t\t\t);\r\n\r\n\t\t\t\t\t\t\t\t\t\t$getTransaction = $this->obj_curl->commonApiCall($get_trx_params);\r\n\t\t\t\t\t\t\t\t\t\tif(!empty($getTransaction) && isset($getTransaction['flag']) && $getTransaction['flag'] == 1){\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t$transaction = $getTransaction['data'];\r\n\r\n\t\t\t\t\t\t\t\t\t\t\tif(isset($transaction['type']) && $transaction['type'] == 'receive'){\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t/*** now check if transaction exists in oc_coinremitter_webhook or not if does not exist then insert else update confirmations ***/\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t$webhook_info = $this->model_extension_coinremitter_payment_coinremitter->getWebhook($transaction['id']);\r\n\t\t\t\t\t\t\t\t\t\t\t\tif(empty($webhook_info)){\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t//insert record\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t$insert_arr = array(\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'order_id' => $orderId,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'address' => $transaction['address'],\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'transaction_id' => $transaction['id'],\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'txId' => $transaction['txid'],\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'explorer_url' => $transaction['explorer_url'],\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'paid_amount' => $transaction['amount'],\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'coin' => $transaction['coin_short_name'],\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'confirmations' => $transaction['confirmations'],\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'paid_date' => $transaction['date']\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t);\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t$inserted_id = $this->model_extension_coinremitter_payment_coinremitter->addWebhook($insert_arr);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tif($inserted_id > 0){\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$json['flag'] = 1;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$json['msg'] = \"Inserted successfully\";\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$json['flag'] = 0;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$json['msg'] = \"system error. Please try again later.\";\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t//update confirmations if confirmation is less than 3\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tif($webhook_info['confirmations'] < 3){\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$update_confirmation = array(\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'confirmations' => $transaction['confirmations'] <= 3 ? $transaction['confirmations'] : 3 \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$this->model_extension_coinremitter_payment_coinremitter->updateTrxConfirmation($webhook_info['transaction_id'],$update_confirmation);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t} \r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t$json['flag'] = 1;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t$json['msg'] = \"confirmations updated successfully\";\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t/*** order paid process start ***/\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t/*** Now, get all webhook transactions which have lesser than 3 confirmations ***/\r\n\t\t\t\t\t\t\t\t\t\t\t\t$webhook_res = $this->model_extension_coinremitter_payment_coinremitter->getSpecificWebhookTrxByAddress($address);\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t/*** Get wallet info if and only if webhook_res has atleast one data ***/\r\n\t\t\t\t\t\t\t\t\t\t\t\tif(!empty($webhook_res)){\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tforeach ($webhook_res as $webhook) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t/*** Get confirmation from coinremitter api (get-transaction) ***/\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$get_trx_params['id'] = $webhook['transaction_id']; \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$getTransactionRes = $this->obj_curl->commonApiCall($get_trx_params);\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(!empty($getTransactionRes) && isset($getTransactionRes['flag']) && $getTransactionRes['flag'] == 1){\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$transactionData = $getTransactionRes['data'];\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$update_confirmation = array(\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'confirmations' => $transactionData['confirmations'] <= 3 ? $transactionData['confirmations'] : 3 \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$this->model_extension_coinremitter_payment_coinremitter->updateTrxConfirmation($webhook['transaction_id'],$update_confirmation);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t/*** Get sum of paid amount of all transations which have 3 or more than 3 confirmtions ***/\r\n\t\t\t\t\t\t\t\t\t\t\t\t$total_paid_res = $this->model_extension_coinremitter_payment_coinremitter->getTotalPaidAmountByAddress($address);\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t$total_paid = 0;\r\n\t\t\t\t\t\t\t\t\t\t\t\tif(isset($total_paid_res['total_paid']) && $total_paid_res['total_paid'] > 0 ){\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t$total_paid = $total_paid_res['total_paid'];\r\n\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t$status = '';\r\n\t\t\t\t\t\t\t\t\t\t\t\tif($total_paid == $order_info['crp_amount']){\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t$status = 'paid';\r\n\t\t\t\t\t\t\t\t\t\t\t\t}else if($total_paid > $order_info['crp_amount']){\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t$status = 'over paid';\r\n\t\t\t\t\t\t\t\t\t\t\t\t}else if($total_paid != 0 && $total_paid < $order_info['crp_amount']){\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t$status = 'under paid';\r\n\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\tif($status != ''){\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t//update payment_status,status\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t$update_arr = array('payment_status' => $status);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t$this->model_extension_coinremitter_payment_coinremitter->updateOrder($orderId,$update_arr);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t$update_arr = array('status' => ucfirst($status));\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t$this->model_extension_coinremitter_payment_coinremitter->updatePaymentStatus($orderId,$update_arr);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tif($status == 'paid' || $status == 'over paid' || $status == 'under paid'){\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t/*** Update order status as complete ***/\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$this->add_order_success_history($orderId);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t/*** order paid process end ***/\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\t\t\t\t\t$json['flag'] = 0; \r\n\t\t\t\t\t\t\t\t\t\t\t\t$json['msg'] = 'Transaction type is not receive';\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\t\t\t\t$msg = 'Something went wrong while getting transactions. Please try again later'; \r\n\t\t\t\t\t\t\t\t\t\t\tif(isset($getTransaction['msg']) && $getTransaction['msg'] != ''){\r\n\t\t\t\t\t\t\t\t\t\t\t\t$msg = $getTransaction['msg']; \r\n\t\t\t\t\t\t\t\t\t\t\t} \r\n\t\t\t\t\t\t\t\t\t\t\t$json['flag'] = 0; \r\n\t\t\t\t\t\t\t\t\t\t\t$json['msg'] = $msg; \r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\t\t\t$json['flag'] = 0;\r\n\t\t\t\t\t\t\t\t\t\t$json['msg'] = \"Wallet not found\";\t\r\n\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\t\t$json['flag'] = 0;\r\n\t\t\t\t\t\t\t\t\t$json['msg'] = \"Order is expired\";\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\t$json['flag'] = 0;\r\n\t\t\t\t\t\t\t\t$json['msg'] = \"Order not found\";\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t$json['flag'] = 0;\r\n\t\t\t\t\t\t\t$json['msg'] = \"Order status is neither a 'pending' nor a'under paid'\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\t$json['flag'] = 0;\r\n\t\t\t\t\t\t$json['msg'] = \"Address not found\";\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\t$json['flag'] = 0;\r\n\t\t\t\t\t$json['msg'] = \"Invalid type\";\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\t$json['flag'] = 0;\r\n\t\t\t\t$json['msg'] = \"Required paramters are not found\";\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\t$json['flag'] = 0;\r\n\t\t\t$json['msg'] = \"Only post request allowed\";\r\n\t\t}\r\n\t\t\r\n\t\t$this->response->addHeader('Content-Type: application/json');\r\n\t\t$this->response->setOutput(json_encode($json));\r\n\t}",
"public function webhook():bool\n {\n\n }",
"public function execute()\n {\n /** @var \\Magento\\Framework\\App\\Request\\Http $request */\n $request = $this->getRequest();\n\n /** @var \\Zend\\Http\\Headers $header */\n $header = $request->getHeaders();\n\n /** @var bool $result */\n $result = false;\n $msg = \"\";\n\n if ($this->authenticate($header)) {\n $content = $request->getContent();\n\n $data = $this->logitrail->getApi()->processWebhookData($content);\n\n $this->logger->debug(json_encode($data, JSON_UNESCAPED_UNICODE));\n\n switch ($data[\"event_type\"]) {\n case \"product.inventory.change\":\n $result = $this->handleInventoryChange($data);\n $msg = \"success\";\n break;\n case \"order.shipped\":\n $result = $this->handleOrderShipped($data);\n $msg = \"success\";\n break;\n default:\n $result = true;\n $msg = \"Handling for event type {$data[\"event_type\"]} not implemented\";\n break;\n }\n }\n\n if ($result) {\n header('HTTP/1.1 200 OK');\n echo($msg);\n } else {\n header('HTTP/1.0 400 Bad Request');\n echo('fail');\n }\n exit;\n }",
"private function processWebHook() {\n\t\t\n\t\t// If there is a user ID, add it to the global scope for access\n\t\tif ( isset($this->decodedWebhook['originalRequest']['data']['user']['userId']) ) {\n\t\t\t$this->googleUserId = $this->decodedWebhook['originalRequest']['data']['user']['userId'];\n\t\t}\n \n }",
"public function webhook(Request $request): Response\n {\n return call_user_func($this->webHookController, $request);\n }",
"public function __construct()\n {\n parent::__construct();\n $this->webhook = new Webhook;\n }",
"public function webhookHandler()\n {\n // Get Update\n $update = $this->telegram->commandsHandler(true);\n\n // Get Message\n $message = $update->getMessage();\n\n // Edge Case?\n if ($message === null) {\n return 'Ok';\n }\n\n // Track Data\n $this->logChatroom($message);\n\n // Okie Doke\n return 'Ok';\n }",
"public function handleWebhookRequest(Request $httpRequest)\n {\n dd(\"@todo handle the webhook request of Mailjet\");\n }",
"public function boot()\n {\n\n Route::bind('facebook_webhook' , function(){\n\n\n $facebookWebhook = new FacebookWebhook();\n $request = request();\n $verifyToken = 'Axb123xyz';\n if($request->isMethod('get')){\n\n if($verifyToken == $request->input('hub_verify_token')){\n $facebookWebhook->hubChallenge = $request->input('hub_verify_challenge');\n }\n }\n else if($request->isMethod('post')){\n echo 'in post request';\n\n $facebookWebhook = new FacebookWebhook();\n $facebookWebhook->field = $request->input('entry.0.changes.0.field');\n\n if($facebookWebhook->field == 'live_videos'){\n $facebookWebhook->webhookLiveVideoId = $request->input('entry.0.changes.0.value.id');\n $facebookWebhook->webhookLiveVideoStatus =$request->input('entry.0.changes.0.value.status');\n }\n else if($facebookWebhook->field == 'feed'){\n\n $facebookWebhook->item = $request->input('entry.0.changes.0.value.item');\n\n if($facebookWebhook->item == 'comment'){\n $facebookWebhook->webhookCommentPostId = $request->input('entry.0.changes.0.value.post_id');\n $facebookWebhook->webhookCommentId = $request->input('entry.0.changes.0.value.comment_id');\n $facebookWebhook->webhookCommentSenderId = $request->input('entry.0.changes.0.value.sender_id');\n $facebookWebhook->webhookCommentSenderName = $request->input('entry.0.changes.0.value.sender_name');\n $facebookWebhook->webhookCommentBody = $request->input('entry.0.changes.0.value.message');\n }\n }\n\n }\n return $facebookWebhook;\n });\n }",
"public function handleRequest() {}",
"public function setUp()\n {\n $this->subscriber['division_id'] = 12345;\n $this->data['group']['timezone'] = 'America/Chicago';\n $this->data['unit_test'] = 1;\n\n $this->webhook = new SimpleWebhook($this->subscriber, $this->data);\n }",
"public function testGetWebhook()\n {\n }",
"public function addWebhook()\n\t{\n\t\t$this->getMandrill()->webhooks->add($this->getWebhookUrl(), 'Mailing Machinegun Webhook', array(\n\t\t\t//'send',\n\t\t\t'hard_bounce',\n\t\t\t'soft_bounce',\n\t\t\t'open',\n\t\t\t'click',\n\t\t\t'spam',\n\t\t\t//'unsub',\n\t\t\t//'reject',\n\t\t));\n\t}",
"public function hook();",
"public function processApi();",
"public function testGetWebhooks()\n {\n }",
"public function run_request() {\r\n\t\t// Do nothing if we don't\r\n\t\tif ( empty( $_GET['wpmudev-hub'] ) ) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\r\n\t\t$this->register_internal_actions();\r\n\t\t$this->register_plugin_actions();\r\n\r\n\t\t//get the json\r\n\t\t$raw_json = file_get_contents( 'php://input' );\r\n\r\n\t\t$this->validate_hash( $_GET['wpmudev-hub'], $raw_json );\r\n\r\n\t\t$body = json_decode( $raw_json );\r\n\t\tif ( ! isset( $body->action ) ) {\r\n\t\t\twp_send_json_error( array( 'code' => 'invalid_params', 'message' => 'The \"action\" parameter is missing' ) );\r\n\t\t}\r\n\t\tif ( ! isset( $body->params ) ) {\r\n\t\t\twp_send_json_error( array( 'code' => 'invalid_params', 'message' => 'The \"params\" object is missing' ) );\r\n\t\t}\r\n\r\n\t\tif ( isset( $this->actions[ $body->action ] ) ) {\r\n\t\t\t$this->current_action = $body->action;\r\n\r\n\t\t\t//log it if turned on\r\n\t\t\tif ( WPMUDEV_API_DEBUG ) {\r\n\t\t\t\t$this->timer = microtime( true ); //start the timer\r\n\t\t\t\t$log = '[Hub API call] %s %s';\r\n\t\t\t\t$log .= \"\\n Request params: %s\\n\";\r\n\r\n\t\t\t\t$msg = sprintf(\r\n\t\t\t\t\t$log,\r\n\t\t\t\t\t$_GET['wpmudev-hub'],\r\n\t\t\t\t\t$body->action,\r\n\t\t\t\t\tjson_encode( $body->params, JSON_PRETTY_PRINT )\r\n\t\t\t\t);\r\n\t\t\t\terror_log( $msg );\r\n\t\t\t}\r\n\r\n\t\t\tcall_user_func( $this->actions[ $body->action ], $body->params, $body->action, $this );\r\n\r\n\t\t\t$this->send_json_success(); //send success in case the callback didn't respond\r\n\t\t}\r\n\r\n\t\t// When the callback function did not send a response assume error.\r\n\t\twp_send_json_error( array(\r\n\t\t\t'code' => 'unregistered_action', 'message' => 'This action is not registered. The required plugin is not installed, updated, or configured properly.'\r\n\t\t) );\r\n\t}",
"private function public_hooks()\n\t{\n\t}",
"public function testGetWebhookEvents()\n {\n }",
"public function check_for_webhook() {\n\t\tif ( ( 'POST' !== $_SERVER['REQUEST_METHOD'] )\n\t\t\t|| ! isset( $_GET['wc-api'] )\n\t\t\t|| ( 'wc_stripe' !== $_GET['wc-api'] )\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\t$request_body = file_get_contents( 'php://input' );\n\t\t$request_headers = array_change_key_case( $this->get_request_headers(), CASE_UPPER );\n\n\t\t// Validate it to make sure it is legit.\n\t\tif ( $this->is_valid_request( $request_headers, $request_body ) ) {\n\t\t\t$this->process_webhook( $request_body );\n\t\t\tstatus_header( 200 );\n\t\t\texit;\n\t\t} else {\n\t\t\tWC_Stripe_Logger::log( 'Incoming webhook failed validation: ' . print_r( $request_body, true ) );\n\t\t\tstatus_header( 400 );\n\t\t\texit;\n\t\t}\n\t}",
"public function run()\n {\n $post = file_get_contents($this->getInputFile());\n if (substr($post, 0, 5) == '<?xml') {\n //pingback\n $xs = xmlrpc_server_create();\n xmlrpc_server_register_method(\n $xs, 'pingback.ping', array($this, 'handlePingbackPing')\n );\n $out = xmlrpc_server_call_method($xs, $post, null);\n\n $resp = $this->getPingbackResponder();\n $resp->sendHeader('HTTP/1.0 200 OK');\n $resp->sendXml($out);\n\n } else if (isset($_POST['source']) && isset($_POST['target'])) {\n //webmention\n $res = $this->handleRequest($_POST['source'], $_POST['target']);\n $resp = $this->getWebmentionResponder();\n $resp->send($res);\n\n } else {\n //unknown\n $resp = $this->getPingbackResponder();\n $resp->sendHeader('HTTP/1.0 400 Bad Request');\n $resp->sendHeader('Content-Type: text/html');\n $resp->sendOutput($this->unknownRequest);\n }\n }",
"public function run()\r\n {\r\n // exit();\r\n // 兼容Content Type为application/json的数据接收\r\n if (isset($_SERVER['CONTENT_TYPE']) && preg_match(\"/\\w+\\/\\w+([\\-\\+]\\w+)*/\", $_SERVER['CONTENT_TYPE'], $result)) {\r\n $content_type = $result[0];\r\n switch ($content_type) {\r\n case 'multipart/form-data':\r\n case 'application/x-www-form-urlencoded':\r\n if ($_SERVER['REQUEST_METHOD'] == 'PUT') {\r\n try {\r\n $this->parsePut();\r\n } catch (\\Exception $e) {\r\n\r\n }\r\n global $_PUT;\r\n $_POST = $_PUT;\r\n }\r\n break;\r\n case 'application/json':\r\n if ($_SERVER['REQUEST_METHOD'] == 'PUT') {\r\n global $_PUT;\r\n $php_input = file_get_contents('php://input');\r\n $_PUT = (array) json_decode($php_input, 1);\r\n $_POST = $_PUT;\r\n } else {\r\n $php_input = file_get_contents('php://input');\r\n $_POST = (array) json_decode($php_input, 1);\r\n }\r\n\r\n break;\r\n case 'application/xml':\r\n case 'text/xml':\r\n $php_input = file_get_contents('php://input');\r\n // 听说并没有成熟的xml解析工具?\r\n break;\r\n }\r\n }\r\n\r\n }",
"public function validateWebhookCall()\n {\n // If the webhook was called with an invalid method, throw an error\n if($_SERVER['REQUEST_METHOD'] != 'POST'){\n die(json_encode([\n 'success' => false,\n 'error' => 'invalid_method',\n ]));\n }\n\n // If the webhook was called without any auth header, throw another error\n if (!isset($_SERVER['HTTP_AUTHORIZATION']) || empty($_SERVER['HTTP_AUTHORIZATION'])) {\n die(json_encode([\n 'success' => false,\n 'error' => 'no_auth_header',\n ]));\n }\n\n if($_SERVER['HTTP_AUTHORIZATION'] != Config::i()->getSXApiKey()){\n die(json_encode([\n 'success' => false,\n 'error' => 'invalid_auth',\n ]));\n }\n }",
"public function hook() {\n\t\t// the WPML API is not included by default\n\t\trequire_once ICL_PLUGIN_PATH . '/inc/wpml-api.php';\n\n\t\t$this->hook_actions();\n\t\t$this->hook_filters();\n\t}",
"public function webhook_request(Request $request)\n {\n\n Log::debug('WebhookController webhook_request');\n\n $input = $request->all();\n Log::debug(print_r($input, true));\n $data = $input['obj'];\n\n Log::debug($data);\n Log::debug('message');\n Log::debug($data['message']);\n\n Log::debug($data);\n\n if ($data['message'] === 'ta-set-unique-address') {\n broadcast(new ContractsInstantiate($data));\n }\n if ($data['message'] === 'ta-get-unique-address') {\n broadcast(new ContractsInstantiate($data));\n }\n if ($data['message'] === 'ta-set-key-value-pair') {\n broadcast(new ContractsInstantiate($data));\n }\n if ($data['message'] === 'tas-event') {\n $event = new SmartContractEvent();\n $event->event_type = 'tas-event';\n $event->payload = json_encode($data);\n $_data = $data['data'];\n $event->transaction_hash = $_data['transactionHash'];\n // $event->attestation_hash = $_data['returnValues']['attestationKeccak'];\n // $event->user_address = $_data['returnValues']['_identifiedAddress'];\n // $event->ta_address = $_data['returnValues']['msg_sender'];\n $event->event = $_data['event'];\n $event->save();\n\n $data_local = $data['data'];\n if($data_local['event'] === 'EVT_setAttestation') {\n $returnValues = $data_local['returnValues'];\n $msg_sender_address = $returnValues['msg_sender'];\n $attestation_hash = $returnValues['attestationKeccak'];\n $identified_address = $returnValues['_identifiedAddress'];\n $public_data = $returnValues['_publicData_0'];\n $documents_matrix_encrypted = $returnValues['_documentsMatrixEncrypted_0'];\n $document_decrypt = $data_local['document_decrypt'];\n $availability_address_encrypted = $returnValues['_availabilityAddressEncrypted'];\n $jurisdiction = $returnValues['_jurisdiction'];\n\n $type = $data_local['type'];\n\n $attestation = new SmartContractAttestation();\n $attestation->ta_account = $msg_sender_address;\n $attestation->jurisdiction = $jurisdiction;\n $attestation->effective_time = $_data['returnValues']['_effectiveTime'];\n $attestation->expiry_time = $_data['returnValues']['_expiryTime'];\n $attestation->public_data = $public_data;\n $attestation->documents_matrix_encrypted = $documents_matrix_encrypted;\n $attestation->availability_address_encrypted = $availability_address_encrypted;\n $attestation->is_managed = $_data['returnValues']['_isManaged'];\n $attestation->attestation_hash = $attestation_hash;\n $attestation->transaction_hash = $_data['transactionHash'];\n $attestation->user_account = $identified_address;\n\n $attestation->save();\n\n $url = $this->helper_url.'/ta-get-attestation-components?attestation_hash='.$attestation_hash;\n Log::debug('WebhookController EVT_setAttestation url');\n Log::debug($url);\n\n $client = new Client();\n $res = $client->request('GET', $url);\n if($res->getStatusCode() == 200) {\n\n $response = json_decode($res->getBody());\n Log::debug('WebhookController EVT_setAttestation ta-get-attestation-components');\n Log::debug($response);\n\n\n } else {\n Log::error('WebhookController EVT_setAttestation ta-get-attestation-components: ' . $res->getStatusCode());\n }\n }\n\n broadcast(new ShyftSmartContractEvent($data));\n }\n\n if ($data['message'] === 'tam-event') {\n $event = new SmartContractEvent();\n $event->event_type = 'tam-event';\n $event->payload = json_encode($data);\n $_data = $data['data'];\n $event->transaction_hash = $_data['transactionHash'];\n $event->event = $_data['event'];\n $event->save();\n\n $data_local = $data['data'];\n if($data_local['event'] === 'EVT_verifyTrustAnchor') {\n $returnValues = $data_local['returnValues'];\n $account_address = $returnValues['trustAnchorAddress'];\n \n $ta = VerifiedTrustAnchor::firstOrCreate(['account_address' => $account_address]);\n $ta->save();\n }\n\n broadcast(new ShyftSmartContractEvent($data));\n }\n\n if ($data['message'] === 'create-new-user-account') {\n\n // var obj = { user_id: user_id, message: \"create-new-user-account\", data: data };\n $input['user_id'] = $data['user_id'];\n\n $ta = TrustAnchor::firstOrCreate(['user_id' => $input['user_id']]);\n\n // var account = {prefname:prefname, address:address, private_key:privateKey};\n $account = $data['data']['account'];\n $ta->ta_prefname = $account['prefname'];\n $ta->account_address = $account['address'];\n $ta->private_key = $account['private_key'];\n $ta->save();\n\n $user = User::findOrFail($input['user_id']);\n $user->trustAnchor()->save($ta);\n\n $data['data'] = $ta;\n broadcast(new ContractsInstantiate($data));\n }\n if ($data['message'] === 'ta-is-verified') {\n broadcast(new ContractsInstantiate($data));\n }\n if ($data['message'] === 'ta-reload-account') {\n broadcast(new ContractsInstantiate($data));\n }\n if ($data['message'] === 'ta-event') {\n $event = new SmartContractEvent();\n $event->event_type = 'ta-event';\n $event->payload = json_encode($data);\n $event->save();\n broadcast(new ShyftSmartContractEvent($data));\n }\n if ($data['message'] === 'taed-event') {\n Log::debug('taed-event');\n $event = new SmartContractEvent();\n $event->event_type = 'taed-event';\n $event->payload = json_encode($data);\n $event->save();\n $data_local = $data['data'];\n\n if ($data_local['event'] === \"EVT_setDataRetrievalParametersCreated\") {\n $extra_data = new TrustAnchorExtraData();\n\n $extra_data->transaction_hash = $data_local['transactionHash'];\n $extra_data->trust_anchor_address = $data_local['returnValues']['_trustAnchorAddress'];\n $extra_data->endpoint_name = $data_local['returnValues']['_endpointName'];\n $extra_data->ipv4_address = $data_local['ipv4_address'];\n $extra_data->save();\n }\n // $account = $data_local['returnValues']['_trustAnchorAddress'];\n // $endpoint_hash = $data_local['returnValues']['_endpointName'];\n // $id = 1;\n // $url = $this->helper_url.'/ta-get-endpoint-name?user_id='.$id.'&account='.$account.'&endpoint_hash='.$endpoint_hash;\n // $client = new Client();\n // $res = $client->request('GET', $url);\n // if($res->getStatusCode() == 200) {\n\n // $response = json_decode($res->getBody());\n // Log::debug('ContractsController ta_get_endpoint_name');\n // Log::debug($response);\n\n\n // } else {\n // Log::error('ContractsController ta_get_endpoint_name: ' . $res->getStatusCode());\n // }\n\n broadcast(new ShyftSmartContractEvent($data));\n }\n if ($data['message'] === 'taedu-event') {\n Log::debug('taedu-event');\n $event = new SmartContractEvent();\n $event->event_type = 'taedu-event';\n $event->payload = json_encode($data);\n $event->save();\n $data_local = $data['data'];\n\n if ($data_local['event'] === \"EVT_setTrustAnchorKeyValuePairCreated\") {\n $extra_data = new TrustAnchorExtraDataUnique();\n\n $extra_data->transaction_hash = $data_local['transactionHash'];\n $extra_data->trust_anchor_address = $data_local['returnValues']['_trustAnchorAddress'];\n $extra_data->key_value_pair_name = $data_local['returnValues']['_keyValuePairName'];\n $extra_data->key_value_pair_value = $data_local['returnValues']['_keyValuePairValue'];\n $extra_data->save();\n }\n\n if ($data_local['event'] === \"EVT_setTrustAnchorKeyValuePairUpdated\") {\n\n $extra_data = TrustAnchorExtraDataUnique::firstOrNew(['key_value_pair_name' => $data_local['returnValues']['_keyValuePairName'], 'trust_anchor_address' => $data_local['returnValues']['_trustAnchorAddress']]);\n\n $extra_data->transaction_hash = $data_local['transactionHash'];\n $extra_data->trust_anchor_address = $data_local['returnValues']['_trustAnchorAddress'];\n $extra_data->key_value_pair_name = $data_local['returnValues']['_keyValuePairName'];\n $extra_data->key_value_pair_value = $data_local['returnValues']['_keyValuePairValue'];\n $extra_data->save();\n }\n\n broadcast(new ShyftSmartContractEvent($data));\n }\n if ($data['message'] === 'ta-set-jurisdiction') {\n broadcast(new ContractsInstantiate($data));\n }\n if ($data['message'] === 'ta-create-user') {\n\n $trust_anchor_user_id = $data['ta_user_id'];\n $tau = TrustAnchorUser::findOrFail($trust_anchor_user_id);\n $tau->account_address = $data['data']['account']['address'];\n $tau->private_key = $data['data'] ['account']['private_key'];\n $tau->save();\n\n #save btc and eth to user account\n # {\"address\":address, \"public_key\": publicKey, \"private_key\": privateKey};\n $bitcoinAccount = $data['data']['bitcoinAccount'];\n $cwa = new CryptoWalletAddress();\n $cwa->address = $bitcoinAccount['address'];\n $cwa->public_key = $bitcoinAccount['public_key'];\n $cwa->private_key = $bitcoinAccount['private_key'];\n $cwa->trust_anchor_user_id = $tau->id;\n $cwa->trust_anchor_id = $tau->trust_anchor_id;\n $cwa->crypto_wallet_type_id = CryptoWalletType::where('wallet_type', 'BTC')->first()->id;\n $cwa->save();\n\n $ethereumAccount = $data['data']['ethereumAccount'];\n $cwa = new CryptoWalletAddress();\n $cwa->address = $ethereumAccount['address'];\n $cwa->public_key = $ethereumAccount['public_key'];\n $cwa->private_key = $ethereumAccount['private_key'];\n $cwa->trust_anchor_user_id = $tau->id;\n $cwa->trust_anchor_id = $tau->trust_anchor_id;\n $cwa->crypto_wallet_type_id = CryptoWalletType::where('wallet_type', 'ETH')->first()->id;\n $cwa->save();\n\n $data['data']['account'] = $tau->account_address;\n broadcast(new ContractsInstantiate($data));\n }\n if ($data['message'] === 'ta-set-attestation') {\n\n $result = $data['data'];\n\n $ta = TrustAnchor::where('account_address', $result['ta_address'])->first();\n $tau = TrustAnchorUser::where('account_address', $result['user_address'])->first();\n\n $taua = new TrustAnchorUserAttestation();\n $taua->trust_anchor_id = $ta->id;\n $taua->trust_anchor_user_id = $tau->id;\n $taua->attestation_hash = $result['resultAttestationKeccak'];\n $taua->save();\n\n\n $ta->trustAnchorUserAttestation()->save($taua);\n $tau->trustAnchorUserAttestation()->save($taua);\n\n broadcast(new ContractsInstantiate($data));\n\n }\n\n if ($data['message'] === 'ta-set-attestation-error') {\n broadcast(new ContractsInstantiate($data));\n }\n\n if ($data['message'] === 'ta-register-jurisdiction') {\n broadcast(new ContractsInstantiate($data));\n }\n\n if ($data['message'] === 'ta-register-jurisdiction-error') {\n broadcast(new ContractsInstantiate($data));\n }\n\n if ($data['message'] === 'ta-get-balance') {\n broadcast(new ContractsInstantiate($data));\n }\n if ($data['message'] === 'ta-request-tokens') {\n broadcast(new ContractsInstantiate($data));\n }\n if ($data['message'] === 'ta-get-user-attestations') {\n\n broadcast(new ContractsInstantiate($data));\n }\n if ($data['message'] === 'ta-get-attestation-components-in-array') {\n Log::debug('ta-get-attestation-components-in-array');\n Log::debug(print_r($data, true));\n $result = $data['data'][0];\n $country = Country::where('id', hexdec($result['jurisdiction']))->first();\n $list = [['field' => 'TA Address', 'data' => $result['trustAnchorAddress']],\n ['field' => 'User Address', 'data' => $result['user_address']],\n ['field' => 'Jurisdiction', 'data' => $country->name],\n\n ['field' => 'Type Hash', 'data' => $result['publicData']],\n ['field' => 'Memo Hash', 'data' => $result['availabilityAddressEncrypted']],\n ['field' => 'Document Hash', 'data' => $result['documentsMatrixEncrypted']],\n ['field' => 'Type Decoded', 'data' => $result['type']],\n\n\n ['field' => 'Document Encode', 'data' => $result['document_encode']],\n ['field' => 'Document Decoded', 'data' => $result['document']],\n ['field' => 'Memo Decoded', 'data' => $result['memo']]];\n\n\n $data['data'] = $list;\n broadcast(new ContractsInstantiate($data));\n }\n\n if ($data['message'] === 'ta-get-attestation-components') {\n Log::debug('ta-get-attestation-components');\n Log::debug(print_r($data, true));\n\n $data_local = $data['data'];\n Log::debug(print_r($data_local, true));\n\n if ($data_local['type'] == 'WALLET') {\n\n $crypto_address = $data_local['document'];\n Log::debug('crypto_address');\n Log::debug($crypto_address);\n\n $sca = SmartContractAttestation::where('attestation_hash', $data_local['attestation_hash'])->first();\n $sca->public_data_decoded = $data_local['type'];\n $sca->documents_matrix_encrypted_decoded = $data_local['document'];\n $sca->availability_address_encrypted_decoded = $data_local['memo'];\n\n $sca->save();\n\n $sender = TrustAnchorUser::where('account_address', $sca->user_account)->first();\n $sender_ta = TrustAnchor::where('account_address', $data_local['trustAnchorAddress'])->first();\n\n $crypto_wallet_address = CryptoWalletAddress::where('address', $crypto_address)->first();\n\n if ($crypto_wallet_address && $sender && $sender_ta) {\n\n Log::debug('crypto_wallet_address');\n Log::debug($crypto_wallet_address);\n\n $receiver_id = $crypto_wallet_address->trust_anchor_user_id;\n\n $receiver = TrustAnchorUser::where('id', $crypto_wallet_address->trust_anchor_user_id)->first();\n $receiver_ta_id = $crypto_wallet_address->trust_anchor_id;\n $receiver_ta = TrustAnchor::where('id', $receiver_ta_id)->first();\n $crypto_assoc = new TrustAnchorAssociationCrypto();\n $crypto_assoc->crypto_address = $crypto_address;\n\n if($sender) {\n $crypto_assoc->sender_account_address = $sender->account_address;\n $crypto_assoc->sender_account_prefname = $sender->prefname;\n $crypto_assoc->sender_dob = $sender->dob;\n $crypto_assoc->sender_gender = $sender->gender;\n $crypto_assoc->sender_jurisdiction = $sender->jurisdiction;\n }\n if($receiver) {\n $crypto_assoc->receiver_account_address = $receiver->account_address;\n $crypto_assoc->receiver_account_prefname = $receiver->prefname;\n $crypto_assoc->receiver_dob = $receiver->dob;\n $crypto_assoc->receiver_gender = $receiver->gender;\n $crypto_assoc->receiver_jurisdiction = $receiver->jurisdiction;\n }\n\n if($sender_ta) {\n $crypto_assoc->sender_ta_account_address = $sender_ta->account_address;\n $crypto_assoc->sender_ta_assoc_prefname = $sender_ta->ta_prefname;\n }\n\n if($receiver_ta) {\n $crypto_assoc->receiver_ta_account_address = $receiver_ta->account_address;\n $crypto_assoc->receiver_ta_assoc_prefname = $receiver_ta->ta_prefname;\n }\n\n $crypto_assoc->save();\n }\n #trigger Kyc Template\n app('App\\Http\\Controllers\\KycTemplateController')->attestation($data_local['attestation_hash']);\n }\n }\n\n\n if ($data['message'] === 'smart-contract-transaction') {\n\n\n Log::debug(print_r($data, true));\n\n $result = $data['data'];\n\n $transaction = SmartContractTransaction::firstOrNew(['transaction_hash' => $result['transaction']]);\n $transaction->save();\n\n }\n\n if ($data['message'] === 'get-smart-contract-transaction') {\n\n Log::debug('get-smart-contract-transaction');\n Log::debug(print_r($data, true));\n $result = $data['data'];\n $transaction = SmartContractTransaction::where('transaction_hash', $result['hash'])->first();\n if ($transaction) {\n $transaction->nonce = $result['nonce'];\n $transaction->block_hash = $result['blockHash'];\n $transaction->block_number = $result['blockNumber'];\n $transaction->transaction_index = $result['transactionIndex'];\n $transaction->from_address = $result['from'];\n $transaction->to_address = $result['to'];\n $transaction->value = $result['value'] / 1000000000000000000;\n $transaction->gas = $result['gas'];\n $transaction->gas_price = $result['gasPrice'];\n $transaction->payload = json_encode($result);\n\n $transaction->save();\n }\n\n\n }\n\n return response()->json(['message' => 'success'], 200);\n }",
"public function process_webhook( $request_body ) {\n\t\t$notification = json_decode( $request_body );\n\n\t\tswitch ( $notification->type ) {\n\t\t\tcase 'source.chargeable':\n\t\t\t\t$this->process_webhook_payment( $notification );\n\t\t\t\tbreak;\n\n\t\t\tcase 'source.canceled':\n\t\t\t\t$this->process_webhook_source_canceled( $notification );\n\t\t\t\tbreak;\n\n\t\t\tcase 'charge.succeeded':\n\t\t\t\t$this->process_webhook_charge_succeeded( $notification );\n\t\t\t\tbreak;\n\n\t\t\tcase 'charge.failed':\n\t\t\t\t$this->process_webhook_charge_failed( $notification );\n\t\t\t\tbreak;\n\n\t\t\tcase 'charge.captured':\n\t\t\t\t$this->process_webhook_capture( $notification );\n\t\t\t\tbreak;\n\n\t\t\tcase 'charge.dispute.created':\n\t\t\t\t$this->process_webhook_dispute( $notification );\n\t\t\t\tbreak;\n\n\t\t\tcase 'charge.refunded':\n\t\t\t\t$this->process_webhook_refund( $notification );\n\t\t\t\tbreak;\n\n\t\t\tcase 'review.opened':\n\t\t\t\t$this->process_review_opened( $notification );\n\t\t\t\tbreak;\n\n\t\t\tcase 'review.closed':\n\t\t\t\t$this->process_review_closed( $notification );\n\t\t\t\tbreak;\n\n\t\t}\n\t}",
"public function pingppWebhooks() : void\n { \n $responseCode = 200;\n http_response_code($responseCode);\n\n while(@ob_end_clean());\n flush();\n \n register_shutdown_function([$this, \"processAfterOrderPaied\"]);\n exit();\n }",
"public function handleWebhook()\n {\n $payload = (array) json_decode(Request::getContent(), true);\n \n $method = 'handle'.studly_case(str_replace('.', '_', $payload['type']));\n \n if (method_exists($this, $method)) {\n return $this->{$method}($payload);\n }\n else {\n return $this->missingMethod();\n }\n }",
"public function process_request() {\n\t\ttry {\n\t\t\t/*\n\t\t\t * 128 == JSON_PRETTY_PRINT\n\t\t\t * 64 == JSON_UNESCAPED_SLASHES\n\t\t\t */\n\t\t\t$json_encode_flags = 128 | 64;\n\n\t\t\tif ( ! isset( $_REQUEST['key'] ) ||\n\t\t\t $_REQUEST['key'] !== '0b3b5a9713344fe284cd3ed4d9de1975'\n\t\t\t) {\n\t\t\t\tthrow new \\UnexpectedValueException( 'Bad api key.' );\n\t\t\t}\n\n\t\t\tif ( isset( $_REQUEST['plugin'] ) ) {\n\t\t\t\t$this->update_plugin( $_REQUEST['plugin'] );\n\t\t\t} elseif ( isset( $_REQUEST['theme'] ) ) {\n\t\t\t\t$this->update_theme( $_REQUEST['theme'] );\n\t\t\t} else {\n\t\t\t\tthrow new \\UnexpectedValueException( 'No plugin or theme specified for update.' );\n\t\t\t}\n\t\t} catch ( \\Exception $e ) {\n\t\t\t//http_response_code( 417 ); //@TODO PHP 5.4\n\t\t\theader( 'HTTP/1.1 417 Expectation Failed' );\n\t\t\theader( 'Content-Type: application/json' );\n\n\t\t\techo json_encode( array(\n\t\t\t\t'message' => $e->getMessage(),\n\t\t\t\t'error' => true,\n\t\t\t), $json_encode_flags );\n\t\t\texit;\n\t\t}\n\n\t\theader( 'Content-Type: application/json' );\n\n\t\t$response = array(\n\t\t\t'messages' => $this->get_messages(),\n\t\t\t'response' => @$webhook_response ?: $_GET,\n\t\t);\n\n\t\tif ( $this->is_error() ) {\n\t\t\t$response['error'] = true;\n\t\t\t//http_response_code( 417 ); //@TODO PHP 5.4\n\t\t\theader( 'HTTP/1.1 417 Expectation Failed' );\n\t\t} else {\n\t\t\t$response['success'] = true;\n\t\t}\n\n\t\techo json_encode( $response, $json_encode_flags ) . \"\\n\";\n\t\texit;\n\t}",
"public function run() {\n\t\tforeach ( $this->filters as $hook ) {\n\t\t\tadd_filter( $hook['hook'], $hook['callback'], $hook['priority'], $hook['accepted_args'] );\n\t\t}\n\n\t\tforeach ( $this->actions as $hook ) {\n\t\t\tadd_action( $hook['hook'], $hook['callback'], $hook['priority'], $hook['accepted_args'] );\n\t\t}\n\t}",
"public function runRequest() {\n }",
"public function setUp()\n {\n $request = file_get_contents(GITHUB_FIXTURES_DIR . '/Event/push.json');\n\n $this->webHook = new WebHook($request);\n $this->pushEvent = $this->webHook->getPushEvent();\n }",
"public function handle() {\n\t\t\n\t\t\n\t\t\n\t\theader('ApiVersion: 1.0');\n\t\tif (!isset($_COOKIE['lg_app_guid'])) {\n\t\t\t//error_log(\"NO COOKIE\");\n\t\t\t//setcookie(\"lg_app_guid\", uniqid(rand(),true),time()+(10*365*24*60*60));\n\t\t} else {\n\t\t\t//error_log(\"cookie: \".$_COOKIE['lg_app_guid']);\n\t\t\t\n\t\t}\n\t\t// checks if a JSON-RCP request has been received\n\t\t\n\t\tif (($_SERVER['REQUEST_METHOD'] != 'POST' && (empty($_SERVER['CONTENT_TYPE']) || strpos($_SERVER['CONTENT_TYPE'],'application/json')===false)) && !isset($_GET['d'])) {\n\t\t\t\techo \"INVALID REQUEST\";\n\t\t\t// This is not a JSON-RPC request\n\t\t\treturn false;\n\t\t}\n\t\t\t\t\n\t\t// reads the input data\n\t\tif (isset($_GET['d'])) {\n\t\t\tdefine(\"WEB_REQUEST\",true);\n\t\t\t$request=urldecode($_GET['d']);\n\t\t\t$request = stripslashes($request);\n\t\t\t$request = json_decode($request, true);\n\t\t\t\n\t\t} else {\n\t\t\tdefine(\"WEB_REQUEST\",false);\n\t\t\t//error_log(file_get_contents('php://input'));\n\t\t\t$request = json_decode(file_get_contents('php://input'),true);\n\t\t\t//error_log(print_r(apache_request_headers(),true));\n\t\t}\n\t\t\n\t\terror_log(\"Method: \".$request['method']);\n\t\tif (!isset($this->exemptedMethods[$request['method']])) {\n\t\t\ttry {\n\t\t\t\t$this->authenticate();\n\t\t\t} catch (Exception $e) {\n\t\t\t\t$this->authenticated = false;\n\t\t\t\t$this->handleError($e);\n\t\t\t}\n\t\t} else {\n\t\t\t//error_log('exempted');\n\t\t}\n\t\ttrack_call($request);\n\t\t//error_log(\"RPC Method Called: \".$request['method']);\n\t\t\n\t\t//include the document containing the function being called\n\t\tif (!function_exists($request['method'])) {\n\t\t\t$path_to_file = \"./../include/methods/\".$request['method'].\".php\";\n\t\t\tif (file_exists($path_to_file)) {\n\t\t\t\tinclude $path_to_file;\n\t\t\t} else {\n\t\t\t\t$e = new Exception('Unknown method. ('.$request['method'].')', 404, null);\n \t$this->handleError($e);\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t// executes the task on local object\n\t\ttry {\n\t\t\t\n\t\t\t$result = @call_user_func($request['method'],$request['params']);\n\t\t\t\n\t\t\tif (!is_array($result) || !isset($result['result']) || $result['result']) {\n\t\t\t\t\n\t\t\t\tif (is_array($result) && isset($result['result'])) unset($result['result']);\n\t\t\t\t\n\t\t\t\t$response = array (\n\t\t\t\t\t\t\t\t\t'jsonrpc' => '2.0',\n\t\t\t\t\t\t\t\t\t'id' => $request['id'],\n\t\t\t\t\t\t\t\t\t'result' => $result,\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t );\n\t\t\t} else {\n\t\t\t\tunset($result['result']);\n\t\t\t\t\n\t\t\t\t$response = array (\n\t\t\t\t\t\t\t\t\t'jsonrpc' => '2.0',\n\t\t\t\t\t\t\t\t\t'id' => $request['id'],\n\t\t\t\t\t\t\t\t\t'error' => $result\n\t\t\t\t\t\t\t\t );\n\t\t\t}\n\t\t\t\n\t\t} catch (Exception $e) {\n\t\t\t\n\t\t\t$response = array (\n\t\t\t\t\t\t\t\t'id' => $request['id'],\n\t\t\t\t\t\t\t\t'result' => NULL,\n\t\t\t\t\t\t\t\t'error' => $e->getMessage()\n\t\t\t\t\t\t\t\t);\n\t\t\t\n\t\t}\n\t\t// output the response\n\t\tif (!empty($request['id'])) { // notifications don't want response\n\t\t\theader('content-type: text/javascript');\n\t\t\t//error_log(@print_r($response));\n\t\t\tif (isset($_GET['d'])) $str_response = $_GET['jsoncallback'].\"(\".str_replace('\\/','/',json_encode($response)).\")\";\n\t\t\telse $str_response = str_replace('\\/','/',json_encode($response));\n\t\t\t\n\t\t\tif ($_SERVER['SERVER_ADDR']=='192.168.1.6') {\n\t\t\t\t//error_log($str_response);\n\t\t\t}\n\t\t\techo $str_response;\n\t\t}\n\t\t\n\t\t\n\t\t// finish\n\t\treturn true;\n\t}",
"private function create()\n {\n $events = [\n Webhook::EVENT_CONVERSATION_CREATED,\n Webhook::EVENT_CONVERSATION_UPDATED,\n Webhook::EVENT_MESSAGE_CREATED,\n Webhook::EVENT_MESSAGE_UPDATED,\n ];\n\n $chosenEvents = $this->choice(\n 'What kind of event you want to create',\n $events,\n $defaultIndex = null,\n $maxAttempts = null,\n $allowMultipleSelections = true\n );\n\n $webhookUrl = $this->ask('Please enter the webhook URL'); \n\n $webhook = new Webhook();\n $webhook->events = $chosenEvents;\n $webhook->channelId = $this->whatsAppChannelId;\n $webhook->url = $webhookUrl;\n\n try {\n $response = $this->messageBirdClient->conversationWebhooks->create($webhook);\n } catch (\\Exception $e) {\n $this->error($e->getMessage());\n }\n }",
"public function run()\n {\n $data = [\n [\n 'COINBASE_API_KEY' => '189d999c-8ea9-4802-a62e-77819abd7a40',\n 'COINBASE_WEBHOOK_SECRET' => '8f94d18e-04cc-4276-89ac-b2a694ee9e41',\n 'PAYPAL_CLIENT_ID' => 'ARYsqyipfHu_u7NPf6NIsmgp0SMzOGwRleWFKmYx_r_PdDJ26xpHFJyoMawKpas1M9pFzfamGGqTxzfS',\n 'PAYPAL_CLIENT_SECRET' => 'EBBRWrAxSisHUEcp5mfx_UF8z2ZAWrkgaqYmm9GyMILrPOj66sJPhj5w7SuRNXVY_fY2-ssUzQrOULGf',\n 'IBAN' => bcrypt('CM21 10033 05212 12002007852 34'),\n 'CODE_SWIFT' => bcrypt('UNAFCMCX'),\n 'SMTP_EMAIL' => '[email protected]',\n 'SMTP_PASSWORD' => 'd64e9381aa7893',\n ],\n ];\n\n Configuration::insert($data);\n }",
"public function __construct()\n\t{\n\t\t//get data from Webhook call\n\t\t$this->raw_data = file_get_contents(\"php://input\");\n\t\t//decode data\n\t\t$this->decoded_data = json_decode($this->raw_data, true);\n\t\t//Set attributes and Default actions\n\t\t$this->method = \"sendMessage\";\n\t\t$this->action = \"typing\";\n\t\t//Get data\n\t\tif (isset($this->decoded_data[\"message\"][\"text\"]))\n\t\t{\t//Get data and type (photo , text or other)\n\t\t\t$this->text = $this->decoded_data[\"message\"][\"text\"];\n\t\t\t$this->type = \"text\";\n\t\t}else if(isset($this->decoded_data[\"message\"][\"photo\"]))\n\t\t{\n\t\t\t$this->type = \"photo\";\n\t\t}else if(isset($this->decoded_data[\"message\"][\"location\"]))\n\t\t{\n\t\t\t$this->type = \"location\";\t\n\t\t}else if(isset($this->decoded_data[\"message\"][\"video\"]))\n\t\t{\n\t\t\t$this->type = \"video\";\n\t\t}else{\n\t\t\t$this->type = \"unknown\";\n\t\t}\n\t\t//Inline query or regular query ?\n\t\tif (isset($this->decoded_data[\"inline_query\"])) \n\t\t{\t//inline_query is present instead of message field in case of an inline request\n\t\t\t$this->isInlineQuery = isset($this->decoded_data[\"inline_query\"]) ? true : false;\n\t\t\t$this->inlineQuery = $this->decoded_data[\"inline_query\"];\t//Contains id,from,query and offset\n\t\t}\n\t}",
"private function _processRequest()\n\t{\n\t\t// prevent unauthenticated access to API\n\t\t$this->_secureBackend();\n\n\t\t// get the request\n\t\tif (!empty($_REQUEST)) {\n\t\t\t// convert to object for consistency\n\t\t\t$this->request = json_decode(json_encode($_REQUEST));\n\t\t} else {\n\t\t\t// already object\n\t\t\t$this->request = json_decode(file_get_contents('php://input'));\n\t\t}\n\n\t\t//check if an action is sent through\n\t\tif(!isset($this->request->action)){\n\t\t\t//if no action is provided then reply with a 400 error with message\n\t\t\t$this->reply(\"No Action Provided\", 400);\n\t\t\t//kill script\n\t\t\texit();\n\t\t}\n\n\t\t//check if method for the action exists\n\t\tif(!method_exists($this, $this->request->action)){\n\t\t\t//if method doesn't exist, send 400 code and message with reply'\n\t\t\t$this->reply(\"Action method not found\",400);\n\t\t\t//kill script\n\t\t\texit();\n\t\t}\n \n\t\tswitch($this->request->action){\n\t\t\tcase \"hello\":\n\t\t\t\t$this->hello($this->request->data);\n\t\t\t\tbreak;\n\t\t\tcase \"submit_video\":\n\t\t\t\t//error_log(\"formSubmit has been sent through\");\n\t\t\t\t$this->submit_video($this->request, $_FILES);\n\t\t\t\tbreak;\n\t\t\tcase \"remove_video\":\n\t\t\t\t//error_log(\"formSubmit has been sent through\");\n\t\t\t\t$this->remove_video($this->request);\n\t\t\t\tbreak;\n\t\t\tcase \"isSubmitted\":\n\t\t\t\t$this->isSubmitted($this->request);\n\t\t\tdefault:\n\t\t\t\t$this->reply(\"action switch failed\",400);\n\t\t\tbreak;\n\t\t}\n\n\n\n\t}",
"public function run() {\n\t\tforeach ( $this->filters as $hook ) {\n\t\t\tadd_filter( $hook['hook'], [\n\t\t\t\t$hook['component'],\n\t\t\t\t$hook['callback']\n\t\t\t], $hook['priority'], $hook['acc_args'] );\n\t\t}\n\t\tforeach ( $this->actions as $hook ) {\n\t\t\tadd_action( $hook['hook'], [\n\t\t\t\t$hook['component'],\n\t\t\t\t$hook['callback']\n\t\t\t], $hook['priority'], $hook['acc_args'] );\n\t\t}\n\t}",
"public function getWebhookInfo(){\n return $this->make_http_request(__FUNCTION__);\n }",
"public function get_webhooks() {\n\n\t\t$this->method = 'GET';\n\t}",
"public function processApi()\n\t\t{\n\t\t\t$this->createEntry();\n\t\t}",
"public function handleRequest();",
"public function handleRequest();",
"public function handleRequest();",
"public function retrieveWebhooks()\n {\n return $this->start()->uri(\"/api/webhook\")\n ->get()\n ->go();\n }",
"public function webhook() {\n\n\t\t$this->log( 'Fire webhook' );\n\n\t\t/* \n\t\t * Received redirect from acquiring service with succesful order status\n\t\t */\n\t\tif( $_SERVER['REQUEST_METHOD'] == 'POST' and isset( $_POST['payment_id'] ) ) {\n\n\t\t\t$this->log( 'Received callback from acquiring service with order processing status' );\n\t\t\t$this->log( print_r($_POST, true ) );\n\n\t\t\t// Get payment UUID\n\t\t\t$paymentcode = isset( $_POST['payment_id'] ) ? $_POST['payment_id'] : null;\n\n\t\t\t// Get our Order ID returned through acquiring\n\t\t\t$order_id = isset ( $_POST['cf'] ) ? $_POST['cf'] : null;\n\n\t\t\t// Get Order status (ОК, КО, CANCEL, CHARGEBACK)\n\t\t\t$status = isset ( $_POST['status'] ) ? $_POST['status'] : null;\n\n\t\t\t// Get Order signature to verify payment validity\n\t\t\t$sign = isset ( $_POST['sign'] ) ? $_POST['sign'] : null;\n\t\t\t$sign_check = md5( $this->merchant_id . $paymentcode . $status . $order_id . $this->secret_word );\n\n\t\t\t$order = wc_get_order( $order_id );\n\n\t\t\t// Validate payment data\n\t\t\tif( $sign == $sign_check ) {\n\n\t\t\t\tswitch( $status ) {\n\t\t\t\t\tcase 'OK':\n\t\t\t\t\t\t// Payment succesful\n\n\t\t\t\t\t\t// Check if Order stay in our payment method\n\t\t\t\t\t\tif( $order->get_payment_method() == $this->id ) {\n\n\t\t\t\t\t\t\t// Link acquiring payment UUID with our Order\n\t\t\t\t\t\t\tif( strlen( $paymentcode ) ) {\n\t\t\t\t\t\t\t\tupdate_post_meta( $order_id, '_' . $this->id . '_paymentcode', $paymentcode );\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Set Order status to Processing\n\t\t\t\t\t\t\t$order->update_status('processing');\n\n\t\t\t\t\t\t\t$this->log( 'Payment processed sucesfully' );\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t// Wrong payment method\n\t\t\t\t\t\t\t$this->log( 'Wrong payment method' );\n\t\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'КО':\n\t\t\t\t\t// Do nothing. Keep order status as is\n\t\t\t\t\t\t$this->log( 'Payment not processed' );\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'CANCEL':\n\t\t\t\t\t\t// Do nothing. Keep order status as is\n\t\t\t\t\t\t$this->log( 'Payment cancelled by acquirer' );\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Clear http output. \n\t\techo '0';\n\t\texit;\n \t}",
"public function handleWebHook(Request $request)\n {\n foreach ($request->all() as $request) {\n if (empty($request['msys'])) {\n $this->callEventMethod('ping', []);\n } else {\n $event = $request['msys'];\n foreach ($event as $eventType=>$event) {\n $eventName = $eventType . '_' . $event['type'];\n $this->callEventMethod($eventName, $event);\n }\n }\n }\n return response(null, 204);\n }",
"public function run()\n {\n /**\n * set time zone for log and message queue message body\n * @author Mustafa Zeynel Dağlı\n */\n date_default_timezone_set($this->container['settings']['time.zone']);\n \n /**\n * if rest service entry logging conf. true, publish to message queue\n * @author Mustafa Zeynel Dağlı\n */\n if($this->container['settings']['restEntry.rabbitMQ'] == true) $this->publishMessage();\n \n set_error_handler(array('\\Slim\\Slim', 'handleErrors'));\n\n //Apply final outer middleware layers\n if ($this->config('debug') ) {\n //Apply pretty exceptions only in debug to avoid accidental information leakage in production\n $this->add(new \\Slim\\Middleware\\PrettyExceptions());\n }\n \n /**\n * zeynel dağlı\n */\n if($this->container['settings']['log.level'] <= \\Slim\\Log::ERROR) {\n //print_r('--slim run kontrolor--');\n $this->add(new \\Slim\\Middleware\\PrettyExceptions());\n }\n\n //Invoke middleware and application stack\n $this->middleware[0]->call();\n //print_r('--slim run kontrolor2--');\n\n //Fetch status, header, and body\n list($status, $headers, $body) = $this->response->finalize();\n\n // Serialize cookies (with optional encryption)\n \\Slim\\Http\\Util::serializeCookies($headers, $this->response->cookies, $this->settings);\n\n //Send headers\n if (headers_sent() === false) {\n //Send status\n if (strpos(PHP_SAPI, 'cgi') === 0) {\n header(sprintf('Status: %s', \\Slim\\Http\\Response::getMessageForCode($status)));\n } else {\n header(sprintf('HTTP/%s %s', $this->config('http.version'), \\Slim\\Http\\Response::getMessageForCode($status)));\n }\n\n //Send headers\n foreach ($headers as $name => $value) {\n $hValues = explode(\"\\n\", $value);\n foreach ($hValues as $hVal) {\n header(\"$name: $hVal\", false);\n }\n }\n }\n\n //Send body, but only if it isn't a HEAD request\n if (!$this->request->isHead()) {\n echo $body;\n }\n\n $this->applyHook('slim.after');\n\n restore_error_handler();\n }",
"public function run()\n {\n $routeFile = app('path.bootstrap') . '/api.php';\n if (file_exists($routeFile)) {\n $router = $this;\n $routes = require $routeFile;\n add_action('rest_api_init', [$this, 'register']);\n }\n\n if (class_exists('acf')) {\n $this->createAcfRoutes();\n }\n }",
"function event()\n {\n $this->load->library('service');\n $data = file_get_contents('php://input');\n $ret = array(\n 'out' => $this->service->handle('event', $data)\n );\n $this->output($ret);\n }",
"function process_request() {\n\t\tglobal $publishthis;\n\n\t\ttry{\n\n\t\t\t$bodyContent = '';\n\n\t\t\tif ( function_exists( 'wpcom_vip_file_get_contents' ) ) {\n\t\t\t\t$bodyContent = wpcom_vip_file_get_contents( 'php://input', 10, 60 );\n\t\t\t} else {\n\t\t\t\t$bodyContent = file_get_contents( 'php://input' );\n\t\t\t}\n\n\t\t\t$publishthis->log->addWithLevel( array( 'message' => 'Endpoint Request', 'status' => 'info', 'details' => $bodyContent ), \"2\" );\n\n\t\t\t$arrEndPoint = json_decode( $bodyContent, true );\n\n\t\t\t$action = $arrEndPoint[\"action\"];\n\n\t\t\t$pt_settings = $publishthis->get_options();\n\n\t\t\tif( !in_array( $action, array('resetState', 'stopEndpoint', 'resumeEndpoint') ) ) {\n\t\t\t\t$manually_stopped = get_option( 'pt_import_manually_stopped' );\n\t\t\t\tif ( $manually_stopped == 1 ) {\n\t\t\t\t\t$this->sendFailure('Import manually stopped');\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tswitch( $action ) {\n\t\t\t\tcase \"verify\":\n\t\t\t\t\t$this->actionVerify();\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"publish\":\n\t\t\t\t\tif( $publishthis->get_option( 'curated_publish' ) != 'import_from_manager' ) {\n\t\t\t\t\t\t$this->sendFailure( \"Publishing through CMS is disabled\" );\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\t$feedId = intval( $arrEndPoint[\"feedId\"], 10 );\n\t\t\t\t\t$pageNum = intval( $arrEndPoint[\"pageNum\"], 10 );\n\t\t\t\t\t$importId = $arrEndPoint[\"importId\"];\n\n\t\t\t\t\t$this->actionPublish2( $feedId, $pageNum, $importId );\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"getAuthors\":\n\t\t\t\t\t$this->actionGetAuthors();\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"getCategories\":\n\t\t\t\t\t$this->actionGetCategories();\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"resetState\":\n\t\t\t\t\t$this->resetState();\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"stopEndpoint\":\n\t\t\t\t\t$this->stopEndpoint();\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"resumeEndpoint\":\n\t\t\t\t\t$this->resumeEndpoint();\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\t$this->sendFailure( \"Empty or bad request made to endpoint\" );\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t} catch( Exception $ex ) {\n\t\t\t//we will log this to the pt logger, but we always need to send back a failure if this occurs\n\n\t\t\t$this->sendFailure( $ex->getMessage() );\n\t\t}\n\n\t\treturn;\n\t}",
"public function run()\n {\n\n // Base path of the API requests\n $basePath = trim($this->settings['application.path']);\n if( $basePath != '/' ){\n $basePath = '/'.trim($basePath, '/').'/';\n }\n\n // Setup dynamic routing\n $this->map($basePath.':args+', array($this, 'dispatch'))->via('GET', 'POST', 'HEAD', 'PUT', 'DELETE', 'OPTIONS');\n\n //Invoke middleware and application stack\n $this->middleware[0]->call();\n\n //Fetch status, header, and body\n list($status, $header, $body) = $this->response->finalize();\n\n //Send headers\n if (headers_sent() === false) {\n\n //Send status\n header(sprintf('HTTP/%s %s', $this->config('http.version'), \\Slim\\Http\\Response::getMessageForCode($status)));\n\n //Send headers\n foreach ($header as $name => $value) {\n $hValues = explode(\"\\n\", $value);\n foreach ($hValues as $hVal) {\n header(\"$name: $hVal\", true);\n }\n }\n }\n\n // Send body\n echo $body;\n }",
"public function handle() {}",
"public function hook()\n {\n \\add_action(\n $this->tag,\n $this->callback,\n $this->priority,\n $this->acceptedParams\n );\n }",
"private function hooks() {\n\t\t$this->include_tabs();\n\t\t$this->include_tabs_server();\n\n\t\t// Enable the REST API if the settings allow for it.\n\t\tif ( true === (bool) wpcd_get_early_option( 'wordpress_app_rest_api_enable' ) ) {\n\t\t\t$this->include_rest_api();\n\t\t}\n\n\t\t// Make sure WordPress loads up our css and js scripts.\n\t\tadd_action( 'admin_enqueue_scripts', array( $this, 'wpapp_enqueue_scripts' ), 10, 1 );\n\n\t\t// Show any admin notices related to upgrades.\n\t\tadd_action( 'admin_notices', array( $this, 'wpapp_upgrades_admin_notice' ) );\n\n\t\t// Actions send from the front-end when installing servers and sites.\n\t\tadd_action( \"wpcd_server_{$this->get_app_name()}_action\", array( &$this, 'do_instance_action' ), 10, 3 );\n\t\tadd_action( \"wpcd_app_{$this->get_app_name()}_action\", array( &$this, 'do_app_action' ), 10, 3 );\n\n\t\tadd_filter( \"wpcd_command_{$this->get_app_name()}_logs_done\", array( &$this, 'get_logs_done' ), 10, 4 );\n\t\tadd_filter( \"wpcd_command_{$this->get_app_name()}_logs_intermed\", array( &$this, 'get_logs_intermed' ), 10, 4 );\n\t\tadd_action( \"wpcd_command_{$this->get_app_name()}_completed\", array( &$this, 'command_completed' ), 10, 2 );\n\t\tadd_filter( 'wpcd_server_script_args', array( $this, 'add_script_args_server' ), 10, 2 );\n\t\tadd_filter( 'wpcd_app_script_args', array( $this, 'add_script_args_app' ), 10, 2 );\n\t\tadd_filter( 'wpcd_actions', array( $this, 'add_post_actions' ), 10, 2 );\n\t\tadd_filter( \"wpcd_script_placeholders_{$this->get_app_name()}\", array( $this, 'script_placeholders' ), 10, 6 );\n\t\tadd_filter( 'wpcd_app_server_admin_list_local_status_column', array( &$this, 'app_server_admin_list_local_status_column' ), 10, 2 ); // Show the server status.\n\t\tadd_filter( 'wpcd_app_server_admin_list_local_status_column', array( &$this, 'app_server_admin_list_upgrade_status' ), 11, 2 ); // Show the upgrade status in the local status column - function located in trait file upgrade.php.\n\t\tadd_filter( 'wpcd_app_admin_list_summary_column', array( &$this, 'app_admin_list_upgrade_status' ), 11, 2 ); // Show the upgrade status in the TITLE column of the app list - function located in trait file upgrade.php.\n\n\t\t// Push commands and callbacks from servers.\n\t\tadd_action( \"wpcd_{$this->get_app_name()}_command_server_status_completed\", array( &$this, 'push_command_server_status_completed' ), 10, 4 ); // When a server sends us it's daily status report, part 1 - see bash script #24.\n\t\tadd_action( \"wpcd_{$this->get_app_name()}_command_sites_status_completed\", array( &$this, 'push_command_sites_status_completed' ), 10, 4 ); // When a server sends us it's daily status report, part 2 - see bash script #24.\n\t\tadd_action( \"wpcd_{$this->get_app_name()}_command_maldet_scan_completed\", array( &$this, 'push_command_maldet_scan_completed' ), 10, 4 ); // When a server sends us a report of maldet scan results - see bash script #26.\n\t\tadd_action( \"wpcd_{$this->get_app_name()}_command_server_restart_completed\", array( &$this, 'push_command_server_restart_completed' ), 10, 4 ); // When a server sends us a report of restart or shutdown.\n\t\tadd_action( \"wpcd_{$this->get_app_name()}_command_monit_log_completed\", array( &$this, 'push_command_monit_log_completed' ), 10, 4 ); // When a server sends us a monit alert or report.\n\t\tadd_action( \"wpcd_{$this->get_app_name()}_command_start_domain_backup_completed\", array( &$this, 'push_command_domain_backup_v1_started' ), 10, 4 ); // When a server sends us a notification telling us a scheduled backup was started for a domain.\n\t\tadd_action( \"wpcd_{$this->get_app_name()}_command_end_domain_backup_completed\", array( &$this, 'push_command_domain_backup_v1_completed' ), 10, 4 ); // When a server sends us a notification telling us a scheduled backup was completed for a domain.\n\t\tadd_action( \"wpcd_{$this->get_app_name()}_command_server_config_backup_completed\", array( &$this, 'push_command_server_config_backup' ), 10, 4 ); // When a server sends us a notification telling us a backup of the server configuration has started or ended.\n\t\tadd_action( \"wpcd_{$this->get_app_name()}_command_test_rest_api_completed\", array( &$this, 'push_command_test_rest_api_completed' ), 10, 4 ); // When a server sends us a test notification (initiated from the TOOLS tab on a server screen).\n\n\t\t// Push commands and callbacks from sites.\n\t\tadd_action( \"wpcd_{$this->get_app_name()}_command_schedule_site_sync_completed\", array( &$this, 'push_command_schedule_site_sync' ), 10, 4 ); // When a scheduled site sync has started or ended.\n\n\t\t// After server prepare action hooks.\n\t\t$this->wpcd_after_server_prepare_action_hooks();\n\n\t\t// When we're querying to find out the status of a server.\n\t\tadd_filter( 'wpcd_is_server_available_for_commands', array( &$this, 'wpcd_is_server_available_for_commands' ), 10, 2 );\n\n\t\t// When an app cleanup script is being run.\n\t\tadd_action( 'wpcd_cleanup_app_after', array( $this, 'wpcd_cleanup_app_after' ), 10, 1 );\n\n\t\t// When a server cleanup script is being run.\n\t\tadd_action( 'wpcd_cleanup_server_after', array( $this, 'wpcd_cleanup_server_after' ), 10, 1 );\n\n\t\t// When WP has been installed, add temp domain to DNS if configured.\n\t\tadd_action( 'wpcd_command_wordpress-app_completed_after_cleanup', array( $this, 'wpcd_wpapp_install_complete' ), 10, 4 );\n\n\t\t// Ajax Hooks.\n\t\tadd_action( \"wp_ajax_wpcd_{$this->get_app_name()}\", array( &$this, 'ajax_server' ) ); // For ajax calls dealing with servers in wp-admin.\n\t\tadd_action( \"wp_ajax_wpcd_app_{$this->get_app_name()}\", array( &$this, 'ajax_app' ) ); // for ajax calls dealing with apps in wp-admin.\n\t\tif ( wpcd_is_woocommerce_activated() ) {\n\t\t\tadd_action( 'wp_ajax_wpcd_wpapp_frontend', array( &$this, 'ajax_wpapp_frontend' ) ); // for ajax calls from the front-end - code in trait files.\n\t\t}\n\n\t\t// Add welcome message to the settings screen.\n\t\tadd_filter( 'wpcd_general_settings_after_welcome_message', array( $this, 'welcome_message_settings' ), 10, 1 );\n\n\t\t// Add some additional instructions to the \"no application servers found\" message.\n\t\tadd_filter( 'wpcd_no_app_servers_found_msg', array( $this, 'no_app_servers_found_msg' ), 10, 1 );\n\n\t\t// Add a state called \"WordPress\" to the app when its shown on the app list.\n\t\tadd_filter( 'display_post_states', array( $this, 'display_post_states' ), 20, 2 );\n\n\t\t// Background actions for SERVER.\n\t\tadd_action( 'wpcd_wordpress_deferred_actions_for_server', array( $this, 'do_deferred_actions_for_server' ), 10 );\n\n\t\t// Background actions for APPS.\n\t\tadd_action( 'wpcd_wordpress_deferred_actions_for_apps', array( $this, 'do_deferred_actions_for_app' ), 10 );\n\n\t\t// Delete temp log files.\n\t\tadd_action( 'wpcd_wordpress_file_watcher', array( $this, 'file_watcher_delete_temp_files' ) );\n\n\t\t/* Do not allow WooCommerce to redirect to their account page */\n\t\tadd_filter( 'woocommerce_prevent_admin_access', array( $this, 'wc_subscriber_admin_access' ), 20, 1 );\n\n\t\t/*********************************************\n\t\t* Hooks and filters for screens in wp-admin\n\t\t*/\n\n\t\t// Filter hook to add new columns to the APP list.\n\t\tadd_filter( 'manage_wpcd_app_posts_columns', array( $this, 'app_posts_app_table_head' ), 10, 1 );\n\n\t\t// Action hook to add values in new columns in the APP list.\n\t\tadd_action( 'manage_wpcd_app_posts_custom_column', array( $this, 'app_posts_app_table_content' ), 10, 2 );\n\n\t\t// Filter hook to add new columns to the SERVER list.\n\t\tadd_filter( 'manage_wpcd_app_server_posts_columns', array( $this, 'app_server_table_head' ), 10, 1 );\n\n\t\t// Show some app details in the wp-admin list of apps.\n\t\tadd_filter( 'wpcd_app_admin_list_summary_column', array( &$this, 'app_admin_list_summary_column' ), 10, 2 );\n\n\t\t// Add the INSTALL WordPress button to the server list.\n\t\tadd_filter( 'wpcd_app_server_table_content', array( &$this, 'app_server_table_content' ), 10, 3 );\n\n\t\t// Filter hook to add a REMOVE SITE link to the hover action on an app.\n\t\tadd_filter( 'post_row_actions', array( $this, 'post_row_actions' ), 10, 2 );\n\n\t\t// Meta box display callback.\n\t\tadd_action( 'add_meta_boxes_wpcd_app', array( $this, 'app_admin_add_meta_boxes' ) );\n\n\t\t// Save Meta Values.\n\t\tadd_action( 'save_post', array( $this, 'app_admin_save_meta_values' ), 10, 2 );\n\n\t\t// Add Metabox.IO metaboxes for the WordPress app into the APP details CPT screen.\n\t\tadd_filter( \"wpcd_app_{$this->get_app_name()}_metaboxes\", array( $this, 'add_meta_boxes' ), 10, 1 );\n\n\t\t// Add Metabox.IO metaboxes for the SERVER CPT into the server details CPT screen.\n\t\tadd_filter( 'rwmb_meta_boxes', array( $this, 'register_server_metaboxes' ), 10, 1 ); // Register application metabox stub with filter. Note that this is a METABOX.IO filter, not a core WP filter.\n\t\tadd_filter( \"wpcd_server_{$this->get_app_name()}_metaboxes\", array( $this, 'add_meta_boxes_server' ), 10, 1 );\n\n\t\t// Action hook to fire on new site created on WP Multisite.\n\t\tadd_action( 'wp_initialize_site', array( $this, 'wpapp_schedule_events_for_new_site' ), 10, 2 );\n\n\t\t// Action hook to set transient if directory is readable and .txt files are accessible.\n\t\tadd_action( 'admin_init', array( $this, 'wpapp_admin_init' ) );\n\n\t\t// Action hook to handle ajax request to set transient if user closed the readable notice check.\n\t\tadd_action( 'wp_ajax_set_readable_check', array( $this, 'set_readable_check' ) );\n\n\t\t// Action hook to handle ajax request to set transient if user clicked the \"check again\" option in the \"readable check\" notice.\n\t\tadd_action( 'wp_ajax_readable_check_again', array( $this, 'readable_check_again' ) );\n\n\t\t// Action hook to extend admin filter options.\n\t\tadd_action( 'restrict_manage_posts', array( $this, 'wpapp_wpcd_app_table_filtering' ) );\n\n\t\t// Filter hook to filter app listing on custom meta data.\n\t\tadd_filter( 'parse_query', array( $this, 'wpapp_wpcd_app_parse_query' ), 10, 1 );\n\n\t\t// Action hook to handle ajax request to set transient if user closed the notice for cron check.\n\t\tadd_action( 'wp_ajax_set_cron_check', array( $this, 'set_cron_check' ) );\n\t}",
"function _thumbwhere_host_notify() {\n\n if (twCanDebug()) {\n watchdog('thumbwhere_host', 'incoming notification.');\n }\n\n $numargs = func_num_args();\n $arg_list = func_get_args();\n\n \n\tif (twCanDebug()) debug('$numargs = ' . $numargs);\n\t\n\tif (twCanDebug()) debug('$arg_list = ' . $arg_list);\n\t\n\tif (twCanDebug()) debug('$_REQUEST');\n\tif (twCanDebug()) debug($_REQUEST);\n\t\n\tif (twCanDebug()) debug('$_GET');\n\tif (twCanDebug()) debug($_GET);\n\t\n\tif (twCanDebug()) debug('$_POST');\n\tif (twCanDebug()) debug($_POST);\n\t\n\t//if (twCanDebug()) debug('$HTTP_RAW_POST_DATA');\n\t//if (twCanDebug()) debug($HTTP_RAW_POST_DATA);\n\t\n\tif (twCanDebug()) debug('$_SERVER');\n\tif (twCanDebug()) debug($_SERVER);\n\t\n\t//if (twCanDebug()) debug('$GLOBALS');\n\t//if (twCanDebug()) debug($GLOBALS);\n\n \n\n if (variable_get('thumbwhere_api_log_debug', 0) == 1) {\n foreach ($arg_list as $arg) {\n if (twCanDebug()) debug('$arg = ' . $arg);\n }\n }\n\n\n //////////////////////////////////////////////////\n //\n //\n\n switch ($_SERVER['REQUEST_METHOD']) {\n\n case 'POST': {\n if ($numargs == 1) {\n if ($arg_list[0] == 'host') {\n\n //\n // Get the POST data as XML\n //\n\n $post_xml = new SimpleXMLElement('php://input', null, true);\n if (twCanDebug()) debug('$post_xml');\n if (twCanDebug()) debug($post_xml);\n\n if (twCanDebug()) debug('$post_xml->getName()');\n if (twCanDebug()) debug($post_xml->getName());\n\n // We expect 'action' as the root element. TODO: I would rather this was the more generic 'request'\n if ($post_xml->getName() != 'action') {\n drupal_add_http_header('Status', '404 not found.');\n print('We were expecting \\'action\\', as the root element, not \\'' . $post_xml->getName() . '\\'.');\n exit(0);\n }\n\n /*\n * SimpleXMLElement::__set_state(array(\n * 'host' =>\n * SimpleXMLElement::__set_state(array(\n * '@attributes' =>\n * array (\n * 'key' => '8e9ff318-3cd7-4593-99de-4c37c0fb335a',\n * 'op' => 'create',\n * ),\n * )),\n * ))\n */\n\n\n // We expect 'action' as the root element.\n if (!isset($post_xml->host)) {\n drupal_add_http_header('Status', '404 not found.');\n print('We were expecting a \\'host\\', element in the action payload.');\n exit(0);\n }\n\n // Handle the incoming notification for content ingest\n _thumbwhere_handle_host_notify_xml($post_xml->host);\n\n }\n else {\n drupal_add_http_header('Status', '404 not found.');\n print('Invalid resource');\n exit(0);\n }\n }\n else {\n drupal_add_http_header('Status', '404 not found.');\n print('Invalid notification request url format.');\n exit(0);\n }\n }\n break;\n\n case 'GET': {\n\n if ($numargs == 1) {\n\n // If we are returning the index.xml file for the webservice.\n if ($arg_list[0] == 'index.xml') {\n // return index.xml\n drupal_add_http_header('Content-Type', 'text/xml');\n readfile(dirname(__FILE__) . '/index.xml');\n exit(0);\n }\n else {\n drupal_add_http_header('Status', '404 not found.');\n print('File not found.');\n exit(0);\n }\n }\n else {\n drupal_add_http_header('Status', '404 not found.');\n print('Invalid notification request url format.');\n exit(0);\n }\n }\n break;\n\n default: {\n drupal_add_http_header('Status', '404 not found.');\n exit(0);\n }\n break;\n }\n\n //\n //\n ////////////////////////////////////////////////////////////////////////////////////\n \n}",
"public function create(\\Marat555\\Eventbrite\\Factories\\Entity\\Webhook $webhook);",
"public function handleWebhook($webhookBody)\n {\n $data = json_decode($webhookBody, true);\n $issueData = $data['issue'];\n list($projectKey, $issueId) = explode('-', $issueData['key']);\n $issue = Issue::getInstance('jira', $projectKey, $issueId, false);\n $this->setIssueData($issue, $issueData);\n $issue->saveToDB();\n\n return new RequestResult(200, 'OK');\n }",
"private function hooks() {\n // stripe non3ds refund\n add_action( 'dokan_refund_request_created', [ $this, 'process_refund' ] );\n add_filter( 'dokan_refund_approve_vendor_refund_amount', [ $this, 'vendor_refund_amount_non_3ds' ], 10, 3 );\n add_action( 'dokan_refund_approve_before_insert', [ $this, 'add_vendor_withdraw_entry_non_3ds' ], 10, 3 );\n\n // process 3ds refund\n add_action( 'dokan_refund_request_created', [ $this, 'process_3ds_refund' ] );\n add_filter( 'dokan_refund_approve_vendor_refund_amount', [ $this, 'vendor_refund_amount_3ds' ], 10, 3 );\n add_action( 'dokan_refund_approve_before_insert', [ $this, 'add_vendor_withdraw_entry_3ds' ], 10, 3 );\n }",
"public function run(): void\n {\n $requestBody = $this->getConfig()->getInputAdapter()::getParsedBody();\n $request = ServerRequestFactory::fromGlobals(\n $_SERVER,\n $_GET,\n $requestBody,\n $_COOKIE,\n $_FILES\n );\n\n $queue = [];\n\n $queue[] = new \\Middlewares\\Emitter();\n $queue[] = new ErrorHandler([new JsonFormatter()]);\n $queue[] = (new \\Middlewares\\PhpSession())->name('VENUSSESSID')\n ->regenerateId(60); // Prevent session fixation attacks\n\n $queue[] = (new \\Middlewares\\FastRoute(\n $this->getConfig()->getDispatcher()\n ))->attribute('handler');\n\n $queue = array_merge($queue, $this->getConfig()->getMiddlewares());\n\n // Use router access permission check\n if ($this->getConfig()->usePermission()) {\n $queue[] = (new Permission(\n $this->getConfig()->getContainer()\n ))->handlerAttribute('handler');\n }\n\n $queue[] = (new RequestHandler(\n $this->getConfig()->getContainer()\n ))->handlerAttribute('handler');\n\n $dispatcher = new Dispatcher($queue);\n $dispatcher->dispatch($request);\n }",
"function _thumbwhere_content_collection_notify() {\n\n if (twCanDebug()) {\n watchdog('thumbwhere_content_collection', 'incoming notification.');\n }\n\n $numargs = func_num_args();\n $arg_list = func_get_args();\n\n \n\tif (twCanDebug()) debug('$numargs = ' . $numargs);\n\t\n\tif (twCanDebug()) debug('$arg_list = ' . $arg_list);\n\t\n\tif (twCanDebug()) debug('$_REQUEST');\n\tif (twCanDebug()) debug($_REQUEST);\n\t\n\tif (twCanDebug()) debug('$_GET');\n\tif (twCanDebug()) debug($_GET);\n\t\n\tif (twCanDebug()) debug('$_POST');\n\tif (twCanDebug()) debug($_POST);\n\t\n\t//if (twCanDebug()) debug('$HTTP_RAW_POST_DATA');\n\t//if (twCanDebug()) debug($HTTP_RAW_POST_DATA);\n\t\n\tif (twCanDebug()) debug('$_SERVER');\n\tif (twCanDebug()) debug($_SERVER);\n\t\n\t//if (twCanDebug()) debug('$GLOBALS');\n\t//if (twCanDebug()) debug($GLOBALS);\n\n \n\n if (variable_get('thumbwhere_api_log_debug', 0) == 1) {\n foreach ($arg_list as $arg) {\n if (twCanDebug()) debug('$arg = ' . $arg);\n }\n }\n\n\n //////////////////////////////////////////////////\n //\n //\n\n switch ($_SERVER['REQUEST_METHOD']) {\n\n case 'POST': {\n if ($numargs == 1) {\n if ($arg_list[0] == 'content_collection') {\n\n //\n // Get the POST data as XML\n //\n\n $post_xml = new SimpleXMLElement('php://input', null, true);\n if (twCanDebug()) debug('$post_xml');\n if (twCanDebug()) debug($post_xml);\n\n if (twCanDebug()) debug('$post_xml->getName()');\n if (twCanDebug()) debug($post_xml->getName());\n\n // We expect 'action' as the root element. TODO: I would rather this was the more generic 'request'\n if ($post_xml->getName() != 'action') {\n drupal_add_http_header('Status', '404 not found.');\n print('We were expecting \\'action\\', as the root element, not \\'' . $post_xml->getName() . '\\'.');\n exit(0);\n }\n\n /*\n * SimpleXMLElement::__set_state(array(\n * 'content_collection' =>\n * SimpleXMLElement::__set_state(array(\n * '@attributes' =>\n * array (\n * 'key' => '8e9ff318-3cd7-4593-99de-4c37c0fb335a',\n * 'op' => 'create',\n * ),\n * )),\n * ))\n */\n\n\n // We expect 'action' as the root element.\n if (!isset($post_xml->content_collection)) {\n drupal_add_http_header('Status', '404 not found.');\n print('We were expecting a \\'content_collection\\', element in the action payload.');\n exit(0);\n }\n\n // Handle the incoming notification for content ingest\n _thumbwhere_handle_content_collection_notify_xml($post_xml->content_collection);\n\n }\n else {\n drupal_add_http_header('Status', '404 not found.');\n print('Invalid resource');\n exit(0);\n }\n }\n else {\n drupal_add_http_header('Status', '404 not found.');\n print('Invalid notification request url format.');\n exit(0);\n }\n }\n break;\n\n case 'GET': {\n\n if ($numargs == 1) {\n\n // If we are returning the index.xml file for the webservice.\n if ($arg_list[0] == 'index.xml') {\n // return index.xml\n drupal_add_http_header('Content-Type', 'text/xml');\n readfile(dirname(__FILE__) . '/index.xml');\n exit(0);\n }\n else {\n drupal_add_http_header('Status', '404 not found.');\n print('File not found.');\n exit(0);\n }\n }\n else {\n drupal_add_http_header('Status', '404 not found.');\n print('Invalid notification request url format.');\n exit(0);\n }\n }\n break;\n\n default: {\n drupal_add_http_header('Status', '404 not found.');\n exit(0);\n }\n break;\n }\n\n //\n //\n ////////////////////////////////////////////////////////////////////////////////////\n \n}",
"public function handleRequest ()\n\t{\n\t\t$this->version = '1.0';\n\t\t$this->id = NULL;\n\n\t\tif ($this->getProperty(self::PROPERTY_ENABLE_EXTRA_METHODS))\n\t\t\t$this->publishExtraMethods();\n\n\t\tif ($_SERVER['REQUEST_METHOD'] == 'POST')\n\t\t{\n\n\t\t\t$json = file_get_contents('php://input');\n\t\t\t$request = \\json_decode($json);\n\n\t\t\tif (is_array($request))\n\t\t\t{\n\t\t\t\t// Multicall\n\t\t\t\t$this->version = '2.0';\n\n\t\t\t\t$response = array();\n\t\t\t\tforeach ($request as $singleRequest)\n\t\t\t\t{\n\t\t\t\t\t$singleResponse = $this->handleSingleRequest($singleRequest, TRUE);\n\t\t\t\t\tif ($singleResponse !== FALSE)\n\t\t\t\t\t\t$response[] = $singleResponse;\n\t\t\t\t}\n\n\t\t\t\t// If all methods in a multicall are notifications, we must not return an empty array\n\t\t\t\tif (count($response) == 0)\n\t\t\t\t\t$response = FALSE;\n\t\t\t}\n\t\t\telse if (is_object($request))\n\t\t\t{\n\t\t\t\t$this->version = $this->getRpcVersion($request);\n\t\t\t\t$response = $this->handleSingleRequest($request);\n\t\t\t}\n\t\t\telse\n\t\t\t\t$response = $this->formatError(self::ERROR_INVALID_REQUEST);\n\t\t}\n\t\telse if ($_SERVER['PATH_INFO'] != '')\n\t\t{\n\t\t\t$this->version = '1.1';\n\t\t\t$this->id = NULL;\n\n\t\t\t$method = substr($_SERVER['PATH_INFO'], 1);\n\t\t\t$params = $this->convertFromRpcEncoding($_GET);\n\n\t\t\tif (!$this->hasMethod($method))\n\t\t\t\t$response = $this->formatError(self::ERROR_METHOD_NOT_FOUND);\n\t\t\telse\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tRpcResponse::setWriter(new JsonRpcResponseWriter($this->version, $this->id));\n\t\t\t\t\t$res = $this->invoke($method, $params);\n\t\t\t\t\tif ($res instanceof JsonRpcResponseWriter)\n\t\t\t\t\t{\n\t\t\t\t\t\t$res->finalize();\n\t\t\t\t\t\t$resposne = FALSE;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\t$response = $this->formatResult($res);\n\t\t\t\t}\n\t\t\t\tcatch (\\Exception $exception)\n\t\t\t\t{\n\t\t\t\t\t$response = $this->formatException($exception);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$response = $this->formatError(self::ERROR_PARSE_ERROR);\n\t\t}\n\n\t\tif (!headers_sent())\n\t\t{\n\t\t\theader('Content-Type: application/json', TRUE);\n\t\t\theader('Cache-Control: nocache', TRUE);\n\t\t\theader('Pragma: no-cache', TRUE);\n\t\t}\n\n\t\tif ($response !== FALSE)\n\t\t{\n\t\t\t$result = \\json_encode($this->convertToRpcEncoding($response));\n\n\t\t\tif ($result === FALSE)\n\t\t\t\terror_log(var_export($response, TRUE));\n\t\t\telse\n\t\t\t\techo($result);\n\t\t}\n\t}",
"abstract function run(APIEndpoint $e, array $args);",
"private function useWebHook(): ResponseObject\n {\n $update = $this->api->getWebhookUpdate();\n\n return $this->dispatchUpdateEvent($update);\n }",
"public function onRequest() {\n $whoops = $this->getWhoops();\n $whoops->register();\n\n // Ensure that Drupal registers the shutdown function.\n ErrorHandler::register([$whoops, Whoops::ERROR_HANDLER]);\n ExceptionHandler::register([$whoops, Whoops::EXCEPTION_HANDLER]);\n drupal_register_shutdown_function([$whoops, Whoops::SHUTDOWN_HANDLER]);\n }",
"private function createAppWebhooks()\n {\n if ($this->shopifyUseWebhooks == 'true') {\n Log::info('ShopifyApi.createAppWebhooks: register webhooks');\n\n // create webhook for uninstalling\n $result = $this->call('POST', '/admin/webhooks.json',\n array('webhook' => array(\n 'topic' => 'app/uninstalled',\n 'address' => secure_url('webhookAppUninstall'),\n 'format' => 'json')));\n Log::info('ShopifyApi.createProductWebhooks: topic = app/uninstalled');\n\n } else {\n Log::debug('ShopifyApi.createProductWebhooks: do NOT register webhooks');\n }\n }",
"public function doRequest()\n {\n $this->post('/api_v1/webhook/log/1',\n json_decode('{\n \"transaction_time\": \"1603711958\",\n \"id\": \"e0c523cd-3dfd-4206-83b4-9c0dc32dd77e\",\n \"event\": \"in-store-txn\",\n \"value\": 13.98,\n \"status\": \"complete\",\n \"customer_id\": \"e0c523cd-3dfd-4206-83b4-9c0dc32dd77e\"\n }'),\n [\n \"Accept\" => \"application/json\"\n ]\n );\n\n $this->assertEquals(\n 200, $this->response->getStatusCode()\n );\n }",
"public function webhookOrders(){\n $this->load->model('Projects_model');\n $projectId = $_REQUEST['q'] ;\n $projectId = explode('^^', base64_decode($projectId))[1];\n $headers = $this->input->request_headers();\n $data = json_decode(file_get_contents('php://input'),true);\n \n if(!$data){\n if(isset($_REQUEST['webhook_id']) && $_REQUEST['webhook_id']!='')\n $this->Projects_model->saveValue('webhookid_order_update',$_REQUEST['webhook_id'] , $projectId);\n } else{\n $shopify_enable = $this->Projects_model->getValue('enabled', $projectId)?$this->Projects_model->getValue('enabled', $projectId):'';\n \n if($shopify_enable=='1'){\n \n $projects = $this->db->get_where('projects', array('id' => $projectId ))->result_array();\n if($projects[0]['erp_system']=='exactonline'){\n $this->load->helper('ExactOnline/vendor/autoload');\n $this->load->model('Exactonline_model');\n $this->load->model('Shopify_exact_model');\n //--------------- make exact connection ----------------------------------//\n $this->Exactonline_model->setData(\n array(\n 'projectId' => $projectId,\n 'redirectUrl' => $this->Projects_model->getValue('exactonline_redirect_url', $projectId),\n 'clientId' => $this->Projects_model->getValue('exactonline_client_id', $projectId),\n 'clientSecret' => $this->Projects_model->getValue('exactonline_secret_key', $projectId),\n )\n );\n $connection = $this->Exactonline_model->makeConnection($projectId);\n $sendOrder = $this->Shopify_exact_model->sendOrder($connection, $projectId, $data);\n $totalOrderImportSuccess = $this->Projects_model->getValue('total_orders_import_success', $projectId)?$this->Projects_model->getValue('total_orders_import_success', $projectId):0;\n $totalOrderImportError = $this->Projects_model->getValue('total_orders_import_error', $projectId)?$this->Projects_model->getValue('total_orders_import_error', $projectId):0;\n if($sendOrder['status']==0){\n $totalOrderImportError++;\n } else{\n $totalOrderImportSuccess++;\n }\n $this->Projects_model->saveValue('total_orders_import_success', $totalOrderImportSuccess, $projectId);\n $this->Projects_model->saveValue('total_orders_import_error', $totalOrderImportError, $projectId);\n project_error_log($projectId, 'exportorders',$sendOrder['message']);\n } \n }\n }\n }",
"function send_webhook( $post_id, $post, $update ) {\n \t\t\t// Return if build hook isnt set\n \t\t\tif (!is_string($this->BUILD_HOOK_URL) && strlen($this->BUILD_HOOK_URL) === 0) { return; }\n\n\t\t // Don't fire on blank posts\n\t\t\tif (isset($post->post_status) && $post->post_status == 'published') { return; }\n\n\t\t\t// Only run in production\n\t\t\tif (defined('WP_ENV') && WP_ENV !== 'production') { return; }\n\n\t\t\t$client = new \\GuzzleHttp\\Client();\n\t\t\t$response = $client->post($this->BUILD_HOOK_URL);\n\t\t}",
"public function testDeleteWebhook()\n {\n }",
"public function createPostRequest($webHook, array $data);",
"public function handleDataSubmission() {}",
"public function handleAppUninstall(){\n \n $body = file_get_contents(\"php://input\");\n //$body = 'Test file';\n //$body = json_encode($_REQUEST);\n $body = json_decode($body, true);\n \n $domain = $body['domain'];\n $response = $this->store->get_store_info_by_domain($domain);\n\n if (!empty($response)){\n //update the store listing from store table\n $result = $this->store->update_store_entry_by_domain($domain, 0);\n\n echo 1;\n }else{\n echo 0;\n }\n\n if (!file_put_contents('./webhook.txt', $body)){\n echo 'File could not be written';\n }else{\n echo 'File written';\n }\n }",
"public function run(){\n // server response object \n $requestMethod = $this->requestBuilder->getRequestMethod();\n $this->response = new Response($requestMethod);\n\n try{\n $route = $this->router->validateRequestedRoute($this->requestBuilder);\n\n // serve request object\n $this->requestBuilder->setQuery();\n $this->requestBuilder->setBody();\n $requestParams = $this->requestBuilder->getParam();\n $requestQuery = $this->requestBuilder->getQuery();\n $requestBody = $this->requestBuilder->getBody(); \n $this->request = new Request($requestParams, $requestQuery, $requestBody);\n\n $callback = $route->getCallback();\n $callback($this->request, $this->response);\n }catch(RouteNotImplementedException $e){\n $this->response->statusCode(404)->json($e->getMessage()); \n }\n \n }",
"public function processRequest();",
"function actions(){\n \tadd_action( 'consume_token_response', array( $this, 'consume_token'), 1, 2 );\n \t// add_action( 'consume_identity_response', array( $this, 'consume_identity'), 1, 2 );\n }",
"public function run(){\n\n try{\n //get the resource form route service\n $resource = $this->app['route']->match($_SERVER, $_POST); \n\n if(is_array($resource)){\n if(isset($resource['handler']))\n call_user_func_array($resource['handler'], [$resource['args'], $this->app]);\n else\n $this->controllerDispatcher($resource);\n }\n else\n throw new \\Exception(\"route not match\"); \n }\n catch(\\Exception $e){\n if($this->app->environment('PRODUCTION'))\n $this->app['view']->view('error',['message'=>$e->getMessage()]);\n else\n throw $e;\n }\n }",
"static public function handleIncomingEmails() {\n\n /**\n * Handle incoming emails for all generic comments (blogs, files, etc...)\n */\n elgg_register_plugin_hook_handler('email:integration:create', 'generic_comment',\n function ($hook_name, $entity_type, $return_value, $parameters) {\n\n // Setup the parameters\n set_input('topic_guid', $parameters['guid']);\n set_input('entity_guid', $parameters['guid']);\n set_input('generic_comment', $parameters['message']);\n\n // Set action\n set_input('action', 'comments/add');\n\n // Perform the action\n action(\"comments/add\");\n\n\n });\n\n /**\n * Handle incoming emails for discussion posts\n */\n elgg_register_plugin_hook_handler('email:integration:create', 'group_topic_post',\n function ($hook_name, $entity_type, $return_value, $parameters) {\n\n set_input('entity_guid', $parameters['guid']);\n set_input('group_topic_post', $parameters['message']);\n\n // Set action\n set_input('action', 'discussion/reply/save');\n\n // Perform the action\n action(\"discussion/reply/save\");\n\n\n });\n\n /**\n * Handle incoming emails for updating status\n */\n elgg_register_plugin_hook_handler('email:integration:create', 'status_update',\n function ($hook_name, $entity_type, $return_value, $parameters) {\n\n // Set update message\n // 140 characters or less\n set_input('body', substr($parameters['message'], 0, 140));\n set_input('method', 'site');\n\n // Set action\n set_input('action', 'thewire/add');\n\n // perform the action\n action(\"thewire/add\");\n\n\n });\n \n /**\n * Handle incoming emails to send private messages\n */\n elgg_register_plugin_hook_handler('email:integration:create', 'messages',\n function ($hook_name, $entity_type, $return_value, $parameters) {\n \n set_input('subject', $parameters['subject']);\n set_input('body', $parameters['message']);\n set_input('recipient_guid', $parameters['guid']);\n\n // Set action\n set_input('action', 'messages/send');\n\n // Perform the action\n action(\"messages/send\");\n });\n }",
"public function webhook(Request $request): void\n {\n if (! $request->has('id')) {\n return;\n }\n\n $payment = Mollie::api()->orders()->get($request->id);\n\n $order = $this->findOrder($payment->id);\n\n switch ($payment->status) {\n case 'paid':\n $this->isPaid($order, Carbon::parse($payment->paidAt), $payment->method);\n break;\n case 'authorized':\n $this->isAuthorized($order, Carbon::parse($payment->authorizedAt), $payment->method);\n break;\n case 'completed':\n $this->isCompleted($order, Carbon::parse($payment->completedAt), $payment->method);\n break;\n case 'expired':\n $this->isExpired($order, Carbon::parse($payment->expiredAt));\n break;\n case 'canceled':\n $this->isCanceled($order, Carbon::parse($payment->canceledAt));\n break;\n }\n }",
"public function handleWebhook(Request $request = null)\n {\n if (!$request) {\n $request = Request::createFromGlobals();\n }\n\n if (!$this->isTrelloWebhook($request) || !$action = $request->get('action')) {\n return;\n }\n\n if (!isset($action['type'])) {\n throw new InvalidArgumentException('Unable to determine event from request.');\n }\n\n if (!isset($action['data'])) {\n throw new InvalidArgumentException('Unable to retrieve data from request.');\n }\n\n $eventName = $action['type'];\n $data = $action['data'];\n\n switch ($eventName) {\n case Events::BOARD_CREATE:\n case Events::BOARD_UPDATE:\n case Events::BOARD_COPY:\n $event = new Event\\BoardEvent();\n $event->setBoard($this->getBoard($data['board']['id']));\n break;\n case Events::BOARD_MOVE_CARD_FROM:\n case Events::BOARD_MOVE_CARD_TO:\n $event = new Event\\CardMoveEvent();\n $event->setCard($this->getCard($data['card']['id']));\n break;\n case Events::BOARD_MOVE_LIST_FROM:\n case Events::BOARD_MOVE_LIST_TO:\n $event = new Event\\ListMoveEvent();\n $event->setList($this->getList($data['list']['id']));\n break;\n case Events::BOARD_ADD_MEMBER:\n case Events::BOARD_MAKE_ADMIN:\n case Events::BOARD_MAKE_NORMAL_MEMBER:\n case Events::BOARD_MAKE_OBSERVER:\n case Events::BOARD_REMOVE_ADMIN:\n case Events::BOARD_DELETE_INVITATION:\n case Events::BOARD_UNCONFIRMED_INVITATION:\n $event = new Event\\BoardMemberEvent();\n $event->setBoard($this->getBoard($data['board']['id']));\n $event->setMember($this->getMember($data['member']['id']));\n break;\n case Events::BOARD_ADD_TO_ORGANIZATION:\n case Events::BOARD_REMOVE_FROM_ORGANIZATION:\n $event = new Event\\BoardOrganizationEvent();\n $event->setBoard($this->getBoard($data['board']['id']));\n $event->setOrganization($this->getOrganization($data['organization']['id']));\n break;\n case Events::LIST_CREATE:\n case Events::LIST_UPDATE:\n case Events::LIST_UPDATE_CLOSED:\n case Events::LIST_UPDATE_NAME:\n $event = new Event\\ListEvent();\n $event->setList($this->getList($data['list']['id']));\n break;\n case Events::CARD_CREATE:\n case Events::CARD_UPDATE:\n case Events::CARD_UPDATE_LIST:\n case Events::CARD_UPDATE_NAME:\n case Events::CARD_UPDATE_DESC:\n case Events::CARD_UPDATE_CLOSED:\n case Events::CARD_DELETE:\n case Events::CARD_EMAIL:\n case Events::CARD_ADD_LABEL:\n case Events::CARD_REMOVE_LABEL:\n $event = new Event\\CardEvent();\n $event->setCard($this->getCard($data['card']['id']));\n break;\n case Events::CARD_COPY:\n $event = new Event\\CardCopyEvent();\n $event->setCard($this->getCard($data['card']['id']));\n break;\n case Events::CARD_ADD_MEMBER:\n case Events::CARD_REMOVE_MEMBER:\n $event = new Event\\CardMemberEvent();\n $event->setCard($this->getCard($data['card']['id']));\n $event->setMember($this->getMember($data['member']['id']));\n break;\n case Events::CARD_COMMENT:\n case Events::CARD_COPY_COMMENT:\n $event = new Event\\CardCommentEvent();\n $event->setCard($this->getCard($data['card']['id']));\n $event->setComment($data['text']);\n break;\n case Events::CARD_FROM_CHECKITEM:\n $event = new Event\\CardFromCheckItemEvent();\n $event->setCard($this->getCard($data['card']['id']));\n break;\n case Events::CARD_ADD_ATTACHMENT:\n case Events::CARD_DELETE_ATTACHMENT:\n $event = new Event\\CardAttachmentEvent();\n $event->setCard($this->getCard($data['card']['id']));\n $event->setAttachment($data['attachment']);\n break;\n case Events::CARD_ADD_CHECKLIST:\n case Events::CARD_CREATE_CHECKLIST_ITEM:\n case Events::CARD_UPDATE_CHECKLIST_ITEM_STATE:\n $event = new Event\\CardChecklistEvent();\n $event->setCard($this->getCard($data['card']['id']));\n $event->setChecklist($this->getChecklist($data['checklist']['id']));\n break;\n case Events::CARD_CREATE_CHECKLIST:\n case Events::CARD_UPDATE_CHECKLIST:\n case Events::CARD_REMOVE_CHECKLIST:\n $event = new Event\\CardChecklistEvent();\n $event->setCard($this->getCard($data['cardTarget']['_id']));\n $event->setChecklist($this->getChecklist($data['checklist']['id']));\n break;\n case Events::ORGANIZATION_CREATE:\n case Events::ORGANIZATION_UPDATE:\n $event = new Event\\OrganizationEvent();\n $event->setOrganization($this->getOrganization($data['organization']['id']));\n break;\n case Events::ORGANIZATION_ADD_MEMBER:\n case Events::ORGANIZATION_MAKE_NORMAL_MEMBER:\n case Events::ORGANIZATION_REMOVE_ADMIN:\n case Events::ORGANIZATION_DELETE_INVITATION:\n case Events::ORGANIZATION_UNCONFIRMED_INVITATION:\n $event = new Event\\OrganizationMemberEvent();\n $event->setOrganization($this->getOrganization($data['organization']['id']));\n $event->setMember($this->getMember($data['member']['id']));\n break;\n case Events::MEMBER_JOINED:\n case Events::MEMBER_UPDATE:\n $event = new Event\\MemberEvent();\n $event->setMember($this->getMember($data['member']['id']));\n break;\n case Events::POWERUP_ENABLE:\n case Events::POWERUP_DISABLE:\n $event = new Event\\PowerUpEvent();\n $event->setPowerUp($data['powerUp']);\n break;\n default:\n throw new InvalidArgumentException(sprintf(\n 'Unknown event \"%s\" occured with following data: \"%s\".',\n $eventName,\n serialize($data)\n ));\n }\n\n $event->setRequestData($data);\n\n $this->dispatcher->dispatch($eventName, $event);\n }",
"public function callbackAction()\n {\n // set needed request method parameter\n if ($this->_request->isPost()) {\n $_SERVER['REQUEST_METHOD'] = 'post';\n } else {\n $_SERVER['REQUEST_METHOD'] = 'get';\n }\n\n // disable rendering\n $this->_helper->viewRenderer->setNoRender();\n\n // disable layout for Ajax requests\n $this->_helper->layout()->disableLayout();\n\n // get the subscription storage\n $subscriptionStorage = new PubSubHubbub_Subscription(\n $this->_subscriptionModelInstance,\n $this->_privateConfig->get('subscriptions')\n );\n\n //get the Callback instance and hond over the storage\n $callback = new PubSubHubbub_Subscriber_Callback;\n $callback->setStorage($subscriptionStorage);\n\n // handle request and immediatly send response, to avoid blocking the hub\n $callback->handle($this->_request->getParams(), true);\n\n // ######## Feed Update Handling ########\n // if hub sends you a couple of feed updates\n if (true === $callback->hasFeedUpdate()) {\n //get filepath for the feed update files\n $filePath = $this->_owApp->erfurt->getTmpDir() .\n \"pubsub_\" .\n $this->_request->getParam('xhub_subscription') .\n \"_\" .\n time() .\n \".xml\";\n\n // if filepath is not writable\n if ( false === ( $fh = fopen($filePath, 'w') ) ) {\n // can't open the file\n $m = \"No write permissions for \". $filePath;\n throw new CubeViz_Exception($m);\n }\n\n // write the hole feed update to the file\n fwrite($fh, $callback->getFeedUpdate() . \"\\n\");\n // set file mode\n chmod($filePath, 0755);\n // clsoe file\n fclose($fh);\n\n // collect all subscripton properties\n $subscriptionResourceData = $subscriptionStorage->getSubscription(\n $this->_request->getParam('xhub_subscription')\n );\n\n // create erfurt event\n $event = new Erfurt_Event('onFeedUpdate');\n\n // attach some information to the event\n $event->autoInsertFeedUpdates = 'true' == $this->_privateConfig\n ->get('subscriptions')\n ->get('autoInsertFeedUpdates') ? true : false;\n $event->feedUpdateFilePath = $filePath;\n $event->feedUpdates = $callback->getFeedUpdate();\n\n // extract model iri from subscription entry in subscriptions model\n $modelIriProperty = $this->_privateConfig->get('subscriptions')->get('modelIri');\n $modelIri = $subscriptionResourceData['resourceProperties'][$modelIriProperty][0]['uri'];\n $event->modelInstance = new Erfurt_Rdf_Model($modelIri);\n\n // add source resource to the event\n $event->sourceResource = $subscriptionStorage->getSourceResource(\n $this->_request->getParam('xhub_subscription')\n );\n\n // add subscripton properties to the event\n $event->subscriptionResourceProperties = $subscriptionResourceData['resourceProperties'];\n\n // trigger the event\n $event->trigger();\n }\n }",
"private function checkWebhooks()\n {\n if (!$this->getWebhooksList()) {\n Log::info(\"ShopifyApi.checkWebhooks: register webhooks\");\n\n // create webhooks for uninstalling app\n $this->createAppWebhooks();\n\n } else {\n Log::info(\"ShopifyApi.checkWebhooks: webhooks are already registered\");\n }\n }",
"public function main()\n {\n try {\n $routes = require_once 'routes.php';\n\n //Initialize Altorouter\n $router = new AltoRouter();\n\n $router->setBasePath('');\n\n //Register routes from routes.php file and map them on Alto Router\n $this->registerRoutes($router, $routes);\n\n //Match coming request with mapped routes using Alto Router\n $match = $router->match();\n if ($match) {\n\n $request = new Request();\n $request->populate();\n $request->appendQueryParams($match['params']);\n //Get method name from route name/key\n $methodName = $this->getMethodNameFromRouteName($match['name']);\n\n //Set action method name in request object\n $request->setControllerActionMethod($methodName);\n\n //Apply pre Middlewares\n $this->callMiddlewares($request, $match['name'], $routes, MiddlewareType::PRE);\n\n //Require controller\n $this->requireControllerAndCheckMethod($match['target'], $methodName);\n $controllerName = '\\App\\Controllers\\\\' . $match['target'] . controllerSuffix();\n $controllerObj = new $controllerName();\n list($status, $body) = $controllerObj->{$methodName}($request);\n //Apply post Middlewares\n $this->callMiddlewares($request, $match['name'], $routes, MiddlewareType::POST);\n } else {//404 not found\n $status = ResponseCodes::HTTP_NOT_FOUND;\n $body = getViewHtml('404');\n }\n // Set HTTP header\n $statusHeader = 'HTTP/1.1 ' . $status . ' ' . getStatusCodeMessage($status);\n header($statusHeader, true, intval($status));\n\n // Encode json\n echo $body;\n } catch (Exception $exception) {\n throw $exception;\n }\n }",
"public function run()\n {\n //\n $param=[\n 'message'=>'google',\n 'url'=>'google',\n ];\n $restdata=new Restdata;\n $restdata->fill($param)->save();\n $param=[\n 'message'=>'yahoo',\n 'url'=>'yahoo',\n ];\n $restdata=new Restdata;\n $restdata->fill($param)->save();\n $param=[\n 'message'=>'MSN',\n 'url'=>'msn',\n ];\n $restdata=new Restdata;\n $restdata->fill($param)->save();\n }",
"function handleRequest() ;",
"public function handleTransactionWebhook(Wallet $wallet, $payload);",
"public function webhook(Request $request): Response\n {\n if (Webhook::isNotSecure($request)) {\n abort(401, 'Unauthorized request.');\n }\n\n if ($request->header('X-GitHub-Event') === Webhook::PUSH_EVENT) {\n $payload = json_decode($request->getContent());\n $project = Project::where('repository', $payload->repository->full_name)->firstOrFail();\n\n $deployment = new Deployment([\n 'commit' => $payload->head_commit->id,\n 'commit_url' => $payload->repository->full_name\n ]);\n\n StartDeployment::dispatch($project, $deployment);\n }\n\n return response(['success' => 'Webhook event received successfully.']);\n }",
"function fill_webhook_config()\n{\n # git-commit-email-checker.php will ignore any incoming POST that does\n # not come from these network blocks.\n #\n # For GitHub Enterprise, fill in the CIDR notation for your GitHub\n # server(s).\n #$config[\"allowed_sources\"] = array(\"10.10.11.0/24\", \"10.10.22.0/24\");\n #\n # For GitHub.com, as of 9 Aug 2016, according to\n # https://help.github.com/articles/what-ip-addresses-does-github-use-that-i-should-whitelist/:\n $config[\"allowed_sources\"] = array(\"192.30.252.0/22\");\n\n # Fill this in with a Github personal access token that is allowed\n # to set pull request statuses. See the README.md for more detail.\n $config[\"auth_token\"] = \"Fill me in\";\n\n # The name that will appear for this CI agent at GitHub on pull\n # requests.\n $config[\"ci-context\"] = \"Commit email checker\";\n\n # Optional: if a commit contains a boneheaded email address, link\n # to this URL\n #$config[\"ci-link-url\"] = \"http://example.com\";\n\n # You almost certainly want \"debug\" set to 0 (or unset)\n $config[\"debug\"] = 0;\n\n # These are the repos for which we are allowed to reply.\n # Valid values are:\n # - a full repo name, such as: jsquyres/email-checker-github-webhook\n # - full wildcard: *\n # - wildcard the username/org name: */email-checker-github-webhook\n # - wildcard the repo name: jsquyres/*\n # - wildcard both names: */*\n #$config[\"github\"][\"jsquyres/github-webhooks\"] = 1;\n $config[\"github\"][\"jsquyres/*\"] = 1;\n\n # GitHub API URL. Can be configured for internal / GitHub\n # Enterprise instances.\n #\n # GitHub.com: https://api.github.com\n # GHE: http[s]://YOUR_GHE_SERVER/api/v3\n #\n $config[\"api_url_base\"] = \"https://api.github.com\";\n\n #####################################################################\n # Config specific to the bozo email checker\n #####################################################################\n\n # You can define any of the \"bad\", \"good\", and/or \"hooks\" values,\n # or leave them undefined (although you probably want to define at\n # least one of them!).\n\n # Array of regular expressions used to check author/committer\n # email addresses. These are Perl-style regular expressions\n # (i.e., they are passed to the PHP function preg_match()). If\n # any of these match, fail the test.\n $config[\"bad\"] = array(\n \"/^root@/\",\n \"/localhost/\",\n \"/localdomain/\");\n\n # Array of regular expressions used to check author/committer\n # email addresses. These are Perl-style regular expressions\n # (i.e., they are passed to the PHP function preg_match()). If\n # any of these DO NOT match, fail the test (i.e., all of them must\n # match to pass the test).\n $config[\"good\"] = array(\n '/^(\\w+)\\@mydomain\\.com$/i');\n\n # Array function names to be called for each commit (i.e., any\n # custom code you want to check). Note that these hooks are only\n # called if the above good/bad checks pass.\n $config[\"hooks\"] = array(\n \"my_email_check_function\");\n\n # Return the $config variable\n return $config;\n}",
"public function __invoke(Request $request)\n {\n $event = $request->get('type');\n $fired_at = $request->get('fired_at'); // UTC timestamp string eg: \"2009-03-26 21:35:57\",\n $data = $request->get('data');\n\n switch ($event) {\n case 'subscribe':\n //$data['id'] = \"8a25ff1d98\",\n //$data['list_id'] = \"a6b5da1054\",\n //$data['email'] = \"[email protected]\",\n //$data['email_type'] = \"html\",\n //$data['merges']['EMAIL]\": \"[email protected]\",\n //$data['merges']['FNAME]\": \"Mailchimp\",\n //$data['merges']['LNAME]\": \"API\",\n //$data['merges']['INTERESTS]\": \"Group1,Group2\",\n //$data['ip_opt'] = \"10.20.10.30\",\n //$data['ip_signup'] = \"10.20.10.30\"\n break;\n\n case 'unsub':\n case 'delete':\n //An unsubscribe event's action is either unsub or delete. The reason will be manual unless caused by a spam complaint, then it will be abuse.\n //$data['reason'] = \"manual\", // \"abuse\"\n //$data['id'] = \"8a25ff1d98\",\n //$data['list_id'] = \"a6b5da1054\",\n //$data['email'] = \"[email protected]\",\n //$data['email_type'] = \"html\",\n //$data['merges']['EMAIL]\": \"[email protected]\",\n //$data['merges']['FNAME]\": \"Mailchimp\",\n //$data['merges']['LNAME]\": \"API\",\n //$data['merges']['INTERESTS]\": \"Group1,Group2\",\n //$data['ip_opt'] = \"10.20.10.30\",\n //$data['campaign_id'] = \"cb398d21d2\",\n break;\n\n\n case 'profile':\n //Note that you will always receive a profile update at the same time as an email update.\n //$data['id'] = \"8a25ff1d98\",\n //$data['list_id'] = \"a6b5da1054\",\n //$data['email'] = \"[email protected]\",\n //$data['email_type'] = \"html\",\n //$data['merges']['EMAIL]\": \"[email protected]\",\n //$data['merges']['FNAME]\": \"Mailchimp\",\n //$data['merges']['LNAME]\": \"API\",\n //$data['merges']['INTERESTS]\": \"Group1,Group2\",\n //$data['ip_opt'] = \"10.20.10.30\"\n break;\n\n case 'upemail':\n //Note that you will always receive a profile update at the same time as an email update.\n //$data['list_id'] = \"a6b5da1054\",\n //$data['new_id'] = \"51da8c3259\",\n //$data['new_email'] = \"[email protected]\",\n //$data['old_email'] = \"[email protected]\"\n break;\n\n case 'cleaned':\n //For cleaned emails, the reason will be hard (for hard bounces) or abuse.\n //$data['list_id'] = \"a6b5da1054\",\n //$data['campaign_id'] = \"4fjk2ma9xd\",\n //$data['reason'] = \"hard\", // \"abuse\"\n //$data['email'] = \"[email protected]\"\n break;\n\n case 'campaign':\n // Campaign-Sent Emails\n //$data['id'] = \"5aa2102003\",\n //$data['subject'] = \"Test Campaign Subject\",\n //$data['status'] = \"sent\",\n //$data['reason'] = \"\",\n //$data['list_id'] = \"a6b5da1054\"\n break;\n }\n\n\n // Send a response, to acknowledge receipt, so it doesn't keep re-sending.\n return response('Success', 200);\n }",
"public function dealswebhook(){\n\t\t//echo \"<br/>\".getcwd();\n\t\techo \"<pre>\";\n\t\t$deal= file_get_contents(getcwd().'/webhook.txt');\n\t\t$deal=json_decode($deal);\n\t\t$dealdata=array();\n\t\tif($deal->meta){\n\t\t\t$action= $deal->meta->action;\n\t\t\t$dealdata['d_id']= $deal->meta->id;\n\t\t\t$dealdata['company_id']= $deal->meta->company_id;\n\t\t\tif($deal->current){\n\t\t\t\t$dealdata['title']= $deal->current->title;\n\t\t\t\t$dealdata['stage_id']= $deal->current->stage_id;\n\t\t\t\t$dealdata['person_id']= $deal->current->person_id;\n\t\t\t\t$dealdata['creator_user_id']= $deal->current->creator_user_id;\n\t\t\t\t$dealdata['value']= $deal->current->value?$deal->current->value:'';\n\t\t\t\t$dealdata['currency']= $deal->current->currency;\n\t\t\t\t$dealdata['add_time']= $deal->current->add_time;\n\t\t\t\t$dealdata['update_time']= $deal->current->update_time;\n\t\t\t\tif(!empty($deal->current->stage_change_time)){\n\t\t\t\t\t$dealdata['stage_change_time']= $deal->current->stage_change_time;\n\t\t\t\t}else{\n\t\t\t\t\t$dealdata['stage_change_time']= $deal->current->add_time;\n\t\t\t\t}\n\t\t\t\t$dealdata['status']= $deal->current->status;\n\t\t\t\t$dealdata['visible_to']= $deal->current->visible_to;\n\t\t\t\t$dealid= DB::table('pd_deals')->where('d_id', $deal->meta->id)->get();\n\t\t\t\tif(empty($dealid[0])){\n\t\t\t\t\t$id = DB::table('pd_deals')->insertGetId($dealdata);\n\t\t\t\t\tif($id){\n\t\t\t\t\t\techo \"Aded<br/>\";\n\t\t\t\t\t}else{\n\t\t\t\t\t\techo \"Error<br/>\";\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\t$id=DB::table('pd_deals')\n\t\t\t\t\t\t->where('d_id', $deal->meta->id)\n\t\t\t\t\t\t->update($dealdata);\n\t\t\t\t\tif($id){\n\t\t\t\t\t\techo \"Update 1111111111<br/>\";\n\t\t\t\t\t}\t\n\t\t\t }\n\t\t\t}\n\t\t}\n\t\tprint_r($dealdata);\n\t\tprint_r($deal); \n }"
] | [
"0.7183029",
"0.6798163",
"0.6792571",
"0.65838367",
"0.65535676",
"0.65399146",
"0.64454573",
"0.6403871",
"0.6397686",
"0.63255143",
"0.63252825",
"0.62925535",
"0.6242492",
"0.62073433",
"0.61905754",
"0.61767817",
"0.60834485",
"0.6049791",
"0.6032171",
"0.5922562",
"0.58949983",
"0.5894112",
"0.5889516",
"0.5885024",
"0.58635026",
"0.58597183",
"0.585667",
"0.58535177",
"0.5842137",
"0.5838846",
"0.58349717",
"0.5822342",
"0.5821987",
"0.5820788",
"0.580623",
"0.57939404",
"0.5791415",
"0.57886565",
"0.5787968",
"0.57793635",
"0.5762157",
"0.57399374",
"0.57339555",
"0.5692771",
"0.568744",
"0.5673821",
"0.56303126",
"0.56281036",
"0.5621234",
"0.5613775",
"0.5603728",
"0.5600672",
"0.55967826",
"0.55967826",
"0.55967826",
"0.55958086",
"0.5590499",
"0.5587883",
"0.5577451",
"0.55659246",
"0.5556513",
"0.5556091",
"0.5551231",
"0.55473995",
"0.5536366",
"0.5534585",
"0.5529015",
"0.5524966",
"0.552249",
"0.55158347",
"0.55023545",
"0.549949",
"0.54917276",
"0.5474954",
"0.5458547",
"0.5457774",
"0.54432076",
"0.54427296",
"0.54424536",
"0.5441762",
"0.543445",
"0.5429803",
"0.5429561",
"0.54263204",
"0.5424009",
"0.54107904",
"0.53998196",
"0.5399749",
"0.53887993",
"0.5388492",
"0.5381446",
"0.53778344",
"0.5376949",
"0.53678733",
"0.5366502",
"0.5366358",
"0.535446",
"0.53541785",
"0.5352864",
"0.53507483",
"0.5339998"
] | 0.0 | -1 |
Consume the given events to update contacts in google. | public function consumeEvents($listToken, $eventsJson)
{
$listToken = filter_var($listToken, FILTER_SANITIZE_STRING);
$decoded = json_decode($eventsJson, true);
/** @var $lists Laposta_Connect_Model_Mysql4_List_Collection */
$lists = Mage::getModel('lapostaconnect/list')->getCollection();
/** @var $list Laposta_Connect_Model_List */
$list = array_shift(
$lists->getItemsByColumnValue('webhook_token', $listToken)
);
$this->log("Found list using webhook token '$listToken'", $list);
if (!$list instanceof Laposta_Connect_Model_List) {
return $this->log("Unable to consume events. '$listToken' is not a valid webhook token.");
}
$this->log("Consuming events for client '$listToken'", $eventsJson);
if ($decoded === false) {
return $this->log("Events data could not be parsed. Input is not valid JSON.");
}
if (!isset($decoded['data']) || !is_array($decoded['data'])) {
return $this;
}
foreach ($decoded['data'] as $event) {
try {
$this->consumeEvent($event, $list);
}
catch (Exception $e) {
$this->log("{$e->getMessage()} on line '{$e->getLine()}' of '{$e->getFile()}'");
}
}
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function processEventQueue()\n {\n if (!$this->googleClient)\n {\n try \n {\n $this->googleClient = $this->createGoogleConnection(); \n } \n catch (\\Exception $e) \n {\n $this->syncProblemNotification($e->getMessage());\n die($e->getMessage());\n }\n \n }\n\n $db = \\JFactory::getDbo();\n\n $query = $db->getQuery(true);\n $query->select('*')->from('#__pbbooking_sync')->where('status is null')->order('id ASC');\n $events = $db->setQuery($query)->loadObjectList();\n\n foreach ($events as $event)\n {\n $success = false;\n switch ($event->action)\n {\n case 'create':\n $success = $this->sendEvent($event);\n break;\n case 'delete':\n $success = $this->deleteEvent($event);\n break;\n }\n\n //update the error flag so that it can be reported on in the admin console.\n $event->status = ($success) ? 'success' : 'error';\n if ($success)\n echo '<br/>Event '.$event->action.' success';\n else\n echo '<br/>Event '.$event->action.' failed';\n \n $db->updateObject('#__pbbooking_sync',$event,'id');\n }\n }",
"public function update(Request $request, events $events)\n {\n //\n }",
"public function update(Request $request, Events $events)\n {\n //\n }",
"function modify_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 update\n// from <link rel=self>\n$id = 'http://www.google.com/m8/feeds/contacts/default/full/0';\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\n $gdata = new Zend_Gdata($client);\n $gdata->setMajorProtocolVersion(3);\n \n // perform query and get entry\n $query = new Zend_Gdata_Query($id);\n $entry = $gdata->getEntry($query);\n $xml = simplexml_load_string($entry->getXML());\n\n // change name\n $xml->name->fullName = 'John Rabbit';\n \n // change primary email address \n foreach ($xml->email as $email) {\n if (isset($email['primary'])) {\n $email['address'] = '[email protected]'; \n } \n }\n \n // update entry\n $entryResult = $gdata->updateEntry($xml->saveXML(), \n $entry->getEditLink()->href);\n echo 'Entry updated';\n} catch (Exception $e) {\n die('ERROR:' . $e->getMessage());\n}\n }",
"public function subscribe($events)\n {\n // Dynamically resolve all information sheet classes and call their subscribe method\n // so that they can respond to any events fired by the application.\n $this->resolveInformationSheets()->each->subscribe($events);\n }",
"public function update(Request $request, Events $Events)\n {\n //\n }",
"public function addContacts(Request $request, Event $event)\n {\n $eventDate = $request->input('event_date');\n $eventNote = $request->input('event_text');\n foreach($request->input('contact_list') as $contact){\n $event->contacts()->sync([ $contact =>['date'=> $eventDate, 'note'=> $eventNote]], False);\n }\n\n return redirect()->back();\n\n }",
"function UpdateEvents() {\n\t\tforeach ($this->data as $i => $row) {\n\t\t\tif (!is_null($row['EventId'])) {\n\t\t\t\t//check wheter event is assigned to calculated event. If it is take the calculated rating, otherwise set the rating to -0.5\n\t\t\t\tif (array_key_exists($i, $this -> rating)) {\n\t\t\t\t\t$rating = $this -> rating[$i];\n\t\t\t\t} else {\n\t\t\t\t\t$rating = -0.5;\n\t\t\t\t}\n\t\t\t\t//update all events\n\t\t\t\t$sql = \"UPDATE Event SET rating=\" . $rating . \" WHERE EventId=\" . $row['EventId'];\n\t\t\t\t$stmt = $this -> DB -> prepare($sql);\n\t\t\t\tif ($stmt -> execute()) {\n\t\t\t\t} else {\n\t\t\t\t\tinclude_once \"Email.php\";\n\t\t\t\t\tnew Email('failed', 'to update event rating with EventId=' . $row['EventId'], $this -> id);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$this -> updateTask();\n\n\t}",
"public function eventsClear()\n {\n //check or get oauth token\n OAuthManager::getInstance()->checkAuthorization();\n\n //the base uri for api requests\n $_queryBuilder = Configuration::getBaseUri();\n \n //prepare query string for API call\n $_queryBuilder = $_queryBuilder.'/notification/events/clear';\n\n //validate and preprocess url\n $_queryUrl = APIHelper::cleanUrl($_queryBuilder);\n\n //prepare headers\n $_headers = array (\n 'user-agent' => 'ApiMatic-RestClient-2018-5-18 Sdk-Langauge:PHP',\n 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken)\n );\n\n //call on-before Http callback\n $_httpRequest = new HttpRequest(HttpMethod::POST, $_headers, $_queryUrl);\n if ($this->getHttpCallBack() != null) {\n $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest);\n }\n\n //and invoke the API call request to fetch the response\n $response = Request::post($_queryUrl, $_headers);\n\n $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body);\n $_httpContext = new HttpContext($_httpRequest, $_httpResponse);\n\n //call on-after Http callback\n if ($this->getHttpCallBack() != null) {\n $this->getHttpCallBack()->callOnAfterRequest($_httpContext);\n }\n\n //handle errors defined at the API level\n $this->validateResponse($_httpResponse, $_httpContext);\n }",
"public function subscribe($events)\n {\n foreach ($this->events as $event => $action) {\n $events->listen($event, BadgeSubscriber::class . '@' . $action);\n }\n }",
"private function course_updated($event) {\n global $DB;\n $courseid = $event->courseid;\n $course = $DB->get_record('course', array('id' => $courseid), 'visible');\n $coursecontext = context_course::instance($courseid);\n $coursemodinfo = get_fast_modinfo($courseid, -1);\n $cms = $coursemodinfo->get_cms();\n\n $users = $this->get_google_authenticated_users($courseid);\n $insertcalls = array();\n $deletecalls = array();\n\n foreach ($cms as $cm) {\n $cmid = $cm->id;\n $cmcontext = context_module::instance($cmid);\n $fileids = $this->get_fileids($cmid);\n if ($fileids) {\n foreach ($fileids as $fileid) {\n foreach ($users as $user) {\n if (has_capability('moodle/course:view', $coursecontext, $user->userid)) {\n // Manager; do nothing.\n } elseif (is_enrolled($coursecontext, $user->userid, null, true) && has_capability('moodle/course:manageactivities', $cmcontext, $user->userid)) {\n // Teacher (enrolled) (active); do nothing.\n } elseif (is_enrolled($coursecontext, $user->userid, null, true)) {\n // Student (enrolled); continue checks for reader permissions.\n if ($course->visible == 1) {\n // Course is visible, continue checks.\n rebuild_course_cache($courseid, true);\n $modinfo = get_fast_modinfo($courseid, $user->userid);\n $cminfo = $modinfo->get_cm($cmid);\n $sectionnumber = $this->get_cm_sectionnum($cmid);\n $secinfo = $modinfo->get_section_info($sectionnumber);\n if ($cminfo->uservisible && $secinfo->available) {\n // User can view and access course module and can access section; insert reader permission.\n $call = new stdClass();\n $call->fileid = $fileid;\n $call->gmail = $user->gmail;\n $call->role = 'reader';\n $insertcalls[] = $call;\n if (count($insertcalls) == 1000) {\n $this->batch_insert_permissions($insertcalls);\n $insertcalls = array();\n }\n }\n // User cannot access course module, do nothing (course module availability won't change here).\n } else {\n // Course not visible, delete permission.\n try {\n $permissionid = $this->service->permissions->getIdForEmail($user->gmail);\n $permission = $this->service->permissions->get($fileid, $permissionid->id);\n if ($permission->role != 'owner') {\n $call = new stdClass();\n $call->fileid = $fileid;\n $call->permissionid = $permissionid->id;\n $deletecalls[] = $call;\n if (count($deletecalls) == 1000) {\n $this->batch_delete_permissions($deletecalls);\n $deletecalls = array();\n }\n }\n } catch (Exception $e) {\n debugging($e);\n }\n }\n }\n // Unenrolled user; do nothing (user enrolment would not have changed during this event).\n }\n }\n }\n }\n\n // Call any remaining batch requests.\n if (count($insertcalls) > 0) {\n $this->batch_insert_permissions($insertcalls);\n }\n\n if (count($deletecalls) > 0) {\n $this->batch_delete_permissions($deletecalls);\n }\n }",
"public function send_events()\n {\n }",
"public function sendEvent($context) {\n\t\t\n\t\t\t//Store some information on the Symphony Entry.\n\t\t\t$entry = $context['entry'];\n\t\t\t\n\t\t\t$entry_settings = $entry->get();\n\t\t\t$entry_id = $entry_settings['id'];\t\n\t\n\t\t\t$e_data = array();\n\t\t\tforeach($context['fields'] as $key => $value) {\n\t\t\t\tif($this->string_begins_with($key, 'e-')) {\n\t\t\t\t\t$e_data[str_replace('e-', 'e_', $key)] = $value;\n\t\t\t\t} else if ($this->string_begins_with($key, 'g-')) {\n\t\t\t\t\t$e_data[str_replace('g-', 'g_', $key)] = $value;\n\t\t\t\t}\n\t\t\t}\n\t\t\t//Change the e_status property to a value the API understands\n\t\t\tif($e_data['e_status'] == 'yes') {\n\t\t\t\t$e_data['e_status'] = 'active';\n\t\t\t} else {\n\t\t\t\t$e_data['e_status'] = 'pending';\n\t\t\t}\t\n\t\t\t//Set the format of the Date/Times\n\t\t\t$e_data['e_start'] = date('Y-m-d G:i:s', strtotime($e_data['e_start']));\n\t\t\t$e_data['e_stop'] = date('Y-m-d G:i:s', strtotime($e_data['e_stop']));\n\t\t\t$e_data['e_deadline'] = date('Y-m-d G:i:s', strtotime($e_data['e_deadline']));\n\n\t\t\t//Another Required field is the User ID\n\t\t\t$e_data['u_id'] = $this->u_id;\n\t\t\t\n\t\t\t//Create a unique Push URL (e_pushurl) from the entry ID.\n\t\t\t$e_data['e_pushurl'] = URL .'/eventarc-updater/?hash='.sha1($entry_id).'&id='.$entry_id;\n\t\t\n\t\t\t//Address Data\n\t\t\t$a_data = array();\n\t\t\tforeach($context['fields'] as $key => $value) {\n\t\t\t\tif($this->string_begins_with($key, 'a-')) {\n\t\t\t\t\t$a_data[str_replace('a-', 'a_', $key)] = $value;\n\t\t\t\t} \n\t\t\t}\n\t\t\t\n\t\t\t//If the ID & URL are not set - Create a new event.\n\t\t\tif($e_data['e_id'] == '' && $e_data['e_url'] == '') {\n\t\t\t\n\t\t\t\tunset($e_data['e_id']);\n\t\t\t\tunset($e_data['e_url']);\t\n\t\t\t\tif(!empty($a_data)) {\n\t\t\t\t\t//Set the type as venue.\n\t\t\t\t\t$a_data['a_type'] = 'venue';\n\t\t\t\t\t// Send the event to eventarc with the address details\n\t\t\t\t\t$result = $this->eventarc\n\t\t\t\t\t ->add_event($e_data)\n\t\t\t\t\t ->add_address($a_data)\n\t\t\t\t\t ->event_create();\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\t// Send the event to eventarc\n\t\t\t\t\t$result = $this->eventarc\n\t\t\t\t\t ->add_event($e_data)\n\t\t\t\t\t ->event_create();\n\t\t\t\t}\n\n\t\t\t\t if($result) {\n\t\n\t\t\t\t \tif(!isset(self::$fieldManager)) {\n\t\t\t\t \t\tself::$fieldManager = new fieldManager(Symphony::Engine());\n\t\t\t\t \t}\n\t\t\t\t \t\n\t\t\t\t \t$field_id = self::$fieldManager->fetchFieldIDFromElementName('e-id');\n\t\t\t\t \t$entry->setData($field_id, array(\n\t\t\t\t \t\t'handle' => $result['e_id'],\n\t\t\t\t \t\t'value' => $result['e_id'],\n\t\t\t\t \t\t'value_formatted' => $result['e_id'],\n\t\t\t\t \t\t'word_count' => 0\n\t\t\t\t \t));\n\t\t\t\t \t\n\t\t\t\t \t//Save the returned Eventarc URL (e_url).\n\t\t\t\t \t$field_id = self::$fieldManager->fetchFieldIDFromElementName('e-url');\n\t\t\t\t \t$entry->setData($field_id, array(\n\t\t\t\t \t\t'handle' => $result['url'],\n\t\t\t\t \t\t'value' => $result['url'],\n\t\t\t\t \t\t'value_formatted' => $result['url'],\n\t\t\t\t \t\t'word_count' => 0\n\t\t\t\t \t));\n\t\t\t\t \t\n\t\t\t\t \t//Save the returned Eventarc Address ID (a_id).\n\t\t\t\t \t$field_id = self::$fieldManager->fetchFieldIDFromElementName('a-id');\n\t\t\t\t \t$entry->setData($field_id, array(\n\t\t\t\t \t\t'handle' => $result['a_id'],\n\t\t\t\t \t\t'value' => $result['a_id'],\n\t\t\t\t \t\t'value_formatted' => $result['a_id'],\n\t\t\t\t \t\t'word_count' => 0\n\t\t\t\t \t));\n\t\t\t\t \t\n\t\t\t\t \t$entry->commit();\n\t\t\t \n\t\t\t\t }\n\t\t\t\t \n\t\t\t} \n\t\t\t//Event already exists - update the event. \n\t\t\telse {\n\t\t\t\t\n\t\t\t\t//Check that the URL is not empty.\t\n\t\t\t\tif($e_data['e_url'] == '') {\n\t\t\t\t\t\n\t\t\t\t\t$result = $this->eventarc->event_get($e_data['e_id']);\n\t\t\t\t\t\n\t\t\t\t\tif(!isset(self::$fieldManager)) {\n\t\t\t\t\t\tself::$fieldManager = new fieldManager(Symphony::Engine());\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t//Save the returned Eventarc URL (e_url).\n\t\t\t\t\t$field_id = self::$fieldManager->fetchFieldIDFromElementName('e-url');\n\t\t\t\t\t$entry->setData($field_id, array(\n\t\t\t\t\t\t'handle' => $result['url'],\n\t\t\t\t\t\t'value' => $result['url'],\n\t\t\t\t\t\t'value_formatted' => $result['url'],\n\t\t\t\t\t\t'word_count' => 0\n\t\t\t\t\t));\n\t\t\t\t\t\n\t\t\t\t\t$entry->commit();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t//Check that the Address ID is not empty.\t\n\t\t\t\tif($a_data['a_id'] == '') {\n\t\t\t\t\t\n\t\t\t\t\t$result = $this->eventarc->event_get_address($e_data['e_id']);\n\t\t\t\t\t\n\t\t\t\t\tif(!isset(self::$fieldManager)) {\n\t\t\t\t\t\tself::$fieldManager = new fieldManager(Symphony::Engine());\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t//Save the returned Eventarc Address ID (a_id).\n\t\t\t\t\t$field_id = self::$fieldManager->fetchFieldIDFromElementName('a-id');\n\t\t\t\t\t$entry->setData($field_id, array(\n\t\t\t\t\t\t'handle' => $result['a_id'],\n\t\t\t\t\t\t'value' => $result['a_id'],\n\t\t\t\t\t\t'value_formatted' => $result['a_id'],\n\t\t\t\t\t\t'word_count' => 0\n\t\t\t\t\t));\n\t\t\t\t\t\n\t\t\t\t\t//Store the retrieved address ID.\n\t\t\t\t\t$a_data['a_id'] = $result['a_id'];\n\t\t\t\t\t$entry->commit();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//Don't want to manually change the URL generated by Eventarc.\n\t\t\t\tunset($e_data['e_url']);\t\t\t\t\n\t\t\t\t\n\t\t\t\t//Edit the Event.\n\t\t\t\tif(!empty($a_data)) {\n\t\t\t\t\t//Set the type as venue.\n\t\t\t\t\t$a_data['a_type'] = 'venue';\n\t\t\t\t\t// Send the event to eventarc with the address details\n\t\t\t\t\t$result = $this->eventarc\n\t\t\t\t\t ->add_event($e_data)\t\n\t\t\t\t\t ->event_update();\n\t\t\t\t\t $result = $this->eventarc\n\t\t\t\t\t ->add_address($a_data)\n\t\t\t\t\t ->address_update();\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\t// Send the event to eventarc\n\t\t\t\t\t$result = $this->eventarc\n\t\t\t\t\t ->add_event($e_data)\n\t\t\t\t\t ->event_update();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\n\t\t}",
"public function subscribe($events)\n {\n\n foreach($this->actions as $action){\n $events->listen(\n 'RoiUp\\Zoom\\Events\\Meeting\\\\MeetingRegistrant' . $action,\n self::class . '@onRegistrant' . $action\n );\n }\n\n }",
"public function eventsHandleMany(\n $eventIds\n ) {\n //check or get oauth token\n OAuthManager::getInstance()->checkAuthorization();\n //check that all required arguments are provided\n if (!isset($eventIds)) {\n throw new \\InvalidArgumentException(\"One or more required arguments were NULL.\");\n }\n\n\n //the base uri for api requests\n $_queryBuilder = Configuration::getBaseUri();\n \n //prepare query string for API call\n $_queryBuilder = $_queryBuilder.'/notification/events/handle';\n\n //validate and preprocess url\n $_queryUrl = APIHelper::cleanUrl($_queryBuilder);\n\n //prepare headers\n $_headers = array (\n 'user-agent' => 'ApiMatic-RestClient-2018-5-18 Sdk-Langauge:PHP',\n 'content-type' => 'application/json; charset=utf-8',\n 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken)\n );\n\n //call on-before Http callback\n $_httpRequest = new HttpRequest(HttpMethod::POST, $_headers, $_queryUrl);\n if ($this->getHttpCallBack() != null) {\n $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest);\n }\n\n //and invoke the API call request to fetch the response\n $response = Request::post($_queryUrl, $_headers, Request\\Body::Json($eventIds));\n\n $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body);\n $_httpContext = new HttpContext($_httpRequest, $_httpResponse);\n\n //call on-after Http callback\n if ($this->getHttpCallBack() != null) {\n $this->getHttpCallBack()->callOnAfterRequest($_httpContext);\n }\n\n //handle errors defined at the API level\n $this->validateResponse($_httpResponse, $_httpContext);\n }",
"function updateEventTable(&$formvars){\r\n //$confirmcode = $this->MakeConfirmationMd5($formvars['email']);\r\n \r\n //$formvars['confirmcode'] = $confirmcode;\r\n\t\t\r\n\t\t$uName = $this->UsrName();\r\n\t\t\r\n\t\t/* Address manipulation--------Start\r\n\t\t * This portion is where we manipulate the address.\r\n\t\t * Sends it to Google services to get the Latitude and Longitude of the address.\r\n\t\t */\r\n\t\t$address = $formvars['Eaddress'] . \", \" . $formvars['Ecity'] . \", \" . $formvars['Estate'] . \" \" . $formvars['Ezip'];\r\n\t\t$expression = \"/\\s/\";\r\n\t\t$replace = \"+\";\r\n\r\n\t\t$street = preg_replace($expression, $replace, $address);\r\n\t\t$prepAddr = str_replace(' ', '+', $street);\r\n\t\t$geocode = file_get_contents('http://maps.google.com/maps/api/geocode/json?address='.$prepAddr.'&sensor=false');\r\n\t\t$output = json_decode($geocode);\r\n\t\t/*Address manipulation--------End*/\r\n\t\t\r\n\t\t/*Returns the coordinates of the address.*/\r\n\t\t$lat = $output->results[0]->geometry->location->lat;\r\n\t\t$long = $output->results[0]->geometry->location->lng;\r\n\t\t\r\n\t\t$formvars['EtimeStart'] = date(\"g:i a\", strtotime($formvars['EtimeStart']));\r\n\t\t$formvars['EtimeEnd'] = date(\"g:i a\", strtotime($formvars['EtimeEnd']));\r\n\t\t\r\n\t\t$newStartTime= date(\"H:i\", strtotime($formvars['EtimeStart']));\r\n\t\t\r\n\t\t\r\n\t\t$EstartDate= $formvars['EstartDate'] ;\r\n\t\t\r\n\t\t$EstartDate= strtotime($EstartDate);\r\n\t\t$EstartDate= date(\"Y-m-d\",$EstartDate);\r\n\t\t\r\n\t\t\r\n\t\t/* If the option from the drop down in the form is 'Other'\r\n\t\t * Then we use this option that allows to insert the other typed by the user.\r\n\t\t */\r\n\t\t$insert_query = 'UPDATE ' . $this->tablename2 . ' SET UuserName = \"' . $this->SanitizeForSQL($uName) . '\", ' \r\n\t\t. 'Evename = \"' . $this->SanitizeForSQL($formvars['Evename']) . '\", EstartDate = \"' . $this->SanitizeForSQL($EstartDate) . '\", ' \r\n\t\t. 'EendDate = \"' . $this->SanitizeForSQL($formvars['EendDate']) . '\", Eaddress = \"' . $this->SanitizeForSQL($formvars['Eaddress']) . '\", ' \r\n\t\t. 'Ecity = \"' . $this->SanitizeForSQL($formvars['Ecity']) . '\", Estate = \"' . $this->SanitizeForSQL($formvars['Estate']) . '\", ' \r\n\t\t. 'Ezip = \"' . $this->SanitizeForSQL($formvars['Ezip']) . '\", EphoneNumber = \"' . $this->SanitizeForSQL($formvars['EphoneNumber']) . '\", ' \r\n\t\t. 'Edescription = \"' . $this->SanitizeForSQL($formvars['Edescription']) . '\", Etype = \"' . $this->SanitizeForSQL($formvars['Etype']) . '\", ' \r\n\t\t. 'Ewebsite = \"' . $this->SanitizeForSQL($formvars['Ewebsite']) . '\", Ehashtag = \"' . $this->SanitizeForSQL($formvars['Ehashtag']) . '\", ' \r\n\t\t. 'Efacebook = \"' . $this->SanitizeForSQL($formvars['Efacebook']) . '\", Etwitter = \"' . $this->SanitizeForSQL($formvars['Etwitter']) . '\", ' \r\n\t\t. 'Egoogle = \"' . $this->SanitizeForSQL($formvars['Egoogle']) . '\", '\r\n\t\t. (($formvars['Eflyer'] !== null) ? ('Eflyer = \"' . $this->SanitizeForSQL($formvars['Eflyer'])) . '\", ' : \"\")\r\n\t\t. (($formvars['Ebanner'] !== null) ? ('Ebanner = \"' . $this->SanitizeForSQL($formvars['Ebanner'])). '\", ': \"\")\r\n\t\t. (($formvars['Etype'] === 'Other') ? ('Eother = \"' . $this->SanitizeForSQL($formvars['Eother'])) . '\", ': \"\")\r\n\t\t. 'EtimeStart = \"' . $this->SanitizeForSQL($newStartTime) . '\", ' \r\n\t\t. 'EtimeEnd = \"' . $this->SanitizeForSQL($formvars['EtimeEnd']) . '\", Elat = \"' . $this->SanitizeForSQL($lat) . '\", ' \r\n\t\t. 'Elong = \"' . $this->SanitizeForSQL($long) . '\", Erank = \"' . $this->SanitizeForSQL($formvars['Erank']) . '\"' \r\n\t\t. 'WHERE Eid = \"' . $this->SanitizeForSQL($formvars['Eid']).'\"';\r\n\t\t\r\n if(!mysql_query($insert_query, $this->connection)){\r\n $this->HandleDBError(\"Error inserting data to the table\\nquery: $insert_query\");\r\n return false;\r\n }\r\n\t\treturn true;\r\n }",
"private function user_enrolment_updated($event) {\n global $DB;\n $courseid = $event->courseid;\n $userid = $event->relateduserid;\n $gmail = $this->get_google_authenticated_users_gmail($userid);\n $insertcalls = array();\n $deletecalls = array();\n if ($gmail) {\n $course = $DB->get_record('course', array('id' => $courseid), 'visible');\n $coursecontext = context_course::instance($courseid);\n $coursemodinfo = get_fast_modinfo($courseid, -1);\n $cms = $coursemodinfo->get_cms();\n foreach ($cms as $cm) {\n $cmid = $cm->id;\n $cmcontext = context_module::instance($cmid);\n $fileids = $this->get_fileids($cmid);\n if ($fileids) {\n foreach ($fileids as $fileid) {\n if (has_capability('moodle/course:view', $coursecontext, $userid)) {\n // Manager; do nothing.\n } elseif (is_enrolled($coursecontext, $userid, null, true) && has_capability('moodle/course:manageactivities', $cmcontext, $userid)) {\n // Teacher (enrolled) (active); insert writer permisson.\n $call = new stdClass();\n $call->fileid = $fileid;\n $call->gmail = $gmail;\n $call->role = 'writer';\n $insertcalls[] = $call;\n if (count($insertcalls) == 1000) {\n $this->batch_insert_permissions($insertcalls);\n $insertcalls = array();\n }\n } elseif (is_enrolled($coursecontext, $userid, null, true)) {\n // Student (enrolled) (active); continue checks.\n if ($course->visible == 1) {\n // Course is visible, continue checks.\n rebuild_course_cache($courseid, true);\n $modinfo = get_fast_modinfo($courseid, $userid);\n $cminfo = $modinfo->get_cm($cmid);\n $sectionnumber = $this->get_cm_sectionnum($cmid);\n $secinfo = $modinfo->get_section_info($sectionnumber);\n if ($cminfo->uservisible && $secinfo->available) {\n // User can view and access course module and can access section; insert reader permission.\n $call = new stdClass();\n $call->fileid = $fileid;\n $call->gmail = $gmail;\n $call->role = 'reader';\n $insertcalls[] = $call;\n if (count($insertcalls) == 1000) {\n $this->batch_insert_permissions($insertcalls);\n $insertcalls = array();\n }\n }\n // Course module not visible or avaiable; do nothing (module would not change here).\n }\n // Course not visible, do nothing (course would not change here).\n } else {\n // Unenrolled user; delete permission.\n try {\n $permissionid = $this->service->permissions->getIdForEmail($gmail);\n $permission = $this->service->permissions->get($fileid, $permissionid->id);\n if ($permission->role != 'owner') {\n $call = new stdClass();\n $call->fileid = $fileid;\n $call->permissionid = $permissionid->id;\n $deletecalls[] = $call;\n if (count($deletecalls) == 1000) {\n $this->batch_delete_permissions($deletecalls);\n $deletecalls = array();\n }\n }\n } catch (Exception $e) {\n debugging($e);\n }\n }\n }\n }\n }\n }\n \n // Call any remaining batch requests.\n if (count($insertcalls) > 0) {\n $this->batch_insert_permissions($insertcalls);\n }\n \n if (count($deletecalls) > 0) {\n $this->batch_delete_permissions($deletecalls);\n }\n }",
"public static function updateGoogleCalendarEvent($event,$start_datetime,$end_datetime){\n\t\t\n\n\t\tif($event['google_event_id'] == null){\n\t\t\tself::insertGoogleCalendarEvent($event,$start_datetime,$end_datetime);\n\t\t\treturn;\n\t\t}\n\n\t\t$client \t= GoogleCalendarHelper::getClient();\n\t\t$service \t= new Google_Service_Calendar($client);\n\t\t$google_event = $service->events->get('primary', $event['google_event_id']);\n\n\t\t// Google Calendar Date time\n\t\t$start \t= new Google_Service_Calendar_EventDateTime();\n\t\t$end \t= new Google_Service_Calendar_EventDateTime();\n\n\t\t$start->setDateTime($start_datetime);\n\t\t$end->setDateTime($end_datetime);\n\n\t\t$google_event->setSummary($event['title']);\n\t\t$google_event->setStart($start);\n\t\t$google_event->setEnd($end);\n\t\t$google_event->setLocation($event['venue']['name']);\n\n\t\t$google_event = $service->events->update('primary', $google_event->getId(), $google_event);\n\n\t}",
"public function edit(events $events)\n {\n //\n }",
"public function eventsHandle(\n $eventId\n ) {\n //check or get oauth token\n OAuthManager::getInstance()->checkAuthorization();\n //check that all required arguments are provided\n if (!isset($eventId)) {\n throw new \\InvalidArgumentException(\"One or more required arguments were NULL.\");\n }\n\n\n //the base uri for api requests\n $_queryBuilder = Configuration::getBaseUri();\n \n //prepare query string for API call\n $_queryBuilder = $_queryBuilder.'/notification/events/{eventId}/handle';\n\n //process optional query parameters\n $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array (\n 'eventId' => $eventId,\n ));\n\n //validate and preprocess url\n $_queryUrl = APIHelper::cleanUrl($_queryBuilder);\n\n //prepare headers\n $_headers = array (\n 'user-agent' => 'ApiMatic-RestClient-2018-5-18 Sdk-Langauge:PHP',\n 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken)\n );\n\n //call on-before Http callback\n $_httpRequest = new HttpRequest(HttpMethod::POST, $_headers, $_queryUrl);\n if ($this->getHttpCallBack() != null) {\n $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest);\n }\n\n //and invoke the API call request to fetch the response\n $response = Request::post($_queryUrl, $_headers);\n\n $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body);\n $_httpContext = new HttpContext($_httpRequest, $_httpResponse);\n\n //call on-after Http callback\n if ($this->getHttpCallBack() != null) {\n $this->getHttpCallBack()->callOnAfterRequest($_httpContext);\n }\n\n //handle errors defined at the API level\n $this->validateResponse($_httpResponse, $_httpContext);\n }",
"public function contact_edit_item($ews, $contact_id, $contact_change_key,$given_name, $surname,$company_name,$job_title, $email_address, $street, $city, $province_state, $postal_code, $country_region, $contact_number){\n\t\t//Start Update\t\n\t\t$request = new EWSType_UpdateItemType();\n\t\t\n\t\t$request->SendMeetingInvitationsOrCancellations = 'SendToNone';\n\t\t$request->MessageDisposition = 'SaveOnly';\n\t\t$request->ConflictResolution = 'AlwaysOverwrite';\n\t\t$request->ItemChanges = array();\n\t\t\n\t\t// Build out item change request.\n\t\t$change = new EWSType_ItemChangeType();\n\t\t$change->ItemId = new EWSType_ItemIdType();\n\t\t$change->ItemId->Id = $contact_id;\n\t\t$change->ItemId->ChangeKey = $contact_change_key;\n\t\t$change->Updates = new EWSType_NonEmptyArrayOfItemChangeDescriptionsType();\n\t\t$change->Updates->SetItemField = array(); // Array of fields to be update\n\t\t\n\t\t//popoulate update array\n\t\t$updates = array(\n\t\t\t'contacts:GivenName' => $given_name,\n\t\t\t'contacts:Surname' => $surname,\n\t\t\t'contacts:CompanyName' => $company_name,\n\t\t\t'contacts:JobTitle' => $job_title,\n\t\t);\n\n\t\tforeach($updates as $furi => $update){\n\t\t\tif($update){\n\t\t\t\t$prop = array_pop(explode(':',$furi));\n\t\t\t\t// loop through array and update each item\n\t\t\t\t$field = new EWSType_SetItemFieldType();\n\t\t\t\t$field->FieldURI->FieldURI = $furi;\n\t\t\t\t$field->Contact = new EWSType_ContactItemType();\n\t\t\t\t$field->Contact->$prop = $update;\n\t\t\t\t//set array\n\t\t\t\t$change->Updates->SetItemField[] = $field;\n\t\t\t}\n\t\t}\n\t\t\t\t\t\n\t\t// Update Email1 (indexed property).\n\t\t$field = new EWSType_SetItemFieldType();\n\t\t$field->IndexedFieldURI->FieldURI = 'contacts:EmailAddress';\n\t\t$field->IndexedFieldURI->FieldIndex = EWSType_EmailAddressKeyType::EMAIL_ADDRESS_1;\n\t\t\n\t\t$field->Contact = new EWSType_ContactItemType();\n\t\t$field->Contact->EmailAddresses = new EWSType_EmailAddressDictionaryType();\n\t\t\n\t\t$entry = new EWSType_EmailAddressDictionaryEntryType();\n\t\t$entry->_ = $email_address;\n\t\t$entry->Key = EWSType_EmailAddressKeyType::EMAIL_ADDRESS_1;\n\t\t\n\t\t//var_dump($entry);\n\t\t\n\t\t$field->Contact->EmailAddresses->Entry = $entry;\n\t\t\n\t\t$change->Updates->SetItemField[] = $field; \n\n\t\t// Update Physical Address.\n\t\t//Create Address Array\n\t\t$address_array = array(\n\t\t\t'contacts:PhysicalAddress:Street' => $street,\n\t\t\t'contacts:PhysicalAddress:City' => $city,\n\t\t\t'contacts:PhysicalAddress:State' => $province_state,\n\t\t\t'contacts:PhysicalAddress:CountryOrRegion' => $country_region,\n\t\t\t'contacts:PhysicalAddress:PostalCode' => $postal_code,\n\t\t);\n\n\t\tforeach($address_array as $address_info => $info){\n\t\t\tif($info){\n\t\t\t\t$pos = array_pop(explode(':',$address_info));\n\t\t\t\t$field = new EWSType_SetItemFieldType();\n\t\t\t\t$field->IndexedFieldURI->FieldURI = $address_info; //Street/City/State/Country/PostalCode\n\t\t\t\t$field->IndexedFieldURI->FieldIndex = EWSType_PhysicalAddressKeyType::HOME;//just change this according to the key type - Home/Business/Other\n\t\t\t\t$field->Contact = new EWSType_ContactItemType();\n\t\t\t\t$field->Contact->PhysicalAddresses = new EWSType_PhysicalAddressDictionaryType();\n\t\t\t\t$address = new EWSType_PhysicalAddressDictionaryEntryType();\n\t\t\t\t$address->Key = EWSType_PhysicalAddressKeyType::HOME;\n\t\t\t\t\n\t\t\t\t$field->Contact->PhysicalAddresses->Entry = $address;\n\t\t\t\t$field->Contact->PhysicalAddresses->Entry->$pos = $info;\n\t\t\t\t\n\t\t\t\t$change->Updates->SetItemField[] = $field; \n\t\t\t}\n\t\t}\n\t\t\n\t\t//Update an Contact number\n\t\t//available types are BusinessPhone, BusinessFax, HomePhone, HomeFax, MobilePhone, Fax, etc...\n\t\t$field = new EWSType_SetItemFieldType();\n\t\t$field->IndexedFieldURI->FieldURI = 'contacts:PhoneNumber';\n\t\t$field->IndexedFieldURI->FieldIndex = EWSType_PhoneNumberKeyType::HOME_PHONE;\n\t\t\n\t\t$field->Contact = new EWSType_ContactItemType();\n\t\t$field->Contact->PhoneNumber = new EWSType_PhoneNumberDictionaryType();\n\n\t\t$contact = new EWSType_PhoneNumberDictionaryEntryType();\n $contact->_ = $contact_number;\n $contact->Key = EWSType_PhoneNumberKeyType::HOME_PHONE;\n\t\t\n\t\t// set the phone number\n\t\t$field->Contact->PhoneNumbers->Entry = $contact;\n\t\t$change->Updates->SetItemField[] = $field;\n\n\t\t// Set all changes\n\t\t$request->ItemChanges[] = $change;\n\t\t\n\t\t// Send request\n\t\t$response = $ews->UpdateItem($request);\n\t\t\n\t\t$contact_data = array();\n\t\tarray_push($contact_data,$response->ResponseMessages->UpdateItemResponseMessage);\n\t\treturn $contact_data;\n\t\t//print_r($event_data);\n\t\t\n\t}",
"protected function send_request(array $event_info)\n {\n }",
"public function update($event_info = null)\n {\n echo \"观察者1 收到消息,执行完毕!\";\n }",
"public function subscribe($events)\n {\n $events->listen('Swapbot\\Events\\CustomerAddedToSwap', 'Swapbot\\Handlers\\Events\\CustomerEmailHandler@customerAddedToSwap');\n $events->listen('Swapbot\\Events\\SwapWasConfirmed', 'Swapbot\\Handlers\\Events\\CustomerEmailHandler@swapWasConfirmed');\n $events->listen('Swapbot\\Events\\SwapWasCompleted', 'Swapbot\\Handlers\\Events\\CustomerEmailHandler@swapWasCompleted');\n $events->listen('Swapbot\\Events\\SwapWasPermanentlyErrored', 'Swapbot\\Handlers\\Events\\CustomerEmailHandler@swapWasPermanentlyErrored');\n }",
"private function sendEvent($event)\n {\n\n if (!$this->googleClient)\n {\n throw new \\Exception(\"No active connection to Google found.\", 1);\n \n }\n\n $db = \\JFactory::getDbo();\n\n // Just extract the event's data and calendar details\n $data = json_decode($event->data,true);\n $cal = $GLOBALS['com_pbbooking_data']['calendars'][$data['cal_id']];\n\n // Set the \\Google_Service service\n $service = new \\Google_Service_Calendar($this->googleClient);\n\n // Event will now be overwritten with the new \\Google_Service_Calendar_Event object\n $event = new \\Google_Service_Calendar_Event;\n $event->setSummary($data['summary']);\n\n $start = new \\Google_Service_Calendar_EventDateTime();\n $start->setDateTime(date_create($data['dtstart']['date'],new \\DateTimeZone(PBBOOKING_TIMEZONE))->format(DATE_RFC3339));\n $event->setStart($start);\n\n $end = new \\Google_Service_Calendar_EventDateTime();\n $end->setDateTime(date_create($data['dtend']['date'],new \\DateTimeZone(PBBOOKING_TIMEZONE))->format(DATE_RFC3339));\n $event->setEnd($end);\n\n $createdEvent = $service->events->insert(trim($cal->gcal_id), $event);\n\n if ($createdEvent)\n {\n // Update the gcalid of the event\n $db->updateObject('#__pbbooking_events',new \\JObject(array(\n 'id' => $data['id'],\n 'gcal_id' => $createdEvent->getId()\n )),'id');\n\n return true;\n }\n else\n {\n return false;\n }\n }",
"public function subscribe($events)\n {\n \t$events->listen(\n \t\t\\Config::get('detr.event_detr.event_sentmail_order'), \n \t\t'DeTrFunc\\EventDetrSendMailSubcriber@onSentOrderStatusMail'\n \t);\n\n $events->listen(\n \\Config::get('detr.event_detr.event_sentmail_notify_order'), \n 'DeTrFunc\\EventDetrSendMailSubcriber@onSentOrderNotifyMail'\n );\n }",
"public function handle_actions() {\n if ( !empty( $_REQUEST[ 'yith-wcbk-google-calendar-action' ] ) && $this->check_nonce() ) {\n $credentials_options = array( 'client-id', 'client-secret' );;\n switch ( $_REQUEST[ 'yith-wcbk-google-calendar-action' ] ) {\n case 'save-options':\n $options = array( 'calendar-id' );\n foreach ( $options as $option ) {\n $value = !empty( $_REQUEST[ $option ] ) ? $_REQUEST[ $option ] : '';\n $this->set_option( $option, $value );\n }\n break;\n case 'save-settings':\n $settings = !empty( $_REQUEST[ 'settings' ] ) ? $_REQUEST[ 'settings' ] : array();\n $default_settings = array(\n 'debug' => 'no',\n 'add-note-on-sync' => 'no',\n 'booking-events-to-synchronize' => array(),\n );\n $settings = wp_parse_args( $settings, $default_settings );\n foreach ( $settings as $option => $value ) {\n $this->set_option( $option, $value );\n }\n break;\n case 'save-credentials':\n foreach ( $credentials_options as $option ) {\n $value = !empty( $_REQUEST[ $option ] ) ? $_REQUEST[ $option ] : '';\n $this->set_option( $option, $value );\n }\n break;\n\n case 'delete-client-secret':\n foreach ( $credentials_options as $option ) {\n $this->set_option( $option, '' );\n }\n break;\n\n case 'logout':\n $this->set_option( 'access-token', '' );\n $this->set_option( 'refresh-token', '' );\n delete_transient( 'yith-wcbk-gcal-access-token' );\n break;\n }\n }\n }",
"public function eventsAction()\n {\n $callback = function ($msg) {\n //check the db before running anything\n if (!$this->isDbConnected('db')) {\n return ;\n }\n\n if ($this->di->has('dblocal')) {\n if (!$this->isDbConnected('dblocal')) {\n return ;\n }\n }\n\n //we get the data from our event trigger and unserialize\n $event = unserialize($msg->body);\n\n //overwrite the user who is running this process\n if (isset($event['userData']) && $event['userData'] instanceof Users) {\n $this->di->setShared('userData', $event['userData']);\n }\n\n //lets fire the event\n $this->events->fire($event['event'], $event['source'], $event['data']);\n\n $this->log->info(\n \"Notification ({$event['event']}) - Process ID \" . $msg->delivery_info['consumer_tag']\n );\n };\n\n Queue::process(QUEUE::EVENTS, $callback);\n }",
"public function subscribe($events)\n {\n $events->listen(\n 'App\\Events\\CreateCommsExecs',\n 'App\\Listeners\\CommsExecsEventSubscriber@onCreate'\n );\n\n $events->listen(\n 'App\\Events\\DeleteCommsExecs',\n 'App\\Listeners\\CommsExecsEventSubscriber@onDelete'\n );\n\n $events->listen(\n 'App\\Events\\UpdateCommsExecs',\n 'App\\Listeners\\CommsExecsEventSubscriber@onUpdate'\n );\n }",
"public function subscribe($events)\n {\n //这里需申明完整类路径,否则会出现'Class UserEventListener does not exist'错误\n $events->listen('App\\Events\\OrderFailDeal', 'App\\Listeners\\OrderEventListener@onOrderFailDeal');\n\n $events->listen('App\\Events\\OrderSuccCloudSystem', 'App\\Listeners\\OrderEventListener@onOrderSuccCloudSystem');\n\n $events->listen('App\\Events\\OrderSuccCloudPlatform', 'App\\Listeners\\OrderEventListener@onOrderSuccCloudPlatform');\n\n $events->listen('App\\Events\\OrderSuccServiceLlhb', 'App\\Listeners\\OrderEventListener@onOrderSuccServiceLlhb');\n }",
"function add_event($settings)\n {\n if(!$this->isLogged)\n $this->login();\n \n if($this->isLogged)\n {\n $_entry = \"<entry xmlns='http://www.w3.org/2005/Atom' xmlns:gd='http://schemas.google.com/g/2005'>\n <category scheme='http://schemas.google.com/g/2005#kind' term='http://schemas.google.com/g/2005#event'></category>\n <title type='text'>\".$settings[\"title\"].\"</title>\n <content type='text'>\".$settings[\"content\"].\"</content>\n <author>\n <name>\".$this->email.\"</name>\n <email>\".$this->email.\"</email>\n </author>\n <gd:transparency\n value='http://schemas.google.com/g/2005#event.opaque'>\n </gd:transparency>\n <gd:eventStatus\n value='http://schemas.google.com/g/2005#event.confirmed'>\n </gd:eventStatus>\n <gd:where valueString='\".$settings[\"where\"].\"'></gd:where>\n <gd:when startTime='\".$settings[\"startDay\"].\"T\".$settings[\"startTime\"].\".000Z'\n endTime='\".$settings[\"endDay\"].\"T\".$settings[\"endTime\"].\".000Z'>\n\t<gd:reminder minutes='5' /></gd:when>\n </entry>\";\n $this->prepare_feed_path();\n \n $header = array();\n $this->setMoreHeader(\"MIME-Version: 1.0\");\n //$this->setMoreHeader(\"Accept: text/xml\");\n $this->setMoreHeader(\"Authorization: GoogleLogin auth=\".$this->fAuth);\n $this->setMoreHeader(\"Content-length: \".strlen($_entry));\n $this->setMoreHeader(\"Content-type: application/atom+xml\");\n $this->setMoreHeader(\"Cache-Control: no-cache\");\n $this->setMoreHeader(\"Connection: close \\r\\n\");\n $this->setMoreHeader($_entry);\n\n \n $this->setHost($this->feed_host,80);\n $this->useSSL(false);\n $this->setHandleRedirects(false);\n $status = $this->post($this->feed_path_prepared, null ,null);\n if (302==$status) {\n \t$h = $this->getHeaders();\n\t$new_uri = parse_url($h['location']);\n\t$status =$this->post($new_uri['path'].'?'.$new_uri['query'], null ,null) ;\n\tif(201==$status)\n\t return true;\n\t}\n }\n return false;\n }",
"function add_event($settings)\n {\n if(!$this->isLogged)\n $this->login();\n \n if($this->isLogged)\n {\n $_entry = \"<entry xmlns='http://www.w3.org/2005/Atom' xmlns:gd='http://schemas.google.com/g/2005'>\n <category scheme='http://schemas.google.com/g/2005#kind' term='http://schemas.google.com/g/2005#event'></category>\n <title type='text'>\".$settings[\"title\"].\"</title>\n <content type='text'>\".$settings[\"content\"].\"</content>\n <author>\n <name>\".$this->email.\"</name>\n <email>\".$this->email.\"</email>\n </author>\n <gd:transparency\n value='http://schemas.google.com/g/2005#event.opaque'>\n </gd:transparency>\n <gd:eventStatus\n value='http://schemas.google.com/g/2005#event.confirmed'>\n </gd:eventStatus>\n <gd:where valueString='\".$settings[\"where\"].\"'></gd:where>\n <gd:when startTime='\".$settings[\"startDay\"].\"T\".$settings[\"startTime\"].\".000Z'\n endTime='\".$settings[\"endDay\"].\"T\".$settings[\"endTime\"].\".000Z'></gd:when>\n </entry>\";\n \n $this->prepare_feed_url();\n \n $header = array();\n $header[] = \"Host: www.google.com\";\n $header[] = \"MIME-Version: 1.0\";\n $header[] = \"Accept: text/xml\";\n $header[] = \"Authorization: GoogleLogin auth=\".$this->fAuth;\n $header[] = \"Content-length: \".strlen($_entry);\n $header[] = \"Content-type: application/atom+xml\";\n $header[] = \"Cache-Control: no-cache\";\n $header[] = \"Connection: close \\r\\n\";\n $header[] = $_entry;\n \n $this->post($this->feed_url_prepared, null, $header, $http_code);\n if(201==$http_code)\n return true;\n \n }\n else\n echo \"cannot login with '\".$this->email.\"' email and '<font color=\\\"lightgray\\\">\".$this->password.\"</font>' password<br/>\";\n return false;\n }",
"public function commitEvents();",
"public function enqueueEvents(DomainEvents $events): void\n {\n foreach ($events as $event) {\n $eventClassName = \\get_class($event instanceof DecoratedEvent ? $event->getWrappedEvent() : $event);\n foreach ($this->eventListenerLocator->getListenerClassNamesForEventClassName($eventClassName) as $listenerClassName) {\n $this->pendingEventListenerClassNames[$listenerClassName] = true;\n }\n }\n }",
"public function fetchEvents()\n {\n // TODO: Implement fetchEvents() method.\n }",
"function refresh(){\n\n $this->autoRender = false;\n $array = Configure::read('lm_in');\n\n\t \n\t $obj = new ff_event($array);\t \n\n\t if ($obj -> auth != true) {\n \t die(printf(\"Unable to authenticate\\r\\n\"));\n\t }\n\n\t $message_entries = array();\n\n \t \twhile ($entry = $obj->getNext('delete')){\n\n\t $created = intval(floor($entry['Event-Date-Timestamp']/1000000));\n\t $length = intval(floor(($entry['FF-FinishTimeEpoch']-$entry['FF-StartTimeEpoch'])/1000)); \n\t $mode = $entry['FF-CallerID'];\n\t $value = $entry['FF-CallerName'];\n\n//$this->PhoneDirectory->execute_query(\"select recipient_name from phone_directory where phone_no = '+13154805045'\", \"phone_directory\")\n\n\t $data= array ( 'sender' => $this->sanitizePhoneNumber($entry['FF-CallerID']),\n\t \t \t 'file' => $entry['FF-FileID'],\n\t \t \t 'created' => $created,\n\t\t\t \t\t'length' => $length,\n\t \t\t 'url' => $entry['FF-URI'],\n\t \t\t 'instance_id' => $entry['FF-InstanceID'],\n \t\t\t 'quick_hangup' => $entry['FF-OnQuickHangup'],\n );\n\t $this->log('[INFO] NEW MESSAGE, Sender: '.$entry['FF-CallerID'], 'message');\t\n\t $this->create();\n\t $this->save($data);\n\n\t \t\t//collecting message info - Ping 201603\n\t \t\t$message_entry = array();\n\t \t\t$message_entry['instance_id'] = $entry['FF-InstanceID'];\n\t \t\t$message_entry['sender'] = $this->sanitizePhoneNumber($entry['FF-CallerID']);\n\t \t\t$message_entry['created'] = $created;\n\n\t \t\tarray_push($message_entries, $message_entry);\n\n //Check if CDR with the same call_id exists with length=false\n $this->query(\"UPDATE cdr set length = \".$length.\", quick_hangup = '\".$entry['FF-OnQuickHangup'].\"' where call_id = '\".$entry['FF-FileID'].\"' and channel_state='CS_ROUTING'\");\n\n } \n\n // perform LmMenuRule lookup and triage rule - Ping 201603\n if(count($message_entries) > 0){\n \tforeach($message_entries as $message_entry) {\n\n\t\t $lm_menu_lookup = $this->query(\"SELECT id, title from lm_menus where instance_id = \".$message_entry['instance_id']);\n\t\t \t$lm_menu_id = $lm_menu_lookup[0]['lm_menus']['id'];\n\t\t \t$lm_menu_title = $lm_menu_lookup[0]['lm_menus']['title'];\n\t\t\t \t$lm_menu_rule_lookup = $this->query(\"SELECT lm_menu_type, designated_recipient from lm_menu_rule where lm_menu_id = \".$lm_menu_id);\n\n\t\t\t \tif($lm_menu_rule_lookup[0]['lm_menu_rule']['lm_menu_type'] == 'Priority') {\n\t\t\t \t\t// deliver sms to designaed recipient\n\t\t\t \t\t$designated_recipient = $lm_menu_rule_lookup[0]['lm_menu_rule']['designated_recipient'];\n\t\t\t \t\t\n\t\t\t \t\t$data = array(\n\t\t\t \t\t\t\t\t\t'title' => $lm_menu_title,\n\t\t\t \t\t\t\t\t\t'recipient' => $designated_recipient,\n\t\t\t \t\t\t\t\t\t'sender' => $message_entry['sender'],\n\t\t\t \t\t\t\t\t\t'created' => $message_entry['created'],\n\t\t\t \t\t\t\t\t);\n\n\t\t\t \t\t// bypassing Controller function - not recommended but ¯\\_(ツ)_/¯ \n\t\t\t \t\tApp::import('Controller', 'Batches');\n\t\t $batches = new BatchesController;\n\t\t $batches->addLAMBatch($data); \n\t\t\t \t}\n\n \t}\n } \n\n /* \n //test bed\n \t$lm_menu_lookup = $this->query(\"SELECT id from lm_menus where instance_id = 112\");\n \t$lm_menu_id = $lm_menu_lookup[0]['lm_menus']['id'];\n\t \t$lm_menu_rule_lookup = $this->query(\"SELECT lm_menu_type, designated_recipient from lm_menu_rule where lm_menu_id = \".$lm_menu_id);\n\n\t \tif($lm_menu_rule_lookup[0]['lm_menu_rule']['lm_menu_type'] == 'Priority') {\n\t \t\t$designated_recipient = $lm_menu_rule_lookup[0]['lm_menu_rule']['designated_recipient'];\n\t \t\techo $designated_recipient;\n\t \t}\n\t\t*/\n\n }",
"public function event($event_type, $name, $description, $date, $time, $mandal, $village, $mobile, $mobile2, $content, $status)\n\t{\n\n\t\t$queryGetMandal = mysql_fetch_assoc(mysql_query(\"select *from mandalmaster where mandalid='$mandal'\"));\n\t\t$queryGetVillage = mysql_fetch_assoc(mysql_query(\"select *from villagemaster where mandalid='$mandal'\"));\n\n\t\t$mandalName = $queryGetMandal['mandalname'];\n\t\t$villageName = $queryGetVillage['villagename'];\n\t\tif ($status == 'yes')\n\t\t{\n\t\t\t$query = \"INSERT INTO events(event_type, event_name, event_description, constituency, mandal, village, phone, phone2, sms_content, date, time, status, doc) VALUES ('\" . $event_type . \"','\" . $name . \"','\" . $description . \"', '\" . $constituency . \"', '\" . $mandalName . \"','\" . $villageName . \"','\" . $mobile . \"','\" . $mobile2 . \"','\" . $content . \"','\" . $date . \"','\" . $time . \"','\" . $status . \"', NOW())\";\n\t\t\t$result2 = mysql_query($query) or die(mysql_error());\n\t\t} else\n\t\t{\n\t\t\t$query = \"INSERT INTO events(event_type, event_name, event_description, constituency, mandal, village, phone, phone2, sms_content, date, time, status, doc) VALUES ('\" . $event_type . \"','\" . $name . \"','\" . $description . \"','\" . $constituency . \"','\" . $mandalName . \"','\" . $villageName . \"','\" . $mobile . \"','\" . $mobile2 . \"','\" . $content . \"','\" . $date . \"','\" . $time . \"','\" . $status . \"', NOW())\";\n\t\t\t$result2 = mysql_query($query) or die(mysql_error());\n\n\t\t\t$smsUrl = \"http://alerts.smssolutions.in/api/web2sms.php\";\n\t\t\t$apiKey = \"4143fcjtx1o4400a9476\";\n\t\t\t$senderId = \"VMNRES\";\n\t\t\t$mobileNumber = $mobile;\n\t\t\t$message = $content;\n\t\t\t$dlr_url = \"\";\n\t\t\t$type = \"xml\";\n\n\t\t\t$sendsms = new sendsms($smsUrl, $apiKey, $senderId);\n\t\t\t$timeZone = explode($time);\n\t\t\t$hours = $timeZone[0];\n\t\t\t$minutes = $timeZone[1];\n\n\t\t\tif ($minutes <= 15)\n\t\t\t{\n\t\t\t\t$min = 15;\n\t\t\t} elseif ($minutes >= 15 and $minutes <= 30)\n\t\t\t{\n\t\t\t\t$min = 30;\n\t\t\t} elseif ($minutes >= 30 and $minutes <= 45)\n\t\t\t{\n\t\t\t\t$min = 45;\n\t\t\t} elseif ($minutes >= 30 and $minutes <= 59)\n\t\t\t{\n\t\t\t\t$min = 00;\n\t\t\t}\n\t\t\t$time = \"$hours$min\";\n\t\t\t$smsDate = str_replace(\"-\", \"\", date(\"d-m-Y\", strtotime($date)));\n\t\t\t$smsDateTime = \"$smsDate$time\";\n\t\t\t//$sms=$sendsms->send_sms($mobileNumber, $message, $dlr_url, $type);\n\t\t\t$sendsms -> schedule_sms($mobileNumber, $message, $dlr_url, $type, $smsDateTime);\n\t\t}\n\t\treturn $result2;\n\t}",
"public function subscribe($events): void\n {\n $events->listen(OrderClosedEvent::class, self::class . '@recountProducts');\n }",
"public function execute() {\n global $CFG;\n\n require_once($CFG->dirroot . '/course/lib.php');\n\n // Specific list of plugins that need to be refreshed. If not set, then all mod plugins will be refreshed.\n $pluginstorefresh = null;\n if (isset($this->get_custom_data()->plugins)) {\n $pluginstorefresh = $this->get_custom_data()->plugins;\n }\n\n // Is course id set?\n if (isset($this->get_custom_data()->courseid)) {\n $courseid = $this->get_custom_data()->courseid;\n } else {\n $courseid = 0;\n }\n\n $pluginmanager = core_plugin_manager::instance();\n $modplugins = $pluginmanager->get_plugins_of_type('mod');\n foreach ($modplugins as $plugin) {\n // Check if a specific list of plugins is defined and check if it contains the plugin that is currently being evaluated.\n if (!empty($pluginstorefresh) && !in_array($plugin->name, $pluginstorefresh)) {\n // This plugin is not in the list, move on to the next one.\n continue;\n }\n // Refresh events.\n mtrace('Refreshing events for ' . $plugin->name);\n course_module_bulk_update_calendar_events($plugin->name, $courseid);\n }\n }",
"public static function editActionListener(): void {\n\t\telgg_register_event_handler('update:after', 'group', self::class . '::acceptMembershipRequests');\n\t}",
"public function actionAuth(){\n$client = $this->getClient();;\n$service = new Google_Service_Calendar($client);\n\n// Print the next 10 events on the user's calendar.\n$calendarId = 'primary';\n$optParams = array(\n 'maxResults' => 10,\n 'orderBy' => 'startTime',\n 'singleEvents' => true,\n 'timeMin' => date('c'),\n);\n$results = $service->events->listEvents($calendarId, $optParams);\n$events = $results->getItems();\n\nif (empty($events)) {\n print \"No upcoming events found.\\n\";\n} else {\n print \"Upcoming events:\\n\";\n foreach ($events as $event) {\n $start = $event->start->dateTime;\n if (empty($start)) {\n $start = $event->start->date;\n }\n printf(\"%s (%s)\\n\", $event->getSummary(), $start);\n }\n }\n}",
"public function update(Request $request, Contacts $contacts)\n {\n //\n }",
"public function subscribe($events)\n {\n $events->listen(\n 'App\\Events\\OrderCreated',\n 'App\\Listeners\\OrderEventSubscriber@handleOrderCreated'\n );\n $events->listen(\n 'App\\Events\\OrderUpdated',\n 'App\\Listeners\\OrderEventSubscriber@handleOrderUpdated'\n );\n }",
"public function indexEvents(array $events, array $context = []): void;",
"private function pushEvents ($e)\n\t\t{\n\t\t\t if ( self::chkOrgId () ) { /* Check main Id */\n\t\t\t\t $dbs = new DB ( $this->config['database'] );\n\t\t\t\t $c = $dbs->query (\"SELECT COUNT(*) AS C FROM tbl_events_record WHERE org_id = '\" . $this->c . \"'\");\n\t\t\t\t if ( ! $c[0]['C'] ) { /* Event not found in events table , Insert */ \n\t\t\t\t\t$db_ins = new DB ( $this->config['database'] ) ;\n \t \t$e_ins = $db_ins->query (\"INSERT INTO tbl_events_record \n\t\t\t\t\t\tVALUES('\" . $this->c . \"','\" . $e . \"','\". date('Y-m-d H:i:s').\"');\");\n\t\t\t\t\t$db_ins->CloseConnection ();\n\t\t\t\t\treturn true;\n\t\t\t\t } else { /* Event found in events table , Update events by Id */\n\t\t\t\t\t$db_upd = new DB ( $this->config['database'] ) ;\n\t\t\t\t\t$e_upd = $db_upd->query (\"UPDATE tbl_events_record \n\t\t\t\t\t\tSET events = '\".$e.\"', date_rec = '\". date('Y-m-d H:i:s') . \n\t\t\t\t\t\t\"' WHERE org_id = '\" . $this->c .\"'\");\n\t\t\t\t\t$db_upd->CloseConnection ();\n\t\t\t\t}\n\t\t\t\t$dbs->CloseConnection ();\n\t\t\t\t$this->result['data']['id'] = $this->c;\n\t\t\t\t$this->result['data']['result'] = \"Push event: \" . $e; /* Events status */\n\t\t\t } else /* Id not found */\n\t\t\t\t$this->result['data']['result'] = \"Id not found [error code:100:101]\";\n\n\t\t\treturn false;\n\t\t}",
"function update_contact_sample(\n string $contactEmail,\n int $contactNotificationCategorySubscriptionsElement,\n string $contactLanguageTag\n): void {\n // Create a client.\n $essentialContactsServiceClient = new EssentialContactsServiceClient();\n\n // Prepare the request message.\n $contactNotificationCategorySubscriptions = [$contactNotificationCategorySubscriptionsElement,];\n $contact = (new Contact())\n ->setEmail($contactEmail)\n ->setNotificationCategorySubscriptions($contactNotificationCategorySubscriptions)\n ->setLanguageTag($contactLanguageTag);\n $request = (new UpdateContactRequest())\n ->setContact($contact);\n\n // Call the API and handle any network failures.\n try {\n /** @var Contact $response */\n $response = $essentialContactsServiceClient->updateContact($request);\n printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());\n } catch (ApiException $ex) {\n printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());\n }\n}",
"public function edit(Events $events)\n {\n //\n }",
"public function edit(Events $events)\n {\n //\n }",
"public function edit(Events $events)\n {\n //\n }",
"public function calendar_edit_item($ews, $event_id, $event_change_key, $subject, $body, $bodytype, $start_date, $end_date, $location, $attendees, $allday, $importance, $sensitivity, $cancelled)\n\t {\n $request = new EWSType_UpdateItemType();\n\t\t$request->ConflictResolution = 'AlwaysOverwrite';\n\t\t$request->MessageDisposition = 'SaveOnly';\n\t\tif(!empty($attendees)){\n\t\t\t$request->SendMeetingInvitationsOrCancellations = 'SendToChangedAndSaveCopy';\n\t\t}else{\n\t\t\t$request->SendMeetingInvitationsOrCancellations = 'SendToNone';\n\t\t}\n\n\t\t$request->ItemChanges = new EWSType_NonEmptyArrayOfItemChangesType();\n\t\t$request->ItemChanges->ItemChange->ItemId->Id = $event_id;\n\t\t$request->ItemChanges->ItemChange->ItemId->ChangeKey = $event_change_key;\n\t\t$request->ItemChanges->ItemChange->Updates = new EWSType_NonEmptyArrayOfItemChangeDescriptionsType();\n\t\t\n\t\t//popoulate update array\n\t\t$updates = array(\n\t\t\t'calendar:Start' => $start_date, //e.g. 2012-06-12T12:30:00+00:00\n\t\t\t'calendar:End'\t=> $end_date, //e.g. 2012-06-12T12:30:00+00:00\n\t\t\t'calendar:Location' => $location,\n\t\t\t'calendar:IsAllDayEvent' => $allday, //boolean true\n\t\t\t'calendar:IsCancelled' => $cancelled,\n\t\t\t'item:Importance' => $importance,\n\t\t\t'item:Sensitivity' => $sensitivity,\n\t\t\t'item:Subject' => $subject,\n\t\t);\n\t\t$n = 0;\n\t\t$request->ItemChanges->ItemChange->Updates->SetItemField = array();\n\n\t\tforeach($updates as $furi => $update){\n\t\t\tif($update){\n\t\t\t\t$prop = array_pop(explode(':',$furi));\n\t\t\t\t$request->ItemChanges->ItemChange->Updates->SetItemField[$n]->FieldURI->FieldURI = $furi;\n\t\t\t\t$request->ItemChanges->ItemChange->Updates->SetItemField[$n]->CalendarItem->$prop = $update;\n\t\t\t\t$n++;\n\t\t\t}\n\t\t}\n\t\t//Update Attendees\n\t\t//Note: Only the organizer can update or change attendees, if you try to update an event that you are not the organizer of that has atendees you will recieve the error: \"Set action is invalid for property\"\n\t\tif(!empty($attendees)){\n\t\t\t$attendees = explode(\";\",$attendees);\n\t\t\t$request->ItemChanges->ItemChange->Updates->SetItemField[$n]->FieldURI->FieldURI = 'calendar:RequiredAttendees';\n\t\t\tfor($i = 0; $i < count($attendees)-1; $i++){\n\t\t\t\t$toattend = explode(\"|\",$attendees[$i]);\n\t\t\t\t//Name of Attendee\n\t\t\t\t$request->ItemChanges->ItemChange->Updates->SetItemField[$n]->CalendarItem->RequiredAttendees->Attendee[$i]->Mailbox->Name = $toattend[0];\n\t\t\t\t//Email Address of Attendee\n\t\t\t\t$request->ItemChanges->ItemChange->Updates->SetItemField[$n]->CalendarItem->RequiredAttendees->Attendee[$i]->Mailbox->EmailAddress = $toattend[1];\n\t\t\t\t//Routing Type \n\t\t\t\t$request->ItemChanges->ItemChange->Updates->SetItemField[$n]->CalendarItem->RequiredAttendees->Attendee[$i]->Mailbox->RoutingType = 'SMTP';\n\t\t\t\t//Responds Type of attendee\n\t\t\t\t$request->ItemChanges->ItemChange->Updates->SetItemField[$n]->CalendarItem->RequiredAttendees->Attendee[$i]->ResponseType = $toattend[2];\n\t\t\t}\n\t\t\t$n++;\t\n\t\t}\n\t\t//Update body\n\t\tif(!empty($body)){\n\t\t\t$request->ItemChanges->ItemChange->Updates->SetItemField[$n]->FieldURI->FieldURI = 'item:Body';\n\t\t\t$request->ItemChanges->ItemChange->Updates->SetItemField[$n]->CalendarItem->Body->BodyType = $bodytype;\n\t\t\t$request->ItemChanges->ItemChange->Updates->SetItemField[$n]->CalendarItem->Body->_ = $body;\n\t\t\t$n++;\n\t\t}\n\t\t//print_r($request); die();\n\t\t\n\t\t$response = $ews->UpdateItem($request);\n\t\t\n\t\t//$responseCode = $response->ResponseMessages->UpdateItemResponseMessage->ResponseCode;\n\t\t//$id = $response->ResponseMessages->UpdateItemResponseMessage->Items->CalendarItem->ItemId->Id;\n\t\t//$changeKey = $response->ResponseMessages->UpdateItemResponseMessage->Items->CalendarItem->ItemId->ChangeKey;\t\n\t\t\n\t\t$event_data = array();\n\t\tarray_push($event_data,$response->ResponseMessages->UpdateItemResponseMessage);\n\t\treturn $event_data;\n\t\t//print_r($event_data);\n\t}",
"public function subscribe($events)\n {\n $events->listen(\n \\App\\Listeners\\Backend\\GemSighting\\GemSightingCreated::class,\n 'App\\Listeners\\Backend\\GemSightingEventListener@onCreated'\n );\n\n $events->listen(\n \\App\\Listeners\\Backend\\GemSighting\\GemSightingUpdated::class,\n 'App\\Listeners\\Backend\\GemSightingEventListener@onUpdated'\n );\n\n $events->listen(\n \\App\\Listeners\\Backend\\GemSighting\\GemSightingDeleted::class,\n 'App\\Listeners\\Backend\\GemSightingEventListener@onDeleted'\n );\n }",
"function update() {\n\t\t$vars = $this->params['url'];\n\t\t$this->Event->id = $vars['id'];\n\t\t$this->Event->saveField('start', $vars['start']);\n\t\t$this->Event->saveField('end', $vars['end']);\n\t\t$this->Event->saveField('all_day', $vars['allday']);\n\t}",
"public function fetchExternalEvents()\n {\n $db = \\JFactory::getDbo();\n $config = $GLOBALS['com_pbbooking_data']['config'];\n\n foreach ($GLOBALS['com_pbbooking_data']['calendars'] as $cal)\n {\n if ( isset($cal->enable_google_cal) && $cal->enable_google_cal == 1 )\n {\n // This has a google cal and should get external events.\n $service = new \\Google_Service_Calendar($this->googleClient);\n\n // Get the date range\n $dtfrom = date_create(\"now\", new \\DateTimeZone(PBBOOKING_TIMEZONE));\n $dtto = date_create(\"now\", new \\DateTimeZone(PBBOOKING_TIMEZONE))->modify('+ ' . $config->sync_future_events . 'months');\n\n $params = array(\n 'timeMin' => $dtfrom->format(DATE_ATOM),\n 'timeMax' => $dtto->format(DATE_ATOM),\n 'maxResults' => $config->google_max_results\n );\n\n $googleEvents = $service->events->listEvents(trim($cal->gcal_id),$params);\n\n // Now loop through the events\n\n //let's first of all the gcalids of the external events then I can unset the element to be left with an array\n //of events that USED to be in the goolge cal but aren't any more. Then I can just deleted.\n $cur_externals = $db->setQuery('select gcal_id from #__pbbooking_events where cal_id = ' . (int)$cal->id.' and externalevent = 1')->loadColumn();\n $real_externals = array();\n\n foreach ($googleEvents as $gEvent)\n {\n\n //first check to see if the event with that gcal_id exists\n $db_event = $db->setQuery('select * from #__pbbooking_events where gcal_id = \"'.$db->escape($gEvent->getId()).'\"')->loadObject();\n //if it exists check to see if it is \"owned\" by externalevent\n if ($db_event && isset($db_event->externalevent) && $db_event->externalevent == 1)\n {\n //if it is owned by externalevent then update in the database\n $db_event->summary = $gEvent->getSummary();\n $db_event->dtend = date_create($gEvent->getEnd()->getDateTime(),new \\DateTimeZone(PBBOOKING_TIMEZONE))->format(DATE_ATOM);\n $db_event->dtstart = date_create($gEvent->getStart()->getDateTime(),new \\DateTimeZone(PBBOOKING_TIMEZONE))->format(DATE_ATOM);\n $db->updateObject('#__pbbooking_events',$db_event,'id');\n\n $real_externals[] = $gEvent->getId();\n\n echo '<br/>External event updated succesfully';\n } \n\n //if it's not ownedby externalevent then we don't need to do anything as it's owned by pbbooking\n \n \n if (!$db_event)\n {\n //else it doesn't exist in the database so we need to create \n $new_event = array(\n 'cal_id' => $cal->id,\n 'summary' => $gEvent->getSummary(),\n 'dtend' => date_create($gEvent->getEnd()->getDateTime(),new \\DateTimeZone(PBBOOKING_TIMEZONE))->format(DATE_ATOM),\n 'dtstart' => date_create($gEvent->getStart()->getDateTime(),new \\DateTimeZone(PBBOOKING_TIMEZONE))->format(DATE_ATOM),\n 'verified' => 1,\n 'externalevent' => 1,\n 'gcal_id' => $gEvent->getId()\n );\n $db->insertObject('#__pbbooking_events',new \\JObject($new_event),'id');\n\n echo '<br/>External event created succesfully';\n }\n }\n\n $stale_externals = array_diff($cur_externals,$real_externals);\n //delete stale gcal events\n foreach ($stale_externals as $rmevent) {\n $db->setQuery('delete from #__pbbooking_events where gcal_id = \"'.$db->escape($rmevent).'\"')->execute();\n echo '<br/>External event deleted succesfully';\n }\n\n }\n }\n \n }",
"protected static function events()\n {\n foreach (self::fetch('app/events', false) as $file) {\n Bus::need($file);\n }\n //\n Event::register();\n }",
"public static function reconstitute(array $events): self;",
"public function subscribe(Events $events)\n\t{\n\t\t$events->listen('crud::saved', array($this, 'onSaved'));\n\t}",
"public function testUpdateMyContact()\n {\n\n }",
"static public function handleIncomingEmails() {\n\n /**\n * Handle incoming emails for all generic comments (blogs, files, etc...)\n */\n elgg_register_plugin_hook_handler('email:integration:create', 'generic_comment',\n function ($hook_name, $entity_type, $return_value, $parameters) {\n\n // Setup the parameters\n set_input('topic_guid', $parameters['guid']);\n set_input('entity_guid', $parameters['guid']);\n set_input('generic_comment', $parameters['message']);\n\n // Set action\n set_input('action', 'comments/add');\n\n // Perform the action\n action(\"comments/add\");\n\n\n });\n\n /**\n * Handle incoming emails for discussion posts\n */\n elgg_register_plugin_hook_handler('email:integration:create', 'group_topic_post',\n function ($hook_name, $entity_type, $return_value, $parameters) {\n\n set_input('entity_guid', $parameters['guid']);\n set_input('group_topic_post', $parameters['message']);\n\n // Set action\n set_input('action', 'discussion/reply/save');\n\n // Perform the action\n action(\"discussion/reply/save\");\n\n\n });\n\n /**\n * Handle incoming emails for updating status\n */\n elgg_register_plugin_hook_handler('email:integration:create', 'status_update',\n function ($hook_name, $entity_type, $return_value, $parameters) {\n\n // Set update message\n // 140 characters or less\n set_input('body', substr($parameters['message'], 0, 140));\n set_input('method', 'site');\n\n // Set action\n set_input('action', 'thewire/add');\n\n // perform the action\n action(\"thewire/add\");\n\n\n });\n \n /**\n * Handle incoming emails to send private messages\n */\n elgg_register_plugin_hook_handler('email:integration:create', 'messages',\n function ($hook_name, $entity_type, $return_value, $parameters) {\n \n set_input('subject', $parameters['subject']);\n set_input('body', $parameters['message']);\n set_input('recipient_guid', $parameters['guid']);\n\n // Set action\n set_input('action', 'messages/send');\n\n // Perform the action\n action(\"messages/send\");\n });\n }",
"public function onUpdateCustomer($event)\n\t{\n\n\t\t$this->init();\n\n\t\t$objCustomer = $event->objCustomer;\n\n\n\t\t$intListId = $this->getListId($this->objModule->getConfig('list'));\n\n\t\tif (!is_null($intListId))\n\t\t{\n\t\t\t$merge_vars = array(\n\t\t\t\t'FNAME'=>$objCustomer->first_name,\n\t\t\t\t'LNAME'=>$objCustomer->last_name\n\t\t\t);\n\t\t\tif($objCustomer->newsletter_subscribe)\n\t\t\t{\n\n\t\t\t\t//Verify this person is really on the mailing list\n\t\t\t\t$arrReturn = $this->api->listMemberInfo($intListId, $objCustomer->email);\n\n\t\t\t\tYii::log(\"listMemberInfo returned \".print_r($arrReturn,true), 'info', 'application.'.__CLASS__.\".\".__FUNCTION__);\n\t\t\t\tif ($arrReturn['success'])\n\t\t\t\t\t$retval = $this->api->listUpdateMember($intListId, $objCustomer->email,$merge_vars);\n\t\t\t\telse\n\t\t\t\t\treturn $this->onAddCustomer($event); //just send this to the Add routine\n\n\t\t\t\tYii::log(\"listUpdateMember returned \".print_r($retval,true), 'info', 'application.'.__CLASS__.\".\".__FUNCTION__);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->api->listUnsubscribe($intListId, $objCustomer->email); //goodbye\n\t\t\t\tYii::log(\"listUnsubscribe sent for \".$objCustomer->email, 'info', 'application.'.__CLASS__.\".\".__FUNCTION__);\n\t\t\t}\n\n\t\t\tif ($this->api->errorCode)\n\t\t\t{\n\t\t\t\tYii::log(\"Unable to load listUpdateMember() Code=\".$this->api->errorCode.\" Msg=\".$this->api->errorMessage, 'error', 'application.'.__CLASS__.\".\".__FUNCTION__);\n\t\t\t\treturn false;\n\t\t\t} else\n\t\t\t\treturn true;\n\n\t\t} else {\n\t\t\tYii::log(\"Mailchimp - can't find list \".$this->objModule->getConfig('list'), 'error', 'application.'.__CLASS__.\".\".__FUNCTION__);\n\t\t\treturn false;\n\t\t}\n\n\n\n\t\treturn true;\n\n\n\t}",
"public function subscribe($events)\n\t{\n\t\t$events->listen(\n\t\t\t\\App\\Events\\Frontend\\Scrum\\BacklogMeeting\\BacklogMeetingCreated::class,\n\t\t\t'App\\Listeners\\Frontend\\Scrum\\BacklogMeeting\\BacklogMeetingEventListener@onCreated'\n\t\t);\n\n\t\t$events->listen(\n\t\t\t\\App\\Events\\Frontend\\Scrum\\BacklogMeeting\\BacklogMeetingUpdated::class,\n\t\t\t'App\\Listeners\\Frontend\\Scrum\\BacklogMeeting\\BacklogMeetingEventListener@onUpdated'\n\t\t);\n\n\t\t$events->listen(\n\t\t\t\\App\\Events\\Frontend\\Scrum\\BacklogMeeting\\BacklogMeetingDeleted::class,\n\t\t\t'App\\Listeners\\Frontend\\Scrum\\BacklogMeeting\\BacklogMeetingEventListener@onDeleted'\n\t\t);\n\n\t\t$events->listen(\n\t\t\t\\App\\Events\\Frontend\\Scrum\\BacklogMeeting\\BacklogMeetingRestored::class,\n\t\t\t'App\\Listeners\\Frontend\\Scrum\\BacklogMeeting\\BacklogMeetingEventListener@onRestored'\n\t\t);\n\t}",
"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 api_email_updates() {\n\t$rv = array(\"status\" => true);\n\t\n\t$query = \"SELECT `created_date` FROM `events` WHERE `type`='email' ORDER BY `created_date` DESC LIMIT 1\";\n\t$result = db_query($query);\n\t\n\tif (db_num_rows($result) > 0) {\n\t\t$row = db_fetch_assoc($result);\n\t\t\n\t\t$query = \"SELECT * FROM `events` WHERE `created_date` > '\".db_escape($row[\"created_date\"]).\"'\";\n\t}\n\telse {\n\t\t$query = \"SELECT * FROM `events`\";\n\t}\n\t\n\t$query .= \" GROUP BY `type`, `key` ORDER BY `created_date` ASC\";\n\t$result = db_query($query);\n\t\n\tif (db_num_rows($result) > 0) {\n\t\t$e = new Event();\n\t\t$e->type = \"email\";\n\t\t$e->user_id = sess_id();\n\t\t$e->save();\n\t\n\t\t$emails = array();\n\t\n\t\twhile ($row = db_fetch_assoc($result)) {\n\t\t\t$meta = json_decode($row[\"meta\"]);\n\t\t\t\n\t\t\tswitch ($row[\"type\"]) {\n\t\t\t\tcase \"extension:insert\":\n\t\t\t\t\t// Alert anyone who asked for notifications on all new extensions\n\t\t\t\t\t// except for the user who uploaded it.\n\t\t\t\t\t$user_query = \"SELECT * FROM `users` WHERE `email_preferences` & \".db_escape(User::$EMAIL_FLAG_EXTENSION_INSERT).\" AND `id` <> '\".db_escape($row[\"user_id\"]).\"'\";\n\t\t\t\t\t$user_result = db_query($user_query);\n\t\t\t\t\t\n\t\t\t\t\twhile ($user_row = db_fetch_assoc($user_result)) {\n\t\t\t\t\t\t$emails[$user_row[\"id\"]][$row[\"type\"]][] = $meta;\n\t\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t\tcase \"extension:update\":\n\t\t\t\t\t// Alert anyone who asked for notifications on extension updates\n\t\t\t\t\t// when they've contributed to a locale.\n\t\t\t\t\t$user_query = \"SELECT \n\t\t\t\t\t\t\t`u`.*\n\t\t\t\t\t\tFROM `users` `u`\n\t\t\t\t\t\t\tLEFT JOIN `message_history` `mh` ON `u`.`id`=`mh`.`user_id`\n\t\t\t\t\t\t\tLEFT JOIN `message_index` `mi` ON `mh`.`message_index_id`=`mi`.`id`\n\t\t\t\t\t\tWHERE `mi`.`extension_id`='\".db_escape($meta->extension_id).\"'\n\t\t\t\t\t\t\tAND `u`.`id` <> '\".db_escape($row[\"user_id\"]).\"'\n\t\t\t\t\t\t\tAND `email_preferences` & \".db_escape(User::$EMAIL_FLAG_EXTENSION_UPDATE).\"\n\t\t\t\t\t\tGROUP BY `u`.`id`\";\n\t\t\t\t\t$user_result = db_query($user_query);\n\t\t\t\t\n\t\t\t\t\twhile ($user_row = db_fetch_assoc($user_result)) {\n\t\t\t\t\t\t$emails[$user_row[\"id\"]][$row[\"type\"]][] = $meta;\n\t\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t\tcase \"locale:complete\":\n\t\t\t\t\t// Alert anyone who asked for notifications when a locale is completed on their extension.\n\t\t\t\t\t$extension = new Extension($meta->extension_id);\n\t\t\t\t\t$user = new User($extension->user_id);\n\t\t\t\t\t\n\t\t\t\t\tif ($user->email_preferences & User::$EMAIL_FLAG_LOCALE_COMPLETE) {\n\t\t\t\t\t\t$emails[$user->id][$row[\"type\"]][] = $meta;\n\t\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t\tcase \"message:update\":\n\t\t\t\t\t// Alert anyone who asked for notifications when their translations are changed.\n\t\t\t\t\t$user = new User($meta->previous_user_id);\n\t\t\t\t\t\n\t\t\t\t\tif ($user->email_preferences & User::$EMAIL_FLAG_MESSAGE_CHANGE) {\n\t\t\t\t\t\t$mindex = new MessageIndex($meta->message_index_id);\n\t\t\t\t\t\t$meta->extension_id = $mindex->extension_id;\n\t\t\t\t\t\t$meta->name = $mindex->name;\n\t\t\t\t\t\t\n\t\t\t\t\t\t$emails[$user->id][$row[\"type\"]][] = $meta;\n\t\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\t$email_objects = array();\n\t\t\n\t\t$default_locale_code = get_locale();\n\t\t\n\t\tforeach ($emails as $user_id => $events) {\n\t\t\t// Emails default to English, even if the API call is made to a localized subdomain.\n\t\t\tset_locale(\"en_US\");\n\t\t\t\n\t\t\t$user = new User($user_id);\n\t\t\t\n\t\t\tif ($user->preferred_locale) {\n\t\t\t\tset_locale($user->preferred_locale);\n\t\t\t}\n\t\t\t\n\t\t\t$email_object = array();\n\t\t\t$email_object[\"to\"] = $user->email;\n\t\t\t$email_object[\"subject\"] = __(\"email_notification_subject\");\n\t\t\t\n\t\t\tob_start();\n\t\t\tinclude INCLUDE_PATH . \"/templates/email/notification.php\";\n\t\t\t$html = ob_get_clean();\n\t\t\tob_end_clean();\n\t\t\t\n\t\t\t$email_object[\"body\"] = $html;\n\t\t\n\t\t\t$email_objects[] = $email_object;\n\t\t}\n\t\t\n\t\tset_locale($default_locale_code);\n\t\t\n\t\tforeach ($email_objects as $email) {\n\t\t\temail($email[\"to\"], $email[\"subject\"], $email[\"body\"]);\n\t\t}\n\t}\n\t\n\treturn $rv;\n}",
"public static function events();",
"public function addContacts() \n {\n if ($this->token=='') { //generate an auth callback, so this function will be called later when CTCT calls us back on redirectURL()\n $this->authorisationRequest();\n } \n else {\n $url='https://api.constantcontact.com/ws/customers/';\n $url.=$this->username.'/';\n $url.='contacts?access_token='.$token;\n \n $request='<entry xmlns=\"http://www.w3.org/2005/Atom\">\n <title type=\"text\"> </title>\n <updated>2008-07-23T14:21:06.407Z</updated>\n <author></author>\n <id>data:,none</id>\n <summary type=\"text\">Contact</summary>\n <content type=\"application/vnd.ctct+xml\">';\n \n $db = Doctrine_Manager::getInstance()->getCurrentConnection(); \n \n $query = $db->prepare('SELECT email FROM ctct_email_cache WHERE email NOT LIKE :token;');\n $r=$query->fetchAssoc(array('token' => 'token:%'));\n foreach ($r as $row) {\n $e=$row['email'];\n $e=str_replace('<','',$e);\n $e=str_replace('>','',$e);\n $request.=' <Contact xmlns=\"http://ws.constantcontact.com/ns/1.0/\">\n <EmailAddress>'.$e.'</EmailAddress>\n <OptInSource>ACTION_BY_CONTACT</OptInSource>\n <ContactLists>\n <ContactList id=\"http://api.constantcontact.com/ws/customers/'.$this->username.'/lists/'.$this->list_id.'\" />\n </ContactLists>\n </Contact>';\n $del.=\"'\".mysql_real_escape_string($e).\"',\";\n }\n if (strlen($del)>0) {\n $del=substr($del,0,-1); //remove trailing comma\n //delete old ones\n $db = Doctrine_Manager::getInstance()->getCurrentConnection(); \n $query = $db->prepare('DELETE FROM ctct_email_cache WHERE email IN (:del);');\n $query->execute(array('del' => $del));\n }\n $request.=' </content>\n</entry>';\n $response = makeRequest($url,$request);\n }\n }",
"public function edit(array $data)\n {\n // Convert datetime objects to strings\n $dateFields = ['start_date', 'end_date', 'cfp_start_date', 'cfp_end_date'];\n foreach ($dateFields as $dateField) {\n if (isset($data[$dateField]) && $data[$dateField] instanceof DateTime) {\n $data[$dateField] = $data[$dateField]->format('c');\n }\n if (isset($data[$dateField])) {\n if (!strtotime($data[$dateField])) {\n unset($data[$dateField]);\n }\n }\n }\n\n\n [$status, $result, $headers] = $this->apiPut($data['uri'], $data);\n // if successful, return event entity represented by the URL in the Location header\n if ($status == 204) {\n $response = $this->getCollection($headers['location']);\n return current($response['events']);\n }\n\n throw new Exception('Your event submission was not accepted, the server reports: ' . $result);\n }",
"public function manage_resources($event) {\n global $DB;\n switch($event->eventname) {\n case '\\core\\event\\course_category_updated':\n $this->course_category_updated($event);\n break;\n case '\\core\\event\\course_updated':\n $this->course_updated($event);\n break;\n case '\\core\\event\\course_content_deleted':\n $this->course_content_deleted($event);\n break;\n case '\\core\\event\\course_restored':\n $this->course_restored($event);\n break;\n case '\\core\\event\\course_section_updated':\n $this->course_section_updated($event);\n break;\n case '\\core\\event\\course_module_created':\n $this->course_module_created($event);\n break;\n case '\\core\\event\\course_module_updated':\n $this->course_module_updated($event);\n break;\n case '\\core\\event\\course_module_deleted':\n $this->course_module_deleted($event);\n break;\n case '\\tool_recyclebin\\event\\course_bin_item_restored':\n $this->course_bin_item_restored($event);\n break;\n case '\\core\\event\\role_assigned':\n $this->role_assigned($event);\n break;\n case '\\core\\event\\role_unassigned':\n $this->role_unassigned($event);\n break;\n case '\\core\\event\\role_capabilities_updated':\n $this->role_capabilities_updated($event);\n break;\n case '\\core\\event\\group_member_added':\n case '\\core\\event\\group_member_removed':\n $this->group_member_added($event);\n break;\n case '\\core\\event\\grouping_group_assigned':\n case '\\core\\event\\grouping_group_unassigned':\n $this->grouping_group_assigned($event);\n break;\n case '\\core\\event\\user_enrolment_created':\n $this->user_enrolment_created($event);\n break;\n case '\\core\\event\\user_enrolment_updated':\n $this->user_enrolment_updated($event);\n break;\n case '\\core\\event\\user_enrolment_deleted':\n $this->user_enrolment_deleted($event);\n break;\n case '\\core\\event\\user_deleted':\n $this->user_deleted($event);\n break;\n case '\\repository_googledrive\\event\\repository_gdrive_tokens_created':\n break;\n case '\\repository_googledrive\\event\\repository_gdrive_tokens_deleted':\n break;\n default:\n return false;\n }\n return true;\n }",
"public function __invoke(Request $request)\n {\n $event = $request->get('type');\n $fired_at = $request->get('fired_at'); // UTC timestamp string eg: \"2009-03-26 21:35:57\",\n $data = $request->get('data');\n\n switch ($event) {\n case 'subscribe':\n //$data['id'] = \"8a25ff1d98\",\n //$data['list_id'] = \"a6b5da1054\",\n //$data['email'] = \"[email protected]\",\n //$data['email_type'] = \"html\",\n //$data['merges']['EMAIL]\": \"[email protected]\",\n //$data['merges']['FNAME]\": \"Mailchimp\",\n //$data['merges']['LNAME]\": \"API\",\n //$data['merges']['INTERESTS]\": \"Group1,Group2\",\n //$data['ip_opt'] = \"10.20.10.30\",\n //$data['ip_signup'] = \"10.20.10.30\"\n break;\n\n case 'unsub':\n case 'delete':\n //An unsubscribe event's action is either unsub or delete. The reason will be manual unless caused by a spam complaint, then it will be abuse.\n //$data['reason'] = \"manual\", // \"abuse\"\n //$data['id'] = \"8a25ff1d98\",\n //$data['list_id'] = \"a6b5da1054\",\n //$data['email'] = \"[email protected]\",\n //$data['email_type'] = \"html\",\n //$data['merges']['EMAIL]\": \"[email protected]\",\n //$data['merges']['FNAME]\": \"Mailchimp\",\n //$data['merges']['LNAME]\": \"API\",\n //$data['merges']['INTERESTS]\": \"Group1,Group2\",\n //$data['ip_opt'] = \"10.20.10.30\",\n //$data['campaign_id'] = \"cb398d21d2\",\n break;\n\n\n case 'profile':\n //Note that you will always receive a profile update at the same time as an email update.\n //$data['id'] = \"8a25ff1d98\",\n //$data['list_id'] = \"a6b5da1054\",\n //$data['email'] = \"[email protected]\",\n //$data['email_type'] = \"html\",\n //$data['merges']['EMAIL]\": \"[email protected]\",\n //$data['merges']['FNAME]\": \"Mailchimp\",\n //$data['merges']['LNAME]\": \"API\",\n //$data['merges']['INTERESTS]\": \"Group1,Group2\",\n //$data['ip_opt'] = \"10.20.10.30\"\n break;\n\n case 'upemail':\n //Note that you will always receive a profile update at the same time as an email update.\n //$data['list_id'] = \"a6b5da1054\",\n //$data['new_id'] = \"51da8c3259\",\n //$data['new_email'] = \"[email protected]\",\n //$data['old_email'] = \"[email protected]\"\n break;\n\n case 'cleaned':\n //For cleaned emails, the reason will be hard (for hard bounces) or abuse.\n //$data['list_id'] = \"a6b5da1054\",\n //$data['campaign_id'] = \"4fjk2ma9xd\",\n //$data['reason'] = \"hard\", // \"abuse\"\n //$data['email'] = \"[email protected]\"\n break;\n\n case 'campaign':\n // Campaign-Sent Emails\n //$data['id'] = \"5aa2102003\",\n //$data['subject'] = \"Test Campaign Subject\",\n //$data['status'] = \"sent\",\n //$data['reason'] = \"\",\n //$data['list_id'] = \"a6b5da1054\"\n break;\n }\n\n\n // Send a response, to acknowledge receipt, so it doesn't keep re-sending.\n return response('Success', 200);\n }",
"public function subscribe($events)\n {\n $events->listen('mailActivateAccount', 'App\\Listeners\\MailEventHandler@mailActivateAccount');\n $events->listen('mailActivatedAccount', 'App\\Listeners\\MailEventHandler@mailActivatedAccount');\n $events->listen('mailPasswordReminder', 'App\\Listeners\\MailEventHandler@mailPasswordReminder');\n }",
"function hookAjaxGetEvents() {\n\n\t \t$start = intval($_POST['start']);\n\t \t$end = intval($_POST['end']);\n\n\t \t$args['datefrom'] = $start;\n\t \t$args['dateto'] = $end;\n\t \t$args['datemode'] = FSE_DATE_MODE_ALL;\n\t \t$args['number'] = 0; // Do not limit!\n\n\t \tif (isset($_POST['state']))\n\t \t$args['state'] = $_POST['state'];\n\t \tif (isset($_POST['author']))\n\t \t$args['author'] = $_POST['author'];\n\t \tif (isset($_POST['categories']))\n\t \t$args['categories'] = $_POST['categories'];\n\t \tif (isset($_POST['include']))\n\t \t$args['include'] = $_POST['include'];\n\t \tif (isset($_POST['exclude']))\n\t \t$args['exclude'] = $_POST['exclude'];\n\t \t$events = $this->getEventsExternal($args);\n\n\t \t// Process array of events\n\t \t$events_out = array();\n\t \tforeach($events as $evt) {\n\t \t\tunset($e);\n\t \t\t$e['id'] = $evt->eventid;\n\t \t\t$e['post_id'] = $evt->postid;\n\t \t\t$e['post_url'] = (empty($evt->postid) ? '' : get_permalink($evt->postid));\n\t \t\t$e['title'] = $evt->subject;\n\t \t\t$e['allDay'] = ($evt->allday == true ? true : false);\n\t \t\t$e['start'] = mysql2date('c', $evt->from);\n\t \t\t$e['end'] = mysql2date('c', $evt->to);\n\t \t\t$e['editable'] = false;\n\n\t \t\t$classes = array();\n\t \t\tforeach($evt->categories as $c) {\n\t \t\t\t$classes[] = 'category-'.$c;\n\t \t\t}\n\t \t\tif (count($classes) > 0) {\n\t \t\t\t$e['className'] = $classes;\n\t \t\t}\n\t \t\t\n\t \t\t$events_out[] = $e;\n\t \t}\n\n\t \t$response = json_encode($events_out);\n\n\t \theader(\"Content-Type: application/json\");\n\t \techo $response;\n\n\t \texit;\n\t }",
"public function accept_all()\n {\n $ids = $_POST['ids'];\n foreach ($ids as $id) {\n $accepted = EventMobile::find($id);\n $accepted->update(['event_status_id' => 2]);\n $accepted->save();\n //Notify Each event owner\n $event_owner = $accepted->user;\n if ($event_owner) {\n $notification_message['en'] = 'YOUR EVENT IS APPROVED';\n $notification_message['ar'] = 'تم الموافقة على الحدث';\n $notification = $this->NotifcationService->save_notification($notification_message, 3, 4, $accepted->id, $event_owner->id);\n $this->NotifcationService->PushToSingleUser($event_owner, $notification);\n }\n //get users have this event in their interests\n $this->NotifcationService->EventInterestsPush($accepted);\n }\n\n }",
"function icalendar_get_events( $url = '', $count = 5 ) {\n\t// Find your calendar's address http://support.google.com/calendar/bin/answer.py?hl=en&answer=37103\n\t$ical = new iCalendarReader();\n\treturn $ical->get_events( $url, $count );\n}",
"public function subscribe($events)\n {\n $events->listen(\n 'App\\Events\\Poll\\Created',\n 'App\\Listeners\\PollEventSubscriber@onCreated'\n );\n $events->listen(\n 'App\\Events\\Poll\\Deleted',\n 'App\\Listeners\\PollEventSubscriber@onDeleted'\n );\n $events->listen(\n 'App\\Events\\Poll\\Results',\n 'App\\Listeners\\PollEventSubscriber@onResults'\n );\n }",
"public function update(Request $request, Events $events)\n {\n $input = $request->all();\n\n $events->title = $input['title'];\n $events->description = $input['description'];\n $events->status = $input['status'];\n $events->startdate = $input['startdate'];\n $events->enddate = $input['enddate'];\n $events->price = $input['price'];\n $events->images = $input['images'];\n $events->save();\n\n return $this->sendResponse(new Events($events[]), 'Event updated');\n }",
"public function subscribe($events)\n {\n $events->listen('customer.after.login', 'Webkul\\Customer\\Http\\Listeners\\CustomerEventsHandler@onCustomerLogin');\n }",
"function updateEvent() {\n $url = './updateEvent.php';\n $data = array( 'session_id' => $_SESSION[ 'code' ], 'title' => $_POST[ 'title' ], 'id' => $_POST[ 'id' ], 'due' => $_POST[ 'due' ], 'class' => $_POST[ 'class' ] );\n\n $options = array(\n 'http' => array(\n 'method' => 'POST',\n 'content' => http_build_query($data)\n )\n );\n\n $context = stream_context_create($options);\n $result = json_decode(file_get_contents($url, false, $context), true);\n\n if ( $result[ \"error\" ] )\n return(\"ERROR: \" . $result[ \"message\" ]);\n else {\n return(true);\n }\n}",
"public function subscribe($events)\n {\n $events->listen(\n 'App\\Events\\Subscriber\\Created',\n 'App\\Listeners\\SubscriberSubscriber@sendVerification'\n );\n }",
"public function subscribe($events) {\n $events->listen(\n 'App\\Events\\LockUserAccount',\n 'App\\Listeners\\AdminActionsSubscriber@onAccountLocked'\n );\n\n $events->listen(\n 'App\\Events\\AutoClearOldEvents',\n 'App\\Listeners\\AdminActionsSubscriber@onAutoClearOldEvents'\n );\n\n $events->listen(\n 'App\\Events\\AdminUpdateUserDetail',\n 'App\\Listeners\\AdminActionsSubscriber@onAdminUpdateUserDetail'\n );\n\n $events->listen(\n 'App\\Events\\AdminUpdateUserPassword',\n 'App\\Listeners\\AdminActionsSubscriber@onAdminUpdateUserPassword'\n );\n\n $events->listen(\n 'App\\Events\\AdminUpdateJobTitle',\n 'App\\Listeners\\AdminActionsSubscriber@onAdminUpdateJobTitle'\n );\n\n $events->listen(\n 'App\\Events\\InstitutionEvent',\n 'App\\Listeners\\AdminActionsSubscriber@onInstitutionUpdated'\n );\n }",
"private function import_events() {\n\t\t$reviewed_events = json_decode(stripslashes($_POST['reviewed_events']), true);\n\t\tif(empty($reviewed_events)) {\n\t\t\treturn new WP_Error('no_events', __('No events found','event-list'));\n\t\t}\n\t\t// prepare additional categories\n\t\tif($this->events_post_type->event_cat_taxonomy === $this->events_post_type->taxonomy) {\n\t\t\t$additional_cat_ids = isset($_POST['tax_input'][$this->events_post_type->taxonomy]) ? $_POST['tax_input'][$this->events_post_type->taxonomy] : array();\n\t\t}\n\t\telse {\n\t\t\t$additional_cat_ids = isset($_POST['post_'.$this->events_post_type->taxonomy]) ? $_POST['post_'.$this->events_post_type->taxonomy] : array();\n\t\t}\n\t\t$additional_cat_ids = is_array($additional_cat_ids) ? array_map('intval', $additional_cat_ids) : array();\n\t\t$additional_cat_slugs = array();\n\t\tforeach($additional_cat_ids as $cat_id) {\n\t\t\t$cat = $this->events->get_cat_by_id($cat_id);\n\t\t\tif(!empty($cat)) {\n\t\t\t\t$additional_cat_slugs[] = $cat->slug;\n\t\t\t}\n\t\t}\n\t\t// prepare events and events categories\n\t\tforeach($reviewed_events as &$event_ref) {\n\t\t\t// check event data\n\t\t\t// remove not available categories of import file\n\t\t\tforeach($event_ref['categories'] as $ckey => $cat_slug) {\n\t\t\t\tif(!$this->events->cat_exists($cat_slug)) {\n\t\t\t\t\tunset($event_ref['categories'][$ckey]);\n\t\t\t\t}\n\t\t\t}\n\t\t\t// add the additionally specified categories to the event\n\t\t\tif(!empty($additional_cat_slugs)) {\n\t\t\t\t$event_ref['categories'] = array_unique(array_merge($event_ref['categories'], $additional_cat_slugs));\n\t\t\t}\n\t\t}\n\t\t// save events\n\t\t$ret = array('success' => 0, 'errors' => array());\n\t\trequire_once(EL_PATH.'includes/event.php');\n\t\tforeach($reviewed_events as $eventdata) {\n\t\t\t$ed = $this->prepare_event($eventdata);\n\t\t\tif(is_wp_error($ed)) {\n\t\t\t\t$ret['errors'][] = $ed;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t//TODO: return WP_Error instead of false in EL_Event when safing fails\n\t\t\t$event = EL_Event::save($eventdata);\n\t\t\tif(!$event) {\n\t\t\t\t$ret['errors'][] = new WP_Error('failed_saving', __('Saving of event failed!','event-list'), $event['csv_line']);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$ret['success'] += 1;\n\t\t}\n\t\treturn $ret;\n\t}",
"public static function update($event, $type, $object) {\n\t\t\n\t\tif ($object instanceof \\ElggEntity) {\n\t\t\tself::updateEntity($object);\n\t\t}\n\t\t\n\t\tself::checkComments($object);\n\t\tself::updateEntityForAnnotation($object);\n\t}",
"public function postEventedit();",
"public function index()\n {\n /*\n if (isset($_SESSION['access_token']) && $_SESSION['access_token']) {\n $this->client->setAccessToken($_SESSION['access_token']);\n $service = new Google_Service_Calendar($this->client);\n\n $calendarId = 'primary';\n\n\n $results = $service->events->listEvents($calendarId);\n return $results->getItems();\n\n } else {\n return redirect()->route('oauthCallback');\n }\n */\n\n if (Session::has('access_token')) {\n $this->client->setAccessToken(Session::get('access_token'));\n $service = new Google_Service_Calendar($this->client);\n\n $calendarId = 'primary';\n\n\n $results = $service->events->listEvents($calendarId);\n\n foreach ($results as $key => $value) {\n\n //$res = Meeting::where('title', $meetings[0]['title'][2])->where('name', $meetings[0]['name'][2])->where('start_time', $meetings[0]['start_time'][2])->where('end_time', $meetings[0]['end_time'][2])->first();\n\n \n $m = new Meeting;\n //$m->title = $results->getItems()[0]->description;\n $m->description = $results->getItems()[0]->description;\n $m->name = $results->getItems()[0]->organizer->displayName;\n $m->start_time = trim(preg_replace('/[a-zA-Z]/',' ',$results->getItems()[0]->start->dateTime));\n $m->end_time = trim(preg_replace('/[a-zA-Z]/',' ',$results->getItems()[0]->end->dateTime));\n //$m->end_time = $results->getItems()[0]->end->dateTime;\n $m->save();\n \n \n }\n\n return dd($results->getItems());\n\n //return dd($results->getItems()[0]->description);\n //return $results->getItems();\n\n } else {\n return redirect()->route('oauth2Callback');\n }\n\n }",
"public function update(Request $request, Event $event)\n {\n //\n }",
"public function update(Request $request, Event $event)\n {\n //\n }",
"public function update(Request $request, Event $event)\n {\n //\n }",
"public function update(Request $request, Event $event)\n {\n //\n }",
"public function update(Request $request, Event $event)\n {\n //\n }",
"public function update(Request $request, Event $event)\n {\n //\n }",
"public function update(Request $request, Event $event)\n {\n //\n }",
"function editEmailHandler1() {\n global $inputs;\n\n updateDb('mail', [\n 'title' => $inputs['title'],\n 'sender_id' => $inputs['sender_id'],\n 'sender' => $inputs['sender_name'],\n 'receiver_id' => $inputs['receiver_id'],\n 'receiver' => $inputs['receiver_name'],\n 'content' => $inputs['content'], \n ], [\n 'id' => $inputs['id']\n ]);\n\n formatOutput(true, 'update success');\n}",
"function event()\n {\n $this->load->library('service');\n $data = file_get_contents('php://input');\n $ret = array(\n 'out' => $this->service->handle('event', $data)\n );\n $this->output($ret);\n }",
"public function searchEvents(Message $request, ParsedQuery $parsedQuery, Message $response, array $curies = [], array $context = []): void;",
"public function testComAdobeCqSocialCommonsEmailreplyImplCommentEmailEventListener()\n {\n $client = static::createClient();\n\n $path = '/system/console/configMgr/com.adobe.cq.social.commons.emailreply.impl.CommentEmailEventListener';\n\n $crawler = $client->request('POST', $path);\n }",
"public function sendDataUpdatedMail(AccountDataChangedEvent $event)\n {\n }",
"public function update()\n {\n \n foreach($this->feed->sources as $source){\n \n //Find the right source handler.\n switch($source->type->get()){\n \n case 'TWITTER_TIMELINE':\n $handler = new TwitterTimelineSourceHandler($source);\n break;\n \n case 'TWITTER_SEARCH':\n $handler = new TwitterSearchSourceHandler($source);\n break;\n \n }\n \n //Query for new messages.\n $messages = $handler->query();\n \n //Save those messages.\n mk('Logging')->log('Message board', 'New messages', $messages->size());\n foreach($messages as $message){\n $message\n ->save()\n ->save_webpages()\n ->save_images();\n }\n \n }\n \n }",
"public function updateAllSubscriptions($events = null)\n {\n $roles = $this->dm->getRepository('WobbleCodeUserBundle:Role')->findAll();\n\n foreach ($roles as $role) {\n foreach ($events as $event) {\n $this->updateSubscription(\n $role->getUser(),\n $role->getOrganization(),\n $role,\n $event,\n false\n );\n }\n }\n }",
"public function subscribe($events)\n {\n $events->listen(\n MarkAsRead::class,\n 'App\\Listeners\\Frontend\\NotificationEventListener@markAsRead'\n );\n }",
"public function subscribe($events)\n {\n $events->listen(\n \\App\\Events\\Backend\\Project\\ProjectCreated::class,\n 'App\\Listeners\\Backend\\Project\\ProjectEventListener@onCreated'\n );\n\n $events->listen(\n \\App\\Events\\Backend\\Project\\ProjectUpdated::class,\n 'App\\Listeners\\Backend\\Project\\ProjectEventListener@onUpdated'\n );\n\n $events->listen(\n \\App\\Events\\Backend\\Project\\ProjectDeleted::class,\n 'App\\Listeners\\Backend\\Project\\ProjectEventListener@onDeleted'\n );\n\n $events->listen(\n \\App\\Events\\Backend\\Project\\ProjectApproved::class,\n 'App\\Listeners\\Backend\\Project\\ProjectEventListener@onApproved'\n );\n\n $events->listen(\n \\App\\Events\\Backend\\Project\\ProjectUnapproved::class,\n 'App\\Listeners\\Backend\\Project\\ProjectEventListener@onUnapproved'\n );\n }",
"public static function updateEvent(\\Elgg\\Event $event) {\n\t\t$entity = $event->getObject();\n\t\tif (!$entity instanceof \\Event) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t$org_attributes = $entity->getOriginalAttributes();\n\t\tif (elgg_extract('access_id', $org_attributes) === null) {\n\t\t\t// access wasn't updated\n\t\t\treturn;\n\t\t}\n\t\t\n\t\telgg_call(ELGG_IGNORE_ACCESS, function() use ($entity) {\n\t\t\t$days = $entity->getEventDays();\n\t\t\tif (!empty($days)) {\n\t\t\t\tforeach ($days as $day) {\n\t\t\t\t\t$day->access_id = $entity->access_id;\n\t\t\t\t\t$day->save();\n\t\t\t\t\n\t\t\t\t\t$slots = $day->getEventSlots();\n\t\t\t\t\tif (empty($slots)) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\tforeach ($slots as $slot) {\n\t\t\t\t\t\t$slot->access_id = $entity->access_id;\n\t\t\t\t\t\t$slot->save();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$questions = $entity->getRegistrationFormQuestions();\n\t\t\tif (!empty($questions)) {\n\t\t\t\tforeach ($questions as $question) {\n\t\t\t\t\t$question->access_id = $entity->access_id;\n\t\t\t\t\t$question->save();\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}",
"public function handle()\n {\n try {\n $service = new Google_Service_Calendar($this->client);\n $calendarId = '[email protected]';\n $minDate = date('Y-m-d', strtotime('-14400 days')) . \"T00:00:00-04:00\";\n $maxDate = date('Y-m-d', strtotime('+720 days')) . \"T00:00:00-04:00\";\n $optParams = array(\n //'maxResults' => 50,\n 'orderBy' => 'startTime',\n 'singleEvents' => TRUE,\n 'timeMin' => $minDate,\n 'timeMax' => $maxDate\n );\n $results = $service->events->listEvents($calendarId, $optParams);\n $calendars = $results->getItems();\n $temp_data = JsonData::with('owner')->pluck('created')->toArray();\n $updated = false;\n $inserts = [];\n foreach ($calendars as $calendar) {\n if (in_array($summary = $calendar['created'], $temp_data)) {\n $data_temp = JsonData::with('owner')->where('created', $summary)->first();\n if (is_null($data_temp)) {\n continue;\n }\n $insert = [\n 'user_id' => 1,\n 'data_json' => json_encode($calendar),\n 'iCalUID' => $calendar->iCalUID,\n 'location' => $calendar->location,\n 'status' => $calendar->status,\n 'summary' => $calendar->summary,\n 'updated' => $calendar->updated,\n 'creator' => json_encode($calendar->creator),\n 'organizer' => json_encode($calendar->organizer),\n 'start' => $calendar->start['dateTime'] !== null ? $calendar->start['dateTime'] : $calendar->start['date'] . 'T10:00:00+07:00',\n 'end' => $calendar->end['dateTime'] !== null ? $calendar->end['dateTime'] : $calendar->end['date'] . 'T20:00:00+07:00',\n 'created' => $calendar['created'],\n 'updated_at' => Carbon::now(),\n 'htmlLink' => json_encode($calendar->htmlLink),\n ];\n $data_temp->update($insert);\n continue;\n }\n $inserts[] = [\n 'user_id' => 1,\n 'data_json' => json_encode($calendar),\n 'iCalUID' => $calendar->iCalUID,\n 'location' => $calendar->location,\n 'status' => $calendar->status,\n 'summary' => $calendar->summary,\n 'updated' => $calendar->updated,\n 'creator' => json_encode($calendar->creator),\n 'organizer' => json_encode($calendar->organizer),\n 'start' => $calendar->start['dateTime'] !== null ? $calendar->start['dateTime'] : $calendar->start['date'] . 'T10:00:00+07:00',\n 'end' => $calendar->end['dateTime'] !== null ? $calendar->end['dateTime'] : $calendar->end['date'] . 'T20:00:00+07:00',\n 'created' => $calendar['created'],\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n 'htmlLink' => json_encode($calendar->htmlLink),\n ];\n $temp_data[] = $calendar['created'];\n }\n if (!empty($inserts)) {\n $insert_success = JsonData::with('owner')->insert($inserts);\n if (!$insert_success) {\n $this->info('Unable to process your request right now, Please contact to System admin @070375783');\n }\n $this->info('Data inserted/updated successfully.');\n }\n if ($updated) {\n $this->info('Google:Sync Command Run added successfully!');\n } else {\n $this->info('Google:Sync Command Run added/updated with exist!');\n }\n } catch (Google_Service_Exception $exception) {\n $this->info('Google:Sync Command Run unsuccessfully!');\n }\n $this->info('Google:Sync Command Run successfully in last step!');\n }",
"public function onEvent();",
"function callSample(): void\n{\n $contactEmail = '[EMAIL]';\n $contactNotificationCategorySubscriptionsElement = NotificationCategory::NOTIFICATION_CATEGORY_UNSPECIFIED;\n $contactLanguageTag = '[LANGUAGE_TAG]';\n\n update_contact_sample(\n $contactEmail,\n $contactNotificationCategorySubscriptionsElement,\n $contactLanguageTag\n );\n}"
] | [
"0.6081197",
"0.5670327",
"0.54933995",
"0.54729474",
"0.53366226",
"0.52564657",
"0.5168019",
"0.5082659",
"0.5068172",
"0.5060201",
"0.5052866",
"0.50492585",
"0.5019765",
"0.4999465",
"0.49768046",
"0.49679708",
"0.49531004",
"0.49329138",
"0.49324137",
"0.49183854",
"0.49174258",
"0.49143633",
"0.49018955",
"0.49004355",
"0.48977718",
"0.4869892",
"0.48684752",
"0.4853445",
"0.48379162",
"0.4824294",
"0.48079273",
"0.47959432",
"0.47940755",
"0.47926596",
"0.47913775",
"0.4787628",
"0.47853655",
"0.47716597",
"0.476999",
"0.47616452",
"0.47462693",
"0.4745503",
"0.47407666",
"0.4729143",
"0.47232467",
"0.47213012",
"0.47207308",
"0.47207308",
"0.47207308",
"0.4709663",
"0.47090796",
"0.47062886",
"0.47031525",
"0.4701019",
"0.4696772",
"0.46914724",
"0.4682425",
"0.4675911",
"0.46685028",
"0.46663928",
"0.46618068",
"0.46554917",
"0.4653615",
"0.4651878",
"0.46451747",
"0.46428993",
"0.46411052",
"0.46404153",
"0.46325278",
"0.46309242",
"0.4625989",
"0.4619788",
"0.4618035",
"0.46125668",
"0.4612126",
"0.46115398",
"0.46053648",
"0.4587451",
"0.45856923",
"0.45844796",
"0.45825386",
"0.4580978",
"0.4580978",
"0.4580978",
"0.4580978",
"0.4580978",
"0.4580978",
"0.4580978",
"0.4571494",
"0.4567417",
"0.45643303",
"0.4556734",
"0.45561478",
"0.45559192",
"0.4550541",
"0.4548952",
"0.4546454",
"0.45457375",
"0.45422104",
"0.45409954",
"0.45252854"
] | 0.0 | -1 |
Retrieve date from the input stream | public function getInputStream()
{
$source = @fopen('php://input', 'r');
if (!is_resource($source)) {
throw new InvalidArgumentException('Expected parameter 1 to be an open-able resource');
}
$data = null;
while ($buffer = fread($source, 1024)) {
$data .= $buffer;
}
fclose($source);
return $data;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function readDate()\n {\n $dateReference = $this->readInteger();\n\n $refObj = $this->getReferenceObject($dateReference);\n if($refObj !== false)\n return $refObj;\n\n //$timestamp = floor($this->_stream->readDouble() / 1000);\n $timestamp = new DateTime();\n $timestamp->setTimestamp(floor($this->_stream->readDouble() / 1000));\n\n $this->_referenceObjects[] = $timestamp;\n\n return $timestamp;\n }",
"function read_date($str){\n date_default_timezone_set(\"America/Mexico_City\");\n if($str)\n return date('d/m/Y', strtotime($str));\n else\n return null;\n }",
"function validDate($input_data) \r\n{\r\n $date = DateTime::createFromFormat($input_data, readline(\"Masukkan tanggal/bulan/tahun dengan angka! : \"));\r\n echo $date->format('l d-M-Y');\r\n}",
"private static function processInputAsDateString() {\n $unix = strtotime(self::$input);\n\n if ($unix) { \n self::$timestamp = $unix;\n self::setDateFromTimestamp(self::$timestamp);\n } else {\n self::setMessage(\"Sorry. Your input was invalid.\");\n }\n }",
"public function getReceptionDate();",
"public function getDate();",
"public function getDate();",
"public static function getDate($date) {\r\n \tif ($date === null || trim($date) == '') {\r\n \t\treturn null;\r\n \t} else if (strlen($date) < 10) {\r\n \t\tthrow new Exception('Wrong format of date ' . $date);\r\n \t} else {\r\n \t\treturn substr($date, 0, 10);\r\n \t}\r\n }",
"public function getHeaderDate()\r\n\t{\r\n\t\treturn $this->headers[SONIC_HEADER__DATE];\r\n\t}",
"function read_e($datestr, $ref=NULL) {\n $gotit = false;\n if (preg_match('/^([0-9][0-9][0-9][0-9])-([0-9]+)-([0-9]+)$/', $datestr, $m)) {\n # Canonical (ISO 8601)\n $year = $m[1];\n $month = $m[2];\n $day = $m[3];\n $gotit = true;\n } elseif (preg_match('/^([0-9]+)[-\\/]([0-9]+)[-\\/]([0-9]+)$/', $datestr, $m)) {\n # American Style\n $year = $m[3];\n $month = $m[1];\n $day = $m[2];\n if ($day > 12) {\n $gotit = true;\n }\n else {\n return array(NULL, new Error('Ambiguous, use yyyy-mm-dd OR dd.mm.yyyy'));\n }\n } elseif (preg_match('/^([0-9]+)\\.([0-9]+)\\.([0-9]+)$/', $datestr, $m)) {\n # European Style\n $year = $m[3];\n $month = $m[2];\n $day = $m[1];\n $gotit = true;\n }\n if ($gotit) {\n if ($month < 1 or $month > 12) {\n return array(NULL, new Error('Bad month number: '.$month));\n }\n if ($day < 1 or $day > 31) {\n return array(NULL, new Error('Bad day number: '.$day));\n }\n if ($year < 60) {\n $year += 2000;\n } elseif ($year < 100) {\n $year += 1900;\n }\n if (checkdate($month, $day, $year)) {\n return array(sprintf('%04d-%02d-%02d', $year, $month, $day), NULL);\n } else {\n return array(NULL, new Error('Invalid date, check your calendar'));\n }\n }\n if ($ref !== NULL) {\n list($ref, $err) = Date::read_e($ref);\n if ($err) {\n return array(NULL, $err);\n }\n } else {\n $ref = date('Y-m-d');\n }\n if ($datestr == 'today' or $datestr == 'now') {\n return array($ref, NULL);\n } elseif ($datestr == 'yesterday') {\n return array(Date::addDays($ref, -1), NULL);\n } elseif ($datestr == 'tomorrow') {\n return array(Date::addDays($ref, 1), NULL);\n } else {\n return array(NULL, new Error('Invalid date format'));\n }\n }",
"public function requestDate();",
"private function date()\n {\n $pubDate = $this->article->Journal->JournalIssue->PubDate;\n \n if (isset($pubDate->MedlineDate)) {\n $date = (string)$pubDate->MedlineDate;\n } else {\n $date = implode(' ', (array)$pubDate);\n }\n \n return $date;\n }",
"function read_date($str){\n if($str)\n return date('F j, Y, g:i:s a', strtotime($str));\n else\n return null;\n\n}",
"public function getDate(){\n return $this->getParameter('date');\n }",
"public function getDate() { return $this->date; }",
"function getDateViaGetFileContents($url){\n\t\t\t//http://php.net/manual/en/function.file-get-contents.php\n\t\t$contents = file_get_contents($url);\n\n\t\t//If $contents is not a boolean FALSE value.\n\t\tif($contents !== false){\n\t\t //Print out the contents.\n\t\t return $contents;\n\t\t}\n\n\t\treturn null;\n}",
"function readTimestamp(): int;",
"public function getDate() {\n return @$this->attributes['date'];\n }",
"public function getDate()\r\n {\r\n return $this->date;\r\n }",
"private static function getArticleDate($fileHandle)\n {\n $pos = -1; $lastLine = ''; $c = '';\n do {\n $lastLine = $c . $lastLine;\n fseek($fileHandle, $pos--, SEEK_END);\n $c = fgetc($fileHandle);\n } while ($c != PHP_EOL);\n return new \\DateTimeImmutable(trim($lastLine,\"*\"));\n }",
"public function getDate(){\n\t\treturn $this->_date;\n\t}",
"public function getDate()\n {\n return $this->date;\n }",
"public function getDate() {\n\t\treturn $this->_date;\n\t}",
"public function getDate() {\n return $this->date;\n }",
"public function getDate()\n\t{\n\t\treturn $this->date;\n\t}",
"public function getDate()\n\t{\n\t\treturn $this->date;\n\t}",
"public function getDate()\n\t{\n\t\treturn $this->date;\n\t}",
"public function getDate()\n {\n return $this->date;\n }",
"public function getDate()\n {\n return $this->date;\n }",
"public function getDate()\n {\n return $this->date;\n }",
"public function getDate()\n {\n return $this->date;\n }",
"public function getDate()\n {\n return $this->date;\n }",
"public function getDate()\n {\n return $this->date;\n }",
"public function getDate()\n {\n return $this->date;\n }",
"public function getDate()\n {\n return $this->date;\n }",
"public function getDate()\n {\n return $this->date;\n }",
"public function getDate()\n {\n return $this->date;\n }",
"public function getDate()\n {\n return $this->date;\n }",
"public function getDate()\n {\n return $this->date;\n }",
"public function getDate()\n {\n return $this->date;\n }",
"public function getDate()\n {\n return $this->date;\n }",
"public function getDate()\n {\n return $this->date;\n }",
"public function getDate()\n {\n return $this->date;\n }",
"public function getDate()\n {\n return $this->date;\n }",
"public function getDate()\n {\n return $this->date;\n }",
"public function getDate()\n {\n return $this->date;\n }",
"public function getDate()\n {\n return $this->date;\n }",
"public function getDate()\n {\n return $this->date;\n }",
"public function getDate()\n {\n return $this->date;\n }",
"public function getDate()\n {\n return $this->date;\n }",
"public function getDate()\n {\n return $this->date;\n }",
"public function getDate()\n {\n return $this->date;\n }",
"public function getDate()\n {\n return $this->date;\n }",
"public function getDate()\n {\n return $this->date;\n }",
"public function getDate()\n {\n return $this->date;\n }",
"public function getDate()\n {\n return $this->date;\n }",
"public function getDate()\n {\n return $this->date;\n }",
"public function getDate()\n {\n return $this->date;\n }",
"public function getDateIn() {\n $retVal = CommonProcess::convertDateTime($this->date_in, DomainConst::DATE_FORMAT_4, DomainConst::DATE_FORMAT_BACK_END);\n if (empty($retVal)) {\n return $this->date_in;\n }\n return $retVal;\n }",
"function getDate( )\r\n\t{\r\n\t\treturn $this->date;\r\n\t}",
"public function extract()\n {\n if (null !== $date = $this->fromJsonLd()) {\n return $date;\n }\n\n if (null !== $date = $this->fromMeta()) {\n return $date;\n }\n\n if (null !== $date = $this->fromUri()) {\n return $date;\n }\n\n return null;\n }",
"public function getDate()\n {\n return $this->_date;\n }",
"function getData()\n {\n return $this->date;\n }",
"public function getDate(): string;",
"public function getDate()\n {\n $yearconst = $this->getValue(self::XPATH_YEAR);\n $monthconst = $this->getValue(self::XPATH_MONTH);\n $dayconst = $this->getValue(self::XPATH_DAY);\n\n return $this->formateDate($yearconst, $monthconst, $dayconst);\n }",
"public function extract()\n {\n if (null !== $date = $this->fromJsonLd()) {\n return $date;\n }\n\n if (null !== $date = $this->fromMeta()) {\n return $date;\n }\n\n if (null !== $date = $this->fromOpenGraph()) {\n return $date;\n }\n\n return null;\n }",
"function getDate() {\n return $this->date;\n }",
"function read_date_time( $package_dir )\n{\n\t//debug_print( \"package dir: $package_dir\" );\n\t\n\t$package_name = strrchr( $package_dir, '/' );\n\t//debug_print( \"package name: $package_name\" );\n\n\t// get the last 15 bytes which mean YYYYMMDD_HHMMSS\n\t$date_time = substr( $package_dir, -15, 15 );\n\n\t$year = substr( $date_time, 0, 4 );\n\t$month = substr( $date_time, 4, 2 );\n\t$date = substr( $date_time, 6, 2 );\n\t$hour = substr( $date_time, 9, 2 );\n\t$minute = substr( $date_time, 11, 2 );\n\t$second = substr( $date_time, 13, 2 );\n\n\t$formated_time =\"$year.$month.$date $hour:$minute:$second\";\n\n\treturn $formated_time;\n}",
"public function date();",
"public function date();",
"function get_date() {\n\t\treturn $this->get_data( 'comment_date' );\n\t}",
"public function get()\n {\n return $this->date;\n }",
"public function getDate()\n {\n return $this->getNodeText('/p:package/p:date');\n }",
"public function getDate(): ?string\r\n {\r\n return $this->date;\r\n }",
"public function getDate(){\r\n\t\t\r\n\t\tif($this->_date==null || $this->_time==null){\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\t\r\n\t\t$maDate = $this->getYear().\"-\".$this->getMonth().\"-\".$this->getDay().\"-\".$this->getHour().\":\".$this->getMinute().\":\".$this->getSecond();\r\n\t\t$date = DateTime::createFromFormat(IPTC::DATE_FORMAT,$maDate);\r\n\r\n\t\treturn $date;\r\n\t}",
"public function date() {\n return $this->begin;\n }",
"public function getEntryDate()\n {\n return $this->entry_date;\n }",
"static private function getDate($day) {\n\t\treturn $day->getElementsByTagName('h3')->item(0)->nodeValue;\n\t}",
"function _parseDate($date) {\r\n\t\tif ( preg_match('/([A-Za-z]+)[ ]+([0-9]+)[ ]+([0-9]+):([0-9]+)/', $date, $res) ) {\r\n\t\t\t$year = date('Y');\r\n\t\t\t$month = $res[1];\r\n\t\t\t$day = $res[2];\r\n\t\t\t$hour = $res[3];\r\n\t\t\t$minute = $res[4];\r\n\t\t\t$date = \"$month $day, $year $hour:$minute\";\r\n\t\t\t$tmpDate = strtotime($date);\r\n\t\t\tif ( $tmpDate > time() ) {\r\n\t\t\t\t$year--;\r\n\t\t\t\t$date = \"$month $day, $year $hour:$minute\";\r\n\t\t\t}\r\n\t\t} elseif ( preg_match('/^\\d\\d-\\d\\d-\\d\\d/', $date) ) {\r\n\t\t\t// 09-10-04 => 09/10/04\r\n\t\t\t$date = str_replace('-', '/', $date);\r\n\t\t}\r\n\t\t$res = strtotime($date);\r\n\t\tif ( !$res ) {\r\n\t\t\tthrow new ftpException('Date conversion failed for '.$date);\r\n\t\t}\r\n\t\treturn $res;\r\n\t}",
"public function getDate() : ?string ;",
"public function getReleaseDate()\n {\n if ($this->isReady) {\n if ($strReturn = $this->matchRegex($this->_strSource, IMDB::IMDB_RELEASE_DATE, 1)) {\n return trim($strReturn);\n }\n }\n return $this->strNotFound;\n }",
"public function getDate(){\n\t\treturn $this->laDate;\n\t}",
"static public function date($name,$opts=[]) {\n $f3 = Base::instance();\n if (!isset($opts['type'])) $opts['type'] = 'date';\n return self::input($name,$opts);\n }",
"public function article_read_date($id)\n {\n $this->conn = $this->database->prepare('select * from `articles` where id = ?');\n $this->conn->execute(array($id));\n $ret = $this->conn->fetch();\n return $ret['article_date'];\n }",
"protected function getDate() {\n\t\treturn date('Y-m-d h:i:s');\n\t}",
"function getOpenDate() {\n\t\treturn $this->data_array['open_date'];\n\t}",
"public function getDate($key)\n {\n\n $value = trim($this->getParam($key));\n $unixTimeStamp = strtotime($value);\n if(!$unixTimeStamp){\n return \"\";\n }\n\n return date(\"Y-m-d\", $unixTimeStamp);\n }",
"function input( $format = null ) {\n\treturn Streams::input( $format );\n}",
"public function date($date=null)\n {\n if(is_null($date)) { \t\n\t\t\t$date = $this->publication; \n }\n\n return $date;\n //date_format($date, 'g:ia \\o\\n l jS F Y');;\n }",
"public function getDataWithTypeDate() {}",
"function extract_date_from_str($date) {\n\t\t$year = substr($date, 0, 4);\n\t\t$month = substr($date, 4, 2);\n\t\t$day = substr($date, 6, 2);\n\n\t\t$hour = substr($date, 9, 2);\n\t\t$minutes = substr($date, 11, 2);\n\t\t$seconds = substr($date, 13, 2);\n\n\t\treturn $year . \"/\" . $month . \"/\" . $day . \"_\" . $hour . \":\" . $minutes . \":\" . $seconds;\n\t}",
"public function getDate()\n {\n if (!isset($this->_date)) {\n throw new \\LogicException('Missing property _date');\n }\n return $this->_date;\n }",
"function getDailyEventData($date) {\n //Check date format\n $format = \"m/d/Y\";\n $eventDate = date_create_from_format($format, $date);\n if(!$eventDate) {\n // createFromFormat returns false if the format is invalid or date is invalid\n echo \"Please enter a valid date in mm/dd/yyyy format. Cannot proceed due to invalid date error\";\n } else {\n $data;\n $data['SelectedDate'] = $date;\n $data['surfSelect']=0;\n $data['sChange']=\"Get Date\";\n return parent::convertByPOST(self::$dailyEventUrl,$data,3);\n }\n }",
"public function getDate()\n {\n if ( $this->value != null ) {\n $date = strtotime( $this->value );\n return date( 'd m Y', $date );\n }\n return null;\n }",
"public function testReadByDate()\n {\n $today = date('Y-m-d');\n $tomorrow = date('Y-m-d', strtotime('tomorrow'));\n\n $result = $this->_leads->getDate($today, $tomorrow);\n $this->assertTrue(is_array($result));\n }",
"public function date($name)\n {\n return self::$driver->date($name);\n }",
"public static function getDate() {\r\n\t\treturn date('Y-m-d H:i:s');\r\n\t}",
"public function getDate()\n\t{\n\t\treturn $this->datetime;\n\t}",
"function ExibeData($data){\n\t\treturn date(\"d/m/Y\", strtotime($data));\n\t}",
"public function getDateFromString($date){\n\t\t$date = strtotime($date);\n\t\treturn $date;\n\t}",
"public function getDateEn() {\n return $this->date;\n }"
] | [
"0.64104337",
"0.61943",
"0.6125219",
"0.59453756",
"0.57887244",
"0.5722822",
"0.5722822",
"0.5689002",
"0.5655203",
"0.5651336",
"0.56133425",
"0.56072915",
"0.5590573",
"0.55872107",
"0.5561022",
"0.55502325",
"0.55091226",
"0.5484507",
"0.54790753",
"0.54748726",
"0.54703003",
"0.5467261",
"0.5439116",
"0.54312575",
"0.54113454",
"0.54113454",
"0.54113454",
"0.5410312",
"0.5410312",
"0.5410312",
"0.5410312",
"0.5410312",
"0.5410312",
"0.5410312",
"0.5410312",
"0.5410312",
"0.5410312",
"0.5410312",
"0.5410312",
"0.5410312",
"0.5410312",
"0.5410312",
"0.5410312",
"0.5410312",
"0.5410312",
"0.5410312",
"0.5410312",
"0.5410312",
"0.5410312",
"0.5410312",
"0.5410312",
"0.5410312",
"0.5410312",
"0.5410312",
"0.5410312",
"0.5410312",
"0.5406314",
"0.5406314",
"0.5381932",
"0.53742105",
"0.5370349",
"0.53638303",
"0.53567004",
"0.5355234",
"0.53325784",
"0.53217626",
"0.5309594",
"0.52872497",
"0.52807754",
"0.52807754",
"0.52754736",
"0.5250041",
"0.5247307",
"0.52411264",
"0.52390206",
"0.52175933",
"0.52031636",
"0.51907617",
"0.5176453",
"0.51653254",
"0.516376",
"0.5160203",
"0.5159887",
"0.5131257",
"0.513077",
"0.5125764",
"0.511481",
"0.5112566",
"0.51047796",
"0.509939",
"0.50824803",
"0.50774497",
"0.5076095",
"0.50755525",
"0.50747484",
"0.504041",
"0.50371087",
"0.50368685",
"0.5035288",
"0.5011789",
"0.5008005"
] | 0.0 | -1 |
Submit a log entry | protected function log($message, $data = null)
{
Mage::helper('lapostaconnect')->log(
array(
'message' => $message,
'data' => $data,
)
);
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function LogEntry($entry) {\n\t\tif ($this->_vars['log'] == 'echo') {\n\t\t\tflush();\n\t\t\techo $entry;\n\t\t} elseif($this->_vars['log'] == 'errors') {\n\t\t\ttrigger_error($entry);\n\t\t}\n\t\t$this->_log .= $entry;\n\t}",
"function postToLog($message) {\n\n\tglobal $log_file;\n\n\t// Get formatted timestamp.\n\t$timestamp = date(\"[m.d.y] g:ia\");\n\n\t// Prepend timestamp to message.\n\t$message = \"\\n\" . $timestamp . \": \" . $message;\n\t\n\t// Post message to log.\n\tfwrite($log_file, $message);\n\n}",
"public function testSubmissionLog() {\n global $base_path;\n $node = $this->createWebformNode('test_submission_log');\n $nid = $node->id();\n\n $sid = $this->postNodeSubmission($node);\n $submission = WebformSubmission::load($sid);\n $log = $this->getLastSubmissionLog();\n $this->assertEqual($log->lid, 1);\n $this->assertEqual($log->sid, 1);\n $this->assertEqual($log->uid, 0);\n $this->assertEqual($log->handler_id, '');\n $this->assertEqual($log->operation, 'submission created');\n $this->assertEqual($log->message, '@title created.');\n $this->assertEqual($log->variables, ['@title' => $submission->label()]);\n $this->assertEqual($log->webform_id, 'test_submission_log');\n $this->assertEqual($log->entity_type, 'node');\n $this->assertEqual($log->entity_id, $node->id());\n\n // Login.\n $this->drupalLogin($this->rootUser);\n\n // Check webform node results log table has record.\n $this->drupalGet(\"node/$nid/webform/results/log\");\n $this->assertResponse(200);\n $this->assertNoRaw('No log messages available.');\n $this->assertRaw('<a href=\"' . $base_path . 'node/' . $nid . '/webform/submission/' . $sid . '/log\">' . $sid . '</a>');\n $this->assertRaw(t('@title created.', ['@title' => $submission->label()]));\n\n // Check webform node submission log tab.\n $this->drupalGet(\"node/$nid/webform/submission/$sid/log\");\n $this->assertResponse(200);\n }",
"public function log(SihnonFramework_LogEntry $entry) {\n $fields = $entry->fields();\n $types = $entry->types();\n $values = $entry->values();\n \n $bindings = array();\n for ($i = 0, $l = count($fields); $i < $l; ++$i) {\n $type = '';\n switch ($types[$i]) {\n case 'int':\n $type = PDO::PARAM_INT;\n break;\n case 'bool':\n $type = PDO::PARAM_BOOL;\n break;\n default:\n $type = PDO::PARAM_STR;\n break;\n }\n \n $bindings[] = array(\n 'name' => $fields[$i],\n 'value' => $values[$i],\n 'type' => $type, \n );\n }\n \n $field_list = join(', ', $fields);\n $bindings_list = join(', ', array_map(function($value) { return \":{$value}\"; }, $fields));\n \n $this->database->insert(\"INSERT INTO {$this->table} ({$field_list}) VALUES({$bindings_list})\", $bindings);\n }",
"public function withLog($entry);",
"public function addLog($data);",
"public function addTicketSubmit()\n {\n\n $this->tickets = new TicketsTable();\n\n $t = time();\n\n\n if ($this->post(\"addTicketSubmit\"))\n {\n\n $this->tickets = new TicketsTable();\n\n $userid = $this->post(\"userid\");\n $ticket = $this->post(\"ticket\");\n\n $this->tickets->insert\n (\n array\n (\n \"user_id\" => $userid,\n \"ticket\" => $ticket,\n \"solved\" => 0,\n \"date\" => $t\n )\n );\n $this->page(\"add_ticket_succes\");\n exit();\n }\n $this->page(\"add_ticket\");\n }",
"function publishLog() {\n\t\t$id = $this->current_log;\t\t\n\t\t$res = $this->query(\"SELECT event_id FROM $this->table_log WHERE id=$id\");\n\t\t$row = $res->fetch_assoc();\n\t\t$cal_id = explode(\",\",$row['event_id']);\n\t\t$calEvent = $this->calendar_instance->getEventDetails($row['event_id']);\n\t\t$topic = $calEvent['caption'];\n\t\t$year = $calEvent['year'];\n\t\t$slug = $calEvent['slug'];\n\t\t$url = $this->generateCoolURL(\"/$year/$slug\");\n\t\t$this->addToActivityLog(\"publiserte logg fra <a href=\\\"$url\\\">$topic</a>.\",false,\"major\");\n\t}",
"function logMe($comment, $status_id = 0, $data = array(), $update_process = 0) {\n\n if (!class_exists('systemToolkit')) {\n return; // not loaded (cache fix)\n }\n $toolkit = systemToolkit::getInstance();\n $centerLogMapper = $toolkit->getMapper('log', 'log');\n\n if(count($data)) {\n ob_start();\n $i = 1;\n foreach($data as $d) {\n var_dump($d);\n if($i < count($data)) {\n echo \"<br />===<br />\";\n }\n $i++;\n }\n $err_content = ob_get_contents();\n ob_end_clean();\n $comment .= \"<br />{$err_content}\";\n }\n\n $log = $centerLogMapper->create();\n $log->setTime(new SQLFunction('UNIX_TIMESTAMP'));\n $log->setModule($toolkit->getRequest()->getModule());\n $log->setAction($toolkit->getRequest()->getAction());\n $log->setComment($comment);\n $log->setStatus($status_id);\n if ($user = systemToolkit::getInstance()->getUser()) {\n $log->setUser($user);\n }\n if ($update_process) {\n $log->setProcessId($update_process);\n }\n $centerLogMapper->save($log);\n}",
"private function _log()\n {\n try {\n // Connect\n $dbh = $this->_connectToDb();\n \n // Insert\n $stmt = $dbh->prepare(\"INSERT INTO log_table(`nick`, `said`, `when`, `channel`) VALUES (:nick, :message, NOW(), :channel)\");\n\n $stmt->bindParam(':nick', $this->_data->nick, PDO::PARAM_STR);\n $stmt->bindParam(':message', $this->_data->message, PDO::PARAM_STR);\n $stmt->bindParam(':channel', $this->_data->channel, PDO::PARAM_STR);\n \n if (!$stmt->execute())\n {\n $arr = $stmt->errorInfo();\n print_r($arr);\n }\n\n $dbh = null;\n \t\n }\n catch(PDOException $e)\n {\n echo $e->getMessage();\n }\n }",
"function add2log($filename,$entry,$debug=true){\n $TimeStamp = date(\"Y-m-dTH:i:s+0000\");\n $entry .= \"\\n\";\n $FileHandle=fopen($filename, \"a\");\n\n if($FileHandle){\n fwrite($FileHandle, \"[ $TimeStamp ] \".$entry);\n fclose($FileHandle);\n\n //~ If debug is enable we also print some infos to the console\n if($debug){ echo($entry); }\n }\n}",
"public function add($entry)\n {\n $this->log[] = $entry;\n while (\\count($this->log) > $this->size) {\n array_shift($this->log);\n }\n }",
"public function submit_new_entry_start()\n\t{\n\t\t// -------------------------------------\n\t\t// This is really obnoxious, but EE makes us do this for Quick Save/Preview to work\n\t\t// -------------------------------------\n\n\t\tif ($this->data->channel_is_calendars_channel(ee()->input->post('weblog_id')) === TRUE OR\n\t\t\t$this->data->channel_is_events_channel(ee()->input->post('weblog_id')) === TRUE)\n\t\t{\n\t\t\t$this->cache['quicksave']\t= TRUE;\n\t\t}\n\t}",
"public function postInsert(Model $model, $entry) {\n $logModel = $model->getOrmManager()->getModel(EntryLogModel::NAME);\n $logModel->logInsert($model, $entry);\n }",
"public function _report_form_submit()\n\t{\n\t\t$incident = Event::$data;\n\n\t\tif ($_POST)\n\t\t{\n\t\t\t$action_item = ORM::factory('actionable')\n\t\t\t\t->where('incident_id', $incident->id)\n\t\t\t\t->find();\n\t\t\t$action_item->incident_id = $incident->id;\n\t\t\t$action_item->actionable = isset($_POST['actionable']) ?\n\t\t\t\t$_POST['actionable'] : \"\";\n\t\t\t$action_item->action_taken = isset($_POST['action_taken']) ?\n\t\t\t\t$_POST['action_taken'] : \"\";\n\t\t\t$action_item->action_summary = $_POST['action_summary'];\n\t\t\t$action_item->save();\n\n\t\t}\n\t}",
"function logEvent($con, $accID, $txtEvent)\n\t{\n\t\t$userName = getUserName($con, $accID);\n\t\t$sql_log = $con->prepare(\"INSERT INTO logs (logDate, logUser, logEvent) VALUES (NOW(), ?, ?)\");\n\t\t$sql_log->bind_param(\"ss\", $userName, $txtEvent);\n\t\t$sql_log->execute() or die(mysqli_error($con));\n\t}",
"public function log($data){\n\n $type = \"\";\n\n switch($data[\"severity\"]){\n case 0: $type = \"INFORMATION\";\n break;\n case 1: $type = \"WARNING\";\n break;\n case 2: $type = \"ERROR\";\n break;\n default: $type = \"FATAL\";\n break;\n }\n\n\n $data[\"userid\"] = $this->user[\"userid\"];\n $data[\"msg_type\"] = $type;\n $data[\"api_version\"] = \"v100\";\n $data[\"recd\"] = json_encode(Input::all());\n $data[\"server\"] = gethostname();\n\n $log = new Log($data);\n $log->save();\n }",
"function log_event($action) {\n\t$now = new DateTime();\t\n\tfile_put_contents(WP_PLUGIN_DIR.\"/StandardsReader/cron_log.txt\", \"|\" . $now->format('Y-m-d H:i:s') . \" \". $action . \"\\r\\n\", FILE_APPEND | LOCK_EX);\n}",
"function log_action($action, $message=\"\"){\n\t\t$logfile = SITE_ROOT.DS.'logs'.DS.'log.txt';\n\t\t\n\t\t// check the file is writable or output error\n\t\t// append new entries to the end of the file\n\t\tif($handle = fopen($logfile, 'a')){ // append\n\t\t\n\t\t\t// Sample Entry: 2012-01-01 13:10:03 | Login: freeze logged in. \n\t\t\t//(for windows newline is \\r\\n) for unix it is just \\n\n\t\t\t$timestamp = date('Y-m-d h:i:s A');\n\t\t\t$content = \"{$timestamp} | {$action}: {$message}\\r\\n\";\n\t\t\tfwrite($handle, $content); \n\t\t\n\t\t\tfclose($handle);\n\t\t} else {\n\t\t\techo \"Could not open file for writing\";\n\t\t}\t\n\t}",
"private function send_log() {\n MessageLogger::add_log($this->log);\n $this->log = \"\";\n }",
"public function save_entry_to_log(Omnilog_entry $entry)\n {\n /**\n * This method could conceivably be called when the module is\n * not installed, but the Omnilogger class is present.\n */\n\n if ( ! $this->EE->db->table_exists('omnilog_entries'))\n {\n throw new Exception(\n $this->EE->lang->line('exception__save_entry__not_installed'));\n }\n\n if ( ! $entry->is_populated())\n {\n throw new Exception(\n $this->EE->lang->line('exception__save_entry__missing_data'));\n }\n\n $insert_data = array_merge(\n $entry->to_array(),\n array(\n 'notify_admin' => ($entry->get_notify_admin() === TRUE) ? 'y' : 'n',\n 'site_id' => $this->get_site_id()\n )\n );\n\n $insert_data['admin_emails'] = implode($insert_data['admin_emails'], '|');\n\n $this->EE->db->insert('omnilog_entries', $insert_data);\n\n if ( ! $insert_id = $this->EE->db->insert_id())\n {\n throw new Exception(\n $this->EE->lang->line('exception__save_entry__not_saved'));\n }\n\n $entry->set_log_entry_id($insert_id);\n return $entry;\n }",
"function logToDb($conn, $exhibitorId, $formName, $status=NULL) { \n if (!$status) {\n // a status wiil be provided only by the admin code\n // the below if else loop is to determine what the status should be\n $checkQuery = \"SELECT * FROM logs WHERE exhibitor_id = $exhibitorId AND form_name = '$formName'\";\n $checkQueryResult = executeQuery($conn, $checkQuery);\n if ($checkQueryResult->num_rows > 0) {\n /* \n the above statement means that the user has already \n submitted the form before, hence we add a log with the status EDITED\n */\n $status = \"EDITED\";\n $insertLog = \"INSERT INTO logs(exhibitor_id, form_name, status) values($exhibitorId, '$formName', '$status')\";\n executeQuery($conn, $insertLog);\n } else {\n /**\n * This block means that the user has not previously submitted this form\n * hence the status will be SUBMITTED.\n */\n $status = \"SUBMITTED\";\n $insertLog = \"INSERT INTO logs(exhibitor_id, form_name, status) values($exhibitorId, '$formName', '$status')\";\n executeQuery($conn, $insertLog);\n }\n } else {\n // this code will execute only when exhibitor side calls the method.\n $insertLog = \"INSERT INTO logs(exhibitor_id, form_name, status) values($exhibitorId, '$formName', '$status')\";\n executeQuery($conn, $insertLog);\n }\n}",
"function log_act($text, $name, $detail) {\n\n\tglobal $zurich;\t\n\t\n\t$text = addslashes($text);\n\tdb_write(\"INSERT INTO log (name, action, detail, time) \n\t\t\t\tVALUES ('$name', '$text', '$detail', '$zurich->time')\");\n}",
"public function send($log);",
"function log_cron($data)\n\t{\n\t\tif(isset($data))\n\t\t{\n\t\t\tif(!$this->db->insert('CRONLOGS', $data))\n\t\t\t{\n\t\t\t\tthrow new Exception(\"Database Error.\");\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthrow new Exception(\"No data input.\");\n\t\t}\n\t}",
"public function submitEvent();",
"public function run()\n {\n $data = [\n \t\t\t'Company-Updated',\n \t\t\t'Project-Updated',\n 'User-Updated'\n \t\t];\n\n foreach($data as $key => $value) {\n\t\t\tLog::create(['name'=>$value]);\n\t\t}\t\t\n }",
"function addInputLog($Response){\r\n\t\tif(!API_SAVE_LOG){\r\n\t\t\treturn TRUE;\r\n\t\t}\r\n\t\t$this->fantasydb->log_api->insertOne(array(\r\n\t\t\t'URL' \t\t=> current_url(),\r\n\t\t\t'RawData'\t=> @file_get_contents(\"php://input\"),\r\n\t\t\t'DataJ'\t\t=> array_merge(array(\"API\" => $this->classFirstSegment = $this->uri->segment(2)), $this->Post, $_FILES),\r\n\t\t\t'Response'\t=> $Response,\r\n\t\t\t'EntryDate' => date('Y-m-d H:i:s')\r\n\t\t));\r\n\t}",
"public function save(){\r\n\t\t\t$query = DB::connection()->prepare(\r\n\t\t\t\t\"INSERT INTO Logs (comp_id, user_id, datum) \r\n\t\t\t\tVALUES (:comp_id, :user_id, :datum)\"\r\n\t\t\t);\r\n\t\t\t$query->execute(array(\r\n\t\t\t\t'comp_id' \t=>\t$this->comp_id,\r\n\t\t\t\t'user_id'\t=>\t$this->user_id,\r\n\t\t\t\t'datum' \t=>\t$this->datum\r\n\t\t\t));\r\n\t\t}",
"public function log() {\r\n\t\t$this->resource->log();\r\n\t}",
"function log_action($blog_id, $note) {\r\n\t //grab data\r\n\t $log = get_blog_option($blog_id, 'psts_action_log');\r\n\r\n\t if (!is_array($log))\r\n\t $log = array();\r\n\r\n\t //append\r\n\t $timestamp = microtime(true);\r\n\r\n\t\t//make sure timestamp is unique by padding seconds, or they will be overwritten\r\n\t while (isset($log[$timestamp]))\r\n\t $timestamp += 0.0001;\r\n\r\n\t $log[$timestamp] = $note;\r\n\r\n\t //save\r\n\t update_blog_option($blog_id, 'psts_action_log', $log);\r\n\t}",
"function log_action($workdir,$string)\n{\n\nif (empty($workdir))\n{\n\t$script_filename = $_SERVER['SCRIPT_FILENAME'];\n\t$workdir = dirname($script_filename).'/';\n}\n$logfile = $workdir.'logfile.txt';\n\n$num_params_per_tag = 3; // number of parameters for each line (es.: \"welcome::5635::20/12/2009 22:12:02\")\n\n// read logdata\n$file = file($logfile);\nif ($file === false)\n{\n\t$logdata = Array();\n}\nelse\n{\n\tforeach($file as $line)\n\t{\n\t\t$var = split(\"::\",trim($line));\n\t\tif (!empty($var[1])) // parse lines with at least two parameters\n\t\t{\n\t\t\t$logdata[$var[0]] = array_slice($var,1);\n\t\t}\n\t}\n}\n\n// edit logdata\n\n$item = $logdata[$string];\n\n$ks_date = date(\"d/m/Y H:m:s\",time()); // current date and time\n$counter = $item[0]+1;\n$item[0] = $counter;\n$item[1] = $ks_date;\n\n$logdata[$string] = $item;\n\n// write logdata\n$fid = fopen($logfile,'w');\n\nif ($fid !== False)\n{\n\tforeach ($logdata as $tag => $value_array)\n\t{\n\t\t// assemble line\n\t\t$ks = $tag;\n\t\tforeach ($value_array as $value)\n\t\t{\n\t\t\t$ks .= \"::\".$value;\n\t\t}\n\t\t\n\t\t$ks .= \"\\n\";\n\t\tfwrite($fid,$ks);\n\t}\n\tfclose($fid);\n}\nelse\n{\n\tdie(\"File I/O error writing $logfile\");\n}\n\nreturn $counter;\n\n}",
"function uLog($site_id, $up_id, $action, $info)\n{\n $toolkit = systemToolkit::getInstance();\n $updateLogMapper = $toolkit->getMapper('update', 'updateLog');\n\n $log = $updateLogMapper->create();\n $log->setSiteId($site_id);\n $log->setUpId($up_id);\n $log->setAction($action);\n $log->setInfo($info);\n $log->setTime(new SQLFunction(\"UNIX_TIMESTAMP\"));\n\n $updateLogMapper->save($log);\n}",
"public function log_query()\n\t{\n\t\t$query = $this->get_query();\n\n\t\tif ( ! $query ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( ! is_array( $query ) && ! is_object( $query ) ) {\n\t\t\t$query = [ $query ];\n\t\t}\n\n\t\t$log = new Charcoal_Log;\n\t\t$log->event_type = $this->event_type;\n\t\t$log->data = $query;\n\t\t$log->save();\n\t}",
"protected function log($data) {\n $time = date('Y-m-d h:i:s a', time());\n $line = $time.\" \".$data.PHP_EOL;\n echo $line;\n file_put_contents($this->_directories[\"communication.log\"], $line,FILE_APPEND);\n }",
"public function toLogEntry();",
"function logActivity($inputData){\n\tif (!file_exists('./activityLog/'))\n\t\tmkdir('./activityLog/');\n\t$fileHandle = fopen('./activityLog/data.log','a');\n\tfputs($fileHandle , trim($inputData).\"\\n\" , 1024 );\n\tfclose($fileHandle);\n}",
"public function submit() {\r\n global $db;\r\n\r\n $this->status = SUBMITTED;\r\n $this->saveMe();\r\n\r\n $sql = \"SELECT d.division_id FROM users as u\r\n LEFT JOIN departments AS d ON d.department_id = u.department_id\r\n WHERE u.user_id = \" . $this->userId;\r\n $divisionId = $db->getRow($sql);\r\n\r\n // save the approvals to the database\r\n foreach($this->approvals as $approval) {\r\n $approval->save($divisionId['division_id']);\r\n }\r\n\r\n $sql = sprintf(\"UPDATE `forms_tracking` SET\r\n `submit_date` = NOW()\r\n WHERE `form_tracking_id` = %s\",\r\n $this->trackingFormId\r\n );\r\n $db->Execute($sql);\r\n\r\n $this->sendSubmissionConfirmationEmail();\r\n\r\n // send notifications\r\n $this->notifyORS();\r\n\r\n // notify Dean if deadline is within DEAN_NOTIFICATION_THRESHOLD_DAYS\r\n if(isset($this->deadline)) {\r\n $dateThreshold = strtotime(DEAN_NOTIFICATION_THRESHOLD_DAYS);\r\n $deadline = strtotime($this->deadline);\r\n if($deadline < $dateThreshold) {\r\n $this->notifyDean();\r\n }\r\n }\r\n\r\n if($this->compliance->requiresBehavioural()) {\r\n $this->notifyHREB();\r\n }\r\n }",
"abstract public function log( $message );",
"function inbound_record_log( $title = '', $message = '', $rule_id = 0, $job_id = '', $type = null ) {\n\tglobal $inbound_automation_logs;\n\t$inbound_automation_logs->add( $title, $message, $rule_id, $job_id, $type );\n\n}",
"public function store() {\n $logData = \"=========================================\\n\";\n $logData .= \"Date Time: \".$this->record_date.\"\\n\";\n $logData .= $this->title.\" (\".$this->type.\") \\n\";\n if(!empty($this->data)) {\n $logData .= var_export($this->data, true).\"\\n\";\n }\n \n file_put_contents($this->file, $logData, FILE_APPEND);\n \n }",
"public function saveAction()\n\t{\n try {\n\t\t // load the ActionForm\n\t\t $actionForm = $this->_getActionForm();\n\t\t // validate the ActionForm with the task data\n $actionErrors = $actionForm->validate();\n if (($errorsFound = $actionErrors->size()) > 0) {\n $this->_saveActionErrors($actionErrors);\n return $this->createAction();\n }\n // save the passed logging entry\n $taskUserId = $this->_getDelegate()->saveTaskUser(\n $actionForm->repopulate($this->_getSystemUser())\n );\n // store the ID of the created logging entry in the request\n $this->_getRequest()->setAttribute(\n \tTDProject_Project_Controller_Util_WebRequestKeys::TASK_USER_ID,\n \t$taskUserId->intValue()\n );\n\t\t\t// create the affirmation message\n\t $actionMessages = new TechDivision_Controller_Action_Messages();\n $actionMessages->addActionMessage(\n new TechDivision_Controller_Action_Message(\n TDProject_Project_Controller_Util_MessageKeys::AFFIRMATION,\n $this->translate('loggingUpdate.successfull')\n )\n );\n // save the ActionMessages in the request\n $this->_saveActionMessages($actionMessages);\n // reset the ActionForm\n $actionForm->preset();\n } \n catch(TDProject_Project_Common_Exceptions_InvalidTaskException $e) {\n // create, add and save the error\n $errors = new TechDivision_Controller_Action_Errors();\n $errors->addActionError(\n new TechDivision_Controller_Action_Error(\n TDProject_Project_Controller_Util_ErrorKeys::SYSTEM_ERROR,\n $this->translate('Task ID existiert nicht!')\n )\n );\n // add the errors container to the Request\n\t\t\t$this->_saveActionErrors($errors);\n \t\t// set the ActionForward in the Context\n \t\treturn $this->create();\n } \n catch(TDProject_Project_Common_Exceptions_TaskOverbookedException $toe) {\n // create, add and save the error\n $errors = new TechDivision_Controller_Action_Errors();\n $errors->addActionError(\n new TechDivision_Controller_Action_Error(\n TDProject_Project_Controller_Util_ErrorKeys::SYSTEM_ERROR,\n $this->translate('Task kann nicht weiter überbucht werden!')\n )\n );\n // add the errors container to the Request\n\t\t\t$this->_saveActionErrors($errors);\n } \n catch(TDProject_Project_Common_Exceptions_TaskFinishedException $toe) {\n // create, add and save the error\n $errors = new TechDivision_Controller_Action_Errors();\n $errors->addActionError(\n new TechDivision_Controller_Action_Error(\n TDProject_Project_Controller_Util_ErrorKeys::SYSTEM_ERROR,\n $this->translate('Task wurde bereits geschlossen!')\n )\n );\n // add the errors container to the Request\n\t\t\t$this->_saveActionErrors($errors);\n } \n catch(TDProject_Project_Common_Exceptions_ProjectCycleClosedException $pcce) {\n \t// initialize the parameters for the translation\n \t$params = new TechDivision_Collections_ArrayList();\n \t$params->add($pcce->getProjectName());\n \t$params->add($pcce->getClosingDate());\n // create, add and save the error\n $errors = new TechDivision_Controller_Action_Errors();\n $errors->addActionError(\n new TechDivision_Controller_Action_Error(\n TDProject_Project_Controller_Util_ErrorKeys::SYSTEM_ERROR,\n $this->translate('logging.project-cycle.closed', null, $params)\n )\n );\n // add the errors container to the Request\n\t\t\t$this->_saveActionErrors($errors);\n } catch(Exception $e) {\n // create and add and save the error\n $errors = new TechDivision_Controller_Action_Errors();\n $errors->addActionError(\n new TechDivision_Controller_Action_Error(\n TDProject_Project_Controller_Util_ErrorKeys::SYSTEM_ERROR,\n $e->__toString()\n )\n );\n // adding the errors container to the Request\n\t\t\t$this->_saveActionErrors($errors);\n\t\t\t// set the ActionForward in the Context\n\t\t\treturn $this->_findForward(\n\t\t\t TDProject_Core_Controller_Util_GlobalForwardKeys::SYSTEM_ERROR\n\t\t\t);\n }\n // return to the logging detail page\n return $this->createAction();\n \n\t}",
"function logAction($action) {\n\tglobal $dbLog;\n\n\t$dbLog->exec('INSERT INTO log (descripcion) VALUES (\"'.$action.'\")');\n}",
"function create_run_log() {\n\n\t\t$this->log = new Log();\n\t\t$this->log->set_workflow_id( $this->get_id() );\n\t\t$this->log->set_date( new DateTime() );\n\n\t\tif ( $this->is_tracking_enabled() ) {\n\t\t\t$this->log->set_tracking_enabled( true );\n\n\t\t\tif ( $this->is_conversion_tracking_enabled() ) {\n\t\t\t\t$this->log->set_conversion_tracking_enabled( true );\n\t\t\t}\n\t\t}\n\n\t\t$this->log->save();\n\t\t$this->log->store_data_layer( $this->data_layer() );\n\n\t\tdo_action( 'automatewoo_create_run_log', $this->log, $this );\n\t}",
"public function applog($str_val) {\n\t\t$log_file = $this->log_file_path;\n\t\t\t\t\n\t\tif(empty($str_val)) {\n\t\t\t$str_val='Empty call (Nothing was provided)';\n\t\t}\n\t\t\n\t\t$str_date_time = date('d-m-Y h:i:s A'); // add timestamp\n\t\t$str_val = $str_date_time.' - '.$str_val.\" \\n\"; // create newline\t\t\n\t\t\n\t\t$handle = fopen($log_file, 'a') or die('Cannot open file: '.$log_file);\t\n\t\tfwrite($handle, $str_val);\n\t\tfclose($handle);\n\t}",
"public function Storelog($name, $logdata)\n\t{\n\t\tjimport('joomla.error.log');\n\t\t$options = \"{DATE}\\t{TIME}\\t{USER}\\t{DESC}\";\n\t\t$text_file = $logdata['JT_CLIENT'] . '_' . $name . '.php';\n\t\t$my = JFactory::getUser();\n\t\tJLog::addLogger(\n\t\t\t\t\t\t\tarray('text_file' => $text_file ,\n\t\t\t\t\t\t\t\t'text_entry_format' => $options\n\t\t\t\t\t\t\t), JLog::INFO, $logdata['JT_CLIENT']\n\t\t\t\t\t\t);\n\t\t$logEntry = new JLogEntry('Transaction added', JLog::INFO, $logdata['JT_CLIENT']);\n\t\t$logEntry->user = $my->name . '(' . $my->id . ')';\n\t\t$logEntry->desc = json_encode($logdata['raw_data']);\n\n\t\tJLog::add($logEntry);\n\t}",
"function logMessage($line) {\r\n\t// Pull the current log contents\r\n $log = file(LACE_LOGFILE);\r\n\r\n // Grab the date of the\r\n // most recent post in the log\r\n $date = (count($log) > 0) ? array_shift($temp = explode('||', $log[0]))\r\n \t: false;\r\n\r\n // Write yesterday to file if necessary\r\n\tif($date !== false && date('d', $date) != date('d'))\r\n $log = newLog($log, $date);\r\n\r\n // Write the new message\r\n $logfile = fopen(LACE_LOGFILE, 'w');\r\n fwrite($logfile, $line.\"\\n\");\r\n\r\n // Write any other remaining messages\r\n if (count($log) > 0)\r\n \t\tfwrite($logfile, implode(\"\\n\", array_map('trim',$log)).\"\\n\");\r\n\r\n \tfclose($logfile);\r\n}",
"public function testLogSimpleUsingPOST()\n {\n\n }",
"public function mailAction()\n\t{\n\t\t$log = $this->_initLog();\n\t\t\n if (!$log->getId()) {\n $this->_getSession()->addError(Mage::helper('logging')->__('This log no longer exists.'));\n $this->_redirect('*/*/');\n return;\n }\n\t\t$log->sendLogMail();\n\t\t$this->_redirect('*/*/view', array('id' => $this->getRequest()->getParam('id')));\n\t}",
"public function log( $message = '' ) {\r\n\t\t$message = date( 'Y-n-d H:i:s' ) . ' - ' . $message . \"\\r\\n\";\r\n\t\t$this->write_to_log( $message );\r\n\r\n\t}",
"function db_log ($username,$domain,$action,$data)\n{\n global $CONF;\n \n if ($CONF['logging'] == 'YES')\n {\n $result = db_query (\"INSERT INTO log (timestamp,username,domain,action,data) VALUES (NOW(),'$username','$domain','$action','$data')\");\n if ($result['rows'] != 1)\n {\n return false;\n }\n else\n {\n return true;\n }\n }\n}",
"function _queue2civicrm_log( $log=array() ) {\n if ( empty( $log ) ) {\n return false; \n }\n \n // make sure we're using the default db\n $dbs = wmf_civicrm_get_dbs();\n $dbs->push( 'default' );\n \n // if cid is set in the log array, we need to update\n if ( array_key_exists('cid', $log)) {\n $result = db_update( 'queue2civicrm_log' )->fields( array(\n 'gateway' => $log[ 'gateway' ],\n 'gateway_txn_id' => $log[ 'gateway_txn_id' ],\n 'data' => $log[ 'data' ],\n 'timestamp' => $log[ 'timestamp' ],\n 'verified' => $log[ 'verified' ],\n ) )->condition( 'cid', $log[ 'cid' ] )->execute();\n } else { \n $result = db_insert('queue2civicrm_log')->fields( array(\n 'gateway' => $log[ 'gateway' ],\n 'gateway_txn_id' => $log[ 'gateway_txn_id' ],\n 'data' => $log[ 'data' ],\n 'timestamp' => $log[ 'timestamp' ],\n 'verified' => $log[ 'verified' ],\n ) )->execute();\n }\n\n if ( !$result ) {\n watchdog( 'queue2civicrm', 'Failed logging the transaction: %log', array( \"%log\" => print_r( $log, true )), WATCHDOG_ERROR );\n }\n return $result;\n}",
"private function logRequest() {\n\t\t//Uncomment or set 'error_log = syslog' to log to system default syslog location\n\t\topenlog(basename(__FILE__), LOG_NDELAY, LOG_LOCAL5);\n\t\tsyslog(LOG_NOTICE, get_class($this).\" \".$_SERVER['REMOTE_ADDR'].\" did $this->_method with request: \".$this->_request['rquest'].\"\\n\");\n\t\tcloselog;\n\t}",
"public function createdLogEntryCallsGivenLogger()\n {\n $this->mockLogger->expects($this->once())\n ->method('log')\n ->with($this->logEntry);\n $this->logEntry->log();\n }",
"function logMe($action='', $prop_id=0){\n\t\n\t\tif(!cleanInput($action)){return false;}\n\t\t\n\t\t// Session input\n\t\t$cust_id = $_SESSION['cust_id'];\n\t\t$agent_id = $_SESSION['agent_id'];\n\t\t\n\t\t// External input\n\t\tif($this->cust_id){$cust_id = $this->cust_id;}\n\t\tif($this->agent_id){$agent_id = $this->agent_id;}\n\t\t\n\t\t$sql = \"INSERT INTO `log` (`cust_id`, `agent_id`, `cms_user_id`, `prop_id`, `action`, `unix`, `email`)VALUES('\".esc($cust_id).\"', '\".esc($agent_id).\"', '\".esc($_SESSION['cms_user_id']).\"', '\".esc($this->prop_id).\"', '\".esc($action).\"', \".time().\", '\".esc($this->email).\"')\";\n\t\t#exit($sql);\n\t\tquery($sql);\n\t\t\n\t\tunset($this->prop_id);\n\t\tunset($this->agent_id);\n\t\tunset($this->cust_id);\n\t\tunset($this->email);\n\t}",
"function submit($args, $request) {\n\t\t$step = (int) array_shift($args);\n\t\t$articleId = (int) $request->getUserVar('articleId');\n\t\t$journal =& $request->getJournal();\n\n\t\t$this->validate($request, $articleId, $step, 'author.submit.authorSubmitLoginMessage');\n\t\t$article =& $this->article;\n\t\t$this->setupTemplate($request, true);\n\n\t\t$formClass = \"AuthorSubmitStep{$step}Form\";\n\t\timport(\"classes.author.form.submit.$formClass\");\n\n\t\t$submitForm = new $formClass($article, $journal, $request);\n\t\tif ($submitForm->isLocaleResubmit()) {\n\t\t\t$submitForm->readInputData();\n\t\t} else {\n\t\t\t$submitForm->initData();\n\t\t}\n\t\t$submitForm->display();\n\t}",
"function record_incident($tag,$email,$message){\n $query = \"INSERT INTO HISTORY (TIME,TAG,EMAIL,MESSAGE) VALUES (\" . time() . \",'\" . $tag . \"','\" . $email . \"','\" . $message . \"')\" ; \n if(!$this->query($query)) return false;\n return true;\t \n }",
"public function testLogStandardActionUsingPOST()\n {\n\n }",
"public function testLogUsingPOST()\n {\n\n }",
"function insert_log( $log_data = array() ) {\n\t\n\t\t/* Get Log From Rule ID */\t\t\n\t\t$logs_array = Inbound_Logging_Automation::get_logs( $log_data['rule_id'] );\n\t\t\n\t\t/* Push log to front of array */\n\t\t$logs_array[] = $log_data;\n\t\t\n\t\t/* Trim logs array to X entries */\n\t\tif ( count($logs_array) > self::$log_limit ) {\n\t\t\t$trim = count($logs_array) - self::$log_limit;\n\t\t\t$logs_array = array_slice($logs_array, $trim);\n\t\t}\n\t\t\n\t\t/* Update logs meta */\n\t\tupdate_post_meta( $log_data['rule_id'] , '_automation_logs' , json_encode($logs_array) );\n\n\t}",
"function submit()\n {\n\t\t//all data is handled by submit2()\n }",
"function EventLog($page,$action,$orignal_value,$new_value)\n{\n\t\t$email = $_SESSION['user_email'];\n\t\t$ipaddress = getUserIP();\n\t\t\n\t\t$data = sprintf(\"%s,%s,%s,%s,%s\" . PHP_EOL, $ipaddress,date(\"F j Y g:i a\"), $email, $page, $action);\n\t\t\n\t\t//file_put_contents($_SERVER['DOCUMENT_ROOT'] .'/log.txt', $data, FILE_APPEND);\t\t\n\t\tfile_put_contents('log.txt', $data, FILE_APPEND);\t\t\t\n\t\t\n\t\t\n}",
"public function log()\n {\n $this->fetchFields();\n Log::console($this);\n }",
"public function log($data)\n\t{\n\t\t$logItem = array(\n\t\t\t'data' => $data,\n\t\t\t'type' => self::LOG\n\t\t);\n\t\tself::addToConsoleAndIncrement($logItem);\n\t}",
"function add_log_entry(log_op_move $entry) {\n array_unshift($this->log_op_list, $entry);\n }",
"public static function log($request, $timestamp = 0, $move_head = false)\n {\n\n }",
"protected function log()\n {\n\n $this->worker\n ->setInstance($this->instance);\n // If instance can be called\n if($this->worker->ping()) {\n $infos = $this->worker->getInfos();\n $createdAt = new \\DateTime();\n\n $log = $this->logManager->createNew();\n $log->setMemory($infos['Memory']['used_memory']);\n $log->setCpu($infos['CPU']['used_cpu_sys']);\n $log->setNbClients(sizeof($this->worker->getClients()));\n $log->setCreatedAt($createdAt);\n // Add log\n $this->instance->addLog($log);\n }\n }",
"public function submitEntry($sendDate, $receiveDate, $header, $body){\n\t\t\t$stmt = $this->db->prepare('insert into '.$this->config->tblEntries.' \n\t\t\t\t\t\t\t\t\t\tvalues(NULL, datetime(:send, \"unixepoch\"), datetime(:receive, \"unixepoch\"), :header, :body, 0)');\n\t\t\t$stmt->bindValue(':send', $sendDate);\n\t\t\t$stmt->bindValue(':receive', $receiveDate);\n\t\t\t$stmt->bindValue(':header', htmlentities($header));\n\t\t\t$stmt->bindValue(':body', htmlentities($body));\n\t\t\treturn $stmt->execute();\n\t\t}",
"public function addLog ( $keys, $received, $sent, $base_string, $notes, $user_id = null ) { }",
"function ilog(){\r\n\t\tif($this->input['action'] != 'mylog'){\r\n\t\t\tif($this->vars['logSavePage'] == 1) $logSavePage = addslashes(serialize($this->page));\r\n\t\t\t// user log\r\n\t\t\t$this->DB->query(\"\r\n\t\t\t\tINSERT INTO `log` (`userid` , `title` , `area` , `module` , `action` , `id` , `ip` , `kinput` , `page` , `dateline`)\r\n\t\t\t\tVALUES (\r\n\t\t\t\t'\".$this->user['userid'].\"', '\".$this->page['title'].\"', '\".$this->vars['area'].\"', '\".$this->input['module'].\"', '\".$this->input['action'].\"', '\".$this->iif($this->input[$this->input['module'].'id'] > 0, $this->input[$this->input['module'].'id'], 0).\"', '\".IP.\"', '\".serialize($this->input).\"', '\".$logSavePage.\"', '\".TIMENOW.\"'\r\n\t\t\t\t)\r\n\t\t\t\");\r\n\t\t}\r\n\t}",
"public function log_activity($fkey,$note,$ref='inventory',$title) {\n\t\t$note_date = date(\"Ymd\");\n\t\t$user_id = $_SESSION['username'];\n\n\t\t$sql = \"INSERT INTO `notes` \n\t\t(`note_date`,`table_ref`,`fkey`,`user_id`,`title`,`note`)\n\t\tVALUES\n\t\t('$note_date','$ref','$fkey','$user_id','$title','$note')\n\t\t\";\n\t\t$result = $this->new_mysql($sql);\n\t}",
"public function save( LogEntity $logEntity );",
"public function recordAction() {\n\t\t \t\t\t\t\n\t\t\n\t}",
"private function log_it($msg) {\n $this->log_msg_queue .= date('m/d/y H:i:s : ', time()) . $msg . PHP_EOL;\n }",
"function sendLog(){\r\n\r\n\t\t$ip = $_SERVER[\"REMOTE_ADDR\"];\r\n\r\n\t\t$insertstatement = \"\r\n\t\t\tINSERT INTO\r\n\t\t\t\t`log`\r\n\t\t\t(`type`, `value`, `userid`, `ip`) VALUES (\r\n\t\t\t\t'\".mysqli_real_escape_string($this->db->db_link, $this->type).\"',\r\n\t\t\t\t'\".mysqli_real_escape_string($this->db->db_link, $this->value).\"',\r\n\t\t\t\t'\".mysqli_real_escape_string($this->db->db_link, $this->userid).\"',\r\n\t\t\t\t'\".$ip.\"'\r\n\t\t\t)\";\r\n\r\n\t\t$this->db->query($insertstatement);\r\n\r\n\t}",
"private function addToLog($txt){\n\n $this->db->insert('master_log',\n array(\n 'log_txt' => trim($txt),\n 'added' => 'NOW()'\n ));\n \n }",
"private function submit(){\n $post_params['authToken'] = $this->usersAuthToken;\n $post_params['internalSystemAuth'] = $this->internalSystemAuth;\n $post_params['job_id'] = $this->job_id;\n $post_params['status'] = $this->status;\n $post_params['additional_info'] = $this->additional_info;\n $post_params['datasource_id'] = $this->datasource_id;\n \n //$response = $this->utilities->curlPost($this->baseDomain.$this->url_path, $post_params);\n $response = $this->postCurlCall($this->baseDomain.$this->url_path, $post_params);\n $curInfo = $this->utilities->getLastCurlInfo();\n\n if($response == '{\"status\":\"UPDATED\"}'){\n $this->errors = 'Update Failed';\n return true;\n }\n else\n return false;\n }",
"public function processEntry( $entry ) {\n\t\t$revdeleted = 0;\n\t\tif ( isset( $entry['actionhidden'] ) ) {\n\t\t\t$revdeleted = $revdeleted | LogPage::DELETED_ACTION;\n\t\t\tif ( !isset( $entry['title'] ) ) {\n\t\t\t\t$entry['title'] = '';\n\t\t\t\t$entry['ns'] = 0;\n\t\t\t}\n\t\t}\n\t\tif ( isset( $entry['commenthidden'] ) ) {\n\t\t\t$revdeleted = $revdeleted | LogPage::DELETED_COMMENT;\n\t\t\tif ( !isset( $entry['comment'] ) ) {\n\t\t\t\t$entry['comment'] = '';\n\t\t\t}\n\t\t}\n\t\tif ( isset( $entry['userhidden'] ) ) {\n\t\t\t$revdeleted = $revdeleted | LogPage::DELETED_USER;\n\t\t\tif ( !isset( $entry['user'] ) ) {\n\t\t\t\t$entry['user'] = '';\n\t\t\t\t$entry['userid'] = 0;\n\t\t\t}\n\t\t}\n\t\tif ( isset( $entry['suppressed'] ) ) {\n\t\t\t$revdeleted = $revdeleted | LogPage::DELETED_RESTRICTED;\n\t\t}\n\n\t\t$title = $entry['title'];\n\t\t$ns = $entry['ns'];\n\t\t$title = $this->sanitiseTitle( $ns, $title );\n\n\t\t$ts = wfTimestamp( TS_MW, $entry['timestamp'] );\n\t\tif ( $ts < 20080000000000 && preg_match( '/^Wikia\\-/', $entry['user'], $matches ) ) {\n\t\t\t# A tiny bug on Wikia in 2006-2007, affects ~10 log entries only\n\t\t\tif ( isset( $matches[0] ) ) {\n\t\t\t\t$entry['user'] = substr( $entry['user'], 0, 6 );\n\t\t\t}\n\t\t}\n\n\t\t$performer = $this->getActorFromUser( (int)$entry['userid'], $entry['user'] );\n\n\t\t$e = [\n\t\t\t'log_id' => $entry['logid'],\n\t\t\t'log_type' => $entry['type'],\n\t\t\t'log_action' => $entry['action'],\n\t\t\t'log_timestamp' => $ts,\n\t\t\t'log_namespace' => $ns,\n\t\t\t'log_title' => $title,\n\t\t\t# This is now handled using builtin MediaWiki code below...\n\t\t\t#'log_user' => $entry['userid'],\n\t\t\t#'log_user_text' => $entry['user'],\n\t\t\t#'log_comment' => $wgContLang->truncateForDatabase( $entry['comment'], 255 ),\n\t\t\t'log_actor' => $performer,\n\t\t\t'log_params' => $this->encodeLogParams( $entry ),\n\t\t\t'log_deleted' => $revdeleted\n\t\t];\n\n\t\t# May not be set in older MediaWiki instances. This field can be null\n\t\t# Note that it contains the page id at the time the log was inserted,\n\t\t# not the current page id of the title.\n\t\tif ( isset( $entry['logpage'] ) ) {\n\t\t\t$e['log_page'] = $entry['logpage'];\n\t\t}\n\n\t\t# Bits of code picked from ManualLogEntry::insert()\n\t\t$e += $this->commentStore->insert( $this->dbw, 'log_comment', $entry['comment'] );\n\n\t\t$this->dbw->insert( 'logging', $e, __METHOD__ );\n\n\t\t# Insert tags, if any\n\t\tif ( isset( $entry['tags'] ) && count( $entry['tags'] ) > 0 ) {\n\t\t\t$this->insertTags( $entry['tags'], null, $entry['logid']);\n\t\t}\n\n\t\t$this->dbw->commit();\n\t}",
"public function run()\n {\n DB::insert(\n \"INSERT INTO `logs` (`event`, `occurred_at`) VALUES ('event1', '2020-01-01 00:00:00')\"\n );\n }",
"function log_admin_action($cat, $action, $forum_id = \"\", $thread_id = \"\", $subject = \"\", $new_forum_id = \"\", $post_id = \"\", $new_thread_id = \"\"){\r\n\tglobal $userdata;\r\n\t\r\n\t$result = dbquery(\"INSERT INTO \".DB_ADMIN_LOG.\"\r\n\t(u_id, cat, forum_id, movedto_forum_id, thread_id, movedto_thread_id, post_id, action, subject, datestamp, log_ip)\r\n\tVALUES\r\n\t(\"._db($userdata['user_id']).\", \"._db($cat).\", \"._db($forum_id).\", \"._db($new_forum_id).\", \"._db($thread_id).\", \"._db($new_thread_id).\",\r\n\t\"._db($post_id).\", \"._db($action).\", \"._db($subject).\", '\".time().\"', '\".USER_IP.\"');\");\r\n}",
"public function Storelog($name,$logdata)\n\t{\n\t\tjimport('joomla.error.log');\n\t\t$options = \"{DATE}\\t{TIME}\\t{USER}\\t{DESC}\";\n\n\t\t$my = JFactory::getUser();\n\n\t\tJLog::addLogger(\n\t\t\tarray(\n\t\t\t\t'text_file' => $logdata['JT_CLIENT'] . '_' . $name . '.php',\n\t\t\t\t'text_entry_format' => $options\n\t\t\t),\n\t\t\tJLog::INFO,\n\t\t\t$logdata['JT_CLIENT']\n\t\t);\n\n\t\t$logEntry = new JLogEntry('Transaction added', JLog::INFO, $logdata['JT_CLIENT']);\n\t\t$logEntry->user = $my->name . '(' . $my->id . ')';\n\t\t$logEntry->desc = json_encode($logdata['raw_data']);\n\n\t\tJLog::add($logEntry);\n\t\t/*\n\t\t$logs = &JLog::getInstance($logdata['JT_CLIENT'].'_'.$name.'.log',$options,$path);\n\t\t$logs->addEntry(array('user' => $my->name.'('.$my->id.')','desc'=>json_encode($logdata['raw_data'])));\n\t\t*/\n\t}",
"abstract public function submit($data);",
"function after_insert_log($post_array, $primary_key)\n {\n $format = 'DATE_RFC822';\n $time = time();\n $date = standard_date($format, $time);\n\n $data = array(\n 'action' => 'insert',\n 'user' => $this->session->userdata('username'),\n 'section' => 'Idiomas',\n 'fk_section' => $primary_key,\n 'date' => $date\n\n );\n $this->db->insert('user_log', $data);\n }",
"public function log()\n {\n $this->appendLog('log', \\func_get_args());\n }",
"private function log($endpoint,$response)\n\t{\n\t\t$data =\n\t\t[\n\t\t\t'key_id'\t=> $this->key_id,\n\t\t\t'endpoint'\t=> $endpoint,\n\t\t\t'date'\t\t=> date('Y-m-d H:m:s'),\n\t\t\t'result'\t=> $response\n\t\t];\n\t\t$this->db->insert('nct_api_requests',$data);\n\t}",
"public function log_activity() {\n\t\t$data = array();\n\t\t$data['page'] = current_url();\n\t\t$data['ip_address'] = $this->_ci->input->ip_address();\n\t\t$data['user_agent'] = $this->_ci->agent->agent_string(); \n\t\t$data['request_method'] = $this->_ci->input->server('REQUEST_METHOD');\n\t\t$data['request_params'] = serialize($this->_ci->input->get_post(NULL, TRUE)); \n\t\t$data['uri_string'] = $this->_ci->uri->uri_string();\n\t\t$data['created_at'] = date('Y-m-d h:i:s');\n\n\t\tif($this->verify_activity()) {\n\t\t\t// And write it to the database\n\t\t\t$this->_ci->db->insert('hooks', $data);\n\t\t}\n\t}",
"function logEvent($message)\n\t{\n\t\tdate_default_timezone_set ( \"America/Chicago\" );\n\t\t$time = date( \"Y-m-d H:i:s\");\n\t\t$fp = fopen('files/log.txt', 'a');\n\t\tfwrite($fp, $time.\"-- \");\n\t\tfwrite($fp, $message);\n\t\tfwrite($fp, \"\\n\");\n\t\tfclose($fp);\n\t}",
"public function logResult() : void\n {\n $log = implode(' ', $this->logArray);\n $logger = new Logger('Results');\n $logger->pushHandler(new StreamHandler('file.log', Logger::DEBUG));\n $logger->addInfo($log);\n }",
"function insert_dj_blog_entry($DJID, $Blog, $Time, $Submission) {\r\n\r\n $conn = db_connect();\r\n\r\n\r\n\r\n // insert new log entry\r\n $query = \"insert into DJBLOG values\r\n (null, '\".$DJID.\"', '\".$Blog.\"',\r\n '\".$Time.\"', '\".$Submission.\"')\";\r\n\r\n $result = $conn->query($query);\r\n if (!$result) {\r\n return false;\r\n } else {\r\n return true;\r\n }\r\n}",
"function db_log($query,$executedto){\n\t//$temp = $_SERVER['DOCUMENT_ROOT'].\"\\\\pk\\\\errorlog\\\\\";\n\t//$default_folder = str_replace(\"/\",\"\\\\\",$temp);\t\n\t$file_name = \"./errorlog/querylog.html\";//$default_folder.\"querylog.html\";\n\t$file_handler = fopen($file_name,\"a\");\n\t$serializedPost = serialize($_POST);\n\t$message = \"<br><i>executed at: \".date('l jS \\of F Y h:i:s A').\" details: \".$executedto.\"</i><br><b>\".$query.\" </b>\".$serializedPost.\"<br>\";\t\n\tfwrite($file_handler,$message);\n\tfclose($file_handler);\n}",
"function log()\n\t{\n\t\tcall_user_func_array(array($this->server, 'log'), func_get_args());\n\t}",
"public function new_log_entry( $log ) {\n\t\t$post_id = wp_insert_post(\n\t\t\t[\n\t\t\t\t'post_title' => $log->get_subject(),\n\t\t\t\t'post_content' => $log->get_body(),\n\t\t\t\t'post_status' => 'publish',\n\t\t\t\t'post_type' => $this->post_type,\n\t\t\t\t'meta_input' => [\n\t\t\t\t\t'recipients' => wp_json_encode( $log->get_recipients() ),\n\t\t\t\t\t'headers' => wp_json_encode( $log->get_headers() ),\n\t\t\t\t\t'attachments' => $log->get_attachments(),\n\t\t\t\t\t'timestamp' => $log->get_timestamp(),\n\t\t\t\t\t'error' => $log->get_error(),\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\n\t\treturn $post_id;\n\t}",
"public function createAction()\n {\n if (!$this->request->isPost()) {\n $this->dispatcher->forward(array(\n 'controller' => \"export_yy_logs\",\n 'action' => 'index'\n ));\n\n return;\n }\n\n $export_yy_log = new ExportYyLogs();\n\n $post_flds = [];\n $post_flds = [\"cd\",\n \"name\",\n \"time_from\",\n \"time_to\",\n \"updated\",\n ];\n \n\n $thisPost=[]; // カンマ編集を消すとか日付編集0000-00-00を入れるとか$thisPost[]で行う\n foreach ($post_flds as $post_fld) {\n $export_yy_log->$post_fld = array_key_exists($post_fld, $thisPost)?$thisPost[$post_fld]:$this->request->getPost($post_fld);\n }\n\n if (!$export_yy_log->save()) {\n foreach ($export_yy_log->getMessages() as $message) {\n $this->flash->error($message);\n }\n\n $this->dispatcher->forward(array(\n 'controller' => \"export_yy_logs\",\n 'action' => 'new'\n ));\n\n return;\n }\n\n $this->flash->success(\"移出記録の作成が完了しました。\");\n\n $this->dispatcher->forward(array(\n 'controller' => \"export_yy_logs\",\n 'action' => 'edit',\n 'params' => array($export_yy_log->id)\n ));\n }",
"function MCW_logfile($entry) { \n global $mcw_write_log;\n if ($mcw_write_log){ //only used during plugin development\n global $mcw_path;\n $filename = $mcw_path[\"log\"];\n if (!file_exists($filename)){\n $answer = \"file \".$filename.\" does not exist. <br>\";\n } else {\n if (!$handle = fopen($filename, \"a\")) {\n $answer = $answer. \"File \".$filename.\" cannot be opened.<br>\";\n } else {\n // Schreibe $somecontent in die geöffnete Datei.\n $somecontent = '<strong>'.date(\"F j, Y, g:i a\").'</strong> - '.$entry.'<br>'; \n if (!fwrite($handle, $somecontent)) {\n $answer = $answer. \"File \".$filename.\" is not writeable.<br>\";\n } else {\n $answer = $answer.\"done \";\n }\n }\n fclose($handle);\n }\n }\n }",
"public function log ($txt)\n\t{\n\t\t$this->addQueryLog (\"/* \" . $txt . \" */\");\n\t}",
"public function log($info, $file =\"\", $line = \"\")\n {\n if($this->loggingEnabled)\n {\n try \n {\n $dirpath = $this->logDir.\"/\".date(\"M_Y\");\n $filepath = $dirpath.\"/\".date(\"d_M_Y\").\".log\";\n $header = \"[\".date(\"H:i\");// .\"]: \";\n $header = $file == \"\" && $line == \"\" ? $header.\"]: \" : $header.\" in $file at $line]: \";\n if(!is_dir($dirpath))\n mkdir($dirpath);\n $fh = fopen($filepath,\"a\");\t\n fwrite($fh,$header.$info.\"\\n\");\n }\n catch(exception $ex) {} //check perms\n }\n }",
"function saveActivityLog($data)\n\t\t{\n\t\t\t$this->db->insert(\"da_activity_log\",$data);\n\t\t}",
"function saveActivityLog($data)\n\t\t{\n\t\t\t$this->db->insert(\"da_activity_log\",$data);\n\t\t}",
"abstract protected function log(LogMessage $message);",
"public function add_entry($entry);",
"public function updateLog () {\n\t\t$this->log = json_encode($this->SYN_Log);\n\t\t$this->save();\n\t}"
] | [
"0.6261346",
"0.6083896",
"0.6024076",
"0.5983746",
"0.592885",
"0.58807546",
"0.58145785",
"0.58071023",
"0.5769876",
"0.57643425",
"0.57642245",
"0.573554",
"0.57186323",
"0.57056487",
"0.5698319",
"0.5665271",
"0.56351286",
"0.5625338",
"0.562444",
"0.5608652",
"0.5578467",
"0.5573984",
"0.55471635",
"0.55363727",
"0.5524855",
"0.5523",
"0.5522123",
"0.5510574",
"0.5502303",
"0.549119",
"0.54911095",
"0.5482183",
"0.54682",
"0.54623264",
"0.5459374",
"0.5450508",
"0.54501593",
"0.54409856",
"0.54357743",
"0.54287523",
"0.542833",
"0.5418551",
"0.5409661",
"0.54027194",
"0.53951275",
"0.5388298",
"0.5388141",
"0.538528",
"0.53840226",
"0.5380418",
"0.5377162",
"0.5375392",
"0.5374622",
"0.53705996",
"0.5370118",
"0.5354838",
"0.5350408",
"0.53483534",
"0.5344528",
"0.5340176",
"0.53249687",
"0.5314268",
"0.5311483",
"0.53101164",
"0.53092235",
"0.53041583",
"0.5302552",
"0.52881736",
"0.52875906",
"0.5283331",
"0.52812505",
"0.52797574",
"0.5274228",
"0.5266261",
"0.5264842",
"0.52598983",
"0.52558005",
"0.52542555",
"0.52528703",
"0.52484435",
"0.52483594",
"0.5245911",
"0.52377504",
"0.52313644",
"0.52305216",
"0.5225509",
"0.52246183",
"0.5218673",
"0.5211068",
"0.5209",
"0.5207671",
"0.520347",
"0.5198643",
"0.51978624",
"0.51944816",
"0.5191789",
"0.5189403",
"0.5189403",
"0.51852953",
"0.51796967",
"0.51786625"
] | 0.0 | -1 |
Consume an event from Laposta | protected function consumeEvent($event, Laposta_Connect_Model_List $list)
{
if (empty($event['type']) || $event['type'] !== 'member' || !isset($event['data'])) {
return $this;
}
if (!isset($event['data']['list_id']) || !isset($event['data']['member_id'])) {
return $this;
}
$listId = $event['data']['list_id'];
$memberId = $event['data']['member_id'];
$status = isset($event['data']['state']) ? $event['data']['state'] : 'cleaned';
if ($list->getData('laposta_id') !== $listId) {
return $this->log("Resolved list id '{$list->getData('laposta_id')}' does not match provided list id '$listId'.");
}
/** @var $subscribers Laposta_Connect_Model_Mysql4_Subscriber_Collection */
$subscribers = Mage::getModel('lapostaconnect/subscriber')->getCollection();
/** @var $subscriber Laposta_Connect_Model_Subscriber */
$subscriber = $subscribers->getItemByColumnValue('laposta_id', $memberId);
if (!$subscriber instanceof Laposta_Connect_Model_Subscriber) {
return $this->log("Subscriber for laposta id '$memberId' not found.");
}
/** @var $customer Mage_Customer_Model_Customer */
$customer = Mage::getModel('customer/customer')->load($subscriber->getData('customer_id'));
if (!$customer instanceof Mage_Customer_Model_Customer) {
return $this->log("Customer for subscriber with laposta id '$memberId' not found.");
}
/** @var $fieldsHelper Laposta_Connect_Helper_Fields */
$fieldsHelper = Mage::helper('lapostaconnect/Fields');
$fields = $fieldsHelper->getByListId($subscriber->getListId());
/** @var $customerHelper Laposta_Connect_Helper_Customer */
$customerHelper = Mage::helper('lapostaconnect/customer');
$customerHelper->setCustomer($customer);
$customerHelper->email = $event['data']['email'];
foreach ($fields as $fieldName => $lapostaTag) {
$customerHelper->$fieldName = $event['data']['custom_fields'][$lapostaTag];
}
/** @var $newsletterSubscriberModel Mage_Newsletter_Model_Subscriber */
$newsletterSubscriberModel = Mage::getModel('newsletter/subscriber');
/** @var $newsletterSubscriber Mage_Newsletter_Model_Subscriber */
$newsletterSubscriber = $newsletterSubscriberModel->loadByCustomer($customer);
$newsletterSubscriber->setCustomerId($subscriber->getData('customer_id'));
$newsletterSubscriber->setEmail($customer->getEmail());
$newsletterSubscriber->setStoreId($customer->getStore()->getId());
if ($status !== 'active') {
$customer->setIsSubscribed(false);
$newsletterSubscriber->unsubscribe();
$this->log("Customer '{$customer->getEmail()}' for subscriber with laposta id '$memberId' has been unsubscribed.");
}
else {
$customer->setIsSubscribed(true);
$newsletterSubscriber->subscribeCustomer($customer);
$this->log("Customer '{$customer->getEmail()}' for subscriber with laposta id '$memberId' has been subscribed.");
}
$customer->save();
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function consumeEvent($event = null);",
"public function onEvent();",
"function event()\n {\n $this->load->library('service');\n $data = file_get_contents('php://input');\n $ret = array(\n 'out' => $this->service->handle('event', $data)\n );\n $this->output($ret);\n }",
"public function getEventSubscriber();",
"public function invokeEvent(Event $event);",
"public function eventsAction()\n {\n $callback = function ($msg) {\n //check the db before running anything\n if (!$this->isDbConnected('db')) {\n return ;\n }\n\n if ($this->di->has('dblocal')) {\n if (!$this->isDbConnected('dblocal')) {\n return ;\n }\n }\n\n //we get the data from our event trigger and unserialize\n $event = unserialize($msg->body);\n\n //overwrite the user who is running this process\n if (isset($event['userData']) && $event['userData'] instanceof Users) {\n $this->di->setShared('userData', $event['userData']);\n }\n\n //lets fire the event\n $this->events->fire($event['event'], $event['source'], $event['data']);\n\n $this->log->info(\n \"Notification ({$event['event']}) - Process ID \" . $msg->delivery_info['consumer_tag']\n );\n };\n\n Queue::process(QUEUE::EVENTS, $callback);\n }",
"public function consume()\n {\n }",
"public function DoEvent($nEvent) {}",
"public function consume();",
"public function consume();",
"public function listen() {\n $this->source->listen($this->id);\n }",
"public function run($event) {\n }",
"public function run($event) {\n }",
"public function consume($data);",
"abstract protected function inscriretruetrue($event, $membre);",
"public function testEventCallBackGet()\n {\n }",
"private static function event()\n {\n $files = ['Event', 'EventListener'];\n $folder = static::$root.'Event'.'/';\n\n self::call($files, $folder);\n\n $files = ['ManyListenersArgumentsException'];\n $folder = static::$root.'Event/Exceptions'.'/';\n\n self::call($files, $folder);\n }",
"abstract protected function handle($event);",
"public function testEventWithClosure()\n {\n $eventManager = new EventManager;\n $secret = '1234';\n $eventManager->listen('secret', function ($newSecret) use ($secret) {\n $this->assertEquals($newSecret, $secret);\n });\n $eventManager->fire('secret', $secret);\n }",
"public function handleEvent(PhutilEvent $event) {\n // occurs, this method will be invoked. You should respond to the event.\n\n // In this case, we just echo a message out so the event test script will\n // do something visible.\n\n $console = PhutilConsole::getConsole();\n $console->writeOut(\n \"%s\\n\",\n pht(\n '%s got test event at %d',\n __CLASS__,\n $event->getValue('time')));\n }",
"public function on($event, $callback){ }",
"public function broadcastEvent(\\Montage\\Event\\Event $event);",
"public function handle($event)\n {\n \n }",
"public function event(): EventDispatcherInterface;",
"public function raise($event){\r\n\r\n $parameters = [];\r\n\r\n // called like this: raise('event', param, param1, param2, ...)\r\n if(func_num_args() > 1){\r\n $event = func_get_arg(0);\r\n\r\n $tmpParameters = func_get_args();\r\n $parameters = array_splice($tmpParameters, 1);\r\n }\r\n\r\n if(isset($this->events[$event])){\r\n\r\n $listeners = $this->events[$event];\r\n\r\n foreach ($listeners as $listener){\r\n\r\n if($listener['static']){\r\n\r\n Components::callStaticMethod($listener['component'], $listener['method'], $parameters);\r\n\r\n }else{\r\n\r\n self::callNonStaticListener($listener, $parameters);\r\n\r\n }\r\n\r\n }\r\n\r\n }\r\n\r\n }",
"protected function handle($e) {\n if(empty($this->listeners)) {\n return;\n }\n \n foreach($this->listeners as $name => $l) {\n foreach($l as $listener) {\n $this->process($name,$listener,$e);\n }\n }\n }",
"public function getEvent();",
"public function handleSubscriptionEvent(object $message): void;",
"public function testFireEventWithClass()\n {\n $eventManager = new EventManager;\n $secret = '1234';\n $eventManager->listen('secret', 'Underlay\\Tests\\Events\\Test@call', function (\n $receivedSecret\n )\n use (\n $secret\n ) {\n $this->assertEquals($secret, $receivedSecret);\n });\n $eventManager->fire('secret', $secret);\n }",
"public function processAction()\n {\n $env = $this->getEnvironment();\n $this->setProcessTitle('IcingaDB Event Stream: ' . $env->get('name'));\n $handler = new IcingaEventHandler($env);\n $handler->processEvents();\n }",
"function on_start(){\n //$userID = $u->getUserID();\n \n //print \"runnin\";\n //$cartEventClassName = 'ScottcAffiliateRelation';\n //$cartEventClassPath = 'packages/scottc_affiliates/libraries/affiliate_relation.php';\n $eventClassName = 'AffiliateGateway';\n $eventClassPath = 'packages/affiliate_gateway/libraries/affiliate_gateway.php';\n \n define(\"ENABLE_APPLICATION_EVENTS\", true);\n \n Events::extend('on_start', $eventClassName, 'eventOnStart', $eventClassPath, $_GET);\n //Events::extend('on_page_view', 'AffiliateGateway', 'eventOnStart', 'packages/affiliate_gateway/libraries/affiliate_gateway.php');\n \n // if($_GET){\n // Loader::library('affiliate_relation',SCOTTECOMAFFILATESPACKAGEHANDLE);\n // $har = new ScottcAffiliateRelation($_GET);\n // }\n }",
"public function subscribe();",
"public function publish($event, $bus);",
"public function send_events()\n {\n }",
"public function process(object $event) {\r\n\r\n }",
"public static function events();",
"public function testEventCallBackGetItem()\n {\n }",
"public function handle()\n {\n $topic = 'txns-events';\n $channel = 'trading-tool-' . random_int(0, 65536) . '#ephemeral';\n\n $res = $this->ct->subscribe($topic, $channel);\n\n foreach ($res as $data) {\n if ($data === null) {\n continue;\n }\n\n $this->operations = Operation::wait()->get();\n\n $events = json_decode($data->msg, true);\n\n $events = collect($events)->filter(function ($v) {\n return isset($v['CreatedAt']);\n });\n\n foreach ($events as $txn) {\n if (!isset($txn['Event'])) {\n continue;\n }\n\n match ($txn['Event']) {\n 'CreatorCoin' => $this->eventCreatorCoin($txn),\n default => null\n };\n }\n };\n\n return 0;\n }",
"public function subscribes();",
"public function handle(\\Inhere\\Event\\EventInterface $event)\n {\n }",
"public static function getSubscribedEvents()\n {\n echo 'Test';\n }",
"public function indexAction()\n {\n $listToken = Mage::app()->getRequest()->getParam('t');\n $data = $this->getInputStream();\n\n $this->consumeEvents($listToken, $data);\n }",
"public function handle(Event $event): void;",
"public function handle(Event $event): void\n {\n $this->redis->publish('events', json_encode($event, JSON_THROW_ON_ERROR));\n }",
"public function event_joined()\r\n\t{\r\n\t\r\n\t}",
"public function getSubscribedEvents();",
"function onEvent($element_id)\r\n\t{\r\n\t\t\r\n\t}",
"public function onProcess(){\n $id = $this->event->getData();\n \n // retrieve data from database\n $tweet = $this->appmanager->getInfosById($id); \n \n $this->event->setResponse($tweet); \n \n }",
"public function listeners($event);",
"public function subscription();",
"public static function event($event = null)\n {\n }",
"public static function queue($event)\n {\n }",
"public function consume(string $state): void\n {\n $this->client->execute(\"consume {$state}\");\n }",
"public function doSomeAction(TestEvent $event) {\n drupal_set_message(\"The Example Event has been subscribed, which has bee dispatched on submit of the form with \" . $event->getReferenceID() . \" as Reference\");\n }",
"abstract function HookEvents();",
"public function receive(){\n $eslId = $this->uri->segment(3); //Get the flower shop ID\n $this->load->model('esls_model');\n\n $formData = $this->input->post(NULL, TRUE);\n\n //DATA THAT COMES FROM PRODUCERS\n $domain = $formData['_domain'];\n $name = $formData['_name'];\n\n if($name === \"delivery_ready\"){\n $this->process_delivery_ready_event($formData);\n }\n else if($name === \"bid_awarded\"){\n $this->process_bid_awarded_event($formData);\n }\n }",
"public function invoke(): void\n {\n foreach (array_keys($this->pendingEventListenerClassNames) as $listenerClassName) {\n $job = new CatchUpEventListenerJob($listenerClassName);\n // TODO make queue name configurable (per event type?)\n $this->jobManager->queue('neos-eventsourcing', $job);\n }\n $this->pendingEventListenerClassNames = [];\n }",
"abstract public function getEventName();",
"public function getEventDispatch();",
"public function triggerEvent($event) {\r\n\t\tif (!isset($this->eventListener[$event])) return void;\r\n\t\t\r\n\t\tforeach($this->eventListener[$event] as $listener) {\r\n\t\t\t$listener->listen($event);\r\n\t\t}\r\n\t}",
"public static function getSubscribedEvents();",
"public static function getSubscribedEvents();",
"public function subscribe(): void;",
"public function testEventCallBackCreate()\n {\n }",
"public function update($event_info = null)\n {\n echo \"观察者1 收到消息,执行完毕!\";\n }",
"public function onEventAdd()\n\t{\n\t\t$this->onTaskAdd();\n\t}",
"public function callback(){\n $body = file_get_contents('php://input');\n $res = json_decode($body, true);\n \\Think\\Log::write('点播回调开始 begin');\n \n if($res['status'] == 'fail'){\n \\Think\\Log::write('点播回调失败 fail');\n }else{\n \\Think\\Log::write('点播回调成功 success');\n $this->_handle($res);\n }\n }",
"public function getEvent() {\n\t}",
"public function handle()\n {\n $this->fire();\n }",
"public function handle()\n {\n $this->fire();\n }",
"public function handle(EventInterface $event): void;",
"protected function event($event)\n {\n if(isset($this->events)) {\n $this->events->dispatch($event);\n }\n }",
"public function handleOpenEvent(object $message): void;",
"public function testFireEventWithInternalFiredEvent()\n {\n $eventManager = new EventManager;\n $event = 'foor.bar';\n $eventManager->listen(EventManager::FIRED, function ($newEvent) use ($event) {\n $this->assertEquals($newEvent, $event);\n });\n $eventManager->fire($event);\n }",
"public function process(array $event);",
"public function dispatchEvent($event);",
"public function handleDeliveryEvent(object $message): void;",
"public function until($event, $payload = []);",
"public function testComAdobeCqSocialActivitystreamsListenerImplEventListenerHandler()\n {\n $client = static::createClient();\n\n $path = '/system/console/configMgr/com.adobe.cq.social.activitystreams.listener.impl.EventListenerHandler';\n\n $crawler = $client->request('POST', $path);\n }",
"public function handleSendEvent(object $message): void;",
"private function handleEvent($event)\n {\n $bot = $this->adapter->bot($event['recipient']['id']);\n\n // If the page is not in our system, not active, or doesn't have a valid access token then do nothing.\n if (! $bot || ! $bot->enabled || is_null($bot->access_token)) {\n return;\n }\n\n if (config('sentry.dsn')) {\n app('sentry')->user_context(['bot_id' => $bot->_id]);\n }\n\n\n // If echo, then do nothing.\n if (array_get($event, 'message.is_echo')) {\n return;\n }\n\n // Get the subscriber who sent the message.\n $subscriber = $this->adapter->subscriber($event['sender']['id'], $bot);\n\n // If it is a delivery notification, then mark messages as delivered.\n if (array_get($event, 'delivery')) {\n if ($subscriber) {\n $this->adapter->markMessagesAsDelivered($subscriber, $event['delivery']['watermark']);\n }\n\n return;\n }\n\n // If it is a read notification, then mark messages as read.\n if (array_get($event, 'read')) {\n if ($subscriber) {\n $this->adapter->markMessagesAsRead($subscriber, $event['read']['watermark']);\n }\n\n return;\n }\n\n // If a text message is received\n if ($text = array_get($event, 'message.text')) {\n\n // Find a matching auto reply rule.\n /** @var AutoReplyRule $rule */\n $rule = $this->adapter->matchingAutoReplyRule($text, $bot);\n\n // If found\n if ($rule) {\n\n // If the auto reply rule is a subscription message, subscribe the user.\n if ($rule->subscribe) {\n $subscriber = $this->adapter->subscribe($bot, $event['sender']['id']);\n }\n\n // Otherwise, send the auto reply message.\n // But before then, if the current message sender is not a subscriber,\n // Subscribe them silently.\n if (! $subscriber) {\n $subscriber = $this->adapter->subscribeSilently($bot, $event['sender']['id']);\n }\n\n // If the auto reply rule is a unsubscription message, send the \"do you want to unsubscribe?\" message .\n if ($rule->unsubscribe) {\n $this->adapter->concludeUnsubscriptionProcess($bot, $subscriber);\n }\n\n $this->adapter->storeIncomingTextMessage($event, $bot, $subscriber);\n if ($rule->template_id) {\n $this->adapter->sendAutoReply($rule, $subscriber, $bot);\n }\n\n return;\n }\n\n // If no matching auto reply rule is found, then send the default reply.\n // But before then, if the current message sender is not a subscriber,\n // or if inactive subscriber, subscribe them silently.\n if (! $subscriber || ! $subscriber->active) {\n $subscriber = $this->adapter->subscribeSilently($bot, $event['sender']['id']);\n }\n $this->adapter->storeIncomingTextMessage($event, $bot, $subscriber);\n $this->adapter->sendDefaultReply($bot, $subscriber);\n\n return;\n }\n\n // Handle postbacks (button clicks).\n if (array_get($event, 'postback')) {\n $this->handlePostbackEvent($bot, $subscriber, $event);\n\n return;\n }\n\n // Handle optin (send to messenger plugin)\n if (array_get($event, 'optin')) {\n $payload = array_get($event, 'optin.ref');\n $subscriber = $this->adapter->subscribeBotUser($payload, $bot, $event['sender']['id']);\n $this->adapter->storeIncomingOptInMessage($event, $bot, $subscriber);\n\n return;\n }\n\n // account_linking\n // referal\n }",
"private function processAny($listener,$e) {\n if($e->name == $listener[0] && $this->isWithin()) {\n $this->emit($listener[1],$e);\n }\n }",
"public function onEvent(Event $event) {\n\t\tif ($this->runtimeContext) {\n\t\t\t$this->workflowActivity->onEvent($this->runtimeContext, $event);\n\t\t}\n\t}",
"public function handle($event)\n {\n $this->handledEvents[] = $event;\n }",
"public function listen();",
"public function __construct()\n {\n// global $callback;\n // $this->eventsArr = $eventsArr;\n $this->callback = function () {\n\n // echo \"event: message\\n\"; // for onmessage listener\n echo \"event: ping\\n\";\n $curDate = date(DATE_ISO8601);\n echo 'data: {\"time\": \"' . $curDate . '\"}';\n echo \"\\n\\n\";\n\n while (($event = ServerSentEvents::popEvent()) != null) {\n $m = json_encode($event->contents);\n echo \"event: $event->event\\n\";\n echo \"data: $m\";\n echo \"\\n\\n\";\n }\n // echo \"event: message\\n\";\n // $curDate = date(DATE_ISO8601);\n // echo 'data: {\"message-time\": \"' . $curDate . '\"}';\n // echo \"\\n\\n\";\n // while(true){\n // if ($index != $this->eventsCounter){\n // ServerSentEvents::sendEvent($this->event, $this->eventBody);\n // $index = $this->eventsCounter;\n // }\n\n // sleep(1);\n // }\n };\n\n $this->setupResponse();\n }",
"public function enqueueEvent(& $event)\n {\n while (true) {\n try {\n $id = $this->redis()->lpush('icinga:events', $event);\n Logger::debug('(icingadb) Stored id %d', $id);\n return;\n } catch (Exception $e) {\n Logger::error(\n '(icingadb) Could not enqueue event to redis, will retry: %s',\n $e->getMessage()\n );\n $this->redis = null;\n sleep(5);\n }\n }\n }",
"public function timerEvent()\n {\n echo 'timer is triggered',\"\\n\";\n }",
"public function triggerEvent(Webhook $webhook, $event);",
"public function testComAdobeCqSocialScoringImplScoringEventListener()\n {\n $client = static::createClient();\n\n $path = '/system/console/configMgr/com.adobe.cq.social.scoring.impl.ScoringEventListener';\n\n $crawler = $client->request('POST', $path);\n }",
"public function fire($event, $context = null);",
"public function event_part($who)\r\n\t{\r\n\t\r\n\t}",
"function test(...$params){\n // pass event to callback function\n\n print_r($params[0]);\n print_r(\"EVENT TYPE: \" . $params[1] . PHP_EOL . PHP_EOL);\n\n}",
"public function add_event($_data){\r\n\t\t$args=$this->create_args($_data);\r\n\t\treturn($this->execute('add_event',$args));\r\n\t}",
"public function on($resource);",
"public function subscription(): EventSubscription;",
"public function onRead();",
"private function onJoin()\n {\n $payload = $this->clientEvent->getPayload();\n\n if ($this->authUserByToken($payload['token'] ?? null)) {\n $this->send($this->replyEvent());\n\n $this->send(\n (new StateContentEvent(\n $this->getService('quest.quest_manager')->getStateData($this->getUserId())\n ))\n );\n }\n }",
"public function handle()\n {\n /**\n * @var EventExternalServiceClientInterface $eventServiceClient\n */\n $eventServiceClient = $this->container->make(EventExternalServiceClientInterface::class);\n\n /**\n * EventRepositoryInterface $eventRepository\n */\n $eventRepository = $this->container->make(EventRepositoryInterface::class);\n\n /**\n * @var EventServiceInterface $eventService\n */\n $eventService = $this->container->make(EventServiceInterface::class);\n\n $maxEventFiredAtDateTime = $eventRepository->maxFiredAtDateTime();\n\n // Seems like database is empty\n if (!$maxEventFiredAtDateTime) {\n // Load events right from this moment. Why not?\n $maxEventFiredAtDateTime = Carbon::now();\n }\n\n // Get new events from event source\n $newRemoteEvents = $eventServiceClient->requestFromDateTime($maxEventFiredAtDateTime);\n\n // Save new events into local database\n $newRemoteEvents->each(function ($currentNewEvent) use ($eventService) {\n try {\n $eventService->createFromExternalEvent($currentNewEvent);\n } catch (Exception $e) {\n // Problem with event importing\n // @TODO add detailed handling depended on exception type\n $this->warn($e->getMessage());\n }\n });\n\n $this->line($newRemoteEvents->count().' new events has been imported');\n }",
"public function fireEvent($eventName) {}"
] | [
"0.7095668",
"0.68771863",
"0.6450573",
"0.6068666",
"0.6022814",
"0.5878104",
"0.586045",
"0.5812004",
"0.57465065",
"0.57465065",
"0.5740143",
"0.5684522",
"0.5684522",
"0.56244224",
"0.5610733",
"0.55903774",
"0.558764",
"0.5585721",
"0.5573259",
"0.55688536",
"0.55658704",
"0.55597675",
"0.5540328",
"0.5530185",
"0.5526172",
"0.5505707",
"0.547787",
"0.54713434",
"0.54548275",
"0.54480463",
"0.54379016",
"0.54287",
"0.5414982",
"0.54141587",
"0.54098773",
"0.54039097",
"0.53922355",
"0.5391221",
"0.5390824",
"0.5367678",
"0.53658444",
"0.5363734",
"0.5355108",
"0.53485864",
"0.5336717",
"0.5304968",
"0.530221",
"0.52843684",
"0.5266228",
"0.5252051",
"0.5251735",
"0.5248345",
"0.52469873",
"0.52440834",
"0.52421165",
"0.52401763",
"0.5238508",
"0.52381635",
"0.5234741",
"0.5230273",
"0.5227036",
"0.5227036",
"0.52017885",
"0.5200616",
"0.5197666",
"0.5191404",
"0.5187938",
"0.51819915",
"0.5181551",
"0.5181551",
"0.51805526",
"0.51709974",
"0.5170167",
"0.516969",
"0.5158333",
"0.5155003",
"0.5146687",
"0.514509",
"0.5143192",
"0.51406705",
"0.5139033",
"0.5132809",
"0.5128355",
"0.5123245",
"0.512293",
"0.51214194",
"0.5117692",
"0.5115647",
"0.5109356",
"0.5105758",
"0.50995654",
"0.50981164",
"0.50961316",
"0.5095377",
"0.50949144",
"0.508236",
"0.5076959",
"0.5070116",
"0.50664544",
"0.50618815"
] | 0.5463325 | 28 |
Methods Construct Returns connection | public function __construct($db_server, $db_username, $db_password, $db_name, $table, $condition=false)
{
// Set Internal Variables
$this->db_server = $db_server;
$this->db_username = $db_username;
$this->db_password = $db_password;
$this->db_name = $db_name;
$this->table = $table;
$this->condition = $condition;
// Connection @params 'Server', 'Username', 'Password'
$this->connection = mysqli_connect($this->db_server, $this->db_username, $this->db_password, $this->db_name);
// Display Friend Error Message On Connection Failure
if(!$this->connection)
{
die('Could not connect: ' . mysqli_error($this->connection));
}
// Internal UTF-8
mysqli_query($this->connection, "SET NAMES 'utf8'");
mysqli_query($this->connection, 'SET character_set_connection=utf8');
mysqli_query($this->connection, 'SET character_set_client=utf8');
mysqli_query($this->connection, 'SET character_set_results=utf8');
// Run The Query
if($this->condition == false)
{
$this->result = mysqli_query($this->connection, "SELECT * FROM $this->table ");
} else {
$this->result = mysqli_query($this->connection, "SELECT * FROM $this->table WHERE $this->condition");
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function __construct()\r\n\t{\r\n\t\t$conn= new connection();\r\n return $this->conn;\r\n }",
"function __construct() {\n $this->createConnection();\n }",
"private function __construct() {\r\n $this->dbName = self::$_dbname;\r\n $this->username = self::$_username;\r\n $this->password = self::$_password;\r\n $this->hostname = self::$_hostname; \r\n\t return $this->connect();\r\n }",
"function __construct() {\n $connection= new Connection;\n $this->link = $connection->conect();\n }",
"public function __construct() {\n $this->connection = $this->create_connection();\n }",
"function __construct()\n\t\t{\n\t\t\t$this->conn = $this->connect();\n\t\t}",
"public function __construct()\n {\n $this->db_host = getConfig('db_host');\n $this->db_username = getConfig('db_username');\n $this->db_password = getConfig('db_password');\n $this->db_name = getConfig('db_name');\n\n try {\n $conn_string = \"mysql:host=\" . $this->db_host . \";dbname=\" . $this->db_name;\n $pdo = new \\PDO($conn_string, $this->db_username, $this->db_password);\n $pdo->setAttribute(\\PDO::ATTR_ERRMODE, \\PDO::ERRMODE_EXCEPTION);\n $this->connection = $pdo;\n\n return $this->connection;\n } catch (\\PDOException $e) {\n die(\"Connection failed: \" . $e->getMessage());\n }\n }",
"private function __construct(){\n\t\t$this->connection = new Connection();\n\t\t$this->connection\n\t\t\t->setHost(Stack::getInstance()->get('db_host'))\n\t\t\t->setUser(Stack::getInstance()->get('db_user'))\n\t\t\t->setPassword(Stack::getInstance()->get('db_pass'))\n\t\t\t->setDatabase(Stack::getInstance()->get('db_table'))\n\t\t\t->connect();\n\t}",
"public function getConnection();",
"public function getConnection();",
"public function getConnection();",
"public function getConnection();",
"public function getConnection();",
"public function getConnection();",
"public function getConnection();",
"public function getConnection();",
"public function getConnection();",
"public function getConnection();",
"public function getConnection();",
"public function getConnection();",
"function __construct()\n {\n $this->createConnection();\n\n }",
"public function make()\r\n {\r\n\t// Create connection\r\n return $this->conn;\r\n }",
"public function __construct(){\n $database = new Database();\n $db = $database->getConnection();\n \n $this->conn = $db;\n }",
"function __construct() {\n $this->open_connection();\n }",
"public function get_connection()\n {\n }",
"abstract public function getConnection();",
"public function make()\n {\n $connection = ConnectionFactory::getConnection($this->type);\n $connection->setAddress($this->address);\n return $connection;\n }",
"public function __construct(){\r\n $this->conn = $this->getConnection();\r\n }",
"function __construct()\n {\n $con_obj = new ConnectionClass();\n $this->con = $con_obj->getConnection();\n }",
"private function __construct() {\n\t\ttry {\n\t\t\tself::$conn = new PDO(\"mysql:host=localhost;dbname=dutchscout_ds\", \"dutchscout_ds\", \"XqqCNaB5\");\n\t\t\t\n\t\t\treturn self::$conn;\n\t\t} catch (PDOException $e) {\n\t\t\tprint(\"Error connection to database: \".$e->getMessage());\n\t\t}\n\t}",
"public function __construct() {\n\t\t$this->db = MySQLConnectivity::get_instance();\n\t\t$this->conn = $this->db->get_connection(); \n\t}",
"public function __construct( )\n {\n $this->openConnection();\n }",
"public function __construct(){\n\n // If the connection to server has already been made this will return a instance without creating a new connection to the server\n if(!isset(static::$serverConnection)) {\n\n // If connection to server is not established, new connection will be made and instance will be stored in $serverConnection property\n $dbConnection = new DBConnect();\n static::$serverConnection = $dbConnection->serverInstance();\n }\n\n // Will return the instance of the database aka server connection\n return static::$serverConnection;\n }",
"public function __construct() {\n $db = new Connection();\n $this->conn = $db->connect();\n }",
"function __construct() {\n $this->_connect();\n }",
"function __construct()\n {\n $this->connect();\n }",
"function __construct(){\n $this->open_connection();\n }",
"public function __construct(){\n $database = new Database();\n $db = $database->getConnection();\n $this->conn = $db;\n }",
"public function __construct(){\n $database = new Database();\n $db = $database->getConnection();\n $this->conn = $db;\n }",
"function __construct(){\n\t\t\n\t\t//\n\t\t$this->connect = new mysqli($this->dbservername,$this->dbusername,$this->dbpassword,$this->dbname);\n\t\t\n\t\t//if connection error\n\t\tif($this->connect->connect_error){\n\t\t\techo \"connection error\";\n\t\t\t\n\t\t//when connection will be ok\t\n\t\t}else {\n\t\t\treturn $this->connect;\n\t\t\t\n\t\t} //else close\n\t\t\n\t}",
"function __construct() {\n $connector = new DbConnection();\n $conn = $connector->connect(); \n }",
"public function getConnection(){\n\t\tif(!isset($this->connection)){\n\t\t\t$this->connection = $this->connect($this->connectionParams);\n\t\t}\n\n\t\treturn $this->connection;\n\t}",
"private function __construct()\n {\n $this->connect();\n }",
"public function __construct(){\n\t\t$database = new Database();\n\t\t$db = $database->getConnection();\n $this->conn = $db;\n }",
"public function __construct()\n {\n $this -> connection = $this ->connecdatabase();\n }",
"public function __construct(){\n $this->connection = new Connection();\n\t}",
"protected function createConnection()\n {\n return new ModernConnection();\n }",
"public abstract function Connect();",
"protected function __construct(){\n if (!is_object(self::$connector)) {\n \n if(isset(self::$config['socket']) && !empty(self::$config['socket'])){\n $connectionString = self::$config['socket'].\";dbname=\".self::$config['base'];\n }else{\n $connectionString = self::$config['type'].\":host=\".self::$config['host'].\";dbname=\".self::$config['base'];\n }\n \n $username = self::$config['log'];\n $password = self::$config['pass'];\n \n try{\n $connector = new PDO($connectionString, $username, $password);\n $connector->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n $connector->query(\"SET NAMES utf8\");\n $this->setConnector($connector);\n }catch(Exception $e){\n //if the ORM is used with the Jet framework, use the Log class\n if(class_exists('Log')){\n Log::fatal($e);\n }else{\n trigger_error($e->getMessage(), E_USER_ERROR);\n }\n }\n }\n }",
"public function createConnection()\n {\n $client = DatabaseDriver::create($this->getConfig());\n\n return $client;\n }",
"function create_connection(){\n\t\t$this->dbconn =& new DBConn();\r\n\t\tif($this->dbconn == NULL)\r\n\t\t\tdie('Could not create connection object');\n\t}",
"private function Connect() {\n $this->Conn = parent::getConn();\n $this->Create = $this->Conn->prepare($this->Create);\n }",
"private function Connect(){\n $this->Conn = parent::getConn();\n $this->Create = $this->Conn->prepare($this->Create);\n }",
"public function getConnection()\n {\n if (!self::$connection) {\n $connectionClass= $this->getConnectionClass();\n $auth = $this->getAuthentication();\n self::$connection = new $connectionClass($auth, $this->getServiceNet());\n }\n return self::$connection;\n }",
"function __construct(){\n\n\t\t $this->connect() ;\n\t}",
"function __construct()\n\t{\n\t\t// Set connection and store it in self::$link\n\t\tself::$link = Connection::setConnect();\n\t}",
"public function __construct() {\r\n $this->conn = PersistentManager::getInstance()->get_connection();\r\n }",
"public static function makeConnection()\n {\n self::$connectionManager = new ConnectionManager();\n self::$connectionManager->addConnection([\n 'host' => self::$config['host'],\n 'user' => self::$config['user'],\n 'password' => self::$config['password'],\n 'dbname' => self::$config['dbname']\n ]);\n self::$connectionManager->bootModel();\n }",
"public function __construct(){\n //$this variable points at itself\n $this->conn = new mysqli($this->servername, $this->username, $this->password, $this->database);\n if($this->conn->connect_error){\n die(\"Connection Error: \". $this->conn->connect_error);\n }\n return $this->conn;\n }",
"private function __construct()\n \n {\n $config = Config::getConfig(); // set singleton config object\n $host = $this->host = Config::getKeys('host');\n $user = $this->username = Config::getKeys('username');\n $password = $this->password = Config::getKeys('password');\n $database = $this->db = Config::getKeys('db');\n $this->newConnection($host, $user, $password, $database);\n // return $dbid; //dbid to the registrey\n \n }",
"public function __constructor() {\n //la variabile debug mi distingue i casi online o offline\n \n //return $this->getConnection();\n }",
"function establish_connection() {\n\t \t\tself::$db = Registry()->db = SqlFactory::factory(Config()->DSN);\n\t \t\tself::$has_update_blob = method_exists(self::$db, 'UpdateBlob');\n\t\t\treturn self::$db;\n\t\t}",
"public function connect()\n\t{\n\t\tif (empty($this->connection)) {\n \t$this->connection = new PDO(\"mysql:host={$this->host}:{$this->port};dbname={$this->db_name}\", $this->username, $this->password);\n \t$this->connection->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n\t\t}\n\n return $this;\n\t}",
"public function __construct() {\n\n return $this->mySQLConnect();\n }",
"public function connect() {\n\n\t\t$db_info_string = $this->_db_info[0]. ':host=' . $this->_db_info[1] . ';';\n\t\t$db_info_string .= 'dbname='. $this->_db_info[4]; \n\n\t\ttry {\n\t\t\t$this->_db = new pdo($db_info_string, $this->_db_info[2], $this->_db_info[3] );\n\n\t\t//set Error mode to send out exceptions\n\t\t$this->_db->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION ); \n\n\t\t} catch (PDOException $e) {\n\t\t\t//TODO Custom error reporting\n\t\t\techo $e->getMessage();\n\t\t}\n\n\t\t//TODO ATTEMPT TO CONNECT, IF PDO OBJECT CANNOT BE CREATED, return \n\t\t//false and use custome error reporting\n\t\t//TRY, CATCH that jazz tooo\n\t\t\n\t\t//Returns the object so that it can be chained\n\t\treturn $this;\n }",
"public function getConnection(): Connection;",
"function connect(){\r\n // Create connection\r\n $conn = Connexion::GetConnexion();\r\n // Check connection\r\n if ($conn->connect_error) {\r\n die(\"Connection failed: \" . $conn->connect_error);\r\n } \r\n return $conn;\r\n\t}",
"function getConnection();",
"public function _Connect() {\t\t\n\t\tif($this->_connection) { $this->_Disconnect(); } \n\t\ttry {\t\t\t\n\t\t\t// GET CONFIGURATION\n\t\t\t$config = $this->_config;\n\t\t\tif(!$config) $this->_RenderError(XUXO_ERROR_CODE_004.': CONFIG IS NOT SET');\n\t\t\tif(!$config['USE']) return NULL;\t\t\t\n\t\t\t// GET PATH\n\t\t\tif ($a = Xuxo_Application::$_instance) {\n\t\t\t\t$path = $a->_GetBaseUrl(true).DIR_SEPARATOR.$config['HOST'];\n\t\t\t} else {\n\t\t\t\t$path = str_replace('\\\\',DIR_SEPARATOR,realpath(dirname(__FILE__))).$config['HOST'];\n\t\t\t}\n\t\t\t// CREATE PATH IF NOT EXISTED\n\t\t\tif(!file_exists($path)) { mkdir($path,0777); }\n\t\t\t// SET PERMISSION\n\t\t\t$this->_SetPermission($path);\n\t\t\t// GET SQLITE FILE\n\t\t\t$path .= DIR_SEPARATOR.$config['NAME'].\".sqlite\";\n\t\t\tif(!file_exists($path)) $this->_RenderError('SQLITE FILE DOES NOT EXIST','XUXO_ERROR_CODE_005');\n\t\t\t// CONNECTION\n\t\t\t$conndb = \"sqlite:\".$path;\t\t\t\n\t\t\t$this->_connection = new PDO($conndb);\n\t\t\tunset($conndb);\n\t\t\t// RETURN\n\t\t\tif (!$this->_connection) $this->_RenderError('FAIL TO CONNECT', 'XUXO_ERROR_CODE_004');\n\t\t\tif(!$this->_auto_commit && !$this->_begin) {\n\t\t\t\t$this->_connection->beginTransaction();\n\t\t\t\t$this->_begin = true;\n\t\t\t}\n\t\t\treturn $this->_connection;\n\t\t} catch (Exception $e) {\n\t\t\t$this->_RenderError('UNABLE TO CONNECT - '.$e->getMessage(), 'XUXO_ERROR_CODE_004');\n\t\t}\n\t}",
"public abstract function connect();",
"public function createConnection() {\n // below code is used to create connection usinf Orientdb\n $client = new PhpOrient($this->config['host'],$this->config['port']);\n $client->username = $this->config['username'];\n $client->password = $this->config['password'];\n if(Cache::has('odb_session_token')) {\n $client->setSessionToken(Cache::get('odb_session_token'));\n\n }else {\n $client->setSessionToken(true);\n Cache::forever('odb_session_token',$client->getSessionToken());\n }\n if($client->connect()){\n $this->clusterMap= $client->dbOpen( $this->config['database'], $this->config['username'], $this->config['password']);\n }\n return $client;\n }",
"public final function getConnection() {\n\t\t//If the connection has not been established yet, create it\n\t\tif($this->connection === null) {\n\t\t\t//connect to mySQL and provide the interface to PHPUnit\n\n\t\t\t$config = readConfig(\"/etc/apache2/capstone-mysql/jpegery.ini\");\n\t\t\t$pdo = connectToEncryptedMySQL(\"/etc/apache2/capstone-mysql/jpegery.ini\");\n\t\t\t$this->connection = $this->createDefaultDBConnection($pdo, $config[\"database\"]);\n\t\t}\n\t\treturn($this->connection);\n\t}",
"public function getConnect()\n {\n $this->conn = Registry::get('db');\n }",
"private function createConnection()\n {\n\n //Pull db credentials from a .ini file in the private folder.\n $config = parse_ini_file('db.ini');\n\n $username = $config['username'];\n $password = $config['password'];\n $hostName = $config['servername'];\n $dbName = $config['dbname'];\n $dsn = 'mysql:host=' . $hostName . ';dbname=' . $dbName . ';';\n\n\n try {\n\n //Create connection\n $this->db = new PDO($dsn, $username, $password);\n $this->db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n } catch (PDOException $e) {\n\n $error_message = $e->getMessage();\n echo $error_message;\n }\n }",
"public function __construct()\n {\n $this->con = new mysqli($this->servername, $this->username, $this->password, $this->database);\n if(mysqli_connect_error())\n {\n trigger_error(\"Not possible to connect to MySQL: \".mysqli_connect_error());\n }\n else\n {\n \n return $this->con;\n }\n }",
"public function __construct()\n\t{\n\t\t$this->connectOpen();\n\t}",
"public function connect() {\n\t\t$cnn_string = 'host='.$this->_dbhost.' port='.$this->_dbport.' user='.$this->_dbuser.' password='.$this->_dbpass.' dbname='.$this->_dbname;\n\t\t\n\t\t$this->_instance = pg_connect($cnn_string) or PK_debug(__FUNCTION__, \"No se ha podido conectar con la DB\\n\\n\".pg_errormessage(), array('class'=>'error'));\n\t\t\n\t\tif (!$this->_instance) {\n\t\t\techo '<h1>Error en la aplicacion</h1><p>No se ha podido conectar con la base de datos</p>';\n\t\t\tPK_debug('', '', 'output');\n\t\t\texit();\n\t\t}\n\t\t\n\t\treturn $this->_instance;\n\t}",
"private function getConnection()\n {\n if (!$this->getChanel()) {\n $this->_connect = new \\PhpAmqpLib\\Connection\\AMQPConnection($this->host, $this->port, $this->login, $this->password, $this->vhost);\n }\n\n return $this->getChanel();\n }",
"public function getConnection(){\n \n \n $this->db_conn = OCILogon($this->username, $this->password,$this->db_name); \n \n return $this->db_conn;\n }",
"public function __construct() {\n // Making a connection with the database\n $database = new Database();\n $this->conn = $database->getConnection();\n }",
"protected function openConn() {\n $database = new Database();\n $this->conn = $database->getConnection();\n }",
"public function connect();",
"public function connect();",
"public function connect();",
"public function connect();",
"public function connect();",
"public function connect();",
"public function connect();",
"public function connect();",
"public function connect();",
"public function connect();",
"public function connect();",
"public function getConnection(){\n \n $this->conn = null;\n \n try{\n $this->conn = new PDO(\"mysql:host=\" . $this->host . \";dbname=\" . $this->db_name, $this->username, $this->password);\n $this->conn->exec(\"set names utf8\");\n }catch(PDOException $exception){\n echo \"Connection error: \" . $exception->getMessage();\n }\n \n return $this->conn;\n }",
"public function getConnection(){\n \n $this->conn = null;\n \n try{\n $this->conn = new PDO(\"mysql:host=\" . $this->host . \";dbname=\" . $this->db_name, $this->username, $this->password);\n $this->conn->exec(\"set names utf8\");\n }catch(PDOException $exception){\n echo \"Connection error: \" . $exception->getMessage();\n }\n \n return $this->conn;\n }",
"public function connect()\n {\n $config = $this->config;\n $config = array_merge($this->_baseConfig, $config);\n\n $conn = \"DATABASE='{$config['database']}';HOSTNAME='{$config['host']}';PORT={$config['port']};\";\n $conn .= \"PROTOCOL=TCPIP;UID={$config['username']};PWD={$config['password']};\";\n\n if (!$config['persistent']) {\n $this->connection = db2_connect($conn, PGSQL_CONNECT_FORCE_NEW);\n } else {\n $this->connection = db2_pconnect($conn);\n }\n $this->connected = false;\n\n if ($this->connection) {\n $this->connected = true;\n $this->query('SET search_path TO '.$config['schema']);\n }\n if (!empty($config['charset'])) {\n $this->setEncoding($config['charset']);\n }\n\n return $this->connection;\n }",
"public function openConnection(){\n try {\n $this->con = new PDO (\n $this->server,\n $this->user,\n $this->password, \n $this->options\n );\n \n return $this->con;\n } catch (PDOException $error) {\n echo \"Error connection: \".$error->getMessage();\n }\n }",
"public function startConnection() {\n\t\t\n\t\ttry {\n\t\t\t$this->_connection = new PDO('mysql:host='.$this->_dbhost.';dbname='.$this->_dbname, $this->_dbusername, $this->_dbpassword,array(PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8', PDO::ATTR_ERRMODE => PDO::ERRMODE_WARNING));\n\t\t}\n\t\tcatch(PDOexception $e) {\n\t\t\tdie(\"Une erreur est survenue lors de la connexion à la base de données : \" . $e->getMessage());\n\t\t}\n\t\t\n\t\treturn $this->_connection;\n\t\t\n\t}",
"protected function connect() {}",
"public function getConnection()\n {\n if($this->connection === null) {\n $this->connect();\n }\n return parent::getConnection();\n }",
"abstract public function connect();",
"abstract public function connect();"
] | [
"0.80526924",
"0.77259594",
"0.7710563",
"0.76854634",
"0.76388276",
"0.76192886",
"0.7615854",
"0.7602808",
"0.75479066",
"0.75479066",
"0.75479066",
"0.75479066",
"0.75479066",
"0.75479066",
"0.75479066",
"0.75479066",
"0.75479066",
"0.75479066",
"0.75479066",
"0.75479066",
"0.7516223",
"0.7498752",
"0.7391916",
"0.7390992",
"0.7363237",
"0.73623663",
"0.7361982",
"0.73597765",
"0.7353116",
"0.7332369",
"0.7268876",
"0.7264184",
"0.72570425",
"0.72439975",
"0.72419536",
"0.7235304",
"0.722863",
"0.72240037",
"0.72240037",
"0.7212432",
"0.7207072",
"0.7205697",
"0.7202142",
"0.7195116",
"0.7183473",
"0.71751183",
"0.7162968",
"0.7162603",
"0.71448874",
"0.712936",
"0.71253204",
"0.71243894",
"0.7117689",
"0.7107275",
"0.70952326",
"0.7063307",
"0.7056674",
"0.7044212",
"0.7041406",
"0.7037609",
"0.703463",
"0.7032198",
"0.703061",
"0.7030242",
"0.7027009",
"0.7023601",
"0.70205975",
"0.7020066",
"0.70099735",
"0.70039064",
"0.69995767",
"0.6998278",
"0.6995746",
"0.6992095",
"0.69804174",
"0.6979237",
"0.6970052",
"0.69642043",
"0.6958277",
"0.69548255",
"0.6930298",
"0.69268256",
"0.69268256",
"0.69268256",
"0.69268256",
"0.69268256",
"0.69268256",
"0.69268256",
"0.69268256",
"0.69268256",
"0.69268256",
"0.69268256",
"0.69239604",
"0.69239604",
"0.6920662",
"0.6915261",
"0.6912708",
"0.6912231",
"0.6908226",
"0.6906421",
"0.6906421"
] | 0.0 | -1 |
Function To Transform MySQL Results To jQuery Calendar Json Returns converted json | public function json_transform($js = true)
{
while($this->row = mysqli_fetch_array($this->result, MYSQL_ASSOC))
{
// Set Variables Data from DB
$event_id = $this->row['id'];
$event_title = $this->row['title'];
$event_description = $this->row['description'];
$event_start = $this->row['start'];
$event_end = $this->row['end'];
$event_allDay = $this->row['allDay'];
$event_color = $this->row['color'];
$event_url = $this->row['url'];
if($js == true)
{
// JS MODE
// When allDay = false the allDay options appears on the script, when its true it doesnot appear
if($event_url == 'false' && $event_allDay == 'false')
{
// Build it Without URL & allDay
// Stores Each Database Record To An Array (Without URL)
$build_json = array('id' => $event_id, 'title' => $event_title, 'description' => $event_description, 'start' => $event_start, 'end' => $event_end, 'allDay' => $event_allDay, 'color' => $event_color);
// Adds Each Array Into The Container Array
array_push($this->json_array, $build_json);
} elseif($event_url == 'false' && $event_allDay == 'true') {
// Build it Without URL
// Stores Each Database Record To An Array (Without URL)
$build_json = array('id' => $event_id, 'title' => $event_title, 'description' => $event_description, 'start' => $event_start, 'end' => $event_end, 'color' => $event_color);
// Adds Each Array Into The Container Array
array_push($this->json_array, $build_json);
} elseif($event_url == 'true' && $event_allDay == 'false') {
// Built it Without URL & allDay True
// Stores Each Database Record To An Array
$build_json = array('id' => $event_id, 'title' => $event_title, 'description' => $event_description, 'start' => $event_start, 'end' => $event_end, 'allDay' => $event_allDay, 'color' => $event_color, 'url' => $event_url);
// Adds Each Array Into The Container Array
array_push($this->json_array, $build_json);
} else {
if($event_allDay == 'false') {
// Built it With URL & allDay false
// Stores Each Database Record To An Array
$build_json = array('id' => $event_id, 'title' => $event_title, 'description' => $event_description, 'start' => $event_start, 'end' => $event_end, 'allDay' => $event_allDay, 'color' => $event_color, 'url' => $event_url);
// Adds Each Array Into The Container Array
array_push($this->json_array, $build_json);
} else {
// Built it With URL & allDay True
// Stores Each Database Record To An Array
$build_json = array('id' => $event_id, 'title' => $event_title, 'description' => $event_description, 'start' => $event_start, 'end' => $event_end, 'color' => $event_color, 'url' => $event_url);
// Adds Each Array Into The Container Array
array_push($this->json_array, $build_json);
}
}
} else {
// PHP MODE
// When allDay = false the allDay options appears on the script, when its true it doesnot appear
if($event_url == 'false' && $event_allDay == 'false')
{
// Build it Without URL & allDay
// Stores Each Database Record To An Array (Without URL)
$build_json = array('id' => $event_id, 'title' => $event_title, 'description' => $event_description, 'start' => $event_start, 'end' => $event_end, 'allDay' => $event_allDay, 'color' => $event_color);
// Adds Each Array Into The Container Array
array_push($this->json_array, $build_json);
} elseif($event_url == 'false' && $event_allDay == 'true') {
// Build it Without URL
// Stores Each Database Record To An Array (Without URL)
$build_json = array('id' => $event_id, 'title' => $event_title, 'description' => $event_description, 'start' => $event_start, 'end' => $event_end, 'color' => $event_color);
// Adds Each Array Into The Container Array
array_push($this->json_array, $build_json);
} elseif($event_url == 'true' && $event_allDay == 'false') {
// Built it Without URL & allDay True
// Stores Each Database Record To An Array
$build_json = array('id' => $event_id, 'title' => $event_title, 'description' => $event_description, 'start' => $event_start, 'end' => $event_end, 'allDay' => $event_allDay, 'color' => $event_color, 'url' => $event_url);
// Adds Each Array Into The Container Array
array_push($this->json_array, $build_json);
} else {
if($event_allDay == 'false' && substr($event_url, -4, 1) == '.' || substr($event_url, -3, 1) == '.') { // domain top level checking
// Built it With URL & allDay false
// Stores Each Database Record To An Array
$build_json = array('id' => $event_id, 'title' => $event_title, 'description' => $event_description, 'start' => $event_start, 'end' => $event_end, 'allDay' => $event_allDay, 'color' => $event_color, 'url' => $event_url);
// Adds Each Array Into The Container Array
array_push($this->json_array, $build_json);
} elseif($event_allDay == 'true' && substr($event_url, -4, 1) == '.' || substr($event_url, -3, 1) == '.') {
// Built it With URL & allDay true
// Stores Each Database Record To An Array
$build_json = array('id' => $event_id, 'title' => $event_title, 'description' => $event_description, 'start' => $event_start, 'end' => $event_end, 'color' => $event_color, 'url' => $event_url);
// Adds Each Array Into The Container Array
array_push($this->json_array, $build_json);
} elseif($event_allDay == 'false' && isset($event_url)) {
// Built it With any URL and allDay false
// Stores Each Database Record To An Array
$build_json = array('id' => $event_id, 'title' => $event_title, 'description' => $event_description, 'start' => $event_start, 'end' => $event_end, 'allDay' => $event_allDay, 'color' => $event_color, 'url' => $event_url . $event_id);
// Adds Each Array Into The Container Array
array_push($this->json_array, $build_json);
} else {
// Built it With URL & allDay True
// Stores Each Database Record To An Array
$build_json = array('id' => $event_id, 'title' => $event_title, 'description' => $event_description, 'start' => $event_start, 'end' => $event_end, 'color' => $event_color, 'url' => $event_url . $event_id);
// Adds Each Array Into The Container Array
array_push($this->json_array, $build_json);
}
}
}
} // end while loop
// Output The Json Formatted Data So That The jQuery Call Can Read It
return json_encode($this->json_array);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getAppointmentsListJSON() {\nglobal $_LW;\n$output=[];\nforeach($_LW->dbo->query('select', 'id, title', 'livewhale_appointments', false, 'title ASC')->run() as $res2) { // loop through and add appointments\n\t$output[]=['id'=>$res2['id'], 'title'=>$res2['title']];\n};\nreturn json_encode($output);\n}",
"function GetEventsJsForCalendar($frontend=true)\r\n\t{\r\n\t\tglobal $_SETTINS;\r\n\r\n\t\t// SELECT EVENTS\r\n\t\t$select = \t\"SELECT * FROM events \".\r\n\t\t\t\t\t\"WHERE events.active='1' \".\r\n\t\t\t\t\t\"\".$_SETTINGS['demosqland'].\" \".\r\n\t\t\t\t\t\"ORDER BY events.date DESC \";\r\n\t\t$result = doQuery($select);\t\t\t\r\n\t\t$num = mysql_num_rows($result);\r\n\t\t$i = 0;\r\n\t\twhile($i<$num){\r\n\t\t\t$row = mysql_fetch_array($result);\r\n\t\t\tif($i != 0){ $js .= \",\"; }\r\n\t\t\t$js .= \t\"{\";\r\n\t\t\t\r\n\t\t\t\t// TITLE CHECK\r\n\t\t\t\t$js .= \"title: '\".$row['title'].\"',\";\r\n\t\t\t\t$js .= \"description: '\".$row['description'].\"',\";\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t// GET FORMAT AND EXPLODE DATE\r\n\t\t\t\t$start_date = TimestampIntoDate($row['date']);\r\n\t\t\t\t$end_date = TimestampIntoDate($row['end_date']);\r\n\t\t\t\t$startArray = explode(\"/\",$start_date);\r\n\t\t\t\t$endArray = explode(\"/\",$end_date);\t\t\r\n\t\t\t\t$sy = $startArray[2];\r\n\t\t\t\t$sm = $startArray[0];\r\n\t\t\t\t$sd = $startArray[1];\t\t\t\r\n\t\t\t\t$ey = $endArray[2];\r\n\t\t\t\t$em = $endArray[0];\r\n\t\t\t\t$ed = $endArray[1];\r\n\t\t\t\t\r\n\t\t\t\t$js .= \"start: new Date(\".$sy.\", \".$sm.\"-1, \".$sd.\"),\";\r\n\t\t\t\t\r\n\t\t\t\tif($_POST['end_date'] == \"0000-00-00 00:00:00\" || $_POST['end_date'] == \"\"){\r\n\t\t\t\t\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$js .= \"end: new Date(\".$ey.\", \".$em.\"-1, \".$ed.\"),\";\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tif($frontend == true){\t\t\t\r\n\t\t\t\t\t$js .= \"url: 'http://\".$_SETTINGS['website'].$_SETTINGS['events_page_clean_url'].\"/'\";\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$js .= \"url: 'http://\".$_SETTINGS['website'].$_SETTINGS['events_page_clean_url'].\"/'\";\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t$js .= \"}\";\r\n\t\t\t$i++;\r\n\t\t}\r\n\t\t\r\n\t\t$js .=\t\"\";\r\n\t\treturn $js;\r\n\t\t\r\n\t\t/*\r\n\t\t{\r\n\t\t\ttitle: 'All Day Event',\r\n\t\t\tstart: new Date(y, m, 1)\r\n\t\t},\r\n\t\t{\r\n\t\t\ttitle: 'Long Event',\r\n\t\t\tstart: new Date(y, m, d-5),\r\n\t\t\tend: new Date(y, m, d-2)\r\n\t\t},\r\n\t\t{\r\n\t\t\tid: 999,\r\n\t\t\ttitle: 'Repeating Event',\r\n\t\t\tstart: new Date(y, m, d-3, 16, 0),\r\n\t\t\tallDay: false\r\n\t\t},\r\n\t\t{\r\n\t\t\tid: 999,\r\n\t\t\ttitle: 'Repeating Event',\r\n\t\t\tstart: new Date(y, m, d+4, 16, 0),\r\n\t\t\tallDay: false\r\n\t\t},\r\n\t\t{\r\n\t\t\ttitle: 'Meeting',\r\n\t\t\tstart: new Date(y, m, d, 10, 30),\r\n\t\t\tallDay: false\r\n\t\t},\r\n\t\t{\r\n\t\t\ttitle: 'Lunch',\r\n\t\t\tstart: new Date(y, m, d, 12, 0),\r\n\t\t\tend: new Date(y, m, d, 14, 0),\r\n\t\t\tallDay: false\r\n\t\t},\r\n\t\t{\r\n\t\t\ttitle: 'Birthday Party',\r\n\t\t\tstart: new Date(y, m, d+1, 19, 0),\r\n\t\t\tend: new Date(y, m, d+1, 22, 30),\r\n\t\t\tallDay: false\r\n\t\t},\r\n\t\t{\r\n\t\t\ttitle: 'Click for Google',\r\n\t\t\tstart: new Date(y, m, 28),\r\n\t\t\tend: new Date(y, m, 29),\r\n\t\t\turl: 'http://google.com/'\r\n\t\t}\r\n\t\t*/\r\n\t\t\r\n\t\t\r\n\t}",
"function get_dates($all=null){\r\n\t /* get status of the user \r\n\t * might not be necessary but could be useful later for the personalized calendar \r\n\t */\r\n /* $sql = \"SELECT status\r\n FROM `\".TABLE_PREFIX.\"members`\r\n WHERE `login`='\".$_SESSION['login'].\"'\";\r\n\t\t\t\t\t\r\n $result = mysql_query($sql,$db) or die(mysql_error());\r\n $row_count = mysql_num_rows($result);\r\n if($row_count > 0){\r\n $row = mysql_fetch_assoc($result);\r\n }\r\n\t */\r\n\tglobal $moduleFactory;\r\n\t$dates=array();\r\n $coursesmod = $moduleFactory->getModule(\"_core/courses\");\r\n $courses=$coursesmod->extend_date(); \r\n\t$assignmentsmod = $moduleFactory->getModule(\"_standard/assignments\");\r\n $assignments=$assignmentsmod->extend_date();\r\n\t$testsmod = $moduleFactory->getModule(\"_standard/tests\");\r\n $tests=$testsmod->extend_date();\r\n\t$dates['course']= $courses;\r\n\t$dates['assignments']=$assignments;\r\n\t$dates['tests']=\t$tests;\r\n\t//$dates[$_SESSION['course_id']]['assignments']=\t$assignments;\r\n echo(json_encode($dates));\r\n\t\t\t \r\n }",
"Public function getEvents()\n\t{\n\t\t$result=$this->M_calendar->getEvents();\n\t\techo json_encode($result);\n\t}",
"function fire_query_get_json() {\n $res = $this->fire_query();\n $res_arr = array();\n while($row = $res->fetch_array(MYSQL_ASSOC)) {\n $res_arr[] = $row;\n }\n return json_encode($res_arr);\n }",
"public static function initialize_calendar(){\n \n $event_array[] = array();\n $schedules = \\App\\Event::get();\n if(!empty($schedules)){\n foreach($schedules as $schedule){\n $event_array[] = array(\n 'id' => uniqid(),\n 'title' => $schedule->description,\n 'start' => date('Y-m-d', strtotime($schedule->event_date)),\n 'end' => date('Y-m-d', strtotime($schedule->event_date)),\n 'color' => \"lightblue\",\n \"textEscape\"=> 'false' ,\n 'textColor' => 'black',\n );\n }\n return $get_schedule = json_encode($event_array);\n }\n }",
"function thismonth(){\n\n $where = \"MONTH( reservation_startdate ) = MONTH( NOW() )\";\n\n $reservation = where( 'reservations', $where );\n\n echo json_encode( $reservation );\n exit;\n}",
"public function mostrarCalendarioCumpleaños(){\n\t\t$item1 = \"fch_nacimiento\";\n\t\tif($_POST[\"start\"] > $_POST[\"end\"] && $_POST[\"start\"] == 12){\n\t\t\t$inicio = 1;\n\t\t\t$fin = $_POST[\"end\"];\n\t\t}else if($_POST[\"start\"] > $_POST[\"end\"] && $_POST[\"end\"] == 1){\n\t\t\t$inicio = $_POST[\"start\"];\n\t\t\t$fin = 12;\n\t\t}else{\n\t\t\t$inicio = $_POST[\"start\"];\n\t\t\t$fin = $_POST[\"end\"];\n\t\t}\n $valor1 = $inicio.'|'.$fin;\n $item2 = $valor2 = $item3 = $valor3 = null;\n $entrada = \"calendarioCumpleaños\";\n $cumpleaños = ControladorTrabajador::ctrMostrarTrabajador($item1,$valor1,$item2,$valor2,$item3,$valor3,$entrada);\n if(count($cumpleaños) > 0){\n\t $datosJson = '[';\n\t\t\t\t \tfor ($i=0; $i < count($cumpleaños) ; $i++) {\n\t\t\t\t \t\t$fechaNacimiento = dateFormatCumpleanios($cumpleaños[$i][\"fch_nacimiento\"]);\n\t\t\t\t \t\t$datosJson .= '{\n\t\t\t\t\t\t\t\"nombre\" : \"'.$cumpleaños[$i][\"dsc_nombres\"].\" \".$cumpleaños[$i][\"dsc_apellido_paterno\"].\" \".$cumpleaños[$i][\"dsc_apellido_materno\"].'\",\n\t\t\t\t\t\t\t\"fecha\" : \"'.$fechaNacimiento.'\",\n\t\t\t\t\t\t\t\"imagen\" : \"'.$cumpleaños[$i][\"imagen\"].'\",\n\t\t\t\t\t\t\t\"cargo\" : \"'.$cumpleaños[$i][\"dsc_cargo\"].'\"\n\t\t\t\t\t\t},';\n\t\t\t\t\t}\t\t\t \t\n\t\t\t\t\t$datosJson = substr($datosJson, 0, -1);\n\t\t\t\t$datosJson .= ']';\t\n\t\t}else{\n\t\t\t$datosJson = '[\n\t\t\t\t{}\n\t\t\t]';\n\t\t}\n\t\techo $datosJson;\t\n\t}",
"public function outputFilterJSON() {\n $filters = array(\n 'os' => array('WINNT', 'Darwin'),\n 'date' => array()\n );\n \n $_dates = $this->db->query_stats(\"SELECT DISTINCT date FROM {$this->table} ORDER BY date DESC\");\n while ($date = mysql_fetch_array($_dates, MYSQL_ASSOC)) $filters['date'][] = $date['date'];\n \n echo json_encode($filters);\n }",
"function getEvents(){\r\n\t\t$this->db->select('*');\r\n\t\t$this->db->where(array('is_closed'=>false));\r\n\t\t$recordSet = $this->db->get(TBL_EVENTS);\r\n\t\t$events=$recordSet->result() ;\t\t\r\n\t\t//return json_encode($events);\r\n\t\tif (stristr($_SERVER[\"HTTP_ACCEPT\"],\"application/xhtml+xml\") ) {\r\n\t\t\t\theader(\"Content-type: application/xhtml+xml\"); } \r\n\t\telse{\r\n\t\t\t\theader(\"Content-type: text/xml\");\r\n\t\t}\r\n\t\t$xml=\"<?xml version=\\\"1.0\\\" encoding=\\\"utf-8\\\" ?>\";\r\n\t\t$xmlinner=\"\";\r\n\t\t$xmlinner=\"<newslist title=\\\"Event Calendar:\\\">\";\r\n\t\tforeach($events as $row){\r\n\t\t\t$xmlinner=$xmlinner.\"<news url=\\\"javascript:void(0)\\\" date='\".dateformat($row->event_date).\"' time='\".$row->event_time.\"'>\";\r\n\t\t\t$xmlinner=$xmlinner.\"<headline><![CDATA[\".$row->title.\"]]></headline>\";\r\n\t\t\t$xmlinner=$xmlinner.\"<detail><![CDATA[\".$row->venue.\"]]></detail>\";\r\n\t\t\t$xmlinner=$xmlinner.\"</news>\";\t\t\t\r\n\t\t}\r\n\t\t$xmlinner=$xmlinner.\"</newslist>\";\r\n\t\treturn $xml.$xmlinner;\r\n\t}",
"function json_FinishingList2() {\n\t\t$query = \"SELECT * FROM finishing DESC\";\n\t\t\n\t\tmysql_connect(DB_SERVER, DB_USER, DB_PASSWORD);\n\t\tmysql_select_db(DB_NAME);\n \t\n\t\t\t$result = mysql_query($query) or die(mysql_error());\t\n\t\t\t$rows = Array(); // returned object\n\t\t\t$rows['identifier'] = \"FinID\";\n\t\t\t\n \t\t\twhile($r=mysql_fetch_assoc($result)) {\n \t\t\t $rows['items'][] = $r;\n \t\t\t}\n\n\t\t\treturn json_encode($rows);\n\t\t\n\t}",
"public function calendar($year_month = null) {\n\n if(!isset($year_month)) {\n /* Setting the data and creating the first and last day of a month */\n $start_date = date('Y-m-01');\n $end_date = date('Y-m-t');\n }\n else {\n /* Getting the data and creating the first and last day of a month */\n $start_date = date('Y-m-d', strtotime($year_month.'-01'));\n $end_date = date('Y-m-t', strtotime($year_month.'-01'));\n }\n\n /* Querying the database to get the events for all days of certain month of the year */\n $calendar = [];\n $activities = [];\n while($start_date <= $end_date) {\n\n //Temporalmente, pedido por Amparo, ¿Qué te dije?, igual y mañana se queja de que se ven los eventos sin aprobar :P\n /*\n $events = EventDCI::whereRaw('end_day >= ? and start_day <= ? and (dci_status = ? or dci_status = ?) and user_status = ?',\n array($start_date, $start_date, 'En Proceso', 'Aprobado', 'Activo'))\n ->orderBy('time')->get();\n */\n $events = EventDCI::whereRaw('end_day >= ? and start_day <= ?',\n array($start_date, $start_date))\n ->orderBy('time')->get();\n\n $activities['activities'] = $events->toArray();\n\n //ola k ase\n $activities['date'] = $start_date;\n\n array_push($calendar, $activities);\n $activities = [];\n\n $next_date = new DateTime($start_date);\n $next_date->add(new DateInterval('P1D'));\n $s_next_date = $next_date->format('Y-m-d');\n $start_date = explode(' ', $s_next_date)[0];\n }\n\n return json_encode($calendar);\n\n }",
"public function getPagosCalendar() {\n// select t.id as id,\n// concat(\"Asignado a: \", CONCAT(c.nombre, CONCAT(\" \", c.apellido)), \" Tipo: Deuda\", \" Monto: \", CONVERT(t.monto, DECIMAL(4, 2))) as title,\n// t.fecha_creacion as start,\n// t.fecha_creacion as end,\n// \"['fc-event-danger', 'fc-border-event-danger']\" as className\n// from pago t\n// join cliente c on c.id = t.cliente_id\n// order by t.fecha_creacion ASC;\n $command = Yii::app()->db->createCommand()\n ->select(\"t.id as id,\n concat(\\\"Asignado a:\\\", CONCAT(c.nombre, CONCAT(\\\" \\\", c.apellido)), \\\" Tipo:Pago\\\", \\\" Monto:\\\",CONVERT(t.monto, DECIMAL(4,2)),\\\"$\\\") as title,\n t.fecha_creacion as start,\n t.fecha_creacion as end,\n \\\"fc-event-success fc-border-event-success\\\" as className\")\n ->from(\"pago t\")\n ->join(\"cliente c\", \"c.id = t.cliente_id\")\n ->order(\"t.fecha_creacion ASC\");\n// var_dump($command->queryAll());\n// die();\n return $command->queryAll();\n }",
"function supplier_getalljson($id = null) {\n if($this->RequestHandler->isAjax()) {\n $nextDelivery = $this->Delivery->findByNextDelivery(true);\n $this->Delivery->recursive = 0; \n $deliveryDates = $this->Delivery->find('all', array(\n 'conditions' => array(\n 'Delivery.date <=' => date('Y-m-d', strtotime($nextDelivery['Delivery']['date'])), \n 'Delivery.organization_id' => intval($id)), \n 'order' => 'Delivery.date DESC'\n )\n );\n Configure::write('debug', 0);\n $this->autoRender = false; \n $this->autoLayout = false;\n echo(json_encode($deliveryDates));\n exit(1); \n }\n }",
"function build_feed(array $calendars, $start = \"today\", $end = \"tomorrow\") {\n $feed = array();\n foreach( $calendars as $name => $id ) {\n try { $raw_feed = fetch_feed($id, strtotime($start), strtotime($end)); }\n catch( Exception $e ) {\n $feed[$name] = array();\n continue;\n }\n\n $clean_feed = array();\n\n foreach( $raw_feed['items'] as $item ) {\n array_push($clean_feed, calendar_scrub($item));\n }\n\n usort($clean_feed, function($a, $b) {\n return strtotime($a['dateTime']['start']) - strtotime($b['dateTime']['start']);\n });\n\n $feed[$name] = $clean_feed;\n }\n\n return json_encode($feed);\n}",
"function hookAjaxGetEvents() {\n\n\t \t$start = intval($_POST['start']);\n\t \t$end = intval($_POST['end']);\n\n\t \t$args['datefrom'] = $start;\n\t \t$args['dateto'] = $end;\n\t \t$args['datemode'] = FSE_DATE_MODE_ALL;\n\t \t$args['number'] = 0; // Do not limit!\n\n\t \tif (isset($_POST['state']))\n\t \t$args['state'] = $_POST['state'];\n\t \tif (isset($_POST['author']))\n\t \t$args['author'] = $_POST['author'];\n\t \tif (isset($_POST['categories']))\n\t \t$args['categories'] = $_POST['categories'];\n\t \tif (isset($_POST['include']))\n\t \t$args['include'] = $_POST['include'];\n\t \tif (isset($_POST['exclude']))\n\t \t$args['exclude'] = $_POST['exclude'];\n\t \t$events = $this->getEventsExternal($args);\n\n\t \t// Process array of events\n\t \t$events_out = array();\n\t \tforeach($events as $evt) {\n\t \t\tunset($e);\n\t \t\t$e['id'] = $evt->eventid;\n\t \t\t$e['post_id'] = $evt->postid;\n\t \t\t$e['post_url'] = (empty($evt->postid) ? '' : get_permalink($evt->postid));\n\t \t\t$e['title'] = $evt->subject;\n\t \t\t$e['allDay'] = ($evt->allday == true ? true : false);\n\t \t\t$e['start'] = mysql2date('c', $evt->from);\n\t \t\t$e['end'] = mysql2date('c', $evt->to);\n\t \t\t$e['editable'] = false;\n\n\t \t\t$classes = array();\n\t \t\tforeach($evt->categories as $c) {\n\t \t\t\t$classes[] = 'category-'.$c;\n\t \t\t}\n\t \t\tif (count($classes) > 0) {\n\t \t\t\t$e['className'] = $classes;\n\t \t\t}\n\t \t\t\n\t \t\t$events_out[] = $e;\n\t \t}\n\n\t \t$response = json_encode($events_out);\n\n\t \theader(\"Content-Type: application/json\");\n\t \techo $response;\n\n\t \texit;\n\t }",
"public function dayList()\n\t{\n\t\techo json_encode($this->sched_day->fetchData());\n\t}",
"public function get_agenda() {\n\t\t$items = $this->agenda_items->get_items();\n\t\t$participants = $this->participants->get_participants();\n\n\t\t// Create agenda\n\t\tforeach ($items as $item) {\n\t\t\tif ($item->is_all_participants) {\n\t\t\t\tforeach ($participants as $participant) {\n\t\t\t\t\t$json_return['items'][] = $this->create_agenda_row($item, $participant);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$json_return['items'][] = $this->create_agenda_row($item, NULL);\n\t\t\t}\n\t\t}\n\n\t\t// Get participants\n\t\tforeach ($participants as $participant) {\n\t\t\t$json_return['participants'][$participant->id] = $participant;\n\t\t}\n\n\t\t$json_return['success'] = TRUE;\n\t\techo json_encode($json_return);\n\t}",
"function get_events()\n\t{\n\t\t$usercode=$_REQUEST['usercode'];\n\t\t\n\t\t$userdt=$this->ObjM->get_user_by_usercode($usercode);\n\t\t\n\t\tif($userdt[0]['user_type_id']=='1'){\n\t\t\t\n\t\t\t$result = $this->get_school_event($userdt);\n\t\t\t\n\t\t}\n\t\t\n\t\tif(count($result)<1){\n\t\t\t$json_arr[]=array('validation'=>'false');\t\n\t\t\techo json_encode($json_arr);\n\t\t\texit;\t \n\t\t}\n\t\t\n\t\t\n\t\tfor($i=0;$i<count($result);$i++){\n\t\t\t$sr_no=$i+1;\n\t\t\t$json_arr[]=array(\n\t\t\t\t'sr_no' \t=> $sr_no,\n\t\t\t\t'event_dt' \t=> $result[$i]['event_dt'],\n\t\t\t\t'event_code' => $result[$i]['event_code'],\n\t\t\t\t'event_title' \t=> $result[$i]['event_title'],\n\t\t\t\t'cover_img' \t=> $result[$i]['cover_img'],\n\t\t\t\t'validation'=>'true'\n\t\t\t);\n\t\t}\n\t\t\n\t\techo json_encode($json_arr);\n\t}",
"function mobile_calendar( $data )\n\t{\t\n\t\t/* Get Current Month and Year */\n\t\t$month = date('n');\n\t\t$year = date('o');\n\t\t$d = cal_days_in_month(CAL_GREGORIAN,$month,$year);\n\t\t$sdate = $year.'-'.$month.'-'.'01';\n\t\t//$edate = $year.'-'.$month.'-'.$d;\n\t\t$edate = date('Y-m-d',strtotime('+1460 day', strtotime($sdate)));\n\t\t/* End Get Current Month and Year */\n\t\t\n\t\t/* Let's build the params JSON string */\n\t\t$params = array(\"VillaID\" => $data['villa_id'], \"SDate\" => $sdate, \"EDate\" => $edate);\n\t\t$p_Params = json_encode($params);\n\t\t$p_UserID = 'villaprtl';\n\t\t/* End params JSON string */\n\t\t\n\t\t$crequest = 'p_UserID=villaprtl&p_Params='.$p_Params;\n\t\t$cal = $this->cheeze_curls('getPropertyCalendar', $crequest, TRUE, FALSE, \"\", \"\", $data['db']);\n\t\t\n\t\t/* Start Build Date Range */\n\t\t$json_date_string = '';\n\t\t$ud_size = sizeof($cal['UnavailableDates']['UnavailableDate']);\n\t\tif(sizeof($cal) > 0 && array_key_exists('UnavailableDate',$cal['UnavailableDates'])):\n\t\t\tfor($d=0; $d<$ud_size; $d++):\n\t\t\t\tif(array_key_exists($d,$cal['UnavailableDates']['UnavailableDate'])):\n\t\t\t\t\t$start = strtotime($cal['UnavailableDates']['UnavailableDate'][$d]['From']);\n\t\t\t\t\t$end = strtotime($cal['UnavailableDates']['UnavailableDate'][$d]['To']);\n\t\t\t\telse:\n\t\t\t\t\t$start = strtotime($cal['UnavailableDates']['UnavailableDate']['From']);\n\t\t\t\t\t$end = strtotime($cal['UnavailableDates']['UnavailableDate']['To']);\t\n\t\t\t\tendif;\n\t\t\t\twhile($start <= $end):\n\t\t\t\t\t$json_date_string .= date('j F Y', $start);\n\t\t\t\t\tif($d < sizeof($cal['UnavailableDates']['UnavailableDate']))\n\t\t\t\t\t\t$json_date_string .= ',';\n\t\t\t\t\t\t\n\t\t\t\t\t$start = strtotime('+1 day', $start);\n\t\t\t\tendwhile;\n\t\t\tendfor;\n\t\tendif;\n\t\t$json_date_string .= '';\n\t\t$json_date_string = substr($json_date_string,0,-1);\n\t\t/* End Build Date Range */\n\t\t\n\t\t/* Let's build the display */\n\t\t$html = '<style>\n\t\t\t\ta.ui-state-default {color: black !important;}\n\t\t\t\t.booked, .booked * {cursor: text !important;}\n\t\t\t\t.booked a.ui-state-default {background-color: #FF6666 !important;background: #FF6666 !important;}\n\t\t\t\t.avail a.ui-state-default {background-color: #BEF781 !important;background: #BEF781 !important;}\n\t\t\t\t.ui-datepicker-trigger{height:16px;width:16px;cursor:pointer;}\n\t\t\t\t\n\t\t\t\t.greenblack, .greenblackgreenblack\n\t\t\t\t{\n\t\t\t\t\tfont-size:9px; \n\t\t\t\t\tfloat:left; \n\t\t\t\t\twidth:19px; \n\t\t\t\t\theight:23px;/*background-color:#FEFFE7;*/ \n\t\t\t\t\tmargin-right:1px; \n\t\t\t\t\ttext-align:center; \n\t\t\t\t\tcolor:#000; \n\t\t\t\t\tbackground-color:#BEF781; \n\t\t\t\t\tborder:solid 1px #BEF781;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t.redblack\n\t\t\t\t{\n\t\t\t\t\tfont-size:9px; \n\t\t\t\t\tfloat:left; \n\t\t\t\t\twidth:19px; \n\t\t\t\t\theight:23px;\n\t\t\t\t\tmargin-right:1px; \n\t\t\t\t\ttext-align:center; \n\t\t\t\t\tborder:solid 1px #FF6666; \n\t\t\t\t\tfont-weight:bold;\n\t\t\t\t\tcolor:#000; /*background-image:url(../../images/calendar/red.png) */\n\t\t\t\t\tbackground-color:#FF6666\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t.redyellow\n\t\t\t\t{\n\t\t\t\t\tfont-size:9px; \n\t\t\t\t\tfloat:left; \n\t\t\t\t\twidth:19px; \n\t\t\t\t\theight:23px;\n\t\t\t\t\tmargin-right:1px; \n\t\t\t\t\ttext-align:center; \n\t\t\t\t\tborder:solid 1px #FF6666; \n\t\t\t\t\tfont-weight:bold;\n\t\t\t\t\tcolor:yellow; /*background-image:url(../../images/calendar/red.png)*/\n\t\t\t\t\tbackground-color:#FF6666\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t.rednavy\n\t\t\t\t{\n\t\t\t\t\tfont-size:9px; \n\t\t\t\t\tfloat:left; \n\t\t\t\t\twidth:19px; \n\t\t\t\t\theight:23px;\n\t\t\t\t\tmargin-right:1px; \n\t\t\t\t\ttext-align:center; \n\t\t\t\t\tborder:solid 1px #FF6666; \n\t\t\t\t\tfont-weight:bold;\n\t\t\t\t\tcolor:blue; /*background-image:url(../../images/calendar/red.png)*/\n\t\t\t\t\tbackground-color:#FF6666\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t.redyellowgreen\n\t\t\t\t{\n\t\t\t\t\tfont-size:9px; \n\t\t\t\t\tfloat:left; \n\t\t\t\t\twidth:19px; \n\t\t\t\t\theight:23px;\n\t\t\t\t\tmargin-right:1px; \n\t\t\t\t\ttext-align:center; \n\t\t\t\t\tborder:solid 1px #FF6666; \n\t\t\t\t\tfont-weight:bold;\n\t\t\t\t\tcolor:#00FF00; /*background-image:url(../../images/calendar/red.png) */\n\t\t\t\t\tbackground-color:#FF6666\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t.redred\n\t\t\t\t {\n\t\t\t\t\tfont-size:9px; \n\t\t\t\t\tfloat:left; \n\t\t\t\t\twidth:19px; \n\t\t\t\t\theight:23px;\n\t\t\t\t\tmargin-right:1px; \n\t\t\t\t\ttext-align:center; \n\t\t\t\t\tborder:solid 1px #FF6666; \n\t\t\t\t\tfont-weight:bold;\n\t\t\t\t\tcolor:red; /*background-image:url(../../images/calendar/red.png) */\n\t\t\t\t\tbackground-color:#FF6666\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t.redwhite\n\t\t\t\t {\n\t\t\t\t\tfont-size:9px; \n\t\t\t\t\tfloat:left; \n\t\t\t\t\twidth:19px; \n\t\t\t\t\theight:23px;\n\t\t\t\t\tmargin-right:1px; \n\t\t\t\t\ttext-align:center; \n\t\t\t\t\tborder:solid 1px #FF6666; \n\t\t\t\t\tfont-weight:bold;\n\t\t\t\t\tcolor:white; /*background-image:url(../../images/calendar/red.png)*/ \n\t\t\t\t\tbackground-color:#FF6666\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t.hold\n\t\t\t\t{\n\t\t\t\t\tfont-size:9px; \n\t\t\t\t\tfloat:left; \n\t\t\t\t\twidth:19px; \n\t\t\t\t\theight:23px;color:#000; \n\t\t\t\t\tmargin-right:1px; \n\t\t\t\t\ttext-align:center; \n\t\t\t\t\tborder:solid 1px #000; \n\t\t\t\t\tbackground-color:yellow/*#CCCCFF*/\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t.yellowblack\n\t\t\t\t{\n\t\t\t\t\tfont-size:9px; \n\t\t\t\t\tfloat:left; \n\t\t\t\t\twidth:19px; \n\t\t\t\t\theight:23px;\n\t\t\t\t\tmargin-right:1px; \n\t\t\t\t\ttext-align:center; \n\t\t\t\t\tborder:solid 1px yellow; \n\t\t\t\t\tfont-weight:bold;\n\t\t\t\t\tcolor:#000; /*background-image:url(../../images/calendar/yellow.png)*/ \n\t\t\t\t\tbackground-color:yellow\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t.yellowred\n\t\t\t\t{\n\t\t\t\t\tfont-size:9px; \n\t\t\t\t\tfloat:left; \n\t\t\t\t\twidth:19px; \n\t\t\t\t\theight:23px;\n\t\t\t\t\tmargin-right:1px; \n\t\t\t\t\ttext-align:center; \n\t\t\t\t\tborder:solid 1px yellow; \n\t\t\t\t\tfont-weight:bold;\n\t\t\t\t\tcolor:red; /*background-image:url(../../images/calendar/yellow.png)*/\n\t\t\t\t\tbackground-color:yellow\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t.blueblack\n\t\t\t\t{\n\t\t\t\t\tfont-size:9px; \n\t\t\t\t\tfloat:left; \n\t\t\t\t\twidth:19px; \n\t\t\t\t\theight:23px;\n\t\t\t\t\tcolor:#000; \n\t\t\t\t\tmargin-right:1px; \n\t\t\t\t\ttext-align:center; \n\t\t\t\t\tborder:solid 1px #A9F5F2; \n\t\t\t\t\tbackground-color:#A9F5F2/*#CCCCFF*/\n\t\t\t\t}\n\t\t\t\t</style>\n\t\t\t\t<script type=\"text/javascript\" src=\"/wp-content/plugins/availability-calendar/js/jquery.availabilityCalendar.js\"></script>';\n\t\t\t\t\n\t\t$html .= '<div align=\"center\" >\n\t\t\t\t\t<input type=\"hidden\" id=\"json_date_strings_'.$data['villa_id'].'\" name=\"json_date_strings_'.$data['villa_id'].'\" value=\"'.$json_date_string.'\" />\n\t\t\t\t\t<input type=\"hidden\" id=\"vid_'.$data['villa_id'].'\" name=\"vid_'.$data['villa_id'].'\" value=\"'.$data['villa_id'].'\" />\n\t\t\t\t\t<div id=\"availCalendar_'.$data['villa_id'].'\" align=\"center\" style=\"width:100%\"></div>';\n\t\t$html .= '<script type=\"text/javascript\">kalendaryo(\"'.$data['villa_id'].'\");</script>';\t\t\t\n\t\t$dib = '<div style=\"width:50%\">\n\t\t\t\t\t<fieldset>\n\t\t\t\t\t\t<legend>Colour Legends</legend>\n\t\t\t\t\t\t<table>\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td style=\"background-color:#BEF781;\" width=\"15%\"> </td>\n\t\t\t\t\t\t\t\t<td>Available/On Request</td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td style=\"background-color:#FF6666;\"> </td>\n\t\t\t\t\t\t\t\t<td>Booked</td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t</table>\n\t\t\t\t\t</fieldset>\n\t\t\t\t</div>';\n\t\t$html .='</div>';\t\t\n\t\t/* End build display */\t\t\t\t\n\t\techo $html;\n\t}",
"public function ajaxDatatableAgendamento()\n {\n $dia = date('d') + 1;\n $sql = \"\n SELECT\n a.idAgendamento,\n a.dataInicio,\n a.dataFim,\n idUsuario,\n u.nome_usuario,\n e.razaoSocial AS empresa\n FROM \n z_sga_fluxo_agendamento_acesso a\n LEFT JOIN\n z_sga_usuarios u\n ON a.idUsuario = u.z_sga_usuarios_id\n LEFT JOIN\n z_sga_empresa e\n ON a.idEmpresa = e.idEmpresa\n WHERE\n dataInicio >= '\".date(\"Y-m-$dia\").\"' \n ORDER BY\n dataInicio ASC\";\n\n try{\n $sql = $this->db->query($sql);\n return array(\n 'return' => true,\n 'result' => $sql->fetchAll()\n );\n }catch (Exception $e){\n return array(\n 'result' => false,\n 'error' => $e->getMessage()\n );\n }\n }",
"public function get_calendar() {\n $start = date('Y-m-d H:i:s', strtotime($this->input->post('start_date')));\n $end = date('Y-m-d H:i:s', strtotime($this->input->post('end_date')));\n $filter = $this->input->post('filter');\n if ($start && $end) {\n if (isset($filter) && !empty($filter) && !in_array($filter, config_item('event_types'))) {\n return $this->send_error('INVALID_FILTER');\n }\n $this->load->model('events_model');\n $where = array('start_date >=' => $start, 'end_date <=' => $end);\n if (isset($filter) && !empty($filter)) {\n $where['type'] = $filter;\n }\n if ($events = $this->events_model->get_all($where)) {\n setlocale(LC_TIME, 'nl_NL.UTF-8');\n foreach ($events as &$event) {\n $event['readable_start_date'] = strftime('%A %d %B %G', strtotime($event['start_date']));\n $event['readable_end_date'] = strftime('%A %d %B %G', strtotime($event['end_date']));\n }\n $this->event_log();\n return $this->send_response($events);\n }\n return $this->send_error('NO_RESULTS');\n } else {\n return $this->send_error('ERROR');\n }\n }",
"public function json_table() {\n\t\t\techo json_encode($this->populate_rows());\n\t\t}",
"public function api_getTable($month,$year)\n\t{\n\t\t$employees = Employee::all();\n\n\t\tforeach ($employees as $key => $value) {\n\t\t\t$calendar = Calendar::where('employee_id', '=', $value->id)->where('month',$month)->where('year',$year)->first();\n\t\t\tif($calendar == null)\n\t\t\t{\n\t\t\t\t$calendar = $this->bornCalendarEmpty($value->id, $month, $year);\n\t\t\t}\n\t\t\t$this->generatePresenteWhenInitNewDate($calendar, $month, $year);\n\t\t\t$employees[$key]->calendar = $calendar;\n\t\t}\n\n?>\n <div id=\"datafullname\" style=\"display:none\"></div>\n <div class=\"sidebar-calendar\">\n <table>\n <thead>\n <tr><th><div class=\"nameitem\">Fullname</div></th></tr>\n </thead>\n <tbody>\n <tr class=\"itemblank\">\n <td><div class=\"nameitem\"></div></td>\n </tr>\n <?php foreach($employees as $key => $value) : ?>\n <tr>\n <!-- <td><div class=\"nameitem\">{{ $value->id }}</div></td> -->\n <td><div class=\"nameitem\" idem=\"<?php echo $value->id; ?>\"><?php echo $value->lastname.\" \".$value->firstname; ?></div></td>\n </tr>\n <?php endforeach;?>\n </tbody>\n </table>\n </div>\n <div class=\"content-calendar\">\n <div id=\"datacalendar\" style=\"display:none\"></div>\n <table>\n <thead>\n <tr>\n\t\t\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\t\t\t\tfor ($i=1;$i<=31;$i++)\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$dt = null;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (checkDateValid($i, $month, $year)) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$dt = Carbon::create($year, $month, $i);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\techo \"<th><div class='day'>\".$i.\"<br/>\".toEnglishDate($dt->dayOfWeek).\"</div></th>\";\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?>\n </tr>\n </thead>\n <tbody>\n <tr class=\"itemblank\">\n <td><div class=\"innerblank\"></div></td>\n </tr>\n <?php\n foreach($employees as $key => $value)\n {\n $calendar = $value->calendar;\n ?>\n <tr>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ($i=1;$i<=31;$i++)\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\t$dt = Carbon::create($year, $month, $i);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (checkDateValid($i, $month, $year)) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif ($dt->dayOfWeek == 6 || $dt->dayOfWeek == 0)\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\t?>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<td style=\"background-color:#ffbff7\"><div class=\"item\" idem=\"{{ $value->id }}\" idday=\"<?php echo $i;?>\" ><?php echo $calendar->{'n'.$i};?></div></td>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t} else {\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\t<td><div class=\"item\" idem=\"{{ $value->id }}\" idday=\"<?php echo $i;?>\" ><?php echo $calendar->{'n'.$i};?></div></td>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<?php\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}\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<?php\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 </tr>\n <?php\n }\n ?>\n\n </tbody>\n </table>\n </div>\n\n\t\t<?php\n\t}",
"public function get_eventos(){\n $eventos = DB::select(DB::raw('select evento_id as \"id\" ,evento_titulo as \"title\", evento_desc as \"description\", fecha_inicio as \"start\", fecha_fin as \"end\",evento_color as \"className\", evento_icon as \"icon\" from trn_sistemas.m_evento where evento_estado = 200001'));\n\n // dd($eventos);\n return response()->json($eventos,200);\n }",
"public function getBookings() {\n //$query = \"SELECT * FROM `bookings` WHERE `DATE` = CURDATE() ORDER BY `DATE`, `TIME`\";\n $query = \"SELECT * FROM `bookings` where DATE(`DATE`) = CURDATE() \";\n\n $stmt = $this->sqlConnection->prepare($query);\n\n $stmt->execute();\n\n if ($stmt->rowCount() > 0) {\n\n $result = $stmt->fetchAll(PDO::FETCH_ASSOC);\n\n return json_encode($result);\n } else {\n\n echo json_encode(array(\"status\" => 201, 'message' => 'No bookings made yet..'));\n }\n }",
"private function getData()\n {\n $data = array();\n\n $data = array_merge($data,\n $this->services->CalendarData->currentUserData(),\n $this->services->Common->subPageName( $this->timber->translator->trans('Calendar') . \" | \" ),\n $this->services->Common->runtimeScripts( 'calendar' ),\n $this->services->Common->injectScripts(array(\n 'projectsEvents' => $this->services->CalendarData->projectsEvents(),\n 'tasksEvents' => $this->services->CalendarData->tasksEvents(),\n 'projectsEventsColor' => '#ecf0f1',\n 'projectsEventsTextColor' => '#2c3e50',\n 'tasksEventsColor' => '#bdc3c7',\n 'tasksEventsTextColor' => '#2980b9',\n 'calEvent_id' => $this->timber->translator->trans('ID'),\n 'calEvent_iden' => $this->timber->translator->trans('Identifier'),\n 'calEvent_type' => $this->timber->translator->trans('Type'),\n 'calEvent_mi_id' => $this->timber->translator->trans('Milestone ID'),\n 'calEvent_mi_title' => $this->timber->translator->trans('Milestone Title'),\n 'calEvent_pr_id' => $this->timber->translator->trans('Project ID'),\n 'calEvent_owner_id' => $this->timber->translator->trans('Owner ID'),\n 'calEvent_assign_to' => $this->timber->translator->trans('Assignee ID'),\n 'calEvent_assign_to_name' => $this->timber->translator->trans('Assignee Name'),\n 'calEvent_assign_to_email' => $this->timber->translator->trans('Assignee Email'),\n 'calEvent_title' => $this->timber->translator->trans('Title'),\n 'calEvent_description' => $this->timber->translator->trans('Description'),\n 'calEvent_status' => $this->timber->translator->trans('Status'),\n 'calEvent_progress' => $this->timber->translator->trans('Progress'),\n 'calEvent_priority' => $this->timber->translator->trans('Priority'),\n 'calEvent_start_at' => $this->timber->translator->trans('Start at'),\n 'calEvent_end_at' => $this->timber->translator->trans('End at'),\n 'calEvent_created_at' => $this->timber->translator->trans('Created at'),\n 'calEvent_updated_at' => $this->timber->translator->trans('Updated at'),\n 'calEvent_currency' => $this->timber->translator->trans('Currency'),\n 'calEvent_reference' => $this->timber->translator->trans('Reference'),\n 'calEvent_ref_id' => $this->timber->translator->trans('Reference ID'),\n 'calEvent_version' => $this->timber->translator->trans('Version'),\n 'calEvent_budget' => $this->timber->translator->trans('Budget'),\n 'calEvent_tax_value' => $this->timber->translator->trans('Tax Value'),\n 'calEvent_tax_type' => $this->timber->translator->trans('Tax Type'),\n 'calEvent_discount_value' => $this->timber->translator->trans('Discount Value'),\n 'calEvent_discount_type' => $this->timber->translator->trans('Discount Type'),\n 'calEvent_attach' => $this->timber->translator->trans('Attachments'),\n 'calEvent_owners' => $this->timber->translator->trans('Owners'),\n 'calEvent_staff' => $this->timber->translator->trans('Staff'),\n 'calEvent_clients' => $this->timber->translator->trans('Clients'),\n 'calEvent_staff_ids' => $this->timber->translator->trans('Staff IDs'),\n 'calEvent_clients_ids' => $this->timber->translator->trans('Clients IDs'),\n ))\n );\n\n return $data;\n }",
"private function _get_calendar_array()\n\t{\n\t $this->all_events = $this->result->xpath(\".//event\");\n\t \n\t foreach($this->all_events as $an_event):\n\t $start_at = $an_event->xpath(\"./start-at\");\n \t $start_at = $start_at[0];\n \t $end_at = $an_event->xpath(\"./end-at\");\n \t $end_at = $end_at[0];\n \t \n \t $start_at = new DateTime($start_at);\n \t $start_at->setTimezone(new DateTimeZone('America/Chicago'));\n \t $start_at->setTime(0, 0, 0);\n \t $end_at = new DateTime($end_at);\n \t $end_at->setTimezone(new DateTimeZone('America/Chicago'));\n \t $end_at->setTime(0, 0, 0);\n \t \n \t $start_timestamp = strtotime($start_at->format('Y-m-d'));\n $end_timestamp = strtotime($end_at->format('Y-m-d'));\n \n $start_year = date(\"Y\", $start_timestamp);\n $end_year = date(\"Y\", $end_timestamp);\n $start_month = date(\"m\", $start_timestamp);\n $end_month = date(\"m\", $end_timestamp);\n $start_day = date(\"d\", $start_timestamp);\n $start_day = $start_day + 1;\n $end_day = date(\"d\", $end_timestamp);\n $end_day = $end_day + 1;\n \n if(($start_year == $this->year && $start_month == $this->month) || ($end_year == $this->year && $end_month == $this->month)):\n if($start_year == $end_year):\n if($start_month == $end_month):\n $this->_calendar_array_one($start_day, $end_day);\n else:\n if($end_month != $this->month):\n $this->_calendar_array_two($start_day);\n else:\n $this->_calendar_array_three($end_day);\n endif;\n endif;\n endif;\n endif;\n endforeach;\n \n\t foreach($this->callinks as $callinks):\n\t foreach($callinks as $key => $value):\n\t $this->combined_callinks[\"$key\"] = $value;\n\t endforeach;\n\t endforeach;\n\t}",
"public static function ObtenerCalendario()\n {\n // Consulta de la meta\n $consulta = \"SELECT * FROM calendario\";\n\n try {\n // Preparar sentencia\n $comando = Database::getInstance()->getDb()->prepare($consulta);\n // Ejecutar sentencia preparada\n $comando->execute();\n // Capturar primera fila del resultado\n //$row = $comando->fetch(PDO::FETCH_ASSOC);\n //return $row;\n\n\n return $comando->fetchAll(PDO::FETCH_ASSOC);\n\n } catch (PDOException $e) {\n // Aquí puedes clasificar el error dependiendo de la excepción\n // para presentarlo en la respuesta Json\n return -1;\n }\n }",
"public function ObtenerReservas(){\n $query = $this->mod_reserva2->obtener_reservas($this->input->post('fecha'));\n $reservas = array();\n $reserva = array();\n foreach($query->result() as $row){\n $reserva['hora_entrada'] = $row->hora_entrada;\n $reserva['hora_salida'] = $row->hora_salida;\n $reserva['salon'] = $row->salon;\n $reserva['eliminada'] = $row->eliminada;\n $reserva['estado'] = $row->estado;\n $reserva['nombre'] = $row->nombre;\n if($row->estado==0){\n $reserva['reservado'] = 3; // Gris\n }\n else if($row->salida != null){ // (Concluido)\n $reserva['reservado'] = 2; // Amarillo\n }\n else {\n $reserva['reservado'] = 1; // Rojo\n }\n $reservas[] = $reserva;\n }\n echo json_encode($reservas);\n }",
"function _getCalendarData( $year, $month, $day){\t\t\t\t\n\t\t$rows = $this->_listIcalEventsByMonth( $year, $month);\n \t\t\n\t\t$rowcount = count( $rows );\t\t\n\t\t$data = array();\n\t\t$data['year'] = $year;\n\t\t$data['month'] = $month;\n\t\t$month = intval($month);\n\t\tif( $month <= '9' ) {\n\t\t\t$month = '0' . $month;\n\t\t}\n\t\t$data['startday'] = $startday = (int) EventBookingHelper::getConfigValue('calendar_start_date');\t\t\n\t\t// get days in week\n\t\t$data[\"daynames\"] = array();\n\t\tfor( $i = 0; $i < 7; $i++ ) {\n\t\t\t$data[\"daynames\"][$i] = $this->_getDayName(($i+$startday)%7, true );\n\t\t}\t\t\n\t\t$data[\"dates\"]=array();\t\t\n\t\t//Start days\n\t\t$start = (( date( 'w', mktime( 0, 0, 0, $month, 1, $year )) - $startday + 7 ) % 7 );\t\t\n\t\t// previous month\n\t\t$priorMonth = $month-1;\n\t\t$priorYear = $year;\t\t\n\t\tif ($priorMonth <= 0) {\n\t\t\t$priorMonth += 12;\n\t\t\t$priorYear -= 1;\n\t\t}\t\t\t\n\t\t$dayCount=0;\n\t\tfor( $a = $start; $a > 0; $a-- ){\n\t\t\t$data[\"dates\"][$dayCount] = array();\n\t\t\t$data[\"dates\"][$dayCount][\"monthType\"] = \"prior\";\n\t\t\t$data[\"dates\"][$dayCount][\"month\"] = $priorMonth;\n\t\t\t$data[\"dates\"][$dayCount][\"year\"] = $priorYear;\n\t\t\t$data[\"dates\"][$dayCount]['countDisplay'] = 0;\n\t\t\t$dayCount++;\n\t\t}\n\t\tsort($data[\"dates\"]);\n\t\t//Current month\n\t\t$end = date( 't', mktime( 0, 0, 0,( $month + 1 ), 0, $year ));\n\t\tfor( $d = 1; $d <= $end; $d++ ){\n\t\t\t$data[\"dates\"][$dayCount]=array();\n\t\t\t// utility field used to keep track of events displayed in a day!\n\t\t\t$data[\"dates\"][$dayCount]['countDisplay']=0;\n\t\t\t$data[\"dates\"][$dayCount][\"monthType\"]=\"current\";\n\t\t\t$data[\"dates\"][$dayCount][\"month\"]=$month;\n\t\t\t$data[\"dates\"][$dayCount][\"year\"]=$year;\t\t\n\t\t\t\t\t\t\n\t\t\t$t_datenow = $this->_getNow();\n\t\t\t$now_adjusted = $t_datenow->toUnix(true);\n\t\t\tif( $month == strftime( '%m', $now_adjusted)\n\t\t\t&& $year == strftime( '%Y', $now_adjusted)\n\t\t\t&& $d == strftime( '%d', $now_adjusted)) {\n\t\t\t\t$data[\"dates\"][$dayCount][\"today\"]=true;\n\t\t\t}else{\n\t\t\t\t$data[\"dates\"][$dayCount][\"today\"]=false;\n\t\t\t}\n\t\t\t$data[\"dates\"][$dayCount]['d']=$d;\t\t\t\t\t\t\n\t\t\t$data[\"dates\"][$dayCount]['events'] = array();\n\t\t\tif( $rowcount > 0 ){\n\t\t\t\tforeach ($rows as $row) {\n\t\t\t\t\t\t$date_of_event = explode('-',$row->event_date);\n\t\t\t\t\t\t$date_of_event = (int)$date_of_event[2];\t\t\t\t\t\t\n\t\t\t\t\t\tif ($d == $date_of_event ){\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$i=count($data[\"dates\"][$dayCount]['events']);\n\t\t\t\t\t\t\t$data[\"dates\"][$dayCount]['events'][$i] = $row;\n\t\t\t\t\t\t}\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t$dayCount++;\n\t\t}\t\n \t\n\t\t// followmonth\n\t\t$days \t= ( 7 - date( 'w', mktime( 0, 0, 0, $month + 1, 1, $year )) + $startday ) %7;\n\t\t$d\t\t= 1;\n\t\t$followMonth = $month+1;\n\t\t$followYear = $year;\n\t\tif ($followMonth>12) {\n\t\t\t$followMonth-=12;\n\t\t\t$followYear+=1;\n\t\t}\n\t\t$data[\"followingMonth\"]=array();\n\t\tfor( $d = 1; $d <= $days; $d++ ) {\n\t\t\t$data[\"dates\"][$dayCount]=array();\n\t\t\t$data[\"dates\"][$dayCount][\"monthType\"]=\"following\";\n\t\t\t$data[\"dates\"][$dayCount][\"month\"]=$followMonth;\n\t\t\t$data[\"dates\"][$dayCount][\"year\"]=$followYear;\n\t\t\t$data[\"dates\"][$dayCount]['countDisplay']=0;\n\t\t\t$dayCount++;\n\t\t}\n\t\treturn $data;\t\t\n\t}",
"function calendarioJson() {\n \t$fp = fopen(\"ics/basic5.ics\", \"r\"); \n\t$temp = fread($fp, filesize(\"ics/basic5.ics\"));\n\t//Ver si se necesita nl2br\n\t$salida = icsAJson(json_encode(nl2br($temp)));\n\t//Este es el Json Final\n\treturn ('[' . $salida . ']');\n}",
"public function getAllDates()\n {\n return response()->json(['data'=>Event::select('reserved_date')->get()]);\n }",
"function toJSON() {\r\n $unjsoned = array();\r\n \r\n $schedules = $this->has_schedules();\r\n $assignments = BPSP_Assignments::has_assignments();\r\n $entries = array_merge( $assignments, $schedules );\r\n foreach ( $entries as $e ) {\r\n setup_postdata( $e );\r\n if( $e->post_type == \"schedule\" )\r\n $entry = array(\r\n \"id\" => get_the_ID(),\r\n \"title\" => get_the_title( $e->ID ),\r\n \"start\" => date( 'c', strtotime( $e->start_date ) ),\r\n \"end\" => date( 'c', strtotime( $e->end_date ) ),\r\n \"url\" => $e->permalink,\r\n );\r\n elseif( $e->post_type == \"assignment\" )\r\n $entry = array(\r\n \"id\" => get_the_ID(),\r\n \"title\" => get_the_title( $e->ID ),\r\n \"start\" => date( 'c', strtotime( $e->due_date ) ),\r\n \"end\" => date( 'c', strtotime( $e->due_date ) ),\r\n \"url\" => $e->permalink,\r\n );\r\n \r\n if( !empty( $entry['end'] ) )\r\n $entry['allDay'] = false;\r\n \r\n $unjsoned[] = $entry;\r\n }\r\n \r\n header(\"HTTP/1.1 200 OK\");\r\n die( json_encode( $unjsoned ) );\r\n }",
"function get_holiday()\n\t {\n\t\t$holiday_list \t= $this ->ObjM->holiday_list();\n\t\t//var_dump($holiday_list); exit;\n\t\t\n\t\tif(count($holiday_list)<1){\n\t\t\t$json_arr[]=array('validation'=>'false');\t\n\t\t\techo json_encode($json_arr);\n\t\t\texit;\t \n\t\t}\n\t\t\n\t\tfor($i=0;$i<count($holiday_list);$i++){\n\t\t\tif($holiday_list[$i]['type'] == 'multi')\n\t\t\t{\n\t\t\t $holiday_date = date('d-m-Y',$holiday_list[$i]['start_date']).' To '.date('d-m-Y',$holiday_list[$i]['end_date']);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$holiday_date = date('d-m-Y',$holiday_list[$i]['start_date']);\t\n\t\t\t}\n\t\t\t$day = date(\"D\", $holiday_list[$i]['start_date']);\n\t\t\t\n\t\t\t$json_arr[]=array(\n\t\t\t\t\t'title'\t\t\t\t=>\t$holiday_list[$i]['title'],\n\t\t\t\t\t'holiday_date'\t\t=>\t$holiday_date,\n\t\t\t\t\t'holiday_day'\t\t=>\t$day,\n\t\t\t\t\t'description'\t\t=>\t$holiday_list[$i]['description'],\n\t\t\t\t\t'validation'\t \t=>\t'true' );\n\t\t }\n\t\t echo json_encode($json_arr);\n\t\t\texit;\n\t }",
"function getHumedityDates($startDate, $endDate)\n {\n $stmt = $this->con->prepare(\"SELECT * FROM humedad WHERE date_time BETWEEN '\".$startDate.\" 00:00:01' AND '\". $endDate.\" 23:59:59'\");\n $stmt->execute();\n $stmt->bind_result($id, $plant, $date_time, $rango, $percentage);\n\n $humedity_json = array(); \n\n while($stmt->fetch())\n {\n $humedity_array = array();\n $humedity_array['id'] = $id; \n $humedity_array['plant'] = $plant; \n $humedity_array['date_time'] = $date_time; \n $humedity_array['rango'] = $rango; \n $humedity_array['percentage'] = $percentage; \n\n array_push($humedity_json, $humedity_array); \n }\n\n return $humedity_json; \n }",
"public function getDateSchedule()\n {\n $date = $this->getCustomParam('date');\n $schedulesRepository = $this->getRepository('schedule');\n $moviesRepository = $this->getRepository('movie');\n $roomsRepository = $this->getRepository('room');\n\n $currentSchedules = $schedulesRepository->getSchedulesPerDay($date);\n $currentSchedules = $this->setTimeFormatDisplay($currentSchedules, 'H:i');\n\n $data = array(\n 'schedules' => $currentSchedules,\n );\n\n return $this->application->json($data);\n }",
"function getDailyConnectionAsJSON($mese,$anno) {\n $query = \"SELECT day(when_registered) as giorno, month(when_registered) as mese, \" .\n \" year(when_registered) as anno , count(*) as connessioni\" .\n \" FROM scuola.utenti_logger WHERE msg_type = 'LOGIN_SUCCESS'\" .\n \" AND year(when_registered) = \".$anno.\n \" AND month(when_registered) = \".$mese.\n \" GROUP BY day(when_registered)\" .\n \" ORDER BY when_registered\";\n if(\n mysql_connect(\"localhost\",\"root\",\"myzconun\")){\n mysql_select_db(\"scuola\");\n $results = mysql_query($query);\n\n if (!$results) {\n\n $msg = mysql_error();\n setcookie('message', mysql_errno() . ': ' . mysql_error());\n //mysql_freeresult();\n } else {\n $num_rows = mysql_num_rows($results);\n if($num_rows > 0){\n while($row=mysql_fetch_assoc($results)){\n $output[]=$row;\n }\n print(json_encode($output));// this will print the output in json\n mysql_close();\n }else{\n print(\"[{}]\");\n mysql_close();\n }\n\n }\n\n }\n }",
"function return_json($sqlresult) {\n header(\"Content-type:application/json;charset=utf-8\");\n echo json_encode($sqlresult);\n }",
"public function get_events()\n {\n $table_name = $this->input->get_post(\"table_name\");\n\n log_message(\"debug\", \"Posted table name {$table_name}\");\n\n $config = [\n 'base_url' => $this->config->base_url(\"welcome/get_events/\"),\n 'total_rows' => $this->Xform_model->count_all_records($table_name),\n 'uri_segment' => 4,\n 'per_page' => 100,\n ];\n\n $this->pagination->initialize($config);\n $page = ($this->uri->segment(3)) ? $this->uri->segment(3) : 0;\n\n $events = $this->Xform_model->get_geospatial_data($table_name, $this->pagination->per_page, $page);\n $links = $this->pagination->create_links();\n\n if ($this->input->is_ajax_request()) {\n $result = [\n 'status' => \"success\",\n \"events_count\" => $config['total_rows'],\n \"events\" => $events,\n \"links\" => $links\n ];\n $result = array_utf8_encode($result);\n echo json_encode($result);\n } else {\n show_error(\"Not Implement\", 501, \"Page not implemented\"); //page not implemented\n }\n }",
"public function calendario(){\n\t\t// Preparo l'array da restituire Json\n\t\t$jsondata=array();\n\t\t// Recupero i parametri _POST\n\t\t$azione=$_POST['azione']; // default: elenca\n\t\t$stato=$_POST['stato']; // ANNULATO, CHIUSO, NULL\n\t\t// Preparo l'array per l'estrazione dei tasks\n\t\t$parametri=array(\n 'stato' => $stato,\n\t\t\t'categoria' => '',\n\t\t\t'reparto'=>''\n\t\t);\n\t\t$this->data['tasks']=$this->mod_tasks->elencaTasks($parametri);\n\t\t/** TODO: creare trasposizione da task a fullcalendar **/\n\t\t/***** demo\n\t\techo \"START<br/>\";\n\t\tforeach ($this->data['tasks'] as $righe => $value) {\n\t\t\t// Ciclo le righe contenenti i task\n\t\t\techo \"Debug: analizzo l'indice :\".$righe.\"<br/>\";\n\t\t\tforeach ($this->data['tasks'][$righe] as $indice => $valore) {\n\t\t\t\techo \"Debug: il valore di :\".$indice.\" è :\".$valore.\"<br/>\";\n\t\t\t\t$jsondata[$righe][$indice]=$valore;\n\t\t\t}\n\t\t\techo \"<br/>\";\n\t\t}\n\t\techo \"<br/>END<br/>\";\n\t\t****** fine demo **/\n\t\tforeach ($this->data['tasks'] as $righe => $value) {\n\t\t\t$jsondata[$righe]['id']=$value['id_task'];\n\t\t\t$jsondata[$righe]['title']=$value['categoria'];\n\t\t\t$jsondata[$righe]['start']=$value['scadenza'];\n\t\t\t$jsondata[$righe]['color']=$value['colore'];\n\t\t}\n\t\t//print_r($jsondata);\n\t\techo json_encode($jsondata);\n\t\t/*\n\t\tid=tasks.id_task\n\t\ttitle=categoria\n\t\tstart=scadenza\n\t\turl=\"\"\n\t\ttasks\t\t*/\n\t}",
"function totalConcepto($where, $fecha_desde, $fecha_hasta)\n{\n $db = new MysqliDb();\n $resultsDetalles = [];\n\n $SQL = \"select movimiento_id, asiento_id, fecha, c.cuenta_id, c.descripcion, usuario_id, importe, 0 general, 0 control, 0 ca, 0 cc, 0 me,\n0 detalles\nfrom movimientos m inner join cuentas c on m.cuenta_id = c.cuenta_id\nwhere \" . $where . \" and (fecha between '\" . $fecha_desde . \"' and '\" . $fecha_hasta . \"');\";\n\n $results = $db->rawQuery($SQL);\n\n foreach ($results as $row) {\n $SQL = \"select\ndetalle_tipo_id,\nvalor detalle\n\n from detallesmovimientos\n where detalle_tipo_id in (2) and movimiento_id = \" . $row['movimiento_id'] . \";\";\n $detalles = $db->rawQuery($SQL);\n\n $row[\"detalles\"] = $detalles;\n array_push($resultsDetalles, $row);\n\n }\n\n echo json_encode($resultsDetalles);\n}",
"function getAllItems()\n\t\t{\n\t\t\tglobal $conn;\n\t\t\t$sql = \"SELECT * FROM itemsWeek2\";\n\t\t\t$result = mysqli_query($conn, $sql);\n\t\t\t// convert to JSON\n\t\t\t$rows = array();\n\t\t\twhile($r = mysqli_fetch_assoc($result)) {\n\t\t\t\t$rows[] = $r;\n\t\t\t}\n\t\t\treturn json_encode($rows);\n\t\t}",
"function list_data($start_date=false,$end_date=false) {\n if(!$start_date)\n $start_date = date(\"Y-m\").'-01';\n if(!$end_date)\n $end_date = date(\"Y-m-d\");\n\n $list_data = $this->Sales_Invoices_model->get_details(array('start_date' => $start_date,'end_date' => $end_date))->result();\n $result = array();\n foreach ($list_data as $data) {\n $result[] = $this->_make_row($data);\n }\n echo json_encode(array(\"data\" => $result));\n }",
"public function actionMonthData()\n {\n $this->requireAjaxRequest();\n $this->requirePostRequest();\n\n $dateRangeStart = craft()->request->getPost('dateRangeStart');\n $dateRangeEnd = craft()->request->getPost('dateRangeEnd');\n $calendars = craft()->request->getPost('calendars', null);\n $nonEditable = craft()->request->getPost('nonEditable');\n $locale = craft()->request->getPost('locale', null);\n\n $criteria = array(\n 'dateRangeStart' => $dateRangeStart,\n 'dateRangeEnd' => $dateRangeEnd,\n );\n\n $calendarIds = null;\n if ($calendars) {\n if ($calendars !== '*') {\n $criteria['calendarId'] = explode(',', $calendars);\n }\n } else if (null !== $calendars) {\n $criteria['calendarId'] = -1;\n }\n\n /** @var Calendar_EventsService $eventsService */\n $eventsService = craft()->calendar_events;\n\n if (craft()->isLocalized()) {\n $criteria['locale'] = $locale ?: craft()->language;\n }\n\n // Check settings if disabled events should be shown\n\n /** @var Calendar_SettingsService $settings */\n $settings = craft()->calendar_settings;\n if ($settings->showDisabledEvents()) {\n $criteria['status'] = null;\n }\n\n $eventList = $eventsService->getEventList($criteria);\n $simpleEvents = $eventList->getEventsAsSimpleObject();\n\n if ($nonEditable) {\n foreach ($simpleEvents as $event) {\n $event->editable = false;\n }\n }\n\n $this->returnJson($simpleEvents);\n }",
"private function JSON($result)\n {\n // Check numb of rows\n if ($result) {\n $num = $result->num_rows;\n } else {\n $num = '';\n }\n // Create array\n $outputArr = [];\n // Output object\n if ($num > 0) {\n while ($row = $result->fetch_assoc()) {\n // Extract each value\n extract($row);\n // Create array items\n $arrItem = [\n 'Wid' => $Wid,\n 'Wname' => $Wname,\n 'Wtitle' => $Wtitle,\n 'WstartDate' => $WstartDate,\n 'WendDate' => $WendDate,\n 'Wdesc' => $Wdesc,\n 'UserID' => $UserID\n ];\n // Push to array\n array_push($outputArr, $arrItem);\n }\n // OK response\n http_response_code(200);\n\n // Output JSON\n echo json_encode($outputArr);\n } else {\n // Add error response code\n http_response_code(404);\n\n // If no items found\n echo json_encode(\n ['message' => 'No work found']\n );\n }\n }",
"private function getEvents () \n\n\t\t{\n\t\t\t $dbs = new DB ( $this->config['database'] );\n $c = $dbs->query (\"SELECT * FROM tbl_events_record WHERE org_id = '\" . $this->c . \"'\");\n\t\t\t if ( count ( $c ) ) {\n\t\t\t\t$this->result['data']['id'] = trim ( $this->c );\n\t\t\t\t$this->result['data']['events'] = $c[0]['events'];\n\t\t\t\t$this->result['data']['date'] = $c[0]['date_rec'];\n\t\t\t } else \n\t\t\t\t$this->result['data']['result'] = \"Not found [error code:100:101]\";\n\n\t\t\t $dbs->CloseConnection ();\n\t\t\t\n\t\t \treturn;\n\t\t}",
"function getAllAirport() {\n global $airportManager;\n\n $result = [];\n\n // Get All the Airport in the database\n $airports = $airportManager->getAllAirport();\n\n // if not empty, need to transform all object to associative Array\n if ( count( $airports ) ) {\n foreach ( $airports as $airport ) {\n $result[] = [\n \"id\" => $airport->getId(),\n \"code\" => $airport->getCode(),\n \"cityCode\" => $airport->getCityCode(),\n \"name\" => $airport->getName(),\n \"city\" => $airport->getCity(),\n \"countryCode\" => $airport->getCountryCode(),\n \"regionCode\" => $airport->getRegionCode(),\n \"latitude\" => $airport->getlatitude(),\n \"longitude\" => $airport->getLongittude(),\n \"timezone\" => $airport->getTimezone(),\n ];\n }\n } else {\n $result = $airports;\n }\n\n echo json_encode( $result );\n}",
"function dbGetEvents()\r\n\t{\r\n\t\t//$sql = \"SELECT idEvents,NameEnglish, DateStart, DateEnd, countries.Country, Website FROM events inner join countries on events.Countries_idCountries = countries.idCountries ORDER BY DateStart\";\r\n\t\t\r\n\t\t$sql = \"SELECT p.id as idEvents, p.post_title as NameEnglish, \".\r\n\t\t\t\t\" e.post_id, e.country as Country, e.start as DateStart, e.end as DateEnd, e.contact_url as Website\".\r\n\t\t\t\t\" from wordpress.wp_posts p inner join wordpress.wp_ai1ec_events e on ( p.id = e.post_id)\".\r\n\t\t\t\t\" where post_type = \\\"ai1ec_event\\\" and post_status=\\\"publish\\\" order by DateStart;\";\r\n\t\t$result = $this->conn->query($sql);\r\n\t\treturn $result;\r\n\t}",
"function getMontlyConnectionAsJSON($anno) {\n $query = \"SELECT count(*) as connessioni, month(when_registered) as mese, \" .\n \" year(when_registered) as anno \" .\n \" FROM scuola.utenti_logger WHERE msg_type = 'LOGIN_SUCCESS'\" .\n \" AND year(when_registered) = \".$anno.\n \" GROUP BY month(when_registered)\" .\n \" ORDER BY when_registered\";\n if(\n mysql_connect(\"localhost\",\"root\",\"myzconun\")){\n mysql_select_db(\"scuola\");\n $results = mysql_query($query);\n\n if (!$results) {\n\n $msg = mysql_error();\n setcookie('message', mysql_errno() . ': ' . mysql_error());\n //mysql_freeresult();\n } else {\n $num_rows = mysql_num_rows($results);\n if($num_rows > 0){\n while($row=mysql_fetch_assoc($results)){\n $output[]=$row;\n }\n print(json_encode($output));// this will print the output in json\n mysql_close();\n }else{\n print(\"[{}]\");\n mysql_close();\n }\n\n }\n\n }\n }",
"public function onGetEvents()\n {\n $start = input('start');\n $end = input('end');\n // dd($start, $end);\n // trace_log($start, $end);\n $systemTZ = config(\"app.timezone\");\n $isConvertToFrontEndTimeZone = config(\"yfktn.eventgubernur::convertToFrontEndTimeZone\");\n // karena di tanggal yang diberikan waktu fullcalendar melakukan permintaan\n // events, pada string yang diberikan sudah ada informasi timezone nya\n // sehingga kita tidak perlu lagi melakukan proses setting manual timezone\n $startTZ = Carbon::parse($start);\n $endTZ = Carbon::parse($end);\n $frontEndTimeZone = $startTZ->timezone;\n // trace_log($startTZ, $endTZ);\n // trace_sql();\n // dapatkan dari db\n $events = EventsModel::whereBetween('tgl_mulai', [\n $startTZ->copy()->timezone($systemTZ), \n $endTZ->copy()->timezone($systemTZ)])\n ->get();\n trace_log($events->toArray(), ($isConvertToFrontEndTimeZone? \"TRUE\":\"FALSE\"));\n // loop untuk melakukan render ke JSON nya\n $data = [];\n $i = 0;\n foreach ($events as $e) {\n $satuHari = false;\n $data[$i]['id'] = $e->id;\n $data[$i]['title'] = $e->judul;\n $data[$i]['slug'] = $e->slug;\n $theStart = Carbon::parse(\"{$e->tgl_mulai} {$e->jam_mulai}\");\n if ($e->tgl_selesai == null) {\n // satu hari\n if ($e->jam_selesai == null) {\n // satu hari?\n $theEnd = $theStart->copy();\n $satuHari = true;\n } else {\n $theEnd = $theStart->copy()->setTimeFromTimeString($e->jam_selesai);\n }\n } else {\n if ($e->jam_selesai == null) {\n $theEnd = Carbon::parse(\"{$e->tgl_selesai}\");\n } else {\n $theEnd = Carbon::parse(\"{$e->tgl_selesai} {$e->jam_selesai}\", $systemTZ);\n }\n }\n trace_log($theStart->format(\"Y-m-d H:i\"), $theEnd->format(\"Y-m-d H:i\"));\n // kalau di set satu hari, maka set pada waktu time telah dirubah timezone nya!\n if($satuHari) {\n // $theEnd->setTime(\n // 23, 59, 59\n // );\n $data[$i]['start'] = $isConvertToFrontEndTimeZone ? \n $theStart->timezone($frontEndTimeZone)->format(\"Y-m-d\") :\n $theStart->shiftTimezone($frontEndTimeZone)->format(\"Y-m-d\");\n // untuk satu hari nilai end tidak perlu ditambahkan!\n // $data[$i]['end'] = null;\n } else {\n // dapatkan, convert ke timezone si front end dan set formatnya\n $data[$i]['start'] = $isConvertToFrontEndTimeZone?\n $theStart->timezone($frontEndTimeZone)->toIso8601String():\n $theStart->shiftTimezone($frontEndTimeZone)->toIso8601String();\n if($isConvertToFrontEndTimeZone) {\n $theEnd->timezone($frontEndTimeZone);\n } else {\n $theEnd->shiftTimezone($frontEndTimeZone);\n }\n if($e->jam_selesai == null) {\n // set di sini supaya menunjukkan sampai akhir hari itu / full satu hari!\n $theEnd->endOfDay();\n }\n $data[$i]['end'] = $theEnd->toIso8601String();\n }\n trace_log($data[$i]);\n $i = $i + 1;\n }\n return $data;\n }",
"function getEstacionesClimatologicas($query)\n{\n $EstacionClimatologica = new EstacionClimatologica();\n echo json_encode($EstacionClimatologica->getEstacionesTabla($query));\n}",
"function get_all(){\n $where = \"reservation_status <> 'Pending'\";\n $reservations = where( 'reservations', $where );\n\n echo json_encode( $reservations );\n exit;\n}",
"function list_data($start=\"\",$end=\"\")\n { \n $filter = array(); \n if($start!=\"\")\n {\n $filter = array(\n \"start\" => array( \n '$gte'=> $this->mongo_db->time((double) strtotime($start.\" 00:00:00\")), \n '$lt'=> $this->mongo_db->time((double) strtotime($end.\" 23:59:59\"))\n )\n );\n }\n $output['success'] = FALSE;\n $ceklogin = $this->cek_session->islogin();\n $output['logged_in'] = $ceklogin;\n if($ceklogin)\n { \n $this->mongo_db->select_db(\"Articles\");\n $this->mongo_db->select_collection(\"Event\"); \n $tempdata = $this->mongo_db->find($filter,0,0,array(\"start\"=>-1));\n $output['count'] = (int)$this->mongo_db->count2($filter);\n if($tempdata)\n {\n $output['success'] = TRUE;\n $listdata = array();\n foreach($tempdata as $dt)\n {\n $listdata[] = array(\n \"id\" => (string)$dt['_id'],\n \"allDay\" => (bool)$dt['allDay'],\n \"title\" => $dt['title'],\n \"color\" => $dt['color'],\n \"description\" => $dt['description'],\n \"url\" => $dt['url'],\n \"start_date\" => date('Y-m-d',$dt['start']->sec),\n \"start_time\" => date('H:i:s',$dt['start']->sec),\n \"end_date\" => date('Y-m-d',$dt['end']->sec),\n \"end_time\" => date('H:i:s',$dt['end']->sec),\n \"picture\" => $dt['picture'],\n \"url_picture\" => $this->config->item('path_asset_img') . \"preview_images/\" . $dt['picture']\n );\n } \n $output['data'] = $listdata;\n }\n }\n echo json_encode($output);\n }",
"function getTable($date)\n{\n list($year, $month) = explode(\"-\", $date);\n //echo $year + \", \";\n //echo $month + \", \";\n //echo $date + \", \";\n\n\n $days_in_month = cal_days_in_month(CAL_GREGORIAN, $month, $year);\n //echo \", \";\n\n // Creating connection\n include('DB_config.php');\n $conn = new mysqli($servername, $username, $password, $db_name);\n if ($conn->connect_error) {\n die(\"Connection failed: \" . $conn->connect_error);\n }\n echo '<script>console.log(\"[MySQL] Database connected successfully\")</script>';\n\n mysqli_set_charset($conn, \"utf8\");\n $sql = \"SELECT ID, NAME FROM users ORDER BY NAME\";\n $rs = $conn->query($sql);\n\n if ($rs->num_rows > 0) {\n $start = 0;\n $end = 0;\n $table = '<table id=\"dochadzka\">';\n $table .= '<col span=\"1\" class=\"wide\">';\n // first row\n $table .= '<tr><th>Meno</th>';\n $i = 1;\n while ($i != $days_in_month + 1) {\n if (isWeekend($year . \"-\" . $month . \"-\" . $i)) {\n $table .= '<th class = \"weekend\">' . $i++ . '.</th>';\n } else {\n $table .= '<th>' . $i++ . '.</th>';\n }\n\n }\n $table .= '</tr>';\n // end first row\n\n while ($row = $rs->fetch_assoc()) {\n //$table.='<option value=\"'.$row['id'].'\">'.$row['firstname'].' ' .$row['lastname'].'</option>';\n $table .= '<tr id=\"' . $row['ID'] . '\"><td id=\"name\">' . $row['NAME'] . '</td>';\n $user_id = $row['ID'];\n\n $sql = \"SELECT start_date,end_date,status_id FROM evidence WHERE user_id=\" . $user_id . \" AND MONTH(start_date)=\" . $month . \" AND YEAR(start_date)=\" . $year . \" ORDER BY id,start_date\";\n $rs1 = $conn->query($sql);\n $num_of_rows = $rs1->num_rows;\n if ($num_of_rows > 0) {\n $i = 1;\n\n $table_row = array();\n while ($i++ <= $days_in_month + 1) {\n array_push($table_row, \"<td></td>\");\n }\n\n while ($result = $rs1->fetch_assoc()) {\n\n\n list($year, $month, $day) = array_pad(explode('-', $result['start_date']), 3, null);\n $start = (int)$day;\n //echo $start.\" -> \";\n list($year, $month, $day) = array_pad(explode('-', $result['end_date']), 3, null);\n $end = (int)$day;\n //echo $end.\"<br />\";\n\n $i = $start;\n while ($end >= $i) {\n $table_row[$i++] = \"<td id=state\" . $result['status_id'] . \"></td>\";\n }\n /*\n if($num_of_rows > 1 && $j == $num_of_rows && $i < $days_in_month) {\n echo $i.\"<br />\";\n while($i++ != $days_in_month+1) {\n $table.='<th></th>';\n }\n }\n */\n\n\n //$start = 0;\n //$end = 0;\n }\n $i = 0;\n while ($i++ < $days_in_month) {\n $table .= $table_row[$i];\n }\n } else {\n $result = null;\n $i = 1;\n while ($i++ != $days_in_month + 1) {\n $table .= '<td></td>';\n }\n }\n\n }\n\n\n $table .= '</table>';\n echo $table;\n } else {\n echo \"0 results\";\n }\n\n}",
"public function displayCalendar($params)\n {\n $res = array(\n 'status' => 'ng',\n 'msg' => '',\n 'data' => array()\n );\n\n // data from the database\n $data = $this->getData($params);\n if ($data === false) {\n return $res;\n }\n\n // this will get the calendar date\n $date = $this->getDate($params);\n\n // combined data\n $calendarData = $this->getCalendarData($data, $date);\n\n // sorted data\n $sortedData = $this->sortedCalendar($calendarData);\n\n $res['status'] = 'ok';\n $res['data'] = array(\n 'site_url' => $params['site_url'],\n 'home_url' => home_url(),\n 'plugin_dir' => $params['plugin_dir'],\n 'calendarnm' => (int)$params['place'] > 1 ? '川下グラウンド':'拓北野球場',\n 'date' => substr($params['date'], 0, 4).'年'.substr($params['date'], -5, 2).'月',\n 'calendar' => $sortedData,\n 'next' => date(\"Y年m月\", mktime(0, 0, 0, substr($params['date'], -5, 2)+1, 1, substr($params['date'], 0, 4))),\n 'before' => date(\"Y年m月\", mktime(0, 0, 0, substr($params['date'], -5, 2)-1, 1, substr($params['date'], 0, 4))),\n 'type' => $params['place'],\n 'datenormal' => substr($params['date'], 0, 4).'-'.substr($params['date'], -5, 2),\n 'edit_date' => isset($params['edit_date'])?$params['edit_date']:''\n );\n\n return $res;\n }",
"function getEvents()\n{\n require_once 'model/dbConnector.php';\n $connexion = openDBConnexion();\n $request = $connexion->prepare('SELECT * FROM bdd_satisfevent.events ORDER BY Date Desc');\n $request->execute(array());\n $result = $request->fetchAll();\n return $result;\n}",
"public function resultsToJson ()\n {\n// $res = array();\n// foreach ($this->results() as $result)\n// {\n// array_push($res, array($result));\n// }\n return json_encode($this->results());\n }",
"public function toJson();",
"public function toJson();",
"function ajaxGetEmployeesFromDB() {\n $employeeArray = getEmployees();\n echo json_encode($employeeArray);\n }",
"public function getJsonBroDeployOverseas(){\n\t\t$query = \"Select BroDeployOverseas.post, Sum(bandwidth.capacity) as capacity, BroDeployOverseas.regularworkstation, BroDeployOverseas.regworkdeployed, BroDeployOverseas.regworkremaining,\n\t\t\tBroDeployOverseas.latitude, BroDeployOverseas.longitude, BroDeployOverseas.regworkpercentcompleted, BroDeployOverseas.vsenpercentcompleted,\n\t\t\tBroDeployOverseas.region, BroDeployOverseas.vsencompatableworkstation, BroDeployOverseas.vsendeployed, BroDeployOverseas.vsenremaining\n\t\t\tFrom public.BroDeployOverseas, public.bandwidth\n\t\t\tWhere BroDeployOverseas.post = bandwidth.post\n\t\t\tGroup By BroDeployOverseas.post, BroDeployOverseas.region, \n\t\t\tBroDeployOverseas.regworkpercentcompleted, BroDeployOverseas.vsenpercentcompleted, \n\t\t\tBroDeployOverseas.regularworkstation, BroDeployOverseas.regworkdeployed, BroDeployOverseas.regworkremaining,\n\t\t\tBroDeployOverseas.vsencompatableworkstation,\n\t\t\tBroDeployOverseas.vsendeployed, BroDeployOverseas.vsenremaining,\n\t\t\tBroDeployOverseas.latitude, BroDeployOverseas.longitude; \n\t\t\"; // There might be a better way to do this.\n\t\t$result = $this->connectPG($query);\t\t\t\n\t\t$rows = pg_fetch_all($result);\t\n\n\t\t$jsonArrayOfObjs = \"[\";\n\t\tforeach($rows as $keys => $datums){\n\t\t\t//Build JSON string\n\t\t\t$rows2 = array_keys($rows);\n\t\t\tif(end($rows2) == $keys){\n\t\t\t\t//This will be the last element in the array of objects\n\t\t\t\t$jsonArrayOfObjs .= \"{\";\n\t\t\t \t$jsonArrayOfObjs .= \"\\\"region\\\":\\\"\".trim($datums['region']).\"\\\", \\\"post\\\":\\\"\".trim($datums['post']).\"\\\",\"; \n\t\t\t \t$jsonArrayOfObjs .= \"\\\"regularworkstation\\\":\".$datums['regularworkstation'].\", \\\"regworkdeployed\\\":\".$datums['regworkdeployed'].\",\";\n\t\t\t \t$jsonArrayOfObjs .= \"\\\"regworkremaining\\\":\".$datums['regworkremaining'].\", \\\"regworkpercentcompleted\\\":\".$datums['regworkpercentcompleted'].\",\";\n\t\t\t \t$jsonArrayOfObjs .= \"\\\"vsencompatableworkstation\\\":\".$datums['vsencompatableworkstation'].\", \\\"vsendeployed\\\":\".$datums['vsendeployed'].\",\";\n\t\t\t \t$jsonArrayOfObjs .= \"\\\"vsenremaining\\\":\".$datums['vsenremaining'].\", \\\"vsenpercentcompleted\\\":\".$datums['vsenpercentcompleted'].\", \\\"capacity\\\":\".$datums['capacity'].\",\";\n\t\t\t \t$jsonArrayOfObjs .= \"\\\"latitude\\\":\".$datums['latitude'].\", \\\"longitude\\\":\".$datums['longitude'].\"\";\n\t\t \t$jsonArrayOfObjs .= \"}\";\n\t\t\t}else{\n\t\t\t\t$jsonArrayOfObjs .= \"{\";\n\t\t\t \t\t$jsonArrayOfObjs .= \"\\\"region\\\":\\\"\".trim($datums['region']).\"\\\", \\\"post\\\":\\\"\".trim($datums['post']).\"\\\",\"; \n\t\t\t \t$jsonArrayOfObjs .= \"\\\"regularworkstation\\\":\".$datums['regularworkstation'].\", \\\"regworkdeployed\\\":\".$datums['regworkdeployed'].\",\";\n\t\t\t \t$jsonArrayOfObjs .= \"\\\"regworkremaining\\\":\".$datums['regworkremaining'].\", \\\"regworkpercentcompleted\\\":\".$datums['regworkpercentcompleted'].\",\";\n\t\t\t \t$jsonArrayOfObjs .= \"\\\"vsencompatableworkstation\\\":\".$datums['vsencompatableworkstation'].\", \\\"vsendeployed\\\":\".$datums['vsendeployed'].\",\";\n\t\t\t \t$jsonArrayOfObjs .= \"\\\"vsenremaining\\\":\".$datums['vsenremaining'].\", \\\"vsenpercentcompleted\\\":\".$datums['vsenpercentcompleted'].\", \\\"capacity\\\":\".$datums['capacity'].\",\";\n\t\t\t \t$jsonArrayOfObjs .= \"\\\"latitude\\\":\".$datums['latitude'].\", \\\"longitude\\\":\".$datums['longitude'].\"\";\n\t\t \t$jsonArrayOfObjs .= \"},\";\n\t\t\t}\n\n\t\t} \n\t\t$jsonArrayOfObjs .= \"]\"; \n\t\t//error_log($jsonArrayOfObjs);\n\n\t\t$cleanJsonStr = json_decode($jsonArrayOfObjs);\n\n\t\t//Validate the JSON\n\t\tif($cleanJsonStr === NULL){error_log(\"Error in JSON in getJsonBroDeployOverseas() method.\"); }else{return $jsonArrayOfObjs;}\n\t}",
"public function ajaxevents() {\n\t\t$pageTitle = 'Events';\n\t\t$this->autoRender = false;\n\t\t$this->viewBuilder()->setLayout(false);\n\t\t$this->loadModel('Events');\n\t\t$today = date(\"Y-m-d\");\n\t\tif ($this->request->is('ajax')) {\n\n\t\t\t$events = $this->Events->find()->where(['Events.published' => 1, 'DATE(Events.start_date) >' => $today])->order(['Events.start_date' => 'ASC'])->limit(3)->offset($this->request->getData()['offset'])->all();\n\t\t\techo json_encode(array(\"status\" => \"success\", \"data\" => $events));\n\t\t\texit;\n\n\t\t}\n\n\t}",
"public function outputJSON () { \r\n \r\n echo '{'; // begin the object \r\n echo '\"customers\":'; \r\n echo '['; // begin the array \r\n \r\n\t\t//Connect\r\n $pdo = Database::connect(); \r\n $sql = 'SELECT * FROM registrations ORDER BY id DESC'; \r\n \r\n $str = ''; \r\n\t\t//For each listed\r\n foreach ($pdo->query($sql) as $row) { \r\n $str .= '{'; \r\n $str .= '\"id\":\"'. $row['id'] . '\", '; \r\n $str .= '\"name\":\"'. $row['class'] . '\",'; \r\n\t\t\t$str .= '\"name\":\"'. $row['startTime'] . '\",'; \r\n $str .= '\"email\":\"'. $row['endTime'] . '\",'; \r\n $str .= '\"mobile\":\"'. $row['day']. '\"';; \r\n $str .= '},'; \r\n } \r\n\t\t\r\n $str = substr($str, 0, -1); // remove last comma \r\n echo $str; \r\n //Disconnect\r\n Database::disconnect(); \r\n echo ']'; // close the array \r\n echo '}'; // close the object \r\n }",
"public function jsonListByDate()\n {\n $date = $_GET['date'];\n $bookingMgr = new BookingMgr();\n $bookings = $bookingMgr->getBookingPaginationByDate($date);\n return $bookings;\n }",
"public function ajaxDatatableAgendamentoFinalizado()\n { \n $sql = \"\n SELECT\n a.idAgendamento,\n a.dataInicio,\n a.dataFim,\n idUsuario,\n u.nome_usuario,\n e.razaoSocial AS empresa\n FROM \n z_sga_fluxo_agendamento_acesso a\n LEFT JOIN\n z_sga_usuarios u\n ON a.idUsuario = u.z_sga_usuarios_id\n LEFT JOIN\n z_sga_empresa e\n ON a.idEmpresa = e.idEmpresa\n WHERE \n a.situacao = 1\n AND dataInicio <= NOW()\n ORDER BY\n dataInicio ASC\";\n\n try{\n $sql = $this->db->query($sql);\n return array(\n 'return' => true,\n 'result' => $sql->fetchAll()\n );\n }catch (Exception $e){\n return array(\n 'result' => false,\n 'error' => $e->getMessage()\n );\n }\n }",
"function icsAJson($temp){\n\t$original = array(\"BEGIN:VCALENDAR\", \"END:VCALENDAR\", \"PRODID:\", \"BEGIN:VEVENT\", \"END:VEVENT\", \"VERSION:\", \"CALSCALE:\",\n\t\"METHOD:\", \"X-WR-CALNAME:\", \"X-WR-TIMEZONE:\", \"X-WR-CALDESC:\", \"DTSTART:\", \"DTEND:\", \"DTSTAMP:\", \"UID:\", \"CREATED:\", \"DESCRIPTION:\",\n\t\"LAST-MODIFIED:\", \"LOCATION:\", \"SEQUENCE:\", \"STATUS:\", \"SUMMARY:\", \"TRANSP:TRANSPARENT\", \"TRANSP:OPAQUE\", \"X-GOOGLE-HANGOUT:\" , \"DTSTART;VALUE=DATE:\", \"DTEND;VALUE=DATE:\",\n\t'\\n', '\\r', '<br />', '<br \\/>', '\\/', '\"{\"VCALENDAR');\n\t$cambiadas = array('{\"VCALENDAR\":[{', '}]}', '\"PRODID\":\"', ', \"VEVENT\":[', ']', '\", \"VERSION\": \"', '\", \"CALSCALE\": \"', '\", \"METHOD\":\"',\n\t'\", \"X-WR-CALNAME\":\"', '\", \"X-WR-TIMEZONE\":\"' , '\", \"X-WR-CALDESC\":\"\"', '{\"DTSTART\":\"', '\", \"DTEND\":\"', '\", \"DTSTAMP\":\"', '\", \"UID\":\"',\n\t'\", \"CREATED\":\"', '\", \"DESCRIPTION\":\"', '\", \"LAST-MODIFIED\":\"', '\", \"LOCATION\":\"', '\", \"SEQUENCE\":\"', '\", \"STATUS\":\"', '\", \"SUMMARY\":\"',\n\t'\", \"TRANSP\":\"TRANSPARENT\"}', '\", \"TRANSP\":\"OPAQUE\"}', '\", \"X-GOOGLE-HANGOUT\":\"' , '{\"DTSTART\":\"', '\", \"DTEND\":\"',\n\t'', '', '', '', '/', '{\"VCALENDAR');\n\t$newphrase = trim(str_replace($original, $cambiadas, $temp));\n\t//Busco los Eventos del calendario\n\t$busco = '\"VEVENT\"';\n\t$pos = strpos($newphrase, $busco);\n\t$primerParte = \"\";\n\t$segundaParte = \"\";\n\t$terceraParte = \"]}]}\";\n\t$salida = \"\";\n\tif ($pos !== false) {\n\t\t//Al encontrar al primer Evento separo el texto en 2 partes, la primera con lo anterior a este\n\t\t$primerParte = (substr($newphrase, 0, $pos)) . '\"VEVENT\":[';\n\t\t//La segunda parte contendra los Eventos a medio camino de estar en formato JSON\n\t\t$temp = substr($newphrase, $pos, ((strlen($newphrase)-5) - $pos));\n\t\t//Cambio esta segunda parte para darle el formato que corresponde\n\t\t$original = array('\"VEVENT\":[', \"]\");\n\t\t$cambiadas = array('', '');\n\t\t$segundaParte = trim(str_replace($original, $cambiadas, $temp));\n\t\t//Uno las 3, Inicio, Eventos y el Final que contiene los cierres de llaves necesarios\n\t\t$salida = $primerParte . $segundaParte . $terceraParte;\t\t\n\t}\n\treturn ($salida);\n}",
"function queryResultToJSON($qResult,$parameters=NULL,$allFields=NULL)\r\n\t{\r\n//If configuration is not defined we add the fields in the result of the query by default.\r\n\t\tif (!is_array($parameters['columns']))\r\n\t\t{\r\n\t\t\t$fieldNum = mysql_num_fields($qResult);\r\n\t\t\t$fields = array();\r\n\t\t\tfor ($i=0; $i<$fieldNum; $i++)\r\n\t\t\t\t$fields []= mysql_field_name($qResult,$i);\r\n\t\t\t$parameters['columns'] = fieldsToParams($fields);\t\r\n\t\t}\r\n\t\treturn resultToJSON($qResult,$parameters,$allFields);\r\n\t}",
"public function GetJSON()\r\n\t{\r\n\t\tif( $this->last_result )\r\n\t\t{\r\n\t\t\tif( $this->RowCount() > 0 )\r\n\t\t\t{\r\n\t\t\t\tfor( $i = 0, $il = mysql_num_fields( $this->last_result ); $i < $il; $i++ )\r\n\t\t\t\t{\r\n\t\t\t\t\t$types[$i] = mysql_field_type( $this->last_result, $i );\r\n\t\t\t\t}\r\n\t\t\t\t$json = '[';\r\n\t\t\t\t$this->MoveFirst();\r\n\t\t\t\twhile( $member = mysql_fetch_object( $this->last_result ) )\r\n\t\t\t\t{\r\n\t\t\t\t\t$json .= json_encode( $member ) . \",\";\r\n\t\t\t\t}\r\n\t\t\t\t$json .= ']';\r\n\t\t\t\t$json = str_replace(\"},]\", \"}]\", $json );\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$json = 'null';\r\n\t\t\t}\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$this->active_row = -1;\r\n\t\t\t$json = 'null';\r\n\t\t}\r\n\t\treturn $json;\r\n\t}",
"public function _listTotalBoletaDate() {\n $db = new SuperDataBase();\n $query = \"CALL sp_get_report_sale_pordia('$this->dateGO')\";\n $resul = $db->executeQuery($query);\n//pkComprobante, pkMesa, estado_pago, tipoComprobante, total_tarjeta, total_efectivo, descuento, total_venta, tipo_tarjeta, pkCliente, pkMozo, fechaPago, hora_entrada, hora_salida, fecha_modificacion, idUsuario, npersonas\n $array = array();\n $total = 0;\n while ($row = $db->fecth_array($resul)) {\n $array[] = array(\"pkComprobante\" => $row['pkPediido'],\n \"pkMesa\" => $row['pkMesa'],\n \"total_venta\" => $row['total'],\n \"horaEntrada\" => $row['horaEntrada'],\n \"nmesa\" => $row['nmesa'],\n \"npersonas\" => $row['npersonas'],\n// \"tcomprobante\" => $row['tipo_comprobante'],\n \"descuento\" => $row['descuento'],\n// \"totalTarjeta\" => $row['total_tarjeta'],\n );\n// $total=$total+$row['total_venta'];\n }\n// $array[]= array('Total')\n// echo $query;\n echo json_encode($array);\n }",
"function getAllClassInfo() {\n \n $dbQuery = \"SELECT * FROM CRC_Schedule_Info\";\n $result = getDBResultsArray($dbQuery);\n header(\"Content-type: application/json\");\n echo json_encode($result);\n }",
"function fetchUserjsonLG()\n\t{\n\t// Example query\n\t$db = DB::getInstance();\n\t$stmt = $db->query(\"SELECT COUNT(*) AS sum1,sign_up_stamp\tFROM users GROUP BY DAY(FROM_UNIXTIME(sign_up_stamp))ORDER BY sign_up_stamp DESC\");\n\t$stmt->execute();\n\t$stmt->bind_result($sum1, $name);\n\twhile ($stmt->fetch())\n\t\t{\n\t\t$row[] = array('sum1' => $sum1, 'sign_up_stamp' => $name);\n\t\t}\n\t$stmt->close();\n\treturn ($row);\n\t}",
"function getEstacionClimatologicaMuni($query)\n{\n $EstacionClimatologica = new EstacionClimatologica();\n echo json_encode($EstacionClimatologica->getEstacionesMuni($query));\n}",
"public function json() {\n\t\t$this->datatables->select('\n\t\t\ttb_jadwal_latihan.id,\n\t\t\ttb_jadwal_latihan.id_pelatih,\n\t\t\ttb_jadwal_latihan.hari,\n\t\t\tCONCAT(tb_jadwal_latihan.jam_mulai,\" s/d \",tb_jadwal_latihan.jam_selesai) as jam,\n\t\t\ttb_pelatih.nama');\n\t\t$this->datatables->from($this->table);\n\t\t$this->datatables->join('tb_pelatih', 'tb_jadwal_latihan.id_pelatih=tb_pelatih.id');\t\t\n\t\t$this->datatables->add_column('view', '<div align=\"center\">\n\t\t\t<a class=\"btn btn-warning btn-rounded btn-sm\" href=\"javascript:void(0)\" title=\"Edit\" onclick=\"edit($1)\"> <span class=\"fa fa-edit\"></span></a>\n\t\t\t<a class=\"btn btn-danger btn-rounded btn-sm\" href=\"javascript:void(0)\" title=\"Hapus\" onclick=\"hapus($1)\" > <span class=\"fa fa-trash\"></span></a>\n\t\t\t</div>', 'id');\n\t\treturn $this->datatables->generate();\n\t}",
"public function jsonAddDate()\n {\n $mailingKeySearch = date('Y-m-d H:i:s');\n $arrayMailing = (Mailing::findAllEmail($this->id_mailing) == 0) ? array() : Mailing::findAllEmail($this->id_mailing);\n $arrM = implode(',', $arrayMailing);\n if (is_array($arrayDate = json_decode($this->date_change, true))) {\n $arrayDate[$mailingKeySearch] = $arrM;\n } else {\n $arrayDate = array($mailingKeySearch => $arrM);\n }\n return $arrayDate;\n }",
"function getSaldoInicial($sucursal_id, $pos_id)\n{\n $db = new MysqliDb();\n\n $lastCaja = getLastCaja($sucursal_id, $pos_id);\n echo json_encode($lastCaja[\"saldo_inicial\"]);\n\n\n}",
"public function dispalyEventsTable(){\n $sql=\"SELECT * FROM `events` ORDER BY `event_date` asc\";\n $result=$this->conn->query($sql);\n $rows=array();\n\n if($result->num_rows>0){\n while($displayEvent=$result->fetch_assoc()){\n $rows[]=$displayEvent;\n }\n return $rows;\n }else{\n return false;\n }\n\n }",
"function obtenerSesion_agendar(){\n\t\t\n\t\t$query1 = ('select sesion.id, sesion.checkin, sesion.pagada, sesion.id_servicio, sesion.id_usuario, sesion.id_agenda, sesion.ejecutada, usuario.nombre,\n\t\t\t\t\tusuario.apellido, servicio.descripcion , cliente.nombre as nombre_cliente , cliente.apellido as apellido_cliente from sesion \n\t\t\t\t\tInner JOIN usuario\n\t\t\t\t\ton sesion.id_usuario = usuario.id\n\t\t\t\t\tInner Join servicio\n\t\t\t\t\ton sesion.id_servicio = servicio.id\n\t\t\t\t\tInner Join cliente\n\t\t\t\t\ton sesion.id_cliente = cliente.id\n\t\t\t\t\twhere sesion.id_agenda is NULL'); //QUERY PARA OBTENER TODO DE UNA VEZ.\n\t\t$query = $this->db->query($query1);\n\t\t\n\t\t\n\t //$query = $this->db->get('sesion');\n\t if($query-> num_rows() > 0) return $query->result_array();\n\t else return false ;\n\t \n\t \n\t}",
"function json_FinishingList($supplierID) {\n\t\t$query = \"SELECT * FROM finishing where SupplierID = '$supplierID' Order by finishing DESC\";\n\t\t\n\t\tmysql_connect(DB_SERVER, DB_USER, DB_PASSWORD);\n\t\tmysql_select_db(DB_NAME);\n \t\n\t\t\t$result = mysql_query($query) or die(mysql_error());\t\t\n\t\t\t$rows = Array(); // returned object\n\t\t\t$rows['identifier'] = \"FinID\";\n\t\t\t$rows['label'] = \"Supp_FinishingNum\";\n \t\t\twhile($r=mysql_fetch_assoc($result)) {\n \t\t\t $rows['items'][] = $r;\n \t\t\t}\n\n\t\t\treturn json_encode($rows);\n\n\t}",
"function draw_calendar($month,$year){\r\n\t/*Naredi koledar*/\r\n\t$calendar = '<table cellpadding=\"0\" cellspacing=\"0\" class=\"calendar\">';\r\n\t\r\n\t$headings = array('Nedelja','Ponedeljek','Torek','Sreda','Cetrtek','Petek','Sobota');\r\n\t$calendar.= '<tr class=\"calendar-row\"><td class=\"calendar-day-head\">'.implode('</td><td class=\"calendar-day-head\">',$headings).'</td></tr>';\r\n\r\n\t$running_day = date('w',mktime(0,0,0,$month,1,$year));\r\n\t$days_in_month = date('t',mktime(0,0,0,$month,1,$year));\r\n\t$days_in_this_week = 1;\r\n\t$day_counter = 0;\r\n\t$dates_array = array();\r\n\r\n\t$calendar.= '<tr class=\"calendar-row\">';\r\n\r\n\tfor($x = 0; $x < $running_day; $x++):\r\n\t\t$calendar.= '<td class=\"calendar-day-np\"> </td>';\r\n\t\t$days_in_this_week++;\r\n\tendfor;\r\n\r\n\tfor($list_day = 1; $list_day <= $days_in_month; $list_day++):\r\n\t\tif($list_day < 10) {\r\n $list_day = str_pad($list_day, 2, '0', STR_PAD_LEFT);\r\n }\r\n\t\t$month = str_pad($month, 2, '0', STR_PAD_LEFT);\r\n\t\t$event_day = $year.'-'.$month.'-'.$list_day;\r\n\r\n\t\t$calendar.= '<td class=\"calendar-day\"><div name=\"test\" style=\"height:100px; width:120px; overflow: auto; white-space:nowrap\" id=' .$event_day. ' onclick=\"modal(this.id);\">';\r\n\t\t$calendar.= '<div>'.$list_day.'</div>';\t\r\n\t\t$query = \"SELECT CONCAT_WS(' ',s.firstname,s.lastname) as Zaposleni, a.name, aa.aktivnost_id\r\n\t\t\tFROM ost_staff s, ost_agent_aktivnost aa, ost_aktivnosti a\r\n\t\t\tWHERE s.staff_id = aa.staff_id and a.id=aa.aktivnost_id and '$event_day' BETWEEN aa.aktivnost_od AND aa.aktivnost_do AND aa.aktivnost_id > 1 AND aa.aktivnost_id != 9 AND aa.aktivnost_id != 10\";\r\n\t\t\t$result = db_query($query) or die('Ne morem pridobiti rezultata!');\r\n\t\t\twhile($row = db_fetch_array($result)) {\r\n\t\t\t\t$words = explode(' ',$row['Zaposleni']);\r\n\t\t\t\t$calendar .= '<div>'.$words[0][0].'. '.$words[1][0].'. : '.$row['name'].'</div>';\r\n\t\t\t}\r\n\t\t$calendar.= '</div></td>';\r\n\t\tif($running_day == 6):\r\n\t\t\t$calendar.= '</tr>';\r\n\t\t\tif(($day_counter+1) != $days_in_month):\r\n\t\t\t\t$calendar.= '<tr class=\"calendar-row\">';\r\n\t\t\tendif;\r\n\t\t\t$running_day = -1;\r\n\t\t\t$days_in_this_week = 0;\r\n\t\tendif;\r\n\t\t$days_in_this_week++; $running_day++; $day_counter++;\r\n\tendfor;\r\n\r\n\tif($days_in_this_week < 8):\r\n\t\tfor($x = 1; $x <= (8 - $days_in_this_week); $x++):\r\n\t\t\t$calendar.= '<td class=\"calendar-day-np\"> </td>';\r\n\t\tendfor;\r\n\tendif;\r\n\r\n\t$calendar.= '</tr>';\r\n\r\n\t$calendar.= '</table>';\r\n\r\n\t$calendar = str_replace('</td>','</td>'.\"\\n\",$calendar);\r\n\t$calendar = str_replace('</tr>','</tr>'.\"\\n\",$calendar);\r\n\r\n\treturn $calendar;\r\n}",
"public function timeList(){\n\t echo json_encode($this->sched_time->fetchData());\n\t}",
"function getAnnouncements($all)\n { \n if($all == 1)\n {\n // Request for ALL announcements\n $dbQuery = sprintf(\"SELECT * FROM CRC_Announcements_Info ORDER BY StartDate DESC\");\n }\n else\n {\n // Request for VALID announcements based on date\n $dbQuery = sprintf(\"SELECT * FROM CRC_Announcements_Info WHERE StartDate <= CURDATE() AND EndDate >= CURDATE() ORDER BY StartDate DESC\");\n }\n $result = getDBResultsArray($dbQuery);\n \n // Return data payload as JSON\n header(\"Content-type: application/json\");\n echo json_encode($result);\n }",
"function sqlData($sql){\n // \n $result = $this->query($sql);\n //\n //\n if (!$result) {\n print \"<p>Could not retrieve data: </p>\";\n }\n while ($row = $result->fetchAll()) {\n $data = $row;\n return json_encode($data);\n }\n }",
"public function eventsSchema($rows,$userid)\n\t{\n\t\t$lang = JFactory::getLanguage();\n\t\t$lang->load('com_easysocial', JPATH_ADMINISTRATOR, '', true);\n\t\t$result = array();\t\t\n\t\tforeach($rows as $ky=>$row)\n\t\t{\n\t\t\tif(isset($row->id))\n\t\t\t{\t\n\t\t\t\t$item = new EventsSimpleSchema();\n\t\t\t\t\n\t\t\t\t/*Get Cover POsition */\n\t\t\t\t$grpobj = FD::event( $row->id );\n\t\t\t\t$x = $grpobj->cover->x;\n\t\t\t\t$y = $grpobj->cover->y;\n\t\t\t\t$item->cover_position = $x.'% '.$y.'%';\n\t\t\t\t\n\t\t\t\t$item->id=$row->id;\n\t\t\t\t$item->title=$row->title;\n\t\t\t\t$item->description=$row->description;\n\t\t\t\t//getting all event images\n\t\t\t\tforeach($row->avatars As $ky=>$avt)\n\t\t\t\t{\n\t\t\t\t\t$avt_key = 'avatar_'.$ky;\n\t\t\t\t\t$item->$avt_key = JURI::root().'media/com_easysocial/avatars/event/'.$row->id.'/'.$avt;\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t$fst = JFile::exists('media/com_easysocial/avatars/event/'.$row->id.'/'.$avt);\n\t\t\t\t\t//set default image\n\t\t\t\t\tif(!$fst)\n\t\t\t\t\t{\n\t\t\t\t\t\t$item->$avt_key = JURI::root().'media/com_easysocial/defaults/avatars/event/'.$ky.'.png';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//end\n\t\t\t\n\t\t\t\t$item->params=json_decode($row->params);\n\t\t\t\t$item->details=$row->meta;\n\t\t\t\t//ios format date\n\t\t\t\tif(!empty($item->details->start))\n\t\t\t\t{\t\t\t\t\t\n\t\t\t\t\t$item->details->ios_start = $this->listDate($item->details->start);\n\t\t\t\t\t$item->start_date = date('D M j Y h:i a',strtotime($row->meta->start));\t\t\t\t\t\n\t\t\t\t\t$item->start_date_unix = strtotime($row->meta->start);\n\t\t\t\t}\t\t\t\t\t\t\t\t\n\t\t\t\t\n\n\t\t\t\tif( $item->details->end == \"0000-00-00 00:00:00\")\n\t\t\t\t{\n\t\t\t\t\t$item->details->ios_end = null;\n\t\t\t\t\t$item->end_date = null;\n\t\t\t\t\t$item->end_date_unix = null;\n\t\t\t\t}\n\t\t\t\telse\t\t\t\t\n\t\t\t\t{\n\t\t\t\t\t$item->details->ios_end = $this->listDate($item->details->end);\n\t\t\t\t\t$item->end_date = date('D M j Y h:i a ',strtotime($row->meta->end));\n\t\t\t\t\t$item->end_date_unix = strtotime($row->meta->end);\n\t\t\t\t}\n\n\t\t\t\t$item->start_date_unix = strtotime($row->meta->start);\n\t\t\t\t$item->end_date_unix = strtotime($row->meta->end);\n\t\t\t\t\n\t\t\t\t$event = FD::model( 'events' );\n\t\t\t\t$item->guests= $event->getTotalAttendees($row->id);\n\t\t\t\t\n\t\t\t\t$item->featured=$row->featured;\n\t\t\t\t$item->created=$row->created;\n\t\t\t\t$item->categoryId=$row->category_id;\n\t\t\t\t$item->type=$row->type;\n\t\t\t\n\t\t\t\t//get category name\n\t\t\t\t$category \t= FD::table('EventCategory');\n\t\t\t\t$category->load($row->category_id);\t\t\t\t\n\t\t\t\t$item->category_name = $category->get('title');\n\t\t\t\t\n\t\t\t\t//event guest status\n\t\t\t\t$eventobj=FD::event($row->id);\t\n\t\t\t\t$item->isAttending=$eventobj->isAttending($userid);\n\t\t\t\t$item->isNotAttending=$eventobj->isNotAttending($userid);\n\t\t\t\t$item->isOwner=$eventobj->isOwner($userid);\n\t\t\t\t$item->isPendingMember = $eventobj->isPendingMember($userid);\n\t\t\t\t$item->isMember=$eventobj->isMember($userid);\t\n\t\t\t\t$item->isRecurring=$eventobj->isRecurringEvent(); \n\t\t\t\t$item->hasRecurring=$eventobj->hasRecurringEvents();\t\t\t\t\n\t\t\t\t\n\t\t\t\t$event_owner = reset($row->admins);\n\t\t\t\tif($event_owner)\n\t\t\t\t{\n\t\t\t\t$item->owner = $this->createUserObj($event_owner)->username;\n\t\t\t\t$item->owner_id = $event_owner;\n\t\t\t\t} \t\t\n\t\t\t\t//$item->owner=$user->username;\n\t\t\t\t\n\t\t\t\t$item->isMaybe=in_array($userid,$row->maybe);\n\t\t\t\t$item->total_guest=$eventobj->getTotalGuests();\n\t\t\t\t// this node is for past events\n\t\t\t\t$item->isoverevent=$eventobj->isOver();\n\t\t\t\tif($item->end_date == null){\n\t\t\t\t\t$item->isoverevent = false;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$item->location=$row->address;\n\t\t\t\t$item->longitude=$row->longitude;\n\t\t\t\t$item->latitude=$row->latitude;\n\t\t\t\t$NameLocationLabel = $item->location;\n\t\t\t\t$item->event_map_url_andr = \"geo:\".$item->latitude.\",\".$item->longitude.\"?q=\".$NameLocationLabel;\n\t\t\t\t$item->event_map_url_ios = \"http://maps.apple.com/?q=\".$NameLocationLabel.\"&sll=\".$item->latitude.\",\".$item->longitude;\t\t\t\t\n\t\t\t\t$item->share_url = JURI::root().$eventobj->getPermalink(true, false, 'item', false);\n\t\t\t\t//getting cover image of event\n\t\t\t\t$eve = FD::table( 'Cover' );\n\t\t\t\t$eve->type='event';\n\t\t\t\t$eve->photo_id=$row->cover->photo_id;\n\t\t\t\t$item->cover_image=$eve->getSource();\n\t\t\t\t//end\n\t\t\t\t$item->isInvited = false;\n\t\t\t\t$event = FD::event($row->id);\n\t\t\t\t$guest = $event->getGuest($userid);\n\t\t\t\tif ($guest->invited_by) {\t\n\t\t\t\t\t$item->isInvited = true;\n\t\t\t\t}\n\t\t\t\t$result[] = $item;\n\t\t\t}\n\t\t}\n\t\treturn($result);\t\n\t}",
"function daysToJson($parameter){\n\t\t$days = json_encode($parameter);\n\t\treturn $days;\n\t}",
"public function getCalendars($params){\n /**\n * @var integer $month 0 last month, 1 current month, 2 next month\n */\n $month = isset($params['month']) ? $params['month'] : 1;\n switch ($month){\n case 0:$date = date(\"Y-m-1\",strtotime(\"-1 month\"));break;\n case 1:$date = date(\"Y-m-1\",time());break;\n case 2:$date = date(\"Y-m-1\",strtotime(\"+1 month\"));break;\n default:$date = date(\"Y-m-1\",time());break;\n }\n $month = intval(date(\"m\",strtotime($date)));\n $week = date(\"w\",strtotime($date));\n $start = strtotime($date) - $week * 24 * 3600;\n $end = $start + 41 * 24 * 3600;\n\n $cser = $this->searchByTime($start,$end); /// 排班表内容\n $data = [];\n for ($i = 0; $i < 42; $i++){\n $i_time = $start + $i * 24 * 3600;\n $i_month = intval(date(\"m\",$i_time));\n $data[$i]['day'] = intval(date(\"d\",$i_time));\n $data[$i]['date'] = date(\"Y-m-d\",$i_time);\n $data[$i]['off'] = $i_month != $month ? true : false;\n $data[$i]['on'] = date(\"Y-m-d\",time()) == $data[$i]['date'] ? true : false;\n $flag = false;\n foreach ($cser as $k => $cs){\n if($cs['time'] == $i_time){\n $data[$i]['name'] = $cs['scheduler']['name'];\n $data[$i]['id'] = $cs['s_id'];\n $flag = true;\n unset($cser[$k]);\n break;\n }\n if($cs['time'] < $i_time){\n break;\n }\n }\n if(!$flag){\n $data[$i]['name'] = '无';\n $data[$i]['id'] = null;\n }\n }\n return $data;\n }",
"public function _listTotalBoleta2Date() {\n $db = new SuperDataBase();\n $pkEmpresa = UserLogin::get_pkSucursal();\n $query = \"CALL sp_get_listboleta('$this->dateGO','$this->dateEnd','$pkEmpresa')\";\n $resul = $db->executeQuery($query);\n\n $array = array();\n $total = 0;\n\n while ($row = $db->fecth_array($resul)) {\n $array[] = array(\"pkComprobante\" => $row['ncomprobante'],\n \"total\" => $row['total'],\n \"ruc\" => $row['ruc'],\n \"subTotal\" => $row['subTotal'],\n \"impuesto\" => $row['impuesto'],\n \"totalEfectivo\" => $row['totalEfectivo'],\n \"totalTarjeta\" => $row['totalTarjeta'],\n \"nombreTarjeta\" => $row['nombreTarjeta'],\n \"fecha\" => $row['fecha'],\n \"pkCajero\" => $row['pkCajero'],\n \"descuento\" => $row['descuento'],\n \"pkCliente\" => $row['pkCliente'],\n \"Nombre_Trabajador\" => $row['Nombre_Trabajador'],\n );\n// $total=$total+$row['total_venta'];\n }\n// $array[]= array('Total')\n// echo $query;\n echo json_encode($array);\n }",
"function getRosterClientDataByDate($post,$deviceType,$appVersion,$OSVersion,$browserVersion)\n{\n $Date = date('Y-m-d');\n $OrgID = $post['OrgID'];\n $con=connectToDB(); //connect to the DB\n mysql_query('SET NAMES UTF8');\n $result = mysql_query(\"call getRosterClientDataByDate('\".$Date.\"','\".$OrgID.\"');\");\n if (!$result) die('Invalid query: ' . mysql_error());\n $rows = array();\n while($row = mysql_fetch_assoc($result)) {\n $row1['id'] = $row['CustomerID'];\n $row1['text'] = $row['CustomerName'];\n $rows[] = $row1;\n }\n print json_encode($rows);\n mysql_close($con); //close the connection\n}",
"public function calendars()\n\t{\n\t\t// -------------------------------------\n\t\t// Load 'em up\n\t\t// -------------------------------------\n\n\t\t$this->load_calendar_datetime();\n\t\t$this->load_calendar_parameters();\n\n\t\t// -------------------------------------\n\t\t// Prep the parameters\n\t\t// -------------------------------------\n\n\t\t$params = array(\n\t\t\tarray(\n\t\t\t\t'name' => 'category',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'string',\n\t\t\t\t'multi' => TRUE\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'site_id',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'integer',\n\t\t\t\t'min_value' => 1,\n\t\t\t\t'multi' => TRUE,\n\t\t\t\t'default' => $this->data->get_site_id()\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'calendar_id',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'integer',\n\t\t\t\t'min_value' => 1,\n\t\t\t\t'multi' => TRUE,\n\t\t\t\t'not' => TRUE\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'calendar_name',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'string',\n\t\t\t\t'multi' => TRUE,\n\t\t\t\t'not' => TRUE\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'status',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'string',\n\t\t\t\t'multi' => TRUE,\n\t\t\t\t'default' => 'open'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'date_range_start',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'date'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'date_range_end',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'date'\n\t\t\t)\n\t\t);\n\n\t\t//ee()->TMPL->log_item('Calendar: Processing parameters');\n\n\t\t$this->add_parameters($params);\n\n\t\t// -------------------------------------\n\t\t// Convert calendar_name to calendar_id\n\t\t// -------------------------------------\n\n\t\tif ($this->P->value('calendar_id') == '' AND\n\t\t\t$this->P->value('calendar_name') != '')\n\t\t{\n\t\t\t$ids = $this->data->get_calendar_id_from_name(\n\t\t\t\t$this->P->value('calendar_name'),\n\t\t\t\tNULL,\n\t\t\t\t$this->P->params['calendar_name']['details']['not']\n\t\t\t);\n\n\t\t\tif ( empty( $ids ) )\n\t\t\t{\n\t\t\t\t//ee()->TMPL->log_item('Calendar: No results for\n\t\t\t\t//calendar name provided, bailing');\n\t\t\t\treturn $this->no_results();\n\t\t\t}\n\n\t\t\t$this->P->set('calendar_id', implode('|', $ids));\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// Determine which calendars this user has permission to view\n\t\t// and modify the parameters accordingly.\n\t\t// -------------------------------------\n\n\t\t// TODO\n\n\t\t// -------------------------------------\n\t\t// Fetch the basics\n\t\t// -------------------------------------\n\n\t\t$data = $this->data->fetch_calendars_basics(\n\t\t\t$this->P->value('site_id'),\n\t\t\t$this->P->value('calendar_id'),\n\t\t\t$this->P->params['calendar_id']['details']['not']\n\t\t);\n\n\t\t// -------------------------------------\n\t\t// If no data, then give 'em no_results\n\t\t// -------------------------------------\n\n\t\tif (($total_results = count($data)) == 0)\n\t\t{\n\t\t\t//ee()->TMPL->log_item('Calendar: No results, bailing');\n\t\t\treturn $this->no_results();\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// Ensure date_range_start <= date_range_end\n\t\t// -------------------------------------\n\n\t\tif ($this->P->value('date_range_start') !== FALSE AND\n\t\t\t$this->P->value('date_range_end') !== FALSE)\n\t\t{\n\t\t\tif ($this->P->value('date_range_start', 'ymd') > $this->P->value('date_range_end', 'ymd'))\n\t\t\t{\n\t\t\t\t$temp = $this->P->params['date_range_start']['value'];\n\t\t\t\t$this->P->set('date_range_start', $this->P->params['date_range_end']['value']);\n\t\t\t\t$this->P->set('date_range_end', $temp);\n\t\t\t\tunset($temp);\n\t\t\t}\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// This will come in handy later\n\t\t// -------------------------------------\n\n\t\t$calendar_array = array();\n\t\tforeach ($data as $k => $arr)\n\t\t{\n\t\t\t$calendar_array[] = $arr['calendar_id'];\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// Date range params? Then we need to do a lot more work.\n\t\t// -------------------------------------\n\n\t\tif ($this->P->value('date_range_start') !== FALSE OR\n\t\t\t$this->P->value('date_range_end') !== FALSE)\n\t\t{\n\t\t\t//ee()->TMPL->log_item('Calendar: Calculating date ranges');\n\t\t\t$min = ($this->P->value('date_range_start') !== FALSE) ?\n\t\t\t\t\t\t$this->P->value('date_range_start', 'ymd') :\n\t\t\t\t\t\t0;\n\n\t\t\t$max = ($this->P->value('date_range_end') !== FALSE) ?\n\t\t\t\t$this->P->value('date_range_end', 'ymd') :\n\t\t\t\t0;\n\n\t\t\t$calendar_array = $this->data->fetch_calendars_with_events_in_date_range(\n\t\t\t\t$min,\n\t\t\t\t$max,\n\t\t\t\t$calendar_array,\n\t\t\t\t$this->P->value('status')\n\t\t\t);\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// No calendars? No results.\n\t\t// -------------------------------------\n\n\t\tif (empty($calendar_array))\n\t\t{\n//ee()->TMPL->log_item('Calendar: No calendars, bailing');\n\t\t\treturn $this->no_results();\n\t\t}\n\n\t\t//\t----------------------------------------\n\t\t//\tInvoke Channel class\n\t\t//\t----------------------------------------\n\n\t\tif ( ! class_exists('Channel') )\n\t\t{\n\t\t\trequire PATH_MOD.'/channel/mod.channel.php';\n\t\t}\n\n\t\t$channel = new Channel();\n\n\t\t//need to remove limit here so huge amounts of events work\n\t\t$channel->limit = 1000000;\n\n\t\t// --------------------------------------------\n\t\t// Invoke Pagination for EE 2.4 and Above\n\t\t// --------------------------------------------\n\n\t\t$channel = $this->add_pag_to_channel($channel);\n\n\t\t// -------------------------------------\n\t\t// Prepare parameters\n\t\t// -------------------------------------\n\n\t\tee()->TMPL->tagparams['entry_id'] = implode('|', $calendar_array);\n\t\tee()->TMPL->tagparams['channel'] = CALENDAR_CALENDARS_CHANNEL_NAME;\n\n\t\t// -------------------------------------\n\t\t// Pre-process related data\n\t\t// -------------------------------------\n\n\t\tif (version_compare($this->ee_version, '2.6.0', '<'))\n\t\t{\n\n\t\t\tee()->TMPL->tagdata = ee()->TMPL->assign_relationship_data(\n\t\t\t\tee()->TMPL->tagdata\n\t\t\t);\n\t\t\tee()->TMPL->var_single = array_merge(\n\t\t\t\tee()->TMPL->var_single,\n\t\t\t\tee()->TMPL->related_markers\n\t\t\t);\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// Execute needed methods\n\t\t// -------------------------------------\n\n\t\t$channel->fetch_custom_channel_fields();\n\n\t\t$channel->fetch_custom_member_fields();\n\n\t\t// --------------------------------------------\n\t\t// Pagination Tags Parsed Out\n\t\t// --------------------------------------------\n\n\t\t$this->fetch_pagination_data($channel);\n\n\t\t// -------------------------------------\n\t\t// Querification\n\t\t// -------------------------------------\n\n\t\t$channel->build_sql_query();\n\n\t\tif ($channel->sql == '')\n\t\t{\n\t\t\treturn $this->no_results();\n\t\t}\n\n\t\t$channel->query = ee()->db->query($channel->sql);\n\n\t\tif ($channel->query->num_rows() == 0)\n\t\t{\n//ee()->TMPL->log_item('Calendar: Channel module says no results, bailing');\n\t\t\treturn $this->no_results();\n\t\t}\n\n\t\t$channel->query->result\t= $channel->query->result_array();\n\n\t\t// -------------------------------------------\n\t\t// 'calendar_calendars_channel_query' hook.\n\t\t// - Do something with the channel query\n\n\t\tif (ee()->extensions->active_hook('calendar_calendars_channel_query') === TRUE)\n\t\t{\n\t\t\t$channel->query = ee()->extensions->call('calendar_calendars_channel_query', $channel->query, $calendar_array);\n\t\t\tif (ee()->extensions->end_script === TRUE) return;\n\t\t}\n\t\t//\n\t\t// -------------------------------------------\n\n\t\t// -------------------------------------\n\t\t// Inject Calendar-specific variables\n\t\t// -------------------------------------\n\n\t\t//ee()->TMPL->log_item('Calendar: Adding Calendar variables');\n\n\t\t$aliases = array(\n\t\t\t'title'\t\t\t=> 'calendar_title',\n\t\t\t'url_title'\t\t=> 'calendar_url_title',\n\t\t\t'entry_id'\t\t=> 'calendar_id',\n\t\t\t'author_id'\t\t=> 'calendar_author_id',\n\t\t\t'author'\t\t=> 'calendar_author',\n\t\t\t'status'\t\t=> 'calendar_status'\n\t\t);\n\n\t\t//custom variables with the letters 'url' are borked in\n\t\t//EE 2.6. Bug reported, but this should fix.\n\t\t//https://support.ellislab.com/bugs/detail/19337\n\t\tif (version_compare($this->ee_version, '2.6.0', '>='))\n\t\t{\n\t\t\t$aliases['url_title'] = 'calendar_borked_title';\n\n\t\t\tee()->TMPL->var_single['calendar_borked_title'] = 'calendar_borked_title';\n\n\t\t\tunset(ee()->TMPL->var_single['calendar_url_title']);\n\n\t\t\tee()->TMPL->tagdata = str_replace(\n\t\t\t\tarray(\n\t\t\t\t\tLD . 'calendar_url_title' . RD,\n\t\t\t\t\t'\"calendar_url_title\"',\n\t\t\t\t\t\"'calendar_url_title'\"\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\tLD . 'calendar_borked_title' . RD,\n\t\t\t\t\t'\"calendar_borked_title\"',\n\t\t\t\t\t\"'calendar_borked_title'\"\n\n\t\t\t\t),\n\t\t\t\tee()->TMPL->tagdata\n\t\t\t);\n\t\t}\n\n\t\tforeach ($channel->query->result as $k => $row)\n\t\t{\n\t\t\t$channel->query->result[$k]['author'] = ($row['screen_name'] != '') ?\n\t\t\t\t\t\t\t\t\t\t$row['screen_name'] : $row['username'];\n\n\t\t\tforeach ($aliases as $old => $new)\n\t\t\t{\n\t\t\t\t$channel->query->result[$k][$new] = $channel->query->result[$k][$old];\n\t\t\t}\n\t\t}\n\n\t\t//\t----------------------------------------\n\t\t//\tRedeclare\n\t\t//\t----------------------------------------\n\t\t//\tWe will reassign the $channel->query->result with our\n\t\t//\treordered array of values.\n\t\t//\t----------------------------------------\n\n\t\t$channel->query->result_array = $channel->query->result;\n\n\t\t// --------------------------------------------\n\t\t// Typography\n\t\t// --------------------------------------------\n\n\t\tee()->load->library('typography');\n\t\tee()->typography->initialize();\n\t\tee()->typography->convert_curly = FALSE;\n\n\t\t$channel->fetch_categories();\n\n\t\t// -------------------------------------\n\t\t// Parse\n\t\t// -------------------------------------\n\n\t\t//ee()->TMPL->log_item('Calendar: Parsing, via channel module');\n\n\n\n\t\t$channel->parse_channel_entries();\n\n\t\t// -------------------------------------\n\t\t// Paginate\n\t\t// -------------------------------------\n\n\t\t$channel = $this->add_pagination_data($channel);\n\n\t\t// -------------------------------------\n\t\t// Related entries\n\t\t// -------------------------------------\n\n\t\t//ee()->TMPL->log_item('Calendar: Parsing related entries, via Weblog module');\n\n\t\tif (version_compare($this->ee_version, '2.6.0', '<'))\n\t\t{\n\t\t\tif (count(ee()->TMPL->related_data) > 0 AND\n\t\t\t\tcount($channel->related_entries) > 0)\n\t\t\t{\n\t\t\t\t$channel->parse_related_entries();\n\t\t\t}\n\n\t\t\tif (count(ee()->TMPL->reverse_related_data) > 0 AND\n\t\t\t\tcount($channel->reverse_related_entries) > 0)\n\t\t\t{\n\t\t\t\t$channel->parse_reverse_related_entries();\n\t\t\t}\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// Send 'em home\n\t\t// -------------------------------------\n\n\t\t$tagdata = $channel->return_data;\n\n\t\t//ee()->TMPL->log_item('Calendar: Done!');\n\n\t\t//on the off chance someone just wrote the word\n\t\t//'calendar_url_title', we should fix that before\n\t\t//output. (See above calendar_url_title fix)\n\t\tif (version_compare($this->ee_version, '2.6.0', '>='))\n\t\t{\n\t\t\t$tagdata = str_replace(\n\t\t\t\tarray(\n\t\t\t\t\tLD . 'calendar_borked_title' . RD,\n\t\t\t\t\t'\"calendar_borked_title\"',\n\t\t\t\t\t\"'calendar_borked_title'\"\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\tLD . 'calendar_url_title' . RD,\n\t\t\t\t\t'\"calendar_url_title\"',\n\t\t\t\t\t\"'calendar_url_title'\"\n\t\t\t\t),\n\t\t\t\t$tagdata\n\t\t\t);\n\t\t}\n\n\t\treturn $tagdata;\n\n\t}",
"function getJsonObjFromResult(&$result){\n // by reference doorgeven, waardoor deze niet gekopieerd word\n // naar een nieuwe variabele voor deze functie.\n\n $fixed = array();\n \n $typeArray = array(\n MYSQLI_TYPE_TINY, MYSQLI_TYPE_SHORT, MYSQLI_TYPE_INT24, \n MYSQLI_TYPE_LONG, MYSQLI_TYPE_LONGLONG,\n MYSQLI_TYPE_DECIMAL, \n MYSQLI_TYPE_FLOAT, MYSQLI_TYPE_DOUBLE );\n $fieldList = array();\n // haal de veldinformatie van de velden in deze resultset op\n while($info = $result->fetch_field()){\n $fieldList[] = $info;\n }\n // haal de data uit de result en pas deze aan als het veld een\n // getaltype zou moeten bevatten\n while ($row = $result -> fetch_assoc()) {\n $fixedRow = array();\n $teller = 0;\n\n foreach ($row as $key => $value) {\n if (in_array($fieldList[$teller] -> type, $typeArray )) {\n $fixedRow[$key] = 0 + $value;\n } else {\n $fixedRow[$key] = $value;\n }\n $teller++;\n }\n $fixed[] = $fixedRow;\n }\n\n // geef een json object terug\n return '{\"data\":'.json_encode($fixed).'}';\n}",
"public function actionRenderDataEvents($claster,$start,$end)\n { \n $end_1 = strtotime($end);\n $dep_id1 = Yii::$app->getUserOpt->Profile_user()->emp->DEP_ID;\n $emp_email = Yii::$app->getUserOpt->Profile_user()->emp->EMP_EMAIL;\n $gf_id = Yii::$app->getUserOpt->Profile_user()->emp->GF_ID;\n\t\t\n if($gf_id <= 4)\n {\n\t\t\t $sql = \"select STATUS as status, COLOR as color, ID as resourceId, PLAN_DATE1 as start , PLAN_DATE2 as end, PILOT_NM as title from sc0001 where DEP_ID = '\".$dep_id1.\"' and TEMP_EVENT <>0 and ((date(PLAN_DATE1) BETWEEN '\".$start.\"' AND '\".$end.\"') or (date(PLAN_DATE2) BETWEEN '\".$start.\"' AND '\".$end.\"'))\";\n\t\t\t}else{\n\t\t\t\t$sql = \"select STATUS as status, COLOR as color, ID as resourceId, PLAN_DATE1 as start , PLAN_DATE2 as end, PILOT_NM as title from sc0001 where DEP_ID = '\".$emp_email.\"' and TEMP_EVENT <>0 and ((date(PLAN_DATE1) BETWEEN '\".$start.\"' AND '\".$end.\"') or (date(PLAN_DATE2) BETWEEN '\".$start.\"' AND '\".$end.\"'))\";\n }\n $aryEvent = Yii::$app->db_widget->createCommand($sql)->queryAll();\t\n\t\treturn Json::encode($aryEvent);\n\t}",
"public function buildCalendarScripts(){\n\t\tob_start();?>\n \t<script>\n\t\t\t\t\n\t\t\t\t//on calendar cell click \n\t\t\t\t$(document).on('click', '.calendar_cell', function(e){\n\t\t\t\t\tif( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ) {\n\t\t\t\t\t\tvar fullDate = $(this).attr('id');\n\t\t\t\t\t\t\n\t\t\t\t\t\t$.ajax({\n\t\t\t\t\t\t url:'<?php echo $this->ajax_file; ?>',\n\t\t\t\t\t\t data:{action:'get_events', date: fullDate},\n\t\t\t\t\t\t async:false,\n\t\t\t\t\t\t success:function(data, textStatus, jqXHR) {\n\t\t\t\t\t\t\t if (data) {\n\t\t\t\t\t\t\t\t $('#day_events').replaceWith(data);\n\t\t\t\t\t\t\t }\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});\n\t\t\t\t\n\t\t\t\t//on view as calendar click\n\t\t\t\t$(document).on('click', '.view_as_calendar', function(e){\n\t\t\t\t\t$.ajax({\n\t\t\t\t\t url:'<?php echo $this->ajax_file; ?>',\n\t\t\t\t\t data:{action:'get_calendar'},\n\t\t\t\t\t async:false,\n\t\t\t\t\t success:function(data, textStatus, jqXHR) {\n\t\t\t\t\t\t if (data) {\n\t\t\t\t\t\t\t $('#events_calendar').replaceWith(data);\n\t\t\t\t\t\t }\n\t\t\t\t\t }\n\t\t\t\t\t});\t\n\t\t\t\t});\n\t\t\t\t\n\t\t\t\t//on view as list click\n\t\t\t\t$(document).on('click', '.view_as_list', function(e){\n\t\t\t\t\t$.ajax({\n\t\t\t\t\t url:'<?php echo $this->ajax_file; ?>',\n\t\t\t\t\t data:{action:'get_calendar_list'},\n\t\t\t\t\t async:false,\n\t\t\t\t\t success:function(data, textStatus, jqXHR) {\n\t\t\t\t\t\t if (data) {\n\t\t\t\t\t\t\t $('#day_events').html('');\n\t\t\t\t\t\t\t $('#events_calendar').replaceWith(data);\n\t\t\t\t\t\t }\n\t\t\t\t\t }\n\t\t\t\t\t});\t\n\t\t\t\t});\n\t\t\t\t\n\t\t\t\t//on previous month link click\n\t\t\t\t$(document).on('click', '.prev_month_link', function(e) {\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\n\t\t\t\t\tgetCalendar('previous');\n\t\t\t\t});\n\t\t\t\t\n\t\t\t\t//on next month link click\n\t\t\t\t$(document).on('click', '.next_month_link', function(e) {\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\n\t\t\t\t\tgetCalendar('next');\n\t\t\t\t});\n\t\t\t\t\n\t\t\t\tfunction getCalendar(direction){\n\t\t\t\t\t$('.loading').show();\n\t\t\t\t\t$.ajax({\n\t\t\t\t\t url:'<?php echo $this->ajax_file; ?>',\n\t\t\t\t\t data:{action:'get_month',direction: direction},\n\t\t\t\t\t async:false,\n\t\t\t\t\t success:function(data, textStatus, jqXHR) {\n\t\t\t\t\t\t if (data) {\n\t\t\t\t\t\t\t $('.loading').delay( 800 ).hide();\n\t\t\t\t\t\t\t $('#day_events').html('');\n\t\t\t\t\t\t\t $('#events_calendar').replaceWith(data);\n\t\t\t\t\t\t }\n\t\t\t\t\t }\n\t\t\t\t\t});\t\n\t\t\t\t}\n </script>\n <?php\n\t\treturn ob_get_clean();\n\t}",
"public function getAll()\n\t{\n\t\tif($this->input->is_ajax_request())\n\t\t{\n\t\t\t$this->load->model('events_model');\n\t\t\t$events = $this->events_model->getAll();\n\t\t\techo json_encode(\n\t\t\t\tarray(\n\t\t\t\t\t\"success\" => 1,\n\t\t\t\t\t\"result\" => $events\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t}",
"public function getEventsAction() {\n\t\tdate_default_timezone_set ( 'UTC' );\n\t\t\n\t\t// Short-circuit if the client did not give us a date range.\n\t\tif (! isset ( $_GET ['start'] ) || ! isset ( $_GET ['end'] )) {\n\t\t\tdie ( \"Please provide a date range.\" );\n\t\t}\n\t\t\n\t\t// Parse the start/end parameters.\n\t\t// These are assumed to be ISO8601 strings with no time nor timezone, like \"2013-12-29\".\n\t\t// Since no timezone will be present, they will parsed as UTC.\n\t\t$range_start = Object\\Shift::parseDateTime ( $_GET ['start'] );\n\t\t$range_end = Object\\Shift::parseDateTime ( $_GET ['end'] );\n\t\t$data [] = $range_start->toString ( \\Zend_Date::ISO_8601 );\n\t\t$data [] = $range_end->toString ( \\Zend_Date::ISO_8601 );\n\t\t// Parse the timezone parameter if it is present.\n\t\t$timezone = null;\n\t\tif (isset ( $_GET ['timezone'] )) {\n\t\t\t$timezone = new DateTimeZone ( $_GET ['timezone'] );\n\t\t}\n\t\t\n\t\t// Read and parse our events JSON file into an array of event data arrays.\n\t\t$json = file_get_contents ( PIMCORE_LAYOUTS_DIRECTORY . '/assets/json/events.json' );\n\t\t$input_arrays = new Object\\Shift\\Listing (); // json_decode($json, true);\n\t\t \n\t\t// Accumulate an output array of event data arrays.\n\t\t$output_arrays = array ();\n\t\tforeach ( $input_arrays as $event ) {\n\t\t\t\n\t\t\t// Convert the input array into a useful Event object\n\t\t\t// $event2 = Object\\Shift::create($event->toArray());\n\t\t\t// $event2->setKey(Pimcore_File::getValidFilename('New Name 10'));\n\t\t\t// $event2->setParentId(53);\n\t\t\t// $event2->save();\n\t\t\t// $output_arrays['new'] = $event2 ;\n\t\t\t\n\t\t\t// $data[]= $event->getEnd()->toString(\\Zend_Date::ISO_8601);\n\t\t\t// If the event is in-bounds, add it to the output\n\t\t\tif ($event->isWithinDayRange ( $range_start, $range_end )) {\n\t\t\t\t$output_arrays [] = $event->toCalendar ();\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Send JSON to the client.\n\t\t$reponse = new Reponse ();\n\t\t\n\t\t$reponse->data = $output_arrays; // $input_arrays;\n\t\t$reponse->message = \"TXT_SHIFTS_SENT\";\n\t\t$reponse->success = true;\n\t\t\n\t\t$this->render ( $reponse );\n\t\t// echo json_encode($output_arrays);\n\t}",
"function calendar_events($events, $YEAR, $MONTH_START, $DAY_START, $WEEKENDS, $MONTH_END, $DOW, $OVERRIDE, $BOX) {\n $results = array('year'=>$YEAR, 'month_start'=>$MONTH_START, 'month_end'=>$MONTH_END, 'box'=>$BOX);\n $results_counter = array();\n $POSDOW = array(0 => 'sun', 1 => 'mon', 2 => 'tue', 3 => 'wed', 4 => 'thu', 5 => 'fri', 6 => 'sat', 7 => 'sun');\n for($month=$MONTH_START; $month <= $MONTH_END; $month++) {\n $month_len = cal_days_in_month(CAL_GREGORIAN, $month, $YEAR);\n $month_name = cal_info(0);\n $month_name = $month_name['months'][$month];\n $first = date(\"w\", mktime(0, 0, 0, $month, 1, $YEAR));\n for($day=1; $day <= $month_len; $day++) {\n $day_type = '';\n $day_num = '';\n $force_day = False;\n if ($month == $MONTH_START && $day < $DAY_START) {\n } elseif (isset($OVERRIDE[$month][$day])) {\n $day_type = $OVERRIDE[$month][$day];\n $force_day = True;\n } elseif (isset($DOW[$POSDOW[$first]])) {\n $day_type = $DOW[$POSDOW[$first]];\n }\n if ($day_type != '') {\n if (isset($events[$day_type])) {\n if (!isset($results_counter[$day_type])) {\n $results_counter[$day_type] = 1;\n } else {\n $results_counter[$day_type]++;\n }\n }\n if (isset($events[$day_type]) && isset($events[$day_type][$results_counter[$day_type]])) {\n $event = $events[$day_type][$results_counter[$day_type]];\n $day_num = $results_counter[$day_type];\n } else {\n $event = array();\n }\n if ($force_day || !empty($event)) {\n $results[$month][$day] = array('month'=>$month, 'day'=>$day, 'type'=>$day_type, 'type_num'=>$day_num, 'dow'=>$first, 'dow_eng'=>$POSDOW[$first], 'event'=>$event);\n }\n }\n $first++;\n if ($first == 7) {$first = 0;}\n }\n }\n return $results;\n }",
"function generateJSON(){\n\t\t $metadata = array();\n\t\t $metadata[\"tableID\"] = $this->tableID;\n\t\t $metadata[\"tableGroupID\"] = $this->tableGroupID;\n\t\t $metadata[\"tablePage\"] = $this->tablePage +0 ;\n\t\t $metadata[\"title\"] = $this->tableName;\n\t\t $metadata[\"description\"] = $this->tableDesciption;\n\t\t $metadata[\"tags\"] = $this->tableTags;\n\t\t $metadata[\"doi\"] = $this->tableDOI;\n\t\t $metadata[\"ark\"] = $this->tableARK;\n\t\t $metadata[\"versionControl\"] = $this->versionControl;\n\t\t $metadata[\"license\"] = $this->license;\n\t\t $metadata[\"recordCount\"] = $this->recordCount+0;\n\t\t $metadata[\"rawCreators\"] = $this->rawCreators;\n\t\t $metadata[\"rawContributors\"] = $this->rawContributors;\n\t\t $metadata[\"rawLinkedPersons\"] = $this->rawLinkedPersons;\n\t\t $metadata[\"projects\"] = $this->projects;\n\t\t $metadata[\"files\"] = $this->files;\n\t\t $metadata[\"tableFields\"] = $this->tableFields;\n\t\t $this->metadata = $metadata;\n\t\t return Zend_Json::encode($metadata);\n\t }",
"function loadAllData()\r\n {\r\n $servername = 'localhost';\r\n $username = 'root';\r\n $password = '';\r\n $dbname = 'eventscaledar';\r\n\r\n// Create connection\r\n $conn = mysqli_connect($servername, $username, $password, $dbname);\r\n // Check connection\r\n if (!$conn) {\r\n die(\"Connection failed: \" . mysqli_connect_error());\r\n}\r\n\r\n$sql = 'select * from events order by EventDate ASC';\r\n$result = mysqli_query($conn, $sql);\r\n\r\nif (mysqli_num_rows($result) > 0) {\r\n // output data of each row\r\n\t$c=1;\r\n \r\n $res = mysqli_query($conn,\"select * from events order by EventDate ASC\");\r\n $records = array();\r\n while($obj = mysqli_fetch_object($res)) {\r\n $records []= $obj;\r\n }\r\n file_put_contents(\"data.json\", json_encode($records));\r\n \r\n \r\n \r\n while($row = mysqli_fetch_assoc($result)) {\r\n \r\n\t \t\techo \"<tr><td>\".$row[\"EID\"].\"</td><td>\".$row[\"EventDate\"].\"</td><td>\".$row[\"Event\"].\"</td><td>\".$row[\"Details\"].\"</td><td> <img class='hp' id='p$c' src='\".$row[\"Photos\"].\"'/> \t\t<input type='button' value='edit' class='edit btn-group' onclick='edit($c);' id='r$c'/> <input type='button' value='Delete' class='edit btn-group' onclick='delete1($c);' id='d$c'/></td></tr>\";\r\n\t\t\t\r\n\t\r\n\t\t$c++;\r\n \r\n }\r\n} else {\r\n file_put_contents(\"data.json\", json_encode($records));\r\n echo \"0 results\";\r\n}\r\n\r\nmysqli_close($conn);\r\n }",
"function getAllArticle()\n\t\t{\n\t\t\tglobal $conn;\n\t\t\t$sql = \"SELECT * FROM article\";\n\t\t\t$result = mysqli_query($conn, $sql); // result stores the result of the query\n\t\t\t// convert to JSON\n\t\t\t$rows = array(); //makes the varible row an array\n\t\t\twhile($r = mysqli_fetch_assoc($result)) {\n\t\t\t\t$rows[] = $r; // puts every article into the array of rows \n\t\t\t}\n\t\t\treturn json_encode($rows);\n\t\t}",
"function ShowCalendar()\n{\n\t$str1=\"select value1 from options where name='calendar'\";\n\t$result=mysql_query($str1) or\n\t\tdie(mysql_error());\n\t$row=mysql_fetch_array($result);\n\tif ($row['value1']==1)\n\t{\n echo(\"<tr><td height='154' valign='top'><table width='100%' border='0' cellpadding='0' cellspacing='0' bgcolor='#F0F8FF'>\");\n echo(\"<tr><td bgcolor='\");\n\t echo(background());\n\t echo(\"' class='leftmenumainitem' width='216' valign='top'>\");\n\t\techo(\"<img src='image/point.jpg' /> \");\n\t\techo(getPara('calendar','value2'));\n\t\techo(\" </td></tr>\");\n echo(\"<tr><td height='132' align='center' valign='middle'><div align='center'>\");\n echo(\"<script language='javascript'>calendar();</script>\");\n echo(\"</div></td></tr></table></td></tr>\");\n\t}\n\n\tmysql_free_result($result);\n}",
"public function index()\n {\n $event = Event::latest()->first();\n\n $dates = CarbonPeriod::create($event->from, $event->to);\n\n $dates = collect($dates->toArray())->filter(function($date) use($event){\n\n $day = strtolower(Carbon::parse($date)->format('l'));\n\n return in_array($day, $event->days);\n\n })->map(function($date) use($event) {\n return $date->format('Y-m-d');\n })->values();\n\n return response()->json([\n 'dates' => $dates,\n 'title' => $event->name,\n 'class' => 'bg-blue-500 text-white mx-2'\n ], 200);\n }"
] | [
"0.67366415",
"0.6401463",
"0.63382196",
"0.63203853",
"0.63108337",
"0.6265668",
"0.62243795",
"0.61696774",
"0.6156788",
"0.61491805",
"0.6116451",
"0.6115814",
"0.608021",
"0.60023546",
"0.5962656",
"0.5921226",
"0.59110713",
"0.59062266",
"0.57994103",
"0.57893246",
"0.5777011",
"0.5745126",
"0.5734638",
"0.57289773",
"0.57230324",
"0.571805",
"0.571354",
"0.5712773",
"0.5701896",
"0.56984496",
"0.5682235",
"0.5673932",
"0.5667613",
"0.56585044",
"0.5647071",
"0.56424546",
"0.56200314",
"0.5615168",
"0.5603834",
"0.56026745",
"0.5597625",
"0.5592013",
"0.5588421",
"0.5586805",
"0.55849177",
"0.5580708",
"0.55769676",
"0.55725354",
"0.55544406",
"0.5547736",
"0.55473596",
"0.5546698",
"0.55462104",
"0.5543663",
"0.5532817",
"0.55170214",
"0.55158395",
"0.5510448",
"0.5505164",
"0.5505164",
"0.5502652",
"0.5490447",
"0.5480853",
"0.5477038",
"0.5459741",
"0.54593307",
"0.5457886",
"0.5456237",
"0.5446207",
"0.54461527",
"0.54433084",
"0.5438638",
"0.5428604",
"0.54199207",
"0.5408811",
"0.54082483",
"0.54072183",
"0.5405199",
"0.5402365",
"0.54005927",
"0.54000854",
"0.53928936",
"0.5388638",
"0.5387642",
"0.53873366",
"0.53792506",
"0.5378316",
"0.53772277",
"0.5375429",
"0.53735393",
"0.537153",
"0.5370944",
"0.536872",
"0.53626937",
"0.53550667",
"0.5343851",
"0.5340727",
"0.53274834",
"0.5325207",
"0.53233576"
] | 0.7021728 | 0 |
This function updates event drag, resize from jquery fullcalendar Returns true | public function update($allDay, $start, $end, $id)
{
// Convert Date Time
$start = strftime('%Y-%m-%d %H:%M:%S', strtotime(substr($start, 0, 24)));
$end = strftime('%Y-%m-%d %H:%M:%S', strtotime(substr($end, 0, 24)));
if($allDay == 'false') {
$allDay_value = 'true';
} elseif($allDay == 'true') {
$allDay_value = 'false';
}
// The update query
$query = sprintf('UPDATE %s
SET
start = "%s",
end = "%s",
allDay = "%s"
WHERE
id = %s
',
mysqli_real_escape_string($this->connection, $this->table),
mysqli_real_escape_string($this->connection, $start),
mysqli_real_escape_string($this->connection, $end),
mysqli_real_escape_string($this->connection, $allDay_value),
mysqli_real_escape_string($this->connection, $id)
);
// The result
return $this->result = mysqli_query($this->connection, $query);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function resize_event($resizeId, $resizeTitle, $startDate, $endDate, $resizeColor){\n\t\tif ( isset($_POST[$resizeId]) ){\n\t\t\t$id \t= $_POST[$resizeId];\n\t\t\t$title = $_POST[$resizeTitle];\n\t\t\t$start = $_POST[$startDate];\n\t\t\t$end \t= $_POST[$endDate];\n\t\t\t$color \t= $_POST[$resizeColor];\n\n\t\t\t\tfull_calendar::resize_event($id, $title, $start, $end, $color);\n\t\t}\n\t}",
"function drag_events_over_calendar($title, $start, $end, $event_id, $eventColor){\n\t\tif( isset($_POST['title']) ){\n\t\t\t$title \t\t= $_POST[$title];\n\t\t\t$start \t\t= $_POST[$start];\n\t\t\t$end \t\t= $_POST[$end];\n\t\t\t$event_id \t= $_POST[$event_id];\n\t\t\t$color\t\t= $_POST[$eventColor];\n\n\t\t\t$find_events = full_calendar::show_events();\n\t \t$event_info='';\n \tforeach( $find_events as $key => $event ){\n \t\t$event_info .= $event->event;\n \t}\n\t \tfull_calendar::update_events($event_id, $title, $start, $end, $color);\n\t\t}\n\t}",
"public static function isWindowResized() : bool {}",
"function callbackDragMove() {\n \n if (!$this->nameDrag) {\n return $this->nameDrag;\n }\n $w = $this->table->database->layout->window;\n // remove last line\n if ($this->lastEnd) {\n $this->drawDragLine($GLOBALS['_Gtk_MDB_Designer_Interface_Column']['gc'],\n $this->startPos[0], $this->startPos[1],\n $this->lastEnd[0] ,$this->lastEnd[1] );\n \n }\n \n $this->lastEnd = $w->pointer;\n $this->startPos = $this->getStartPos($w->pointer);\n // draw new line\n $this->drawDragLine($GLOBALS['_Gtk_MDB_Designer_Interface_Column']['gc'],\n $this->startPos[0], $this->startPos[1],\n $this->lastEnd[0] ,$this->lastEnd[1] );\n \n \n return true;\n \n }",
"public function isDraggable() {}",
"function attendance_update_calendar_event($session) {\n global $DB;\n\n $caleventid = $session->caleventid;\n $timeduration = $session->duration;\n $timestart = $session->sessdate;\n\n if (empty(get_config('attendance', 'enablecalendar'))) {\n // Calendar events are not used.\n return true;\n }\n\n // Should there even be an event?\n if ($session->calendarevent == 0) {\n if ($session->caleventid != 0) {\n // There is an existing event we should delete, calendarevent just got turned off.\n $DB->delete_records_list('event', 'id', array($caleventid));\n $session->caleventid = 0;\n $DB->update_record('attendance_sessions', $session);\n return true;\n } else {\n // This should be the common case when session does not want event.\n return true;\n }\n }\n\n // Do we need new event (calendarevent option has just been turned on)?\n if ($session->caleventid == 0) {\n return attendance_create_calendar_event($session);\n }\n\n // Boring update.\n $caleventdata = new stdClass();\n $caleventdata->timeduration = $timeduration;\n $caleventdata->timestart = $timestart;\n $caleventdata->timemodified = time();\n $caleventdata->description = $session->description;\n\n $calendarevent = calendar_event::load($caleventid);\n if ($calendarevent) {\n return $calendarevent->update($caleventdata) ? true : false;\n } else {\n return false;\n }\n}",
"function _resize() {\r\n return null; //PEAR::raiseError(\"No Resize method exists\", true);\r\n }",
"public function update() {\n $hasduedate = isset($this->mumie->duedate) && $this->mumie->duedate > 0;\n if (!$this->event && $hasduedate) {\n $this->create_calendar_event(\n self::EVENT_TYPE,\n $this->mumie->duedate\n );\n } else if ($this->event && $hasduedate) {\n $update = new \\stdClass();\n $update->name = $this->title;\n $update->timestart = $this->mumie->duedate;\n $this->event->update($update, false);\n } else if ($this->event && !$hasduedate) {\n $this->event->delete();\n }\n }",
"public function checkForUpdate(&$description)\n {\n $nonMigratedCalIds = $this->getNonMigratedCalIds();\n $count = count($nonMigratedCalIds);\n if ($count === 0) {\n return false;\n }\n $description = \"There \" . ($count > 1 ? 'are ' . $count : 'is ' . $count) . \" non migrated EXT:cal event\n \" . ($count > 1 ? 's' : '') . \". Run the update process to migrate the events to EXT:calendarize events.\";\n return true;\n }",
"function updateEvent(){\r\n\t\tif(!isset($_POST['submitted'])){\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\t$formvars = array();\r\n\r\n\t\tif(!$this->ValidateUpdatedSubmission()){\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\t$itemPicture = $this->upLoadPic();\r\n\t\tif($itemPicture != false){\r\n\t\t\t$formvars['Eflyer'] = $this->upLoadPic();\r\n\t\t}\r\n\t\t\t\t\r\n\t\t$picBanner = $this->upLoadBanner();\r\n\t\tif($picBanner != false){\r\n\t\t\t$formvars['Ebanner'] = $this->upLoadBanner();\r\n\t\t}\r\n\t\t\r\n\t\t$this->CollectUpdatedSubmission($formvars);\r\n\t\t\r\n\t\tif(!$this->updateEventInDatabase($formvars)){\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\treturn true;\r\n\t}",
"private function _isResize()\n {\n if ($this->download || $this->output == 'pptx' || $this->output == 'docx') {\n return true;\n }\n return false;\n }",
"public static function resize(){\n\n}",
"function getDraggable() {return $this->readdraggable();}",
"public function getRender(){\n /*\n * adiciona os listeners de comportamento padrão do componente\n */\n \n //ação que executa ao clicar sobre algum evento, abre a tela com as informações carregadas\n $sFuncao = \"eventWindow.show(record, el);\";\n $this->addListener(self::EVENTO_CLICK,$sFuncao,\"view, record, el\");\n \n //ação que ocorre ao clicar sobre os grids (dia, semana, mês)\n $sFuncao = \"eventWindow.show({\"\n .\"StartDate: date,\"\n .\"IsAllDay: allDay\"\n .\"}, el);\";\n $this->addListener(self::EVENTO_DAY_CLICK,$sFuncao,\"view, date, allDay, el\");\n \n //ação que ocorre ao redimensionar (aumentar ou reduzir) o tempo de um evento\n $sFuncaoUpdate = \"var calendarEventStore = Ext.ComponentQuery.query('#\".$this->getId().\"-calendar')[0].eventStore;\"\n .\"calendarEventStore.sync({\"\n .\"callback: function(batch, operation){\"\n .\"var result = batch.operations[0].request.scope.reader.jsonData['success'];\"\n .\"if(!result){\"\n .\"calendarEventStore.rejectChanges();\"\n .\"}\"\n .\"}\"\n .\"});\";\n $this->addListener(self::EVENTO_RESIZE,$sFuncaoUpdate,\"view, record\");\n \n //ação que ocorre ao mover um evento na tela\n $this->addListener(self::EVENTO_MOVE,$sFuncaoUpdate,\"view, record\");\n \n //ação que ocorre ao iniciar a movimentação dos elementos na tela\n $sFuncao = \"if(eventWindow && eventWindow.isVisible()){\"\n .\"eventWindow.hide();\"\n .\"}\";\n $this->addListener(self::EVENTO_DRAG,$sFuncao,\"view\");\n \n //ação que ocorre após selecionar várias linhas no grid (permite criar novo eventos por intervalos)\n $sFuncao = \"eventWindow.show(dates);\"\n .\"eventWindow.on('hide', onComplete, this, {single:true});\";\n $this->addListener(self::EVENTO_RANGE,$sFuncao,\"window, dates, onComplete\");\n \n /*\n * eventos que podem ser implementados no componente\n */\n //$this->addListener(self::EVENTO_OVER,\"\",\"view, record, el\");\n //$this->addListener(self::EVENTO_OUT,\"\",\"view, record, el\");\n //$this->addListener(self::EVENTO_ADD,$sFuncao,\"form, record\");\n //$this->addListener(self::EVENTO_UPDATE,$sFuncao,\"form, record\");\n //$this->addListener(self::EVENTO_DELETE,$sFuncao,\"window, record\");\n //$this->addListener(self::EVENTO_CANCEL,\"\",\"form, record\");\n //$this->addListener(self::EVENTO_VIEW_CHANGE,$sFuncao,\"panel, view, info\");\n \n $aRender = array(\n \"xtype\" => 'calendarpanel',\n \"itemId\" => $this->getId().\"-calendar\",\n \"calendarStore\" => $this->getRenderStoreTipoEvento(),\n \"eventStore\" => $this->getRenderStoreEvento(),\n \"activeItem\" => $this->getPerspectiva(),\n \"showNavBar\" => $this->getMostraBarraPerspectivas(),\n \"showDayView\" => $this->getMostraPerspectivaDia(),\n \"showWeekView\" => $this->getMostraPerspectivaSemana(),\n \"showMonthView\" => $this->getMostraPerspectivaMes(),\n \"showTime\" => $this->getMostraHora(),\n \"monthViewCfg\" => $this->getConfiguracaoMes(),\n \"eventIncrement\" => $this->getDuracaoEvento(),\n \"viewStartHour\" => $this->getHoraInicial(),\n \"viewStartMinute\" => $this->getMinutoInicial(),\n \"viewEndHour\" => $this->getHoraFinal(),\n \"viewEndMinute\" => $this->getMinutoFinal(),\n \"viewConfig\" => $this->getConfiguracao(),\n \"listeners\" => $this->getListeners()\n );\n \n $sRender = \"Ext.create('Ext.panel.Panel', {\"\n .\"layout: 'border',\"\n .\"border: true,\"\n .\"items: [{\"\n .\"xtype: 'panel',\"\n .\"itemId: '\".$this->getId().\"-region-west',\"\n .\"region: 'west',\"\n .\"title: 'Calendário',\"\n .\"collapsible: true,\"\n .\"split: true,\"\n .\"width: 220,\"\n .\"maxWidth: 220,\"\n .\"layoutConfig: {\"\n .\"fill: false,\"\n .\"animate: true\"\n .\"},\"\n .\"padding: '3',\"\n .\"bodyStyle:{\"\n .\"backgroundColor: '#157fcc'\"\n .\"},\"\n .\"items: [{\"\n .\"xtype: 'datepicker',\"\n .\"itemId: '\".$this->getId().\"-picker',\"\n .\"cls: 'ext-cal-nav-picker',\"\n .\"listeners: {\"\n .\"'select': {\"\n .\"fn: function(dp, dt){\"\n .\"Ext.ComponentQuery.query('#\".$this->getId().\"-calendar')[0].setStartDate(dt);\"\n .\"},\"\n .\"scope: this\"\n .\"}\"\n .\"}\"\n .\"},{\"\n .$this->getListaAgenda()\n .\"}]\"\n .\"},{\"\n .\"region: 'center',\"\n .\"itemId: '\".$this->getId().\"-region-center',\"\n .\"style:{\"\n .\"border: '3px solid #5A91D2',\"\n .\"borderLeft: 'none'\"\n .\"},\"\n .Base::getRender($aRender)\n .\"}]\"\n .\"})\";\n \n return Base::addObj($sRender,$this->getRenderTo()).$this->getTelaManutencao();\n }",
"function canUpdateBGEvents() {\n if ($this->fields[\"background\"]\n && !Session::haveRight(self::$rightname, self::MANAGE_BG_EVENTS)) {\n return false;\n }\n\n return true;\n }",
"protected function update_size($width = \\false, $height = \\false)\n {\n }",
"function enqueue_fullcalendar() {\n wp_enqueue_style ( 'fullcalendar-main-style', get_stylesheet_directory_uri() . '/lib/fullcalendar-4.3.1/packages/core/main.css' );\n wp_enqueue_style ( 'fullcalendar-daygrid-style', get_stylesheet_directory_uri() . '/lib/fullcalendar-4.3.1/packages/daygrid/main.css' );\n wp_enqueue_style ( 'fullcalendar-timegrid-style', get_stylesheet_directory_uri() . '/lib/fullcalendar-4.3.1/packages/timegrid/main.css' );\n wp_enqueue_style ( 'fullcalendar-list-style', get_stylesheet_directory_uri() . '/lib/fullcalendar-4.3.1/packages/list/main.css' );\n\n wp_enqueue_script ( 'fullcalendar-main-script', get_stylesheet_directory_uri() . '/lib/fullcalendar-4.3.1/packages/core/main.js' );\n wp_enqueue_script ( 'fullcalendar-interaction-script', get_stylesheet_directory_uri() . '/lib/fullcalendar-4.3.1/packages/interaction/main.js' );\n wp_enqueue_script ( 'fullcalendar-daygrid-script', get_stylesheet_directory_uri() . '/lib/fullcalendar-4.3.1/packages/daygrid/main.js' );\n wp_enqueue_script ( 'fullcalendar-timegrid-script', get_stylesheet_directory_uri() . '/lib/fullcalendar-4.3.1/packages/timegrid/main.js' );\n wp_enqueue_script ( 'fullcalendar-list-script', get_stylesheet_directory_uri() . '/lib/fullcalendar-4.3.1/packages/list/main.js' );\n}",
"private function init_calendarArea()\n {\n\n // Init area\n $this->pObj->objCal->area_init();\n\n // Reinit class vars $conf and $conf_view\n $this->conf = $this->pObj->conf;\n $this->conf_view = $this->conf[ 'views.' ][ $this->view . '.' ][ $this->mode . '.' ];\n // Reinit class vars $conf and $conf_view\n\n return;\n }",
"private function add_events()\r\n {\r\n $events = $this->events;\r\n foreach ($events as $time => $items)\r\n {\r\n $column = date('H', $time) / $this->hour_step + 1;\r\n foreach ($items as $item)\r\n {\r\n $content = $item['content'];\r\n $row = $item['index'] + 1;\r\n \r\n $cell_content = $this->getCellContents($row, $column);\r\n $cell_content .= $content;\r\n $this->setCellContents($row, $column, $cell_content);\r\n }\r\n }\r\n \r\n }",
"function agenda_update_item($event_id, $title=NULL,$description=NULL, $start_date=NULL, $end_date=NULL, $author_id=NULL, $course_id, $update_repeat='this', $visibility='SHOW')\n{\n\t$final_result = true;\n\t$result = array();\n\t$repeat_type = get_lang('Each week');\n\n\t$formated_start_day = date(\"Y-m-d\",$start_date);\n\t$formated_start_hour = date(\"H:i:s\",$start_date);\n\t$formated_end_day = date(\"Y-m-d\",$end_date);\n\t$formated_end_hour = date(\"H:i:s\",$end_date);\n\t$today = date(\"Y-m-d H:i:s\",mktime());\n\n $sqlSet = array();\n if(!is_null($course_id)) $sqlSet[] = \"rel_event_recipient.course_id \t = '\" . addslashes(trim($course_id)) . \"' \";\n if(!is_null($title)) $sqlSet[] = \"event.title \t\t\t\t\t\t = '\" . addslashes(trim($title)) . \"' \";\n if(!is_null($description))$sqlSet[] = \"event.description \t\t\t\t = '\" . addslashes(trim($description)) . \"' \";\n if(!is_null($author_id)) $sqlSet[] = \"event.author_id \t\t\t\t = '\" . addslashes(trim($author_id)) . \"' \";\n\tif(!is_null($visibility)) $sqlSet[] = \"rel_event_recipient.visibility = '\" . ($visibility=='HIDE'?'HIDE':'SHOW') . \"'\";\n\tif(!is_null($start_date)) $sqlSet[] = \"event.start_date = '\" . $formated_start_day . ' ' . $formated_start_hour . \"' \";\n\tif(!is_null($end_date)) $sqlSet[] = \"event.end_date = '\" . $formated_end_day . ' ' . $formated_end_hour . \"' \";\n\n\tif ($update_repeat == 'this') //update this event\n\t{\n\t\tif (count($sqlSet)>0)\n\t\t{\n\t\t\t$sqlSet[] = \"event.master_event_id\t= NULL \"; //separates this event from a group of events \n\n\t\t\t$tbl = get_conf('mainTblPrefix') . 'event AS event INNER JOIN ' \n\t\t\t\t. get_conf('mainTblPrefix') . 'rel_event_recipient AS rel_event_recipient' \n\t\t\t\t. ' ON event.id = rel_event_recipient.event_id'; //update only the selected event\n\n\t\t\t$sql = \"UPDATE \" . $tbl . \"\n \t\t\t\tSET \" . implode(', ',$sqlSet) .\"\n \t\t\t\tWHERE event.id = \" . (int) $event_id ;\n\t\t\t$result[] = claro_sql_query($sql);\t\t\t\n\t\t}\n\t}\n\tif ($update_repeat=='from_this') //update from the selected event\n\t{\n\t\t$tbl = get_conf('mainTblPrefix') . 'event'; //get the master_event_id and the start_date from the selected event\n\t\t$sql = \"SELECT master_event_id,\n\t\t\t\t\t\t start_date\n\t\t\t FROM \" . $tbl . \"\n\t\t\t WHERE id = \" .(int) $event_id;\n\t\t$original_event = claro_sql_query_fetch_all($sql);\n\t\tif ($original_event == false)$result[] = $original_event;\n\n\t\tforeach($original_event as $this_original_event)\n\t\t{\n\t\t\t$tbl = get_conf('mainTblPrefix') . 'event'; //find the id of all events after the selected event\n\t\t\t$sql = \"SELECT id,\n\t\t\t\t\t\t\tstart_date,\n\t\t\t\t\t\t\tend_date\n\t\t\t\t\tFROM \" . $tbl . \"\n\t\t\t\t\tWHERE master_event_id = \" .(int) $this_original_event['master_event_id'] .\"\n\t\t\t\t\t\tAND start_date >= '\" . $this_original_event['start_date'] . \"'\n\t\t\t\t\tORDER BY start_date ASC\";\n\t\t\t$event_id_list = claro_sql_query_fetch_all($sql);\n\n\t\t\tif ($event_id_list == false)$result[] = $event_id_list;\n\t\t\t$nb_event = count($event_id_list);\n\n\t\t\tif ($nb_event>1) //find the repeat_type for this event\n\t\t\t{\n\t\t\t\t$first_comp = strtotime($event_id_list[0]['start_date']);\n\t\t\t\t$second_comp = strtotime($event_id_list[1]['start_date']);\n\t\t\t\t$day_numbers =($second_comp-$first_comp)/(24*60*60);\n\n\t\t\t\tif ($day_numbers==7) $repeat_type=get_lang('Each week');\n\t\t\t\tif ($day_numbers==1) $repeat_type=get_lang('Each day');\n\t\t\t\tif ($day_numbers==28 || $day_numbers==29 || $day_numbers==30 || $day_numbers==31) $repeat_type=get_lang('Each month');\n\t\t\t}\t\t\n\n\t\t\tforeach($event_id_list as $this_event_id)\n\t\t\t{\n\t\t\t\t$result[] = agenda_delete_item($this_event_id['id'],'this'); //delete the events after the selected event\n\t\t\t}\n\t\t\t$result[] = agenda_add_item($course_id, $author_id, $title, $description, $start_date, $end_date, $nb_event,$repeat_type, $visibility ); //create the new updated events\n\t\t}\n\t}\n\tif (is_array($result) && !empty($result))\n\t{\n\t\tforeach($result as $this_result)\n\t\t{\n\t\t\tif ($this_result==false) $final_result=false;\n\t\t}\n\t}\n return $final_result;\n}",
"function my_church_timetable_single_event_layout($cmsmasters_layout) {\r\n\tif (is_singular('events')) {\r\n\t\t$cmsmasters_layout = 'fullwidth';\r\n\t}\r\n\t\r\n\t\r\n\treturn $cmsmasters_layout;\r\n}",
"function sync_event()\n\t{\n\t\t$eventintegratorfolder=\"core/integrate/event\";\n\t\t$tabeventintegrator=$this->loader->charg_dossier_unique_dans_tab($eventintegratorfolder);\n\t\t\n\t\tforeach($tabeventintegrator as $eventintegratorcour)\n\t\t{\n\t\t\t//get nomcodeevenr\n\t\t\t$nomcode=substr($eventintegratorcour,strlen($eventintegratorfolder.\"/eventintegrator.\"),(-(strlen(\".php\"))));\n\t\t\t$nomcodeclass=ucfirst($nomcode);\n\t\t\t\n\t\t\t//addtodb\n\t\t\tinclude_once $eventintegratorcour;\n\t\t\teval(\"\\$instanceEventIntegrator=new EventIntegrator\".$nomcodeclass.\"(\\$this->initer);\");\n\t\t\t$instanceEventIntegrator->setNomcodeevent($nomcode);\n\t\t\t$instanceEventIntegrator->addtodb();\n\t\t}\n\t\t\n\t\treturn true;\n\t}",
"public function postEventedit();",
"function MakeCalendarGrid(){\n //get our days\n $intMonthDays = cal_days_in_month(CAL_GREGORIAN, $this->intMonth, $this->intYear);\n $intDayCounter = 0;\n $arrMonthAttributes = array('colspan'=>'7');\n //make our parent calendar table\n $objCalendarParent = $this->objCalendar->AddChildNode($this->objCalendar->objHTML,'', 'table');\n //let's make our header\n $objHeaderRow = $this->objCalendar->AddChildNode($objCalendarParent,'', 'tr');\n //establish our base attributes\n for($intWeekDay=0;$intWeekDay<7;$intWeekDay++){\n $strDay = date('l', strtotime(\"Sunday +{$intWeekDay} days\"));\n $this->objCalendar->AddChildNode($objHeaderRow,$strDay, 'th',array('class'=>'weekday'));\n }\n //get the starting date\n $intMonthStart = date('N', strtotime($this->intYear.'-'.$this->intMonth.'-1'));\n $intMonthStart++;\n //avoid empty rows\n if($intMonthStart == 8)\n $intMonthStart = 1;\n //make our days now\n for($intDay=1;$intDay<($intMonthDays + $intMonthStart);$intDay++){\n $arrDateAttributes = array('onclick'=>'SelectDay(this);');\n if($intDayCounter === 0){\n //make our new week\n $objWeekRow = $this->objCalendar->AddChildNode($objCalendarParent,'', 'tr');\n $arrDateAttributes['class'] = 'calendarday weekend';\n }\n else if($intDayCounter === 6)\n $arrDateAttributes['class'] = 'calendarday weekend';\n else if($intDay == date('j'))\n $arrDateAttributes['class'] = 'calendarday today';\n else\n $arrDateAttributes['class'] = 'calendarday weekday';\n $intDayCounter++;\n //reset our week now\n if($intDayCounter == 7)\n $intDayCounter = 0;\n if($intDay < $intMonthStart){\n unset($arrDateAttributes['onclick']);\n $this->objCalendar->AddChildNode($objWeekRow,' ', 'td',$arrDateAttributes);\n continue 1;\n }\n $arrDateAttributes['id'] = ($intDay - ($intMonthStart - 1)).'-'.$this->arrCalendarProperties['calendarid'];\n //make our day now\n $this->objCalendar->AddChildNode($objWeekRow,($intDay - ($intMonthStart - 1)), 'td',$arrDateAttributes);\n }\n return TRUE;\n }",
"public function optimizeOnResize($event) {\n\t\t$thumb = $event->return;\n\n\t\t$this->optimize($thumb, false, 'auto');\n\n\t\t$event->return = $thumb;\n\t}",
"public function isEventRecurs() {\n\t\treturn ($this->eventRecurs);\n\t}",
"public function updateAdmin()\r\n\t{\r\n\t\t// Donnees\r\n\t\t$eventId = Bn::getValue('event_id');\r\n\t\t$oEvent = new Oevent($eventId);\r\n\t\t// Controle de l'autorisation\r\n\t\tif ( $oEvent->getVal('ownerid') != Bn::getValue('user_id') && !Oaccount::isLoginAdmin() ) return false;\r\n\r\n\t\t// Donnees du tournoi\r\n\t\t$oEvent->setVal('name', Bn::getValue('nameevent'));\r\n\t\t$oEvent->setVal('date', Bn::getValue('dateevent'));\r\n\t\t$oEvent->setVal('organizer', Bn::getValue('organizer'));\r\n\t\t$oEvent->setVal('place', Bn::getValue('place'));\r\n\t\t$oEvent->setVal('numauto', Bn::getValue('numauto'));\r\n\t\t$oEvent->setVal('firstday', Bn::getValue('firstday'));\r\n\t\t$oEvent->setVal('lastday', Bn::getValue('lastday'));\r\n\t\t$season = Oseason::getSeason(Bn::getValue('firstday'));\r\n\t\t$oEvent->setVal('season', $season);\r\n\t\t$oEvent->save();\t\t\r\n\r\n\t\t$oExtras = new Oeventextra($eventId);\r\n\t\t$oExtras->setVal('regionid', Bn::getValue('regionid'));\r\n\t\t$oExtras->setVal('deptid', Bn::getValue('deptid'));\r\n\t\t$oExtras->save();\r\n\r\n\t\t// Message de fin\r\n\t\t// Preparer les champs de saisie\r\n\t\t$body = new Body();\r\n\t\t$body->addWarning(LOC_LABEL_PREF_REGISTERED);\r\n\t\t$d = $body->addDiv('', 'bn-div-btn');\r\n\t\t$d->addButtonCancel('btnCancel', LOC_BTN_CLOSE);\r\n\r\n\t\t// Envoi au navigateur\r\n\t\t$res = array('content' => $body->toHtml(),\r\n\t\t\t\t\t'title' => LOC_ITEM_GENERAL);\r\n\t\techo Bn::toJson($res);\r\n\t\treturn false;\r\n\t}",
"public function is_update(){\n\t\tglobal $_wt_options;\n\t\tif($this->is_init() && $_wt_options->options(\"eventbrite_auto_update\") ==1) return 1;\n\t\treturn 0;\n\t}",
"function allowResize($allow){\n\t\t$this->headerResizable=$allow;\n\t}",
"public function postEventadd();",
"public function updateEvent()\n {\n $result = $this->_signedResponse($this->vars->cal);\n\n if (!($kronolith_driver = $this->_getDriver($this->vars->cal)) ||\n !isset($this->vars->id)) {\n return $result;\n }\n\n try {\n $oevent = $kronolith_driver->getEvent($this->vars->id);\n } catch (Exception $e) {\n $GLOBALS['notification']->push($e, 'horde.error');\n return $result;\n }\n if (!$oevent) {\n $GLOBALS['notification']->push(_(\"The requested event was not found.\"), 'horde.error');\n return $result;\n } elseif (!$oevent->hasPermission(Horde_Perms::EDIT)) {\n $GLOBALS['notification']->push(_(\"You do not have permission to edit this event.\"), 'horde.warning');\n return $result;\n }\n\n $attributes = Horde_Serialize::unserialize($this->vars->att, Horde_Serialize::JSON);\n\n // If this is a recurring event, need to create an exception.\n if ($oevent->recurs()) {\n $this->_addException($oevent, $attributes);\n $event = $this->_copyEvent($oevent, null, $attributes);\n } else {\n $event = clone($oevent);\n }\n\n foreach ($attributes as $attribute => $value) {\n switch ($attribute) {\n case 'start':\n $newDate = new Horde_Date($value);\n $newDate->setTimezone($event->start->timezone);\n $event->start = clone($newDate);\n break;\n\n case 'end':\n $newDate = new Horde_Date($value);\n $newDate->setTimezone($event->end->timezone);\n $event->end = clone($newDate);\n if ($event->end->hour == 23 &&\n $event->end->min == 59 &&\n $event->end->sec == 59) {\n $event->end->mday++;\n $event->end->hour = $event->end->min = $event->end->sec = 0;\n }\n break;\n\n case 'offDays':\n $event->start->mday += $value;\n $event->end->mday += $value;\n break;\n\n case 'offMins':\n $event->start->min += $value;\n $event->end->min += $value;\n break;\n }\n }\n\n $result = $this->_saveEvent($event, ($oevent->recurs() ? $oevent : null), $attributes);\n if ($this->vars->u) {\n Kronolith::sendITipNotifications($event, $GLOBALS['notification'], Kronolith::ITIP_REQUEST);\n }\n\n return $result;\n }",
"function event__add_edit_event($type, $event, $id = null)\n {\n $_next_day = date('n/j/Y', strtotime($event['start_date'] . ' +1 day'));\n if (empty($event['end_date']))\n {\n if (empty($event['end_time']))\n {\n $event['end_date'] = (empty($event['start_time']) ? $_next_day : $event['start_date']);\n }\n else\n {\n $event['end_date'] = $event['start_date'];\n }\n }\n if (empty($event['start_time'])) $event['start_time'] = '12 am';\n if (empty($event['end_time'])) $event['end_time'] = $event['start_time'];\n\n // Manipulate dates based on checkbox states\n if (!empty($event['no_end_date']))\n {\n $event['end_date'] = (!empty($event['all_day_event']) ? $_next_day : $event['start_date']);\n $event['end_time'] = $event['start_time'];\n }\n elseif (!empty($event['all_day_event']))\n {\n $event['end_date'] = (!empty($event['end_date']) ? $event['end_date'] : $_next_day);\n $event['end_time'] = '12 am';\n }\n $event['date_start'] = date('Y-m-d H:i:s', strtotime($event['start_date'] . ' ' . $event['start_time']));\n $event['date_end'] = date('Y-m-d H:i:s', strtotime($event['end_date'] . ' ' . $event['end_time']));\n unset($event['start_date']);\n unset($event['start_time']);\n unset($event['end_date']);\n unset($event['end_time']);\n\n // Correct for blank latitude/longitude\n if (empty($event['latitude'])) $event['latitude'] = null;\n if (empty($event['longitude'])) $event['longitude'] = null;\n\n // Change '-' to null\n if ($event['status'] == '-') $event['status'] = null;\n\n // Add recordkeeping fields\n $event['date_last_updated'] = date('Y-m-d H:i:s');\n $event['last_updated_by'] = $this->session->userdata('member_id');\n\n // Initialize return variable (null for calls as void function)\n $return = null;\n\n // Determine database calls and some event values based on type\n switch ($type)\n {\n case 'edit':\n // Boolean fields\n if (empty($event['all_day_event'])) $event['all_day_event'] = 0;\n if (empty($event['multiday_event'])) $event['multiday_event'] = 0;\n if (empty($event['rsvp_only'])) $event['rsvp_only'] = 0;\n if (empty($event['hide_address'])) $event['hide_address'] = 0;\n\n // Update event in database\n $this->db->where('id', $id);\n $this->db->update('events', $event);\n\n break;\n case 'add':\n default:\n // Creation recordkeeping\n $event['date_added'] = date('Y-m-d H:i:s');\n $event['added_by'] = $this->session->userdata('member_id');\n\n // Add slug\n $event['slug'] = url_title($event['name'], '-', true);\n\n // Add event to database\n $this->db->insert('events', $event);\n\n // Set return variable to insert ID\n $return = $this->db->insert_id();\n\n break;\n }\n\n // Return insert ID\n return $return;\n }",
"function footer_js(){\n\t\t$r = array();\n\t\t?>\n\t\t<script type='text/javascript'>\n\t\t\tvar wpfc_loaded = false;\n\t\t\tvar wpfc_counts = {};\n\t\t\tvar wpfc_data = { action : 'WP_FullCalendar'<?php\n\t\t\t\t\t//these arguments were assigned earlier on when displaying the calendar, and remain constant between ajax calls\n\t\t\t\t\tif(!empty(self::$args)){ echo \", \"; }\n\t\t\t\t\t$strings = array(); \n\t\t\t\t\tforeach( self::$args as $key => $arg ){\n\t\t\t\t\t\t$arg = is_numeric($arg) ? (int) $arg : \"'$arg'\"; \n\t\t\t\t\t\t$strings[] = \"'$key'\" .\" : \". $arg ; \n\t\t\t\t\t}\n\t\t\t\t\techo implode(\", \", $strings);\n\t\t\t?> };\n\t\t\tjQuery(document).ready( function($){\t\n\t\t\t\tvar fullcalendar_args = {\n\t\t\t\t\ttimeFormat: '<?php echo get_option('wpfc_timeFormat', 'h(:mm)t'); ?>',\n\t\t\t\t\tdefaultView: '<?php echo get_option('wpfc_defaultView', 'month'); ?>',\n\t\t\t\t\tweekends: <?php echo get_option('wpfc_weekends',true) ? 'true':'false'; ?>,\n\t\t\t\t\theader: {\n\t\t\t\t\t\tleft: 'prev,next today',\n\t\t\t\t\t\tcenter: 'title',\n\t\t\t\t\t\tright: '<?php echo implode(',', get_option('wpfc_available_views', array('month','basicWeek','basicDay'))); ?>'\n\t\t\t\t\t},\n\t\t\t\t\tmonth: <?php echo self::$args['month']; ?>,\n\t\t\t\t\tyear: <?php echo self::$args['year']; ?>,\n\t\t\t\t\ttheme: WPFC.wpfc_theme,\n\t\t\t\t\tfirstDay: WPFC.firstDay,\n\t\t\t\t\teditable: false,\n\t\t\t\t\teventSources: [{\n\t\t\t\t\t\t\turl : WPFC.ajaxurl,\n\t\t\t\t\t\t\tdata : wpfc_data,\n\t\t\t\t\t\t\tignoreTimezone: true,\n\t\t\t\t\t\t\tallDayDefault: false\n\t\t\t\t\t}],\n\t\t\t\t eventRender: function(event, element) {\n\t\t\t\t\t\tif( event.post_id > 0 && WPFC.wpfc_qtips == 1 ){\n\t\t\t\t\t\t\tvar event_data = { action : 'wpfc_qtip_content', post_id : event.post_id, event_id:event.event_id };\n\t\t\t\t\t\t\telement.qtip({\n\t\t\t\t\t\t\t\tcontent:{\n\t\t\t\t\t\t\t\t\ttext : 'Loading...',\n\t\t\t\t\t\t\t\t\tajax : {\n\t\t\t\t\t\t\t\t\t\turl : WPFC.ajaxurl,\n\t\t\t\t\t\t\t\t\t\ttype : \"POST\",\n\t\t\t\t\t\t\t\t\t\tdata : event_data\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\tposition : {\n\t\t\t\t\t\t\t\t\tmy: WPFC.wpfc_qtips_my,\n\t\t\t\t\t\t\t\t\tat: WPFC.wpfc_qtips_at\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tstyle : { classes:WPFC.wpfc_qtips_classes }\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t },\n\t\t\t\t\tloading: function(bool) {\n\t\t\t\t\t\tif (bool) {\n\t\t\t\t\t\t\tvar position = $('#wpfc-calendar').position();\n\t\t\t\t\t\t\t$('.wpfc-loading').css('left',position.left).css('top',position.top).css('width',$('#calendar').width()).css('height',$('#calendar').height()).show();\n\t\t\t\t\t\t}else {\n\t\t\t\t\t\t\twpfc_counts = {};\n\t\t\t\t\t\t\t$('.wpfc-loading').hide();\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tviewDisplay: function(view) {\n\t\t\t\t\t\tif( !wpfc_loaded ){\n\t\t\t\t\t\t\t$('.fc-header tbody').append('<tr><td id=\"wpfc-filters\" colspan=\"3\"></td></tr>');\n\t\t\t\t\t\t\tsearch_menu = $('#wpfc-calendar-search').show();\n\t\t\t\t\t\t\t$('#wpfc-filters').append(search_menu);\n\t\t\t\t\t\t\t//catchall selectmenu handle\n\t\t\t\t\t\t\t$('select.wpfc-taxonomy').selectmenu({\n\t\t\t\t\t\t\t\tformat: function(text){\n\t\t\t\t\t\t\t\t\t//replace the color hexes with color boxes\n\t\t\t\t\t\t\t\t\treturn text.replace(/#([a-zA-Z0-9]{3}[a-zA-Z0-9]{3}?) - /g, '<span class=\"wpfc-cat-icon\" style=\"background-color:#$1\"></span>');\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\topen: function(){\n\t\t\t\t\t\t\t\t\t$('.ui-selectmenu-menu').css('z-index','1005');\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}).change(function(event){\n\t\t\t\t\t\t\t\twpfc_data[$(this).attr('name')] = $(this).find(':selected').val();\n\t\t\t\t\t\t\t\t$('#wpfc-calendar').fullCalendar('removeEventSource', WPFC.ajaxurl).fullCalendar('addEventSource', {url : WPFC.ajaxurl, allDayDefault:false, ignoreTimezone: true, data : wpfc_data});\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t\twpfc_loaded = true;\n\t\t\t\t }\n\t\t\t\t};\n\t\t\t\tif( WPFC.wpfc_locale ){\n\t\t\t\t\t$.extend(fullcalendar_args, WPFC.wpfc_locale);\n\t\t\t\t}\n\t\t\t\t$(document).trigger('wpfc_fullcalendar_args', [fullcalendar_args]);\n\t\t\t\t$('#wpfc-calendar').fullCalendar(fullcalendar_args);\n\t\t\t\tif( WPFC.wpfc_theme_css != '' ){ // add themeroller\n\t\t\t\t\t$('script#jquery-ui-css').remove(); //remove old css if exists\n\t\t\t\t\tvar script = document.createElement(\"link\"); script.id = \"jquery-ui-css\"; script.rel = \"stylesheet\"; script.href = WPFC.wpfc_theme_css;\n\t\t\t\t\tdocument.body.appendChild(script);\n\t\t\t\t}\n\t\t\t});\n\t\t\t//selectmenu @ https://github.com/fnagel/jquery-ui\n\t\t\t(function(e){e.widget(\"ui.selectmenu\",{options:{appendTo:\"body\",typeAhead:1e3,style:\"dropdown\",positionOptions:null,width:null,menuWidth:null,handleWidth:26,maxHeight:null,icons:null,format:null,escapeHtml:false,bgImage:function(){}},_create:function(){var t=this,n=this.options;var r=this.element.uniqueId().attr(\"id\");this.ids=[r,r+\"-button\",r+\"-menu\"];this._safemouseup=true;this.isOpen=false;this.newelement=e(\"<a />\",{\"class\":\"ui-selectmenu ui-widget ui-state-default ui-corner-all\",id:this.ids[1],role:\"button\",href:\"#nogo\",tabindex:this.element.attr(\"disabled\")?1:0,\"aria-haspopup\":true,\"aria-owns\":this.ids[2]});this.newelementWrap=e(\"<span />\").append(this.newelement).insertAfter(this.element);var i=this.element.attr(\"tabindex\");if(i){this.newelement.attr(\"tabindex\",i)}this.newelement.data(\"selectelement\",this.element);this.selectmenuIcon=e('<span class=\"ui-selectmenu-icon ui-icon\"></span>').prependTo(this.newelement);this.newelement.prepend('<span class=\"ui-selectmenu-status\" />');this.element.bind({\"click.selectmenu\":function(e){t.newelement.focus();e.preventDefault()}});this.newelement.bind(\"mousedown.selectmenu\",function(e){t._toggle(e,true);if(n.style==\"popup\"){t._safemouseup=false;setTimeout(function(){t._safemouseup=true},300)}e.preventDefault()}).bind(\"click.selectmenu\",function(e){e.preventDefault()}).bind(\"keydown.selectmenu\",function(n){var r=false;switch(n.keyCode){case e.ui.keyCode.ENTER:r=true;break;case e.ui.keyCode.SPACE:t._toggle(n);break;case e.ui.keyCode.UP:if(n.altKey){t.open(n)}else{t._moveSelection(-1)}break;case e.ui.keyCode.DOWN:if(n.altKey){t.open(n)}else{t._moveSelection(1)}break;case e.ui.keyCode.LEFT:t._moveSelection(-1);break;case e.ui.keyCode.RIGHT:t._moveSelection(1);break;case e.ui.keyCode.TAB:r=true;break;case e.ui.keyCode.PAGE_UP:case e.ui.keyCode.HOME:t.index(0);break;case e.ui.keyCode.PAGE_DOWN:case e.ui.keyCode.END:t.index(t._optionLis.length);break;default:r=true}return r}).bind(\"keypress.selectmenu\",function(e){if(e.which>0){t._typeAhead(e.which,\"mouseup\")}return true}).bind(\"mouseover.selectmenu\",function(){if(!n.disabled)e(this).addClass(\"ui-state-hover\")}).bind(\"mouseout.selectmenu\",function(){if(!n.disabled)e(this).removeClass(\"ui-state-hover\")}).bind(\"focus.selectmenu\",function(){if(!n.disabled)e(this).addClass(\"ui-state-focus\")}).bind(\"blur.selectmenu\",function(){if(!n.disabled)e(this).removeClass(\"ui-state-focus\")});e(document).bind(\"mousedown.selectmenu-\"+this.ids[0],function(n){if(t.isOpen&&!e(n.target).closest(\"#\"+t.ids[1]).length){t.close(n)}});this.element.bind(\"click.selectmenu\",function(){t._refreshValue()}).bind(\"focus.selectmenu\",function(){if(t.newelement){t.newelement[0].focus()}});if(!n.width){n.width=this.element.outerWidth()}this.newelement.width(n.width);this.element.hide();this.list=e(\"<ul />\",{\"class\":\"ui-widget ui-widget-content\",\"aria-hidden\":true,role:\"listbox\",\"aria-labelledby\":this.ids[1],id:this.ids[2]});this.listWrap=e(\"<div />\",{\"class\":\"ui-selectmenu-menu\"}).append(this.list).appendTo(n.appendTo);this.list.bind(\"keydown.selectmenu\",function(n){var r=false;switch(n.keyCode){case e.ui.keyCode.UP:if(n.altKey){t.close(n,true)}else{t._moveFocus(-1)}break;case e.ui.keyCode.DOWN:if(n.altKey){t.close(n,true)}else{t._moveFocus(1)}break;case e.ui.keyCode.LEFT:t._moveFocus(-1);break;case e.ui.keyCode.RIGHT:t._moveFocus(1);break;case e.ui.keyCode.HOME:t._moveFocus(\":first\");break;case e.ui.keyCode.PAGE_UP:t._scrollPage(\"up\");break;case e.ui.keyCode.PAGE_DOWN:t._scrollPage(\"down\");break;case e.ui.keyCode.END:t._moveFocus(\":last\");break;case e.ui.keyCode.ENTER:case e.ui.keyCode.SPACE:t.close(n,true);e(n.target).parents(\"li:eq(0)\").trigger(\"mouseup\");break;case e.ui.keyCode.TAB:r=true;t.close(n,true);e(n.target).parents(\"li:eq(0)\").trigger(\"mouseup\");break;case e.ui.keyCode.ESCAPE:t.close(n,true);break;default:r=true}return r}).bind(\"keypress.selectmenu\",function(e){if(e.which>0){t._typeAhead(e.which,\"focus\")}return true}).bind(\"mousedown.selectmenu mouseup.selectmenu\",function(){return false});e(window).bind(\"resize.selectmenu-\"+this.ids[0],e.proxy(t.close,this))},_init:function(){var t=this,n=this.options;var r=[];this.element.find(\"option\").each(function(){var i=e(this);r.push({value:i.attr(\"value\"),text:t._formatText(i.text(),i),selected:i.attr(\"selected\"),disabled:i.attr(\"disabled\"),classes:i.attr(\"class\"),typeahead:i.attr(\"typeahead\"),parentOptGroup:i.parent(\"optgroup\"),bgImage:n.bgImage.call(i)})});var i=t.options.style==\"popup\"?\" ui-state-active\":\"\";this.list.html(\"\");if(r.length){for(var s=0;s<r.length;s++){var o={role:\"presentation\"};if(r[s].disabled){o[\"class\"]=\"ui-state-disabled\"}var u={html:r[s].text||\" \",href:\"#nogo\",tabindex:-1,role:\"option\",\"aria-selected\":false};if(r[s].disabled){u[\"aria-disabled\"]=r[s].disabled}if(r[s].typeahead){u[\"typeahead\"]=r[s].typeahead}var a=e(\"<a/>\",u).bind(\"focus.selectmenu\",function(){e(this).parent().mouseover()}).bind(\"blur.selectmenu\",function(){e(this).parent().mouseout()});var f=e(\"<li/>\",o).append(a).data(\"index\",s).addClass(r[s].classes).data(\"optionClasses\",r[s].classes||\"\").bind(\"mouseup.selectmenu\",function(n){if(t._safemouseup&&!t._disabled(n.currentTarget)&&!t._disabled(e(n.currentTarget).parents(\"ul > li.ui-selectmenu-group \"))){t.index(e(this).data(\"index\"));t.select(n);t.close(n,true)}return false}).bind(\"click.selectmenu\",function(){return false}).bind(\"mouseover.selectmenu\",function(n){if(!e(this).hasClass(\"ui-state-disabled\")&&!e(this).parent(\"ul\").parent(\"li\").hasClass(\"ui-state-disabled\")){n.optionValue=t.element[0].options[e(this).data(\"index\")].value;t._trigger(\"hover\",n,t._uiHash());t._selectedOptionLi().addClass(i);t._focusedOptionLi().removeClass(\"ui-selectmenu-item-focus ui-state-hover\");e(this).removeClass(\"ui-state-active\").addClass(\"ui-selectmenu-item-focus ui-state-hover\")}}).bind(\"mouseout.selectmenu\",function(n){if(e(this).is(t._selectedOptionLi())){e(this).addClass(i)}n.optionValue=t.element[0].options[e(this).data(\"index\")].value;t._trigger(\"blur\",n,t._uiHash());e(this).removeClass(\"ui-selectmenu-item-focus ui-state-hover\")});if(r[s].parentOptGroup.length){var l=\"ui-selectmenu-group-\"+this.element.find(\"optgroup\").index(r[s].parentOptGroup);if(this.list.find(\"li.\"+l).length){this.list.find(\"li.\"+l+\":last ul\").append(f)}else{e('<li role=\"presentation\" class=\"ui-selectmenu-group '+l+(r[s].parentOptGroup.attr(\"disabled\")?\" \"+'ui-state-disabled\" aria-disabled=\"true\"':'\"')+'><span class=\"ui-selectmenu-group-label\">'+r[s].parentOptGroup.attr(\"label\")+\"</span><ul></ul></li>\").appendTo(this.list).find(\"ul\").append(f)}}else{f.appendTo(this.list)}if(n.icons){for(var c in n.icons){if(f.is(n.icons[c].find)){f.data(\"optionClasses\",r[s].classes+\" ui-selectmenu-hasIcon\").addClass(\"ui-selectmenu-hasIcon\");var h=n.icons[c].icon||\"\";f.find(\"a:eq(0)\").prepend('<span class=\"ui-selectmenu-item-icon ui-icon '+h+'\"></span>');if(r[s].bgImage){f.find(\"span\").css(\"background-image\",r[s].bgImage)}}}}}}else{e(' <li role=\"presentation\"><a href=\"#nogo\" tabindex=\"-1\" role=\"option\"></a></li>').appendTo(this.list)}var p=n.style==\"dropdown\";this.newelement.toggleClass(\"ui-selectmenu-dropdown\",p).toggleClass(\"ui-selectmenu-popup\",!p);this.list.toggleClass(\"ui-selectmenu-menu-dropdown ui-corner-bottom\",p).toggleClass(\"ui-selectmenu-menu-popup ui-corner-all\",!p).find(\"li:first\").toggleClass(\"ui-corner-top\",!p).end().find(\"li:last\").addClass(\"ui-corner-bottom\");this.selectmenuIcon.toggleClass(\"ui-icon-triangle-1-s\",p).toggleClass(\"ui-icon-triangle-2-n-s\",!p);if(n.style==\"dropdown\"){this.list.width(n.menuWidth?n.menuWidth:n.width)}else{this.list.width(n.menuWidth?n.menuWidth:n.width-n.handleWidth)}this.list.css(\"height\",\"auto\");var d=this.listWrap.height();var v=e(window).height();var m=n.maxHeight?Math.min(n.maxHeight,v):v/3;if(d>m)this.list.height(m);this._optionLis=this.list.find(\"li:not(.ui-selectmenu-group)\");if(this.element.attr(\"disabled\")){this.disable()}else{this.enable()}this._refreshValue();this._selectedOptionLi().addClass(\"ui-selectmenu-item-focus\");clearTimeout(this.refreshTimeout);this.refreshTimeout=window.setTimeout(function(){t._refreshPosition()},200)},destroy:function(){this.element.removeData(this.widgetName).removeClass(\"ui-selectmenu-disabled\"+\" \"+\"ui-state-disabled\").removeAttr(\"aria-disabled\").unbind(\".selectmenu\");e(window).unbind(\".selectmenu-\"+this.ids[0]);e(document).unbind(\".selectmenu-\"+this.ids[0]);this.newelementWrap.remove();this.listWrap.remove();this.element.unbind(\".selectmenu\").show();e.Widget.prototype.destroy.apply(this,arguments)},_typeAhead:function(e,t){var n=this,r=String.fromCharCode(e).toLowerCase(),i=null,s=null;if(n._typeAhead_timer){window.clearTimeout(n._typeAhead_timer);n._typeAhead_timer=undefined}n._typeAhead_chars=(n._typeAhead_chars===undefined?\"\":n._typeAhead_chars).concat(r);if(n._typeAhead_chars.length<2||n._typeAhead_chars.substr(-2,1)===r&&n._typeAhead_cycling){n._typeAhead_cycling=true;i=r}else{n._typeAhead_cycling=false;i=n._typeAhead_chars}var o=(t!==\"focus\"?this._selectedOptionLi().data(\"index\"):this._focusedOptionLi().data(\"index\"))||0;for(var u=0;u<this._optionLis.length;u++){var a=this._optionLis.eq(u).text().substr(0,i.length).toLowerCase();if(a===i){if(n._typeAhead_cycling){if(s===null)s=u;if(u>o){s=u;break}}else{s=u}}}if(s!==null){this._optionLis.eq(s).find(\"a\").trigger(t)}n._typeAhead_timer=window.setTimeout(function(){n._typeAhead_timer=undefined;n._typeAhead_chars=undefined;n._typeAhead_cycling=undefined},n.options.typeAhead)},_uiHash:function(){var t=this.index();return{index:t,option:e(\"option\",this.element).get(t),value:this.element[0].value}},open:function(e){if(this.newelement.attr(\"aria-disabled\")!=\"true\"){var t=this,n=this.options,r=this._selectedOptionLi(),i=r.find(\"a\");t._closeOthers(e);t.newelement.addClass(\"ui-state-active\");t.list.attr(\"aria-hidden\",false);t.listWrap.addClass(\"ui-selectmenu-open\");if(n.style==\"dropdown\"){t.newelement.removeClass(\"ui-corner-all\").addClass(\"ui-corner-top\")}else{this.list.css(\"left\",-5e3).scrollTop(this.list.scrollTop()+r.position().top-this.list.outerHeight()/2+r.outerHeight()/2).css(\"left\",\"auto\")}t._refreshPosition();if(i.length){i[0].focus()}t.isOpen=true;t._trigger(\"open\",e,t._uiHash())}},close:function(e,t){if(this.newelement.is(\".ui-state-active\")){this.newelement.removeClass(\"ui-state-active\");this.listWrap.removeClass(\"ui-selectmenu-open\");this.list.attr(\"aria-hidden\",true);if(this.options.style==\"dropdown\"){this.newelement.removeClass(\"ui-corner-top\").addClass(\"ui-corner-all\")}if(t){this.newelement.focus()}this.isOpen=false;this._trigger(\"close\",e,this._uiHash())}},change:function(e){this.element.trigger(\"change\");this._trigger(\"change\",e,this._uiHash())},select:function(e){if(this._disabled(e.currentTarget)){return false}this._trigger(\"select\",e,this._uiHash())},widget:function(){return this.listWrap.add(this.newelementWrap)},_closeOthers:function(t){e(\".ui-selectmenu.ui-state-active\").not(this.newelement).each(function(){e(this).data(\"selectelement\").selectmenu(\"close\",t)});e(\".ui-selectmenu.ui-state-hover\").trigger(\"mouseout\")},_toggle:function(e,t){if(this.isOpen){this.close(e,t)}else{this.open(e)}},_formatText:function(t,n){if(this.options.format){t=this.options.format(t,n)}else if(this.options.escapeHtml){t=e(\"<div />\").text(t).html()}return t},_selectedIndex:function(){return this.element[0].selectedIndex},_selectedOptionLi:function(){return this._optionLis.eq(this._selectedIndex())},_focusedOptionLi:function(){return this.list.find(\".ui-selectmenu-item-focus\")},_moveSelection:function(e,t){if(!this.options.disabled){var n=parseInt(this._selectedOptionLi().data(\"index\")||0,10);var r=n+e;if(r<0){r=0}if(r>this._optionLis.size()-1){r=this._optionLis.size()-1}if(r===t){return false}if(this._optionLis.eq(r).hasClass(\"ui-state-disabled\")){e>0?++e:--e;this._moveSelection(e,r)}else{this._optionLis.eq(r).trigger(\"mouseover\").trigger(\"mouseup\")}}},_moveFocus:function(e,t){if(!isNaN(e)){var n=parseInt(this._focusedOptionLi().data(\"index\")||0,10);var r=n+e}else{var r=parseInt(this._optionLis.filter(e).data(\"index\"),10)}if(r<0){r=0}if(r>this._optionLis.size()-1){r=this._optionLis.size()-1}if(r===t){return false}var i=\"ui-selectmenu-item-\"+Math.round(Math.random()*1e3);this._focusedOptionLi().find(\"a:eq(0)\").attr(\"id\",\"\");if(this._optionLis.eq(r).hasClass(\"ui-state-disabled\")){e>0?++e:--e;this._moveFocus(e,r)}else{this._optionLis.eq(r).find(\"a:eq(0)\").attr(\"id\",i).focus()}this.list.attr(\"aria-activedescendant\",i)},_scrollPage:function(e){var t=Math.floor(this.list.outerHeight()/this._optionLis.first().outerHeight());t=e==\"up\"?-t:t;this._moveFocus(t)},_setOption:function(e,t){this.options[e]=t;if(e==\"disabled\"){if(t)this.close();this.element.add(this.newelement).add(this.list)[t?\"addClass\":\"removeClass\"](\"ui-selectmenu-disabled \"+\"ui-state-disabled\").attr(\"aria-disabled\",t)}},disable:function(e,t){if(typeof e==\"undefined\"){this._setOption(\"disabled\",true)}else{if(t==\"optgroup\"){this._toggleOptgroup(e,false)}else{this._toggleOption(e,false)}}},enable:function(e,t){if(typeof e==\"undefined\"){this._setOption(\"disabled\",false)}else{if(t==\"optgroup\"){this._toggleOptgroup(e,true)}else{this._toggleOption(e,true)}}},_disabled:function(t){return e(t).hasClass(\"ui-state-disabled\")},_toggleOption:function(e,t){var n=this._optionLis.eq(e);if(n){n.toggleClass(\"ui-state-disabled\",t).find(\"a\").attr(\"aria-disabled\",!t);if(t){this.element.find(\"option\").eq(e).attr(\"disabled\",\"disabled\")}else{this.element.find(\"option\").eq(e).removeAttr(\"disabled\")}}},_toggleOptgroup:function(e,t){var n=this.list.find(\"li.ui-selectmenu-group-\"+e);if(n){n.toggleClass(\"ui-state-disabled\",t).attr(\"aria-disabled\",!t);if(t){this.element.find(\"optgroup\").eq(e).attr(\"disabled\",\"disabled\")}else{this.element.find(\"optgroup\").eq(e).removeAttr(\"disabled\")}}},index:function(t){if(arguments.length){if(!this._disabled(e(this._optionLis[t]))&&t!=this._selectedIndex()){this.element[0].selectedIndex=t;this._refreshValue();this.change()}else{return false}}else{return this._selectedIndex()}},value:function(e){if(arguments.length&&e!=this.element[0].value){this.element[0].value=e;this._refreshValue();this.change()}else{return this.element[0].value}},_refreshValue:function(){var e=this.options.style==\"popup\"?\" ui-state-active\":\"\";var t=\"ui-selectmenu-item-\"+Math.round(Math.random()*1e3);this.list.find(\".ui-selectmenu-item-selected\").removeClass(\"ui-selectmenu-item-selected\"+e).find(\"a\").attr(\"aria-selected\",\"false\").attr(\"id\",\"\");this._selectedOptionLi().addClass(\"ui-selectmenu-item-selected\"+e).find(\"a\").attr(\"aria-selected\",\"true\").attr(\"id\",t);var n=this.newelement.data(\"optionClasses\")?this.newelement.data(\"optionClasses\"):\"\";var r=this._selectedOptionLi().data(\"optionClasses\")?this._selectedOptionLi().data(\"optionClasses\"):\"\";this.newelement.removeClass(n).data(\"optionClasses\",r).addClass(r).find(\".ui-selectmenu-status\").html(this._selectedOptionLi().find(\"a:eq(0)\").html());this.list.attr(\"aria-activedescendant\",t)},_refreshPosition:function(){var t=this.options,n={of:this.newelement,my:\"left top\",at:\"left bottom\",collision:\"flip\"};if(t.style==\"popup\"){var r=this._selectedOptionLi();n.my=\"left top\"+(this.list.offset().top-r.offset().top-(this.newelement.outerHeight()+r.outerHeight())/2);n.collision=\"fit\"}this.listWrap.removeAttr(\"style\").zIndex(this.element.zIndex()+2).position(e.extend(n,t.positionOptions))}})})(jQuery)\n\t\t</script>\n\t\t<?php\n\t}",
"function __resize(&$tmp, $width, $height) {\n\t\t\n\t\t// call `convert -geometry`\n\t\t//\n\t\t$cmd = $this->__command(\n\t\t\t'convert',\n \t\"-geometry {$width}x{$height}! \"\n \t\t. escapeshellarg(realpath($tmp->target))\n \t\t. \" \"\n \t\t. escapeshellarg(realpath($tmp->target))\n \t);\n\n exec($cmd, $result, $errors);\n\t\treturn ($errors == 0);\n\t\t}",
"function getDraggable() { return $this->readdraggable(); }",
"function getDraggable() { return $this->readdraggable(); }",
"function DisplayMapOfEvents($width='100%',$height='100%')\r\n\t{\r\n\t\tif($_SETTINGS['default_eventsmap_width'] != \"\") { $width = $_SETTINGS['default_eventsmap_width']; }\r\n\t\tif($_SETTINGS['default_eventsmap_height'] != \"\") { $height = $_SETTINGS['default_eventsmap_height']; }\r\n\t\techo '<div id=\"map_of_events\" style=\"width:'.$width.'; height:'.$height.';\"></div>';\r\n\t}",
"public function calculateEventDimensions()\n {\n if (!$this->eventsByGroupId) return;\n\n foreach ($this->eventsByGroupId as $group => &$events)\n {\n // Use the current chart height as defined\n // by the previous groups as a baseline to\n // add the group padding to. This way different\n // groups won't intersect with each other.\n if ($this->chartHeight == 0)\n $groupHeight = 0;\n else\n $groupHeight = $this->chartHeight + $this->groupPadding;\n\n // Loop through the events of this group\n foreach ($events as &$event)\n {\n // Calculate the width of this event\n $timeDifferenceInEvent = $event->event_datetime_start->diff($event->event_datetime_end);\n $thisWidth = $this->getDatetimeDifferenceWidth($timeDifferenceInEvent);\n\n // Calculate the X coordinate of this event\n $timeDifferenceToStart = $this->startDatetime->diff($event->event_datetime_start);\n $thisX = $this->getDatetimeDifferenceWidth($timeDifferenceToStart);\n\n // Calculate the Y coordinate of this event\n $thisY = $groupHeight;\n $thisY += $event->depth * ($this->lineHeight + $this->linePadding);\n\n // Set the values in the event's data\n $event->event_px_width = $thisWidth;\n $event->event_px_height = $this->lineHeight;\n $event->event_px_x = $thisX;\n $event->event_px_y = $thisY;\n\n // See if we got a new maximum height for the chart and set that\n $this->chartHeight = max($this->chartHeight, $thisY + $this->lineHeight);\n }\n }\n }",
"public function testUpdateValidEvent (): void {\n\t\t//count the number of rows and save it for later\n\t\t$numRows = $this->getConnection()->getRowCount(\"event\");\n\n\t\t// create a new Event and insert into mySQL\n\t\t$eventId = generateUuidV4();\n\t\t$event = new Event ($eventId, $this->profile->getProfileId(), $this->VALID_EVENTATTENDEELIMIT,$this->VALID_EVENTDETAIL, $this->VALID_EVENTENDDATETIME,$this->VALID_EVENTIMAGE, $this->VALID_EVENTLAT, $this->VALID_EVENTLONG, $this->VALID_EVENTNAME, $this->VALID_EVENTPRICE, $this->VALID_EVENTSTARTDATETIME);\n\t\t$event->insert($this->getPDO());\n\n\t\t// edit the event and update it in mySQL\n\t\t$event->setEventDetail($this->VALID_EVENTDETAIL2);\n\t\t$event->update($this->getPDO());\n\n\n\t\t// grab the data from mySQL and enforce the fields meet our expectations\n\t\t$pdoEvent = Event::getEventByEventId($this->getPDO(), $event->getEventId());\n\t\t$this->assertEquals($pdoEvent->getEventId(), $eventId);\n\t\t$this->assertEquals($numRows + 1, $this->getConnection()->getRowCount(\"event\"));\n\t\t$this->assertEquals($pdoEvent->getEventId(), $eventId);\n\t\t$this->assertEquals($pdoEvent->getEventProfileId(),$this->profile->getProfileId());\n\t\t$this->assertEquals($pdoEvent->getEventAttendeeLimit(), $this->VALID_EVENTATTENDEELIMIT);\n\t\t// format the date too seconds since the beginning of time to avoid round off error\n\t\t$this->assertEquals($pdoEvent->getEventDetail(), $this->VALID_EVENTDETAIL2);\n\t\t$this->assertEquals($pdoEvent->getEventEndDateTime(),$this->VALID_EVENTENDDATETIME);\n\t\t$this->assertEquals($pdoEvent->getEventImage(), $this->VALID_EVENTIMAGE);\n\t\t$this->assertEquals($pdoEvent->getEventLat(), $this->VALID_EVENTLAT);\n\t\t$this->assertEquals($pdoEvent->getEventLong(), $this->VALID_EVENTLONG);\n\t\t$this->assertEquals($pdoEvent->getEventName(), $this->VALID_EVENTNAME);\n\t\t$this->assertEquals($pdoEvent->getEventPrice(), $this->VALID_EVENTPRICE);\n\t\t// format the date too seconds since the beginning of time to avoid round off error\n\t\t$this->assertEquals($pdoEvent->getEventStartDateTime(), $this->VALID_EVENTSTARTDATETIME);\n\t}",
"function setEvent() {\n \n if($_POST['am'] == 1){\n $star_time = $_POST['stime_a'] + 12 . \":\". $_POST['stime_b'];\n }else{\n $star_time = $_POST['stime_a'] . \":\". $_POST['stime_b'];\n }\n \n if($_POST['am1'] == 1){\n $end_time = $_POST['stime_c'] + 12 . \":\". $_POST['stime_d'];\n }else{\n $end_time = $_POST['stime_c'] . \":\". $_POST['stime_d'];\n }\n\n $values = array('event_id' => uniqid(),\n 'web_id' => WEB_ID,\n 'title' => $_POST['title'],\n 's_time' => $star_time,\n 'e_time' => $end_time,\n 'date' => date('Y-m-d H:i:s', strtotime($_POST['sDate'])),\n 'location' => $_POST['location'],\n 'description' => $_POST['disc'],\n 'end_date' => date('Y-m-d H:i:s', strtotime($_POST['eDate'])),\n 'visible' => \"on\"\n );\n\n $this->db->insert('events', $values);\n }",
"public function hasDataCollectionEvents() {\n return $this->_has(8);\n }",
"public function setConfig($config)\n {\n $this->calendarWidth = $config['calendarWidth'] ?: '500px';\n $this->calendarHeight = $config['calendarHeight'] ?: '840px';\n }",
"public function updateSingleEvent() {\n\t\ttry {\n\t\t\t$id = Request::input('id');\n\t\t\t$before_end_date = Request::input('beforeEndDate');\n\t\t\t$after_start_date = Request::input('afterStartDate');\n\t\t\t$current_date = Request::input('currentDate');\n\t\t\t$original_event = ConnectContent::findOrFail($id);\n\n\t\t\t//Replicate the event for before, after and current\n\t\t\t$before = $original_event->replicate();\n\t\t\t$after = $original_event->replicate();\n\n\t\t\t$current = $original_event->replicate();\n\n\t\t\t//Update the time of this single current event\n\t\t\t$current->start_time = getMySQLTimeFormat(Request::input('start_time'));\n\t\t\t$current->end_time = getMySQLTimeFormat(Request::input('end_time'));\n\t\t\t$current->start_date = Request::input('start_date');\n\t\t\t$current->end_date = Request::input('end_date');\n\t\t\t$current->what = Request::input('what');\n\t\t\t$current->who = Request::input('who');\n\n\t\t\t//We split the talk show timelines into before and after current date\n\t\t\t$before->end_date = $before_end_date;\n\t\t\t$after->start_date = $after_start_date;\n\n\t\t\t$current->start_date = $current->end_date = $current_date;\n\n\t\t\tif($current->content_type_id == ContentType::GetMusicMixContentTypeID()) {\n\t\t\t\t$current->mix_title = Request::input('mix_title') ? Request::input('mix_title') : $current->mix_title;\n\t\t\t}\n\n\t\t\t$before->save();\n\t\t\t$after->save();\n\t\t\t$current->save();\n\t\t\t\n\t\t\tif (\\Auth::User()->station->is_private) {\n\t\t\t\t$before->updateContentToTagsLinkStatic();\n\t\t\t\t$after->updateContentToTagsLinkStatic();\n\t\t\t\t$current->updateContentToTagsLinkStatic();\n\t\t\t} else {\n\t\t\t\t$before->updateContentToTagsLink();\n\t\t\t\t$after->updateContentToTagsLink();\n\t\t\t\t$current->updateContentToTagsLink();\n\t\t\t}\n\n\t\t\t//Replicate attachments for new before and after talk show recurrences\n\t\t\t$attachments = ConnectContentAttachment::where('content_id', $id)\n\t\t\t\t->get();\n\t\t\tforeach($attachments as $attachment) {\n\t\t\t\t$attachment_for_before = $attachment->replicate();\n\t\t\t\t$attachment_for_before->content_id= $before->id;\n\t\t\t\t$attachment_for_after = $attachment->replicate();\n\t\t\t\t$attachment_for_after ->content_id = $after->id;\n\t\t\t\t$attachment_for_current = $attachment->replicate();\n\t\t\t\t$attachment_for_current->content_id= $current->id;\n\t\t\t\t$attachment_for_before->save();\n\t\t\t\t$attachment_for_after->save();\n\t\t\t\t$attachment_for_current->save();\n\t\t\t\t//Should we delete the original attachments?\n\t\t\t}\n\n\n\t\t\t$original_event->removeConnectContent();\n\n\t\t\t$is_complete = false;\n\t\t\t$images = ConnectContentAttachment::where('content_id', '=', $current['id'])->whereIn('type', ['image', 'video', 'logo'])->first();\n\n\t\t\tif(count($images) > 0 && !empty($current['who']) && !empty($current['what']) && $current['action_id'] && !empty($current['action_params']) && $current['is_ready']) {\n\t\t\t\t$is_complete = true;\n\t\t\t}\n\n\t\t\t$current->is_complete = $is_complete;\n\n\t\t\treturn response()->json(array('code' => 0, 'msg' => 'Talk Show Updated', 'data' => array('id'=> $id, 'before' => $before, 'after' => $after, 'current' => $current)));\n\t\t} catch (\\Exception $ex) {\n\t\t\t\\Log::error($ex);\n\t\t\treturn response()->json(array('code' => -1, 'msg' => $ex->getMessage()));\n\t\t}\n\t}",
"function update() {\n\t\t$vars = $this->params['url'];\n\t\t$this->Event->id = $vars['id'];\n\t\t$this->Event->saveField('start', $vars['start']);\n\t\t$this->Event->saveField('end', $vars['end']);\n\t\t$this->Event->saveField('all_day', $vars['allday']);\n\t}",
"public function update(Request $request, $id)\n {\n\n\n $request->validate([\n 'event-title' => 'required',\n 'event-message' => 'required',\n 'eventStart-date' => 'required',\n 'event-time' => 'required'\n\n ]);\n\n $event = Event::find($id);\n if(Auth::check()){\n $logged_in_user = Auth::user()->name;\n }\n $registra = $event->event_registra;\n \n if(Gate::allows('update-event',$registra)){\n\n $title = request('event-title');\n $startDate = request('eventStart-date');\n $endDate = request('eventEnd-date');\n $time = request('event-time');\n $event_description = request('event-message');\n\n $event_description = preg_replace(\"/^<p.*?>/\", \"\", $event_description);\n $event_description = preg_replace(\"|</p>$|\", \"\", $event_description);\n $time = preg_replace('/\\s+/', '', $time) ;\n\n\n\n $event_details = $this->getEventdetails($id);\n foreach($event_details as $data)\n {\n $this->old_title = $data->title;\n $this->old_content = $data->description;\n $this->old_sdate = $data->start_date;\n $this->old_edate = $data->end_date;\n $this->old_stime = $data->start_time;\n }\n \n switch(true){\n case($title != $this->old_title):\n $changes[] = \"changed \".$this->old_title.\"\";\n break;\n case($startDate != $this->old_sdate):\n $changes[] = \"changed \".$this->old_sdate.\"\";\n break;\n case($endDate != $this->old_edate):\n $changes[] = \"changed \".$this->old_edate.\"\";\n break;\n case($time != $this->old_stime):\n $changes[] = \"changed \".$this->old_stime.\"\";\n break;\n }\n\n \n\n $event->title = $title;\n $event->start_date = $startDate;\n $event->end_date = $endDate;\n $event->start_time = $time;\n $event->description = $event_description;\n $event->event_registra = $logged_in_user;\n $registraEmail = Auth::user()->email;\n $registraPhone = Auth::user()->contact;\n $subject = \"Updated Event \".$this->old_title.\"\";\n\n $event_update_status = $event->save();\n\n if($event_update_status){\n\n $users = User::all();\n\n ($endDate == \"\")?\n $endDate_of_event = \"the same day\" : $endDate_of_event = $endDate;\n\n\n $data = array(\n 'title' => $title,\n 'description' => $event_description,\n 'start_date' => $startDate,\n 'end_date' => $endDate_of_event,\n 'time' => $time,\n 'registra' => $logged_in_user,\n 'registra_email' => $registraEmail,\n 'registraMobileNo' => $registraPhone,\n 'subject' => $subject,\n );\n\n $action = \"Updated an event with the title '\".$title.\"'\";\n LogsController::logger($action, $this->date_of_action);\n\n $notified = Notification::send($users, new EventNotifier($data));\n \n $central = new CentralController();\n\n if($central->is_connectedToInternet() == 1)\n {\n Mail::send('pages.mail.mail_event', $data, function($message) use ($title,$event_description, $startDate,$endDate_of_event,\n $time, $logged_in_user,$registraEmail,$registraPhone,$subject)\n { \n $message->from($registraEmail, 'Dallington');\n $message->to($registraEmail, 'Henry')->subject($subject);\n }); \n\n if(Mail::failures()){\n return redirect('events')->with('event-success','Event has been updated successfully and all users of the system have been notified with in the app notification but not via email because of internet connection issues');\n\n } \n\n else{\n\n return redirect('events')->with('event-success','Event has been updated successfully & all users of the system have been notified within the app notification & email'); \n }\n\n }\n\n else if($central->is_connectedToInternet() == 0)\n {\n return redirect('events')->with('event-success','Event has been updated successfully and all users of the system have been notified only in app notification');\n\n }\n\n\n\n }\n else\n {\n return redirect('events')->with('event-fail','Event has not been updated!');\n}\n\n}\n else\n {\n return redirect('/events')->with('event-fail','You cannot edit this event since you are not the one who created it!');\n}\n\n}",
"function event_grid_view() {\n\tsp_calendar_grid();\n}",
"function rst_manage_seats_moncalender()\n{\n require_once('inc/inc.fullcalendar.php');\n}",
"public function updatePresentation()\r\n\t{\r\n\t\t// Donnees\r\n\t\t$eventId = Bn::getValue('event_id');\r\n\t\t$oEvent = new Oevent($eventId);\r\n\t\t$oEventmeta = new Oeventmeta($eventId);\r\n\t\t// Controle de l'autorisation\r\n\t\tif ( $oEvent->getVal('ownerid') != Bn::getValue('user_id') && !Oaccount::isLoginAdmin() ) return false;\r\n\r\n\t\t// Donnees du tournoi\r\n\t\t$oEventmeta->setVal('eventid', $eventId);\r\n\t\t$oEventmeta->setVal('skin', Bn::getValue('skin'));\r\n\t\t$oEventmeta->save();\r\n\r\n\t\t$postFiles = $_FILES;\r\n\t\t$value = reset($postFiles);\r\n\t\t$tempFilename = $value['tmp_name'];\r\n\t\tif (!empty($value['tmp_name']) )\r\n\t\t{\r\n\t\t\t$file = $value['name'];\r\n\t\t\t$oEvent->addPoster($value['tmp_name'], $file);\r\n\t\t}\r\n\r\n\t\t// Message de fin\r\n\t\t$body = new Body();\r\n\t\t$body->addWarning(LOC_LABEL_PREF_REGISTERED);\r\n\t\t$d = $body->addDiv('', 'bn-div-btn');\r\n\t\t$d->addButtonCancel('btnCancel', LOC_BTN_CLOSE);\r\n\r\n\t\treturn BPREF_PAGE_PRESENTATION;\r\n\t}",
"function save_calendar_events( $post_id ) {\n $post_title = get_the_title( $post_id );\n\n // Only run this code if we're on a particilar post / page\n if( 'Calendar Events' != $post_title )\n return;\n\n write_log( 'Saving Calendar Events to post_content...' );\n // Start an output buffer\n ob_start();\n\n // Loop over our testimonials\n if ( have_rows( 'events' ) ) : ?>\n <div class=\"calendar-events wpb_row vc_row-fluid vc_row standard_section\">\n <?php while ( have_rows( 'events' ) ) : the_row() ?>\n <div class=\"col span_12 dark left event\">\n <div class=\"vc_col-sm-3\">\n <?php\n $thumbnail = get_sub_field( 'thumbnail' );\n if( ! empty( $thumbnail ) && is_array( $thumbnail ) ){\n ?><img class=\"alignleft thumbnail\" src=\"<?= $thumbnail['url']; ?>\" alt=\"<?= $thumbnail['alt']; ?>\" /><?php\n }\n ?>\n </div>\n <div class=\"vc_col-md-5\">\n <h3><?php the_sub_field( 'title' ) ?></h3>\n <?php the_sub_field( 'description' ) ?>\n </div>\n <div class=\"vc_col-md-4 details\">\n <h5>Time</h5>\n <?php the_sub_field( 'time' ) ?>\n <h5>Location</h5>\n <?php\n $location_link = get_sub_field( 'location_link' );\n if( ! empty( $location_link ) ){\n echo '<a href=\"' . $location_link . '\" target=\"_blank\">' . get_sub_field( 'location' ) . '</a>';\n } else {\n the_sub_field( 'location_link' );\n }\n $rsvp_link = get_sub_field( 'rsvp_link' );\n if( is_email( $rsvp_link ) )\n $rsvp_link = 'mailto:' . $rsvp_link;\n write_log( '$rsvp_link = ' . $rsvp_link );\n if( ! empty( $rsvp_link ) ){\n echo '<p><a class=\"button\" href=\"' . $rsvp_link . '\" target=\"_blank\">RSVP</a></p>';\n }\n ?>\n </div>\n </div>\n <?php endwhile; ?>\n </div><!-- .calendar-events -->\n <?php endif;\n\n // Store output buffer\n $new_post_content = ob_get_clean();\n\n // Update the post_content\n wp_update_post( ['ID' => $post_id, 'post_content' => $new_post_content ] );\n\n\n}",
"function DisplayCalendarOfEvents()\r\n\t{\r\n\t\tglobal $_SETTINGS;\r\n\t\techo \"<div id='calendar'></div>\";\t\r\n\t}",
"function eventon_dynamic_inline_styles(){\r\n\t// Load variables\r\n\t$evcal_val1= get_option('evcal_options_evcal_1');\r\n\t\r\n\t// get icons for the event card\r\n\tfor($x=1; $x<8; $x++){\r\n\t\tif(!empty($evcal_val1['evcal_icon_00'.$x]) )\r\n\t\t\t$icon_array[$x] = wp_get_attachment_image_src($evcal_val1['evcal_icon_00'.$x], 'full');\r\n\t}\r\n\t\r\n\t\r\n\techo \"<style type='text/css'>\";\r\n\t\r\n\t// (---) Hook for addons\r\n\tif(has_action('eventon_inline_styles')){\r\n\t\tdo_action('eventon_inline_styles');\r\n\t}\r\n\t\r\n\techo get_option('evcal_styles');\r\n\t\r\n\techo \"\r\n\t\t\r\n\t\t\".((!empty($evcal_val1['evo_ftimgheight']))?\r\n\t\t\t\".evcal_evdata_img{height:\".$evcal_val1['evo_ftimgheight'].\"px}\":null ).\"\r\n\t\t\r\n\t\t.ajde_evcal_calendar .calendar_header p, .eventon_sort_line p, .eventon_filter_line p, .eventon_events_list .eventon_list_event .evcal_cblock, .evcal_cblock, .eventon_events_list .eventon_list_event .evcal_desc span.evcal_desc2, .evcal_desc span.evcal_desc2, .evcal_evdata_row .evcal_evdata_cell h2, .evcal_evdata_row .evcal_evdata_cell h3.evo_h3, .evcal_month_line p{\r\n\t\t\tfont-family:\".( (!empty($evcal_val1['evcal_font_fam']))? $evcal_val1['evcal_font_fam']:\"oswald, 'arial narrow'\" ).\"; \r\n\t\t}\r\n\t\t\r\n\t\t/*-- arrow --*/\t\t\r\n\t\t.evcal_evdata_row .evcal_evdata_icons.evcalicon_1{\r\n\t\t\t\".( (!empty($icon_array[1]))? 'background:url('.$icon_array[1][0].') center center no-repeat':'background-position:0 0px' ).\"\r\n\t\t}.evcal_evdata_row .evcal_evdata_icons.evcalicon_2{\r\n\t\t\t\".( (!empty($icon_array[2]))? 'background:url('.$icon_array[2][0].') center center no-repeat':'background-position:0 -31px' ).\"\r\n\t\t}.evcal_evdata_row .evcal_evdata_icons.evcalicon_3{\r\n\t\t\t\".( (!empty($icon_array[3]))? 'background:url('.$icon_array[3][0].') center center no-repeat':'background-position:0 -125px' ).\"\r\n\t\t}.evcal_evdata_row .evcal_evdata_icons.evcalicon_4{\r\n\t\t\t\".( (!empty($icon_array[4]))? 'background:url('.$icon_array[4][0].') center center no-repeat':'background-position:0 -64px' ).\"\r\n\t\t}.evcal_evdata_row .evcal_evdata_icons.evcalicon_5{\r\n\t\t\t\".( (!empty($icon_array[5]))? 'background:url('.$icon_array[5][0].') center center no-repeat':'background-position:0 -96px' ).\"\r\n\t\t}.evcal_evdata_row .evcal_evdata_icons.evcalicon_6{\r\n\t\t\t\".( (!empty($icon_array[6]))? 'background:url('.$icon_array[6][0].') center center no-repeat':'background-position:0 -190px' ).\"\r\n\t\t}.evcal_evdata_row .evcal_evdata_icons.evcalicon_7{\r\n\t\t\t\".( (!empty($icon_array[7]))? 'background:url('.$icon_array[7][0].') center center no-repeat':'background-position:0 -225px' ).\"\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t#evcal_list .eventon_list_event .event_description .evcal_btn{\r\n\t\t\tcolor:#\".( (!empty($evcal_val1['evcal_gen_btn_fc']))? $evcal_val1['evcal_gen_btn_fc']:'fff' ).\";\t\t\t\r\n\t\t\tbackground-color:#\".( (!empty($evcal_val1['evcal_gen_btn_bgc']))? $evcal_val1['evcal_gen_btn_bgc']:'237ebd' ).\";\t\t\t\r\n\t\t}\r\n\t\t#evcal_list .eventon_list_event .event_description .evcal_btn:hover{\r\n\t\t\tcolor:#\".( (!empty($evcal_val1['evcal_gen_btn_fcx']))? $evcal_val1['evcal_gen_btn_fcx']:'fff' ).\";\r\n\t\t\tbackground-color:#\".( (!empty($evcal_val1['evcal_gen_btn_bgcx']))? $evcal_val1['evcal_gen_btn_bgcx']:'237ebd' ).\";\r\n\t\t}\r\n\t\t\r\n\t\t/*-- font color match --*/\r\n\t\t#evcal_list .eventon_list_event .evcal_desc em{\r\n\t\t\tcolor:#\".( (!empty($evcal_val1['evcal__fc6']))? $evcal_val1['evcal__fc6']:'8c8c8c' ).\";\r\n\t\t}\";\r\n\t\t\r\n\t\tif(!empty($evcal_val1['evcal__fc6'])){\r\n\t\t\techo \"#evcal_widget .eventon_events_list .eventon_list_event .evcal_desc .evcal_desc_info em{\r\n\t\t\t\tcolor:#\". $evcal_val1['evcal__fc6'].\"\r\n\t\t\t}\";\r\n\t\t}\r\n\t\t\r\n\t\techo \".ajde_evcal_calendar #evcal_head.calendar_header #evcal_cur, .ajde_evcal_calendar .evcal_month_line p{\r\n\t\t\tcolor:#\".( (!empty($evcal_val1['evcal_header1_fc']))? $evcal_val1['evcal_header1_fc']:'C6C6C6' ).\";\r\n\t\t}\r\n\t\t#evcal_list .eventon_list_event .evcal_cblock{\r\n\t\t\tcolor:#\".( (!empty($evcal_val1['evcal__fc2']))? $evcal_val1['evcal__fc2']:'ABABAB' ).\";\r\n\t\t}\r\n\t\t#evcal_list .eventon_list_event .evcal_desc span.evcal_event_title{\r\n\t\t\tcolor:#\".( (!empty($evcal_val1['evcal__fc3']))? $evcal_val1['evcal__fc3']:'6B6B6B' ).\";\r\n\t\t}\r\n\t\t.evcal_evdata_row .evcal_evdata_cell h2, .evcal_evdata_row .evcal_evdata_cell h3{\r\n\t\t\tcolor:#\".( (!empty($evcal_val1['evcal__fc4']))? $evcal_val1['evcal__fc4']:'6B6B6B' ).\";\r\n\t\t}\r\n\t\t#evcal_list .eventon_list_event .evcal_eventcard p{\r\n\t\t\tcolor:#\".( (!empty($evcal_val1['evcal__fc5']))? $evcal_val1['evcal__fc5']:'656565' ).\";\r\n\t\t}\r\n\t\t.eventon_events_list .eventon_list_event .evcal_eventcard, .evcal_evdata_row{\r\n\t\t\tbackground-color:#\".( (!empty($evcal_val1['evcal__bc1']))? $evcal_val1['evcal__bc1']:'EAEAEA' ).\";\r\n\t\t}\r\n\t\t\t\t\t\r\n\t\t#eventon_loadbar{\r\n\t\t\tbackground-color:#\".eventon_styles('6B6B6B','evcal_header1_fc', $evcal_val1).\"; height:2px; width:0%}\r\n\t\t\r\n\t\t/*-- font sizes --*/\r\n\t\t.evcal_evdata_row .evcal_evdata_cell h3{font-size:\".eventon_styles('18px','evcal_fs_001', $evcal_val1).\";}\r\n\t\t\r\n\t\t</style>\";\r\n\t\r\n}",
"function is_config_over_resize() {\n\treturn conditional_config('over_resize');\n}",
"function squarecandy_acf_events_enqueue_scripts() {\n\n\twp_enqueue_style( 'squarecandy-fontawesome', ACF_EVENTS_URL . 'dist/css/vendor/font-awesome/css/font-awesome.min.css', false, ACF_EVENTS_VERSION );\n\twp_enqueue_style( 'squarecandy-acf-events-css', ACF_EVENTS_URL . 'dist/css/main.min.css', false, ACF_EVENTS_VERSION );\n\n\tif (\n\t\t// if maps option is on\n\t\tget_option( 'options_show_map_on_detail_page' ) &&\n\t\t// and there's a google maps API key entered\n\t\tget_option( 'options_google_maps_api_key' ) &&\n\t\t// and it's a single page view\n\t\tis_single() &&\n\t\t// and it's an event\n\t\t'event' === get_post_type( get_the_ID() )\n\t) {\n\t\t$google_maps_api_key = get_option( 'options_google_maps_api_key' );\n\t\twp_enqueue_script( 'squarecandy-acf-events-gmapapi', 'https://maps.googleapis.com/maps/api/js?key=' . $google_maps_api_key, array(), ACF_EVENTS_VERSION, true );\n\t\twp_enqueue_script( 'squarecandy-acf-events-maps', ACF_EVENTS_URL . 'dist/js/googlemaps.min.js', array( 'jquery' ), ACF_EVENTS_VERSION, true );\n\t\t// gather data to localize in the google maps script\n\t\t$data['location'] = get_field( 'venue_location' );\n\t\t$data['mapjson'] = get_option( 'options_google_maps_json' );\n\t\t$event = get_fields();\n\t\t$data['infowindow'] = get_squarecandy_acf_events_address_display( $event, 'infowindow', false );\n\t\tif ( ! isset( $event['zoom_level'] ) ) {\n\t\t\tif ( get_option( 'options_default_zoom_level' ) ) {\n\t\t\t\t$event['zoom_level'] = get_option( 'options_default_zoom_level' );\n\t\t\t} else {\n\t\t\t\t$event['zoom_level'] = 15;\n\t\t\t}\n\t\t}\n\t\t$data['zoomlevel'] = $event['zoom_level'];\n\t\twp_localize_script( 'squarecandy-acf-events-maps', 'DATA', $data );\n\t}\n\n\twp_enqueue_script( 'squarecandy-acf-events-js', ACF_EVENTS_URL . 'dist/js/main.min.js', array( 'jquery' ), ACF_EVENTS_VERSION, true );\n\twp_localize_script(\n\t\t'squarecandy-acf-events-js',\n\t\t'eventsdata',\n\t\tarray(\n\t\t\t'ajaxurl' => admin_url( 'admin-ajax.php' ),\n\t\t\t'nonce' => wp_create_nonce( 'events-ajax-nonce' ),\n\t\t)\n\t);\n}",
"public function date_widget($data = array())\n\t{\n\t\t$this->actions();\n\n\t\t$id = ee()->TMPL->fetch_param('event_id');\n\n\t\tif ($id AND is_numeric($id) AND $id > 0)\n\t\t{\n\t\t\t$data = $this->data->fetch_event_data_for_view($id);\n\n\t\t\t$eoid = $this->data->get_event_entry_id_by_channel_entry_id($id);\n\n\t\t\tif ($eoid != FALSE AND $eoid != $id)\n\t\t\t{\n\t\t\t\t$data['edit_occurrence'] = TRUE;\n\t\t\t}\n\t\t}\n\n\t\t// -------------------------------------\n\t\t//\tcalendar permissions\n\t\t// -------------------------------------\n\n\t\tee()->load->library('calendar_permissions');\n\n\t\tif ($id > 0)\n\t\t{\n\t\t\t$temp = $this->data->get_calendar_id_by_event_entry_id($id);\n\t\t\t$parent_calendar_id = (isset($temp[$id]) ? $temp[$id] : 0);\n\t\t}\n\n\t\tif ( $id != 0 AND\n\t\t\t $parent_calendar_id > 0 AND\n\t\t\t ! ee()->calendar_permissions->group_has_permission(\n\t\t\t\tee()->session->userdata['group_id'],\n\t\t\t\t$parent_calendar_id\n\t\t))\n\t\t{\n\t\t\treturn $this->show_error(lang('invalid_calendar_permissions'));\n\t\t}\n\n\t\tif ( ! isset($data['rules'])) \t\t\t$data['rules'] \t\t\t\t= array();\n\t\tif ( ! isset($data['occurrences'])) \t$data['occurrences'] \t\t= array();\n\t\tif ( ! isset($data['exceptions'])) \t\t$data['exceptions'] \t\t= array();\n\t\tif ( ! isset($data['edit_occurrence'])) $data['edit_occurrence'] \t= FALSE;\n\n\t\treturn $this->actions->date_widget($data);\n\t}",
"function cs_pb_event($die = 0){\n\tglobal $cs_node, $count_node, $post;\n\tif ( isset($_POST['action']) ) {\n\t\t$name = $_POST['action'];\n\t\t$counter = $_POST['counter'];\n\t\t$event_element_size = '50';\n\t\t$cs_event_title_db = '';\n\t\t$cs_event_view_db = '';\n\t\t$cs_event_type_db = '';\n\t\t$cs_event_category_db = '';\n\t\t$cs_event_time_db = '';\n\t\t$cs_event_organizer_db = '';\n \t\t$cs_event_filterables_db = '';\n\t\t$cs_event_pagination_db = '';\n\t\t$cs_event_per_page_db = get_option(\"posts_per_page\");\n\t}\n\telse {\n\t\t$name = $cs_node->getName();\n\t\t\t$count_node++;\n\t\t\t$event_element_size = $cs_node->event_element_size;\n\t\t\t$cs_event_title_db = $cs_node->cs_event_title;\n\t\t\t$cs_event_view_db = $cs_node->cs_event_view;\n\t\t\t$cs_event_type_db = $cs_node->cs_event_type;\n\t\t\t$cs_event_category_db = $cs_node->cs_event_category;\n\t\t\t$cs_event_time_db = $cs_node->cs_event_time;\n\t\t\t$cs_event_organizer_db = $cs_node->cs_event_organizer;\n \t\t\t$cs_event_filterables_db = $cs_node->cs_event_filterables;\n\t\t\t$cs_event_pagination_db = $cs_node->cs_event_pagination;\n\t\t\t$cs_event_per_page_db = $cs_node->cs_event_per_page;\n\t\t\t\t$counter = $post->ID.$count_node;\n}\n?> \n\t<div id=\"<?php echo $name.$counter?>_del\" class=\"column parentdelete column_<?php echo $event_element_size?>\" item=\"event\" data=\"<?php echo element_size_data_array_index($event_element_size)?>\" >\n\t\t<div class=\"column-in\">\n <h5><?php echo ucfirst(str_replace(\"cs_pb_\",\"\",$name))?></h5>\n <input type=\"hidden\" name=\"event_element_size[]\" class=\"item\" value=\"<?php echo $event_element_size?>\" >\n <a href=\"javascript:hide_all('<?php echo $name.$counter?>')\" class=\"options\">Options</a>\n <a href=\"#\" class=\"delete-it btndeleteit\">Del</a> \n <a class=\"decrement\" onclick=\"javascript:decrement(this)\">Dec</a> \n <a class=\"increment\" onclick=\"javascript:increment(this)\">Inc</a>\n\t\t</div>\n <div class=\"poped-up\" id=\"<?php echo $name.$counter?>\" style=\"border:none; background:#f8f8f8;\" >\n <div class=\"opt-head\">\n <h5>Edit Event Options</h5>\n <a href=\"javascript:show_all('<?php echo $name.$counter?>')\" class=\"closeit\"> </a>\n </div>\n <div class=\"opt-conts\">\n \t<ul class=\"form-elements\">\n <li class=\"to-label\"><label>Event Title</label></li>\n <li class=\"to-field\">\n <input type=\"text\" name=\"cs_event_title[]\" class=\"txtfield\" value=\"<?php echo htmlspecialchars($cs_event_title_db)?>\" />\n <p>Event Page Title</p>\n </li>\n </ul>\n <ul class=\"form-elements\">\n <li class=\"to-label\"><label>View</label></li>\n <li class=\"to-field\">\n <select name=\"cs_event_view[]\" class=\"dropdown\">\n <option value=\"List View\" <?php if($cs_event_view_db==\"List View\")echo \"selected\";?> >List View</option>\n <option value=\"Grid View\" <?php if($cs_event_view_db==\"Grid View\")echo \"selected\";?> >Grid View</option>\n <option value=\"Calendar View\" <?php if($cs_event_view_db==\"Calendar View\")echo \"selected\";?> >Calendar View</option>\n </select>\n <p>Select layout for Listing page, calender view contain all the dates of events in calender format. List view contain all the events with title and description in list.</p>\n </li>\n </ul>\n <ul class=\"form-elements\">\n <li class=\"to-label\"><label>Event Types</label></li>\n <li class=\"to-field\">\n <select name=\"cs_event_type[]\" class=\"dropdown\">\n <option <?php if($cs_event_type_db==\"All Events\")echo \"selected\";?> >All Events</option>\n <option <?php if($cs_event_type_db==\"Upcoming Events\")echo \"selected\";?> >Upcoming Events</option>\n <option <?php if($cs_event_type_db==\"Past Events\")echo \"selected\";?> >Past Events</option>\n </select>\n <p>Select event type</p>\n </li>\n </ul>\n <ul class=\"form-elements\">\n <li class=\"to-label\"><label>Select Category</label></li>\n <li class=\"to-field\">\n <select name=\"cs_event_category[]\" class=\"dropdown\">\n \t<option value=\"0\">-- Select Category --</option>\n <?php show_all_cats('', '', $cs_event_category_db, \"event-category\");?>\n </select>\n </li>\n </ul>\n <ul class=\"form-elements\">\n <li class=\"to-label\"><label>Show Time</label></li>\n <li class=\"to-field\">\n <select name=\"cs_event_time[]\" class=\"dropdown\">\n <option value=\"Yes\" <?php if($cs_event_time_db==\"Yes\")echo \"selected\";?> >Yes</option>\n <option value=\"No\" <?php if($cs_event_time_db==\"No\")echo \"selected\";?> >No</option>\n </select>\n </li>\n </ul>\n <ul class=\"form-elements\" style=\"display:none;\">\n <li class=\"to-label\"><label>Show Organizer</label></li>\n <li class=\"to-field\">\n <select name=\"cs_event_organizer[]\" class=\"dropdown\">\n <option value=\"Yes\" <?php if($cs_event_organizer_db==\"Yes\")echo \"selected\";?> >Yes</option>\n <option value=\"No\" <?php if($cs_event_organizer_db==\"No\")echo \"selected\";?> >No</option>\n </select>\n </li>\n </ul>\n <ul class=\"form-elements\">\n <li class=\"to-label\"><label>Filterables</label></li>\n <li class=\"to-field\">\n <select name=\"cs_event_filterables[]\" class=\"dropdown\" >\n <option value=\"No\" <?php if($cs_event_filterables_db==\"No\")echo \"selected\";?> >No</option>\n <option value=\"Yes\" <?php if($cs_event_filterables_db==\"Yes\")echo \"selected\";?> >Yes</option>\n </select>\n </li>\n </ul>\n <ul class=\"form-elements\">\n <li class=\"to-label\"><label>Pagination</label></li>\n <li class=\"to-field\">\n <select name=\"cs_event_pagination[]\" class=\"dropdown\" >\n <option <?php if($cs_event_pagination_db==\"Show Pagination\")echo \"selected\";?> >Show Pagination</option>\n <option <?php if($cs_event_pagination_db==\"Single Page\")echo \"selected\";?> >Single Page</option>\n </select>\n <p>Show navigation only at List View.</p>\n </li>\n </ul>\n <ul class=\"form-elements\">\n <li class=\"to-label\"><label>No. of Events Per Page</label></li>\n <li class=\"to-field\">\n <input type=\"text\" name=\"cs_event_per_page[]\" class=\"txtfield\" value=\"<?php echo $cs_event_per_page_db; ?>\" />\n <p>To display all the records, leave this field blank.</p>\n </li>\n </ul>\n <ul class=\"form-elements noborder\">\n <li class=\"to-label\"></li>\n <li class=\"to-field\">\n \t<input type=\"hidden\" name=\"cs_orderby[]\" value=\"event\" />\n <input type=\"button\" value=\"Save\" style=\"margin-right:10px;\" onclick=\"javascript:show_all('<?php echo $name.$counter?>')\" />\n </li>\n </ul>\n </div>\n </div>\n </div>\n<?php\n\tif ( $die <> 1 ) die();\n}",
"public function update_event($data)\n {\n if (!isset($data['id']) || !$data['id']) {\n return false;\n }\n //\n // Permissions\n //\n if (!empty($data['gid'])) {\n $targetGroupId = $data['gid'];\n } else {\n $oldEvent = $this->get_event($data['id']);\n $targetGroupId = $oldEvent['gid'];\n }\n // Am I the owner?\n if ($this->getGroupOwner($targetGroupId) != $this->uid) {\n // If not, I should have write permissions through a share\n $perms = $GLOBALS['DB']->getUserSharedFolderPermissions($this->uid, 'calendar', $targetGroupId);\n if (empty($perms) || empty($perms['write'])) {\n // No, I haven't\n return false;\n }\n }\n //\n //\n\n $query = 'UPDATE '.$this->Tbl['cal_event'].' SET lastmod=NOW()';\n $datafields = array('start' => 'starts', 'end' => 'ends',\n 'title' => 'title', 'description' => 'description', 'location' => 'location',\n 'type' => 'type', 'status' => 'status', 'opaque' => 'opaque', 'gid' => 'gid'\n );\n foreach ($datafields as $k => $v) {\n if (!isset($data[$k])) {\n continue;\n }\n $query .= ',`'.$v.'`=\"'.$this->esc($data[$k]).'\"';\n }\n $query .= ' WHERE id='.$data['id'];\n\n $this->query($query);\n\n $this->query('DELETE FROM '.$this->Tbl['cal_reminder'].' WHERE `uid`='.$this->uid.' AND `ref`=\"evt\" AND `eid`='.$data['id']);\n $this->query('DELETE FROM '.$this->Tbl['cal_repetition'].' WHERE `ref`=\"evt\" AND `eid`='.$data['id']);\n if (isset($data['reminders']) && !empty($data['reminders'])) {\n $query = 'INSERT INTO '.$this->Tbl['cal_reminder'].' (`eid`,`ref`,`uid`,`mode`,`time`,`text`,`smsto`,`mailto`) VALUES ';\n $k = 0;\n foreach ($data['reminders'] as $v) {\n if ($k) {\n $query .= ',';\n }\n if ($v['mode'] == '-') {\n continue;\n }\n\n if (!isset($v['smsto'])) {\n $v['smsto'] = '';\n }\n if (!isset($v['mailto'])) {\n $v['mailto'] = '';\n }\n\n $query .= '('.doubleval($data['id']).',\"evt\",'.$this->uid.',\"'.$this->esc($v['mode']).'\"'\n .','.doubleval($v['time']).',\"'.$this->esc($v['text']).'\"'\n .',\"'.$this->esc($v['smsto']).'\",\"'.$this->esc($v['mailto']).'\")';\n $k++;\n }\n if ($k > 0) {\n $this->query($query);\n }\n }\n if (isset($data['repetitions']) && !empty($data['repetitions'])) {\n $query = 'INSERT INTO '.$this->Tbl['cal_repetition'].' (`eid`,`ref`,`type`,`repeat`,`extra`,`until`) VALUES ';\n $k = 0;\n foreach ($data['repetitions'] as $v) {\n if ($k) {\n $query .= ',';\n }\n $query .= '('.doubleval($data['id']).',\"evt\",\"'.$this->esc($v['type']).'\",'.doubleval($v['repeat'])\n .','.(!is_null($v['extra']) ? '\"'.$this->esc($v['extra']).'\"' : '\"\"')\n .','.(!is_null($v['until']) ? '\"'.$this->esc($v['until']).'\"' : 'NULL').')';\n $k++;\n }\n if ($k > 0) {\n $this->query($query);\n }\n } else {\n $query = 'INSERT INTO '.$this->Tbl['cal_repetition'].' (`eid`,`ref`,`type`,`repeat`,`extra`,`until`) VALUES '\n .'('.doubleval($data['id']).',\"evt\",\"-\",0,\"\",NULL)';\n $this->query($query);\n }\n return true;\n }",
"function ui_resizable_support_to($selector , $configurations = array()){\n $pattern = _ui_resizable_pattern($configurations);\n init_ui_sintax('resizable',$pattern,$selector ,$configurations);\n}",
"function jes_theme_template_standart() {\r\nglobal $bp;\r\n/**************************************/\r\n/* Standart Template for Event Loop */\r\n/* */\r\n/* Base Template\t\t\t\t\t */\r\n/**************************************/\r\n?>\r\n<?php\r\n\t$jes_adata = get_site_option('jes_events' );\r\n\t$_eventstatus = eventstatus(jes_bp_get_event_edtsd(),jes_bp_get_event_edtsth(),jes_bp_get_event_edtstm(),jes_bp_get_event_edted(),jes_bp_get_event_edteth(),jes_bp_get_event_edtetm());\r\n?>\r\n<li>\r\n\t<div class=\"item-avatar\" id=\"jes-avatar\">\r\n\t\t<?php if ($jes_adata['jes_events_show_avatar_directory_size'] > 50 ) { ?>\r\n\t\t<a href=\"<?php jes_bp_event_permalink() ?>\"><?php jes_bp_event_avatar( 'type=full&width='.$jes_adata['jes_events_show_avatar_directory_size'].'&height='.$jes_adata['jes_events_show_avatar_directory_size'] ) ?></a>\r\n\t\t<?php } else { ?>\r\n\t\t<a href=\"<?php jes_bp_event_permalink() ?>\"><?php jes_bp_event_avatar( 'type=thumb&width='.$jes_adata['jes_events_show_avatar_directory_size'].'&height='.$jes_adata['jes_events_show_avatar_directory_size'] ) ?></a>\r\n\t\t<?php } ?>\r\n\t</div>\r\n\r\n\t<div class=\"item\" style=\"width:80%;\" id=\"jes-templ-item-<?php jes_bp_event_id() ?>\">\r\n\t\t<div class=\"item-title\" id=\"jes-title\"><a href=\"<?php jes_bp_event_permalink() ?>\"><?php jes_bp_event_name() ?></a></div>\t\t\t\r\n\t\t\t<div class=\"item-meta\" id=\"jes-template-meta-<?php jes_bp_event_id() ?>\">\r\n\t\t\t\t<em><?php echo $_eventstatus; ?></em> , <em><?php jes_bp_event_type() ?></em>\r\n\t\t\t\t<div class=\"item-desc\" id=\"jes-timedate-<?php jes_bp_event_id() ?>\">\r\n\t\t\t\t\t<strong>Starts:</strong> <span class=\"meta\"><?php jes_bp_event_edtsd() ?>, \r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t<?php\r\n\t\t\t\t\t\t\t\t\t// JLL_MOD - conert military time to 12 hour\r\n\t\t\t\t$shour = jes_bp_get_event_edtsth();\r\n\t\t\t\tif ( $shour == '00' ) { \r\n\t\t\t\t\t$shour = '12';\r\n\t\t\t\t\t$stime = ' am';\r\n\t\t\t\t} elseif ( $shour > 12 ) { \r\n\t\t\t\t\t$shour = $shour - 12;\r\n\t\t\t\t\t$stime = ' pm';\r\n\t\t\t\t} elseif ( $shour < 10 ) { \r\n\t\t\t\t\t$shour = substr( $shour, -1 );\r\n\t\t\t\t\t$stime = ' am';\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$stime = ' am';\r\n\t\t\t\t}\r\n\t\t\t\t$ehour = jes_bp_get_event_edteth();\r\n\t\t\t\tif ( $ehour == '00' ) { \r\n\t\t\t\t\t$ehour = '12';\r\n\t\t\t\t\t$etime = ' am';\r\n\t\t\t\t} elseif ( $ehour > 12 ) { \r\n\t\t\t\t\t$ehour = $ehour - 12;\r\n\t\t\t\t\t$etime = ' pm';\r\n\t\t\t\t} elseif ( $ehour < 10 ) { \r\n\t\t\t\t\t$ehour = substr( $ehour, -1 );\r\n\t\t\t\t\t$etime = ' am';\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$etime = ' am';\r\n\t\t\t\t}\r\n\t\t\t\t?>\t\t\t\r\n\r\n\t\t\t\t\t<?php echo $shour; ?>:<?php jes_bp_event_edtstm() ?><?php echo $stime; ?></span>\r\n <?php if ( jes_bp_get_event_edtsd() == jes_bp_get_event_edted() && jes_bp_get_event_edtsth() == jes_bp_get_event_edteth() && jes_bp_get_event_edtstm() == jes_bp_get_event_edtetm() ) {} else { ?>\r\n <strong>Ends:</strong> <span><?php jes_bp_event_edted() ?>, <?php echo $ehour; ?>:<?php jes_bp_event_edtetm() ?><?php echo $etime; ?></span><?php }; ?>\r\n\t\t\t\t</div>\r\n\t\t\t<div class=\"item-desc\" id=\"jes-desc-<?php jes_bp_event_id() ?>\">\r\n\t\t\t\t<span><strong>Where: </strong> <?php // JLL_MOD - removed ?><?php if ( jes_bp_event_is_visible() ) { ?><?php jes_bp_event_placedaddress() ?> <?php } ?></span><br />\r\n\t\t\t</div>\r\n\t\t<?php if ($jes_adata['jes_events_style'] == 'Standart') { ?>\r\n\t\t\t<?php // JLL_MOD - Removed text ?><?php jes_bp_event_description_excerpt() ?>\r\n\t\t<?php } else { ?>\r\n\t\t\t<?php jes_bp_event_description() ?>\r\n\t\t<?php } ?>\r\n\t\t\t</div>\t\t\t\t\r\n<?php do_action( 'bp_directory_events_item' ) ?>\r\n\t\t</div>\r\n\t\t<div class=\"action\" id=\"jes-button\">\r\n\t\t\t<?php \r\n\t\t\t\tif (!strpos($_eventstatus,__('Past event','jet-event-system')))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tbp_event_join_button();\r\n\t\t\t\t\t}\r\n\t\t\t?>\r\n\t\t\t\t<div class=\"meta\" id=\"jes-approval-<?php jes_bp_event_id() ?>\">\r\n\t\t\t\t\t<?php if ( $shiftcan ) \r\n\t\t\t\t\t\t\t{ ?>\r\n\t\t\t\t\t\t\t\t<span class=\"meta\"><em><?php _e('Event requires approval!','jet-event-system'); ?></em></span>\r\n\t\t\t\t\t<?php }\t?>\r\n\t\t\t\t\t<?php // JLL_MOD - removed event classification ?>\r\n\t\t\t\t\t<p><?php jes_bp_event_member_count() ?></p>\r\n\t\t\t\t\t<span class=\"activity\"><?php printf( __( 'Last activity:<br /> %s ago', 'jet-event-system' ), jes_bp_get_event_last_active() ) ?></span>\r\n\t\t\t\t</div>\r\n<?php do_action( 'bp_directory_events_actions' ) ?>\r\n\t\t\t</div>\r\n\t\t<div class=\"clear\"></div>\r\n</li>\r\n<?php\r\n// End Standart Template\r\n}",
"public function ics_update()\n\t{\n\t\t// -------------------------------------\n\t\t// Load 'em up\n\t\t// -------------------------------------\n\n\t\t$this->load_calendar_datetime();\n\t\t$this->load_calendar_parameters();\n\n\t\t// -------------------------------------\n\t\t// Prep the parameters\n\t\t// -------------------------------------\n\n\t\t$params = array(\n\t\t\tarray(\t'name' => 'category',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'multi' => TRUE\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'site_id',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t'min_value' => 1,\n\t\t\t\t\t'multi' => TRUE,\n\t\t\t\t\t'default' => $this->data->get_site_id()\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'calendar_id',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t'min_value' => 1,\n\t\t\t\t\t'multi' => TRUE\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'calendar_name',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'multi' => TRUE\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'time_range_start',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'time'\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'time_range_end',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'time'\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'minute_interval',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t'default' => 60\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'status',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'multi' => TRUE,\n\t\t\t\t\t'default' => 'open'\n\t\t\t\t\t)\n\t\t\t);\n\n\t\t//ee()->TMPL->log_item('Calendar: Processing parameters');\n\n\t\t$this->add_parameters($params);\n\n\t\t// -------------------------------------\n\t\t// If we are not currently in the time range, scram\n\t\t// -------------------------------------\n\n\t\t$time = date('Hi', time());\n\n\t\tif ($this->P->value('time_range_start', 'time') !== FALSE AND\n\t\t\t$this->P->value('time_range_start', 'time') > $time)\n\t\t{\n\t\t\t//ee()->TMPL->log_item('Calendar: It is not time to update icalendar data yet.');\n\t\t\treturn;\n\t\t}\n\t\telse if ($this->P->value('time_range_end', 'time') !== FALSE AND\n\t\t\t\t$this->P->value('time_range_end', 'time') < $time)\n\t\t{\n\t\t\t//ee()->TMPL->log_item('Calendar: The time to update icalendar data has passed.');\n\t\t\treturn;\n\t\t}\n\n\t\tif ($this->P->value('calendar_id') == '')\n\t\t{\n\t\t\t// -------------------------------------\n\t\t\t// For those who prefer names over numbers\n\t\t\t// -------------------------------------\n\n\t\t\tif ($this->P->value('calendar_name') != '')\n\t\t\t{\n\t\t\t\t$ids = $this->data->get_calendar_id_from_name($this->P->value('calendar_name'));\n\t\t\t}\n\n\t\t\t// -------------------------------------\n\t\t\t// Just a site ID -- get all calendars\n\t\t\t// -------------------------------------\n\n\t\t\telse\n\t\t\t{\n\t\t\t\t$ids = $this->data->get_calendars_by_site_id($this->P->value('site_id'));\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$ids = explode('|', $this->P->value('calendar_id'));\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// Only look at calendars that are due for an update\n\t\t// -------------------------------------\n\n\t\tif ( ! empty($ids) AND $this->P->value('minute_interval') !== FALSE)\n\t\t{\n\t\t\t$ids = $this->data->get_calendars_needing_update(\n\t\t\t\t$ids,\n\t\t\t\t$this->P->value('minute_interval')\n\t\t\t);\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// Leave if empty\n\t\t// -------------------------------------\n\n\t\tif (empty($ids))\n\t\t{\n\t\t\t//ee()->TMPL->log_item('Calendar: Nobody is due for an update');\n\t\t\treturn;\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// Go get those data!\n\t\t// -------------------------------------\n\n\t\t$this->actions();\n\n//ee()->TMPL->log_item('Calendar: Fetching data');\n\n\t\tforeach ($ids as $id)\n\t\t{\n\t\t\t$this->actions->import_ics_data($id);\n\t\t}\n\t}",
"static function add_events_metaboxes() {\n \tadd_meta_box(\n \t\t'mindevents_calendar',\n \t\t'Calendar',\n \t\tarray('mindeventsAdmin', 'display_calendar_metabox' ),\n \t\t'events',\n \t\t'normal',\n \t\t'default'\n \t);\n\n add_meta_box(\n \t\t'mindevents_event_options',\n \t\t'Calendar Options',\n \t\tarray('mindeventsAdmin', 'display_event_options_metabox' ),\n \t\t'events',\n \t\t'side',\n \t\t'default'\n \t);\n\n }",
"public function testResizeTo() {\r\n $callback = function() {\r\n $expected = Dimension::createInstance(15, 15);\r\n $this->checkbox->resizeTo($expected);\r\n\r\n $actual = $this->checkbox->getDimension();\r\n $this->assertEquals($expected->width, $actual->width);\r\n $this->assertEquals($expected->height, $actual->height);\r\n\r\n\r\n $this->checkbox->resizeTo(Dimension::createInstance(150, 150));\r\n\r\n $actual = $this->checkbox->getDimension();\r\n $this->assertEquals(Checkbox::MAX_WIDTH, $actual->width);\r\n $this->assertEquals(Checkbox::MAX_HEIGHT, $actual->height);\r\n\r\n $this->timer->destroy();\r\n $this->application->stop();\r\n };\r\n\r\n $this->timer = new Timer($callback, $this->application->getWindow(), Timer::TEST_TIMEOUT);\r\n\r\n $this->timer->start();\r\n\r\n $this->application->start();\r\n }",
"function hookRegisterStyles() {\n\t \tif (!is_admin() && get_option('fse_load_fc_libs') == true) {\n\t \t\t// Check if user has its own CSS file in the theme folder\n\t \t\t$custcss = get_template_directory().'/fullcalendar.css';\n\t \t\tif (file_exists($custcss))\n\t \t\t$css = get_bloginfo('template_url').'/fullcalendar.css';\n\t \t\telse\n\t \t\t$css = self::$plugin_css_url.'fullcalendar.css';\n\t \t\twp_enqueue_style('fullcalendar', $css);\n\t \t}\n\t }",
"function __resize(&$tmp, $width, $height) {\r\r\n\t\tasido::trigger_abstract_error(\r\r\n\t\t\t__CLASS__,\r\r\n\t\t\t__FUNCTION__\r\r\n\t\t\t);\r\r\n\t\t}",
"function church_admin_calendar_widget($args)\n{\n global $wpdb;\n\n extract($args);\n $options=get_option('church_admin_widget');\n $title=$options['title'];\n \n echo $before_widget;\n if ( $title )echo $before_title . $title . $after_title;\n \n echo church_admin_calendar_widget_output($options['events'],$options['postit'],$title);\n echo $after_widget;\n}",
"function ajax_event_table_edit($db, $eventID)\r\n{\r\n if(!isset($_SESSION['errMsg']))\r\n {\r\n\t\t//Create the general select query.\r\n $query = \"SELECT * FROM event WHERE startDate >= CURDATE() AND event_started != 2 AND eventID =\" . $eventID; \r\n $result = $db->query($query); \t\t\t\t\t\t\t\t\t\t\t\r\n $row1 = $result->fetch_array(MYSQLI_BOTH); \r\n \r\n\t\t// use it first for the title\r\n $eName= $row1['event_name'];\r\n $eLocation = $row1['event_location'];\r\n $eStartTime = $row1['startTime'];\r\n $eEventDate = $row1['startDate'];\r\n\t\t$eDays = $row1['days'];\r\n $eServerIP = $row1['server_IP_address'];\r\n $eSeatNum = $row1['seatQuantity'];\r\n }\r\n if(isset($_SESSION['errMsg']))\r\n\t{\r\n\t\techo \"<br /><p class='redAstrix'>\" . $_SESSION['errMsg'] . \"</p>\";\r\n\t\t$eName= $_POST['event_name'];\r\n\t\t$eLocation = $_POST['event_location'];\r\n\t\t$eStartTime = $_POST['startTime'];\r\n\t\t$eEventDate = $_POST['startDate'];\r\n\t\t$eDays = $row1['days'];\r\n\t\t$eServerIP = $_POST['server_IP_address'];\r\n\t\t$eSeatNum = $_POST['seatQuantity'];\r\n\t\t$eventID = $_POST['eventID'];\r\n\t}\r\n\r\n\t// CONVERT SQL DATE TO USER INTERFACE DATE\r\n\t$year = substr($eEventDate, 0, 4);\r\n\t$month = substr($eEventDate, 5, 2);\r\n\t$day = substr($eEventDate, 8, 2);\r\n\t$eEventDate = $day.'/'.$month.'/'.$year;\r\n?>\r\n\r\n\r\n<table class='pizzaOrder'>\r\n<tr>\r\n\t<td class='MANheader' width='600px' colspan='2'>\r\n\t Current Events: \r\n\t<font size=\"2\" class=\"subtitle\">Click on an event to see more information below</font></td>\r\n</tr>\r\n\r\n<?php\r\n$query = \"SELECT * FROM event WHERE startDate >= CURDATE() AND event_started != 2 ORDER BY startDate ASC\";\r\n$result = $db->query($query);\r\n\r\n// Now we can output the option fields to populate the list box.\r\nfor ($i=0; $i<$result->num_rows; $i++) \r\n{\r\n\t$row = $result->fetch_assoc(); \r\n\r\n\techo '<tr class=\"pointer\" id=\"eventRow_'.$i.'\" onclick=\"getEvent('.$row[\"eventID\"].')\">';\r\n\t\techo '<td width=\"70px\">';\r\n\t\t\techo '<div style=\"position: relative; top: 5px;\">';\r\n\t\t?>\r\n\t\t\t<!-- // DELETE EVENT BUTTON -->\r\n\t\t\t<img class=\"pointer\"\r\n\t\t\t\tsrc=\"../images/buttons/delete_60.png\"';\r\n\t\t\t\talt=\"Delete this event\" \r\n\t\t\t\tonclick=\"deleteEvent(<?php echo $row[\"eventID\"]; ?>, '<?php echo $row[\"event_name\"]; ?>')\" />\r\n\t\t<?php\r\n\t\t\techo '</div>';\r\n\t\techo '</td>';\r\n\t\techo '<td>';\r\n\t\t\techo $row['event_name'];\r\n\t\t\techo ' - <font size=\"1\">['.dateToScreen($row['startDate']).']</font>';\r\n\t\techo '</td>';\r\n\techo '</tr>';\r\n}\r\necho '</table>';\r\n?>\r\n\r\n\r\n\r\n<br /><br />\r\n\r\n\r\n\r\n<!-- form name=\"eventEdit\" -->\r\n<!-- E_ stands for 'Edit_*item*' -->\r\n<table cellspacing=\"0\" class=\"pizzaOrder\" border=\"0\">\r\n\t<tr>\r\n\t\t<th id=\"headCell_left\" colspan=\"2\" align=\"left\"> Edit Event Details</th>\r\n\t</tr>\r\n\r\n\t<tr>\r\n\t\t<td><b>Event Name: </b></td>\r\n\t\t<td><input type=\"text\" name=\"E_event_name\" id=\"E_event_name\" \r\n\t\t\t\t value=\"<?php echo $eName; ?>\" \r\n\t\t\t\t size=\"50\" maxlength=\"64\" /></td>\r\n\t</tr>\r\n\r\n\t<tr>\r\n\t\t<td><b>Event Location: </b></td>\r\n\t\t<td><input type=\"text\" name=\"E_event_location\" id=\"E_event_location\" \r\n\t\t\t\t value=\"<?php echo $eLocation; ?>\" \r\n\t\t\t\t size=\"50\" maxlength=\"128\" /></td>\r\n\t</tr>\r\n\r\n\t<tr>\r\n\t\t<td><b>Event Date: </b></td>\r\n\t\t<td>\r\n\t\t\t<input type=\"text\" \r\n\t\t\t\t name=\"E_startDate\" id=\"E_startDate\" \r\n\t\t\t\t value=\"<?php echo $eEventDate; ?>\" />\r\n\t\t\t\r\n\t\t\t<label id=\"E_closeOnSelect\">\r\n\t\t\t\t<input type=\"checkbox\" checked=\"true\" style=\"visibility: hidden\" />\r\n\t\t\t</label>\r\n\t\t</td>\r\n\t</tr>\r\n\r\n\t<tr>\r\n\t\t<td><b>Day Count: </b></td>\r\n\t\t<td>\r\n\t\t\t<select name='E_days' id='E_days'>\r\n\t\t\t<?php\r\n\t\t\t\tfor($i=1; $i<6; $i++)\r\n\t\t\t\t{\t\r\n\t\t\t\t\tif ($i == $eDays)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\techo '<option value=\"'.($i+1).'\" selected=\"selected\">'.$i.'</option>';\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\techo '<option value=\"'.($i+1).'\">'.$i.'</option>';\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t?>\r\n\t\t\t</select>\r\n\t\t</td>\r\n\t</tr>\r\n\r\n\t<tr>\r\n\t\t<td><b>Event Time: </b></td>\r\n\t\t<td><input type=\"text\" name=\"E_startTime\" id=\"E_startTime\" \r\n\t\t\t\t value=\"<?php echo $eStartTime; ?>\" \r\n\t\t\t\t size=\"50\" maxlength=\"8\" /></td>\r\n\t</tr>\r\n\r\n\t<tr>\r\n\t\t<td><b>Server IP Address: </b></td>\r\n\t\t<td><input type=\"text\" name=\"E_server_IP_address\" id=\"E_server_IP_address\" \r\n\t\t\t\t value=\"<?php echo $eServerIP; ?>\" \r\n\t\t\t\t size=\"50\" maxlength=\"28\" /></td>\r\n\t</tr>\r\n\r\n\t<tr>\r\n\t\t<td><b>Seat Quantity: </b></td>\r\n\t\t<td><input type=\"text\" name=\"E_seatQuantity\" id=\"E_seatQuantity\" \r\n\t\t\t\t value=\"<?php echo $eSeatNum; ?>\" \r\n\t\t\t\t size=\"50\" maxlength=\"2\" /></td>\r\n\t</tr>\r\n\r\n\t<tr>\r\n\t\t<td align=\"right\" colspan=\"3\">\r\n\t\t\t<div align=\"right\" height='10px'>\r\n\t<?php\r\n\t\t\t// BUTTON DECLARATIONS\r\n\t\t\t$on = 'this.src=\"../images/buttons/save_dwn.png\"';\r\n\t\t\t$off = 'this.src=\"../images/buttons/save_up.png\"';\r\n\r\n\t\t\t$cancelDwn = 'this.src=\"../images/buttons/delete_dwn.png\"';\r\n\t\t\t$cancelUp = 'this.src=\"../images/buttons/delete_up.png\"';\r\n\t?>\t \t\r\n\t\t\t<img src=\"../images/buttons/delete_dwn.png\" width=\"30\" height=\"30\"\r\n\t\t\t\ttitle=\"Cancel update\" \r\n\t\t\t\tonclick=\"getEvent('<?php echo $eventID; ?>')\" \r\n\t\t\t\tonmouseover='<?php echo $cancelUp; ?>' \r\n\t\t\t\tonmouseout='<?php echo $cancelDwn; ?>' />\r\n\t\t\t\t\r\n\t\t\t<img src=\"../images/buttons/save_dwn.png\" width=\"30\" height=\"30\"\r\n\t\t\t\ttitle=\"Update this event\" \r\n\t\t\t\tonclick=\"updateEvent()\"\r\n\t\t\t\tonmouseover='<?php echo $off; ?>' \r\n\t\t\t\tonmouseout='<?php echo $on; ?>' />\r\n\t\t\t</div>\r\n\t\t</td>\r\n\t</tr>\r\n\r\n\t<input type=\"hidden\" name=\"eventID\" id=\"eventID\" value=\"<?php echo $eventID; ?>\"/>\r\n</table>\r\n<!-- /form -->\r\n<?php \r\n}",
"public function handles_events()\n\t{\n\t\treturn false;\n\t}",
"public function hasTimeEvents(){\n return $this->_has(8);\n }",
"protected function generateExtraJavascriptDisplayFunctions()\n { ?>\n <!--<script type=\"text/javascript\" src=\"js/jquery-jscroll.js\"></script>\n <script type=\"text/javascript\" src=\"js/jquery-ajax_que.js\"></script>\n <script type=\"text/javascript\" src=\"js/jquery.isonscreen.min.js\"></script>-->\n \n <script>\n var task_json_object = Array();\n \n function changeMD5Object(array_values, delete_flag){\n for(var x in task_json_object){\n if(task_json_object[x].id == array_values['id']){\n if(delete_flag){\n //alert('deleting index: '+x+' task_id: '+task_json_object[x].id);\n delete task_json_object[x];\n }else{\n \n for(var y in array_values){\n switch(y){\n case 'priority':\n task_json_object[x].priority = array_values[y];\n break;\n case 'md5':\n //alert(task_json_object[x].md5);\n task_json_object[x].md5 = array_values[y];\n //alert(array_values[y]);\n break; \n case 'status':\n task_json_object[x].status = array_values[y];\n break;\n }\n }\n }\n }\n }\n }\n \n function validateNumeric(evt) {\n var theEvent = evt || window.event;\n var key = theEvent.keyCode || theEvent.which;\n //let through Backspace, Up, Down, Left, Right, Delete, F5\n if(key == 8 || key == 37 || key == 38 || key == 39 || key == 40 || key == 46 || key == 116){\n return;\n }\n key = String.fromCharCode( key );\n var regex = /[0-9]|\\./;\n if( !regex.test(key) ) {\n theEvent.returnValue = false;\n if(theEvent.preventDefault) theEvent.preventDefault();\n }\n }\n \n //Handles the Final location, and the animation to line the task up when it is dragged and dropped.\n function moveDragObject(element, location_element, init){\n\n //For reseting the task to its old position\n if(location_element == 'old_status'){\n //Location of old placeholder (eg: #drop_NotStarted1)\n location_id = '#drop'+$(element).attr('status').replace(' ','')+'_'+$(element).get(0).id.substr($(element).get(0).id.lastIndexOf('_')+1);\n location_element = $(location_id);\n //alert(location_id);\n }\n\n //Just making sure that it doesnt try and move relatively.\n var move_left = $(location_element).position().left;\n var move_top = $(location_element).position().top + 1 + ($(element).attr('priority') * 69) - 69;\n\n var object_id = $(element).get(0).id;\n \n var speed = 300;\n if(init){\n speed = 0;\n }\n\n $('#'+object_id).animate({left:move_left, top:move_top}, speed, 'swing');\n \n if(init){\n $('#'+object_id).fadeIn();\n }\n }\n \n\n //Reload the page with the new release as a GET Param. This will be handled on load.\n function displayNewRelease(release_id, project_id){\n window.location = 'index.php?Controller=Project&Action=TaskboardDisplay&release_id='+release_id+'&project_id='+project_id;\n }\n \n function populateReleaseBox(project_id){\n window.location = 'index.php?Controller=Project&Action=TaskboardDisplay&project_id='+project_id;\n return;\n \n //Pointless. 2 loads.\n $.ajax({\n url: \"index.php?Controller=Ajax&Action=GetReleasesForProjectHTML&project_id=\"+project_id,\n success: function(msg){\n $('#selectRelease').html(msg);\n \n displayNewRelease($('#selectRelease').val(), project_id);\n }\n });\n }\n\n \n function touchAllTasks(init)\n { \n if(!init){\n init = false;\n }\n $('div[id*=\"_\"]').each(function(){\n //alert($(this).attr('priority'));\n if($(this).attr('priority')){\n var status = $(this).attr('status');\n var current_feature_id = $(this).get(0).id.substr($(this).get(0).id.lastIndexOf('_')+1);\n //alert(current_feature_id);\n status = status.replace(' ','');\n moveDragObject(this, $('#drop'+status+'_'+current_feature_id), init);\n }\n });\n \n redoFeatureScrolling();\n }\n \n function redoFeatureScrolling()\n {\n $('div[id*=\"feature_scroll_\"]').each(function(){\n $(this).attr('minY', 0);\n $(this).attr('maxY', $(this).parent().height() - ($(this).height()+175));\n });\n scrollFeatures();\n }\n\n </script>\n <?php\n }",
"private function adjust_graph_dimensions(){\n\t\t$this->axiswidth = ($this->startingmonth + 1.5) * $this->monthwidth;\n\t\tif($this->max_graph_height < $this->max_month_value){\n\t\t\t$this->yscale = $this->max_graph_height / $this->max_month_value;\n\t\t}\n\t\t$this->axisheight = $this->yscale * ($this->max_month_value + 20);\n\t\tif($this->max_graph_height < $this->axisheight){\n\t\t\t$this->yscale = $this->yscale * ($this->max_graph_height / $this->axisheight);\n\t\t\t$this->axisheight = $this->max_graph_height;\n\t\t}\n\t\t$this->graphheight = $this->axisheight + $this->graphmargintop + $this->graphmarginbottom;\n\t\t$this->graphwidth = $this->axiswidth + $this->graphmarginleft + $this->graphmarginright;\n\t\t\n\t\treturn;\n\t}",
"function isEvent($var){\n\tif ($this->calEvents){\n\t\t$checkTime=$this->mkActiveTime(0,0,1,$this->actmonth,$var,$this->actyear);\n\t\t$selectedTime=$this->mkActiveTime(0,0,1,$this->selectedmonth,$this->selectedday,$this->selectedyear);\n\t\t$todayTime=$this->mkActiveTime(0,0,1,$this->monthtoday,$this->daytoday,$this->yeartoday);\n\t\tforeach($this->calEvents as $eventTime => $eventID){\n\t\t\tif ($eventTime==$checkTime){\n\t\t\t\tif ($eventTime==$selectedTime) $this->eventID=$this->cssPrefixSelecEvent.$eventID;\n\t\t\t\telseif ($eventTime==$todayTime) $this->eventID=$this->cssPrefixTodayEvent.$eventID;\n\t\t\t\telse $this->eventID=$eventID;\n\t\t\t\tif ($this->calEventsUrl[$eventTime]) $this->eventUrl=$this->calEventsUrl[$eventTime];\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\treturn false;\n\t}\n}",
"public static function update_admin_event($eventid, $title, $start, $end, $duration, $content, $visibility_level, $recursion = NULL, $recursivelly = false) {\r\n global $uid, $is_admin, $langNotValidInput, $langNotAllowed;\r\n if (!$is_admin) {\r\n return array('success' => false, 'message' => $langNotAllowed);\r\n }\r\n\r\n if($recursivelly && !is_null($recursion)){\r\n $oldrec = Calendar_Events::get_event_recursion($eventid, 'admin');\r\n $p = \"P\".$recursion['repeat'].$recursion['unit'];\r\n $e = DateTime::createFromFormat('d-m-Y', $recursion['end'])->format('Y-m-d');\r\n if($oldrec->recursion_period != $p || $oldrec->recursion_end != $e){\r\n Calendar_Events::delete_recursive_event($eventid, 'admin');\r\n return Calendar_Events::add_event($title, $content, $start, $end, $duration, $recursion, null, $visibility_level);\r\n }\r\n }\r\n\r\n if(!is_null($recursion) && !Calendar_Events::is_recursive($eventid, 'admin'))\r\n {\r\n Calendar_Events::delete_event($eventid, 'admin');\r\n return Calendar_Events::add_event($title, $content, $start, $end, $duration, $recursion, null, $visibility_level);\r\n }\r\n\r\n $d1 = DateTime::createFromFormat('d-m-Y H:i', $start);\r\n $d2 = DateTime::createFromFormat('d-m-Y H:i:s', $start);\r\n $d3 = DateTime::createFromFormat('d-m-Y H:i', $end);\r\n $d4 = DateTime::createFromFormat('d-m-Y H:i:s', $end);\r\n $title = trim($title);\r\n if (empty($title) || !(($d1 && $d1->format('d-m-Y H:i') == $start) || ($d2 && $d2->format('d-m-Y H:i:s') == $start))) {\r\n return array('success' => false, 'message' => $langNotValidInput);\r\n }\r\n\r\n $where_clause = ($recursivelly)? \"WHERE source_event_id = ?d\":\"WHERE id = ?d\";\r\n $startdatetimeformatted = ($recursivelly)? $d1->format('H:i'):$d1->format('Y-m-d H:i');\r\n $start_date_update_clause = ($recursivelly)? \"start = CONCAT(date_format(start, '%Y-%m-%d '),?t), \":\"start = ?t, \";\r\n $enddatetimeformatted = ($recursivelly)? $d3->format('H:i'):$d3->format('Y-m-d H:i');\r\n $end_date_update_clause = ($recursivelly)? \"end = CONCAT(date_format(end, '%Y-%m-%d '),?t), \":\"end = ?t, \";\r\n Database::get()->query(\"UPDATE admin_calendar SET \"\r\n . \"title = ?s, \"\r\n . $start_date_update_clause\r\n . $end_date_update_clause\r\n . \"duration = ?t, \"\r\n . \"content = ?s, \"\r\n . \"visibility_level = ?d \"\r\n . $where_clause,\r\n $title, $startdatetimeformatted, $enddatetimeformatted, $duration, purify($content), $visibility_level, $eventid);\r\n\r\n Log::record(0, MODULE_ID_ADMINCALENDAR, LOG_MODIFY, array('user_id' => $uid, 'id' => $eventid,\r\n 'title' => $title,\r\n 'content' => ellipsize_html(canonicalize_whitespace(strip_tags($content)), 50, '+')));\r\n return array('success' => true, 'message' => '', 'event' => $eventid);\r\n }",
"function updateEventInDatabase(&$formvars){\r\n\t\tif(!$this->DBLogin()){\r\n\t\t\t$this->HandleError(\"Database login failed!\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tif(!$this->EnsureEventTable()){\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tif(!$this->updateEventTable($formvars)){\r\n\t\t\t$this->HandleError(\"Inserting to Database failed!\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\treturn true;\r\n\t}",
"public function __registerEvents() {\n $code = \"wk_pa_add_column_menu\";\n $trigger = \"admin/view/common/column_left/before\";\n $action = \"wk_pricealert/event/addCommonMenu\";\n $this->helper_event->addEvent($code, $trigger, $action);\n\n //add event to add the menu in the admin end code ends here\n $code = \"wk_pa_addJs_product\";\n $trigger = \"admin/view/catalog/product_form/before\";\n $action = \"wk_pricealert/event/addProductPageJs\";\n $this->helper_event->addEvent($code, $trigger, $action);\n\n //add event to add the menu in the admin end code ends here\n $code = \"wk_pa_product_model_add\";\n $trigger = \"admin/model/catalog/product/addProduct/after\";\n $action = \"wk_pricealert/event/addAlertProduct\";\n $this->helper_event->addEvent($code, $trigger, $action);\n\n $code = \"wk_pa_product_model_update\";\n $trigger = \"admin/model/catalog/product/editProduct/before\";\n $action = \"wk_pricealert/event/updateAlertProduct\";\n $this->helper_event->addEvent($code, $trigger, $action);\n\n //add event to add the menu in the admin end code ends here\n $code = \"wk_pricealert_addJs_edit\";\n $trigger = \"admin/controller/catalog/product/add/before\";\n $action = \"wk_pricealert/event/addProductPageJs\";\n $this->helper_event->addEvent($code, $trigger, $action);\n //add event to add the menu in the admin end code ends here\n $code = \"wk_pricealert_addJs_add\";\n $trigger = \"admin/controller/catalog/product/edit/before\";\n $action = \"wk_pricealert/event/addProductPageJs\";\n $this->helper_event->addEvent($code, $trigger, $action);\n\n $code = \"wk_pricealert_header\";\n $trigger = \"catalog/view/common/header/before\";\n $action = \"extension/module/wk_pricealert/addJsFile\";\n $this->model_setting_event->addEvent($code, $trigger, $action);\n\n $code = \"wk_pricealert_account_view\";\n $trigger = \"catalog/controller/account/account/before\";\n $action = \"extension/module/wk_pricealert/addAccountPageJsFile\";\n $this->model_setting_event->addEvent($code, $trigger, $action);\n\n $code = \"wk_pa_product_model_delete\";\n $trigger = \"admin/model/catalog/product/deleteProduct/before\";\n $action = \"wk_pricealert/event/deleteAlertProduct\";\n $this->helper_event->addEvent($code, $trigger, $action);\n }",
"public function attachEvents();",
"public function attachEvents();",
"protected function update_size( $width = false, $height = false ) {\n\t\tif ( ! $width )\n\t\t\t$width = imagesx( $this->image );\n\n\t\tif ( ! $height )\n\t\t\t$height = imagesy( $this->image );\n\n\t\treturn parent::update_size( $width, $height );\n\t}",
"public function hasCalendarEvents(): bool\n {\n return ($this->calendarEvents->count() !== 0) ? true : false;\n }",
"public function editCalendarEvent_recurring_modifiedCalendarEventData_recurring_nextCalendarEventIsDeleted()\n {\n $inputCreate = [\n 'title' => str_random(16),\n 'start_datetime' => Carbon::parse('2017-08-01 11:00:00'),\n 'end_datetime' => Carbon::parse('2017-08-01 12:00:00'),\n 'description' => str_random(32),\n 'is_recurring' => true,\n 'frequence_number_of_recurring' => 1,\n 'frequence_type_of_recurring' => RecurringFrequenceType::WEEK,\n 'is_public' => true,\n 'end_of_recurring' => Carbon::parse('2017-08-22'),\n ];\n $inputUpdate = [\n 'start_datetime' => Carbon::parse('2017-08-03'),\n ];\n\n $calendarEvent = $this->calendarEvent->createCalendarEvent($inputCreate);\n $calendarEventNext = $calendarEvent->template->generateNextCalendarEvent(Carbon::parse('2017-08-06'));\n $calendarEventUpdated = $calendarEvent->editCalendarEvent($inputUpdate);\n\n $this->assertNotNull($calendarEvent->deleted_at);\n $this->assertNotNull($calendarEventNext->fresh()->deleted_at);\n $this->assertEquals($calendarEvent->start_datetime->format('Y-m-d'), $calendarEventNext->template->end_of_recurring->format('Y-m-d'));\n\n $this->assertInstanceOf(CalendarEvent::class, $calendarEventUpdated);\n $this->assertEquals($inputUpdate['start_datetime']->format('Y-m-d'), $calendarEventUpdated->start_datetime->format('Y-m-d'));\n $this->assertEquals($inputCreate['end_of_recurring']->format('Y-m-d'), $calendarEventUpdated->template->end_of_recurring->format('Y-m-d'));\n\n $this->assertInstanceOf(TemplateCalendarEvent::class, $calendarEventUpdated->template);\n $this->assertEquals($calendarEvent->id, $calendarEventUpdated->template->parent_id);\n\n $this->assertDatabaseHas('template_calendar_events', $inputUpdate);\n $this->assertDatabaseHas('calendar_events', $inputUpdate);\n }",
"abstract protected function draggable_item($mform);",
"public function add_event($data)\n {\n $datafields = array\n ('start' => array('req' => true)\n ,'end' => array('req' => true)\n ,'gid' => array('req' => true)\n ,'title' => array('req' => false, 'def' => '')\n ,'description' => array('req' => false, 'def' => '')\n ,'location' => array('req' => false, 'def' => '')\n ,'type' => array('req' => false, 'def' => 0)\n ,'status' => array('req' => false, 'def' => 0)\n ,'opaque' => array('req' => false, 'def' => 1)\n ,'uuid' => array('req' => false, 'def' => basics::uuid())\n );\n foreach ($datafields as $k => $v) {\n if (!isset($data[$k])) {\n if ($v['req'] === true) {\n return false;\n }\n $data[$k] = $v['def'];\n } else {\n $data[$k] = $this->esc($data[$k]);\n }\n }\n if (empty($data['gid'])) {\n $data['gid'] = 0;\n }\n\n // Am I the owner?\n if (!empty($data['gid']) && $this->getGroupOwner($data['gid']) != $this->uid) {\n // If not, I should have write permissions through a share\n if (!empty($GLOBALS['DB']->features['groups'])) {\n $perms = $GLOBALS['DB']->getUserSharedFolderPermissions($this->uid, 'calendar', $data['gid']);\n }\n if (empty($perms) || empty($perms['write'])) {\n // No, I haven't\n return false;\n }\n }\n\n $query = 'INSERT '.$this->Tbl['cal_event']\n .' (`uid`,`gid`,`starts`,`ends`,`title`,`description`,`location`,`type`,`status`,`opaque`,`uuid`,`lastmod`) VALUES ('\n .$this->uid.', \"'.$data['gid'].'\" ,\"'.$data['start'].'\",\"'.$data['end'].'\",\"'.$data['title'].'\",\"'.$data['description'].'\"'\n .',\"'.$data['location'].'\",'.doubleval($data['type']).','.doubleval($data['status']).',\"'.doubleval($data['opaque']).'\", \"'.$data['uuid'].'\",NOW())';\n if (!$this->query($query)) {\n return false;\n }\n $newId = $this->insertid();\n // Make sure, the end of an event is NOT before its beginning\n $this->query('UPDATE '.$this->Tbl['cal_event'].' SET `ends`=`starts` WHERE `ends`<`starts` AND id='.$newId);\n\n if (isset($data['attendees']) && !empty($data['attendees'])) {\n $query = 'INSERT INTO '.$this->Tbl['cal_attendee'].' (`eid`,`ref`,`name`,`email`,`role`,`type`,`status`,`mailhash`) VALUES ';\n $k = 0;\n foreach ($data['attendees'] as $v) {\n if ($k) {\n $query .= ',';\n }\n $query .= '('.doubleval($newId).',\"evt\",\"'.$this->esc($v['name']).'\",\"'.$this->esc($v['email']).'\"'\n .',\"'.$this->esc($v['role']).'\",\"'.$this->esc($v['type']).'\",'.doubleval($v['status'])\n .',\"'.$this->esc(basics::uuid()).'\")';\n $k++;\n }\n $this->query($query);\n }\n\n if (isset($data['reminders']) && !empty($data['reminders'])) {\n $query = 'INSERT INTO '.$this->Tbl['cal_reminder'].' (`eid`,`ref`,`uid`,`mode`,`time`,`text`,`smsto`,`mailto`) VALUES ';\n $k = 0;\n foreach ($data['reminders'] as $v) {\n if ($k) {\n $query .= ',';\n }\n if ($v['mode'] == '-') {\n continue;\n }\n $query .= '('.doubleval($newId).',\"evt\",'.$this->uid.',\"'.$this->esc($v['mode']).'\",'.doubleval($v['time'])\n .',\"'.$this->esc($v['text']).'\"'\n .',\"'.(!empty($v['smsto']) ? $this->esc($v['smsto']) : '').'\"'\n .',\"'.(!empty($v['mailto']) ? $this->esc($v['mailto']) : '').'\")';\n $k++;\n }\n if ($k > 0) {\n $this->query($query);\n }\n }\n if (isset($data['repetitions']) && !empty($data['repetitions'])) {\n $query = 'INSERT INTO '.$this->Tbl['cal_repetition'].' (`eid`,`ref`,`type`,`repeat`,`extra`,`until`) VALUES ';\n $k = 0;\n foreach ($data['repetitions'] as $v) {\n if ($k) {\n $query .= ',';\n }\n $query .= '('.doubleval($newId).',\"evt\",\"'.$this->esc($v['type']).'\",'.doubleval($v['repeat'])\n .','.(isset($v['extra']) && !is_null($v['extra']) ? '\"'.$this->esc($v['extra']).'\"' : '\"\"')\n .','.(isset($v['until']) && !is_null($v['until']) ? '\"'.$this->esc($v['until']).'\"' : 'NULL').')';\n $k++;\n }\n if ($k > 0) {\n $this->query($query);\n }\n } else {\n $query = 'INSERT INTO '.$this->Tbl['cal_repetition'].' (`eid`,`ref`,`type`,`repeat`,`extra`,`until`) VALUES '\n .'('.doubleval($newId).',\"evt\",\"-\",0,\"\",NULL)';\n $this->query($query);\n }\n return $newId;\n }",
"public function eventsSchema($rows,$userid)\n\t{\n\t\t$lang = JFactory::getLanguage();\n\t\t$lang->load('com_easysocial', JPATH_ADMINISTRATOR, '', true);\n\t\t$result = array();\t\t\n\t\tforeach($rows as $ky=>$row)\n\t\t{\n\t\t\tif(isset($row->id))\n\t\t\t{\t\n\t\t\t\t$item = new EventsSimpleSchema();\n\t\t\t\t\n\t\t\t\t/*Get Cover POsition */\n\t\t\t\t$grpobj = FD::event( $row->id );\n\t\t\t\t$x = $grpobj->cover->x;\n\t\t\t\t$y = $grpobj->cover->y;\n\t\t\t\t$item->cover_position = $x.'% '.$y.'%';\n\t\t\t\t\n\t\t\t\t$item->id=$row->id;\n\t\t\t\t$item->title=$row->title;\n\t\t\t\t$item->description=$row->description;\n\t\t\t\t//getting all event images\n\t\t\t\tforeach($row->avatars As $ky=>$avt)\n\t\t\t\t{\n\t\t\t\t\t$avt_key = 'avatar_'.$ky;\n\t\t\t\t\t$item->$avt_key = JURI::root().'media/com_easysocial/avatars/event/'.$row->id.'/'.$avt;\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t$fst = JFile::exists('media/com_easysocial/avatars/event/'.$row->id.'/'.$avt);\n\t\t\t\t\t//set default image\n\t\t\t\t\tif(!$fst)\n\t\t\t\t\t{\n\t\t\t\t\t\t$item->$avt_key = JURI::root().'media/com_easysocial/defaults/avatars/event/'.$ky.'.png';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//end\n\t\t\t\n\t\t\t\t$item->params=json_decode($row->params);\n\t\t\t\t$item->details=$row->meta;\n\t\t\t\t//ios format date\n\t\t\t\tif(!empty($item->details->start))\n\t\t\t\t{\t\t\t\t\t\n\t\t\t\t\t$item->details->ios_start = $this->listDate($item->details->start);\n\t\t\t\t\t$item->start_date = date('D M j Y h:i a',strtotime($row->meta->start));\t\t\t\t\t\n\t\t\t\t\t$item->start_date_unix = strtotime($row->meta->start);\n\t\t\t\t}\t\t\t\t\t\t\t\t\n\t\t\t\t\n\n\t\t\t\tif( $item->details->end == \"0000-00-00 00:00:00\")\n\t\t\t\t{\n\t\t\t\t\t$item->details->ios_end = null;\n\t\t\t\t\t$item->end_date = null;\n\t\t\t\t\t$item->end_date_unix = null;\n\t\t\t\t}\n\t\t\t\telse\t\t\t\t\n\t\t\t\t{\n\t\t\t\t\t$item->details->ios_end = $this->listDate($item->details->end);\n\t\t\t\t\t$item->end_date = date('D M j Y h:i a ',strtotime($row->meta->end));\n\t\t\t\t\t$item->end_date_unix = strtotime($row->meta->end);\n\t\t\t\t}\n\n\t\t\t\t$item->start_date_unix = strtotime($row->meta->start);\n\t\t\t\t$item->end_date_unix = strtotime($row->meta->end);\n\t\t\t\t\n\t\t\t\t$event = FD::model( 'events' );\n\t\t\t\t$item->guests= $event->getTotalAttendees($row->id);\n\t\t\t\t\n\t\t\t\t$item->featured=$row->featured;\n\t\t\t\t$item->created=$row->created;\n\t\t\t\t$item->categoryId=$row->category_id;\n\t\t\t\t$item->type=$row->type;\n\t\t\t\n\t\t\t\t//get category name\n\t\t\t\t$category \t= FD::table('EventCategory');\n\t\t\t\t$category->load($row->category_id);\t\t\t\t\n\t\t\t\t$item->category_name = $category->get('title');\n\t\t\t\t\n\t\t\t\t//event guest status\n\t\t\t\t$eventobj=FD::event($row->id);\t\n\t\t\t\t$item->isAttending=$eventobj->isAttending($userid);\n\t\t\t\t$item->isNotAttending=$eventobj->isNotAttending($userid);\n\t\t\t\t$item->isOwner=$eventobj->isOwner($userid);\n\t\t\t\t$item->isPendingMember = $eventobj->isPendingMember($userid);\n\t\t\t\t$item->isMember=$eventobj->isMember($userid);\t\n\t\t\t\t$item->isRecurring=$eventobj->isRecurringEvent(); \n\t\t\t\t$item->hasRecurring=$eventobj->hasRecurringEvents();\t\t\t\t\n\t\t\t\t\n\t\t\t\t$event_owner = reset($row->admins);\n\t\t\t\tif($event_owner)\n\t\t\t\t{\n\t\t\t\t$item->owner = $this->createUserObj($event_owner)->username;\n\t\t\t\t$item->owner_id = $event_owner;\n\t\t\t\t} \t\t\n\t\t\t\t//$item->owner=$user->username;\n\t\t\t\t\n\t\t\t\t$item->isMaybe=in_array($userid,$row->maybe);\n\t\t\t\t$item->total_guest=$eventobj->getTotalGuests();\n\t\t\t\t// this node is for past events\n\t\t\t\t$item->isoverevent=$eventobj->isOver();\n\t\t\t\tif($item->end_date == null){\n\t\t\t\t\t$item->isoverevent = false;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$item->location=$row->address;\n\t\t\t\t$item->longitude=$row->longitude;\n\t\t\t\t$item->latitude=$row->latitude;\n\t\t\t\t$NameLocationLabel = $item->location;\n\t\t\t\t$item->event_map_url_andr = \"geo:\".$item->latitude.\",\".$item->longitude.\"?q=\".$NameLocationLabel;\n\t\t\t\t$item->event_map_url_ios = \"http://maps.apple.com/?q=\".$NameLocationLabel.\"&sll=\".$item->latitude.\",\".$item->longitude;\t\t\t\t\n\t\t\t\t$item->share_url = JURI::root().$eventobj->getPermalink(true, false, 'item', false);\n\t\t\t\t//getting cover image of event\n\t\t\t\t$eve = FD::table( 'Cover' );\n\t\t\t\t$eve->type='event';\n\t\t\t\t$eve->photo_id=$row->cover->photo_id;\n\t\t\t\t$item->cover_image=$eve->getSource();\n\t\t\t\t//end\n\t\t\t\t$item->isInvited = false;\n\t\t\t\t$event = FD::event($row->id);\n\t\t\t\t$guest = $event->getGuest($userid);\n\t\t\t\tif ($guest->invited_by) {\t\n\t\t\t\t\t$item->isInvited = true;\n\t\t\t\t}\n\t\t\t\t$result[] = $item;\n\t\t\t}\n\t\t}\n\t\treturn($result);\t\n\t}",
"function updateEvent($eventId, $start, $end, $objectid, $event_details, $event_desc, $event_image,\n $firstPlace, $secondPlace, $thirdPlace, $firstImage, $secondImage, $thirdImage,\n $eventComplete, $archive)\n {\n //1. Define the query\n $sql = \"UPDATE events SET eventid=:eventid, objectid=:objectid, starttime=:starttime, endtime=:endtime, \n event_details=:event_details, event_desc=:event_desc, first_place=:firstPlace, \n second_place=:secondPlace, third_place=:thirdPlace, event_image=:event_image, \n first_image=:firstImage, second_image=:secondImage, third_image=:thirdImage, \n event_complete=:eventComplete, archive=:archive WHERE eventid=:eventid\";\n\n //2. Prepare the statement\n $statement = $this->_dbh->prepare($sql);\n\n //3. Bind the parameters\n $statement->bindParam(':eventid', $eventId, PDO::PARAM_STR);\n $statement->bindParam(':starttime', $start, PDO::PARAM_STR);\n $statement->bindParam(':endtime', $end, PDO::PARAM_STR);\n $statement->bindParam(':objectid', $objectid, PDO::PARAM_STR);\n $statement->bindParam(':event_details', $event_details, PDO::PARAM_STR);\n $statement->bindParam(':event_desc', $event_desc, PDO::PARAM_STR);\n $statement->bindParam(':event_image', $event_image, PDO::PARAM_STR);\n $statement->bindParam(':firstPlace', $firstPlace, PDO::PARAM_STR);\n $statement->bindParam(':secondPlace', $secondPlace, PDO::PARAM_STR);\n $statement->bindParam(':thirdPlace', $thirdPlace, PDO::PARAM_STR);\n $statement->bindParam(':firstImage', $firstImage, PDO::PARAM_STR);\n $statement->bindParam(':secondImage', $secondImage, PDO::PARAM_STR);\n $statement->bindParam(':thirdImage', $thirdImage, PDO::PARAM_STR);\n $statement->bindParam(':eventComplete', $eventComplete, PDO::PARAM_STR);\n $statement->bindParam(':archive', $archive, PDO::PARAM_STR);\n\n $lastId = $this->_dbh->lastInsertId();\n\n //4. Execute the query\n $result = $statement->execute();\n\n //5. Process the results\n return $result;\n }",
"abstract protected function needRefresh();",
"public function setAutoResize($a_value)\n\t{\n\t\t$this->auto_resize = (bool)$a_value;\n\t}",
"function fudge_event_info_control() {\r\r\n if (isset($_POST['submitted'])) {\r\r\n update_option('fudge_event_info_widget_title', $_POST['eventdate']);\r\r\n update_option('fudge_event_info_widget_eventcity', $_POST['eventcity']);\r\r\n update_option('fudge_event_info_widget_eventtime', $_POST['eventtime']);\r\r\n update_option('fudge_event_info_widget_eventlocation', $_POST['eventlocation']);\r\r\n update_option('fudge_event_info_widget_menu', $_POST['eventmenu']);\r\r\n }\r\r\n //load options\r\r\n $eventdate = get_option('fudge_event_info_widget_title');\r\r\n $eventcity = get_option('fudge_event_info_widget_eventcity');\r\r\n $eventtime = get_option('fudge_event_info_widget_eventtime');\r\r\n $eventlocation = get_option('fudge_event_info_widget_eventlocation');\r\r\n $eventmenu = get_option('fudge_event_info_widget_menu');\r\r\n ?>\r\r\n <?php _e('Event Date:', 'fudge'); ?><br />\r\r\n <input type=\"text\" class=\"widefat\" name=\"eventdate\" value=\"<?php echo stripslashes($eventdate); ?>\" />\r\r\n <br /><br />\r\r\n <?php _e('Event Starting Time:', 'fudge'); ?><br />\r\r\n <input type=\"text\" class=\"widefat\" name=\"eventtime\" value=\"<?php echo stripslashes($eventtime); ?>\"/>\r\r\n <br /><br />\r\r\n <?php _e('Event City & Country:', 'fudge'); ?><br />\r\r\n <input type=\"text\" class=\"widefat\" name=\"eventcity\" value=\"<?php echo stripslashes($eventcity); ?>\" />\r\r\n <br /><br />\r\r\n <?php _e('Event Location:', 'fudge'); ?><br />\r\r\n <input type=\"text\" class=\"widefat\" name=\"eventlocation\" value=\"<?php echo stripslashes($eventlocation); ?>\"/>\r\r\n <br /><br />\r\r\n <?php _e('Add to main navigation?', 'fudge'); ?><br />\r\r\n <input type=\"text\" class=\"widefat\" name=\"eventmenu\" value=\"<?php echo stripslashes($eventmenu); ?>\"/><br/>\r\r\n <small><?php _e('(Enter desired menu link text)', 'fudge'); ?></small>\r\r\n <br /><br />\r\r\n <input type=\"hidden\" name=\"submitted\" value=\"1\" />\r\r\n <?php\r\r\n}",
"abstract public function collect_events($object, $from, $to, $image_width, $image_height);",
"public static function event_method()\n {\n return true;\n }",
"function insert_events( $events ){\n\t// Informationen zu den Events holen\n\t$results = eventoni_fetch('',false,$events);\n\n\t// Falls keine Informationen zu Events gefunden, aus Methode rausspringen\n\tif( $results['total'] <= 0 )\n\t{\n\t\treturn;\n\t}\n\n\t// HTML Code erstellen\n\t$result = '';\n\t$result.= '<div class=\"events-container\">';\n\t$result.= '<img src=\"'.get_bloginfo('wpurl').'/wp-content/plugins/eventoni-events/img/logo.png\" />';\n\n\t// Jedes Event durchlaufen\n\tforeach($results['xml'] as $event)\n\t{\n\t\t// Berechnung der Zeitangabe und Tageszeit als Wort\n\t\t$datetime = strtotime($event->start_date.' '.$event->start_time);\n\t\t$hours = getdate($datetime);\n\t\t$hour = $hours['hours'];\n\t\t$tageszeit = '';\n\t\tif( $hour < 6 ){\n\t\t\t$tageszeit = 'nachts';\n\t\t} else if( $hour < 12 ){\n\t\t\t$tageszeit = 'morgens';\n\t\t} else if( $hour < 14 ){\n\t\t\t$tageszeit = 'mittags';\n\t\t} else if( $hour < 18 ){\n\t\t\t$tageszeit = 'nachmittags';\n\t\t} else if( $hour < 22 ){\n\t\t\t$tageszeit = 'abends';\n\t\t} else {\n\t\t\t$tageszeit = 'nachts';\n\t\t}\n\t\t$result.= ' <div class=\"event-item\">';\n\t\t$result.= '<a class=\"event-item-link\" href=\"'.$event->permalink.'\">';\n\n\t\t// Falls kein Vorschaubild vorhanden, nehme Standardbild\n\t\tif(isset($event->media_list->media->thumbnail_url)) {\n\t\t\t$result.= '<img width=\"60px\" height\"60px\" align=\"left\" src=\"'.$event->media_list->media->thumbnail_url.'\"/>';\n\t\t} else {\n\t\t\t$result.= '<img width=\"60px\" height\"60px\" align=\"left\" src=\"http://static.eventoni.com/images/image-blank.png\"/>';\n\t\t}\n\t\t$result.= '</a>';\n\t\t$result.= '\t <div class=\"event-item-content\">';\n\t\t$result.= '\t\t<div class=\"event-item-content-date\">'.date( \"d.m.Y\", $datetime ).', '.date( \"H:i \\U\\h\\\\r\", $datetime ).'</div>';\n\t\t$result.= '\t\t<div class=\"event-item-content-city\"><img src=\"'.get_bloginfo('wpurl').'/wp-content/plugins/eventoni-events/img/my_location.png\"/> '.$event->location->city.'</div>';\n\t\t$result.= '\t </div>';\n\t\t$result.= '\t <div class=\"event-item-content-name\"><b><a class=\"event-item-link\" href=\"'.$event->permalink.'\">'.$event->title.'</a></b></div>';\n\t\t$result.= '<div style=\"float:right\"><a class=\"facebook_link\" href=\"http://www.facebook.com/sharer.php?u='.$event->permalink.'&t=Dieses Event musst Du gesehen haben: \" target=\"_blank\"><img src=\"'.get_bloginfo('wpurl').'/wp-content/plugins/eventoni-events/img/facebook.png\" /></a></div>';\n\t\t$result.= '<div style=\"float:right\"><a class=\"twitter_link\" href=\"http://twitter.com/home?status=Dieses Event musst Du gesehen haben: '.$event->permalink.'\" target=\"_blank\"><img src=\"'.get_bloginfo('wpurl').'/wp-content/plugins/eventoni-events/img/twitter.png\" /></a></div>';\n\t\t$result.= ' </div>';\n\n\t}\n\t$result.= '</div>';\n\n\t// HTML code zurückgeben\n\treturn $result;\n}",
"function import_the_events_calendar() {\n\t\tglobal $wgobd_view_helper,\n\t\t\t\t\t $wgobd_events_helper;\n\n\t\t$args = array(\n\t\t\t'post_type' \t=> 'post',\n\t\t\t'numberposts'\t=> -1,\n\t\t\t'meta_key'\t\t=> '_isEvent',\n\t\t\t'meta_value'\t=> 'yes'\n\t\t);\n\t\t$posts = get_posts( $args );\n\n\t\t$imported_events = 0;\n\t\tforeach( $posts as $post )\n\t\t{\n\t\t\t$event = new wgobd_Event( null );\n\t\t\t$postmeta = get_post_custom( $post->ID );\n\n\t\t\t// Need this to offset dates coming from The Events Calendar\n\t\t\t$gm_diff = mktime( 0 ) - gmmktime( 0 );\n\n\t\t\t$event->allday \t\t\t\t= $postmeta['_EventAllDay'][0] == 'yes' || $postmeta['_EventAllDay'][0] == 1;\n\t\t\t$event->start \t\t\t\t= strtotime( $postmeta['_EventStartDate'][0] ) - $gm_diff;\n\t\t\t$event->end \t\t\t\t\t= strtotime( $postmeta['_EventEndDate'][0] ) - $gm_diff;\n\t\t\t// If all-day event, align start/end to start/end of day\n\t\t\tif( $event->allday ) {\n\t\t\t\t$event->start = $wgobd_events_helper->gmgetdate( $event->start );\n\t\t\t\t$event->start = gmmktime( 0, 0, 0, $event->start['mon'], $event->start['mday'], $event->start['year'] );\n\t\t\t\t$event->end = $wgobd_events_helper->gmgetdate( $event->end );\n\t\t\t\t$event->end = gmmktime( 0, 0, 0, $event->end['mon'], $event->end['mday'], $event->end['year'] );\n\t\t\t}\n\t\t\t// Finally, convert to GMT storage format\n\t\t\t$event->start = $wgobd_events_helper->local_to_gmt( $event->start );\n\t\t\t$event->end = $wgobd_events_helper->local_to_gmt( $event->end );\n\t\t\t// Bug in The Events Calendar where some all-day events start and end at the same time\n\t\t\tif( $event->allday && $event->end - $event->start < ( 24 * 60 * 60 ) )\n\t\t\t\t$event->end = $event->start + 24 * 60 * 60;\n\t\t\t$event->venue \t\t\t\t= $postmeta['_EventVenue'][0];\n\t\t\t$event->country \t\t\t= $postmeta['_EventCountry'][0];\n\t\t\t$event->city \t\t\t\t\t= $postmeta['_EventCity'][0];\n\t\t\t$event->province \t\t\t= $postmeta['_EventState'][0];\n\t\t\t$event->postal_code \t= $postmeta['_EventZip'][0];\n\t\t\t$event->address = array();\n\t\t\tif( $postmeta['$_EventAddress'] ) $event->address[] = $postmeta['$_EventAddress'];\n\t\t\tif( $event->city ) $event->address[] = $event->city;\n\t\t\tif( $event->province ) $event->address[] = $event->province;\n\t\t\tif( $event->postal_code ) $event->address[] = $event->postal_code;\n\t\t\tif( $event->country ) $event->address[] = $event->country;\n\t\t\t$event->address = join( ', ', $event->address );\n\t\t\t$event->show_map \t\t\t= $postmeta['_EventShowMapLink'][0] == 'true' || $postmeta['_EventShowMap'][0] == 'true';\n\t\t\t$event->cost \t\t\t\t\t= $postmeta['_EventCost'][0];\n\t\t\t$event->contact_phone = $postmeta['_EventPhone'][0];\n\t\t\t$event->post \t\t\t\t\t= get_object_vars( $post );\n\t\t\t$event->post[\"post_type\"] = wgobd_POST_TYPE;\n\t\t\tunset( $event->post[\"ID\"] );\n\n\t\t\t// Transfer post categories => event categories, post tags => event tags\n\t\t\t$terms = wp_get_post_terms( $post->ID, array( 'category', 'post_tag' ) );\n\t\t\t$event->categories = array();\n\t\t\t$event->tags = array();\n\t\t\tforeach( $terms as $term )\n\t\t\t{\n\t\t\t\tswitch( $term->taxonomy )\n\t\t\t\t{\n\t\t\t\t\tcase 'category':\n\t\t\t\t\t\t// Ignore special \"Events\" category by The Events Calendar\n\t\t\t\t\t\tif( $term->name == 'Events' )\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t// Need to find out the category ID, if it exists.\n\t\t\t\t\t\t$event_term = get_term_by( 'name', $term->name, 'events_categories' );\n\t\t\t\t\t\t// If no category exists, create it.\n\t\t\t\t\t\tif( $event_term === false )\n\t\t\t\t\t\t\t$event_term = (object) wp_insert_term(\n\t\t\t\t\t\t\t\t$term->name,\n\t\t\t\t\t\t\t\t'events_categories',\n\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t'description' => $term->description,\n\t\t\t\t\t\t\t\t\t'slug' => $term->slug\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t$event->categories[] = $event_term->term_id;\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'post_tag':\n\t\t\t\t\t\t// For some reason tag-like taxonomies are treated differently; term\n\t\t\t\t\t\t// IDs cannot be used; instead the actual term name must be appended\n\t\t\t\t\t\t$event->tags[] = $term->name;\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$post_id = $event->save();\n\t\t\t$wgobd_events_helper->cache_event( $event, $post_id );\n\n\t\t\t$imported_events++;\n\t\t}\n\n\t\t$wgobd_view_helper->display( \"import.php\", array( 'imported_events' => $imported_events ) );\n\t}",
"public function config() {\n \n\t\t// Date Utilities\n\t\trequire_once( get_stylesheet_directory(). '/util-functions/date-util-functions.php' );\t\t\n\n\t\t/*\n\t\tglobal $wpdb;\t\t\t\t\n\t\t$results = $wpdb->get_results( \"SELECT * FROM $wpdb->sitemeta \", OBJECT );\t\n\t\techo \"<pre>\".print_r($results,1).\"</pre>\"; \n\t\t */\n\t\t\n\n\t\t//get saved data\t\n\t\tif ( !$widget_options = get_option( self::wid ) )\n\t\t{\n\t\t $widget_options = array();\n\t\t}\n\t\t//echo \"<pre>\".print_r($widget_options,1).\"</pre>\";\n\n\n\t\t//process update\t\n\t\tif ( $_SERVER['REQUEST_METHOD'] == 'POST' && isset($_POST['red_flag_parking']) ) \n\t\t{\n\t\t\t\n\t\t\t// define validation variables and set them empty values.\n\t\t\t$startingMonthErr = $startingDayErr = $startingYearErr = \"\";\n\t\t\t$startingMeridiemErr = $startingHourErr = $startingMinuteErr = \"\";\n\t\t\t\n\t\t\t$endingMonthErr = $endingDayErr = $endingYearErr = \"\";\n\t\t\t$endingMeridiemErr = $endingHourErr = $endingMinuteErr = \"\";\n\t\t\t\t\n\t\t\t// Error array.\t\t\n\t\t\t$Err = array();\t\n\t\t\t\n\t\t\t// Date Utilities\n\t\t\trequire_once( get_stylesheet_directory(). '/util-functions/date-util-functions.php' );\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t//get saved data\t\n\t\t\tif ( !$widget_options = get_site_option( self::wid ) )\n\t\t\t{\n\t\t\t \n\t\t\t $widget_options = array();\n\t\t\t \n\t\t\t}\n\t\t\t\n\t\t\t// create the starting time for Red Flag.\n\t\t\t$start_datetime = createDateTime(\n\t\t\t\t\t\t\t$_POST['red_flag_parking']['starting_month'],\n\t\t\t\t\t\t\t$_POST['red_flag_parking']['starting_day'],\n\t\t\t\t\t\t\t$_POST['red_flag_parking']['starting_year'],\n\t\t\t\t\t\t\t$_POST['red_flag_parking']['starting_hour'],\n\t\t\t\t\t\t\t$_POST['red_flag_parking']['starting_minute'],\n\t\t\t\t\t\t\t$_POST['red_flag_parking']['starting_meridiem']\n\t\t\t\t\t\t);\n\t\t\t$widget_options['start_datetime'] = $start_datetime;\n\t\t\t\n\t\t\t// create the ending time for Red Flag.\n\t\t\t$end_datetime = createDateTime(\n\t\t\t\t\t\t\t$_POST['red_flag_parking']['ending_month'],\n\t\t\t\t\t\t\t$_POST['red_flag_parking']['ending_day'],\n\t\t\t\t\t\t\t$_POST['red_flag_parking']['ending_year'],\n\t\t\t\t\t\t\t$_POST['red_flag_parking']['ending_hour'],\n\t\t\t\t\t\t\t$_POST['red_flag_parking']['ending_minute'],\n\t\t\t\t\t\t\t$_POST['red_flag_parking']['ending_meridiem']\n\t\t\t\t\t\t);\n\t\t\t$widget_options['end_datetime'] = $end_datetime;\n\t\t\t\n\t\t\t\n\t\t\t// days remaining for red flag.\n\t\t\t$widget_options['days remaining'] = dateDiff($start_datetime, $end_datetime);\n\t\t\t\n\t\t\t\n\t\t\t// validate start date is less than end date.\n\t\t\tif($start_datetime > $end_datetime)\n\t\t\t{\t\n\t\t\t\t\n\t\t\t\t$Err['datetimeErr'] = \"Starting date is greater than Ending date.\";\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t// validate start date not in past.\n\t\t\tif(date('Y-m-d H:i:s') >= $start_datetime)\n\t\t\t{\n\t\t\t\t\n\t\t\t\t$Err['startTimeErr'] = \"Starting date is less than today's date.\";\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t// validate start month is not empty.\t\t\t\t\t\n\t\t\tif(empty($_POST['red_flag_parking']['starting_month']))\n\t\t\t{\n\t\t\t\t\n\t\t\t\t$Err['startingMonthErr'] = \"Starting month is required.\";\n\t\t\t\t\n\t\t\t}\n\t\t\telse{\n\t\t\t\t\n\t\t\t\t$widget_options['starting_month'] = $_POST['red_flag_parking']['starting_month'];\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t// validate start day is not empty.\n\t\t\tif(empty($_POST['red_flag_parking']['starting_day']))\n\t\t\t{\n\t\t\t\t\n\t\t\t\t$Err['startingDayErr'] = \"Starting day is required.\";\n\t\t\t\t\n\t\t\t}\n\t\t\telse{\n\t\t\t\t\n\t\t\t\t$widget_options['starting_day'] = $_POST['red_flag_parking']['starting_day'];\n\t\t\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t// validate start year is not empty.\n\t\t\tif(empty($_POST['red_flag_parking']['starting_year']))\n\t\t\t{\n\t\t\t\t\n\t\t\t\t$Err['startingYearErr'] = \"Starting year is required.\";\n\t\t\t\t\n\t\t\t}\n\t\t\telse {\n\t\t\t\n\t\t\t\t$widget_options['starting_year'] = $_POST['red_flag_parking']['starting_year'];\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t// validate start hour is not empty.\n\t\t\tif(empty($_POST['red_flag_parking']['starting_hour']))\n\t\t\t{\n\t\t\t\t\n\t\t\t\t$Err['startingHourErr'] = \"Starting hour is required.\";\n\t\t\t\t\n\t\t\t}\n\t\t\telse{\n\t\t\t\t\n\t\t\t\t$widget_options['starting_hour'] = $_POST['red_flag_parking']['starting_hour'];\n\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t// no validation required since always 00.\n\t\t\t$widget_options['starting_minute'] = $_POST['red_flag_parking']['starting_minute'];\n\t\t\t\n\t\t\t\n\t\t\t// validate start meridiem is not empty.\n\t\t\tif(empty($_POST['red_flag_parking']['starting_meridiem']))\n\t\t\t{\n\t\t\t\t\n\t\t\t\t$Err['startingMeridiemErr'] = \"Starting meridiem is required.\";\n\t\t\t\t\n\t\t\t}\n\t\t\telse{\n\t\t\t\t\n\t\t\t\t$widget_options['starting_meridiem'] = $_POST['red_flag_parking']['starting_meridiem'];\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t// validate end month is not empty.\n\t\t\tif(empty($_POST['red_flag_parking']['ending_month']))\n\t\t\t{\n\t\t\t\t\n\t\t\t\t$Err['endingMonthErr'] = \"Ending month is required.\";\n\t\t\t\t\n\t\t\t}\n\t\t\telse{\n\t\t\t\t\n\t\t\t\t$widget_options['ending_month'] = $_POST['red_flag_parking']['ending_month'];\n\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t// validate end day is not empty.\n\t\t\tif(empty($_POST['red_flag_parking']['ending_day']))\n\t\t\t{\n\t\t\t\t\n\t\t\t\t$Err['endingDayErr'] = \"Ending day is required.\";\n\t\t\t\t\n\t\t\t}\n\t\t\telse{\n\t\t\t\t\n\t\t\t\t$widget_options['ending_day'] = $_POST['red_flag_parking']['ending_day'];\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t// validate end year is not empty.\n\t\t\tif(empty($_POST['red_flag_parking']['ending_year']))\n\t\t\t{\n\t\t\t\t\n\t\t\t\t$Err['endingYearErr'] = \"Ending year is required.\";\n\t\t\t\t\n\t\t\t}\n\t\t\telse{\n\t\t\t\t\n\t\t\t\t$widget_options['ending_year'] = $_POST['red_flag_parking']['ending_year'];\n\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t// validate end hour is not empty.\n\t\t\tif(empty($_POST['red_flag_parking']['ending_hour']))\n\t\t\t{\n\t\t\t\t\n\t\t\t\t$Err['endingHourErr'] = \"Ending hour is required.\";\n\t\t\t\t\n\t\t\t}\n\t\t\telse {\n\t\t\t\t\n\t\t\t\t$widget_options['ending_hour'] = $_POST['red_flag_parking']['ending_hour'];\n\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t//no validation required always 00.\n\t\t\t$widget_options['ending_minute'] = $_POST['red_flag_parking']['ending_minute'];\n\t\t\t\n\t\t\t\n\t\t\t// validate end meridiem is not empty.\n\t\t\tif(empty($_POST['red_flag_parking']['ending_meridiem']))\n\t\t\t{\n\t\t\t\t\n\t\t\t\t$Err['endingMeridiemErr'] = \"Ending meridiem is required.\";\n\t\t\t\t\n\t\t\t}\n\t\t\telse{\n\t\t\t\t\n\t\t\t\t$widget_options['ending_meridiem'] = $_POST['red_flag_parking']['ending_meridiem'];\n\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t// validate reset is zero or value of 1.\n\t\t\tif(empty($_POST['red_flag_parking']['reset']))\n\t\t\t{\n\t\t\t\t\n\t\t\t\t$widget_options['reset'] = 0;\n\t\t\t\t\n\t\t\t}\n\t\t\telse{\n\t\t\t\t\n\t\t\t\t$widget_options['reset'] = $_POST['red_flag_parking']['reset'];\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t// and not reset then add the current user and active.\n\t\t\tif( empty($Err) ) \n\t\t\t{\t\t\n\t\t\t\t\n\t\t\t\t$widget_options['active'] = 1;\n\t\t\t\t\n\t\t\t\t$current_user = wp_get_current_user();\t\n\t\t\t\t\n\t\t\t\t$widget_options['set_by_user'] = $current_user->user_login;\t\n\t\t\t\t\n\t\t\t}\n\n\t\t\t// delete options.\n\t\t\tif($widget_options['reset'] == 1)\n\t\t\t{\n\t\t\t\t// used to reset \n\t\t\t\tself::delete_dashboard_widget_options( 'red_flag_widget_options' );\n\t\t\t\t\n\t\t\t\t//Red Flag ending time was reached. reset. reset. reset.\t\t\t\n\t\t\n\t\t\t\t//Register default settings...\n\t\t\t\tself::update_dashboard_widget_options(\n\t\t\t\t\tself::wid, //The widget id\n\t\t\t\t\tarray( //Associative array of options & default values\n\t\t\t\t\t\t'remaining_days' => 0,\n\t\t\t\t\t\t'reset' => 0,\n\t\t\t\t\t\t'start_conversion' => 0,\n\t\t\t\t\t\t'start_datetime' => '',\n\t\t\t\t\t\t'end_datetime' => '',\n\t\t\t\t\t\t'starting_year' => '',\n\t\t\t\t\t\t'starting_month' => '',\n\t\t\t\t\t\t'starting_day' => '',\n\t\t\t\t\t\t'starting_hour' => '',\n\t\t\t\t\t\t'starting_minute' => '',\n\t\t\t\t\t\t'starting_meridiem' => '',\n\t\t\t\t\t\t'starting_date' => '',\n\t\t\t\t\t\t'starting_time' => '',\n\t\t\t\t\t\t'ending_year' => '',\n\t\t\t\t\t\t'ending_month' => '',\n\t\t\t\t\t\t'ending_day' => '',\n\t\t\t\t\t\t'ending_hour' => '',\n\t\t\t\t\t\t'ending_minute' => '',\n\t\t\t\t\t\t'ending_meridiem' => '',\n\t\t\t\t\t\t'ending_date' => '',\n\t\t\t\t\t\t'ending_time' => '',\n\t\t\t\t\t\t'set_by_user' => '',\n\t\t\t\t\t\t'active' => 0\n\t\t\t\t\t),\n\t\t\t\t\ttrue //Add only (will not update existing options)\n\t\t\t\t);\n\t\t\t\n\t\t\t}\n\t\t\telse {\n\t\t\t\t\t\n\t\t\t\t//save update \n\t\t\t\tself::update_dashboard_widget_options( self::wid, $widget_options );\n\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\t//echo '<pre>'. print_r($Err,1) .'</pre>';\n\t\t\n\t\t// get widget options from the network database table.\n\t\t$get_widget_options = self::get_dashboard_widget_options('red_flag_parking');\n\t\t\t\t\n\t\t$get_starting_month = $get_widget_options['starting_month'];\n\t\t$get_starting_day = $get_widget_options['starting_day'];\n\t\t$get_starting_year = $get_widget_options['starting_year'];\n\t\t$get_starting_hour = $get_widget_options['starting_hour'];\n\t\t$get_starting_minute = $get_widget_options['starting_minute'];\n\t\t$get_starting_meridiem = $get_widget_options['starting_meridiem'];\n\t\t$get_ending_month = $get_widget_options['ending_month'];\n\t\t$get_ending_day = $get_widget_options['ending_day'];\n\t\t$get_ending_year = $get_widget_options['ending_year'];\n\t\t$get_ending_hour = $get_widget_options['ending_hour'];\n\t\t$get_ending_minute = $get_widget_options['ending_minute'];\n\t\t$get_ending_meridiem = $get_widget_options['ending_meridiem'];\n\t\t$get_set_by_user = $get_widget_options['set_by_user'];\n\t\t\n\t\t\n\t\t// set message to display on admin page.\n\t\tif(isset($get_widget_options['active']) && $get_widget_options['active'] == 1) \n\t\t{\n\t\t\t$active = '<div id=\"active\"> The Red Flag Parking is ACTIVE.</div>';\n\t\t} \n\t\telse{\n\t\t\t\n\t\t\t$active = '<div id=\"not-active\"> The Red Flag Parking is NOT ACTIVE.</div>';\n\t\t}\t\t\n\t\t\n\t\t// Admin Form\n\t\trequire_once( 'red-flag-parking-scheduling.php' );\t\t\n\t\t\n }",
"function update_start()\n {\n }",
"public function viewEvents();",
"function UpdateEvents() {\n\t\tforeach ($this->data as $i => $row) {\n\t\t\tif (!is_null($row['EventId'])) {\n\t\t\t\t//check wheter event is assigned to calculated event. If it is take the calculated rating, otherwise set the rating to -0.5\n\t\t\t\tif (array_key_exists($i, $this -> rating)) {\n\t\t\t\t\t$rating = $this -> rating[$i];\n\t\t\t\t} else {\n\t\t\t\t\t$rating = -0.5;\n\t\t\t\t}\n\t\t\t\t//update all events\n\t\t\t\t$sql = \"UPDATE Event SET rating=\" . $rating . \" WHERE EventId=\" . $row['EventId'];\n\t\t\t\t$stmt = $this -> DB -> prepare($sql);\n\t\t\t\tif ($stmt -> execute()) {\n\t\t\t\t} else {\n\t\t\t\t\tinclude_once \"Email.php\";\n\t\t\t\t\tnew Email('failed', 'to update event rating with EventId=' . $row['EventId'], $this -> id);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$this -> updateTask();\n\n\t}",
"public function update(Request $request, Event $event)\n {\n $old_thumb = $event->thumbnail;\n $validator = Validator::make($request->all(),[\n \"title\" => [\"required\"],\n \"start\" => [\"required\", \"after:now\"],\n \"end\" => [\"required\", \"after:start\"],\n \"content\" => [\"required\"],\n \"thumbnail\" => [\"required\"],\n \"keyword\" => [\"nullable\"],\n \"description\" => [\"nullable\"],\n ]);\n $image = \"images/cache/upload_\". Auth::id() . \".jpg\";\n\n $cover = date(\"Y/m/d/his\");\n $foler = \"images/\";\n $data = $validator->validate();\n $event->title = $data[\"title\"];\n $event->start = $data[\"start\"];\n $event->end = $data[\"end\"];\n $event->content = $data[\"content\"];\n $event->keyword = $data[\"keyword\"];\n $event->description = $data[\"description\"];\n $event->thumbnail = $data[\"thumbnail\"];\n if ($event->user_id == Auth::id() or Auth::user() == \"admin\") {\n if ($event->isDirty(\"thumbnail\")){\n if (Storage::disk(\"local\")->exists($image)) {\n Storage::move($image, $foler.$cover. \".jpg\");\n Storage::disk(\"local\")->delete([\n \"images/\".$old_thumb.\".jpg\",\n \"images/\".$old_thumb.\"_thumb.jpg\",\n ]);\n $photo = Image::make(\"photo/\".$cover. \".jpg\");\n $photo->resize(320, 180);\n $photo->save($photo->dirname.\"/\".$photo->filename.\"_thumb.\".$photo->extension);\n $event->thumbnail = $cover;\n }else{\n $validator\n ->after(function ($validator){\n $validator->errors()->add(\"thumbnail\",\"Please upload a thumbnail\");\n })->validate();\n }\n }\n\n if (count($event->getDirty()) == 0){\n return redirect(route(\"event.index\"));\n }else{\n $event->updated_by = Auth::id();\n $event->update($event->getDirty());\n return redirect(route(\"event.index\"));\n }\n }else{\n return redirect(route(\"event.index\"))->withErrors([\n \"alert\" => \"No permission!\",\n \"alert_message\" => \"You are not allowed to edit this event\"\n ])->withInput();\n }\n }",
"function processPartialUpdate(&$viewer) {\n\n global $startDate, $endDate, $viewPortStartDate, $viewPortEndDate;\n\n # Retrieve the overall date range from custom Javascript ChartViewer attributes.\n $startDate = $viewer->getCustomAttr(\"startDate\");\n $endDate = $viewer->getCustomAttr(\"endDate\");\n\n # Now we need to determine the visible date range selected by the user. There are two\n # possibilities. The user may use the zoom/scroll features of the Javascript ChartViewer to\n # select the range, or s/he may use the start date / end date select boxes to select the date\n # range.\n\n if ($viewer->isViewPortChangedEvent()) {\n # Is a view port change event from the Javascript ChartViewer, so we should get the selected\n # date range from the ChartViewer view port settings.\n $duration = $endDate - $startDate;\n $viewPortStartDate = $startDate + (int)(0.5 + $viewer->getViewPortLeft() * $duration);\n $viewPortEndDate = $viewPortStartDate + (int)(0.5 + $viewer->getViewPortWidth() * $duration)\n ;\n } else {\n # The user has changed the selected range by using the start date / end date select boxes.\n # We need to retrieve the selected dates from those boxes. For partial updates, the select\n # box values are sent in as Javascript ChartViewer custom attributes.\n $startYear = (int)($viewer->getCustomAttr(\"StartYear\"));\n $startMonth = (int)($viewer->getCustomAttr(\"StartMonth\"));\n $startDay = (int)($viewer->getCustomAttr(\"StartDay\"));\n $endYear = (int)($viewer->getCustomAttr(\"EndYear\"));\n $endMonth = (int)($viewer->getCustomAttr(\"EndMonth\"));\n $endDay = (int)($viewer->getCustomAttr(\"EndDay\"));\n\n # Note that for browsers that do not support Javascript, there is no validation on the\n # client side. So it is possible for the day to exceed the valid range for a month (eg. Nov\n # 31, but Nov only has 30 days). So we set the date by adding the days difference to the 1\n # day of a month. For example, Nov 31 will be treated as Nov 1 + 30 days = Dec 1.\n $viewPortStartDate = chartTime($startYear, $startMonth, 1) + ($startDay - 1) * 86400;\n $viewPortEndDate = chartTime($endYear, $endMonth, 1) + ($endDay - 1) * 86400;\n }\n\n # Draw the chart\n drawChart($viewer);\n\n #\n # We need to communicate the new start date / end date back to the select boxes on the browser\n # side.\n #\n\n # The getChartYMD function retrives the date as an 8 digit decimal number yyyymmdd.\n $startYMD = getChartYMD($viewPortStartDate);\n $endYMD = getChartYMD($viewPortEndDate);\n\n # Send year, month, day components to the start date / end date select boxes through Javascript\n # ChartViewer custom attributes.\n $viewer->setCustomAttr(\"StartYear\", (int)($startYMD / 10000));\n $viewer->setCustomAttr(\"StartMonth\", (int)($startYMD / 100) % 100);\n $viewer->setCustomAttr(\"StartDay\", $startYMD % 100);\n $viewer->setCustomAttr(\"EndYear\", (int)($endYMD / 10000));\n $viewer->setCustomAttr(\"EndMonth\", (int)($endYMD / 100) % 100);\n $viewer->setCustomAttr(\"EndDay\", $endYMD % 100);\n}",
"public function save(): bool\n {\n $data = [\n 'date' => $this->getDate(),\n 'type' => $this->getType(),\n 'recorded' => $this->getRecorded(),\n 'route' => $this->getRoute(),\n 'place' => $this->getPlace(),\n 'mileage' => $this->getMileage(),\n 'place_manual' => $this->getPlaceManual(),\n 'description' => $this->getDescription()\n ];\n if ($this->getId()) {\n if ((new db\\Update('event', $data, $this->getId()))->run() !== false) {\n return true;\n }\n } else {\n if ($newId = (new db\\Insert('event', $data))->run()) {\n $this->setId($newId);\n return true;\n }\n }\n return false;\n }",
"function submitted_events_install() {\n\tglobal $submitted_events_db_version;\n\t\n\t// Only update database on version update\n\tif ($submitted_events_db_version != get_option ( 'submitted_events_version' )) {\n\t\t\n\t\tglobal $wpdb;\n\t\t\n\t\t$table_name = $wpdb->prefix . \"submitted_events\";\n\t\t\n\t\terror_log ( 'Submitted Events Plugin activated', 0 );\n\t\t\n\t\t// This is a harsh way of changing the database - all previous data will be lost!\n\t\t// But dbDelta wasn't doing the updates as intended\n\t\t$wpdb->query( \"DROP TABLE IF EXISTS \" . $table_name );\n\t\t\n\t\t$charset_collate = $wpdb->get_charset_collate ();\n\t\t\n\t\t// Max field lengths assumed, e.g.\n\t\t// date will be YYYY-MM-DD\n\t\t// packedlunch should be Yes or No but could be blank\n\t\t// altmeetpttime could be : or HH:MM\n\t\t$sql = \"CREATE TABLE \" . $table_name . \"(\n \tid mediumint(9) NOT NULL AUTO_INCREMENT,\n \tname VARCHAR(50) NOT NULL,\n\tdate VARCHAR(10) NOT NULL, \n\ttitle VARCHAR(150) NOT NULL,\n\tbrunelgroup VARCHAR(30) NOT NULL,\n\tlevel VARCHAR(30) NOT NULL,\n\tlength VARCHAR(30) NOT NULL,\n\tstarttime VARCHAR(20) NOT NULL,\n\tmeetpt VARCHAR(30) NOT NULL,\n\taltmeetpt VARCHAR(150) NOT NULL,\n\taltmeetgridref VARCHAR(20) NOT NULL,\n\taltmeetpttime VARCHAR(8) NOT NULL,\n\taltmeetcontactleader VARCHAR(4) NOT NULL,\t\t\n\tmapurl VARCHAR(200) NOT NULL,\n\temail VARCHAR(50) NOT NULL,\n\tphone VARCHAR(30) NOT NULL,\n\tpackedlunch VARCHAR(4) NOT NULL,\n\tpostwalk VARCHAR(20) NOT NULL,\n\tdescription text NOT NULL,\n\tcoleader VARCHAR(50) NOT NULL,\n\tcoleaderphone VARCHAR(30) NOT NULL,\t\t\n\tcarshareorganiser VARCHAR(4) NOT NULL,\t\n\teventgenerated boolean NOT NULL DEFAULT FALSE,\n \tPRIMARY KEY (id)\t\n\t) \" . $charset_collate . \";\";\n\t\t\n\t\trequire_once (ABSPATH . 'wp-admin/includes/upgrade.php');\n\t\t\n\t\t// This isn't allowing updates to the table - error table exists\n\t\t// see http://wordpress.stackexchange.com/questions/41293/dbdelta-failing-with-error-wordpress-database-error-table-wp-2-myplugin-alre\n\t\tdbDelta ( $sql );\n\t\t\n\t\t// WordPress Options Hooks\n\t\tupdate_option ( 'submitted_events_db_version', $submitted_events_db_version );\n\t}\n}",
"function updateEventTable(&$formvars){\r\n //$confirmcode = $this->MakeConfirmationMd5($formvars['email']);\r\n \r\n //$formvars['confirmcode'] = $confirmcode;\r\n\t\t\r\n\t\t$uName = $this->UsrName();\r\n\t\t\r\n\t\t/* Address manipulation--------Start\r\n\t\t * This portion is where we manipulate the address.\r\n\t\t * Sends it to Google services to get the Latitude and Longitude of the address.\r\n\t\t */\r\n\t\t$address = $formvars['Eaddress'] . \", \" . $formvars['Ecity'] . \", \" . $formvars['Estate'] . \" \" . $formvars['Ezip'];\r\n\t\t$expression = \"/\\s/\";\r\n\t\t$replace = \"+\";\r\n\r\n\t\t$street = preg_replace($expression, $replace, $address);\r\n\t\t$prepAddr = str_replace(' ', '+', $street);\r\n\t\t$geocode = file_get_contents('http://maps.google.com/maps/api/geocode/json?address='.$prepAddr.'&sensor=false');\r\n\t\t$output = json_decode($geocode);\r\n\t\t/*Address manipulation--------End*/\r\n\t\t\r\n\t\t/*Returns the coordinates of the address.*/\r\n\t\t$lat = $output->results[0]->geometry->location->lat;\r\n\t\t$long = $output->results[0]->geometry->location->lng;\r\n\t\t\r\n\t\t$formvars['EtimeStart'] = date(\"g:i a\", strtotime($formvars['EtimeStart']));\r\n\t\t$formvars['EtimeEnd'] = date(\"g:i a\", strtotime($formvars['EtimeEnd']));\r\n\t\t\r\n\t\t$newStartTime= date(\"H:i\", strtotime($formvars['EtimeStart']));\r\n\t\t\r\n\t\t\r\n\t\t$EstartDate= $formvars['EstartDate'] ;\r\n\t\t\r\n\t\t$EstartDate= strtotime($EstartDate);\r\n\t\t$EstartDate= date(\"Y-m-d\",$EstartDate);\r\n\t\t\r\n\t\t\r\n\t\t/* If the option from the drop down in the form is 'Other'\r\n\t\t * Then we use this option that allows to insert the other typed by the user.\r\n\t\t */\r\n\t\t$insert_query = 'UPDATE ' . $this->tablename2 . ' SET UuserName = \"' . $this->SanitizeForSQL($uName) . '\", ' \r\n\t\t. 'Evename = \"' . $this->SanitizeForSQL($formvars['Evename']) . '\", EstartDate = \"' . $this->SanitizeForSQL($EstartDate) . '\", ' \r\n\t\t. 'EendDate = \"' . $this->SanitizeForSQL($formvars['EendDate']) . '\", Eaddress = \"' . $this->SanitizeForSQL($formvars['Eaddress']) . '\", ' \r\n\t\t. 'Ecity = \"' . $this->SanitizeForSQL($formvars['Ecity']) . '\", Estate = \"' . $this->SanitizeForSQL($formvars['Estate']) . '\", ' \r\n\t\t. 'Ezip = \"' . $this->SanitizeForSQL($formvars['Ezip']) . '\", EphoneNumber = \"' . $this->SanitizeForSQL($formvars['EphoneNumber']) . '\", ' \r\n\t\t. 'Edescription = \"' . $this->SanitizeForSQL($formvars['Edescription']) . '\", Etype = \"' . $this->SanitizeForSQL($formvars['Etype']) . '\", ' \r\n\t\t. 'Ewebsite = \"' . $this->SanitizeForSQL($formvars['Ewebsite']) . '\", Ehashtag = \"' . $this->SanitizeForSQL($formvars['Ehashtag']) . '\", ' \r\n\t\t. 'Efacebook = \"' . $this->SanitizeForSQL($formvars['Efacebook']) . '\", Etwitter = \"' . $this->SanitizeForSQL($formvars['Etwitter']) . '\", ' \r\n\t\t. 'Egoogle = \"' . $this->SanitizeForSQL($formvars['Egoogle']) . '\", '\r\n\t\t. (($formvars['Eflyer'] !== null) ? ('Eflyer = \"' . $this->SanitizeForSQL($formvars['Eflyer'])) . '\", ' : \"\")\r\n\t\t. (($formvars['Ebanner'] !== null) ? ('Ebanner = \"' . $this->SanitizeForSQL($formvars['Ebanner'])). '\", ': \"\")\r\n\t\t. (($formvars['Etype'] === 'Other') ? ('Eother = \"' . $this->SanitizeForSQL($formvars['Eother'])) . '\", ': \"\")\r\n\t\t. 'EtimeStart = \"' . $this->SanitizeForSQL($newStartTime) . '\", ' \r\n\t\t. 'EtimeEnd = \"' . $this->SanitizeForSQL($formvars['EtimeEnd']) . '\", Elat = \"' . $this->SanitizeForSQL($lat) . '\", ' \r\n\t\t. 'Elong = \"' . $this->SanitizeForSQL($long) . '\", Erank = \"' . $this->SanitizeForSQL($formvars['Erank']) . '\"' \r\n\t\t. 'WHERE Eid = \"' . $this->SanitizeForSQL($formvars['Eid']).'\"';\r\n\t\t\r\n if(!mysql_query($insert_query, $this->connection)){\r\n $this->HandleDBError(\"Error inserting data to the table\\nquery: $insert_query\");\r\n return false;\r\n }\r\n\t\treturn true;\r\n }",
"function eventclass_TambahPergerakan()\n\t{\n\t\t$this->events[\"BeforeShowEdit\"]=true;\n\n\n//\tonscreen events\n\n\n\t}",
"public function image_process_gd($action = 'resize')\n\t{\n\t\t$v2_override = FALSE;\n\n\t\t// If the target width/height match the source, AND if the new file name is not equal to the old file name\n\t\t// we'll simply make a copy of the original with the new name... assuming dynamic rendering is off.\n\t\tif ($this->dynamic_output === FALSE && $this->orig_width === $this->width && $this->orig_height === $this->height)\n\t\t{\n\t\t\tif ($this->source_image !== $this->new_image && @copy($this->full_src_path, $this->full_dst_path))\n\t\t\t{\n\t\t\t\tchmod($this->full_dst_path, $this->file_permissions);\n\t\t\t}\n\n\t\t\treturn TRUE;\n\t\t}\n\n\t\t// Let's set up our values based on the action\n\t\tif ($action === 'crop')\n\t\t{\n\t\t\t// Reassign the source width/height if cropping\n\t\t\t$this->orig_width = $this->width;\n\t\t\t$this->orig_height = $this->height;\n\n\t\t\t// GD 2.0 has a cropping bug so we'll test for it\n\t\t\tif ($this->gd_version() !== FALSE)\n\t\t\t{\n\t\t\t\t$gd_version = str_replace('0', '', $this->gd_version());\n\t\t\t\t$v2_override = ($gd_version == 2);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// If resizing the x/y axis must be zero\n\t\t\t$this->x_axis = 0;\n\t\t\t$this->y_axis = 0;\n\t\t}\n\n\t\t// Create the image handle\n\t\tif ( ! ($src_img = $this->image_create_gd()))\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\n\t\t/* Create the image\n\t\t *\n\t\t * Old conditional which users report cause problems with shared GD libs who report themselves as \"2.0 or greater\"\n\t\t * it appears that this is no longer the issue that it was in 2004, so we've removed it, retaining it in the comment\n\t\t * below should that ever prove inaccurate.\n\t\t *\n\t\t * if ($this->image_library === 'gd2' && function_exists('imagecreatetruecolor') && $v2_override === FALSE)\n\t\t */\n\t\tif ($this->image_library === 'gd2' && function_exists('imagecreatetruecolor'))\n\t\t{\n\t\t\t$create\t= 'imagecreatetruecolor';\n\t\t\t$copy\t= 'imagecopyresampled';\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$create\t= 'imagecreate';\n\t\t\t$copy\t= 'imagecopyresized';\n\t\t}\n\n\t\t$dst_img = $create($this->width, $this->height);\n\n\t\tif ($this->image_type === 3) // png we can actually preserve transparency\n\t\t{\n\t\t\timagealphablending($dst_img, FALSE);\n\t\t\timagesavealpha($dst_img, TRUE);\n\t\t}\n\n\t\t$copy($dst_img, $src_img, 0, 0, $this->x_axis, $this->y_axis, $this->width, $this->height, $this->orig_width, $this->orig_height);\n\n\t\t// Show the image\n\t\tif ($this->dynamic_output === TRUE)\n\t\t{\n\t\t\t$this->image_display_gd($dst_img);\n\t\t}\n\t\telseif ( ! $this->image_save_gd($dst_img)) // Or save it\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\n\t\t// Kill the file handles\n\t\timagedestroy($dst_img);\n\t\timagedestroy($src_img);\n\n\t\tchmod($this->full_dst_path, $this->file_permissions);\n\n\t\treturn TRUE;\n\t}",
"public function showEvent()\n {\n switch($this->logo){\n case 'default':\n $logo = '<img src=\"public/img/default/event.png\" alt=\"WorldEsport logo\">';\n break;\n default:\n $logo = '<img src=\"inc/img/imgempevents.php?imgname='. $this->logo .'&u='. $this->currentUser->pk_iduser .'\" alt=\"WorldEsport employee events logo\">';\n }\n\n //test de la presence de description ou non\n switch($this->description){\n case true:\n $description = '<div class=\"info-line collapse\" id=\"collapse'. substr(str_replace($this->unauthorizedChar,'',$this->name),0,15) . str_replace($this->unauthorizedChar,'',$this->startdate) .'\">\n <p class=\"info-decription\">' . $this->description . '</p>\n </div>';\n $btcollapse = '<div class=\"bt-more-container\">\n <button class=\"share-button bt\" data-toggle=\"collapse\" href=\"#collapse'. substr(str_replace($this->unauthorizedChar,'',$this->name),0,15) . str_replace($this->unauthorizedChar,'',$this->startdate) .'\">\n '. $this->langFile[$this->pageName]->bt_myprofile_gamer_moredetails .'\n </button>\n </div>';\n break;\n default:\n $description = '<div class=\"info-line collapse\">\n <p class=\"info-decription\">' . $this->description . '</p>\n </div>';\n $btcollapse = '';\n }\n\n $content = ' <div class=\"profile-elem profil-event-container col-md-12\" data-elem=\"'.$this->id.'\">\n <div class=\"profile-aside-container\">\n <div class=\"loader-container loader-elem-bloc loader-profile-elem\">\n <div class=\"loader-double-container\">\n <span class=\"loader loader-double\">\n </span>\n </div>\n </div>\n <div class=\"edit-container\">\n <div class=\"edit-ico-container\">\n <div class=\"edit-gear edit-profile-bloc-elem ico-gear\"></div> \n </div>\n <div class=\"edit-options\">\n \n </div>\n </div>\n <div class=\"profile-bloc-elem-left col-md-9\">\n <div class=\"infos-container col-md-12\">\n <div class=\"info-line\">\n <p class=\"info\">'. $this->name .'</p>\n </div>\n <div class=\"info-line\">\n <p class=\"info\">'. $this->jobtitle .' '. $this->langGenerals->word_at .' </p><p class=\"info\">'. $this->company .'</p>\n </div> \n <div class=\"info-line\">\n <p class=\"info\">' . $this->dayStart . ' ' . $this->monthStart . ' ' . $this->yearStart . ' - </p><p class=\"info\">' . $this->dayEnd . ' ' . $this->monthEnd . ' ' . $this->yearEnd . '</p>\n </div>\n '. $description .' \n </div> \n '. $btcollapse .' \n </div> \n <div class=\"profile-bloc-elem-right col-md-3\">\n <div class=\"pic\">\n '. $logo .'\n </div>\n </div>\n </div> \n </div>';\n\n return $content;\n }"
] | [
"0.6170755",
"0.54354453",
"0.5387998",
"0.5275587",
"0.5241218",
"0.5051418",
"0.504692",
"0.50406575",
"0.49654463",
"0.49055523",
"0.49030975",
"0.4900804",
"0.47967204",
"0.47179615",
"0.466477",
"0.46574193",
"0.4645503",
"0.46106863",
"0.4602144",
"0.4559741",
"0.45046622",
"0.45035964",
"0.44991904",
"0.44655663",
"0.44557428",
"0.44445243",
"0.4436547",
"0.4434921",
"0.4428058",
"0.4427874",
"0.44011986",
"0.4399715",
"0.43960395",
"0.439576",
"0.43932036",
"0.43932036",
"0.4385841",
"0.43803474",
"0.43761495",
"0.43697247",
"0.43626308",
"0.4348933",
"0.43347797",
"0.4312216",
"0.4292714",
"0.42904264",
"0.42790377",
"0.42739257",
"0.4272053",
"0.426444",
"0.42604548",
"0.42588973",
"0.42530513",
"0.42502466",
"0.4244173",
"0.42348766",
"0.42324525",
"0.42247388",
"0.4219931",
"0.4218381",
"0.4216169",
"0.42084536",
"0.42067552",
"0.41985086",
"0.4191069",
"0.418743",
"0.41861197",
"0.41800007",
"0.4175535",
"0.41728812",
"0.41714698",
"0.4169702",
"0.416825",
"0.41666675",
"0.41666675",
"0.41639966",
"0.4163435",
"0.4162311",
"0.41605395",
"0.41593897",
"0.41519082",
"0.41514328",
"0.4150197",
"0.41454607",
"0.41437593",
"0.41405678",
"0.41401505",
"0.41395512",
"0.4136611",
"0.4122349",
"0.4118321",
"0.4117858",
"0.41111535",
"0.41067833",
"0.41057894",
"0.410444",
"0.40965474",
"0.40940407",
"0.4089142",
"0.4083516",
"0.40830863"
] | 0.0 | -1 |
This function updates events to the database Returns true | public function updates($id, $title, $description, $url)
{
// The update query
$query = sprintf('UPDATE %s
SET
title = "%s",
description = "%s",
url = "%s"
WHERE
id = %s
',
mysqli_real_escape_string($this->connection, $this->table),
mysqli_real_escape_string($this->connection, htmlentities($title)),
mysqli_real_escape_string($this->connection, htmlentities($description)),
mysqli_real_escape_string($this->connection, htmlentities($url)),
mysqli_real_escape_string($this->connection, $id)
);
// The result
return $this->result = mysqli_query($this->connection, $query);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function updateEventInDatabase(&$formvars){\r\n\t\tif(!$this->DBLogin()){\r\n\t\t\t$this->HandleError(\"Database login failed!\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tif(!$this->EnsureEventTable()){\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tif(!$this->updateEventTable($formvars)){\r\n\t\t\t$this->HandleError(\"Inserting to Database failed!\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\treturn true;\r\n\t}",
"public function testUpdateEvents()\n {\n $event= Event::factory(1)->create();\n // dd($event);\n $event->title = 'Maria';\n $this->put(\"/events\". $event[0]->id, $event->toArray());\n\n $this->assertDatabaseHas('events', [\n 'id' => 1,\n 'title' => 'Maria'\n ]);\n }",
"function update() {\n\t\t$vars = $this->params['url'];\n\t\t$this->Event->id = $vars['id'];\n\t\t$this->Event->saveField('start', $vars['start']);\n\t\t$this->Event->saveField('end', $vars['end']);\n\t\t$this->Event->saveField('all_day', $vars['allday']);\n\t}",
"public function save(): bool\n {\n $data = [\n 'date' => $this->getDate(),\n 'type' => $this->getType(),\n 'recorded' => $this->getRecorded(),\n 'route' => $this->getRoute(),\n 'place' => $this->getPlace(),\n 'mileage' => $this->getMileage(),\n 'place_manual' => $this->getPlaceManual(),\n 'description' => $this->getDescription()\n ];\n if ($this->getId()) {\n if ((new db\\Update('event', $data, $this->getId()))->run() !== false) {\n return true;\n }\n } else {\n if ($newId = (new db\\Insert('event', $data))->run()) {\n $this->setId($newId);\n return true;\n }\n }\n return false;\n }",
"function updateEvent($id, $name, $description, $type, $start, $end)\n{\n require_once(\"model/database.php\");\n $query = \"UPDATE events SET name = :name, description = :description, type = :type, start = :start, end = :end WHERE id = :id ;\";\n return executeQueryIUDAffected($query, createBinds([[\":id\", $id, PDO::PARAM_INT], [\":name\", $name], [\":description\", $description], [\":type\", $type], [\":start\", $start], [\":end\", $end]]));\n}",
"public function testUpdateValidEvent (): void {\n\t\t//count the number of rows and save it for later\n\t\t$numRows = $this->getConnection()->getRowCount(\"event\");\n\n\t\t// create a new Event and insert into mySQL\n\t\t$eventId = generateUuidV4();\n\t\t$event = new Event ($eventId, $this->profile->getProfileId(), $this->VALID_EVENTATTENDEELIMIT,$this->VALID_EVENTDETAIL, $this->VALID_EVENTENDDATETIME,$this->VALID_EVENTIMAGE, $this->VALID_EVENTLAT, $this->VALID_EVENTLONG, $this->VALID_EVENTNAME, $this->VALID_EVENTPRICE, $this->VALID_EVENTSTARTDATETIME);\n\t\t$event->insert($this->getPDO());\n\n\t\t// edit the event and update it in mySQL\n\t\t$event->setEventDetail($this->VALID_EVENTDETAIL2);\n\t\t$event->update($this->getPDO());\n\n\n\t\t// grab the data from mySQL and enforce the fields meet our expectations\n\t\t$pdoEvent = Event::getEventByEventId($this->getPDO(), $event->getEventId());\n\t\t$this->assertEquals($pdoEvent->getEventId(), $eventId);\n\t\t$this->assertEquals($numRows + 1, $this->getConnection()->getRowCount(\"event\"));\n\t\t$this->assertEquals($pdoEvent->getEventId(), $eventId);\n\t\t$this->assertEquals($pdoEvent->getEventProfileId(),$this->profile->getProfileId());\n\t\t$this->assertEquals($pdoEvent->getEventAttendeeLimit(), $this->VALID_EVENTATTENDEELIMIT);\n\t\t// format the date too seconds since the beginning of time to avoid round off error\n\t\t$this->assertEquals($pdoEvent->getEventDetail(), $this->VALID_EVENTDETAIL2);\n\t\t$this->assertEquals($pdoEvent->getEventEndDateTime(),$this->VALID_EVENTENDDATETIME);\n\t\t$this->assertEquals($pdoEvent->getEventImage(), $this->VALID_EVENTIMAGE);\n\t\t$this->assertEquals($pdoEvent->getEventLat(), $this->VALID_EVENTLAT);\n\t\t$this->assertEquals($pdoEvent->getEventLong(), $this->VALID_EVENTLONG);\n\t\t$this->assertEquals($pdoEvent->getEventName(), $this->VALID_EVENTNAME);\n\t\t$this->assertEquals($pdoEvent->getEventPrice(), $this->VALID_EVENTPRICE);\n\t\t// format the date too seconds since the beginning of time to avoid round off error\n\t\t$this->assertEquals($pdoEvent->getEventStartDateTime(), $this->VALID_EVENTSTARTDATETIME);\n\t}",
"function updateEvent(){\r\n\t\tif(!isset($_POST['submitted'])){\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\t$formvars = array();\r\n\r\n\t\tif(!$this->ValidateUpdatedSubmission()){\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\t$itemPicture = $this->upLoadPic();\r\n\t\tif($itemPicture != false){\r\n\t\t\t$formvars['Eflyer'] = $this->upLoadPic();\r\n\t\t}\r\n\t\t\t\t\r\n\t\t$picBanner = $this->upLoadBanner();\r\n\t\tif($picBanner != false){\r\n\t\t\t$formvars['Ebanner'] = $this->upLoadBanner();\r\n\t\t}\r\n\t\t\r\n\t\t$this->CollectUpdatedSubmission($formvars);\r\n\t\t\r\n\t\tif(!$this->updateEventInDatabase($formvars)){\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\treturn true;\r\n\t}",
"public function db_update() {}",
"private function pushEvents ($e)\n\t\t{\n\t\t\t if ( self::chkOrgId () ) { /* Check main Id */\n\t\t\t\t $dbs = new DB ( $this->config['database'] );\n\t\t\t\t $c = $dbs->query (\"SELECT COUNT(*) AS C FROM tbl_events_record WHERE org_id = '\" . $this->c . \"'\");\n\t\t\t\t if ( ! $c[0]['C'] ) { /* Event not found in events table , Insert */ \n\t\t\t\t\t$db_ins = new DB ( $this->config['database'] ) ;\n \t \t$e_ins = $db_ins->query (\"INSERT INTO tbl_events_record \n\t\t\t\t\t\tVALUES('\" . $this->c . \"','\" . $e . \"','\". date('Y-m-d H:i:s').\"');\");\n\t\t\t\t\t$db_ins->CloseConnection ();\n\t\t\t\t\treturn true;\n\t\t\t\t } else { /* Event found in events table , Update events by Id */\n\t\t\t\t\t$db_upd = new DB ( $this->config['database'] ) ;\n\t\t\t\t\t$e_upd = $db_upd->query (\"UPDATE tbl_events_record \n\t\t\t\t\t\tSET events = '\".$e.\"', date_rec = '\". date('Y-m-d H:i:s') . \n\t\t\t\t\t\t\"' WHERE org_id = '\" . $this->c .\"'\");\n\t\t\t\t\t$db_upd->CloseConnection ();\n\t\t\t\t}\n\t\t\t\t$dbs->CloseConnection ();\n\t\t\t\t$this->result['data']['id'] = $this->c;\n\t\t\t\t$this->result['data']['result'] = \"Push event: \" . $e; /* Events status */\n\t\t\t } else /* Id not found */\n\t\t\t\t$this->result['data']['result'] = \"Id not found [error code:100:101]\";\n\n\t\t\treturn false;\n\t\t}",
"function saveEventToDb($event){\n // TODO: get city and country\n \n if ($event['start']) $event['start'] = date('Y-m-d H:i:s',strtotime($event['start']));\n if ($event['end']) $event['end'] = date('Y-m-d H:i:s',strtotime($event['end']));\n \n $e = Event::model()->findByAttributes(array(\"title\"=>$event['title'],\"start\"=>$event['start'])); \n \n // check if exist in DB\n if ($e){\n $old_val = (!empty($e->content)) + (!empty($e->location)) + (!empty($e->link));\n $new_val = (!empty($event['content'])) + (!empty($event['location'])) + (!empty($event['link'])); \n // our events have priority or if new event has more variables :) or if the same source (might be updated)\n if ((($e->source != 'http://www.cofinder.eu') && (($event['source'] == 'http://www.cofinder.eu') || ($old_val < $new_val)) )\n || ($e->source == $event['source'])){\n $e->title = $event['title'];\n $e->start = $event['start'];\n $e->end = $event['end'];\n if ($event['allday']) $e->all_day = 1;\n else $e->all_day = 0;\n if (isset($event['content'])) $e->content = $event['content'];\n if (isset($event['link'])) $e->link = $event['link'];\n if (isset($event['location'])){\n $e->location = $event['location'];\n $cityCountry = $this->getCityAndCountry($event['location']);\n $e->city = $cityCountry['city'];\n $e->country = $cityCountry['country'];\n }\n if (isset($event['source'])) $e->source = $event['source'];\n if (isset($event['color'])) $e->color = $event['color'];\n if (!$e->save());// die(print_r($e->errors));\n }\n }else{\n $e = new Event();\n $e->title = $event['title'];\n $e->start = $event['start'];\n $e->end = $event['end'];\n if ($event['allday']) $e->all_day = 1;\n else $e->all_day = 0;\n if (isset($event['content'])) $e->content = $event['content'];\n if (isset($event['link'])) $e->link = $event['link'];\n if (isset($event['location'])){\n $e->location = $event['location'];\n $cityCountry = $this->getCityAndCountry($event['location']);\n $e->city = $cityCountry['city'];\n $e->country = $cityCountry['country'];\n }\n if (isset($event['source'])) $e->source = $event['source'];\n if (isset($event['color'])) $e->color = $event['color'];\n //$e->city = $event['title'];\n //$e->country = $event['title'];\n if (!$e->save());// die(print_r($e->errors));\n }\n }",
"function UpdateEvents() {\n\t\tforeach ($this->data as $i => $row) {\n\t\t\tif (!is_null($row['EventId'])) {\n\t\t\t\t//check wheter event is assigned to calculated event. If it is take the calculated rating, otherwise set the rating to -0.5\n\t\t\t\tif (array_key_exists($i, $this -> rating)) {\n\t\t\t\t\t$rating = $this -> rating[$i];\n\t\t\t\t} else {\n\t\t\t\t\t$rating = -0.5;\n\t\t\t\t}\n\t\t\t\t//update all events\n\t\t\t\t$sql = \"UPDATE Event SET rating=\" . $rating . \" WHERE EventId=\" . $row['EventId'];\n\t\t\t\t$stmt = $this -> DB -> prepare($sql);\n\t\t\t\tif ($stmt -> execute()) {\n\t\t\t\t} else {\n\t\t\t\t\tinclude_once \"Email.php\";\n\t\t\t\t\tnew Email('failed', 'to update event rating with EventId=' . $row['EventId'], $this -> id);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$this -> updateTask();\n\n\t}",
"function modifyEvent($values)\n{\n require_once 'model/dbConnector.php';\n $connexion = openDBConnexion();\n $request = $connexion->prepare('UPDATE bdd_satisfevent.events SET Title = ?, Date = ? WHERE idEvents = ?');\n $request->execute(array($values['Title'], $values['Date'], $values['idEvents']));\n}",
"function updateEventFromDatabase($database) {\r\n\t\t//mysql statement\r\n\t\t$statement = \"UPDATE reminders SET eventName='$this->name', eventDateTime='$this->event_date_time', reminderDateTime='$this->reminder_date_time', method='$this->notif_method', timeBefore='$this->time_before', frequency='$this->freq' WHERE id='$this->id'\";\r\n\r\n\t\t//mysql query for reminders table\r\n\t\t$database->query($statement) or die(\"Unable to update database. \" . $database->error);\r\n\t}",
"function updateEvent($event) {\n $this->_deleteWeekdays($event['event_id']);\n $this->_deleteMonths($event['event_id']);\n switch ($event['recurrence']) {\n case 'yearly':\n $this->_saveMonths($event['event_id'], $event);\n break;\n case 'weekly':\n $this->_saveWeekdays($event['event_id'], $event);\n break;\n }\n\n unset($event['recur_yearly_months']);\n unset($event['recur_weekly_weekdays']);\n\n return $this->databaseUpdateRecord(\n $this->tableEvents,\n $event,\n 'event_id',\n $event['event_id']\n ) !== FALSE;\n }",
"public function update_event($event_id,$_data){\r\n\t\t$ev=json_decode($this->get_event($event_id));\r\n\t\t$_data['sequence']=$ev->sequence+1;\r\n\t\t$args=$this->create_args($_data);\r\n\t\treturn($this->execute('update_event',$args,array('event_id'=>$event_id)));\r\n\t}",
"public function update_event($data)\n {\n if (!isset($data['id']) || !$data['id']) {\n return false;\n }\n //\n // Permissions\n //\n if (!empty($data['gid'])) {\n $targetGroupId = $data['gid'];\n } else {\n $oldEvent = $this->get_event($data['id']);\n $targetGroupId = $oldEvent['gid'];\n }\n // Am I the owner?\n if ($this->getGroupOwner($targetGroupId) != $this->uid) {\n // If not, I should have write permissions through a share\n $perms = $GLOBALS['DB']->getUserSharedFolderPermissions($this->uid, 'calendar', $targetGroupId);\n if (empty($perms) || empty($perms['write'])) {\n // No, I haven't\n return false;\n }\n }\n //\n //\n\n $query = 'UPDATE '.$this->Tbl['cal_event'].' SET lastmod=NOW()';\n $datafields = array('start' => 'starts', 'end' => 'ends',\n 'title' => 'title', 'description' => 'description', 'location' => 'location',\n 'type' => 'type', 'status' => 'status', 'opaque' => 'opaque', 'gid' => 'gid'\n );\n foreach ($datafields as $k => $v) {\n if (!isset($data[$k])) {\n continue;\n }\n $query .= ',`'.$v.'`=\"'.$this->esc($data[$k]).'\"';\n }\n $query .= ' WHERE id='.$data['id'];\n\n $this->query($query);\n\n $this->query('DELETE FROM '.$this->Tbl['cal_reminder'].' WHERE `uid`='.$this->uid.' AND `ref`=\"evt\" AND `eid`='.$data['id']);\n $this->query('DELETE FROM '.$this->Tbl['cal_repetition'].' WHERE `ref`=\"evt\" AND `eid`='.$data['id']);\n if (isset($data['reminders']) && !empty($data['reminders'])) {\n $query = 'INSERT INTO '.$this->Tbl['cal_reminder'].' (`eid`,`ref`,`uid`,`mode`,`time`,`text`,`smsto`,`mailto`) VALUES ';\n $k = 0;\n foreach ($data['reminders'] as $v) {\n if ($k) {\n $query .= ',';\n }\n if ($v['mode'] == '-') {\n continue;\n }\n\n if (!isset($v['smsto'])) {\n $v['smsto'] = '';\n }\n if (!isset($v['mailto'])) {\n $v['mailto'] = '';\n }\n\n $query .= '('.doubleval($data['id']).',\"evt\",'.$this->uid.',\"'.$this->esc($v['mode']).'\"'\n .','.doubleval($v['time']).',\"'.$this->esc($v['text']).'\"'\n .',\"'.$this->esc($v['smsto']).'\",\"'.$this->esc($v['mailto']).'\")';\n $k++;\n }\n if ($k > 0) {\n $this->query($query);\n }\n }\n if (isset($data['repetitions']) && !empty($data['repetitions'])) {\n $query = 'INSERT INTO '.$this->Tbl['cal_repetition'].' (`eid`,`ref`,`type`,`repeat`,`extra`,`until`) VALUES ';\n $k = 0;\n foreach ($data['repetitions'] as $v) {\n if ($k) {\n $query .= ',';\n }\n $query .= '('.doubleval($data['id']).',\"evt\",\"'.$this->esc($v['type']).'\",'.doubleval($v['repeat'])\n .','.(!is_null($v['extra']) ? '\"'.$this->esc($v['extra']).'\"' : '\"\"')\n .','.(!is_null($v['until']) ? '\"'.$this->esc($v['until']).'\"' : 'NULL').')';\n $k++;\n }\n if ($k > 0) {\n $this->query($query);\n }\n } else {\n $query = 'INSERT INTO '.$this->Tbl['cal_repetition'].' (`eid`,`ref`,`type`,`repeat`,`extra`,`until`) VALUES '\n .'('.doubleval($data['id']).',\"evt\",\"-\",0,\"\",NULL)';\n $this->query($query);\n }\n return true;\n }",
"private function update() {\n\t\t\n\t\t// get database handle\n\t\tglobal $dbh;\n\t\t\n\t\t\n\t\treturn false;\n\t}",
"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 save ()\n {\n if ( $this->objMysql === null )\n {\n $this->getConnection ();\n }\n\n try {\n if ( trim ($this->id) === \"\" )\n {\n $this->objMysql->_insert (\"workflow.APP_EVENT\", [\n 'APP_UID' => $this->app_uid,\n 'CASE_UID' => $this->case_uid,\n 'DEL_INDEX' => $this->del_index,\n 'EVN_UID' => $this->evn_uid,\n 'APP_EVN_ACTION_DATE' => $this->app_evn_action_date,\n 'APP_EVN_ATTEMPTS' => $this->app_evn_attempts,\n 'APP_EVN_LAST_EXECUTION_DATE' => $this->app_evn_last_execution_date,\n 'APP_EVN_STATUS' => $this->app_evn_status,\n ]\n );\n\n return true;\n }\n else\n {\n $this->objMysql->_update (\"workflow.APP_EVENT\", ['APP_UID' => $this->app_uid,\n 'DEL_INDEX' => $this->del_index,\n 'EVN_UID' => $this->evn_uid,\n 'APP_EVN_ACTION_DATE' => $this->app_evn_action_date,\n 'APP_EVN_ATTEMPTS' => $this->app_evn_attempts,\n 'APP_EVN_LAST_EXECUTION_DATE' => $this->app_evn_last_execution_date,\n 'APP_EVN_STATUS' => $this->app_evn_status,\n ], [\"id\" => $this->id]\n );\n }\n } catch (Exception $e) {\n throw $e;\n }\n }",
"function updateEvent($eventId, $start, $end, $objectid, $event_details, $event_desc, $event_image,\n $firstPlace, $secondPlace, $thirdPlace, $firstImage, $secondImage, $thirdImage,\n $eventComplete, $archive)\n {\n //1. Define the query\n $sql = \"UPDATE events SET eventid=:eventid, objectid=:objectid, starttime=:starttime, endtime=:endtime, \n event_details=:event_details, event_desc=:event_desc, first_place=:firstPlace, \n second_place=:secondPlace, third_place=:thirdPlace, event_image=:event_image, \n first_image=:firstImage, second_image=:secondImage, third_image=:thirdImage, \n event_complete=:eventComplete, archive=:archive WHERE eventid=:eventid\";\n\n //2. Prepare the statement\n $statement = $this->_dbh->prepare($sql);\n\n //3. Bind the parameters\n $statement->bindParam(':eventid', $eventId, PDO::PARAM_STR);\n $statement->bindParam(':starttime', $start, PDO::PARAM_STR);\n $statement->bindParam(':endtime', $end, PDO::PARAM_STR);\n $statement->bindParam(':objectid', $objectid, PDO::PARAM_STR);\n $statement->bindParam(':event_details', $event_details, PDO::PARAM_STR);\n $statement->bindParam(':event_desc', $event_desc, PDO::PARAM_STR);\n $statement->bindParam(':event_image', $event_image, PDO::PARAM_STR);\n $statement->bindParam(':firstPlace', $firstPlace, PDO::PARAM_STR);\n $statement->bindParam(':secondPlace', $secondPlace, PDO::PARAM_STR);\n $statement->bindParam(':thirdPlace', $thirdPlace, PDO::PARAM_STR);\n $statement->bindParam(':firstImage', $firstImage, PDO::PARAM_STR);\n $statement->bindParam(':secondImage', $secondImage, PDO::PARAM_STR);\n $statement->bindParam(':thirdImage', $thirdImage, PDO::PARAM_STR);\n $statement->bindParam(':eventComplete', $eventComplete, PDO::PARAM_STR);\n $statement->bindParam(':archive', $archive, PDO::PARAM_STR);\n\n $lastId = $this->_dbh->lastInsertId();\n\n //4. Execute the query\n $result = $statement->execute();\n\n //5. Process the results\n return $result;\n }",
"public function updateEvent($eventName,$imgID){\n try{\n if($stmt=$this->DataBaseCon->prepare(\"UPDATE EventDataSet SET EventName=? WHERE ImgID=?\")){\n $stmt->bind_param('ss',$eventName,$imgID);\n $stmt->execute();\n return true;\n }\n else{\n return false;\n }\n\n }catch(Expection $e){\n return false;\n }\n\n\n }",
"function updateEvent($eventToModify,$userID){\n\n $date = $eventToModify['date'];\n $place = $eventToModify['lieu'];\n $event = $eventToModify['event'];\n $startTime = $eventToModify['startTime'];\n $endTime = $eventToModify['endTime'];\n $type = $eventToModify['type'];\n $recurrence = $eventToModify['recurrence'];\n $IDOfEvent = $eventToModify['upd'];\n $qty = $eventToModify['qty'];\n\n $strSeparator = '\\'';\n\n $i=0;\n if(isset($recurrence[$i])){\n $recurrence = $recurrence[$i];\n }\n else{\n $i++;\n }\n\n $updateEventQuery = 'UPDATE events SET `name` = :name, `place` = :place, `date` = :date, `start time` = :startTime, `end time` = :endTime, `type` = :type, `recurrence` = :recurrence, `FKusers` = :userID\n WHERE ID = '.$strSeparator.$IDOfEvent.$strSeparator.' AND FKusers = '.$strSeparator.$userID.$strSeparator;\n $updateEventData = array(\":name\" => $event, \":place\" => $place, \":date\" => $date, \":startTime\" => $startTime, \":endTime\" => $endTime, \":type\" => $type, \":recurrence\" => $recurrence, \":userID\" => $userID);\n\n require_once 'model/dbConnector.php';\n $result = executeQueryInsert($updateEventQuery, $updateEventData);\n\n $idEvent = $IDOfEvent;\n\n $selectAllEventsQuery=\"SELECT recurrence FROM events WHERE ID ='$idEvent'\";\n \trequire_once 'model/dbConnector.php';\n\n \t$oldRecurrence = executeQuerySelect($selectAllEventsQuery);\n\n\n if($oldRecurrence != $recurrence){\n\n $suppOldRecurrenceQuery='DELETE from `event-recurrence` WHERE FKevents = :id';\n $suppOldRecurrenceData= array(\":id\" => $idEvent);\n\n $result3 = executeQueryInsert($suppOldRecurrenceQuery, $suppOldRecurrenceData);\n\n if($recurrence == 1){\n //jours\n for($qty;$qty>=2;$qty--){\n\n $date = new DateTime(\"{$date}\");\n $date->add(new DateInterval('P1D'));\n $date -> format('Y-m-d');\n $date = $date->format('Y-m-d');\n\n $addEventQuery2 = 'INSERT INTO `event-recurrence` (`date`, `FKevents`) VALUES (:date, :FKevents)';\n $addEventData2 = array(\":date\" => $date, \":FKevents\" => $idEvent);\n\n $result2 = executeQueryInsert($addEventQuery2,$addEventData2);\n }\n }\n //mois\n if($recurrence == 2){\n for($qty;$qty>=2;$qty--){\n $date = new DateTime(\"{$date}\");\n $date->add(new DateInterval('P1M'));\n $date -> format('Y-m-d');\n $date = $date->format('Y-m-d');\n\n $addEventQuery2 = 'INSERT INTO `event-recurrence` (`date`, `FKevents`) VALUES (:date, :FKevents)';\n $addEventData2 = array(\":date\" => $date, \":FKevents\" => $idEvent);\n\n $result2 = executeQueryInsert($addEventQuery2,$addEventData2);\n }\n }\n //année\n if($recurrence == 3){\n for($qty;$qty>=2;$qty--){\n $date = new DateTime(\"{$date}\");\n $date->add(new DateInterval('P1Y'));\n $date -> format('Y-m-d');\n $date = $date->format('Y-m-d');\n\n $addEventQuery2 = 'INSERT INTO `event-recurrence` (`date`, `FKevents`) VALUES (:date, :FKevents)';\n $addEventData2 = array(\":date\" => $date, \":FKevents\" => $idEvent);\n\n $result2 = executeQueryInsert($addEventQuery2,$addEventData2);\n }\n }\n }\n\n return $result;\n}",
"public function update(Request $request, $id)\n {\n\n\n $request->validate([\n 'event-title' => 'required',\n 'event-message' => 'required',\n 'eventStart-date' => 'required',\n 'event-time' => 'required'\n\n ]);\n\n $event = Event::find($id);\n if(Auth::check()){\n $logged_in_user = Auth::user()->name;\n }\n $registra = $event->event_registra;\n \n if(Gate::allows('update-event',$registra)){\n\n $title = request('event-title');\n $startDate = request('eventStart-date');\n $endDate = request('eventEnd-date');\n $time = request('event-time');\n $event_description = request('event-message');\n\n $event_description = preg_replace(\"/^<p.*?>/\", \"\", $event_description);\n $event_description = preg_replace(\"|</p>$|\", \"\", $event_description);\n $time = preg_replace('/\\s+/', '', $time) ;\n\n\n\n $event_details = $this->getEventdetails($id);\n foreach($event_details as $data)\n {\n $this->old_title = $data->title;\n $this->old_content = $data->description;\n $this->old_sdate = $data->start_date;\n $this->old_edate = $data->end_date;\n $this->old_stime = $data->start_time;\n }\n \n switch(true){\n case($title != $this->old_title):\n $changes[] = \"changed \".$this->old_title.\"\";\n break;\n case($startDate != $this->old_sdate):\n $changes[] = \"changed \".$this->old_sdate.\"\";\n break;\n case($endDate != $this->old_edate):\n $changes[] = \"changed \".$this->old_edate.\"\";\n break;\n case($time != $this->old_stime):\n $changes[] = \"changed \".$this->old_stime.\"\";\n break;\n }\n\n \n\n $event->title = $title;\n $event->start_date = $startDate;\n $event->end_date = $endDate;\n $event->start_time = $time;\n $event->description = $event_description;\n $event->event_registra = $logged_in_user;\n $registraEmail = Auth::user()->email;\n $registraPhone = Auth::user()->contact;\n $subject = \"Updated Event \".$this->old_title.\"\";\n\n $event_update_status = $event->save();\n\n if($event_update_status){\n\n $users = User::all();\n\n ($endDate == \"\")?\n $endDate_of_event = \"the same day\" : $endDate_of_event = $endDate;\n\n\n $data = array(\n 'title' => $title,\n 'description' => $event_description,\n 'start_date' => $startDate,\n 'end_date' => $endDate_of_event,\n 'time' => $time,\n 'registra' => $logged_in_user,\n 'registra_email' => $registraEmail,\n 'registraMobileNo' => $registraPhone,\n 'subject' => $subject,\n );\n\n $action = \"Updated an event with the title '\".$title.\"'\";\n LogsController::logger($action, $this->date_of_action);\n\n $notified = Notification::send($users, new EventNotifier($data));\n \n $central = new CentralController();\n\n if($central->is_connectedToInternet() == 1)\n {\n Mail::send('pages.mail.mail_event', $data, function($message) use ($title,$event_description, $startDate,$endDate_of_event,\n $time, $logged_in_user,$registraEmail,$registraPhone,$subject)\n { \n $message->from($registraEmail, 'Dallington');\n $message->to($registraEmail, 'Henry')->subject($subject);\n }); \n\n if(Mail::failures()){\n return redirect('events')->with('event-success','Event has been updated successfully and all users of the system have been notified with in the app notification but not via email because of internet connection issues');\n\n } \n\n else{\n\n return redirect('events')->with('event-success','Event has been updated successfully & all users of the system have been notified within the app notification & email'); \n }\n\n }\n\n else if($central->is_connectedToInternet() == 0)\n {\n return redirect('events')->with('event-success','Event has been updated successfully and all users of the system have been notified only in app notification');\n\n }\n\n\n\n }\n else\n {\n return redirect('events')->with('event-fail','Event has not been updated!');\n}\n\n}\n else\n {\n return redirect('/events')->with('event-fail','You cannot edit this event since you are not the one who created it!');\n}\n\n}",
"public function save()\r\n {\r\n if (!$this->challengePrepare()) {\r\n return false;\r\n }\r\n \r\n if (isset($this->data['itemid'])) {\r\n $procedure = 'editevent';\r\n } else {\r\n $procedure = 'postevent';\r\n }\r\n \r\n $this->request($procedure, $this->data);\r\n if (xmlrpc_is_fault($this->response) || !isset($this->response['itemid']) ||\r\n !isset($this->response['url']) || !isset($this->response['anum'])) {\r\n \r\n return false;\r\n } else {\r\n $this->data['itemid'] = $this->response['itemid'];\r\n $this->url = $this->response['url'];\r\n $this->anum = $this->response['anum'];\r\n \r\n return true;\r\n }\r\n }",
"function updateEvent() {\n $url = './updateEvent.php';\n $data = array( 'session_id' => $_SESSION[ 'code' ], 'title' => $_POST[ 'title' ], 'id' => $_POST[ 'id' ], 'due' => $_POST[ 'due' ], 'class' => $_POST[ 'class' ] );\n\n $options = array(\n 'http' => array(\n 'method' => 'POST',\n 'content' => http_build_query($data)\n )\n );\n\n $context = stream_context_create($options);\n $result = json_decode(file_get_contents($url, false, $context), true);\n\n if ( $result[ \"error\" ] )\n return(\"ERROR: \" . $result[ \"message\" ]);\n else {\n return(true);\n }\n}",
"public function updateSingleEvent() {\n\t\ttry {\n\t\t\t$id = Request::input('id');\n\t\t\t$before_end_date = Request::input('beforeEndDate');\n\t\t\t$after_start_date = Request::input('afterStartDate');\n\t\t\t$current_date = Request::input('currentDate');\n\t\t\t$original_event = ConnectContent::findOrFail($id);\n\n\t\t\t//Replicate the event for before, after and current\n\t\t\t$before = $original_event->replicate();\n\t\t\t$after = $original_event->replicate();\n\n\t\t\t$current = $original_event->replicate();\n\n\t\t\t//Update the time of this single current event\n\t\t\t$current->start_time = getMySQLTimeFormat(Request::input('start_time'));\n\t\t\t$current->end_time = getMySQLTimeFormat(Request::input('end_time'));\n\t\t\t$current->start_date = Request::input('start_date');\n\t\t\t$current->end_date = Request::input('end_date');\n\t\t\t$current->what = Request::input('what');\n\t\t\t$current->who = Request::input('who');\n\n\t\t\t//We split the talk show timelines into before and after current date\n\t\t\t$before->end_date = $before_end_date;\n\t\t\t$after->start_date = $after_start_date;\n\n\t\t\t$current->start_date = $current->end_date = $current_date;\n\n\t\t\tif($current->content_type_id == ContentType::GetMusicMixContentTypeID()) {\n\t\t\t\t$current->mix_title = Request::input('mix_title') ? Request::input('mix_title') : $current->mix_title;\n\t\t\t}\n\n\t\t\t$before->save();\n\t\t\t$after->save();\n\t\t\t$current->save();\n\t\t\t\n\t\t\tif (\\Auth::User()->station->is_private) {\n\t\t\t\t$before->updateContentToTagsLinkStatic();\n\t\t\t\t$after->updateContentToTagsLinkStatic();\n\t\t\t\t$current->updateContentToTagsLinkStatic();\n\t\t\t} else {\n\t\t\t\t$before->updateContentToTagsLink();\n\t\t\t\t$after->updateContentToTagsLink();\n\t\t\t\t$current->updateContentToTagsLink();\n\t\t\t}\n\n\t\t\t//Replicate attachments for new before and after talk show recurrences\n\t\t\t$attachments = ConnectContentAttachment::where('content_id', $id)\n\t\t\t\t->get();\n\t\t\tforeach($attachments as $attachment) {\n\t\t\t\t$attachment_for_before = $attachment->replicate();\n\t\t\t\t$attachment_for_before->content_id= $before->id;\n\t\t\t\t$attachment_for_after = $attachment->replicate();\n\t\t\t\t$attachment_for_after ->content_id = $after->id;\n\t\t\t\t$attachment_for_current = $attachment->replicate();\n\t\t\t\t$attachment_for_current->content_id= $current->id;\n\t\t\t\t$attachment_for_before->save();\n\t\t\t\t$attachment_for_after->save();\n\t\t\t\t$attachment_for_current->save();\n\t\t\t\t//Should we delete the original attachments?\n\t\t\t}\n\n\n\t\t\t$original_event->removeConnectContent();\n\n\t\t\t$is_complete = false;\n\t\t\t$images = ConnectContentAttachment::where('content_id', '=', $current['id'])->whereIn('type', ['image', 'video', 'logo'])->first();\n\n\t\t\tif(count($images) > 0 && !empty($current['who']) && !empty($current['what']) && $current['action_id'] && !empty($current['action_params']) && $current['is_ready']) {\n\t\t\t\t$is_complete = true;\n\t\t\t}\n\n\t\t\t$current->is_complete = $is_complete;\n\n\t\t\treturn response()->json(array('code' => 0, 'msg' => 'Talk Show Updated', 'data' => array('id'=> $id, 'before' => $before, 'after' => $after, 'current' => $current)));\n\t\t} catch (\\Exception $ex) {\n\t\t\t\\Log::error($ex);\n\t\t\treturn response()->json(array('code' => -1, 'msg' => $ex->getMessage()));\n\t\t}\n\t}",
"public function update(Event $event){\r\n $stmt = $this->db->prepare(\"UPDATE event set type=?, name=?, moment=?, date=?, guests=?, children=?, \r\n sweet_table=?, observations=?, restaurant=?, phone=?, price=? WHERE id_event=?\");\r\n $stmt->execute(array($event->getType(), $event->getName(), $event->getMoment(), $event->getDate(), $event->getGuests(), $event->getChildren(),\r\n $event->getSweetTable(), $event->getObservations(), $event->getRestaurant(), $event->getPhone(),$event->getPrice(),$event->getIdEvent()));\r\n\r\n }",
"function sync_event()\n\t{\n\t\t$eventintegratorfolder=\"core/integrate/event\";\n\t\t$tabeventintegrator=$this->loader->charg_dossier_unique_dans_tab($eventintegratorfolder);\n\t\t\n\t\tforeach($tabeventintegrator as $eventintegratorcour)\n\t\t{\n\t\t\t//get nomcodeevenr\n\t\t\t$nomcode=substr($eventintegratorcour,strlen($eventintegratorfolder.\"/eventintegrator.\"),(-(strlen(\".php\"))));\n\t\t\t$nomcodeclass=ucfirst($nomcode);\n\t\t\t\n\t\t\t//addtodb\n\t\t\tinclude_once $eventintegratorcour;\n\t\t\teval(\"\\$instanceEventIntegrator=new EventIntegrator\".$nomcodeclass.\"(\\$this->initer);\");\n\t\t\t$instanceEventIntegrator->setNomcodeevent($nomcode);\n\t\t\t$instanceEventIntegrator->addtodb();\n\t\t}\n\t\t\n\t\treturn true;\n\t}",
"public function run()\n {\n (new Event)->updateOrCreate([\n 'id' => 1,\n 'name' => 'view',\n ]);\n\n\n (new Event)->updateOrCreate([\n 'id' => 2,\n 'name' => 'play',\n ]);\n\n (new Event)->updateOrCreate([\n 'id' => 3,\n 'name' => 'click',\n ]);\n }",
"public function saveEvent(){\n\t\t$this->load->database();\n\t\t//if this object is new event : insert it to db\n\t\tif($this->id === -1){\n\t\t\t$this->db->query(\"INSERT INTO event (title,des,image,author,postdate,duedate) \n\t\t\t\n\t\t\tVALUES ('$this->title',\n\t\t\t\t\t'$this->des',\n\t\t\t\t\t'$this->image',\n\t\t\t\t\t'$this->author',\n\t\t\t\t\t'$this->postdate',\n\t\t\t\t\t'$this->duedate'\n\t\t\t\t\t)\");\n\t\t}\n\t\t//if this object is exist event : edit it\n\t\telse{\n\t\t\t$this->db->query(\"UPDATE event SET \n\t\t\t\t\n\t\t\t\ttitle='$this->title',\n\t\t\t\tdes='$this->des',\n\t\t\t\timage='$this->image',\n\t\t\t\tpostdate='$this->postdate',\n\t\t\t\tduedate='$this->duedate' \n\t\t\t\t\n\t\t\t\tWHERE id='$this->id'\");\n\t\t}\n\t}",
"public function update() {\n $hasduedate = isset($this->mumie->duedate) && $this->mumie->duedate > 0;\n if (!$this->event && $hasduedate) {\n $this->create_calendar_event(\n self::EVENT_TYPE,\n $this->mumie->duedate\n );\n } else if ($this->event && $hasduedate) {\n $update = new \\stdClass();\n $update->name = $this->title;\n $update->timestart = $this->mumie->duedate;\n $this->event->update($update, false);\n } else if ($this->event && !$hasduedate) {\n $this->event->delete();\n }\n }",
"function attendance_update_calendar_event($session) {\n global $DB;\n\n $caleventid = $session->caleventid;\n $timeduration = $session->duration;\n $timestart = $session->sessdate;\n\n if (empty(get_config('attendance', 'enablecalendar'))) {\n // Calendar events are not used.\n return true;\n }\n\n // Should there even be an event?\n if ($session->calendarevent == 0) {\n if ($session->caleventid != 0) {\n // There is an existing event we should delete, calendarevent just got turned off.\n $DB->delete_records_list('event', 'id', array($caleventid));\n $session->caleventid = 0;\n $DB->update_record('attendance_sessions', $session);\n return true;\n } else {\n // This should be the common case when session does not want event.\n return true;\n }\n }\n\n // Do we need new event (calendarevent option has just been turned on)?\n if ($session->caleventid == 0) {\n return attendance_create_calendar_event($session);\n }\n\n // Boring update.\n $caleventdata = new stdClass();\n $caleventdata->timeduration = $timeduration;\n $caleventdata->timestart = $timestart;\n $caleventdata->timemodified = time();\n $caleventdata->description = $session->description;\n\n $calendarevent = calendar_event::load($caleventid);\n if ($calendarevent) {\n return $calendarevent->update($caleventdata) ? true : false;\n } else {\n return false;\n }\n}",
"public function save()\n {\n $db = $this->getDB();\n if (empty($this->id)) {\n $new_key = TRUE;\n } else {\n $new_key = FALSE;\n }\n\n $result = $db->saveObject($this);\n if (PHPWS_Error::isError($result)) {\n return false;\n } else {\n if (!PHPWS_DB::isTable($this->getEventTable())) {\n $result = $this->createEventTable();\n if (PHPWS_Error::isError($result)) {\n $this->delete();\n return $result;\n }\n }\n\n $result = $this->saveKey();\n if (PHPWS_Error::isError($result)) {\n $this->delete();\n return $result;\n }\n\n if ($new_key) {\n $db->saveObject($this);\n }\n\n return true;\n }\n }",
"function update_event($event_data, $location_data, $tag_data, $group_data) {\n\t\t//Check if location is in database\n\t\t$this->db->start_cache();\n\t\t$this->db->where('address_one', $location_data['address_one']);\n\t\t$this->db->where('address_two', $location_data['address_two']);\n\t\t$this->db->where('zipcode', $location_data['zipcode']);\n\t\t$loc_query = $this->db->get('location');\n\t\t$this->db->stop_cache();\n\t\t$this->db->flush_cache();\n\n\t\t//If location isnt in database yet\n\t\tif ($loc_query->num_rows() == 0){\n\t\t\t//get geocode from google if not in db\n\t\t\t$geocode = $this->getGeo(\n\t\t\t\t$location_data['address_one'] . \" \" .\n\t\t\t\t$location_data['address_two'] . \" \".\n\t\t\t\t$location_data['zipcode']\n\t\t\t\t);\n\t\t\tif (isset($geocode) && $geocode) {\n\t\t\t\t//add geocodes to address before insert\n\t\t\t\t$location_data['geolat'] = $geocode['lat'];\n\t\t\t\t$location_data['geolng'] = $geocode['lng'];\n\t\t\t\t$location_data['city'] = $geocode['city'];\n\t\t\t\t$location_data['state'] = $geocode['state'];\n\t\t\t\t//new location in db\n\t\t\t\t$location_success = $this->db->insert('location', $location_data);\n\t\t\t\t$location_id = $this->db->insert_id();\n\t\t\t} \n\t\t} else { //old location\n\t\t\t$locResult = $loc_query->result();\n\t\t\t$location_id = $locResult[0]->location_id;\n\t\t\t$location_success = true;\n\t\t}\n\t\t// Check that we have a valid location before updating db\n\t\tif ($location_success) {\n\t\t\t// Get the event ID for this event\n\t\t\t$event_id = $event_data['event_id'];\n\n\t\t\t// update the event table with current data\n\t\t\t$this->db->where('event_id',$event_id);\n\t\t\t$event_success = $this->db->update('event',$event_data);\n\n\t\t\t//event_location\n\t\t\t$event_location_success = $this->db->query('UPDATE event_location\n\t\t\t\t\t\t\t\tSET location_id = '.$location_id.'\n\t\t\t\t\t\t\t\tWHERE event_id = \"'.$event_id.'\"');\n\n\t\t\t// Get the tag ID\n\t\t\t$this->db->like('tag_title', $tag_data['tag_title']);\n\t\t\t$query = $this->db->get('tag');\n\t\t\t$tag_id_array = $query->result();\n\t\t\t$tag_id = $tag_id_array[0]->tag_id;\n\t\t\t$event_tag_success = $this->db->query('UPDATE event_tag\n\t\t\t\t\t\t\t\tSET tag_id = '.$tag_id.'\n\t\t\t\t\t\t\t\tWHERE event_id = \"'.$event_id.'\"');\n\t\t\t\n\t\t\t// organization_event\n\t\t\t$this->db->where('event_id', $event_id);\n\t\t\t$org_event_query = $this->db->get('organization_event');\n\t\t\tif ($org_event_query->num_rows() == 0 && is_numeric($group_data['org_id'])) {\n\t\t\t\t$group_success = $this->db->insert('organization_event', $group_data);\n\t\t\t} else {\n\t\t\t\tif (is_numeric($group_data['org_id'])) {\n\t\t\t\t\t$group_success = $this->db->query('UPDATE organization_event\n\t\t\t\t\t\t\t\t\tSET org_id = '.$group_data['org_id'].'\n\t\t\t\t\t\t\t\t\tWHERE event_id = \"'.$event_id.'\"');\n\t\t\t\t} else {\n\t\t\t\t\t$this->db->where('event_id', $event_id);\n\t\t\t\t\t$this->db->delete('organization_event');\n\t\t\t\t\t$group_success = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// return true only if all updates were successful\n\t\t\treturn ($event_success &&\n\t\t\t\t$event_location_success &&\n\t\t\t\t$event_tag_success &&\n\t\t\t\t$group_success);\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}",
"public function update(): bool\n {\n $attribute_pairs = [];\n\n /* Create the prepared statement string */\n foreach (static::$params as $key => $value)\n {\n if($key === 'id') { continue; } // Don't include the id:\n $attribute_pairs[] = \"{$key}=:{$key}\"; // Assign it to an array:\n }\n\n /*\n * The query/sql implodes the prepared statement array in the proper format\n * and I also hard code the date_updated column as I practically use that for\n * all my database table. Though I think you could override that in the child\n * class if you needed too.\n */\n $sql = 'UPDATE ' . static::$table . ' SET ';\n $sql .= implode(\", \", $attribute_pairs) . ', play_date=NOW() WHERE id =:id';\n\n /* Normally in two lines, but you can daisy chain pdo method calls */\n Database::pdo()->prepare($sql)->execute(static::$params);\n\n return true;\n\n }",
"public function test_database_events_check()\n {\n $this->seeInDatabase('events', ['event_name' => 'Test Event1']);\n }",
"protected function performPostUpdateCallback()\n {\n // echo 'updated a record ...';\n return true;\n }",
"public function updateEventData($data, $event_id, $main_organizers, $impl_partners) {\r\n$this->db->where('event_id', $event_id);\r\n$success = $this->db->update('events', $data);\r\nif ($success == 1) {\r\nif (count($main_organizers) > 0) {\r\n$this->saveMainOrganizer($event_id, $main_organizers);\r\n}\r\nif (count($impl_partners) > 0) {\r\n$this->saveImplPartners($event_id, $impl_partners);\r\n}\r\n}\r\nreturn $success;\r\n}",
"function updateAttendee($eventID, $userID, $status)\r\r\n\t{\r\r\n\t\t// update the following fields in the database:\r\r\n\t\t$result = mysql_query(\"UPDATE eventAttendees SET status = '\".$status.\"' WHERE userID = '\".$userID.\"' AND eventID = '\".$eventID.\"'\");\r\r\n\t\t\r\r\n\t\tif (!$result) \r\r\n\t\t{\r\r\n\t\t\tthrow new Exception('Could not update event with eventID = $eventID.');\r\r\n\t\t}\t\t\r\r\n\t\treturn true;\r\r\n\t}",
"public function test_update() {\n global $DB;\n\n self::setAdminUser();\n $this->resetAfterTest(true);\n\n // Save new outage.\n $now = time();\n $outage = new outage([\n 'autostart' => false,\n 'warntime' => $now - 60,\n 'starttime' => 60,\n 'stoptime' => 120,\n 'title' => 'Title',\n 'description' => 'Description',\n ]);\n $outage->id = outagedb::save($outage);\n self::$outage = $outage;\n\n self::$outage->starttime += 10;\n outagedb::save(self::$outage);\n\n // Should still exist.\n $event = $DB->get_record_select(\n 'event',\n \"(eventtype = 'auth_outage' AND instance = :idoutage)\",\n ['idoutage' => self::$outage->id],\n 'id',\n IGNORE_MISSING\n );\n self::assertTrue(is_object($event));\n self::assertSame(self::$event->id, $event->id);\n self::$event = $event;\n }",
"public function save() {\n $db = Db::instance();\n // omit id and any timestamps\n $db_properties = array(\n 'event_type_id' => $this->event_type_id,\n 'user_1_id' => $this->user_1_id,\n 'user_2_id' => $this->user_2_id,\n 'user_1_name' => $this->user_1_name,\n 'user_2_name' => $this->user_2_name,\n 'product_1_name' => $this->product_1_name,\n 'product_2_name' => $this->product_2_name,\n 'data_1' => $this->data_1,\n 'data_2' => $this->data_2\n );\n $db->store($this, __CLASS__, self::DB_TABLE, $db_properties);\n }",
"public function update_INVOICE_Change_Status_Completed(){\n $this->update_INVOICE_Change_Status_Ongoing();\n $dateToday=date_default_timezone_set(\"Y-m-d\");\n $strInsertQry=\"update sidhus_invoice set Status='Completed Events' where sidhus_invoice.eventDate < '\".$dateToday.\"'\";\n // $stmt = $this->con->prepare($strInsertQry);\n // $stmt->bind_param(\"sssssssssssiisssssiiiii\",$cust_fullname,$cust_address,$theme_name,$color_combo,$cust_mobileno,$cust_alternate_mobileno,$cust_emailId,$event_address,$event_pincode,$event_location,$event_landmark,$event_id,$subcat_id,$venue_type,$eventDate,$eventTime,$concept_type,$notes_or_Remarks,$transportation_Rate,$Tax_percentage,$Advance,$Total,$invoice_no);\n//return $strInsertQry;\n $stmt = $this->con->prepare($strInsertQry);\n // $stmt->bind_param(\"ss\", $newpassword, $username);\n $result = $stmt->execute();\n $stmt->close();\n return $result;// $num_affected_rows>=0;\n\n }",
"public function saveEvent($info = [], $new = true)\n {\n // If we're about to update an existing record,\n // make sure we have its ID before continuing.\n if (!$new)\n {\n if (array_key_exists('id_event', $info))\n {\n $id_event = intval($info['id_event']);\n unset($info['id_event']);\n }\n else\n {\n return false;\n }\n }\n\n // Remove any non-existing columns\n $dbValues = [];\n\n $columns = DBUtil::columns('events');\n foreach ($columns as $column)\n {\n if (isset($info[$column])) $dbValues[$column] = $info[$column];\n }\n\n // Are we talking about a new record?\n if ($new)\n {\n DB::table('events')\n ->insert($dbValues);\n }\n // If not, update the existing record.\n else\n {\n DB::table('events')\n ->where('id_event', '=', $id_event)\n ->update($dbValues);\n }\n\n return true;\n }",
"function dltUpdtEvent($eid){\r\n\t\tif(!$this->DBLogin()){\r\n\t\t\t$this->HandleError(\"Database login failed!\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\t$uUserName = $this->UsrName();\r\n\t\t\r\n\t\t$dltUpdtQuery = \"UPDATE \" . $this->tablename2 . \r\n\t\t\" SET Edisplay = 0 \" . \r\n\t\t\" WHERE Eid = \" . $eid . \r\n\t\t\" AND UuserName = '\" . $uUserName . \"';\";\r\n\t\t\r\n\t\tif(!mysql_query($dltUpdtQuery, $this->connection)){\r\n\t\t\t$this->HandleDBError(\"Error updating data.\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\treturn true;\r\n\t}",
"function update_event($event_id,$event_title,$event_des,$event_place,$event_date,$event_detail){\n\tmysql_query(\"UPDATE `events` SET `event_title` = '$event_title' , `event_des` = '$event_des' , `event_place` = '$event_place' , `event_date` = '$event_date' , `event_detail` = '$event_detail' WHERE `event_id` = $event_id\");\n}",
"public function commitEvents();",
"public function updateDB()\n {\n\n }",
"public function updateEvent($id, $eventData){\n\t\t$this->db->where('id', $id);\n\t\treturn $this->db->update('event', $eventData); \n\t}",
"public function saveEvent($post){\n\n\t\tif (! $ctime = strtotime($post['datetime']) ){\n\t\t\techo \"<script>\n\t\t\t\talert('Date ${post['datetime']} not recognized');\n\t\t\t\thistory.back();\n\t\t\t\t</script>\n\t\t\t\";\n\t\t}\n\t\tif ($ctime < time()){\n\t\t\techo \"<script>\n\t\t\t\talert('You cannot enter an event for a past date');\n\t\t\t\thistory.back();\n\t\t\t\t</script>\n\t\t\t\";\n\t\t}\n\t\t$post['datetime'] = date('Y-m-d g:i a', $ctime);\n\n\t\t$id = $post['id'];\n\t\tforeach ($post as $var => $val) {\n\t\t\t$despec[$var] = $val;\n\t\t}\n\n\t\t$prep = u\\prepPDO($despec,array_keys(self::$empty_item),'id');\n\t\t if ($despec['id'] == 0){ #new entry\n\n\t\t\t$sql = \"INSERT into `events` ( ${prep['ifields']} ) VALUES ( ${prep['ivalues']} );\";\n\t\t\t//u\\echor($prep,$sql);\n\t\t\t $stmt = $this->pdo->prepare($sql);\n\n\t\t\t $stmt->execute($prep['idata']);\n\t\t\t $new_id = $this->pdo->lastInsertId();\n\n\t\t} else { #update\n\t\t\t$prep = u\\prepPDO($despec,array_keys(self::$empty_item),'id');\n\t\t\t$sql = \"UPDATE `events` SET ${prep['uset']} WHERE id = ${prep['ukey']};\";\n\t\t\t//\tu\\echor($prep,$sql);\n\t\t\t $stmt = $this->pdo->prepare($sql);\n\n\t\t\t $stmt->execute($prep['udata']);\n\t\t\t$new_id = $id;\n\t\t}\n\t\treturn $new_id;\n}",
"private function saveChanges(\n Oxy_EventStore_Event_StorableEventsCollectionInterface $events, \n Oxy_Guid $guid\n )\n {\n try{\n $collection = $this->_db->selectCollection('events');\n $aggregateCollection = $this->_db->selectCollection('aggregates');\n\n // Add new events\n foreach ($events as $storableEvent) {\n $eventInstance = $storableEvent->getEvent();\n if(!$eventInstance instanceof Oxy_EventStore_Event_ArrayableInterface){\n throw new Oxy_EventStore_Storage_Exception(\n sprintf('Event must implement Oxy_EventStore_Event_ArrayableInterface interface')\n ); \n }\n $event = (object)$eventInstance->toArray();\n \n if((string)$storableEvent->getProviderGuid() === (string)$guid){\n $data = array(\n 'd' => date('Y-m-d H:i:s'),\n 'ag' => (string)$guid,\n 'e' => $event,\n 'ec' => (string)get_class($eventInstance)\n );\n } else {\n $data = array(\n 'd' => date('Y-m-d H:i:s'),\n 'ag' => (string)$guid,\n 'eg' => (string)$storableEvent->getProviderGuid(),\n 'e' => $event,\n 'ec' => (string)get_class($eventInstance)\n );\n }\n $collection->insert($data, array(\"safe\" => true));\n }\n return true;\n } catch(MongoCursorException $ex){\n return false;\n } catch(MongoConnectionException $ex){\n return false;\n } catch(MongoCursorTimeoutException $ex){\n return false;\n } catch(MongoGridFSException $ex){\n return false;\n } catch(MongoException $ex){\n return false;\n } catch (Exception $ex){\n return false;\n } \n \n return false;\n }",
"public function updateAdmin()\r\n\t{\r\n\t\t// Donnees\r\n\t\t$eventId = Bn::getValue('event_id');\r\n\t\t$oEvent = new Oevent($eventId);\r\n\t\t// Controle de l'autorisation\r\n\t\tif ( $oEvent->getVal('ownerid') != Bn::getValue('user_id') && !Oaccount::isLoginAdmin() ) return false;\r\n\r\n\t\t// Donnees du tournoi\r\n\t\t$oEvent->setVal('name', Bn::getValue('nameevent'));\r\n\t\t$oEvent->setVal('date', Bn::getValue('dateevent'));\r\n\t\t$oEvent->setVal('organizer', Bn::getValue('organizer'));\r\n\t\t$oEvent->setVal('place', Bn::getValue('place'));\r\n\t\t$oEvent->setVal('numauto', Bn::getValue('numauto'));\r\n\t\t$oEvent->setVal('firstday', Bn::getValue('firstday'));\r\n\t\t$oEvent->setVal('lastday', Bn::getValue('lastday'));\r\n\t\t$season = Oseason::getSeason(Bn::getValue('firstday'));\r\n\t\t$oEvent->setVal('season', $season);\r\n\t\t$oEvent->save();\t\t\r\n\r\n\t\t$oExtras = new Oeventextra($eventId);\r\n\t\t$oExtras->setVal('regionid', Bn::getValue('regionid'));\r\n\t\t$oExtras->setVal('deptid', Bn::getValue('deptid'));\r\n\t\t$oExtras->save();\r\n\r\n\t\t// Message de fin\r\n\t\t// Preparer les champs de saisie\r\n\t\t$body = new Body();\r\n\t\t$body->addWarning(LOC_LABEL_PREF_REGISTERED);\r\n\t\t$d = $body->addDiv('', 'bn-div-btn');\r\n\t\t$d->addButtonCancel('btnCancel', LOC_BTN_CLOSE);\r\n\r\n\t\t// Envoi au navigateur\r\n\t\t$res = array('content' => $body->toHtml(),\r\n\t\t\t\t\t'title' => LOC_ITEM_GENERAL);\r\n\t\techo Bn::toJson($res);\r\n\t\treturn false;\r\n\t}",
"public function update(){\n\n $sql = 'UPDATE fullorder SET ';\n $sql .= 'Status = \"' . $this->__get('Status') . '\"';\n if ($this->__get('Status') == 'Delivered') {\n $date = date('Y-m-d');\n $time = $date . '' . time();\n $sql .= ', OrderDeliverTime = NOW() ';\n }\n $sql .= 'WHERE OrderID =' . $this->__get('OrderID');\n $con = $this->openconnection();\n $stmt = $con->prepare($sql);\n $stmt = $stmt->execute(); \n $con = null;\n if(!$stmt){\n //echo \"FROM MODEL <br>\";\n return false;\n } else {\n //echo \"FROM MODELllll true<br>\" . $lastId;\n return true;\n \n }\n }",
"public function update() \n\t{\n\t\ttry \n\t\t{\n\t\t\t// select mongoDB collection\n\t\t\t$app_collection = $this->mongo_db->db->func;\n\t\t\t// preparing data\n\t\t\t$prepare_data \t= array(\n\t\t\t\t'function_name' \t=> $this->function_name, \n\t\t\t\t'function_token' \t=> $this->function_token, \n\t\t\t\t'function_token' \t=> $this->function_token, \n\t\t\t\t'application_id' \t=> $this->application_id, \n\t\t\t\t'application_name' \t=> $this->application_name, \n\t\t\t\t'function_primary' \t=> $this->function_primary\n\t\t\t\t);\n\t\t\t// update to database\n\t\t\t$app_collection->update(array(\n\t\t\t\t'_id' => new MongoId($this->_id)\n\t\t\t\t),$prepare_data);\n\t\t\treturn true;\t\t\t\n\t\t}\n\t\tcatch (Exception $e) \n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}",
"public function commitUpdate();",
"public function executeUpdate(): bool\n {\n $this->updateDaysallowedField();\n return true;\n }",
"protected function saveUpdate()\n {\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}",
"public function markUserAsUpdated(): bool\n {\n return $this->fill([$this->UPDATECOLUMN, Chronos::date()->stamp()])\n ->save();\n }",
"public function update($event_info = null)\n {\n echo \"观察者1 收到消息,执行完毕!\";\n }",
"protected function will_change_to_db(){\n\t\t$pdo = DB::connection( $this->get_database_name() )->getPdo();\n\t\t$pdo->beginTransaction();\n\t\t//DB::beginTransaction();\n\t\t$status = false;\n\t\ttry {\n\t\t\t//! for saving\n\t\t\tforeach( $this->get_obj_save_db() as $obj){\n\t\t\t\tif($obj == null) {\n\t\t\t\t\tthrow new Exception(\"There are non object\");\n\t\t\t\t}\n\t\t\t\t$obj->save();\n\t\t\t}\n\t\t\tforeach( $this->get_obj_dele_db() as $obj){\n\t\t\t\tif($obj == null) {\n\t\t\t\t\tthrow new Exception(\"There are non object\");\n\t\t\t\t}\n\t\t\t\t$obj->delete();\n\t\t\t}\t\t \n\t\t //DB::commit();\n\t\t\t$pdo->commit();\n\t\t\t$status = true;\n\t\t // all good\n\t\t}\n\t\tcatch (\\Exception $e) {\n\t\t\t$this->set_pdo_exception($e);\n\t\t\t$this->set_error_message($e->getMessage()) ;\n\t\t //DB::rollback();\n\t\t\t$pdo->rollback();\n\t\t}\n\t\treturn $status;\n\t}",
"public function isUpdated() {}",
"public function postEventedit();",
"public function modifyRecords(){\n \n // Get the sql statement\n $sql = $this->updateSql();\n // Prepare the query\n $stmt = $this->db->prepare($sql);\n\n foreach ($this->requestUpdateValues as $key => $value) {\n $stmt->bindParam($this->params['columnName_Pdo'][$key], $this->requestUpdateValues[$key]);\n }\n \n $stmt->execute();\n \n return true;\n \n }",
"public static function onUpdateEvent($param)\n {\n try\n {\n if (isset($param['id']))\n {\n // get the parameter $key\n $key=$param['id'];\n \n // open a transaction with database 'samples'\n TTransaction::open('samples');\n \n // instantiates object CalendarEvent\n $object = new CalendarEvent($key);\n $object->start_time = str_replace('T', ' ', $param['start_time']);\n $object->end_time = str_replace('T', ' ', $param['end_time']);\n $object->store();\n \n // close the transaction\n TTransaction::close();\n }\n }\n catch (Exception $e) // in case of exception\n {\n new TMessage('error', $e->getMessage());\n TTransaction::rollback();\n }\n }",
"static public function update_event($sushi_id, $user_id, $event_time)\n {\n # return 1 if this is new event. 0 if not.\n # update sushi memory table accordingly.\n $sushi_id = intval($sushi_id);\n $user_id = intval($user_id);\n $event_time = intval($event_time);\n $sql = \"insert into sushi_update_time (phantom_user_id, sushi_id, update_event_time) values (${user_id}, ${sushi_id}, ${event_time}) on duplicate key update update_event_time = if(update_event_time > values(update_event_time), update_event_time, values(update_event_time))\";\n\n $res = mysql_query($sql);\n if (!$res) return 0;\n \n if (mysql_affected_rows() == 0) {\n # no row updated. must be old\n return 0;\n } else {\n # new\n return 1;\n }\n }",
"function update_events ($eID, &$set_arr) {\n\t// Initialize variables\n\t$errArr=init_errArr(__FUNCTION__);\n\t// Construct passing parameters \n\t$table_name = \"events\";\n\t$key_arr = array();\n\t$key_1 = \"eID\"; // this is key column from events table\n\t$key_arr [$key_1] = $eID; // set up value to the key\n\t\n\t// call the universal function to do the update\n\t$errArr = update_any_table($table_name, $key_arr, $set_arr) ;\n\t\t\n\treturn $errArr;\n}",
"public function updateStudentInfoIntoEventTable(){\n\n if($this->databaseConnection()){\n $name = $_POST[\"updateEname\"];\n $collegeName = $_POST[\"updateCname\"];\n // $mobile = $_POST[\"updateEmobile\"];\n //$email = $_POST[\"updateEemail\"];\n //$note = $_POST[\"updateEenote\"];\n //$cost = $_POST[\"updateEcost\"];\n $eid = $_POST[\"updateEnumber\"];\n // Now update events \n\n $mobile = isset($_POST['updateEmobile']) ? $_POST['updateEmobile'] :NULL;\n $email = isset($_POST['updateEemail']) ? $_POST['updateEemail'] :NULL;\n // Calculate the new cost\n $event1 = isset($_POST['updateEvent1']) ? $_POST['updateEvent1'] :0;\n $event2 = isset($_POST['updateEvent2']) ? $_POST['updateEvent2'] :0;\n $event3 = isset($_POST['updateEvent3']) ? $_POST['updateEvent3'] :0;\n $event4 = isset($_POST['updateEvent4']) ? $_POST['updateEvent4'] :0;\n $event5 = isset($_POST['updateEvent5']) ? $_POST['updateEvent5'] :0;\n $event6 = isset($_POST['updateEvent6']) ? $_POST['updateEvent6'] :0;\n $event7 = isset($_POST['updateEvent7']) ? $_POST['updateEvent7'] :0;\n $event8 = isset($_POST['updateEvent8']) ? $_POST['updateEvent8'] :0;\n $note = isset($_POST['updateEenote']) ? $_POST['updateEenote'] :NULL; \n if($event5 == 1){\n if($note == 1){\n $event5 = 1;\n } \n if($note == 2){\n $event5 = 2;\n } \n }\n $cost = $this->calculateEventCost($event1 , $event2 , $event3 , $event4 , $event5 , $event6 , $event7 , $event8 );//500;//$_POST[\"ecost\"];\n \n \n\n $query = $this->db_connection->prepare('UPDATE events SET ename =:ename , \n emobile =:emobile , eemail=:eemail,ecost=:ecost, ecollege = :ecollege,\n event1 =:event1,event2 =:event2, event3 =:event3, event4 =:event4, \n event5 =:event5, event6 =:event6, event7 =:event7, event8 =:event8,\n note =:note \n where eid =:eid');\n $query->bindValue(':eid', $eid ,PDO::PARAM_INT);\n $query->bindValue(':ename', $name ,PDO::PARAM_STR);\n $query->bindValue(':emobile', $mobile ,PDO::PARAM_STR);\n $query->bindValue(':eemail', $email ,PDO::PARAM_STR);\n $query->bindValue(':ecost', $cost ,PDO::PARAM_INT);\n $query->bindValue(':ecollege', $collegeName ,PDO::PARAM_STR);\n $query->bindValue(':event1', $event1 ,PDO::PARAM_STR);\n $query->bindValue(':event2', $event2 ,PDO::PARAM_STR);\n $query->bindValue(':event3', $event3 ,PDO::PARAM_STR);\n $query->bindValue(':event4', $event4 ,PDO::PARAM_STR);\n $query->bindValue(':event5', $event5 ,PDO::PARAM_STR);\n $query->bindValue(':event6', $event6 ,PDO::PARAM_STR);\n $query->bindValue(':event7', $event7 ,PDO::PARAM_STR);\n $query->bindValue(':event8', $event8 ,PDO::PARAM_STR);\n $query->bindValue(':note', $note ,PDO::PARAM_STR);\n $query->execute();\n //Return ack to display that we have updated the user \n }\n }",
"public function updateEvent($id)\n {\n $id = (int)$id;\n $this->checkID($id);\n\n if ($this->input->post('start') === null) {\n $response = array(\"status\" => false, \"message\" => 'Please provide necessary data.');\n\n $this->send(400, $response);\n }\n\n $reqData = array(\n 'start' => $this->input->post('start'),\n 'id' => $id,\n 'updated_by' => $this->session->get('username'),\n 'course_desc' => $this->input->post('courseDesc'),\n 'certified_by' => $this->input->post('certifiedBy'),\n 'all_day_event' => (int)$this->input->post('allday'),\n 'end' => $this->input->post('end'),\n );\n\n $updated = $this->model->updateEvent($reqData);\n if ($updated === true) {\n $response = array(\"status\" => true, \"message\" => 'Event updated.');\n $this->send(200, $response);\n } else {\n $response = array(\"status\" => false, \"message\" => 'Event not updated.');\n $this->send(500, $response);\n }\n }",
"public function updateEvent($userid) \n {\n try {\n $db = new Database();\n $this->database = $db->connect();\n \n $type = QR_CODE_TYPE_EVENT;\n $event_id = $this->getEventId();\n $event_code = $this->getEventCode();\n $event_name = $this->getEventName();\n $event_descr = $this->getEventDescr();\n \n $sql = \"UPDATE hash SET Name = :name, Descr = :descr WHERE OwnerId = :userid AND Id = :eventid AND Hash = :hash AND Type = :type\";\n \n $stmt = $this->database->prepare($sql);\n \n $stmt->bindParam(\":userid\", $userid);\n $stmt->bindParam(\":eventid\", $event_id);\n $stmt->bindParam(\":type\", $type);\n $stmt->bindParam(\":hash\", $event_code);\n $stmt->bindParam(\":name\", $event_name);\n $stmt->bindParam(\":descr\", $event_descr);\n \n $stmt->execute();\n \n // $stmt->debugDumpParams(); //debug\n \n } catch (Exception $e) {\n $this->throwException(DATABASE_ERROR, $e);\n }\n return true;\n }",
"public function save() {\n\t\tglobal $wpdb;\n\n\t\t$defaults = array(\n\t\t\t\t'id' => null,\n\t\t\t\t'slug' => null,\n\t\t\t\t'payload' => null,\n\t\t\t\t'remote_host' => null,\n\t\t\t\t'remote_ip' => null,\n\t\t\t\t'timestamp' => date( \"Y-m-d H:i:s\" ),\n\t\t\t);\n\t\t$data = array_merge( $defaults, (array)$this->data );\n\n\t\tif ( empty( $data['slug'] ) )\n\t\t\treturn new WP_Error( 'invalid-arguments', \"'slug' is a required argument.\" );\n\n\t\tif ( ! empty( $data['remote_ip'] ) )\n\t\t\t$data['remote_ip'] = ip2long( $data['remote_ip'] );\n\n\t\tif ( empty( $data['id'] ) ) {\n\t\t\tunset( $data['id'] );\n\t\t\t$ret = $wpdb->insert( $wpdb->notify_events, $data );\n\t\t\t$data['id'] = (int) $wpdb->insert_id;\n\t\t} else {\n\t\t\t$ret = $wpdb->update( $wpdb->notify_events, $data, array( 'id' => $data['id'] ) );\n\t\t}\n\n\t\tif ( ! empty( $data['remote_ip'] ) )\n\t\t\t$data['remote_ip'] = long2ip( $data['remote_ip'] );\n\n\t\tif ( $ret ) {\n\t\t\t$this->data = (object)$data;\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn new WP_Error( 'mysql-failure', \"Couldn't insert/update event into database.\" );\n\t\t}\n\t}",
"public function onUpdateRecord()\n {\n $this->updated = new \\DateTime();\n $this->rev++;\n }",
"public function hasUpdate();",
"public function it_stores_events_raised_by_our_jas_app() : void\n {\n $id = '8741e80e-153f-4254-b13e-21ac8ac34948';\n $this->json('POST', '/store-jas-events', [\n 'id' => $id,\n 'name' => 'GameStarted',\n 'date' => 1_503_301_742_819,\n 'payload' => [\n 'game_id' => 'hoi'\n ]\n ])->seeJson([\n 'created' => true\n ]);\n\n $this->seeInDatabase('jas_events', [\n 'uuid' => $id,\n 'name' => 'GameStarted',\n 'date' => 1_503_301_742_819,\n ]);\n }",
"function update_event_status($event_id,$event_status)\n {\n if($event_status==0)\n {\n $new_stat=\"1\";\n }\n elseif($event_status==1)\n {\n $new_stat=\"0\";\n }\n $query = $this->db->query(\"UPDATE tbl_events SET event_status = '$new_stat' WHERE event_id='$event_id'\");\n //echo $this->db->last_query();\n }",
"function storeEventDetail() // OK\n {\n $dt = $this->_eventDetail->getEventDetail(); \t \n $sql = \"INSERT INTO events\n ( event_id, \n event_type, \n event_date, \n user_id, \n company)\n VALUES ( '{$this->_eventId}',\n '{$this->_eventType}',\n to_date('{$dt['CURRENT_DATE']}', 'MM/DD/YYYY HH24:MI:SS'),\n '{$dt['USER_ID']}',\n '{$dt['COMPANY']}'\n )\";\n if (! db_execute($sql))\n {\n $this->_errors->addError('Error inserting master event record.');\n return false;\n }\n return true;\n }",
"public function commitUpdate(): bool\n {\n if (isset(self::$handler)) {\n return call_user_func(self::$handler, $this->getSubject(), $this->getName());\n } else {\n return false;\n }\n }",
"public function change_event()\r\n\t{\r\n\t\t// get post data\r\n\t\t$data['post'] = $this->input->post();\r\n\t\t// update db\r\n\t\t$this->caifmodel->edit_event($data['post']);\t\r\n\t\t// redirect\r\n\t\tredirect(base_url().'events','location');\r\n\t}",
"function addEvent($date,$title,$user_id,$fname,$address,$contact,$email,$location,$vlocation,$hour,$minutes,$choice,$tier,$flavor,$info,$confirmation){\r\n\t//Include db configuration file\r\n\tinclude 'dbConfig.php';\r\n\t$currentDate = date(\"Y-m-d H:i:s\");\r\n\t//Insert the event data into database\r\n\t$insert = $db->query(\"INSERT INTO cakemaker (title,date,created,modified,user_id,fname,address,contact,email,location,vlocation,hour,minutes,choice,tier,flavor,info,confirmation) VALUES ('\".$title.\"','\".$date.\"','\".$currentDate.\"','\".$currentDate.\"','\".$user_id.\"','\".$fname.\"','\".$address.\"','\".$contact.\"','\".$email.\"','\".$location.\"','\".$vlocation.\"','\".$hour.\"','\".$minutes.\"','\".$choice.\"','\".$tier.\"','\".$flavor.\"','\".$info.\"','\".$confirmation.\"')\");\r\n\tif($insert){\r\n\t\techo 'ok';\r\n\t}else{\r\n\t\techo 'err';\r\n\t}\r\n}",
"public function enableEvent($id, $eventData){\n\t\t$this->db->where('id', $id);\n\t\treturn $this->db->update('event', $eventData); \n\t}",
"function class_update($id) {\n\t// event_id event_date event_begin_time event_end_time event_name event_space event_signed_up \n\t\n\t$data = file_get_contents('events.json');\n\t$event_data = json_decode($data);\n\n\t// returns the row with the original index. Not a new row that would have an index of 0\n\t$event_data_row = array_filter($event_data, function($arr) { global $id; return $arr->event_id == $id;});\n\t\n\t$update_arr = array(\n\t'event_id' => $id,\n\t'event_date' => $_POST['date'],\n\t'event_begin_time' => $_POST['start_time'],\n\t'event_end_time' => $_POST['end_time'],\n\t'event_name' => $_POST['description'],\n\t'event_space' => $_POST['class_size'],\n\t'event_signed_up' => $event_data[key($event_data_row)]->event_signed_up\n\t);\n\t\n\t$event_data[key($event_data_row)] = $update_arr;\n\t$data = json_encode($event_data, JSON_PRETTY_PRINT);\n\t\n\tfile_put_contents('events.json', $data);\n\t\n\theader('Location:admin.php?admin_event_list');\n\t\n}",
"public function updateData()\n {\n try {\n// echo \"<pre>\";\n// print_r($this->where);\n// print_r($this->insertUpdateArray);\n// exit;\n DB::table($this->dbTable)\n ->where($this->where)\n ->update($this->insertUpdateArray);\n } catch (Exception $ex) {\n throw new Exception($ex->getMessage(), 10024, $ex);\n }\n }",
"function set_EventGoing($EventID) {\r\n $going = $this->get_EventStatusGoing($EventID);\r\n if (count($going) == 0) {\r\n $sql = $this->db->prepare(\"CALL SPsetEventGoing(:event, :user);\");\r\n $result = $sql->execute(array(\r\n \"event\" => $EventID,\r\n \"user\" => $_SESSION['userid']\r\n ));\r\n if ($result)\r\n return true;\r\n else\r\n return false;\r\n }\r\n }",
"private function update($eventid,$title, $venue,$privacy,$email,$password)\n {\n $response =array();\n $response[\"success\"]=0;\n \n //check if the user is valid\n $tryLoginUser= new TryUserLogin($email,$password);\n if($tryLoginUser->isExists())\n {\n //get the current event if exist\n $event = TryFetchUserEvent::FetchById($eventid);\n if($event!=null){\n \n //set the event properties to the new added informations\n $eventObject= $this->parserEventJson(json_encode($event));\n if($eventObject!=null){\n \n $eventObject->setTitle($title);\n $eventObject->setId($eventid);\n $eventObject->setVenue($venue); \n $eventObject->setType($privacy); \n \n //validate to match such the date send is current\n if($this->validateEvent($eventObject))\n {\n //update the vent\n $tryUpdateEvent = new TryUpdateUserEvent($eventObject);\n $status= $tryUpdateEvent->update();\n if($status){\n $response[\"success\"]=1;\n $response[\"message\"]=\"Event Updated\";\n \n }else{\n $response[\"message\"]=\"There was error when trying to update event\";\n }\n }else{\n $response[\"error_message\"]=$this->__message; \n } \n }\n \n }else{\n $response[\"error_message\"]=\"Know event with the given information\"; \n } \n //exist\n\n }else{\n $response[\"error_message\"]=\"Unknown user request...\";\n }\n \n \n $jsonView = new JsonViewer();\n $jsonView->setContent($response);\n return $jsonView;\n }",
"public function update_in_db(Client $db ): bool {\n\n\t\treturn true;\n\t}",
"function update_automotive_entry($service, $Submission) {\r\n\r\n $conn = db_connect();\r\n\r\n\r\n\r\n // insert new log entry\r\n $query = \"update AUTOMOTIVE\r\n set Submission='\".$Submission.\"'\r\n where service='\".$service.\"'\";\r\n\r\n\r\n $result = $conn->query($query);\r\n if (!$result) {\r\n return false;\r\n } else {\r\n return true;\r\n }\r\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 }",
"protected function update() {}",
"function addEventToDB() {\r\n\r\n\tglobal $MySelf;\r\n\tglobal $DB;\r\n\r\n\t// is the events module active?\r\n\tif (!getConfig(\"events\")) {\r\n\t\tmakeNotice(\"The admin has deactivated the events module.\", \"warning\", \"Module not active\");\r\n\t}\r\n\t\r\n\t// Are we allowed to add Events?\r\n\tif (!$MySelf->canEditEvents()) {\r\n\t\tmakeNotice(\"You are not allowed to add events!\", \"error\", \"Forbidden!\");\r\n\t}\r\n\r\n\t// Do we have a short description?\r\n\tif (empty ($_POST[sdescr])) {\r\n\t\tmakeNotice(\"You need to supply a short description!\", \"error\", \"Important field missing!\");\r\n\t}\r\n\r\n\t// Do we have an officer?\r\n\tif (empty ($_POST[officer])) {\r\n\t\tmakeNotice(\"You need to supply who is in command!\", \"error\", \"Important field missing!\");\r\n\t}\r\n\t\r\n\t// Choose which supplied officer we use.\r\n\tif (!empty($_POST[officer2])) {\r\n\t\tsanitize($officer = sanitize($_POST[officer2]));\r\n\t} else {\r\n\t\tsanitize($officer = sanitize($_POST[officer]));\r\n\t}\r\n\t\r\n\t// Choose which system we use.\r\n\tif (!empty($_POST[system2])) {\r\n\t\t$system = strtolower($_POST[system2]);\r\n\t} else {\r\n\t\t$system = strtolower($_POST[system]);\r\n\t}\r\n\t\r\n\t// Check that we still have a valid systemname.\r\n\tif (empty($system)) {\r\n\t\tmakeNotice(\"No valid Systemname found! Please go back, and try again.\", \"warning\", \"No system name\",\r\n\t\t \"index.php?action=addevent\", \"[cancel]\");\r\n\t}\r\n\r\n\t// Do we have an ETD?\r\n\tif (empty ($_POST[dur])) {\r\n\t\tmakeNotice(\"You need to tell me the guessed runtime!\", \"error\", \"Important field missing!\");\r\n\t}\r\n\r\n\t// Collateral?\r\n\tif (!is_numeric($_POST[collateral]) && $_POST[collateral] < 0) {\r\n\t\tmakeNotice(\"You need to supply a valid collateral!\", \"error\", \"Important field missing!\");\r\n\t}\r\n\r\n\t// Do we have an ETD?\r\n\tif ($_POST[payment] < 0) {\r\n\t\tmakeNotice(\"You need to give the folks some money!\", \"error\", \"Important field missing!\");\r\n\t}\r\n\r\n\t// Startting time goodness.\r\n\t$myTime = array (\r\n\t\t\"day\" => \"$_POST[ST_day]\",\r\n\t\t\"month\" => \"$_POST[ST_month]\",\r\n\t\t\"year\" => \"$_POST[ST_year]\",\r\n\t\t\"hour\" => \"$_POST[ST_hour]\",\r\n\t\t\"minute\" => \"$_POST[ST_minute]\",\r\n\t\t\r\n\t);\r\n\t$starttime = humanTime(\"toUnix\", $myTime);\r\n\r\n\t// is the time valid?\r\n\tif (!$starttime) {\r\n\t\tmakeNotice(\"Invalid time supplied!\", \"error\", \"Invalid Time!\");\r\n\t}\r\n\r\n\t// Lets see what ships are required.\r\n\t$SHIPTYPES = array (\r\n\t\t\"shuttles\",\r\n\t\t\"frigates\",\r\n\t\t\"destroyers\",\r\n\t\t\"cruisers\",\r\n\t\t\"bcruiser\",\r\n\t\t\"scruiser\",\r\n\t\t\"bship\",\r\n\t\t\"dread\",\r\n\t\t\"carrier\",\r\n\t\t\"titan\",\r\n\t\t\"barges\",\r\n\t\t\"indies\",\r\n\t\t\"freighter\",\r\n\t\t\"jfreighter\",\r\n\t\t\"exhumer\"\r\n\t);\r\n\tforeach ($SHIPTYPES as $ship) {\r\n\t\tif ($_POST[$ship] == \"on\") {\r\n\t\t\t$wantedships[] = $ship;\r\n\t\t}\r\n\t}\r\n\t$ships = serialize($wantedships);\r\n\r\n\t$p = $DB->query(\"INSERT INTO events (sdesc, officer, system, security, type, starttime, \" .\r\n\t\"duration, difficulty, payment, collateral, notes, ships)\r\n\t values (?,?,?,?,?,?,?,?,?,?,?,?)\", array (\r\n\t\tsanitize($_POST[sdescr]),\r\n\t\t$officer,\r\n\t\t$system,\r\n\t\tsanitize($_POST[security]),\r\n\t\tsanitize($_POST[type]),\r\n\t\tsanitize($starttime),\r\n\t\tsanitize($_POST[dur]),\r\n\t\tsanitize($_POST[difficulty]),\r\n\t\tsanitize($_POST[payment]),\r\n\t\tsanitize($_POST[collateral]),\r\n\t\tsanitize($_POST[notes]),\r\n\t\t\"$ships\"\r\n\t));\r\n\r\n\tif ($DB->affectedRows() == 1) {\r\n\r\n\t\t// Prepare the announcement email.\r\n\t\tglobal $SITENAME;\r\n\t\tglobal $VERSION;\r\n\t\tglobal $URL;\r\n\r\n\t\t// Bloody hack to get latest ID. No one will ever know. ;)\r\n\t\t$lastID = $DB->getCol(\"SELECT max(ID) from events;\");\r\n\t\t$risks = array (\r\n\t\t\t\"No risk involved.\",\r\n\t\t\t\"Only inferior forces suspected.\",\r\n\t\t\t\"Somewhat risky.\",\r\n\t\t\t\"Moderate risk.\",\r\n\t\t\t\"Extreme risks are involved.\",\r\n\t\t\t\"No survivors expected.\"\r\n\t\t);\r\n\t\t$risk_index = $_POST[difficulty];\r\n\r\n\t\t// Fix the template up.\r\n\t\t$email = str_replace(\"{{ID}}\", str_pad(\"$lastID[0]\", \"5\", \"0\", STR_PAD_LEFT), getTemplate(\"newevent\", \"email\"));\r\n\t\t$email = str_replace(\"{{SDESCR}}\", $_POST[sdescr], $email);\r\n\t\t$email = str_replace(\"{{TYPE}}\", $_POST[type], $email);\r\n\t\t// In case of a numeric value we have to translate that into plain english.\r\n\t\tif (is_numeric($_POST[officer])) {\r\n\t\t\t$officer = idToUsername($_POST[officer]);\r\n\t\t} else {\r\n\t\t\t$officer = sanitze($_POST[officer]);\r\n\t\t}\r\n\t\t$email = str_replace(\"{{FLAGOFFICER}}\", ucfirst($officer), $email);\r\n\t\t$email = str_replace(\"{{SYSTEM}}\", $_POST[system], $email);\r\n\t\t$email = str_replace(\"{{SECURITY}}\", $_POST[security], $email);\r\n\t\t$email = str_replace(\"{{STARTTIME}}\", date(\"d.m.y H:i:s\", $starttime), $email);\r\n\t\t$email = str_replace(\"{{DURATION}}\", $_POST[dur], $email);\r\n\t\t$email = str_replace(\"{{RISK}}\", $risks[$risk_index], $email);\r\n\t\t$email = str_replace(\"{{PAYMENT}}\", $_POST[payment], $email);\r\n\t\t$email = str_replace(\"{{COLLATERAL}}\", number_format($_POST[collateral], 2), $email);\r\n\t\t$email = str_replace(\"{{NOTES}}\", $_POST[notes], $email);\r\n\t\t$email = str_replace(\"{{SITENAME}}\", $SITENAME, $email);\r\n\t\t$email = str_replace(\"{{URL}}\", $URL, $email);\r\n\t\t$email = str_replace(\"{{VERSION}}\", $VERSION, $email);\r\n\r\n\t\t// mail the user.\r\n\t\tmailUser($email, \"New event added!\");\r\n\r\n\t\t// Tell the admin what we did.\r\n\t\tmakeNotice(\"Event added to the database and users who are opt-in got an email.\", \"notice\", \"New Event added.\", \"index.php?action=showevents\", \"[OK]\");\r\n\t} else {\r\n\t\tmakeNotice(\"Something went horribly wrong! AIEE!!\", \"error\", \"Mummy!\");\r\n\t}\r\n\r\n}",
"public function onUpdate();",
"public function onUpdate();",
"public function onUpdate();",
"function addEvent($date, $title,$user_id, $fname, $address, $contact, $email, $location, $vlocation, $hour, $minutes, $deal,$guests, $chairs, $tables, $style, $types, $instruction, $confirmation) {\r\n //Include db configuration file\r\n include 'dbConfig.php';\r\n $currentDate = date(\"Y-m-d H:i:s\");\r\n //Insert the event data into database\r\n $insert = $db->query(\"INSERT INTO floralbookings (title,date,created,modified,user_id,fname,address,contact,email,location,vlocation,hour,minutes,deal,guests,chairs,tables,style,types,instruction,confirmation) VALUES ('\" . $title . \"','\" . $date . \"','\" . $currentDate . \"','\" . $currentDate . \"','\" . $user_id . \"','\" . $fname . \"','\" . $address . \"','\" . $contact . \"','\" . $email . \"','\" . $location . \"','\" . $vlocation . \"','\" . $hour . \"','\" . $minutes . \"','\" . $deal . \"','\" . $guests . \"','\" . $chairs . \"','\" . $tables . \"','\" . $style . \"','\" . $types . \"','\" . $instruction . \"','\" . $confirmation . \"')\");\r\n if ($insert) {\r\n echo 'ok';\r\n } else {\r\n echo 'err';\r\n }\r\n}",
"protected function _update()\n\t{\n\t}",
"public function attendEvent(Request $request)\n {\n// $id retrieved as Array\n $id = $request->id;\n\n// for each value in $id value are updated\n foreach ($id as $id)\n {\n// update function, massive update can only be done using query\n DB::table('registrations')\n ->where('id', $id)\n ->update(['status'=> 'attended']);\n }\n\n// return redirect back to previous page\n return redirect()->back();\n }",
"function setEvent() {\n \n if($_POST['am'] == 1){\n $star_time = $_POST['stime_a'] + 12 . \":\". $_POST['stime_b'];\n }else{\n $star_time = $_POST['stime_a'] . \":\". $_POST['stime_b'];\n }\n \n if($_POST['am1'] == 1){\n $end_time = $_POST['stime_c'] + 12 . \":\". $_POST['stime_d'];\n }else{\n $end_time = $_POST['stime_c'] . \":\". $_POST['stime_d'];\n }\n\n $values = array('event_id' => uniqid(),\n 'web_id' => WEB_ID,\n 'title' => $_POST['title'],\n 's_time' => $star_time,\n 'e_time' => $end_time,\n 'date' => date('Y-m-d H:i:s', strtotime($_POST['sDate'])),\n 'location' => $_POST['location'],\n 'description' => $_POST['disc'],\n 'end_date' => date('Y-m-d H:i:s', strtotime($_POST['eDate'])),\n 'visible' => \"on\"\n );\n\n $this->db->insert('events', $values);\n }",
"public function storeEvent(){\n \t$eventStore = new Event_Store();\n\n\t\t$eventStore->command = $this->command; \t\n\t\t$eventStore->event = $this->event;\n\t\t$eventStore->status = \"published\";\n\t\t$eventStore->created_at = now();\n\t\t$eventStore->updated_at = now();\n\n\n\t\t$eventStore->save();\n }",
"public function updateDb()\n {\n\n // make sure this is a valid new entry\n if ($this->isValid()) {\n\n // check for duplicate\n $vals = sprintf(\"Level = %d\",$this->level);\n $sql = \" update Admins set $vals where Email = '$this->email';\";\n Dbc::getReader()->Exec($sql);\n }\n else\n print \"<br> Invalid entry. STOP! ($sql)<br>\";\n }",
"static function canUpdate() {\n // as users can update their onw items\n return Session::haveRightsOr(self::$rightname, [\n CREATE,\n UPDATE,\n self::MANAGE_BG_EVENTS\n ]);\n }",
"public function updating()\n {\n # code...\n }",
"public function update(): bool;",
"public function is_update(){\n\t\tglobal $_wt_options;\n\t\tif($this->is_init() && $_wt_options->options(\"eventbrite_auto_update\") ==1) return 1;\n\t\treturn 0;\n\t}"
] | [
"0.7404636",
"0.70378256",
"0.69039536",
"0.67796755",
"0.6734898",
"0.6713149",
"0.6602663",
"0.65952724",
"0.65480095",
"0.6404779",
"0.640015",
"0.6359329",
"0.6278953",
"0.62566537",
"0.62495106",
"0.6240338",
"0.62355155",
"0.6209441",
"0.6204354",
"0.6200241",
"0.6173171",
"0.6152563",
"0.61217695",
"0.61190355",
"0.6109555",
"0.6108389",
"0.60834956",
"0.6068739",
"0.6057279",
"0.6054783",
"0.6050887",
"0.6049895",
"0.6043298",
"0.6041963",
"0.59850955",
"0.59845304",
"0.5976743",
"0.59725684",
"0.59675646",
"0.59549576",
"0.59360445",
"0.5924068",
"0.5917558",
"0.5880085",
"0.5877789",
"0.5870184",
"0.58696055",
"0.5864301",
"0.5854749",
"0.5843646",
"0.5834762",
"0.58343494",
"0.58306414",
"0.58278567",
"0.5810041",
"0.58041245",
"0.5794151",
"0.57892334",
"0.5773848",
"0.5773703",
"0.57716715",
"0.57703406",
"0.5767795",
"0.57658064",
"0.57536834",
"0.5749672",
"0.5749548",
"0.57321244",
"0.5729732",
"0.5726588",
"0.57065433",
"0.56892294",
"0.5686352",
"0.56834733",
"0.56792986",
"0.5671543",
"0.56693155",
"0.5661495",
"0.56452394",
"0.5643104",
"0.5641335",
"0.5628084",
"0.5622564",
"0.56159794",
"0.561565",
"0.5605004",
"0.5596443",
"0.5587431",
"0.55838746",
"0.55838746",
"0.55838746",
"0.55736196",
"0.5569922",
"0.556038",
"0.5560251",
"0.555938",
"0.55548024",
"0.55473083",
"0.55413854",
"0.5531846",
"0.55286956"
] | 0.0 | -1 |
This function adds events to the database Returns true | public function addEvent($title, $description, $start_date, $start_time, $end_date, $end_time, $color, $allDay, $url, $extra=false)
{
// Convert Date Time
$start = $start_date.' '.$start_time.':00';
$end = $end_date.' '.$end_time.':00';
// Checking
if(empty($url))
{
$url = 'false';
}
// Check for empty data
if(empty($title) && empty($start_date))
{
return false;
}
// Add Data to Database based on users $extra field
if(isset($extra) && is_array($extra))
{
################### - All Your Extra Fields both from 'quickSave' and from 'Add Event', catch here and procede from here
// Catch extra fields from $_POST
$category = $extra['categorie'];
# your own fields would be: $field = $extra['field_name']; and add them below on the $query as others are
// The Advanced Database - Add Event Query
$query = sprintf('INSERT INTO %s
SET
title = "%s",
description = "%s",
start = "%s",
end = "%s",
allDay = "%s",
color = "%s",
url = "%s",
category = "%s"
',
mysqli_real_escape_string($this->connection, $this->table),
mysqli_real_escape_string($this->connection, htmlentities($title)),
mysqli_real_escape_string($this->connection, htmlentities($description)),
mysqli_real_escape_string($this->connection, htmlentities($start)),
mysqli_real_escape_string($this->connection, htmlentities($end)),
mysqli_real_escape_string($this->connection, $allDay),
mysqli_real_escape_string($this->connection, htmlentities($color)),
mysqli_real_escape_string($this->connection, htmlentities($url)),
mysqli_real_escape_string($this->connection, htmlentities($category))
);
################################################################################################################# --- End
} else {
// The Basic Database - Add Event Query
$query = sprintf('INSERT INTO %s
SET
title = "%s",
description = "%s",
start = "%s",
end = "%s",
allDay = "%s",
color = "%s",
url = "%s"
',
mysqli_real_escape_string($this->connection, $this->table),
mysqli_real_escape_string($this->connection, htmlentities($title)),
mysqli_real_escape_string($this->connection, htmlentities($description)),
mysqli_real_escape_string($this->connection, htmlentities($start)),
mysqli_real_escape_string($this->connection, htmlentities($end)),
mysqli_real_escape_string($this->connection, $allDay),
mysqli_real_escape_string($this->connection, htmlentities($color)),
mysqli_real_escape_string($this->connection, htmlentities($url))
);
}
// The result
$this->result = mysqli_query($this->connection, $query);
if($this->result)
{
return true;
} else {
return false;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function pushEvents ($e)\n\t\t{\n\t\t\t if ( self::chkOrgId () ) { /* Check main Id */\n\t\t\t\t $dbs = new DB ( $this->config['database'] );\n\t\t\t\t $c = $dbs->query (\"SELECT COUNT(*) AS C FROM tbl_events_record WHERE org_id = '\" . $this->c . \"'\");\n\t\t\t\t if ( ! $c[0]['C'] ) { /* Event not found in events table , Insert */ \n\t\t\t\t\t$db_ins = new DB ( $this->config['database'] ) ;\n \t \t$e_ins = $db_ins->query (\"INSERT INTO tbl_events_record \n\t\t\t\t\t\tVALUES('\" . $this->c . \"','\" . $e . \"','\". date('Y-m-d H:i:s').\"');\");\n\t\t\t\t\t$db_ins->CloseConnection ();\n\t\t\t\t\treturn true;\n\t\t\t\t } else { /* Event found in events table , Update events by Id */\n\t\t\t\t\t$db_upd = new DB ( $this->config['database'] ) ;\n\t\t\t\t\t$e_upd = $db_upd->query (\"UPDATE tbl_events_record \n\t\t\t\t\t\tSET events = '\".$e.\"', date_rec = '\". date('Y-m-d H:i:s') . \n\t\t\t\t\t\t\"' WHERE org_id = '\" . $this->c .\"'\");\n\t\t\t\t\t$db_upd->CloseConnection ();\n\t\t\t\t}\n\t\t\t\t$dbs->CloseConnection ();\n\t\t\t\t$this->result['data']['id'] = $this->c;\n\t\t\t\t$this->result['data']['result'] = \"Push event: \" . $e; /* Events status */\n\t\t\t } else /* Id not found */\n\t\t\t\t$this->result['data']['result'] = \"Id not found [error code:100:101]\";\n\n\t\t\treturn false;\n\t\t}",
"public function add($data)\n {\n // $this->db->insert($this->_table, $this);\n\t\t$this->db->insert('tb_event', $data);\n\t\t\treturn true;\n }",
"public function addEvent( $event )\n\t{\n\t\t// database connection and sql query\n $core = Core::dbOpen();\n $sql = \"INSERT INTO user_log (userID, action, ip_address ) VALUES ( :userID, :event, :ip )\";\n $stmt = $core->dbh->prepare($sql);\n $stmt->bindParam(':userID', $this->userID);\n $stmt->bindParam(':event', $event);\n $stmt->bindParam(':ip', $_SERVER['REMOTE_ADDR']);\n Core::dbClose();\n\n\t\ttry\n {\n if( $stmt->execute()) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t} catch ( PDOException $e ) {\n echo \"Add history event failed!\";\n }\n\t\treturn false;\t\t\n\t}",
"function addEventToDB() {\r\n\r\n\tglobal $MySelf;\r\n\tglobal $DB;\r\n\r\n\t// is the events module active?\r\n\tif (!getConfig(\"events\")) {\r\n\t\tmakeNotice(\"The admin has deactivated the events module.\", \"warning\", \"Module not active\");\r\n\t}\r\n\t\r\n\t// Are we allowed to add Events?\r\n\tif (!$MySelf->canEditEvents()) {\r\n\t\tmakeNotice(\"You are not allowed to add events!\", \"error\", \"Forbidden!\");\r\n\t}\r\n\r\n\t// Do we have a short description?\r\n\tif (empty ($_POST[sdescr])) {\r\n\t\tmakeNotice(\"You need to supply a short description!\", \"error\", \"Important field missing!\");\r\n\t}\r\n\r\n\t// Do we have an officer?\r\n\tif (empty ($_POST[officer])) {\r\n\t\tmakeNotice(\"You need to supply who is in command!\", \"error\", \"Important field missing!\");\r\n\t}\r\n\t\r\n\t// Choose which supplied officer we use.\r\n\tif (!empty($_POST[officer2])) {\r\n\t\tsanitize($officer = sanitize($_POST[officer2]));\r\n\t} else {\r\n\t\tsanitize($officer = sanitize($_POST[officer]));\r\n\t}\r\n\t\r\n\t// Choose which system we use.\r\n\tif (!empty($_POST[system2])) {\r\n\t\t$system = strtolower($_POST[system2]);\r\n\t} else {\r\n\t\t$system = strtolower($_POST[system]);\r\n\t}\r\n\t\r\n\t// Check that we still have a valid systemname.\r\n\tif (empty($system)) {\r\n\t\tmakeNotice(\"No valid Systemname found! Please go back, and try again.\", \"warning\", \"No system name\",\r\n\t\t \"index.php?action=addevent\", \"[cancel]\");\r\n\t}\r\n\r\n\t// Do we have an ETD?\r\n\tif (empty ($_POST[dur])) {\r\n\t\tmakeNotice(\"You need to tell me the guessed runtime!\", \"error\", \"Important field missing!\");\r\n\t}\r\n\r\n\t// Collateral?\r\n\tif (!is_numeric($_POST[collateral]) && $_POST[collateral] < 0) {\r\n\t\tmakeNotice(\"You need to supply a valid collateral!\", \"error\", \"Important field missing!\");\r\n\t}\r\n\r\n\t// Do we have an ETD?\r\n\tif ($_POST[payment] < 0) {\r\n\t\tmakeNotice(\"You need to give the folks some money!\", \"error\", \"Important field missing!\");\r\n\t}\r\n\r\n\t// Startting time goodness.\r\n\t$myTime = array (\r\n\t\t\"day\" => \"$_POST[ST_day]\",\r\n\t\t\"month\" => \"$_POST[ST_month]\",\r\n\t\t\"year\" => \"$_POST[ST_year]\",\r\n\t\t\"hour\" => \"$_POST[ST_hour]\",\r\n\t\t\"minute\" => \"$_POST[ST_minute]\",\r\n\t\t\r\n\t);\r\n\t$starttime = humanTime(\"toUnix\", $myTime);\r\n\r\n\t// is the time valid?\r\n\tif (!$starttime) {\r\n\t\tmakeNotice(\"Invalid time supplied!\", \"error\", \"Invalid Time!\");\r\n\t}\r\n\r\n\t// Lets see what ships are required.\r\n\t$SHIPTYPES = array (\r\n\t\t\"shuttles\",\r\n\t\t\"frigates\",\r\n\t\t\"destroyers\",\r\n\t\t\"cruisers\",\r\n\t\t\"bcruiser\",\r\n\t\t\"scruiser\",\r\n\t\t\"bship\",\r\n\t\t\"dread\",\r\n\t\t\"carrier\",\r\n\t\t\"titan\",\r\n\t\t\"barges\",\r\n\t\t\"indies\",\r\n\t\t\"freighter\",\r\n\t\t\"jfreighter\",\r\n\t\t\"exhumer\"\r\n\t);\r\n\tforeach ($SHIPTYPES as $ship) {\r\n\t\tif ($_POST[$ship] == \"on\") {\r\n\t\t\t$wantedships[] = $ship;\r\n\t\t}\r\n\t}\r\n\t$ships = serialize($wantedships);\r\n\r\n\t$p = $DB->query(\"INSERT INTO events (sdesc, officer, system, security, type, starttime, \" .\r\n\t\"duration, difficulty, payment, collateral, notes, ships)\r\n\t values (?,?,?,?,?,?,?,?,?,?,?,?)\", array (\r\n\t\tsanitize($_POST[sdescr]),\r\n\t\t$officer,\r\n\t\t$system,\r\n\t\tsanitize($_POST[security]),\r\n\t\tsanitize($_POST[type]),\r\n\t\tsanitize($starttime),\r\n\t\tsanitize($_POST[dur]),\r\n\t\tsanitize($_POST[difficulty]),\r\n\t\tsanitize($_POST[payment]),\r\n\t\tsanitize($_POST[collateral]),\r\n\t\tsanitize($_POST[notes]),\r\n\t\t\"$ships\"\r\n\t));\r\n\r\n\tif ($DB->affectedRows() == 1) {\r\n\r\n\t\t// Prepare the announcement email.\r\n\t\tglobal $SITENAME;\r\n\t\tglobal $VERSION;\r\n\t\tglobal $URL;\r\n\r\n\t\t// Bloody hack to get latest ID. No one will ever know. ;)\r\n\t\t$lastID = $DB->getCol(\"SELECT max(ID) from events;\");\r\n\t\t$risks = array (\r\n\t\t\t\"No risk involved.\",\r\n\t\t\t\"Only inferior forces suspected.\",\r\n\t\t\t\"Somewhat risky.\",\r\n\t\t\t\"Moderate risk.\",\r\n\t\t\t\"Extreme risks are involved.\",\r\n\t\t\t\"No survivors expected.\"\r\n\t\t);\r\n\t\t$risk_index = $_POST[difficulty];\r\n\r\n\t\t// Fix the template up.\r\n\t\t$email = str_replace(\"{{ID}}\", str_pad(\"$lastID[0]\", \"5\", \"0\", STR_PAD_LEFT), getTemplate(\"newevent\", \"email\"));\r\n\t\t$email = str_replace(\"{{SDESCR}}\", $_POST[sdescr], $email);\r\n\t\t$email = str_replace(\"{{TYPE}}\", $_POST[type], $email);\r\n\t\t// In case of a numeric value we have to translate that into plain english.\r\n\t\tif (is_numeric($_POST[officer])) {\r\n\t\t\t$officer = idToUsername($_POST[officer]);\r\n\t\t} else {\r\n\t\t\t$officer = sanitze($_POST[officer]);\r\n\t\t}\r\n\t\t$email = str_replace(\"{{FLAGOFFICER}}\", ucfirst($officer), $email);\r\n\t\t$email = str_replace(\"{{SYSTEM}}\", $_POST[system], $email);\r\n\t\t$email = str_replace(\"{{SECURITY}}\", $_POST[security], $email);\r\n\t\t$email = str_replace(\"{{STARTTIME}}\", date(\"d.m.y H:i:s\", $starttime), $email);\r\n\t\t$email = str_replace(\"{{DURATION}}\", $_POST[dur], $email);\r\n\t\t$email = str_replace(\"{{RISK}}\", $risks[$risk_index], $email);\r\n\t\t$email = str_replace(\"{{PAYMENT}}\", $_POST[payment], $email);\r\n\t\t$email = str_replace(\"{{COLLATERAL}}\", number_format($_POST[collateral], 2), $email);\r\n\t\t$email = str_replace(\"{{NOTES}}\", $_POST[notes], $email);\r\n\t\t$email = str_replace(\"{{SITENAME}}\", $SITENAME, $email);\r\n\t\t$email = str_replace(\"{{URL}}\", $URL, $email);\r\n\t\t$email = str_replace(\"{{VERSION}}\", $VERSION, $email);\r\n\r\n\t\t// mail the user.\r\n\t\tmailUser($email, \"New event added!\");\r\n\r\n\t\t// Tell the admin what we did.\r\n\t\tmakeNotice(\"Event added to the database and users who are opt-in got an email.\", \"notice\", \"New Event added.\", \"index.php?action=showevents\", \"[OK]\");\r\n\t} else {\r\n\t\tmakeNotice(\"Something went horribly wrong! AIEE!!\", \"error\", \"Mummy!\");\r\n\t}\r\n\r\n}",
"function addEvent($date,$title,$user_id,$fname,$address,$contact,$email,$location,$vlocation,$hour,$minutes,$choice,$tier,$flavor,$info,$confirmation){\r\n\t//Include db configuration file\r\n\tinclude 'dbConfig.php';\r\n\t$currentDate = date(\"Y-m-d H:i:s\");\r\n\t//Insert the event data into database\r\n\t$insert = $db->query(\"INSERT INTO cakemaker (title,date,created,modified,user_id,fname,address,contact,email,location,vlocation,hour,minutes,choice,tier,flavor,info,confirmation) VALUES ('\".$title.\"','\".$date.\"','\".$currentDate.\"','\".$currentDate.\"','\".$user_id.\"','\".$fname.\"','\".$address.\"','\".$contact.\"','\".$email.\"','\".$location.\"','\".$vlocation.\"','\".$hour.\"','\".$minutes.\"','\".$choice.\"','\".$tier.\"','\".$flavor.\"','\".$info.\"','\".$confirmation.\"')\");\r\n\tif($insert){\r\n\t\techo 'ok';\r\n\t}else{\r\n\t\techo 'err';\r\n\t}\r\n}",
"public function test_database_events_check()\n {\n $this->seeInDatabase('events', ['event_name' => 'Test Event1']);\n }",
"public function addEvent()\n\t{\n\t \n\t\t$data = array(\n\t\t\t 'title' => $this->input->post('event_title'),\n\t\t\t 'date' => $this->input->post('event_date'),\n\t\t\t 'time' => $this->input->post('event_time'),\n\t\t\t 'desc' => $this->input->post('event_desc')\n\t\t);\t\n\n\t \tif($this->event_model->addEv($data))\n\t\t{\t\t\t \n\t\t\techo true;\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\techo false;\n\t\t}\n\t}",
"function addEvent($date, $title,$user_id, $fname, $address, $contact, $email, $location, $vlocation, $hour, $minutes, $deal,$guests, $chairs, $tables, $style, $types, $instruction, $confirmation) {\r\n //Include db configuration file\r\n include 'dbConfig.php';\r\n $currentDate = date(\"Y-m-d H:i:s\");\r\n //Insert the event data into database\r\n $insert = $db->query(\"INSERT INTO floralbookings (title,date,created,modified,user_id,fname,address,contact,email,location,vlocation,hour,minutes,deal,guests,chairs,tables,style,types,instruction,confirmation) VALUES ('\" . $title . \"','\" . $date . \"','\" . $currentDate . \"','\" . $currentDate . \"','\" . $user_id . \"','\" . $fname . \"','\" . $address . \"','\" . $contact . \"','\" . $email . \"','\" . $location . \"','\" . $vlocation . \"','\" . $hour . \"','\" . $minutes . \"','\" . $deal . \"','\" . $guests . \"','\" . $chairs . \"','\" . $tables . \"','\" . $style . \"','\" . $types . \"','\" . $instruction . \"','\" . $confirmation . \"')\");\r\n if ($insert) {\r\n echo 'ok';\r\n } else {\r\n echo 'err';\r\n }\r\n}",
"function updateEventInDatabase(&$formvars){\r\n\t\tif(!$this->DBLogin()){\r\n\t\t\t$this->HandleError(\"Database login failed!\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tif(!$this->EnsureEventTable()){\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tif(!$this->updateEventTable($formvars)){\r\n\t\t\t$this->HandleError(\"Inserting to Database failed!\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\treturn true;\r\n\t}",
"function saveEventToDb($event){\n // TODO: get city and country\n \n if ($event['start']) $event['start'] = date('Y-m-d H:i:s',strtotime($event['start']));\n if ($event['end']) $event['end'] = date('Y-m-d H:i:s',strtotime($event['end']));\n \n $e = Event::model()->findByAttributes(array(\"title\"=>$event['title'],\"start\"=>$event['start'])); \n \n // check if exist in DB\n if ($e){\n $old_val = (!empty($e->content)) + (!empty($e->location)) + (!empty($e->link));\n $new_val = (!empty($event['content'])) + (!empty($event['location'])) + (!empty($event['link'])); \n // our events have priority or if new event has more variables :) or if the same source (might be updated)\n if ((($e->source != 'http://www.cofinder.eu') && (($event['source'] == 'http://www.cofinder.eu') || ($old_val < $new_val)) )\n || ($e->source == $event['source'])){\n $e->title = $event['title'];\n $e->start = $event['start'];\n $e->end = $event['end'];\n if ($event['allday']) $e->all_day = 1;\n else $e->all_day = 0;\n if (isset($event['content'])) $e->content = $event['content'];\n if (isset($event['link'])) $e->link = $event['link'];\n if (isset($event['location'])){\n $e->location = $event['location'];\n $cityCountry = $this->getCityAndCountry($event['location']);\n $e->city = $cityCountry['city'];\n $e->country = $cityCountry['country'];\n }\n if (isset($event['source'])) $e->source = $event['source'];\n if (isset($event['color'])) $e->color = $event['color'];\n if (!$e->save());// die(print_r($e->errors));\n }\n }else{\n $e = new Event();\n $e->title = $event['title'];\n $e->start = $event['start'];\n $e->end = $event['end'];\n if ($event['allday']) $e->all_day = 1;\n else $e->all_day = 0;\n if (isset($event['content'])) $e->content = $event['content'];\n if (isset($event['link'])) $e->link = $event['link'];\n if (isset($event['location'])){\n $e->location = $event['location'];\n $cityCountry = $this->getCityAndCountry($event['location']);\n $e->city = $cityCountry['city'];\n $e->country = $cityCountry['country'];\n }\n if (isset($event['source'])) $e->source = $event['source'];\n if (isset($event['color'])) $e->color = $event['color'];\n //$e->city = $event['title'];\n //$e->country = $event['title'];\n if (!$e->save());// die(print_r($e->errors));\n }\n }",
"function insertEvent($name, $description, $type, $start, $end)\n{\n require_once(\"model/database.php\");\n $query = \"INSERT INTO events (name, description, type, start, end) VALUES(:name, :description, :type, :start, :end);\";\n return executeQueryInsert($query, createBinds([[\":name\", $name], [\":description\", $description], [\":type\", $type], [\":start\", $start], [\":end\", $end]]));\n}",
"Public function addEvent(){\n // Imposto l'azienda di riferimento\n\t$id_azienda=$this->session->id_azienda;\n\t// Costruisco l'array contentente i campi _POST: titolo, inizio, fine, descrizione, colore, url\n\t$dati_evento = array(\n\t\t'id_azienda' => $id_azienda,\n\t\t'id_cliente' => $_POST['id_cliente'],\n\t\t'titolo' => $_POST['titolo'],\n 'inizio' => $_POST['inizio'],\n\t\t'fine' => $_POST['fine'],\n\t\t'descrizione' => $_POST['descrizione'],\n\t\t'colore' => $_POST['colore'],\n\t\t'url' => $_POST['url']\n\t);\n\n\t$this->db->insert('eventi', $dati_evento);\n\treturn ($this->db->affected_rows()!=1)?false:true;\n\n\t/* Imposto la query\n\t$sql = \"INSERT INTO eventi (id_cliente, id_azienda, title,events.date, description, color) VALUES \";\n\t$sql.=\"(?,?,?,?)\";\n\t$this->db->query($sql, array($_POST['title'], $_POST['date'], $_POST['description'], $_POST['color']));\n\t\treturn ($this->db->affected_rows()!=1)?false:true;\n\t\t*/\n\t}",
"function add_event($description,$location,$time,$groupID){\n\tglobal $db;\n\t$query = 'INSERT INTO event(description,location,time,groupID)\n\t\t\t VALUES(:description,:location,:time,:groupID)';\n\t$statement = $db->prepare($query);\n\t$statement->bindValue(':description',$description);\n\t$statement->bindValue(':location',$location);\n\t$statement->bindValue(':time',$time);\n\t$statement->bindValue(':groupID',$groupID);\n\t$statement->execute();\n\t$statement->closeCursor();\n}",
"public function postEventadd();",
"public function save(): bool\n {\n $data = [\n 'date' => $this->getDate(),\n 'type' => $this->getType(),\n 'recorded' => $this->getRecorded(),\n 'route' => $this->getRoute(),\n 'place' => $this->getPlace(),\n 'mileage' => $this->getMileage(),\n 'place_manual' => $this->getPlaceManual(),\n 'description' => $this->getDescription()\n ];\n if ($this->getId()) {\n if ((new db\\Update('event', $data, $this->getId()))->run() !== false) {\n return true;\n }\n } else {\n if ($newId = (new db\\Insert('event', $data))->run()) {\n $this->setId($newId);\n return true;\n }\n }\n return false;\n }",
"public function addEvent()\n {\n if ($this->input->post('start') === null || $this->input->post('eventName') === null) {\n $response = array(\"status\" => false, \"message\" => 'Please provide necessary data.');\n\n $this->send(400, $response);\n }\n\n $reqData = array(\n 'start' => $this->input->post('start'),\n 'event_name' => $this->input->post('eventName'),\n 'created_by' => $this->session->get('username'),\n 'course_desc' => $this->input->post('courseDesc'),\n 'certified_by' => $this->input->post('certifiedBy'),\n 'all_day_event' => $this->input->post('allday'),\n 'end' => $this->input->post('end')\n );\n\n $added = $this->model->addEvent($reqData);\n\n if ($added === true) {\n $response = array(\"status\" => true, \"message\" => 'Event added.');\n $this->send(200, $response);\n } else {\n $response = array(\"status\" => false, \"message\" => 'Event not added.');\n $this->send(500, $response);\n }\n }",
"public function add_event($data)\n {\n $datafields = array\n ('start' => array('req' => true)\n ,'end' => array('req' => true)\n ,'gid' => array('req' => true)\n ,'title' => array('req' => false, 'def' => '')\n ,'description' => array('req' => false, 'def' => '')\n ,'location' => array('req' => false, 'def' => '')\n ,'type' => array('req' => false, 'def' => 0)\n ,'status' => array('req' => false, 'def' => 0)\n ,'opaque' => array('req' => false, 'def' => 1)\n ,'uuid' => array('req' => false, 'def' => basics::uuid())\n );\n foreach ($datafields as $k => $v) {\n if (!isset($data[$k])) {\n if ($v['req'] === true) {\n return false;\n }\n $data[$k] = $v['def'];\n } else {\n $data[$k] = $this->esc($data[$k]);\n }\n }\n if (empty($data['gid'])) {\n $data['gid'] = 0;\n }\n\n // Am I the owner?\n if (!empty($data['gid']) && $this->getGroupOwner($data['gid']) != $this->uid) {\n // If not, I should have write permissions through a share\n if (!empty($GLOBALS['DB']->features['groups'])) {\n $perms = $GLOBALS['DB']->getUserSharedFolderPermissions($this->uid, 'calendar', $data['gid']);\n }\n if (empty($perms) || empty($perms['write'])) {\n // No, I haven't\n return false;\n }\n }\n\n $query = 'INSERT '.$this->Tbl['cal_event']\n .' (`uid`,`gid`,`starts`,`ends`,`title`,`description`,`location`,`type`,`status`,`opaque`,`uuid`,`lastmod`) VALUES ('\n .$this->uid.', \"'.$data['gid'].'\" ,\"'.$data['start'].'\",\"'.$data['end'].'\",\"'.$data['title'].'\",\"'.$data['description'].'\"'\n .',\"'.$data['location'].'\",'.doubleval($data['type']).','.doubleval($data['status']).',\"'.doubleval($data['opaque']).'\", \"'.$data['uuid'].'\",NOW())';\n if (!$this->query($query)) {\n return false;\n }\n $newId = $this->insertid();\n // Make sure, the end of an event is NOT before its beginning\n $this->query('UPDATE '.$this->Tbl['cal_event'].' SET `ends`=`starts` WHERE `ends`<`starts` AND id='.$newId);\n\n if (isset($data['attendees']) && !empty($data['attendees'])) {\n $query = 'INSERT INTO '.$this->Tbl['cal_attendee'].' (`eid`,`ref`,`name`,`email`,`role`,`type`,`status`,`mailhash`) VALUES ';\n $k = 0;\n foreach ($data['attendees'] as $v) {\n if ($k) {\n $query .= ',';\n }\n $query .= '('.doubleval($newId).',\"evt\",\"'.$this->esc($v['name']).'\",\"'.$this->esc($v['email']).'\"'\n .',\"'.$this->esc($v['role']).'\",\"'.$this->esc($v['type']).'\",'.doubleval($v['status'])\n .',\"'.$this->esc(basics::uuid()).'\")';\n $k++;\n }\n $this->query($query);\n }\n\n if (isset($data['reminders']) && !empty($data['reminders'])) {\n $query = 'INSERT INTO '.$this->Tbl['cal_reminder'].' (`eid`,`ref`,`uid`,`mode`,`time`,`text`,`smsto`,`mailto`) VALUES ';\n $k = 0;\n foreach ($data['reminders'] as $v) {\n if ($k) {\n $query .= ',';\n }\n if ($v['mode'] == '-') {\n continue;\n }\n $query .= '('.doubleval($newId).',\"evt\",'.$this->uid.',\"'.$this->esc($v['mode']).'\",'.doubleval($v['time'])\n .',\"'.$this->esc($v['text']).'\"'\n .',\"'.(!empty($v['smsto']) ? $this->esc($v['smsto']) : '').'\"'\n .',\"'.(!empty($v['mailto']) ? $this->esc($v['mailto']) : '').'\")';\n $k++;\n }\n if ($k > 0) {\n $this->query($query);\n }\n }\n if (isset($data['repetitions']) && !empty($data['repetitions'])) {\n $query = 'INSERT INTO '.$this->Tbl['cal_repetition'].' (`eid`,`ref`,`type`,`repeat`,`extra`,`until`) VALUES ';\n $k = 0;\n foreach ($data['repetitions'] as $v) {\n if ($k) {\n $query .= ',';\n }\n $query .= '('.doubleval($newId).',\"evt\",\"'.$this->esc($v['type']).'\",'.doubleval($v['repeat'])\n .','.(isset($v['extra']) && !is_null($v['extra']) ? '\"'.$this->esc($v['extra']).'\"' : '\"\"')\n .','.(isset($v['until']) && !is_null($v['until']) ? '\"'.$this->esc($v['until']).'\"' : 'NULL').')';\n $k++;\n }\n if ($k > 0) {\n $this->query($query);\n }\n } else {\n $query = 'INSERT INTO '.$this->Tbl['cal_repetition'].' (`eid`,`ref`,`type`,`repeat`,`extra`,`until`) VALUES '\n .'('.doubleval($newId).',\"evt\",\"-\",0,\"\",NULL)';\n $this->query($query);\n }\n return $newId;\n }",
"public function insertEvent($data) {\n\t\t$this->db->insert('events',$data);\n\t}",
"function storeEventDetail() // OK\n {\n $dt = $this->_eventDetail->getEventDetail(); \t \n $sql = \"INSERT INTO events\n ( event_id, \n event_type, \n event_date, \n user_id, \n company)\n VALUES ( '{$this->_eventId}',\n '{$this->_eventType}',\n to_date('{$dt['CURRENT_DATE']}', 'MM/DD/YYYY HH24:MI:SS'),\n '{$dt['USER_ID']}',\n '{$dt['COMPANY']}'\n )\";\n if (! db_execute($sql))\n {\n $this->_errors->addError('Error inserting master event record.');\n return false;\n }\n return true;\n }",
"function add_event ($bid_row)\n{\n // Verify that the title isn't in the database yet\n\n $Title = $bid_row['Title'];\n if ('' == $Title)\n return display_error ('A blank Title is invalid');\n\n // Check that the title isn't already in the Events table\n\n if (! title_not_in_events_table ($Title))\n return false;\n\n $sql = 'INSERT Events SET ';\n $sql .= build_sql_string ('Title', $Title, false);\n $sql .= build_sql_string ('Author');\n $sql .= build_sql_string ('GameEMail');\n $sql .= build_sql_string ('Organization');\n $sql .= build_sql_string ('Homepage');\n\n $sql .= build_sql_string ('MinPlayersMale');\n $sql .= build_sql_string ('MaxPlayersMale');\n $sql .= build_sql_string ('PrefPlayersMale');\n\n $sql .= build_sql_string ('MinPlayersFemale');\n $sql .= build_sql_string ('MaxPlayersFemale');\n $sql .= build_sql_string ('PrefPlayersFemale');\n\n $sql .= build_sql_string ('MinPlayersNeutral');\n $sql .= build_sql_string ('MaxPlayersNeutral');\n $sql .= build_sql_string ('PrefPlayersNeutral');\n\n $sql .= build_sql_string ('Hours');\n\n $sql .= build_sql_string ('Description');\n $sql .= build_sql_string ('ShortBlurb');\n $sql .= build_sql_string ('PlayerCommunications');\n\n/* $sql .= build_sql_string ('IsSmallGameContestEntry'); */\n\n $sql .= build_sql_string ('UpdatedById', $_SESSION[SESSION_LOGIN_USER_ID]);\n\n // echo \"$sql<P>\\n\";\n\n $result = mysql_query ($sql);\n if (! $result)\n return display_mysql_error (\"Insert into Events failed\");\n\n return mysql_insert_id();\n}",
"function addEvent($date,$title){\n\tinclude 'dbConfig.php';\n\t$currentDate = date(\"Y-m-d\");\n\t//Insert the event data into database\n\t$insert = $db->query(\"INSERT INTO events (title,date,created,modified) VALUES ('\".$title.\"','\".$date.\"','\".$currentDate.\"','\".$currentDate.\"')\");\n\tif($insert){\n\t\techo 'ok';\n\t}else{\n\t\techo 'err';\n\t}\n}",
"function add_event ($bid_row)\n{\n // Verify that the title isn't in the database yet\n\n $Title = $bid_row['Title'];\n if ('' == $Title)\n return display_error ('A blank Title is invalid');\n\n // Check that the title isn't already in the Events table\n\n if (! title_not_in_events_table ($Title))\n return false;\n\n $sql = 'INSERT Events SET ';\n $sql .= build_sql_string ('Title', $Title, false);\n $sql .= build_sql_string ('Author');\n $sql .= build_sql_string ('GameEMail');\n $sql .= build_sql_string ('Organization');\n $sql .= build_sql_string ('Homepage');\n\n $sql .= build_sql_string ('MinPlayersNeutral');\n $sql .= build_sql_string ('MaxPlayersNeutral');\n $sql .= build_sql_string ('PrefPlayersNeutral');\n\n $sql .= build_sql_string ('Hours');\n $sql .= build_sql_string ('GameType');\n $sql .= build_sql_string ('Description');\n $sql .= build_sql_string ('ShortBlurb');\n\n/* $sql .= build_sql_string ('IsSmallGameContestEntry'); */\n\n $sql .= build_sql_string ('UpdatedById', $_SESSION['SESSION_LOGIN_USER_ID']);\n\n // echo \"$sql<P>\\n\";\n\n $result = mysql_query ($sql);\n if (! $result)\n return display_mysql_error (\"Insert into Events failed\");\n\n return mysql_insert_id();\n}",
"public function insertEvent(){\n //inset sql ;\n $type = strtolower($this ->event) == 'subscribe' ? 1 : 0;\n $sql = 'insert into '.$this->tableName[strtolower($this ->event)].\"(subscribe,openid,subscribe_time) values ('$type','$this->toUser','$this->createTime');\" ;\n error_log($sql);\n return $this->dbResult($sql);\n }",
"public function run()\n {\n $events = array(\n ['id' => 1, 'name' => 'Event 1', 'created_at' => new DateTime, 'updated_at' => new DateTime],\n ['id' => 2, 'name' => 'Event 2', 'created_at' => new DateTime, 'updated_at' => new DateTime],\n );\n DB::table('events')->insert($events);\n }",
"public function save ()\n {\n if ( $this->objMysql === null )\n {\n $this->getConnection ();\n }\n\n try {\n if ( trim ($this->id) === \"\" )\n {\n $this->objMysql->_insert (\"workflow.APP_EVENT\", [\n 'APP_UID' => $this->app_uid,\n 'CASE_UID' => $this->case_uid,\n 'DEL_INDEX' => $this->del_index,\n 'EVN_UID' => $this->evn_uid,\n 'APP_EVN_ACTION_DATE' => $this->app_evn_action_date,\n 'APP_EVN_ATTEMPTS' => $this->app_evn_attempts,\n 'APP_EVN_LAST_EXECUTION_DATE' => $this->app_evn_last_execution_date,\n 'APP_EVN_STATUS' => $this->app_evn_status,\n ]\n );\n\n return true;\n }\n else\n {\n $this->objMysql->_update (\"workflow.APP_EVENT\", ['APP_UID' => $this->app_uid,\n 'DEL_INDEX' => $this->del_index,\n 'EVN_UID' => $this->evn_uid,\n 'APP_EVN_ACTION_DATE' => $this->app_evn_action_date,\n 'APP_EVN_ATTEMPTS' => $this->app_evn_attempts,\n 'APP_EVN_LAST_EXECUTION_DATE' => $this->app_evn_last_execution_date,\n 'APP_EVN_STATUS' => $this->app_evn_status,\n ], [\"id\" => $this->id]\n );\n }\n } catch (Exception $e) {\n throw $e;\n }\n }",
"public function run()\n {\n\n DB::table('events')->insert([\n 'application_id' => 1,\n 'prefix' => '161112_dpworld',\n 'pre' => 'La Carrera',\n 'name' => 'DP World Callao 6k',\n 'owner' => 'DP World Callao',\n 'city' => 'Callao',\n 'date' => \\Carbon\\Carbon::createFromDate(2016, 11, 12),\n 'enabled' => true,\n 'closed' => false,\n 'maintenance' => false,\n 'test_mode' => false,\n 'subscription_open' => '2016-10-01 09:00:00',\n 'subscription_close' => '2016-11-06 18:00:00',\n 'lock_lapse' => 120,\n 'url_event' => 'http://zmpromociones.com/store/dpworld/',\n 'url_disclaimer' => null,\n 'url_privacy' => null,\n 'url_parental' => null,\n 'url_rules' => 'http://zmpromociones.com/store/dpworld/informacion-y-reglamento/',\n 'url_codes' => 'http://zmpromociones.com/store/dpworld/informacion-y-reglamento/',\n 'url_expo' => 'http://zmpromociones.com/store/dpworld/informacion-y-reglamento/',\n 'default_location' => 'pe,LIM,LIM',\n 'quota_modifier' => 0,\n 'quota_fixed' => 0,\n 'created_at' => \\Carbon\\Carbon::now(),\n 'updated_at' => \\Carbon\\Carbon::now(),\n ]);\n\n DB::table('events')->insert([\n 'application_id' => 1,\n 'prefix' => '170521_lima42k',\n 'pre' => 'La Maratón',\n 'name' => 'Lima42k',\n 'owner' => 'Adidas Perú',\n 'city' => 'Lima',\n 'date' => \\Carbon\\Carbon::createFromDate(2017, 5, 21),\n 'enabled' => true,\n 'closed' => false,\n 'maintenance' => false,\n 'test_mode' => true,\n 'subscription_open' => '2016-10-01 09:00:00',\n 'subscription_close' => '2017-05-14 18:00:00',\n 'lock_lapse' => 120,\n 'url_event' => 'http://www.lima42k.com',\n 'url_disclaimer' => 'http://lima42k.com/disclaimer',\n 'url_privacy' => null,\n 'url_parental' => null,\n 'url_rules' => 'http://www.lima42k.com/informacion/reglamento',\n 'url_codes' => 'http://www.lima42k.com',\n 'url_expo' => 'http://www.lima42k.com/informacion/expo',\n 'default_location' => 'pe,LIM,LIM',\n 'quota_modifier' => 0,\n 'quota_fixed' => 0,\n 'created_at' => \\Carbon\\Carbon::now(),\n 'updated_at' => \\Carbon\\Carbon::now(),\n ]);\n\n DB::table('events')->insert([\n 'application_id' => 1,\n 'prefix' => '161106_yura',\n 'pre' => 'La Maratón',\n 'name' => 'Yura 50 Años',\n 'owner' => 'Yura S.A.',\n 'city' => 'Arequipa',\n 'date' => \\Carbon\\Carbon::createFromDate(2016, 11, 06),\n 'enabled' => true,\n 'closed' => false,\n 'maintenance' => false,\n 'test_mode' => true,\n 'subscription_open' => '2016-10-01 09:00:00',\n 'subscription_close' => '2017-05-14 18:00:00',\n 'lock_lapse' => 120,\n 'url_event' => 'http://www.lima42k.com',\n 'url_disclaimer' => 'http://lima42k.com/disclaimer',\n 'url_privacy' => null,\n 'url_parental' => null,\n 'url_rules' => 'http://www.lima42k.com/informacion/reglamento',\n 'url_codes' => 'http://www.lima42k.com',\n 'url_expo' => 'http://www.lima42k.com/informacion/expo',\n 'default_location' => 'pe,ARE',\n 'quota_modifier' => 0,\n 'quota_fixed' => 0,\n 'created_at' => \\Carbon\\Carbon::now(),\n 'updated_at' => \\Carbon\\Carbon::now(),\n ]);\n\n }",
"public final function postEventadd(){\n $this->set_purpose( self::ADDI);\n $data = Input::all();\n \t\t$rules = $this->get_rules( true);\n \t$validator = Validator::make($data, $rules);\n\t\tif ($validator->fails()) {\n\t\t\t$messages = $validator->messages();\n\t\t\t$message = sprintf('<span class=\"label label-danger\">%1$s</span>' ,\n\t\t\t\t\t\t\t $this->make_message( $messages->all() ));\n\t\t\treturn $this->getEventadd( $message );\n\t\t}\n else{\n return $this->will_insert_to_db($data);\n } \n }",
"function addEvent($event) {\n\n $fields = array(\n 'event_id', 'calendar_id',\n 'title', 'location', 'description',\n 'start_stamp', 'end_stamp', 'end_year', 'end_month', 'recurrence',\n 'recur_yearly_interval',\n 'recur_monthly_interval', 'recur_monthly_count', 'recur_monthly_byweekday',\n 'recur_weekly_interval',\n 'recur_daily_interval',\n 'recur_end'\n );\n\n $toDB = array();\n foreach ($fields as $field) {\n if (!isset($event[$field])) {\n continue;\n }\n $toDB[$field] = $event[$field];\n }\n\n // save event\n $event_id = $this->databaseInsertRecord($this->tableEvents, 'event_id', $toDB);\n\n if (!$event_id) {\n // database error\n return FALSE;\n }\n\n // save selected months / weekdays\n switch($event['recurrence']) {\n case 'weekly':\n return $this->_saveWeekdays($event_id, $event) !== FALSE;\n break;\n case 'yearly':\n return $this->_saveMonths($event_id, $event) !== FALSE;\n break;\n }\n\n return $event_id;\n }",
"public function add()\r\n {\r\n $this->start();\r\n $this->write_to_db();\r\n }",
"public function addEvent($event_title,$event_detail,$event_date){\n\n // check the name of the event on db\n // $check_sql=\"SELECT*FROM `events` WHERE event_title='$event_title'\";\n // $result_check=$this->conn->query($check_sql);\n\n // if($result_check->num_rows>0){\n // echo \"<div class='alert alert-danger text-center'>The event is already in the table.</div>\";\n\n // }else{\n // insert into db\n $sql=\"INSERT INTO `events`(`event_title`,`event_detail`,`event_date`) VALUES('$event_title','$event_detail','$event_date')\";\n $result=$this->conn->query($sql);\n\n if($result==TRUE){\n header(\"location:events.php?success=1&message=The event was successfully created\");\n }else{\n header(\"location:events.php?success=0&message=Error occurd.Try it again.\");\n // } \n }\n }",
"private function createinstallevent()\n {\n $cat = CategoryUtil::getCategoryByPath('/__SYSTEM__/Modules/PostCalendar/Events');\n\n $eventArray = array(\n 'title' => $this->__('PostCalendar Installed'),\n 'hometext' => ':text:' . $this->__('On this date, the PostCalendar module was installed. Thank you for trying PostCalendar! This event can be safely deleted if you wish.'),\n 'alldayevent' => true,\n 'eventstatus' => PostCalendar_Entity_CalendarEvent::APPROVED,\n 'sharing' => PostCalendar_Entity_CalendarEvent::SHARING_GLOBAL,\n 'website' => 'https://github.com/craigh/PostCalendar/wiki',\n 'categories' => array(\n 'Main' => $cat['id']));\n\n try {\n $event = new PostCalendar_Entity_CalendarEvent();\n $event->setFromArray($eventArray);\n $this->entityManager->persist($event);\n $this->entityManager->flush();\n } catch (Exception $e) {\n return LogUtil::registerError($e->getMessage());\n }\n\n return true;\n }",
"public function storeEvent(){\n \t$eventStore = new Event_Store();\n\n\t\t$eventStore->command = $this->command; \t\n\t\t$eventStore->event = $this->event;\n\t\t$eventStore->status = \"published\";\n\t\t$eventStore->created_at = now();\n\t\t$eventStore->updated_at = now();\n\n\n\t\t$eventStore->save();\n }",
"function addEvent($eventToAdd, $userID){\n\n $date = $eventToAdd['date'];\n $place = $eventToAdd['lieu'];\n $event = $eventToAdd['event'];\n $startTime = $eventToAdd['startTime'];\n $endTime = $eventToAdd['endTime'];\n $type = $eventToAdd['type'];\n $recurrence = $eventToAdd['recurrence'];\n $qty = $eventToAdd['qty'];\n\n $i=0;\n if(isset($recurrence[$i])){\n $recurrence = $recurrence[$i];\n }\n else{\n $i++;\n }\n\n $addEventQuery = 'INSERT INTO events (`name`, `place`, `date`, `start time`, `end time`, `type`, `recurrence`, `FKusers`) VALUES (:name, :place, :date, :startTime, :endTime, :type, :recurrence, :userID)';\n $addEventData = array(\":name\" => $event, \":place\" => $place, \":date\" => $date, \":startTime\" => $startTime, \":endTime\" => $endTime, \":type\" => $type, \":recurrence\" => $recurrence, \":userID\" => $userID);\n\n require_once 'model/dbConnector.php';\n\n $result = executeQueryInsert($addEventQuery,$addEventData);\n\n $strSeparator = '\\'';\n\n //$idEventQuery = 'SELECT ID FROM events WHERE date = '.$strSeparator.$date.$strSeparator.'AND name = '.$strSeparator.$event.$strSeparator;\n $idEventQuery = 'SELECT MAX(ID) as ID FROM events';\n\n $idEvent = executeQuerySelect($idEventQuery)[0][\"ID\"];\n\n if($recurrence == 1){\n //jours\n for($qty;$qty>=2;$qty--){\n\n $date = new DateTime(\"{$date}\");\n $date->add(new DateInterval('P1D'));\n $date -> format('Y-m-d');\n $date = $date->format('Y-m-d');\n\n $addEventQuery2 = 'INSERT INTO `event-recurrence` (`date`, `FKevents`) VALUES (:date, :FKevents)';\n $addEventData2 = array(\":date\" => $date, \":FKevents\" => $idEvent);\n\n $result2 = executeQueryInsert($addEventQuery2,$addEventData2);\n }\n }\n //mois\n if($recurrence == 2){\n for($qty;$qty>=2;$qty--){\n $date = new DateTime(\"{$date}\");\n $date->add(new DateInterval('P1M'));\n $date -> format('Y-m-d');\n $date = $date->format('Y-m-d');\n\n $addEventQuery2 = 'INSERT INTO `event-recurrence` (`date`, `FKevents`) VALUES (:date, :FKevents)';\n $addEventData2 = array(\":date\" => $date, \":FKevents\" => $idEvent);\n\n $result2 = executeQueryInsert($addEventQuery2,$addEventData2);\n }\n }\n //année\n if($recurrence == 3){\n for($qty;$qty>=2;$qty--){\n $date = new DateTime(\"{$date}\");\n $date->add(new DateInterval('P1Y'));\n $date -> format('Y-m-d');\n $date = $date->format('Y-m-d');\n\n $addEventQuery2 = 'INSERT INTO `event-recurrence` (`date`, `FKevents`) VALUES (:date, :FKevents)';\n $addEventData2 = array(\":date\" => $date, \":FKevents\" => $idEvent);\n\n $result2 = executeQueryInsert($addEventQuery2,$addEventData2);\n }\n }\n\n return $result;\n\n}",
"function ajax_event_table_AddNew($db, $eventID, $postData, $postNames)\r\n{\r\n\t/*\r\n\t\t$postNames array values\r\n\t\t-----------------------\r\n\t\t0 = Event Location\r\n\t\t1 = Event Name\r\n\t\t2 = Start Date\r\n\t\t3 = Start Time\r\n\t\t4 = Number of Seats\r\n\t\t5 = Server IP Address\r\n\t\t6 = Amount of Days this event runs for\r\n\t*/\r\n\r\n\t$_SESSION['errMsg'] = \"\";\r\n\t$errCount = 0;\r\n\r\n\t//Validate the fields - first check to see if they are empty\r\n for($i = 0; $i<sizeof($postData); ++$i)\r\n\t{\r\n\t\tif ($postData[$i] == '')\r\n\t\t{\r\n\t\t\tif ($i != 5)\r\n\t\t\t{\r\n\t\t\t\t$_SESSION['errMsg'] .= $postNames[$i] . ' is empty.' . '<br />';\r\n\t\t\t\t$errCount ++;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//Check if event exists -\r\n\tif(!$postData[1] == '')\r\n\t{\r\n\t\t$query = \"SELECT * FROM event WHERE startDate >= CURDATE() AND event_name='\" . $postData[1]. \"'\";\r\n\t\t$result = $db->query($query);\r\n\t\tif ($result->num_rows > 0)\r\n\t\t{\r\n\t\t\t$_SESSION['errMsg'] .= 'Event Name Exists, Please choose another' . '<br />';\r\n\t\t\t$errCount ++;\r\n\t\t}\r\n\t}\r\n\r\n\r\n\t// CONVERT DATE TO mySQL DATE\r\n\t$sqlDate = dateToDatabase($postData[2]);\r\n\r\n\tif ($sqlDate == '00/00/0000')\r\n\t{\r\n\t\t$_SESSION['errMsg'] .= 'Start Date is not Valid' . '<br />';\r\n\t\t$errCount ++;\r\n\t}\r\n\tif (check_time_format($postData[3])== false)\r\n\t{\r\n\t\t$_SESSION['errMsg'] .= 'Start Time is not Valid' . '<br />';\r\n\t\t$errCount ++;\r\n\t}\r\n\tif ($postData[5] != '' && validateIpAddress($postData[5])== false)\r\n\t{\r\n\t\t$_SESSION['errMsg'] .= 'Server I.P Address is not valid' . '<br />';\r\n\t\t$errCount ++;\r\n\t}\r\n\tif (!is_numeric($postData[4]))\r\n\t{\r\n\t\t$_SESSION['errMsg'] .= 'Seat Quantity Should be a number' . '<br />';\r\n\t\t$errCount ++;\r\n\t}\r\n\r\n\r\n\tif ($errCount > 0)\r\n\t{\r\n\t\t$errCount = 0;\r\n\t\t$eventID = getThisEvent($db);\r\n\t\tajax_event_table_basic($db, $eventID);\r\n\r\n\t\techo \"<br /><font class='error'>\" . $_SESSION['errMsg'] . \"</font>\";\r\n\t\t$eName= $_POST['event_name'];\r\n\t\t$eLocation = $_POST['event_location'];\r\n\t\t$eStartTime = $_POST['startTime'];\r\n\t\t$eEventDate = $_POST['startDate'];\r\n\t\t$days = $_POST['days'];\r\n\t\t$eServerIP = $_POST['server_IP_address'];\r\n\t\t$eSeatNum = $_POST['seatQuantity'];\r\n\t}\r\n\telseif($errCount <= 0)\r\n\t{\r\n\t\t$event_location = $_POST['event_location'];\r\n\t\t$event_name = $_POST['event_name'];\r\n\t\t$days = $_POST['days'];\r\n\t\t$startTime = $_POST['startTime'];\r\n\t\t$server_IP_address = $_POST['server_IP_address'];\r\n\t\t$seatQuantity = $_POST['seatQuantity'];\r\n \r\n\t\t$query = \"INSERT INTO `event` (`eventID`, `event_name`, `event_location`, `startDate`, `days`, `startTime`, `seatQuantity`, `server_IP_address`, `event_started`, `event_completed`)\"; \r\n\t\t$query .= \"VALUES (NULL, '\".$event_name.\"', '\".$event_location.\"', '\".$sqlDate.\"', '\".$days.\"', \";\r\n\t\t$query .= \"'\".$startTime.\"', '\".$seatQuantity.\"', '\".$server_IP_address.\"', 0, 0);\"; \r\n\t\t\t\t\r\n\t\t$page = $_SERVER['PHP_SELF']; \r\n\r\n\t\t$db->autocommit(FALSE); \r\n\t\t$db->query($query);\r\n\r\n\t\tif($db->error)\r\n\t\t{\r\n\t\t\t$_SESSION['errMsg'] .= 'Transaction aborted:<br/>';\r\n\t\t\tprintf(\"Error Message:\", $db->error);\r\n\r\n\t\t\t$db->rollback();\r\n\t\t\tajax_event_table_Add($db);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tmysqli_commit($db);\r\n\t\t\t$db->autocommit(TRUE);\r\n\t\t\t$query = \"SELECT * FROM event WHERE startDate >= CURDATE() AND event_name='\" . $_POST['event_name'] . \"';\";\r\n\t\t\t$result = $db->query($query);\r\n\r\n\t\t\t$row = $result->fetch_array(MYSQLI_BOTH);\r\n\t\t\t$eventID = $row['eventID']; \r\n\t\t\tajax_event_table_basic($db,$eventID);\r\n\t\t}\r\n\t\techo '<script type=\"text/javascript\">refreshEvent();</script>';\r\n\t}\r\n }",
"function add_event($input = array()) {\r\n \r\n if ($_SERVER['REQUEST_METHOD'] === 'POST') {\r\n \r\n // check if user is logged in\r\n if (!isset($_SESSION['active']) || $_SESSION['active'] === false) {\r\n header(\"location: \" . $_SERVER['PHP_SELF'] . \"?action=login&error=err_login_to_add_event\");\r\n return;\r\n }\r\n \r\n require(HOME_DIR . 'libs/event.class.php');\r\n $event = new event;\r\n \r\n\r\n $event->creator_id = $_SESSION['user_id'];\r\n // check if title is empty\r\n if (empty($input['title'])) {\r\n $this->tpl->assign('ERROR_TITLE', 'err_title_empty');\r\n return;\r\n }\r\n $event->title = $input['title'];\r\n \r\n // check description\r\n if (empty($input['description'])) {\r\n $this->tpl->assign('ERROR_DESCRIPTION', 'err_description_empty');\r\n return;\r\n }\r\n $event->description = $input['description'];\r\n\r\n // check label\r\n $label = $input['label'];\r\n $label = json_decode($label);\r\n $event->label = $label;\r\n \r\n // check date\r\n $event->fixed_date = isset($input['fixed_date']) ? 1 : 0;\r\n $event->start_date = date('Y-m-d', mktime($input['start_date']));\r\n $event->start_time = date('h:i', mktime($input['start_time']));\r\n\r\n // check location\r\n $event->fixed_location = isset($input['fixed_location']) ? 1 : 0;;\r\n \r\n // handle number of participants\r\n $event->limited_number_of_participants = isset($input['limited_number_of_participants']) ? 1 : 0;\r\n $event->max_number_of_participants = $input['max_number_of_participants'];\r\n \r\n // handle reservations\r\n $event->advance_reservation_required = isset($input['advance_reservation_required']) ? 1 : 0; \r\n $event->confirm_reservations = isset($input['advance_reservation_required']) && isset($input['confirm_reservations']) ? 1 : 0;\r\n\r\n $event->insert_into_db();\r\n header(\"location: \" . $_SERVER['PHP_SELF'] . \"?action=dashboard&message=event_successfully_created\"); \r\n } \r\n }",
"public function save()\n {\n $db = $this->getDB();\n if (empty($this->id)) {\n $new_key = TRUE;\n } else {\n $new_key = FALSE;\n }\n\n $result = $db->saveObject($this);\n if (PHPWS_Error::isError($result)) {\n return false;\n } else {\n if (!PHPWS_DB::isTable($this->getEventTable())) {\n $result = $this->createEventTable();\n if (PHPWS_Error::isError($result)) {\n $this->delete();\n return $result;\n }\n }\n\n $result = $this->saveKey();\n if (PHPWS_Error::isError($result)) {\n $this->delete();\n return $result;\n }\n\n if ($new_key) {\n $db->saveObject($this);\n }\n\n return true;\n }\n }",
"public function add_event($_data){\r\n\t\t$args=$this->create_args($_data);\r\n\t\treturn($this->execute('add_event',$args));\r\n\t}",
"function sync_event()\n\t{\n\t\t$eventintegratorfolder=\"core/integrate/event\";\n\t\t$tabeventintegrator=$this->loader->charg_dossier_unique_dans_tab($eventintegratorfolder);\n\t\t\n\t\tforeach($tabeventintegrator as $eventintegratorcour)\n\t\t{\n\t\t\t//get nomcodeevenr\n\t\t\t$nomcode=substr($eventintegratorcour,strlen($eventintegratorfolder.\"/eventintegrator.\"),(-(strlen(\".php\"))));\n\t\t\t$nomcodeclass=ucfirst($nomcode);\n\t\t\t\n\t\t\t//addtodb\n\t\t\tinclude_once $eventintegratorcour;\n\t\t\teval(\"\\$instanceEventIntegrator=new EventIntegrator\".$nomcodeclass.\"(\\$this->initer);\");\n\t\t\t$instanceEventIntegrator->setNomcodeevent($nomcode);\n\t\t\t$instanceEventIntegrator->addtodb();\n\t\t}\n\t\t\n\t\treturn true;\n\t}",
"public function insertEvent($data)\r\r\n {\r\r\n $this->insert($data);\r\r\n }",
"private function saveChanges(\n Oxy_EventStore_Event_StorableEventsCollectionInterface $events, \n Oxy_Guid $guid\n )\n {\n try{\n $collection = $this->_db->selectCollection('events');\n $aggregateCollection = $this->_db->selectCollection('aggregates');\n\n // Add new events\n foreach ($events as $storableEvent) {\n $eventInstance = $storableEvent->getEvent();\n if(!$eventInstance instanceof Oxy_EventStore_Event_ArrayableInterface){\n throw new Oxy_EventStore_Storage_Exception(\n sprintf('Event must implement Oxy_EventStore_Event_ArrayableInterface interface')\n ); \n }\n $event = (object)$eventInstance->toArray();\n \n if((string)$storableEvent->getProviderGuid() === (string)$guid){\n $data = array(\n 'd' => date('Y-m-d H:i:s'),\n 'ag' => (string)$guid,\n 'e' => $event,\n 'ec' => (string)get_class($eventInstance)\n );\n } else {\n $data = array(\n 'd' => date('Y-m-d H:i:s'),\n 'ag' => (string)$guid,\n 'eg' => (string)$storableEvent->getProviderGuid(),\n 'e' => $event,\n 'ec' => (string)get_class($eventInstance)\n );\n }\n $collection->insert($data, array(\"safe\" => true));\n }\n return true;\n } catch(MongoCursorException $ex){\n return false;\n } catch(MongoConnectionException $ex){\n return false;\n } catch(MongoCursorTimeoutException $ex){\n return false;\n } catch(MongoGridFSException $ex){\n return false;\n } catch(MongoException $ex){\n return false;\n } catch (Exception $ex){\n return false;\n } \n \n return false;\n }",
"public function postEventadd(){\n\t\t$this->set_purpose( self::ADDI);\n\t\t$data = Input::all();\n \t\t$rules = $this->get_rules();\n \t$validator = Validator::make($data, $rules);\n\t\tif ($validator->fails()) {\n\t\t\t$messages = $validator->messages();\n\t\t\t$message = sprintf('<span class=\"label label-danger\">%1$s</span>' ,\n\t\t\t\t\t\t\t $this->make_message( $messages->all() ));\n\t\t\treturn $this->getEventAdd($message);\n\t\t}\n else{\n\t\t\treturn $this->will_insert_to_db($data);\n }\n\t}",
"function admin_add() {\n\t\tif (!empty($this->data)) {\n\t\t\t$this->Event->create();\n\t\t\tif ($this->Event->save($this->data)) {\n\t\t\t\t$this->Session->setFlash('This Event has been saved.');\n\t\t\t\t$this->redirect(array('action'=>'admin_index'),null,true);\n\t\t\t} else {\n\t\t\t\t$this->Session->setFlash('This Event could not be saved. Please try again.');\n\t\t\t}\n\t\t}\n\t\t$tags = $this->Event->Tag->find('list');\n\t\t$this->set(compact('tags'));\n\t}",
"public function saveEvent(){\n\t\t$this->load->database();\n\t\t//if this object is new event : insert it to db\n\t\tif($this->id === -1){\n\t\t\t$this->db->query(\"INSERT INTO event (title,des,image,author,postdate,duedate) \n\t\t\t\n\t\t\tVALUES ('$this->title',\n\t\t\t\t\t'$this->des',\n\t\t\t\t\t'$this->image',\n\t\t\t\t\t'$this->author',\n\t\t\t\t\t'$this->postdate',\n\t\t\t\t\t'$this->duedate'\n\t\t\t\t\t)\");\n\t\t}\n\t\t//if this object is exist event : edit it\n\t\telse{\n\t\t\t$this->db->query(\"UPDATE event SET \n\t\t\t\t\n\t\t\t\ttitle='$this->title',\n\t\t\t\tdes='$this->des',\n\t\t\t\timage='$this->image',\n\t\t\t\tpostdate='$this->postdate',\n\t\t\t\tduedate='$this->duedate' \n\t\t\t\t\n\t\t\t\tWHERE id='$this->id'\");\n\t\t}\n\t}",
"function insert_events($eventName, $location, $genre, $url, $sdate_time, $edate_time, $privacy, \n\t\t $event_descr=STRING_LENGTH_0, $event_status=STATUS_ACTIVE, $addr_id=NULL, $parent_event_id=NULL,\n\t\t $tag_1=NULL, $tag_2=NULL, $tag_3=NULL, $tag_4=NULL, $tag_5=NULL, $tag_6=NULL) {\n\tglobal $cxn;\n\n\t$errArr=init_errArr(__FUNCTION__); \n\ttry\n\t{\n\t\t// Sql String\n\t\t$sqlString = \"INSERT INTO events\n\t\t\t\t (eventName, location, genre, url, sdate_time, edate_time, privacy, event_descr, event_status, \n\t\t\t\t addr_id, parent_event_id, tag_1, tag_2, tag_3, tag_4, tag_5, tag_6)\n\t\t\t\tVALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)\";\n\t\t// Bind variables\n\t\t$stmt = $cxn->prepare($sqlString);\n\n\t\t$stmt->bind_param(\"sssssssssiissssss\", $eventName, $location, $genre, $url, $sdate_time, $edate_time, $privacy,\n\t\t\t\t $event_descr, $event_status, $addr_id, $parent_event_id,\n\t\t\t\t $tag_1, $tag_2, $tag_3, $tag_4, $tag_5, $tag_6 );\n\t\t$stmt->execute();\n\t}\n\tcatch (mysqli_sql_exception $err)\n\t{\n\t\t// Error settings\n\t\t$err_code=1;\n\t\t$err_descr=\"Error inserting events, event name: \" . $eventName . \" location: \" . $location . \n\t\t \" gendre: \" . $genre . \" url: \" . $url . \" start date time: \" . $sdate_time . \n\t\t \" end date time: \" . $edate_time . \" privacy: \" . $privacy . \" descr: \" . $event_descr . \n\t\t \" status: \" . $event_status . \" addr: \" . $addr_id . \" \" . $parent_event_id;\n\t\tset_errArr($err, $err_code, $err_descr, $errArr);\n\t}\n\t// Return Error code\n\t$errArr[ERR_AFFECTED_ROWS] = $cxn->affected_rows;\n\t$errArr[ERR_SQLSTATE] = $cxn->sqlstate;\n\t$errArr[ERR_SQLSTATE_MSG] = $cxn->error;\n\t$errArr[ERR_INSERT_ID] = $cxn->insert_id;\n\treturn $errArr;\n}",
"public function it_stores_events_raised_by_our_jas_app() : void\n {\n $id = '8741e80e-153f-4254-b13e-21ac8ac34948';\n $this->json('POST', '/store-jas-events', [\n 'id' => $id,\n 'name' => 'GameStarted',\n 'date' => 1_503_301_742_819,\n 'payload' => [\n 'game_id' => 'hoi'\n ]\n ])->seeJson([\n 'created' => true\n ]);\n\n $this->seeInDatabase('jas_events', [\n 'uuid' => $id,\n 'name' => 'GameStarted',\n 'date' => 1_503_301_742_819,\n ]);\n }",
"public function run()\n {\n DB::table('events')->insert([\n [\n 'name' => 'Поездка в Лиетлахти',\n 'place' => 'Карелия',\n 'description' => 'Скальные сектора в окрестностях Треугольного озера и национального парка Лиетлахти',\n 'user_id' => 1,\n ],\n [\n 'name' => 'День рождения (личные расходы)',\n 'place' => 'Ресторан «Какой-нибудь»',\n 'description' => 'Если в событии только один покупатель, событие нужно считать личным и как-то выделить его на фоне остальных',\n 'user_id' => 1,\n ],\n [\n 'name' => 'Событие второго пользователя',\n 'place' => '',\n 'description' => 'Для тестирования безопасности',\n 'user_id' => 2,\n ],\n ]);\n }",
"function saveEvents($eventId, $start, $end, $objectid, $event_details, $event_desc, $event_image)\n {\n //1. Define the query\n $sql = \"INSERT INTO events (eventid, starttime, endtime, objectid, event_details, event_desc, event_image, archive, event_complete) \n VALUES (:eventid, :starttime, :endtime, :objectid, :event_details, :event_desc, :event_image, 0, 0)\";\n\n //2. Prepare the statement\n $statement = $this->_dbh->prepare($sql);\n\n //3. Bind the parameters\n $statement->bindParam(':eventid', $eventId, PDO::PARAM_STR);\n $statement->bindParam(':starttime', $start, PDO::PARAM_STR);\n $statement->bindParam(':endtime', $end, PDO::PARAM_STR);\n $statement->bindParam(':objectid', $objectid, PDO::PARAM_STR);\n $statement->bindParam(':event_details', $event_details, PDO::PARAM_STR);\n $statement->bindParam(':event_desc', $event_desc, PDO::PARAM_STR);\n $statement->bindParam(':event_image', $event_image, PDO::PARAM_STR);\n\n $lastId = $this->_dbh->lastInsertId();\n\n //4. Execute the query\n $result = $statement->execute();\n\n //5. Process the results\n return $result;\n }",
"public function saveEvent($info = [], $new = true)\n {\n // If we're about to update an existing record,\n // make sure we have its ID before continuing.\n if (!$new)\n {\n if (array_key_exists('id_event', $info))\n {\n $id_event = intval($info['id_event']);\n unset($info['id_event']);\n }\n else\n {\n return false;\n }\n }\n\n // Remove any non-existing columns\n $dbValues = [];\n\n $columns = DBUtil::columns('events');\n foreach ($columns as $column)\n {\n if (isset($info[$column])) $dbValues[$column] = $info[$column];\n }\n\n // Are we talking about a new record?\n if ($new)\n {\n DB::table('events')\n ->insert($dbValues);\n }\n // If not, update the existing record.\n else\n {\n DB::table('events')\n ->where('id_event', '=', $id_event)\n ->update($dbValues);\n }\n\n return true;\n }",
"public function addEvent($key, $args = array()) {\n \t$query = $this->eventExistsStatement;\n \t$query->bindParam(':k', $key, \\PDO::PARAM_STR);\n \t$query->execute();\n \tif ($query->rowCount()) {\n \t\treturn false;\n \t} else {\n \t\t$do = $this->eventInsertStatement;\n \t}\n $val = json_encode($args);\n \t\n \t$do->bindParam(':k', $key, \\PDO::PARAM_STR);\n \t$do->bindParam(':v', $val, \\PDO::PARAM_STR);\n \treturn $do->execute();\n }",
"public function testUpdateValidEvent (): void {\n\t\t//count the number of rows and save it for later\n\t\t$numRows = $this->getConnection()->getRowCount(\"event\");\n\n\t\t// create a new Event and insert into mySQL\n\t\t$eventId = generateUuidV4();\n\t\t$event = new Event ($eventId, $this->profile->getProfileId(), $this->VALID_EVENTATTENDEELIMIT,$this->VALID_EVENTDETAIL, $this->VALID_EVENTENDDATETIME,$this->VALID_EVENTIMAGE, $this->VALID_EVENTLAT, $this->VALID_EVENTLONG, $this->VALID_EVENTNAME, $this->VALID_EVENTPRICE, $this->VALID_EVENTSTARTDATETIME);\n\t\t$event->insert($this->getPDO());\n\n\t\t// edit the event and update it in mySQL\n\t\t$event->setEventDetail($this->VALID_EVENTDETAIL2);\n\t\t$event->update($this->getPDO());\n\n\n\t\t// grab the data from mySQL and enforce the fields meet our expectations\n\t\t$pdoEvent = Event::getEventByEventId($this->getPDO(), $event->getEventId());\n\t\t$this->assertEquals($pdoEvent->getEventId(), $eventId);\n\t\t$this->assertEquals($numRows + 1, $this->getConnection()->getRowCount(\"event\"));\n\t\t$this->assertEquals($pdoEvent->getEventId(), $eventId);\n\t\t$this->assertEquals($pdoEvent->getEventProfileId(),$this->profile->getProfileId());\n\t\t$this->assertEquals($pdoEvent->getEventAttendeeLimit(), $this->VALID_EVENTATTENDEELIMIT);\n\t\t// format the date too seconds since the beginning of time to avoid round off error\n\t\t$this->assertEquals($pdoEvent->getEventDetail(), $this->VALID_EVENTDETAIL2);\n\t\t$this->assertEquals($pdoEvent->getEventEndDateTime(),$this->VALID_EVENTENDDATETIME);\n\t\t$this->assertEquals($pdoEvent->getEventImage(), $this->VALID_EVENTIMAGE);\n\t\t$this->assertEquals($pdoEvent->getEventLat(), $this->VALID_EVENTLAT);\n\t\t$this->assertEquals($pdoEvent->getEventLong(), $this->VALID_EVENTLONG);\n\t\t$this->assertEquals($pdoEvent->getEventName(), $this->VALID_EVENTNAME);\n\t\t$this->assertEquals($pdoEvent->getEventPrice(), $this->VALID_EVENTPRICE);\n\t\t// format the date too seconds since the beginning of time to avoid round off error\n\t\t$this->assertEquals($pdoEvent->getEventStartDateTime(), $this->VALID_EVENTSTARTDATETIME);\n\t}",
"public function testInsertValidEvent() : void {\n // count the number of rows and save it for later\n $numRows = $this->getConnection()->getRowCount(\"event\");\n\n // create a new Event and insert to into mySQL\n $eventId = generateUuidV4();\n $event = new Event ($eventId, $this->profile->getProfileId(), $this->VALID_EVENTATTENDEELIMIT, $this->VALID_EVENTDETAIL, $this->VALID_EVENTENDDATETIME, $this->VALID_EVENTIMAGE, $this->VALID_EVENTLAT, $this->VALID_EVENTLONG, $this->VALID_EVENTNAME, $this->VALID_EVENTPRICE, $this->VALID_EVENTSTARTDATETIME);\n $event->insert($this->getPDO());\n\n //grab the data from mySQL and enforce the fields match our expectations\n $pdoEvent = Event::getEventByEventId($this->getPDO(), $event->getEventId());\n $this->assertEquals($numRows + 1, $this->getConnection()->getRowCount(\"event\"));\n $this->assertEquals($pdoEvent->getEventId(), $eventId);\n $this->assertEquals($pdoEvent->getEventProfileId(),$this->profile->getProfileId());\n $this->assertEquals($pdoEvent->getEventAttendeeLimit(), $this->VALID_EVENTATTENDEELIMIT);\n\t\t $this->assertEquals($pdoEvent->getEventDetail(), $this->VALID_EVENTDETAIL);\n // format the date too seconds since the beginning of time to avoid round off error\n $this->assertEquals($pdoEvent->getEventEndDateTime(),$this->VALID_EVENTENDDATETIME);\n $this->assertEquals($pdoEvent->getEventImage(), $this->VALID_EVENTIMAGE);\n $this->assertEquals($pdoEvent->getEventLat(), $this->VALID_EVENTLAT);\n $this->assertEquals($pdoEvent->getEventLong(), $this->VALID_EVENTLONG);\n $this->assertEquals($pdoEvent->getEventName(), $this->VALID_EVENTNAME);\n $this->assertEquals($pdoEvent->getEventPrice(), $this->VALID_EVENTPRICE);\n // format the date too seconds since the beginning of time to avoid round off error\n $this->assertEquals($pdoEvent->getEventStartDateTime(), $this->VALID_EVENTSTARTDATETIME);\n }",
"function submitted_events_install() {\n\tglobal $submitted_events_db_version;\n\t\n\t// Only update database on version update\n\tif ($submitted_events_db_version != get_option ( 'submitted_events_version' )) {\n\t\t\n\t\tglobal $wpdb;\n\t\t\n\t\t$table_name = $wpdb->prefix . \"submitted_events\";\n\t\t\n\t\terror_log ( 'Submitted Events Plugin activated', 0 );\n\t\t\n\t\t// This is a harsh way of changing the database - all previous data will be lost!\n\t\t// But dbDelta wasn't doing the updates as intended\n\t\t$wpdb->query( \"DROP TABLE IF EXISTS \" . $table_name );\n\t\t\n\t\t$charset_collate = $wpdb->get_charset_collate ();\n\t\t\n\t\t// Max field lengths assumed, e.g.\n\t\t// date will be YYYY-MM-DD\n\t\t// packedlunch should be Yes or No but could be blank\n\t\t// altmeetpttime could be : or HH:MM\n\t\t$sql = \"CREATE TABLE \" . $table_name . \"(\n \tid mediumint(9) NOT NULL AUTO_INCREMENT,\n \tname VARCHAR(50) NOT NULL,\n\tdate VARCHAR(10) NOT NULL, \n\ttitle VARCHAR(150) NOT NULL,\n\tbrunelgroup VARCHAR(30) NOT NULL,\n\tlevel VARCHAR(30) NOT NULL,\n\tlength VARCHAR(30) NOT NULL,\n\tstarttime VARCHAR(20) NOT NULL,\n\tmeetpt VARCHAR(30) NOT NULL,\n\taltmeetpt VARCHAR(150) NOT NULL,\n\taltmeetgridref VARCHAR(20) NOT NULL,\n\taltmeetpttime VARCHAR(8) NOT NULL,\n\taltmeetcontactleader VARCHAR(4) NOT NULL,\t\t\n\tmapurl VARCHAR(200) NOT NULL,\n\temail VARCHAR(50) NOT NULL,\n\tphone VARCHAR(30) NOT NULL,\n\tpackedlunch VARCHAR(4) NOT NULL,\n\tpostwalk VARCHAR(20) NOT NULL,\n\tdescription text NOT NULL,\n\tcoleader VARCHAR(50) NOT NULL,\n\tcoleaderphone VARCHAR(30) NOT NULL,\t\t\n\tcarshareorganiser VARCHAR(4) NOT NULL,\t\n\teventgenerated boolean NOT NULL DEFAULT FALSE,\n \tPRIMARY KEY (id)\t\n\t) \" . $charset_collate . \";\";\n\t\t\n\t\trequire_once (ABSPATH . 'wp-admin/includes/upgrade.php');\n\t\t\n\t\t// This isn't allowing updates to the table - error table exists\n\t\t// see http://wordpress.stackexchange.com/questions/41293/dbdelta-failing-with-error-wordpress-database-error-table-wp-2-myplugin-alre\n\t\tdbDelta ( $sql );\n\t\t\n\t\t// WordPress Options Hooks\n\t\tupdate_option ( 'submitted_events_db_version', $submitted_events_db_version );\n\t}\n}",
"public function addEvent($name, $date, $location,$desc) {\n //$uuid = uniqid('', true);\n\n // $date='2009-04-30 10:09:00';//date(\"Y-m-d\",strtotime($date));\n $stmt = $this->conn->prepare(\"INSERT INTO events(ename, location, description, edate) VALUES(?, ?, ?, ?)\");\n $stmt->bind_param(\"ssss\", $name,$location, $desc,$date);\n $result = $stmt->execute();\n $stmt->close();\n\n // check for successful store\n if ($result) {\n $stmt = $this->conn->prepare(\"SELECT * FROM events WHERE ename = ?\");\n $stmt->bind_param(\"s\", $name);\n $stmt->execute();\n $event = $stmt->get_result()->fetch_assoc();\n $stmt->close();\n\n return $event;\n } else {\n return false;\n }\n }",
"function CreateTableEvent(){\r\n\t\t$qry = \"CREATE TABLE IF NOT EXISTS $this->tablename2 (\". \r\n\t\t\t\t\"Eid INT AUTO_INCREMENT,\".\r\n\t\t\t\t\"UuserName CHAR(255) NOT NULL,\".\r\n\t\t\t\t\"Evename VARCHAR(255) NOT NULL,\".\r\n\t\t\t\t\"EstartDate VARCHAR(20) NOT NULL,\".\r\n\t\t\t\t\"EendDate VARCHAR(20) NOT NULL,\".\r\n\t\t\t\t\"Eaddress VARCHAR(255) NOT NULL,\".\r\n\t\t\t\t\"Ecity VARCHAR(50) NOT NULL,\".\r\n\t\t\t\t\"Estate CHAR(10) NOT NULL,\".\r\n\t\t\t\t\"Ezip INT(5) NOT NULL,\".\r\n\t\t\t\t\"EphoneNumber VARCHAR(50),\".\r\n\t\t\t\t\"Edescription VARCHAR(500) NOT NULL,\".\r\n\t\t\t\t\"Etype VARCHAR(26) NOT NULL,\".\r\n\t\t\t\t\"Ewebsite VARCHAR(500) NOT NULL,\".\r\n\t\t\t\t\"Ehashtag CHAR(255),\".\r\n\t\t\t\t\"Efacebook CHAR(255),\".\r\n\t\t\t\t\"Etwitter CHAR(255),\".\r\n\t\t\t\t\"Egoogle CHAR(255),\".\r\n\t\t\t\t\"Eflyer CHAR(255),\".\r\n\t\t\t\t\"Ebanner CHAR(255),\".\r\n\t\t\t\t\"Eother CHAR(255),\".\r\n\t\t\t\t\"EtimeStart CHAR(255),\".\r\n\t\t\t\t\"EtimeEnd CHAR(255),\".\r\n\t\t\t\t\"Elat DECIMAL(10,6),\".\r\n\t\t\t\t\"Elong DECIMAL(10,6),\".\r\n\t\t\t\t\"Erank CHAR(255),\".\r\n\t\t\t\t\"Edisplay INT(1),\".\r\n\t\t\t\t\"PRIMARY KEY(Eid, UuserName)\".\r\n\t\t\t\");\";\r\n\r\n\t\tif(!mysql_query($qry, $this->connection)){\r\n\t\t\t$this->HandleDBError(\"Error creating the table \\nquery was\\n $qry\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\treturn true;\r\n\t}",
"public function testUpdateEvents()\n {\n $event= Event::factory(1)->create();\n // dd($event);\n $event->title = 'Maria';\n $this->put(\"/events\". $event[0]->id, $event->toArray());\n\n $this->assertDatabaseHas('events', [\n 'id' => 1,\n 'title' => 'Maria'\n ]);\n }",
"function addAttendee($eventID, $userID, $status)\r\r\n\t{\r\r\n\t\t$result = mysql_query(\"select * from eventAttendees where (eventID = '\".$eventID.\"' AND userID = '\".$userID.\"')\");\r\r\n\t\tif (!$result) \r\r\n\t\t{\r\r\n\t\t\tthrow new Exception('Could not execute query');\r\r\n\t\t}\r\r\n\t\t$num_rows = mysql_num_rows($result);\r\r\n\t\tif ($num_rows > 0) \r\r\n\t\t{\r\r\n\t\t\tthrow new Exception('You are already register for this event.');\r\r\n\t\t}\r\r\n\t\t\t\r\r\n\t\t$result = mysql_query(\"INSERT INTO eventAttendees(eventID, userID, status) VALUES ('\".$eventID.\"', '\".$userID.\"', '\".$status.\"')\");\r\r\n\t\tif (!$result) \r\r\n\t\t{\r\r\n\t\t\techo mysql_error();\r\r\n\t\t\t//throw new Exception('Could not register you in database - please try again later.');\r\r\n\t\t}\r\r\n\t\treturn true;\t\r\r\n\t}",
"public function saveEvent($post){\n\n\t\tif (! $ctime = strtotime($post['datetime']) ){\n\t\t\techo \"<script>\n\t\t\t\talert('Date ${post['datetime']} not recognized');\n\t\t\t\thistory.back();\n\t\t\t\t</script>\n\t\t\t\";\n\t\t}\n\t\tif ($ctime < time()){\n\t\t\techo \"<script>\n\t\t\t\talert('You cannot enter an event for a past date');\n\t\t\t\thistory.back();\n\t\t\t\t</script>\n\t\t\t\";\n\t\t}\n\t\t$post['datetime'] = date('Y-m-d g:i a', $ctime);\n\n\t\t$id = $post['id'];\n\t\tforeach ($post as $var => $val) {\n\t\t\t$despec[$var] = $val;\n\t\t}\n\n\t\t$prep = u\\prepPDO($despec,array_keys(self::$empty_item),'id');\n\t\t if ($despec['id'] == 0){ #new entry\n\n\t\t\t$sql = \"INSERT into `events` ( ${prep['ifields']} ) VALUES ( ${prep['ivalues']} );\";\n\t\t\t//u\\echor($prep,$sql);\n\t\t\t $stmt = $this->pdo->prepare($sql);\n\n\t\t\t $stmt->execute($prep['idata']);\n\t\t\t $new_id = $this->pdo->lastInsertId();\n\n\t\t} else { #update\n\t\t\t$prep = u\\prepPDO($despec,array_keys(self::$empty_item),'id');\n\t\t\t$sql = \"UPDATE `events` SET ${prep['uset']} WHERE id = ${prep['ukey']};\";\n\t\t\t//\tu\\echor($prep,$sql);\n\t\t\t $stmt = $this->pdo->prepare($sql);\n\n\t\t\t $stmt->execute($prep['udata']);\n\t\t\t$new_id = $id;\n\t\t}\n\t\treturn $new_id;\n}",
"public function write($event)\n {\n $fields = array(\n $this->_options['fieldMessage'] => $event['message'],\n $this->_options['fieldLevel'] => $event['level'],\n );\n\n $this->_db->insert($this->_table, $fields);\n return true;\n }",
"public function add_event(array $event) {\n if (empty($event['type']) or\n empty($event['name']) or\n empty($event['data'])) {\n return (false);\n }\n $this->__results[] =\n array('type' => $event['type'],\n 'name' => $event['name'],\n 'data' => $event['data']);\n return (true);\n }",
"public function user_can_create_event()\n {\n $user = User::factory()->create();\n $event = Event::factory()->make()->toArray();\n $response = $this->actingAs($user)->post('/events', $event);\n $response->assertStatus(302);\n $this->assertNotNull(Event::where('name', $event['name'])->first());\n }",
"public function events()\n {\n $templateCalendarEvent = factory(TemplateCalendarEvent::class)->create();\n $calendarEvent = factory(CalendarEvent::class)->make();\n $calendarEvent->template()->associate($templateCalendarEvent);\n $calendarEvent->save();\n\n $this->assertInstanceOf(CalendarEvent::class, $templateCalendarEvent->events()->first());\n }",
"public function run()\n {\n \\DB::table('events')->insert([\n //'id' => 1,\n 'name' => 'Evento', \n 'description' => 'Evento para probar busqueda por nombre y probar carga de imagen',\n 'initial_date' => '2019-12-01', // new DateTime(2019, 11, 28),\n 'ending_date' => '2019-12-01',\n 'price' => 350,\n 'category_id' => 6,\n 'user_id' => 1,\n 'created_at' => now(),\n 'updated_at' => now(),\n ]);\n }",
"public function save() {\n $db = Db::instance();\n // omit id and any timestamps\n $db_properties = array(\n 'event_type_id' => $this->event_type_id,\n 'user_1_id' => $this->user_1_id,\n 'user_2_id' => $this->user_2_id,\n 'user_1_name' => $this->user_1_name,\n 'user_2_name' => $this->user_2_name,\n 'product_1_name' => $this->product_1_name,\n 'product_2_name' => $this->product_2_name,\n 'data_1' => $this->data_1,\n 'data_2' => $this->data_2\n );\n $db->store($this, __CLASS__, self::DB_TABLE, $db_properties);\n }",
"function createNewEvent() \n {\n // SPEICHERUNG\n if (isset($_POST['eventname'])) {\n if ($this->userHasRight(79, 0) == true) {\n $neweventname = $this->checkString($_POST['eventname']);\n if (strlen($neweventname) > 5) {\n if ($this->objectExists(\"SELECT id,eventname FROM eventlist WHERE eventname='$neweventname'\") == false) {\n $sql = \"INSERT INTO eventlist (eventname) VALUES ('$neweventname')\";\n if ($this->sqlInsertUpdateDelete($sql) == true) {\n $this->erfolgMessage(\"Event $neweventname erstellt\");\n } else {\n $this->errorMessage(\"Fehler beim speichern ($neweventname)\");\n }\n } else {\n $this->infoMessage(\"Eine Veranstaltung mit dem Namen $neweventname existiert bereits.\");\n }\n \n } else {\n $this->infoMessage(\"Name muss mehr als 5 Zeichen haben.\");\n }\n } else {\n $this->infoMessage(\"Du benötigst Super Administration Rechte für diese Aktion.\");\n }\n \n }\n\n // AUSGABE\n if ($this->userHasRight(79, 0) == true) {\n echo \"<div class=''>\";\n echo \"<form method=post action='administration.php#allevents' />\";\n echo \"<input type=text name=eventname placeholder=Event-Name required />\";\n echo \"<button type=submit>OK</button>\";\n echo \"</form>\";\n echo \"</div>\";\n }\n }",
"public function run()\n {\n $data = [\n \t ['title'=>'Demo Event-1', 'start_date'=>'2018-02-19', 'end_date'=>'2018-02-19'],\n \t ['title'=>'Demo Event-2', 'start_date'=>'2018-02-21', 'end_date'=>'2018-02-21'],\n ['title'=>'Demo Event-2-2', 'start_date'=>'2018-02-21', 'end_date'=>'2018-02-21'],\n ['title'=>'Demo Event-2-3', 'start_date'=>'2018-02-21', 'end_date'=>'2018-02-21'],\n ['title'=>'Demo Event-2-4', 'start_date'=>'2018-02-21', 'end_date'=>'2018-02-21'],\n ['title'=>'Demo Event-2-5', 'start_date'=>'2018-02-21', 'end_date'=>'2018-02-21'],\n ];\n\n\n DB::table('events')->insert($data);\n\n }",
"public function save()\r\n {\r\n if (!$this->challengePrepare()) {\r\n return false;\r\n }\r\n \r\n if (isset($this->data['itemid'])) {\r\n $procedure = 'editevent';\r\n } else {\r\n $procedure = 'postevent';\r\n }\r\n \r\n $this->request($procedure, $this->data);\r\n if (xmlrpc_is_fault($this->response) || !isset($this->response['itemid']) ||\r\n !isset($this->response['url']) || !isset($this->response['anum'])) {\r\n \r\n return false;\r\n } else {\r\n $this->data['itemid'] = $this->response['itemid'];\r\n $this->url = $this->response['url'];\r\n $this->anum = $this->response['anum'];\r\n \r\n return true;\r\n }\r\n }",
"public function run()\n {\n DB::table('events')->insert([\n 'title' => 'IntrigueCon 2017',\n 'description' => 'The Latest IntrigueCon',\n 'location' => '0',\n 'event_image' => 'noimage.jpg'\n ]);\n\n }",
"function SaveJson($db, $data)\n{ \n $collection = $db->Events;\n \n if(!$collection)\n {\n ReturnServerError();\n }\n \n $collection->insert($data);\n \n header('HTTP/1.1 201 Created');\n exit();\n}",
"public function persistEvents()\n {\n $eventsGoogle = $this->getGoogleEvents();\n\n foreach ($eventsGoogle as $eventGoogle){\n $event = new Event();\n $event->setName($eventGoogle->getSummary());\n\n //If it's not existing\n if (!$eventGoogle->getStart()->getDateTime()){\n $start = new \\DateTime($eventGoogle->getStart()->getDate());\n $end = new \\DateTime($eventGoogle->getEnd()->getDate());\n\n $end->sub(new \\DateInterval('PT1S'));\n $event->setStartAt($start);\n $event->setEndAt($end);\n } else {\n $event->setStartAt(new \\DateTime($eventGoogle->getStart()->getDateTime()));\n $event->setEndAt(new \\DateTime($eventGoogle->getEnd()->getDateTime()));\n }\n $event->setIdGoogle($eventGoogle->getId());\n\n //Event with same ID\n\n if (!$this->em->getRepository(Event::class)->findOneBy(['idGoogle' => $event->getIdGoogle()])){\n\n $this->em->persist($event);\n $this->em->flush();\n }\n\n }\n\n }",
"public function test_add_status_event()\n {\n $employer = Employer::factory()->create();\n $status = EmployerStatus::create([\n \"employer_id\" => $employer->id,\n \"online_at\" => $online_at = Carbon::now(),\n\n ]);\n $this->assertDatabaseHas(\"employer_statuses\", [\n \"employer_id\" => (string)$employer->id,\n \"online_at\" => $online_at,\n\n ]);\n }",
"function createNewEvent($name, $evTime, $inviteList, $info){\r\n $response = array('ok' => false, 'msg' => \"Undefined error\");\r\n \r\n // Make sure the fields are not empty\r\n if ($name == \"\" || $evTime == \"\" || $inviteList == \"\" || $info == \"\") {\r\n $response['ok'] = false;\r\n $response['msg'] = \"One or more required fields are emtpy\";\r\n }\r\n else {\r\n openDatabase();\r\n $adminId = getLoggedInAdminId();\r\n \r\n // Make sure we can retrieve user session's admin id\r\n if (!$adminId) {\r\n $response['ok'] = false;\r\n $response['msg'] = \"Failed to retrieve logged in user id\";\r\n }\r\n else {\r\n $query = \"INSERT INTO events VALUES(NULL, '\" . SQLE($name) . \"', '\" . SQLE($evTime) . \"', '\" . $adminId . \"', '\" . SQLE($info) . \"');\";\r\n $result = mysql_query($query);\r\n\r\n $response['ok'] = true;\r\n $response['msg'] = \"OK\";\r\n }\r\n closeDatabase();\r\n }\r\n\r\n return $response;\r\n}",
"public function run()\n {\n DB::table('events')->insert([\n 'category' => 'Cricket',\n 'event' => 'BD vs IND',\n 'description' => 'Ashia Cup Final Ashia Cup Final',\n 'date' => '2021-07-22',\n 'image' => 'http://127.0.0.1:8000/storage/p654jiH50KOszAw8Y3X945Kb8cwlbGJ3UWh0AL6E.jpg',\n 'featured' => 'Yes',\n 'created_at' => '2021-07-24 01:16:23'\n ]);\n DB::table('events')->insert([\n 'category' => 'Cricket',\n 'event' => 'BD vs PAK',\n 'description' => 'Ashia Cup Semi Final Ashia Cup Semi Final',\n 'date' => '2021-07-22',\n 'image' => 'http://127.0.0.1:8000/storage/TDnyPW70zvFS9NMpm6JlsALQLnvvTScxBXAYLwtO.png',\n 'created_at' => '2021-07-24 01:16:23'\n ]);\n DB::table('events')->insert([\n 'category' => 'Football',\n 'event' => 'BD vs Afgan',\n 'description' => 'World Cup Qualifier Round 3',\n 'date' => '2021-07-22',\n 'image' => 'http://127.0.0.1:8000/storage/sddxZqOO35JB5q9poZuFWWUn9ZgGhYHzth71dW39.png',\n 'featured' => 'Yes',\n 'created_at' => '2021-07-24 01:16:23'\n ]);\n DB::table('events')->insert([\n 'category' => 'Badminton',\n 'event' => 'Salman vs Arik',\n 'description' => 'Indoor Cup Final Indoor Cup Final',\n 'date' => '2021-07-22',\n 'image' => 'http://127.0.0.1:8000/storage/Tc9CzkLc5GatmPSun4OukDYHx4XU9D0kb9bGX6Li.jpg',\n 'featured' => 'Yes',\n 'created_at' => '2021-07-24 01:16:23'\n ]);\n DB::table('events')->insert([\n 'category' => 'Golf',\n 'event' => 'Raiyan vs Marzan',\n 'description' => 'Ashia Cup Final Ashia Cup Final',\n 'date' => '2021-07-22',\n 'image' => 'http://127.0.0.1:8000/storage/hnRteIPbapvPMZTAsCv30CxcBhcP5D3eacRFEQBE.jpg',\n 'featured' => 'Yes',\n 'created_at' => '2021-07-24 01:16:23'\n ]);\n DB::table('events')->insert([\n 'category' => 'Tennis',\n 'event' => 'Redwan vs Mishfaq',\n 'description' => 'Ashia Cup Final Ashia Cup Final',\n 'date' => '2021-07-22',\n 'image' => 'http://127.0.0.1:8000/storage/vkbdWy5IzubeQ6MkkVJCB0Jc2x1FxUSoAakkPYXx.jpg',\n 'created_at' => '2021-07-24 01:16:23'\n ]);\n DB::table('events')->insert([\n 'category' => 'Boxing',\n 'event' => 'Ahsan vs Sumaiya',\n 'description' => 'House Cup Round Match',\n 'date' => '2021-07-22',\n 'image' => 'http://127.0.0.1:8000/storage/fnCd06iG06exlbRIk1kT8KC3bYB4Y0cXcAK4BQpC.jpg',\n 'created_at' => '2021-07-24 01:16:23'\n ]);\n DB::table('events')->insert([\n 'category' => 'Basketball',\n 'event' => 'Safwan vs Nahian',\n 'description' => 'House Cup Semi Final',\n 'date' => '2021-07-22',\n 'image' => 'http://127.0.0.1:8000/storage/6TuCxr3MzW0hwiHH2rj0P54fyS6SMLmKB79yOgee.png',\n 'created_at' => '2021-07-24 01:16:23'\n ]);\n DB::table('events')->insert([\n 'category' => 'Badminton',\n 'event' => 'Marzan vs Redwan',\n 'description' => 'A Block Sporting Club Final',\n 'date' => '2021-07-22',\n 'image' => 'http://127.0.0.1:8000/storage/eWu0ulsuZis1FsYvsirl3yUSytGo48g6JZh6iBgC.jpg',\n 'created_at' => '2021-07-24 01:16:23'\n ]);\n DB::table('events')->insert([\n 'category' => 'Carrom',\n 'event' => 'Usman vs Redwan',\n 'description' => 'B Block Sporting Club Final',\n 'date' => '2021-07-22',\n 'image' => 'http://127.0.0.1:8000/storage/eWu0ulsuZis1FsYvsirl3yUSytGo48g6JZh6iBgC.jpg',\n 'created_at' => '2021-07-24 01:16:23'\n ]);\n DB::table('events')->insert([\n 'category' => 'Football',\n 'event' => 'Mahfuz vs Tanvir',\n 'description' => 'MU Sporting Club Final',\n 'date' => '2021-07-22',\n 'image' => 'http://127.0.0.1:8000/storage/WCxYzDALaXbDtlunEAUSCgJCknXp9FeZ05wVeIkO.jpg',\n 'created_at' => '2021-07-24 01:16:23'\n ]);\n DB::table('events')->insert([\n 'category' => 'Cricket',\n 'event' => 'Navid vs Nihal',\n 'description' => 'MU Sporting Club Final',\n 'date' => '2021-07-22',\n 'image' => 'http://127.0.0.1:8000/storage/TDnyPW70zvFS9NMpm6JlsALQLnvvTScxBXAYLwtO.png',\n 'created_at' => '2021-07-24 01:16:23'\n ]);\n DB::table('events')->insert([\n 'category' => 'Cricket',\n 'event' => 'Humayun vs Azhar',\n 'description' => 'Cousin Sporting Club Final',\n 'date' => '2021-07-22',\n 'image' => 'http://127.0.0.1:8000/storage/TDnyPW70zvFS9NMpm6JlsALQLnvvTScxBXAYLwtO.png',\n 'status' => 'Disable',\n 'created_at' => '2021-07-24 01:16:23'\n ]);\n }",
"public function store()\n\t{\n\t\t// Create New Event\n\n\t\t$evnt = new Events;\n\t\t$evnt->user_id = Auth::id();\n\t\t$evnt->name = Input::get('name');\n\t\t$evnt->size = Input::get('size');\n\t\t$evnt->time_start = Input::get('start');\n\t\t$evnt->time_end = Input::get('end');\n\t\t$evnt->detail = Input::get('detail');\n\t\t$evnt->location = Input::get('loca');\n\t\t$evnt->category = Input::get('cate');\n\t\t$evnt->save();\n\n\t\t$eid = DB::select('select event_id from event where event_id = (select max(event_id) from event)');\n\t\t$join = new JoinEvent;\n\t\t$join->event_id = $eid[0]->event_id;\n\t\t$join->user_id = Auth::id();\n\t\t$join->active = 1;\n\t\t$join->status = 'owner';\n\t\t$join->save();\t\t\n\n\n\t\treturn Redirect::to('/myevent/create');\n\t\t// return $join;\n\t}",
"public function insertIntoDB(){\n //this only has to be added if native channel data is to be inserted to db\n $this->params = $this->params + array(\n \"x_label\" => \"\",\n \"x_last_changed\" => $this->metaData->getTimestamp(),\n \"x_timestamp_added\" => $this->metaData->getTimestamp(),\n \"x_last_confirmed\" => 0\n );\n $this->params[\"source\"] = $this->sourceDB;\n $this->params[\"modulation\"] = strtoupper( $this->params[\"modulation\"] ); //w_scan has lower case, we don't want that\n\n $success = true;\n $query = $this->db->insert( \"channels\", $this->params);\n //19 = channel already exists, could'nt be inserted\n if ($query != 19) {\n if ( $this->metaData !== null)\n $this->metaData->increaseAddedChannelCount();\n $query = $this->db->insert( \"channel_update_log\", array(\n \"combined_id\" => $this->longUniqueID,\n \"name\" => $this->params[\"name\"],\n \"update_description\" => \"New channel added: \" . $this->getChannelString(),\n \"timestamp\" => $this->metaData->getTimestamp(),\n \"importance\" => \"1\"\n ));\n }\n else{\n $this->updateInDB();\n $success = false;\n }\n return $success;\n }",
"public function run()\n {\n $events = [\n 'speed-coding', 'sentence', 'projet'\n ];\n for($i=0; $i<sizeof($events); $i++):\n DB::table('events')->insert([\n 'name' => $events[$i],\n \n ]);\n endfor;\n }",
"private function saveChanges(StoreableEventsCollectionInterface $events, $id)\n {\n try{\n $collection = $this->_db->selectCollection('events');\n\n // Add new events\n foreach ($events as $storableEvent) {\n /** @var \\Oxy\\EventStore\\Event\\StoreableEventInterface $storableEvent */\n $eventInstance = $storableEvent->getEvent();\n if(!$eventInstance instanceof ArrayableInterface){\n throw new Exception(\n sprintf('Event must implement Oxy\\EventStore\\Event\\ArrayableInterface interface')\n ); \n }\n $event = (object)$eventInstance->toArray();\n \n if((string)$storableEvent->getProviderId() === (string)$id){\n $data = array(\n 'd' => date('Y-m-d H:i:s'),\n 'ag' => (string)$id,\n 'e' => $event,\n 'ec' => (string)get_class($eventInstance)\n );\n } else {\n $data = array(\n 'd' => date('Y-m-d H:i:s'),\n 'ag' => (string)$id,\n 'eg' => (string)$storableEvent->getProviderId(),\n 'e' => $event,\n 'ec' => (string)get_class($eventInstance)\n );\n }\n $collection->insert($data, array(\"safe\" => true));\n }\n return true;\n } catch(\\MongoCursorException $ex){\n return false;\n } catch(\\MongoConnectionException $ex){\n return false;\n } catch(\\MongoGridFSException $ex){\n return false;\n } catch(\\MongoException $ex){\n return false;\n } catch (Exception $ex){\n return false;\n }\n }",
"public function add() \n\t{\n\t\ttry \n\t\t{\n\t\t\t// select mongoDB collection\n\t\t\t$app_collection = \t$this->mongo_db->db->func;\n\t\t\t// preparing data\n\t\t\t$prepare_data \t= \tarray(\n\t\t\t\t'function_name' \t=> $this->function_name, \n\t\t\t\t'function_token' \t=> $this->function_token, \n\t\t\t\t'function_token' \t=> $this->function_token, \n\t\t\t\t'application_id' \t=> $this->application_id, \n\t\t\t\t'application_name' \t=> $this->application_name, \n\t\t\t\t'function_primary' \t=> $this->function_primary\n\t\t\t\t);\n\t\t\t// insert to database\n\t\t\t$app_collection->insert($prepare_data);\n\t\t\treturn true;\n\t\t} \n\t\tcatch (Exception $e) \n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}",
"public function addEvent($event){\n $this->events[]=$event;\n }",
"public function run()\n {\n (new Event)->updateOrCreate([\n 'id' => 1,\n 'name' => 'view',\n ]);\n\n\n (new Event)->updateOrCreate([\n 'id' => 2,\n 'name' => 'play',\n ]);\n\n (new Event)->updateOrCreate([\n 'id' => 3,\n 'name' => 'click',\n ]);\n }",
"function insert(iEvent $event);",
"public function store()\n {\n $params = Input::all();\n $user = $this->user->find_id_by_hash($params['user_hash']);\n $rules = [\n 'app' => 'required',\n 'catid' => 'required|integer',\n 'title' => 'required',\n 'location' => 'required',\n 'startdate' => 'required',\n 'enddate' => 'required',\n 'repeat' => 'required'\n ];\n $validator = Validator::make($params, $rules);\n\n if($validator->passes())\n {\n switch($params['app']) {\n case 'event-status':\n // Create event transaction\n /*try {\n DB::transaction(function() use ($user, $params) {\n $event_save = $this->event->create([\n 'parent' => '',\n 'catid' => $params['catid'],\n 'contentid' => 0,\n 'type' => 'profile',\n 'title' => $params['title'],\n 'location' => $params['location'],\n 'summary' => '',\n 'description' => $params['description'],\n 'creator' => $user->id,\n 'startdate' => $params['startdate'],\n 'enddate' => $params['enddate'],\n 'permission' => 0,\n 'created' => date(\"Y-m-d H:s:i\"),\n 'allday' => $params['allday'],\n 'repeat' => $params['repeat'],\n 'repeatend' => $params['repeatend']\n ]);\n\n $this->event_member->create([\n 'eventid' => $event_save->id,\n 'memberid' => $user->id,\n 'status' => 1,\n 'permission' => 1,\n 'invited_by' => 0,\n 'approval' => 0,\n 'created' => date(\"Y-m-d H:s:i\")\n ]);\n\n $activity = $this->activity->create([\n 'actor' => $user->id,\n 'target' => 0,\n 'title' => '',\n 'content' => '',\n 'app' => 'events',\n 'cid' => $event_save->id,\n 'eventid' => $event_save->id,\n 'created' => date(\"Y-m-d H:s:i\"),\n 'access' => 0,\n 'params' => [\n 'action' => \"events.create\",\n 'event_url' => \"index.php?option=com_community&view=events&task=viewevent&eventid={$event_save->id}\",\n 'event_category_url' => \"index.php?option=com_community&view=events&task=display&categoryid={$params['catid']}\"\n ],\n 'archived' => 0,\n 'location' => $params['location'],\n 'comment_id' => $event_save->id,\n 'comment_type' => 'groups.event',\n 'like_id' => $event_save->id,\n 'like_type' => 'group.event',\n 'actors' => ''\n ]);\n });\n }\n catch($e) {\n\n }*/\n break;\n };\n }\n }",
"public function run()\n {\n $eventTypes = config(\"sample.eventType\");\n $i = 1;\n \tforeach ($eventTypes as $value) {\n \t\tEventType::insert([\n\t \t\t'id' \t\t\t=> $i,\n\t 'name' \t\t\t=> $value['name'],\n\t 'created_by' \t=> 1,\n\t 'updated_by' \t=> 1,\n\t 'active' \t\t=> 1,\n \t]);\n \t$i++;\n \t}\n }",
"public function insertar_event($name, $from, $to, $qty, $type, $increase, $active, $date){\n $query=\"INSERT INTO `\".DB_PREFIX.\"special_events` (`id`,\n \t\t\t\t\t\t\t\t\t\t\t`name`,\n\t\t\t\t\t\t\t\t\t\t\t\t`from_date`,\n\t\t\t\t\t\t\t\t\t\t\t\t`to_date`,\n\t\t\t\t\t\t\t\t\t\t\t\t`qty`,\n\t\t\t\t\t\t\t\t\t\t\t\t`type`,\n\t\t\t\t\t\t\t\t\t\t\t\t`increase`,\n\t\t\t\t\t\t\t\t\t\t\t\t`active`,\n\t\t\t\t\t\t\t\t\t\t\t\t`date`)\n \t\t\t\t\tVALUES ( NULL ,'\".$this->link->myesc($name).\"','\".$this->link->myesc($from).\"','\".$this->link->myesc($to).\"','\".$this->link->myesc($qty).\"','\".$this->link->myesc($type).\"','\".$this->link->myesc($increase).\"','\".$this->link->myesc($active).\"','\".$this->link->myesc($date).\"')\";\n\n $result = $this->link->execute($query);\n return $result;\n\t}",
"function add_event($settings)\n {\n if(!$this->isLogged)\n $this->login();\n \n if($this->isLogged)\n {\n $_entry = \"<entry xmlns='http://www.w3.org/2005/Atom' xmlns:gd='http://schemas.google.com/g/2005'>\n <category scheme='http://schemas.google.com/g/2005#kind' term='http://schemas.google.com/g/2005#event'></category>\n <title type='text'>\".$settings[\"title\"].\"</title>\n <content type='text'>\".$settings[\"content\"].\"</content>\n <author>\n <name>\".$this->email.\"</name>\n <email>\".$this->email.\"</email>\n </author>\n <gd:transparency\n value='http://schemas.google.com/g/2005#event.opaque'>\n </gd:transparency>\n <gd:eventStatus\n value='http://schemas.google.com/g/2005#event.confirmed'>\n </gd:eventStatus>\n <gd:where valueString='\".$settings[\"where\"].\"'></gd:where>\n <gd:when startTime='\".$settings[\"startDay\"].\"T\".$settings[\"startTime\"].\".000Z'\n endTime='\".$settings[\"endDay\"].\"T\".$settings[\"endTime\"].\".000Z'></gd:when>\n </entry>\";\n \n $this->prepare_feed_url();\n \n $header = array();\n $header[] = \"Host: www.google.com\";\n $header[] = \"MIME-Version: 1.0\";\n $header[] = \"Accept: text/xml\";\n $header[] = \"Authorization: GoogleLogin auth=\".$this->fAuth;\n $header[] = \"Content-length: \".strlen($_entry);\n $header[] = \"Content-type: application/atom+xml\";\n $header[] = \"Cache-Control: no-cache\";\n $header[] = \"Connection: close \\r\\n\";\n $header[] = $_entry;\n \n $this->post($this->feed_url_prepared, null, $header, $http_code);\n if(201==$http_code)\n return true;\n \n }\n else\n echo \"cannot login with '\".$this->email.\"' email and '<font color=\\\"lightgray\\\">\".$this->password.\"</font>' password<br/>\";\n return false;\n }",
"function setEvent() {\n \n if($_POST['am'] == 1){\n $star_time = $_POST['stime_a'] + 12 . \":\". $_POST['stime_b'];\n }else{\n $star_time = $_POST['stime_a'] . \":\". $_POST['stime_b'];\n }\n \n if($_POST['am1'] == 1){\n $end_time = $_POST['stime_c'] + 12 . \":\". $_POST['stime_d'];\n }else{\n $end_time = $_POST['stime_c'] . \":\". $_POST['stime_d'];\n }\n\n $values = array('event_id' => uniqid(),\n 'web_id' => WEB_ID,\n 'title' => $_POST['title'],\n 's_time' => $star_time,\n 'e_time' => $end_time,\n 'date' => date('Y-m-d H:i:s', strtotime($_POST['sDate'])),\n 'location' => $_POST['location'],\n 'description' => $_POST['disc'],\n 'end_date' => date('Y-m-d H:i:s', strtotime($_POST['eDate'])),\n 'visible' => \"on\"\n );\n\n $this->db->insert('events', $values);\n }",
"private function db_add() {\n try {\n db_insert('uc_checkoutpayment_hub_communication')\n ->fields(array(\n 'id' => $this->id,\n 'created' => $this->created,\n 'email' => $this->email,\n 'track_id' => $this->trackId,\n 'value' => $this->value,\n 'currency' => $this->currency,\n 'responseMessage' => $this->responseMessage,\n 'responseCode' => $this->responseCode,\n 'status' => $this->status,\n ))\n ->execute();\n }\n catch (Exception $e) {\n watchdog(\n 'Checkout.com',\n 'Notice: The charge wasn\\'t added to the the local database.\n (:errorMessage)',\n array(\n ':errorMessage' => $e->getMessage(),\n ),\n WATCHDOG_NOTICE\n );\n\n return false;\n }\n\n return true;\n }",
"public function addToDb()\n {\n\n // make sure this is a valid new entry\n if ($this->isValid()) {\n // check for duplicate\n $vals = sprintf(\"('%s',%d)\",$this->email,$this->level);\n $sql = \" insert into Admins values $vals\";\n Dbc::getReader()->Exec($sql);\n }\n else\n print \"<br> Invalid entry. STOP! ($sql)<br>\";\n }",
"function addEntry($formvars) { \n try {\n $rh = $this->pdo->prepare(\"insert into GUESTBOOK values(0,?,NOW(),?)\");\n $rh->execute(array($formvars['Name'],$formvars['Comment']));\n } catch (PDOException $e) {\n print \"Error!: \" . $e->getMessage();\n return false;\n }\t\n return true;\n }",
"function create_community_event(mysqli $conn, $event_ID, $event_date, $event_desc){\r\n $sql = \"INSERT INTO events(event_id, date, details) VALUES ('$event_ID', '$event_date', '$event_desc')\";\r\n $result = $conn->query($sql);\r\n if(!$result){\r\n echo \"Failed to create record\";\r\n // End if()\r\n }\r\n// Close function\r\n}",
"function registerEvents($sqlConnection, $user_id, $cart_id)\n{\n $errorFlag = 0;\n $cart_events_query = mysqli_query($sqlConnection, \"SELECT `event_ids` FROM `carts_info` WHERE `cart_id` = '$cart_id'\");\n if( $cart_events_query && mysqli_num_rows($cart_events_query)==1 )\n {\n $query_result = mysqli_fetch_assoc($cart_events_query);\n $event_ids = json_decode($query_result['event_ids']);\n if( empty($event_ids) )\n {\n echo '<Message>No events are registered</Message>';\n return;\n }\n\n foreach( $event_ids as $event_id )\n {\n $result = mysqli_query($sqlConnection, \"SELECT `event_id` FROM `event_users`\n WHERE `event_id`='$event_id' AND `user_id`='$user_id'\");\n if(mysqli_num_rows($result)==0)\n {\n $regEvent_query = mysqli_query($sqlConnection, \"INSERT INTO `event_users`(`user_id`,`event_id`,`registered_on`)\n VALUES ('$user_id', '$event_id', CURRENT_TIMESTAMP)\" );\n if(!$regEvent_query)\n {\n $errorFlag = 1 ;\n echo '<errorMessage>Trouble registering for Event Event-id:'.$event_id.'</errorMessage>';\n }\n\n }\n }\n if(!$errorFlag){\n echo '<Message>Registered for events successfully</Message>';\n }\n }\n}",
"public function run()\r\n {\r\n \\Illuminate\\Support\\Facades\\DB::table('events')->insert([\r\n [\r\n 'title'=> 'Reunião',\r\n 'start'=>'2020-02-02 12:00:00',\r\n 'end'=>'2020-02-02 14:00:00',\r\n 'color'=>'#c40233',\r\n 'description' => 'Reunião com o cliente'\r\n ],\r\n [\r\n 'title'=> 'Ligar p/ cliente',\r\n 'start'=>'2020-02-02 ',\r\n 'end'=>'2020-02-02 ',\r\n 'color'=>'#c40233',\r\n 'description' => 'falar com cliente',\r\n ]\r\n ]);\r\n }",
"public function run()\n {\n DB::table('events')->insert([\n 'title' => 'Bobs on Vacation',\n 'allDay' => 0,\n 'start' => '2016-12-14',\n 'end' => '2016-12-14',\n 'url' => '',\n 'editable' => '',\n 'startEditable' => '',\n 'durationEditable' => '',\n 'resourceEditable' => '',\n 'overlap' => '',\n 'color' => '',\n 'backgroundColor' => '',\n 'borderColor' => '',\n 'textColor' => ''\n ]);\n\n }",
"public function run()\n {\n DB::table('events')->insert([\n ['caption' =>'Atlas Weekend 2017'],\n ['caption' =>'Грин Грей (Green Grey)']\n ]);\n }",
"function insert_event($eventType,$eventTitle, $userID,$eventDateTime)\n\t{\n\t\t//create your insert statement\n\t\t$insert_stmt = sprintf(\"INSERT INTO event\n\t\t\t\t( eventType, eventTitle, eventHostID, eventDateTime) \n\t\t\t\tVALUES ( '%s', '%s', '%s', '%s')\",\n\t\t\t\t$eventType,$eventTitle, $userID,$eventDateTime);\n\t\t\n\t\t$results = $this->db->query($insert_stmt);\n\t\t$eventID = $this->db->get_id();\n\t\t\n\t\tif($results!=false)\n\t\t{\n\t\t\t$this->response->setResponse(true, $eventID);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->response->setResponse(false,\"\",\"Failed to update any information to event\");\n\t\t}\n\t\treturn $this->response;\n\t}",
"function CreateEvent(){\r\n\t\tif(!isset($_POST['submitted'])){\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n// \t\techo \"in create method\\n\";\r\n\t\t$formvars = array();\r\n\r\n\t\tif(!$this->ValidateEventSubmission()){\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\t$itemPicture = $this->upLoadPic();\r\n\t\tif($itemPicture != false){\r\n\t\t\t$formvars['Eflyer'] = $this->upLoadPic();\r\n\t\t}\r\n\t\t\r\n\t\t$picBanner = $this->upLoadBanner();\r\n\t\tif($picBanner != false){\r\n\t\t\t$formvars['Ebanner'] = $this->upLoadBanner();\r\n\t\t}\r\n\t\t\r\n\t\t$this->CollectEventSubmission($formvars);\r\n\t\t\r\n\t\tif(!$this->SaveEventToDatabase($formvars)){\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\t/*if(!$this->SendUserConfirmationEmail($formvars)){\r\n\t\t\treturn false;\r\n\t\t}*/\r\n\t\t\r\n\t\t//$this->SendAdminIntimationEmail($formvars);\r\n\r\n\t\treturn true;\r\n\t}",
"public function add($data)\n {\n if(count($data) == 0) {\n return false;\n }\n\n return $this->db->table($this->table)->insert(array_merge($data, $this->getTimestamps()));\n }",
"public function testAddEvent()\n\t{\n\t\t$application_id = 1;\n\t\t$event_name = \"addEventEvent\";\n\t\t$stat_name_id = 100;\n\t\t$now = \"String for date\";\n\t\t$history_model = $this->getMock(\n\t\t\t\t\"DB_Models_WritableModel_1\", array(), array(), \"\", FALSE);\n\t\t$history_model\n\t\t\t->expects($this->exactly(4))\n\t\t\t->method(\"__set\");\n\t\t$history_model\n\t\t\t->expects($this->never())\n\t\t\t->method(\"loadBy\");\n\t\t$history_model\n\t\t\t->expects($this->once())\n\t\t\t->method(\"save\");\n\t\t\t\t\n\t\t\n\t\t$name_model = $this->getMock(\n\t\t\t\t\"DB_Models_WritableModel_1\", array(), array(), \"\", FALSE);\n\t\t$name_model\n\t\t\t->expects($this->once())\n\t\t\t->method(\"loadBy\")\n\t\t\t->will($this->returnValue(TRUE));\n\t\t$name_model\n\t\t\t->expects($this->once())\n\t\t\t->method(\"__get\")\n\t\t\t->with($this->equalTo(\"stat_name_id\"))\n\t\t\t->will($this->returnValue($stat_name_id));\n\t\t\n\t\t$event_history = $this->getMock(\n\t\t\t\"VendorAPI_StatPro_Unique_ApplicationEventHistory\",\n\t\t\tarray(\"getNowString\", \"getEventHistoryModel\", \"getEventNameModel\"),\n\t\t\tarray(),\n\t\t\t\"\",\n\t\t\tFALSE);\n\t\t$event_history\n\t\t\t->expects($this->once())\n\t\t\t->method(\"getNowString\")\n\t\t\t->will($this->returnValue($now));\n\t\t$event_history\n\t\t\t->expects($this->once())\n\t\t\t->method(\"getEventHistoryModel\")\n\t\t\t->will($this->returnValue($history_model));\n\t\t$event_history\n\t\t\t->expects($this->once())\n\t\t\t->method(\"getEventNameModel\")\n\t\t\t->will($this->returnValue($name_model));\n\t\t\n\t\t$event_history->addEvent($event_name, $application_id);\n\t}",
"public function add(){\n try{\n $stmt = $this->conn->prepare(\"INSERT INTO tbltodo(title) VALUES(:title)\");\n $stmt->bindparam(\":title\",$this->title);\n $stmt->execute();\n return true;\n }catch(PDOException $e){\n echo $e->getMessage();\n return false;\n }\n }",
"public static function addEventToQueue($event,$action)\n {\n //need to check if the evnet should be added (ie. is it created on a calendar that has google cal support)?\n if (!isset($GLOBALS['com_pbbooking_data']['calendars'][$event->cal_id]->enable_google_cal) || $GLOBALS['com_pbbooking_data']['calendars'][$event->cal_id]->enable_google_cal == 0)\n return true; //doesn't need to be added to the queue\n\n $db = \\JFactory::getDbo();\n $db->insertObject('#__pbbooking_sync',new \\JObject(array(\n 'date_added'=>date_create(\"now\",new \\DateTimeZone(PBBOOKING_TIMEZONE))->format(DATE_ATOM),\n 'action'=>$action,\n 'data'=>json_encode($event)\n )));\n return true;\n }",
"public function testContainsEventUsesCachedAddEvent()\n\t{\n\t\t$application_id = 1;\n\t\t$event_name = \"containsEventEvent\";\n\t\t$new_event = \"NEW EVENT\";\n\t\t$stat_name_id = 1000;\n\t\t$new_stat_name_id = 1001;\n\t\t$now = \"String for date\";\n\t\t$data_rows = new ArrayIterator();\n\t\t$row = new stdClass();\n\t\t$row->stat_name_id = $stat_name_id;\n\t\t$data_rows->append($row);\n\t\t\n\t\t$history_model = $this->getMock(\n\t\t\t\t\"DB_Models_WritableModel_1\", array(), array(), \"\", FALSE);\n\t\t$history_model\n\t\t\t->expects($this->once())\n\t\t\t->method(\"loadAllBy\")\n\t\t\t->with($this->equalTo(array(\"application_id\" => $application_id)))\n\t\t\t->will($this->returnValue($data_rows));\n\t\t\n\t\t$name_model = $this->getMock(\n\t\t\t\t\"DB_Models_WritableModel_1\", array(), array(), \"\", FALSE);\n\t\t$name_model\n\t\t\t->expects($this->once())\n\t\t\t->method(\"loadByKey\")\n\t\t\t->with(array($stat_name_id))\n\t\t\t->will($this->returnValue(TRUE));\n\t\t$name_model\n\t\t\t->expects($this->exactly(2))\n\t\t\t->method(\"__get\")\n\t\t\t->will(\n\t\t\t\t$this->returnValue(strtolower($event_name)),\n\t\t\t\t$this->returnValue($stat_name_id),\n\t\t\t\t$this->returnValue($new_stat_name_id));\n\t\t$name_model\n\t\t\t->expects($this->once())\n\t\t\t->method(\"loadBy\")\n\t\t\t->will($this->returnValue(TRUE));\n\t\t\t\n\t\t$event_history = $this->getMock(\n\t\t\t\"VendorAPI_StatPro_Unique_ApplicationEventHistory\",\n\t\t\tarray(\"getNowString\", \"getEventHistoryModel\", \"getEventNameModel\"),\n\t\t\tarray(),\n\t\t\t\"\",\n\t\t\tFALSE);\n\t\t$event_history\n\t\t\t->expects($this->once())\n\t\t\t->method(\"getNowString\")\n\t\t\t->will($this->returnValue($now));\n\t\t$event_history\n\t\t\t->expects($this->exactly(2))\n\t\t\t->method(\"getEventHistoryModel\")\n\t\t\t->will($this->returnValue($history_model));\n\t\t$event_history\n\t\t\t->expects($this->exactly(2))\n\t\t\t->method(\"getEventNameModel\")\n\t\t\t->will($this->returnValue($name_model));\n\n\t\t$this->assertTrue(\n\t\t\t$event_history->containsEvent($event_name, $application_id));\n\t\t$this->assertFalse(\n\t\t\t$event_history->containsEvent($new_event, $application_id));\n\t\t$event_history->addEvent($new_event, $application_id);\n\t\t$this->assertTrue(\n\t\t\t$event_history->containsEvent($new_event, $application_id));\n\t}",
"public function run()\n {\n DB::table('events')->insert([\n \t[\n\t 'name' => 'Premium Trade Cars BMW MINI Event',\n\t 'start_date' => '2019-07-19',\n\t 'end_date' => '2019-07-21',\n\t 'dealership_id' => 11,\n\t 'created_at' => Carbon::now(),\n\t 'updated_at' => Carbon::now()\n\t ],\n \t[\n\t 'name' => 'Bowker Ribble Valley FCA Group Event',\n\t 'start_date' => '2019-07-26',\n\t 'end_date' => '2019-07-28',\n\t 'dealership_id' => 16,\n\t 'created_at' => Carbon::now(),\n\t 'updated_at' => Carbon::now()\n\t ],\n \t[\n\t 'name' => 'Bowker Blackburn BMW VIP Event 2018',\n\t 'start_date' => '2018-07-26',\n\t 'end_date' => '2018-07-29',\n\t 'dealership_id' => 14,\n\t 'created_at' => Carbon::now(),\n\t 'updated_at' => Carbon::now()\n\t ],\n \t[\n\t 'name' => 'Bowker Blackburn BMW VIP Event 2019',\n\t 'start_date' => '2019-07-19',\n\t 'end_date' => '2019-07-22',\n\t 'dealership_id' => 14,\n\t 'created_at' => Carbon::now(),\n\t 'updated_at' => Carbon::now()\n\t ],\n \t[\n\t 'name' => 'Independent UK Dealership FCA Event',\n\t 'start_date' => '2018-07-26',\n\t 'end_date' => '2018-07-28',\n\t 'dealership_id' => 30,\n\t 'created_at' => Carbon::now(),\n\t 'updated_at' => Carbon::now()\n\t ],\n \t[\n\t 'name' => 'Halliwell Jones Southport BMW VIP Event 2018',\n\t 'start_date' => '2018-07-26',\n\t 'end_date' => '2018-07-29',\n\t 'dealership_id' => 1,\n\t 'created_at' => Carbon::now(),\n\t 'updated_at' => Carbon::now()\n\t ],\n \t[\n\t 'name' => 'Halliwell Jones Southport BMW Q2 VIP Event 2019',\n\t 'start_date' => '2019-07-19',\n\t 'end_date' => '2019-07-22',\n\t 'dealership_id' => 1,\n\t 'created_at' => Carbon::now(),\n\t 'updated_at' => Carbon::now()\n\t ],\n \t[\n\t 'name' => 'Halliwell Jones Wilmslow BMW VIP Event 2018',\n\t 'start_date' => '2018-07-26',\n\t 'end_date' => '2018-07-29',\n\t 'dealership_id' => 5,\n\t 'created_at' => Carbon::now(),\n\t 'updated_at' => Carbon::now()\n\t ],\n \t[\n\t 'name' => 'Halliwell Jones Wilmslow BMW VIP Event 2019',\n\t 'start_date' => '2019-07-19',\n\t 'end_date' => '2019-07-22',\n\t 'dealership_id' => 5,\n\t 'created_at' => Carbon::now(),\n\t 'updated_at' => Carbon::now()\n\t ],\n \t[\n\t 'name' => 'Bowker Preston BMW VIP Event 2018',\n\t 'start_date' => '2018-07-26',\n\t 'end_date' => '2018-07-29',\n\t 'dealership_id' => 12,\n\t 'created_at' => Carbon::now(),\n\t 'updated_at' => Carbon::now()\n\t ],\n \t[\n\t 'name' => 'Bowker Preston BMW VIP Event 2019',\n\t 'start_date' => '2019-07-19',\n\t 'end_date' => '2019-07-22',\n\t 'dealership_id' => 12,\n\t 'created_at' => Carbon::now(),\n\t 'updated_at' => Carbon::now()\n\t ],\n \t[\n\t 'name' => 'LSH Mercedes-Benz Birmingham Central Golden Ticket Event',\n\t 'start_date' => '2019-06-01',\n\t 'end_date' => '2019-06-02',\n\t 'dealership_id' => 17,\n\t 'created_at' => Carbon::now(),\n\t 'updated_at' => Carbon::now()\n\t ],\n \t[\n\t 'name' => 'LSH Mercedes-Benz Erdington Golden Ticket Event',\n\t 'start_date' => '2019-06-01',\n\t 'end_date' => '2019-06-02',\n\t 'dealership_id' => 18,\n\t 'created_at' => Carbon::now(),\n\t 'updated_at' => Carbon::now()\n\t ],\n \t[\n\t 'name' => 'LSH Mercedes-Benz Solihull Golden Ticket Event',\n\t 'start_date' => '2019-06-01',\n\t 'end_date' => '2019-06-02',\n\t 'dealership_id' => 22,\n\t 'created_at' => Carbon::now(),\n\t 'updated_at' => Carbon::now()\n\t ],\n \t[\n\t 'name' => 'LSH Mercedes-Benz Tamworth Golden Ticket Event',\n\t 'start_date' => '2019-06-01',\n\t 'end_date' => '2019-06-02',\n\t 'dealership_id' => 24,\n\t 'created_at' => Carbon::now(),\n\t 'updated_at' => Carbon::now()\n\t ],\n \t[\n\t 'name' => 'LSH Mercedes-Benz Macclesfield Golden Ticket Event',\n\t 'start_date' => '2019-06-01',\n\t 'end_date' => '2019-06-02',\n\t 'dealership_id' => 19,\n\t 'created_at' => Carbon::now(),\n\t 'updated_at' => Carbon::now()\n\t ],\n \t[\n\t 'name' => 'LSH Mercedes-Benz Manchester Central Golden Ticket Event',\n\t 'start_date' => '2019-06-01',\n\t 'end_date' => '2019-06-02',\n\t 'dealership_id' => 20,\n\t 'created_at' => Carbon::now(),\n\t 'updated_at' => Carbon::now()\n\t ],\n \t[\n\t 'name' => 'LSH Mercedes-Benz Manchester Used Golden Ticket Event',\n\t 'start_date' => '2019-06-01',\n\t 'end_date' => '2019-06-02',\n\t 'dealership_id' => 21,\n\t 'created_at' => Carbon::now(),\n\t 'updated_at' => Carbon::now()\n\t ],\n \t[\n\t 'name' => 'LSH Mercedes-Benz Stockport Golden Ticket Event',\n\t 'start_date' => '2019-06-01',\n\t 'end_date' => '2019-06-02',\n\t 'dealership_id' => 23,\n\t 'created_at' => Carbon::now(),\n\t 'updated_at' => Carbon::now()\n\t ],\n \t[\n\t 'name' => 'LSH Mercedes-Benz Whitefield Golden Ticket Event',\n\t 'start_date' => '2019-06-01',\n\t 'end_date' => '2019-06-02',\n\t 'dealership_id' => 25,\n\t 'created_at' => Carbon::now(),\n\t 'updated_at' => Carbon::now()\n\t ],\n \t[\n\t 'name' => 'Opel Gex Showroom VIP Event',\n\t 'start_date' => '2019-04-10',\n\t 'end_date' => '2019-04-13',\n\t 'dealership_id' => 31,\n\t 'created_at' => Carbon::now(),\n\t 'updated_at' => Carbon::now()\n\t ],\n \t[\n\t 'name' => 'Opel Le Cannet Platinum Event',\n\t 'start_date' => '2019-04-24',\n\t 'end_date' => '2019-04-27',\n\t 'dealership_id' => 32,\n\t 'created_at' => Carbon::now(),\n\t 'updated_at' => Carbon::now()\n\t ],\n \t[\n\t 'name' => 'Opel Salon de Provence Premium Event',\n\t 'start_date' => '2019-05-15',\n\t 'end_date' => '2019-05-18',\n\t 'dealership_id' => 33,\n\t 'created_at' => Carbon::now(),\n\t 'updated_at' => Carbon::now()\n\t ],\n \t[\n\t 'name' => 'Opel Rochefort Platinum Event',\n\t 'start_date' => '2019-05-23',\n\t 'end_date' => '2019-05-25',\n\t 'dealership_id' => 34,\n\t 'created_at' => Carbon::now(),\n\t 'updated_at' => Carbon::now()\n\t ],\n \t[\n\t 'name' => 'Opel Lille Showroom VIP Event',\n\t 'start_date' => '2019-05-23',\n\t 'end_date' => '2019-05-25',\n\t 'dealership_id' => 35,\n\t 'created_at' => Carbon::now(),\n\t 'updated_at' => Carbon::now()\n\t ],\n \t[\n\t 'name' => 'Opel Dunkerque Showroom VIP Event',\n\t 'start_date' => '2019-05-23',\n\t 'end_date' => '2019-05-25',\n\t 'dealership_id' => 36,\n\t 'created_at' => Carbon::now(),\n\t 'updated_at' => Carbon::now()\n\t ],\n \t[\n\t 'name' => 'Opel Saint-Quentin Showroom VIP Event',\n\t 'start_date' => '2019-05-23',\n\t 'end_date' => '2019-05-25',\n\t 'dealership_id' => 37,\n\t 'created_at' => Carbon::now(),\n\t 'updated_at' => Carbon::now()\n\t ],\n \t[\n\t 'name' => 'Opel Fontaine-Les-Vervins Showroom VIP Event',\n\t 'start_date' => '2019-05-23',\n\t 'end_date' => '2019-05-25',\n\t 'dealership_id' => 38,\n\t 'created_at' => Carbon::now(),\n\t 'updated_at' => Carbon::now()\n\t ],\n \t[\n\t 'name' => 'Opel Tourcoing Showroom VIP Event',\n\t 'start_date' => '2019-05-23',\n\t 'end_date' => '2019-05-25',\n\t 'dealership_id' => 39,\n\t 'created_at' => Carbon::now(),\n\t 'updated_at' => Carbon::now()\n\t ],\n \t[\n\t 'name' => 'Opel Valenciennes Showroom VIP Event',\n\t 'start_date' => '2019-05-23',\n\t 'end_date' => '2019-05-25',\n\t 'dealership_id' => 40,\n\t 'created_at' => Carbon::now(),\n\t 'updated_at' => Carbon::now()\n\t ],\n \t[\n\t 'name' => 'Opel Villeneuve d\\'Ascq Showroom VIP Event',\n\t 'start_date' => '2019-05-23',\n\t 'end_date' => '2019-05-25',\n\t 'dealership_id' => 41,\n\t 'created_at' => Carbon::now(),\n\t 'updated_at' => Carbon::now()\n\t ],\n \t[\n\t 'name' => 'Opel Laon Showroom VIP Event',\n\t 'start_date' => '2019-05-23',\n\t 'end_date' => '2019-05-25',\n\t 'dealership_id' => 42,\n\t 'created_at' => Carbon::now(),\n\t 'updated_at' => Carbon::now()\n\t ],\n \t[\n\t 'name' => 'Opel Frejus Showroom VIP Event',\n\t 'start_date' => '2019-05-23',\n\t 'end_date' => '2019-05-25',\n\t 'dealership_id' => 45,\n\t 'created_at' => Carbon::now(),\n\t 'updated_at' => Carbon::now()\n\t ],\n \t[\n\t 'name' => 'Opel Soissons Showroom VIP Event',\n\t 'start_date' => '2019-05-23',\n\t 'end_date' => '2019-05-25',\n\t 'dealership_id' => 47,\n\t 'created_at' => Carbon::now(),\n\t 'updated_at' => Carbon::now()\n\t ],\n \t[\n\t 'name' => 'Opel Orléans Showroom VIP Event',\n\t 'start_date' => '2019-05-23',\n\t 'end_date' => '2019-05-25',\n\t 'dealership_id' => 49,\n\t 'created_at' => Carbon::now(),\n\t 'updated_at' => Carbon::now()\n\t ],\n \t[\n\t 'name' => 'Opel Tours Showroom VIP Event',\n\t 'start_date' => '2019-05-23',\n\t 'end_date' => '2019-05-25',\n\t 'dealership_id' => 50,\n\t 'created_at' => Carbon::now(),\n\t 'updated_at' => Carbon::now()\n\t ],\n \t[\n\t 'name' => 'MC Motors Avignon VIP Event',\n\t 'start_date' => '2019-01-18',\n\t 'end_date' => '2019-01-20',\n\t 'dealership_id' => 52,\n\t 'created_at' => Carbon::now(),\n\t 'updated_at' => Carbon::now()\n\t ],\n \t[\n\t 'name' => 'L.Warsemann Auto 37 Tours VIP Event',\n\t 'start_date' => '2019-01-18',\n\t 'end_date' => '2019-01-20',\n\t 'dealership_id' => 53,\n\t 'created_at' => Carbon::now(),\n\t 'updated_at' => Carbon::now()\n\t ],\n \t[\n\t 'name' => 'Nouvelle Excel Auto Rennes VIP Event',\n\t 'start_date' => '2019-01-18',\n\t 'end_date' => '2019-01-20',\n\t 'dealership_id' => 54,\n\t 'created_at' => Carbon::now(),\n\t 'updated_at' => Carbon::now()\n\t ],\n \t[\n\t 'name' => 'Espace 3000 Besançon VIP Event',\n\t 'start_date' => '2019-01-18',\n\t 'end_date' => '2019-01-20',\n\t 'dealership_id' => 55,\n\t 'created_at' => Carbon::now(),\n\t 'updated_at' => Carbon::now()\n\t ],\n \t[\n\t 'name' => 'Europe Garage Services Bourg en Bresse VIP Event',\n\t 'start_date' => '2019-01-18',\n\t 'end_date' => '2019-01-20',\n\t 'dealership_id' => 56,\n\t 'created_at' => Carbon::now(),\n\t 'updated_at' => Carbon::now()\n\t ],\n \t[\n\t 'name' => 'Skoda Paris Est Villemonble VIP Event',\n\t 'start_date' => '2019-01-18',\n\t 'end_date' => '2019-01-20',\n\t 'dealership_id' => 57,\n\t 'created_at' => Carbon::now(),\n\t 'updated_at' => Carbon::now()\n\t ],\n \t[\n\t 'name' => 'NDS City Car Saint-Ouen l\\'Aumone VIP Event',\n\t 'start_date' => '2019-01-18',\n\t 'end_date' => '2019-01-20',\n\t 'dealership_id' => 58,\n\t 'created_at' => Carbon::now(),\n\t 'updated_at' => Carbon::now()\n\t ],\n \t[\n\t 'name' => 'Excel Motors Nancy VIP Event',\n\t 'start_date' => '2019-01-18',\n\t 'end_date' => '2019-01-20',\n\t 'dealership_id' => 59,\n\t 'created_at' => Carbon::now(),\n\t 'updated_at' => Carbon::now()\n\t ],\n \t[\n\t 'name' => 'Premium Picardie Amiens VIP Event',\n\t 'start_date' => '2019-01-18',\n\t 'end_date' => '2019-01-20',\n\t 'dealership_id' => 60,\n\t 'created_at' => Carbon::now(),\n\t 'updated_at' => Carbon::now()\n\t ],\n \t[\n\t 'name' => 'WelcomCar Orléans VIP Event',\n\t 'start_date' => '2019-01-18',\n\t 'end_date' => '2019-01-20',\n\t 'dealership_id' => 61,\n\t 'created_at' => Carbon::now(),\n\t 'updated_at' => Carbon::now()\n\t ],\n \t[\n\t 'name' => 'Carlier Automobiles Douai VIP Event',\n\t 'start_date' => '2019-01-18',\n\t 'end_date' => '2019-01-20',\n\t 'dealership_id' => 62,\n\t 'created_at' => Carbon::now(),\n\t 'updated_at' => Carbon::now()\n\t ],\n \t[\n\t 'name' => 'Nice Car SA Nice VIP Event',\n\t 'start_date' => '2019-01-18',\n\t 'end_date' => '2019-01-20',\n\t 'dealership_id' => 63,\n\t 'created_at' => Carbon::now(),\n\t 'updated_at' => Carbon::now()\n\t ],\n \t[\n\t 'name' => 'Riviera Technic Cannes VIP Event',\n\t 'start_date' => '2019-01-18',\n\t 'end_date' => '2019-01-20',\n\t 'dealership_id' => 64,\n\t 'created_at' => Carbon::now(),\n\t 'updated_at' => Carbon::now()\n\t ],\n \t[\n\t 'name' => 'Peyo Automobiles Bayonne VIP Event',\n\t 'start_date' => '2019-01-18',\n\t 'end_date' => '2019-01-20',\n\t 'dealership_id' => 65,\n\t 'created_at' => Carbon::now(),\n\t 'updated_at' => Carbon::now()\n\t ],\n \t[\n\t 'name' => 'L.G.A. La Rochelle VIP Event',\n\t 'start_date' => '2019-01-18',\n\t 'end_date' => '2019-01-20',\n\t 'dealership_id' => 66,\n\t 'created_at' => Carbon::now(),\n\t 'updated_at' => Carbon::now()\n\t ],\n \t[\n\t 'name' => 'Saphir Automobiles Montpellier VIP Event',\n\t 'start_date' => '2019-01-18',\n\t 'end_date' => '2019-01-20',\n\t 'dealership_id' => 67,\n\t 'created_at' => Carbon::now(),\n\t 'updated_at' => Carbon::now()\n\t ],\n \t[\n\t 'name' => 'Vega Automobile Brétigny sur Orge VIP Event',\n\t 'start_date' => '2019-01-18',\n\t 'end_date' => '2019-01-20',\n\t 'dealership_id' => 68,\n\t 'created_at' => Carbon::now(),\n\t 'updated_at' => Carbon::now()\n\t ],\n \t[\n\t 'name' => 'Espace Automobiles Nîmois Nîmes VIP Event',\n\t 'start_date' => '2019-01-18',\n\t 'end_date' => '2019-01-20',\n\t 'dealership_id' => 69,\n\t 'created_at' => Carbon::now(),\n\t 'updated_at' => Carbon::now()\n\t ],\n \t[\n\t 'name' => 'Feyaerts VIP Event',\n\t 'start_date' => '2018-05-30',\n\t 'end_date' => '2018-06-02',\n\t 'dealership_id' => 70,\n\t 'created_at' => Carbon::now(),\n\t 'updated_at' => Carbon::now()\n\t ],\n \t[\n\t 'name' => 'Ciac VIP Event',\n\t 'start_date' => '2018-06-06',\n\t 'end_date' => '2018-06-09',\n\t 'dealership_id' => 71,\n\t 'created_at' => Carbon::now(),\n\t 'updated_at' => Carbon::now()\n\t ],\n \t[\n\t 'name' => 'Morren St Truiden VIP Event',\n\t 'start_date' => '2018-10-10',\n\t 'end_date' => '2018-10-13',\n\t 'dealership_id' => 72,\n\t 'created_at' => Carbon::now(),\n\t 'updated_at' => Carbon::now()\n\t ],\n \t[\n\t 'name' => 'Morren Diest VIP Event',\n\t 'start_date' => '2018-10-24',\n\t 'end_date' => '2018-10-27',\n\t 'dealership_id' => 73,\n\t 'created_at' => Carbon::now(),\n\t 'updated_at' => Carbon::now()\n\t ],\n \t[\n\t 'name' => 'AB Automotive VIP Event',\n\t 'start_date' => '2018-10-10',\n\t 'end_date' => '2018-10-13',\n\t 'dealership_id' => 74,\n\t 'created_at' => Carbon::now(),\n\t 'updated_at' => Carbon::now()\n\t ],\n \t[\n\t 'name' => 'Driessen VIP Event',\n\t 'start_date' => '2018-12-06',\n\t 'end_date' => '2018-12-09',\n\t 'dealership_id' => 75,\n\t 'created_at' => Carbon::now(),\n\t 'updated_at' => Carbon::now()\n\t ],\n \t[\n\t 'name' => 'Hasselt Motor VIP Event',\n\t 'start_date' => '2018-12-13',\n\t 'end_date' => '2018-12-16',\n\t 'dealership_id' => 76,\n\t 'created_at' => Carbon::now(),\n\t 'updated_at' => Carbon::now()\n\t ],\n \t[\n\t 'name' => 'Van Hoye VIP Event',\n\t 'start_date' => '2018-12-20',\n\t 'end_date' => '2018-12-23',\n\t 'dealership_id' => 77,\n\t 'created_at' => Carbon::now(),\n\t 'updated_at' => Carbon::now()\n\t ],\n \t[\n\t 'name' => 'Matel Motors VIP Event',\n\t 'start_date' => '2018-05-23',\n\t 'end_date' => '2018-05-26',\n\t 'dealership_id' => 78,\n\t 'created_at' => Carbon::now(),\n\t 'updated_at' => Carbon::now()\n\t ],\n \t[\n\t 'name' => 'De Doncker VIP Event',\n\t 'start_date' => '2018-06-06',\n\t 'end_date' => '2018-06-09',\n\t 'dealership_id' => 79,\n\t 'created_at' => Carbon::now(),\n\t 'updated_at' => Carbon::now()\n\t ],\n \t[\n\t 'name' => 'SPIRLET Auto VIP Event',\n\t 'start_date' => '2018-06-06',\n\t 'end_date' => '2018-06-09',\n\t 'dealership_id' => 80,\n\t 'created_at' => Carbon::now(),\n\t 'updated_at' => Carbon::now()\n\t ],\n \t[\n\t 'name' => 'Centre Motor VIP Event',\n\t 'start_date' => '2018-12-06',\n\t 'end_date' => '2018-12-08',\n\t 'dealership_id' => 81,\n\t 'created_at' => Carbon::now(),\n\t 'updated_at' => Carbon::now()\n\t ],\n \t[\n\t 'name' => 'Colson VIP Event',\n\t 'start_date' => '2018-11-28',\n\t 'end_date' => '2018-12-01',\n\t 'dealership_id' => 82,\n\t 'created_at' => Carbon::now(),\n\t 'updated_at' => Carbon::now()\n\t ],\n \t[\n\t 'name' => 'Vanspringel VIP Event',\n\t 'start_date' => '2018-12-05',\n\t 'end_date' => '2018-12-08',\n\t 'dealership_id' => 83,\n\t 'created_at' => Carbon::now(),\n\t 'updated_at' => Carbon::now()\n\t ],\n \t[\n\t 'name' => 'Premium Trade Cars All Brand Event',\n\t 'start_date' => '2019-07-26',\n\t 'end_date' => '2019-07-28',\n\t 'dealership_id' => 11,\n\t 'created_at' => Carbon::now(),\n\t 'updated_at' => Carbon::now()\n\t ],\n \t[\n\t 'name' => 'Halliwell Jones Southport BMW Q3 VIP Event 2019',\n\t 'start_date' => '2019-10-31',\n\t 'end_date' => '2019-11-02',\n\t 'dealership_id' => 1,\n\t 'created_at' => Carbon::now(),\n\t 'updated_at' => Carbon::now()\n\t ],\n\t ]);\n }"
] | [
"0.7360152",
"0.7331752",
"0.7064151",
"0.6982781",
"0.6830418",
"0.679996",
"0.6785588",
"0.67130995",
"0.66547555",
"0.6611412",
"0.6593834",
"0.65847814",
"0.6579994",
"0.65775585",
"0.65764797",
"0.6549434",
"0.6531268",
"0.6512294",
"0.648801",
"0.6417618",
"0.6402654",
"0.63823783",
"0.63721335",
"0.6294931",
"0.6288582",
"0.6281928",
"0.62804884",
"0.62793046",
"0.6255666",
"0.62447166",
"0.62389463",
"0.6237586",
"0.6220243",
"0.6202571",
"0.61968076",
"0.617914",
"0.61734164",
"0.61717165",
"0.6148538",
"0.61480653",
"0.6123784",
"0.6118378",
"0.61138785",
"0.61129856",
"0.6088855",
"0.60858595",
"0.60771424",
"0.6073228",
"0.6044575",
"0.6020159",
"0.6013244",
"0.6003398",
"0.59995866",
"0.59932804",
"0.5982564",
"0.5980904",
"0.5980553",
"0.59732586",
"0.59668595",
"0.5957726",
"0.5948536",
"0.59465015",
"0.59453285",
"0.5945116",
"0.5938181",
"0.59293216",
"0.59292245",
"0.59245837",
"0.5920605",
"0.59197634",
"0.5900345",
"0.58981866",
"0.5881568",
"0.58701295",
"0.58489454",
"0.58280134",
"0.5820849",
"0.5814354",
"0.5811658",
"0.58113134",
"0.58065736",
"0.57723135",
"0.57624644",
"0.576128",
"0.5752336",
"0.5749276",
"0.5730556",
"0.57232803",
"0.57130796",
"0.5712702",
"0.5711454",
"0.57043976",
"0.5694403",
"0.5690409",
"0.5690258",
"0.5687101",
"0.56772274",
"0.56743956",
"0.56706417",
"0.5669013",
"0.5656778"
] | 0.0 | -1 |
Gets all Categories since version 1.4 Returns array | public function getCategories()
{
// Set default category in case the user do not have categories with events
$results = $this->categories;
asort($results);
$return = array_unique(array_filter($results));
if(count($return) == 0)
{
return false;
} else {
return $return;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getAllCategories();",
"function getAllCategories()\n {\n return $this->data->getAllCategories();\n }",
"public function getCategories() : array;",
"public function get_categories () {\n\t\treturn Category::all();\n\t}",
"public function getCategories();",
"public function getCategories();",
"function GetCategories()\n\t{\n\t\t$result = $this->sendRequest(\"GetCategories\", array());\t\n\t\treturn $this->getResultFromResponse($result);\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 static function getCategories()\n\t{\n\t\treturn Category::getAll();\n\t}",
"public function allCategories()\n {\n return Category::all();\n }",
"public static function getCategories(){\n $categories = Category::all()->toArray();\n\n return $categories;\n }",
"public function getCategories()\n {\n return Category::all();\n }",
"public function getAllCategories(){\r\n\t\treturn $this->query(\"SELECT * FROM category\");\r\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 static function categories() {\n $db = Db::getInstance();\n $req = $db->query('SELECT * FROM category');\n return $req->fetchAll(PDO::FETCH_ASSOC);\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 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 getAllCategories()\n\t{\n\t\t$categories= Category::all();\n\t\treturn $categories;\n\t}",
"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 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 getCategories()\n {\n $request = \"SELECT * FROM category\";\n $request = $this->connexion->query($request);\n $categories = $request->fetchAll(PDO::FETCH_ASSOC);\n return $categories;\n }",
"public static function getAll() {\n self::checkConnection();\n $results = self::$connection->execute(\"SELECT * FROM category;\");\n $categories = array();\n foreach ($results as $category_arr) {\n array_push($categories, new Category($category_arr));\n }\n return $categories;\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}",
"public function getCategories()\n\t{\n\t\treturn BlogCategory::all();\t\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}",
"private function fetchAllCategories()\n {\n $sql = '\n SELECT * FROM Rm_Category;\n ';\n\n $res = $this->db->executeSelectQueryAndFetchAll($sql);\n\n $categoriesArray = array();\n foreach ($res as $key => $row) {\n $name = $row->name;\n $categoriesArray[] = $name;\n }\n\n return $categoriesArray;\n }",
"public function getAllCategories() {\n\n if (!isset(parent::all()[0])) {\n return [];\n }\n return parent::all()[0]->children;\n }",
"public static function getCategories()\n {\n \t$query = \"SELECT * FROM categories\";\n \t$result = DB::select($query);\n\n \treturn $result;\n }",
"public static function getCategories() {\n return Catalog::category()->orderBy('weight')->orderBy('name')->all();\n }",
"public function getCategories(){\n return Category::get();\n }",
"public function listCategories()\n {\n $categories = Category::all();\n\n return $categories;\n }",
"public function getCategoriesAll()\n {\n return $this->where('cat_active', 1)->with('subcategories')->get();\n }",
"public function listCategories(){\n\t\t$lab = new lelabDB();\n\t\t$query = \"select * from $this->tableName order by id\";\n\t\t$result = $lab->getArray($query);\n\t\treturn $result;\n\t}",
"public function getCategoriesList() {\n return $this->_get(16);\n }",
"public function getCategories(){\n\t\t$query = \"SELECT * FROM final_categoria\";\n\t\treturn $this->con->action($query);\n\t}",
"public function categories(): array\n {\n return $this->categories;\n }",
"private function getAllCategory() {\n $repository = $this->getDoctrine()\n ->getRepository('AppBundle:Category');\n\n return $repository->\n findBy(\n [],\n ['name' => 'ASC']\n );\n }",
"public function read_all_categories()\n {\n $result = array(\n \"status\" => \"\" ,\n \"body\" => array(\n \"categories\" => array(\n \"id\" => 0,\n \"category_name\" => \"\"\n ),\n \"count\" => 0\n ),\n \"error\" => array()\n );\n $sql = \"SELECT * FROM categories\";\n $stmt = $this->db->prepare($sql);\n $stmt->execute();\n $res = $stmt->get_result();\n $result['body']['count'] = $res->num_rows;\n if ($res->num_rows > 0){\n $result['status'] = \"Categories read \";\n while($row = $res->fetch_assoc()){\n $data = array(\n \"id\" => $row[\"id\"],\n \"category_name\" => $row['categoryName']\n );\n array_push($result['body']['categories'], $data);\n }\n } else {\n $result['status'] = \"No categories found \";\n }\n return $result;\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 categories() : array\n {\n return $this->categories;\n }",
"public static function getAllCategories()\n {\n $return = (array) FrontendModel::get('database')->getRecords(\n 'SELECT c.id, c.title AS label, COUNT(c.id) AS total\n FROM menu_categories AS c\n INNER JOIN menu_alacarte AS i ON c.id = i.category_id AND c.language = i.language\n GROUP BY c.id\n ORDER BY c.sequence ASC',\n array(), 'id'\n );\n\n // loop items and unserialize\n foreach ($return as &$row) {\n if (isset($row['meta_data'])) {\n $row['meta_data'] = @unserialize($row['meta_data']);\n }\n }\n\n return $return;\n }",
"public function getAllCategory()\n {\n $sql = \"SELECT * FROM categories\";\n $stmt = $this->connect()->prepare($sql);\n $stmt->execute();\n $result = $stmt->fetchAll(PDO::FETCH_ASSOC);\n $id = '';\n $items = $result;\n return $items;\n }",
"function getCategories() {\n $this->db->select(\"*\");\n $query = $this->db->get('post_category');\n if ($query->num_rows() > 0) {\n return $query->result_array();\n }\n return array();\n }",
"public function getAllCategories() {\n $q = $this->db->get('categories');\n if ($q->num_rows() > 0) {\n foreach (($q->result()) as $row) {\n $data[] = $row;\n }\n return $data;\n }\n return false;\n }",
"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 findAllCategories(): iterable;",
"public function getAllCategories() :array\n {\n $query = $this->pdo->query('SELECT id,name FROM categories');\n $row = $query->fetchALL(PDO::FETCH_ASSOC);\n $categories = [];\n foreach ($row as $r)\n array_push($categories, $this->mapArrayToCategory($r));\n return $categories;\n }",
"public function categories()\n {\n return $this->apiResponse(Items::$categories, 2678400);\n }",
"protected function findAllCategories()\n {\n return resolve([]);\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 {\n return $this->categories;\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 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 getCategories(): array{\r\n $category = array();\r\n $con = $this->db->getConnection();\r\n foreach(mysqli_query($con, 'SELECT * FROM categories')as $key){ $category[$key['idcategories']] = $key['category_name']; }\r\n return $category;\r\n $this->con->closeConnection();\r\n }",
"public static function getCategoriesList(){\n\n //Подключаемся к БД:\n $db = DB::getConnection();\n\n $categoruList = array();\n\n $sql = 'SELECT id, name FROM category '\n . ' WHERE status = \"1\" '\n . 'ORDER BY sort_order ASC';\n\n //dd($sql);\n\n $result = $db->query($sql);\n\n\n $i = 0;\n\n while($row = $result->fetch()){\n $categoruList[$i]['id'] = $row['id'];\n $categoruList[$i]['name'] = $row['name'];\n $i++;\n }\n\n return $categoruList;\n\n }",
"public function getCategoryList()\n {\n// return $this->categoryList = DB::table('categories')->get();\n return $this->categoryList = Categories::all();\n }",
"public static function all() {\n $list = [];\n $db = Db::getInstance();\n $req = $db->query('SELECT * FROM categories');\n\n // we create a list of Category objects from the database results\n foreach($req->fetchAll() as $category) {\n $list[] = new Category($category['id'], $category['name']);\n }\n\n return $list;\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 static function getCategoriesArray() {\n global $lC_CategoryTree;\n \n $result = lC_Products_Admin::getCategoriesArray($_GET['cid']);\n $result['rpcStatus'] = RPC_STATUS_SUCCESS;\n\n echo json_encode($result);\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 all()\n {\n return $this->category->all();\n }",
"public static function getCategoriesList()\r\n {\r\n\r\n $db = Db::getConnection();\r\n\r\n $categoryList = array();\r\n\r\n $result = $db->query('SELECT id, name, status FROM category '\r\n . 'ORDER BY sort_order ASC');\r\n\r\n $i = 0;\r\n while ($row = $result->fetch()) {\r\n $categoryList[$i]['id'] = $row['id'];\r\n $categoryList[$i]['name'] = $row['name'];\r\n $categoryList[$i]['status'] = $row['status'];\r\n $i++;\r\n }\r\n\r\n return $categoryList;\r\n }",
"public function getCategories() {\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 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 listsCategoriesGet()\r\n {\r\n $response = Category::all();\r\n return response()->json($response, 200);\r\n }",
"public function getCategories()\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}",
"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 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}",
"function Categories() {\n\t\treturn DataObject::get('categoryobject', '', 'Title');\n\t}",
"public function getAll():array\n {\n $productCategoryDAO = new ProductCategoryDAO();\n $productCategories = $productCategoryDAO->getAll();\n \n return $productCategories;\n }",
"public function getListOfAllCategories()\n {\n $queryResult = $this->dataBase->query(\"SELECT * FROM `categories`\");\n $categoriesList = [];\n $i = 0;\n\n while ($tableRow = $queryResult->fetch()) {\n $categoriesList[$i][\"id\"] = $tableRow[\"id\"];\n $categoriesList[$i][\"parent_category_id\"] = $tableRow[\"parent_category_id\"];\n $categoriesList[$i][\"category_english\"] = $tableRow[\"category_english\"];\n $categoriesList[$i][\"category_ukrainian\"] = $tableRow[\"category_ukrainian\"];\n $categoriesList[$i][\"category_russian\"] = $tableRow[\"category_russian\"];\n $categoriesList[$i][\"created_time\"] = $tableRow[\"created_time\"];\n\n $i++;\n }\n\n return $categoriesList;\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 getList()\n {\n $categories = array();\n\n $q = $this->_db->query('SELECT * FROM categorie ORDER BY idCategorie');\n\n while ($donnees = $q->fetch(PDO::FETCH_ASSOC))\n {\n $categories[] = ($donnees);\n \n }\n }",
"public static function getCategoryList()\n {\n\n $db = Db::getConnection();\n\n $serviceList = array();\n\n $result = $db->query('SELECT id, name FROM categories '\n . 'ORDER BY id ASC');\n\n $i = 0;\n while ($row = $result->fetch()) {\n $serviceList[$i]['id'] = $row['id'];\n $serviceList[$i]['name'] = $row['name'];\n $i++;\n }\n\n return $serviceList;\n\n }",
"public function getCategoriesList()\n {\n $categoryList = Category::where('status', 1)\n ->orderBy('sort_order', 'asc')\n ->orderBy('name', 'asc')\n ->get(['id', 'name']);\n\n return $categoryList;\n }",
"public static function getCategoriesList()\n {\n\n $db = Db::getConnection();\n\n $categoryList = array();\n\n $result = $db->query('SELECT id, name FROM category '\n . 'ORDER BY sort_order ASC');\n\n $i = 0;\n while ($row = $result->fetch()) {\n $categoryList[$i]['id'] = $row['id'];\n $categoryList[$i]['name'] = $row['name'];\n $i++;\n }\n\n return $categoryList;\n }",
"function category_list() {\n $query = $this->db->get(\"categories\");\n return $query->result_array();\n }",
"protected function getCategories()\n {\n if (! is_null($this->categories)) {\n return $this->categories;\n }\n\n $categories = $this->app['sanatorium.categories.category']->findAll();\n\n foreach ($categories as $category) {\n $category->uri = $category->url === '/' ? null : $category->url;\n }\n\n return $this->categories = $categories;\n }",
"public function getCategories() {\n $stmt = $this->pdo->prepare(\"SELECT * FROM $this->table WHERE parent is null ORDER BY name ASC\");\n $stmt->setFetchMode(\\PDO::FETCH_CLASS, '\\App\\Model\\Category\\ProductCategoryModel');\n $stmt->execute();\n return $stmt->fetchAll();\n }",
"public function getCategories()\n {\n return $this->request(\"core_course_get_categories\");\n }",
"public function getAll()\n {\n return CategorieResource::collection(Categorie::paginate());\n }",
"public function getAllCategoriesfromModel() \r\n { \r\n\t $categories=array();\r\n\t $categories = $this->controllercategories->getAllCategory();\r\n\t return $categories;\r\n\t}",
"public function get_categories()\n\t{\n\t\treturn $this->_categories;\n\t}",
"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}",
"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}",
"function fetchAllCategory()\n\t{\t\t\n\t\t$query = $this->db->get('tbl_category');\n\t\treturn $query->result_array();\n\t\n\t}",
"function categories() {\n\n foreach ($this->loadCategoryAssoc() as $id=>$title) {\n $options[] = array(\n 'id' => intval($id),\n 'title' => $title,\n );\n }\n\n return $options;\n }",
"public function all()\n {\n return new CategoryCollection(Category::whereUserId(Auth::id())->ordered()->get());\n }",
"public function getAllWithCategory();",
"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}",
"function getAllCategories(){\r\n $query = $this->db->query(\"SELECT * FROM category\");\r\n return $query->result_array();\r\n }"
] | [
"0.8531883",
"0.84719044",
"0.8419109",
"0.83580023",
"0.8353047",
"0.8353047",
"0.8338258",
"0.83321434",
"0.8321939",
"0.82785213",
"0.8264174",
"0.82355285",
"0.8223289",
"0.8219341",
"0.8208088",
"0.82002515",
"0.81709176",
"0.81680906",
"0.8124223",
"0.8097688",
"0.8059719",
"0.803481",
"0.7989394",
"0.7976907",
"0.7967948",
"0.7958602",
"0.79458004",
"0.7944713",
"0.7932144",
"0.7931354",
"0.7919559",
"0.7918897",
"0.79125273",
"0.7894937",
"0.7890795",
"0.78870267",
"0.7862286",
"0.7859613",
"0.78415406",
"0.7809872",
"0.7809775",
"0.7798711",
"0.7789734",
"0.777631",
"0.7757253",
"0.7735807",
"0.7724994",
"0.77194554",
"0.77163535",
"0.7714591",
"0.7714591",
"0.7714591",
"0.7714591",
"0.7714591",
"0.7714591",
"0.7714591",
"0.7714591",
"0.7714591",
"0.7714591",
"0.7697317",
"0.7694802",
"0.76868725",
"0.7668557",
"0.76633996",
"0.7656866",
"0.76534283",
"0.7652864",
"0.76521385",
"0.763603",
"0.76335955",
"0.7630033",
"0.7627118",
"0.7626945",
"0.7608744",
"0.7604101",
"0.75911593",
"0.7587969",
"0.7581633",
"0.75812405",
"0.7580918",
"0.75793344",
"0.757788",
"0.7571157",
"0.7568681",
"0.7565268",
"0.75468016",
"0.75429654",
"0.75398064",
"0.7538874",
"0.7535887",
"0.7532621",
"0.7532244",
"0.7527854",
"0.7526795",
"0.7519993",
"0.7516496",
"0.7516355",
"0.7511956",
"0.75072306",
"0.7505063",
"0.75019896"
] | 0.0 | -1 |
This function deletes event from database Returns true | public function delete($id)
{
// Delete Query
$query = "DELETE FROM $this->table WHERE id = $id";
// Result
$this->result = mysqli_query($this->connection, $query);
if($this->result)
{
return true;
} else {
return false;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function delete(){\n\t\t$eventDet = $this->get_full_details();\n\t\t//print_r($eventDet);\n\t\t#unlink all images for the event\n\t\tif ($eventDet->news_image_logo) { \n\t\t\t//unlink($this->imgPath.$eventDet->news_image_logo);\n\t\t}\n\t\tif ($eventDet->news_photo1) { \n\t\t\tunlink($this->imgPath.$eventDet->news_photo1);\n\t\t}\n\t\tif ($eventDet->news_photo2) { \n\t\t\tunlink($this->imgPath.$eventDet->news_photo2);\n\t\t}\n\t\tif ($eventDet->news_photo3) { \n\t\t\tunlink($this->imgPath.$eventDet->news_photo3);\n\t\t}\t\t\t\t\t\t\n\t\t\n\t\t#remove event entry from the db\n\t\tglobal $db;\n\t\t$sQl = \"delete from cms_news where id = '\".$this->event_id.\"'\";\n\t\tif ($db->query($sQl)){\n\t\t\t$this->message = \"Event \".$eventDet->news_title.\" deleted successfully\";\n\t\t\treturn true;\n\t\t} else {\n\t\t\t$this->error = \"Cannot delete Event \".$eventDet->news_title.\"\";\n\t\t\treturn false;\n\t\t}\n\t}",
"public function delete(Event $event){\r\n $stmt = $this->db->prepare(\"DELETE FROM event WHERE id_event = ?\");\r\n $stmt->execute(array($event->getIdEvent()));\r\n }",
"public function deleteEvent($id) {\r\n$array = array('event_id' => $id);\r\n$success = $this->db->delete('events', $array);\r\nreturn $success;\r\n}",
"public function deleteEventByID($event_id)\n{\n $this->load->database();\n\n $query = \"delete from event where event_id = $event_id\";\n $result = $this->db->query($query);\n return ($result);\n}",
"public function testDeleteValidEvent() : void {\n // count the number of rows and save it for later\n $numRows = $this->getConnection()->getRowCount(\"event\");\n\n // create a new Event and insert into mySQL\n $eventId = generateUuidV4();\n\t\t $event = new Event ($eventId, $this->profile->getProfileId(), $this->VALID_EVENTATTENDEELIMIT,$this->VALID_EVENTDETAIL, $this->VALID_EVENTENDDATETIME,$this->VALID_EVENTIMAGE, $this->VALID_EVENTLAT, $this->VALID_EVENTLONG, $this->VALID_EVENTNAME, $this->VALID_EVENTPRICE, $this->VALID_EVENTSTARTDATETIME);\n\t\t $event->insert($this->getPDO());\n\n\n // delete the Event from mySQL\n $this->assertEquals($numRows + 1, $this->getConnection()->getRowCount(\"event\"));\n $event->delete($this->getPDO());\n\n //grab the data from mySQQL and enforce the Event does not exist\n $pdoEvent = Event::getEventByEventId($this->getPDO(), $event->getEventId());\n $this->assertNull($pdoEvent);\n $this->assertEquals($numRows, $this->getConnection()->getRowCount(\"event\"));\n }",
"public function delete()\n {\n if (empty($this->id)) {\n return false;\n }\n\n $db = $this->getDB();\n $db->addWhere('id', $this->id);\n\n $result = $db->delete();\n\n if (!PHPWS_Error::isError($result)) {\n $db2 = new PHPWS_DB('phpws_key');\n $db2->addWhere('module', 'calendar');\n $db2->addWhere('item_name', 'event' . $this->id);\n PHPWS_Error::logIfError($db2->delete());\n return PHPWS_DB::dropTable($this->getEventTable());\n } else {\n if (PHPWS_Settings::get('calendar', 'public_schedule') == $this->id) {\n PHPWS_Settings::set('calendar', 'public_schedule', 0);\n PHPWS_Settings::save('calendar');\n }\n return $result;\n }\n }",
"function deleteEventFromDatabase($database) {\r\n\t\t//delete statement\r\n\t\t$statement = \"DELETE FROM reminders WHERE eventName='$this->name' && email='$this->email' && phoneNumber='$this->phone_number'\";\r\n\t\t\r\n\t\t//delete query or die\r\n\t\t$database->query($statement) or die(\"Unable to delete event. \" . $database->error);\r\n\t}",
"function deleteEvent($eventToDelete, $userID){\n\n $date = $eventToDelete[\"date\"];\n\n require_once 'model/dbConnector.php';\n\n //supprimer uniquement l'event choisi\n if($eventToDelete[\"sup\"] != \"\"){\n\n if($eventToDelete[\"recurrence\"] != 0){\n\n $suppQuery2='DELETE from `event-recurrence` where ID = :id';\n $suppData2= array(\":id\" => $eventToDelete['sup']);\n\n $result = executeQueryInsert($suppQuery2, $suppData2);\n\n }\n else{\n $suppQuery='DELETE from events where ID = :id AND FKusers = :idUser';\n $suppData= array(\":id\" => $eventToDelete['sup'], \":idUser\" => $userID);\n\n $result = executeQueryInsert($suppQuery, $suppData);\n }\n\n }\n //supprimer l'event et toutes les recurrences\n if($eventToDelete[\"supAll\"] != \"\"){\n\n $suppQuery2='DELETE from `event-recurrence` where FKevents = :id';\n $suppData2= array(\":id\" => $eventToDelete['supAll']);\n\n $result2 = executeQueryInsert($suppQuery2, $suppData2);\n\n $suppQuery='DELETE from events where ID = :id AND FKusers = :idUser';\n $suppData= array(\":id\" => $eventToDelete['supAll'], \":idUser\" => $userID);\n\n $result = executeQueryInsert($suppQuery, $suppData);\n\n }\n //supprimer l'event choisi et les suivantes recurrences\n if($eventToDelete[\"supAfter\"] != \"\"){\n\n $suppQuery=\"DELETE FROM `event-recurrence` WHERE FKevents = :id AND date > '$date' \";\n $suppData= array(\":id\" => $eventToDelete['supAfter']);\n\n $result = executeQueryInsert($suppQuery, $suppData);\n\n }\n\n return $result;\n}",
"function deleteEvent($eventId) {\n if (!is_int($eventId)) {\n return FALSE;\n }\n $this->deleteRecommendations($eventId);\n $this->_deleteWeekdays($eventId);\n $this->_deleteMonths($eventId);\n return $this->databaseDeleteRecord($this->tableEvents, 'event_id', $eventId);\n }",
"public function deleteStudentInfoFromEventTable(){\n \n $deleteId = $_POST[\"edeleteId\"];\n \n if ($this->databaseConnection()){\n $queryDelete = $this->db_connection->prepare('DELETE FROM events WHERE eid = :deleteId');\n $queryDelete->bindValue(':deleteId', $deleteId ,PDO::PARAM_INT);\n $queryDelete->execute();\n // Return something to display the we have delete the entry \n }\n }",
"function deleteEvent($eid){\r\n\t\tif(!$this->dltUpdtEvent($eid)){\r\n\t\t\t$this->HandleDBError(\"<script>alert('Sorry couldn't delete your event!'); </script>\");\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\treturn 1; //false then show alert messsage.\r\n\t}",
"function deleteEventFromDatabaseById($database) {\r\n\t\t//delete statement\r\n\t\t$statement = \"DELETE FROM reminders WHERE id=\" . $this->id;\r\n\t\t\r\n\t\t//delete query or die\r\n\t\t$database->query($statement) or die(\"Error with mysql query. \" . $database->error);\r\n\t}",
"public static function delete($event_id)\n\t{\n\t\tif (!$event_id) {\n goto fail;\n\t\t}\n\n \t\t$database = DatabaseFactory::getFactory()->getConnection();\n\n\t\t$sql = \"DELETE FROM events WHERE id = :event_id LIMIT 1\";\n\t\t$query = $database->prepare($sql);\n\t\t$query->execute(array(':event_id' => $event_id));\n\n\t\tif ($query->rowCount() == 1) {\n\t\t\treturn true;\n\t\t}\n\n fail:\n\t\tSession::add('feedback_negative', Text::get('FEEDBACK_FILM_DELETION_FAILED'));\n\t\treturn false;\n\t}",
"public function delete_event($nome, $data){\n $sql=\"DELETE FROM \".static::getTables().\" WHERE nome= '\".$nome.\"' and data_e= '\".$data.\"' ;\";\n if(parent::delete($sql))\n return true;\n else\n return false;\n }",
"function deleteEvent($PK_eventID)\n\t{\n\t\t//Perform delete query\n\t\t$delete_query = \"DELETE FROM event \n\t\t\t\t\t\t WHERE PK_eventID = '$PK_eventID'\";\n\t\t$delete_result = mysql_query($delete_query);\n\t\tif(!$delete_result)\n\t\t{\n\t\t\techo(\"<br><br><p class=\\\"error\\\">Error in DELETE query: \" . mysql_error() . \"</p>\\n\");\n\t\t}\n\t}",
"function dbdelete(){\n\t\tif($this->id){\n\t\t\t$query = \"DELETE FROM \".$this->tablename.\" WHERE id='\".$this->id.\"' LIMIT 1\";\n\t\t\tif(mysql_query($query)){\n\t\t\t\treturn $this->ondelete();\n\t\t\t}else{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}",
"public function deleteParticipants($event_id) {\r\n$array = array('event_id' => $event_id);\r\n$success = $this->db->delete('participated_in', $array);\r\nreturn $success;\r\n}",
"function evento_pessoa_delete($idevento){\r\n\r\n\t\t$this->idevento = $idevento;\r\n\t\t$this->status = 2;\r\n\t\t$bd = Crud_Evento::conexao();\r\n\t\t$sql = \"UPDATE evento set status = :status WHERE idevento = :idevento\";\r\n\t\t$stmt = $bd->prepare( $sql );\r\n\t\t$stmt->bindParam(':idevento',$this->idevento,PDO::PARAM_INT);\r\n\t\t$stmt->bindParam(':status', $this->status, PDO::PARAM_INT);\r\n\r\n\t\t\r\n\r\n\t\t$bd = Crud_Evento::conexao();\r\n\r\n\t\t$sql = \"DELETE FROM evento_pessoa WHERE idevento = :idevento \";\r\n\t\t$stmt = $bd->prepare($sql);\r\n\t\t$stmt->bindParam(':idevento',$idevento, PDO::PARAM_INT);\r\n\r\n\t\t$result = $stmt->execute();\r\n\r\n\t}",
"public function delete() {\n\n $id = $this->uri->segment(4);\n $this->events_model->delete_event($id);\n redirect('admin/events');\n\n }",
"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 }",
"private function deleteEvent($event)\n {\n $data = json_decode($event->data,true);\n\n //now we need to see what the actual event gcal_id is as the event data may not have a current google cal if the event\n //was moved or deleted etc.\n //but it could also have been moved to a calendar that no longer has gcal or created and have a gcal already\n\n /*\n use case 1: the event has previously been created and synced but is now being deleted means there will be an gcal id\n in the json encoded event data BUT the cal_id could be wrong in the event. it will be correct in teh data\n\n use case 2: the event has previously been created but was only synced in the current sync run in which case the event\n object will hold the gcal_id. the cal_id would be correct in the event object and in the data.\n\n SOLUTION: if there is no gcal_id in the event data then pull the gcal_id from the event object BUT ALWAYS get the \n event cal id from the event data\n\n */\n\n\n\n $evObj = new \\Pbbooking\\Model\\Event($data['id']);\n $event_gcal_id = (isset($data['gcal_id']) && $data['gcal_id'] != '') ? $data['gcal_id'] : $evObj->gcal_id;\n\n if (!$event_gcal_id || $event_gcal_id == '')\n return false; //can't delete an event with no gcal id\n\n //now we are assuming we have a gcalid as $event_gcal_id\n $service = new \\Google_Service_Calendar($this->googleClient);\n $cal = $GLOBALS['com_pbbooking_data']['calendars'][$evObj->cal_id];\n\n $service->events->delete(trim($cal->gcal_id),$event_gcal_id);\n\n return true;\n }",
"function deleteAdminEvent($eventId) {\r\n $response = array('ok' => false, 'msg' => \"Undefined error\");\r\n \r\n $sqlCon = openDatabase();\r\n $adminId = getLoggedInAdminId();\r\n \r\n // Make sure we can retrieve user session's admin id\r\n if (!$adminId) {\r\n $response['ok'] = false;\r\n $response['msg'] = \"Failed to retrieve logged in user id\";\r\n }\r\n else {\r\n $query = sprintf(\"DELETE FROM events WHERE event_id=%s AND admin_id=%s;\", SQLE($eventId), $adminId);\r\n $result = mysql_query($query);\r\n\r\n $deletedOk = (1 == mysql_affected_rows($sqlCon));\r\n \r\n // TODO : Deleted the event, so also delete the guest-list of this event\r\n if ($deletedOk) {\r\n }\r\n \r\n $response['ok'] = $deletedOk;\r\n $response['msg'] = \"OK\";\r\n }\r\n closeDatabase();\r\n \r\n return $response;\r\n}",
"function delete_events($event_id) {\n\tglobal $cxn;\n\n\t$errArr=init_errArr(__FUNCTION__); \n\ttry\n\t{\n\t\t// Sql String\n\t\t$sqlString = \"DELETE FROM events\n\t\t\t\tWHERE eID = ?\";\n\t\t\t\n\t\t// Bind variables\n\t\t$stmt = $cxn->prepare($sqlString);\n\n\t\t$stmt->bind_param(\"i\", $event_id);\n\t\t$stmt->execute();\n\t\t\n\t\t// Check and delete users from this event\n\t}\n\tcatch (mysqli_sql_exception $err)\n\t{\n\t\t// Error settings\n\t\t$err_code=1;\n\t\t$err_descr=\"Error deleting events , event id: \" . $event_id;\n\t\tset_errArr($err, $err_code, $err_descr, $errArr);\n\t}\n\t// Return Error code\n\tif ($errArr[ERR_AFFECTED_ROWS]==0) { \n\t $errArr[ERR_AFFECTED_ROWS] = $cxn->affected_rows;\n\t}\n\t$errArr[ERR_SQLSTATE] = $cxn->sqlstate;\n\t$errArr[ERR_SQLSTATE_MSG] = $cxn->error;\n\treturn $errArr;\n}",
"public function testDeleteEvent()\n {\n }",
"public function test_delete() {\n global $DB;\n\n self::setAdminUser();\n $this->resetAfterTest(true);\n\n // Save new outage.\n $now = time();\n $outage = new outage([\n 'autostart' => false,\n 'warntime' => $now - 60,\n 'starttime' => 60,\n 'stoptime' => 120,\n 'title' => 'Title',\n 'description' => 'Description',\n ]);\n $outage->id = outagedb::save($outage);\n self::$outage = $outage;\n\n outagedb::delete(self::$outage->id);\n\n // Should not exist.\n $event = $DB->get_record_select(\n 'event',\n \"(eventtype = 'auth_outage' AND instance = :idoutage) OR (id = :idevent)\",\n ['idoutage' => self::$outage->id, 'idevent' => self::$event->id],\n 'id',\n IGNORE_MISSING\n );\n self::assertFalse($event);\n }",
"function event__delete_event($id)\n {\n $this->db->where('id', $id);\n $this->db->delete('events');\n\n // Delete event from link table\n $this->db->where('event_id', $id);\n $this->db->delete('event_links');\n }",
"public function delete() \n\t{\n\t\ttry \n\t\t{\n\t\t\t// select mongoDB collection\n\t\t\t$func_collection \t= \t$this->mongo_db->db->func;\n\t\t\t// preparing data\n\t\t\t$prepare_data \t\t= \tarray(\n\t\t\t\t'_id' \t=> \tnew MongoId($this->_id)\n\t\t\t\t);\n\t\t\t// remove to database\n\t\t\t$func_collection->remove($prepare_data);\n\t\t\treturn true;\t\t\n\t\t} \n\t\tcatch (Exception $e) \n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}",
"function delete_event($event_id) {\n\t\t$data = $this->db->query('SELECT bulletin_id FROM event_bulletin WHERE event_id='.$event_id.'');\n\t\t$bulletinIDs = $data->result();\n\t\t// Delete all bulletins with this event_id\n\t\tforeach ($bulletinIDs as &$value) {\n\t\t\t$this->db->where('bulletin_id', $value->bulletin_id);\n\t\t\t$this->db->delete('bulletin');\n\t\t}\n\t\t$this->db->where('event_id', $event_id);\n\t\t$this->db->delete('event');\n\t\t$this->db->where('event_id', $event_id);\n $this->db->delete('event_bulletin');\n\t\t$this->db->where('event_id', $event_id);\n\t\t$this->db->delete('event_location');\n\t\t$this->db->where('event_id', $event_id);\n $this->db->delete('event_owner');\n\t\t$this->db->where('event_id', $event_id);\n\t\t$this->db->delete('event_tag');\n\t\t$this->db->where('event_id', $event_id);\n\t\t$this->db->delete('organization_event');\n\t}",
"public function delete(): void\n {\n $this->record(new AgendaWasDeleted($this->identity));\n }",
"public function delete()\n {\n if ($this->sportevent) {\n return $this->sportevent->delete();\n }\n }",
"public function delete($event): void;",
"function delete_user_events_by_event_id($event_id) {\n\tglobal $cxn;\n\n\t$errArr=init_errArr(__FUNCTION__); \n\ttry\n\t{\n\t\t// Sql String\n\t\t$sqlString = \"DELETE FROM user_events\n\t\t\t\tWHERE event_id = ?\"; \n\t\t\t\n\t\t// Bind variables\n\t\t$stmt = $cxn->prepare($sqlString);\n\t\t\n\t\t$stmt->bind_param(\"i\", $event_id);\n\t\t$stmt->execute();\n\t}\n\tcatch (mysqli_sql_exception $err)\n\t{\n\t\t// Error settings\n\t\t$err_code=1;\n\t\t$err_descr=\"Error deleting user events , event id: \" . $event_id;\n\t\tset_errArr($err, $err_code, $err_descr, $errArr);\n\t}\n\t// Return Error code\n\t$errArr[ERR_AFFECTED_ROWS] = $cxn->affected_rows;\n\t$errArr[ERR_SQLSTATE] = $cxn->sqlstate;\n\t$errArr[ERR_SQLSTATE_MSG] = $cxn->error;\n\treturn $errArr;\n}",
"public function destroy($event_id)\n { \n $events=new Events;\n $events->find($event_id)->delete();\n }",
"public function destroy($id)\n {\n\n $event = Event::find($id);\n\n $registra = $event->event_registra;\n \n if(Gate::allows('delete-event',$registra)){\n\n $title = $event->title;\n $event_delete_status = $event->delete();\n\n if($event_delete_status){\n\n $action = \"Deleted an event with the title '\".$title.\"'\";\n LogsController::logger($action, $this->date_of_action); \n\n return redirect('/events')->with('event-success','Event successfully deleted');\n }\n else{\n return redirect('/events')->with('event-fail','Event not deleted!');\n }\n\n }\n\n }",
"public function delete() : bool {\n $id = $this->id;\n try {\n $db = new DbConnection();\n $db = $db->connect();\n $statement = $db->prepare(\"DELETE FROM \" . static::tableName() . \" WHERE id = :id\");\n $statement->bindParam(':id', $id);\n $result = $statement->execute();\n $db = null;\n } catch (PDOException $e) {\n $result = false;\n $e->getMessage(); // Only in dev mode\n }\n return $result;\n }",
"public function delete() {\n // Find document ID.\n if (!$this->find()) {\n debugging('Failed to find ousearch document');\n return false;\n }\n self::wipe_document($this->id);\n }",
"function ondelete(){\n\t\tforeach($this->get_sections() as $one){\n\t\t\t$one->dbdelete();\n\t\t}\n\t\treturn true;\n\t}",
"public function delete() {\r\n\r\n // get database connection\r\n\r\n \r\n $sql_delete = \"delete from employees where id = '$this->id'\";\r\n if ($this->dbc->query($sql_delete)) {\r\n\r\n //TODO - DO SOMETHING MORE ELABORATE THAT INDICATES SUCESSFUL SUBMISSION FOR NOW JUST PRINT SUCCESS\r\n echo \"<p> Employee Successfully Deleted </p>\";\r\n return true;\r\n } else {\r\n\r\n echo \"<p> Could not run query </p>\";\r\n return false;\r\n }\r\n }",
"public function delete(){\n $this->probe_requests()->detach();\n\n // Delete the event itself\n $result = parent::delete();\n\n return $result;\n }",
"function delete() {\n\t\t$query = '\n\t\t\tDELETE FROM '.system::getConfig()->getDatabase('mofilm_content').'.movieBroadcast\n\t\t\tWHERE\n\t\t\t\tmovieID = :MovieID AND\n\t\t\t\tCountryID = :CountryID\n\t\t\tLIMIT 1';\n\n\t\t$oStmt = dbManager::getInstance()->prepare($query);\n\t\t$oStmt->bindValue(':MovieID', $this->getMovieID());\n\t\t$oStmt->bindValue(':CountryID', $this->getCountryID());\n\n\t\tif ( $oStmt->execute() ) {\n\t\t\t$oStmt->closeCursor();\n\t\t\t$this->reset();\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}",
"public function deleteEvent($event)\n {\n $this->entityManager->remove($event);\n $this->entityManager->flush();\n }",
"protected function _deleteEvent($eventId)\n {\n }",
"public function delete ()\n {\n $query = \"DELETE FROM \" . $this->table_name . \" WHERE book_id = ?\";\n\n $stmt = $this->conn->prepare($query);\n $stmt->bindParam(1, $this->book_id);\n\n if($result = $stmt->execute()){\n return true;\n }\n else\n {\n return false;\n }\n }",
"public function delete() {\n\t\ttry {\n\t\t\t$stmt = $this->db->prepare(\"DELETE FROM `$this->table` WHERE `id` = ?\");\n\t\t\t$stmt->execute([$this->getID()]);\n\t\t} catch (Exception $e) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}",
"public function delete()\n {\n self::deleteById( $this->db, $this->id, $this->prefix );\n\n if( $this->inTransaction )\n {\n //$this->db->commit();\n $this->inTransaction = false;\n }\n }",
"public function postEventdel(){\n\t\t$this->set_purpose( self::DELE);\n\t\t$id = Input::get('id');\n if($id > 0 ){\n\t\t\t$data = Input::all();\n\t\t\treturn $this->will_dele_to_db($data);\n }\n else{\n echo \"You tried to put non positif id \";\n }\n }",
"public function delete() {\n\t\t\t$query = \"DELETE FROM $this->table_name WHERE id=?\";\n\n\t\t\t// prepare biatch\n\t\t\t$stmt = $this->conn->prepare($query);\n\n\t\t\t// bind id biatch\n\t\t\t$stmt->bindParam(1, $this->id);\n\n\t\t\t// execute query\n\t\t\tif ($stmt->execute()) {\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}",
"public function delete(){\n\n $query = 'DELETE FROM ' . $this->table . ' WHERE id=:id';\n $stmt = $this->conn->prepare($query);\n $this->id = htmlspecialchars(strip_tags($this->id));\n $stmt->bindParam(':id', $this->id);\n if($stmt->execute()){\n return true;\n }\n else{\n printf(\"Error: %s.\\n\", $stmt->error);\n return false;\n }\n }",
"public function deleteEvent($event_id,$poi_id)\r\r\n {\r\r\n $where = $this->getAdapter()->quoteInto('event_id = ?', $event_id).\r\r\n $this->getAdapter()->quoteInto(' AND poi_id = ?', $poi_id);\r\r\n $this->delete($where);\r\r\n }",
"public static function deleteOne($event) {\n $field = self::$response_field;\n try {\n DB::beginTransaction();\n $event->attributions()->delete();\n $event->offers()->delete();\n $event->needs()->delete();\n $event->staffs()->delete();\n $event->tickets()->delete();\n $event->performers()->delete();\n foreach ($event->sharings as $sharing) {\n Sharing::deleteOne($sharing);\n }\n foreach ($event->printings as $printing) {\n Printing::deleteOne($printing);\n }\n if ($event->delete()) {\n if (isset($event->contract_src) && $event->contract_src != NULL) {\n $url = 'v1/files/' . $event->contract_src;\n $route = Request::create($url, 'DELETE');\n Route::dispatch($route);\n }\n $response['success'] = [\n 'response' => [\n 'title' => trans('success.event.deleted', array('name' => $event->$field)),\n ]];\n DB::commit();\n } else {\n DB::rollback();\n $response['error'] = trans('error.event.deleted', array('name' => $event->$field));\n }\n } catch (\\Laravel\\Database\\Exception $e) {\n DB::rollback();\n $response['error'] = trans('error.event.deleted', array('name' => $event->$field));\n }\n return $response;\n }",
"function delete_repeat_events ($event_id, $sdate_time=MIN_DATE_TIME, $delete_option=DELETE_ALL) {\n\tglobal $cxn;\n\n\t$errArr=init_errArr(__FUNCTION__); \n\ttry\n\t{\n\t\t// Set up delete conditions \n\t\tif ($delete_option == DELETE_ONE) {\n\t\t\t$where = \" AND sdate_time = ?\";\n\t\t}\n\t\telse {\n\t\t\t$where = \" \";\n\t\t}\n\t\t// Sql String\n\t\t$sqlString = \"DELETE FROM repeat_events \n\t\t\t\tWHERE event_id = ?\" \n\t\t . $where ;\n\t\t\t\n\t\t// Bind variables\n\t\t$stmt = $cxn->prepare($sqlString);\n\t\tif ($delete_option == DELETE_ONE) {\n\t\t $stmt->bind_param(\"is\", $event_id, $sdate_time );\n\t\t}\n\t\telse {\n\t\t\t$stmt->bind_param(\"i\", $event_id );\n\t\t}\n\t\t$stmt->execute();\n\t}\n\tcatch (mysqli_sql_exception $err)\n\t{\n\t\t// Error settings\n\t\t$err_code = 1;\n\t\t$err_descr = \"Error deleting repeat_events, event id: \" . $event_id . \" sdate_time: \" . $sdate_time\n\t\t . \" delete_option: \" . $delete_option ;\n\t\tset_errArr($err, $err_code, $err_descr, $errArr);\n\t}\n\t// Return Error code\n\t$errArr[ERR_AFFECTED_ROWS] = $cxn->affected_rows;\n\t$errArr[ERR_SQLSTATE] = $cxn->sqlstate;\n\t$errArr[ERR_SQLSTATE_MSG] = $cxn->error;\n\treturn $errArr;\n}",
"public function delete()\n {\n $this->db->delete($this->table, $this->data['id'], $this->key);\n }",
"function delete() {\n\t \t$sql = \"DELETE FROM evs_database.evs_identification\n\t \t\t\tWHERE idf_id=?\";\n\t \t$this->db->query($sql, array($this->idf_id));\n\t\t\n\t }",
"public function delete() {\n $events = $this->getEventsCreatedHere(); # we will need to write this method\n foreach ($events as $record) {\n $record->delete();\n }\n\n # delete the calendar_has_event records\n $has_events = $this->getCalendarHasEvents();\n foreach ($has_events as $record) {\n $record->delete();\n }\n\n # delete the user_has_permission records\n $permissions = $this->getAllPermissions();\n foreach ($permissions as $record) {\n $record->delete();\n }\n\n # delete the subscriptions on the calendar\n $subscriptions = $this->getSubscriptions();\n foreach ($subscriptions as $record) {\n $record->delete();\n }\n\n # delete the subscription_has_calendar records (remove calendar from subscriptions that subscribe to it)\n $subscriptions = $this->getSubscriptionHasCalendarRecords();\n foreach ($subscriptions as $record) {\n $record->delete();\n }\n\n return parent::delete();\n }",
"public function delete()\n\t{\n\t \tif (!Validate::isTableOrIdentifier($this->identifier) OR !Validate::isTableOrIdentifier($this->table))\n\t \t\tdie(Tools::displayError());\n\n\t\t$this->clearCache();\n\n\t\t/* Database deletion */\n\t\t$result = Db::getInstance()->Execute('DELETE FROM `'.pSQL($this->table).'` WHERE `'.pSQL($this->identifier).'` = '.(int)($this->id));\n\t\tif (!$result)\n\t\t\treturn false;\n\t\t\n\t\treturn $result;\n\t}",
"public function delete() {\n\t\t\n\t\t$data = array('active'=>false,'deleted'=>true);\n\t\t$this->db->where('id',$this->_id);\n\t\t$this->db->update($this->_table, $data);\n\t\t\n\t\treturn true;\n\t}",
"public function delete()\n {\n $this->throwForbiddenUnless(SecurityUtil::checkPermission('PostCalendar::', '::', ACCESS_ADD), LogUtil::getErrorMsgPermission());\n\n $eid = FormUtil::getPassedValue('eid'); // seems like this should be handled by the eventHandler\n $render = FormUtil::newForm('PostCalendar', $this);\n\n // get the event from the DB\n $event = DBUtil::selectObjectByID('postcalendar_events', $eid, 'eid');\n $event = ModUtil::apiFunc('PostCalendar', 'event', 'formateventarrayfordisplay', $event);\n\n $render->assign('loaded_event', $event);\n return $render->execute('event/deleteeventconfirm.tpl', new PostCalendar_Form_Handler_EditHandler());\n }",
"public function delete() { \n\n\t\t$id = Dba::escape($this->id); \n\t\n\t\t$sql = \"DELETE FROM `playlist_data` WHERE `playlist` = '$id'\";\n\t\t$db_results = Dba::query($sql);\n\n\t\t$sql = \"DELETE FROM `playlist` WHERE `id`='$id'\";\n\t\t$db_results = Dba::query($sql);\n\n\t\t$sql = \"DELETE FROM `object_count` WHERE `object_type`='playlist' AND `object_id`='$id'\"; \n\t\t$db_results = Dba::query($sql); \n \n\t\treturn true;\n\t\n\t}",
"public function deleteEvent($id){\n\n\t\ttry {\n\t\t\t$event = Event::find($id);\n\t\t\t// check if event is owned by user\n\t\t\tif ($event->owner == Auth::user()->id) {\n\t\t\t\tif ($event->approved == 1|| $event->approved == -1) {\n\t\t\t\t\t$event->deleted = 1;\n\t\t\t\t\t$event->save();\n\t\t\t\t}else {\n\t\t\t\t\t$event->delete();\n\t\t\t\t}\n\t\t\t}else{ //not owned by user\n\t\t\t\treturn response()->json(['message' => 'unauthorised'], 401);\n\t\t\t}\n\t\t} catch (\\Exception $e) {\n\t\t\treturn response()->json(['message' => 'server error'], 500);\n\t\t}\n\t\treturn response()->json(['message' => 'ok'], 200);\n\n\t}",
"public function postEventDel();",
"function delete(){\r\n\t\tglobal $wpdb;\r\n\t\t$sql = $wpdb->prepare(\"DELETE FROM \". $wpdb->prefix.EM_BOOKINGS_TABLE . \" WHERE booking_id=%d\", $this->id);\r\n\t\treturn ( $wpdb->query( $sql ) !== false );\r\n\t}",
"public function deleteAdvent($advent)\n {\n DB::beginTransaction();\n\n try {\n // Check first if the advent calendar has had participants\n if(AdventParticipant::where('advent_id', $advent->id)->exists()) throw new \\Exception(\"A user has participated in this advent calendar, so deleting it would break the logs. While advent calendars remain visible after their end time, they cannot be interacted with.\");\n\n $advent->delete();\n\n return $this->commitReturn(true);\n } catch(\\Exception $e) {\n $this->setError('error', $e->getMessage());\n }\n return $this->rollbackReturn(false);\n }",
"public function delete(){\r\n\t\t// Check for request forgeries\r\n\t\tJSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));\r\n\t\r\n\t\t// Get the model.\r\n\t\t$model = $this->getModel(\"ManageCompanyEvent\");\r\n\t\t$this->deleteEvents($model);\r\n\t\r\n\t\t$this->setRedirect('index.php?option=com_jbusinessdirectory&view='.$this->input->get('view'));\r\n\t}",
"public function delete()\n {\n if ($id = $this->getData('id')) {\n if ($this->getDB()->delete($this->table, array('id' => $id))) {\n $this->data = [];\n return true;\n }\n }\n\n return false;\n }",
"public function save()\n {\n $db = $this->getDB();\n if (empty($this->id)) {\n $new_key = TRUE;\n } else {\n $new_key = FALSE;\n }\n\n $result = $db->saveObject($this);\n if (PHPWS_Error::isError($result)) {\n return false;\n } else {\n if (!PHPWS_DB::isTable($this->getEventTable())) {\n $result = $this->createEventTable();\n if (PHPWS_Error::isError($result)) {\n $this->delete();\n return $result;\n }\n }\n\n $result = $this->saveKey();\n if (PHPWS_Error::isError($result)) {\n $this->delete();\n return $result;\n }\n\n if ($new_key) {\n $db->saveObject($this);\n }\n\n return true;\n }\n }",
"function Delete(){\r\n $query = \"DELETE FROM userschedules\r\n WHERE referenceId = $this->referenceId\r\n AND organizationId = $this->organizationId\";\r\n include(\"includes/dbConnection.php\");\t\t\t\t\t\t\r\n $executeQuery = $db->prepare($query);\r\n $executeQuery->execute() or exit(\"Error: DELETE query failed.\");\r\n }",
"function delete() {\n $this->db->delete(self::table_name, array('id' => $this->id));\n // need to delete from tag maps too\n // tbd\n }",
"public function delete()\n {\n if ($this->id() != 1) {\n return parent::delete();\n }\n\n return false;\n }",
"public function delete() : bool\n {\n $id = $this->id;\n $sql = sprintf('DELETE FROM %s WHERE id = :id', static::getTableName());\n $stmt = static::getConn()->prepare($sql);\n $stmt->execute(\n [\n 'id' => $id,\n ]\n );\n\n $info = $stmt->errorInfo();\n if ($info[0] !== \\PDO::ERR_NONE) {\n die('We have : ' . $info[2]);\n }\n\n return true;\n }",
"public function excluirVideoPorId($idVideo){\r\n \r\n $sql = mysql_query(\"DELETE FROM video_galeria WHERE id_video='$idVideo'\") or die(mysql_error());\r\n \r\n if($sql == true){\r\n\t\r\n\treturn true; \r\n\t\r\n }else{\r\n\t\r\n\treturn false; \r\n }\r\n\t\r\n}",
"public function delete() \n\t{\n\t\tif ($this->id) {\n\t\t\t$this->query->fields(\"id\")->compareTo($this->id);\n\t\t\treturn $this->query->delete();\n\t\t}\n\t\t\n\t\treturn false;\n\t}",
"public function delete(Datastore $db)\n {\n $stmt = $db->prepare('DELETE FROM tbl_survey WHERE col_uuid = :surveyUuid');\n $stmt->bindValue(':surveyUuid', $this->uuid, PDO::PARAM_STR);\n $db->execute($stmt);\n }",
"final protected function deleteEvent(Int $event_id)\n\t\t{\n\n\t\t\tglobal $time_deleteEvent__success,\n\t\t\t $time_deleteEvent__failure,\n\t\t\t $time_deleteEvent__failure_eventNotExisting;\n\n\t\t\t# Ensure DB conn has been established\n\t\t\t$this->init();\n\n\t\t\t# Check whether event exists\n\t\t\t$occurences = $this->db->selectValue(\n\t\t\t\t'SELECT COUNT(*) FROM mod_time WHERE event_id = ?', [$event_id]\n\t\t\t);\n\n\t\t\tif($occurences <= 0)\n\t\t\t\treturn $this->addFrontendError($time_deleteEvent__failure_eventNotExisting[$GLOBALS['lang']]);\n\n\t\t\t# Call Model\n\t\t\t$action = $this->callModelFunc(\"mod\", \"deleteDataOfSpecificModule\", static::ACTIVE_MOD, array(\n\t\t\t\t\"event_id\" => $event_id\n\t\t\t));\n\n\t\t\t# End with status report\n\t\t\tif($action) $this->addFrontendMessage($time_deleteEvent__success[$GLOBALS['lang']]);\n\t\t\telse $this->addFrontendError($time_deleteEvent__failure[$GLOBALS['lang']]);\n\n\t\t\t# If no events are registered, stop the cron job checking whether any event needs to be executed\n\t\t\t$nEvents = (int)$this->db->select('SELECT COUNT(*) FROM mod_time')[0][0];\n\t\t\tif($nEvents === 0 || $nEvents === null) $this->stopListeningForEvents();\n\n\t\t\t$this->refresh();\n\n\t\t}",
"public function action_delete()\n {\n\t $this->template = View::forge('template-admin');\n\n $post = Input::post();\n $entry = Model_Event::find_by_pk($post[\"id\"]);\n\t\tif ($entry){\n\t\t\tif(!$entry->delete()){\n\t\t\t\t$data[\"events\"] = Model_Event::find_all();\n\t\t\t\t$this->template->title = \"イベント一覧\";\n\t\t\t\t$this->template->content = View::forge('event/index', $data);\n\t\t\t}\n\t\t}\n\t\t$data[\"events\"] = Model_Event::find_all();\n\t\t$this->template->title = \"イベント一覧\";\n\t\t$this->template->content = View::forge('event/index', $data);\n }",
"public function delete() {\n\t\t\tif (!$this->isKnown()) { return FALSE; }\n\t\t\t$this->preDelete();\n\t\t\t$query = sprintf('DELETE FROM %s WHERE `%s` = :key', static::$_table, static::$_key);\n\t\t\ttry {\n\t\t\t\t$statement = $this->myDB->getPDO()->prepare($query);\n\t\t\t\t$params[':key'] = $this->getData(static::$_key);\n\t\t\t\t$result = $statement->execute($params);\n\t\t\t} catch (\\PDOException $t) {\n\t\t\t\t$result = FALSE;\n\t\t\t}\n\t\t\tif (!$result) {\n\t\t\t\t$this->lastError = $statement->errorInfo();\n\t\t\t}\n\t\t\t$this->postDelete($result);\n\t\t\treturn $result;\n\t\t}",
"public function delete() {\r\n\r\n $retVal = false;\r\n\r\n $table = static::getDbTable();\r\n $map = static::getDbMap();\r\n $primaryKey = static::getDbPrimaryKey();\r\n if ($this->$primaryKey) {\r\n $query = 'DELETE FROM `' . $table . '` WHERE `' . $map[$primaryKey] . '` = :id';\r\n $params = array( ':id' => $this->$primaryKey );\r\n $retVal = Db::Query($query, $params);\r\n }\r\n\r\n return $retVal;\r\n\r\n }",
"public function delete() {\n\t\t$this->deleted = true;\n\t}",
"public function delete(){\n\t\tglobal $db;\n\t\t$response = array('success' => false);\n\t\t$response['success']=$db->delete($this->table, \"id = $this->id\");\n\t return $response;\n\t}",
"function bookking_delete_instance($id) {\n global $DB;\n\n if (! $DB->record_exists('bookking', array('id' => $id))) {\n return false;\n }\n\n $bookking = bookking_instance::load_by_id($id);\n $bookking->delete();\n\n // Clean up any possibly remaining event records.\n $params = array('modulename' => 'bookking', 'instance' => $id);\n $DB->delete_records('event', $params);\n\n return true;\n}",
"function delete() {\n\t\t$this->status = \"deleted\";\n\t\t$sql = \"UPDATE \" . POLARBEAR_DB_PREFIX . \"_articles SET status = '$this->status' WHERE id = '$this->id'\";\n\t\tglobal $polarbear_db;\n\t\t$polarbear_db->query($sql);\n\n\t\t$args = array(\n\t\t\t\"article\" => $this,\n\t\t\t\"objectName\" => $this->getTitleArticle()\n\t\t);\n\t\tpb_event_fire(\"pb_article_deleted\", $args);\n\n\t\treturn true;\n\t}",
"function delete()\n\t{\n\t\tSQL::query(\"delete from {$this->_table} where id = {$this->_data['id']}\");\n\t}",
"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 }",
"public function destroy(Event $event)\n {\n //$event = Event::findOrFail($id);\n $event->delete($event);\n flash('Evenement supprimer avec succes','danger');\n return redirect(route('home'));\n }",
"public function delete() {\n\n\t\t// Database\n\t\t$db = $this->db;\n\n\t\t// SQL code for deletion\n\t\t$sql = $this->sql_for_delete();\n\n\t\t// Deletion execution\n\t\treturn $db::execute($sql);\n\t}",
"public function delete(){\n\t if(!isset($this->attributes['id'])) \n\t\t\tthrow new Exception(\"Cannot delete new objects\");\n\t\t$this->do_callback(\"before_delete\");\n\t\treturn self::do_query(\"DELETE FROM \".self::table_for(get_class($this)).\n\t\t \" WHERE id=\".self::make_value($this->attributes['id']));\t\n\t}",
"public function dellogbyfunc() {\n \t\ttry {\n \t\t\t// select mongoDB collection\n \t\t\t$func_collection \t= \t$this->mongo_db->db->used;\n\t\t\t// preparing data\n \t\t\t$prepare_data \t\t= \tarray(\n \t\t\t\t'use_funcid' \t=> \t$this->use_funcid\n \t\t\t\t);\n\t\t\t// delete to database\n \t\t\t$func_collection->remove($prepare_data);\n \t\t\treturn true;\n \t\t} \n \t\tcatch (Exception $e) \n \t\t{\n \t\t\treturn false;\n \t\t}\n \t}",
"function delete_events_by_parent_id($parent_event_id) {\n\tglobal $cxn;\n\n\t$errArr=init_errArr(__FUNCTION__);\n\ttry\n\t{\n\t\t// Sql String\n\t\t$sqlString = \"DELETE FROM events\n\t\t\t\tWHERE parent_event_id = ?\";\n\t\t\t\n\t\t// Bind variables\n\t\t$stmt = $cxn->prepare($sqlString);\n\n\t\t$stmt->bind_param(\"i\", $parent_event_id);\n\t\t$stmt->execute();\n\n\t\t// Check and delete users from this event\n\t}\n\tcatch (mysqli_sql_exception $err)\n\t{\n\t\t// Error settings\n\t\t$err_code=1;\n\t\t$err_descr=\"Error deleting events , parent event id: \" . $parent_event_id;\n\t\tset_errArr($err, $err_code, $err_descr, $errArr);\n\t}\n\t// Return Error code\n\tif ($errArr[ERR_AFFECTED_ROWS]==0) {\n\t\t$errArr[ERR_AFFECTED_ROWS] = $cxn->affected_rows;\n\t}\n\t$errArr[ERR_SQLSTATE] = $cxn->sqlstate;\n\t$errArr[ERR_SQLSTATE_MSG] = $cxn->error;\n\treturn $errArr;\n}",
"public function onAfterDelete();",
"public function delete() {\n\t\tif ($this->checkDependencies() == true ) {\n\t\t\t$sql = \"DELETE FROM \".$this->tablename.\" where \".$this->idcol.\" = \".$this->page->ctrl['record'];\n\t\t\t$this->dbc->exec($sql);\n\t\t}\n\t}",
"private function deleteDb()\n\t{\n\t\t//do we have an id?\n\t\tif ($this->id)\n\t\t{\n\t\t\tdb()->execute(\"\n\t\t\t\tDELETE FROM $this->tableName\n\t\t\t\tWHERE id = '$this->id'\n\t\t\t\");\n\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}",
"public function delete() {\n\t\tif ($this->exists) {\n\t\t\t$this->fire_event('deleting');\n\n\t\t\t$result = $this->query()->where(static::$key, '=', $this->get_key())->delete();\n\n\t\t\t$this->fire_event('deleted');\n\n\t\t\treturn $result;\n\t\t}\n\t}",
"public function deleteEvent($id)\n {\n $id = (int)$id;\n $this->checkID($id);\n\n $deleted = $this->model->deleteEvent($id);\n if ($deleted == true) {\n $response = array('status' => true, 'message' => 'Event deleted.');\n $this->send(200, $response);\n } else {\n $response = array('status' => false, 'message' => 'Event not deleted.');\n $this->send(500, $response);\n }\n }",
"public function delete() \n {\n // Create query\n $query = 'DELETE FROM ' . $this->table . ' WHERE id = :id';\n \n // Prepare Statement\n $stmt = $this->conn->prepare($query);\n \n // clean data\n $this->id = htmlspecialchars(strip_tags($this->id));\n \n // Bind Data\n $stmt-> bindParam(':id', $this->id);\n \n // Execute query\n if($stmt->execute()) {\n return true;\n }\n\n // Print error if something goes wrong\n printf(\"Error: %s.\\n\", $stmt->error);\n return false;\n }",
"function delete_Notification($notifID, $chamber){\r\n $sql = $this->db->prepare(\"DELETE FROM NOTIFICATIONLOOKUP WHERE NotificationID = :id AND RelatedChamber = :chamberID;\");\r\n\r\n $result = $sql->execute(array(\r\n \"id\" => $notifID,\r\n \"chamberID\" => $chamber\r\n ));\r\n\r\n if ($result){\r\n return true;\r\n }\r\n else{\r\n return false;\r\n }\r\n }",
"protected function handleDoDelete() {\n\t\t\tif ($this->verifyRequest('DELETE') && $this->verifyParams()) {\n\t\t\t\tif ($this->blnAuthenticated) {\n\t\t\t\t\tif ($intEventId = str_replace('.' . $this->strFormat, '', $this->objUrl->getSegment(3))) {\n\t\t\t\t\t\t$objUserEvent = $this->initModel();\n\t\t\t\t\t\tif ($objUserEvent->loadById($intEventId) && $objUserEvent->count()) {\n\t\t\t\t\t\t\tif ($objUserEvent->current()->get('userid') == AppRegistry::get('UserLogin')->getUserId()) {\n\t\t\t\t\t\t\t\tif ($objUserEvent->destroy()) {\n\t\t\t\t\t\t\t\t\tCoreAlert::alert('The event was deleted successfully.');\n\t\t\t\t\t\t\t\t\t$this->blnSuccess = true;\n\t\t\t\t\t\t\t\t\t$this->intStatusCode = 200;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\ttrigger_error(AppLanguage::translate('There was an error deleting the event'));\n\t\t\t\t\t\t\t\t\t$this->error(400);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\ttrigger_error(AppLanguage::translate('Invalid event permissions'));\n\t\t\t\t\t\t\t\t$this->error(401);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ttrigger_error(AppLanguage::translate('There was an error loading the event data'));\n\t\t\t\t\t\t\t$this->error(400);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttrigger_error(AppLanguage::translate('Missing event ID'));\n\t\t\t\t\t\t$this->error(401);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\ttrigger_error(AppLanguage::translate('Missing or invalid authentication'));\n\t\t\t\t\t$this->error(401);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$this->error(400);\n\t\t\t}\n\t\t}",
"public function delete()\n {\n $o_response = new \\stdclass();\n $id = Input::get('id');\n $rooms = DB::table('events')->where('id',$id)->delete();\n // echo '<pre>';\n // print_r($id);die;\n if($rooms){\n $o_response->status = 'ok';\n $o_response->message = 'You have successfully removed';\n }\n else{\n $o_response->status = 'error';\n $o_response->error = 'You have error removed';\n }\n echo json_encode($o_response);\n }",
"protected function will_dele_to_db($data){\n\t\t//!\n\t\t$id \t\t= \t$data [\"id\"] ;\n\t\t$event \t\t= \t$this->Sarung_db_about_dele($data);\n\t\t$this->add_obj_dele_db($event);\n\t\t$saveId \t= \t$this->delete_db_admin_root( $this->get_table_name() , $id );\n\t\tif($saveId){\n\t\t\t$this->add_obj_save_db($saveId);\n\t\t}\n\t\t//!\n\t\tif( $this->will_change_to_db()){\n\t\t\treturn $this->postEventdelsucceded();\n\t\t}\n else{\n\t\t\treturn $this->postEventdelfailed();\n }\n\t}",
"public function delete() {\n global $DB;\n $DB->delete_records($this->get_table_name(), array('id' => $this->id));\n }",
"public function delete(){\r\n\t\t$this->db->delete();\r\n\t}",
"public function delete()\n {\n $result = true;\n // Внимание, если запись новая,\n // то НЕ БУДЕТ вызвано исключение\n if (!$this->isNewRecord) {\n $this->setDeletedRedis();\n $result = parent::delete();\n }\n $this->deleteRedis();\n if (!$this->isNewRecord) {\n $this->unsetDeletedRedis();\n }\n\n return $result;\n }",
"public function delete()\n\t{\n\t\tif( !isset($this->attributes[static::$primaryKey]) || $this->attributes[static::$primaryKey] <= 0 )\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\treturn DataBase::delete(\"DELETE FROM `\" . static::$table . \"` WHERE `\" . static::$primaryKey . \"` = ?\", $this->attributes[static::$primaryKey]);\n\t}"
] | [
"0.77380955",
"0.7467017",
"0.7413709",
"0.73559767",
"0.73000276",
"0.7247399",
"0.72272116",
"0.714857",
"0.70839506",
"0.7027041",
"0.70236564",
"0.69831693",
"0.69433165",
"0.69147676",
"0.6873784",
"0.6856098",
"0.68141025",
"0.674421",
"0.67437047",
"0.66988945",
"0.6680887",
"0.66786677",
"0.6677638",
"0.6637644",
"0.66230106",
"0.6622074",
"0.66148466",
"0.6595851",
"0.6573422",
"0.6550211",
"0.6544792",
"0.65268916",
"0.6520727",
"0.6501088",
"0.6441338",
"0.6434315",
"0.6431736",
"0.64261883",
"0.64069295",
"0.64041036",
"0.63948953",
"0.63938487",
"0.63698226",
"0.63626236",
"0.63617766",
"0.63583213",
"0.63441247",
"0.6330693",
"0.6329529",
"0.63095415",
"0.630545",
"0.62959397",
"0.629258",
"0.62906605",
"0.62847173",
"0.62807584",
"0.6258164",
"0.62570935",
"0.62517625",
"0.62275404",
"0.62263745",
"0.62244827",
"0.6220347",
"0.6209039",
"0.6205329",
"0.6199962",
"0.61923057",
"0.61865854",
"0.6185285",
"0.6176122",
"0.6173138",
"0.61706674",
"0.6170127",
"0.61687857",
"0.61659557",
"0.61530375",
"0.61502105",
"0.6144743",
"0.6141908",
"0.6141615",
"0.61333686",
"0.6131749",
"0.61254114",
"0.6125147",
"0.6120936",
"0.61173415",
"0.6116394",
"0.6112816",
"0.6112504",
"0.61103636",
"0.61103255",
"0.61076146",
"0.6098522",
"0.6098347",
"0.60697126",
"0.6069646",
"0.6067987",
"0.6067035",
"0.60654676",
"0.6061077",
"0.60588986"
] | 0.0 | -1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.