query
stringlengths
7
5.25k
document
stringlengths
15
1.06M
metadata
dict
negatives
listlengths
3
101
negative_scores
listlengths
3
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Returns array of all Menu objects filtered by name if parameter passed
public function menus($filter = null) { return $this->contentManager->listMenus($filter); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getQueryMenus();", "public function getMenus() {}", "function menu_list($channel_id, $name = '', $flags = 0) {\n\n\t$sel_options = '';\n\t$sel_options .= (($name) ? \" and menu_name = '\" . protect_sprintf(dbesc($name)) . \"' \" : '');\n\t$sel_options .= (($flags) ? \" and menu_flags = \" . intval($flags) . \" \" : '');\n\n\t$r = q(\"select * from menu where menu_channel_id = %d $sel_options order by menu_desc\",\n\t\tintval($channel_id)\n\t);\n\treturn $r;\n}", "public static function getMenus()\n\t{\n\t\t$sql = \"SELECT * FROM mod_menu\";\n\t\t$query = \\SimplCMS::$app->getDbConnection()->query($sql);\n\t\treturn $query->fetchAll( \\PDO::FETCH_ASSOC );\t\t\n\t}", "public function getMenusListAttribute()\n {\n return Menu::orderBy('name')->get();\n }", "public function get($name) {\n\n\t\tif (isset(self::$_menus[$name])) {\n\t\t\treturn self::$_menus[$name];\n\t\t}\n\n\t\tself::$_menus[$name] = $this->app->object->create('ZlMenu', array($name));\n\n\t\treturn self::$_menus[$name];\n\t}", "public function findAllByMenu(MenuInterface $menu);", "public function getMenu();", "public function getMenu( string $name )\n {\n return (isset($this->menus[$name])) ? $this->menus[$name] : null;\n }", "function getMenuItems () {\n return sqlSelect('SELECT * FROM menu');\n}", "public function getAllMenuItems()\n\t{\n\t\t$out = array();\n\t\n\t\t$sql = \"SELECT\n\t\t\t\t\t`menu`.`link_id`,\n\t\t\t\t\t`menu_tree`.`parent_id`,\n\t\t\t\t\t`menu`.`redirect_url`,\n\t\t\t\t\t`menu_tree`.`sequence_no`,\n\t\t\t\t\t`menu`.`title_menu`,\n\t\t\t\t\t`menu`.`title_page`,\n\t\t\t\t\t`menu`.`template_name`,\n\t\t\t\t\t`menu`.`module_id`,\n\t\t\t\t\t`menu`.`security_level_id`,\n\t\t\t\t\t`menu`.`group_id`,\n\t\t\t\t\t`menu_tree`.`main_link`,\n\t\t\t\t\t`menu_tree`.`quick_link`,\n\t\t\t\t\t`menu_tree`.`bottom_link`,\n\t\t\t\t\t`menu`.`sitemap`,\n\t\t\t\t\t`menu`.`status`\n\t\t\t\tFROM\n\t\t\t\t\t`menu_tree`\n\t\t\t\tLEFT JOIN\n\t\t\t\t\t`menu`\n\t\t\t\tON\n\t\t\t\t\t`menu`.`link_id` = `menu_tree`.`link_id`\n\t\t\t\tORDER BY \n\t\t\t\t\t`menu_tree`.`parent_id`,`menu_tree`.`sequence_no`\n\t\t\t\t\";\n\t\t$stmt = $this->db->prepare($sql);\n\t\t$stmt->bind_result($link_id,$parent_id,$redirect_url,$sequence_no,$title_menu,$title_page,$template_name,$module_id,$security_level_id,$group_id,$main_link,$quick_link,$bottom_link,$sitemap,$status);\n\n\t\t$stmt->execute();\n\t\twhile($stmt->fetch())\n\t\t{\n\t\t\t$out[] = array(\n\t\t\t\t'link_id' => $link_id,\n\t\t\t\t'parent_id' => $parent_id,\n\t\t\t\t'redirect_url' => $redirect_url,\n\t\t\t\t'sequence_no' => $sequence_no,\n\t\t\t\t'title_menu' => $title_menu,\n\t\t\t\t'title_page' => $title_page,\n\t\t\t\t'template_name' => $template_name,\n\t\t\t\t'module_id' => $module_id,\n\t\t\t\t'security_level_id' => $security_level_id,\n\t\t\t\t'group_id' => $group_id,\n\t\t\t\t'main_link' => $main_link,\n\t\t\t\t'quick_link' => $quick_link,\n\t\t\t\t'bottom_link' => $bottom_link,\n\t\t\t\t'sitemap' => $sitemap,\n\t\t\t\t'status' => $status\n\t\t\t);\n\t\t}\n\t\t$stmt->close();\n\t\t\n\t\treturn $out;\n\t}", "public function items()\n\t{\n\t\tif( ! is_null($this->menu))\n\t\t{\n\t\t\tforeach($this->items as $item)\n\t\t\t{\n\t\t\t\t$this->menu->filter($item);\n\t\t\t}\n\t\t}\n\n\t\treturn $this->items;\n\t}", "public function get_by_name($name)\r\n\t{\r\n\t\t$where = array();\r\n\t\t$where['name'] = $name;\r\n\t\t$action = ORM::factory('action')->where($where)->find();\r\n\t\treturn $action->as_array();\r\n\t}", "public function getMenus()\n\t{\n\n\t}", "private static function getFilterArray($name) {\n global $lC_Database, $lC_Vqmod;\n\n $filter_id = 0;\n $filter_array = array();\n $templates_array = array();\n if (file_exists('includes/templates/' . $name . '.php')) {\n require($lC_Vqmod->modCheck('includes/templates/' . $name . '.php'));\n $Qtemplates = $lC_Database->query('select id, title, code from :table_templates order by title');\n $Qtemplates->bindTable(':table_templates', TABLE_TEMPLATES);\n $Qtemplates->execute();\n while ( $Qtemplates->next() ) {\n if ( $Qtemplates->value('code') == $name ) {\n $filter_id = $Qtemplates->valueInt('id');\n }\n $templates_array[$Qtemplates->value('code')] = $Qtemplates->value('title');\n }\n }\n $filter_array['filter_id'] = $filter_id;\n $filter_array['filter_name'] = $name;\n $filter_array['template_array'] = $templates_array;\n\n return $filter_array;\n }", "function getMenuItems()\n {\n }", "public function findAll()\n {\n $menus['active_menu'] = $this->buildMenu(\n Menu::where('status', 1)\n ->orderBy('order')\n ->get()\n );\n $menus['inactive_menu'] = $this->buildMenu(\n Menu::where('status', 0)\n ->orderBy('order', 'created_at')\n ->get()\n );\n\n return $menus;\n }", "public function get_all()\n {\n\n $sql = \"SELECT * FROM `menu`\";\n $query = $this->db->prepare($sql);\n\n $query->execute();\n\n return $query->fetchAll();\n }", "public function getMenu(string $name)\n {\n $menu = new MenuTreeBuilder($this->configuration['menu'][$name], $this->container);\n return $menu->createMenu($name);\n }", "public function selectAll() {\n $conn = $this->conex->connectDatabase();\n $sql = \"select * from tbl_menu\";\n $stm = $conn->prepare($sql);\n $success = $stm->execute();\n if ($success) {\n $listMenu = [];\n foreach ($stm->fetchAll(PDO::FETCH_ASSOC) as $result) {\n $Menu = new MenuFuncionario();\n $Menu->setId($result['id_menu']);\n $Menu->setPaginas($result['paginas']);\n array_push($listMenu, $Menu);\n }\n $this->conex -> closeDataBase();\n return $listMenu;\n } else {\n return \"Erro\";\n }\n }", "protected function getDBData()\n {\n $menus = StaticMenu::listDbInTheme($this->theme);\n\n $searchTerm = Str::lower($this->getSearchTerm());\n\n if (strlen($searchTerm)) {\n $words = explode(' ', $searchTerm);\n $filteredMenus = [];\n\n foreach ($menus as $menu) {\n if ($this->textMatchesSearch($words, $menu->name.' '.$menu->fileName)) {\n $filteredMenus[] = $menu;\n }\n }\n\n $menus = $filteredMenus;\n }\n\n return $menus;\n }", "public function getMenuItems(){\n $items = ItemMenu::getBy(array('_id' => array('$in' => $this->_menuItems)));\n return $items;\n }", "public function getMenuItems()\n {\n $sql = \"\n SELECT\n menu.uid,\n parent_uid,\n sort_order,\n nofollow,\n target,\n class,\n label,\n uri_uid,\n uri,\n menu.archived,\n menu.archived_datetime\n FROM menu\n LEFT JOIN uri\n ON uri.uid = menu.uri_uid\n WHERE menu.archived = '0'\n AND (uri.archived = '0' OR uri.archived IS NULL)\n \";\n\n $sql .= \"\n ORDER BY sort_order;\n \";\n\n $db = new Query($sql);\n $results = $db->fetchAllAssoc();\n\n return $results;\n }", "public function getAllMenus()\n {\n $menus = $this->find('all', array(\n 'conditions' => array(\n 'Menu.active' => true,\n ),\n 'order' => array(\n 'Menu.order' => 'asc',\n ),\n 'joins' => array(\n array(\n 'table' => 'product_categories',\n 'alias' => 'ProductCategory',\n 'type' => 'left',\n 'conditions' => array(\n 'Menu.type = \"ProductCategory\"',\n 'Menu.child = ProductCategory.id'\n )\n ),\n array(\n 'table' => 'blog_categories',\n 'alias' => 'BlogCategory',\n 'type' => 'left',\n 'conditions' => array(\n 'Menu.type = \"BlogCategory\"',\n 'Menu.child = BlogCategory.id'\n )\n ),\n array(\n 'table' => 'pages',\n 'alias' => 'Page',\n 'type' => 'left',\n 'conditions' => array(\n 'Menu.type = \"Page\"',\n 'Menu.child = Page.id'\n )\n )\n ),\n 'fields' => array(\n 'Menu.id',\n 'Menu.introduction',\n 'Menu.name',\n 'Menu.image',\n 'Menu.type',\n 'Menu.parent_id',\n 'Menu.child',\n 'ProductCategory.slug',\n 'Page.slug',\n 'BlogCategory.slug'\n )\n ));\n\n return $menus;\n }", "public static function menus()\n {\n return [];\n }", "public function findMenu($mod = false)\n {\n $result = array();\n $installedModules = ModulesModel::getEnabled();\n foreach ($installedModules as $module) {\n Yii::import('mod.' . $module->name . '.' . ucfirst($module->name) . 'Module');\n //if (method_exists($class, 'getAdminMenu')) {\n // $result = CMap::mergeArray($result, $class::getAdminMenu());\n //}\n if (Yii::app()->hasModule($module->name)) {\n if (isset(Yii::app()->getModule($module->name)->adminMenu)) {\n $result = CMap::mergeArray($result, Yii::app()->getModule($module->name)->getAdminMenu());\n }\n }\n }\n return ($mod) ? $result[$mod] : $result;\n\n }", "public function getmenu( ) {\n \t$parent = $this->find('all', array(\n 'conditions' => array(\n 'Page.parent_id IS NULL',\n 'Page.is_menu' => 1,\n 'Page.is_active' => 1\n ),\n 'contain'=>array(\n ),\n 'fields'=>array('Page.lft', 'Page.rght'),\n 'order'=>array('Page.lft' => 'ASC')\n ));\n\t\t\n\t\t$recs = array(); \n foreach($parent as $v){\n \t$info = $this->find('threaded', array(\n\t 'conditions' => array(\n\t 'Page.lft >=' => $v['Page']['lft'], \n\t 'Page.rght <=' => $v['Page']['rght'],\n\t 'Page.is_menu' => 1,\n\t 'Page.is_active' => 1\n\t ),\n\t 'contain'=>array()\n\t ));\n\t \n\t $recs = array_merge($recs, $info);\n\t }\n\t\t\n\t\treturn $recs;\n }", "public function getMenus(){\n\n }", "public function getMenuByModelName($modelName){\n $amenu = $this->table('permission')\n ->where('showInMenu=1 and type=\"backend_menu\" and `level` like (SELECT CONCAT(p2.`level`,\",\",\"%\") as `level` FROM permission p1 LEFT JOIN permission p2 ON p1.pId=p2.id WHERE p1.`name`=\"'.$modelName.'\")')\n ->order('`level`')\n ->getField('id,pId,name,title,URL,icon,level');\n //dump($this->getlastsql());\n return $amenu;\n }", "public static function getAll(): array\n\t{\n\t\t$key = '';\n\t\t$cacheName = 'MenuAll';\n\t\tif (!\\App\\Cache::has($cacheName, $key)) {\n\t\t\t$menuModels = [];\n\t\t\t$dataReader = (new App\\Db\\Query())->from(self::$menusTable)->orderBy(['sequence' => SORT_ASC])->createCommand()->query();\n\t\t\twhile ($rowData = $dataReader->read()) {\n\t\t\t\t$blockId = (int) $rowData[self::$menuId];\n\t\t\t\t$menuModels[$blockId] = self::getInstanceFromArray($rowData);\n\t\t\t}\n\t\t\t$dataReader->close();\n\t\t\t\\App\\Cache::save($cacheName, $key, $menuModels);\n\t\t}\n\t\treturn \\App\\Cache::get($cacheName, $key);\n\t}", "public function menu_get_names()\n {\n return menu_get_names();\n }", "private function getMenuItems()\n {\n $menu = $this->getDoctrine()->getRepository('XvolutionsAdminBundle:Menu')->findBy([], array('position' => 'ASC'));\n $menuItems = null;\n foreach ($menu as $item) {\n $menuItems[$item->getPage()->getId()] = ['id' => $item->getPage()->getId(), 'title' => $item->getPage()->getTitle()];\n }\n\n return $menuItems;\n }", "function getItemsByCategory($name)\n {\n $metadataDao = MidasLoader::loadModel('Metadata')->getMetadata(MIDAS_METADATA_TEXT, \"mrbextrator\", \"category\");\n $enabledDao = MidasLoader::loadModel('Metadata')->getMetadata(MIDAS_METADATA_TEXT, \"mrbextrator\", \"slicerdatastore\");\n $items = array(); \n if($metadataDao)\n {\n $db = Zend_Registry::get('dbAdapter');\n $escaped = $db->quote(\"%zzz\".$name.\"zzz%\");\n $results = $db->query(\"SELECT itemrevision_id FROM metadatavalue WHERE value LIKE $escaped AND metadata_id='\".$metadataDao->getKey().\"'\")\n ->fetchAll();\n \n foreach($results as $result)\n {\n $tmpResults = $db->query(\"SELECT value FROM metadatavalue WHERE itemrevision_id='\".$result['itemrevision_id'].\"' AND metadata_id='\".$enabledDao->getKey().\"'\")\n ->fetchAll();\n if(empty($tmpResults))continue;\n $revision = MidasLoader::loadModel(\"ItemRevision\")->load($result['itemrevision_id']);\n if($revision)\n {\n $items[] = $revision->getItem()->getKey();\n }\n } \n }\n return $items;\n }", "function get_all_menu_by_parent($params) {\n $sql = \"SELECT * FROM com_menu\n WHERE portal_id = ? AND parent_id = ?\n ORDER BY nav_no ASC\";\n $query = $this->db->query($sql, $params);\n if ($query->num_rows() > 0) {\n $result = $query->result_array();\n $query->free_result();\n return $result;\n } else {\n return array();\n }\n }", "public function getMenuItems()\n {\n return $this->adminMenu->all();\n }", "public function get(){\n\t\t\t\n\t\t\t$query=\"SELECT menuItem FROM menuModel\";\n\t\t\t$results=$this->db()->query($query);\n\t\t\t\n\t\t\t// echo\"<pre>\";\n\t\t\t// var_dump($results);\n\t\t\t\n\t\t\tforeach($results as $res){\n\t\t\t\t$menu_array[]=$res;\n\t\t\t}\n\t\t\t\n\t\t\treturn $menu_array;\n\t\t\t\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 }", "static function getList(&$params)\n\t{\n\t\t$menu = App::get('menu');\n\n\t\t// If no active menu, use default\n\t\t$active = ($menu->getActive()) ? $menu->getActive() : $menu->getDefault();\n\n\t\t$levels = User::getAuthorisedViewLevels();\n\t\tasort($levels);\n\n\t\t$key = 'mod_menu.' . 'menu_items' . $params . implode(',', $levels) . '.' . $active->id;\n\n\t\tif (!($items = Cache::get($key)))\n\t\t{\n\t\t\t// Initialise variables.\n\t\t\t$list = array();\n\t\t\t$db = App::get('db');\n\n\t\t\t$path = $active->tree;\n\t\t\t$start = (int) $params->get('startLevel');\n\t\t\t$end = (int) $params->get('endLevel');\n\t\t\t$showAll = $params->get('showAllChildren');\n\t\t\t$items = $menu->getItems('menutype', $params->get('menutype'));\n\n\t\t\t$lastitem = 0;\n\n\t\t\tif ($items)\n\t\t\t{\n\t\t\t\tforeach ($items as $i => $item)\n\t\t\t\t{\n\t\t\t\t\tif (($start && $start > $item->level)\n\t\t\t\t\t\t|| ($end && $item->level > $end)\n\t\t\t\t\t\t|| (!$showAll && $item->level > 1 && !in_array($item->parent_id, $path))\n\t\t\t\t\t\t|| ($start > 1 && !in_array($item->tree[$start-2], $path))\n\t\t\t\t\t)\n\t\t\t\t\t{\n\t\t\t\t\t\tunset($items[$i]);\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\t$item->deeper = false;\n\t\t\t\t\t$item->shallower = false;\n\t\t\t\t\t$item->level_diff = 0;\n\n\t\t\t\t\tif (isset($items[$lastitem]))\n\t\t\t\t\t{\n\t\t\t\t\t\t$items[$lastitem]->deeper = ($item->level > $items[$lastitem]->level);\n\t\t\t\t\t\t$items[$lastitem]->shallower = ($item->level < $items[$lastitem]->level);\n\t\t\t\t\t\t$items[$lastitem]->level_diff = ($items[$lastitem]->level - $item->level);\n\t\t\t\t\t}\n\n\t\t\t\t\t$item->parent = (boolean) $menu->getItems('parent_id', (int) $item->id, true);\n\n\t\t\t\t\t$lastitem = $i;\n\t\t\t\t\t$item->active = false;\n\t\t\t\t\t$item->flink = $item->link;\n\n\t\t\t\t\t$item->title = htmlspecialchars($item->title, ENT_COMPAT, 'UTF-8', false);\n\t\t\t\t\t$item->anchor_css = htmlspecialchars($item->params->get('menu-anchor_css', ''), ENT_COMPAT, 'UTF-8', false);\n\t\t\t\t\t$item->anchor_title = htmlspecialchars($item->params->get('menu-anchor_title', ''), ENT_COMPAT, 'UTF-8', false);\n\t\t\t\t\t$item->menu_image = $item->params->get('menu_image', '') ? htmlspecialchars($item->params->get('menu_image', ''), ENT_COMPAT, 'UTF-8', false) : '';\n\n\t\t\t\t\t// Reverted back for CMS version 2.5.6\n\t\t\t\t\tswitch ($item->type)\n\t\t\t\t\t{\n\t\t\t\t\t\tcase 'separator':\n\t\t\t\t\t\t\t// No further action needed.\n\t\t\t\t\t\t\tcontinue 2;\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'url':\n\t\t\t\t\t\t\tif ((strpos($item->link, 'index.php?') === 0) && (strpos($item->link, 'Itemid=') === false))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t// If this is an internal link, ensure the Itemid is set.\n\t\t\t\t\t\t\t\t$item->flink = $item->link . '&Itemid=' . $item->id;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'alias':\n\t\t\t\t\t\t\t// If this is an alias use the item id stored in the parameters to make the link.\n\t\t\t\t\t\t\t$item->flink = 'index.php?Itemid=' . $item->params->get('aliasoptions');\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t$item->flink = 'index.php?Itemid=' . $item->id;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (strcasecmp(substr($item->flink, 0, 4), 'http') && (strpos($item->flink, 'index.php?') !== false))\n\t\t\t\t\t{\n\t\t\t\t\t\t$item->flink = Route::url($item->flink, true, $item->params->get('secure'));\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$item->flink = Route::url($item->flink);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (isset($items[$lastitem]))\n\t\t\t\t{\n\t\t\t\t\t$items[$lastitem]->deeper = (($start ? $start : 1) > $items[$lastitem]->level);\n\t\t\t\t\t$items[$lastitem]->shallower = (($start ? $start : 1) < $items[$lastitem]->level);\n\t\t\t\t\t$items[$lastitem]->level_diff = ($items[$lastitem]->level - ($start ? $start : 1));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tCache::put($key, $items, intval($params->get('cache_time', 900)) / 60);\n\t\t}\n\t\treturn $items;\n\t}", "public function menu()\n {\n $menu_raw = $this->db->select('fs_department.id as de_id, fs_department.name as de_name, fs_category.*')\n ->from('fs_department')\n ->join('fs_category', 'fs_department.id = fs_category.department_id', 'left')\n ->get()->result_array();\n\n $menu_good = array();\n foreach ($menu_raw as $k => $v) {\n $menu_good[$v['de_name']][$k] = $v;// short array menu\n }\n return $menu_good;\n\n }", "public function findByNames(array $name)\n {\n return $this->categoryModel->whereIn('name',$name)->get();\n }", "function loadMenu($arg_menu_name)\n{\n\tINCLUDE('menus/' . $arg_menu_name . '.mnu');\n\treturn $menu;\n}", "public function get_list_of( $name ) {\n\t\t$data = [];\n\t\tswitch ( $name ) {\n\t\t\tcase 'volume':\n\t\t\t\tforeach ( $this->data as $datum ) {\n\t\t\t\t\t$data[] = [\n\t\t\t\t\t\t'id' => $datum['id'],\n\t\t\t\t\t\t'name' => $datum['name'],\n\t\t\t\t\t];\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'devices':\n\t\t\tcase 'device':\n\t\t\t\t$data = $this->get_devices();\n\t\t\t\tbreak;\n\t\t\tcase 'products':\n\t\t\t\t$data = $this->get_products();\n\t\t\t\tbreak;\n\t\t}\n\n\t\treturn apply_filters( 'THESPA_data_list_of', $data, $name );\n\t}", "public function loadMenuName($name=null)\n\t{\n\t\t$theme = wed_getSystemValue('THEME');\n\t\t$pairs = array('theme' => $theme, 'code' => $name);\n\t\t$data = $this->selectByPairs($pairs,null,false);\n\t\t$this->addValues_Data($data);\t\n\t\treturn (!$data) ? false : true ; // let caller know\n\t}", "public static function getAllMenu()\n {\n $rows = Yii::$app->cache->get(\"BackendMenu:all\");\n if (false === is_array($rows)) {\n $rows = static::find()\n ->orderBy('parent_id ASC, sort ASC')\n ->asArray()\n ->all();\n Yii::$app->cache->set(\n \"BackendMenu:all\",\n $rows,\n 86400,\n new TagDependency([\n 'tags' => [\n ActiveRecordHelper::getCommonTag(static::className()),\n ],\n ])\n );\n }\n // rebuild rows to tree $all_menu_items\n $all_menu_items = Tree::rowsArrayToMenuTree($rows, 0, 0, false);\n\n return $all_menu_items;\n }", "public static function getMenus()\n\t{\n\t\t$db = JFactory::getDbo();\n\t\t$query = $db->getQuery(true)\n\t\t\t->select('a.*, SUM(b.home) AS home')\n\t\t\t->from('#__menu_types AS a')\n\t\t\t->join('LEFT', '#__menu AS b ON b.menutype = a.menutype AND b.home != 0')\n\t\t\t->select('b.language')\n\t\t\t->join('LEFT', '#__languages AS l ON l.lang_code = language')\n\t\t\t->select('l.image')\n\t\t\t->select('l.sef')\n\t\t\t->select('l.title_native')\n\t\t\t->where('(b.client_id = 0 OR b.client_id IS NULL)');\n\n\t\t// Sqlsrv change\n\t\t$query->group('a.id, a.menutype, a.description, a.title, b.menutype,b.language,l.image,l.sef,l.title_native');\n\n\t\t$db->setQuery($query);\n\n\t\ttry\n\t\t{\n\t\t\t$result = $db->loadObjectList();\n\t\t}\n\t\tcatch (RuntimeException $e)\n\t\t{\n\t\t\t$result = array();\n\t\t\tJFactory::getApplication()->enqueueMessage(JText::_('JERROR_AN_ERROR_HAS_OCCURRED'), 'error');\n\t\t}\n\n\t\treturn $result;\n\t}", "public function menu() {\n\t\treturn $this->getteams();\n\t}", "public function allmenus() {\n //$this->db->order_by('serialid');\n $query = $this->db->get('menu');\n return $query->result();\n }", "public static function getMenu($nameMenu) {\n ob_start();\n require(DIR_HOME . SP. 'view'. SP .'menu'. SP . $nameMenu .'.php');\n $result = ob_get_contents();\n ob_end_clean();\n\n return $result;\n }", "public function getMenuItems()\n\t{\n\t\treturn Settings_Vtiger_MenuItem_Model::getAll($this->getId());\n\t}", "public function getItemsByName($a_name,$a_recursive = true)\n\t{\n\t\treturn array();\n\t}", "public function getMenu(){\n\n\t\treturn $this->get();\n\t}", "public function obtenerElementosMenu();", "abstract public function getMenuData();", "function _quick_menu () {\n\t\t$menu = array(\n\t\t\tarray(\n\t\t\t\t\"name\"\t=> ucfirst($_GET[\"object\"]).\" main\",\n\t\t\t\t\"url\"\t=> \"./?object=\".$_GET[\"object\"],\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t\"name\"\t=> \"\",\n\t\t\t\t\"url\"\t=> \"./?object=\".$_GET[\"object\"],\n\t\t\t),\n\t\t);\n\t\treturn $menu;\t\n\t}", "protected function getMenuItems( $slugAsId = true ) {\n $type = $slugAsId ? 'slug as id' : 'id';\n\n return self::select( $type , 'name')->where('active', 1)->where('show_menu', 1)->orderBy('order', 'ASC')->get();\n\n }", "function get__menu($terms, $isotope = true) {\n\n\t# Vars \n\t$html = '';\n\t$count = count($terms);\n\n\tif ($count > 0) {\n\t\tif ($isotope) {\n\t\t\t$html .= '<ul class=\"menu--utility\">';\n\t\t\t$html .= '<li class=\"menu__item filter__item iso--filter\" data-filter=\"*\">All</li>';\n\t\t\tforeach ($terms as $term) {\n\t\t\t\t$filter__type = 'filter--' . camelCase(strtolower($term->slug));\n\t\t\t\t$html .= '<li class=\"menu__item filter__item iso--filter\" data-filter=\".' . $filter__type . '\" id=\"' . $filter__type . '\">' . $term->name . '</li>';\n\t\t\t}\n\t\t\t$html .= '</ul>';\n\t\t}\n\n\t\t# Need to refine this later\n\t\telse {\n\t\t\t$html .= '<ul class=\"menu--utility\">';\n\t\t\tforeach ($terms as $term) {\n\t\t\t\t$html .= '<li class=\"menu__item filter__item\">';\n\t\t\t\t$html .= '<a href=\"#\">';\n\t\t\t\t$html .= 'Link';\n\t\t\t\t$html .= '</a>';\n\t\t\t\t$html .= '</li>';\n\t\t\t}\n\t\t\t$html .= '</ul>';\n\t\t}\n\n\t\treturn $html;\n\t}\n\n\telse {\n\t\treturn false;\n\t}\n}", "function get_all_menu_selected_by_parent($params) {\n $sql = \"SELECT a.*, b.role_id, b.role_tp\n FROM com_menu a\n LEFT JOIN (SELECT * FROM com_role_menu WHERE role_id = ?) b ON a.nav_id = b.nav_id\n WHERE portal_id = ? AND parent_id = ?\n ORDER BY nav_no ASC\";\n $query = $this->db->query($sql, $params);\n if ($query->num_rows() > 0) {\n $result = $query->result_array();\n $query->free_result();\n return $result;\n } else {\n return array();\n }\n }", "protected function buildMenuArray() {}", "public function menu()\n\t{\n\t\treturn array(\n\t\t\tarray(\n\t\t\t\t'name' => 'users',\n\t\t\t\t'href' => '#',\n\t\t\t\t'submenu' => TRUE,\n\t\t\t\t'menu' => array(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'name' => 'foo',\n\t\t\t\t\t\t'href' => '#',\n\t\t\t\t\t\t'submenu' => FALSE,\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'name' => 'bar',\n\t\t\t\t\t\t'href' => '#',\n\t\t\t\t\t\t'submenu' => TRUE,\n\t\t\t\t\t\t'menu' => array(\n\t\t\t\t\t\t\t'name' => 'this is a third submenu',\n\t\t\t\t\t\t\t'href' => '#',\n\t\t\t\t\t\t\t'submenu' => FALSE,\n\t\t\t\t\t\t),\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'foobar',\n\t\t\t\t'href' => '#',\n\t\t\t\t'submenu' => FALSE,\n\t\t\t),\n\t\t);\n\t}", "public function getMenu() {\r\n $sql = $this->db->query(\"SELECT * FROM ms_menu WHERE menu_isactive = 1 ORDER BY menu_urut\");\r\n if ($sql->num_rows() > 0) {\r\n return $sql->result_array();\r\n }\r\n return null;\r\n }", "public abstract function getMenuData(): array;", "function menu_build_tree_without_access_check($menu_name, array $parameters = array()) {\n // Build the menu tree without access check and ignore disabled nodes\n $data = _menu_build_tree($menu_name, $parameters);\n return $data['tree'];\n }", "public function search() {\n\t\t\tif (!empty($this->params['form']['query'])) {\n\t\t\t\t/* Get query */\n\t\t\t\t$query = Sanitize::escape($this->params['form']['query']);\n\t\t\t\n\t\t\t\t/* Get list of menu items filtered by query */\n\t\t\t\t$this->menuList = $this->getThreadedList($query);\n\t\t\t} else {\n\t\t\t\t/* Get list of menu items */\n\t\t\t\t$this->menuList = $this->getThreadedList();\n\t\t\t}\n\t\t\t$this->set('menuList', $this->menuList);\n\t\t\t\n\t\t\t$this->render('list');\n\t\t}", "public function getMenus()\n\t{\n\t\t$this->db->select('*');\n\t\t$this->db->from('menus');\n\t\t$this->db->order_by('order', 'ASC');\n\t\t//$this->db->where('post_type', 'menu');\n\t\t$query = $this->db->get();\n\n\t\treturn $query->result();\n\t}", "public static function getInstance($name)\n\t{\n\t\t$rowData = (new App\\Db\\Query())\n\t\t\t->from(self::$menusTable)\n\t\t\t->where(['label' => $name])\n\t\t\t->limit(1)\n\t\t\t->one();\n\t\tif ($rowData) {\n\t\t\treturn self::getInstanceFromArray($rowData);\n\t\t}\n\t\treturn false;\n\t}", "function &getMenus() {\n\t\t$lines = explode(\"\\n\", $this->menus);\n\n\t\t$menus = array();\n\t\tforeach( $lines as $line ) {\n\t\t\tif ($line) {\n\t\t\t\tlist( $menutype, $ordering, $show, $showXML, $priority, $changefreq ) = explode(',', $line);\n\t\t\t\t$info = explode(',', $line);\n\t\t\t\t$menu = new stdclass;\n\t\t\t\t$menu->menutype \t= @$info[0];\n\t\t\t\t$menu->ordering \t= @$info[1];\n\t\t\t\t$menu->show \t\t= @$info[2];\n\t\t\t\t$menu->showXML \t= @$info[3];\n\t\t\t\t$menu->priority \t= (@$info[4]? $info[4] : '0.5');\n\t\t\t\t$menu->changefreq \t= (@$info[5]? $info[5] : 'weekly');\n\t\t\t\t$menu->module \t\t= (@$info[6]? $info[6] : 'mod_mainmenu');\n\t\t\t\t$menus[$menutype] \t= $menu;\n\t\t\t}\n\t\t}\n\t\treturn $menus;\n\t}", "public function get_all($params)\n\t{\n\t\t// loading database table\n\t\t$db_menus = $this->config->item('db_menus');\n\t\t$db_users = $this->config->item('db_users');\n\t\t$db_menu_sections = $this->config->item('db_menu_sections');\n\t\t$db_sections = $this->config->item('db_sections');\n\n\t\t$condition = $join = $custom_select = array();\n\t\t$order_by = $group_by = \"\";\n\n\t\t$start = (isset($params->start) && !empty($params->start) ? $params->start : 0);\n\t\t$end = (isset($params->end) && !empty($params->end) ? $params->end : 1000);\n\n\t\tif (isset($params->menu_id))\n\t\t\t$condition[] = \"m.m_id = '\".@mysql_real_escape_string($params->menu_id).\"'\";\n\n\t\tif (isset($params->title))\n\t\t\t$condition[] = \"m.title LIKE \".'%'.@mysql_real_escape_string($params->title).'%';\n\n\t\tif (isset($params->status))\n\t\t\t$condition[] = \"m.status = '\".@mysql_real_escape_string($params->status).\"'\";\n\n\t\tif (isset($params->load)){\n\n\t\t\tif (in_array('added_by', $params->load)) {\n\t\t\t\t$join[] = \"INNER JOIN $db_users AS u1 ON u1.u_id = m.added_by \";\n\t\t\t\t$custom_select[] = \"u1.full_name AS add_by\";\n\t\t\t}\n\t\t\t\n\t\t\tif (in_array('has_section', $params->load)) {\n\n\t\t\t\t$join[] = \"LEFT JOIN $db_menu_sections AS ms\n\t\t\t\t\t\t\tON ms.`m_id` = m.`m_id`\n\t\t\t\t\t\t\tLEFT JOIN $db_sections AS s\n\t\t\t\t\t\t\tON s.`s_id` = ms.`s_id` \";\n\n\t\t\t\t$custom_select[] = \" IF(s.s_id IS NOT NULL,'yes','no') AS section_exists \";\n\t\t\t\t$group_by = \" GROUP BY m.m_id \";\n\t\t\t}\n\n\t\t\tif (in_array('section', $params->load)) {\n\n\t\t\t\t$join[] = \"LEFT JOIN $db_menu_sections AS ms\n\t\t\t\t\t\t\tON ms.`m_id` = m.`m_id`\n\t\t\t\t\t\t\tLEFT JOIN $db_sections AS s\n\t\t\t\t\t\t\tON s.`s_id` = ms.`s_id` \";\n\n\t\t\t\t$custom_select[] = \" s.title AS section_title,s.s_id AS section_id \";\n\t\t\t\t// $group_by = \" GROUP BY m.m_id \";\n\t\t\t}\n\n\t\t}\n\n\t\tif (isset($params->date_added)){\n\t\t\t$datetime = (ctype_digit($params->date_added) ? $params->date_added : date(\"Y-m-d H:i:s\",strtotime($params->date_added)) );\n\t\t\t$condition[] = \"m.date_added >= $datetime\";\n\t\t}\n\n\t\tif (isset($params->order_by))\n\t\t\t$order_by = \"ORDER BY \".@mysql_real_escape_string($params->order_by);\n\n\t\tif (count($condition))\n\t\t\t$condition = ' WHERE '.implode(\" AND \", $condition);\n\t\telse\n\t\t\t$condition = '';\n\n\t\tif (count($join))\n\t\t\t$join = implode(\" \", $join);\n\t\telse\n\t\t\t$join = '';\n\n\t\tif (count($custom_select))\n\t\t\t$custom_select = ','.implode(\",\", $custom_select);\n\t\telse\n\t\t\t$custom_select = '';\n\t\t\n\n\t\t$sql = \"SELECT m.* $custom_select FROM \".$db_menus.\" AS m $join $condition $group_by $order_by LIMIT $start,$end\";\n\t\t$result = $this->db->query($sql);\n\n\t\tif( $result->num_rows() > 0 )\n\t\t\treturn $result->result();\t\t\t\n\t\telse\n\t\t\treturn NULL;\n\t\n\t}", "public function menu_tree_all_data($menu_name, $link = NULL, $max_depth = NULL)\n {\n return menu_tree_all_data($menu_name, $link, $max_depth);\n }", "public function getMenus()\n {\n return $this->hasMany(Menu::className(), ['id' => 'menu_id'])->viaTable('menu_cook', ['cook_id' => 'id']);\n }", "function getMenuItem($type, $id_admin, $top_menu, $id_parent='-1')\n{\n\tif($type == '1') //for super admin\n\t{\n\t\t$query\t\t= \"* FROM admin_menu where id_parent='\". $id_parent .\"' and status='1' and top_menu = '\". $top_menu .\"' order by sort\";\n\t}\n\telse //for sub admins\n\t{\n\t\t$query\t\t= \"* FROM admin_menu as AM, admin_access as AC where AM.id_menu = AC.id_menu and AM.id_parent='\". $id_parent .\"' and AM.status='1' and top_menu = '\". $top_menu .\"' \";\n\t\tif($type != '1')\n\t\t\t$query\t.= \"and AC.id_admin = '\". $id_admin .\"' \";\n\t\t$query\t\t.= \"order by sort\";\t\n\t}\n\treturn getLoopData($query);\n}", "function GetMenu()\n {\n $sql = \"SELECT\n title,\n slug,\n id\n FROM\n pages\";\n $this->setSql($sql);\n return $this->getAll();\n }", "public function getMenu()\n\t{\n\t\t$user = $this->user;\n\n\t\t$session = Yii::$app->session;\n\t\t$sessionMenus = $session->get('user.menus');\n\t\tif ( $user->role != 30 )\n\t\t{\n\n\t\t\t$role = Role::find()->where(['=', 'code', $user->role])->one();\n\t\t\t$menuPermission = Menu::getMenuPermission($role->id);\n\t\t\t$session->set('user.menus', $menuPermission); \t\n\n\t\t} else {\n\t\t\t$menuPermission = Menu::getMenuAdmin();\n\t\t\t$session->set('user.menus', $menuPermission);\n\t\t}\n\n\t\t$pureMenu = ArrayHelper::toArray($menuPermission);\n\t\t$reIndex = ArrayHelper::index($pureMenu, 'id');\n\t\t$result = [];\n\t\tforeach ($pureMenu as $key => $menu) {\n\t\t\tif ( array_key_exists($menu['parent_id'], $reIndex) )\n\t\t\t{\n\t\t\t\tunset( $reIndex[$menu['id']] );\n\t\t\t\t$menu['name'] = str_replace($reIndex[$menu['parent_id']]['name'], '', $menu['name']);\n\t\t\t\t$reIndex[$menu['parent_id']]['child'][] = $menu;\n\t\t\t}\n\t\t}\n\t\t// echo \"<pre>\";print_r($reIndex);exit;\n\t\treturn $reIndex;\t\t\t\n\t}", "public function index()\n {\n return $this->menu->all();\n }", "public function getMenuArray()\n {\n $menuArray = $this->_buildMenuArray();\n if (isset($menuArray['report']) && isset($menuArray['report']['children']) && isset($menuArray['report']['children']['cleansql'])) {\n $this->_appendCleanSqlReports($menuArray['report']['children']['cleansql']);\n }\n return $menuArray;\n }", "function listitems($name)\r\n\t\t{\r\n\t\t \t\r\n\t\t}", "public static function get_all()\n\t{\n\n\t\t$params = array(\n\t\t\t'orderby' => 'name ASC'\n\t\t\t);\n\n\t\treturn self::get( $params );\n\t}", "public function getFilter(string $name);", "function getMenus($parent_menu=false,$parent_id=null){\r\n\t\t$this->db->select(TBL_MASTER_MENUS.'.*');\r\n\t\tif($parent_menu==true){\r\n\t\t\t$this->db->where(array('menu_parent_id'=>0));\r\n\t\t}\r\n\t\tif($parent_id!=null && $parent_id!=''){\r\n\t\t\t$this->db->where(array('menu_parent_id'=>$parent_id));\r\n\t\t}\r\n\t\t$this->db->where(array('is_active'=>1));\r\n\t\t\t\r\n\t\t$this->db->from(TBL_MASTER_MENUS);\r\n\t\t$recordSets = $this->db->get();\r\n\t\t$data = $recordSets->result();\r\n\t\treturn $data;\r\n\t}", "function get_custom_menu($name, $classes = array()) {\n $menu = new CustomMenuDisplay($name, $classes);\n $menu->displayMenu();\n}", "public static function menus(): array\n {\n return [];\n }", "public function query()\n {\n return MenuGroup::query();\n }", "public function allNamed(): array;", "function get_list_items_by_name( $name )\n {\n $q = \"SELECT * FROM \n list_items\n LEFT JOIN lists ON list_items.list_id = lists.id \n WHERE LOWER(TRIM(name)) = \" . $this->db->escape(strtolower(trim($name))) . \n ' ORDER BY sort_order';\n $res = $this->db->query( $q );\n \n $data = array();\n foreach( $res->result() as $row ) {\n $item = $this->get_item_by_type($row->type, $row->data_id);\n \n\n /* \n \t\t$q = \"\n SELECT a.id, title, body, excerpt, ac.category, publish_on, author, \n owner, ast.status, a.group as group_id, gt.name as group_name, \n u.firstname, u.lastname, u.nickname\n \tFROM articles as a, article_categories as ac, article_statuses as ast, group_tree as gt, users as u\n WHERE a.category = ac.id AND a.status = ast.id AND a.group = gt.id AND u.username = a.owner\n AND a.id = $row->data_id\";\n\n $res = $this->db->query( $q );\n if( $res->num_rows() ) {\n $ritem = $res->row();\n\t\t\t $ritem->media = $this->media_model->get_media_for_path(\"/articles/$ritem->id\", 'general', 1);\n $data[] = $ritem;\n }*/\n if ($item) $data[] = $item;\n }\n return $data;\n }", "public function getSortMenu();", "public static function getMenuItems($menutype)\n\t{\n\t\t$db = JFactory::getDbo();\n\t\t$query = $db->getQuery(true);\n\n\t\t// Prepare the query.\n\t\t$query->select('m.*')\n\t\t\t->from('#__menu AS m')\n\t\t\t->where('m.menutype = ' . $db->q($menutype))\n\t\t\t->where('m.client_id = 1')\n\t\t\t->where('m.published = 1')\n\t\t\t->where('m.id > 1');\n\n\t\t// Filter on the enabled states.\n\t\t$query->select('e.element')\n\t\t\t->join('LEFT', '#__extensions AS e ON m.component_id = e.extension_id')\n\t\t\t->where('(e.enabled = 1 OR e.enabled IS NULL)');\n\n\t\t// Order by lft.\n\t\t$query->order('m.lft');\n\n\t\t$db->setQuery($query);\n\n\t\t// Component list\n\t\ttry\n\t\t{\n\t\t\t$menuItems = $db->loadObjectList();\n\n\t\t\tforeach ($menuItems as &$menuitem)\n\t\t\t{\n\t\t\t\t$menuitem->params = new Registry($menuitem->params);\n\t\t\t}\n\t\t}\n\t\tcatch (RuntimeException $e)\n\t\t{\n\t\t\t$menuItems = array();\n\t\t\tJFactory::getApplication()->enqueueMessage(JText::_('JERROR_AN_ERROR_HAS_OCCURRED'), 'error');\n\t\t}\n\n\t\treturn $menuItems;\n\t}", "public function get_list_of_menus(){\n\n $items = array();\n\n $args = array(\n 'post_type' => 'erm_menu',\n 'orderby' => 'menu_order',\n 'order' => 'ASC',\n 'post_status' => 'publish',\n 'posts_per_page' => -1 \n );\n\n $menu_posts = get_posts($args);\n\n if ( !empty($menu_posts) ) {\n\n foreach ( $menu_posts as $menu_post ){\n $items[] = array(\n 'title' => $menu_post -> post_title,\n 'url' => $menu_post -> post_name\n );\n }\n\n }\n else{\n return new WP_Error( 'no_menus', 'No menus found', array( 'status' => 404 ) );\n }\n\n return $items;\n\n }", "public static function getAll() {\r\n $results = db_select('{md_megamenus}', 'mmn')\r\n ->fields('mmn')\r\n ->execute()\r\n ->fetchAll(PDO::FETCH_CLASS, 'MDMegaMenu');\r\n\r\n if (!count($results)) {\r\n return array();\r\n }\r\n\r\n # Run object initialize\r\n foreach ($results as &$menu) {\r\n if ($menu instanceof stdClass)\r\n $menu = _megamenu_recast('MDMegaMenu', $menu);\r\n\r\n $menu->initialize();\r\n }\r\n\r\n # Return list menus\r\n return $results;\r\n }", "public function filter_wp_get_nav_menus($menus, $args)\n {\n }", "public function searchByName($name){\n $projections=$this->getAllProjectionsGroup();\n $arrayFinded = array();\n foreach ($projections as $value) {\n $movie=$value->getMovie();\n if (stripos($movie->getTitle(),$name)!==false)\n {\n array_push($arrayFinded,$value);\n }\n }\n return $arrayFinded; \n }", "function api_list_menus() {\n\t\t$menus = array();\n\t\tforeach ( get_nav_menu_locations() as $menu_slug => $menu_id ) {\n\n\t\t\t$menu = $menu_id?self::get_menu_object($menu_id):false;\n\t\t\t$menus[ $menu_slug ] = $menu;\n\t\t}\n\n\t\treturn $menus;\n\t}", "abstract protected function getMenuTree();", "public function prepareMenu()\n {\n if (empty($this->list)) {\n // Load the menu based on the module's parameters\n $this->list = \\Admin\\Models\\Menus::instance()->emptyState()->setState('filter.root', false)->setState('filter.published', true)->setState('filter.tree', $this->mapper->{'details.selected-menu'})->setState('order_clause', array( 'tree'=> 1, 'lft' => 1 ))->getList();\n }\n \n if (empty($this->list)) {\n return array();\n }\n\n $items = $this->list;\n \n $this->items = $items;\n }", "public function getMenus($filter = null)\n {\n return $this->contentManager->listMenus($filter);\n }", "function getAllMenus(){\n $data = array();\n $Q = $this->db->get('adminmenu');\n if ($Q->num_rows() > 0){\n foreach ($Q->result_array() as $row){\n $data[] = $row;\n }\n }\n $Q->free_result();\n return $data;\n }", "public function getChildrenMenuitems($menuitem){\n\t\t$collection = $menuitem->getCollection();\n\t\t$collection\n\t\t\t->addFilter('status', 1)\n\t\t\t->addIdFilter($menuitem->getChildren())\n\t\t\t->setOrder('position', Varien_Db_Select::SQL_ASC)\n\t\t\t->load();\n\t\treturn $collection;\n\t}", "public function getNavigation() {\n \n $search = $this->search();\n $menuObjects = $search->getRecords();\n $result = array();\n $fields = $this->definition->fields();\n $menuItemField = FieldService::instance()->getFieldByName($fields, \"menuItems\");\n \n //$search->getRelationsForObjects(\"menuItems\", $menuObjects);\n \n foreach($menuObjects as $menuObject) {\n $result[$menuObject->name] = $search->getRelations($menuItemField, $menuObject->id);\n }\n \n return $result;\n }", "public function index(Request $request, Menu $menu)\n {\n $search = $request->input('search');\n\n $menuModel = $menu->where(function ($query) use ($search) {\n if ($search) {\n $query->orWhere('title', 'like', '%' . $search . '%');\n $query->orWhere('name', 'like', '%' . $search . '%');\n }\n });\n $list = $menuModel->orderBy('id', 'desc')->paginate($request->input('limit'))->toArray();\n if ($list['data']) {\n $kv = $menu->kv();\n foreach ($list['data'] as $k => $item) {\n $list['data'][$k]['pName'] = isset($kv[$item['pId']]) ? $kv[$item['pId']] : '一级菜单';\n $list['data'][$k]['pIds'] = json_decode($item['pIds'], true);\n }\n }\n return $this->apiSuccess($list);\n }", "public function get($name, array $options = array())\n {\n if (!$this->has($name)) {\n throw new \\InvalidArgumentException('Menu \"' . $name . '\" doesn\\'t exists.');\n }\n\n return $this->mainMenu($options);\n }", "public static function returnMenu() {\n return array(\n array(\n 'title' => 'Eve - лица',\n 'link' => self::$group . '/' . 'faces',\n 'class' => 'fa-list-alt',\n 'permit' => 'view',\n ),\n );\n }", "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 }" ]
[ "0.6168145", "0.6147449", "0.60135096", "0.5904966", "0.59036624", "0.5884623", "0.5865573", "0.58650035", "0.5856898", "0.58082414", "0.5732923", "0.571809", "0.5711931", "0.56924874", "0.5690392", "0.56776494", "0.56368977", "0.5631922", "0.5631885", "0.5629822", "0.5603935", "0.55979645", "0.5573846", "0.557004", "0.55393845", "0.55345225", "0.55307406", "0.551035", "0.55020577", "0.5490583", "0.5485642", "0.54810643", "0.54788876", "0.54761165", "0.5473062", "0.546463", "0.54544663", "0.54488707", "0.5446104", "0.54315764", "0.5425183", "0.5418558", "0.5405244", "0.539708", "0.5394667", "0.53814185", "0.5374746", "0.535881", "0.53572875", "0.5352062", "0.5341146", "0.5339342", "0.5326631", "0.5323456", "0.5315973", "0.5307634", "0.53034925", "0.5291852", "0.5280997", "0.52753574", "0.527471", "0.5274511", "0.527434", "0.5272944", "0.5266536", "0.5254225", "0.5249859", "0.5247376", "0.5236931", "0.52361816", "0.5235886", "0.5230901", "0.522278", "0.52152306", "0.5209526", "0.5204362", "0.5198138", "0.5197877", "0.5197723", "0.51868635", "0.5186492", "0.51859534", "0.5181735", "0.517547", "0.517332", "0.5171588", "0.5171125", "0.5170897", "0.5162099", "0.5153034", "0.51528513", "0.5150947", "0.5140109", "0.5138273", "0.513614", "0.5122484", "0.51068115", "0.51045144", "0.50967073", "0.5096063" ]
0.53691375
47
Saves menus in page based on passed arguments
public function saveMenus( $name, $template = Menu::DEFAULT_TEMPLATE, $items = null, $itemProcess = null, $activeClass = null, $isActive = null ) { $menus = $this->menus($name); $processedItems = []; foreach ($menus as $menu) { // If items are passed, set them if ($items !== null) { $menu->items( $items, $itemProcess ); } $processedItems = $menu->items(); $menu->setTemplate($template); if ($activeClass !== null) { $menu->setActiveClass($activeClass); } $menu->html($isActive); } return $processedItems; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function save() {\n foreach($this->getMenuItems() as $item){\n $item->setMenu($this);\n $item->save();\n }\n parent::save();\n }", "function wp_save_nav_menu_items($menu_id = 0, $menu_data = array())\n {\n }", "public function save($arguments,$function='body') {\n\t\t$id = md5($this->mid);\n\t\t$module = $this->parent->get_type();\n\t\tDB::Replace('utils_custommenu_page',array('id'=>$id,'module'=>$module,'function'=>$function,'arguments'=>serialize($arguments)),array('id'),true);\n\t\tDB::Execute('DELETE FROM utils_custommenu_entry WHERE page_id=%s',$id);\n\t\t$data = $this->get_module_variable('data');\n\t\tforeach($data as $row)\n\t\t\tDB::Execute('INSERT INTO utils_custommenu_entry(page_id,path) VALUES(%s, %s)',array($id,$row));\t\t\n\t}", "public function actionSaveMenuItems(): void\n {\n $this->requirePostRequest();\n $intMenuId = Craft::$app->request->getBodyParams()['menu-id'];\n $strMenuItems = Craft::$app->request->getBodyParams()['menu-items-serialized'];\n\n $arrMenuItems = json_decode($strMenuItems, true);\n\n if (!empty($arrMenuItems)) {\n foreach($arrMenuItems as $order=> $menuItem) {\n $parent_id = 0;\n\n if (isset($menuItem['parent-id'])){\n $parent_id = $menuItem['parent-id'];\n\n foreach ($arrMenuItems as $element) {\n if (isset($element['item-id']['html']) && $element['item-id']['html'] == $parent_id) {\n $parent_id = $element['menu-item-db-id'];\n $arrMenuItems[$order]['parent-id'] = $parent_id;\n break;\n }\n }\n }\n \n if ($menuItem['item-id']['db'] != null) {\n $menuItemModel = Olivemenus::$plugin->olivemenuItems->getMenuItem($menuItem['item-id']['db']);\n } else {\n $menuItemModel = new OlivemenusItemsModel();\n }\n $arrData['id']= $menuItem['item-id']['db'];\n $arrData['menu_id']= $intMenuId;\n $arrData['parent_id']= $parent_id;\n $arrData['item_order']= $order;\n $arrData['name']= $menuItem['name'];\n $arrData['entry_id']= (isset($menuItem['entry-id']) ? $menuItem['entry-id'] : '');\n $arrData['custom_url']= (isset($menuItem['custom-url']) ? $menuItem['custom-url'] : '');\n $arrData['class']= (isset($menuItem['class']) ? $menuItem['class'] : '');\n $arrData['class_parent']= (isset($menuItem['class-parent']) ? $menuItem['class-parent'] : '');\n $arrData['data_json']= (isset($menuItem['data-json']) ? $menuItem['data-json'] : '');\n $arrData['target']= (isset($menuItem['target']) ? $menuItem['target'] : '');\n\n $menuItemModel->setAttributes($arrData);\n\n if ($menuItemModel->validate()) {\n $menuItemDbId = Olivemenus::$plugin->olivemenuItems->saveMenuItem($menuItemModel);\n if (is_numeric($menuItemDbId)) $arrMenuItems[$order]['menu-item-db-id'] = $menuItemDbId;\n }\n }\n }\n\n $menuItemsDeleted = Craft::$app->request->getBodyParams()['menu-items-deleted'];\n if (!empty($menuItemsDeleted)) {\n $arrItems = explode(',', $menuItemsDeleted);\n if (!empty($arrItems)) {\n foreach ($arrItems as $intVal) {\n Olivemenus::$plugin->olivemenuItems->deleteMenuItem($intVal);\n }\n }\n }\n Craft::$app->getSession()->setNotice(Craft::t('olivemenus', 'Menu items saved successfully.'));\n }", "public function saveMenu($params){\r\n\t\tif(!$params)return;\r\n\t\t$db = Zend_Registry :: get(\"db\");\r\n\t\r\n\t\tforeach($params['section_id'] as $key => $val){\r\n\t\t\t$date = date(\"Y-m-d H:i:s\");\r\n\t\t\t$code = $params['lookup_code'];\r\n\t\t\t$name = $params['lookup_name'];\r\n\t\t\t$item = array(\r\n\t\t\t\t\t'm_id' \t\t\t=> $val,\r\n\t\t\t\t\t'lookup_code' \t=> $code,\r\n\t\t\t\t\t'lookup_name'\t=> $name,\r\n\t\t\t\t\t'lookup_date'\t=> $date\r\n\t\t\t);\r\n\t\t\t\t\r\n\t\t\t$inserted = $db->insert('lookup_menu', $item);\r\n\t\t}\r\n\t}", "public function save_options_menu() {\n if ( !isset($_REQUEST['cs_nonce']) ) return;\n if ( !isset($_REQUEST['cs_options']) ) return;\n if ( !isset($_REQUEST['cs_page']) ) return;\n if ( !wp_verify_nonce( stripslashes($_REQUEST['cs_nonce']), 'save-caseswap-options') ) return;\n\n $section = stripslashes( $_REQUEST['cs_page'] );\n if ( !isset($this->option_pages[$section]) ) return;\n\n $options = $this->get_options();\n $submitted = $this->get_options( stripslashes_deep($_REQUEST['cs_options']) );\n\n // We only want to save the updated options for the page we clicked \"Save changes\" for.\n foreach( $this->option_pages[$section]['fields'] as $key ) {\n if ( isset($submitted[$key]) ) {\n $options[$key] = $submitted[$key];\n }else{\n $options[$key] = false;\n }\n }\n\n // Save the updated options\n update_option( 'caseswap-options', $options );\n\n $args = apply_filters( 'caseswap-options-saved-redirect-args', array('cs_page' => $section, 'cs_message' => 'options-saved'), $this );\n\n wp_redirect( add_query_arg( $args, $this->options_page_url) );\n exit;\n }", "function do_page_save($mode=\"ADD\") {\n\tif(!has_user_permission(__FUNCTION__,$mode)) return;\n\tglobal $GO,$ROW;\n\tLOG_MSG('INFO',\"do_page_save(): START (mode=$mode)\");\n\tif ($mode == 'ADD') { $GO='list'; }\n\t// Get all the args from $_POST\n\t$page_id=get_arg($_POST,\"page_id\");\n\t$name=make_clean_url(get_arg($_POST,\"name\"));\n\t$title=get_arg($_POST,\"title\");\n\t$content=get_arg($_POST,\"content\");\n\t$type=get_arg($_POST,\"type\");\n\tLOG_MSG('DEBUG',\"do_page_save(): Got args\");\n\tif ( $type != 'HTML' && $type != 'CODE' ) $type='HTML';\n\t// Validate parameters\n\tif (!validate(\"Name\",$name,1,100,\"varchar\") ||\n\t\t!validate(\"Title\",$title,1,100,\"varchar\") ||\n\t\t!validate(\"Content\",$content,0,65536,\"text\") ||\n\t\t!validate(\"Type\",$type,1,20,\"varchar\")) {\n\t\tLOG_MSG('ERROR',\"do_page_save(): Validate args failed!\");\n\t\t return;\n\t} \n\tLOG_MSG('DEBUG',\"do_page_save(): Validated args\");\n\t##################################################\n\t# DB INSERT #\n\t##################################################\n\tswitch($mode) {\n\t\tcase \"ADD\":\n\t\t\t$ROW=db_page_insert(\n\t\t\t\t\t\t\t\t$name,\n\t\t\t\t\t\t\t\t$title,\n\t\t\t\t\t\t\t\t$content,\n\t\t\t\t\t\t\t\t$type);\n\t\t\tif ( $ROW['STATUS'] != \"OK\" ) {\n\t\t\t\tswitch ($ROW[\"SQL_ERROR_CODE\"]) {\n\t\t\t\t\tcase 1062: // unique key\n\t\t\t\t\t\tadd_msg(\"ERROR\",\"The Page <strong>$name</strong> is already in use. Please enter a different Page\");\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tadd_msg(\"ERROR\",\"There was an error adding the Page <strong>$name</strong>.\");\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tLOG_MSG('ERROR',\"do_page_save(): Add args failed!\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tadd_msg(\"SUCCESS\",\"New Page <strong>$name</strong> added successfully\");\n\t\t\tbreak;\n\t\tcase \"UPDATE\":\n\t\t\t// Validate page_id\n\t\t\tif ( !validate(\"Page Id\",$page_id,1,11,\"int\") ) { \n\t\t\t\tLOG_MSG('ERROR',\"do_page_save(): Validate arguments failed\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t$ROW=db_page_update(\n\t\t\t\t\t\t\t\t$page_id,\n\t\t\t\t\t\t\t\t$name,\n\t\t\t\t\t\t\t\t$title,\n\t\t\t\t\t\t\t\t$content,\n\t\t\t\t\t\t\t\t$type);\n\t\t\tif ( $ROW['STATUS'] != \"OK\" ) {\n\t\t\t\tadd_msg(\"ERROR\",\"There was an error updating the Page <strong>$name</strong> .\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tadd_msg(\"SUCCESS\",\"Page <strong>$name</strong> updated successfully\");\n\t\t\tbreak;\n\t}\n\t// on success show the list\n\t//$GO=\"list\";\n\tLOG_MSG('INFO',\"do_page_save(): END\");\n}", "public function save() {\r\n $fields = array();\r\n\r\n foreach ($this->dbFields() as $field_name) {\r\n $fields[$field_name] = $this->{$field_name};\r\n }\r\n\r\n if (!is_string($fields['settings'])) {\r\n $fields['settings'] = serialize($fields['settings']);\r\n }\r\n\r\n # check update or create new\r\n if (!$this->mid) {\r\n $mid = db_insert('md_megamenus')\r\n ->fields($fields)\r\n ->execute();\r\n\r\n if (!$mid) {\r\n return FALSE;\r\n }\r\n $this->mid = $mid;\r\n }\r\n else {\r\n # update for menu\r\n db_update('{md_megamenus}')\r\n ->condition('mid', $this->mid)\r\n ->fields($fields)\r\n ->execute();\r\n }\r\n\r\n # Generate css custom for menu\r\n generate_menu_css_configure($this->mid, $this->settings);\r\n\r\n return TRUE;\r\n }", "public function generate_menu() {\n\t\t\t$nav_menus = wp_get_nav_menus();\n\t\t\t$menu_count = count($nav_menus);\n\n\t\t\t// Allowed actions: add, update, delete\n\t\t\t$action = isset( $_REQUEST['action'] ) ? $_REQUEST['action'] : 'edit';\n\n\t\t\t$nav_menu_selected_id = isset($_REQUEST['menu']) ? (int) $_REQUEST['menu'] : 0;\n\n\t\t\t// Are we on the add new screen?\n\t\t\t$add_new_screen = ( isset( $_GET['menu'] ) && 0 == $_GET['menu'] ) ? true : false;\n\t // Get recently edited nav menu.\n\t $recently_edited = absint(get_user_option('nav_menu_recently_edited'));\n\t if (empty($recently_edited) && is_nav_menu($nav_menu_selected_id))\n\t $recently_edited = $nav_menu_selected_id;\n\n\t // Use $recently_edited if none are selected.\n\t if (empty($nav_menu_selected_id) && !isset($_GET['menu']) && is_nav_menu($recently_edited))\n\t $nav_menu_selected_id = $recently_edited;\n\n\t if (empty($nav_menu_selected_id) && !empty($nav_menus) && !$add_new_screen) {\n\t // if we have no selection yet, and we have menus, set to the first one in the list.\n\t $nav_menu_selected_id = $nav_menus[0]->term_id;\n\t }\n\n\t // Update the user's setting.\n\t if ($nav_menu_selected_id != $recently_edited && is_nav_menu($nav_menu_selected_id))\n\t update_user_meta(get_current_user_id(), 'nav_menu_recently_edited', $nav_menu_selected_id);\n\n\t //if menu hase change on dropdwon and save menu than recently menu option will update\n\t if (!empty($_POST['menu'])) {\n\t $nav_menu_selected_id = (int) $_POST['menu'];\n\t $user_id = get_current_user_id();\n\t update_user_meta($user_id, 'nav_menu_recently_edited', $nav_menu_selected_id);\n\t }\n\t $menu_locations = get_nav_menu_locations();\n\t $locations = get_registered_nav_menus();\n\n\t $users_data = array('udata' => $this->get_all_user_data());\n\n\t\t\t$nav_menus_l10n = array(\n\t\t\t\t'oneThemeLocationNoMenus' => '',\n\t\t\t\t'moveUp' => __( 'Move up one' ),\n\t\t\t\t'moveDown' => __( 'Move down one' ),\n\t\t\t\t'moveToTop' => __( 'Move to the top' ),\n\t\t\t\t/* translators: %s: previous item name */\n\t\t\t\t'moveUnder' => __( 'Move under %s' ),\n\t\t\t\t/* translators: %s: previous item name */\n\t\t\t\t'moveOutFrom' => __( 'Move out from under %s' ),\n\t\t\t\t/* translators: %s:s previous item name */\n\t\t\t\t'under' => __( 'Under %s' ),\n\t\t\t\t/* translators: %s: previous item name */\n\t\t\t\t'outFrom' => __( 'Out from under %s' ),\n\t\t\t\t/* translators: 1: item name, 2: item position, 3: total number of items */\n\t\t\t\t'menuFocus' => __( '%1$s. Menu item %2$d of %3$d.' ),\n\t\t\t\t/* translators: 1: item name, 2: item position, 3: parent item name */\n\t\t\t\t'subMenuFocus' => __( '%1$s. Sub item number %2$d under %3$s.' ),\n\t\t\t);\n\t\t\t \n\n\t //$messages = $this->processing_action_request($action, $nav_menu_selected_id);\n\t $messages = MMCP_Controllers::instance()->get_messages();\n\t wp_nav_menu_setup();\n\t wp_initial_nav_menu_meta_boxes();\n\t wp_enqueue_script('nav-menu');\n\t $all_register_widget_items = MMCP_Manager_Widget::instance()->get_all_items_register_widget();\n\t\t\tif ( wp_is_mobile() )\n\t\t\t\twp_enqueue_script( 'jquery-touch-punch' ); \n\t\t\twp_localize_script( 'nav-menu', 'menus', $nav_menus_l10n );\n\t\t\twp_localize_script( 'nav-menu', 'mmcp_users', $users_data );\n\t //wp_nav_menu_post_type_meta_boxes();\n\t //wp_nav_menu_taxonomy_meta_boxes(); \n\t include_once(MMCPRO()->plugin_path().'/admin/views/menus/group_menu.php');\n\t include_once(MMCPRO()->plugin_path().'/admin/views/menus/items.php');\n\t //include_once(MMCPRO()::$plugin_path.'admin/views/menus/group_menu.php');\n\t\t}", "function save($isAjaxR=true) {\n if ($isAjaxR) $this->doNotRenderHeader = true;\n $this->set('menu', json_encode($this->create_archive_nav_array()));\n }", "function page_menueeditor() {\r\n\t\tglobal $_GET,$_POST, $admin_language;\r\n\t\r\n\t\t$menue_id = 0;\r\n\t\t$out = \"\\t\\t\\t<h3>Menueeditor</h3><hr />\t\r\n\t\t\t<ul>\\r\\n\";\r\n\t\r\n\t\tif(isset($_GET['menue_id']) || isset($_POST['menue_id'])) {\r\n\t\t\tif(isset($_GET['menue_id']))\r\n\t\t\t\t$menue_id = $_GET['menue_id'];\r\n\t\t\telse\r\n\t\t\t\t$menue_id = $_POST['menue_id'];\r\n\t\t}\r\n\t\t//\r\n\t\t// write the 'coose menue' to make it able to switch betwen both possible menues\r\n\t\t//\r\n\t\tif($menue_id == \"2\")\r\n\t\t\t$out .= \"\\t\\t\\t\\t<li><a href=\\\"admin.php?page=menueeditor&amp;menue_id=1\\\">Menü 1</a></li>\r\n\t\t\t\t<li><u>Menü 2</u></li>\\r\\n\";\r\n\t\telse {\r\n\t\t\t$out .= \"\\t\\t\\t\\t<li><u>Menü 1</u></li>\r\n\t\t\t\t<li><a href=\\\"admin.php?page=menueeditor&amp;menue_id=2\\\">Menü 2</a></li>\\r\\n\";\r\n\t\t\t$menue_id = 1;\r\n\t\t}\r\n\t\t$out .= \"\\t\\t\\t</ul>\\r\\n\";\r\n\t\r\n\t\tif(isset($_GET['action']) || isset($_POST['action'])) {\r\n\t\t\tif(isset($_GET['action']))\r\n\t\t\t\t$action = $_GET['action'];\r\n\t\t\telse\r\n\t\t\t\t$action = $_POST['action'];\r\n\t\t\r\n\t\t\tif(isset($_GET['id']))\r\n\t\t\t\t$id = $_GET['id'];\r\n\t\t\telseif(isset($_POST['id']))\r\n\t\t\t\t$id = $_POST['id'];\r\n\t\t\telse\r\n\t\t\t\t$id = 0;\r\n\t\t\t//\r\n\t\t\t// put the item one position higher\r\n\t\t\t//\r\n\t\t\tif($action == \"up\") {\r\n\t\t\t\t$_result = db_result(\"SELECT * FROM \".DB_PREFIX.\"menue WHERE id=\".$id.\"\");\r\n\t\t\t\t$_data = mysql_fetch_object($_result);\r\n\t\t\t\t$id1 = $_data->id;\r\n\t\t\t\t//\r\n\t\t\t\t// get the orderid to find the follownig menue item\r\n\t\t\t\t//\r\n\t\t\t\t$orderid1 = $_data->orderid;\r\n\t\t\t\r\n\t\t\t\t$_result2 = db_result(\"SELECT * FROM \".DB_PREFIX.\"menue WHERE orderid <\".$orderid1.\" AND menue_id=\".$menue_id.\" ORDER BY orderid DESC\");\r\n\t\t\t\t$_data2 = mysql_fetch_object($_result2);\r\n\t\t\t\t\r\n\t\t\t\t//\r\n\t\t\t\t// switch the orderids to cange the order of this two menue items\r\n\t\t\t\t//\r\n\t\t\t\tif($_data2 != null) {\r\n\t\t\t\t\t$id2 = $_data2->id;\r\n\t\t\t\t\t$orderid2 = $_data2->orderid;\r\n\t\t\t\t\tdb_result(\"UPDATE \".DB_PREFIX.\"menue SET orderid= \".$orderid2.\" WHERE id=\".$id1);\r\n\t\t\t\t\tdb_result(\"UPDATE \".DB_PREFIX.\"menue SET orderid= \".$orderid1.\" WHERE id=\".$id2);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t//\r\n\t\t\t// put the item one position lower\r\n\t\t\t//\r\n\t\t\telseif($action == \"down\") {\r\n\t\t\t\t$_result = db_result(\"SELECT * FROM \".DB_PREFIX.\"menue WHERE id=\".$id.\"\");\r\n\t\t\t\t$_data = mysql_fetch_object($_result);\r\n\t\t\t\t$id1 = $_data->id;\r\n\t\t\t\t$orderid1 = $_data->orderid;\r\n\t\t\t\r\n\t\t\t\t$_result2 = db_result(\"SELECT * FROM \".DB_PREFIX.\"menue WHERE orderid >\".$orderid1.\" AND menue_id=\".$menue_id.\" ORDER BY orderid ASC\");\r\n\t\t\t\t$_data2 = mysql_fetch_object($_result2);\r\n\t\t\t\r\n\t\t\t\tif($_data2 != null) {\r\n\t\t\t\t\t$id2 = $_data2->id;\r\n\t\t\t\t\t$orderid2 = $_data2->orderid;\r\n\t\t\t\t\tdb_result(\"UPDATE \".DB_PREFIX.\"menue SET orderid= \".$orderid2.\" WHERE id=\".$id1);\r\n\t\t\t\t\tdb_result(\"UPDATE \".DB_PREFIX.\"menue SET orderid= \".$orderid1.\" WHERE id=\".$id2);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t//\r\n\t\t\t// remove the selected item\r\n\t\t\t//\r\n\t\t\telseif($action == \"delete\") {\r\n\t\t\t\tif(isset($_GET['sure']) || isset($_POST['sure'])) {\r\n\t\t\t\t\tif(isset($_GET['sure']))\r\n\t\t\t\t\t\t$sure = $_GET['sure'];\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\t$sure = $_POST['sure'];\r\n\t\t\t\t\tif($sure == 1)\r\n\t\t\t\t\t\tdb_result(\"DELETE FROM \".DB_PREFIX.\"menue WHERE id=\".$id.\"\");\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\t$_result = db_result(\"SELECT * FROM \".DB_PREFIX.\"menue WHERE id=\".$id.\"\");\r\n\t\t\t\t\t$_data = mysql_fetch_object($_result);\r\n\t\t\t\t\t$out .= \"\\t\\t\\t<div class=\\\"error\\\">Soll der Link \".$_data->text.\"(\".$_data->link.\") wirklich gelöscht werden?<br />\r\n\t\t\t<a href=\\\"admin.php?page=menueeditor&amp;action=delete&amp;menue_id=\".$menue_id.\"&amp;id=\".$id.\"&amp;sure=1\\\" title=\\\"Wirklich Löschen?\\\">Ja</a> &nbsp;&nbsp;&nbsp; <a href=\\\"admin.php?page=menueeditor&amp;menue_id=\".$menue_id.\"\\\" title=\\\"Nein! nicht löschen\\\">Nein</a></div>\";\r\n\t\t\t\t\t\r\n\t\t\t\t\treturn $out;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t//\r\n\t\t\t// add a new item\r\n\t\t\t//\r\n\t\t\telseif($action == \"add\") {\r\n\t\t\t\tif(isset($_GET['intern_link']))\r\n\t\t\t\t\t$intern_link = $_GET['intern_link'];\r\n\t\t\t\telse\r\n\t\t\t\t\t$intern_link = $_POST['intern_link'];\r\n\t\t\t\r\n\t\t\t\tif(isset($_GET['extern_link']))\r\n\t\t\t\t\t$extern_link = $_GET['extern_link'];\r\n\t\t\t\telse\r\n\t\t\t\t\t$extern_link = $_POST['extern_link'];\r\n\t\t\t\r\n\t\t\t\tif(isset($_GET['caption']))\r\n\t\t\t\t\t$caption = $_GET['caption'];\r\n\t\t\t\telse\r\n\t\t\t\t\t$caption = $_POST['caption'];\r\n\t\t\t\t$new_window = \"\";\r\n\t\t\t\tif(isset($_GET['new_window']))\r\n\t\t\t\t\t$new_window = $_GET['new_window'];\r\n\t\t\t\telseif(isset($_POST['new_winow']))\r\n\t\t\t\t\t$new_window = $_POST['new_window'];\t\r\n\t\t\t\t\r\n\t\t\t\tif($intern_link == \"\")\r\n\t\t\t\t\t$link = $extern_link;\r\n\t\t\t\telse\r\n\t\t\t\t\t$link = \"l:\".$intern_link;\r\n\t\t\t\tif($link != \"\" && $caption != \"\") {\r\n\t\t\t\t\tif($new_window == \"on\")\r\n\t\t\t\t\t\t$new = \"yes\";\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\t$new = \"no\";\r\n\t\t\t\t\t$menue_result = db_result(\"SELECT orderid FROM \".DB_PREFIX.\"menue WHERE menue_id = \".$menue_id.\" ORDER BY orderid DESC\");\r\n\t\t\t\t\t$menue_data = mysql_fetch_object($menue_result);\r\n\t\t\t\t\tif($menue_data != null)\r\n\t\t\t\t\t\t$ordid = $menue_data->orderid + 1;\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\t$ordid = 0;\r\n\t\t\t\t\r\n\t\t\t\t\tdb_result(\"INSERT INTO \".DB_PREFIX.\"menue (text, link, new, orderid,menue_id) VALUES ('\".$caption.\"', '\".$link.\"', '\".$new.\"', \".$ordid.\",$menue_id)\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\r\n\t\t$out .= \"\\t\\t\\t<table class=\\\"linktable\\\">\r\n\t\t\t\t<thead>\r\n\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t<td>Text</td>\r\n\t\t\t\t\t\t<td>Link</td>\r\n\t\t\t\t\t\t<td>Aktionen</td>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t</thead>\r\n\t\t\t\t<tbody>\\r\\n\";\r\n\t\t//\r\n\t\t// add the menueedit part where you can select\r\n\t\t//\r\n\t\t$out .= menue_edit_view($menue_id);\r\n\t\t$out .= \"\\t\\t\\t\\t</tbody>\r\n\t\t\t</table><br />\\r\\n\";\r\n\t\t$out .= \"\\t\\t\\t<form method=\\\"get\\\" action=\\\"admin.php\\\">\r\n\t\t\t\t<input type=\\\"hidden\\\" name=\\\"page\\\" value=\\\"menueeditor\\\" />\r\n\t\t\t\t<input type=\\\"hidden\\\" name=\\\"action\\\" value=\\\"add\\\" />\r\n\t\t\t\t<input type=\\\"hidden\\\" name=\\\"menue_id\\\" value=\\\"\".$menue_id.\"\\\" />\r\n\t\t\t\t<table>\r\n\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t<td>Bezeichnung:</td>\r\n\t\t\t\t\t\t<td><input type=\\\"text\\\" name=\\\"caption\\\" /></td>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t<td>Interner Link:</td>\r\n\t\t\t\t\t\t<td>\r\n\t\t\t\t\t\t\t<select name=\\\"intern_link\\\">\r\n\t\t\t\t\t\t\t\t<option value=\\\"\\\">externer Link</option>\\r\\n\";\r\n\t\t//\r\n\t\t// list all available pages \r\n\t\t//\r\n\t\t$site_result = db_result(\"SELECT * FROM \".DB_PREFIX.\"pages_content WHERE page_visible!='deleted' ORDER BY page_name ASC\");\r\n\t\twhile($site_data = mysql_fetch_object($site_result))\r\n\t\t\t$out.= \"\\t\\t\\t\\t\\t\\t\\t\\t<option value=\\\"\".$site_data->page_name.\"\\\">\".$site_data->page_title.\"(\".$site_data->page_name.\")</option>\\r\\n\";\r\n\t\t\t\r\n\t\t$out .=\"\\t\\t\\t\\t\\t\\t\\t</select>\r\n\t\t\t\t\t\t</td>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t<td>Externer Link:</td>\r\n\t\t\t\t\t\t<td><input type=\\\"text\\\" name=\\\"extern_link\\\" /></td>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t<td>Neue Fenster:</td>\r\n\t\t\t\t\t\t<td><input type=\\\"checkbox\\\" name=\\\"new_window\\\" /></td>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t<td colspan=\\\"2\\\"><input type=\\\"submit\\\" value=\\\"Hinzufügen\\\" /></td>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t</table>\r\n\t\t\t</form>\";\r\n\t\r\n\t\treturn $out;\r\n\t}", "public function saveAction()\n {\n if (!$this->request->isPost()) {\n $this->dispatcher->forward([\n \"action\" => \"index\"\n ]);\n return;\n }\n\n $form = new AdminMenuEditForm();\n $id = $this->request->getPost('id');\n if (!empty($id)) {\n $menu = Menu::findFirstById($this->request->getPost('id'));\n } else {\n $menu = new Menu();\n }\n\n $form->bind($_POST, $menu);\n if (!$form->isValid()) {\n $this->flashErrors($form);\n\n $this->dispatcher->forward([\n \"action\" => \"edit\",\n \"params\" => [$id]\n ]);\n return;\n }\n\n if (!$menu->save()) {\n $this->flashErrors($menu);\n\n $this->dispatcher->forward([\n \"action\" => \"edit\",\n \"params\" => [$id]\n ]);\n return;\n }\n\n $this->flashSession->success(\"Menu was updated successfully\");\n\n $this->response->redirect('admin/core/menu/index/' . $menu->getMenuTypeId())->send();\n return;\n }", "function wp_ajax_menu_locations_save()\n {\n }", "public function save( $data ){\n\t\t\t$pageIDs = array_values( array_diff($data['chosenPages'], array('0')) );\n\t\t\t$args['serializedPageIDs'] = Loader::helper('json')->encode( $pageIDs );\n\t\t\tparent::save( $args );\n\t\t}", "function lb_save_page() {\n\tif ( ! isset( $_POST['save_page'] ) ) {\n\t\treturn;\n\t}\n\n\t$page_name = esc_html( $_POST['page_name'] );\n\t$page_content = $_POST['mytextarea'];\n\n\tif ( lb_add_page( $page_name, $page_content ) ) {\n\t\tlb_add_notice( 'success', 'Сторінку додано' );\n\t} else {\n\t\tlb_add_notice( 'error', 'Сторінку не додано' );\n\t}\n\n\theader( 'Location:?action=make_page' );\n\tdie();\n}", "protected function set_new_menu_params() {\n\t\t$this->menu_args['menu-item-title'] = !empty( $_POST['premise_post_title'] ) ? $_POST['premise_post_title'] : '';\n\t\t$this->menu_args['menu-item-url'] = !empty( $_POST['premise_post_url'] ) ? $_POST['premise_post_url'] : '';\n\t\t$this->menu_args['menu-item-object-id'] = !empty( $_POST['premise_post_object_id'] ) ? $_POST['premise_post_object_id'] : '';\n\t\t$this->menu_args['menu-item-object'] = !empty( $_POST['premise_post_object'] ) ? $_POST['premise_post_object'] : '';\n\t}", "public function actionSave()\n\t{\n\t\t$ajax = new \\AjaxHelper();\n\t\t$ajax->success = Menu::model()->updateTree(\\Yii::app()->request->getPost('items'));\n\t\t$ajax->errorDefaultMessage = 'Произошла ошибка на сервере, порядок не был сохранен';\n\t\t$ajax->endFlush();\n\t}", "function add_menu() {\n add_menu_page(\"Polls\", \"Polls\", \"administrator\", \"polls\", \"managePollsPage\");\n}", "function add_site_settings_to_menu(){\n add_menu_page( 'Footer Settings', 'Footer Settings', 'manage_options', 'post.php?post='.get_page_by_path(\"footer-settings\",NULL,\"page\")->ID.'&action=edit', '', 'dashicons-admin-tools', 20);\n}", "function setMenuItem(){\n\n $totalMenuItem=count($this->html->find('b')); // total number of menu items in the webpage\n $allMenuName=$this->html->find('b'); // array of objects of all b tag for item name\n $allMenuDetails=$this->html->find('span[itemprop=\"description\"]'); // array of objects of all span of itemproperty description\n $allMenuPrice=$this->html->find('span.price'); // array of objects of all span with class price\n $phone=$this->html->find('span[itemprop=\"telephone\"]')[0]->innertext; // string\n $address=$this->html->find('span[itemprop=\"streetAddress\"]')[0]->innertext.' , '\n .$this->html->find('span[itemprop=\"addressLocality\"]')[0]->innertext; // string concated restaurant address\n\n for ($i=0; $i<$totalMenuItem; $i++){\n \n $price=$this->stringModifier->modifyString($allMenuPrice[$i]->innertext); //remove currency sign from price\n $this->saveMenuItems($totalMenuItem,$allMenuName[$i]->innertext,$allMenuDetails[$i]->innertext,\n $price,NULL,webPageUrlThree,$phone,$address); // save data in the database\n \n } // loop ends\n \n }", "function maker_4ym_change_menu_order() {\n return array(\n 'index.php',\n 'edit.php',\n 'edit.php?post_type=story',\n\t'upload.php'\n );\n}", "public function writeMenu() {}", "public function writeMenu() {}", "public function writeMenu() {}", "public function writeMenu() {}", "public function createBackendMenu(){\n\t\tadd_menu_page( 'Stackoverflow', 'Stackoverflow', 'manage_options', 'stackoverflowStats', array($this, 'settingsPage') );\n\t}", "function DefineMenu($tipoFormulario = \"S\")\n{\n global $StepId, $Fechar, $Voltar, $Action, $Menu, $Queue, $CustonMenu, $CustonGate, $CustonNewInstance, $CustonRoot, $Custon, $CaseNum, $Retornar, $userdef, $LockedById;\n if ($Fechar == 1) {\n $Menu = 35;\n return;\n }\n\n $Menu = 2;\n $ImagemTopo = \"caseedit0001.png\";\n if (($Action == \"Edit\") && empty($LockedById)) {\n if (empty($userdef->UserId)) {\n $Menu = 19;\n $ImagemTopo = \"caseedit0001.png\";\n } else {\n $Menu = 3;\n $ImagemTopo = \"caseedit0001_pb.png\";\n }\n }\n if ($Action == \"Pesq\") {\n if (empty($UserId)) {\n $Menu = 43;\n } else {\n $Menu = 43;\n }\n }\n if ($Custon == 1) {\n if ($Action == \"Edit\") {\n if (empty($CaseNum)) {\n $Menu = $CustonMenu[3];\n $Queue = $CustonRoot . $CustonGate;\n $Retornar = $CustonRoot . $CustonNewInstance;\n } else {\n $Menu = $CustonMenu[1];\n $Queue = \"flow0001-2.php\";\n $Retornar = $Queue;\n }\n } else {\n $Menu = $CustonMenu[2];\n }\n }\n}", "function prefix_save_ml_menu_walker()\n{\n\n global $wpdb;\n\n $menus = (isset($_POST['menus']) ? $_POST['menus'] : []);\n $themes = (isset($_POST['themes']) ? $_POST['themes'] : []);\n\n $wpdb->query('TRUNCATE wp_ml_menus');\n\n $i = 0;\n foreach($menus as $menu) {\n $theme = $themes[$i];\n $wpdb->query('REPLACE INTO wp_ml_menus(menukey, custom, template, namespace) VALUES(\"'.$menu.'\", 1, \"'.$theme.'\", NULL)');\n echo $menu;\n $i++;\n }\n\n wp_redirect(admin_url('admin.php?page=ml_menu-walker'));\n}", "public function save()\n\t{\n\t\t$does_exist = (is_numeric($this->record['pid']) && self::load($this->record['pid']) !== false);\n\t\t$primary_keys = array();\n\t\tif ($does_exist) {\n\t\t\t$primary_keys = 'pid';\n\t\t}\n\t\treturn drupal_write_record('ablecore_menu_item_path', $this->record, $primary_keys);\n\t}", "public function setPageMenu() {\n\t\t\tglobal $factory_impressive_page_menu;\n\n\t\t\t$dashicon = ( ! empty( $this->page_menu_dashicon ) ) ? ' ' . $this->page_menu_dashicon : '';\n\t\t\t$short_description = ( ! empty( $this->page_menu_short_description ) ) ? ' ' . $this->page_menu_short_description : '';\n\n\t\t\tif ( is_multisite() && is_network_admin() && ! $this->network ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$factory_impressive_page_menu[ $this->getMenuScope() ][ $this->getResultId() ] = [\n\t\t\t\t'type' => $this->type, // page, options\n\t\t\t\t'url' => $this->getBaseUrl(),\n\t\t\t\t'title' => $this->getPageTitle() . ' <span class=\"dashicons' . $dashicon . '\"></span>',\n\t\t\t\t'short_description' => $short_description,\n\t\t\t\t'position' => $this->page_menu_position,\n\t\t\t\t'parent' => $this->page_parent_page\n\t\t\t];\n\t\t}", "public static function save() {\n\t\t\t$page_title = $_POST['page_title'];\n\t\t\t$meta['dod_custom_css'] = $_POST['custom_css'];\n\t\t\t$meta['_wp_page_template'] = $_POST['page_template'];\n\t\t\treturn dd_update_page(get_option('dod_page_id'), $page_title, '', $meta);\n\t\t}", "function favesMenu() {\r\n\t\t$faves= new FavesAdmin;\r\n\t\tif ( $_GET['page'] == basename(__FILE__) ) {\r\n\t if ( 'add' == $_REQUEST['action'] ) {\r\n\t\t\t\t$faves->add( $_REQUEST );\r\n\t\t\t}\r\n\t\t\t\r\n\t\t if ( 'edit' == $_REQUEST['action'] ) {\r\n\t\t\t\t$faves->edit( $_REQUEST );\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif ( 'delete' == $_REQUEST['action'] ) {\r\n\t\t\t\t$faves->burninate( $_REQUEST['id'] );\r\n\t\t\t}\r\n\t\t}\r\n\t\t?>\r\n\t\t<?php if ( isset( $_REQUEST['add'] ) ) { ?>\r\n\t\t<div id=\"message\" class=\"updated fade\"><p><strong><?php echo __('Fave saved.'); ?></strong></p></div>\r\n\t\t<?php } ?>\r\n\t\t\t<div class=\"wrap\">\r\n\t\t\t\r\n\t\t\t\t<div id=\"admin-options\">\r\n\t\t\t\t\t<h2><?php _e('Manage My Faves'); ?></h2>\r\n\t\t\t\t\t<?php if( $faves->check() != 'false' && $faves->count() != '' ) { ?>\r\n\t\t\t\t\t<table class=\"form-table\" style=\"margin-bottom:30px;\">\r\n\t\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t\t<th>Title</th>\r\n\t\t\t\t\t\t\t<th style=\"text-align:center;\">Feed</th>\r\n\t\t\t\t\t\t\t<th style=\"text-align:center;\" colspan=\"2\">Actions</th>\r\n\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t<?php \r\n\t\t\t\t\t\tforeach( $faves->collect() as $fave ) {\r\n\t\t\t\t\t?>\t\t\r\n\t\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t\t<td><?php echo $fave->title; ?></td>\r\n\t\t\t\t\t\t \t<td style=\"text-align:center;\"><a href=\"<?php echo $fave->feed_url; ?>\" title=\"<?php echo $fave->feed_url; ?>\"><img src=\"<?php bloginfo('template_directory'); ?>/images/icon-feed.gif\" alt=\"View\"/></a></td>\r\n\t\t\t\t\t\t \t<td style=\"text-align:center;\">\r\n\t\t\t\t\t\t\t<form method=\"post\" action=\"<?php echo $_SERVER['PHP_SELF']; ?>?page=faves.php&amp;gather=true&amp;id=<?php echo $fave->id; ?>\">\r\n\t\t\t\t\t\t\t\t<input type=\"submit\" value=\"Edit\" />\r\n\t\t\t\t\t\t\t\t<input type=\"hidden\" name=\"action\" value=\"gather\" />\r\n\t\t\t\t\t\t\t</form>\r\n\t\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t\t<td style=\"text-align:center;\">\r\n\t\t\t\t\t\t\t<form method=\"post\" action=\"<?php echo $_SERVER['PHP_SELF']; ?>?page=faves.php&amp;delete=true&amp;id=<?php echo $fave->id; ?>\">\r\n\t\t\t\t\t\t\t\t<input type=\"submit\" name=\"action\" value=\"Delete\" />\r\n\t\t\t\t\t\t\t\t<input type=\"hidden\" name=\"action\" value=\"delete\" />\r\n\t\t\t\t\t\t\t</form>\r\n\t\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t<?php } ?>\r\n\t\t\t\t\t</table>\r\n\t\t\t\t\t<?php } else { ?>\r\n\t\t\t\t\t\t<p>You don't have any Favorites, why not add some?</p>\r\n\t\t\t\t\t<?php } ?>\r\n\t\t\t\t\t<?php if ( isset( $_REQUEST['gather'] ) ) { ?>\r\n\t\t\t\t\t\t<?php $data= $faves->gather( $_REQUEST['id'] ); ?>\r\n\t\t\t\t\t\t<form method=\"post\" action=\"<?php echo $_SERVER['PHP_SELF']; ?>?page=faves.php&amp;edit=true\">\r\n\t\t\t\t\t\t\t<h2>Editing \"<?php echo $data[0]->title; ?>\"</h2>\r\n\t\t\t\t\t\t\t<p><input type=\"text\" name=\"title\" id=\"title\" value=\"<?php echo $data[0]->title; ?>\" /></p>\r\n\t\t\t\t\t\t\t<p><input type=\"text\" name=\"url\" id=\"url\" value=\"<?php echo $data[0]->feed_url; ?>\" /></p>\r\n\t\t\t\t\t\t\t<p class=\"submit\">\r\n\t\t\t\t\t\t\t\t<input name=\"save\" type=\"submit\" value=\"Save Changes\" />\r\n\t\t\t\t\t\t\t\t<input type=\"hidden\" name=\"action\" value=\"edit\" />\r\n\t\t\t\t\t\t\t\t<input type=\"hidden\" name=\"id\" value=\"<?php echo $data[0]->id; ?>\">\r\n\t\t\t\t\t\t\t</p>\r\n\t\t\t\t\t\t</form>\r\n <?php } ?>\r\n\t\t\t\t\t<?php if( $faves->check() != 'false' && !isset( $_REQUEST['gather'] ) ) { ?>\r\n\t\t\t\t\t\t<form method=\"post\" action=\"<?php echo $_SERVER['PHP_SELF']; ?>?page=faves.php&amp;add=true\" class=\"form-table\">\r\n\t\t\t\t\t\t\t<h2>Add a New Fave</h2>\r\n\t\t\t\t\t\t\t<p><input type=\"text\" name=\"title\" id=\"title\" onfocus=\"if(this.value=='Fave Title')value=''\" onblur=\"if(this.value=='')value='Fave Title';\" value=\"Fave Title\" /></p>\r\n\t\t\t\t\t\t\t<p><input type=\"text\" name=\"url\" id=\"url\" onfocus=\"if(this.value=='Fave Feed URL')value=''\" onblur=\"if(this.value=='')value='Fave Feed URL';\" value=\"Fave Feed URL\" /></p>\r\n\t\t\t\t\t\t\t<p class=\"submit\">\r\n\t\t\t\t\t\t\t\t<input name=\"save\" type=\"submit\" value=\"Add Fave\" /> \r\n\t\t\t\t\t\t\t\t<input type=\"hidden\" name=\"action\" value=\"add\" />\r\n\t\t\t\t\t\t\t</p>\r\n\t\t\t\t\t\t</form>\r\n\t\t\t\t\t<?php } ?>\r\n\t\t\t\t</div>\r\n\t\t\t\t<?php include_once('advert.php'); ?>\r\n<?php\r\n\t}", "public function save_nav_menus_created_posts($setting)\n {\n }", "public function save( $data ){\n\t\t\t$args['numToShow'] \t = (int) $data['numToShow'];\n $args['displayBeneath'] = (int) $data['displayBeneath'];\n $args['parentPageID'] = (int) $data['parentPageID'];\n\t\t\tparent::save( $args );\n\t\t}", "function tv_add_menu_items(){\n $reports_page = \"contact_reports.php\";\n // add_menu_page('Reports', 'Reports', 'manage_options', 'contact_reports.php', 'tv_render_list_page', 'dashicons-clipboard', 6);\n add_menu_page('Reports', 'Reports', 'manage_options', $reports_page, 'tv_render_list_page', 'dashicons-clipboard', 6);\n}", "function vsb_crypto_calculator_admin_page_screen() {\n global $submenu;\r\n\n // access page settings\r\n $page_data = array();\r\n\n foreach ($submenu['options-general.php'] as $i => $menu_item) {\r\n if ($submenu['options-general.php'][$i][2] == 'vsb_crypto_calculator') {\n $page_data = $submenu['options-general.php'][$i];\r\n }\r\n }\r\n // output\r\n?>\r\n <div class=\"wrap\">\r\n <?php screen_icon(); ?>\r\n <h2><?php echo $page_data[3]; ?></h2>\r\n <form id=\"vsb_crypto_calculator_options\" action=\"options.php\" method=\"post\">\n <?php\r\n settings_fields('vsb_crypto_calculator_options');\n do_settings_sections('vsb_crypto_calculator');\n submit_button('Save options', 'primary', 'vsb_crypto_calculator_options_submit');\n ?>\r\n </form>\r\n </div>\r\n <?php\r\n}", "function save(){\n\t\t// $insert_query = 'INSERT INTO tb_categories';\n\t\t// $insert_query .= ' SET ';\n\t\t// $insert_query .= ' name = \"'.$this->name.'\"';\n\n\t\t// $this->db->query($insert_query);\n\t\t\tif($this->page_id){\n\t\t\t\t$this->update();\n\t\t\t}else{\n\t\t\t\t$this->page_id = $this->db->insert(\n\t\t\t\t\t'tb_pages',\n\t\t\t\t\tarray(\t\t\t\t\t\n\t\t\t\t\t'title' => $this->title,\n\t\t\t\t\t'content' => $this->content)\n\t\t\t\t);\n\t\t\t}\n\t\t}", "public function store($request)\n {\n $storeMenu = [\n 'name' => $request['name'],\n 'description' => $request['description'],\n ]; \n $menu = $this->_menu->store($storeMenu);\n if (isset($request['submenu']) && $request['name'] ) {\n $items = [\n 'menu_id' => $menu['id'],\n 'name' => $request['submenu']\n ];\n $this->_submenu->store($items);\n }\n\n }", "function saveAllTitles()\n\t{\n\t\tglobal $ilCtrl;\n\t\t\n\t\tilLMObject::saveTitles($this->content_object, ilUtil::stripSlashesArray($_POST[\"title\"]), $_GET[\"transl\"]);\n\t\t\n\t\t$ilCtrl->redirect($this, \"showHierarchy\");\n\t}", "public function save_metabox( $post_id, $post ) {\n\t\tif( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {\n\t\t\treturn;\n\t\t}\n\t\t// if our nonce isn't there, or we can't verify it, bail\n\t\tif( !isset( $_POST['page_specific_menu_nonce'] ) || !wp_verify_nonce( $_POST['page_specific_menu_nonce'], 'page_specific_menu_meta_nonce' ) ) {\n\t\t\treturn;\n\t\t}\n\t\t// if our current user can't edit this post, bail\n\t\tif( !current_user_can( 'edit_post', $post_id ) ) {\n\t\t\treturn;\n\t\t}\n\t\tupdate_post_meta( $post_id, 'page_specific_menu', sanitize_text_field( $_POST['page_specific_menu'] ) );\n\t}", "function sale_admin_menu() {\n global $submenu;\n $url = '/wp-admin/post.php?post=11088&action=edit';\n $submenu['edit.php?post_type=page'][] = array('Apps on Sale', 'manage_options', $url);\n}", "function edit_page()\n\t{\n\t\tglobal $errors, $cache, $security, $basic_gui;\n\t\t\n\t\t// basic error check\n\t\tif ( !isset( $_POST[ 'submit_page' ] ) )\n\t\t{\n\t\t\t$errors->report_error( $this->lang[ 'Wrong_form' ], CRITICAL_ERROR );\n\t\t}\n\t\t\n\t\t// get data\n\t\t$title = ( isset( $_POST[ 'title' ] ) ) ? strval( $_POST[ 'title' ] ) : '';\n\t\t$lang = ( isset( $_POST[ 'language' ] ) ) ? strval( $_POST[ 'language' ] ) : '';\n\t\t$text = str_replace( '&nbsp;', ' ', $basic_gui->gennuline( ( isset( $_POST[ 'editor1' ] ) ) ? strval( $_POST[ 'editor1' ] ) : '' ) );\n\t\t$auth = ( isset( $_POST[ 'auth' ] ) ) ? intval( $_POST[ 'auth' ] ) : GUEST;\n\t\t$remove = ( isset( $_POST[ 'remove' ] ) && $_POST[ 'remove' ] == 'on' ) ? TRUE : FALSE;\n\t\t\n// \t\t$text = str_replace( \"\\n\", '<br />', $text );\n\t\t\n\t\tif ( empty( $title ) || empty( $text ) )\n\t\t{ // need these\n\t\t\t$errors->report_error( $this->lang[ 'No_data' ], GENERAL_ERROR );\n\t\t}\n\t\t\n\t\t// save to the array\n\t\tif ( !is_array( $this->pages_array[ $lang ] ) )\n\t\t{ // make it an array, just to be sure\n\t\t\t$this->pages_array[ $lang ] = array();\n\t\t}\n\t\tif ( !$remove )\n\t\t{\n\t\t\t$pag = array( 'content' => $text, 'auth' => $auth );\n\t\t\t$this->pages_array[ $lang ][ $title ] = $pag;\n\t\t}else\n\t\t{\n\t\t\tunset( $this->pages_array[ $lang ][ $title ] );\n\t\t}\n\t\t\n\t\t// now write it\n\t\t$this->save_pages();\n\t\t\n\t\t$errors->report_error( $this->lang[ 'Edited' ], MESSAGE );\n\t}", "private function createMenu() {\n $menu = new Menu;\n $menu->name = $this->page['title'];\n if ($this->page['parent_id']) {\n $parent = ModelsPage::findOrFail($this->page['parent_id']);\n $menu->link = env('APP_URL') . '/' . $parent->slug . '/' . $this->page['slug'];\n } else {\n $menu->link = env('APP_URL') . '/' . $this->page['slug'];\n }\n $menu->parent_id = null;\n $order = Menu::select('order')->where('parent_id', null)->orderBy('order', 'desc')->first();\n $menu->order = (($order) ? $order->order : 0) + 1;\n $menu->target = '_self';\n $menu->status = true;\n $menu->save();\n }", "function _wp_auto_add_pages_to_menu($new_status, $old_status, $post)\n {\n }", "function mt_add_pages() {\n\n add_menu_page(__('Manage Options','alpha'), __('Mange Options','alpha'), 'manage_options', 'mange-options', 'manage_option_page' );\n}", "public function savePageEditorSettingsObject()\n\t{\n\t\tglobal $tpl, $lng, $ilCtrl, $ilSetting;\n\t\n\t\t$this->initPageEditorForm();\n\t\tif ($this->form->checkInput())\n\t\t{\n\t\t\tinclude_once(\"./Services/COPage/classes/class.ilPageEditorSettings.php\");\n\t\t\tinclude_once(\"./Services/COPage/classes/class.ilPageContentGUI.php\");\n\t\t\t$buttons = ilPageContentGUI::_getCommonBBButtons();\n\t\t\tforeach ($buttons as $b => $t)\n\t\t\t{\n\t\t\t\tilPageEditorSettings::writeSetting($_GET[\"grp\"], \"active_\".$b,\n\t\t\t\t\t$this->form->getInput(\"active_\".$b));\n\t\t\t}\n\t\t\t\n\t\t\tif ($_GET[\"grp\"] == \"test\")\n\t\t\t{\n\t\t\t\t$ilSetting->set(\"enable_tst_page_edit\", (int) $_POST[\"tst_page_edit\"]);\n\t\t\t}\n\t\t\telseif ($_GET[\"grp\"] == \"rep\")\n\t\t\t{\n\t\t\t\t$ilSetting->set(\"enable_cat_page_edit\", (int) $_POST[\"cat_page_edit\"]);\n\t\t\t}\n\t\t\t\n\t\t\tilUtil::sendInfo($lng->txt(\"msg_obj_modified\"), true);\n\t\t}\n\t\t\n\t\t$ilCtrl->setParameter($this, \"grp\", $_GET[\"grp\"]);\n\t\t$ilCtrl->redirect($this, \"showPageEditorSettings\");\n\t}", "public function addAdminMenuPage()\n\t{\n\t\t$menuPage = &ModelAdminMenu::getScheme();\n\n\t\tforeach ( $menuPage as $menu ) {\n\t\t\t$callback = array_keys( $menu );\n\t\t\t$paramArr = array_values( $menu );\n\n\t\t\t$this->_adminMenuPage( $callback[0], $paramArr[0]['parameters'] );\n\t\t}\n\t}", "public function yaml_add_menu_page(){\n\t\tadd_options_page('Export to YAML', 'Export to YAML', 'administrator', __FILE__, function(){\n\t\t\tdo_settings_sections(__FILE__);\n\t\t});\n\t}", "public static function func_ajax_sav_menu() {\n\t\t\t \n\t\t\t\tglobal $wpdb;\n\t\t\t\t\n\t\t\t\tif(!defined('DOING_AJAX')){\n wp_redirect (site_url());\n exit;\n } else {\n $id = $_POST['id'];\n $name = self::sanitize($_POST['name']);\n $day = self::sanitize($_POST['day']);\n $desc = self::sanitize($_POST['desc']);\n $list = $wpdb->query($wpdb->prepare(\"UPDATE \" . $wpdb->prefix.self::$table_name. \" SET re_title = %s, re_day = %s, re_desc = %s WHERE re_int = \".$id,$name,$day,$desc ));\n echo \"success\";\n die();\n\t\t\t\t}\n\t\t\n\t\t}", "function rew_render_menu_page(){\n\n\tif ( isset( $_GET['rew-action'] ) && $_GET['rew-action'] == 'edit_item' ) {\n\t\trequire_once plugin_dir_path(__FILE__) . '/levels/edit-item.php';\n\t} elseif ( isset( $_GET['rew-action'] ) && $_GET['rew-action'] == 'add_item' ) {\n\t\trequire_once plugin_dir_path(__FILE__) . '/levels/add-item.php';\n\t} else {\n\t\trequire_once plugin_dir_path(__FILE__) . 'gamify-levels.php';\n\n\t\t$rew_items_table = new gamify_Rewards_Table();\n\t\t$rew_items_table->prepare_items();\n\t\t?>\n\n\t\t<div class=\"wrap\">\n\t\t\t<div class=\"icon32\" id=\"icon-options-general\">\n\t\t\t\t<br />\n\t\t\t</div>\n\t\t\t<h2><?php _e( 'Gamify WP Levels', 'gamify' ); ?><a href=\"<?php echo add_query_arg( array( 'rew-action' => 'add_item' ) ); ?>\" class=\"add-new-h2\">Add New</a></h2>\n\t\t\t<form id=\"rew-items-filter\" method=\"get\" action=\"<?php echo admin_url( 'admin.php?page=gamify-levels.php&post-type=rew' ); ?>\">\n\t\t\t\t<input type=\"hidden\" name=\"post_type\" value=\"rew\" />\n\t\t\t\t<input type=\"hidden\" name=\"page\" value=\"gamify-levels.php\" />\n\t\t\t\t<?php $rew_items_table->display() ?>\n\t\t\t</form>\n\t\t</div>\n\n\t\t<?php\n\t}\n\n}", "public function grp_settings_page_init(){\n\t\t$settings_page = add_menu_page( 'GRP Settings', 'GRP Settings', 'edit_theme_options', 'grp-settings', array($this,'grp_settings_page') );\n\t\t//add this action to save your setting page data\n\t\tadd_action( \"load-{$settings_page}\", array( $this, 'grp_load_settings_page' ) );\n\t}", "function eclecticapp_checklist_settings_create() {\n $page_title = 'Checklist Admin';\n $menu_title = 'Checklist Admin';\n $capability = 'manage_options';\n $menu_slug = 'checklist_settings';\n $function = 'eclecticapp_checklist_settings_display';\n $icon_url = '';\n $position = 20;\n\n add_menu_page( $page_title, $menu_title, $capability, $menu_slug, $function, $icon_url, $position );\n}", "public function addMenu() {\n $menu = trim($this->input->post('nommenu'));\n $idPage = $this->input->post('idPage');\n $idCategorie = $this->input->post('idCategorie');\n \n if($menu != \"\") {\n \n $data = array(\n 'menu' => $menu,\n 'idPage' => $idPage,\n 'idCategorie' => $idCategorie\n );\n \n $this->db->insert('menus', $data); \n \n }\n }", "function scoreSystemManager_add_pages() {\r\n // Add a new top-level menu (ill-advised):\r\n add_menu_page('Score System', 'Score System', 'edit_pages', 'scoreSystemManager-dashboard', 'scoreSystemManager_dashboard');\r\n}", "public function menuAction()\n {\n $module = $this->getModule();\n $model = $this->getModel($module);\n $orders = $this->params('order');\n foreach ($orders as $id => $value) {\n $model->update(\n array('nav_order' => (int) $value),\n array('id' => (int) $id)\n );\n }\n Pi::registry('nav', $this->getModule())->flush();\n\n return $this->jump(\n array('action' => 'index'),\n _a('Solutions navigation menu updated successfully.')\n );\n }", "function at_try_menu()\n{\n add_menu_page('signup_list', //page title\n 'Sign Up List', //menu title\n 'manage_options', //capabilities\n 'Signup_List', //menu slug\n Signup_list //function\n );\n}", "function adminMenu() {\r\n\t\t// TODO: This does not only create the menu, it also (only?) *does* sth. with the entries.\r\n\t\t// But those actions must be done before the menu is created (due to the redirects).\r\n\t\t// !Split the function!\r\n\t\t//$page = add_submenu_page('admin.php', __('UWR Ergebnisse'), __('UWR Ergebnisse'), 'edit_posts', 'uwr1results', array('Uwr1resultsController', 'adminAction'));\r\n\t\t$page = add_submenu_page('uwr1menu', __('UWR Ergebnisse'), __('UWR Ergebnisse'), UWR1RESULTS_CAPABILITIES, 'uwr1results', array('Uwr1resultsController', 'adminAction'));\r\n\t\tadd_action( 'admin_print_scripts-' . $page, array('Uwr1resultsView', 'adminScripts') );\r\n\t}", "function mt_add_pages() {\n // Add a new submenu under Tools:\n add_management_page( __('KML Upload','menu-test'), __('KML Upload','menu-test'), 'manage_options', 'kmlupload', 'mt_tools_page');\n}", "function ada_add_pages() {\n\nadd_submenu_page('edit.php?post_type=horse', __('Options','wp_horse'), __('Options','wp_horse'), 'manage_options', 'horse_options_page', 'horse_options_page' );\n}", "function manage()\n\t{\n\t\tglobal $template, $errors, $db, $mod_loader, $security;\n\t\t\n\t\t$menuid = ( isset( $_GET[ 'menuid' ] ) ) ? intval( $_GET[ 'menuid' ] ) : 0;\n\t\t\n\t\tif ( $menuid != 0 )\n\t\t{\n\t\t\t$sql = \"SELECT * FROM \" . MORECONTENT_MENU_TABLE . \" WHERE menu_parent='$menuid'\";\n\t\t\tif ( !$result = $db->sql_query( $sql ) )\n\t\t\t{\n\t\t\t\t$errors->report_error( 'Couldn\\'t read database', CRITICAL_ERROR );\n\t\t\t}\n\t\t\t$submenus = $db->sql_fetchrowset( $result );\n\t\t\t\n\t\t\t$sql = \"SELECT m.*, c.* FROM \" . MORECONTENT_MENU_TABLE . \" m LEFT JOIN \" . MORECONTENT_CONTENT_TABLE . \" c ON c.menu_id=m.menu_id WHERE m.menu_id='$menuid' LIMIT 1\";\n\t\t\tif ( !$result = $db->sql_query( $sql ) )\n\t\t\t{\n\t\t\t\t$errors->report_error( 'Couldn\\'t read database', CRITICAL_ERROR );\n\t\t\t}\n\t\t\t$menu = $db->sql_fetchrow( $result );\n\t\t}else\n\t\t{\n\t\t\t$sql = \"SELECT * FROM \" . MORECONTENT_MENU_TABLE . \" WHERE menu_level='0'\";\n\t\t\tif ( !$result = $db->sql_query( $sql ) )\n\t\t\t{\n\t\t\t\t$errors->report_error( 'Couldn\\'t read database', CRITICAL_ERROR );\n\t\t\t}\n\t\t\t$submenus = $db->sql_fetchrowset( $result );\n\t\t\t\n\t\t\t$menu = array( 'menu_id' => 0, 'menu_parent' => 0, 'menu_level' => -1, 'menu_title' => $this->lang[ 'Menu_na' ], 'menu_content' => 0, 'id' => 0, 'content' => '' );\n\t\t}\n\t\t\n\t\t// get the editor\n\t\t$mods = $mod_loader->getmodule( 'editor', MOD_FETCH_NAME, NOT_ESSENTIAL );\n\t\t$mod_loader->port_vars( array( 'name' => 'editor1', 'quickpost' => FALSE, 'def_text' => stripslashes( $menu[ 'content' ] ) ) );\n\t\t$mod_loader->execute_modules( 0, 'show_editor' );\n\t\t$editor = $mod_loader->get_vars( array( 'editor_HTML', 'editor_WYSIWYG' ) );\n\t\t\n\t\t$frame = '<b><a href=\"%s\">%s</a></b> :: ';\n\t\t$parsed_submenus = '';\n\t\tif ( is_array( $submenus ) )\n\t\t{\n\t\t\tforeach ( $submenus as $sub )\n\t\t\t{\n\t\t\t\t$url = $security->append_sid( '?' . MODE_URL . '=ACP&' . SUBMODE_URL . '=ACP_MoreContent&s=manage&menuid=' . $sub[ 'menu_id' ] );\n\t\t\t\t$parsed_submenus .= sprintf( $frame, $url, $sub[ 'menu_title' ] );\n\t\t\t}\n\t\t}\n\t\t\n\t\t$template->assign_block_vars( 'manage', '', array(\n\t\t\t'L_TITLE' => $this->lang[ 'Manage_title' ],\n\t\t\t'L_EXPLAIN' => $this->lang[ 'Manage_explain' ],\n\t\t\t'L_TITLE2' => $this->lang[ 'Menu_title' ],\n\t\t\t'L_TITLE3' => $menu[ 'menu_title' ],\n\t\t\t'L_ADDMENU' => $this->lang[ 'Menu_add' ],\n\t\t\t'L_ADDTITLE' => $this->lang[ 'Menu_addtitle' ],\n\t\t\t'L_DELMENU' => $this->lang[ 'Menu_delete' ],\n\t\t\t'L_CHANGEMENU' => $this->lang[ 'Menu_change' ],\n\t\t\t'L_UP' => $this->lang[ 'Menu_up' ],\n\t\t\t\n\t\t\t'S_EDITOR' => $editor[ 'editor_HTML' ],\n\t\t\t'S_MENUS' => $parsed_submenus,\n\t\t\t'S_FORM_ACTION' => $security->append_sid( '?' . MODE_URL . '=ACP&' . SUBMODE_URL . '=ACP_MoreContent&s=manage2&menuid=' . $menu[ 'menu_id' ] . '&menulevel=' . $menu[ 'menu_level' ] ),\n\t\t\t\n\t\t\t'U_UP' => $security->append_sid( '?' . MODE_URL . '=ACP&' . SUBMODE_URL . '=ACP_MoreContent&s=manage&menuid=' . $menu[ 'menu_parent' ] ),\n\t\t) );\n\t\t$template->assign_switch( 'manage', TRUE );\n\t}", "function h_add_menus(array $args) {\n if (!is_admin()) { return;}\n\n $menu = new H_Sidenav($args);\n $menu->add();\n}", "public function editMenuAction() \n { \n $chapId = Zend_Auth::getInstance()->getIdentity()->id; \n \n //Change the default view and load add-page view\n $this->_helper->viewRenderer->setRender('add-menu') ;\n \n //Get web pages\n $menuId = trim($this->_request->id);\n\n $modelPage = new Pbo_Model_WlPages();\n $pages = $modelPage->getPages($chapId);\n //Zend_Debug::dump($pages);die();\n\n $this->view->webPages = $pages;\n\n $languageUsersModel = new Pbo_Model_LanguageUsers();\n $languages = $languageUsersModel->getChapLanguages($chapId);\n $this->view->languages = $languages;\n \n if($this->_request->isPost())\n {\n $title = utf8_encode(trim($this->getRequest()->getPost('txtTitle')));\n $menuType = strtoupper(trim($this->_getParam('chkMenuType')));\n $url = trim($this->_getParam('txtUrl'));\n $url = !empty($url) ? $url : '';\n $webPageId = trim($this->_getParam('chkPage'));\n $webPageId = !empty($webPageId) ? $webPageId : '';\n $menuId = trim($this->_getParam('menuId'));\n $language = $this->_getParam('language');\n \n //If menu type is External, then its a external url, hence no need to have a web page id\n //if it's Internal, then no need to have a URL\n if($menuType == 'EXTERNAL')\n {\n $webPageId = null;\n }\n else\n {\n $url = null;\n }\n \n $targetWindow = trim($this->_getParam('chkTarget')); \n $status = trim($this->_getParam('chkStatus'));\n \n $status = ($status == 'publish') ? '1' : '0';\n $order = 1; \n \n $menuModel = new Pbo_Model_WlMenuItems();\n $modified = $menuModel->updateMenuItem($title, $targetWindow, $menuType, $url, $webPageId, $chapId, $status, $menuId, $language);\n\n\n if($modified)\n { \n $this->_helper->flashMessenger->addMessage('Menu item successfully edited.');\n \n } \n \n $this->_redirect('/menu/edit-menu/id/'.$menuId); \n }\n else\n { \n\n $menuModel = new Pbo_Model_WlMenuItems();\n $menuDetails = $menuModel->getMenuDetailsbyId($chapId, $menuId);\n\n $this->view->menuType = $menuDetails->type;\n \n $this->view->menuDetails = $menuDetails;\n\n $this->view->action = 'edit-menu';\n $this->view->menuId = $menuId;\n $this->view->title = \"Page : Edit Menu Item\";\n \n //Set the messages if exists\n $this->view->menuMessages = $this->_helper->flashMessenger->getMessages();\n \n }\n }", "function savepage()\r\n\t{\r\n\t\t$model\t\t=& $this->getModel( 'Formsession' );\r\n\t\t$model->savePage();\r\n\t}", "public function add_menus()\n {\n }", "public function run()\n {\n $index = new Menu;\n $index->name = \"控制台\";\n $index->parent_id = 0;\n $index->icon = \"fa fa-dashboard\";\n $index->slug = \"admin.systems.index\";\n $index->url = \"admin\";\n $index->save();\n /**\n * -------------------------------------------------\n * 博客管理\n * -------------------------------------------------\n */\n $blog = new Menu;\n $blog->name = \"博客管理\";\n $blog->parent_id = 0;\n $blog->icon = \"fa fa-diamond\";\n $blog->slug = \"admin.systems.blog\";\n $blog->url = \"admin/cate*,admin/article*,admin/tag*\";\n $blog->save();\n\n $categories = new Menu;\n $categories->name = \"分类管理\";\n $categories->parent_id = $blog->id;\n $categories->icon = \"fa fa-cloud\";\n $categories->slug = \"admin.categories.list\";\n $categories->url = \"admin/cate\";\n $categories->save();\n\n $article = new Menu;\n $article->name = \"文章管理\";\n $article->parent_id = $blog->id;\n $article->icon = \"fa fa-file-text\";\n $article->slug = \"admin.articles.list\";\n $article->url = \"admin/article\";\n $article->save();\n\n $tags = new Menu;\n $tags->name = \"标签管理\";\n $tags->parent_id = $blog->id;\n $tags->icon = \"fa fa-tags\";\n $tags->slug = \"admin.tags.list\";\n $tags->url = \"admin/tag\";\n $tags->save();\n /**\n * -------------------------------------------------\n * 系统管理\n * -------------------------------------------------\n */\n $system = new Menu;\n $system->name = \"系统管理\";\n $system->parent_id = 0;\n $system->icon = \"fa fa-cog\";\n $system->slug = \"admin.systems.manage\";\n $system->url = \"admin/role*,admin/permission*,admin/user*,admin/menu*,admin/log-viewer*\";\n $system->save();\n\n $user = new Menu;\n $user->name = \"用户管理\";\n $user->parent_id = $system->id;\n $user->icon = \"fa fa-users\";\n $user->slug = \"admin.users.list\";\n $user->url = \"admin/user\";\n $user->save();\n\n $role = new Menu;\n $role->name = \"角色管理\";\n $role->parent_id = $system->id;\n $role->icon = \"fa fa-male\";\n $role->slug = \"admin.roles.list\";\n $role->url = \"admin/role\";\n $role->save();\n\n $permission = new Menu;\n $permission->name = \"权限管理\";\n $permission->parent_id = $system->id;\n $permission->icon = \"fa fa-paper-plane\";\n $permission->slug = \"admin.permissions.list\";\n $permission->url = \"admin/permission\";\n $permission->save();\n\n $log = new Menu;\n $log->name = \"系统日志\";\n $log->parent_id = $system->id;\n $log->icon = \"fa fa-file-text-o\";\n $log->slug = \"admin.logs.all\";\n $log->url = \"admin/log-viewer\";\n $log->save();\n\n $menu = new Menu;\n $menu->name = \"菜单管理\";\n $menu->parent_id = $system->id;\n $menu->icon = \"fa fa-navicon\";\n $menu->slug = \"admin.menus.list\";\n $menu->url = \"admin/menu\";\n $menu->save();\n }", "public function run()\n {\n $menu = Menu::where('name', 'home')->firstOrFail();\n $menuItem = MenuItem::firstOrNew([\n 'menu_id' => $menu->id,\n 'title' => __('menu_items.dashboard'),\n 'url' => '',\n 'route' => 'dashboard',\n ]);\n if (! $menuItem->exists) {\n $menuItem->fill([\n 'target' => '_self',\n 'icon_class' => 'boat',\n 'color' => null,\n 'parent_id' => null,\n 'order' => 1,\n ])->save();\n }\n $menuItem = MenuItem::firstOrNew([\n 'menu_id' => $menu->id,\n 'title' => __('menu_items.media'),\n 'url' => '',\n 'route' => 'media.index',\n ]);\n if (! $menuItem->exists) {\n $menuItem->fill([\n 'target' => '_self',\n 'icon_class' => 'images',\n 'color' => null,\n 'parent_id' => null,\n 'order' => 5,\n ])->save();\n }\n $menuItem = MenuItem::firstOrNew([\n 'menu_id' => $menu->id,\n 'title' => __('menu_items.users'),\n 'url' => '',\n 'route' => 'users.index',\n ]);\n if (! $menuItem->exists) {\n $menuItem->fill([\n 'target' => '_self',\n 'icon_class' => 'person',\n 'color' => null,\n 'parent_id' => null,\n 'order' => 3,\n ])->save();\n }\n $menuItem = MenuItem::firstOrNew([\n 'menu_id' => $menu->id,\n 'title' => __('menu_items.roles'),\n 'url' => '',\n 'route' => 'roles.index',\n ]);\n if (! $menuItem->exists) {\n $menuItem->fill([\n 'target' => '_self',\n 'icon_class' => 'lock',\n 'color' => null,\n 'parent_id' => null,\n 'order' => 2,\n ])->save();\n }\n $toolsMenuItem = MenuItem::firstOrNew([\n 'menu_id' => $menu->id,\n 'title' => __('menu_items.tools'),\n 'url' => '',\n ]);\n if (! $toolsMenuItem->exists) {\n $toolsMenuItem->fill([\n 'target' => '_self',\n 'icon_class' => 'tools',\n 'color' => null,\n 'parent_id' => null,\n 'order' => 9,\n ])->save();\n }\n $menuItem = MenuItem::firstOrNew([\n 'menu_id' => $menu->id,\n 'title' => __('menu_items.menu_builder'),\n 'url' => '',\n 'route' => 'menus.index',\n ]);\n if (! $menuItem->exists) {\n $menuItem->fill([\n 'target' => '_self',\n 'icon_class' => 'list',\n 'color' => null,\n 'parent_id' => $toolsMenuItem->id,\n 'order' => 10,\n ])->save();\n }\n $menuItem = MenuItem::firstOrNew([\n 'menu_id' => $menu->id,\n 'title' => __('menu_items.database'),\n 'url' => '',\n 'route' => 'database.index',\n ]);\n if (! $menuItem->exists) {\n $menuItem->fill([\n 'target' => '_self',\n 'icon_class' => 'data',\n 'color' => null,\n 'parent_id' => $toolsMenuItem->id,\n 'order' => 11,\n ])->save();\n }\n $menuItem = MenuItem::firstOrNew([\n 'menu_id' => $menu->id,\n 'title' => __('menu_items.compass'),\n 'url' => '',\n 'route' => 'compass.index',\n ]);\n if (! $menuItem->exists) {\n $menuItem->fill([\n 'target' => '_self',\n 'icon_class' => 'compass',\n 'color' => null,\n 'parent_id' => $toolsMenuItem->id,\n 'order' => 12,\n ])->save();\n }\n $menuItem = MenuItem::firstOrNew([\n 'menu_id' => $menu->id,\n 'title' => __('menu_items.bread'),\n 'url' => '',\n 'route' => 'bread.index',\n ]);\n if (! $menuItem->exists) {\n $menuItem->fill([\n 'target' => '_self',\n 'icon_class' => 'bread',\n 'color' => null,\n 'parent_id' => $toolsMenuItem->id,\n 'order' => 13,\n ])->save();\n }\n $menuItem = MenuItem::firstOrNew([\n 'menu_id' => $menu->id,\n 'title' => __('menu_items.settings'),\n 'url' => '',\n 'route' => 'settings.index',\n ]);\n if (! $menuItem->exists) {\n $menuItem->fill([\n 'target' => '_self',\n 'icon_class' => 'settings',\n 'color' => null,\n 'parent_id' => null,\n 'order' => 14,\n ])->save();\n }\n }", "public function addMenuPage()\n {\n $hook = add_options_page(\n __('Wistia Integration Settings'),\n __('Wistia'),\n 'manage_options',\n self::ADMIN_PAGE_ID,\n [$this->renderer, 'renderSettingsPage']\n );\n error_log('hook: '. $hook);\n }", "public function add_to_one_page_nav() {\n\n\t\t// Check if menu even exists\n\t\tif( empty( $this->menu_id ) ) {\n\n\t\t\techo json_encode( $this->message['no-menu'] );\n\t\t\tdie();\n\t\t}\n\n\t\t// update premise_add_post_to_one_page post meta\n\t\tif ( isset( $_POST['premise_add_post_to_one_page'] )\n\t\t\t&& isset( $_POST['premise_post_object_id'] ) ) {\n\n\t\t\tupdate_post_meta(\n\t\t\t\t$_POST['premise_post_object_id'],\n\t\t\t\t'premise_add_post_to_one_page',\n\t\t\t\t$_POST['premise_add_post_to_one_page']\n\t\t\t);\n\t\t}\n\n\n\t\t// if adding post to OPN\n\t\tif ( isset( $_POST['premise_add_post_to_one_page'] )\n\t\t\t&& $_POST['premise_add_post_to_one_page'] == '1' ) {\n\n\t\t\t$r = true;\n\n\t\t\tif( !$this->premise_nav_item_exists() )\n\t\t\t\t$r = wp_update_nav_menu_item( $this->menu_id, 0, $this->menu_args );\n\n\t\t\techo $r ? json_encode( $this->message['success-add-post'] ) : json_encode( $this->message['failure-add-post'] );\n\t\t\tdie();\n\t\t}\n\n\t\t// If deleting post from OPN\n\t\t$item_id = \"\";\n\t\tforeach( $this->menu as $item ){\n\n\t\t\tif( $item->object_id == $this->menu_args['menu-item-object-id'] )\n\t\t\t\t$item_id = $item->ID;\n\t\t}\n\n\t\t$menuObject = wp_get_nav_menu_object( $this->menu_id );\n\t\t$menu_objects = get_objects_in_term( $menuObject->term_id, 'nav_menu' );\n\n\t\tif ( !empty( $item_id ) && !empty( $menu_objects ) ) {\n\n\t\t\tforeach ( $menu_objects as $item ) {\n\n\t\t\t\tif( $item == $item_id ){\n\n\t\t\t\t\t$r = wp_delete_post( $item );\n\n\t\t\t\t\techo $r ? json_encode( $this->message['success-delete-post'] ) : json_encode( $this->message['failure-delete-post'] );\n\t\t\t\t\tdie();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\techo json_encode( $this->message['success-delete-post'] );\n\n\t\tdie();\n\t}", "function cloudfw_admin_update_menu($menu_id, $menu_item_db_id, $args ){\n\t$current_location = cloudfw_get_editing_menu_location();\n\t$options = cloudfw_detect_options( array('data' => cloudfw_get_schemes('menu_map', false, NULL, $current_location)) );\n\n\tif ( is_array($options) && !empty($options) ) {\n\t\t/* Loop the menu options. */\n\t\tforeach ((array) $options as $field) {\n\t\t\t$name = $field['id'] . '_' . $menu_item_db_id;\n\n\t\t\t$old = get_post_meta( $menu_item_db_id, $field['id'], true );\n\t\t\t$new = isset($_POST[ $name ]) ? $_POST[ $name ] : NULL;\n\n\t\t\t\t$is_defined = isset($_POST[ 'is_defined_'. $name ]) ? $_POST[ 'is_defined_'. $name ] : NULL;\n\t\t\t\tif ( $is_defined == 'onoff' && empty( $new ) ) {\n\t\t\t\t\t$new = 'FALSE';\n\t\t\t\t\t$_POST[ $name ] = $new;\n\t\t\t\t}\n\n\t\t\t\tif ( !is_array( $new ) )\n\t\t\t\t\t$new = stripslashes( $new );\n\n\t\t\tif ( array_key_exists($name, $_POST) && !is_null($new) && $new != $old )\n\t\t\t\tupdate_post_meta( $menu_item_db_id, $field['id'], $new );\n\t\t\telseif ( array_key_exists($field['id'], $_POST) && !is_null( $new ) && empty( $new ) && isset( $old ) )\n\t\t\t\tdelete_post_meta( $menu_item_db_id, $field['id'], $old );\n\n\t\t}\n\t}\n}", "public function save_settings() {\n\n if (!isset($_REQUEST['action']) || !isset($_GET['page']))\n return;\n\n if ('swpm-settings' !== $_GET['page'])\n return;\n\n if ('swpm_settings' !== $_REQUEST['action'])\n return;\n\n check_admin_referer('swpm-update-settings');\n\n $data = array();\n\n foreach ($_POST['swpm-settings'] as $key => $val) {\n $data[$key] = esc_html($val);\n }\n\n update_option('swpm-settings', $data);\n }", "function book_add_page() {\n add_submenu_page('edit.php?post_type=book', 'Book Admin', 'Book Settings', 'edit_posts', basename(__FILE__), 'book_s');\n}", "public function store()\n {\n $this->preStoreActions($this->data);\n\n //check all the fields\n $this->validate();\n\n //save to the database\n $this->save();\n\n //do broadcast\n //$this->broadcastUpdate(\"Updated Menu for - \".Str::limit($this->accountName,50));\n\n //tidy up\n $this->afterStore($this->data['id'] ?? '');\n\n //run a user specific method IF installed and needed after save\n $this->afterStoreActions($this->data);\n }", "function change()\n\t{\n\t\tglobal $errors, $db;\n\t\t\n\t\t$menuid = ( isset( $_GET[ 'menuid' ] ) ) ? intval( $_GET[ 'menuid' ] ) : 0;\n\t\t$title = $_POST[ 'newmenutitle' ];\n\t\t\n\t\t$sql = \"UPDATE \" . MORECONTENT_MENU_TABLE . \" SET menu_title='$title' WHERE menu_id='$menuid' LIMIT 1\";\n\t\tif ( !$db->sql_query( $sql ) )\n\t\t{\n\t\t\t$errors->report_error( 'Couldn\\'t modify', CRITICAL_ERROR );\n\t\t}\n\t\t\n\t\t$errors->report_error( $this->lang[ 'Menu_changed' ], MESSAGE );\n\t}", "protected function generateMenu() {}", "protected function generateMenu() {}", "protected function generateMenu() {}", "protected function generateMenu() {}", "protected function generateMenu() {}", "protected function generateMenu() {}", "public static function menuInit()\n {\n global $menu, $submenu;\n//print_r($temp);\n// exit;\n /**\n * Menu items that need completed\n * Registrations\n * Transactions\n * Settings\n * General\n * Payment Methods\n */\n\n // Add in locations\n foreach ([\n 'event_location',\n 'event_registration',\n 'event_transaction'\n ] as $temp) {\n $temp = get_post_type_object($temp);\n\n $submenu['edit.php?post_type=event'][] = [\n $temp->labels->menu_name,\n 'manage_options',\n admin_url('edit.php?post_type=' . $temp->name)\n ];\n\n }\n\n add_submenu_page(\n 'edit.php?post_type=event',\n __('General Settings', __NAMESPACE__),\n __('General Settings', __NAMESPACE__),\n 'manage_options',\n 'general',\n ['\\\\' . __NAMESPACE__ . '\\\\PageGeneral', 'Display'],\n get_stylesheet_directory_uri('stylesheet_directory') . \"/images/media-button-other.gif\"\n );\n\n $temp = get_post_type_object('event_payment_method');\n $submenu['edit.php?post_type=event'][] = [\n $temp->labels->menu_name,\n 'manage_options',\n admin_url('edit.php?post_type=event_payment_method')\n ];\n\n\n // Easy save post handler.\n add_action('save_post', [self::$_class, 'saveHandler'], 10, 1);\n\n }", "function h_add_menu(string $title, array $args) {\n h_add_menus([\n $title => $args\n ]);\n}", "function procMenuAdminInsertItemForAdminMenu()\n\t{\n\t\t$requestArgs = Context::getRequestVars();\n\t\t$tmpMenuName = explode(':', $requestArgs->menu_name);\n\t\t$moduleName = $tmpMenuName[0];\n\t\t$menuName = $tmpMenuName[1];\n\n\t\t// variable setting\n\t\t$logged_info = Context::get('logged_info');\n\t\t//$oMenuAdminModel = getAdminModel('menu');\n\t\t$oMemberModel = getModel('member');\n\n\t\t//$parentMenuInfo = $oMenuAdminModel->getMenuItemInfo($requestArgs->parent_srl);\n\t\t$groupSrlList = $oMemberModel->getMemberGroups($logged_info->member_srl);\n\n\t\t//preg_match('/\\{\\$lang->menu_gnb\\[(.*?)\\]\\}/i', $parentMenuInfo->name, $m);\n\t\t$oModuleModel = getModel('module');\n\t\t//$info = $oModuleModel->getModuleInfoXml($moduleName);\n\t\t$info = $oModuleModel->getModuleActionXml($moduleName);\n\n\t\t$url = getNotEncodedFullUrl('', 'module', 'admin', 'act', $info->menu->{$menuName}->index);\n\t\tif(empty($url)) $url = getNotEncodedFullUrl('', 'module', 'admin', 'act', $info->admin_index_act);\n\t\tif(empty($url)) $url = getNotEncodedFullUrl('', 'module', 'admin');\n\t\t$dbInfo = Context::getDBInfo();\n\n\t\t$args = new stdClass();\n\t\t$args->menu_item_srl = (!$requestArgs->menu_item_srl) ? getNextSequence() : $requestArgs->menu_item_srl;\n\t\t$args->parent_srl = $requestArgs->parent_srl;\n\t\t$args->menu_srl = $requestArgs->menu_srl;\n\t\t$args->name = sprintf('{$lang->menu_gnb_sub[\\'%s\\']}', $menuName);\n\t\t//if now page is https...\n\t\tif(strpos($url, 'https') !== false)\n\t\t{\n\t\t\t$args->url = str_replace('https'.substr($dbInfo->default_url, 4), '', $url);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$args->url = str_replace($dbInfo->default_url, '', $url);\n\t\t}\n\t\t$args->open_window = 'N';\n\t\t$args->expand = 'N';\n\t\t$args->normal_btn = '';\n\t\t$args->hover_btn = '';\n\t\t$args->active_btn = '';\n\t\t$args->group_srls = implode(',', array_keys($groupSrlList));\n\t\t$args->listorder = -1*$args->menu_item_srl;\n\n\t\t// Check if already exists\n\t\t$oMenuModel = getAdminModel('menu');\n\t\t$item_info = $oMenuModel->getMenuItemInfo($args->menu_item_srl);\n\t\t// Update if exists\n\t\tif($item_info->menu_item_srl == $args->menu_item_srl)\n\t\t{\n\t\t\t$output = executeQuery('menu.updateMenuItem', $args);\n\t\t\tif(!$output->toBool()) return $output;\n\t\t}\n\t\t// Insert if not exist\n\t\telse\n\t\t{\n\t\t\t$args->listorder = -1*$args->menu_item_srl;\n\t\t\t$output = executeQuery('menu.insertMenuItem', $args);\n\t\t\tif(!$output->toBool()) return $output;\n\t\t}\n\t\t// Get information of the menu\n\t\t$menu_info = $oMenuModel->getMenu($args->menu_srl);\n\t\t$menu_title = $menu_info->title;\n\t\t// Update the xml file and get its location\n\t\t$xml_file = $this->makeXmlFile($args->menu_srl);\n\n\t\t$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispAdminSetup');\n\t\t$this->setRedirectUrl($returnUrl);\n\t}", "public function registerMenu()\n\t\t{\n\t\t\tadd_options_page( 'Thingdom Settings', 'Thingdom Settings', 'manage_options', $this->slug, array($this, 'loadSettings')); \n\t\t\tadd_action('admin_init', array($this, 'registerSettings'));\n\t\t}", "function save_options(){\n\t\t\n\t\t$nonsavable_types=array('open', 'close','subtitle','title','documentation','block','blockclose');\n\t\n\t\t//insert the default values if the fields are empty\n\t\tforeach ($this->options as $value) {\n\t\t\tif(isset($value['id']) && get_option($value['id'])===false && isset($value['std']) && !in_array($value['type'], $nonsavable_types)){\n\t\t\t\tupdate_option( $value['id'], $value['std']);\n\t\t\t}\n\t\t}\n\t\t\n\t\t//save the field's values if the Save action is present\n\t\tif ( $_GET['page'] == HANA_OPTIONS_PAGE ) {\n\t\t\tif ( isset($_REQUEST['action']) && 'save' == $_REQUEST['action'] ) {\n\t\t\t\t//verify the nonce\n\t\t\t\tif ( empty($_POST) || !wp_verify_nonce($_POST['hana-theme-options'],'hana-theme-update-options') )\n\t\t\t\t{\n\t\t\t\t\tprint 'Sorry, your nonce did not verify.';\n\t\t\t\t\texit;\n\t\t\t\t}else{\n\t\t\t\t\tif(!get_option(HANA_SHORTNAME.'_first_save')){\n\t\t\t\t\t\tupdate_option(HANA_SHORTNAME.'_first_save','true');\n\t\t\t\t\t}\n\t\t\t\t\tforeach ($this->options as $value) {\n\t\t\t\t\t\tif(isset($value['id']) ) if( isset( $_REQUEST[ $value['id'] ] ) && !in_array($value['type'], $nonsavable_types)) {\n\t\t\t\t\t\t\tupdate_option( $value['id'], $_REQUEST[ $value['id'] ] );\n\t\t\t\t\t\t} elseif(!in_array($value['type'], $nonsavable_types)){\n\t\t\t\t\t\t\tdelete_option( $value['id'] );\n\t\t\t\t\t\t}\n\t\n\t\t\t\t\t\t/* Update the values for the custom options that contain unlimited suboptions - for example when having\n\t\t\t\t\t\t * a slider with fields \"title\" and \"imageurl\", for all the entities the titles will be saved in one field,\n\t\t\t\t\t\t * separated by a separator. In this case, if the field name is slider_title and it contains some data like\n\t\t\t\t\t\t * title 1|*|title2|*|title3 (|*| is the separator), then all this data will be saved into a custom field\n\t\t\t\t\t\t * with id slider_titles.\n\t\t\t\t\t\t */\n\t\t\t\t\t\tif($value['type']=='custom'){\n\t\t\t\t\t\t\tforeach($value['fields'] as $field){\n\t\t\t\t\t\t\t\tupdate_option( $field['id'].'s', $_REQUEST[ $field['id'].'s' ] );\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\theader(\"Location: admin.php?page=\".HANA_OPTIONS_PAGE.\"&saved=true\");\n\t\t\t\t\tdie;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\n\t}", "public function run()\n {\n $object = new Menu();\n $object->id = '1';\n $object->idparent = '0';\n $object->idfils = '1';\n $object->libelle = 'Application';\n $object->groupeuser = '2';\n $object->rang = '1';\n $object->icon = 'cogs';\n $object->fichiercontroller = 'ApplicationController';\n $object->fichierview = 'Application';\n $object->save();\n\n $object = new Menu();\n $object->id = '2';\n $object->idparent = '0';\n $object->idfils = '1';\n $object->libelle = 'Utilisateurs';\n $object->groupeuser = '2';\n $object->rang = '2';\n $object->icon = 'user';\n $object->fichiercontroller = 'UserController';\n $object->fichierview = 'Utilisateurs';\n $object->save();\n\n $object = new Menu();\n $object->id = '3';\n $object->idparent = '0';\n $object->idfils = '1';\n $object->libelle = 'Groupe Utilisateurs';\n $object->groupeuser = '2';\n $object->rang = '3';\n $object->icon = 'users';\n $object->fichiercontroller = 'TlistGroupeUserController';\n $object->fichierview = 'GroupeUtilisateurs';\n $object->save();\n\n $object = new Menu();\n $object->id = '4';\n $object->idparent = '0';\n $object->idfils = '1';\n $object->libelle = 'Gestions';\n $object->groupeuser = '5';\n $object->rang = '4';\n $object->icon = 'folder';\n $object->fichiercontroller = 'GestionsController';\n $object->fichierview = 'Gestions';\n $object->save();\n\n $object = new Menu();\n $object->id = '5';\n $object->idparent = '0';\n $object->idfils = '1';\n $object->libelle = 'Contacts';\n $object->groupeuser = '5';\n $object->rang = '5';\n $object->lien = 'Contacts';\n $object->icon = 'contact';\n $object->route = 'contact';\n $object->controller = 'ContactController@index';\n $object->fichiercontroller = 'ContactController';\n $object->fichierview = 'Contacts';\n $object->save();\n\n $object = new Menu();\n $object->id = '6';\n $object->idparent = '0';\n $object->idfils = '1';\n $object->libelle = 'Messagerie';\n $object->groupeuser = '5';\n $object->rang = '6';\n $object->lien = 'Messagerie';\n $object->icon = 'inbox';\n $object->route = 'inbox';\n $object->controller = 'InboxController@index';\n $object->fichiercontroller = 'InboxController';\n $object->fichierview = 'Messagerie';\n $object->save();\n\n $object = new Menu();\n $object->id = '7';\n $object->idparent = '0';\n $object->idfils = '1';\n $object->libelle = 'Galeries';\n $object->groupeuser = '5';\n $object->rang = '7';\n $object->lien = 'Galeries';\n $object->icon = 'camera-retro';\n $object->route = 'galerie';\n $object->controller = 'GalerieController@index';\n $object->fichiercontroller = 'GalerieController';\n $object->fichierview = 'Galeries';\n $object->save();\n\n $object = new Menu();\n $object->id = '8';\n $object->idparent = '0';\n $object->idfils = '1';\n $object->libelle = 'Parametre';\n $object->groupeuser = '5';\n $object->rang = '8';\n $object->icon = 'cog';\n $object->fichiercontroller = 'ParametreController';\n $object->fichierview = 'Parametre';\n $object->save();\n\n $object = new Menu();\n $object->id = '9';\n $object->idparent = '0';\n $object->idfils = '1';\n $object->libelle = 'Apropos';\n $object->groupeuser = '5';\n $object->rang = '9';\n $object->lien = 'Apropos';\n $object->icon = 'certificate';\n $object->fichierview = 'Apropos';\n $object->save();\n\n $object = new Menu();\n $object->id = '11';\n $object->idparent = '1';\n $object->idfils = '2';\n $object->libelle = 'Maintenance';\n $object->groupeuser = '2';\n $object->rang = '1';\n $object->lien = 'Application\\Maintenance';\n $object->icon = 'cog';\n $object->route = 'maintenance';\n $object->controller = 'ApplicationController@Maintenance';\n $object->fichierview = 'application\\Maintenance';\n $object->save();\n\n $object = new Menu();\n $object->id = '12';\n $object->idparent = '1';\n $object->idfils = '2';\n $object->libelle = 'Menus';\n $object->groupeuser = '2';\n $object->rang = '2';\n $object->lien = 'Application\\Menus';\n $object->icon = 'list';\n $object->route = 'menus';\n $object->controller = 'ApplicationController@menus';\n $object->fichierview = 'application\\Menus';\n $object->save();\n\n $object = new Menu();\n $object->id = '13';\n $object->idparent = '1';\n $object->idfils = '2';\n $object->libelle = 'Restaurer l\\'application';\n $object->groupeuser = '2';\n $object->rang = '3';\n $object->lien = 'Application\\UploadDataBase';\n $object->icon = 'cloud-upload';\n $object->route = 'uploadDataBase';\n $object->controller = 'ApplicationController@uploadDataBase';\n $object->fichierview = 'application\\uploadDataBase';\n\n $object->save();\n $object = new Menu();\n $object->id = '14';\n $object->idparent = '1';\n $object->idfils = '2';\n $object->groupeuser = '2';\n $object->libelle = 'Creer un point de restauration';\n $object->rang = '4';\n $object->lien = 'Application\\downloadDataBase';\n $object->icon = 'cloud-download';\n $object->route = 'downloadDataBase';\n $object->controller = 'ApplicationController@downloadDataBase';\n $object->fichierview = 'application\\downloadDataBase';\n $object->save();\n\n $object = new Menu();\n $object->id = '21';\n $object->idparent = '2';\n $object->idfils = '2';\n $object->libelle = 'nouvel Utilisateur';\n $object->groupeuser = '2';\n $object->rang = '1';\n $object->lien = 'Utilisateurs\\nouvel';\n $object->icon = 'pencil-square-o';\n $object->route = 'addUser';\n $object->controller = 'UserController@nouvel';\n $object->fichierview = 'nouvelUtilisateur';\n $object->save();\n\n $object = new Menu();\n $object->id = '22';\n $object->idparent = '2';\n $object->idfils = '2';\n $object->libelle = 'Modifier Utilisateur';\n $object->groupeuser = '2';\n $object->rang = '2';\n $object->lien = 'Utilisateurs\\Modification';\n $object->icon = 'pencil-square-o';\n $object->route = 'updateUser';\n $object->controller = 'UserController@modification';\n $object->fichierview = 'ModifierUtilisateur';\n $object->save();\n\n $object = new Menu();\n $object->id = '31';\n $object->idparent = '3';\n $object->idfils = '2';\n $object->libelle = 'nouvel Groupe Utilisateur';\n $object->groupeuser = '2';\n $object->rang = '1';\n $object->lien = 'GroupeUtilisateur\\nouvel';\n $object->icon = 'pencil-square-o';\n $object->route = 'addGroupeUser';\n $object->controller = 'TlistGroupeUserController@nouvel';\n $object->fichierview = 'nouvelGroupeUtilisateur';\n $object->save();\n\n $object = new Menu();\n $object->id = '32';\n $object->idparent = '3';\n $object->idfils = '2';\n $object->libelle = 'Modifier Groupe Utilisateur';\n $object->groupeuser = '2';\n $object->rang = '2';\n $object->lien = 'GroupeUtilisateur\\Modification';\n $object->icon = 'pencil-square-o';\n $object->route = 'updateGroupeUser';\n $object->controller = 'TlistGroupeUserController@modification';\n $object->fichierview = 'ModifierGroupeUtilisateur';\n $object->save();\n\n $object = new Menu();\n $object->id = '41';\n $object->idparent = '4';\n $object->idfils = '2';\n $object->libelle = 'Cachets';\n $object->groupeuser = '3';\n $object->rang = '1';\n $object->fichierview = 'Cachets';\n $object->save();\n\n $object = new Menu();\n $object->id = '42';\n $object->idparent = '4';\n $object->idfils = '2';\n $object->libelle = 'Photos';\n $object->groupeuser = '3';\n $object->rang = '2';\n $object->fichierview = 'Photos';\n $object->save();\n\n $object = new Menu();\n $object->id = '43';\n $object->idparent = '4';\n $object->idfils = '2';\n $object->libelle = 'MoMo';\n $object->groupeuser = '3';\n $object->rang = '3';\n $object->fichierview = 'MoMo';\n $object->save();\n\n $object = new Menu();\n $object->id = '44';\n $object->idparent = '4';\n $object->idfils = '2';\n $object->libelle = 'Personnelle';\n $object->groupeuser = '5';\n $object->rang = '4';\n $object->lien = 'Gestions\\Personnelle';\n $object->icon = 'bookmark-o';\n $object->route = 'gestionPerso';\n $object->controller = 'GestionsController@personnelle';\n $object->fichierview = 'Personnelle';\n $object->save();\n\n $object = new Menu();\n $object->id = '45';\n $object->idparent = '4';\n $object->idfils = '2';\n $object->libelle = 'Mise à jours';\n $object->groupeuser = '2';\n $object->rang = '5';\n $object->lien = 'Gestions\\updateGestion';\n $object->icon = 'exchange';\n $object->route = 'updateGestion';\n $object->controller = 'GestionsController@updateGestion';\n $object->fichierview = 'gestions\\updateGestion';\n $object->save();\n\n $object = new Menu();\n $object->id = '46';\n $object->idparent = '4';\n $object->idfils = '2';\n $object->libelle = 'Enregistrer';\n $object->groupeuser = '2';\n $object->rang = '5';\n $object->lien = 'Gestions\\SaveGestion';\n $object->icon = 'cloud-download';\n $object->route = 'saveGestion';\n $object->controller = 'GestionsController@saveGestion';\n $object->fichierview = 'SaveGestion';\n $object->save();\n\n $object = new Menu();\n $object->id = '81';\n $object->idparent = '8';\n $object->idfils = '2';\n $object->libelle = 'Profile';\n $object->groupeuser = '5';\n $object->rang = '1';\n $object->lien = 'Parametre\\Profile';\n $object->icon = 'user';\n $object->route = 'profile';\n $object->controller = 'ParametreController@profile';\n $object->fichierview = 'Profile';\n $object->save();\n\n $object = new Menu();\n $object->id = '411';\n $object->idparent = '41';\n $object->idfils = '3';\n $object->libelle = 'Recettes Cachet';\n $object->groupeuser = '3';\n $object->rang = '1';\n $object->lien = 'Gestions\\Cachet\\Recettes';\n $object->icon = 'adjust';\n $object->route = 'recetteCachet';\n $object->controller = 'GestionsController@recetteCachet';\n $object->fichierview = 'RecettesCachet';\n $object->save();\n\n $object = new Menu();\n $object->id = '412';\n $object->idparent = '41';\n $object->idfils = '3';\n $object->libelle = 'Depenses Cachet';\n $object->groupeuser = '2';\n $object->rang = '2';\n $object->lien = 'Gestions\\Cachet\\Depenses';\n $object->icon = 'exchange';\n $object->route = 'depenseCachet';\n $object->controller = 'GestionsController@depenseCachet';\n $object->fichierview = 'DepensesCachet';\n $object->save();\n\n $object = new Menu();\n $object->id = '413';\n $object->idparent = '41';\n $object->idfils = '3';\n $object->libelle = 'Bilan Cachet';\n $object->groupeuser = '3 ';\n $object->rang = '3';\n $object->lien = 'Gestions\\Cachet\\Bilan';\n $object->icon = 'bar-chart-o';\n $object->route = 'bilanCachet';\n $object->controller = 'GestionsController@bilanCachet';\n $object->fichierview = 'BilanCachet';\n $object->save();\n\n $object = new Menu();\n $object->id = '421';\n $object->idparent = '42';\n $object->idfils = '3';\n $object->libelle = 'Recette Photo';\n $object->groupeuser = '3';\n $object->rang = '1';\n $object->lien = 'Gestions\\Photos\\Recettes';\n $object->icon = 'adjust';\n $object->route = 'recettePhoto';\n $object->controller = 'GestionsController@recettePhoto';\n $object->fichierview = 'RecettePhoto';\n $object->save();\n\n $object = new Menu();\n $object->id = '422';\n $object->idparent = '42';\n $object->idfils = '3';\n $object->libelle = 'Depense Photo';\n $object->groupeuser = '2';\n $object->rang = '2';\n $object->lien = 'Gestions\\Photos\\Depenses';\n $object->icon = 'exchange';\n $object->route = 'depensePhoto';\n $object->controller = 'GestionsController@depensePhoto';\n $object->fichierview = 'DepensePhoto';\n $object->save();\n\n $object = new Menu();\n $object->id = '423';\n $object->idparent = '42';\n $object->idfils = '3';\n $object->libelle = 'Bilan Photo';\n $object->groupeuser = '3';\n $object->rang = '3';\n $object->lien = 'Gestions\\Photos\\Bilan';\n $object->icon = 'bar-chart-o';\n $object->route = 'bilanPhoto';\n $object->controller = 'GestionsController@bilanPhoto';\n $object->fichierview = 'BilanPhoto';\n $object->save();\n\n $object = new Menu();\n $object->id = '431';\n $object->idparent = '43';\n $object->idfils = '3';\n $object->libelle = 'Compte MoMo';\n $object->groupeuser = '2';\n $object->rang = '1';\n $object->lien = 'Gestions\\MoMo\\Recette';\n $object->icon = 'adjust';\n $object->route = 'recetteMoMo';\n $object->controller = 'GestionsController@recetteMoMo';\n $object->fichierview = 'RecettesMoMo';\n $object->save();\n\n $object = new Menu();\n $object->id = '432';\n $object->idparent = '43';\n $object->idfils = '3';\n $object->libelle = 'Bilan MoMo';\n $object->groupeuser = '2';\n $object->rang = '2';\n $object->lien = 'Gestions\\MoMo\\Bilan';\n $object->icon = 'bar-chart-o';\n $object->route = 'bilanMoMo';\n $object->controller = 'GestionsController@bilanMoMo';\n $object->fichierview = 'BilanMoMo';\n $object->save();\n\n }", "function wp_nav_menu_update_menu_items($nav_menu_selected_id, $nav_menu_selected_title)\n {\n }", "function osg_singout_notifier_menu() {\n $items['osg/singout/notifier/contact/form'] = array(\n 'title' => 'STS Singout Notifier: contact form',\n 'page callback' => 'drupal_get_form',\n 'page arguments' => array('osg_singout_notifier_form'),\n 'access arguments' => array('access content'),\n );\n\t\n $items['osg/singout/notifier/unregistered/form'] = array(\n 'title' => 'STS Singout Notifier: Blast Unregistered',\n 'page callback' => 'drupal_get_form',\n 'page arguments' => array('osg_singout_notifier_blast_unregistered_form'),\n 'access arguments' => array('access content'),\n );\n\t$items['osg/singout/notifier/blast/unregistered'] = array(\n 'type' => MENU_CALLBACK,\n 'title' =>'STS Singout Notifier: Registration Needed',\n 'page callback' => 'osg_singout_notifier_registration_needed',\n 'access callback'=> TRUE,\n\n );\n\n return $items;\n}", "function save_postdata( $post_id ) {\n\tglobal $post, $new_meta_boxes;\n\n\tif(isset($post) && $post->post_type=='page'){\n\t\t$new_meta_boxes=$GLOBALS['new_meta_boxes'];\n\t\tpexeto_save_meta_data($new_meta_boxes, $post_id);\n\t}\n}", "public function add_menus() {\n add_action( 'admin_menu', array( 'Hotmembers3\\Admin_Pages_Creator', 'create_pages') );\n }", "protected function menus()\n {\n\n }", "public function update($menu)\r\n {\r\n\r\n }", "function pmpromh_pmpro_save_membership_level($level_id)\r\n{\r\n\tif(isset($_REQUEST['member_homepage_id']))\r\n\t\tupdate_option('pmpro_member_homepage_' . $level_id, $_REQUEST['member_homepage_id']);\r\n}", "public function set_menu_list()\r\n {\r\n $controllerData = $this->setUrlController;\r\n $controllerData = urldecode($controllerData);\r\n $getUrlSegment = explode('/', $controllerData);\r\n $controllerSet = isset($_GET['page']) && trim($_GET['page']) !== '' ?\r\n $_GET['page'] : $this->config['controller_default'];\r\n\r\n $methodSet = isset($_GET['method']) && trim($_GET['method']) !== '' ?\r\n $_GET['method'] : $this->config['method_default'];\r\n\r\n $realControllerName = ucfirst($controllerSet);\r\n $realControllerName = str_replace('-', '_', $realControllerName);\r\n\r\n include $this->bootstrap->base_config_dir . 'Routes.php';\r\n\r\n //add menu by foreach all menu list item array\r\n // list main menu plugin\r\n $xCounterMenu = 0;\r\n foreach ($menu_list as $keyItem => $valueItem) {\r\n if ($valueItem['menu_item']['page_slug'] !== $controllerSet) {\r\n add_menu_page(\r\n $valueItem['menu_item']['page_title'], // Title of the page\r\n $valueItem['menu_item']['page_menu_text'], // Text to show on the menu link\r\n $valueItem['menu_item']['page_capability'], // Capability requirement to see the link\r\n $valueItem['menu_item']['page_slug'], // The 'slug' - file to display when clicking the link,\r\n $valueItem['menu_item']['page_render'],\r\n $valueItem['menu_item']['page_menu_icon'], // icon plugin\r\n $valueItem['menu_item']['page_menu_position'] // item position\r\n );\r\n }\r\n $xCounterMenu++;\r\n }\r\n\r\n // list sub main menu plugin\r\n $yCounterMenu = 0;\r\n foreach ($menu_list_sub as $keyItem => $valueItem) {\r\n\r\n if ($valueItem['menu_item']['page_slug'] !== $controllerSet) {\r\n add_submenu_page(\r\n $valueItem['menu_item']['page_slug_current'], // slug current menu\r\n $valueItem['menu_item']['page_title'], // Title of the page\r\n $valueItem['menu_item']['page_menu_text'], // Text to show on the menu link\r\n $valueItem['menu_item']['page_capability'], // Capability requirement to see the link\r\n $valueItem['menu_item']['page_slug'], // The 'slug' - file to display when clicking the link,\r\n $valueItem['menu_item']['page_render'],\r\n $valueItem['menu_item']['page_menu_position'] // item position\r\n );\r\n }else{\r\n add_submenu_page(\r\n $_SESSION['controller_data_sub']['page_slug_current'], // slug current menu\r\n $_SESSION['controller_data_sub']['page_title'], // Title of the page\r\n $_SESSION['controller_data_sub']['page_menu_text'], // Text to show on the menu link\r\n $_SESSION['controller_data_sub']['page_capability'], // Capability requirement to see the link\r\n $_SESSION['controller_data_sub']['page_slug'], // The 'slug' - file to display when clicking the link,\r\n $_SESSION['controller_data_sub']['page_render'], // render\r\n $_SESSION['controller_data_sub']['page_menu_position'] // item position\r\n );\r\n }\r\n \r\n $yCounterMenu++;\r\n }\r\n }", "function saveOrderingAndIndentObject()\n\t{\n\t\tglobal $ilCtrl, $lng;\n\n\t\t$this->checkPermission(\"write\");\n\n\t\t$this->object->saveOrderingAndIndentation($_POST[\"ord\"], $_POST[\"indent\"]);\n\t\tilUtil::sendSuccess($lng->txt(\"wiki_ordering_and_indent_saved\"), true);\n\t\t$ilCtrl->redirect($this, \"editImportantPages\");\n\t}", "public function add_menu_item () {\n $page = add_menu_page( __( 'Listeo Core ', 'listeo_core' ) , __( 'Listeo Core', 'listeo_core' ) , 'manage_options' , $this->_token . '_settings' , array( $this, 'settings_page' ) );\n add_action( 'admin_print_styles-' . $page, array( $this, 'settings_assets' ) );\n\n// submit_listing\n// browse_listing\n// Registration\n// Booking\n// Pages\n// Emails\n add_submenu_page($this->_token . '_settings', 'Map Settings', 'Map Settings', 'manage_options', 'listeo_settings&tab=maps', array( $this, 'settings_page' ) ); \n \n add_submenu_page($this->_token . '_settings', 'Submit Listing', 'Submit Listing', 'manage_options', 'listeo_settings&tab=submit_listing', array( $this, 'settings_page' ) ); \n \n add_submenu_page($this->_token . '_settings', 'Single Listing', 'Single Listing', 'manage_options', 'listeo_settings&tab=single', array( $this, 'settings_page' ) ); \n \n add_submenu_page($this->_token . '_settings', 'Booking Settings', 'Booking Settings', 'manage_options', 'listeo_settings&tab=booking', array( $this, 'settings_page' ) ); \n \n add_submenu_page($this->_token . '_settings', 'Browse Listings', 'Browse Listings', 'manage_options', 'listeo_settings&tab=browse', array( $this, 'settings_page' ) ); \n \n add_submenu_page($this->_token . '_settings', 'Registration', 'Registration', 'manage_options', 'listeo_settings&tab=registration', array( $this, 'settings_page' ) ); \n \n add_submenu_page($this->_token . '_settings', 'Pages', 'Pages', 'manage_options', 'listeo_settings&tab=pages', array( $this, 'settings_page' ) ); \n \n add_submenu_page($this->_token . '_settings', 'Emails', 'Emails', 'manage_options', 'listeo_settings&tab=emails', array( $this, 'settings_page' ) ); \n \n add_submenu_page($this->_token . '_settings', 'Users Conversation', 'Users Conversation', 'manage_options', 'user-conversation', array( $this, 'user_conversation_fun' ) ); \n\n add_submenu_page(NULL, 'Single Users Conversation', 'Single Users Conversation', 'manage_options', 'single-user-conversation', array( $this, 'single_user_conversation_fun' ) ); \n }", "function spreadshop_admin_menu_entry($content) \n\t{\n add_menu_page(\"Spreadshop Admin\", \"Spreadshop\", 1, \"Spreadshop_Admin\", \"spreadshop_admin\"); \n\t}", "public function testAddMenuAction()\n {\n parent::login();\n $this->clickAt(\"link=CMS\", \"\");\n $this->click(\"link=Páginas\");\n $this->waitForPageToLoad(\"30000\");\n $this->click(\"link=Criar uma nova página\");\n $this->waitForPageToLoad(\"30000\");\n $this->type(\"id=xvolutions_adminbundle_page_title\", \"Test Menu Selenium 1\");\n $this->type(\"id=xvolutions_adminbundle_page_idalias\", \"test-menu-selenium-1\");\n $this->runScript(\"tinyMCE.activeEditor.setContent('Test Menu Selenium 1')\");\n $this->select(\"id=xvolutions_adminbundle_page_id_language\", \"label=Português\");\n $this->select(\"id=xvolutions_adminbundle_page_id_section\", \"label=Pública\");\n $this->select(\"id=xvolutions_adminbundle_page_id_status\", \"label=Publicado\");\n $this->click(\"id=xvolutions_adminbundle_page_Criar\");\n $this->waitForPageToLoad(\"30000\");\n $this->click(\"link=Criar uma nova página\");\n $this->waitForPageToLoad(\"30000\");\n $this->type(\"id=xvolutions_adminbundle_page_title\", \"Test Menu Selenium 2\");\n $this->type(\"id=xvolutions_adminbundle_page_idalias\", \"test-menu-selenium-2\");\n $this->runScript(\"tinyMCE.activeEditor.setContent('Test Menu Selenium 2')\");\n $this->select(\"id=xvolutions_adminbundle_page_id_language\", \"label=Português\");\n $this->select(\"id=xvolutions_adminbundle_page_id_section\", \"label=Pública\");\n $this->select(\"id=xvolutions_adminbundle_page_id_status\", \"label=Publicado\");\n $this->click(\"id=xvolutions_adminbundle_page_Criar\");\n $this->waitForPageToLoad(\"30000\");\n $this->clickAt(\"link=CMS\", \"\");\n $this->click(\"link=Menus\");\n $this->waitForPageToLoad(\"30000\");\n $this->isElementPresent(\"css=ul#sortable1.connectedSortable.ui-sortable li#id-1.ui-state-default.ui-sortable-handle\");\n $this->assertElementContainsText(\"css=ul#sortable1.connectedSortable.ui-sortable li#id-1.ui-state-default.ui-sortable-handle\", \"Test Menu Selenium 1\");\n $this->isElementPresent(\"css=ul#sortable1.connectedSortable.ui-sortable li#id-2.ui-state-default.ui-sortable-handle\");\n $this->assertElementContainsText(\"css=ul#sortable1.connectedSortable.ui-sortable li#id-2.ui-state-default.ui-sortable-handle\", \"Test Menu Selenium 2\");\n parent::logout();\n }", "function SaveItems() \n {\n global $Core;\n \n $name = $Core->GetVar($_POST, 'name', NULL);\n if (isset($_POST['content']) && !empty($_POST['content']))\n {\n $text = $_POST['content'];\n }\n \n $text = stripslashes($text);\n \n if (!empty($name) && !empty($text))\n {\n $name = $this->AddFileExtension($name, 'txt');\n $file = SB_SITE_DATA_DIR . \"ads/\" . $name;\n $Core->ExitEvent($Core->WriteFile($file, $text, 1), $this->redirect);\n }\n else\n {\n $Core->ExitEvent(0, $this->redirect);\n }\n }", "public function store(Request $request)\n {\n ini_set('memory_limit','2048M');\n \n $this->validate($request, [\n 'title' => 'required',\n 'menu' => 'required',\n 'mate_title' => 'required',\n 'mate_keywords' => 'required',\n 'mate_description' => 'required',\n 'body' => 'required',\n ]);\n \n if($request->get('sub_menu') != 0){\n $update_data = array('is_sub_menu' => 'Y');\n DB::table('pages')->where('id', $request->get('sub_menu'))->update($update_data);\n }\n \n $page = new Pages([\n 'title' => $request->get('title'),\n 'menu' => $request->get('menu'),\n 'mate_title' => $request->get('mate_title'),\n 'mate_keywords' => $request->get('mate_keywords'),\n 'mate_description' => $request->get('mate_description'),\n 'body' => $request->get('body'),\n 'slug' => str_slug($request->get('title')),\n 'page_order' => $request->get('page_order'),\n 'sub_menu' => $request->get('sub_menu'),\n ]);\n\n $page->save();\n return redirect('/page')->with('message', 'Page added successful!');\n }", "public function updatemenu() {\n $idMenu = $this->input->post('idMenu');\n $menu = trim($this->input->post('nommenu'));\n $idPage = $this->input->post('idPage');\n $idCategorie = $this->input->post('idCategorie');\n \n if($menu != \"\") {\n \n $data = array(\n 'menu' => $menu,\n 'idPage' => $idPage,\n 'idCategorie' => $idCategorie\n );\n \n $this->db->where('idMenu', $idMenu);\n $this->db->update('menus', $data); \n \n }\n }", "function scfw_menu(){\n add_menu_page('SCFW - Order List', 'SCFW', 'manage_options', 'scfw-options', 'scfw_orders_list');\n add_submenu_page( 'scfw-options', 'Settings page title', 'Teste Ajax', 'manage_options', 'scfw-op-settings', 'scfw_theme_func_settings');\n add_submenu_page( 'scfw-options', 'FAQ page title', 'FAQ menu label', 'manage_options', 'scfw-op-faq', 'scfw_theme_func_faq');\n}" ]
[ "0.7310136", "0.69270164", "0.6827748", "0.6497084", "0.6495229", "0.6459758", "0.6455603", "0.6446444", "0.6430075", "0.6293528", "0.625331", "0.61862755", "0.61782104", "0.6170719", "0.6147013", "0.6138908", "0.61098427", "0.60628396", "0.60384446", "0.6024094", "0.60167277", "0.6015798", "0.6015775", "0.6015775", "0.60154504", "0.5983858", "0.59627366", "0.59524786", "0.5947333", "0.5939418", "0.59368485", "0.59352905", "0.5932401", "0.59321225", "0.5927862", "0.59156305", "0.5911754", "0.59050465", "0.59038645", "0.58922654", "0.588693", "0.58771455", "0.58513653", "0.5846852", "0.583311", "0.5830793", "0.58294964", "0.58291715", "0.58210313", "0.5820401", "0.5813538", "0.5785886", "0.5782089", "0.5780182", "0.57753897", "0.5774471", "0.5753317", "0.5748385", "0.5746131", "0.5742446", "0.5735928", "0.5729916", "0.57224184", "0.5717743", "0.5716948", "0.57028735", "0.56728554", "0.56656224", "0.5657589", "0.5656162", "0.56501544", "0.56495965", "0.5639744", "0.56230706", "0.56230706", "0.56230706", "0.56230706", "0.56230706", "0.56230706", "0.5618818", "0.56020206", "0.5595781", "0.5593813", "0.55882776", "0.5583098", "0.5581926", "0.557568", "0.55695957", "0.55629224", "0.5560292", "0.55528903", "0.55469966", "0.5539621", "0.55383945", "0.55343306", "0.5532074", "0.55311227", "0.55295634", "0.5525059", "0.5524431", "0.5523759" ]
0.0
-1
Returns the page title (the title tag).
public function getPageTitle() { $element = $this->query('title')->first(); if ($element) { return $element->text(); } return ''; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function getPageTitle() {\r\n\t\treturn $this->pageTitle;\r\n\t}", "public function get_page_title() {\n return $this->get_string('page_title');\n }", "static public function getTitle() {\n\t\treturn self::$page_title;\n\t}", "public function getPageTitle() {\n\t\treturn $this->pageTitle;\n\t}", "public function getPageTitle()\n {\n return $this->page_title;\n }", "private function getPageTitle() {\n return $this->pageTitle;\n }", "public function getTitle() {\n return (isset($this->titlePage)) ? $this->titlePage.' - '.Params::param('metainfo-titlePage') : Params::param('metainfo-titlePage');\n }", "public function get_page_title() {\n\n\t\tob_start();\n\n\t\t$this->output_page_title();\n\t\t$this->output_vendor_info();\n\n\t\treturn ob_get_clean();\n\t}", "public function getTitle()\n {\n $list = $this->getPages();\n\n return isset($list[$this->page])\n ? $list[$this->page]\n : '';\n }", "public static function get_page_title() {\n\t\t// Set the current page of the WP query since it's used by SEO plugins.\n\t\tglobal $wp_query, $page;\n\t\t$oldPage = $wp_query->get( 'page' );\n\t\tif ( $page > 1 ) {\n\t\t\t$wp_query->set( 'page', $page );\n\t\t} else {\n\t\t\t$wp_query->set( 'page', null );\n\t\t}\n\n\t\t// Get the title.\n\t\t$title = self::get_page_titleHelper();\n\t\t$title = html_entity_decode( $title, ENT_QUOTES, 'UTF-8' );\n\n\t\t// Set back the current page.\n\t\t$wp_query->set( 'page', $oldPage );\n\n\t\t// Return the title.\n\t\treturn $title;\n\t}", "public function getPageTitle() {\r\n\t\t$config = $this->getConfig();\r\n return $config[\"title\"];\r\n }", "public function getPageTitle() {\n return $this->configuration['page_title'];\n }", "function getPageTitle() {\n return $this->title;\n }", "private static final function getPageTitle () {\r\n // Execute the <title tag> .tp file;\r\n $webHeaderString = new FileContent (FORM_TP_DIR . _S . 'frm_web_header_title.tp');\r\n return $webHeaderString->doToken ('[%TITLE_REPLACE_STRING%]',\r\n implode (_DCSP, ((self::$objPageTitleBackward->toInt () == 1) ? (self::$objPageTitle->arrayReverse ()->toArray ()) :\r\n self::$objPageTitle->toArray ())));\r\n }", "function getPageTitle() {\n\t\tglobal $current_page_title;\n\t\t\n\t\treturn $current_page_title;\n\t}", "private static function get_page_titleHelper() {\n\t\tglobal $wpseo_front;\n\t\tif (\n\t\t\tisset( $wpseo_front ) &&\n\t\t\tmethod_exists( $wpseo_front, 'title' )\n\t\t) {\n\t\t\treturn $wpseo_front->title( '', false );\n\t\t}\n\n\t\t// If the SEO Ultimate plugin is active and compatible.\n\t\tglobal $seo_ultimate;\n\t\tif (\n\t\t\tisset( $seo_ultimate ) &&\n\t\t\tproperty_exists( $seo_ultimate, 'modules' ) &&\n\t\t\tisset( $seo_ultimate->modules['titles'] ) &&\n\t\t\tmethod_exists( $seo_ultimate->modules['titles'], 'get_title' )\n\t\t) {\n\t\t\t@$title = $seo_ultimate->modules['titles']->get_title();\n\n\t\t\treturn $title;\n\t\t}\n\n\t\t// If all else fails, return the standard WordPress title. Unfortunately, most theme hard-code their <title> tag.\n\t\treturn wp_title( '', false );\n\t}", "public function get_title () {\r\n\t\treturn $this->get_info()['title'];\r\n\t}", "public static function title($page_title = false)\r\n\t{\r\n\t\t$title = '';\r\n\t\tif($page_title)\r\n\t\t{\r\n\t\t\t$title = $page_title . ' | ';\r\n\t\t}\r\n\t\treturn $title . Kohana::$config->load('site')->get('name');\r\n\t}", "public static function title($page_title = false)\r\n\t{\r\n\t\t$title = '';\r\n\t\tif($page_title)\r\n\t\t{\r\n\t\t\t$title = $page_title . ' | ';\r\n\t\t}\r\n\t\treturn $title . Kohana::$config->load('site')->get('name');\r\n\t}", "public function getPageTitle(): string;", "public function title() {\n\t\tif ( ! is_object( $this->object ) ) {\n\t\t\treturn esc_html__( 'Page not found', 'nhg-seo' );\n\t\t}\n\n\t\t$title = Strategy::get_from_meta( 'post', $this->object->ID, $this->object, 'title' );\n\t\tif ( \\is_string( $title ) && '' !== $title ) {\n\t\t\treturn $title;\n\t\t}\n\n\t\treturn Strategy::get_title( 'post', $this->object->post_type, $this->object );\n\t}", "public function getTitle() {\n\t\treturn Template::getSiteTitle();\n\t}", "public function getTitle()\n {\n return $this->get(self::_TITLE);\n }", "public function getTitle()\n {\n return $this->get(self::_TITLE);\n }", "function get_page_title()\n {\n return $this->object->name;\n }", "public static function getTitle()\n {\n return self::$title;\n }", "public function get_title() {\n\t\tif ( ! is_null( $this->title ) ) {\n\t\t\treturn $this->title;\n\t\t}\n\n\t\t/**\n\t\t * Allow changing the title.\n\t\t *\n\t\t * @param string $title The page title being put out.\n\t\t */\n\t\t$this->title = $this->do_filter( 'frontend/title', $this->paper->title() );\n\n\t\t// Early Bail!!\n\t\tif ( '' === $this->title ) {\n\t\t\treturn $this->title;\n\t\t}\n\n\t\t// Remove excess whitespace.\n\t\t$this->title = preg_replace( '[\\s\\s+]', ' ', $this->title );\n\n\t\t// Capitalize Titles.\n\t\tif ( Helper::get_settings( 'titles.capitalize_titles' ) ) {\n\t\t\t$this->title = ucwords( $this->title );\n\t\t}\n\n\t\t$this->title = wp_strip_all_tags( stripslashes( $this->title ), true );\n\t\t$this->title = esc_html( $this->title );\n\t\t$this->title = convert_smilies( $this->title );\n\n\t\treturn $this->title;\n\t}", "public function getTitle()\n\t{\n\t\t$content = $this->getContent();\n\t\treturn $content->title;\n\t}", "function getHtmlTitle()\n\t{\n\t\t// set up the page title\n\t\tif ($this->isContentPage) {\n\t\t\t\n\t\t\tif (isset($this->map[$this->area]['show'][$this->page]) &&\n\t\t\t\t$this->map[$this->area]['show'][$this->page] != $this->page) {\n\t\t\t\t// use the 'show' text\n\t\t\t\t$htmlTitle = $this->map[$this->area]['show'][$this->page];\n\t\t\t} else {\n\t\t\t\t// if the nav title and the page name are the same,\n\t\t\t\t// show a hierarchy instead.\n\t\t\t\t// for content pages, the name is based on the\n\t\t\t\t// area and page-path\n\t\t\t\t$htmlTitle = $this->area;\n\t\t\t\t\n\t\t\t\tif (count($this->path)) {\n\t\t\t\t\t$htmlTitle .= ' -- ' .\n\t\t\t\t\timplode(' : ', $this->path);\n\t\t\t\t} else {\n\t\t\t\t\t$htmlTitle .= ' : ' . $this->page;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t\n\t\t\t// for non-content (administrative) pages, the\n\t\t\t// name is based on the script name.\n\t\t\t$htmlTitle = basename(strip_tags($_SERVER['SCRIPT_NAME']));\n\t\t\t$htmlTitle = str_replace('.php', '', $htmlTitle);\n\t\t\t$htmlTitle = str_replace('_', ' ', $htmlTitle);\n\t\t\t$htmlTitle = ucwords($htmlTitle);\n\t\t\t\n\t\t}\n\t\t\n\t\treturn $htmlTitle;\n\t}", "public function getPageTitle()\n {\n return 'Links to Scanned Page - ' . $this->page->uri;\n }", "public function pageTitle($title = '') {\n $page_title = '';\n if (empty($title)) {\n $page_title .='Ticketchai | Home ';\n } else {\n $page_title .=$title;\n }\n\n return \"<title>\" . $page_title . \"</title>\";\n }", "function getTitle() {\n\t\tif($this->title) {\n\t\t\treturn $this->title;\n\t\t}\n\t\telse if(Session::getValue(\"nav_sindex\")) {\n\t\t\t$query = new Query();\n\t\t\tif($query->sql(\"SELECT name FROM \".UT_NAV.\" WHERE sindex = '\".Session::getValue(\"sindex\").\"'\")) {\n\t\t\t\treturn $query->getQueryResult(0, \"name\");\n\t\t\t}\n\t\t}\n\t\treturn SITE_NAME;\n\t}", "public function getTitle()\n {\n return $this->getValue('title');\n }", "public function getTitle() {\r\n\t\treturn $this->title;\r\n\t}", "public function getTitle(): string {\n\t\treturn $this->title;\n\t}", "public function title(){\r\n\r\n echo ISSET($this->pageSettings->page_title)?$this->pageSettings->page_title:'';\r\n\r\n }", "public function getTitle() {\n\t\treturn $this->title;\n\t}", "public function getTitle() {\n\t\treturn $this->title;\n\t}", "public function getTitle() {\n\t\treturn $this->title;\n\t}", "public function getTitle() {\n\t\treturn $this->title;\n\t}", "public function getTitle()\n\t{\n\t\treturn $this->title;\n\t}", "public function getTitle()\n\t{\n\t\treturn $this->title;\n\t}", "public function getTitle()\n\t{\n\t\treturn $this->title;\n\t}", "public function getTitle()\n\t{\n\t\treturn $this->title;\n\t}", "public function getTitle()\n\t{\n\t\treturn $this->title;\n\t}", "public function getTitle()\n\t{\n\t\treturn $this->title;\n\t}", "public function getTitle()\n\t{\n\t\treturn $this->title;\n\t}", "public function getTitle()\n\t{\n\t\treturn $this->title;\n\t}", "public function getTitle()\n\t{\n\t\treturn $this->title;\n\t}", "public function getTitle()\n\t{\n\t\treturn $this->title;\n\t}", "public function getTitle()\n\t{\n\t\treturn $this->title;\n\t}", "public function getTitle()\n\t{\n\t\treturn $this->title;\n\t}", "public function getTitle()\n {\n return isset($this->metas['title']) ? $this->metas['title'] : '';\n }", "public function getTitle()\n {\n\t\treturn $this->title;\n\t}", "public function getTitle()\r\n\t{\r\n\t\treturn $this->_title;\r\n\t}", "public function getTitle() {\n\t\t\treturn $this->title;\n\t\t}", "public function getTitle()\r\n\t\t{\r\n\t\t\treturn $this->_title;\r\n\t\t}", "public function get_title()\n\t{\n\t\treturn $this->title;\n\t}", "public function getTitle(): string\n {\n return $this->_title;\n }", "public function getTitle()\n\t\t{\n\t\t\treturn $this->_title;\n\t\t}", "public function getTitle()\n\t\t{\n\t\t\treturn $this->_title;\n\t\t}", "public function getTitle(): string\n\t{\n\t\treturn $this->title;\n\t}", "public function get_title() {\n\t\treturn $this->post ? $this->post->post_title : '';\n\t}", "public function getTitle() {\r\n\t\treturn $this->_title;\r\n\t}", "public function getTitle(): string\n {\n return $this->title;\n }", "public function getTitle(): string\n {\n return $this->title;\n }", "public function getTitle(): string\n {\n return $this->title;\n }", "public function getTitle(): string\n {\n return $this->title;\n }", "public function getTitle(): string\n {\n return $this->title;\n }", "public function getTitle(): string\n {\n return $this->title;\n }", "public function getTitle(): string\n {\n return $this->title;\n }", "public function getTitle() : string\n {\n return $this->title;\n }", "public function getTitle() : string\n {\n return $this->title;\n }", "function page_title($title = ''){\r\n\tglobal $eqdkp, $user;\r\n\t$pt_prefix\t\t= (defined('IN_ADMIN')) ? $user->lang['admin_title_prefix'] : $user->lang['title_prefix'];\r\n\t$main_title\t\t= sprintf($pt_prefix, $eqdkp->config['guildtag'], $eqdkp->config['dkp_name']);\r\n\treturn sanitize((( $title != '' ) ? $title.' - ' : '').$main_title, TAG);\r\n}", "public function getTitle() {\n\t\treturn $this->_title;\n\t}", "public function getTitle()\n\t\t{\n\t\t\tif(is_null($this->data))\n\t\t\t\treturn '';\n\t\t\t\n\t\t\tif(!array_key_exists('title', $this->data))\n\t\t\t\treturn '';\n\t\t\t\n\t\t\treturn $this->data['title'];\n\t\t}", "public function currentPageTitle()\n {\n return $this->pageGuide->getTitle($this->currentPage);\n }", "public function getTitle() {\n\t\treturn $this->title;\t\n\t}", "public function get_title() {\n\t\treturn $this->format_string( $this->title );\n\t}", "public function getTitle()\n {\n return $this->title;\n }", "public function getTitle()\n {\n return $this->title;\n }", "public function getTitle()\n {\n return $this->title;\n }", "public function getTitle()\n {\n return $this->title;\n }", "public function getTitle()\n {\n return $this->title;\n }", "public function getTitle()\n {\n return $this->title;\n }", "public function getTitle()\n {\n return $this->title;\n }", "public function getTitle()\n {\n return $this->title;\n }", "public function getTitle()\n {\n return $this->title;\n }", "public function getTitle()\n {\n return $this->title;\n }", "public function getTitle()\n {\n return $this->title;\n }", "public function getTitle()\n {\n return $this->title;\n }", "public function getTitle()\n {\n return $this->title;\n }", "public function getTitle()\n {\n return $this->title;\n }", "public function getTitle()\n {\n return $this->title;\n }", "public function getTitle()\n {\n return $this->title;\n }", "public function getTitle()\n {\n return $this->title;\n }", "public function getTitle()\n {\n return $this->title;\n }", "public function getTitle()\n {\n return $this->title;\n }", "public function getTitle()\n {\n return $this->title;\n }", "public function getTitle()\n {\n return $this->title;\n }" ]
[ "0.89247775", "0.88945967", "0.8873029", "0.8856092", "0.8826045", "0.88136685", "0.8664483", "0.860149", "0.8599555", "0.85964715", "0.85926557", "0.856295", "0.84522694", "0.83191776", "0.8264882", "0.82567924", "0.82371825", "0.8218668", "0.8218668", "0.8201418", "0.8177374", "0.8158901", "0.8137088", "0.8137088", "0.81181496", "0.8112567", "0.8090324", "0.8087567", "0.8082909", "0.8075825", "0.80635875", "0.8062507", "0.80496556", "0.804278", "0.802518", "0.8024207", "0.80217147", "0.80217147", "0.80217147", "0.80217147", "0.8018854", "0.8018854", "0.8018854", "0.8018854", "0.8018854", "0.8018854", "0.8018854", "0.8018854", "0.8018854", "0.8018854", "0.8018854", "0.8018854", "0.801829", "0.80174834", "0.8007168", "0.7999555", "0.79959726", "0.79956675", "0.79933953", "0.7991657", "0.7991657", "0.79862916", "0.7981979", "0.7980786", "0.7980571", "0.7980571", "0.7980571", "0.7980571", "0.7980571", "0.7980571", "0.7980571", "0.79759264", "0.79759264", "0.79657525", "0.79528767", "0.7947576", "0.79441965", "0.79385287", "0.793536", "0.79268837", "0.79268837", "0.79268837", "0.79268837", "0.79268837", "0.79268837", "0.79268837", "0.79268837", "0.79268837", "0.79268837", "0.79268837", "0.79268837", "0.79268837", "0.79268837", "0.79268837", "0.79268837", "0.79268837", "0.79268837", "0.79268837", "0.79268837", "0.79268837" ]
0.88270646
4
Sets the page title (the title tag).
public function setPageTitle($title) { $titleElement = $this->query('title')->first(); if ($title === '') { // If empty value passed we need to remove title tag if ($titleElement) { $this->removeElement($titleElement); } } else { if ($titleElement) { $titleElement->text($title); } else { $titleElement = new Title($title); $head = $this->query('head'); if ($head->count() > 0) { /* @var Element $head */ $this->appendTo($head->first(), $titleElement); } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setPageTitle($title);", "protected function setPageTitle() {\r\n\t\t$pageTitleText = (empty($this->settings['news']['semantic']['general']['pageTitle']['useAlternate'])) ? $this->newsItem->getTitle() : $this->newsItem->getAlternativeTitle();\r\n\t\t$pageTitleAction = $this->settings['news']['semantic']['general']['pageTitle']['action'];\r\n\r\n\t\tif (!empty($pageTitleAction)) {\r\n\t\t\tswitch ($pageTitleAction) {\r\n\t\t\t\tcase 'prepend':\r\n\t\t\t\t\t$pageTitleText .= ': ' . $GLOBALS['TSFE']->page['title'];\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'append':\r\n\t\t\t\t\t$pageTitleText = $GLOBALS['TSFE']->page['title'] . ': ' . $pageTitleText;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t}\r\n\t\t\t$this->pageTitle = html_entity_decode($pageTitleText, ENT_QUOTES, \"UTF-8\");\r\n\t\t\t$GLOBALS['TSFE']->page['title'] = $this->pageTitle;\r\n\t\t\t$GLOBALS['TSFE']->indexedDocTitle = $this->pageTitle;\r\n\t\t}\r\n\t}", "protected function setPageTitle($title) {\n\n $this->pageTitle = $title;\n\n $args = array('class' => 'title');\n $titleTag = \\MUtil_Html::create('h3', $title, $args);\n\n $this->html->append($titleTag);\n }", "public function setPageTitle($title)\n {\n self::set('_title', $title);\n }", "public function setTitle($title)\n\t{\n\t\t$this->title = $title;\n\n\t\tif($this->pageInitialized)\n\t\t{\n\t\t\t$titleElement = $this->document->getElementsByTagName('title')->item(0);\n\t\t\t$titleElement->clear();\n\t\t\t$titleElement->loadHtml($title);\n\t\t}\n\t}", "function setPageTitle($pageTitle)\n\t{\n\t\t$this->pageTitle = $pageTitle;\n\t}", "public static function setPageTitle($title)\n\t{\n\t\tYii::app()->controller->pageTitle = $title;\n\t}", "public function setPageTitle($pageTitle) {\n $this->pageTitle = $pageTitle;\n }", "public function setPageTitle($title)\n\t{\n\t\t$this->_themeExtras['title'] = $title;\n\t}", "public function set_pagetitle($title)\n {\n $this->pagetitle = $title;\n }", "public function setTitle($title) {\r\n $this->_title = $title;\r\n }", "public function setTitle($title) {\r\n $this->title = $title;\r\n }", "public function setPageTitle($page_name);", "public function setPageTitle($page_name);", "public function setTitle($title) {\n $this->_title = $title;\n }", "public function setTitle($title) {\n $this->title = $title;\n }", "public function setTitle($title) {\n $this->title = $title;\n }", "public function setTitle($title)\r\n\t\t{\r\n\t\t\t$this->_title = $title;\r\n\t\t}", "public function setTitle($title) {\n\t\t$this->title = $title;\n\t}", "public function setTitle($title) {\n\t\t$this->title = $title;\n\t}", "public function setTitle($title) {\n\t\t$this->title = $title;\n\t}", "public function setTitle($title) {\n $this->_title = $title;\n }", "public function setTitle($title)\n {\n $this->_title = $title;\n }", "public function setTitle($title)\n {\n $this->_title = $title;\n }", "public function setTitle($title)\r\n {\r\n $this->title = $title;\r\n }", "public function setTitle($title = ''){\n $this->setVar('TITLE', $title);\n }", "public function setTitle($title) {\n\t\tTemplate::setSiteTitle($title);\n\t}", "public function setTitle($title){\n $this->title = $title;\n }", "public function setTitle($title)\n {\n $this->title = $title;\n }", "public function setTitle($title)\n {\n $this->title = $title;\n }", "public function setTitle($title)\n {\n $this->title = $title;\n }", "public function setTitle($title)\n {\n $this->title = $title;\n }", "public function setTitle($title)\n {\n $this->title = $title;\n }", "public function setTitle($title)\n {\n $this->title = $title;\n }", "public function setTitle($title = '')\n {\n $this->title = $title;\n }", "public function set_title($title)\n {\n $this->title = $title;\n }", "public function setTitle($title) {\n $this->title = $title ;\n }", "public function setTitle($title)\n\t{\n\t\t$this->title = $title;\n\t}", "public function setTitle($title)\n\t{\n\t\t$this->title = $title;\n\t}", "public function setTitle($title){\n $this->title = $title;\n }", "function setTitle($title) {\n\t\t$this->title = $title;\n\t}", "function setTitle($title)\r\n {\r\n $this->title = $title;\r\n }", "public function setTitle($title)\n {\n $this->title = $title;\n }", "function setTitle($title) {\r\n $this->_title = $title;\r\n }", "function setTitle($title) {\r\n $this->_title = $title;\r\n }", "function setTitle($title) {\n\t\t$this->_title = $title;\n\t}", "public function setTitle($title) {\n\t\t\n\t\t\t$this->_title = $title;\n\t\t\n\t\t}", "function set_title($title){\r\n\t\t$this->_title = $title;\r\n\t}", "function setTitle($title)\n {\n $this->title = $title;\n }", "function setTitle($title)\n {\n $this->title = $title;\n }", "function setTitle($title)\n {\n $this->title = $title;\n }", "function setTitle($title)\r\n\t{\r\n\t\t$this->title = $title;\r\n\t}", "function setTitle($title)\n {\n $this->m_title = $title;\n }", "function setTitle(string $title): void\n {\n $this->data['head']['title'] = $title;\n }", "public function setTitle($title)\n\t{\n\t\t$this->setBodyTitle($title);\n\t\t$this->setPageTitle($title);\n\t}", "public function setTitle($title){\n $this->p_title = $title;\n }", "public function setTitle($title)\n {\n $this->title = (string) $title;\n }", "public function SetHeadTitle ($title) {\r\n\t\t$this->head->SetTitle($title);\r\n\t}", "public function setTitle(string $title) {\n\t\t$this->title = $title;\n\t}", "public function setTitle($title)\n\t{\n\t\tif (!empty($title)) {\n\t\t\t$this->title = $title;\n\t\t}\n\t}", "public function setTitle($title)\n {\n $this->setValue('title', $title);\n }", "public function setTitle($title){\n \t$this->title = $title;\n }", "public function setTitle(string $title): void {\n\t\t$this->m_title = $title;\n\t}", "public function setTitle(string $title): void\n {\n $this->_title = $title;\n }", "public function setTitle(string $title)\n {\n $this->title = $title;\n }", "public function setTitle(string $title)\n {\n $this->title = $title;\n }", "public function setTitle($newTitle) { $this->Title = $newTitle; }", "protected function setTitle()\n\t{\n\t\tglobal $APPLICATION;\n\n\t\tif ($this->arParams[\"SET_TITLE\"] == 'Y')\n\t\t\t$APPLICATION->SetTitle(Localization\\Loc::getMessage(\"SPOL_DEFAULT_TITLE\"));\n\t}", "final public function setPageTitle($title) {\n if ($title === null) {\n return;\n }\n if ($this->title !== null) {\n trigger_warning(\"Setting page title more than once! Was {$this->title} but now is $title\", E_USER_WARNING);\n }\n $this->title = $title;\n return $this;\n }", "public function setTitle(string $title): void\n {\n $this->title = $title;\n }", "public function setTitle(string $title): void\n {\n $this->title = $title;\n }", "public function setTitle(string $title): void\n {\n $this->title = $title;\n }", "public function setTitle(string $title): void\n {\n $this->title = $title;\n }", "public function setPageTitle($title) {\n $this->configuration['page_title'] = $title;\n return $this;\n }", "protected function setPageTitle($title, $raw = false)\n {\n $this->data[\"site\"][\"page_title\"] = $raw ? $title : config(\"site_name\") . \" - \" . $title;\n }", "public function set_title($title)\n {\n $this->set_default_property(self::PROPERTY_TITLE, $title);\n }", "public function set_page_title($p_page_title)\n\t{\n\t\t$this->c_page_title = $p_page_title;\n\t}", "function set_the_title($title) {\n\n md_set_the_title($title);\n \n }", "public function setTitle($var)\n {\n $this->_title = $var;\n }", "public function setTitle($value)\n {\n $this->_title = $value;\n }", "public function setTitle($title);", "public function setTitle($title);", "public function setTitle($title);", "public function setTitle($title);", "public function setTitle($title);", "public function setTitle($title);", "public function setTitle($title);", "function setBrowserTitle( $pTitle ) {\n\t\tglobal $gBitSmarty, $gPageTitle;\n\t\t$gPageTitle = $pTitle;\n\t\t$gBitSmarty->assign( 'browserTitle', $pTitle );\n\t\t$gBitSmarty->assign( 'gPageTitle', $pTitle );\n\t}", "public function setTitleTag($title)\n {\n $this->_title_tag = $title;\n }", "public function setTitle( $newTitle )\n {\n\t\t$this->title = $newTitle;\n\t}", "function setTitle( $title )\n {\n $title = trim( $title );\n $this->properties['TITLE'] = $title;\n }", "public static function setTitle(string $title) {}", "public function setTitle($newTitle) {\n\t\t$this->title = $newTitle;\n\t}", "function set_title($title) \r\n\t{\r\n\t\t//$this->title = $title;\r\n\t\t$this->data['title_for_layout'] = $title;\r\n\t\t$this;\r\n\t}", "public function set_title($title){\n\t\t$this->set_channel_element('title', $title);\n\t}", "function setTitle() {\n global $pageTitle;\n\n $pageTitle = isset($pageTitle) ? $pageTitle : 'Default' ;\n echo $pageTitle;\n }", "public function setTitle($value)\n {\n $this->title = $value;\n }", "function od_set_page_title($orig_title) {\n\t\treturn \"Map | \"; // set the page title (could be improved, eg based on filters. Might be something the user wants to set\n\t}", "public function setTitle($title){\n\t\t$this->mail_title = $title;\n\t}", "function setTitle($a_title)\n\t{\n\t\t$this->title = $a_title;\n\t}" ]
[ "0.8762942", "0.8735817", "0.86016035", "0.8524776", "0.84464437", "0.84459853", "0.8372553", "0.8372281", "0.8339985", "0.82565075", "0.8246561", "0.8239226", "0.8235697", "0.8235697", "0.822129", "0.81988674", "0.81988674", "0.81965786", "0.81954074", "0.81954074", "0.81954074", "0.8192135", "0.8182621", "0.8182621", "0.8179907", "0.81792396", "0.8175719", "0.81690216", "0.81674504", "0.81674504", "0.81674504", "0.81674504", "0.81674504", "0.81674504", "0.81648654", "0.8149152", "0.81488675", "0.812596", "0.812596", "0.8122049", "0.81118983", "0.81075174", "0.81041294", "0.81005406", "0.81005406", "0.8100311", "0.8098463", "0.8050624", "0.80401105", "0.80401105", "0.80401105", "0.8036083", "0.80298877", "0.8024023", "0.8018293", "0.80012524", "0.79736716", "0.7950087", "0.7940406", "0.79386395", "0.7918467", "0.78774333", "0.78557295", "0.7843309", "0.7835886", "0.7835886", "0.782598", "0.7812781", "0.78039044", "0.7758953", "0.7758953", "0.7758953", "0.7758953", "0.7748358", "0.7738103", "0.7732717", "0.77163893", "0.77130973", "0.7703654", "0.77031285", "0.7692808", "0.7692808", "0.7692808", "0.7692808", "0.7692808", "0.7692808", "0.7692808", "0.7650945", "0.764703", "0.7641671", "0.7635644", "0.7627812", "0.7626266", "0.76178986", "0.7611124", "0.7600916", "0.7593444", "0.75869715", "0.75800806", "0.7536722" ]
0.8524936
3
Reads the page description meta tag.
public function getPageDescription() { $element = $this->query('meta[name="description"]')->first(); if ($element) { return $element->getAttribute('content'); } return ''; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getMetaDescription() {\n return (isset($this->metaDescription) && $this->metaDescription!='') ? $this->metaDescription : Params::param('metainfo-metaDescription');\n }", "public function description()\n {\n $description = $this->DOM->filter(\"meta[name='description']\")->attr('content');\n\n return $description;\n }", "function arras_document_description() {\n\tif ( class_exists('All_in_One_SEO_Pack') || class_exists('Platinum_SEO_Pack') ) return false;\n\t\n\tif ( is_single() || is_page() ) {\n\t\tif ( have_posts() ) {\n\t\t\twhile( have_posts() ) {\n\t\t\t\tthe_post();\n\t\t\t\techo '<meta name=\"description\" content=\"' . get_the_excerpt() . '\" />';\n\t\t\t}\n\t\t}\n\t} else {\n\t\techo '<meta name=\"description\" content=\"' . get_bloginfo('description') . '\" />';\n\t}\n}", "function site_description() {\n\treturn site_meta('description');\n}", "public function meta_description()\n\t{\n\t\treturn $this->meta_description;\n\t}", "static public function getDescription() {\n\t\treturn self::$page_description;\n\t}", "function writeMetatags($description) {\r\n echo '<meta name=\"author\" content=\"Stephen Wallace\">' . \"\\n\";\r\n echo \"<meta name=\\\"description\\\" content=\\\"$description\\\">\\n\";\r\n}", "public static function description(string $content): MetaTag {\n return static::namedContent('description', $content);\n }", "function wpcom_vip_meta_desc() {\n _deprecated_function( __FUNCTION__, '2.0.0' );\n\n $text = wpcom_vip_get_meta_desc();\n if ( !empty( $text ) ) {\n echo \"\\n<meta name=\\\"description\\\" content=\\\"$text\\\" />\\n\";\n }\n}", "public function getMetaDescription();", "public function get_description () {\r\n\t\t$content = file_get_contents($this->url);\r\n\t\t$regex = preg_match('/<p id=\"eow-description\" class=\"\" >(.*)<\\/p>/i', $content, $matches);\r\n\t\treturn $matches[1];\r\n\t}", "public static function description($description)\n {\n // Set page description\n self::$data['description'] = $description;\n }", "public function getMetaDescription(): string\n {\n return (string) $this->metaDescription;\n }", "public function meta_description()\n\t{\n\t\treturn $this->get_context_meta_value( __FUNCTION__ );\n\t}", "public function getDescription() {\n\t\treturn Template::getSiteMetaDescription();\n\t}", "public function getDescription(): string\n {\n $description = $this->meta[\"description\"] ?? \"\";\n return is_array($description) ? end($description) : $description;\n }", "function getPageDescription() {\n global $wp_query,\n $post;\n\n $description = get_bloginfo( 'description' );\n\n // single / page\n if( ( is_single() || is_page() ) && !is_front_page() ) {\n $_description = $post->post_content;\n\n // try fetching first text blocks\n if( function_exists( 'get_field' ) ) {\n if( $blocks = get_field( 'blocks', $post->ID ) ) {\n for( $i = 0; $i < count( $blocks ); $i++ ) {\n if( $blocks[$i]['acf_fc_layout'] === 'text' ) {\n $_description = $blocks[$i]['text'];\n break;\n }\n }\n }\n }\n\n if( function_exists( 'get_field' ) ) {\n if( get_field( 'linkpreview--description', $post->ID ) ) {\n $_description = get_field( 'linkpreview--description', $post->ID );\n }\n }\n\n $description = ( !empty( $_description ) ) ? $_description : $description;\n }\n\n // custom taxonomy terms\n if( !empty( $wp_query->query_vars['term'] ) ) {\n $term = get_term_by( 'slug', $wp_query->query_vars['term'], $wp_query->query_vars['taxonomy'] );\n if( $term ) {\n $description = ( !empty( $term->description ) ) ? $term->description : $description;\n }\n }\n\n // tags\n if( is_tag() ) {\n $tag = get_term_by( 'slug', $wp_query->query['tag'], 'post_tag' );\n if( $tag ) {\n $description = ( !empty( $tag->description ) ) ? $tag->description : $description;\n }\n }\n\n // category\n if( is_category() ) {\n $category = get_term_by( 'slug', $wp_query->query['category_name'], 'category' );\n if( $category ) {\n $description = ( !empty( $category->description ) ) ? $category->description : $description;\n }\n }\n\n // author\n if( !empty( $wp_query->query['author_name'] ) ) {\n $author = get_user_by( 'slug', $wp_query->query['author_name'] );\n if( $author ) {\n $biography = get_the_author_meta( 'description', $author->ID );\n $description = ( !empty( $biography ) ) ? $biography : $description;\n }\n }\n\n return wp_trim_words( $description, 115, null );\n}", "function getMetaTags($pageName){\n\t\t\t$metaTags = $this->manage_content->getValue_where('meta_tags','*','page',$pageName);\n\t\t\techo '<meta name=\"keywords\" content=\"'.$metaTags[0]['keyword'].'\" />\n<meta name=\"description\" content=\"'.$metaTags[0]['description'].'\" />';\n\t\t}", "public function metaDescription()\n\t{\n\t\tif ( static::$titleLangPrefix and static::$descriptionLangSuffix )\n\t\t{\n\t\t\treturn \\IPS\\Member::loggedIn()->language()->addToStack( static::$titleLangPrefix . $this->id . static::$descriptionLangSuffix, FALSE, array( 'striptags' => TRUE ) );\n\t\t}\n\t\treturn NULL;\n\t}", "public function testDescription()\n {\n $description_original = \"This is the original \\\"description\\\".\";\n $description_received =\n MetaTags::setDescription($description_original,0)\n ->getDescription();\n\n // Make sure what we got back is what we put in. (not truncated)\n $this->assertEquals(\n $description_original,\n $description_received,\"The original description was not a match\"\n );\n\n // Do the same test, but with truncation turned on.\n $description_received =\n MetaTags::setDescription($description_original,10)\n ->getDescription();\n\n // Test to make sure truncation is working.\n $this->assertEquals(\n $description_received,\n MetaTags::truncateAtWord($description_original,10)\n );\n\n $tag_text = MetaTags::renderDescription(true)->__toString();\n $this->assertStringStartsWith(\"<meta \",$tag_text);\n $this->assertStringEndsWith(\">\",$tag_text);\n }", "private function readMetaConfig(){\r\n\t\tif($this->CI->config->item('zt_head_meta')){\r\n\t\t\t$metaTags = $this->CI->config->item('zt_head_meta');\r\n\t\t\t$meta = null;\r\r\n\t\t\tforeach($metaTags as $metaTag){\r\n\t\t\t\tif(isset($metaTag[\"type\"])){\r\t\t\t\t\tif(isset($metaTag[\"lang\"]) && $metaTag[\"lang\"] && !empty($this->langService)){\r\t\t\t\t\t\t$meta = new Meta($metaTag[\"type\"], $metaTag[\"name\"], $this->langService->GetPrimaryWithSubLangCode());\t\r\t\t\t\t\t} else {\r\t\t\t\t\t\t$meta = new Meta($metaTag[\"type\"], $metaTag[\"name\"], $metaTag[\"content\"]);\t\r\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$meta = new Meta(Meta::TYPE_NAME, $metaTag[\"name\"], $metaTag[\"content\"]);\r\n\t\t\t\t}\r\r\n\t\t\t\t$this->head->AddMetaTag($meta);\r\n\t\t\t}\r\n\t\t}\r\r\n\t}", "protected function _parseDescTag() {}", "public static function get_front_page_meta_description() {\n\t\t$front_page_meta = get_option( self::FRONT_PAGE_META_OPTION );\n\n\t\tif ( empty( $front_page_meta ) ) {\n\t\t\t$legacy_meta_option = get_option( self::LEGACY_META_OPTION );\n\t\t\tif ( ! empty( $legacy_meta_option ) ) {\n\t\t\t\treturn self::update_front_page_meta_description( $legacy_meta_option, true );\n\t\t\t}\n\t\t}\n\n\t\treturn $front_page_meta;\n\t}", "public function setPageDescription($text)\n {\n $metaDescription = $this->query('meta[name=\"description\"]')->first();\n if ($text === '') {\n // If empty value passed we need to remove title tag\n if ($metaDescription) {\n $this->removeElement($metaDescription);\n }\n } else {\n if ($metaDescription) {\n $metaDescription->setAttribute('content', $text);\n } else {\n // Try to insert meta description tag into head\n $metaDescription = new Meta('description', $text);\n $head = $this->query('head');\n if ($head->count() > 0) {\n /* @var Element $head */\n $this->appendTo($head->first(), $metaDescription);\n }\n }\n }\n }", "private function getMetaData ()\n\t\t{\n\t\t\t$data = file_get_contents (\"META.inf\");\n\t\t\t$o = json_decode ($data,true);\n\t\t\treturn $o;\t\n\t\t}", "public static function get_front_page_meta_description() {\n\t\tif ( self::is_enabled_jetpack_seo() ) {\n\t\t\t$front_page_meta = get_option( self::FRONT_PAGE_META_OPTION );\n\t\t\treturn $front_page_meta ? $front_page_meta : get_option( self::GRANDFATHERED_META_OPTION, '' );\n\t\t}\n\n\t\t// Support grandfathering for non-business users.\n\t\treturn get_option( self::GRANDFATHERED_META_OPTION, '' );\n\t}", "function getInfo ()\n\t{\n\t\t$node = $this->getElementsByTagname(\"MetaData\");\n\n\t\tif($node !== false)\n\t\t{\n\t\t\t$childs = $node[0]->child_nodes();\n\n\t\t\tforeach ($childs as $child)\n\t\t\t{\n\t\t\t\t\tif (($child->node_type() == XML_ELEMENT_NODE) && ($child->tagname == \"General\"))\n\t\t\t\t\t{\n\t\t\t\t\t\t$childs2 = $child->child_nodes();\n\n\t\t\t\t\t\tforeach ($childs2 as $child2)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (($child2->node_type() == XML_ELEMENT_NODE) && ($child2->tagname == \"Title\" || $child2->tagname == \"Description\"))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$arr[$child2->tagname] = $child2->get_content();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// General-tag was found. Stop foreach-loop\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// for compatibility reasons:\n\t\t$arr[\"title\"] = $arr[\"Title\"];\n\t\t$arr[\"desc\"] = $arr[\"Description\"];\n\n\t\treturn $arr;\n\t}", "function getDataDescription($data)\n{\n\t$dataDesc = getData($data, \"Page/Description\");\n\treturn $dataDesc[0];\n}", "public function blogdescription() {\n\n\t\tbloginfo( 'description' );\n\n\t}", "private function readDescriptionConfig(){\r\t\tif(empty($this->langService) || $this->langService->IsDefaultSelected()){\r\t\t\tif(empty($this->langService) || $this->CI->config->item(\"zt_site_description\")){\r\t\t\t\t$description = $this->CI->config->item(\"zt_site_description\");\r\t\t\t\t$this->head->SetDescription($description);\r\t\t\t}\t\r\t\t} else {\r\t\t\tif($this->CI->config->item(\"zt_site_description_\" . $this->langService->GetLangCode())){\r\t\t\t\t$description = $this->CI->config->item(\"zt_site_description_\" . $this->langService->GetLangCode());\r\t\t\t\tif(empty($description)){\r\t\t\t\t\t$description = $this->CI->config->item(\"zt_site_description\");\t\r\t\t\t\t}\r\t\t\t\t\r\t\t\t\t$this->head->SetDescription($description);\r\t\t\t}\r\t\t}\r\n\t}", "function getUrlMeta($parser) {\n $metaArray = $parser->getMetatags();\n\n $description = \"\";\n $keywords = \"\";\n\n foreach ($metaArray as $meta) {\n if ($meta->getAttribute(\"name\") == \"description\" || $meta->getAttribute(\"name\") == \"Description\") {\n $description = $meta->getAttribute(\"content\");\n $description = str_replace(\"\\n\", \"\", $description); // cleaning output\n }\n if ($meta->getAttribute(\"name\") == \"keywords\") {\n $keywords = $meta->getAttribute(\"content\");\n $keywords = str_replace(\"\\n\", \"\", $keywords); // cleaning output\n }\n }\n\n return [$description, $keywords];\n}", "protected function addMetaInformation( $description, $thumb ) {\n\t\t$out = $this->getOutput();\n\t\t$out->addHeadItem( 'description',\n\t\t\tHtml::element(\n\t\t\t\t'meta', [\n\t\t\t\t\t'name' => 'description',\n\t\t\t\t\t'content' => $description,\n\t\t\t\t]\n\t\t\t)\n\t\t);\n\t\tif ( $thumb ) {\n\t\t\t$out->addHeadItem(\n\t\t\t\t'ogimage',\n\t\t\t\tHtml::element(\n\t\t\t\t\t'meta',\n\t\t\t\t\t[\n\t\t\t\t\t\t'property' => 'og:image',\n\t\t\t\t\t\t'content' => wfExpandUrl( $thumb->getUrl(), PROTO_CURRENT ),\n\t\t\t\t\t]\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t}", "public function add_meta() {\n\t\techo \"\\n<meta data-plugin='a04_vertical_button' name='description' content='a sample meta description for this website'/>\\n\\n\";\n\t}", "public function show($url)\n\t{\n try{\n\t\t$tags = get_meta_tags(\"http://\".str_replace(\" \",\"\",$url));\n echo $tags['description'];\n }\n catch(Exception $e)\n {\n echo \"Sorry ..... No description available\";\n }\n \n\t}", "function quasar_get_post_loop_description(){\n\tglobal $post;\n\tif(!$post) return;\n\t\n\t$summary_choice = xr_get_option('post_summary','content');//or excerpt;\n\t\n\t$return = '';\n\t\n\tif($summary_choice === 'content'){\n\t\t$return = quasar_get_the_content();\n\t}elseif($summary_choice === 'excerpt'){\n\t\t$return = rock_check_p(get_the_excerpt());\n\t\t$return .= quasar_get_read_more_link();\n\t}\n\t\n\treturn $return;\n}", "private function get_description()\n\t{\n\t\treturn $this->m_description;\n\t}", "private function get_description()\n\t{\n\t\treturn $this->m_description;\n\t}", "protected function set_meta_desc()\r\r\n {\r\r\n define('_KEYWORDS',_BUY_ONLINE);\r\r\n define('_DESCRIPTION',_BUY_ONLINE);\r\r\n define('_TITLE_PAGE',_BUY_ONLINE);\r\r\n }", "public function read_meta( &$object ) {\n\t\t}", "public function getDescTag($html)\n {\n preg_match(\n '/<meta name=\"description\"(.*?)content=\"(.*?)\"(.*?\\/*)>/',\n $html,\n $descTagMatches\n );\n if (empty($descTagMatches)) {\n $finalDescTagMatches = ['', ''];\n } else {\n $finalDescTagMatches[] = $descTagMatches[0];\n $finalDescTagMatches[] = trim($descTagMatches[2]);\n }\n return $finalDescTagMatches;\n }", "function cosmo_get_site_meta() {\n\n ob_start();\n ob_clean();\n\n if( is_single() || is_page() ){ \n global $post; ?>\n <meta name=\"description\" content=\"<?php echo strip_tags( post::get_excerpt( $post, $ln=150 ) ); ?>\" /> \n <meta property=\"og:title\" content=\"<?php the_title() ?>\" />\n <meta property=\"og:site_name\" content=\"<?php echo get_bloginfo('name'); ?>\" />\n <meta property=\"og:url\" content=\"<?php the_permalink() ?>\" />\n <meta property=\"og:type\" content=\"article\" />\n <meta property=\"og:locale\" content=\"en_US\" /> \n <meta property=\"og:description\" content=\"<?php echo get_bloginfo('description'); ?>\"/>\n <?php\n\n } else { ?>\n <meta name=\"description\" content=\"<?php echo get_bloginfo('description'); ?>\" /> \n <meta property=\"og:title\" content=\"<?php echo get_bloginfo('name'); ?>\"/>\n <meta property=\"og:site_name\" content=\"<?php echo get_bloginfo('name'); ?>\"/>\n <meta property=\"og:url\" content=\"<?php echo home_url() ?>/\"/>\n <meta property=\"og:type\" content=\"blog\"/>\n <meta property=\"og:locale\" content=\"en_US\"/>\n <meta property=\"og:description\" content=\"<?php echo get_bloginfo('description'); ?>\"/>\n <?php\n }\n\n return ob_get_clean();\n\n }", "public function extractContent()\n {\n $metas = $this->parsedDOM->getElementsByTagName('meta');\n\n // If exists meta-description, uses it\n foreach ($metas as $meta)\n {\n // Loops the list of attributes\n foreach ($meta->attributes as $attribute)\n {\n\n // Checks if the page is OG Compliant\n if ($attribute->name == 'name'\n && $attribute->value == 'og:description'\n && $meta->attributes->getNamedItem('content')->value !== ''\n ) {\n // Returns the og:description\n return trim($meta->attributes->getNamedItem('content')->value);\n }\n\n // looks for the description meta tag\n if ($attribute->name == 'name'\n && $attribute->value == 'description'\n && $meta->attributes->getNamedItem('content')->value !== ''\n ) {\n return trim($meta->attributes->getNamedItem('content')->value);\n }\n }\n }\n\n $article = $this->parsedDOM->getElementsByTagName('article')->item(0);\n\n if ($article !== null ) {\n // Search the first paragraph inside the article\n $paragraph = $article->firstChild->nodeValue;\n return trim($paragraph);\n\n }\n\n $paragraph = $this\n ->parsedDOM\n ->getElementsByTagName('p')\n ->item(0);\n\n if ($paragraph !== null) {\n return trim($paragraph);\n }\n\n return trim($this\n ->parsedDOM\n ->getElementsByTagName('body')\n ->item(0)\n ->nodeValue);\n }", "function bajweb_custom_meta_des(){\n if( is_single() ) {\n $des = get_post_meta( get_the_id(), 'description', true );\n if( ! empty( $des ) ){\n $des = esc_html( $des );\n echo \"<meta name='description' content='$des'>\";\n }\n }\n}", "function fetchMeta($metadata)\n {\n $languages = $this->getLanguages();\n $attribname = $this->fieldName().(!$this->isMlNode()?'_'.$languages[0]:'');\n $this->m_size = min($metadata[$attribname]['len'], $this->maxInputSize());\n $this->m_searchsize = min($metadata[$attribname]['len'], 20);\n $this->m_maxsize = $metadata[$attribname]['len'];\n }", "function _arc_meta_description($type = null)\n{\n global $thisarticle;\n\n $metaDescription = getMetaDescription($type);\n\n if (!empty($metaDescription)) {\n $description = txpspecialchars($metaDescription);\n } elseif (!empty($thisarticle['excerpt'])) {\n $description = strip_tags($thisarticle['excerpt']);\n $description = substr($description, 0, 200);\n $description = txpspecialchars($description);\n } elseif (!empty($thisarticle['body'])) {\n $description = strip_tags($thisarticle['body']);\n $description = substr($description, 0, 200);\n $description = txpspecialchars($description);\n } else {\n $description = null;\n }\n\n return $description;\n}", "function getDescription($description = null)\n {\n if (!is_string($description)) {\n $description = config('settings.site_description');\n }\n return strip_tags($description);\n }", "private function retrieve_tag_description() {\n\t\treturn $this->retrieve_term_description();\n\t}", "public function getMetaDescription()\n {\n if (\\Lang::hasForLocale($this->getRoutesPath() . \\Slug::getRouteSlug(), $this->getCurrent())) {\n return trans($this->getRoutesPath() . \\Slug::getRouteSlug() . '.metaDescription');\n } else {\n return trans($this->getRoutesPath() . \\Slug::getRouteName() . '.metaDescription');\n }\n }", "function article_description() {\n return Registry::prop('article', 'description');\n}", "public function get_description() {\n\t\t\t$path = $this->git_directory_path();\n\t\t\treturn file_get_contents($path.\"/description\");\n\t\t}", "function cosmetro_site_description() {\n\t$show_desc = get_theme_mod( 'show_tagline', cosmetro_theme()->customizer->get_default( 'show_tagline' ) );\n\n\tif ( ! $show_desc ) {\n\t\treturn;\n\t}\n\n\t$description = get_bloginfo( 'description', 'display' );\n\n\tif ( ! ( $description || is_customize_preview() ) ) {\n\t\treturn;\n\t}\n\n\t$format = apply_filters( 'cosmetro_site_description_format', '<div class=\"site-description\">%s</div>' );\n\n\tprintf( $format, $description );\n}", "function charity_create_description() {\n\t\t$content = '';\n\t\tif (charity_seo()) {\n \t\tif (is_single() || is_page() ) {\n \t\t if ( have_posts() ) {\n \t\t while ( have_posts() ) {\n \t\t the_post();\n\t\t\t\t\t\t\t\t\t\tif (charity_the_excerpt() == \"\") {\n \t\tif (charity_use_autoexcerpt()) {\n \t\t$content =\"\\t\";\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$content .= \"<meta name=\\\"description\\\" content=\\\"\";\n \t\t$content .= charity_excerpt_rss();\n \t\t$content .= \"\\\" />\";\n \t\t$content .= \"\\n\\n\";\n \t\t}\n \t\t} else {\n \t\tif (charity_use_excerpt()) {\n \t\t$content =\"\\t\";\n \t\t$content .= \"<meta name=\\\"description\\\" content=\\\"\";\n \t\t$content .= charity_the_excerpt();\n \t\t$content .= \"\\\" />\";\n \t\t$content .= \"\\n\\n\";\n \t\t}\n \t\t}\n \t\t}\n \t\t}\n \t\t} elseif ( is_home() || is_front_page() ) {\n \t\t$content =\"\\t\";\n \t\t$content .= \"<meta name=\\\"description\\\" content=\\\"\";\n \t\t$content .= get_bloginfo('description');\n \t\t$content .= \"\\\" />\";\n \t\t$content .= \"\\n\\n\";\n \t\t}\n \t\techo apply_filters ('charity_create_description', $content);\n\t\t}\n}", "function get_description() \t{\n \t\treturn $this->description;\n \t}", "public function read_meta( &$object );", "function fumseck_pagemeta() {\n\t\n\t// Initialize\n\t\n\t$output = '';\n\tglobal $post;\n\t$post_id = $post->ID;\n\t\n\t\n\t// Get metadata for the page from WordPress\n\t\n\t$post_title = get_the_title($post_id);\n\t$post_permalink = get_permalink($post_id);\n\t\n\t$post_has_featured_image = has_post_thumbnail( $post_id );\n\t\n\tif( $post_has_featured_image ) {\n\t\t$post_featured_image_large = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'large'); // [URL, w, h, resized?]\n\t};\n\t\n\t$post_summary = wp_strip_all_tags( get_field( '_summary', $post_id, true ));\n\t\n\t\n\tif ( ! $post_summary ) {\t\t// if no summary, try a manual excerpt\n\t\t$post_summary = $post->post_excerpt;\n\t};\t// TODO: do something if there's no manual excerpt either\n\n\t\n\t// Static metadata\n\t\n\t$output .= '<meta name=\"twitter:site\" content=\"@gpaumier\"><meta name=\"twitter:creator\" content=\"@gpaumier\">';\t\n\t$output .= '<meta name=\"twitter:domain\" content=\"guillaumepaumier.com\">';\t\n\t$output .= '<meta property=\"fb:admins\" content=\"710543474\" />';\n\t//$output .= '<meta property=\"fb:admins\" content=\"579323492087704\" />';\n\t$output .= '<meta property=\"article:author\" content=\"https://www.facebook.com/gllmpmr\" />';\n\t$output .= '<meta property=\"article:publisher\" content=\"https://www.facebook.com/gllmpmr\" />';\n\t\n\t$output .= '<meta property=\"og:type\" content=\"article\" />'; // TODO: be more specific\n\t\n\t// Common metadata\n\t\n\t$output .= '<meta property=\"og:site_name\" content=\"' . get_bloginfo( 'name' ) . '\"/>';\n\t\n\t$output .= '<meta name=\"twitter:title\" content=\"' . $post_title . '\">';\n\t$output .= '<meta property=\"og:title\" content=\"' . $post_title . '\"/>';\n\t\n\t\n\t$output .= '<meta property=\"og:url\" content=\"' . $post_permalink . '\" />';\n\t\n\t\n\t$output .= '<meta property=\"og:description\" content=\"' . $post_summary . '\" />';\n\t\n\t// TODO: add locale\n\t\n\tif ( get_post_format( $post_id ) === 'image' ) {\n\t\t\n\t\t$output .= '<meta name=\"twitter:card\" content=\"photo\">';\n\t\t$output .= '<meta name=\"twitter:image\" content=\"' . $post_featured_image_large[0] . '\">';\n\t\t$output .= '<meta name=\"twitter:image:width\" content=\"' . $post_featured_image_large[1] . '\">';\n\t\t$output .= '<meta name=\"twitter:image:height\" content=\"' . $post_featured_image_large[2] . '\">';\n\t\t$output .= '<meta property=\"og:image:width\" content=\"' . $post_featured_image_large[1] . '\" />';\n\t\t$output .= '<meta property=\"og:image:height\" content=\"' . $post_featured_image_large[2] . '\" />';\n\t\t\n\t} else {\t// Not a photo\n\t\t\n\t\t$output .= '<meta name=\"twitter:description\" content=\"' . $post_summary . '\">';\n\t\t\n\t\tif( $post_has_featured_image ) {\n\t\t\t\n\t\t\t$output .= '<meta name=\"twitter:card\" content=\"summary_large_image\">';\n\t\t\t$output .= '<meta name=\"twitter:image:src\" content=\"' . $post_featured_image_large[0] . '\">';\n\t\t\t$output .= '<meta property=\"og:image\" content=\"' . $post_featured_image_large[0] . '\" />';\n\t\t\t$output .= '<meta property=\"og:image:width\" content=\"' . $post_featured_image_large[1] . '\" />';\n\t\t\t$output .= '<meta property=\"og:image:height\" content=\"' . $post_featured_image_large[2] . '\" />';\n\t\t\t\n\t\t} else {\n\t\t\t\n\t\t\t$output .= '<meta name=\"twitter:card\" content=\"summary\">';\n\t\t}\n\t\t\n\t};\n\t\n\n\techo $output;\n}", "function emc_taxonomy_description( $description = null ) {\r\n\r\n\tif ( isset( $description ) ){\r\n\t\t$desc = $description;\r\n\t} else {\r\n\t\tglobal $wp_query;\r\n\t\t$term = $wp_query->get_queried_object();\r\n\t\t$desc = $term->description;\r\n\t}\r\n\r\n\t$html = apply_filters( 'the_content', $desc );\r\n\treturn $html;\r\n\r\n}", "public function setDescription($description) {\n\t\tTemplate::setSiteMetaDescription($description);\n\t}", "public function getMeta($post, $additional=array())\n {\n if(!is_array($additional))\n throw new \\Exception(\"Error in Content::getMeta(), additional meta tags must be an array\");\n\n // Get description\n if(!empty($post->post_excerpt))\n $description = $post->post_excerpt;\n elseif(!empty($post->custom_fields['erdiko_seo_description'][0]))\n $description = $post->custom_fields['erdiko_seo_description'][0];\n else\n $description = $post->post_title;\n\n // Get formatted post dates\n $postDate = date('c', strtotime($post->post_date));\n $updateDate = date('c', strtotime($post->post_modified));\n \n // Description & author\n $meta['description'] = $description;\n $meta['author'] = $post->author->display_name;\n\n // Open Graph\n // $meta['og:locale'] = 'en_US'; // coming from application.json now\n $meta['og:type'] = 'blog';\n $meta['og:title'] = $post->post_title;\n $meta['og:description'] = $description;\n // @todo remove 'http://' and set dynamically somehow\n $meta['og:url'] = \"http://\".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'];\n $meta['og:updated_time'] = $updateDate;\n $meta['og:image'] = $post->feat_image;\n\n // Article\n // $meta['article:publisher'] = \"https://www.facebook.com/yoast\";\n // $meta['article:author'] = \"https://www.facebook.com/jdevalk\";\n $meta['article:section'] = 'Blog';\n $meta['article:published_time'] = $postDate;\n $meta['article:modified_time'] = $updateDate;\n\n // Article Tags\n $tags = array();\n\t if(!empty($post->tags)) {\n\t\t foreach ( $post->tags as $tag ) {\n\t\t\t $tags[] = $tag->name;\n\t\t } // $tag->slug\n\t\t if ( count( $tags ) > 0 ) {\n\t\t\t $meta['article:tag'] = $tags;\n\t\t }\n\t }\n\n // Twitter Card\n $meta['twitter:card'] = \"summary_large_image\";\n $meta['twitter:description'] = $description;\n $meta['twitter:title'] = $post->post_title;\n $meta['twitter:image'] = $post->feat_image;\n // $meta['twitter:creator'] = \"@erdiko\";\n\n // Override any default meta values (from post) with $additional meta supplied\n $meta = array_merge($meta, $additional);\n\n return $meta;\n }", "public function getDescription()\n {\n return $this->getHeaderFieldModel('Content-Description');\n }", "public function get_description() {\n\t\treturn $this->_post->post_excerpt;\n\t}", "abstract function getdescription();", "function getDescription() {\n\t\treturn $this->data_array['description'];\n\t}", "function getDescription() {\n\t\treturn $this->getElementText(DOMIT_RSS_ELEMENT_DESCRIPTION);\n\t}", "function getDescription() {\n\t\treturn $this->getElementText(DOMIT_RSS_ELEMENT_DESCRIPTION);\n\t}", "function getDescription() {\n\t\treturn $this->getElementText(DOMIT_RSS_ELEMENT_DESCRIPTION);\n\t}", "function getDescription() {\n\t\treturn $this->getElementText(DOMIT_RSS_ELEMENT_DESCRIPTION);\n\t}", "public function getMeta();", "public function getMeta();", "private function readMeta()\n {\n $xr = $this->xmlReader;\n \n $insideFieldOrder = FALSE;\n $fieldsNames = NULL;\n \n while ($xr->read())\n {\n // Begin: /meta/fieldOrder\n if ($xr->nodeType == XMLReader::ELEMENT &&\n $xr->name === 'fieldOrder')\n {\n $insideFieldOrder = TRUE;\n $fieldsNames = array();\n }\n \n // Read: /meta/fieldOrder/field/[TEXT]\n if ($insideFieldOrder &&\n $xr->nodeType == XMLReader::TEXT)\n {\n $fieldsNames[] = $xr->value;\n }\n \n // End: /meta/fieldOrder\n if ($xr->nodeType == XMLReader::END_ELEMENT &&\n $xr->name === 'fieldOrder')\n {\n return new Splunk_ResultsFieldOrder($fieldsNames);\n }\n }\n \n throw new Exception('Syntax error in <meta> element.');\n }", "public function get_description() {\n\t\tif ( ! is_null( $this->description ) ) {\n\t\t\treturn $this->description;\n\t\t}\n\n\t\t/**\n\t\t* Allow changing the meta description sentence.\n\t\t*\n\t\t* @param string $description The description sentence.\n\t\t*/\n\t\t$this->description = $this->do_filter( 'frontend/description', trim( $this->paper->description() ) );\n\n\t\t// Early Bail!!\n\t\tif ( '' === $this->description ) {\n\t\t\treturn $this->description;\n\t\t}\n\n\t\t$this->description = wp_strip_all_tags( stripslashes( $this->description ), true );\n\t\t$this->description = esc_attr( $this->description );\n\n\t\treturn $this->description;\n\t}", "public function getDescription() {\n return $this->config['general']['description'];\n }", "public function getMetaContent($metaName, ContentInfo $contentInfo);", "function get_meta_content($file){\r\n $h1count = preg_match_all('/(<meta)(.*=\"(.*)\").\\/>/ix',$file,$patterns);\r\n $res = array();\r\n array_push($res,$patterns[2]);\r\n array_push($res,count($patterns[2]));\r\n return $res;\r\n}", "public function getMetaData() {\n\t\treturn stream_get_meta_data($this->handle);\n\t}", "private function get_main_description() {\n\t\treturn utf8_encode(file_get_contents($this->root . \"/description.\" .\n\t\t\t$this->lang . \".html\"));\n\t}", "public function getMeta()\n {\n return $this->getValue('meta');\n }", "public function getMeta()\n {\n return $this->getValue('meta');\n }", "function emc_the_cpt_description(){\r\n\r\n\t$desc = get_page_by_path( 'description', OBJECT, 'emc_content_focus' );\r\n\t$html = apply_filters( 'the_content', $desc->post_content );\r\n\techo $html;\r\n\r\n}", "public function getMetaData();", "function ct_critic_update_yoast_og_description( $ogdesc ) {\n\t$read_more_text = get_theme_mod( 'read_more_text' );\n\tif ( empty( $read_more_text ) ) {\n\t\t$read_more_text = __( 'Continue reading', 'critic' );\n\t}\n\t$ogdesc = substr( $ogdesc, 0, strpos( $ogdesc, $read_more_text ) );\n\n\treturn $ogdesc;\n}", "public function setDescription($description)\n\t{\n\t\t$this->description = $description;\n\n\t\tif($this->pageInitialized)\n\t\t\t$this->setMetaTag('description', $this->description);\n\t}", "public function description()\n {\n if (@$this->data[\"description\"]) {\n return $this->data[\"description\"];\n }\n return null;\n }", "public function is_on_page_with_description() {\n return ($this->page->pagelayout == 'pagewithdescription');\n }", "public function showMeta()\n {\n $query = $this->pdo->prepare(\"SHOW META\");\n $query->execute();\n return $query->fetchAll();\n }", "public function set_description($description) \n\t{\n\t\t$tag = ($this->version == ATOM)? 'summary' : 'description'; \n\t\t$this->add_element($tag, $description);\n\t}", "public function getDescription() {\n return $this->attributes['description'];\n }", "public function read($description)\n {\n\n \t$object = $this->dao->read($description);\n\n \t//VISTA EN LA CUAL SE MUESTRA LO LEIDO\n\n \t//FALTA REALIZAR LA VISTA EN LA CUAL SE MUESTRA LO ANTERIOR\n }", "public function addMetaTag($name,$desc){\n $this->_metaTags[$name] = $desc;\n }", "protected function _prepareMetaDescription($sMeta, $iLength = 200, $blDescTag = false)\n {\n if (!$sMeta) {\n $sMeta = $this->getContent()->oxcontents__oxtitle->value;\n }\n\n return parent::_prepareMetaDescription($sMeta, $iLength, $blDescTag);\n }", "public function getDescription()\n {\n $this->parseDocBlock();\n return $this->description;\n }", "function site_description($site_desc = '', $location = 'site-tagline') {\n\t\t\t$desc = json_decode($this->get_cached_mod($location));\n\t\t\t$is_image_mode = isset($desc->mode) && 'image' === $desc->mode && !empty($desc->src);\n\t\t\t$url = apply_filters('themify_customizer_tagline_url', !empty($desc->link) ? $desc->link : home_url() );\n\t\t\t$html = !empty($desc->link) ? '<a class=\"site-taglink\" href=\"' . esc_attr($url) .'\" >' : '';\n\t\t\tif ( $is_image_mode===true) {\n\t\t\t\t$alt = get_post_meta( $desc->id, '_wp_attachment_image_alt', true ) ?: $site_desc;\n\t\t\t\t$title = get_the_title( $desc->id ) ?: $site_desc;\n\t\t\t\t$html .= '<img src=\"' . esc_url(themify_https_esc($desc->src)) . '\" alt=\"' . esc_attr( $alt ) . '\" title=\"' . esc_attr( $title ) . '\">';\n\t\t\t\tif(is_customize_preview()){\n\t\t\t\t $html .= '<span style=\"display: none;\">' . esc_html($site_desc) . '</span>' ;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\t$html .= '<span>' . html_entity_decode($site_desc) . '</span>';\n\t\t\t}\n\t\t\t$html .= ( !empty($desc->link) ) ? '</a>' : '';\n\t\t\treturn $html;\n\t\t}", "public function getMeta(){\n // $this->meta();\n }", "public function getDescription()\n {\n return $this->post->post_content;\n }", "public function setMetaDescription($metaDescription): self\n {\n $this->metaDescription = $metaDescription;\n\n return $this;\n }", "public function setMetaDescription($metaDescription): self\n {\n $this->metaDescription = $metaDescription;\n\n return $this;\n }", "public function description()\n\t{\n\t\t$txt = array();\n\t\t$txt['wiki'] = 'Generates a link to a random page.';\n\t\t$txt['html'] = '<p>Generates a link to a random page.</p>';\n\t\treturn $txt['html'];\n\t}", "protected final function parseMetaComment() {\n\t\t$lines = explode(\"\\n\", $this->file_content);\n\n\t\tif($lines[0] === \"<!--\" || $lines[1] === \"<!--\") {\n\t\t\tarray_shift($lines);\n\t\t\tforeach($lines as $line) {\n\t\t\t\tif(strlen($line) > 0) {\n\t\t\t\t\t$mcline = array_shift($lines);\n\t\t\t\t\tif($mcline === \"-->\") {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$mcfound = preg_match(Application::getMetacommentPreg(), $mcline, $matches);\n\t\t\t\t\t\tif($mcfound != 0) {\n\t\t\t\t\t\t\t$matches[1] = strtolower($matches[1]);\n\t\t\t\t\t\t\t// PHP is rather fussy about booleans, so I needed a conversion function. \n\t\t\t\t\t\t\t// 'true' and 'yes' → true\n\t\t\t\t\t\t\t// 'false' and 'no' → false\n\t\t\t\t\t\t\t$value = Utils::str_to_bool($matches[2]);\n\t\t\t\t\t\t\t$this->pageData[$matches[1]] = $value;\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\t$this->file_content = implode(\"\\n\", $lines);\n\t\t}\n\t\treturn $this->pageData;\n\t}", "public function getPageDescription()\n {\n if ($this->_pageDescription === null) {\n $action = $this->getAction();\n if (method_exists($action, 'label')) /* @var \\Restyii\\Action\\Base $action */\n $this->_pageDescription = $action->label();\n }\n return $this->_pageDescription;\n }", "public static function meta() {\n //echo $this->keywords ? '<meta name=\"keywords\" content=\"'.$this->keywords.'\" />'.\"\\r\\n\" : '';\n\n echo '<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />', \"\\r\\n\";\n\n ksort(self::$css);\n foreach (self::$css as $css_arr) {\n foreach ($css_arr as $css) {\n echo '<link type=\"text/css\" rel=\"stylesheet\" href=\"', $css, '\" />', \"\\r\\n\";\n }\n }\n ksort(self::$js);\n foreach (self::$js as $js_arr) {\n foreach ($js_arr as $js) {\n echo '<script type=\"text/javascript\" src=\"', $js, '\"></script>', \"\\r\\n\";\n }\n }\n }", "function getDescription() {\n\t\tif( !($ret = $this->getField( 'summary' )) ) {\n\t\t\t$ret = $this->getField( 'data' );\n\t\t}\n\t\treturn $ret;\n\t}" ]
[ "0.6822339", "0.6710006", "0.6708061", "0.664036", "0.6541855", "0.6512424", "0.63987523", "0.6394304", "0.63880146", "0.635342", "0.63009965", "0.6257565", "0.61920655", "0.61899346", "0.60884774", "0.6063717", "0.60565317", "0.60435146", "0.6014236", "0.59969735", "0.59719956", "0.59604067", "0.5950121", "0.5946041", "0.58658177", "0.58340055", "0.58224285", "0.58136183", "0.5805937", "0.5788654", "0.57870036", "0.5779089", "0.5733053", "0.572855", "0.57267547", "0.5705039", "0.5705039", "0.5671313", "0.56528866", "0.5652773", "0.5642902", "0.56292546", "0.5624277", "0.56044537", "0.5584767", "0.55830324", "0.55792224", "0.5574022", "0.55726856", "0.55581546", "0.5557996", "0.5552733", "0.55523014", "0.55517095", "0.55129236", "0.5511696", "0.5504703", "0.5504607", "0.55030024", "0.5497762", "0.5489303", "0.5478026", "0.5469877", "0.5469877", "0.5469877", "0.5469877", "0.54651296", "0.54651296", "0.54609776", "0.5458528", "0.54569316", "0.54505914", "0.543961", "0.54067373", "0.5406399", "0.5402712", "0.5402712", "0.5401753", "0.5400802", "0.5398569", "0.5398454", "0.5394702", "0.5388938", "0.53883135", "0.53874046", "0.5383427", "0.5377594", "0.5376692", "0.5373742", "0.53602505", "0.5352556", "0.5342314", "0.5335985", "0.5333034", "0.5333034", "0.532752", "0.5325604", "0.53115565", "0.53059834", "0.5302157" ]
0.7191118
0
Sets the page description meta tag with the given content.
public function setPageDescription($text) { $metaDescription = $this->query('meta[name="description"]')->first(); if ($text === '') { // If empty value passed we need to remove title tag if ($metaDescription) { $this->removeElement($metaDescription); } } else { if ($metaDescription) { $metaDescription->setAttribute('content', $text); } else { // Try to insert meta description tag into head $metaDescription = new Meta('description', $text); $head = $this->query('head'); if ($head->count() > 0) { /* @var Element $head */ $this->appendTo($head->first(), $metaDescription); } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function description(string $content): MetaTag {\n return static::namedContent('description', $content);\n }", "public function setMetaDescriptionAttribute($value)\n {\n $this->attributes['meta_description'] = $value;\n\n if (empty($value)) {\n $this->attributes['meta_description'] = config('settings.meta_description');\n }\n }", "public function setDescription($description) {\n\t\tTemplate::setSiteMetaDescription($description);\n\t}", "public function setDescription($description)\n\t{\n\t\t$this->description = $description;\n\n\t\tif($this->pageInitialized)\n\t\t\t$this->setMetaTag('description', $this->description);\n\t}", "protected function addDescriptionToTlHead($content)\n {\n if ($GLOBALS['TL_HEAD']) {\n foreach ($GLOBALS['TL_HEAD'] as $i => $entry) {\n if (preg_match(\"/description/\", $entry)) {\n unset($GLOBALS['TL_HEAD'][$i]);\n }\n }\n }\n $GLOBALS['TL_HEAD'][] = sprintf('<meta name=\"description\" content=\"%s\">', $content);\n }", "protected function set_meta_desc()\r\r\n {\r\r\n define('_KEYWORDS',_BUY_ONLINE);\r\r\n define('_DESCRIPTION',_BUY_ONLINE);\r\r\n define('_TITLE_PAGE',_BUY_ONLINE);\r\r\n }", "protected function setMeta($title = '', $desc = '', $keywords = '')\n {\n $this->meta['title'] = $title;\n $this->meta['desc'] = $desc;\n $this->meta['keywords'] = $keywords;\n }", "public function setDescription ($value) {\n\t\t$this->setData(\"pageDescription\", $value);\n\t\treturn true;\n\t}", "public static function description($description)\n {\n // Set page description\n self::$data['description'] = $description;\n }", "function writeMetatags($description) {\r\n echo '<meta name=\"author\" content=\"Stephen Wallace\">' . \"\\n\";\r\n echo \"<meta name=\\\"description\\\" content=\\\"$description\\\">\\n\";\r\n}", "function setHeadDescription($var)\n\t{\n\t\t$this -> head_description = $var;\n\t}", "public function addMeta($content, $name = 'description')\n\t{\n\t\t$this->_themeExtras['meta'][$name] = $content;\n\t}", "public function addMetaTag($name,$desc){\n $this->_metaTags[$name] = $desc;\n }", "public function add_meta() {\n\t\techo \"\\n<meta data-plugin='a04_vertical_button' name='description' content='a sample meta description for this website'/>\\n\\n\";\n\t}", "public function setPageDescription($pageDescription)\n {\n $this->_pageDescription = $pageDescription;\n }", "public function AddMeta($name, $content) {\n \t\t$this->_headMeta[$name] = $content;\n \t}", "public function set_description($description) \n\t{\n\t\t$tag = ($this->version == ATOM)? 'summary' : 'description'; \n\t\t$this->add_element($tag, $description);\n\t}", "static public function setDescription($new_description) {\n\t\tself::$page_description = (string)$new_description;\n\t}", "function renderMetadata($content, $configuration) {\n\t\t$this->conf = $configuration;\n\t\t$this->sys_page = t3lib_div::makeInstance('t3lib_pageSelect');\n\t\t$this->sys_page->init($GLOBALS['TSFE']->showHiddenPage);\n\n\t\t$templateLayouts = array (\n\t\t\t'title' => $configuration['layouts.']['title'],\n\t\t\t'description' => $configuration['layouts.']['description'],\n\t\t\t'keywords' => $configuration['layouts.']['keywords']\n\t\t);\n\t\t$a_alternativePageContent = $this->getAlternativePageContent();\n\n\t\t// Set index/follow of page\n\t\t$a_indexFollow = array( 1 => 'noindex, nofollow', 2 => 'index, follow', 3 => 'noindex, follow', 4 => 'index, nofollow' );\n\t\t$GLOBALS['TSFE']->pSetup['meta.']['robots'] = $a_indexFollow[ $a_alternativePageContent['tx_rkmetadata_seo'] ];\n\n\t\t// Get the MetaData (keywords, description || get from rootLine when not available)\n\t\t$this->s_keyWords = $this->cleanForKeywords( $a_alternativePageContent['keywords'] );\n\t\t$this->s_description = $this->cleanForKeywords( $a_alternativePageContent['description'] );\n\n\t\t$this->s_keyWords = $this->replaceDynamicData( $templateLayouts['keywords'] ); // Get the dynamic page keywords\n\t\t$this->s_description = $this->replaceDynamicData( $templateLayouts['description'] ); // Get the dynamic page description\n\t\t$this->s_title = $this->replaceDynamicData( $templateLayouts['title'] ); // Get the dynamic page title\n\n\t\t// Set the MetaData (keywords, description and title)\n\t\t$GLOBALS['TSFE']->pSetup['meta.']['keywords'] = $this->s_keyWords;\n\t\t$GLOBALS['TSFE']->pSetup['meta.']['description'] = $this->s_description;\n\n\t\treturn('<title>'.$this->s_title.'</title>');\n\t}", "protected function _setMetaDescription(array $metaDescription)\n {\n $metaDescription = $this->_insertContent(\n $this->getOriginPageMetaDescription(),\n $metaDescription,\n self::HEADING_DESCRIPTION_SEPARATOR\n );\n $this->category->setData('meta_description', $metaDescription);\n return $this;\n }", "function setDescription( $value )\r\n {\r\n $this->Description = $value;\r\n }", "function setDescription( $value )\r\n {\r\n $this->Description = $value;\r\n }", "protected function setDescription($description) {\r\n $this->description = $description;\r\n }", "public function meta($name = \"\", $content =\"\") {\n echo \"<meta name='\" . $name . \"' content ='\" . $content . \"'>\";\n }", "public function setDescription($desc) {\n\t\t$this->description = $desc;\n\t}", "public function addMeta($name, $content)\n\t{\n\t\t$this->meta[$name] = '<META name=\"' . $name . '\" content=\"'. $content .'\">' . PHP_EOL;\n\t}", "function setDescription($description) {\n\t\t$this->description = $description;\n\t}", "public function setDescription($desc)\n {\n $this->description = $desc;\n }", "public function setDescription($value)\n {\n $this->setItemValue('description', (string)$value);\n }", "public function addContentMeta($name, $value): void\n {\n $this->_content_meta[$name] = $value;\n }", "public function setDescription($description){\n\t\t$this->description = $description;\n\t}", "public function setPageContent(string $content): void {\n\t\t$this->m_pageContent = $content;\n\t}", "function meta($name, $content=\"\") {\n\t\t$this->metas[] = array('name' => $name, 'content' => $content);\n\t}", "function arras_document_description() {\n\tif ( class_exists('All_in_One_SEO_Pack') || class_exists('Platinum_SEO_Pack') ) return false;\n\t\n\tif ( is_single() || is_page() ) {\n\t\tif ( have_posts() ) {\n\t\t\twhile( have_posts() ) {\n\t\t\t\tthe_post();\n\t\t\t\techo '<meta name=\"description\" content=\"' . get_the_excerpt() . '\" />';\n\t\t\t}\n\t\t}\n\t} else {\n\t\techo '<meta name=\"description\" content=\"' . get_bloginfo('description') . '\" />';\n\t}\n}", "public function set_description($desciption){\n\t\t$this->set_channel_element('description', $desciption);\n\t}", "public function SetHeadDescription ($description) {\r\n\t\t$this->head->SetDescription($description);\r\n\t}", "public function setDescription($description)\r\n {\r\n $this->description = $description;\r\n }", "public function setDescription($description) {\n\t\t$this->description = $description;\n\t}", "public function setDescription(?string $value): void {\n $this->getBackingStore()->set('description', $value);\n }", "public function setDescription(?string $value): void {\n $this->getBackingStore()->set('description', $value);\n }", "public function setDescription(?string $value): void {\n $this->getBackingStore()->set('description', $value);\n }", "public function setDescription(?string $value): void {\n $this->getBackingStore()->set('description', $value);\n }", "public function setDescription(?string $value): void {\n $this->getBackingStore()->set('description', $value);\n }", "public function setDescription(?string $value): void {\n $this->getBackingStore()->set('description', $value);\n }", "public function setDescription(?string $value): void {\n $this->getBackingStore()->set('description', $value);\n }", "public function setDescription(?string $value): void {\n $this->getBackingStore()->set('description', $value);\n }", "protected function addMetaInformation( $description, $thumb ) {\n\t\t$out = $this->getOutput();\n\t\t$out->addHeadItem( 'description',\n\t\t\tHtml::element(\n\t\t\t\t'meta', [\n\t\t\t\t\t'name' => 'description',\n\t\t\t\t\t'content' => $description,\n\t\t\t\t]\n\t\t\t)\n\t\t);\n\t\tif ( $thumb ) {\n\t\t\t$out->addHeadItem(\n\t\t\t\t'ogimage',\n\t\t\t\tHtml::element(\n\t\t\t\t\t'meta',\n\t\t\t\t\t[\n\t\t\t\t\t\t'property' => 'og:image',\n\t\t\t\t\t\t'content' => wfExpandUrl( $thumb->getUrl(), PROTO_CURRENT ),\n\t\t\t\t\t]\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t}", "function onPrepareContent(&$article){\n\t\t$doc =& JFactory::getDocument();\n\t\t$plugin = & JPluginHelper::getPlugin('content', 'autometadescription');\n\t\t// Load plugin params info\n\t\t$pluginParams = new JParameter($plugin->params);\n\t\t$blacklist = explode('|',$pluginParams->def('blacklist'));\n\n\t\t$shortintro = shortIntro($article->introtext,$blacklist);\n\t\tif($article->metadesc == ''){\n\t\t\t $doc->setDescription( $shortintro ); \t\n\t\t\t}\n\t\t}", "public function set_metadata( $name, $content, $type = 'meta' ) {\n $name = htmlspecialchars( strip_tags( $name ) );\n $content = htmlspecialchars( strip_tags( $content ) );\n\n // Keywords with no comments? ARG! comment them\n if ( $name == 'keywords' AND ! strpos( $content, ',' ) ) {\n $content = preg_replace( '/[\\s]+/', ', ', trim( $content ) );\n }\n\n switch ( $type ) {\n case 'meta':\n $this->_metadata[ $name ] = '<meta name=\"' . $name . '\" content=\"' . $content . '\" />';\n break;\n\n case 'link':\n $this->_metadata[ $content ] = '<link rel=\"' . $name . '\" href=\"' . $content . '\" />';\n break;\n }\n\n return $this;\n }", "public function setDescription(string $description)\n {\n $this->description = $description;\n }", "public function setDescription($description) {\n $this->description = $description;\n }", "public function testDescription()\n {\n $description_original = \"This is the original \\\"description\\\".\";\n $description_received =\n MetaTags::setDescription($description_original,0)\n ->getDescription();\n\n // Make sure what we got back is what we put in. (not truncated)\n $this->assertEquals(\n $description_original,\n $description_received,\"The original description was not a match\"\n );\n\n // Do the same test, but with truncation turned on.\n $description_received =\n MetaTags::setDescription($description_original,10)\n ->getDescription();\n\n // Test to make sure truncation is working.\n $this->assertEquals(\n $description_received,\n MetaTags::truncateAtWord($description_original,10)\n );\n\n $tag_text = MetaTags::renderDescription(true)->__toString();\n $this->assertStringStartsWith(\"<meta \",$tag_text);\n $this->assertStringEndsWith(\">\",$tag_text);\n }", "public function setMetaDescription($metaDescription): self\n {\n $this->metaDescription = $metaDescription;\n\n return $this;\n }", "public function setMetaDescription($metaDescription): self\n {\n $this->metaDescription = $metaDescription;\n\n return $this;\n }", "public function setDescription($description)\n {\n $this->_description = $description;\n }", "function bajweb_custom_meta_des(){\n if( is_single() ) {\n $des = get_post_meta( get_the_id(), 'description', true );\n if( ! empty( $des ) ){\n $des = esc_html( $des );\n echo \"<meta name='description' content='$des'>\";\n }\n }\n}", "public function setSetDescription($description) {\r\n\t\t$this -> setdescription = $description;\r\n\t}", "public function setDescription( $description )\r\n\t{\r\n\t\t$this->description = $description;\r\n\t}", "public function setDescription($description)\n {\n $this->description = $description;\n }", "public function setDescription($description)\n {\n $this->description = $description;\n }", "public function setDescription($description)\n {\n $this->description = $description;\n }", "public function setDescription($description)\n {\n $this->description = $description;\n }", "public function setDescription($description)\n {\n $this->description = $description;\n }", "public function setDescription($description)\n {\n $this->description = $description;\n }", "public function setDescription($description)\n {\n $this->description = $description;\n }", "public function setDescription($description)\n {\n $this->description = $description;\n }", "public function setDescription($description)\n {\n $this->description = $description;\n }", "public function setDescription($description)\n {\n $this->description = $description;\n }", "public function setDescription($description)\n {\n $this->description = $description;\n }", "public function setDescription($description)\n {\n $this->description = $description;\n }", "public function setDescription($description)\n {\n $this->description = $description;\n }", "protected function setDescription() {\r\n\t\t$descriptionCrop = intval($this->settings['news']['semantic']['general']['description']['crop']);\r\n\t\t$descriptionAction = $this->settings['news']['semantic']['general']['description']['action'];\r\n\t\t$descriptionText = $this->newsItem->getTeaser();\r\n\t\tif (empty($descriptionText)) {\r\n\t\t\t$descriptionText = $this->newsItem->getBodytext();\r\n\t\t}\r\n\t\tif (!empty($descriptionText) && !empty($descriptionAction)) {\r\n\t\t\tif (!empty($GLOBALS['TSFE']->page['description'])) {\r\n\t\t\t\tswitch ($descriptionAction) {\r\n\t\t\t\t\tcase 'prepend':\r\n\t\t\t\t\t\t$descriptionText .= ': ' . $GLOBALS['TSFE']->page['description'];\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase 'append':\r\n\t\t\t\t\t\t$descriptionText = $GLOBALS['TSFE']->page['description'] . ': ' . $descriptionText;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t$this->description = $this->contentObject->crop($descriptionText, $descriptionCrop . '|...|' . TRUE);\r\n\t\t}\r\n\t}", "public function setDescription($description) {\n $this->_description = $description;\n }", "public static function meta($name, $content)\n {\n return static::tag('meta', null, array('name' => $name, 'content' => $content));\n }", "public function setDescription($description)\n {\n $this->_description = $description;\n }", "public function setDescription($description)\n\t{\n\t\t$this->_description = $description;\n\t}", "public function setDescriptionAttribute($value)\n {\n $this->attributes['description'] = htmlentities($value, ENT_COMPAT, 'UTF-8');\n }", "public function setDescription($description) \n\t{\n \n $this->description = empty($description) ? \"\" : $description;\t\n\t}", "public function setDescription($description);", "public function setDescription($description);", "public function setDescription($description);", "public function setDescription($description);", "public function setDescription($description);", "public function setDescription($description);", "public function setContent( string $content ) : void\n {\n $this->content = $content;\n }", "public function setDescription(string $description)\n {\n $this->description = $description;\n }", "public function setMetaTags($seo)\n {\n $this->pageTitle = $seo->title;\n $this->keywords = $seo->keywords;\n $this->description = $seo->description;\n }", "public function setDescription(?string $description): void\n {\n $this->description['value'] = $description;\n }", "public \tfunction\tmeta($content, $file) {\n\t\t\t//Ensure that this is loaded only for this plugin. \n\t\t\tif ($file == plugin_basename(__FILE__)) {\n\t\t\t\t//Append HTML content to the metadata. \n\t\t\t\t$content[]\t=\tsprintf('<a href=\"%s\" target=\"_blank\">%s</a>', \n\t\t\t\t\t\t\"options-general.php?page=FrozenPlugin-settings\", \n\t\t\t\t\t\t__('Plugin Settings'));\n\t\t\t\t$content[]\t=\tsprintf('<a href=\"%s\" target=\"_blank\">%s</a>', \n\t\t\t\t\t\t\"https://github.com/mookman288/FrozenPlugin\", \n\t\t\t\t\t\t__('Author'));\n\t\t\t}\n\t\t\n\t\t\t//Return content.\n\t\t\treturn $content;\n\t\t}", "public function setDesciption($description);", "public function render($name, $content) {\n $tag = \"<meta name=\\\"$name\\\" content=\\\"$content\\\" >\";\n\n $this->addPageHeader($tag, md5(\"meta.$name\"));\n }", "public function setMeta($strName, $strContent) {\n\t\t\t$this->arMeta[$strName] = $strContent; \n\t\t}", "public function set_description ($description) {\n $this->description = $description;\n }", "public function setContent( string $content );", "public function setDescription($description) {\n\t\t$this->addChannelTag('description', $description);\n\t}", "function wpcom_vip_meta_desc() {\n _deprecated_function( __FUNCTION__, '2.0.0' );\n\n $text = wpcom_vip_get_meta_desc();\n if ( !empty( $text ) ) {\n echo \"\\n<meta name=\\\"description\\\" content=\\\"$text\\\" />\\n\";\n }\n}", "public function add_meta_content(Array $parameters = array()){\n $this->metatags[] = $parameters;\n }", "public function setDesc($val){ return $this->setField('desc',$val); }", "public function setDescription($value)\n {\n return $this->set('Description', $value);\n }", "public function setDescription($value)\n {\n return $this->set('Description', $value);\n }" ]
[ "0.7295828", "0.7261422", "0.72327876", "0.7122621", "0.6840984", "0.67465454", "0.67297256", "0.6700923", "0.66913474", "0.66386557", "0.6572405", "0.6570796", "0.6557805", "0.6545076", "0.6531342", "0.6482197", "0.6467233", "0.64413965", "0.63923985", "0.63854766", "0.6370143", "0.6370143", "0.63698596", "0.63688827", "0.63625836", "0.63121265", "0.63074017", "0.6302475", "0.6291149", "0.62496394", "0.62465334", "0.6239271", "0.62207717", "0.6186334", "0.61844605", "0.6156329", "0.61494505", "0.61476344", "0.6137202", "0.6137202", "0.6137202", "0.6137202", "0.6137202", "0.6137202", "0.6137202", "0.6137202", "0.6136332", "0.61306363", "0.61278456", "0.61229587", "0.61195284", "0.61108583", "0.6095972", "0.6095972", "0.60908145", "0.6082715", "0.60798514", "0.6079093", "0.60718703", "0.60718703", "0.60718703", "0.60718703", "0.60718703", "0.60718703", "0.60718703", "0.60718703", "0.60718703", "0.60718703", "0.60718703", "0.60718703", "0.60718703", "0.6061033", "0.6040052", "0.6034309", "0.6032766", "0.6023754", "0.6016789", "0.5996782", "0.5990904", "0.5990904", "0.5990904", "0.5990904", "0.5990904", "0.5990904", "0.5979995", "0.5979514", "0.5969722", "0.5967477", "0.5957747", "0.5956716", "0.5941048", "0.59273946", "0.59100807", "0.5906571", "0.5905148", "0.59049845", "0.5904785", "0.5904745", "0.589685", "0.589685" ]
0.80547327
0
Sets a new paymentAmount Amount for each mean of payment. &lt;xs:element name="PaymentAmount" type="SAFmonetaryType"/&gt;
public function setPaymentAmount(float $paymentAmount): bool { if ($paymentAmount < 0.0) { $msg = "PaymentAmount can not be negative"; \Logger::getLogger(\get_class($this)) ->error(\sprintf(__METHOD__." '%s'", $msg)); $return = false; $this->getErrorRegistor()->addOnSetValue("PaymentAmount_not_valid"); } else { $return = true; } $this->paymentAmount = $paymentAmount; \Logger::getLogger(\get_class($this)) ->debug( \sprintf( __METHOD__." set to '%s'", \strval($this->paymentAmount) ) ); return $return; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setAmount($amount)\n {\n $this->amount = $amount;\n }", "public function setAmount($amount)\n {\n $this->amount = $amount;\n }", "public function setPaymentAmountType($value)\n {\n $this->_fields['PaymentAmountType']['FieldValue'] = $value;\n return $this;\n }", "public function setAmount($amount){\n\n $this->amount = $amount;\n\n }", "public function setAmount($amount);", "public function setAmount($amount = 0, $wholeAmt) {\n $amt = array(\n 'x_amount'=>$this->cleanAmt($amount, $wholeAmt),\n );\n $this->NVP = array_merge($this->NVP, $amt); \n }", "public function setTransactionAmount($value) \n {\n $this->_fields['TransactionAmount']['FieldValue'] = $value;\n return;\n }", "public function setTaxAmount($amount);", "protected function setAmount()\n {\n if ( ! isset( $_POST['amount'] ) ) {\n $this->error = true;\n $this->data['error']['amount'] = 'Please enter a donation amount.';\n return;\n }\n \n $amount = trim( $_POST['amount'] );\n\n // Remove illegal characters\n $regex = '/[[^0-9.]]/';\n $value = preg_replace( $regex, '', $amount );\n \n \tif ( $value && is_numeric( $value ) && $value > 0 ) {\n $value = floor( $value * 100 ); // Set the amount in cents.\n \t\t$this->data['amount'] = $value;\n \t} else {\n \t\t$this->data['amount'] = 0;\n \t}\n }", "public function setBaseTaxAmount($amount);", "public function setAmountTotal($amountTotal)\n {\n $this->amountTotal = (float) $amountTotal;\n }", "public function setAmount($value) \n {\n $this->_fields['Amount']['FieldValue'] = $value;\n return $this;\n }", "private function setTotalAmounts()\n {\n $taxable\t= 0.00;\n $expenses = 0.00;\n $outlays\t= 0.00;\n\n foreach ($this->invoiceDetails as $invoiceDetail) {\n $amount = $invoiceDetail->getAmount();\n switch ($invoiceDetail->getType())\n {\n case 'incoming':\n $taxable += $amount;\n break;\n case 'expense':\n $taxable += $amount;\n $expenses += $amount;\n break;\n case 'outlay':\n $outlays += $amount;\n break;\n }\n }\n\n $this->setTotalTaxable($taxable);\n $this->setTotalExpenses($expenses);\n $this->setTotalOutlays($outlays);\n }", "public function withPaymentAmountType($value)\n {\n $this->setPaymentAmountType($value);\n return $this;\n }", "public function setAmount($balance)\n {\n $this->amount = (int) $balance;\n }", "public function setAmount($amount)\n {\n return $this->setData(self::AMOUNT, $amount);\n }", "public function setAmount($value)\n\t{\n\t\treturn $this->set('Amount', $value);\n\t}", "public function setAmount($value)\n {\n $this->_fields['Amount']['FieldValue'] = $value;\n return $this;\n }", "public function setAmount()\n {\n $exact = $this->getOriginalPurgeValue('amount_exact');\n $percentage = $this->getOriginalPurgeValue('amount_percentage');\n\n $this->amount = $this->is_percentage\n ? $percentage\n : $exact;\n }", "public function setPaymentAuthorizationAmount($amount);", "public function setAmount($amount)\n {\n $this->amount = Checker::int($amount, self::AMOUNT_MIN, self::AMOUNT_MAX, \"amount\");\n }", "public function setAmount($var)\n {\n GPBUtil::checkFloat($var);\n $this->amount = $var;\n\n return $this;\n }", "public function add(float $amount)\n {\n $this->balance += $amount;\n }", "public function setBaseAmount($amount) {\r\n $this->baseAmount = NumberDataTypeHelper::truncate(floatval($amount), 2);\r\n }", "public function setBaseDiscountTaxCompensationAmount($amount);", "public function setTaxAmount($amount) {\r\n $this->taxAmount = NumberDataTypeHelper::truncate(floatval($amount), 2);\r\n }", "public function Amount() {\n\t\t// TODO: Multi currency\n\t\t$shopConfig = ShopConfig::current_shop_config();\n\n\t\t$amount = Price::create();\n\t\t$price = $this->OnSpecial() ? $this->SpecialPrice : $this->Price;\n\t\t$amount->setAmount($price);\n\t\t$amount->setCurrency($shopConfig->BaseCurrency);\n\t\t$amount->setSymbol($shopConfig->BaseCurrencySymbol);\n\n\t\t// Transform amount for applying discounts etc.\n\t\t$this->extend('updateAmount', $amount);\n\n\t\treturn $amount;\n\t}", "public function amount($amount = null)\n {\n return new Amount([\"amount\" => $amount ?: $this->getAttribute(\"amount\")]);\n }", "public function setBaseDiscountAmount($amount);", "public function addBaseItemDiscountAmount($amount)\n {\n $this->baseItemDiscountAmount +=$amount;\n }", "public function set_amountInvoice($amountInvoice) {\n $this->amountInvoice = (double)$amountInvoice;\n }", "public function getPaymentAmountType()\n {\n return $this->_fields['PaymentAmountType']['FieldValue'];\n }", "public function amount($value) {\n $this->annotations['amount'] = $value;\n return $this;\n }", "public function set_amountCustomer($amountCustomer) {\n $this->amountCustomer = (double)$amountCustomer;\n }", "public function setUnitAmount(float $unit_amount): void\n {\n $this->_unit_amount = $unit_amount;\n }", "public function set_total_outstanding_amount( $value ) {\n\t\tif ( ! is_numeric( $value ) ) {\n\t\t\tthrow new Exception( esc_html__( 'Invalid total outstanding amount.', 'credits-for-woocommerce' ) ) ;\n\t\t}\n\n\t\t$this->set_prop( 'total_outstanding_amount', wc_format_decimal( $value ) ) ;\n\t}", "public function setDiscountTaxCompensationAmount($amount);", "public function setAmount(\\horstoeko\\ubl\\entities\\cbc\\Amount $amount)\n {\n $this->amount = $amount;\n return $this;\n }", "function deposit($amount) {\n $this->balance += $amount;\n }", "public function setPayment($value) {\n $this->payment = $value;\n }", "public function setBaseShippingTaxAmount($amount);", "public function update($amount)\n {\n $currentBalance = auth()->user()->balance->amount;\n $newAmount = $currentBalance + $amount;\n auth()->user()->balance()->update(['amount' => $newAmount]);\n }", "public function getPaymentMeans()\n {\n return $this->paymentMeans;\n }", "private function _addAmountElement($order)\n {\n $amountElement = $order->addChild('amount');\n $amountElement['currencyCode'] = $this->currencyCode;\n $amountElement['exponent'] = self::EXPONENT;\n $amountElement['value'] = $this->_amountAsInt($this->amount);\n }", "public function deposit($amount)\n {\n $this->balance += $amount;\n $this->save();\n }", "public function setPerPersonTotalTaxAmount(float $value): self\n {\n $this->PerPersonTotalTaxAmount = $value;\n\n return $this;\n }", "public function setBaseShippingAmount($amount);", "public function setPayments($payments)\n {\n $this->payments = $payments;\n }", "public function setChargesAttribute($amount)\n {\n $this->attributes['charges'] = formatAmount($amount);\n }", "public function Amount($amount) {\n\t\t$this->Param('amount', $amount);\n\n\t\treturn true;\n\t}", "public function Amount($amount) {\n\t\t$this->Param('amount', $amount);\n\n\t\treturn true;\n\t}", "public function setBaseGrandTotal($amount);", "public function setBaseSubtotal($amount);", "public function getPaymentAmount()\n {\n return $this->bonus + parent::getSalary();\n }", "public function setPayment($payment);", "public function addItemDiscountAmount($amount)\n {\n $this->itemDiscountAmount += $amount;\n }", "public function setShippingTaxAmount($amount);", "protected function setSettlementAmount(array $data)\n {\n $this->settlementAmount = CurrencyAndAmount::fromArray($data);\n }", "public function setAmount($amount)\n {\n $this->amount = $amount;\n\n return $this;\n }", "private function multiplySumByDecimalFactor($orderAmount)\n {\n return $orderAmount * Mage::helper('multiplysum')->getDecimalFactor();\n }", "public function setAmount(Amount $amount)\n {\n $this->amount = $amount;\n return $this;\n }", "public function setPerPersonTotalTaxCurrency(string $value): self\n {\n $this->PerPersonTotalTaxCurrency = $value;\n\n return $this;\n }", "public function setAmount($var)\n {\n GPBUtil::checkString($var, True);\n $this->amount = $var;\n\n return $this;\n }", "public function setAmount($value)\n {\n return $this->set(self::_AMOUNT, $value);\n }", "function total_amount($amount){\n\t\t$price = 0.0;\n\t\tif(is_array($amount)){\n\t\t \tforeach($amount as $idod ){\n\t\t \t\t$amt = getamount($idod);\n\t\t \t\tif($amt){\n\t\t \t\t\t$price += $amt;\n\t\t \t\t}\n\t\t \t}\n\t\t}\n\t\treturn $price;\n\t}", "public function setAmount($value)\n {\n return $this->set(self::_AMOUNT, $value);\n }", "public function setAmount($value)\n {\n return $this->set(self::_AMOUNT, $value);\n }", "public function setAmount($value)\n {\n return $this->set(self::_AMOUNT, $value);\n }", "public function setAmount($value)\n {\n return $this->set(self::_AMOUNT, $value);\n }", "public function setAmountMoney(Money $amountMoney): void\n {\n $this->amountMoney = $amountMoney;\n }", "private function _setTotalAmt(string $currency, float $operationAmt): float\n {\n return\n $this->_currencyConversion($operationAmt, $currency);\n }", "public function setAmountArticle($amountArticle){\n $this->amountArticle = $amountArticle;\n }", "public function setAmount($amount)\n {\n $this->_amount = $amount;\n return $this;\n }", "private function _getTotalAmount($payments) {\n $totalAmount = 0;\n foreach($payments as $payment)\n $totalAmount += $payment['payable'];\n\n return $totalAmount;\n }", "public function addBaseShippingDiscountAmount($amount)\n {\n $this->baseShippingDiscountAmount +=$amount;\n }", "public function setAmount($amount)\r\n {\r\n $this->amount = $amount;\r\n\r\n return $this;\r\n }", "public function setShippingDiscountTaxCompensationAmount($amount);", "public function addPayment(Money $payment)\n {\n $paidAmount = $this->getAmountPaid()->add($payment);\n\n $this->paidAmount = $paidAmount->getAmount();\n\n if ($this->paidAmount > $this->price) {\n $this->paid();\n }\n }", "protected function amount($amount)\n {\n return $this->setAmount($amount);\n }", "public function setBaseShippingInclTax($amount);", "public function setDiscountAmount($amount);", "public function setAmount($amount)\n {\n $this->amount = $amount;\n return $this;\n }", "public function setAmount($amount)\n {\n $this->amount = $amount;\n return $this;\n }", "public function setAmount($amount)\n {\n $this->amount = $amount;\n return $this;\n }", "public function setAmount($amount)\n {\n $this->amount = $amount;\n return $this;\n }", "public function getAmount() \n {\n return $this->_fields['Amount']['FieldValue'];\n }", "public function setShippingInclTax($amount);", "public function getAmount() {\n return $this->attributes['amount'];\n }", "public function setAmount($amount)\n {\n $this->_amount = (int) $amount;\n return $this;\n }", "public function setFreeAfterAmountAttribute($amount)\n {\n $this->attributes['free_after_amount'] = formatAmount($amount);\n }", "public function setAmount($amount)\n {\n $amount = floatval(str_replace(' ','',$amount));\n\n if (!Amount::validate($amount)) {\n throw new AmountException($amount);\n }\n $this->amount = $amount;\n\n return $this;\n }", "public function setBaseShippingDiscountAmount($amount);", "public function setSubtotal($amount);", "public function setPaymentType($payment_type){\n $this->payment_type = $payment_type;\n }", "public function setAmount(Money $amount) {\n\t\t$this->amount = $amount;\n\t\treturn $this;\n\t}", "public function addPayment($payment)\n {\n $this->payments[$payment->getVendorTxCode()] = $payment;\n }", "private function parseAmountCryptoForSave($payments) {\n $current_sale_amount = 0;\n foreach ($payments as $payment) {\n if (!$payment->is_sale) {\n $crypto = $this->cryptoRepository->getCryptoInformation($payment->cour->crypto_id);\n $current_sale_amount += round(($payment->quantity * $crypto->current_cour), 2);\n }\n }\n return $current_sale_amount;\n }", "public function setAmount($amount)\n {\n if ($amount instanceof DBMoney) {\n $this->setField('Money', $amount);\n } elseif ($this->Status == 'Created' && is_numeric($amount)) {\n $this->MoneyAmount = $amount;\n }\n return $this;\n }", "public function testTotalAmountCalculation(): void\n {\n $order = new Order('consumerIdTest123', '845126849', new \\DateTimeImmutable('midnight'), 'OrderNumber123', 7);\n $order->addOrderLine('productIdTest1', 2, 4.9);\n $order->addOrderLine('productIdTest2', 3, 10.5);\n\n static::assertEquals(41.3, $order->getAmount());\n }", "protected function setTotalAmount($value, $type)\n\t{\n\t\t$this->setNumbersFont(10);\n\t\tif ($type == TypeEnum::A){\n\t\t\tfor($i=0;$i<$this->copies;$i++){\n\t\t\t\t$this->_getPdf()->pages[$i]->drawText($this->asMonospacedNumber($value,11), 498, 86, 'UTF-8');\n\t\t\t}\n\t\t}else{\n\t\t\tfor($i=0;$i<$this->copies;$i++){\n\t\t\t\t$this->_getPdf()->pages[$i]->drawText($this->asMonospacedNumber($value,11), 498, 89, 'UTF-8');\n\t\t\t}\t\t\t\t\n\t\t}\n\t}" ]
[ "0.63957715", "0.63957715", "0.63502824", "0.6331521", "0.6212733", "0.61249375", "0.609537", "0.5909582", "0.59042656", "0.5877619", "0.5846902", "0.58461976", "0.58394456", "0.5813733", "0.57830745", "0.575758", "0.5682938", "0.5673642", "0.5658647", "0.5656488", "0.5646351", "0.5633462", "0.56119525", "0.558875", "0.5580727", "0.5579773", "0.55705357", "0.5554433", "0.5499607", "0.54955107", "0.54955053", "0.54705465", "0.54648453", "0.5447579", "0.5442524", "0.54417825", "0.54374456", "0.54317904", "0.5429158", "0.54143494", "0.54105884", "0.53982997", "0.5376011", "0.53663146", "0.5356661", "0.53302103", "0.5324395", "0.53231144", "0.5320224", "0.5294759", "0.5294759", "0.528538", "0.527717", "0.5276116", "0.52724355", "0.52705175", "0.52686685", "0.5267651", "0.5261068", "0.5256883", "0.52562046", "0.5228965", "0.522635", "0.5217747", "0.52176046", "0.5217097", "0.5217097", "0.5217097", "0.5217097", "0.5210957", "0.5208629", "0.5200627", "0.5184258", "0.517864", "0.5168453", "0.51638514", "0.5161785", "0.5159733", "0.51458675", "0.5134731", "0.51301503", "0.5126929", "0.5126929", "0.5126929", "0.5126929", "0.5124978", "0.5123403", "0.51198953", "0.511791", "0.5114939", "0.51120514", "0.51070535", "0.5102219", "0.5090076", "0.5082407", "0.50652325", "0.5050502", "0.50461966", "0.50380003", "0.50332516" ]
0.5570418
27
Get if is set paymentAmount
public function issetPaymentAmount(): bool { return isset($this->paymentAmount); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getTotalPayment()\n\t{\n\t\treturn $this->total_payment;\n\t}", "public function getamount()\n {\n return $this->amount;\n }", "public function getPayment()\n {\n return $this->payment;\n }", "public function getPayment()\n {\n return $this->payment;\n }", "public function getPayment()\n {\n return $this->payment;\n }", "public function getAmount()\n\t{\n\t\treturn Config::get('paypal.amount');\n\t}", "public function getAmount()\r\n {\r\n return $this->amount;\r\n }", "public function getAmount()\r\n {\r\n return $this->amount;\r\n }", "public function getAmount()\r\n {\r\n return $this->amount;\r\n }", "public function getAmount()\r\n {\r\n return $this->amount;\r\n }", "public function getAmount()\n {\n return $this->amount;\n }", "public function getAmount()\n {\n return $this->amount;\n }", "public function getAmount()\n {\n return $this->amount;\n }", "public function getAmount()\n {\n return $this->amount;\n }", "public function getAmount()\n {\n return $this->amount;\n }", "public function getAmount()\n {\n return $this->amount;\n }", "public function getAmount()\n {\n return $this->amount;\n }", "public function getAmount()\n {\n return $this->amount;\n }", "public function getAmount()\n {\n return $this->amount;\n }", "public function getAmount()\n {\n return $this->amount;\n }", "public function getAmount()\n {\n return $this->amount;\n }", "public function getAmount()\n {\n return $this->amount;\n }", "public function getAmount()\n {\n return $this->amount;\n }", "public function getAmount()\n {\n return $this->amount;\n }", "public function getAmount()\n {\n return $this->amount;\n }", "public function getAmount()\n {\n return $this->amount;\n }", "public function getAmount()\n {\n return $this->amount;\n }", "public function getPaymentAmount()\n {\n return $this->bonus + parent::getSalary();\n }", "public function getPaymentAmountType()\n {\n return $this->_fields['PaymentAmountType']['FieldValue'];\n }", "public function getPaymentAuthorizationAmount();", "public function getAmount()\n {\n return $this->_amount;\n }", "public function getAmount()\n {\n return $this->_amount;\n }", "protected function getPayment()\n {\n return $this->getOrder()->getPayment();\n }", "public function getAmount()\n\t{\n\t\treturn $this->amount;\n\t}", "public function getAmount();", "public function getAmount();", "public function getAmount();", "public function getAmount();", "public function getAmount() \n {\n return $this->_fields['Amount']['FieldValue'];\n }", "public function getLastpaymentamount()\n {\n return $this->lastpaymentamount;\n }", "public function getAmount()\n {\n return $this->_fields['Amount']['FieldValue'];\n }", "public function amount() {\r\n\t\treturn $this->amount;\r\n\t}", "public function getAmount()\n {\n return $this->MoneyAmount;\n }", "public function getAmount() {\n return $this->attributes['amount'];\n }", "public function getAmount()\n\t{\n\t\treturn $this->get('Amount');\n\t}", "public function getAmount(): Money\n {\n return $this->amount;\n }", "public function getStatusPayment()\r\n {\r\n return $this->statusPayment;\r\n }", "public function getAmtPaid()\n {\n return $this->amt_paid;\n }", "public function getAmount()\n {\n return $this->get(self::_AMOUNT);\n }", "public function getAmount()\n {\n return $this->get(self::_AMOUNT);\n }", "public function getAmount()\n {\n return $this->get(self::_AMOUNT);\n }", "public function getAmount()\n {\n return $this->get(self::_AMOUNT);\n }", "public function getAmount()\n {\n return $this->get(self::_AMOUNT);\n }", "public function getAmount()\r\n\t{\r\n\t\treturn $this->getTransaction()->getAmount();\r\n\t}", "public function getAmount(): string\n {\n return $this->amount;\n }", "public function getAmountPaid()\n {\n return $this->amountPaid instanceof TypedMoneyBuilder ? $this->amountPaid->build() : $this->amountPaid;\n }", "public function getTransactionAmount() \n {\n return $this->_fields['TransactionAmount']['FieldValue'];\n }", "public function getPaymentPrice() {\r\n\r\n\t\tself::errorReset();\r\n\t\t$this->reload();\r\n\t\treturn $this->paymentPrice;\r\n\t}", "public function getAmount()\n {\n return $this->getData(self::AMOUNT);\n }", "public function getAmount(): int\n {\n return $this->amount;\n }", "public function getAmountPaid()\n {\n $amountPaid = 0;\n if ($this->payments) {\n foreach ($this->payments as $payment) {\n if ($payment->getStatus() == 'OK') {\n $amountPaid = $amountPaid + $payment->getAmount();\n }\n }\n }\n return $amountPaid;\n }", "public function getDepositAmount(){\n return $this->getParameter('deposit_amount');\n }", "public function getDepositAmount()\n {\n return $this->depositAmount;\n }", "public function getAmount(): ?int;", "public function getPaymentid()\r\n {\r\n return $this->paymentid;\r\n }", "public function getAmountMoney(): Money\n {\n return $this->amountMoney;\n }", "public function getAmount(): string;", "public function getTransactionAmount()\n {\n return $this->transactionAmount;\n }", "public function getAmount(): float\n {\n return $this->_amount;\n }", "private function getPayum()\n {\n return $this->get('payum');\n }", "public function getPaymentReceived()\n {\n return $this->payment_received;\n }", "public function getBaseAmount()\n {\n return $this->amount;\n }", "public function hasAmount()\n {\n return isset($this->amount);\n }", "public function getCashPaymentMoney(): ?Money\n {\n return $this->cashPaymentMoney;\n }", "public function getAmount(): float;", "public function getPaymentId()\n {\n return $this->paymentId;\n }", "public function getAmountArticle(){\n return $this->amountArticle;\n }", "function get_transaction_amount()\n {\n // payment_gross depreciated: https://www.x.com/message/168279;jsessionid=194758CBB355AB9E942D506519951253.node0\n //return $this->platnosci_post_vars['payment_gross'];\n return $this->platnosci_post_vars['mc_gross'];\n }", "public function amount(): float\n {\n return $this->amount;\n }", "public function getBaseAmount() {\r\n return $this->baseAmount;\r\n }", "public function isSetAmount()\n {\n return !is_null($this->_fields['Amount']['FieldValue']);\n }", "public function isSetAmount()\n {\n return !is_null($this->_fields['Amount']['FieldValue']);\n }", "public function getSum()\n {\n return $this->amount;\n }", "public function getPaidValue()\n {\n return defined('static::PAID_VALUE') ? static::PAID_VALUE : 'paid';\n }", "public function get_amountInvoice() {\n return $this->amountInvoice;\n }", "public function isSetPaymentAmountType()\n {\n return !is_null($this->_fields['PaymentAmountType']['FieldValue']);\n }", "private function _calculatePaymentFee(): int\n {\n $paymentFee = 0;\n if ($this->paymentMethod === 'paypal' && $_COOKIE['currency'] == 'EUR') {\n $paymentFee = 45;\n }\n\n return $paymentFee;\n }", "public function get_donated_amount() {\r\n\t\tif ( ! isset( $this->donated_amount ) || is_null( $this->donated_amount ) ) {\r\n\r\n\t\t\t/**\r\n\t\t\t * Try to fetch from cache first. \r\n\t\t\t */\r\n\t\t\t$this->donated_amount = get_transient( $this->get_donations_cache_key( $this->ID ) . '_amount' );\r\n\r\n\t\t\tif ( $this->donated_amount === false ) {\r\n\t\t\t\t$this->donated_amount = charitable()->get_db_table('campaign_donations')->get_campaign_donated_amount( $this->ID );\r\n\r\n\t\t\t\tset_transient( $this->get_donations_cache_key( $this->ID ) . '_amount', $this->donated_amount, 0 );\r\n\t\t\t}\t\t\t\r\n\t\t}\r\n\r\n\t\treturn $this->donated_amount;\r\n\t}", "public function getReceivableAmount()\n {\n return $this->receivable_amount;\n }", "public function get_amountCustomer() {\n return $this->amountCustomer;\n }", "public function hasAmount(): bool\n {\n return isset($this->amount);\n }", "public function getMicroPaymentPayabale()\r\n {\r\n /**\r\n * if\r\n */\r\n }", "abstract public function getPaymentConfig($payment);", "private function _getTotalAmount($payments) {\n $totalAmount = 0;\n foreach($payments as $payment)\n $totalAmount += $payment['payable'];\n\n return $totalAmount;\n }", "public function getPayment() {\n return $this->request(\n \"GET\",\n \"/shops/{$this->shop_id}/receipts/{$this->receipt_id}/payments\",\n \"Payment\"\n )\n ->first();\n }", "public function setPayment($payment);", "function get_payment_status()\n {\n return $this->platnosci_post_vars['payment_status'];\n }", "public function getTotalAmount();", "public function total_amount()\n {\n $total_price = DB::table('payment_details')\n ->select(DB::raw('SUM(received_amount) as taka'))\n ->get();\n return $total_price;\n }", "public function getPrice($amount){\r\n\t\t$tmp_perso = new Personalization($this->persoID);\r\n\t\t$tmp_price = $tmp_perso->getPrice($amount);\r\n\t\treturn $tmp_price;\r\n\t}" ]
[ "0.69099814", "0.68800545", "0.6864911", "0.6864911", "0.6864911", "0.6817689", "0.6771128", "0.6771128", "0.6771128", "0.6771128", "0.67533517", "0.67407644", "0.67407644", "0.67407644", "0.67407644", "0.67407644", "0.67407644", "0.67407644", "0.67407644", "0.67407644", "0.67407644", "0.67407644", "0.67407644", "0.67407644", "0.67407644", "0.67407644", "0.67407644", "0.6714508", "0.6694906", "0.6676104", "0.66479385", "0.66479385", "0.6641377", "0.6640269", "0.65837497", "0.65837497", "0.65837497", "0.65837497", "0.6581451", "0.6550599", "0.6514204", "0.65019315", "0.6478517", "0.64600545", "0.64416826", "0.64196587", "0.6390175", "0.6388615", "0.6359203", "0.6359203", "0.6359203", "0.6359203", "0.6359203", "0.6356801", "0.63163", "0.6314424", "0.6221661", "0.6203394", "0.6202521", "0.61941767", "0.6171912", "0.6152097", "0.6148391", "0.6117296", "0.6095089", "0.60782003", "0.60767484", "0.60757107", "0.60701555", "0.6051769", "0.60261166", "0.6017752", "0.60162365", "0.6016204", "0.6004553", "0.59899265", "0.59783596", "0.5955983", "0.59528375", "0.59489864", "0.5937702", "0.5937702", "0.59182113", "0.5915514", "0.59001666", "0.5889346", "0.58779573", "0.58682525", "0.5857951", "0.58523834", "0.5847207", "0.5838963", "0.58292204", "0.5829202", "0.58255583", "0.58142495", "0.58045125", "0.579475", "0.5780569", "0.5777018" ]
0.65466934
40
Gets PaymentDate &lt;xs:element name="PaymentDate" type="SAFdateType"/&gt;
public function getPaymentDate(): RDate { \Logger::getLogger(\get_class($this)) ->info( \sprintf( __METHOD__." get '%s'", $this->paymentDate->format(RDate::SQL_DATE) ) ); return $this->paymentDate; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getPaymentDate();", "public function getPaymentDate() {\n\t\t// return $this->created_at;\n\t\treturn $this->account ? $this->account->payment_date : $this->created_at;\n\t}", "public function getFirstPaymentDate()\n\t{\n\t\treturn $this->first_payment_date;\n\t}", "public function getFormattedPaymentDate(): string;", "public function getPayDate() {\r\n\r\n\t\tself::errorReset();\r\n\t\t$this->reload();\r\n\t\treturn $this->payDate;\r\n\t}", "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 getFirstPaymentDate() {\r\n $query = $this->createQuery($this->_alias)\r\n ->select(\"DATE_FORMAT(cp.created_at, '%Y-%m') AS payment_date\")\r\n ->orderBy(\"id ASC\")\r\n ->limit(1);\r\n\r\n $res = $query->execute(array(), Doctrine_Core::HYDRATE_SCALAR);\r\n\r\n if (count($res) > 0) {\r\n $res = $res[0][\"cp_payment_date\"];\r\n }\r\n\r\n return $res;\r\n }", "public static function getPayDate() {\n return new DateTime(date(\"Ymd H:i:s\", strtotime('+ 7 days')));\n }", "public function getLastPaymentDate(): \\DateTime\n {\n return $this->lastPaymentDate;\n }", "public function getDate() {\n return @$this->attributes['date'];\n }", "public function getLastpaymentdate()\n {\n return $this->lastpaymentdate;\n }", "public function getTransactionDate() \n {\n return $this->_fields['TransactionDate']['FieldValue'];\n }", "public function getDate()\n {\n return $this->getNodeText('/p:package/p:date');\n }", "public function setPaymentDate($payment_date);", "function getDate() {\n\t\treturn $this->data_array['adddate'];\n\t}", "public function getBillDate()\n {\n return isset($this->billDate) ? $this->billDate : new DateTime;\n }", "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 }", "public function getSaleDate()\n {\n if (!$this->sale_date) return null;\n return Formatter::date($this->sale_date);\n }", "function getDate( )\r\n\t{\r\n\t\treturn $this->date;\r\n\t}", "public function getWarrantyDate()\n {\n return $this->warrantyDate;\n }", "public function getDate() { return $this->date; }", "public function getShipmentReceiptDate()\n {\n $value = $this->get(self::SHIPMENTRECEIPTDATE);\n return $value === null ? (string)$value : $value;\n }", "public function getPayDate(): ?Carbon\n {\n return $this->payDate;\n }", "public function getDate()\n {\n return $this->_date;\n }", "public function getDate() {\n\t\treturn $this->_date;\n\t}", "public function getDate()\r\n {\r\n return $this->date;\r\n }", "public function getDate()\n {\n return $this->date = new \\DateTime($this->get()->post_date);\n }", "public function getDate()\n {\n return $this->date;\n }", "public function getDate(){\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\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 return $this->date;\n }", "function getDate() {\n return $this->date;\n }", "public function getInvoiceDate() {\r\n\r\n\t\tself::errorReset();\r\n\t\t$this->reload();\r\n\t\treturn $this->invoiceDate;\r\n\t}", "public function getDate()\n {\n return $this->date;\n }", "public function getDate()\n {\n return $this->date;\n }", "public function getPayDateModel()\n\t\t{\n\t\t\tif ($this->paydate_model === NULL)\n\t\t\t{\n\t\t\t\t$model = $this->getModel();\n\t\t\t\t$this->paydate_model = Date_PayDateModel_1::getModel(\n\t\t\t\t\t\t\t\t$model->paydate_model,\n\t\t\t\t\t\t\t\t$model->day_of_week,\n\t\t\t\t\t\t\t\t$model->last_paydate,\n\t\t\t\t\t\t\t\t$model->day_of_month_1,\n\t\t\t\t\t\t\t\t$model->day_of_month_2,\n\t\t\t\t\t\t\t\t$model->week_1,\n\t\t\t\t\t\t\t\t$model->week_2);\n\t\t\t}\n\t\t\t\n\t\t\treturn $this->paydate_model;\n\t\t}", "public function getRecDate()\n {\n return $this->rec_date;\n }", "public function getPaymentType(){\n return $this->payment_type;\n }", "public function getDate() : string\r\n {\r\n return $this->format('Y-m-d');\r\n }", "public function getDate()\n {\n return new \\DateTime($this->date);\n }", "function get_date() {\n\t\treturn $this->get_data( 'comment_date' );\n\t}", "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 getPayment()\n {\n return $this->payment;\n }", "public function getPayment()\n {\n return $this->payment;\n }", "public function getPayment()\n {\n return $this->payment;\n }", "function getPubDate() {\n\t\treturn $this->getElementText(DOMIT_RSS_ELEMENT_PUBDATE);\n\t}", "function getPubDate() {\n\t\treturn $this->getElementText(DOMIT_RSS_ELEMENT_PUBDATE);\n\t}", "public function getDeliveryDate() {\r\n\r\n\t\tself::errorReset();\r\n\t\t$this->reload();\r\n\t\treturn $this->deliveryDate;\r\n\t}", "public function getTime()\n {\n return date('c', strtotime($this->data['payment_date']));\n }", "public function getOrderDate()\n {\n return $this->order_date;\n }", "public function getDate(){\n\t\treturn $this->laDate;\n\t}", "public function get_last_payment_date( $context = 'view' ) {\n\t\treturn $this->get_prop( 'last_payment_date', $context ) ;\n\t}", "public function getPaydates()\n\t{\n\t\treturn $this->paydates;\n\t}", "public function getPublicationDate()\n\t\t{\n\t\t\tif(is_null($this->data))\n\t\t\t\treturn null;\n\t\t\t\n\t\t\tif(!array_key_exists('publish_date', $this->data))\n\t\t\t\treturn null;\n\t\t\t\n\t\t\t//return DateTime::createFromFormat('M j, Y', $this->data['publish_date']);\n\t\t\treturn $this->data['publish_date'];\n\t\t}", "public function _getShipmentDate() {\n\t\treturn $this->_shipmentDate;\n\t}", "public function getTransactionPostedDate()\n {\n return $this->_fields['TransactionPostedDate']['FieldValue'];\n }", "public function getTransferDate()\n {\n $value = $this->get(self::TRANSFERDATE);\n return $value === null ? (string)$value : $value;\n }", "public function getPayment() {\n return $this->request(\n \"GET\",\n \"/shops/{$this->shop_id}/receipts/{$this->receipt_id}/payments\",\n \"Payment\"\n )\n ->first();\n }", "public function getSpecialToDate()\n {\n return $this->_getData('special_to_date');\n }", "public function getOrderdate()\n {\n return $this->orderdate;\n }", "public function getDATE_DEPOT()\n {\n return $this->DATE_DEPOT;\n }", "private function getBasicPayDate(\\DateTime $date): \\DateTime\n {\n $date = clone $date;\n $date->modify('last day of this month');\n\n // fix payment day according to business rules (if appropriate)\n $saturdaySundayDayNumbers = [0, 6];\n while (in_array($date->format('w'), $saturdaySundayDayNumbers)) {\n $date->modify('-1 day');\n }\n\n return $date;\n }", "function getRegistrationDate()\n { \n return $this->getValueByFieldName('registration_date');\n }", "public function get()\n {\n return $this->date;\n }", "public function getTransactionDateAttribute(){\n return $this->format_date($this->attributes['transaction_date']);\n }", "public function getDate()\n\t{\n\t\treturn $this->datetime;\n\t}", "public\n\tfunction getPostDate(): \\DateTime {\n\t\treturn ($this->postDate);\n\t}", "public function getFundDateEstimate()\n\t{\n\t\treturn $this->fund_date;\n\t}", "public function getPurchaseDateCreated() {\n return $this->purchaseDateCreatedDate;\n }" ]
[ "0.77713466", "0.74972916", "0.69472134", "0.6801402", "0.67326385", "0.6454902", "0.634827", "0.6205493", "0.6191901", "0.6031016", "0.60275036", "0.60195315", "0.5958611", "0.59426016", "0.59345627", "0.59027904", "0.58933455", "0.5892541", "0.5848577", "0.5848161", "0.5809078", "0.57984823", "0.5791214", "0.57805276", "0.5779056", "0.5760513", "0.5756802", "0.5735707", "0.57253176", "0.5724094", "0.5724094", "0.5724094", "0.5724094", "0.5724094", "0.5724094", "0.5724094", "0.5724094", "0.5724094", "0.5724094", "0.5724094", "0.5724094", "0.5724094", "0.5724094", "0.5724094", "0.5724094", "0.5724094", "0.5724094", "0.5724094", "0.5724094", "0.5724094", "0.5724094", "0.5724094", "0.5724094", "0.5724094", "0.5724094", "0.5724094", "0.5724094", "0.5724094", "0.571926", "0.571926", "0.571926", "0.5710098", "0.5695853", "0.568108", "0.56751245", "0.56751245", "0.5654802", "0.5596314", "0.5595288", "0.5585669", "0.5579218", "0.5579014", "0.557776", "0.5575698", "0.5575698", "0.5575698", "0.5565986", "0.5565986", "0.55425936", "0.5519192", "0.55104166", "0.5501715", "0.54955924", "0.54923314", "0.54665506", "0.5465555", "0.54636973", "0.54619265", "0.5451387", "0.54493827", "0.54493093", "0.54372305", "0.54370356", "0.543656", "0.54108727", "0.54026866", "0.5396523", "0.5389428", "0.5389396", "0.5386703" ]
0.77122015
1
Sets PaymentDate &lt;xs:element name="PaymentDate" type="SAFdateType"/&gt;
public function setPaymentDate(RDate $paymentDate): void { $this->paymentDate = $paymentDate; \Logger::getLogger(\get_class($this)) ->debug( \sprintf( __METHOD__." set to '%s'", $this->paymentDate->format(RDate::SQL_DATE) ) ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setPaymentDate($payment_date);", "public function setTransactionDate($value) {\n\t\tself::$_transactionDate = $value;\n\t}", "public function set_last_payment_date( $value ) {\n\t\t$this->set_prop( 'last_payment_date', $value ) ;\n\t}", "public function setDate($value) {\n\t\t$this->_date = $value;\n\t}", "public function getPaymentDate();", "public function setDate($date);", "public function set_date($date) \n\t{\n\t\tif(! is_numeric($date))\n\t\t{\n\t\t\t$date = strtotime($date);\n\t\t}\n\t\t\n\t\tif($this->version == ATOM)\n\t\t{\n\t\t\t$tag = 'updated';\n\t\t\t$value = date(DATE_ATOM, $date);\n\t\t} \n\t\telseif($this->version == RSS2) \n\t\t{\n\t\t\t$tag = 'pubDate';\n\t\t\t$value = date(DATE_RSS, $date);\n\t\t}\n\t\telse \n\t\t{\n\t\t\t$tag = 'dc:date';\n\t\t\t$value = date(\"Y-m-d\", $date);\n\t\t}\n\t\t\n\t\t$this->add_element($tag, $value); \n\t}", "public function getPaymentDate() {\n\t\t// return $this->created_at;\n\t\treturn $this->account ? $this->account->payment_date : $this->created_at;\n\t}", "public function setDate($date){\n\t\t$this->date = $date;\n\t}", "public function setinvoiceDateAttribute($value)\n {\n\n $this->attributes['invoice_date'] = UserHelper::parseDateFromString($value);\n }", "public function setDate($date)\n\t{\n\t\t$this->date = $date;\n\t}", "public function setDate($date)\n {\n $this->date = $date;\n }", "public function setDate($date)\n {\n $this->date = $date;\n }", "public function setDate($date) {\n $this->date = $date;\n }", "public function setDate( $sDate ) {\n\t\t$this->sDate = $sDate;\n\t}", "public function setTransactionDate($value) \n {\n $this->_fields['TransactionDate']['FieldValue'] = $value;\n return $this;\n }", "public function getPaymentDate(): RDate\n {\n \\Logger::getLogger(\\get_class($this))\n ->info(\n \\sprintf(\n __METHOD__.\" get '%s'\",\n $this->paymentDate->format(RDate::SQL_DATE)\n )\n );\n return $this->paymentDate;\n }", "public function setDate($date){\r\n\t\t$this->wishDate = $date;\r\n\t}", "public function setDueDateAttribute($value)\n {\n $this->attributes['due_date'] = $value;\n }", "function _webform_datetime_date(array &$element, FormStateInterface $form_state, DrupalDateTime $date = NULL) {\n // Make sure the date element is being displayed.\n if (!isset($element['date'])) {\n return;\n }\n\n $type = (isset($element['#date_date_element'])) ? $element['#date_date_element'] : 'date';\n switch ($type) {\n case 'datepicker':\n // Convert #type from datepicker to textfield.\n $element['date']['#type'] = 'textfield';\n\n // Must manually set 'data-drupal-date-format' to trigger date picker.\n // @see \\Drupal\\Core\\Render\\Element\\Date::processDate\n $element['date']['#attributes']['data-drupal-date-format'] = [$element['date']['#date_date_format']];\n break;\n }\n}", "public function setPayment($payment);", "public function setDateAttribute($value)\n {\n $this->attributes['date'] = Carbon::parse($value)->format('Y-m-d');\n }", "public function setDateAttribute($value)\n {\n $this->attributes['date'] = Carbon::parse($value)->toDateTimeString();\n }", "public function setOrderDateAttribute($orderDate) {\n $this->attributes['order_date'] = Carbon::parse($orderDate)->toDateString(); //'toDateTimeString(); use to dd:mm:yyyy:hh:mm:ss\n }", "private function actionAlterTablePaymentSetTimestamp() {\n $this->changeTableColumnToTimestamp(TB_VPS_PAYMENT, array(\"payment_date\"), \"payment_id\");\n echo TB_VPS_PAYMENT . \" DONE <br/>\";\n }", "public function setPayment($value) {\n $this->payment = $value;\n }", "public function getFirstPaymentDate()\n\t{\n\t\treturn $this->first_payment_date;\n\t}", "public function setDate($date_string = null)\n {\n\n if ($this->is_date() == 1) {\n $this->now = getdate(strtotime($date_string));\n } else {\n $this->now = getdate();\n }\n }", "public function setPublishDateAttribute($value)\n {\n $this->attributes['publish_date'] = date(\"Y-m-d H:i:s\", strtotime($value));\n }", "public function setPurchaseDateAttribute($input)\n {\n if ($input != null && $input != '') {\n $this->attributes['purchase_date'] = Carbon::createFromFormat(config('app.date_format'), $input)->format('Y-m-d');\n } else {\n $this->attributes['purchase_date'] = null;\n }\n }", "public function setDateAttribute($date)\n {\n \t$this->attributes['date'] = Carbon::parse($date);\n }", "private function _setDate(){\n\t\tif($this->_year>=1970&&$this->_year<=2038){\n\t\t\t$this->_day = date('d', $this->_timestamp);\n\t\t\t$this->_month = date('m', $this->_timestamp);\n\t\t\t$this->_year = date('Y', $this->_timestamp);\n\t\t} else {\n\t\t\t$dateParts = self::_getDateParts($this->_timestamp, true);\n\t\t\t$this->_day = sprintf('%02s', $dateParts['mday']);\n\t\t\t$this->_month = sprintf('%02s', $dateParts['mon']);\n\t\t\t$this->_year = $dateParts['year'];\n\t\t}\n\t\t$this->_date = $this->_year.'-'.$this->_month.'-'.$this->_day;\n\t}", "public function setDateAttribute($value)\n {\n $this->attributes['date'] = Carbon::parse($value)->format(self::DATE_FORMAT_SET);\n }", "private function set_date()\r\n\t{\r\n\t\tif ($this->month > 12)\r\n\t\t{\r\n\t\t\t$this->month=1;\r\n\t\t\t$this->year++;\r\n\t\t}\r\n\r\n\t\tif ($this->month < 1)\r\n\t\t{\r\n\t\t\t$this->month=12;\r\n\t\t\t$this->year--;\r\n\t\t}\r\n\r\n\t\tif ($this->year > 2037) $this->year = 2037;\r\n\t\tif ($this->year < 1971) $this->year = 1971;\r\n\t}", "public function setDate($a = null)\n {\n throw new NotImplementedException(__METHOD__);\n }", "private function XML_addDate() {\n\t\t$dateEntity = $this->xmlHandler->createElement('date');\n\t\t$dateEntity->appendChild($this->xmlHandler->createTextNode(date(\"F j, Y, g:i a\")));\n\n\t\t$this->xmlRoot->appendChild($dateEntity);\n\t}", "function setDate($date = null)\r\n\t{\t\r\n\t\t$day = substr($date ,8, 2);\r\n\t\t$month = substr($date ,5, 2);\r\n\t\t$year = substr($date ,0, 4);\r\n\t\t\r\n\t\t$newDate = $day.'-'.$month.'-'.$year;\r\n\t\t\r\n\t\treturn $newDate;\r\n\t}", "function setDueDate( $value )\n {\n if ( $this->State_ == \"Dirty\" )\n $this->get( $this->ID );\n\n $this->DueDate = $value;\n }", "public function set_next_bill_date( $value ) {\n\t\t$this->set_prop( 'next_bill_date', $value ) ;\n\t}", "public function setDate($date = null): object\n\t{\n\t\tif (null !== $date && !($date instanceof FHIRDateTime)) {\n\t\t\t$date = new FHIRDateTime($date);\n\t\t}\n\t\t$this->_trackValueSet($this->date, $date);\n\t\t$this->date = $date;\n\t\treturn $this;\n\t}", "public function setPaymentType($payment_type){\n $this->payment_type = $payment_type;\n }", "public function setTxnDate($date)\n\t{\n\t\treturn $this->setDateType('TxnDate', $date);\n\t}", "public function setDateOfBirth($value)\n {\n $this->_date_of_birth = $value;\n }", "public function setDepositDueDate($depositDueDate)\n {\n if (stristr($depositDueDate, \"-\")) {\n $depositDueDate = strtotime($depositDueDate);\n }\n $this->depositDueDate = $depositDueDate;\n }", "public function setNextServiceDateAttribute($input)\n {\n if ($input != null && $input != '') {\n $this->attributes['next_service_date'] = Carbon::createFromFormat(config('app.date_format'), $input)->format('Y-m-d');\n } else {\n $this->attributes['next_service_date'] = null;\n }\n }", "public function setContactDate($date) {\n $this->date = $date;\n }", "public function setdueDateAttribute($value)\n {\n\n $this->attributes['due_date'] = UserHelper::parseDateFromString($value);\n }", "public function setBalanceDueDate($balanceDueDate)\n {\n if (stristr($balanceDueDate, \"-\")) {\n $balanceDueDate = strtotime($balanceDueDate);\n }\n $this->balanceDueDate = $balanceDueDate;\n }", "public function setDate($date = null): object\n {\n if (null !== $date && !($date instanceof FHIRDate)) {\n $date = new FHIRDate($date);\n }\n $this->_trackValueSet($this->date, $date);\n $this->date = $date;\n return $this;\n }", "private function updatePublishOnDate()\n {\n $this->owner->PublishOnDate = $this->owner->DesiredPublishDate;\n // Remove the DesiredPublishDate.\n $this->owner->DesiredPublishDate = null;\n }", "public function getPayDate() {\r\n\r\n\t\tself::errorReset();\r\n\t\t$this->reload();\r\n\t\treturn $this->payDate;\r\n\t}", "public function setInvoiceDateAttribute($input)\n {\n if ($input != null && $input != '') {\n $this->attributes['invoice_date'] = Carbon::createFromFormat(config('app.date_format'), $input)->format('Y-m-d');\n } else {\n $this->attributes['invoice_date'] = null;\n }\n }", "public function setExpirationDate(?Date $value): void {\n $this->getBackingStore()->set('expirationDate', $value);\n }", "public function setOrderDate($date)\n {\n $this->order_date = $date;\n }", "public function _setShipmentDate($shipmentDate) {\n\t\t$this->_shipmentDate = $shipmentDate;\n\t}", "public function setPaymentResponse(?PaymentResponse $paymentResponse)\n {\n $this->paymentResponse = $paymentResponse;\n }", "public function setDate()\n\t{\n\t\tif ($this->getIsNewRecord())\n\t\t\t$this->create_time = time();\n\t}", "public function setDate($date)\n {\n $this->values['Date'] = $date;\n return $this;\n }", "public function setExpiryDate($date)\n {\n $this->expiryDate = $date;\n }", "public function setDate($date)\n {\n $this->date = $date;\n \n return $this;\n }", "public function setProfileBirthdateAttribute($value)\n {\n if(is_string($value)){\n $this->attributes['profile_birthdate'] = $this->setDate($value);\n } else {\n $this->attributes['profile_birthdate'] = null;\n }\n }", "public function issetPaymentDate(): bool\n {\n return isset($this->paymentDate);\n }", "public function setPublishedAtAttribute($date){ //guarda el campo published_at como si fuera una instancia de Carbon para que se guarde con hora\n \t$this->attributes['published_at']=Carbon::parse($date); \n }", "public function setUseDate($use_date) \n \t{\n \t\t$this->use_date = $use_date;\n \t}", "public function setBlockDateAttribute($value) {\n $this->attributes['block_date'] = Carbon::parse($value);\n }", "function set_change_sale_date_enable() {\n $this->sale_lib->set_change_sale_date_enable($this->input->post('change_sale_date_enable'));\n if (!$this->sale_lib->get_change_sale_date()) {\n $this->sale_lib->set_change_sale_date(date(get_date_format()));\n }\n }", "function setDateDue($dateDue) {\n\t\t$this->setData('dateDue', $dateDue);\n\t}", "public function set_approved_date( $date ) {\n\t\t$this->set_prop( 'approved_date', $date ) ;\n\t}", "public function setDueDate(\\DateTime $value)\n {\n $this->setItemValue('due_date', (string)$value->getTimestamp());\n }", "public function setPaymentRequest(string $payment_request);", "public function setDateOfBirth()\n {\n $dateOfBirth = request('dob_year') . '-' . request('dob_month') . '-' . request('dob_day');\n\n $this->date_of_birth = $dateOfBirth;\n $this->save();\n }", "public function updateDate( Inx_Api_Recipient_Attribute $attr, $sValue );", "public function setDateAttribute($value)\n {\n $this->attributes['date'] = Carbon::createFromFormat('d/m/Y', $value);\n }", "public function setDateFormat($date){\n\t\t$this->_dateFormat = $date;\n\t}", "public function setDate()\n\t{\n\t\tif($this->isNewRecord)\n\t\t\t$this->create_time=$this->update_time=time();\n\t\telse\n\t\t\t$this->update_time=time();\n\t}", "public function setDate()\n\t{\n\t\tif($this->isNewRecord)\n\t\t\t$this->create_time=$this->update_time=time();\n\t\telse\n\t\t\t$this->update_time=time();\n\t}", "public function setShippingDate($data)\n {\n if ($data == '0000-00-00 00:00:00') {\n $data = null;\n }\n if ($data === 'CURRENT_TIMESTAMP' || is_null($data)) {\n $data = \\Zend_Date::now()->setTimezone('UTC');\n }\n\n if ($data instanceof \\Zend_Date) {\n\n $data = new \\DateTime($data->toString('yyyy-MM-dd HH:mm:ss'), new \\DateTimeZone($data->getTimezone()));\n\n } elseif (!is_null($data) && !$data instanceof \\DateTime) {\n\n $data = new \\DateTime($data, new \\DateTimeZone('UTC'));\n }\n if ($data instanceof \\DateTime && $data->getTimezone()->getName() != 'UTC') {\n\n $data->setTimezone(new \\DateTimeZone('UTC'));\n }\n\n if ($this->_shippingDate != $data) {\n $this->_logChange('shippingDate');\n }\n\n $this->_shippingDate = $data;\n return $this;\n }", "public function setUpRegisterDate()\n {\n $this->setRegisterDate(new \\DateTime());\n }", "private function setDate(){\n\t// Validate incoming parameters\n\t\t$this->di->logger->stamp(__CLASS__, __METHOD__, '');\n\tif (isset($_GET['month'])) {\n\t\tis_numeric($_GET['month']) or die('month has to be numeric');\n\t}\n\tif (isset($_GET['year'])) {\n\t\tis_numeric($_GET['year']) or die('year has to be numeric');\n\t}\n\n\t// Set new date\n\t$this->newMonth = isset($_GET['month']) ? ($_GET['month']) : $this->currentMonth;\n\t$this->newYear = isset($_GET['year']) ? ($_GET['year']) : $this->currentYear;\n\n\tif ($this->newMonth > 12) {\n\t\t$this->newYear = $this->newYear +1;\n\t\t$this->newMonth = 1;\n\t\t$_GET['month'] = 1;\n\n\t}\n\telse if ($this->newMonth < 1) {\n\t\t$this->newYear = $this->newYear -1;\n\t\t$this->newMonth = 12;\n\t\t$_GET['month'] = 12;\n\t}\n\t\n\t}", "public function setToDate($toDate)\n {\n if (stristr($toDate, \"-\")) {\n $toDate = strtotime($toDate);\n }\n $this->toDate = $toDate;\n }", "public function setPubDate($pubDate)\n {\n $this->_pubDate = $pubDate;\n }", "public function setDateAttribute($input)\n {\n if ($input != null && $input != '') {\n $this->attributes['date'] = Carbon::createFromFormat(config('app.date_format'), $input)->format('Y-m-d');\n } else {\n $this->attributes['date'] = null;\n }\n }", "public function setDateAttribute($input)\n {\n if ($input != null && $input != '') {\n $this->attributes['date'] = Carbon::createFromFormat(config('app.date_format'), $input)->format('Y-m-d');\n } else {\n $this->attributes['date'] = null;\n }\n }", "public function setToDate($toDate)\n {\n // $this->toDate = $newDate->format('c');\n $this->toDate = $toDate;\n }", "public function setDate($p)\n {\n if ($p !== null && trim($p) !== \"\") {\n $this->appendCommandArgument(\"-D\");\n $this->appendCommandArgument($p);\n }\n }", "public function setExpiryDateAttribute($input)\n {\n if($input != '') {\n $this->attributes['expiry_date'] = Carbon::createFromFormat(config('quickadmin.date_format'), $input)->format('Y-m-d');\n }else{\n $this->attributes['expiry_date'] = '';\n }\n }", "protected function setDate($type, $date)\n\t{\n\t\t$this->{'date' . $type} = AdFox::convertDate($date);\n\n\t\treturn $this;\n\t}", "public function setBirthDateAttribute($date)\n {\n $this->attributes['birth_date'] = empty($date) ? null : $date;\n }", "function setDateResponseDue($dateResponseDue) {\n\t\t$this->setData('dateResponseDue', $dateResponseDue);\n\t}", "public function setDateOfBirth($dateOfBirth) {\n $this->dateOfBirth = $dateOfBirth;\n }", "public function setPaymentString(string $paymentString): void\n {\n $this->paymentString = $paymentString;\n }", "public function setCurrentLoanRepaymentExpectedDate()\n {\n if (!empty($this->current_loan_details)) {\n $date_time_add_month_str = '+' . $this->current_loan_details['loans'][0]['terms']['repayment_term'] . ' month';\n // Instantiate a DateTime object\n $date_time_zone = new DateTimeZone('UTC');\n $date = new DateTime(\"2017-02-13T05:40:05Z\", $date_time_zone);\n $date->modify(\"$date_time_add_month_str\");\n $this->currentLoanRepaymentExpectedDate = $date->format('Y-m-d H:i:s');\n \n return true;\n }\n \n return false; // hopefully not\n }", "public function setStartDate(string $date);", "protected function _setDateModified(XMLWriter $xml)\n {\n if (!$this->feed->getDateModified()) {\n return;\n }\n\n $xml->writeElement(\n 'pubDate', \n $this->feed->getDateModified()->format(DateTime::RSS)\n );\n }", "public function setDate(string $date)\r\n {\r\n $this->date = $date;\r\n\r\n return $this;\r\n }", "public function setPublishedAtAttribute($date)\n\t{\n\t\t$this->attributes['published_at'] = Carbon::createFromFormat('Y-m-d', $date);\n\t}", "public function setLastPaymentDate(\\DateTime $lastPaymentDate): self\n {\n $this->lastPaymentDate = $lastPaymentDate;\n\n return $this;\n }", "public function setArticle_date($t)\n {\n if(is_string($t))\n $this->_article_date = $t;\n }", "public function setStartDate($value)\n {\n $this->startDate = $value;\n }", "public function set_last_billed_due_date( $value ) {\n\t\t$this->set_prop( 'last_billed_due_date', $value ) ;\n\t}" ]
[ "0.7845562", "0.64185447", "0.6366298", "0.63164955", "0.6164906", "0.6102558", "0.6082409", "0.60491043", "0.6032942", "0.60210645", "0.60172725", "0.6013079", "0.6013079", "0.5996242", "0.5950348", "0.58824646", "0.5874693", "0.5752229", "0.5747266", "0.56992215", "0.5680494", "0.5676362", "0.56579036", "0.56487817", "0.56416", "0.56298566", "0.5628384", "0.5614487", "0.5599381", "0.5588827", "0.557932", "0.55768764", "0.55722344", "0.55521554", "0.5547226", "0.55401635", "0.5535524", "0.55263615", "0.5515814", "0.54767394", "0.5469287", "0.5464371", "0.5447261", "0.5437781", "0.5433911", "0.5426779", "0.5424764", "0.54216933", "0.5413054", "0.5412308", "0.54012775", "0.53944135", "0.53813934", "0.5376314", "0.53748673", "0.53745186", "0.5367335", "0.5364423", "0.5358719", "0.53573465", "0.5356363", "0.5348569", "0.5344527", "0.5334278", "0.5334114", "0.5329014", "0.5313433", "0.53107363", "0.53028834", "0.5302261", "0.5301292", "0.52985924", "0.52920175", "0.5284343", "0.5271607", "0.5271607", "0.5271539", "0.52712566", "0.52672803", "0.5264641", "0.5260845", "0.52593035", "0.52593035", "0.52588195", "0.52472913", "0.52449024", "0.5235596", "0.523505", "0.5234603", "0.5230655", "0.52290946", "0.52200836", "0.5199214", "0.5199148", "0.5195365", "0.51912284", "0.5181932", "0.51693636", "0.5168746", "0.5164713" ]
0.74097013
1
Get if is set paymentDate
public function issetPaymentDate(): bool { return isset($this->paymentDate); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getPaymentDate();", "public function getPaymentDate() {\n\t\t// return $this->created_at;\n\t\treturn $this->account ? $this->account->payment_date : $this->created_at;\n\t}", "public function getPaymentDate(): RDate\n {\n \\Logger::getLogger(\\get_class($this))\n ->info(\n \\sprintf(\n __METHOD__.\" get '%s'\",\n $this->paymentDate->format(RDate::SQL_DATE)\n )\n );\n return $this->paymentDate;\n }", "public function getPayDate() {\r\n\r\n\t\tself::errorReset();\r\n\t\t$this->reload();\r\n\t\treturn $this->payDate;\r\n\t}", "public function setPaymentDate($payment_date);", "public function getLastpaymentdate()\n {\n return $this->lastpaymentdate;\n }", "public function getFirstPaymentDate()\n\t{\n\t\treturn $this->first_payment_date;\n\t}", "public function getLastPaymentDate(): \\DateTime\n {\n return $this->lastPaymentDate;\n }", "public function getPayDate(): ?Carbon\n {\n return $this->payDate;\n }", "public function getFormattedPaymentDate(): string;", "public function getPayment()\n {\n return $this->payment;\n }", "public function getPayment()\n {\n return $this->payment;\n }", "public function getPayment()\n {\n return $this->payment;\n }", "function getDate() {\n return $this->date;\n }", "public function getDate() { return $this->date; }", "public function getStatusPayment()\r\n {\r\n return $this->statusPayment;\r\n }", "public function get_last_payment_date( $context = 'view' ) {\n\t\treturn $this->get_prop( 'last_payment_date', $context ) ;\n\t}", "function getDate( )\r\n\t{\r\n\t\treturn $this->date;\r\n\t}", "public function getBillDate()\n {\n return isset($this->billDate) ? $this->billDate : new DateTime;\n }", "function getDate() {\n\t\treturn $this->data_array['adddate'];\n\t}", "public function getDate()\n {\n return $this->date;\n }", "public function getDate()\n {\n return $this->date;\n }", "public function getProrationDate(): ?int\n {\n return $this->prorationDate;\n }", "public function getDate()\r\n {\r\n return $this->date;\r\n }", "public function getDate(){\n\t\treturn $this->_date;\n\t}", "public function getDate()\n {\n return $this->date;\n }", "public function getFirstPaymentDate() {\r\n $query = $this->createQuery($this->_alias)\r\n ->select(\"DATE_FORMAT(cp.created_at, '%Y-%m') AS payment_date\")\r\n ->orderBy(\"id ASC\")\r\n ->limit(1);\r\n\r\n $res = $query->execute(array(), Doctrine_Core::HYDRATE_SCALAR);\r\n\r\n if (count($res) > 0) {\r\n $res = $res[0][\"cp_payment_date\"];\r\n }\r\n\r\n return $res;\r\n }", "public function getPricingDate(): ?string\n {\n return $this->pricingDate;\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 isPaid() {\r\n\r\n\t\tself::errorReset();\r\n\t\t$this->reload();\r\n\t\treturn InputValidator::isEmpty($this->payDate) ? false: true;\r\n\t}", "public function getDate() {\n return $this->date;\n }", "public function get_has_date()\n\t{\n\t\treturn $this->has_date;\n\t}", "public function getTime()\n {\n return date('c', strtotime($this->data['payment_date']));\n }", "public function getReturnDate() {\r\n\r\n\t\tself::errorReset();\r\n\t\t$this->reload();\r\n\t\treturn $this->returnDate;\r\n\t}", "public function getPurchaseDateModified() {\n return $this->PurchaseDateModified;\n }", "public function getDate() {\n return @$this->attributes['date'];\n }", "public function setCurrentLoanRepaymentExpectedDate()\n {\n if (!empty($this->current_loan_details)) {\n $date_time_add_month_str = '+' . $this->current_loan_details['loans'][0]['terms']['repayment_term'] . ' month';\n // Instantiate a DateTime object\n $date_time_zone = new DateTimeZone('UTC');\n $date = new DateTime(\"2017-02-13T05:40:05Z\", $date_time_zone);\n $date->modify(\"$date_time_add_month_str\");\n $this->currentLoanRepaymentExpectedDate = $date->format('Y-m-d H:i:s');\n \n return true;\n }\n \n return false; // hopefully not\n }", "public function getVerifiedDate()\n {\n return $this->getProperty()->verifiedDate;\n }", "public function getDate()\n {\n return $this->_date;\n }", "public function _getShipmentDate() {\n\t\treturn $this->_shipmentDate;\n\t}", "public function getPaydates()\n\t{\n\t\treturn $this->paydates;\n\t}", "public function getOrderdate()\n {\n return $this->orderdate;\n }", "public function getPurchaseDateCreated() {\n return $this->purchaseDateCreatedDate;\n }", "public function getPaymentType(){\n return $this->payment_type;\n }", "public function getDate()\n {\n return $this->date = new \\DateTime($this->get()->post_date);\n }", "public function getOrderDate()\n {\n return $this->order_date;\n }", "public function getRecDate()\n {\n return $this->rec_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\t\treturn $this->_date;\n\t}", "protected function _getDob()\n {\n $dob = '';\n \n // First check if form birthday is set else get the birthday of the customer, otherwise error\n if ( isset( $this->_additionalFields['dob'] ) || isset( $this->_additionalFields['dob_year'] ) )\n {\n // Logics if javascript worked\n if ( array_key_exists( 'dob', $this->_additionalFields ) )\n {\n $dobTimestamp = strtotime( $this->_additionalFields['dob'], time() );\n $dob = date( 'Y-m-d\\TH:i:s', $dobTimestamp );\n }\n // Logics if javascript for date has not worked\n elseif ( \n array_key_exists( 'dob_year', $this->_additionalFields )\n && array_key_exists( 'dob_month', $this->_additionalFields )\n && array_key_exists( 'dob_day', $this->_additionalFields )\n )\n {\n $dobdate = $this->_additionalFields['dob_year'] . '-' . $this->_additionalFields['dob_month'] . '-' . \n $this->_additionalFields['dob_day'];\n $dobTimestamp = strtotime($dobdate, time());\n $dob = date('Y-m-d\\TH:i:s', $dobTimestamp);\n }\n }\n // No birthday sent through form fields, look if a birthday was sent using Magento default fields\n elseif( $this->_order->getCustomerDob() )\n {\n $dobdate = $this->_order->getCustomerDob();\n $dobTimestamp = strtotime( $dobdate, time() );\n $dob = date('Y-m-d\\TH:i:s', $dobTimestamp);\n }\n // If the variable $dob is not filled, then there was a problem with getting the correct date of birth\n // Because sending an empty value will cause SOAP error, do Mage Exception instead\n if ($dob == '')\n {\n // Cancel the order to prevent pending orders\n $this->_order->cancel()->save();\n // Restore the quote to keep cart information\n $this->restoreQuote();\n // Sent back error\n Mage::throwException($this->_helper->__('The date of birth is missing invalid. Please check your date or birth or contact our customer service.'));\n }\n \n return $dob;\n }", "public function getTransactionDate() \n {\n return $this->_fields['TransactionDate']['FieldValue'];\n }", "private function _getDueDate()\n {\n $iDueDate = trim($this->getNovalnetConfigValue('iDueDate' . $this->sCurrentPayment));\n if ($this->sCurrentPayment == 'novalnetinvoice') {\n $iDueDate = (!empty($iDueDate) && is_numeric($iDueDate)) ? $iDueDate : '';\n } elseif($this->sCurrentPayment == 'novalnetsepa') {\n $iDueDate = (empty($iDueDate) || $iDueDate <= 6) ? 7 : $iDueDate;\n } else {\n $iDueDate = (!empty($iDueDate) && is_numeric($iDueDate)) ? $iDueDate : '';\n }\n\n return ($iDueDate) ? date('Y-m-d', strtotime('+' . $iDueDate . ' days')) : false;\n }", "function getDateResponseDue() {\n\t\treturn $this->getData('dateResponseDue');\n\t}", "public function setPaymentDate(RDate $paymentDate): void\n {\n $this->paymentDate = $paymentDate;\n \\Logger::getLogger(\\get_class($this))\n ->debug(\n \\sprintf(\n __METHOD__.\" set to '%s'\",\n $this->paymentDate->format(RDate::SQL_DATE)\n )\n );\n }", "public function getPaymentid()\r\n {\r\n return $this->paymentid;\r\n }", "public function getInvoiceDate() {\r\n\r\n\t\tself::errorReset();\r\n\t\t$this->reload();\r\n\t\treturn $this->invoiceDate;\r\n\t}", "public static function getPayDate() {\n return new DateTime(date(\"Ymd H:i:s\", strtotime('+ 7 days')));\n }", "public function getDueDate()\n {\n if (array_key_exists(\"dueDate\", $this->_propDict)) {\n return $this->_propDict[\"dueDate\"];\n } else {\n return null;\n }\n }", "public function set_last_payment_date( $value ) {\n\t\t$this->set_prop( 'last_payment_date', $value ) ;\n\t}", "function getFecha(){\n\t\treturn $this->fecha;\n\t}", "protected function getPayment()\n {\n return $this->getOrder()->getPayment();\n }", "public function getWarrantyDate()\n {\n return $this->warrantyDate;\n }", "public function getDueDate(){\n return $this->getParameter('due_date');\n }", "function getFecha() {\r\n return $this->fecha;\r\n }", "public function getDATE_DEPOT()\n {\n return $this->DATE_DEPOT;\n }", "function get_payment_status()\n {\n return $this->platnosci_post_vars['payment_status'];\n }", "public function getDateTransaction()\n {\n return $this->dateTransaction;\n }", "public\n\tfunction getPostDate(): \\DateTime {\n\t\treturn ($this->postDate);\n\t}", "function getDateDue() {\n\t\treturn $this->getData('dateDue');\n\t}", "public function isSetTransactionDate()\n {\n return !is_null($this->_fields['TransactionDate']['FieldValue']);\n }" ]
[ "0.8280552", "0.7783818", "0.7375068", "0.72478944", "0.7152", "0.7018978", "0.7001281", "0.66639954", "0.6504495", "0.65041775", "0.6378031", "0.6378031", "0.6378031", "0.6160028", "0.6158033", "0.6149654", "0.61134785", "0.6102285", "0.6054844", "0.6022556", "0.5999278", "0.5999278", "0.599161", "0.59911734", "0.5975145", "0.59684116", "0.5964375", "0.5964141", "0.5958626", "0.5958626", "0.5958626", "0.5958626", "0.5958626", "0.5958626", "0.5958626", "0.5958626", "0.5958626", "0.5958626", "0.5958626", "0.5958626", "0.5958626", "0.5958626", "0.5958626", "0.5958626", "0.5958626", "0.5958626", "0.5958626", "0.5958626", "0.5958626", "0.5958626", "0.5958626", "0.5958626", "0.5958626", "0.5958626", "0.5958626", "0.5958626", "0.5958626", "0.59435534", "0.592767", "0.59242415", "0.5922821", "0.59169286", "0.59122026", "0.5906502", "0.5905673", "0.5902837", "0.5901012", "0.5891651", "0.5887545", "0.5886893", "0.58860356", "0.58801925", "0.58782643", "0.5876919", "0.5875541", "0.5874497", "0.5874497", "0.5874497", "0.5868685", "0.5867692", "0.5857157", "0.5847242", "0.5839384", "0.58265495", "0.5825676", "0.58225965", "0.58187675", "0.5818508", "0.58181417", "0.5814407", "0.5812687", "0.58122456", "0.58062655", "0.5806234", "0.5795056", "0.57933944", "0.57729936", "0.57599485", "0.5756583", "0.5756226" ]
0.72193027
4
Create the XML node
public function createXmlNode(\SimpleXMLElement $node): \SimpleXMLElement { \Logger::getLogger(\get_class($this))->trace(__METHOD__); if ($node->getName() !== Payment::N_PAYMENT && $node->getName() !== ADocumentTotals::N_DOCUMENTTOTALS) { $msg = \sprintf( "Node name should be '%s' or '%s' but is '%s", Payment::N_PAYMENT, ADocumentTotals::N_DOCUMENTTOTALS, $node->getName() ); \Logger::getLogger(\get_class($this)) ->error(\sprintf(__METHOD__." '%s'", $msg)); throw new AuditFileException($msg); } $nodePayMethod = $node->getName() === Payment::N_PAYMENT ? $node->addChild(static::N_PAYMENTMETHOD) : $node->addChild(SalesInvoices\DocumentTotals::N_PAYMENT); if ($this->getPaymentMechanism() !== null) { $nodePayMethod->addChild( static::N_PAYMENTMECHANISM, $this->getPaymentMechanism()->get() ); } if (isset($this->paymentAmount)) { $nodePayMethod->addChild( static::N_PAYMENTAMOUNT, $this->floatFormat($this->getPaymentAmount()) ); } else { $node->addChild(static::N_PAYMENTAMOUNT); $this->getErrorRegistor()->addOnCreateXmlNode("PaymentAmount_not_valid"); } if (isset($this->paymentDate)) { $nodePayMethod->addChild( static::N_PAYMENTDATE, $this->getPaymentDate()->format(RDate::SQL_DATE) ); } else { $node->addChild(static::N_PAYMENTDATE); $this->getErrorRegistor()->addOnCreateXmlNode("PaymentDate_not_valid"); } return $nodePayMethod; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function createXML() {}", "function _oembed_create_xml($data, $node = \\null)\n {\n }", "private function createRootNode()\n {\n $this->_rootNode = $this->_dom->createElement($this->_rootElement, '');\n $this->_dom->appendChild($this->_rootNode);\n }", "public function createDocumentElement() {\n\t\t$this->node = $this->getDocument ()->createElement ( 'notificationRequest' );\n\t\t$this->node->setAttribute ( 'xmlns', self::XMLNS_ORDERS );\n\t\t$this->node->setAttribute ( 'xmlns:common', self::XMLNS_COMMON );\n\t\t$this->node->setAttribute ( 'version', '1.0' );\n\t\t$this->getDocument ()->appendChild ( $this->node );\n\t}", "function create_dom_node(&$dom, &$parent_node, $node_name, $node_value = NULL){\n\t\t$node = $dom->create_element($node_name);\n\t\t$new_node = $parent_node->append_child($node);\n\t\tif($node_value != NULL){\n\t\t\t$txt_node = $dom->create_text_node($node_value);\n\t\t\t$new_node->append_child($txt_node);\n\t\t}\n\t\treturn $new_node;\n\t}", "public function createDocumentElement() {\n\t\t$this->node = $this->getDocument ()->createElement ( 'submitCartRequest' );\n\t\t$this->node->setAttribute ( 'xmlns', self::XMLNS_CHECKOUT );\n\t\t$this->node->setAttribute ( 'xmlns:common', self::XMLNS_COMMON );\n\t\t$this->node->setAttribute ( 'version', '1.0' );\n\t\t$this->getDocument ()->appendChild ( $this->node );\n\t}", "function createElement ($a_node)\n\t{\n\t\treturn $this->doc->create_element($a_node);\n\t}", "function createNode ($a_parent, $a_elementname, $a_attr_list = NULL, $a_text = NULL)\n\t{\n\t\t// create new element node\n\t\t$node = $this->createElement($a_elementname);\n\t\t\n\t\t// set attributes\n\t\tif (is_array($a_attr_list)) {\n\t\t\tforeach ($a_attr_list as $attr => $value) {\n\t\t\t\t$node->set_attribute($attr, $value);\n\t\t\t}\n\t\t}\n\t\t\n\t\t// create and add a text node to the new element node\n\t\tif (is_string($a_text)) {\n\t\t\t$node_text = $this->doc->create_text_node($a_text);\n\t\t\t$node_text = $node->append_child($node_text);\n\t\t}\n\t\t\n\t\t// add element node at at the end of the children of the parent\n\t\t$node = $a_parent->append_child($node);\n\t\t\n\t\treturn $node;\n\t}", "public function toXML();", "public function createXML($xml) {\n\n\t\t\t$xml = parent::createXML($xml);\n\t\t\t$xml->addChild(\"company-id\",$this->getCompanyId());\n\t\t\t$xml->addChild(\"company-name\",$this->getCompanyName());\n\t\t\t$xml->addChild(\"first-name\",$this->getFirstName());\n\t\t\t$xml->addChild(\"last-name\",$this->getLastName());\n\t\t\treturn $xml;\n\t\t}", "function crearXML(){\n\t\t$objConexion = conectar(\"on\");\n\t\t\n\t\t$consulta='SELECT id_solicitud as numero,\n\t\t\t\t\tfecha_requerida_solicitud as requerida,\n\t\t\t\t\tbeneficiario_solicitud as beneficiario,\n\t\t\t\t\tconcepto_solicitud as concepto,\n\t\t\t\t\tfactura_solicitud as factura,\n\t\t\t\t\t(SELECT nombre_desarrollo FROM desarrollo WHERE id_desarrollo=tipo_desarrollo_solicitud) as desarrollo,\n\t\t\t\t\t(SELECT nombre_departamento FROM departamento WHERE id_departamento=tipo_departamento_solicitud) as depto,\n\t\t\t\t\timporte_solicitud as monto,\n\t\t\t\t\testatus_solicitud as estado \n\t\t\t\t\tFROM solicitud WHERE tipo_solicitud=1';\n\t\t\t\t\t\n\t\t$datos_consulta=$objConexion->query($consulta);\n\t\t\n\t\t$xml = new DomDocument('1.0','UTF-8');\n\t\t$root = $xml->createElement('registros');\n\t\t$root = $xml->appendChild($root);\n\t\t\n\t\twhile($fila=$datos_consulta->fetch_assoc()){\n\t\t\t$caja = $xml->createElement('caja');\n \t\t\t$caja = $root->appendChild($caja);\n\t\t\t$numero_sc = $xml->createElement('id_solicitud',$fila['numero']);\n\t\t\t$numero_sc = $caja->appendChild($numero_sc);\n\t\t\t$fechreq=$fila['requerida'];\n\t\t\t$fechareq = $xml->createElement('fecha_requerida',$fechreq);\n\t\t\t$fechareq = $caja->appendChild($fechareq);\n\t\t\t$beneficiaro = $xml->createElement('beneficiario',$fila['beneficiario']);\n\t\t\t$beneficiaro = $caja->appendChild($beneficiaro);\n\t\t\t$concepto = $xml->createElement('concepto',$fila['concepto']);\n\t\t\t$concepto = $caja->appendChild($concepto);\n\t\t\t$factura = $xml->createElement('factura',$fila['factura']);\n\t\t\t$factura = $caja->appendChild($factura);\n\t\t\t$desarrollo = $xml->createElement('desarrollo',$fila['desarrollo']);\n\t\t\t$desarrollo = $caja->appendChild($desarrollo);\n\t\t\t$departamento = $xml->createElement('departamento',$fila['depto']);\n\t\t\t$departamento = $caja->appendChild($departamento);\n\t\t\t$monto = $xml->createElement('monto',$fila['monto']);\n\t\t\t$monto = $caja->appendChild($monto);\n\t\t\t$estatus = $xml->createElement('estatus',$fila['estado']);\n\t\t\t$estatus = $caja->appendChild($estatus);\n\t\t}\n\t\t\n\t\t$consulta='SELECT id_solicitud as numero,\n\t\t\t\t\tfecha_requerida_solicitud as requerida,\n\t\t\t\t\tbeneficiario_solicitud as beneficiario,\n\t\t\t\t\tconcepto_solicitud as concepto,\n\t\t\t\t\tfactura_solicitud as factura,\n\t\t\t\t\t(SELECT nombre_desarrollo FROM desarrollo WHERE id_desarrollo=tipo_desarrollo_solicitud) as desarrollo,\n\t\t\t\t\t(SELECT nombre_departamento FROM departamento WHERE id_departamento=tipo_departamento_solicitud) as depto,\n\t\t\t\t\timporte_solicitud as monto,\n\t\t\t\t\testatus_solicitud as estado \n\t\t\t\t\tFROM solicitud WHERE tipo_solicitud=2';\n\t\t\t\t\t\n\t\t$datos_consulta=$objConexion->query($consulta);\n\t\t\n\t\twhile($fila=$datos_consulta->fetch_assoc()){\n\t\t\t$proveedor = $xml->createElement('proveedor');\n \t\t\t$proveedor = $root->appendChild($proveedor);\n\t\t\t$numero_sp = $xml->createElement('id_solicitud',$fila['numero']);\n\t\t\t$numero_sp = $proveedor->appendChild($numero_sp);\n\t\t\t$fechreq=$fila['requerida'];\n\t\t\t$fechareq = $xml->createElement('fecha_requerida',$fechreq);\n\t\t\t$fechareq = $proveedor->appendChild($fechareq);\n\t\t\t$beneficiaro = $xml->createElement('beneficiario',$fila['beneficiario']);\n\t\t\t$beneficiaro = $proveedor->appendChild($beneficiaro);\n\t\t\t$concepto = $xml->createElement('concepto',$fila['concepto']);\n\t\t\t$concepto = $proveedor->appendChild($concepto);\n\t\t\t$factura = $xml->createElement('factura',$fila['factura']);\n\t\t\t$factura = $proveedor->appendChild($factura);\n\t\t\t$desarrollo = $xml->createElement('desarrollo',$fila['desarrollo']);\n\t\t\t$desarrollo = $proveedor->appendChild($desarrollo);\n\t\t\t$departamento = $xml->createElement('departamento',$fila['depto']);\n\t\t\t$departamento = $proveedor->appendChild($departamento);\n\t\t\t$monto = $xml->createElement('monto',$fila['monto']);\n\t\t\t$monto = $proveedor->appendChild($monto);\n\t\t\t$estatus = $xml->createElement('estatus',$fila['estado']);\n\t\t\t$estatus = $proveedor->appendChild($estatus);\n\t\t}\n\t\t\n\t\t$consulta='SELECT id_comisiones as numero,\n\t\t\t\t\tfecha_requerida_comisiones as requerida,\n\t\t\t\t\t(SELECT nombre_usuario FROM usuario WHERE id_usuario=asesor_comisiones) as asesor,\n\t\t\t\t\tfactura_comisiones as factura,\n\t\t\t\t\tconcepto_comisiones as concepto,\n\t\t\t\t\t(SELECT nombre_departamento FROM departamento WHERE id_departamento=tipo_departamento_comisiones) as depto,\n\t\t\t\t\t(SELECT nombre_desarrollo FROM desarrollo WHERE id_desarrollo=tipo_desarrollo_comisiones) as desarrollo,\n\t\t\t\t\t(SELECT nombre_cliente FROM cliente WHERE id_cliente=cliente_comisiones) as cliente,\n\t\t\t\t\tmonto_comisiones as monto,\n\t\t\t\t\tanticipo_comisiones as anticipo,\n\t\t\t\t\t(monto_comisiones-anticipo_comisiones) as resta,\n\t\t\t\t\testatus_comisiones as estado\n\t\t\t\t\tFROM comisiones';\n\t\t\t\t\t\n\t\t$datos_consulta=$objConexion->query($consulta);\n\t\t\n\t\twhile($fila=$datos_consulta->fetch_assoc()){\n\t\t\t$comision = $xml->createElement('comision');\n \t\t\t$comision = $root->appendChild($comision);\n\t\t\t$numero_scn = $xml->createElement('id_solicitud',$fila['numero']);\n\t\t\t$numero_scn = $comision->appendChild($numero_scn);\n\t\t\t$fechreq=$fila['requerida'];\n\t\t\t$fechareq = $xml->createElement('fecha_requerida',$fechreq);\n\t\t\t$fechareq = $comision->appendChild($fechareq);\n\t\t\t$asesor = $xml->createElement('asesor',$fila['asesor']);\n\t\t\t$asesor = $comision->appendChild($asesor);\n\t\t\t$concepto = $xml->createElement('concepto',$fila['concepto']);\n\t\t\t$concepto = $comision->appendChild($concepto);\n\t\t\t$factura = $xml->createElement('factura',$fila['factura']);\n\t\t\t$factura = $comision->appendChild($factura);\n\t\t\t$desarrollo = $xml->createElement('desarrollo',$fila['desarrollo']);\n\t\t\t$desarrollo = $comision->appendChild($desarrollo);\n\t\t\t$departamento = $xml->createElement('departamento',$fila['depto']);\n\t\t\t$departamento = $comision->appendChild($departamento);\n\t\t\t$cliente = $xml->createElement('cliente',$fila['cliente']);\n\t\t\t$cliente = $comision->appendChild($cliente);\n\t\t\t$anticipo = $xml->createElement('anticipo',$fila['anticipo']);\n\t\t\t$anticipo = $comision->appendChild($anticipo);\n\t\t\t$monto = $xml->createElement('monto',$fila['monto']);\n\t\t\t$monto = $comision->appendChild($monto);\n\t\t\t$resto = $xml->createElement('resto',$fila['resta']);\n\t\t\t$resto = $comision->appendChild($resto);\n\t\t\t$estatus = $xml->createElement('estatus',$fila['estado']);\n\t\t\t$estatus = $comision->appendChild($estatus);\n\t\t}\n\t\t\n\t\tconectar(\"off\");\n\t\t$xml->formatOutput = true;\n\t\t$strings_xml = $xml->saveXML();\n\t\t$xml->save('admins_all_reg.xml');\n\t\t\n\t}", "public function asXML();", "public function createXML() {\n\t\treturn \"<atom:entry xmlns:atom='http://www.w3.org/2005/Atom'\\n\" .\r\n\t\t\t\t\"xmlns:apps='http://schemas.google.com/apps/2006'>\\n\" .\r\n\t\t\t\t\"<apps:property name=\\\"password\\\" value=\\\"\" . ProvisioningApi::escapeXML_Attr($this -> password) . \"\\\"/>\\n\" .\r\n\t\t\t\t\"<apps:property name=\\\"hashFunction\\\" value=\\\"\" . ProvisioningApi::escapeXML_Attr($this -> hashFunction) . \"\\\"/>\\n\" .\r\n\t\t\t\t\"<apps:property name=\\\"userEmail\\\" value=\\\"\" . ProvisioningApi::escapeXML_Attr($this -> userEmail) . \"\\\"/>\\n\" .\r\n\t\t\t\t\"<apps:property name=\\\"firstName\\\" value=\\\"\" . ProvisioningApi::escapeXML_Attr($this -> firstName) . \"\\\"/>\\n\" .\r\n\t\t\t\t\"<apps:property name=\\\"lastName\\\" value=\\\"\" . ProvisioningApi::escapeXML_Attr($this -> lastName) . \"\\\"/>\\n\" .\r\n\t\t\t\t\"<apps:property name=\\\"isAdmin\\\" value=\\\"\" . ProvisioningApi::escapeXML_Attr($this -> isAdmin) . \"\\\"/>\\n\" .\n\t\t\t\t\"<apps:property name=\\\"isSuspended\\\" value=\\\"\" . ProvisioningApi::escapeXML_Attr($this -> isSuspended) . \"\\\"/>\\n\" .\r\n\t\t\t\t\"</atom:entry>\\n\";\n\t}", "public function createXml()\n\t{\n\t\t$this->validate(array('name', 'id'));\n\t\t$xml_string = \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?><entry xmlns='http://www.w3.org/2005/Atom'></entry>\";\n\t\t$xml = simplexml_load_string($xml_string);\n\t\t$xml->addChild(\"id\", $this->id);\n\t\t$xml->addChild(\"title\");\n\t\t$xml->addChild(\"author\");\n\t\t$xml->addChild(\"updated\", \"2008-04-16\");\n\t\t$contentNode = $xml->addChild(\"content\");\n\t\t$contentNode->addAttribute(\"type\", \"application/vnd.ctct+xml\");\n\t\t$listNode = $contentNode->addChild(\"ContactList\");\n\t\t$listNode->addAttribute(\"xmlns\", \"http://ws.constantcontact.com/ns/1.0/\");\n\t\t$listNode->addChild(\"OptInDefault\", $this->optInDefault);\n\t\t$listNode->addChild(\"Name\", $this->name);\n\t\t$listNode->addChild(\"SortOrder\", $this->sortOrder);\n\t\treturn $xml->asXML();\n\t}", "function basicXMLNode( $obj, $nodeName )\r\n{\r\n\t$xmlString = \"<Site>\"; //. $nodeName .\r\n\r\n\tforeach ($obj as $fieldName => $fieldValue) {\r\n\t\t$xmlString .= \"<\" . $fieldName . \">\";\r\n\t\t$xmlString .= $fieldValue;\r\n\t\t$xmlString .= \"</\" . $fieldName . \">\";\r\n\t}\r\n\t\r\n\t$xmlString .= \"</Site>\"; //. $nodeName .\r\n\t\r\n\t\r\n\t\r\n\treturn $xmlString;\r\n}", "public function buildNode( $doc, &$parent_node, $hierarchy ){\n\t\tif( is_array( $hierarchy ) ){\n\t\t\tforEach( $hierarchy as $key => $value ){\n\t\t\t\t$current_node = $doc->createElement( $key );\n\t\t\t\t$this->buildNode( $doc, $current_node, $value );\n\t\t\t\t$parent_node->appendChild( $current_node );\n\t\t\t}\n\t\t}\n\t\telse{\n\t\t\t$current_node = $doc->createTextNode( $hierarchy );\n\t\t\t$parent_node->appendChild( $current_node );\n\t\t}\n\t}", "protected function _buildNode()\n {\n $fileElement = $this->_createElement('file', null, $this->_record->id);\n if ($this->_record->order) {\n $fileElement->setAttribute('order', $this->_record->order);\n }\n $srcElement = $this->_createElement('src', $this->_record->getWebPath(),\n null, $fileElement);\n $authenticationElement = $this->_createElement('authentication',\n $this->_record->authentication, null, $fileElement);\n $this->_buildElementSetContainerForRecord($this->_record, $fileElement);\n\n if (in_array($this->_context, array('file'))) {\n $item = get_db()->getTable('Item')->find($this->_record->item_id);\n $itemOmekaXml = new Output_ItemOmekaXml($item, $this->_context);\n $itemElement = $this->_doc->importNode($itemOmekaXml->_node, true);\n $fileElement->appendChild($itemElement);\n }\n\n $this->_node = $fileElement;\n }", "private function makeNode($tagName, $tagContent, $attributes = null)\n\t{ \n\t\t$nodeText = '';\n\t\t$attrText = '';\n\n\t\tif(is_array($attributes))\n\t\t{\n\t\t\tforeach ($attributes as $key => $value) \n\t\t\t{\n\t\t\t\t$attrText .= \" $key=\\\"$value\\\" \";\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(is_array($tagContent) && $this->version == RSS1)\n\t\t{\n\t\t\t$attrText = ' rdf:parseType=\"Resource\"';\n\t\t}\n\t\t\n\t\t\n\t\t$attrText .= (in_array($tagName, $this->CDATAEncoding) && $this->version == ATOM)? ' type=\"html\" ' : '';\n\t\t$nodeText .= (in_array($tagName, $this->CDATAEncoding))? \"<{$tagName}{$attrText}><![CDATA[\" : \"<{$tagName}{$attrText}>\";\n\t\t \n\t\tif(is_array($tagContent))\n\t\t{ \n\t\t\tforeach ($tagContent as $key => $value) \n\t\t\t{\n\t\t\t\t$nodeText .= $this->makeNode($key, $value);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$nodeText .= (in_array($tagName, $this->CDATAEncoding))? $tagContent : htmlentities($tagContent);\n\t\t} \n\t\t\t\n\t\t$nodeText .= (in_array($tagName, $this->CDATAEncoding))? \"]]></$tagName>\" : \"</$tagName>\";\n\n\t\treturn $nodeText . PHP_EOL;\n\t}", "public function generujXML() {\n // nadawca\n $elementNadawca = $this->xml->createElement($this->ElementXmlNazwa());\n\n foreach ($this->regulyWalidacji() as $regula) {\n $atrybutNadawca = $this->xml->createAttribute($regula['pole']);\n $atrybutNadawca->value = $this->$regula['pole'];\n $elementNadawca->appendChild($atrybutNadawca);\n }\n\n return $this->xml->appendChild($elementNadawca);\n }", "private function makeNode($tagName, $tagContent, $attributes = array()) {\n\t\t$node = '';\n\n\t\tif (is_array($tagContent) && $this->type == 'RSS1')\n\t\t\t$attributes['rdf:parseType'] = \"Resource\";\n\n\t\tif (in_array($tagName, $this->feedElements['CDATAEncoded'])) {\n\t\t\tif ($this->type == 'ATOM')\n\t\t\t\t$attributes['type'] = \"html\";\n\t\t\t$node .= $this->openTag($tagName, $attributes) . '<![CDATA[';\n\t\t}\n\t\telse\n\t\t\t$node .= $this->openTag($tagName, $attributes);\n\n\t\tif (is_array($tagContent)) {\n\t\t\tforeach ($tagContent as $tag => $content)\n\t\t\t\t$node .= $this->makeNode($tag, $content);\n\t\t}\n\t\telse\n\t\t\t$node .= in_array($tagName, $this->feedElements['CDATAEncoded']) ? $tagContent : $this->encode($tagContent);\n\n\t\t$node .= in_array($tagName, $this->feedElements['CDATAEncoded']) ? PHP_EOL . ']]>' : '';\n\n\t\t$node .= $this->closeTag($tagName);\n\n\t\treturn $node . PHP_EOL;\n\t}", "public function compose()\n {\n $elementBasic = $this->domDocument->createElementNS(\"KaseyaWS\",\"GetRoles\",null);\n\n $elementReq = $this->domDocument->createElement(\"req\");\n\n $elementSession = $this->domDocument->createElement(\"SessionID\",$this->sessionID);\n\n $elementReq->appendChild($elementSession);\n\n $elementBasic->appendChild($elementReq);\n\n $this->domDocument->appendChild($elementBasic);\n\n\n\n\n\n }", "protected function _createXml() {\n\t\t$methodCall = $this->_xml->createElement('methodCall', null);\n\t\t$methodCall->createElement('methodName', $this->methodName);\t\n\t\t$this->_paramsEl = $methodCall->createElement('params', null);\t\n\t\t\n\t\t$this->__parseData($this->_data, $this->_paramsEl, false);\n\t}", "function genexml2($matricule,$nom,$prenom,$datenaissance,$lieunaissance,$telephone,$montantdu,$anneeacademique,$statut,$etablissement,$filiere,$nationalite, $type){\n\t$xml = new DOMDocument('1.0', 'utf-8');\n\t//$items = $xml->createElement('id_dataTable');\n\t\t$item = $xml->createElement('etudiant');\n\t\t$db_item=[\"matricule\"=>$matricule,\"nom\"=>$nom,\"prenom\"=>$prenom,\"telephone\"=>$telephone,\"anneeacademique\"=>$anneeacademique,\"etablissement\"=>$etablissement,\"anneeEtude\"=>$filiere,\"nationalite\"=>$nationalite,\"statut\"=>$statut,\"montant\"=>$montantdu,\"categorie\"=>$type,\"datePaiement\"=>\"\",\"reftransaction\"=>\"\",\"intermediairePaiement\"=>\"\"];\n\t\tforeach($db_item as $key => $value){\n\t\t\t$node = $xml->createElement($key,$value);\n\t\t\t$item->appendChild($node);\n\t\t}\n\t\t//$items->appendChild($item);\n\t$xml->appendChild($item);\n\t$date=date(\"Y-m-d\");\n\t$date=convertdatebanque($date);\n\t\n\treturn $xml->saveXML();\n}", "public static function create_xrd() {\n $xrd = '<?xml version=\"1.0\" encoding=\"UTF-8\"?>'.\"\\n\";\n $xrd .= '<XRD xmlns=\"http://docs.oasis-open.org/ns/xri/xrd-1.0\">'.\"\\n\";\n $xrd .= ' <Subject>'.site_url(\"/\").'</Subject>'.\"\\n\";\n $xrd .= ' <Property type=\"http://www.oexchange.org/spec/0.8/prop/vendor\">'.get_bloginfo('name').'</Property>'.\"\\n\";\n $xrd .= ' <Property type=\"http://www.oexchange.org/spec/0.8/prop/title\">'.get_bloginfo('description').'</Property>'.\"\\n\";\n $xrd .= ' <Property type=\"http://www.oexchange.org/spec/0.8/prop/name\">\"Press This\" bookmarklet</Property>'.\"\\n\";\n $xrd .= ' <Property type=\"http://www.oexchange.org/spec/0.8/prop/prompt\">Press This</Property>'.\"\\n\";\n $xrd .= ' <Link rel= \"icon\" href=\"'.OExchangePlugin::get_icon_url(16).'\" />'.\"\\n\";\n $xrd .= ' <Link rel= \"icon32\" href=\"'.OExchangePlugin::get_icon_url(32).'\" />'.\"\\n\";\n $xrd .= ' <Link rel= \"http://www.oexchange.org/spec/0.8/rel/offer\" href=\"'.admin_url('press-this.php').'\" type=\"text/html\"/>'.\"\\n\";\n $xrd .= '</XRD>';\n\n return $xrd;\n }", "public function __construct($root = 'root',$node_name = 'node'){\r\n parent::__construct();\r\n\r\n //set the encoding\r\n $this->encoding = \"utf-8\";\r\n //format the output\r\n $this->formatOutput = true;\r\n\r\n //set the node names\r\n $this->node_name = $node_name;\r\n\r\n //create the root element\r\n $this->root = $this->appendChild($this->createElement($root));\r\n\r\n $this->xpath = new DOMXPath($this);\r\n }", "function appendXmlNode($domDocument, $parentNode, $name, $value){\n \t$childNode = $domDocument->createElement($name);\n \t$childNodeValue = $domDocument->createTextNode($value);\n \t$childNode->appendChild($childNodeValue);\n \t$parentNode->appendChild($childNode);\n}", "private function makeNode($tagName, $tagContent, $attributes = null)\n {\n $nodeText = '';\n $attrText = '';\n\n if (is_array($attributes)) {\n foreach ($attributes as $key => $value) {\n $attrText .= \" $key=\\\"$value\\\" \";\n }\n }\n\n if (is_array($tagContent) && $this->version == RSS1) {\n $attrText = ' rdf:parseType=\"Resource\"';\n }\n\n\n $attrText .= (in_array($tagName, $this->CDATAEncoding) && $this->version == ATOM) ? ' type=\"html\" ' : '';\n\n\n if (in_array($tagName, $this->CDATAEncoding)) {\n\n if ($this->version == self::Turbo) {\n $str = \"<![CDATA[\";\n }\n\n else {\n $str = \"<{$tagName}{$attrText}><![CDATA[\";\n }\n }\n\n elseif ($this->version == self::AMP || $this->version == self::Telegram) {\n $str = \"{$tagName}{$attrText}\";\n }\n\n else {\n $str = \"<{$tagName}{$attrText}>\";\n }\n\n $nodeText .= $str;\n\n if (is_array($tagContent)) {\n foreach ($tagContent as $key => $value) {\n $nodeText .= $this->makeNode($key, $value);\n }\n }\n\n else {\n $nodeText .= $tagContent;\n }\n\n\n if (in_array($tagName, $this->CDATAEncoding)) {\n\n if ($this->version == self::Turbo) {\n $str = \"]]>\";\n }\n\n else {\n $str = \"]]></$tagName>\";\n }\n }\n\n elseif ($this->version == self::AMP || $this->version == self::Telegram) {\n $str = \"$tagName\";\n }\n\n else {\n $str = \"</$tagName>\";\n }\n\n $nodeText .= $str;\n\n return $nodeText . PHP_EOL;\n }", "private static function convert($node_name, $arr=array()) \n { \n //print_arr($node_name);\n $xml = self::getXMLRoot();\n $node = $xml->createElement($node_name);\n \n if(is_array($arr)){\n // get the attributes first.;\n if(isset($arr['@attributes'])) {\n foreach($arr['@attributes'] as $key => $value) {\n if(!self::isValidTagName($key)) {\n throw new Exception('[Array2XML] Illegal character in attribute name. attribute: '.$key.' in node: '.$node_name);\n }\n $node->setAttribute($key, self::bool2str($value));\n }\n unset($arr['@attributes']); //remove the key from the array once done.\n }\n \n // check if it has a value stored in @value, if yes store the value and return\n // else check if its directly stored as string\n if(isset($arr['@value'])) {\n $node->appendChild($xml->createTextNode(self::bool2str($arr['@value'])));\n unset($arr['@value']); //remove the key from the array once done.\n //return from recursion, as a note with value cannot have child nodes.\n return $node;\n } else if(isset($arr['@cdata'])) {\n $node->appendChild($xml->createCDATASection(self::bool2str($arr['@cdata'])));\n unset($arr['@cdata']); //remove the key from the array once done.\n //return from recursion, as a note with cdata cannot have child nodes.\n return $node;\n }\n }\n \n //create subnodes using recursion\n if(is_array($arr)){\n // recurse to get the node for that key\n foreach($arr as $key=>$value){\n if(!self::isValidTagName($key)) {\n throw new Exception('[Array2XML] Illegal character in tag name. tag: '.$key.' in node: '.$node_name);\n }\n if(is_array($value) && is_numeric(key($value))) {\n // MORE THAN ONE NODE OF ITS KIND;\n // if the new array is numeric index, means it is array of nodes of the same kind\n // it should follow the parent key name\n foreach($value as $k=>$v){\n $node->appendChild(self::convert($key, $v));\n }\n } else {\n // ONLY ONE NODE OF ITS KIND\n $node->appendChild(self::convert($key, $value));\n }\n unset($arr[$key]); //remove the key from the array once done.\n }\n }\n \n // after we are done with all the keys in the array (if it is one)\n // we check if it has any text value, if yes, append it.\n if(!is_array($arr)) {\n $node->appendChild($xml->createTextNode(self::bool2str($arr)));\n }\n \n return $node;\n }", "public function createNode($arr,$node = null){\r\n if(is_null($node)){\r\n $node = $this->root;\r\n }\r\n foreach($arr as $element => $value){\r\n $element = is_numeric($element)? $this->node_name : $element;\r\n\r\n $child = $this->createElement($element,(is_array($value)? null : $value));\r\n $node->appendChild($child);\r\n\r\n if(is_array($value)){\r\n self::createNode($value,$child);\r\n }\r\n }\r\n }", "private function open_xml()\n {\n $xmlw = new XMLWriter();\n $xmlw->openMemory();\n\n if (isset($this->request['fs_curl_debug']) && $this->request['fs_curl_debug'] > 0) {\n $indent = true;\n } else {\n $indent = false;\n }\n $xmlw->setIndent($indent);\n $xmlw->setIndentString(' ');\n\n $xmlw->startDocument('1.0', 'UTF-8', 'no');\n $xmlw->startElement('document');\n $xmlw->writeAttribute('type', 'freeswitch/xml');\n\n return $xmlw;\n }", "private function XML_addDate() {\n\t\t$dateEntity = $this->xmlHandler->createElement('date');\n\t\t$dateEntity->appendChild($this->xmlHandler->createTextNode(date(\"F j, Y, g:i a\")));\n\n\t\t$this->xmlRoot->appendChild($dateEntity);\n\t}", "function XML(){\n\t\t$this->__construct();\n\t\t$this->Set_Template( 'header', 'rss/header-xml.php' );\n\t\t$this->Set_Template( 'footer', 'rss/footer-xml.php' );\n\t}", "public function generate()\n {\n $this->document = new \\DOMDocument('1.0', 'utf-8');\n $this->document->formatOutput = true;\n\n $rootEl = $this->document->createElementNS($this->nsUrl, 'gupdate');\n $rootEl->setAttribute('protocol', '2.0');\n $this->document->appendChild($rootEl);\n\n $appId = $this->idGenerator->getAppId();\n $appEl = $this->document->createElementNS($this->nsUrl, 'app');\n $appEl->setAttribute('appid', $appId);\n $rootEl->appendChild($appEl);\n\n $updateCheckEl = $this->document->createElementNS($this->nsUrl, 'updatecheck');\n $updateCheckEl->setAttribute('codebase', $this->packageUrl);\n $updateCheckEl->setAttribute('version', $this->package->getPackageVersion());\n $appEl->appendChild($updateCheckEl);\n }", "function __setRoot() {\r\n\t\t$this->root = $this->domFragment->createElementNS(self :: TEXT, 'text:user-field-get');\r\n\t}", "function begin_xml() {\n\t\tglobal $pgv_lang, $factarray;//, $eventsArray, $dom, $ePeople, $this->eFams, $egSources, $ePlaces, $eObject;\n\t\t$user = PGV_USER_NAME;\n\n\t\t$this->dom = new DomDocument(\"1.0\", \"UTF-8\");\n\t\t$this->dom->formatOutput = true;\n\n\t\t$eRoot = $this->dom->createElementNS(\"http://gramps-project.org/xml/1.1.0/\", \"database\");\n\t\t$eRoot = $this->dom->appendChild($eRoot);\n\n\t\t$eHeader = $this->dom->createElement(\"header\");\n\t\t$eHeader = $eRoot->appendChild($eHeader);\n\n\t\t$eCreated = $this->dom->createElement(\"created\");\n\t\t$eCreated = $eHeader->appendChild($eCreated);\n\t\t$eCreated->setAttribute(\"date\", date(\"Y-m-d\"));\n\t\t$eCreated->setAttribute(\"version\", \"1.1.2.6\");\n\n\t\t$eResearcher = $this->dom->createElement(\"researcher\");\n\t\t$eResname = $this->dom->createElement(\"resname\");\n\t\t$etResname = $this->dom->createTextNode(getUserFullName($user));\n\t\t$etResname = $eResname->appendChild($etResname);\n\t\t$eResname = $eResearcher->appendChild($eResname);\n\t\t$eResemail = $this->dom->createElement(\"resemail\");\n\t\t$etResemail = $this->dom->createTextNode(get_user_setting($user, 'email'));\n\t\t$etResemail = $eResemail->appendChild($etResemail);\n\t\t$eResemail = $eResearcher->appendChild($eResemail);\n\t\t$eResearcher = $eHeader->appendChild($eResearcher);\n\n\t\t$this->egEvents = $this->dom->createElement(\"events\");\n\t\t$this->egEvents = $eRoot->appendChild($this->egEvents);\n\n\t\t$this->ePeople = $this->dom->createElement(\"people\");\n\t\t$this->ePeople = $eRoot->appendChild($this->ePeople);\n\n\t\t$this->eFams = $this->dom->createElement(\"families\");\n\t\t$this->eFams = $eRoot->appendChild($this->eFams);\n\n\t\t$this->egSources = $this->dom->createElement(\"sources\");\n\t\t$this->egSources = $eRoot->appendChild($this->egSources);\n\n\t\t$this->ePlaces = $this->dom->createElement(\"places\");\n\t\t$this->ePlaces = $eRoot->appendChild($this->ePlaces);\n\n\t\t$this->eObject = $this->dom->createElement(\"objects\");\n\t\t$this->eObject = $eRoot->appendChild($this->eObject);\n\t}", "function toXML()\n {\n // Not implemented yet.\n }", "protected function _createDataNode(\\DOMElement $fieldNode) {}", "protected function buildPackageNode() {\n\t\t$this->parentNode = $this->node;\n\t\t$this->node = $this->getToken();\n\t\t\n\t\t$sql = \"INSERT INTO\twcf\".WCF_N.\"_package_installation_node\n\t\t\t\t\t(queueID, processNo, sequenceNo, node, parentNode, nodeType, nodeData)\n\t\t\tVALUES\t\t(?, ?, ?, ?, ?, ?, ?)\";\n\t\t$statement = WCF::getDB()->prepareStatement($sql);\n\t\t$statement->execute(array(\n\t\t\t$this->installation->queue->queueID,\n\t\t\t$this->installation->queue->processNo,\n\t\t\t0,\n\t\t\t$this->node,\n\t\t\t$this->parentNode,\n\t\t\t'package',\n\t\t\t'a:0:{}'\n\t\t));\n\t}", "private function generateRootElement()\n {\n try {\n $root = $this->xml->createElement('program');\n\n if (!$root) throw new Exception(\"Can not create program element.\", 99);\n } catch (Exception $exception) {\n die($exception->terminateProgram());\n }\n\n $root->setAttribute('language', 'IPPcode21');\n\n return $root;\n }", "public function build(){\n\n\t\t// Node Attributes;\n\t\t$this->getAttrString();\n\t\t\n\t\tif(is_array($this->content)){\n\t\t\t$this->html.= '<'. $this->tag .' '. $this->attrString .'>' ;\n\t\t\tforeach ($this->content as $key => $value) \n\t\t\t\t$this->html.= $value->build() ;\n\n\t\t\t$this->html .= '</'. $this->tag .'>';\n\t\t}else{\n\t\t\t// Node Content\n\t\t\t$nodeContent = $this->content instanceof HTMLNode ? $this->content->build() : $this->content ; \n\n\t\t\t// Node HTML\n\t\t\t$this->html = '<'. $this->tag .' '. $this->attrString .'>'. $nodeContent .'</'. $this->tag .'>' ;\n\t\t}\n\n\t\treturn $this->html ;\n\t}", "public function toXML()\n {\n // TODO: Implement toXML() method.\n }", "function toXML() {\n return \"<!-- \" . strval($this->content) . \"-->\";\n }", "function createXML($outputArray,$ext=FALSE)\t{\n\n\t\t\t// Options:\n\t\t$options = array(\n\t\t\t'parentTagMap' => array(\n\t\t\t\t'data' => 'languageKey',\n\t\t\t\t'orig_hash' => 'languageKey',\n\t\t\t\t'orig_text' => 'languageKey',\n\t\t\t\t'labelContext' => 'label',\n\t\t\t\t'languageKey' => 'label'\n\t\t\t)\n\t\t);\n\n\t\t\t// Creating XML file from $outputArray:\n\t\t$XML = '<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\" ?>'.chr(10);\n\t\t$XML.= t3lib_div::array2xml($outputArray,'',0,$ext ? 'T3locallangExt' : 'T3locallang',0,$options);\n\n\t\treturn $XML;\n\t}", "protected function buildXml()\n\t{\n\t\t$xml = new DOMDocument('1.0', 'utf8');\n\t\t$cra_inquiry = $xml->createElement('LoanRecord');\n\t\t$cra_inquiry->appendChild($this->buildData($xml));\n\t\t\n\t\t$xml->appendChild($cra_inquiry);\n\t\t\n\t\treturn $xml;\n\t}", "protected function __setRoot() {\r\n\t\t$this->root = $this->domFragment->createElementNS(self :: TEXT, 'text:p');\r\n\t}", "function __setRoot() {\r\n\t\t$this->root = $this->domFragment->createElementNS(self :: TEXT, 'text:user-field-decls');\r\n\t}", "protected function generate_instruction()\n {\n $this->xml->startElement(\"instruction\");\n $this->xml->writeAttribute(\"order\", $this->instrCount);\n $this->xml->writeAttribute(\"opcode\", $this->token);\n }", "public function createXmlNode(\\SimpleXMLElement $node): \\SimpleXMLElement\n {\n $lineNode = parent::createXmlNode($node);\n\n if ($this->getOrderReferences() !== null) {\n foreach ($this->getOrderReferences() as $orderReferences) {\n $orderReferences->createXmlNode($lineNode);\n }\n }\n\n if (isset($this->productCode)) {\n $lineNode->addChild(static::N_PRODUCTCODE, $this->getProductCode());\n } else {\n $lineNode->addChild(static::N_PRODUCTCODE);\n $this->getErrorRegistor()->addOnCreateXmlNode(\"ProductCode_not_valid\");\n }\n\n if (isset($this->productDescription)) {\n $lineNode->addChild(\n static::N_PRODUCTDESCRIPTION, $this->getProductDescription()\n );\n } else {\n $lineNode->addChild(static::N_PRODUCTDESCRIPTION);\n $this->getErrorRegistor()->addOnCreateXmlNode(\"ProductDescription_not_valid\");\n }\n\n if (isset($this->quantity)) {\n $lineNode->addChild(\n static::N_QUANTITY, $this->floatFormat($this->getQuantity())\n );\n } else {\n $lineNode->addChild(static::N_QUANTITY);\n $this->getErrorRegistor()->addOnCreateXmlNode(\"Quantity_not_valid\");\n }\n\n if (isset($this->unitOfMeasure)) {\n $lineNode->addChild(\n static:: N_UNITOFMEASURE, $this->getUnitOfMeasure()\n );\n } else {\n $lineNode->addChild(static:: N_UNITOFMEASURE);\n $this->getErrorRegistor()->addOnCreateXmlNode(\"UnitOfMeasure_not_valid\");\n }\n\n if (isset($this->unitPrice)) {\n $lineNode->addChild(\n static::N_UNITPRICE, $this->floatFormat($this->getUnitPrice())\n );\n } else {\n $lineNode->addChild(static::N_UNITPRICE);\n $this->getErrorRegistor()->addOnCreateXmlNode(\"UnitPrice_not_valid\");\n }\n\n return $lineNode;\n }", "public function generate()\n {\n $this->xml = new DOMDocument( '1.0', 'utf-8' );\n $this->xml->formatOutput = 1;\n\n $rss = $this->xml->createElementNS( self::NAMESPACE_URI, 'feed' );\n $this->channel = $rss;\n $this->root = $this->xml->appendChild( $rss );\n\n $this->generateRequired();\n $this->generateAtLeastOne();\n $this->generateOptional();\n $this->generateFeedModules( $this->channel );\n $this->generateItems();\n\n return $this->xml->saveXML();\n }", "protected function renderAsXML() {}", "function webmap_compo_lib_xml_build()\r\n{\r\n\t$this->webmap_compo_lib_xml_base();\r\n}", "private function createNode($data)\n {\n return (new Node($data));\n }", "protected function buildXML() {\n $xml = new \\DOMDocument('1.0', 'utf-8');\n $xml->formatOutput = true;\n\n $request = $xml->appendChild($xml->createElement('SMSBoxXMLRequest'));\n\n // add command, username and password params\n $username = $xml->createElement('username', $this->client->getConfig('username'));\n $password = $xml->createElement('password', $this->client->getConfig('password'));\n $command = $xml->createElement('command', strtoupper($this->getName()));\n\n $request->appendChild($username);\n $request->appendChild($password);\n $request->appendChild($command);\n\n $params = $request->appendChild($xml->createElement('parameters'));\n\n // add parameters\n foreach ($this->getApiCommand()->getParams() as $name => $arg) {\n if ($this->get($name) === true) {\n $params->appendChild($xml->createElement($name));\n } else if (!is_null($this->get($name)) && $this->get($name) !== false) {\n $params->appendChild($xml->createElement($name, $this->get($name)));\n }\n }\n\n return $xml;\n }", "function packXML($rootName){\n\t\t\t//create xml parser\n\t\t\t$this->xml = domxml_new_xmldoc('1.0');\n\t\t\t\n\t\t\t//set root node\n\t\t\t$this->root = domxml_add_root($this->xml,$rootName);\n\t\t}", "private function create_xml_file(){\r\n global $CFG;\r\n \r\n $tmpfileid = time().rand(1,99999);\r\n $tmpfile = 'export_xml_'.$tmpfileid.'.pdf';\r\n $this->attachfile = $CFG->tempdir.'/'.$tmpfile;\r\n \r\n $dom = new DOMDocument('1.0', 'utf-8');\r\n $dom->preserveWhiteSpace = false;\r\n $dom->formatOutput = true;\r\n $dom->loadXML($this->xml_structure);\r\n $dom->save($this->attachfile);\r\n }", "function createXmlFile()\r\n\t{\r\n\t\t/*\r\n\t\t<xml>\r\n\t\t\t<videofile src=\"eafade3f55760e4cdb44f82f2a4141f6ac439c5f\" thumbnail=\"e45829281e341081e43c4394544ddcee403ddc0b\" length=\"01:27\" text=\"Massmann 1\" />\r\n\t\t</xml>\r\n\t\t*/\r\n\t\t$output = '<?xml version=\"1.0\" encoding=\"UTF-8\"?><xml>';\r\n\t\r\n\t\t$videosQuery = $this->mc->database->query(\"SELECT * FROM \" . $this->mc->config['database_pref'] . \"concept_mediacenter AS A WHERE view_id = ?\", array(array($this->viewId, \"i\")), array(array(\"concept_mediacenter\", \"view_id\", \"video_name\")));\r\n\t\tforeach($videosQuery->rows as $currentVideo)\r\n\t\t{\r\n\t\t\t$output .= '<videofile src=\"' . $currentVideo->video_name . '\" thumbnail=\"' . $currentVideo->video_thumbnail . '\" length=\"' . $currentVideo->video_length . '\" text=\"' . $currentVideo->video_text . '\" />';\r\n\t\t}\r\n\t\t$output .= '</xml>';\r\n\t\t\r\n\t\t$outputFileSuffix = \"\";\r\n\t\t$outputFileHandle = fopen($this->mc->config['upload_dir'] . '/root/xml/'. $this->viewDetails->view_name . $outputFileSuffix . '.xml', 'wb');\r\n\t\tfwrite($outputFileHandle, $output);\r\n\t\tfclose($outputFileHandle);\r\n\t\t\r\n\t\treturn true;\r\n\t}", "function createXML(){\n global $test_result_html, $test_count, $test_fail, $test_pass, $today;\n echo\"<!DOCTYPE html>\n <html>\n <head>\n <style>\n article {\n width: 600px;\n margin-left: 10px;\n margin-right: auto;\n }\n h1 {\n font-size: 250%;\n font-family: serif;\n margin-bottom: 0;\n }\n table {\n font-family: arial, sans-serif;\n border-collapse: collapse;\n white-space: nowrap;\n }\n\n td, th {\n border: 1px solid #dddddd;\n text-align: left;\n padding: 8px;\n }\n\n tr:nth-child(even) {\n background-color: #dddddd;\n }\n th {\n background-color: #4CAF50;\n color: white;\n }\n .article-meta {\n font-family: sans-serif;\n color: #aaa;\n font-size: 12px;\n }\n </style>\n </head>\n <body>\n\n <article>\n <h1>IPPcode19</h1>\n <p class='article-meta'><strong>Author:</strong> Egor Shamardin <strong>Date:</strong> $today</p>\n </article>\n <span style='color: Gray; font-size:25px;'>&#9744 Total test: $test_count</span>\n <span style='color: MediumSeaGreen; font-size:25px;'>&#9745 Tests pass: $test_pass</span>\n <span style='color: Tomato; font-size:25px;'>&#9746 Tests fail: $test_fail</span>\n\n <table>\n <tr>\n <th>Test_name</th>\n <th>Result</th>\n </tr>$test_result_html\n </table>\n\n </body>\n </html>\";\n}", "private function response_xml($array) {\n require_once 'array2xml.php';\n try {\n// header(\"Content-type: text/xml\");\n $xml = new array2xml('my_node');\n $xml->createNode($array);\n return $xml;\n } catch (Exception $e) {\n return $e->getMessage();\n }\n }", "private function version()\r\n\t{\r\n\t\t$xml = simplexml_load_file(JPATH_COMPONENT_ADMINISTRATOR . '/fabrik.xml');\r\n\t\t$version = $this->doc->createElement('fabrikversion', (string) $xml->version);\r\n\r\n\t\treturn $version;\r\n\t}", "public static function generate() {\n\t\tstatic::$document = new DOMDocument('1.0', 'UTF-8');\n\t\t\n\t\t// create our rss feed\n\t\t$rss = static::element('rss', null, array('version' => '2.0'));\n\t\tstatic::$document->appendChild($rss);\n\t\t\n\t\t// create channel\n\t\t$channel = static::element('channel');\n\t\t$rss->appendChild($channel);\n\t\n\t\t\t// title\n\t\t\t$title = static::element('title', Config::get('metadata.sitename'));\n\t\t\t$channel->appendChild($title);\n\n\t\t\t// link\n\t\t\t$link = static::element('link', 'http://' . $_SERVER['HTTP_HOST']);\n\t\t\t$channel->appendChild($link);\n\n\t\t\t// description\n\t\t\t$description = static::element('description', Config::get('metadata.description'));\n\t\t\t$channel->appendChild($description);\n\n\t\t// articles\n\t\t$params = array('status' => 'published', 'sortby' => 'id', 'sortmode' => 'desc');\n\n\t\tforeach(Posts::list_all($params) as $post) {\n\t\t\t$item = static::element('item');\n\t\t\t$channel->appendChild($item);\n\n\t\t\t\t// title\n\t\t\t\t$title = static::element('title', $post->title);\n\t\t\t\t$item->appendChild($title);\n\t\t\n\t\t\t\t// link\n\t\t\t\t$url = 'http://' . $_SERVER['HTTP_HOST'] . Url::make(IoC::resolve('posts_page')->slug . '/' . $post->slug);\n\t\t\t\t$link = static::element('link', $url);\n\t\t\t\t$item->appendChild($link);\n\t\t\t\n\t\t\t\t// description\n\t\t\t\t$description = static::element('description', $post->description);\n\t\t\t\t$item->appendChild($description);\n\t\t\t\t\n\t\t\t\t// date\n\t\t\t\t$date = static::element('pubDate', date(DATE_RSS, $post->created));\n\t\t\t\t$item->appendChild($date);\n\n\t\t}\n\n\t\t// dump xml tree\n\t\treturn static::$document->saveXML();\n\t}", "public function __toString() {\n\t\treturn $this->xml_definition->asXML();\n\t}", "function to_xml(){\n\t\tif ($this->skip) return \"\";\n\t\t\n\t\t$str=\"<item id='\".$this->get_id().\"' >\";\n\t\tfor ($i=0; $i<sizeof($this->config->text); $i++){\n\t\t\t$extra = $this->config->text[$i][\"name\"];\n\t\t\t$str.=\"<\".$extra.\"><![CDATA[\".$this->data[$extra].\"]]></\".$extra.\">\";\n\t\t}\n\t\treturn $str.\"</item>\";\n\t}", "public function toXML()\n {\n $xmlString = \"<?xml version=\\\"1.0\\\"?><conversion></conversion>\";\n $xml = new \\SimpleXMLElement($xmlString);\n\n if (isset($this->timestamp)) {\n $xml->addChild(\"timestamp\", $this->timestamp);\n }\n if (isset($this->timestamp_sql)) {\n $xml->addChild(\"timestamp_sql\", $this->timestampSql);\n }\n if (isset($this->contact_id)) {\n $xml->addChild(\"contact_id\", $this->contactId);\n }\n if (isset($this->contact_email)) {\n $xml->addChild(\"contact_email\", $this->contactEmail);\n }\n if (isset($this->contact_external_id)) {\n $xml->addChild(\"contact_external_id\", $this->contactExternalId);\n }\n if (isset($this->value)) {\n $xml->addChild(\"value\", $this->value);\n }\n if (isset($this->mailing_sent_date)) {\n $xml->addChild(\"mailing_sent_date\", $this->mailingSentTimestamp);\n }\n if (isset($this->mailing_sent_date_sql)) {\n $xml->addChild(\"mailing_sent_date_sql\", $this->mailingSentTimestampSql);\n }\n if (isset($this->mailing_id)) {\n $xml->addChild(\"mailing_id\", $this->mailingId);\n }\n if (isset($this->mailing_name)) {\n $xml->addChild(\"mailing_name\", $this->mailingName);\n }\n if (isset($this->site_id)) {\n $xml->addChild(\"site_id\", $this->siteId);\n }\n if (isset($this->site_name)) {\n $xml->addChild(\"site_name\", $this->siteName);\n }\n if (isset($this->goal_id)) {\n $xml->addChild(\"goal_id\", $this->goalId);\n }\n if (isset($this->goal_name)) {\n $xml->addChild(\"goal_name\", $this->goalName);\n }\n if (isset($this->link_id)) {\n $xml->addChild(\"link_id\", $this->linkId);\n }\n if (isset($this->link_url)) {\n $xml->addChild(\"link_url\", $this->linkUrl);\n }\n\n return $xml;\n }", "protected function createXmlGraph() {\n // Defines the constant LOCALE for the use in the template\n define(LOCALE, $GLOBALS['TSFE']->config['config']['locale_all']);\n\n // Defines the constant CURRENT_PID for the use in the template\n define(CURRENT_PID, $GLOBALS['TSFE']->page['uid']);\n\n // Defines the constant STORAGE_PID for the use in the template\n $storageSiterootPids = $GLOBALS['TSFE']->getStorageSiterootPids();\n define(STORAGE_PID, $storageSiterootPids['_STORAGE_PID']);\n\n // Redefines the constant for TTF directory if necessary\n $unserializedConfiguration = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['sav_jpgraph']);\n if ($unserializedConfiguration['plugin.']['sav_jpgraph.']['ttfDir']) {\n define('TTF_DIR', $unserializedConfiguration['plugin.']['sav_jpgraph.']['ttfDir']);\n }\n\n // Defines the main directory\n define('JP_maindir', \\TYPO3\\CMS\\Core\\Utility\\ExtensionManagementUtility::extPath('sav_jpgraph') . 'Classes/JpGraph/');\n\n // Defines the cache dir\n define('CACHE_DIR', 'typo3temp/sav_jpgraph/');\n\n // Requires the xml class\n require_once(\\TYPO3\\CMS\\Core\\Utility\\ExtensionManagementUtility::extPath('sav_jpgraph'). 'Classes/XmlParser/XmlTypo3Tag.php');\n require_once(\\TYPO3\\CMS\\Core\\Utility\\ExtensionManagementUtility::extPath('sav_jpgraph'). 'Classes/XmlParser/XmlGraph.php');\n\n // Creates the xlmgraph\n $this->xmlGraph = GeneralUtility::makeInstance('Tx_SavJpgraph_XmlParser_xmlGraph');\n }", "function generateXML( $node,&$strArr,$level ){\r\n\r\n\t$i=0;\r\n\t$tabs=\"\";\r\n\twhile( $i<$level ){\r\n\t\t$tabs .= \"\t\";\r\n\t\t$i++;\r\n\t}\r\n\t//print_r($node);\r\n\tif( isset($node['childs']) && is_array( $node['childs'] ) && count( $node['childs'] )>0 ){\r\n\t\t$strArr[] = $tabs.\"<\".$node['name'].\">\";\r\n\t\t$i=0;\r\n\t\tforeach ( $node['childs'] as $k=>$c ) {\r\n\t\t\tgenerateXML( $c,$strArr,$level+1 );\r\n\t\t}\r\n\t\t$strArr[] = $tabs.\"</\".$node['name'].\">\";\r\n\t}\r\n\telse{\r\n\t\t$strArr[] = $tabs.\"<\".$node['name'].\">\".$node['value'].\"</\".$node['name'].\">\";\r\n\t}\r\n}", "public function generate_head()\n {\n $this->xml->openMemory();\n $this->xml->setIndent(true);\n $this->xml->startDocument(\"1.0\",\"UTF-8\");\n $this->xml->startElement(\"program\");\n $this->xml->writeAttribute(\"language\",\"IPPcode19\");\n }", "public function toXML()\n {\n $namespace = 'tns';\n $writer = new XMLWriter();\n $writer->openMemory();\n $writer->setIndent(true);\n $writer->setIndentString(' ');\n $writer->startElementNs($namespace, 'Naknada', null);\n $writer->writeElementNs($namespace, 'NazivN', null, $this->getName());\n $writer->writeElementNs($namespace, 'IznosN', null, $this->getValue());\n $writer->endElement();\n\n return $writer->outputMemory();\n }", "function create($object, $xmlFile = null){\r\n\t\tif($xmlFile == null)\r\n\t\t\t$xmlFile = constant(\"OBJECT_XML\");\t\t\r\n\t\t\r\n\t\t$xml = simplexml_load_file($xmlFile);\r\n\t\t$xml = $object->addToXML($xml);\r\n\t\t$xml->asXML($xmlFile);\r\n\t}", "function XML(){\n\t\t\t\t$this->parser = &xml_parser_create();\n\t\t\t\txml_parser_set_option($this->parser, XML_OPTION_CASE_FOLDING, false);\n\t\t\t\txml_set_object($this->parser, $this);\n\t\t\t\txml_set_element_handler($this->parser, 'open','close');\n\t\t\t\txml_set_character_data_handler($this->parser, 'data');\n\t\t\t}", "function createXMLfile($phonebook){\r\n\r\n/* Het handigste is om een leeg bestand generated.phonebook.xml aan te maken en de juiste rechten toe te kennen. \r\n De onderstaande regel moet aangepast worden in bijv. $filePath = 'C://DIRECTORY/ANDERE/DIRECTORY/generated.phonebook.xml'; onder windows\r\n*/\r\n\t$filePath = '/var/www/html/telefoonboek/generated.phonebook.xml'; \r\n\t\r\n\t$document = new DOMDocument(\"1.0\",\"UTF-8\");\r\n\t$root = $document->createElement('IPPhoneDirectory');\r\n $parent1 = $document->createElement('Title','Phonelist');\r\n $parent2= $document->createElement('Prompt','Prompt');\r\n \t$root->appendChild($parent1);\r\n \t$root->appendChild($parent2);\r\n\t$document->appendChild($root);\r\n\r\n\tfor($i=0; $i<count($phonebook); $i++){\r\n\r\n\t$_Name \t = $phonebook[$i]['name'];\r\n\t$_phonenumber = $phonebook[$i]['number']; \r\n\r\n\t$_Directory = $document->createElement('DirectoryEntry');\r\n $name = $document->createElement('Name', $_Name);\r\n $_Directory->appendChild($name); \r\n $phonenumber = $document->createElement('Telephone', $_phonenumber);\r\n $_Directory->appendChild($phonenumber);\r\n \t\r\n\t$root->appendChild($_Directory);\r\n\t}\r\n\r\n $document->appendChild($root);\r\n \r\n $document->save($filePath)or die(\"Error saving phonebook file. Check folder or permissions?\"); \r\n echo \"Saving changes\";\r\n// echo $document->saveXML() . \"\\n\";\r\n}", "function makeXML($template) {\n\t# ensure its a v2 template if the Config entries exist\n\tif ( $template['Config'] && ! $template['@attributes'] )\n\t\t$template['@attributes'] = array(\"version\"=>2);\n\n\tfixAttributes($template,\"Network\");\n\tfixAttributes($template,\"Config\");\n\n\t$Array2XML = new Array2XML();\n\t$xml = $Array2XML->createXML(\"Container\",$template);\n\treturn $xml->saveXML();\n}", "function &AppendNode($Name)\n {\n //$node =& new XMLNode($Name);\n $node = new XMLNode($Name); // FRC\n $node->SetParent($this);\n\n // Do not use array_push with pass-by-reference any more to avoid\n // allow_call_time_pass_reference warning (Oliver Grahl, 2006-08-31)\n //array_push($this->ChildNodes, &$node);\n $this->ChildNodes[] =& $node;\n\n return $node;\n }", "private function _print_xml()\n\t{\n\t\n\t}", "function buildOutput()\n {\n $dom = new DOMDocument('1.0', 'UTF-8');\n $field = $dom->createElement('field');\n if ( !isset($this->class) )\n {\n $field->setAttribute('class', $this->type);\n } else {\n $field->setAttribute('class', $this->class);\n }\n $field->setAttribute('id', $this->name);\n $field->setAttribute('label', $this->label);\n $field->setAttribute('name', $this->name);\n $field->setAttribute('type', $this->type);\n if ( is_array($this->options) )\n {\n foreach ( $this->options AS $name=>$value )\n {\n $field->setAttribute($name, $value);\n }\n }\n $field->appendChild($dom->createCDATASection($this->value));\n return $field;\n }", "public function __toString()\n {\n $doc = DOMDocumentFactory::create();\n $root = $doc->createElementNS(Constants::NS_SAML, 'root');\n $ele = $this->toXML($root);\n\n return $doc->saveXML($ele);\n }", "public function generateXML()\n {\n $xml = new xmlWriter();\n $xml->openMemory();\n $xml->setIndent(true);\n\n $xml->startDocument('1.0', $this->charset);\n\n $xml->startElement('rdf:RDF');\n $xml->writeAttribute('xmlns:rdf', 'http://www.w3.org/1999/02/22-rdf-syntax-ns#');\n $xml->writeAttribute('xmlns', 'http://purl.org/rss/1.0/');\n\n $xml->startElement('channel');\n $xml->writeAttribute('rdf:about', $this->resource);\n\n $xml->writeElement('title', $this->title);\n $xml->writeElement('link', $this->link);\n $xml->writeElement('description', $this->description);\n\n if (!is_null($this->image)) {\n $xml->startElement('image');\n $xml->writeAttribute('rdf:resource', $this->image->url);\n $xml->endElement();\n }\n\n if (!is_null($this->textinput)) {\n $xml->startElement('textinput');\n $xml->writeAttribute('rdf:resource', $this->textinput->uri);\n $xml->endElement();\n }\n\n if (empty($this->items))\n throw new CException(Yii::t('EWebFeed', 'At least one item must exist'));\n $xml->startElement('items');\n $xml->startElement('rdf:Seq');\n foreach ($this->items as $item) {\n $xml->startElement('rdf:li');\n $xml->writeAttribute('resource', $item->uri);\n $xml->endElement();\n }\n $xml->endElement();\n $xml->endElement();\n\n $xml->endElement();\n\n if (!is_null($this->image)) {\n $xml->startElement('image');\n $xml->writeAttribute('rdf:about', $this->image->url);\n $xml->writeElement('title', $this->image->title);\n $xml->writeElement('link', $this->image->link);\n $xml->writeElement('url', $this->image->url);\n $xml->endElement();\n }\n\n if (!is_null($this->textinput)) {\n $xml->startElement('textinput');\n $xml->writeAttribute('rdf:about', $this->textinput->uri);\n $xml->writeElement('title', $this->textinput->title);\n $xml->writeElement('description', $this->textinput->description);\n $xml->writeElement('name', $this->textinput->name);\n $xml->writeElement('link', $this->textinput->link);\n $xml->endElement();\n }\n\n foreach ($this->items as $item) {\n $xml->startElement('item');\n $xml->writeAttribute('rdf:about', $item->uri);\n $xml->writeElement('title', $item->title);\n $xml->writeElement('link', $item->link);\n if ($item->description !== '') $xml->writeElement('description', $item->description);\n $xml->endElement();\n }\n \n $xml->endElement();\n $xml->endDocument();\n\n return $xml->flush();\n }", "private function createRequest()\n {\n $xml = new DOMDocument();\n $xml->formatOutput = true;\n\n $trackRequest = $xml->appendChild($xml->createElement(\"TrackRequest\"));\n $trackRequest->setAttribute('xml:lang', 'en-US');\n\n $request = $trackRequest->appendChild($xml->createElement(\"Request\"));\n\n $node = $xml->importNode($this->createTransactionNode(), true);\n $request->appendChild($node);\n\n $request->appendChild($xml->createElement(\"RequestAction\", \"Track\"));\n\n if (null !== $this->requestOption) {\n $request->appendChild($xml->createElement(\"RequestOption\", $this->requestOption));\n }\n\n if (null !== $this->trackingNumber) {\n $trackRequest->appendChild($xml->createElement(\"TrackingNumber\", $this->trackingNumber));\n }\n\n return $xml->saveXML();\n }", "public function createElement( $name, $attributes = array(), $value = '' ) {\n\t\t\tif ( is_string( $name ) && strpos( $name, '<' ) ) {\n\t\t\t\t// xml string given\n\t\t\t\t$xml = \\arc\\xml::parse( $name );\n\t\t\t\t$imported = $this->importNode( $xml );\n\t\t\t\treturn $imported;\n\t\t\t} else if ( $name instanceof Element ) {\n\t\t\t\t// element passed, so just return that, imported in this DOMDocument\n\t\t\t\t$imported = $this->importNode( $name );\n\t\t\t\treturn $imported;\n\t\t\t} else if ( !is_string( $name ) ) {\n\t\t\t\tthrow new \\arc\\Exception( 'arc\\\\xml\\\\createElement requires name to be a string', 101 );\n\t\t\t} else {\n\t\t\t\tif ( is_array( $value ) ) {\n\t\t\t\t\t// create a node list of elements\n\t\t\t\t\t$result = array();\n\t\t\t\t\tforeach ( $value as $item ) {\n\t\t\t\t\t\t$result = $this->createElement( $name, $attributes, $item );\n\t\t\t\t\t}\n\t\t\t\t\treturn new NodeList( $result, $this );\n\t\t\t\t} else {\n\t\t\t\t\t// check if value is parseable xml\n\t\t\t\t\t$nodeValue = $value;\n\t\t\t\t\t// now create the element\n\t\t\t\t\tlist ( $prefix, $namespace, $localName ) = $this->parseName( $name );\n\t\t\t\t\tif ( $this->domReference instanceof \\DOMDocument ) {\n\t\t\t\t\t\t$domDocument = $this->domReference;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$domDocument = $this->domReference->ownerDocument;\n\t\t\t\t\t}\n\t\t\t\t\tif ( $namespace ) {\n\t\t\t\t\t\t$domElement = $domDocument->createElementNS( $namespace, $prefix.':'.$localName, $nodeValue );\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$domElement = $domDocument->createElement( $name, $nodeValue );\n\t\t\t\t\t}\n\t\t\t\t\treturn $this->document->proxy( $domElement );\n\t\t\t\t}\n\t\t\t}\n\t\t}", "private function createRootElement(): \\DOMElement {\n $attribute = [\n 'office:version' => '1.2',\n 'xmlns:office' => 'urn:oasis:names:tc:opendocument:xmlns:office:1.0',\n 'xmlns:style' => 'urn:oasis:names:tc:opendocument:xmlns:style:1.0',\n 'xmlns:text' => 'urn:oasis:names:tc:opendocument:xmlns:text:1.0',\n 'xmlns:table' => 'urn:oasis:names:tc:opendocument:xmlns:table:1.0',\n 'xmlns:draw' => 'urn:oasis:names:tc:opendocument:xmlns:drawing:1.0',\n 'xmlns:fo' => 'urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0',\n 'xmlns:xlink' => 'http://www.w3.org/1999/xlink',\n 'xmlns:dc' => 'http://purl.org/dc/elements/1.1/',\n 'xmlns:meta' => 'urn:oasis:names:tc:opendocument:xmlns:meta:1.0',\n 'xmlns:number' => 'urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0',\n 'xmlns:svg' => 'urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0',\n 'xmlns:chart' => 'urn:oasis:names:tc:opendocument:xmlns:chart:1.0',\n 'xmlns:dr3d' => 'urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0',\n 'xmlns:math' => 'http://www.w3.org/1998/Math/MathML',\n 'xmlns:form' => 'urn:oasis:names:tc:opendocument:xmlns:form:1.0',\n 'xmlns:script' => 'urn:oasis:names:tc:opendocument:xmlns:script:1.0',\n 'xmlns:ooo' => 'http://openoffice.org/2004/office',\n 'xmlns:ooow' => 'http://openoffice.org/2004/writer',\n 'xmlns:oooc' => 'http://openoffice.org/2004/calc',\n 'xmlns:dom' => 'http://www.w3.org/2001/xml-events',\n 'xmlns:rpt' => 'http://openoffice.org/2005/report',\n 'xmlns:of' => 'urn:oasis:names:tc:opendocument:xmlns:of:1.2',\n 'xmlns:xhtml' => 'http://www.w3.org/1999/xhtml',\n 'xmlns:grddl' => 'http://www.w3.org/2003/g/data-view#',\n 'xmlns:tableooo' => 'http://openoffice.org/2009/table',\n 'xmlns:css3t' => 'http://www.w3.org/TR/css3-text/',\n 'xmlns:xforms' => 'http://www.w3.org/2002/xforms',\n 'xmlns:xsd' => 'http://www.w3.org/2001/XMLSchema',\n 'xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance',\n 'xmlns:field' => 'urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0',\n 'xmlns:formx' => 'urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0'];\n\n $rootElement = $this->createNewElement('office:document-content', $attribute);\n $bodyElement = $this->createNewElement('office:body', $attribute);\n $textElement = $this->createNewElement('office:text');\n\n $this->getDocument()->appendChild($rootElement);\n $rootElement->appendChild($bodyElement);\n $bodyElement->appendChild($textElement);\n\n return $textElement;\n }", "public function getXML(DOMDocument $xml){\n\t\t$user_setting = $xml->createElement('user-setting');\n\t\t/* Get XML method */\n\t\tif(!is_null($this->user)){\n\t\t\t$user_setting->setAttribute('user', $this->user->getID());\n\t\t}\n\t\tif(!is_null($this->ident)){\n\t\t\t$user_setting->setAttribute('ident', $this->getIdent());\n\t\t}\n\t\tif(!is_null($this->value)){\n\t\t\t$user_setting->setAttribute('value', $this->getValue());\n\t\t}\n\t\t/* Get XML method end */\n\t\treturn $user_setting;\n\t}", "protected function createElement($name, $value = null)\n {\n // otherwise only one element is attached to the DOM.\n\n $id = null;\n $uri = null;\n\n // The node name can contain the namespace id prefix.\n // Example: xsl:template\n $colon_pos = \\strpos($name, ':');\n\n if ($colon_pos !== false) {\n $id = \\substr($name, 0, $colon_pos);\n $name = \\substr($name, $colon_pos + 1);\n }\n\n if ($id !== null) {\n $ns = $this->namespaces[$id];\n $uri = $ns->uri();\n\n if ($ns->mode() === FluidNamespace::MODE_EXPLICIT) {\n $name = \"{$id}:{$name}\";\n }\n }\n\n // Algorithm 1:\n $el = new \\DOMElement($name, $value, $uri);\n\n // Algorithm 2:\n // $el = $dom->createElement($name, $value);\n\n return $el;\n }", "protected function createRegularPostXML()\n {\n $security_data = $this->makeSecurityData();\n $hash_data = $this->makeHashData($security_data);\n\n $nodes = [\n 'GVPSRequest' => [\n 'Mode' => $this->mode,\n 'Version' => 'v0.1',\n 'Terminal' => [\n 'ProvUserID' => $this->account->username,\n 'UserID' => $this->account->username,\n 'HashData' => $hash_data,\n 'ID' => $this->account->terminal_id,\n 'MerchantID' => $this->account->client_id,\n ],\n 'Customer' => [\n 'IPAddress' => $this->order->ip,\n 'EmailAddress' => isset($this->order->email) ? $this->order->email : null,\n ],\n 'Order' => [\n 'OrderID' => $this->order->id,\n ],\n 'Transaction' => [\n 'Type' => $this->types[$this->order->transaction],\n 'Amount' => $this->amountFormat($this->order->amount),\n 'CurrencyCode' => $this->order->currency,\n 'OriginalRetrefNum' => $this->order->ref_ret_num,\n ],\n ]\n ];\n\n return $this->createXML($nodes);\n }", "protected function xml_start(){\n\t\t$attributes = \"\";\n\t\tforeach($this->attributes as $k=>$v)\n\t\t\t$attributes .= \" \".$k.\"='\".$v.\"'\";\n\n\t\tif ($this->dload){\n\t\t\tif ($pos=$this->request->get_start())\n\t\t\t\treturn \"<data pos='\".$pos.\"'\".$attributes.\">\";\n\t\t\telse\n\t\t\t\treturn \"<data total_count='\".$this->sql->get_size($this->request).\"'\".$attributes.\">\";\n\t\t}\n\t\telse\n\t\t\treturn \"<data\".$attributes.\">\";\n\t}", "public function create()\r\n {\r\n // Load only root elements.\r\n $this->loadRoots($this->elements, $this->roots);\r\n\r\n // Make sure that first element isn't child. If child then throw a exception about that.\r\n if ($this->elements[0]->isChild())\r\n TypeRegression::cantBe('child', 'First');\r\n\r\n // Set elements compiled field with relations\r\n $this->makeRelationsToCompiled($this->elements);\r\n \r\n // After append process by root-child then compile all stuffs into 'page' field.\r\n foreach ($this->roots as $key => $element) {\r\n \r\n $this->page .= $element->compiled;\r\n }\r\n }", "function create(&$a_pg_obj, $a_hier_id)\n\t{\n\t\t$this->node = $this->createPageContentNode();\n\t}", "public function write($xml);", "function __construct($value = ''){\n if($value){\n $this->encoding($value);\n }\n $this->document = $this->document();\n $this->tree = $this->document->appendChild(new DOMElement('tree'));\n }", "private function _replacementNode($old_node, $value)\n {\n $new_node = $this->_xml->createElementNS(\n self::XMLNAMESPACE, $old_node->tagName\n );\n $text = $this->_xml->createTextNode($value);\n $new_node->appendChild($text);\n return $new_node;\n }", "public function makeOpeningTag()\n {\n $return = '<'.$this->name;\n\n // add the attributes\n foreach ($this->attr as $key => $info) {\n $info = $this->getAttribute($key);\n $val = $info['value'];\n if (is_null($val)) {\n $return .= ' '.$key;\n } elseif ($info['doubleQuote']) {\n $return .= ' '.$key.'=\"'.$val.'\"';\n } else {\n $return .= ' '.$key.'=\\''.$val.'\\'';\n }\n }\n\n if ($this->selfClosing) {\n return $return.' />';\n } else {\n return $return.'>';\n }\n }", "function init($mXML) {\n $mXML->preserveWhiteSpace = false;\n $mXML->formatOutput = true;\n //create root & ns attributes\n $root = $mXML->createElement(\"mods:mods\");\n $root->setAttribute(\"xmlns:mods\",\"http://www.loc.gov/mods/v3\");\n $root->setAttribute(\"xmlns:xlink\",\"http://www.w3.org/1999/xlink\");\n $root->setAttribute(\"xmlns:xsi\",\"http://www.w3.org/2001/XMLSchema-instance\");\n $root->setAttribute(\"version\",\"3.4\");\n $root->setAttribute(\"xsi:schemaLocation\",\n \"http://www.loc.gov/mods/v3 http://www.loc.gov/standards/mods/v3/mods-3-0.xsd\");\n $mXML->appendChild($root);\n }", "function create_xml( $pmWidth, $pmHeight, $loaderColor,$innerSideColor, $autoplay, $fieldOfView, $sideShadowAlpha, $dropShadowAlpha, $dropShadowDistance, $dropShadowScale, $dropShadowBlurX, $dropShadowBlurY, $menuDistanceX, $menuDistanceY, $menuColor1, $menuColor2, $menuColor3, $controlSize, $controlDistance, $controlColor1 , $controlColor2, $controlAlpha, $controlAlphaOver, $controlsX, $controlsY, $controlsAlign, $tooltipHeight, $tooltipColor, $tooltipTextY, $tooltipTextStyle, $tooltipTextColor, $tooltipMarginLeft, $tooltipMarginRight, $tooltipTextSharpness, $tooltipTextThickness, $infoWidth, $infoBackground, $infoBackgroundAlpha, $infoMargin, $infoSharpness, $infoThickness, $allPages, $allTransitions){\n\n\t\t\t// this is place where you can see\n\t\t\t// how xml will looks like\n\t\t//\techo \"ja pier...\".$allPages['type'];\n\t\t\t$xml = \"<Piecemaker>\\n\"\n\t\t\t\t.\" <Contents> \\n\";\n\t\t\t\tif($allPages !== \"\"){\n\t\t\t\t\t//\techo \"aaaaa\";\n\t\t\t\t//\techo $allPages['type']['0'].\"\\n\";\n\t\t\t \t\tfor($i = 0; $i < count($allPages['type']); $i++) {\n\t\t\t\t\t\t//echo \" \".$allPages['type'][$i].\"\\n\";\n\t\t\t\t\t\t\tif($allPages['type'][$i] == \"image\"){\n\t\t\t\t\t\t\t\t\t$xml .= \"\t\t<Image Source=\\\"\".$allPages['src'][$i].\"\\\" Title=\\\"\".stripslashes($allPages['slideTitle'][$i]).\"\\\" TypeOur=\\\"\".$allPages['type'][$i].\"\\\">\\n\"\n\t\t\t\t\t\t\t\t\t\t .\"\t\t\t<Text>\\n\"\n\t\t\t\t\t\t\t\t\t\t .\"\t\t\t\t\".\"<![CDATA[\".stripslashes($allPages['slideText'][$i]).\"]]>\\n\"\n\t\t\t\t\t\t\t\t\t\t .\"\t\t\t</Text>\\n\"\n\t\t\t\t\t\t\t\t\t\t .\"\t\t\t<Hyperlink URL=\\\"\".$allPages['hyperlinkURL'][$i].\"\\\" Target=\\\"\".$allPages['hyperlinkTarget'][$i].\"\\\"/>\\n\"\n\t\t\t\t\t\t \t\t\t\t .\"\t\t</Image>\\n\";\n\t\t\t\t\t\t\t} elseif($allPages['type'][$i] == \"flash\"){\n\t\t\t\t\t\t\t\t\t\t$xml .= \"\t\t<Flash Source=\\\"\".$allPages['src'][$i].\"\\\" Title=\\\"\".stripslashes($allPages['slideTitle'][$i]).\"\\\" TypeOur=\\\"\".$allPages['type'][$i].\"\\\">\\n\"\n\t\t\t\t\t\t\t\t.\"\t\t\t<Image Source=\\\"\".$allPages['large'][$i].\"\\\"/>\\n\"\n\t\t\t\t\t\t\t\t.\"\t\t</Flash>\\n\";\n\t\t\t\t\t\t\t} elseif($allPages['type'][$i] == \"video\"){\n\t\t\t\t\t\t\t\t\t\t$xml .= \"\t\t<Video Source=\\\"\".$allPages['src'][$i].\"\\\" Title=\\\"\".stripslashes($allPages['slideTitle'][$i]).\"\\\" Width=\\\"\".$allPages['videoWidth'][$i].\"\\\" Height=\\\"\".$allPages['videoHeight'][$i].\"\\\" Autoplay=\\\"\".$allPages['autoplay'][$i].\"\\\" TypeOur=\\\"\".$allPages['type'][$i].\"\\\">\\n\"\n\t\t\t\t\t\t\t\t.\"\t\t\t<Image Source=\\\"\".$allPages['large'][$i].\"\\\"/>\\n\"\n\t\t\t\t\t\t\t\t.\"\t\t</Video>\\n\";\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$xml .= \" </Contents> \\n\" \n\t\t\t\t.\" \\n\"\n\t\t\t\t.\" <Settings \\n\"\n\t\t\t\t.\" \t\tImageWidth=\\\"\".$pmWidth.\"\\\" \\n\"\n\t\t\t\t.\" \t\tImageHeight=\\\"\".$pmHeight.\"\\\" \\n\"\n\t\t\t\t.\" \t\tLoaderColor=\\\"\".$loaderColor.\"\\\" \\n\"\n\t\t\t\t.\" \t\tInnerSideColor=\\\"\".$innerSideColor.\"\\\" \\n\"\n\t\t\t\t.\" \t\tAutoplay=\\\"\".$autoplay.\"\\\" \\n\"\n\t\t\t\t.\" \t\tFieldOfView=\\\"\".$fieldOfView.\"\\\" \\n\"\n\t\t\t\t.\" \t\tSideShadowAlpha=\\\"\".$sideShadowAlpha.\"\\\" \\n\"\n\t\t\t\t.\" \t\tDropShadowAlpha=\\\"\".$dropShadowAlpha.\"\\\" \\n\"\n\t\t\t\t.\" \t\tDropShadowDistance=\\\"\".$dropShadowDistance.\"\\\" \\n\"\n\t\t\t\t.\" \t\tDropShadowScale=\\\"\".$dropShadowScale.\"\\\" \\n\"\n\t\t\t\t.\" \t\tDropShadowBlurX=\\\"\".$dropShadowBlurX.\"\\\" \\n\"\n\t\t\t\t.\" \t\tDropShadowBlurY=\\\"\".$dropShadowBlurY.\"\\\" \\n\"\n\t\t\t\t.\" \t\tMenuDistanceX=\\\"\".$menuDistanceX.\"\\\" \\n\"\n\t\t\t\t.\" \t\tMenuDistanceY=\\\"\".$menuDistanceY.\"\\\" \\n\"\n\t\t\t\t.\" \t\tMenuColor1=\\\"\".$menuColor1.\"\\\" \\n\"\n\t\t\t\t.\" \t\tMenuColor2=\\\"\".$menuColor2.\"\\\" \\n\"\n\t\t\t\t.\" \t\tMenuColor3=\\\"\".$menuColor3.\"\\\" \\n\"\n\t\t\t\t.\" \t\tControlSize=\\\"\".$controlSize.\"\\\" \\n\"\n\t\t\t\t.\" \t\tControlDistance=\\\"\".$controlDistance.\"\\\" \\n\"\n\t\t\t\t.\" \t\tControlColor1=\\\"\".$controlColor1.\"\\\" \\n\"\n\t\t\t\t.\" \t\tControlColor2=\\\"\".$controlColor2.\"\\\" \\n\"\n\t\t\t\t.\" \t\tControlAlpha=\\\"\".$controlAlpha.\"\\\" \\n\"\n\t\t\t\t.\" \t\tControlAlphaOver=\\\"\".$controlAlphaOver.\"\\\" \\n\"\n\t\t\t\t.\" \t\tControlsX=\\\"\".$controlsX.\"\\\" \\n\"\n\t\t\t\t.\" \t\tControlsY=\\\"\".$controlsY.\"\\\" \\n\"\n\t\t\t\t.\" \t\tControlsAlign=\\\"\".$controlsAlign.\"\\\" \\n\"\n\t\t\t\t.\" \t\tTooltipHeight=\\\"\".$tooltipHeight.\"\\\" \\n\"\n\t\t\t\t.\" \t\tTooltipColor=\\\"\".$tooltipColor.\"\\\" \\n\"\n\t\t\t\t.\" \t\tTooltipTextY=\\\"\".$tooltipTextY.\"\\\" \\n\"\n\t\t\t\t.\" \t\tTooltipTextStyle=\\\"\".$tooltipTextStyle.\"\\\" \\n\"\n\t\t\t\t.\" \t\tTooltipTextColor=\\\"\".$tooltipTextColor.\"\\\" \\n\"\n\t\t\t\t.\" \t\tTooltipMarginLeft=\\\"\".$tooltipMarginLeft.\"\\\" \\n\"\n\t\t\t\t.\" \t\tTooltipMarginRight=\\\"\".$tooltipMarginRight.\"\\\" \\n\"\n\t\t\t\t.\" \t\tTooltipTextSharpness=\\\"\".$tooltipTextSharpness.\"\\\" \\n\"\n\t\t\t\t.\" \t\tTooltipTextThickness=\\\"\".$tooltipTextThickness.\"\\\" \\n\"\n\t\t\t\t.\" \t\tInfoWidth=\\\"\".$infoWidth.\"\\\" \\n\"\n\t\t\t\t.\" \t\tInfoBackground=\\\"\".$infoBackground.\"\\\" \\n\"\n\t\t\t\t.\" \t\tInfoBackgroundAlpha=\\\"\".$infoBackgroundAlpha.\"\\\" \\n\"\n\t\t\t\t.\" \t\tInfoMargin=\\\"\".$infoMargin.\"\\\" \\n\"\n\t\t\t\t.\" \t\tInfoSharpness=\\\"\".$infoSharpness.\"\\\" \\n\"\n\t\t\t\t.\" \t\tInfoThickness=\\\"\".$infoThickness.\"\\\"/> \\n\"\n\t\t\t\t.\"\\n\"\n\t\t\t\t.\" <Transitions> \\n\";\n\t\t\t\t\n\t\t\tif(trim($allTransitions) !== \"\"){\n\t\t\t\tfor($i = 0; $i < count($allTransitions['pieces']); $i++) {\n\t\t\t\t\t$xml .= \"\t\t<Transition Pieces=\\\"\".$allTransitions['pieces'][$i].\"\\\" Time=\\\"\".$allTransitions['time'][$i].\"\\\" Transition=\\\"\".$allTransitions['type'][$i].\"\\\" Delay=\\\"\".$allTransitions['delay'][$i].\"\\\" DepthOffset=\\\"\".$allTransitions['depth'][$i].\"\\\" CubeDistance=\\\"\".$allTransitions['distance'][$i].\"\\\"/>\\n\";\n\t\t\t\t}\n\t\t\t}\n\n\t\t$xml .= \"\\n\"\n\n\t\t\t\t.\" </Transitions>\\n\"\n\n\t\t\t\t.\"</Piecemaker>\";\n\n return $xml;\n\t}", "public function create() {\n\t \n }", "public function create_xml($path = null)\n\t{\n\t\t// Was a path specified? If so, use that array.\n\t\tif ($path !== null)\n\t\t{\n\t\t\t$path = $this->path($path);\n\n\t\t\t// The path was not found\n\t\t\tif ($path === false)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t$path = $path->array;\n\t\t}\n\t\t// Just use the current array.\n\t\telse\n\t\t{\n\t\t\t$path = $this->array;\n\t\t}\n\n\t\t// Add the xml declaration to the front.\n\t\treturn '<?xml version=\"1.0\"?' . '>' . $this->_xml($path, 0);\n\t}", "public function create()\n\t{\n\t\t\n\t\t//\n\t}", "public function afficherXML(){\n echo\"<humidite>\";\n\n echo\"<moyenne>\".$this->moyenne.\"</moyenne>\";\n echo\"<max>\".$this->max.\"</max>\";\n echo\"<min>\".$this->min.\"</min>\";\n echo\"<nombreHumiditeReference>\".$this->nombreHumiditeReference.\"</nombreHumiditeReference>\";\n echo\"<date>\".$this->date.\"</date>\";\n\n echo\"</humidite>\";\n }", "public function build()\n {\n return $this->generateXml();\n }", "private function _createDomNode($dom, $value, $name = null)\r\n {\r\n if ($value instanceof SagepayItem)\r\n {\r\n return $value->asDomElement($dom);\r\n }\r\n else if ($name === null)\r\n {\r\n return $dom->createElement($value);\r\n }\r\n else if (is_string($value) || is_int($value))\r\n {\r\n return $dom->createElement($name, trim($value));\r\n }\r\n else if (is_float($value))\r\n {\r\n return $dom->createElement($name, number_format($value, 2, '.', ''));\r\n }\r\n else if (is_array($value))\r\n {\r\n if (count($value) === 0)\r\n {\r\n return null;\r\n }\r\n $base = $dom->createElement($name);\r\n if (array_keys($value) !== range(0, count($value) - 1))\r\n {\r\n // For Associative Array\r\n foreach ($value as $_key => $_val)\r\n {\r\n $node = $this->_createDomNode($dom, $_val, $_key);\r\n $base->appendChild($node);\r\n }\r\n return $base;\r\n }\r\n else\r\n {\r\n foreach ($value as $_val)\r\n {\r\n $node = $this->_createDomNode($dom, $_val);\r\n $base->appendChild($node);\r\n }\r\n return $base->childNodes;\r\n }\r\n }\r\n }", "public function create()\n\t{\n\n\n\t\t//\n\t}", "public function xmlOutput()\n {\n return\n '<output>\n <answer>' . $this->answer . '</answer>\n <summary>' . htmlspecialchars($this->summary) . '</summary>\n </output>';\n }", "public function create()\n\t\t{\n\t\t\t//\n\t\t}", "public function create()\n\t\t{\n\t\t\t//\n\t\t}" ]
[ "0.7890504", "0.68093204", "0.6684434", "0.6672879", "0.665791", "0.6525716", "0.63897955", "0.6370771", "0.63452184", "0.6292584", "0.62651247", "0.62245595", "0.6202104", "0.6154628", "0.6077528", "0.6076858", "0.6069574", "0.6055599", "0.60487217", "0.6006208", "0.59986395", "0.5986952", "0.59857696", "0.59656733", "0.5964038", "0.5946067", "0.5936211", "0.5919856", "0.59160554", "0.5890109", "0.5885323", "0.5872445", "0.5869752", "0.58563507", "0.5832002", "0.5807646", "0.5797159", "0.57798284", "0.5765889", "0.5747236", "0.57455736", "0.5707495", "0.5706653", "0.5704086", "0.57026136", "0.5697509", "0.56897295", "0.56583333", "0.5650554", "0.5620184", "0.56082654", "0.5607022", "0.55990744", "0.5595652", "0.5594969", "0.5593804", "0.5582797", "0.5580271", "0.5577121", "0.5565288", "0.5563986", "0.55541915", "0.55464923", "0.552713", "0.55241865", "0.55198216", "0.5518195", "0.5510504", "0.5506461", "0.5506426", "0.5478665", "0.54773027", "0.5475717", "0.5474284", "0.54697007", "0.5469611", "0.5455698", "0.54512256", "0.545043", "0.5447296", "0.54449993", "0.5443093", "0.5440072", "0.543062", "0.54293823", "0.54193836", "0.541292", "0.5409229", "0.54056436", "0.53956467", "0.53953874", "0.5392669", "0.5386564", "0.53732276", "0.5371874", "0.5369116", "0.5366729", "0.5360203", "0.5356946", "0.5349658", "0.5349658" ]
0.0
-1
Parse the XML node
public function parseXmlNode(\SimpleXMLElement $node): void { \Logger::getLogger(\get_class($this))->trace(__METHOD__); if (false === \in_array( $node->getName(), [static::N_PAYMENTMETHOD, ADocumentTotals::N_DOCUMENTTOTALS, DocumentTotals::N_PAYMENT] ) ) { $msg = \sprintf( "Node name should be '%s' or '%s' but is '%s'", Payment::N_PAYMENTMETHOD, ADocumentTotals::N_DOCUMENTTOTALS, $node->getName() ); \Logger::getLogger(\get_class($this)) ->error(\sprintf(__METHOD__." '%s'", $msg)); throw new AuditFileException($msg); } if ($node->{static::N_PAYMENTMECHANISM}->count() > 0) { $this->setPaymentMechanism( new PaymentMechanism((string) $node->{static::N_PAYMENTMECHANISM}) ); } else { $this->setPaymentMechanism(null); } $this->setPaymentAmount( (float) $node->{static::N_PAYMENTAMOUNT} ); $this->setPaymentDate( RDate::parse( RDate::SQL_DATE, (string) $node->{static::N_PAYMENTDATE} ) ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function parse(DOMElement $node);", "protected function parseXmlFile() {}", "function Parse()\n {\n //Create the parser resource\n $this->parser = xml_parser_create(\"UTF-8\");\n \n //Set the handlers\n xml_set_object($this->parser, $this);\n xml_set_element_handler($this->parser, 'StartElement', 'EndElement');\n xml_set_character_data_handler($this->parser, 'CharacterData');\n\n //Error handling\n if (!xml_parse($this->parser, $this->xml))\n $this->HandleError(xml_get_error_code($this->parser), xml_get_current_line_number($this->parser), xml_get_current_column_number($this->parser));\n\n //Free the parser\n xml_parser_free($this->parser);\n }", "public function parseXml()\n {\n libxml_use_internal_errors(true);\n\n if ($this->getMimeType() == 'application/xml') {\n $elem = simplexml_load_string($this->contents);\n if ($elem !== false) {\n return $elem;\n } else {\n return libxml_get_errors();\n }\n }\n\n return false;\n }", "function parse() {\n $this->xml_parser = xml_parser_create('UTF-8');\n xml_set_object($this->xml_parser,$this);\n\n ## convert all tags to upper\n xml_parser_set_option($this->xml_parser, XML_OPTION_CASE_FOLDING, true);\n \n xml_set_element_handler($this->xml_parser,'startElement', 'endElement');\n xml_set_character_data_handler($this->xml_parser,'characterData');\n \n if(!($fp = @fopen($this->xml_file,\"r\"))) {\n die(\"could not open XML input\".$this->xml_file);\n }\n \n ## read the whole file and scan in the information\n while($data = fread($fp, 4096)) {\n if(!xml_parse($this->xml_parser,$data, feof($fp))) {\n die(sprintf(\"XML error: %s at line %d\", xml_error_string(xml_get_error_code($this->xml_parser)), xml_get_current_line_number($this->xml_parser)));\n }\n }\n fclose($fp);\n $this->destroy();\n }", "function parseXml($xmlText) {\n if ($xmlText == '') {\n trace('Warning: Empty xml supplied!');\n }\n $this->navajoDoc = new DOMDocument('1.0', 'iso-8859-1');\n $this->navajoDoc->loadXML($xmlText);\n $nodelist = $this->navajoDoc->getElementsByTagName('tml');\n $this->tmlNode = $nodelist->item(0);\n #\tfor ($i = 0; $i < $nodelist->length; $i++) {\n #\t echo $nodelist->item($i)->nodeValue . \"\\n\";\n #\t}\n\n // TODO Fix this, not efficient\n $this->headerNode = $this->tmlNode->getElementsByTagName('header')->item(0);\n $this->transactionNode = $this->headerNode->getElementsByTagName('transaction')->item(0);\n # $this->dumpElement($this->headerNode);\n\n }", "private function parse()\n {\n $this->parseChildrenNodes($this->_dom, $this->_rootNode);\n }", "private function parseXml(\\DOMNode $node)\n {\n $data = $this->parseXmlAttributes($node);\n\n $value = $this->parseXmlValue($node);\n\n if (!count($data)) {\n return $value;\n }\n\n if (!is_array($value)) {\n $data['#'] = $value;\n\n return $data;\n }\n\n if (1 === count($value) && key($value)) {\n $data[key($value)] = current($value);\n\n return $data;\n }\n\n foreach ($value as $key => $val) {\n $data[$key] = $val;\n }\n\n return $data;\n }", "function amazon_xml_parsexml ( $xmlcontent )\n\t\t{\n\t\t\t$String = $xmlcontent;\n\t\t\t$Encoding = $this->amazon_xml_encoding( $String );\n\t\t\t$String = $this->amazon_xml_deleteelements( $String, \"?\" );\n\t\t\t$String = $this->amazon_xml_deleteelements( $String, \"!\" );\n\t\t\t$Data = $this->amazon_xml_readxml( $String, $Data, $Encoding );\n\t\t\treturn($Data);\n\t\t}", "public function parse()\n {\n $parserResolver = new ParserResolver();\n $parserResolver->setXMLElement(new \\SimpleXMLElement($this->xmlString));\n \n $parser = $parserResolver->getParser();\n \n return $parser->parse();\n }", "function parseXML() {\n \n $xml_parser = xml_parser_create($this->encoding);\n xml_parser_set_option($xml_parser, XML_OPTION_CASE_FOLDING, 1);\n\n xml_set_object($xml_parser, $this);\n xml_set_element_handler($xml_parser, 'startElement', 'endElement');\n xml_set_character_data_handler($xml_parser, 'cDataHandler');\n\n xml_set_external_entity_ref_handler($xml_parser, 'externalEntityRefHandler');\n xml_set_processing_instruction_handler($xml_parser, 'piHandler');\n xml_set_unparsed_entity_decl_handler($xml_parser, 'unparsedEntityDeclHandler');\n xml_set_notation_decl_handler($xml_parser, 'entityDeclHandler');\n xml_set_default_handler($xml_parser, 'defaultHandler');\n \n if (!xml_parse($xml_parser, $this->contentBuffer, true)) {\n ($this->currentFile != '') ? $inFile = \"in file $this->currentFile\" : $inFile = '';\n if ($GLOBALS['SM_develState']) {\n echo \"XML dump: \\n\".$this->contentBuffer;\n }\n $this->fatalErrorPage(sprintf(get_class($this).\": XML error: %s at line %d $inFile\",\n xml_error_string(xml_get_error_code($xml_parser)),\n xml_get_current_line_number($xml_parser)));\n }\n\n xml_parser_free($xml_parser);\n\n }", "abstract public function parse($xmlFile);", "function parse_xml($xml)\n\t{\n\t\t// PHP's XML array structures stink so make our own\n\t\tif ($this->parse_into_struct($xml) === FALSE)\n\t\t{\n\t\t\terror_log('Unable to parse XML data');\n\t\t\treturn FALSE;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$elements = array();\n\t\t\t$child = array();\n\t\t\tforeach ($this->tagdata as $item)\n\t\t\t{\n\t\t\t\t$current = count($elements);\n\n\t\t\t\tif ($item['type'] == 'open' OR $item['type'] == 'complete')\n\t\t\t\t{\n\t\t\t\t\t$elements[$current] = new XML_Cache;\n\t\t\t\t\t$elements[$current]->tag\t\t= $item['tag'];\n\t\t\t\t\t$elements[$current]->attributes\t= (array_key_exists('attributes', $item)) ? $item['attributes'] : '';\n\t\t\t\t\t$elements[$current]->value\t\t= (array_key_exists('value', $item)) ? $item['value'] : '';\n\n\t\t\t\t\t/** -------------------------------------\n\t\t\t\t\t/** Create a new child layer for 'open'\n\t\t\t\t\t/** -------------------------------------*/\n\t\t\t\t\tif ($item['type'] == \"open\")\n\t\t\t\t\t{\n\t\t\t\t\t\t$elements[$current]->children = array();\n\t\t\t\t\t\t$child[count($child)] = &$elements;\n\t\t\t\t\t\t$elements = &$elements[$current]->children;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t/** -------------------------------------\n\t\t\t\t/** Put child layer into root object\n\t\t\t\t/** -------------------------------------*/\n\n\t\t\t\telseif ($item['type'] == 'close')\n\t\t\t\t{\n\t\t\t\t\t$elements = &$child[count($child) - 1];\n\t\t\t\t\tunset($child[count($child) - 1]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $elements[0];\n\t}", "public function parse(DOMElement $node)\n {\n $this->tag = 'audio';\n\n parent::parse($node);\n\n $this->boundary = IdmlParserHelper::parseBoundary($node);\n\n $loopAttrib = $node->hasAttribute('SoundLoop') ? $node->getAttribute('SoundLoop') : 'false';\n $autoplayAttrib = $node->hasAttribute('PlayOnPageTurn') ? $node->getAttribute('PlayOnPageTurn') : 'false';\n\n $this->loop = ($loopAttrib == 'true') ? true : false;\n $this->autoplay = ($autoplayAttrib == 'true') ? true : false;\n }", "private function parseXmlValue(\\DOMNode $node)\n {\n if (!$node->hasChildNodes()) {\n return $node->nodeValue;\n }\n\n if (1 === $node->childNodes->length && in_array($node->firstChild->nodeType, array(XML_TEXT_NODE, XML_CDATA_SECTION_NODE))) {\n return $node->firstChild->nodeValue;\n }\n\n $value = array();\n\n foreach ($node->childNodes as $subnode) {\n if ($subnode->nodeType === XML_PI_NODE) {\n continue;\n }\n\n $val = $this->parseXml($subnode);\n\n if ('item' === $subnode->nodeName && isset($val['@key'])) {\n if (isset($val['#'])) {\n $value[$val['@key']] = $val['#'];\n } else {\n $value[$val['@key']] = $val;\n }\n } else {\n $value[$subnode->nodeName][] = $val;\n }\n }\n\n foreach ($value as $key => $val) {\n if (is_array($val) && 1 === count($val)) {\n $value[$key] = current($val);\n }\n }\n\n return $value;\n }", "function CardinalXMLParser() {\n\t\t $this->xml_parser = xml_parser_create();\n\t\t}", "private function _parseXml()\n {\n $temp = @simplexml_load_string( $this->input, \"SimpleXMLElement\", LIBXML_NOCDATA );\n $json = @json_encode( $temp );\n $data = @json_decode( $json, true );\n\n if( is_array( $data ) )\n {\n $_REQUEST = array_merge( $_GET, $this->_data( $data ) );\n return true;\n }\n return false;\n }", "function parseXML() {\r\n\t\t$xmlString = getFileStr();\r\n\r\n\t\tif (!strstr($xmlString, \"<?xml version='1.0' ?>\")) {\r\n\t\t\tparseBin();\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t$xmlParser = xml_parser_create();\r\n\t\txml_parser_set_option($xmlParser, XML_OPTION_CASE_FOLDING, FALSE);\r\n\t\txml_set_element_handler($xmlParser, \"startElement\", \"endElement\");\r\n\r\n\t\txml_parse($xmlParser, $xmlString);\r\n\t\txml_parser_free($xmlParser);\r\n\r\n\t\txmlToObj();\r\n\t}", "public function parse($xml)\n {\n // return (isset($data['elements'])) ? $data['elements'] : throw new Exception('elements key not found');\n }", "public function handle(SimpleXMLElement $root);", "public function getParsedContent(): string\n {\n return $this->XMLTree;\n }", "protected function parseValueElement(\\SimpleXMLElement $node) {\n\t\t\t$children = $node->children();\n\t\t\tif (count($children) > 0) {\n\t\t\t\t$value = '';\n\t\t\t\tforeach ($children as $child) {\n\t\t\t\t\tswitch ($child->getName()) {\n\t\t\t\t\t\tcase 'null':\n\t\t\t\t\t\t\t$value = $this->parseNullElement($child);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tthrow new Throwable\\Instantiation\\Exception('Unable to initial class.');\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn $value;\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$attributes = $node->attributes();\n\t\t\t\t$value = dom_import_simplexml($node)->textContent;\n\t\t\t\tif (isset($attributes['type'])) {\n\t\t\t\t\t$type = $this->__valueOf($attributes['type']);\n\t\t\t\t\tif (!Spring\\Data\\XML\\Syntax::isPrimitiveType($type)) {\n\t\t\t\t\t\tthrow new Throwable\\Instantiation\\Exception('Unable to initial class.');\n\t\t\t\t\t}\n\t\t\t\t\t$value = Core\\Convert::changeType($value, $type);\n\t\t\t\t}\n\t\t\t\tif (is_string($value)) {\n\t\t\t\t\t$attributes = $node->attributes('xml', true);\n\t\t\t\t\tif (isset($attributes['space'])) {\n\t\t\t\t\t\t$space = $this->__valueOf($attributes['space']);\n\t\t\t\t\t\tif (!Spring\\Data\\XML\\Syntax::isSpacePreserved($space)) {\n\t\t\t\t\t\t\tthrow new Throwable\\Instantiation\\Exception('Unable to initial class.');\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t$value = trim($value);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn $value;\n\t\t\t}\n\t\t}", "public function getTagValue()\r\n\t{\r\n\t\treturn $this->root->nodeValue;\r\n\t}", "protected function readElementNode()\n {\n $this->element = $this->createVirtualElement();\n\n if ($this->reader->hasAttributes) {\n foreach ($this->readElementAttributes() as $attribute => $value) {\n $this->element->put($attribute, $value);\n }\n }\n }", "protected function parseNullElement(\\SimpleXMLElement $node) {\n\t\t\treturn null;\n\t\t}", "public function parseXML($xml)\n\t{\n\t\ttry\n\t\t{\n\t\t\t$this->dom_doc = new DOMDocument();\n\t\t\t$this->dom_doc->loadXML($xml);\n\t\t\t$this->xpath = new DOMXPath($this->dom_doc);\n\t\t}\n\t\tcatch (Exception $e)\n\t\t{\n\t\t\tthrow new TSS_Tribal_TransportException($e->getMessage(), 0);\n\t\t}\n\n\t\t//return !$this->searchForError();\n\t}", "public function parse(DOMElement $node)\n {\n parent::parse($node);\n\n $hyperlinkMgr = IdmlHyperlinkManager::getInstance();\n\n // Set the id attribute value\n $destinationKey = $this->contextualStyle->idmlKeyValues['DestinationUniqueKey'];\n $this->id = 'Hyperlink_' . $destinationKey;\n\n // Save this destination in the hyperlink manager.\n // After parsing the page completes, its id must be stored for all the hyperlink destinations on the page.\n $hyperlinkMgr->saveDestinationForPageData($this->id);\n }", "protected function parseExpressionElement(\\SimpleXMLElement $node) {\n\t\t\t$attributes = $node->attributes();\n\t\t\t$expression = $this->__valueOf($node[0]);\n\t\t\t$value = null;\n\t\t\t/*\n\t\t\t@eval('$value = ' . $expression . ';');\n\t\t\tif (isset($attributes['type'])) {\n\t\t\t\t$type = $this->__valueOf($attributes['type']);\n\t\t\t\tif (!Spring\\Data\\XML\\Syntax::isPrimitiveType($type)) {\n\t\t\t\t\tthrow new Throwable\\Instantiation\\Exception('Unable to initial class.');\n\t\t\t\t}\n\t\t\t\tif (!isset($value)) {\n\t\t\t\t\t$type = 'NULL';\n\t\t\t\t\t$value = null;\n\t\t\t\t}\n\t\t\t\t$value = Core\\Convert::changeType($value, $type);\n\t\t\t}\n\t\t\t*/\n\t\t\treturn $value;\n\t\t}", "public function parse();", "public function parse();", "public function parse();", "public function parse()\n {\n // TODO: Implement parse() method.\n }", "function parseXmlElement($tag)\n { \n $temp = $this->simplexmlObject->xpath($tag);\n $output = (string)$temp[0];\n return $output;\n }", "abstract public function parse ();", "public function parse()\n {\n }", "public function parse()\n {\n }", "public function parse()\n {\n }", "public function parse()\n {\n }", "protected function parse() {}", "function _parserResult($resultXML) {\r\n \t$statusMessage = substr($resultXML, strpos($resultXML, \"<statusMessage>\")+strlen(\"<statusMessage>\"), strpos($resultXML, \"</statusMessage>\")-strlen(\"<statusMessage>\")-strpos($resultXML, \"<statusMessage>\"));\r\n \t//print \"message = $statusMessage\";\r\n\t$cphandling = substr($resultXML, strpos($resultXML, \"<handling>\")+strlen(\"<handling>\"), strpos($resultXML, \"</handling>\")-strlen(\"<handling>\")-strpos($resultXML, \"<handling>\"));\r\n\t$this->handling_cp = $cphandling;\r\n \tif ($statusMessage == 'OK') {\r\n \t\t$strProduct = substr($resultXML, strpos($resultXML, \"<product id=\")+strlen(\"<product id=>\"), strpos($resultXML, \"</product>\")-strlen(\"<product id=>\")-strpos($resultXML, \"<product id=\"));\r\n \t\t$index = 0;\r\n \t\t$aryProducts = false;\r\n \t\twhile (strpos($resultXML, \"</product>\")) {\r\n\t\t\t$cpnumberofboxes = substr_count($resultXML, \"<expediterWeight\");\r\n\t\t\t$this->boxCount = $cpnumberofboxes;\r\n \t\t\t$name = substr($resultXML, strpos($resultXML, \"<name>\")+strlen(\"<name>\"), strpos($resultXML, \"</name>\")-strlen(\"<name>\")-strpos($resultXML, \"<name>\"));\r\n \t\t\t$rate = substr($resultXML, strpos($resultXML, \"<rate>\")+strlen(\"<rate>\"), strpos($resultXML, \"</rate>\")-strlen(\"<rate>\")-strpos($resultXML, \"<rate>\"));\r\n \t\t\t$shippingDate = substr($resultXML, strpos($resultXML, \"<shippingDate>\")+strlen(\"<shippingDate>\"), strpos($resultXML, \"</shippingDate>\")-strlen(\"<shippingDate>\")-strpos($resultXML, \"<shippingDate>\"));\r\n \t\t\t$deliveryDate = substr($resultXML, strpos($resultXML, \"<deliveryDate>\")+strlen(\"<deliveryDate>\"), strpos($resultXML, \"</deliveryDate>\")-strlen(\"<deliveryDate>\")-strpos($resultXML, \"<deliveryDate>\"));\r\n \t\t\t$deliveryDayOfWeek = substr($resultXML, strpos($resultXML, \"<deliveryDayOfWeek>\")+strlen(\"<deliveryDayOfWeek>\"), strpos($resultXML, \"</deliveryDayOfWeek>\")-strlen(\"<deliveryDayOfWeek>\")-strpos($resultXML, \"<deliveryDayOfWeek>\"));\r\n \t\t\t$nextDayAM = substr($resultXML, strpos($resultXML, \"<nextDayAM>\")+strlen(\"<nextDayAM>\"), strpos($resultXML, \"</nextDayAM>\")-strlen(\"<nextDayAM>\")-strpos($resultXML, \"<nextDayAM>\"));\r\n \t\t\t$packingID = substr($resultXML, strpos($resultXML, \"<packingID>\")+strlen(\"<packingID>\"), strpos($resultXML, \"</packingID>\")-strlen(\"<packingID>\")-strpos($resultXML, \"<packingID>\"));\r\n \t\t\t$aryProducts[$index] = array( $name . ', ' . $deliveryDate => $rate);\r\n \t\t\t$index++;\r\n \t\t\t$resultXML = substr($resultXML, strpos($resultXML, \"</product>\") + strlen(\"</product>\"));\r\n \t\t}\r\n \t\treturn $aryProducts;\r\n \t} else {\r\n \t\tif (strpos($resultXML, \"<error>\")) return $statusMessage;\r\n \t\telse return false;\r\n \t}\r\n }", "abstract public function parse();", "abstract public function parse();", "abstract public function parse();", "abstract public function parse();", "public function parseXML($start, $end, $xml)\t {\n\t\t\t $result = \"Can't parse XML\";\n $matches = array();\n if(preg_match('|'.$start.'(.*?)'.$end.'|i', $xml, $matches))\n $result = $matches[1];\n $start.$result.$end.\"<br/>\";\n return $result;\n\t\t}", "private function readNextElement()\n {\n $xr = $this->xmlReader;\n \n if ($this->emptyXml)\n return NULL;\n \n while ($xr->read())\n {\n // Read: /meta\n if ($xr->nodeType == XMLReader::ELEMENT &&\n $xr->name === 'meta')\n {\n return $this->readMeta();\n }\n \n // Read: /messages/msg\n if ($xr->nodeType == XMLReader::ELEMENT &&\n $xr->name === 'msg')\n {\n $type = $xr->getAttribute('type');\n \n // Read: /messages/msg/[TEXT]\n if (!$xr->read())\n break;\n assert ($xr->nodeType == XMLReader::TEXT);\n $text = $xr->value;\n \n return new Splunk_ResultsMessage($type, $text);\n }\n \n // Read: /result\n if ($xr->nodeType == XMLReader::ELEMENT &&\n $xr->name === 'result')\n {\n return $this->readResult();\n }\n }\n return NULL;\n }", "protected function parseElement()\n {\n $c = $this->parseCombinator();\n\n $e = $this->match(array(\n '/\\\\G(?:\\d+\\.\\d+|\\d+)%/',\n //'/\\\\G(?:[.#]?|:*)(?:[\\w-]|[^\\x00-\\x9f]|\\\\\\\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+/',\n // http://stackoverflow.com/questions/3665962/regular-expression-error-no-ending-delimiter\n '/\\\\G(?:[.#]?|:*)(?:[\\w-]|[^\\\\x{00}-\\\\x{9f}]|\\\\\\\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+/',\n '*',\n '&',\n 'parseAttribute',\n '/\\\\G\\([^()@]+\\)/',\n '/\\\\G[\\.#](?=@)/',\n 'parseEntitiesVariableCurly'\n ));\n\n if (!$e) {\n if ($this->matchChar('(')) {\n if (($v = $this->parseSelector()) && $this->matchChar(')')) {\n $e = new ILess_Node_Paren($v);\n }\n }\n }\n\n if ($e) {\n return new ILess_Node_Element($c, $e, $this->position, $this->env->currentFileInfo);\n }\n }", "function parse ( $src, $typeof = 'FILE', $encoding = 'UTF-8' ) {\n\n\t\t// ini;\n\t\t// (re)set array;\n\t\t$this->pOut = array();\n\t\t$this->parser = xml_parser_create();\n\n\t\txml_parser_set_option($this->parser, XML_OPTION_CASE_FOLDING, 0);\n\t\txml_parser_set_option($this->parser, XML_OPTION_TARGET_ENCODING, $encoding);\n\n\t\txml_set_object($this->parser, $this);\n\t\txml_set_element_handler($this->parser, 'startHandler', 'endHandler');\n\t\txml_set_character_data_handler($this->parser, 'contentHandler');\n\n\n\t\t// format source;\n\t\tif($typeof == NULL)\n\t\t\t$data = $src;\n\t\telseif($typeof == 'FILE') {\n\t\t\t$fop = fopen($src, 'r');\n\t\t\t$data = fread($fop, filesize($src));\n\t\t\tfclose($fop);\n\t\t}\n\t\telseif($typeof == 'CURL') {\n\t\t\t$curl = curl_init();\n\t\t\tcurl_setopt($curl, CURLOPT_URL, $src);\n\t\t\tcurl_setopt($curl, CURLOPT_HEADER, 0);\n\t\t\t$data = curl_exec($curl);\n\t\t\tcurl_close($curl);\n\t\t}\n\t\telse\n\t\t\ttrigger_error('Xml parser need data', E_USER_ERROR);\n\n\t\t// parse $data;\n\t\t$parse = xml_parse($this->parser, $data);\n\t\tif(!$parse)\n\t\t\ttrigger_error('XML Error : '.xml_error_string(xml_get_error_code($this->parser)).\n ' at line '.xml_get_current_line_number($this->parser), E_USER_ERROR);\n\n\t\t// destroy parser;\n\t\txml_parser_free($this->parser);\n\n\t\t// unset extra vars;\n\t\tunset($data, $this->track, $this->tmpLevel, $this->tmpAttrLevel);\n\n\t\t// remove global tag and return the result;\n\t\treturn $this->pOut[0][key($this->pOut[0])];\n\t}", "function process(){\n\t\t\treturn $this->xml->dumpmem();\n\t\t}", "function parse($strInputXML) {\n\n\t\t$this->objParser = xml_parser_create();\n\t\txml_set_object($this->objParser, $this);\n\t\txml_set_element_handler($this->objParser, \"tagOpen\", \"tagClosed\");\n\n\t\txml_set_character_data_handler($this->objParser, \"tagData\");\n\n\t\t$this->strXmlData = xml_parse($this->objParser, $strInputXML);\n\t\tif (!$this->strXmlData) {\n\t\t\tdie(sprintf(\"XML error: %s at line %d\",\n\t\t\t\txml_error_string(xml_get_error_code($this->objParser)),\n\t\t\t\txml_get_current_line_number($this->objParser)));\n\t\t}\n\n\t\txml_parser_free($this->objParser);\n\n\t\treturn $this->arrOutput;\n\t}", "private function parseXml()\n\t{\n\t\t$this->raw = new SimpleXMLElement( $this->content, LIBXML_NOCDATA );\n\t\treturn $this;\n\t}", "public function parse(DOMNode $node): iterable;", "function ParseXmlData($xmlData) {\n\tif (strpos($xmlData, \"<?xml\")===false) {\n\t\t$xmlStatus='500';\n\t\t$xmlInfo=$xmlData;\n\t\treturn;\n\t}\n\t$xml_parser = xml_parser_create(\"\");\n\txml_parser_set_option($xml_parser, XML_OPTION_CASE_FOLDING, false);\n\txml_set_element_handler($xml_parser, \"start_xml_tag\", \"end_xml_tag\");\n\txml_set_character_data_handler($xml_parser, \"parse_xml\");\n\txml_parse($xml_parser, $xmlData, true);\n\txml_parser_free($xml_parser);\n}", "function getXML() {\n return $this->xml;\n }", "function readXml($xmlResult)\n{\n //$data = implode(\"\", $xmlResult);\n \n $parser = xml_parser_create();\n xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, 0);\n \n xml_parser_set_option($parser, XML_OPTION_SKIP_WHITE, 1);\n xml_parse_into_struct($parser, $xmlResult, $values, $tags);\n \n if(!xml_parser_free($parser))\n die(\"Failed parsing\");\n \n // loop through the structures\n foreach ($tags as $key=>$val) {\n if ($key == \"result\") {\n $molranges = $val;\n // each contiguous pair of array entries are the\n // lower and upper range for each molecule definition\n for ($i=0; $i < count($molranges); $i+=2) {\n \n $offset = $molranges[$i] + 1;\n \n $len = $molranges[$i + 1] - $offset;\n \n $tdb[] = parseMol(array_slice($values, $offset, $len));\n \n }\n } else {\n continue;\n }\n }\n return $tdb;\n}", "protected function parseResponse()\n {\n $data = simplexml_load_string($this->body);\n \n $this->data = $data;\n }", "public function parseNode($node) {\n $item = new SimpleXMLElement($node);\n\n $id = $item->productID;\n $name = $item->name;\n $description = $item->description;\n $price = $item->price;\n $currency = $item->price['currency'];\n $url = $item->productURL;\n $categories = [];\n\n foreach($item->categories as $category) {\n array_push($categories, $category->category);\n }\n\n /*\n \tOutput file requirement:\n\n Product: [PRODUCT_NAME] ([PRODUCT_ID])\n Description: [PRODUCT_DESCRIPTION]\n Price: [PRODUCT_CURRENCY] [PRODUCT_PRICE]\n Categories: [PRODUCT_CATEGORY][,][PRODUCT_CATEGORY][...]\n URL: [PRODUCT_URL]\n */\n\n //construct the product file\n $content = 'Product: '.$name.' ('.$id.')'.PHP_EOL;\n $content .= 'Description: '.$description.PHP_EOL;\n $content .= 'Price: '.$currency.' '.$price.PHP_EOL;\n $content .= 'Categories: ';\n foreach ($categories as $category) {\n $content .= $category.', ';\n }\n $content = rtrim($content, \", \");\n $content .= PHP_EOL;\n $content .= 'URL: '.$url.PHP_EOL;\n\n //write the product file\n file_put_contents('products/'.$id.'.txt', $content);\n }", "public function parse(): PhpCss\\Ast\\Node {\n }", "public function process_root_element($data) {\n }", "function getXmlElementValue($node, $path){\r\n\t\t$element = xmlutil::GetXmlElement($node, $path);\r\n\t\tif($element === false )\r\n\t\t\treturn \"\";\r\n\t\treturn $element->nodeValue;\r\n\t}", "public function parseXmlNode(\\SimpleXMLElement $node): void\n {\n \\Logger::getLogger(\\get_class($this))->trace(__METHOD__);\n\n if ($node->getName() !== static::N_PRODUCT) {\n $msg = sprintf(\n \"Node name should be '%s' but is '%s\",\n static::N_PRODUCT, $node->getName()\n );\n \\Logger::getLogger(\\get_class($this))\n ->error(\\sprintf(__METHOD__.\" '%s'\", $msg));\n throw new AuditFileException($msg);\n }\n\n $this->setProductType(new ProductType((string) $node->{static::N_PRODUCTTYPE}));\n $this->setProductCode((string) $node->{static::N_PRODUCTCODE});\n\n if ($node->{static::N_PRODUCTGROUP}->count() > 0) {\n $this->setProductGroup((string) $node->{static::N_PRODUCTGROUP});\n } else {\n $this->setProductGroup(null);\n }\n\n $this->setProductDescription((string) $node->{static::N_PRODUCTDESCRIPTION});\n\n $this->setProductNumberCode((string) $node->{static::N_PRODUCTNUMBERCODE});\n\n if ($node->{static::N_CUSTOMSDETAILS}->count() > 0) {\n $this->getCustomsDetails()->parseXmlNode($node->{static::N_CUSTOMSDETAILS});\n }\n }", "public function parse()\n {\n }", "function startElement($parser, $name, $attr){\n global $currentTag, $currencyValue;\n $currentTag = $name;\n if(strcmp($name, \"price\") == 0)\n $currencyValue = $attr[\"currency\"];\n}", "function ting_openformmat_feeds_parse_nodes($nodelist) {\n $ret = array();\n foreach ($nodelist as $node) {\n foreach ($node->childNodes as $element) {\n // use htmlspecialchars - especially for encoding the ampersand (&) which\n // fucks up the xml.\n $ret[$element->nodeName] = check_plain($element->nodeValue);\n }\n }\n return $ret;\n}", "private function parseMessage(DOMElement $node)\n {\n if ($node->getAttribute('type') == 'error') {\n foreach ($node->childNodes as $_node)\n {\n if ($_node->localName == 'error')\n {\n // todo handle error response\n Log::info(\"===error===\");\n Log::error($_node->textContent);\n }\n }\n }elseif ($node->firstChild->localName == 'gcm' && ($json = $node->firstChild->textContent) && ($data = json_decode($json)) && @$data->message_type && @$data->message_id) {\n\n switch ($data->message_type)\n {\n case 'ack':\n // message acknowledgement received\n $this->events->fire(new MessageAcknowledged($data->message_id));\n break;\n case 'nack':\n switch (strtolower($data->error))\n {\n case 'bad_registration':\n // unregistered/uninstalled app\n $this->events->fire(new InvalidDeviceRegistration($data->from));\n break;\n case 'device_unregistered':\n // unregistered/uninstalled app\n $this->events->fire(new InvalidDeviceRegistration($data->from));\n break;\n case 'device_message_rate_exceeded':\n // device rate exceeded\n $this->events->fire(new DeviceMessageRateExceeded($data->from, null, $data->message_id));\n break;\n case 'invalid_json':\n // invalid json\n $this->events->fire(new InvalidJson($data->from, $data->description));\n break;\n default:\n // unknown error\n $this->events->fire(new AbstractError($data->error, $data->from, $data->description));\n break;\n }\n break;\n case 'control':\n if ($data->control_type == 'CONNECTION_DRAINING')\n {\n // connection server connection drainage\n $this->events->fire(new ConnectionDrainage());\n }\n break;\n case 'receipt':\n // ack for receipt of message receipt before processing receipt\n $this->sendAck($data->message_id, $data->data->device_registration_id);\n\n // message receipt\n $this->events->fire(new MessageReceiptReceived((array)$data));\n break;\n default:\n break;\n }\n\n if (@$data->registration_id) {\n // registration expired for token\n $this->events->fire(new RegistrationExpired($data->from, $data->registration_id));\n }\n\n } elseif (($json = $node->firstChild->textContent) && ($mData = json_decode($json)) && ($client_token = $mData->from) && ($client_message = $mData->data)) {\n // ack for receipt before processing message\n $this->sendAck($mData->message_id, $mData->from);\n\n // message received\n $this->events->fire(new MessageReceived((array)$mData, 'xmpp'));\n }\n }", "public function parse()\n {\n $parts = explode( '/', $this->url);\n \n $hold = array();\n \n for( $i = 0; $i < count($parts); $i += 2){\n\t $hold[ $parts[$i] ] = $parts[ $i+1 ];\n }\n $this->nodes = $hold;\n \n }", "private function parse(\\DomNode $node, $parent)\n\t{\n \tif($node->childNodes->length) {\n\t\t foreach($node->childNodes as $childNode) {\n\n\t\t \tif(!in_array($childNode->nodeName, $this->allowedTypes)) {\n\t\t \t\tcontinue;\n\t\t \t}\n\t\t\t \t\n\n\t\t\t $previousSibling = $childNode->previousSibling;\n\t\t\t $key = null;\n\n\t\t\t while($previousSibling && $previousSibling->nodeName == '#text' && $previousSibling->previousSibling) {\n\t\t\t\t $previousSibling = $previousSibling->previousSibling;\n\t\t\t\t}\n\n\t\t \tif($previousSibling && $previousSibling->nodeName == 'key') {\n\t\t\t \t$key = $previousSibling->firstChild->nodeValue;\n\t\t\t }\n\n\t\t\t\tswitch($childNode->nodeName) {\n\t\t\t\t\tcase 'array':\n\t\t\t\t\t\t$value = new PlistArray();\n\t\t\t\t\t\t$this->parse($childNode, $value);\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'dict':\n\t\t\t\t\t\t$value = new PlistDict();\n\t\t\t\t\t\t$this->parse($childNode, $value);\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'string':\n\t\t\t\t\t\t$value = new PlistString($childNode->nodeValue);\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'real':\n\t\t\t\t\t\t$value = new PlistNumber(floatval($childNode->nodeValue));\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'integer':\n\t\t\t\t\t \t$value = new PlistNumber(intval($childNode->nodeValue));\n\t\t\t\t\t \tbreak;\n\n\t\t\t\t\tcase 'true':\n\t\t\t\t\t\t$value = new PlistBoolean($childNode->nodeName == 'true');\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'false':\n\t\t\t\t\t \t$value = new PlistBoolean($childNode->nodeName == 'true');\n\t\t\t\t\t \tbreak;\n\n\t\t\t\t\t\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tthrow new PlistException($node->nodeValue . ' not implemented');\n\t\t\t\t}\n\n\t\t\t\tif($parent instanceof PlistDict) {\n\t\t\t\t\t$parent->append($key, $value);\n\t\t\t\t} else {\n\t\t\t\t\t$parent->append($value);\n\t\t\t\t}\n\t\t\t}\n \t}\n }", "protected function parseAssignElement(\\SimpleXMLElement $node) {\n\t\t\t$attributes = $node->attributes();\n\t\t\tif (!isset($attributes['location'])) {\n\t\t\t\tthrow new Throwable\\Instantiation\\Exception('Unable to initial class.');\n\t\t\t}\n\t\t\t$segments = explode('.', $this->__valueOf($attributes['location']));\n\t\t\tif (count($segments) > 0) {\n\t\t\t\t$value = Core\\Data\\Undefined::instance();\n\t\t\t\t$children = $node->children();\n\t\t\t\tif (count($children) > 0) {\n\t\t\t\t\tforeach ($children as $child) {\n\t\t\t\t\t\tswitch ($child->getName()) {\n\t\t\t\t\t\t\tcase 'array':\n\t\t\t\t\t\t\t\t$value = $this->parseArrayElement($child);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'dictionary':\n\t\t\t\t\t\t\t\t$value = $this->parseDictionaryElement($child);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'expression':\n\t\t\t\t\t\t\t\t$value = $this->parseExpressionElement($child);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'null':\n\t\t\t\t\t\t\t\t$value = $this->parseNullElement($child);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'undefined':\n\t\t\t\t\t\t\t\t$value = $this->parseUndefinedElement($child);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'value':\n\t\t\t\t\t\t\t\t$value = $this->parseValueElement($child);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\tthrow new Throwable\\Instantiation\\Exception('Unable to initial class.');\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\telse if (isset($attributes['value'])) {\n\t\t\t\t\t$value = $this->__valueOf($attributes['value']);\n\t\t\t\t\tif (isset($attributes['type'])) {\n\t\t\t\t\t\t$type = $this->__valueOf($attributes['type']);\n\t\t\t\t\t\tif (!Spring\\Data\\XML\\Syntax::isPrimitiveType($type)) {\n\t\t\t\t\t\t\tthrow new Throwable\\Instantiation\\Exception('Unable to initial class.');\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$value = Core\\Convert::changeType($value, $type);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tthrow new Throwable\\Instantiation\\Exception('Unable to initial class.');\n\t\t\t\t}\n\t\t\t\t$property = $this->models;\n\t\t\t\tforeach ($segments as $segment) {\n\t\t\t\t\tif (!Spring\\Data\\XML\\Syntax::isPropertyName($segment)) {\n\t\t\t\t\t\tthrow new Throwable\\Instantiation\\Exception('Unable to initial class.');\n\t\t\t\t\t}\n\t\t\t\t\t$property = &$property->$segment;\n\t\t\t\t}\n\t\t\t\t$property = $value;\n\t\t\t}\n\t\t}", "function readInXML()\n {\n $xml = simplexml_load_file($this->url);\n return $xml;\n }", "public function readXML ( ) {\n\n return $this->getStream()->asXML();\n }", "function parseXMLResult($doc, &$result) {\n\tglobal $gbRepeatView;\n\n\t$result = array();\n\t$median = $doc->getElementsByTagName('median')->item(0); // This is the block of info representing ALL the data of the \"median\" run.\n\tif ( ! $median ) {\n\t\treturn;\n\t}\n\t$pageview = $median->getElementsByTagName( $gbRepeatView ? 'repeatView' : 'firstView' )->item(0); // change this to 'repeatView' for primed cache\n\tif ( ! $pageview ) {\n\t\treturn;\n\t}\n\n\t$result['medianRun'] = (int)$pageview->getElementsByTagName('run')->item(0)->nodeValue;\n}", "function getXML($stamp){\n $url = AGENTS_URL.$stamp;\n $xml = @simplexml_load_file($url);\n\n\n\tif(!$xml){\n logError ('No xml from server');\n exit;\n}\nif (count($xml->children()) == 0){\n logError ('Error parseFile: xml children');\n exit;\n}\n return $xml;\n}", "public function parseXml($data = '') {\n\n if ($data == '' || !$data) {\n return [];\n }\n // Read string using SimpleXMLElement.\n $xml_data = new \\SimpleXMLElement($data);\n\n return $xml_data;\n }", "function _EndElement($parser, $name) {\n $this->_CurrentNode->Value = trim($this->_CurrentNode->Value);\n $this->_CurrentNode =& $this->_CurrentNode->ParentNode;\n }", "function parseXmlTags($content, $tag_name)\n {\n $parsed_value=\"\";\n\n if (!empty($content) && !empty($tag_name))\n {\n preg_match_all(\"/<\".preg_quote($tag_name, \"/\").\">(.*?)<\\/\".preg_quote($tag_name, \"/\").\">/ims\", $content, $output_array, PREG_SET_ORDER);\n\n if (!empty($output_array[0][1]))\n {\n $parsed_value=trim($output_array[0][1]);\n }\n }\n\n return $parsed_value;\n }", "private function load(){\n\n $xml = simplexml_load_string($this->response);\n if($xml){\n if(!$this->isResponseSuccessFull($xml)) {\n\n $item = $xml->Items->Item;\n\n $this->data['title'] = $item->ItemAttributes->Title->__toString();\n $this->data['ean'] = $item->ItemAttributes->EAN->__toString();\n $this->data['brand'] = $item->ItemAttributes->Brand->__toString();\n $this->data['picture'] = $item->SmallImage->URL->__toString();\n $this->data['asin'] = $item->ASIN->__toString();\n $this->data['price'] = round(((int)$item->ItemAttributes->ListPrice->Amount->__toString()) / 100,2);\n }\n }else{\n $this->errorMessage[] = 'can not load xml.';\n }\n }", "protected static function parse_start(nodes\\Tag $node) {\n\t\t\n\t $text_handler = '\\phphaml\\haml\\handlers\\Text';\n\t \n\t\tif($node->content[0] == '%') {\n\t\t\tif(!preg_match(self::RE_TAG, substr($node->content, 1), $match)) {\n\t\t\t static::$parser->force_handler($text_handler);\n\t\t\t return static::$parser->handle();\n\t\t\t}\n\t\t\t\n\t\t\t$node->content = substr($node->content, strlen($match[0]) + 1);\n\t\t\t$node->tag_name = $match[0];\n\t\t}\n\t\t\n\t\t$id = false;\n\t\t$classes = array();\n\t\twhile($node->content[0] == '.' or $node->content[0] == '#') {\n\t\t\t$type = $node->content[0] == '.' ? 'class' : 'id';\n\t\t\t\n\t\t\tif(!preg_match($type == 'id' ? self::RE_ID : self::RE_CLASS, substr($node->content, 1), $match)) {\n\t\t\t $node->remove();\n\t\t\t throw new NotHandledException();\n\t\t }\n\t\t\t\n\t\t\t$node->content = substr($node->content, strlen($match[0]) + 1);\n\t\t\t\n\t\t\tif($type == 'class')\n\t\t\t $classes[] = '\\'' . $match[0] . '\\'';\n\t\t\telse\n\t\t\t $id = $match[0];\n\t\t}\n\t\t\n\t\tif($classes)\n\t\t $node->attributes[] = array('\\'class\\'', $classes);\n\t\tif($id)\n\t\t $node->attributes[] = array('\\'id\\'', '\\'' . $id . '\\'');\n\t\t\n\t\tstatic::parse_html_attributes($node);\n\t\t\n\t}", "protected function _parseDescTag() {}", "public function getRootNode() {}", "protected function parseNodeAttributes()\n {\n /**\n * TODO: Clarify this problem\n *\n * Either there is a bug in the Jackrabbit builtin nodetypes CND file here:\n *\n * [rep:Group] > rep:Authorizable\n * + rep:members (rep:Members) = rep:Members multiple protected VERSION\n * - rep:members (WEAKREFERENCE) protected multiple < 'rep:Authorizable'\n *\n * or there is an error in the spec that says that a node attribute cannot be\n * \"multiple\".\n */\n $this->debug('parseNodeAttributes');\n return $this->parseAttributes('nodeAttributes', $this->getNodeAttributes());\n }", "function visita_XML($node,$lev) {\r\n\t$i=0;\r\n\twhile ($node) {\r\n\t\t$nome=$node->node_name();\r\n\t\techo \"<br> Livello $lev ° Elemento $i ° Nodo : $nome <br>\";\r\n\t\tprint_r($node);\r\n\t\tif ($node->has_attributes()) {\r\n\t\t\techo \"<br>-------- ATTRIBUTI ---------<br>\";\r\n\t\t\t$attr=$node->attributes();\r\n\t\t\tforeach ($attr as $v) {\r\n\t\t\t\tprint_r($v);\r\n\t\t\t\techo \"<br>\";\r\n\t\t\t}\r\n\t\t}\r\n\t\techo \"<br> Nodi Figli : \".count($node->child_nodes()).\"<br>\";\r\n\t\t$i++;\r\n\t\tif ($node->has_child_nodes()) {\r\n\t\t\t$lev++;\r\n\t\t\tvisita_XML($node->first_child(),$lev);\r\n\t\t\t$lev--;\r\n\t\t}\r\n\t\t$node= $node->next_sibling();\t\r\n\t}\r\n}", "protected function processData()\n {\n if (empty($this->data)) {\n throw new \\Netcreators\\NcgovPdc\\Xml\\Search\\SamenwerkendeCatalogi40\\ResponseParser\\Exception('Error: No XML data supplied.');\n }\n\n libxml_clear_errors();\n $this->xmlRoot = simplexml_load_string($this->data, '\\SimpleXmlElement', LIBXML_NOERROR);\n $lastError = libxml_get_last_error();\n if ($this->xmlRoot === false || $lastError !== false) {\n throw new \\Netcreators\\NcgovPdc\\Xml\\Search\\SamenwerkendeCatalogi40\\ResponseParser\\Exception('Xml parsing failed with message: ' . $lastError->code . ': ' . $lastError->message);\n }\n\n $this->xmlRoot->registerXPathNamespace('sru', 'http://www.loc.gov/zing/srw/'); // __ns\n $this->xmlRoot->registerXPathNameSpace('xsi', 'http://www.w3.org/2001/XMLSchema-instance');\n $this->xmlRoot->registerXPathNamespace('overheidsru', 'http://standaarden.overheid.nl/sru');\n $this->xmlRoot->registerXPathNamespace('dcterms', 'http://purl.org/dc/terms/');\n $this->xmlRoot->registerXPathNamespace('overheid', 'http://standaarden.overheid.nl/owms/terms/');\n $this->xmlRoot->registerXPathNamespace('overheidproduct', 'http://standaarden.overheid.nl/product/terms/');\n }", "public function testXmlParser() {\n $xmlElement = new SimpleDOM('<?xml version=\"1.0\"?><test/>');\n $xml = $xmlElement->asXML();\n $this->assertNotFalse($xml);\n }", "protected static function extractTypeDefFromNode($xmlnode)\n {\n // -- Links\n // -- Properties\n // -- the Object ID\n // RRM -- NEED TO ADD ALLOWABLEACTIONS\n $retval = new stdClass();\n $retval->links = self :: getLinksArray($xmlnode);\n $retval->properties = array ();\n $retval->attributes = array ();\n $result = self :: doXQueryFromNode($xmlnode, \"//cmisra:type/*\");\n foreach ($result as $node)\n {\n if ((substr($node->nodeName, 0, 13) == \"cmis:property\") && (substr($node->nodeName, -10) == \"Definition\"))\n {\n $id = $node->getElementsByTagName(\"id\")->item(0)->nodeValue;\n $cardinality = $node->getElementsByTagName(\"cardinality\")->item(0)->nodeValue;\n $propertyType = $node->getElementsByTagName(\"propertyType\")->item(0)->nodeValue;\n // Stop Gap for now\n $retval->properties[$id] = array (\n \"cmis:propertyType\" => $propertyType,\n \"cmis:cardinality\" => $cardinality,\n \n );\n } else\n {\n $retval->attributes[$node->nodeName] = $node->nodeValue;\n }\n $retval->id = $retval->attributes[\"cmis:id\"];\n }\n //TODO: RRM FIX THIS\n $children_node = $xmlnode->getElementsByTagName(\"children\");\n if (is_object($children_node)) {\n \t $children_feed_c = $children_node->item(0);\n }\n if (is_object($children_feed_c)) {\n\t\t\t$children_feed_l = $children_feed_c->getElementsByTagName(\"feed\");\n }\n if (isset($childern_feed_l) && is_object($children_feed_l) && is_object($children_feed_l->item(0))) {\n \t$children_feed = $children_feed_l->item(0);\n\t\t\t$children_doc = new DOMDocument();\n\t\t\t$xnode = $children_doc->importNode($children_feed,true); // Avoid Wrong Document Error\n\t\t\t$children_doc->appendChild($xnode);\n\t $retval->children = self :: extractTypeFeedFromNode($children_doc);\n }\n\n /*\n * \n \n \n \n \t\t$prop_nodes = $xmlnode->getElementsByTagName(\"object\")->item(0)->getElementsByTagName(\"properties\")->item(0)->childNodes;\n \t\tforeach ($prop_nodes as $pn) {\n \t\t\tif ($pn->attributes) {\n \t\t\t\t$retval->properties[$pn->attributes->getNamedItem(\"propertyDefinitionId\")->nodeValue] = $pn->getElementsByTagName(\"value\")->item(0)->nodeValue;\n \t\t\t}\n \t\t}\n $retval->uuid=$xmlnode->getElementsByTagName(\"id\")->item(0)->nodeValue;\n $retval->id=$retval->properties[\"cmis:objectId\"];\n */\n return $retval;\n }", "public function initVarfromXml() {\n if ((array) $this->xml_data) {\n foreach ($this->xml_data->xpath('//page_group') as $item) {\n foreach ($item->children() as $child) {\n $seq = 0;\n if (!empty($child['seq'])) {\n $seq = (string) $child['seq'];\n }\n if ($seq < 99) {\n\n if ($child['type'] == 'IE') {\n foreach ($child->xpath('input') as $value) {\n $tp = 0;\n if (empty($value->value)) {\n $datav = (string) $value->default;\n } else {\n $datav = (string) $value->value;\n }\n if (strtolower($value->type) == 'number')\n $tp = 1;\n if (empty($this->sccpvalues[(string) $value->name])) {\n $this->sccpvalues[(string) $value->name] = array('keyword' => (string) $value->name, 'data' => $datav, 'type' => $tp, 'seq' => $seq);\n// $this->sccpvalues[] = array('keyword' => (string)$value->name, 'data' =>(string)$value->default, 'type'=> '0');\n }\n }\n }\n if ($child['type'] == 'IS' || $child['type'] == 'IED') {\n if (empty($child->value)) {\n $datav = (string) $child->default;\n } else {\n $datav = (string) $child->value;\n }\n if (empty($this->sccpvalues[(string) $child->name])) {\n $this->sccpvalues[(string) $child->name] = array('keyword' => (string) $child->name, 'data' => $datav, 'type' => '2', 'seq' => $seq);\n// $this->sccpvalues[] = array('keyword' => (string)$child->name, 'data' =>(string)$child-> default,'type'=>'0');\n }\n }\n if ($child['type'] == 'SLD' || $child['type'] == 'SLS' || $child['type'] == 'SLT' || $child['type'] == 'SL' || $child['type'] == 'SLM' || $child['type'] == 'SLZ' || $child['type'] == 'SLZN' || $child['type'] == 'SLA') {\n if (empty($child->value)) {\n $datav = (string) $child->default;\n } else {\n $datav = (string) $child->value;\n }\n if (empty($this->sccpvalues[(string) $child->name])) {\n $this->sccpvalues[(string) $child->name] = array('keyword' => (string) $child->name, 'data' => $datav, 'type' => '2', 'seq' => $seq);\n }\n }\n }\n }\n }\n }\n }", "private function _print_xml()\n\t{\n\t\n\t}", "private function parseItem( ezcFeedEntryElement $element, DOMElement $xml )\n {\n foreach ( $xml->childNodes as $itemChild )\n {\n if ( $itemChild->nodeType === XML_ELEMENT_NODE )\n {\n $tagName = $itemChild->tagName;\n\n switch ( $tagName )\n {\n case 'id':\n $element->$tagName = $itemChild->textContent;\n break;\n\n case 'title':\n $this->parseTextNode( $element, $itemChild, 'title' );\n break;\n\n case 'rights':\n $this->parseTextNode( $element, $itemChild, 'copyright' );\n break;\n\n case 'summary':\n $this->parseTextNode( $element, $itemChild, 'description' );\n break;\n\n case 'updated':\n case 'published':\n $element->$tagName = $itemChild->textContent;\n break;\n\n case 'author':\n case 'contributor':\n $subElement = $element->add( $tagName );\n foreach ( $itemChild->childNodes as $subChild )\n {\n if ( $subChild->nodeType === XML_ELEMENT_NODE )\n {\n $subTagName = $subChild->tagName;\n if ( in_array( $subTagName, array( 'name', 'email', 'uri' ) ) )\n {\n $subElement->$subTagName = $subChild->textContent;\n }\n }\n }\n break;\n\n case 'content':\n $type = $itemChild->getAttribute( 'type' );\n $src = $itemChild->getAttribute( 'src' );\n $subElement = $element->add( $tagName );\n\n switch ( $type )\n {\n case 'xhtml':\n $nodes = $itemChild->childNodes;\n if ( $nodes instanceof DOMNodeList )\n {\n for ( $i = 0; $i < $nodes->length; $i++ )\n {\n if ( $nodes->item( $i ) instanceof DOMElement )\n {\n break;\n }\n }\n\n $contentNode = $nodes->item( $i );\n $subElement->text = $contentNode->nodeValue;\n }\n $subElement->type = $type;\n break;\n\n case 'html':\n $subElement->text = $itemChild->textContent;\n $subElement->type = $type;\n break;\n\n case 'text':\n $subElement->text = $itemChild->textContent;\n $subElement->type = $type;\n break;\n\n case null:\n $subElement->text = $itemChild->textContent;\n break;\n\n default:\n if ( preg_match( '@[+/]xml$@i', $type ) !== 0 )\n {\n foreach ( $itemChild->childNodes as $node )\n {\n if ( $node->nodeType === XML_ELEMENT_NODE )\n {\n $doc = new DOMDocument( '1.0', 'UTF-8' );\n $copyNode = $doc->importNode( $node, true );\n $doc->appendChild( $copyNode );\n $subElement->text = $doc->saveXML();\n $subElement->type = $type;\n break;\n }\n }\n }\n else if ( substr_compare( $type, 'text/', 0, 5, true ) === 0 )\n {\n $subElement->text = $itemChild->textContent;\n $subElement->type = $type;\n break;\n }\n else // base64\n {\n $subElement->text = base64_decode( $itemChild->textContent );\n $subElement->type = $type;\n }\n break;\n }\n\n if ( !empty( $src ) )\n {\n $subElement->src = $src;\n }\n\n $language = $itemChild->getAttribute( 'xml:lang' );\n if ( !empty( $language ) )\n {\n $subElement->language = $language;\n }\n\n break;\n\n case 'link':\n $subElement = $element->add( $tagName );\n\n $attributes = array( 'href' => 'href', 'rel' => 'rel', 'hreflang' => 'hreflang',\n 'type' => 'type', 'title' => 'title', 'length' => 'length' );\n\n foreach ( $attributes as $name => $alias )\n {\n if ( $itemChild->hasAttribute( $name ) )\n {\n $subElement->$alias = $itemChild->getAttribute( $name );\n }\n }\n break;\n\n case 'category':\n $subElement = $element->add( $tagName );\n\n $attributes = array( 'term' => 'term', 'scheme' => 'scheme', 'label' => 'label' );\n foreach ( $attributes as $name => $alias )\n {\n if ( $itemChild->hasAttribute( $name ) )\n {\n $subElement->$alias = $itemChild->getAttribute( $name );\n }\n }\n break;\n\n case 'source':\n $subElement = $element->add( $tagName );\n $this->parseSource( $subElement, $itemChild );\n break;\n\n default:\n $this->parseModules( $element, $itemChild, $tagName );\n break;\n }\n }\n }\n\n if ( $xml->hasAttribute( 'xml:lang' ) )\n {\n $element->language = $xml->getAttribute( 'xml:lang' );\n }\n }", "function readtag($xmltext) {\n \n\t $text = ltrim($xmltext); //left rrim\n\t \n\t $i = 1; //bypass \"<\"\n\t while ($text[$i]!='>') {\n\t $preout .= $text[$i];\n\t $i+=1;\n\t }\n\t \n\t $tagpart = explode(\" \",$preout); //split in case of tag attr\n\t \n\t return ($tagpart[0]); //roottag name \n }", "public function parseXML($filePath) {\n \t$doc = $this->_loadXML($filePath);\n\n \t$texts = $doc->getElementsByTagName('text');\n \tforeach ($texts as $text) {\n \t\tdefine($text->getAttribute('id'), $text->nodeValue);\n \t}\n\n //\tthat's all folks!\n }", "public function asXML();", "protected function return_node_value($doc, $result = '') \n\t{\t\n\t\t$tmpdoc = new DOMDocument();\n\t\t$tmpdoc->appendChild($tmpdoc->importNode($doc, TRUE));\n\t\t$tmpdoc->formatOutput = true;\n\t\t$result .= $tmpdoc->saveXML();\n\t\t$result = str_replace(array(\"\\r\\n\", \"\\r\", \"\\n\", \"\\t\", \"&#xD;\"), '', $result);\n\t\t$result = trim(preg_replace('/<\\?xml.*\\?>/', '', $result, 1));\n\t\treturn $result;\n\t}", "public function getValue(Node $node);", "protected static function parseXslValueOf(DOMElement $ir, DOMElement $node)\n\t{\n\t\tself::appendOutput($ir, 'xpath', $node->getAttribute('select'));\n\t}", "public function parseStringForCmsElementInfo($string);", "private function parsePerson( $element, DOMElement $xml, $type )\n {\n foreach ( $xml->childNodes as $itemChild )\n {\n if ( $itemChild->nodeType === XML_ELEMENT_NODE )\n {\n $tagName = $itemChild->tagName;\n\n switch ( $tagName )\n {\n case 'name':\n case 'email':\n case 'uri':\n $element->$tagName = $itemChild->textContent;\n break;\n }\n }\n }\n }", "protected static function parseNodeName($node) {\r\n return $node;\r\n }", "public function getXml() {}", "function xml_get($name,$num,$filename){\n $dom=new DOMDocument('1.0');\n $dom->load($filename);\n $records = $dom->getElementsByTagName($name);\n return $records->item($num)->nodeValue;\n}", "public function getValue() {\n return $this->node->hasAttribute('value') ? iconv('utf-8', xp::ENCODING, $this->node->getAttribute('value')) : NULL;\n }", "abstract protected function getMetaFromFormatNode(\\DOMNode $formatNode);", "function parseFormValueXML($xmlString, $lng = 0, $complete = FALSE, $nameForEmptyCaption = TRUE) {\n $values = array();\n // Get the appropriate language name\n if ($lng > 0) {\n $lngName = $this->getLanguageTitle($lng);\n } else {\n $lngName = 'en-US';\n }\n // Try to create an XML tree and check whether it's valid\n $xml = simple_xmltree::createFromXML($xmlString, $this);\n if (!($xml && isset($xml->documentElement))) {\n return $values;\n }\n // Formally, everything is okay, so start parsing the XML tree\n $doc = $xml->documentElement;\n if (!$doc->hasChildNodes()) {\n return $values;\n }\n for ($i = 0; $i < $doc->childNodes->length; $i++) {\n unset($name, $caption);\n $val = $doc->childNodes->item($i);\n if ($val->nodeType == XML_ELEMENT_NODE &&\n $val->nodeName == 'value' && $val->hasChildNodes()) {\n for ($j = 0; $j < $val->childNodes->length; $j++) {\n $node = $val->childNodes->item($j);\n if ($node->nodeType == XML_ELEMENT_NODE) {\n $childrenFound = FALSE;\n if ($node->nodeName == 'content' && $node->hasChildNodes()) {\n $contentNode = &$node->childNodes->item(0);\n if ($contentNode->nodeType == XML_TEXT_NODE) {\n $childrenFound = TRUE;\n $nameNode = $node->childNodes->item(0);\n $name = $nameNode->valueOf();\n }\n }\n if (!$childrenFound &&\n $node->nodeName == 'captions' && $node->hasChildNodes()) {\n for ($k = 0; $k < $node->childNodes->length; $k++) {\n $subNode = $node->childNodes->item($k);\n if ($subNode->nodeType == XML_ELEMENT_NODE && $subNode->hasChildNodes()) {\n $captionNode = $subNode->childNodes->item(0);\n if ($captionNode->nodeType == XML_TEXT_NODE) {\n if ($complete) {\n if (!isset($caption)) {\n $caption = array();\n }\n $caption[$subNode->nodeName] = $captionNode->valueOf();\n } elseif ($subNode->nodeName == $lngName) {\n $caption = $captionNode->valueOf();\n }\n }\n }\n }\n }\n }\n }\n }\n if (isset($name)) {\n if ($nameForEmptyCaption == TRUE) {\n $caption = (!isset($caption)) ? $name : '';\n }\n $values[$name] = $caption;\n }\n }\n return $values;\n }" ]
[ "0.654538", "0.6280129", "0.61916906", "0.6133502", "0.59902084", "0.58383137", "0.5718693", "0.569693", "0.5641078", "0.56214416", "0.55662996", "0.5555116", "0.5504472", "0.5382005", "0.53462636", "0.5291961", "0.52723503", "0.5237331", "0.5233285", "0.52276844", "0.52087164", "0.5207073", "0.5194351", "0.5177685", "0.513043", "0.5129376", "0.50859827", "0.5081724", "0.50698614", "0.50698614", "0.50698614", "0.5056705", "0.5053586", "0.504656", "0.5045682", "0.5045682", "0.50449216", "0.5044658", "0.50359464", "0.50341165", "0.5027539", "0.5027539", "0.5027539", "0.5027539", "0.50013417", "0.49930158", "0.49743924", "0.49667513", "0.49599445", "0.49580386", "0.49568975", "0.491717", "0.49163893", "0.4866093", "0.4864344", "0.48611766", "0.48323247", "0.4827683", "0.4811185", "0.48076916", "0.48001945", "0.47971806", "0.47860044", "0.47832185", "0.47643447", "0.47613987", "0.47605535", "0.47454184", "0.47357786", "0.47273058", "0.4722711", "0.47072122", "0.46965086", "0.46933734", "0.46806052", "0.46754032", "0.46673918", "0.46673447", "0.46627587", "0.46604592", "0.46414983", "0.46406493", "0.46337777", "0.46323997", "0.4631514", "0.4630856", "0.46307322", "0.4630267", "0.46273386", "0.46214628", "0.46198583", "0.46148437", "0.46125156", "0.4610397", "0.4609627", "0.46049422", "0.46038875", "0.4600013", "0.45815396", "0.45758736", "0.45735726" ]
0.0
-1
Display a listing of the resource.
public function index() { $jadwal = Jadwal::all(); return view('jadwal.index', compact('jadwal')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->resource->getList($offset, $limit, $filter, $sort);\n\n $this->View()->assign($result);\n $this->View()->assign('success', true);\n }", "public function listing();", "function index() {\n\t\t$this->show_list();\n\t}", "public function actionList() {\n $this->_getList();\n }", "public function listAction()\n {\n $model = $this->_getPhotoModel();\n $entries = $model->fetchEntries($this->_getParam('page', 1));\n\n $this->view->url = 'http://' . $this->_request->getHttpHost() . $this->_request->getBaseUrl(); \n $this->view->paginator = $entries;\n }", "public function index()\n {\n $items = Item::all();\n return ItemForShowResource::collection($items);\n }", "public function index()\n {\n return Resource::collection(($this->getModel())::paginate(10));\n }", "function index()\n\t{\n\t\t$this->_list();\n\t\t$this->display();\n\t}", "public function listingAction(){\n if (!LoginHelper::isAdmin()){\n Router::redirect('home', '<p class=\"alert alert-danger\">Unauthorized</p>');\n }\n $this->view->render('patient/list', Patient::all());\n }", "public function index()\n {\n //\n $list = $this->obj->all();\n\n return $this->render('index', compact('list'));\n }", "public function action_index()\n\t{\n\t\t$this->template->title = 'Resources';\n\t\t$this->view = View::factory('admin/resource/index');\n\t\t$this->template->scripts[] = 'media/js/jquery.tablesorter.min.js';\n\t\t$this->template->scripts[] = 'media/js/admin/resource.js';\n\t\t\n\t\t$resources = Sprig::factory('resource')->load(NULL, FALSE);\n\t\tif (!empty($resources))\n\t\t{\n\t\t\t$this->view->resources = $resources->as_array();\n\t\t}\n\t}", "function listing()\n\t\t{\n\t\t// en $this->_view->_listado para poder acceder a el desde la vista.\n\t\t\t$this->_view->_listado = $listado = $this->_instrumentoModel->getInstrumento();\n\t\t\t$this->_view->render('listing', '', '',$this->_sidebar_menu);\n\t\t}", "public function listAction()\n {\n $em = $this->getDoctrine()->getManager();\n \n $todos = $em->getRepository(Todo::class)->findAll();\n \n return $this->render('todo/index.html.twig', array(\n 'todos' => $todos,\n ));\n }", "public function index()\n\t{\n $this->authorize('list', Instance::class);\n\n\t\treturn $this->ok($this->repo->paginate($this->request->all()));\n\t}", "public function actionRestList() {\n\t $this->doRestList();\n\t}", "public function listing()\n\t{\n\t\t$hospitalID = $this->request->getSession()->read(\"hospital_id\") ? $this->request->getSession()->read(\"hospital_id\") : \"\";\n\t\t\n\t\t$patientMonitored = 1;\n\t\t$patientActive = 1;\n\t\t\n\t\t//GET ALL PATIENTS\n\t\t$patientsData = $this->Patients->allPatients($hospitalID,$patientMonitored,$patientActive);\n\t\t//GET ALL PATIENTS\n\t\t\n\t\t//echo \"<pre>\"; print_r($patientsData);die;\n\t\t$this->set(compact(\"patientsData\"));\n\t}", "public function listAction()\n {\n $htmlpage = '<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"UTF-8\">\n <title>todos list!</title>\n </head>\n <body>\n <h1>todos list</h1>\n <p>Here are all your todos:</p>\n <ul>';\n \n $em = $this->getDoctrine()->getManager();\n $todos = $em->getRepository(Todo::class)->findAll();\n foreach($todos as $todo) {\n $htmlpage .= '<li>\n <a href=\"/todo/'.$todo->getid().'\">'.$todo->getTitle().'</a></li>';\n }\n $htmlpage .= '</ul>';\n\n $htmlpage .= '</body></html>';\n \n return new Response(\n $htmlpage,\n Response::HTTP_OK,\n array('content-type' => 'text/html')\n );\n }", "public function index()\n {\n // Get Persons\n $person = Person::paginate(10);\n\n //Return collection of person as a resource\n return PersonResource::collection($person);\n }", "public function listAction() {\n\t\t$this->view->title = $this->translator->translate(\"Invoice list\");\n\t\t$this->view->description = $this->translator->translate(\"Here you can see all the invoices.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"/admin/invoices/new/\", \"label\" => $this->translator->translate('New'), \"params\" => array('css' => null)));\r\n\t\t$this->datagrid->setConfig ( Invoices::grid() )->datagrid ();\n\t}", "public function listAll()\n\t{\n\t\t$this->render(self::PATH_VIEWS . '/list', [\n\t\t\t'pages' => $this->pagesDb->findAll('id', 'DESC'),\n\t\t]);\n\t}", "public function list()\n {\n // récupérer les données : toutes les catégories enregistrées\n $productList = Product::findAll();\n\n $this->show('product/list', [\n 'productList' => $productList\n ]);\n }", "public function index()\n {\n // CRUD -> Retrieve --> List\n // BREAD -> Browse Read Edit Add Delete\n // return Item::all();\n return view('list_items',compact('items'));\n }", "public function index()\n {\n // Get manufacturers\n $manufacturers = Manufacturer::orderBy('created_at', 'desc')->paginate(15);\n\n // Return collection of manufacturers as a resource\n return ManufacturerResource::collection($manufacturers);\n }", "public function index()\n {\n return ArtistResource::collection(Artist::orderBy('created_at', 'desc')->get());\n }", "public function indexAction() {\n\t\t$page = intval($this->getInput('page'));\n\t\t$perpage = $this->perpage;\n\t\t\n\t\tlist(,$files) = Lock_Service_FileType::getAllFileType();\n\t\t$data = array();\n\t\tforeach ($files as $key=>$value) {\n\t\t\t$data[$key]['id'] = $value['id'];\n\t\t\t$data[$key]['title'] = $value['name'];\n\t\t}\n\t\tlist($total, $filetype) = Lock_Service_FileType::getList($page, $perpage);\n\t\t$this->assign('filetype', $filetype);\n\t\t$this->assign('pager', Common::getPages($total, $page, $perpage, $this->actions['listUrl'].'/?'));\n\t\t$this->assign('data', json_encode($data));\n\t}", "public function listAction()\n {\n $qb = $this->getRepository()->queryAll();\n\n $view = new ImportListView;\n $view->imports = $qb->getQuery()->execute();\n\n return $this->templating->renderResponse('InfiniteImportBundle:Import:list.html.twig', array(\n 'data' => $view\n ));\n }", "public function index()\n\t{\n\t\t//Return model all()\n\t\t$instances = $this->decorator->getListingModels();\n\n\t\treturn View::make($this->listingView, array(\n\t\t\t'instances' => $instances,\n\t\t\t'controller' => get_class($this), \n\t\t\t'modelName' => class_basename(get_class($this->decorator->getModel())),\n\t\t\t'columns' => $this->getColumnsForInstances($instances),\n\t\t\t'editable' => $this->editable\n\t\t));\n\t}", "public function index()\n {\n return InfografiResources::collection(\n Infografi::orderBy('date', 'desc')->get()\n );\n }", "public function listAction()\n\t {\n\t\t\t$this->_forward('index');\n \n\t\t}", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function listAction()\n {\n $defaults = array(\n 'page' => null,\n 'order' => null,\n 'limit' => null,\n 'offset' => null,\n 'filter' => array(),\n );\n $body = $this->getRequest()->getBody();\n $options = $body + $defaults;\n\n // Process the options\n if (is_string($options['order'])) {\n $options['order'] = array_map('trim', explode(',', $options['order']));\n }\n if (is_string($options['page'])) {\n $options['page'] = (int)$options['page'];\n }\n if (is_string($options['limit'])) {\n $options['limit'] = (int)$options['limit'];\n }\n if (is_string($options['offset'])) {\n $options['offset'] = (int)$options['offset'];\n }\n $filter = $options['filter'];\n unset($options['filter']);\n\n $options = array_filter($options);\n\n return $this->getBinding()->find($filter, $options);\n }", "public function index()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the resources from the model */\n $resources = $this->resourcesList($this->model);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.index\")) {\n $view = \"admin.{$this->name}.index\";\n } else {\n $view = 'admin.includes.actions.index';\n }\n\n /* Display a listing of the resources */\n return view($view)\n ->with('resources', $resources)\n ->with('module', $this->module);\n }", "public function index()\n\t{\n\t\t$data['lists'] = $this->mdl_student->get_all();\n\t\t$this->template->set('title', 'Student Hostel List');\n\t\t$this->template->load('template', 'contents', 'student_hostel/student_hostel_list', $data);\n\t}", "public function index()\n {\n $modules = Module::all();\n return Resource::collection($modules);\n }", "public function index()\n {\n // List all resources from user entity\n $users = User::all();\n\n return $this->showAll($users);\n }", "public function index()\n {\n // Get todos\n $todos = Todo::orderBy('created_at', 'desc')->paginate(3);\n\n // Return collection of articles as a resource\n return TodoResource::collection($todos);\n }", "public function index()\n {\n return Resources::collection(Checking::paginate());\n }", "public function index()\n {\n return CourseListResource::collection(\n Course::query()->withoutGlobalScope('publish')\n ->latest()->paginate()\n );\n }", "public function index()\n {\n $cars = Car::paginate(15);\n return CarResource::collection($cars);\n }", "public function index()\n {\n // Get articles\n $articles = Article::orderBy('created_at', 'desc')->paginate(5);\n\n // Return collection of articles as a resource\n return ArticleResource::collection($articles);\n }", "public function index()\n {\n $authors = Author::paginate(10);\n\n return AuthorResource::collection($authors);\n }", "public function index()\n {\n //Get Books\n $books = Book::paginate(10);\n \n if ($books) {\n return (BookResource::collection($books))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n } else {\n return (BookResource::collection([]))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n }\n return view('index')->with('data', $books);\n }", "public function view(){\n\t\t$this->buildListing();\n\t}", "public function index()\n {\n $books = Book::latest()\n ->paginate(20);\n\n return BookResource::collection($books);\n }", "public function index()\n {\n $listing = Listing::orderBy('id', 'desc')->paginate(10);\n return view('listings.index')->withListings($listing);\n }", "public function listAction()\n {\n $this->_getSession()->setFormData([]);\n\n $this->_title($this->__('Training Cms'))\n ->_title($this->__('Pages'));\n\n $this->loadLayout();\n\n $this->_setActiveMenu('training_cms');\n $this->_addBreadcrumb($this->__('Training Cms'), $this->__('Training Cms'));\n $this->_addBreadcrumb($this->__('Pages'), $this->__('Pages'));\n\n $this->renderLayout();\n }", "public function index()\n {\n $services = $this->serviceRepository->paginate();\n\n return ServiceResource::collection($services);\n }", "public function index()\n {\n $resources = ResourceManagement::paginate(5);\n $users = User::get();\n\n return view('resources-mgmt/index', ['resources' => $resources, 'users' => $users]);\n }", "public function index()\n {\n $catalogs = Catalog::where('status', '=', Catalog::PUBLICADO)\n ->orderBy('id', 'DESC')->get();\n \n $data = CatalogResource::collection($catalogs);\n\n return [\n 'items' => $data,\n 'mensaje' => ''\n ];\n }", "public function listAction(){\n // In a controller this can be:\n // $this->request->getQuery('page', 'int'); // GET\n $currentPage = $this->request->getPost('pageindex', 'int'); // POST\n $pageNum = ($currentPage == null) ? 1 : $currentPage;\n\n // The data set to paginate\n $message = new Notice();\n $results = $message->getMsg4Admin();\n\n // Create a Model paginator, show 10 rows by page starting from $currentPage\n $paginator = new PaginatorArray(\n array(\n \"data\" => $results,\n \"limit\" => 10,\n \"page\" => $pageNum\n )\n );\n\n // Get the paginated results\n $page = $paginator->getPaginate();\n\n return $this->response->setJsonContent($page);\n\n }", "public function list()\n {\n try {\n return $this->success($this->service->list());\n } catch (\\Exception $exception) {\n return $this->error($exception->getMessage());\n }\n }", "public function index()\n {\n return $this->sendResponse(CrisisResource::collection(Crisis::paginate(10)), 'Data fetched successfully');\n }", "public function index()\n\t{\n\t\t$%Alias = new %Model();\n\t\t$params = array();\n\t\t\n\t\t$Paginator = new Paginator( $%Alias->findSize( $params ), $this->getLimit(), $this->getPage() );\n\t\t$this->getView()->set( '%Aliass', $%Alias->findList( $params, 'Id desc', $this->getOffset(), $this->getLimit() ) );\n\t\t$this->getView()->set( 'Paginator', $Paginator );\n\t\treturn $this->getView()->render();\n\t}", "public function listAction() {}", "public function index()\n {\n\n return RecipeResource::collection(Recipe::all());\n }", "public function index()\n {\n $this->indexPage('list-product', 'List Product');\n }", "public function listAction()\n {\t\n\t\t$this->removeSession();\n\t\t$this->verifySessionRights();\n\t\t$this->setActivity(\"List view\");\n $em = $this->getDoctrine()->getManager();\n $oRepClient = $em->getRepository('BoAdminBundle:Client');\n\t\t$nb_tc = $oRepClient->getTotal();\n\t\t//get page\n\t\t$page = $this->get('session')->get('page');\n\t\tif($page==null){\n\t\t\t$page=1;\n\t\t\t$this->get('session')->set('page',1);\n\t\t}\n\t\t//get number line per page\n\t\t$nb_cpp = $em->getRepository('BoAdminBundle:Param')->getParam(\"display_list_page_number\",1);\n\t\t$nb_pages = ceil($nb_tc/$nb_cpp);\n\t\t$offset = $page>0?($page-1) * $nb_cpp:0;\n\t\t$clients = $em->getRepository('BoAdminBundle:Client')->findBy(array(),array('id' => 'desc'),$nb_cpp,$offset);\n $form = $this->createForm('Bo\\AdminBundle\\Form\\ClientType', new Client());\n return $this->render('client/index.html.twig', array(\n 'clients' => $clients,\n\t\t\t'page' => $page, // forward current page to view,\n\t\t\t'nb_pages' => $nb_pages, //total number page,\n 'form' => $form->createView(),\n\t\t\t'total'=>$nb_tc, // record number.\n\t\t\t'nb_cpp' => $nb_cpp,// line's number to display\n\t\t\t'pm'=>\"contracts\",\n\t\t\t'sm'=>\"client\",\n ));\n }", "public function index()\n {\n return AcResource::collection(Ac::latest()->paginate()); //\n }", "public function executeList()\n {\n $this->setTemplate('list');\n }", "public function indexAction()\n {\n $books = Book::getAll();\n\n View::renderTemplate('Books/index.html', [\n 'books' => $books\n ]);\n }", "function listing() {\r\n\r\n }", "public function listar() {\n $rs = $this->model->listar();\n\n echo $this->toJson($rs);\n }", "public function index()\n {\n return BookResource::collection(Book::orderby('id')->get());\n }", "public function doRestList()\n {\n $this->outputHelper( \n 'Records Retrieved Successfully', \n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->orderBy($this->restSort)->limit($this->restLimit)->offset($this->restOffset)->findAll(),\n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->count()\n );\n\t}", "public function index()\n {\n $client = Client::paginate();\n return ClientResource::collection($client);\n }", "public function index()\n {\n return TagResource::collection(\n Tag::orderBy('name', 'ASC')->paginate(request('per_page', 10))\n );\n }", "public function _index(){\n\t $this->_list();\n\t}", "public function index()\n\t{\n\t\t$data['lists'] = $this->gallery_mdl->get_all();\n\t\t$this->template->set('title', 'Gallery');\n\t\t$this->template->render('template', 'list', $data);\n\t}", "function drush_restapi_list() {\n\n $resources = restapi_get_resources();\n $last_module = NULL;\n $rows = [\n [dt('Module'), dt('Path'), dt('Class')],\n ];\n\n foreach($resources as $resource) {\n if ($last_module != $resource->getModule()) {\n $module = $last_module = $resource->getModule();\n }\n else {\n $module = '';\n }\n $rows[] = [$module, $resource->getPath(), $resource->getClass()];\n }\n\n drush_print_table($rows, TRUE);\n drush_log(dt('Displaying !count total resources', [\n '!count' => count($resources),\n ]), 'ok');\n\n}", "public function index()\n {\n $this->booklist();\n }", "public function index()\n {\n //\n $accounts = accounts::paginate(15);\n\n //return the collection of employees as a resource\n return accountResource::collection($accounts);\n\n\n }", "public function index()\n {\n $items = Item::all();\n return view('items::list_items',compact('items'));\n }", "public function index()\n {\n // Get houses\n $houses = House::orderBy('created_at', 'desc')->paginate(self::PAGINATE);\n \n // Return collection of houses\n \n return HouseResource::collection($houses);\n }", "public function index()\n {\n $products = Product::paginate(6);\n return ProductResource::collection($products);\n }", "public function index() {\n $this->template->allFoundItems = Found::showAll();\n $this->template->display( 'index.html.php' );\n }", "public function indexAction() {\n $this->_forward('list');\n }", "public function index()\n {\n $data = Productcategory::paginate(10);\n\t\treturn ProductcategoryResource::Collection($data);\n }", "public function index()\n {\n return SongResource::collection(\\App\\Song::orderBy('created_at', 'desc')->get());\n }", "public function ListView()\n\t{\n\t\t\n\t\t// Requer permissão de acesso\n\t\t$this->RequirePermission(Usuario::$P_ADMIN,\n\t\t\t\t'SecureExample.LoginForm',\n\t\t\t\t'Autentique-se para acessar esta página',\n\t\t\t\t'Você não possui permissão para acessar essa página ou sua sessão expirou');\n\t\t\n\t\t//$usuario = Controller::GetCurrentUser();\n\t\t//$this->Assign('usuario',$usuario);\n\t\t$this->Render();\n\t}", "public function index () {\n permiss ( 'role.list' );\n\n $data = $this->entity\n ->orderBy('created_at', 'desc')->get();\n\n return new ModelResource($data);\n }", "public function showResources()\n {\n $resources = Resource::get();\n return view('resources', compact('resources'));\n }", "public function index()\n {\n //get articless\n $articles = Article::paginate(15);\n\n //Return collection of article has a resource\n return ArticleResource::collection($articles);\n\n }", "public function actionList() {\n header(\"Content-type: application/json\");\n $verb = $_SERVER[\"REQUEST_METHOD\"];\n\n if ($verb === 'GET') {\n echo \"{\\\"data\\\":\" . CJSON::encode(Donneur::model()->findAll()) . \"}\";\n } else if ($verb == 'POST') {\n if (Donneur::model()->exists('id' === $_POST['id'])) {\n $this->actionListUpdate($_POST);\n } else {\n $this->actionListPost();\n }\n } else if ($verb == 'DELETE') {\n $this->actionListDelete();\n }\n }", "public function list()\n {\n return $this->http->request(HttpMethods::GET, $this->endpoint);\n }", "public function indexAction(){\n $data = array(\n 'collection' => $this->model->getCollection(),\n \n ); \t\n return $this->getView($data);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('DiverPriceLisrBundle:Items')->findAll();\n\n return $this->render('DiverPriceLisrBundle:Items:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => Slaves::find(),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function listAction() {\n\t\t// Recogemos el repositorio\n\t\t$repository = $this->getDoctrine() ->getRepository('AppBundle:Product');\n\t\n\t\t// Recuperamos todos los productos.\n\t\t$products = $repository->findAll();\n\t\t// Pasamos a la plantilla el aray products\n\t\treturn $this->render('product/listActionProduct.html.twig', array( 'products' => $products));\n\t\n\t}", "public function listAction()\n\t {\n\t\t$model = $this->_getModel();\n\t\t$result = $model->getLayouts();\t\n\t\t$page = (int)($this->_request->getParam('page')); \n\t\tif(count($result) > 0)\n\t\t{ \n\t\t\tGlobals::doPaging($result, $page, $this->view);\n\t\t}\n\t\t\t\t\n\t\t$this->view->page = $page;\n\t }", "public function actionList()\n {\n // get model\n $model = new $this->_model('search');\n $model->unsetAttributes();\n\n // set filter\n if (isset($_GET[$this->_model])) {\n $model->attributes = $_GET[$this->_model];\n }\n $model->u_cms_album_id = $_GET['album'];\n\n // search\n $dataProvider = $model->search(Yii::app()->language);\n // sort\n $sort = $dataProvider->getSort();\n // route\n $sort->route = $this->id . '/list';\n\n // pagination parameters\n $pagination = $dataProvider->getPagination();\n $pagination->route = $this->id . '/list';\n $pagination->pageSize = UInterfaceSetting::model()->getSettings($this->id . ':' . $this->module->id, Yii::app()->user->id)->page_size;\n $pagination->itemCount = $dataProvider->totalItemCount;\n\n // datas\n $datas = $dataProvider->getData();\n\n // related datas\n $relatedDatas = $this->_loadRelatedData();\n\n // template\n $template = isset($_REQUEST['partial']) ? 'list/_table' : 'list/main';\n\n $jsonParams = array();\n if (Yii::app()->request->isAjaxRequest) {\n // filters\n $filtersDatas = array();\n if (isset($_GET[$this->_model])) {\n $filtersDatas[$this->_model] = $_GET[$this->_model];\n }\n if (isset($_GET[$sort->sortVar])) {\n $filtersDatas[$sort->sortVar] = $_GET[$sort->sortVar];\n }\n\n $jsonParams = array(\n 'filters' => http_build_query($filtersDatas)\n );\n }\n\n $this->dynamicRender(\n $template,\n array(\n 'dataView' => new $this->crudComponents['listDataView'](\n $datas, $relatedDatas, $model, $sort, $pagination, $this\n )\n ),\n $jsonParams\n );\n }", "public function index()\n {\n return view('listings.index')->with('listings', Listing::all());\n }", "public function get_index()\n\t{\n\t\t$pages = Page::recent_available()->paginate(30);\n\t\t$table = Cello\\Presenter\\Page::table($pages);\n\t\t$data = array(\n\t\t\t'eloquent' => $pages,\n\t\t\t'table' => $table,\n\t\t);\n\n\t\tSite::set('title', __('cello::title.pages.list'));\n\n\t\treturn View::make('cello::api.resources.index', $data);\n\t}", "public function index()\n {\n return ProductResource::collection(Product::latest()->paginate(10));\n }", "public function index()\n {\n $category = GalleryCategory::paginate(15);\n\n // return collection of category as a resource.\n return Resource::collection($category);\n }", "public function index()\n {\n //\n $news = News::latest()->paginate(18);\n\n return NewsResource::collection($news);\n }", "public function indexAction() {\n\t\t$list_info = Zend_Registry::get('list_info');\n if (!Engine_Api::_()->core()->hasSubject('list_listing')) {\n return $this->setNoRender();\n }\n \n $this->view->expiry_setting = Engine_Api::_()->list()->expirySettings();\n\n //GET SUBJECT\n $this->view->list = $list = Engine_Api::_()->core()->getSubject('list_listing');\n\n\t\t//GET CATEGORY TABLE\n\t\t$this->view->tableCategory = Engine_Api::_()->getDbTable('categories', 'list');\n\n //GET CATEGORIES NAME\n\t\t$this->view->category_name = $this->view->subcategory_name = $this->view->subsubcategory_name = '';\n\n\t\tif(!empty($list->category_id)) {\n\t\t\tif($this->view->tableCategory->getCategory($list->category_id))\n\t\t\t$this->view->category_name = $this->view->tableCategory->getCategory($list->category_id)->category_name;\n\n\t\t\tif(!empty($list->subcategory_id)) {\n\t\t\t\tif($this->view->tableCategory->getCategory($list->subcategory_id))\n\t\t\t\t$this->view->subcategory_name = $this->view->tableCategory->getCategory($list->subcategory_id)->category_name;\n\n\t\t\t\tif(!empty($list->subsubcategory_id)) {\n\t\t\t\t\tif($this->view->tableCategory->getCategory($list->subsubcategory_id))\n\t\t\t\t\t$this->view->subsubcategory_name = $this->view->tableCategory->getCategory($list->subsubcategory_id)->category_name;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n //GET LISTING TAGS\n $this->view->listTags = $list->tags()->getTagMaps();\n\n\t\t//GET OTHER DETAILS\n\t\t$this->view->list_description = Zend_Registry::get('list_descriptions');\n $this->view->addHelperPath(APPLICATION_PATH . '/application/modules/Fields/View/Helper', 'Fields_View_Helper');\n $this->view->fieldStructure = Engine_Api::_()->fields()->getFieldsStructurePartial($list);\n\t\tif(empty($list_info)){ return $this->setNoRender(); }\n }", "public function index()\n {\n return $this->service->fetchResources(Author::class, 'authors');\n }", "public function index()\n {\n return view('admin.resources.index');\n }", "public function doRestList() {\n\t\t$this->outputHelper ( 'Collections Retrieved Successfully', $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->orderBy ( $this->restSort )->limit ( $this->restLimit )->offset ( $this->restOffset )->findAll (), $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->count () );\n\t}" ]
[ "0.7446777", "0.736227", "0.73005503", "0.72478926", "0.71631265", "0.71489686", "0.7131636", "0.7105969", "0.71029514", "0.7101372", "0.70508176", "0.6995128", "0.69890636", "0.6934895", "0.6900203", "0.6899281", "0.6891734", "0.6887235", "0.68670005", "0.6849741", "0.6830523", "0.6802689", "0.6797", "0.67957735", "0.67871135", "0.6760129", "0.67427456", "0.6730486", "0.67272323", "0.67255723", "0.67255723", "0.67255723", "0.67177945", "0.6707866", "0.6706713", "0.6704375", "0.6664782", "0.6662871", "0.6660302", "0.6659404", "0.6656656", "0.6653517", "0.6647965", "0.6620322", "0.66185474", "0.6618499", "0.6606105", "0.6600617", "0.65996987", "0.6594775", "0.6587389", "0.6585109", "0.6581641", "0.6581017", "0.6577157", "0.65747666", "0.6572513", "0.65721947", "0.6570553", "0.65646994", "0.6563556", "0.6554194", "0.65529937", "0.65460825", "0.65368485", "0.653429", "0.65328294", "0.6526759", "0.6526695", "0.6526284", "0.65191334", "0.65183175", "0.65174305", "0.651703", "0.65141153", "0.6507088", "0.65061647", "0.6504046", "0.64942145", "0.6491893", "0.64883405", "0.6486392", "0.6485077", "0.64846045", "0.6478858", "0.64756656", "0.64726377", "0.6471126", "0.64701074", "0.6467418", "0.6462195", "0.64618355", "0.6459199", "0.6457831", "0.6454631", "0.64533997", "0.6451915", "0.6450861", "0.6449301", "0.64492667", "0.64469045" ]
0.0
-1
Show the form for creating a new resource.
public function create() { $ukm = DB::select('select * from ukm'); return view('jadwal.create', compact('ukm')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return view('admin.resources.create');\n }", "public function create(){\n\n return view('resource.create');\n }", "public function create()\n\t{\n\t\treturn $this->showForm('create');\n\t}", "public function create()\n {\n return \"Display a form for creating a new catalogue\";\n }", "public function newAction()\n {\n $entity = new Resource();\n $current = $this->get('security.context')->getToken()->getUser();\n $entity->setMember($current);\n $form = $this->createCreateForm($entity);\n\n return array(\n 'nav_active'=>'admin_resource',\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }", "public function create()\n {\n return view ('forms.create');\n }", "public function create ()\n {\n return view('forms.create');\n }", "public function create()\n\t{\n\t\treturn view('faith.form');\n\t}", "public function create(NebulaResource $resource): View\n {\n $this->authorize('create', $resource->model());\n\n return view('nebula::resources.create', [\n 'resource' => $resource,\n ]);\n }", "public function create()\n {\n return view(\"request_form.form\");\n }", "public function create()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.create\")) {\n $view = \"admin.{$this->name}.create\";\n } else {\n $view = 'admin.includes.actions.create';\n }\n\n /* Show the form for creating a new resource. */\n return view($view)\n ->with('name', $this->name);\n }", "public function newAction()\n\t{\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => 'Ajouter une nouvelle &eacute;cole'\n\t\t) ) );\n\t}", "public function create()\n {\n return view($this->forms . '.create');\n }", "public function create()\n {\n return view('restful.add');\n }", "public function create()\n {\n $resource = (new AclResource())->AclResource;\n\n //dd($resource);\n return view('Admin.acl.role.form', [\n 'resource' => $resource\n ]);\n }", "public function create()\n {\n return view('admin.createform');\n }", "public function create()\n {\n return view('admin.forms.create');\n }", "public function create()\n {\n return view('backend.student.form');\n }", "public function newAction()\n {\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Nuevo');\n\n $entity = $this->getManager()->create();\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function create()\n {\n return view('client.form');\n }", "public function create()\n {\n // Nos regresa la vista del formulario\n return view('project.form');\n }", "public function create()\n {\n return view('Form');\n }", "public function newAction(){\n \n $entity = new Resourceperson();\n $form = $this->createAddForm($entity);\n\n \n return $this->render('ABCRspBundle:rsp:add.html.twig',array('entity'=>$entity,'form'=> $form->createView()));\n }", "public function createForm()\n\t{\n\t\treturn view('post.new');\n\t}", "public function create()\n {\n return view('admin.form.create', ['form' => new Form]);\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n $title = $this->title;\n $subtitle = \"Adicionar cliente\";\n\n return view('admin.clients.form', compact('title', 'subtitle'));\n }", "public function create()\n {\n return view('backend.schoolboard.addform');\n }", "public function create()\n\t{\n\t\treturn view('info.forms.createInfo');\n\t}", "public function create()\n {\n //\n return view('form');\n }", "public function create()\n {\n return view('rests.create');\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return view(\"Add\");\n }", "public function create(){\n return view('form.create');\n }", "public function create()\n {\n // Show the page\n return view('admin.producer.create_edit');\n }", "public function create()\n {\n\n return view('control panel.student.add');\n\n }", "public function newAction() {\n\t\t\n\t\t$this->view->form = $this->getForm ( \"/admin/invoices/process\" );\n\t\t$this->view->title = $this->translator->translate(\"New Invoice\");\n\t\t$this->view->description = $this->translator->translate(\"Create a new invoice using this form.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"#\", \"label\" => $this->translator->translate('Save'), \"params\" => array('css' => null,'id' => 'submit')),\r\n\t\t\t\t\t\t\t array(\"url\" => \"/admin/invoices/list\", \"label\" => $this->translator->translate('List'), \"params\" => array('css' => null)));\n\t\t$this->render ( 'applicantform' );\n\t}", "public function create()\n {\n $data['action'] = 'pengiriman.store';\n return view('pengiriman.form', $data);\n }", "public function create()\n {\n return $this->cView(\"form\");\n }", "public function newAction()\n {\n // Création de l'entité et du formulaire.\n $client = new Client();\n $formulaire = $this->createForm(new ClientType(), $client);\n \n \n \n // Génération de la vue.\n return $this->render('KemistraMainBundle:Client:new.html.twig',\n array('formulaire' => $formulaire->createView()));\n }", "public function create()\n {\n return view(\"dresses.form\");\n }", "public function create()\n\t{\n\t\treturn View::make('new_entry');\n\t}", "public function createAction()\n {\n// $this->view->form = $form;\n }", "public function create()\n {\n return view('bank_account.form', ['mode' => 'create']);\n }", "public function create()\n {\n return view('fish.form');\n }", "public function create()\n {\n return view('users.forms.create');\n }", "public function create()\n {\n $this->setFormFields($this->getCreateFormFields());\n $form = $this->getCreateForm();\n\n return view($this->getViewName('create'), [\n 'crudSlug' => $this->slug,\n 'form' => $form,\n ]);\n }", "public function create()\n\t{\n\t\treturn view('admin.estadoflete.new');\n\t}", "public function create()\n {\n $person = new Person;\n return view('contents.personform')->with(compact('person') );\n }", "public function createAction(){\n \t$this->view->placeholder('title')->set('Create');\n \t$this->_forward('form');\n }", "public function create()\n {\n Gate::authorize('app.products.create');\n\n return view('backend.products.form');\n }", "public function create()\n {\n return view('essentials::create');\n }", "public function create()\n {\n return view('student.add');\n }", "public function create()\n\t{\n\t\treturn view('loisier/create');\n\t}", "public function create()\n {\n return view('url.form');\n }", "public function newAction()\n {\n $entity = new Facture();\n $factureType = new FactureType();\n\t\t$factureType->setUser($this->get('security.context')->getToken()->getUser());\n $form = $this->createForm($factureType, $entity);\n\n return $this->render('chevPensionBundle:Facture:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function newAction()\n {\n $entity = new Chofer();\n $form = $this->createForm(new ChoferType(), $entity, ['user' => $this->getUser()]);\n\n return $this->render('ChoferesBundle:Chofer:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'css_active' => 'chofer',\n ));\n }", "public function create()\n\t{\n\t\treturn View::make('crebos.create');\n\t}", "public function create() : View\n {\n $fieldset = $this->menuFieldset();\n\n return $this->view('create', [\n 'title' => trans('addons.Aardwolf::titles.create'),\n 'data' => [],\n 'fieldset' => $fieldset->toPublishArray(),\n 'suggestions' => [],\n 'submitUrl' => route('aardwolf.postCreate')\n ]);\n }", "public function create()\n {\n return view('libro.create');\n }", "public function create()\n {\n return view('libro.create');\n }", "public function newAction()\n {\n $entity = new Species();\n $form = $this->createForm(new SpeciesType(), $entity);\n\n return $this->render('InfectBackendBundle:Species:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view('crud/add'); }", "public function create()\n\t{\n\t\treturn View::make('supplier.create');\n\t}", "public function newAction()\n {\n $entity = new Company();\n $form = $this->createForm(new CompanyType(), $entity);\n\n return $this->render('SiteSavalizeBundle:Company:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view(\"List.form\");\n }", "public function index_onCreateForm()\n\t{\n\t\tparent::create();\n\t\treturn $this->makePartial('create');\n\t}", "public function create()\n {\n //load create form\n return view('products.create');\n }", "public function create()\n {\n return view('article.addform');\n }", "public function create()\n {\n // Mengarahkan ke halaman form\n return view('buku.form');\n }", "public function create()\n\t{\n\t\t// load the create form (app/views/material/create.blade.php)\n\t\t$this->layout->content = View::make('material.create');\n\t}", "public function create()\n {\n return view('saldo.form');\n }", "public function create()\n\t\t{\n\t\t\treturn view('kuesioner.create');\n\t\t}", "public function view_create_questioner_form() {\n \t// show all questioner\n \t// send questioner to form\n \treturn view(\"create_questioner\");\n }", "public function newAction() {\n $entity = new Question();\n $form = $this->createCreateForm($entity);\n\n return $this->render('CdlrcodeBundle:Question:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n $data['companies'] = Company::select('id', 'name')->where('status', 1)->orderBy('id', 'desc')->get();\n return view('admin.outlet.outlet_form', $data);\n }", "public function create()\n {\n return view('admin.inverty.add');\n }", "public function create()\n {\n return view('Libro.create');\n }", "public function create()\n {\n $title = trans('entry_mode.new');\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n $breadcrumb='car.create';\n return view('admin.partials.cars.form', compact('breadcrumb'));\n }", "public function create()\n {\n return view(\"familiasPrograma.create\");\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n\t{\n\t\treturn View::make('perusahaans.create');\n\t}", "public function create()\n {\n return view(\"create\");\n }", "public function create()\n\t{\n //echo 'show form';\n\t\treturn View::make('gaans.create');\n\t}", "public function create()\n {\n $title = trans('dormitorybed.new');\n $this->generateParams();\n\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n return view('forming');\n }", "public function formNew() {\n $this->data->options = array(\n 'RJ' => 'Rio de Janeiro',\n 'MG' => 'Minas Gerais',\n 'SP' => 'São Paulo',\n 'ES' => 'Espírito Santo',\n 'BA' => 'Bahia',\n 'RS' => 'Rio Grande do Sul'\n );\n $this->data->action = \"@exemplos/pessoa/save\";\n $this->render();\n }", "public function create()\n {\n \t\n \treturn view('supplies.create');\n\n }", "public function createAction()\n {\n if ($form = $this->processForm()) {\n $this->setPageTitle(sprintf($this->_('New %s...'), $this->getTopic()));\n $this->html[] = $form;\n }\n }", "public function create()\n {\n $page_title = \"Add New\";\n return view($this->path.'create', compact('page_title'));\n }", "public function create()\n {\n // not sure what to do with the form since im\n // using ame partial for both create and edit\n return view('plants.create')->with('plant', new Plant);\n }", "public function create() {\n\t\t$title = 'Create | Show';\n\n\t\treturn view('admin.show.create', compact('title'));\n\t}", "public function create()\n {\n return view('student::students.student.create');\n }", "public function newAction(){\n\t\t$entity = new Reserva();\n\t\t$form = $this->createCreateForm($entity);\n\n\t\treturn $this->render('LIHotelBundle:Reserva:new.html.twig', array(\n\t\t\t'entity' => $entity,\n\t\t\t'form' => $form->createView(),\n\t\t));\n\t}" ]
[ "0.75948673", "0.75948673", "0.75863165", "0.7577412", "0.75727344", "0.7500887", "0.7434847", "0.7433956", "0.73892003", "0.73531085", "0.73364776", "0.73125", "0.7296102", "0.7281891", "0.72741455", "0.72424185", "0.7229325", "0.7226713", "0.7187349", "0.7179176", "0.7174283", "0.7150356", "0.71444064", "0.71442676", "0.713498", "0.71283126", "0.7123691", "0.71158516", "0.71158516", "0.71158516", "0.7112176", "0.7094388", "0.7085711", "0.708025", "0.70800644", "0.70571953", "0.70571953", "0.70556754", "0.70396435", "0.7039549", "0.7036275", "0.703468", "0.70305896", "0.7027638", "0.70265305", "0.70199823", "0.7018007", "0.7004984", "0.7003889", "0.7000935", "0.69973785", "0.6994679", "0.6993764", "0.6989918", "0.6986989", "0.6966502", "0.69656384", "0.69564354", "0.69518244", "0.6951109", "0.6947306", "0.69444615", "0.69423944", "0.6941156", "0.6937871", "0.6937871", "0.6936686", "0.69345254", "0.69318026", "0.692827", "0.69263744", "0.69242257", "0.6918349", "0.6915889", "0.6912884", "0.691146", "0.69103104", "0.69085974", "0.69040126", "0.69014287", "0.69012105", "0.6900397", "0.68951064", "0.6893521", "0.68932164", "0.6891899", "0.6891616", "0.6891616", "0.6889246", "0.68880934", "0.6887128", "0.6884732", "0.68822503", "0.68809193", "0.6875949", "0.68739206", "0.68739134", "0.6870358", "0.6869779", "0.68696856", "0.686877" ]
0.0
-1
Store a newly created resource in storage.
public function store(Request $request) { $request->validate([ 'ukm_id' => ['required', 'unique:jadwal,ukm_id'], 'waktu_mulai' => ['required'], 'waktu_selesai' => ['required'], 'hari' => ['required'], 'tempat' => ['required'] ], [ 'required' => 'Field harus diisi!', 'unique' => 'Jadwal sudah ada!' ]); $jadwal = new Jadwal; $jadwal->ukm_id = $request->ukm_id; $jadwal->waktu_mulai = $request->waktu_mulai; $jadwal->waktu_selesai = $request->waktu_selesai; $jadwal = $request->merge([ 'hari' => implode(', ', (array) $request->get('hari')) ]); $jadwal->tempat = $request->tempat; //Session::flash('add',$jadwal->save()); Jadwal::create($request->all()); return redirect('/jadwal')->with('status', 'Data Jadwal Berhasil Ditambahkan!'); }
{ "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(Jadwal $jadwal) { // }
{ "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(Jadwal $jadwal) { $ukm = DB::select('select id, nama_ukm from ukm'); return view('jadwal.edit', compact('jadwal', 'ukm')); }
{ "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, Jadwal $jadwal) { $request->validate([ 'ukm_id' => ['required', 'unique:jadwal,ukm_id,'. $jadwal->id], 'waktu_mulai' => ['required'], 'waktu_selesai' => ['required'], 'hari' => ['required'], 'tempat' => ['required'] ], [ 'required' => 'Field harus diisi!', 'unique' => 'Jadwal sudah dibuat!' ]); Jadwal::where('id', $jadwal->id) ->update([ 'ukm_id' => $request->ukm_id, 'waktu_mulai' => $request->waktu_mulai, 'waktu_selesai' => $request->waktu_selesai, 'hari' => implode(', ',$request->hari), 'tempat' => $request->tempat ]); return redirect('/jadwal')->with('status', 'Data Jadwal berhasil diubah!'); }
{ "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(Jadwal $jadwal) { DB::table('jadwal')->where('id',$jadwal->id)->delete(); return redirect('/jadwal')->with('status', 'Data Jadwal Berhasil Dihapus!'); }
{ "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
Called before Zend_Controller_Front begins evaluating the request against its routes.
public function routeStartup(Zend_Controller_Request_Abstract $request) { $front = Zend_Controller_Front::getInstance(); $router = $front->getRouter(); /** * Products catalog */ $router->addRoute('catalog', new Zend_Controller_Router_Route_Regex( '^[a-zA-Z0-9\-/]+?/c-([0-9_]+)(-pagina-([0-9]+)/?)?$', array( 'controller' => 'produse', 'action' => 'categorie' ), array( 1 => 'cPath', 2 => 'viewing-subcategory', 3 => 'pagina' ), '%s/c-%s-pagina-%d/' ) ); /** * Product details */ $router->addRoute('product-details', new Zend_Controller_Router_Route_Regex( '^[a-zA-Z0-9\-/]+?-([0-9]+)\.html$', //(([0-9_]+)-)? array( 'controller' => 'produse', 'action' => 'detalii-produs' ), array( 1 => 'pid' ), '%s-%d.html' ) ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function preDispatch( Zend_Controller_Request_Abstract $request )\n {\n\n }", "public function preDispatch() {\n if (!Zend_Auth::getInstance()->hasIdentity()) {\n $requestUri = Zend_Controller_Front::getInstance()->getRequest()->getRequestUri();\n $session = new Zend_Session_Namespace('lastRequest');\n $session->lastRequestUri = $requestUri;\n $this->_helper->redirector('index', 'index', 'login');\n }\n }", "public function preDispatch()\n\t{\n\t\t$this->_actionController->initView();\n\t\t\n\t\t// We have to store the values here, because forwarding overwrites\n\t\t// the request settings.\n\t\t$request = $this->getRequest();\n\t\t$this->_lastAction = $request->getActionName();\n\t\t$this->_lastController = $request->getControllerName();\n\t}", "public function preDispatch(Zend_Controller_Request_Abstract $request)\n {\n\n }", "public function preDispatch(){\t\t\t\t\t\r\n\t\t\tparent::preDispatch();\t\r\n\t\t\t\r\n\t\t\t//Zend_Debug::dump($_SERVER);\r\n\t\t}", "public function routeStartup(Zend_Controller_Request_Abstract $request)\n {\n\n }", "private function beforeRoutingMiddleWare()\n {\n if (isset($this->before[$_SERVER['REQUEST_METHOD']])) {\n $this->handle($this->before[$_SERVER['REQUEST_METHOD']]);\n }\n }", "function preDispatch(Zend_Controller_Request_Abstract $request)\n {\n $module = $request->getModuleName();\n $controller = $request->getControllerName();\n $action = $request->getActionName();\n \n $redirector = Zend_Controller_Action_HelperBroker::getStaticHelper('redirector');\n $session_admin=new Zend_Session_Namespace('session_admin');\n \n Zend_Registry::set('session_admin',$session_admin);\n \n \n\t if( $this->_request->getControllerName() != 'index'\n\t\t && $this->_request->getControllerName() != 'register'\n\t\t && $this->_request->getControllerName() != 'api'\n\t\t && $this->_request->getControllerName() != 'veritrans')\n\t\t{\n\t\t\t\tif($module=='admin'){/* @var $redirector Zend_Controller_Action_Helper_Redirector */\n\t\t \t \tif(!isset($session_admin->user_id) || $session_admin->user_id == ''){\n\t\t \t \t\treturn $redirector->gotoSimple('index', 'loginadmin', 'admin', array());\n\t\t \t \t}\n\t\t \t }\n\t } \n \t\n }", "public function preDispatch()\n {\n // set admin layout\n // check if user is authenticated\n // if not, redirect to login page\n $url = $this->getRequest()->getRequestUri();\n $this->_helper->layout->setLayout('admin');\n if (!Zend_Auth::getInstance()->hasIdentity()) {\n $session = new Zend_Session_Namespace('zf1.auth');\n $session->requestURL = $url;\n $this->_redirect('/admin/login');\n }\n }", "protected function setUp()\n {\n $this->_front = Zend_Controller_Front::getInstance();\n $this->_oldRequest = $this->_front->getRequest();\n $this->_oldRouter = $this->_front->getRouter();\n \n $this->_front->resetInstance();\n $this->_front->setRequest(new Zend_Controller_Request_Http());\n $this->_front->getRouter()->addDefaultRoutes();\n }", "public function preDispatch()\n {\n // Get the instance of the front controller\n $this->_front = Zend_Controller_Front::getInstance();\n \n // Get the container from the front controller\n $this->_container = $this->_front->getParam('bootstrap')->getContainer();\n \n // Get the Zend_Config from the front container\n $this->_config = $this->_container->getConfig(); \n }", "public function preDispatch()\n\t{\n\t\tparent::preDispatch();\n\t\tif ($this->getRequest()->getActionName() == 'view'){\n\t\t\t$this->getRequest()->setRouteName('icecatimport');\n\t\t}\n\t}", "public function onBeforeRouting() {\n\t\t// TODO: need some way of allowing plugins to specify whether they want\n\t\t// to be notified of this request or not\n\t\t// This is true for all plugin events\n\t\tforeach ( $this->getInstantiablePlugins() as $pluginContainer ) {\n\t\t\t$pluginContainer->trigger(\"onBeforeRouting\");\n\t\t}\n\t}", "public static function preRouter(){\n\t\t\n\t}", "protected function preReRouting()\n {\n\n }", "public function beforeRoute() {\n \n F3::set('v', Cfg::instance()->v);\n F3::set('app_dir', Cfg::instance()->app_dir);\n F3::set('master_url', Cfg::instance()->master_url);\n \n // logged in to the game?\n if (FB::instance()->me) {\n $c = new UsersController();\n F3::set('user', $c->getCurrentUser());\n } else {\n echo F3::render('templates/notloggedin.php');\n return FALSE;\n }\n \n // whitelisting\n if (!App::isWhitelisted(FB::instance()->user_id)) {\n F3::error(404);\n return FALSE;\n }\n \n // Sanitizing Fat-Free's REQUEST global also sanitizes PHP's $_REQUEST\n F3::set('REQUEST', F3::scrub($_REQUEST));\n\n }", "public function preDispatch()\n {\n parent::preDispatch();\n \n if (!Mage::helper('clarion_reviewreminder')->isExtensionEnabled()) {\n $this->setFlag('', 'no-dispatch', true);\n $this->_redirect('noRoute');\n } \n }", "public function preDispatch()\n {\n parent::preDispatch();\n \n if (!Mage::helper('archana_storelocator')->isEnabled()) {\n $this->setFlag('', 'no-dispatch', true);\n $this->_redirect('noRoute');\n } \n }", "protected function _preConfig()\n {\n parent::_preConfig();\n $this->_request = Solar_Registry::get('request');\n $this->_Solar_Uri_Action['path'] = $this->_request->server(\n 'SOLAR_URI_ACTION_PATH',\n '/index.php'\n );\n }", "public function dispatchLoopStartup(Zend_Controller_Request_Abstract $request)\n {\n \t//get view ojbect and init\n $viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper('viewRenderer');\n $viewRenderer->init();\n \n $view = $viewRenderer->view;\n $this->_view = $view;\n // set up common variables for the view\n // $viewRenderer->view->baseUrl = $request->getBaseUrl();\n // $viewRenderer->view->module = $request->getModuleName();\n //get controller and action names\n $viewRenderer->view->controller = $request->getControllerName();\n $viewRenderer->view->action = $request->getActionName();\n\t\t//logfire('predispatch','happened');\n }", "function onRequest(){\n\n\t// check if we need to reload the application\n\tcheckApplicationState();\n\n\t// initialize the ViewSate for every request\n\tsetViewState( getFactory()->getBean( 'ViewState' ) );\n\n\t// decide what to do, the front controller\n\thandleAction();\n\n\t// render the application\n\trenderApplication();\n}", "public function before()\n\t{\n\t\tif ($this->request->is_initial())\n\t\t{\n\t\t\t$this->request->action(404);\n\t\t}\n\t\t\n\t\treturn parent::before();\n\t}", "public function preDispatch(Zend_Controller_Request_Abstract $request)\n {\n \t// Get Zend_Auth\n $auth = Zend_Auth::getInstance();\n \n // Get Zend_Acl\n $registry = Zend_Registry::getInstance();\n\t\t$acl = $registry->get('acl');\n\t\t\n\t\t// Determine what role the user has\n if (!$auth->hasIdentity()) {\n \t\t$role = 'guest';\n } else {\n \t$identity = $auth->getIdentity();\n \t$role = $identity->role;\n }\n \n // Check permission for this user for this page\n $isAllowed = $acl->isAllowed($role,\n\t\t $request->getControllerName(),\n\t\t $request->getActionName());\n\t\t\n\t\t// If the user does not have permission, redirect and show flash message\n\t\tif (!$isAllowed) {\n\t\t\t$flash = Zend_Controller_Action_HelperBroker::getStaticHelper('FlashMessenger');\n\t\t\t$redirector = Zend_Controller_Action_HelperBroker::getStaticHelper('Redirector');\n\t\t\t\n\t\t\tif($auth->hasIdentity()) {\n\t \t$flash->addMessage('You do not have permission to access this page.');\n\t \t$redirector->gotoUrlAndExit('index/empty');\n\t\t\t} else {\n\t\t\t\t$flash->addMessage('You need to be logged in to access this page.');\n\t\t\t\t$redirector->gotoUrlAndExit('auth');\n\t\t\t}\t\t\t\n\t\t}\n }", "protected function preRunController()\n {\n $annotations = $this->controller->getControllerAnnotationParser()->getAnnotationsForMethod($this->action);\n\n if ($annotations->has(\"AuthRequired\")) {\n if (!$this->getApplicationSession()->isSessionActive()) {\n $this->reRouteTo(\"login\", \"prompt\");\n }\n }\n\n if ($annotations->has(\"LogInNotPermitted\")) {\n if ($this->getApplicationSession()->isSessionActive()) {\n $this->redirectTo(\"main\");\n }\n }\n }", "public function preDispatch(Zend_Controller_Request_Abstract $request) {\n\t\t$role = $this->getRole();\n\n\t\t// the ACL resource is the requested controller name\n\t\t$resource = $request->controller;\n\n\t\tif($request->module != 'default') {\n\t\t\t$resource = $request->module . ':' . $resource;\n\n }\n // the ACL privilege is the requested action name\n\t\t$privilege = $request->action;\n\n\t\t// if we haven't explicitly added the resource, check the default global\n\t\t// permissions\n\t\tif (!$this->acl->has($resource)) {\n\t\t\t$resource = null;\n\t\t}\n\n\t\t// access denied - reroute the request to the default action handler\n\t\tif (!$this->acl->isAllowed($role, $resource, $privilege)) {\n\t\t\t$request->setModuleName($this->_authController['module']);\n\t\t\t$request->setControllerName($this->_authController['controller']);\n\t\t\t$request->setActionName($this->_authController['action']);\n\t\t}\n\t}", "function beforeRoute() {\n\t\tif ($this->app->get('SESSION.user')) {\n\t\t\t$this->app->set('loggedIN', true);\n\t\t}\n\t}", "public function preDispatch()\n {\n if (!in_array($this->Request()->getActionName(), ['index', 'load'])) {\n $this->Front()->Plugins()->Json()->setRenderer(true);\n }\n }", "public function preDispatch()\n {\n parent::preDispatch();\n if (!Mage::helper('ab_adverboard')->isEnabled()) {\n $this->setFlag('', 'no-dispatch', true);\n $this->_redirect('noRoute');\n }\n }", "private function _preInit()\n {\n // Load the request before anything else, so everything else can safely check Craft::$app->has('request', true)\n // to avoid possible recursive fatal errors in the request initialization\n $this->getRequest();\n $this->getLog();\n\n // Set the timezone\n $this->_setTimeZone();\n\n // Set the language\n $this->updateTargetLanguage();\n }", "public function preDispatch()\n {\n \t$auth\t= Zend_Auth::getInstance();\n \t\n// \t$this->view->loginIn = $auth->hasIdentity();\n \t$this->_loggedIn\t = $auth->hasIdentity();\n \n \t/* Check if loging in is neccessary ! */\n \tif (!$auth->hasIdentity())\n \t{\n \t\t/* If required: force log-in */\n \t}\n \t\n }", "public function beforeExecuteRoute()\n {\n if (method_exists($this, 'initialize')) {\n $this->initialize();\n }\n\n $this->middlewareHandler();\n }", "public function preDispatch(Zend_Controller_Request_Abstract $request)\n {\n \n /*\n * TODO: check if the user is still enabled\n * */\n $identity = Zend_Auth::getInstance();\n if($identity->hasIdentity() && $identity->getIdentity()) {\n Zend_Registry::set('user', $identity->getIdentity());\n }\n else {\n $user = new stdClass();\n $user->role_id = 0;\n Zend_Registry::set('user', $user);\n }\n $acl = new Acl_Db();\n Zend_Registry::set('acl', $acl);\n \n if(!$this->_actionExists($request)) {\n return;\n }\n \n if(!$acl->isUserAllowed(\n $request->getModuleName(),\n $request->getControllerName(), $request->getActionName() ))\n {\n $redirector = Zend_Controller_Action_HelperBroker::getStaticHelper('redirector');\n $redirector->gotoSimple('index', 'login', 'default')\n ->redirectAndExit();\n throw new Zend_Acl_Exception('You are not authorized to view this page', 403);\n }\n }", "public function beforeLoadRoutes() {\n if ($this->beforeConfig) {\n $this->createRoutes($this->m->Routing->routes);\n $current = $this->m->Routing->route;\n if (is_array($current) and isset($current['priority'])) {\n if ($current['priority'] > $this->priority)\n return;\n }\n if ($this->checkPath($this->request->path)) {\n \n }\n }\n }", "public function dispatchLoopStartup(Zend_Controller_Request_Abstract $request)\n {\n if (!$request instanceof Zend_Controller_Request_Http) {\n return;\n }\n $controller = $request->getControllerName();\n $action \t= $request->getActionName();\n $isMember = Zend_Auth::getInstance()->hasIdentity();\n $role = $isMember ? Zend_Auth::getInstance()->getIdentity()->role : 'guest';\n // 最基础的角色权限判断(基于 Controller 和 Action ),更细化的需要在各个页面判断\n $isAllowed = ICE_Acl::allowed($role, $controller, $action);\n\t\tif (!$isAllowed) {\n\t\t\t$forwardAction = $isMember ? 'deny' : 'login';\n $next = $request->getRequestUri();\n\t\t\t$request->setControllerName('Auth')\n\t\t\t\t\t->setActionName($forwardAction)\n\t\t\t\t\t->setQuery('next', $next)\n\t\t\t\t\t->setDispatched(true);\n\t\t}\n }", "protected function initRequest()\n {\n $context = new RequestContext();\n $context->fromRequest(self::$request);\n $matcher = new UrlMatcher($this->routCollection, $context);\n\n try {\n $attributes = $matcher->match(self::$request->getPathInfo());\n $response = $this->callController($attributes);\n } catch (ResourceNotFoundException $e) {\n $response = new Response('Not Found', 404);\n } catch (Exception $e) {\n $response = new Response('An error occurred', 500);\n }\n\n $response->send();\n }", "public function preDispatch() {\n\t\t\n\t\t}", "public function preExecute()\n {\n // store current URI incase we need to be redirected back to this page\n $request = $this->getRequest();\n if($request->getPathInfo() != '/getEbayResults')\n {\n $this->getUser()->setAttribute('lastPageUri', $request->getPathInfo());\n }\n }", "public function preDispatch()\r\n {\r\n $this->View()->setScope(Enlight_Template_Manager::SCOPE_PARENT);\r\n\r\n $this->View()->sUserLoggedIn = $this->admin->sCheckUser();\r\n $this->View()->sUserData = $this->getUserData();\r\n }", "public function preDispatch(Zend_Controller_Request_Abstract $request)\n {\n\n $auth = Zend_Auth::getInstance();\n if (!$auth->hasIdentity()) {\n $request->setModuleName($this->_noAuth['module']);\n $request->setControllerName($this->_noAuth['controller']);\n $request->setActionName($this->_noAuth['action']);\n return;\n }\n\n }", "public function route() {\n\t\t// Start the profiler\n\t\tProfiler::register('Core', 'Router');\n\n\t\t// First, let's look at the URL the user supplied\n\t\t$requestUrl = array_values(array_filter(explode('/', Request::getUrl())));\n\t\t$requestRoute = null;\n\n\t\t// Loop over each route and test to see if they are valid\n\t\tforeach (self::$_routes as $route) {\n\t\t\tif ($this->routeTest($requestUrl, $route)) {\n\t\t\t\t$requestRoute = $route;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t// We have completed the route matching\n\t\t// Finish the setup of the request object\n\t\tProfiler::register('Core', 'Request');\n\t\tif ($requestRoute) {\n\t\t\t$_GET['controller'] = $route->endpoint['controller'];\n\t\t\t$_GET['action'] = $route->endpoint['action'];\n\t\t\tRequest::setUrlFragments(str_replace($this->_routePath, '', Request::getUrl()));\n\t\t} else {\n\t\t\tRequest::setUrlFragments(Request::getUrl(), true);\n\t\t}\n\t\tProfiler::deregister('Core', 'Request');\n\n\t\t// Inform the event listener a request has been initialised\n\t\tEvent::trigger(\n\t\t\t'initRequest',\n\t\t\tarray(\n\t\t\t\t'controller' => Request::get('controller'),\n\t\t\t\t'action' => Request::get('action')\n\t\t\t)\n\t\t);\n\n\t\t// And stop the profiler\n\t\tProfiler::deregister('Core', 'Router');\n\t\tProfiler::deregister('Core', 'Front');\n\n\t\t// And dispatch\n\t\tDispatcher::loadController(\n\t\t\tRequest::get('controller'),\n\t\t\tRequest::get('action')\n\t\t);\n\t}", "public function FrontControllerRoute() {\n\t\t// Step 1\n\t\t// Take current url and divide it in controller, method and parameters\n\t\t$this->request = new CRequest($this->config['base_url']);\n\t\t$this->request->Init();\n\t\t$controller = $this->request->controller;\n\t\t$method = $this->request->method;\n\t\t$arguments = $this->request->arguments;\n\n\t\t$controllerExists = isset($this->config['controllers'][$controller]);\n\t\t$controllerEnabled = false;\n\t\t$className = false;\n\t\t$classExists = false;\n\n\t\tif($controllerExists){\n\t\t\t$controllerEnabled = ($this->config['controllers'][$controller]['enabled'] == true);\n\t\t\t$className = $this->config['controllers'][$controller]['class'];\n\t\t\t$classExists = class_exists($className);\n\t\t}\n\n\n\n\t\t// Step 2\n\t\t// Check if there is a callable method in the controller class, if then call it\n\n\t\tif($controllerExists && $controllerEnabled && $classExists){\n\t\t\t$rc = new ReflectionClass($className);\n\t\t\tif($rc->implementsInterface('IController')){\n\t\t\t\tif($rc->hasMethod($method)){\n\t\t\t\t\t$controllerObj = $rc->newInstance();\n\t\t\t\t\t$methodObj = $rc->getMethod($method);\n\t\t\t\t\t$methodObj->invokeArgs($controllerObj, $arguments);\n\t\t\t\t} else {\n\t\t\t\t\tdie(\"404. \" . get_class() . ' error: Controller does not contain method.');\n\t\t\t\t}\n\t } else {\n\t \tdie('404. ' . get_class() . ' error: Controller does not implement interface IController.');\n\t\t\t\t}\n\t\t} else { \n\t\t\tdie('404. Page is not found.');\n\t\t}\n\t\n\n\n\t\t$this->data['debug'] = \"REQUEST_URI - {$_SERVER['REQUEST_URI']}\\n\";\n\t\t$this->data['debug'] .= \"SCRIPT_NAME - {$_SERVER['SCRIPT_NAME']}\\n\";\n\t}", "public function preDispatch() { }", "public function before()\n\t{\n\t\t// Check method Support\n\t\tif ( ! isset($this->_method_map[$this->request->method()]))\n\t\t\tthrow HTTP_Exception::factory(405)->allowed($this->_method_map);\n\n\t\t// Generate the action name based on the HTTP Method of the request, and a supplied action\n\t\t$action_name = ($this->request->action() === 'index')\n\t\t\t? Arr::get($this->_method_map, $this->request->method())\n\t\t\t: Arr::get($this->_method_map, $this->request->method()).'_'.$this->request->action();\n\n\n\t\t$this->request->action($action_name);\n\t}", "public function preDispatch()\n {\n if ( !Auth_UserAdapter::hasIdentity() )\n {\n $this->_helper->redirector( 'index', 'index' );\n }\n }", "protected function before()\n {\n $object = new self($this->routeParams);\n (new Middleware())->middlewares($this->callBeforeMiddlewares())\n ->middleware($object, function ($object) {\n return $object;\n });\n }", "public function preDispatch()\n\t{\n\n\t\t\n\t\t\n\t}", "public function before()\n {\n parent::before();\n\n // Get the HTTP status code\n $action = $this->request->action();\n\n if ($this->request->is_initial())\n {\n // This controller happens to exist, but lets pretent it does not\n $this->request->action($action = 404);\n }\n else if ( ! method_exists($this, 'action_'.$action))\n {\n // Return headers only\n $this->request->action('empty');\n }\n\n // Set the HTTP status code\n $this->response->status($action);\n }", "public function preDispatch();", "public function preDispatch(Zend_Controller_Request_Abstract $request)\n {\n //Zend_Debug::dump($navigation);\n if(Zend_Registry::isRegistered('cache')) {\n $oCache = Zend_Registry::get('cache');\n $sCacheId = 'zend_navigation';\n \n if ( ! $oCache->test( $sCacheId ) ) {\n $data = new Zend_Config_Xml(CONFIGS_PATH . 'navigation.xml', APPLICATION_ENVIRONMENT);\n $nav = $data->navigation;\n $topNav = $data->navigation->home->pages->top_menu->pages;\n $adminNav = $nav->home->pages->admin->pages;\n $userNav = $nav->home->pages->users->pages;\n $oCache->save( $nav, $sCacheId );\n } else {\n $nav = $oCache->load( $sCacheId );\n $topNav = $nav->home->pages->top_menu->pages;\n $adminNav = $nav->home->pages->admin->pages;\n $userNav = $nav->home->pages->users->pages;\n }\n } else {\n $data = new Zend_Config_Xml(CONFIGS_PATH . 'navigation.xml', APPLICATION_ENVIRONMENT);\n $nav = $data->navigation; \n $topNav = $data->navigation->home->pages->top_menu->pages;\n $adminNav = $nav->home->pages->admin->pages;\n $userNav = $nav->home->pages->users->pages;\n \n } \n\n $navigation = new Zend_Navigation($nav);\n Zend_Registry::set('Zend_Navigation', $navigation);\n \n $navigationConfig = $this->_prepareDynamicMenu();\n $mainav = new Zend_Navigation($navigationConfig); \n $this->_setActiveMenuID($mainav);\n Zend_Registry::set('Main_Navigation', $mainav);\n \n Zend_Registry::set('Admin_Navigation', new Zend_Navigation($adminNav));\n Zend_Registry::set('User_Navigation', new Zend_Navigation($userNav));\n Zend_Registry::set('Top_Navigation', new Zend_Navigation($topNav));\n// \n $this->_prepareDynamicLeftMenu();\n \n if(Zend_Registry::isRegistered('acl')) {\n $view = Zend_Layout::getMvcInstance()->getView();\n $role = App_Auth::getRole();\n $view->navigation()->menu()->setAcl(Zend_Registry::get('acl'));\n $view->navigation()->menu()->setRole(App_Auth::getRole());\n }\n }", "public function init()\n {\n $request =& $this->request;\n $route = '/:controller/:action';\n $opts = ['controller' => 'Home', 'action' => 'index'];\n\n // Inlined as a closure to fix \"using $this when not in object context\" on 5.3\n $validateSession = function () {\n if (!empty($_SESSION['php-censor-user-id'])) {\n $user = Factory::getStore('User')->getByPrimaryKey($_SESSION['php-censor-user-id']);\n\n if ($user) {\n return true;\n }\n }\n\n return false;\n };\n\n $skipAuth = [$this, 'shouldSkipAuth'];\n\n // Handler for the route we're about to register, checks for a valid session where necessary:\n $routeHandler = function (&$route, Response &$response) use (&$request, $validateSession, $skipAuth) {\n $skipValidation = in_array($route['controller'], ['session', 'webhook', 'build-status']);\n\n if (!$skipValidation && !$validateSession() && (!is_callable($skipAuth) || !$skipAuth())) {\n if ($request->isAjax()) {\n $response->setResponseCode(401);\n $response->setContent('');\n } else {\n $_SESSION['php-censor-login-redirect'] = substr($request->getPath(), 1);\n $response = new RedirectResponse($response);\n $response->setHeader('Location', APP_URL . 'session/login');\n }\n\n return false;\n }\n\n return true;\n };\n\n $this->router->clearRoutes();\n $this->router->register($route, $opts, $routeHandler);\n }", "public function preDispatch()\n {\n parent::preDispatch();\n\n // The parent may block the dispatch\n $this->setFlag('', 'no-dispatch', false);\n\n if (!$this->getRequest()->isDispatched()) {\n return;\n }\n\n $action = $this->getRequest()->getActionName();\n $openActions = array(\n 'create',\n 'login',\n 'existing',\n 'confirmation'\n );\n $pattern = '/^(' . implode('|', $openActions) . ')/i';\n\n if (!preg_match($pattern, $action)) {\n if (!$this->_getSession()->authenticate($this)) {\n $this->setFlag('', 'no-dispatch', true);\n }\n } else {\n $this->_getSession()->setNoReferer(true);\n }\n }", "public function preDispatch($request)\n\t{\n\t\tif(!$request->isXmlHttpRequest())\n\t\t\treturn;\n\t\t\n\t\t\n\t\t$oldViewHelper = Zend_Controller_Action_HelperBroker::getStaticHelper('ViewRenderer');\n\t\t\n\t\t$viewHelper = new Zend_Controller_Action_Helper_ViewRenderer($oldViewHelper->view);\n\t\t\n\t\tZend_Controller_Action_HelperBroker::addHelper($viewHelper);\n\t}", "public function preDispatch(Zend_Controller_Request_Abstract $request)\n {\n $request->setParam('_acl', $this->_auth);\n \n // Set view param _acl\n $mvc = Zend_Layout::getMvcInstance();\n $view = $mvc->getView();\n $view->acl = $this->_auth;\n\n if (!$this->_auth->authoriseRequest($request)) {\n\n if ($this->_auth->isLoggedIn()) {\n $this->_redirect->gotoRoute(array('module' => 'default', 'controller' => 'auth', 'action' => 'forbidden'));\n } else {\n $this->_redirect->gotoRoute(array('module' => 'default', 'controller' => 'auth', 'action' => 'login'));\n }\n }\n }", "public function preDispatch()\n {\n \n # if the user is not logged in, they can not log out\n if (!Zend_Auth::getInstance()->hasIdentity()) {\n # display to user\n $this->_helper->Message(array(\"authMsg:FailLogOut\"), 'warning');\n $this->_helper->Message(array(\"authMsg:LoginThroughForm\"), 'info');\n \n # redirect login page\n $this->_helper->redirector('index', 'login', 'auth');\n }\n }", "protected function _before() {\n\t\tparent::_before ();\n\t\t$this->_startServices ( true );\n\t\t$this->startup = new Startup ();\n\t\tEventsManager::start ();\n\t\tTranslatorManager::start ( 'fr_FR', 'en' );\n\t\t$this->_initRequest ( 'RestApiController', 'GET' );\n\t}", "public static function boot() {\n $controller = Router::getController();\n\n // todo: perhaps transfer here some server, get, post and cookie parameters as context?\n if ($controller instanceof Controller) $controller->run(Tools::get('action','string',''));\n }", "public function preDispatcher()\n {\n $bootstrap = Front::getInstance()->getBootstrap();\n $view = $bootstrap->getResource('view');\n $settings = $bootstrap->getResource('settings');\n $navigation = $bootstrap->getResource('navigation');\n\n $module = $this->getRequest()->getModule();\n\n $view->headMeta()->setCharset('utf-8');\n\n $minDepth = 1;\n\n if ($module == 'Admin') {\n $minDepth = 2;\n $view->headTitle()->set('PHP Pro Bid Admin Control Panel');\n $view->headMeta()->setName('robots', 'noindex, nofollow');\n }\n else {\n $view->headTitle()->set($settings['sitename']);\n\n if (!empty($settings['meta_data'])) {\n $metaData = \\Ppb\\Utility::unserialize($settings['meta_data']);\n if (isset($metaData['key'])) {\n foreach ($metaData['key'] as $key => $value) {\n if (!empty($value)) {\n $view->headMeta()->appendName($value, $metaData['value'][$key]);\n }\n }\n }\n }\n }\n\n if ($navigation instanceof Navigation) {\n /** @var \\Cube\\View\\Helper\\Navigation $navigationHelper */\n $navigationHelper = $view->navigation()->setMinDepth($minDepth);\n $breadcrumbs = $navigationHelper->getBreadcrumbs();\n\n if (count($breadcrumbs) > 0) {\n $headTitle = array();\n\n foreach ($breadcrumbs as $breadcrumb) {\n $headTitle[] = $breadcrumb->label;\n }\n\n $view->headTitle()->prepend(implode(' / ', array_filter(array_reverse($headTitle))));\n }\n }\n }", "public function dispatchLoopStartup (Zend_Controller_Request_Abstract $request)\r\n {\r\n if (! $request->isGet()) {\r\n //self::$doNotCache = true;\r\n self::$doCache = false;\r\n return;\r\n }\r\n $path = $request->getPathInfo();\r\n $this->key = md5($path);\r\n // diferente\r\n if (false !== ($response = $this->getCache())) {\r\n $response->sendResponse();\r\n exit();\r\n }\r\n }", "protected function initializeAction() {\n\t\t$this->akismetService->setCurrentRequest($this->request->getHttpRequest());\n\t}", "public function setRoute() {\n $address = $_SERVER['REQUEST_URI'];\n \n $this->determineControllerAndMethod($address);\n\n $this->determineArguments($address);\n }", "public function beforeFilter()\r\n\t{\r\n\t\t$this->Auth->allow('display');\r\n\r\n\t\t// find out which prefixes have been specified in the core.php file and loop though them\r\n\t\t$routing_prefixes = Configure::read('Routing.prefixes');\r\n\t\tforeach ($routing_prefixes as $prefix)\r\n\t\t{\r\n\t\t\t// check if one of the routing prefixes matches the current page's prefix\r\n\t\t\tif (isset($this->request->params['prefix']) && $this->request->params['prefix'] == $prefix && $this->Auth->user($prefix) != 1)\r\n\t\t\t{\r\n\t\t\t\t// user is not allowed on current page, redirect to login screen\r\n\t\t\t\tAuthComponent::redirect();\r\n\t\t\t}\r\n\r\n\t\t\t// set layout based on routing prefix\r\n\t\t\tif (isset($this->request->params['prefix']) && $this->request->params['prefix'] == $prefix)\r\n\t\t\t{\r\n\t\t\t\t$this->layout = $prefix;\r\n\t\t\t}\r\n\t\t}\r\n\r\n//\t\t$this->set('logged_in', $this->Auth->loggedIn());\r\n\t\t$this->set('auth_user', $this->Auth->user());\r\n\t}", "public function preDispatch()\n\t{\n\t\tparent::preDispatch();\n\n\t\tif (!$this->getRequest()->isDispatched()) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (!$this->_getCustomerSession()->authenticate($this)) {\n\t\t\t$this->setFlag('', 'no-dispatch', true);\n\t\t}\n\t}", "public function router()\n {\n // Initializing variables\n LSReqenvironment::initialize();\n }", "public function preAction() {\n $this->apiBrowser = new ApiBrowser();\n\n $basePath = $this->request->getBasePath();\n $this->namespaceAction = $basePath . '/namespace/';\n $this->classAction = $basePath . '/class/';\n $this->searchAction = $basePath . '/search';\n }", "public function dispatchLoopStartup(Zend_Controller_Request_Abstract $request) {\n \n $cache = Zend_Cache::factory('Output', 'File',\n\t\t\t\t array('lifetime' => $this->_cacheDuration['lifetime'], \"automatic_serialization\" => true),\n\t\t\t\t $this->_cacheOptions);\n \n if (!($navinfo = $cache->load('zend_navigation'))) {\n\t \n $front = Zend_Controller_Front::getInstance();\n \n // associative array of module => controller dir\n $controller_dirs = $front->getControllerDirectory();\n $default_controller = $front->getDefaultControllerName();\n \n // loop through controller directories and include all controllers\n foreach ($controller_dirs as $module => $dir) {\n\t$files = scandir($dir);\n\tforeach ($files as $file) {\n\t if (preg_match(\"/^[A-Za-z].*Controller.php$/\", $file)) {\n\t require_once($dir . \"/\" . $file);\n\t }\n\t}\n }\n \n // call static function getNav of the default controller\n $index_controller = ucfirst($default_controller) . \"Controller\";\n $navinfo = call_user_func(array($index_controller, \"getNav\"));\n \n $cache->save($navinfo);\n }\n \n $nav = new Zend_Navigation($navinfo);\n Zend_Registry::set('Zend_Navigation', $nav);\n }", "public function dispatchLoopStartup(Zend_Controller_Request_Abstract $request)\n {\n // Block access to the upgrade controller.\n if ($request->getControllerName() == 'upgrade'\n && $request->getModuleName() == 'default'\n && !$this->_dbCanUpgrade()\n ) {\n $request->setControllerName('index')\n ->setActionName('index')\n ->setDispatched(false);\n }\n if ($this->_dbNeedsUpgrade()) {\n if (!is_admin_theme()) {\n die(\"Public site is unavailable until the upgrade completes.\");\n }\n // This is a workaround to avoid the authentication requirement.\n Zend_Controller_Front::getInstance()->unregisterPlugin('Omeka_Controller_Plugin_Admin');\n\n if ($request->getControllerName() != 'upgrade') {\n $this->_upgrade($request);\n }\n }\n }", "public function __init()\n\t{\n\t\t// This code will run before your controller's code is called\n\t}", "function preDispatch()\r\n {\r\n // The parent preDispatch check that a user is connected\r\n parent::preDispatch();\r\n\r\n // Now, check the role\r\n if (!$this->user->isReviewer()) {\r\n // Forward to the \"access denied\" action\r\n $this->_forward (\"accessdenied\", \"index\", \"default\");\r\n }\r\n\r\n }", "public function preDispatch()\n\t{\n\t\t$this->_initView();\n\t\t//if its an AJAX request stop here - can be simulated via ?ajax GET parameter sent in the request\n\t\tif ($this->_request->isXmlHttpRequest() || isset($_GET['ajax']))\n\t\t{\n\t\t\tZend_Controller_Action_HelperBroker::removeHelper('Layout');\n\t\t}\n\t\t/*\n\t\tif (!$this->getRequest()->isXmlHttpRequest())\n\t\t{\n\t\t\t$messages = array();\n\t\t\t$messages['error'] = $this->_helper->FlashMessenger->setNamespace('error')->getMessages();\n\t\t\t$messages['success'] = $this->_helper->FlashMessenger->setNamespace('success')->getMessages();\n\t\t\t$this->view->messages = $messages;\n\t\t}\n\t\t*/\n\t\t//Sets the base url to the javascripts of the application\n \n $authNamespace = new Zend_Session_Namespace('Zend_Auth');\n $timeout = $authNamespace->timeout;\n $time_render = time();\n \n\t\t$script = '\n\t\t\tvar base_url = \"' . $this->view->baseUrl().'\",\n timeout = \"'.$timeout.'\",\n\t\t\t time_render = \"' .$time_render.'\";\n\t\t';\n \n\t\t$this->view->headScript()->prependScript($script, $type = 'text/javascript', $attrs = array());\n $this->view->inlineScript()->appendFile(($this->view->baseUrl().'/js/contadorsessao.js'), 'text/javascript');\n \n\t}", "protected function _initRoutes()\n {\n $front = Zend_Controller_Front::getInstance();\n $router = $front->getRouter();\n\n $route = new Zend_Controller_Router_Route('login/:provider',\n array(\n 'controller' => 'user',\n 'action' => 'login'\n ));\n $router->addRoute('login/:provider', $route);\n\n $route = new Zend_Controller_Router_Route_Static('login',\n array(\n 'controller' => 'user',\n 'action' => 'login'\n ));\n $router->addRoute('login', $route);\n\n $route = new Zend_Controller_Router_Route_Static('logout',\n array(\n 'controller' => 'user',\n 'action' => 'logout'\n ));\n $router->addRoute('logout', $route);\n }", "function init(){\n\t\t//$uri = str_replace(BASE_URL,\"\",\"http://\" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);\n\t\t$uri = str_replace(BASE_URL,\"\",\"//\" . HOST . REQUEST);\n\t\t$this->route($uri);\n\t}", "public function preDispatch($request)\n {\n $db = get_db();\n \n // Some routes don't have a default module, which resolves to NULL.\n $currentModule = is_null($request->getModuleName()) ? 'default' : $request->getModuleName();\n $currentController = $request->getControllerName();\n $currentAction = $request->getActionName();\n \n // Allow plugins to register routes that contain form inputs rendered by \n // Omeka_View_Helper_ElementForm::_displayFormInput().\n $routes = apply_filters('meta_meta_data_routes', $this->_defaultRoutes);\n \n // Apply filters to defined routes.\n foreach ($routes as $route) {\n \n // Check registered routed against the current route.\n if ($route['module'] != $currentModule \n || $route['controller'] != $currentController \n || !in_array($currentAction, $route['actions']))\n {\n continue;\n }\n \n // Add the filters if the current route is registered.\n // Loop all elements / or specific set of elements\n $allTerms = $db->getTable('Element')->findAll();\n# print_r($allTerms);\n foreach ($allTerms as $allTerm) {\n $elementSet = $db->getTable('ElementSet')->find($allTerm->element_set_id);\n# print $allTerm->name . \" + \" . $allTerm->element_set_id . \" >> \" . $elementSet->name;\n if ($elementSet){\n add_filter(array('ElementInput', 'Item', $elementSet->name, $allTerm->name), array($this, 'filterElementInputMmd'), 15);\n }\n# add_filter(array('ElementInput', 'Item', $elementSet->name, $allTerm->name), array($this, 'input_filter'), 15);\n }\n // Once the filter is applied for one route there is no need to \n // continue looping the routes.\n break;\n }\n }", "public function preDispatch()\n {\n\n parent::preDispatch();\n //exit;\n if (Zend_Auth::getInstance()->hasIdentity()) {\n $authStorage = Zend_Auth::getInstance()->getStorage()->read();\n $isAuth = true;\n } else {\n $authStorage = null;\n $isAuth = false;\n }\n\n $config = $this->getConfig();\n\n $this->config = $this->getConfig();\n $this->log = $this->getLog();\n $this->mediaUrl = $this->config->app->mediaUrl;\n $this->siteUrl = $this->config->app->siteUrl;\n\n $this->view->assign('mediaUrl', $config->app->mediaUrl);\n $this->view->assign('elementsUrl', $config->app->elementsUrl);\n $this->view->assign('siteUrl', $config->app->siteUrl);\n\n $helper = $this->_helper->getHelper('FlashMessengerCustom');\n $this->_flashMessenger = $helper;\n if ($this->_request->getModuleName() == \"empresa\") {\n $this->view->headLink()->appendStylesheet(\n Zend_Layout::getMvcInstance()->getView()->S('/css/empresa/empresa.layout.css'),\n 'all'\n );\n\n $this->view->headLink()->appendStylesheet(\n Zend_Layout::getMvcInstance()->getView()->S('/css/empresa/empresa.class.css'),\n 'all'\n );\n }\n\n }", "public function before() {\n\t\tif (!$this->request->is_ajax()) {\n\t\t\t$this->request->redirect('/');\n\t\t}\n\n\t\tparent::before();\n\t}", "public function preDispatch(Zend_Controller_Request_Abstract $request)\n\t{\n\t\t// include from addons\n\n\t\tif ((int)Zend_Registry::get('option')->get('allow_addons') && APPLICATION_ENV != 'safe') {\n\t\t\tforeach (glob(ADDONS_PATH . '/*') as $addon) {\n\t\t\t\t$plugin_name = basename($addon);\n\n\t\t\t\t// do not include disabled\n\t\t\t\tif ($plugin_name[0] != '_' && file_exists($addon . '/hooks.php')) {\n\t\t\t\t\trequire_once $addon . '/hooks.php';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// save to global storage registry\n\t\tZend_Registry::set('hooks', $this);\n\n\t\t// run bootstrap hooks\n\t\t$front = Zend_Controller_Front::getInstance();\n\t\t$viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper('viewRenderer');\n\t\tif (null === $viewRenderer->view) {\n\t\t\t$viewRenderer->initView();\n\t\t}\n\t\t$view = $viewRenderer->view;\n\n\t\t$app = array(\n\t\t\t'front' => $front,\n\t\t\t'view' => $view\n\t\t);\n\n\t\t// trigger hooks\n\t\tZend_Registry::get('hooks')->trigger('hook_app_init', $app);\n\t}", "public function init()\n {\n// \tinclude_once 'Acl/permission.php';\n\t\t$this->layout = Zend_Registry::get('LAYOUT');\n\t\t$this->auth = new Zend_Session_Namespace('AUTH');\n\t\t$this->tr = Zend_Registry::get('TRANSLATE');\n\n//\t\tif (isset($_SERVER['HTTP_X_REQUESTED_WITH']) \n// \t\t&& $_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest') {\n//\t \t$this->_helper->layout()->disableLayout();\n//\t\t\t$this->_helper->viewRenderer->setNoRender(TRUE);\n// \t}\n\t if ($this->_request->isXmlHttpRequest()) {\n//\t\t\t$fc = Zend_Controller_Front::getInstance();\n//\t\t\t$fc->setParam('noViewRenderer', true);\n\t\t\t$this->_helper->layout()->disableLayout();\n\t\t\t$this->_helper->viewRenderer->setNoRender(TRUE);\n\t\t}\n }", "protected function _initRouter() {\r\n\t\t$front = $this->bootstrap('FrontController')->getResource('FrontController');\r\n\t\t$router = $front->getRouter();\r\n\t\t$router->addRoute('Accueil', new Zend_Controller_Router_Route('accueil', array('module' => 'Shop', 'controller' => 'index', 'action' => 'index')));\r\n\t\t$router->addRoute('monCompte', new Zend_Controller_Router_Route('compte', array('module' => 'Shop', 'controller' => 'client', 'action' => 'tableau-bord')));\r\n\t\t$router->addRoute('connexionClient', new Zend_Controller_Router_Route('connexion', array('module' => 'Shop', 'controller' => 'index', 'action' => 'login')));\r\n\t\t$router->addRoute('deconnexion', new Zend_Controller_Router_Route('deconnexion', array('module' => 'Shop', 'controller' => 'index', 'action' => 'logout')));\r\n\t\t$router->addRoute('newCompte', new Zend_Controller_Router_Route('nouveau_compte', array('module' => 'Shop', 'controller' => 'client', 'action' => 'ajout')));\r\n\t\t$router->addRoute('panier', new Zend_Controller_Router_Route('panier/:rm', array('module' => 'Shop', 'controller' => 'client', 'action' => 'panier','rm'=>'')));\r\n\t\t$router->addRoute('menu', new Zend_Controller_Router_Route('menu', array('module' => 'Shop', 'controller' => 'administration', 'action' => 'login')));\r\n\t\t$router->addRoute('carnetAdresse', new Zend_Controller_Router_Route('carnet_adresses', array('module' => 'Shop', 'controller' => 'client', 'action' => 'carnet-adresse')));\r\n\t\t$router->addRoute('informationCompte', new Zend_Controller_Router_Route('information_compte', array('module' => 'Shop', 'controller' => 'client', 'action' => 'information-compte')));\r\n\t\t$router->addRoute('mesCommandes', new Zend_Controller_Router_Route('mes_commandes/:orderBy/:page', array('module' => 'Shop', 'controller' => 'client', 'action' => 'commande','orderBy'=>'Id_Desc', 'page'=>'')));\r\n\t\t$router->addRoute('ajoutAdresse', new Zend_Controller_Router_Route('ajouter_adresse', array('module' => 'Shop', 'controller' => 'client', 'action' => 'ajout-carnet-adresse')));\r\n\t\t$router->addRoute('modifierAdresse', new Zend_Controller_Router_Route('modifier_adresse/:id', array('module' => 'Shop', 'controller' => 'client', 'action' => 'ajout-carnet-adresse')));\r\n\t\t$router->addRoute('supprimerAdresse', new Zend_Controller_Router_Route('supprimer_adresse/:id', array('module' => 'Shop', 'controller' => 'client', 'action' => 'delete-carnet-adresse','id' => '')));\r\n\t\t$router->addRoute('mesFichesCommandes', new Zend_Controller_Router_Route('fiches_commandes/:id', array('module' => 'Shop', 'controller' => 'client', 'action' => 'fiche-commande','id' => '')));\r\n\t\t$router->addRoute('listeCommandes', new Zend_Controller_Router_Route('liste_commandes/:orderBy/:page', array('module' => 'Shop', 'controller' => 'commande', 'action' => 'liste', 'orderBy'=>'Id_Asc', 'page'=>'')));\r\n\t\t$router->addRoute('fichesCommandes', new Zend_Controller_Router_Route('fiche_commande/:id', array('module' => 'Shop', 'controller' => 'commande', 'action' => 'fiche')));\r\n\t\t$router->addRoute('livreCommandes', new Zend_Controller_Router_Route('livre_commande/:id/:islivre', array('module' => 'Shop', 'controller' => 'commande', 'action' => 'envoye')));\r\n\t\t$router->addRoute('ficheProduitAdmin', new Zend_Controller_Router_Route('fiche_produit_admin/:id', array('module' => 'Shop', 'controller' => 'administration', 'action' => 'fiche-produit')));\r\n\t\t$router->addRoute('listeProduit', new Zend_Controller_Router_Route('liste_produit/:orderBy/:page/:mode', array('module' => 'Shop', 'controller' => 'produit', 'action' => 'liste', 'orderBy'=>'Ligne_Asc', 'page'=>'', 'mode' => 'now_futur')));\r\n\t\t$router->addRoute('ajoutProduit', new Zend_Controller_Router_Route('ajout_produit', array('module' => 'Shop', 'controller' => 'produit', 'action' => 'ajout')));\r\n\t\t$router->addRoute('listeClient', new Zend_Controller_Router_Route('liste_client/:orderBy/:page', array('module' => 'Shop', 'controller' => 'client', 'action' => 'liste','orderBy'=>'', 'page'=>'')));\r\n\t\t$router->addRoute('ajoutClient', new Zend_Controller_Router_Route('ajout_client', array('module' => 'Shop', 'controller' => 'client', 'action' => 'ajout-admin')));\r\n\t\t$router->addRoute('statutProduit', new Zend_Controller_Router_Route('statut_produit/:id', array('module' => 'Shop', 'controller' => 'produit', 'action' => 'statut')));\r\n\t\t$router->addRoute('supprimerProduit', new Zend_Controller_Router_Route('supprimer_produit/:id', array('module' => 'Shop', 'controller' => 'produit', 'action' => 'delete')));\r\n\t\t$router->addRoute('modifierProduit', new Zend_Controller_Router_Route('modifier_produit/:id', array('module' => 'Shop', 'controller' => 'produit', 'action' => 'update')));\r\n\t\t$router->addRoute('ficheClient', new Zend_Controller_Router_Route('fiche_client/:id', array('module' => 'Shop', 'controller' => 'administration', 'action' => 'fiche-client')));\r\n\t\t$router->addRoute('supprimerClient', new Zend_Controller_Router_Route('supprimer_client/:id', array('module' => 'Shop', 'controller' => 'client', 'action' => 'delete')));\r\n\t\t$router->addRoute('listeCategorie', new Zend_Controller_Router_Route('liste_categorie/:id/:orderBy', array('module' => 'Shop', 'controller' => 'categorie', 'action' => 'liste','id'=>'','orderBy'=>'Id_Asc')));\r\n\t\t$router->addRoute('ajoutCategorie', new Zend_Controller_Router_Route('ajout_categorie', array('module' => 'Shop', 'controller' => 'categorie', 'action' => 'ajout')));\r\n\t\t$router->addRoute('supprimerCategorie', new Zend_Controller_Router_Route('modifier_categorie', array('module' => 'Shop', 'controller' => 'categorie', 'action' => 'update')));\r\n\t\t$router->addRoute('parametre', new Zend_Controller_Router_Route('parametres', array('module' => 'Shop', 'controller' => 'administration', 'action' => 'parametre')));\r\n\t\t$router->addRoute('catalogue', new Zend_Controller_Router_Route('catalogue/:orderBy/:page', array('module' => 'Shop', 'controller' => 'produit', 'action' => 'catalogue', 'page'=>'', 'orderBy'=>'Date_Desc')));\r\n\t\t$router->addRoute('recherche', new Zend_Controller_Router_Route('recherche/:mot/:orderBy/:page', array('module' => 'Shop', 'controller' => 'produit', 'action' => 'catalogue', 'mot'=>'', 'page'=>'', 'orderBy'=>'Date_Desc')));\r\n\t\t$router->addRoute('new', new Zend_Controller_Router_Route('new/:orderBy/:page', array('module' => 'Shop', 'controller' => 'index', 'action' => 'new', 'page'=>'', 'orderBy'=>'Date_Desc')));\r\n\t\t$router->addRoute('topVentes', new Zend_Controller_Router_Route('top_ventes/:orderBy/:page', array('module' => 'Shop', 'controller' => 'index', 'action' => 'top-ventes', 'page'=>'', 'orderBy'=>'Date_Desc')));\r\n\n\t}", "public function preDispatch()\n {\n //...\n }", "public function before()\n {\n if (in_array($this->request->action(), $this->_no_auth_action))\n {\n $this->_auth_required = FALSE;\n }\n\n parent::before();\n }", "public function beforeAction( $request )\r\n\t\t{\r\n\r\n\t\t}", "public function dispatchLoopStartup(Zend_Controller_Request_Abstract $request) {\n\t\tif ($this->_enabled) {\n\t\t\t$this->_initializeTokens ();\n\t\t\t\n\t\t\tif ($request->isPost () === true) {\n\t\t\t\tif (empty ( $this->_previousToken )) {\n\t\t\t\t\t$request->setControllerName('error')\n\t\t\t\t\t\t ->setActionName('csrf')\n\t\t\t\t\t\t ->setModuleName('default')\n\t\t\t\t\t\t ->setDispatched(false);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$value = $request->getParam ( $this->_keyName ); //sometimes it is usefull to have it as a GET param\n\t\t\t\t\n\t\t\t\tif (! $this->isValidToken ( $value )) {\n\t\t\t\t\t$request->setControllerName('error')\n\t\t\t\t\t\t ->setActionName('csrf')\n\t\t\t\t\t\t ->setModuleName('default')\n\t\t\t\t\t\t ->setDispatched(false);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function preDispatch()\n {\n parent::preDispatch();\n $action = $this->getRequest()->getActionName();\n $loginUrl = Mage::helper('customer')->getLoginUrl();\n if (!Mage::getSingleton('customer/session')->authenticate($this, $loginUrl)) {\n $this->setFlag('', self::FLAG_NO_DISPATCH, true);\n }\n }", "public function front_action() {\n\n\t\tif ( $this->is_request_to_forget() ) {\n\t\t\t$this->process_request_to_forget();\n\t\t}\n\n\t\tif ( $this->is_request_confirmation() ) {\n\t\t\t$this->process_confirm_request();\n\t\t}\n\t}", "public function preDispatch() {\r\n\t\t$this->_auth = Zend_Auth::getInstance();\r\n\t\t$this->_auth->setStorage(new Zend_Auth_Storage_Session('Fancrank_App'));\r\n\t\t//\r\n\t\tif(!$this->_auth->hasIdentity()) {\r\n\t\t\t$this->_helper->json(array('message'=>'authentication failed','code'=>400));\r\n\t\t\t//set the proper navbar\r\n\t\t}\r\n\t\t$this->_helper->layout()->disableLayout();\r\n\t\t$this->_helper->viewRenderer->setNoRender();\r\n\t\t$this->_user = $this->_auth->getIdentity();\r\n\t\t\r\n\t\tif ($this->_getParam('id') != $this->_user->facebook_user_id){\r\n\t\t\techo \"IDENTITY AND PARAMETER ID DOES NOT MATCH\"\t;\r\n\t\t\texit();\r\n\t\t}\r\n\t}", "public function preDispatch(\\Zend_Controller_Request_Abstract $request) \n {\n \n // twee elementen, frontend en backend\n // frontend, hoelang\n \n $frontendOptions = array(\n 'lifetime' => 3600, // 1 uur in de cache\n 'automatic_serialization' => true\n );\n \n // realpath zal het volledige pad gaan ophalen\n // volledige root tot aan de public/html\n // zorgt ervoor dat het op ieder systeem werkt\n // cache folder zal op ons systeem in de root staan\n \n $backendOptions = array(\n 'cache_dir' => APPLICATION_PATH.'/../cache'\n );\n \n // object aanmaken\n \n $cache = Zend_Cache::factory('Core',\n 'File',\n $frontendOptions,\n $backendOptions\n );\n \n // key meegeven (meerdere caches mogelijk)\n // bvb navigation\n // gaat cache gaan inladen, zit er nog geen in zal het fals genereren\n // 'je zoekt een file met naam navigation'\n // als bestaat zal hij het inladen\n // kunnen we dus perfect in een if steken, als opgevult lezen, anders maken\n // dmv ronde haken eerst opvullen en dan vergelijken\n // als false is hij leeg, bevat hij inhoud is hij vol\n \n if(($result = $cache->load('navigation')) === false){\n // onze cache bestaat niet\n \n $locale = Zend_Registry::get('Zend_Locale');\n $model = new Application_Model_Page();\n $pages = $model->getMenu($locale);\n \n $container = new Zend_Navigation();\n \n foreach ($pages as $page)\n {\n $menu = new Zend_Navigation_Page_Mvc(\n array(\n 'label' => $page['title'], \n //'controller' => 'index',\n 'route' => 'page',\n 'params' => array('slug' => $page['slug'],\n 'lang' => $locale)\n ));\n \n $container->addPage($menu);\n }\n // cache object wegschrijven\n $cache->save($container,'navigation');\n }else{\n $container = $result;\n // echo 'we zitten in de cache !';\n }\n \n Zend_Registry::set('Zend_Navigation', $container);\n }", "public function preDispatch()\n {\n\n }", "public function preDispatch() \n\t{\n\t\t// except for error\n\t\t$request = $this->getRequest();\n\t\tif($request->getControllerName() != 'api' || $request->getActionName() != 'error') {\n\t\t\tif(!$this->authenticate()) {\n\t\t\t\t$this->_forward('error', 'api', null, array(\n\t\t\t\t\t//'http_code' => 401, Flex/AS§ doesn't support status codes\n\t\t\t\t\t'code' => 'AuthenticationFailed',\n\t\t\t\t\t'message' => 'Authentication failed!'\n\t\t\t\t));\n\t\t\t}\n\t\t}\n\t}", "public function preDispatch() {\n\t\t$registry = Shineisp_Registry::getInstance ();\n\t\t$this->translator = $registry->Zend_Translate;\n\t}", "private function init_route(){\n if(array_key_exists ( $this->uri_request , $this->web )){\n /*\n * check controller folder exist\n */\n if(is_dir(_CONTROLLER)){\n\n if(is_file(_CONTROLLER.\"/\".$this->web[$this->uri_request]['controller'])){\n $this->controller_path = _CONTROLLER.\"/\".$this->web[$this->uri_request]['controller'];\n $this->controller = basename(explode(\".\",$this->controller_path)[0]);\n $this->method = $this->web[$this->uri_request]['method'];\n }\n else{\n $ERROR = \"Controller not found!\";\n }\n\n }\n else{\n $ERROR = \"Controller path not set properly!\";\n }\n\n\n }\n else{\n $ERROR = \"route not found!\";\n }\n\n // echo $controller;\n\n }", "public function init()\n {\n $controller = $this->router->getController();\n $action = $this->router->getAction();\n $params = $this->router->getParams();\n\n $objController = registerObject($controller);\n\n call_user_func_array([$objController, $action], $params);\n }", "public function filter_init()\n {\n // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps\n ob_start(); // This prevents themes and plugins from screwing us over.\n $this->ajax_router();\n }", "public function beforeRoute()\n {\n if (!Session::get('userid')) {\n \\BarkaneArts\\redirect('/login');\n }\n parent::beforeRoute();\n }", "public function preDispatch( Zend_Controller_Request_Abstract $request )\n\t{\n\t\t$layout = Zend_Layout::getMvcInstance();\n\t\t$path = APPLICATION_PATH .'/modules/'. $request->getModuleName() .'/layouts';\n\t\tif( file_exists($path) )\n\t\t\t$layout->setLayoutPath( $path );\n\t}", "public function _activate() {\r\n\t\t// Bail early if requirements aren't met.\r\n\t\tif ( ! $this->check_requirements() ) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// Make sure any rewrite functionality has been loaded.\r\n\t\tflush_rewrite_rules();\r\n\t}", "public function preDispatch(\\Zend_Controller_Request_Abstract $request)\n\t{\n\t\tif (!$request instanceof \\Zend_Controller_Request_Http) {\n\t\t\treturn;\n\t\t}\n\n if (Env::isCLI()) {\n return;\n }\n\n $this->getResponse()->setHeader('Access-Control-Allow-Origin', '*');\n $this->getResponse()->setHeader('Access-Control-Allow-Headers', join(',', array(\n 'Dope-Rest-Token',\n 'Range',\n 'X-Requested-With',\n 'Content-type',\n 'Dope-Accept'\n )));\n $this->getResponse()->setHeader('Access-Control-Expose-Headers', join(',', array(\n 'Content-Range',\n 'Dope-Search-Id',\n 'Link'\n )));\n\n if ('OPTIONS' == strtoupper($request->getMethod())) {\n $this->getResponse()->sendHeaders();\n die();\n }\n\n $token = $request->getHeader('Dope-Rest-Token');\n if (!$token OR Auth::hasUser()) {\n return;\n }\n\t\n $user = \\Dope\\Doctrine::getRepository(Auth::getUserEntityClass())->findOneBy(array(\n 'token' => $token\n ));\n\n if (! $user) {\n return;\n }\n\n Auth::setUser($user);\n\t}", "public function init() {\n\n\t\t$token = $this->get_token();\n\n\t\tif ( ! $token || ! $this->is_valid_token( $token ) ) {\n\n\t\t\treturn;\n\n\t\t}\n\n\t\tforeach ( $this->routes as $route => $class ) {\n\n\t\t\tif ( class_exists( $class ) ) {\n\n\t\t\t\tnew $class( $route );\n\n\t\t\t}\n\n\t\t}\n\n\t\tadd_filter( 'rest_index', [ $this, 'hide_from_rest_index' ], PHP_INT_MAX );\n\t\tadd_filter( 'rest_pre_serve_request', [ $this, 'send_headers' ], PHP_INT_MAX, 4 );\n\t\tadd_filter( 'rest_send_nocache_headers', '__return_true', PHP_INT_MAX );\n\n\t}", "public function beforeFilter(){\n\t\t//redirect to top page in case of only input http://{url}/\n\t\tif(empty($this->params ['controller']) == TRUE){\n\t\t\t$this->redirect(array('controller' => 'home', 'action' => 'index'));\n\t\t}\n\t\t//redirect to top page in case of only input http://{url}/admin/\n\t\t\n\t\tif($this->params ['controller'] == 'admin'){\n\t\t\t$this->redirect(array('controller' => 'admin/users', 'action' => 'index'));\n\t\t}\n\t\t// if admin url requested, check the existing of session\n\t\telseif((isset($this->params ['admin']) == TRUE) && ($this->params ['controller']) != 'users'){\n\t\t\t// check user is logged in\n\t\t\tif(!$this->Session->check(SYS_LOG_000)){\n\t\t\t\t//if not, redirect to login page\n\t\t\t\t$url = Router::url(NULL, true);// get all url\n\t\t\t\tif(!preg_match('/login|logout/i', $url)){\n\t\t\t\t\t$this->Session->write('lastUrl',$url);\n\t\t\t\t}\n\t\t\t\t$this->Session->setFlash(array(Configure::read(SYS_LOG_000.'.SessionTimeout')),'flash_session', array(),'bad');\n\t\t\t\t$this->redirect(array('controller' => 'users', 'action' => 'index'));\n\t\t\t}\n\t\t\t//if user has logged in\n\t\t\t//$this->redirect(array('controller' => 'users', 'action' => 'default'));\n\t\t\t$this->layout='/admin/default';\n\t\t}\n\t\t\n \t//$this->requireNonSSL('');\n\t}", "public function preInit()\n {\n $this->_viewEngine = Bigace_Services::get()->getService('view');\n }", "public function init()\n\t{\n\t\t$acl = Zend_Controller_Front::getInstance()->getParam('acl');\n\t\t$role = Zend_Auth::getInstance()->getIdentity()->role;\n\t\t\n\t\tif ($role == \"administrator\") {\n\t\t\t//$this->_models[] = 'Default_Model_Sources';\n\t\t}\t\n\t\t\n\t\t// find if a page have been set\n\t\t$params = $this->getRequest()->getParams();\n\t\tif (isset($params['page'])) {\n\t\t\t$this->page = $params['page'];\n\t\t}\t\n\t}", "private function start()\n {\n // CSRF Watchdog\n $this->csrfWatchdog();\n\n // Retrieve and other services\n $this->retriever->watchdog();\n\n // Router Templater Hybrid\n $this->renderer->route();\n }" ]
[ "0.7267515", "0.72168", "0.7209081", "0.7186009", "0.7129266", "0.70465386", "0.6972642", "0.692866", "0.6922937", "0.69097203", "0.69057673", "0.6897841", "0.68922716", "0.68624794", "0.68569833", "0.6845615", "0.675835", "0.67328846", "0.6696042", "0.6690522", "0.6682041", "0.6678693", "0.6665975", "0.6638781", "0.6593672", "0.65363646", "0.6518625", "0.64962035", "0.6470103", "0.64665496", "0.6453528", "0.6452018", "0.64344656", "0.6417743", "0.64067864", "0.6376686", "0.6325544", "0.63200307", "0.62978584", "0.6294443", "0.6286852", "0.62848985", "0.62820274", "0.62794477", "0.6275629", "0.62640864", "0.62627006", "0.62594575", "0.62580794", "0.62527734", "0.6242578", "0.6235292", "0.62216526", "0.62048215", "0.61931044", "0.61895496", "0.61809164", "0.6174943", "0.61680865", "0.6161088", "0.6160755", "0.61332303", "0.61302716", "0.6126444", "0.6125689", "0.6122997", "0.61223876", "0.6117349", "0.61170113", "0.6102342", "0.6091911", "0.6077707", "0.60573494", "0.603966", "0.60369956", "0.6031263", "0.602916", "0.602543", "0.6022397", "0.59983647", "0.5975875", "0.59694976", "0.5968106", "0.5956592", "0.59535605", "0.59526837", "0.5945972", "0.5926764", "0.5926159", "0.5922531", "0.5907399", "0.5904716", "0.5895594", "0.58679885", "0.5867632", "0.5859456", "0.585542", "0.58360404", "0.5835804", "0.58278686" ]
0.61861247
56
get the data return with an array
function data_page($dbc, $id){ # Page Setup query $query = "SELECT * FROM pages WHERE id = $id "; $result = mysqli_query($dbc, $query); $data = mysqli_fetch_assoc($result); $data['body_nohtml'] = strip_tags($data['body']); if($data['body_nohtml'] == $data['body']){ $data['body_formatted'] = '<p>'.$data['body'] .'</p>'; }else{ $data['body_formatted'] = $data['body']; } return $data; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get_data(): array;", "public function get_data(): array;", "public function getData(): array;", "public function getData(): array;", "public function getData(): array;", "public function getData(): array;", "public function getData() : array;", "public function getData() : array;", "protected abstract function getData(): array;", "private function _getData():array {\n\n # Set result\n $result = [];\n\n # Return result\n return $result;\n\n }", "public function getMultipleData();", "public function getData()\n {\n //let's assume that this array is from a database\n return array('persian', 'bob', 'tabby', 'stray');\n }", "abstract public function getArray();", "public function DataGenerateArray() {\n $data = $this->GenerateArray();\n return $data['data']; \n }", "public function getData()\n {\n return array(\n\n );\n }", "public function getDataArr(){\n\t\treturn $this->data_arr;\n\t}", "private function getDataArray() {\n\t\treturn $this->dataArray;\n\t}", "public function get_data();", "public function data(): ?array;", "public function getData();", "public function getData();", "public function getData();", "public function getData();", "public function getData();", "public function getData();", "public function getData();", "public function getData();", "public function getData();", "public function getData();", "public function getData();", "public function getData();", "public function getData();", "public function getData();", "public function getData();", "public function getData();", "public function getData();", "public function getData();", "public function getData();", "public function getData();", "public function getData();", "public function get(): array;", "public function get(): array;", "public function getArray() {\n\t\treturn $this->data; \n\t}", "public function getArray() {\n\t\treturn $this->data; \n\t}", "public function get() : array;", "public function getDataArray(){\n return array($this->item_id,$this->name,$this->count,$this->price);\n }", "public function getData () : array {\n\t\treturn $this->data;\n\t}", "public function getAsArray();", "function getData()\n{\n return array(\n array(\"name\"=>\"Bob\",\"age\"=>50),\n array(\"name\"=>\"Jane\",\"age\"=>41),\n array(\"name\"=>\"Sarah\",\"age\"=>30)\n );\n}", "public function getData() : array\n {\n return $this->data;\n }", "public function getData() : array\n {\n return $this->data;\n }", "public function getData() : array\n {\n return $this->data;\n }", "function getArray();", "public abstract function FetchArray();", "public function getData() {\n if ($this->_multiple) {\n return $this->_data;\n }\n return isset($this->_data[0])? $this->_data[0] : [];\n }", "public function getData() {}", "protected function getData()\n {\n return [];\n }", "public function _getData(): array\n {\n $result = [\n ];\n\n return parent::normalizeData($result);\n }", "public function getData(): array\n\t{\n\t\treturn $this->data;\n\t}", "public function fetchArray();", "public function fetchArray();", "public static function getData() {}", "public function getResponse() : array;", "public function getData(): array\n {\n return $this->data;\n }", "public function getData(): array\n {\n return $this->data;\n }", "public function getData(): array\n {\n return $this->data;\n }", "public function result() : array;", "abstract function getdata();", "public function getData() : array{\n $this->collection->rewind();\n $data = [];\n while($this->collection->valid()){\n $data[] = $this->collection->current()->getData();\n $this->collection->next();\n }\n return $data;\n }", "public function getData()\n {\n $row = $this->_row;\n $data = array(\n 'id' => intval($row['id']),\n 'mls_number' => $row['mls_number'],\n 'type' => $row['type'],\n 'price' => intval($row['price']),\n 'city' => $row['city'],\n 'subdivision' => $row['subdivision'],\n 'num_bedrooms' => ($row['bedrooms'] == 0 ? null : intval($row['bedrooms'])),\n 'num_bathrooms' => ($row['bathrooms'] == 0 ? null : floatval($row['bathrooms'])),\n 'num_sqft' => ($row['sqft'] == 0 ? null : intval($row['sqft'])),\n 'feed' => $row['idx'],\n 'source' => $row['table'],\n );\n return $data;\n }", "public function getData(): mixed;", "public function asArray(){\n return $this->data;\n }", "abstract public function data2Array($data);", "public function getRawData();", "public function getRawData();", "function toArray(){\r\n\t\treturn $this->data;\r\n\t}", "public function getDataList(){\n return $this->_get(1);\n }", "public function getResponse(): array;", "public function getData(){ \n return json_decode($this->data); \n }", "public function getResponseData();", "public function getData()\n\t{\n\t\treturn array_merge($this->values, $this->rest, array('id' => $this->getID()));\n\t}", "public function getRawData() {}", "protected function getDataArray(): array\n {\n return [];\n }", "public function asArray()\r\n {\r\n return $this->data;\r\n }", "public function getFakedData(): array;", "public function data() : array\n {\n return $this->data->toArray();\n }", "public function getData()\n\t{\n\t\treturn $this->arrData;\n\t}", "public function getData()\n\t{\n\t\treturn $this->arrData;\n\t}", "public function &getData() : array\n {\n return $this->data;\n }", "public function getData(){\n $data = json_encode($this->data);\n return $data;\n }", "public function getData(){\n\t\treturn $this->data;\n\t}", "public function getData(){\n\t\treturn $this->data;\n\t}", "public function getData(){\n\t\treturn $this->data;\n\t}", "public function getResult(): array;", "public function getResult(): array;", "public function getDatasList(){\n return $this->_get(5);\n }", "protected function data()\n {\n $row = array('id' => 0, 'name' => '', 'age' => 0, 'gender' => '');\n\n $rougin = $angel = $royce = $roilo = $rouine = $row;\n\n $rougin['id'] = 1;\n $rougin['name'] = 'rougin';\n $rougin['age'] = 18;\n $rougin['gender'] = 'male';\n\n $angel['id'] = 2;\n $angel['name'] = 'angel';\n $angel['age'] = 19;\n $angel['gender'] = 'female';\n\n $royce['id'] = 3;\n $royce['name'] = 'royce';\n $royce['age'] = 15;\n $royce['gender'] = 'male';\n\n $roilo['id'] = 4;\n $roilo['name'] = 'roilo';\n $roilo['age'] = 17;\n $roilo['gender'] = 'male';\n\n $rouine['id'] = 5;\n $rouine['name'] = 'rouine';\n $rouine['age'] = 12;\n $rouine['gender'] = 'male';\n\n return array($rougin, $angel, $royce, $roilo, $rouine);\n }", "private function getData() {\n $arr = \\Yii::$app->session->get('arr');\n if(isset($arr['pkd']) && $arr['pkd'] !== '0'){\n $pkd = \\app\\models\\Rujukan::find()->where(['kod' => $arr['pkd'], 'kat' => 'pkd'])->one();\n } else {\n $pkd = new \\app\\models\\Rujukan();\n }\n\n if(isset($arr['pks']) && $arr['pks'] !== '0'){\n $klinik = \\app\\models\\Klinik::find()->where(['id' => $arr['pks']])->one();\n } else {\n $klinik = new \\app\\models\\Klinik();\n }\n\n if(isset($arr['sekolah']) && $arr['sekolah'] !== '0'){\n $sekolah = \\app\\models\\Sekolah::find()->where(['id' => $arr['sekolah']])->one();\n } else {\n $sekolah = new \\app\\models\\Sekolah();\n }\n //\\var_dump($arr);exit;\n return ['pkd' => $pkd, 'klinik' => $klinik, 'sekolah' => $sekolah, 'ym_dari' => $arr['ym_dari'], 'ym_hingga' => $arr['ym_hingga']];\n }", "public function get(): array\n {\n \n }", "public function getData() \n\t{\n return $this->data;\n }", "public function getData()\r\n {\r\n }" ]
[ "0.8349315", "0.8349315", "0.8276994", "0.8276994", "0.8276994", "0.8276994", "0.81858355", "0.81858355", "0.7902489", "0.77432257", "0.77190864", "0.7710706", "0.75571406", "0.7544841", "0.7528552", "0.75049573", "0.7484665", "0.7469283", "0.74200636", "0.7398328", "0.7398328", "0.7398328", "0.7398328", "0.7398328", "0.7398328", "0.7398328", "0.7398328", "0.7398328", "0.7398328", "0.7398328", "0.7398328", "0.7398328", "0.7398328", "0.7398328", "0.7398328", "0.7398328", "0.7398328", "0.7398328", "0.7398328", "0.7398328", "0.7368893", "0.7368893", "0.73493236", "0.73493236", "0.7347601", "0.73369217", "0.7317785", "0.731338", "0.73093843", "0.7270706", "0.7270706", "0.7270706", "0.7256314", "0.72516733", "0.7234891", "0.72296315", "0.71885353", "0.7174506", "0.7132526", "0.71316177", "0.71316177", "0.713126", "0.7126314", "0.71257186", "0.71257186", "0.71257186", "0.7123672", "0.7120956", "0.70991147", "0.7088459", "0.7083815", "0.7076698", "0.70690465", "0.70484173", "0.70484173", "0.7046987", "0.70451725", "0.7028706", "0.70131075", "0.7005383", "0.6993347", "0.6960291", "0.6952985", "0.6933193", "0.69302684", "0.69243336", "0.6917846", "0.6917846", "0.69037527", "0.6899579", "0.6893406", "0.6893406", "0.6893406", "0.68812263", "0.68812263", "0.6873755", "0.6869959", "0.6867864", "0.68621826", "0.68299955", "0.68187153" ]
0.0
-1
Construct a connector object. If you will be authenticating with only a single set of credentials, it is recommended that you use the singleton getInstance() method instead. Use this constructor if you require multiple connector objects for more than one set of credentials. Overridden to return the SilverpopGuzzleXmlConnector.
public function __construct($baseUrl='http://api.pilot.silverpop.com', $dateFormat='MM/dd/yyyy') { $this->restConnector = SilverpopRestConnector::getInstance(); $this->xmlConnector = SilverpopGuzzleXmlConnector::getInstance(); $this->setBaseUrl($baseUrl); $this->setDateFormat($dateFormat); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function createConnector()\n {\n // Load credentials:\n $iid = isset($this->libGuidesConfig->General->iid)\n ? $this->libGuidesConfig->General->iid : null;\n // Pick version:\n $ver = isset($this->libGuidesConfig->General->version)\n ? $this->libGuidesConfig->General->version : 1;\n // Build HTTP client:\n $client = $this->serviceLocator->get('VuFind\\Http')->createClient();\n $timeout = isset($this->libGuidesConfig->General->timeout)\n ? $this->libGuidesConfig->General->timeout : 30;\n $client->setOptions(array('timeout' => $timeout));\n $connector = new Connector($iid, $client, $ver);\n $connector->setLogger($this->logger);\n return $connector;\n }", "public function getConnector() {\n\treturn new Agel_Payment_Gateway_Qiwi_Connector();\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 }", "public function getConnector();", "public function getConnection()\n {\n return new TwitterOAuth(\n $this->config['customerKey'],\n $this->config['customerSecret'],\n $this->config['accessToken'],\n $this->config['accessTokenSecret']\n );\n }", "public function __construct($endpoint, $username, $password) {\n $this->endpoint = $endpoint;\n $this->username = $username;\n $this->password = $password;\n $this->login();\n\n return $this;\n }", "public function getConnector()\r\n {\r\n return $this->connector;\r\n }", "public function getClient()\n\t{\n\t\treturn new Client([\n\t\t\t'headers' => [\n\t\t\t\t'Authorization' => 'ZXWS ' . $this->connect_id . ':' . $this->getSignature(),\n\t\t\t\t'Date' => $this->timestamp,\n\t\t\t\t'nonce' => $this->nonce\n\t\t\t]\n\t\t]);\n\t}", "public function make()\n {\n $connection = ConnectionFactory::getConnection($this->type);\n $connection->setAddress($this->address);\n return $connection;\n }", "public function getConnectorManager()\n {\n if (empty($this->connectorManger)) {\n $this->connectorManager = new ConnectorManager();\n }\n return $this->connectorManager;\n }", "public function connect($endpoint = 'WebApp')\n {\n if (in_array($endpoint, $this->endpoints, true)) {\n // set forge endpoint\n Forge::setEndpoint($endpoint);\n $class = \"Fut\\\\Connector\\\\\" . $endpoint;\n $this->connector = new $class($this->email, $this->password, $this->answer, $this->platform);\n $this->connector\n ->setClient($this->client)\n ->setCookiePlugin($this->cookiePlugin);\n\n $this->connector->connect();\n }\n\n return $this;\n }", "public function getApiClient()\n {\n $client = new \\Acelle\\Extra\\SendGrid(['username' => $this->getSubAccountUsername(), 'password' => decrypt($this->password)]);\n return $client;\n }", "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 }", "protected function _getClient()\n {\n $client = new Zend_Http_Client();\n $client->setUri($this->getGatewayUrl())\n ->setConfig(array('maxredirects' => self::REQUEST_MAX_REDIRECTS, 'timeout' => self::REQUEST_TIMEOUT))\n ->setParameterGet('API', $this->getApiCode())\n ->setParameterGet('XML', $this->asXml());\n return $client;\n }", "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 __construct()\r\n\t{\r\n\t\t$conn= new connection();\r\n return $this->conn;\r\n }", "public function getDatabaseConnectorInstance() {\n return new DatabaseConnector($this->config['general']['db']);\n }", "public function get_curl_object() {\n if (!is_null($this->curl)) {\n return $this->curl;\n }\n\n // Connection to Solr is allowed to use 'localhost' and other potentially blocked hosts/ports.\n $this->curl = new \\curl(['ignoresecurity' => true]);\n\n $options = array();\n // Build the SSL options. Based on pecl-solr and general testing.\n if (!empty($this->config->secure)) {\n if (!empty($this->config->ssl_cert)) {\n $options['CURLOPT_SSLCERT'] = $this->config->ssl_cert;\n $options['CURLOPT_SSLCERTTYPE'] = 'PEM';\n }\n\n if (!empty($this->config->ssl_key)) {\n $options['CURLOPT_SSLKEY'] = $this->config->ssl_key;\n $options['CURLOPT_SSLKEYTYPE'] = 'PEM';\n }\n\n if (!empty($this->config->ssl_keypassword)) {\n $options['CURLOPT_KEYPASSWD'] = $this->config->ssl_keypassword;\n }\n\n if (!empty($this->config->ssl_cainfo)) {\n $options['CURLOPT_CAINFO'] = $this->config->ssl_cainfo;\n }\n\n if (!empty($this->config->ssl_capath)) {\n $options['CURLOPT_CAPATH'] = $this->config->ssl_capath;\n }\n }\n\n // Set timeout as for Solr client.\n $options['CURLOPT_TIMEOUT'] = !empty($this->config->server_timeout) ? $this->config->server_timeout : '30';\n\n $this->curl->setopt($options);\n\n if (!empty($this->config->server_username) && !empty($this->config->server_password)) {\n $authorization = $this->config->server_username . ':' . $this->config->server_password;\n $this->curl->setHeader('Authorization: Basic ' . base64_encode($authorization));\n }\n\n return $this->curl;\n }", "public function create( Credentials $credentials )\n {\n $params = [\n 'auth' => [ $credentials->getUsername(), $credentials->getPassword() ],\n 'base_uri' => $credentials->getEndpoint(),\n ];\n //$adapter->setOption(CURLOPT_SSL_VERIFYPEER, false);\n //$adapter->setOption(CURLOPT_TIMEOUT, 300);\n\n $client = new HttpClient( $params );\n\n $options = array(\n 'query' => array(\n 'channel' => $credentials->getChannel(),\n 'organisation' => $credentials->getOrganisation()\n )\n );\n\n return new DefaultGateway( $client, $options );\n }", "public function get() {\n $config = [\n 'base_uri' => 'https://example.com',\n ];\n\n $client = new Client($config);\n\n return $client;\n }", "public function __construct($socksUri, ConnectorInterface $connector)\r\n {\r\n // support `socks+unix://` scheme for Unix domain socket (UDS) paths\r\n if (preg_match('/^(socks(?:5|4|4a)?)(s|\\+unix):\\/\\/(.*?@)?(.+?)$/', $socksUri, $match)) {\r\n // rewrite URI to parse SOCKS scheme, authentication and dummy host\r\n $socksUri = $match[1] . '://' . $match[3] . 'localhost';\r\n\r\n // connector uses appropriate transport scheme and explicit host given\r\n $connector = new FixedUriConnector(\r\n ($match[2] === 's' ? 'tls://' : 'unix://') . $match[4],\r\n $connector\r\n );\r\n }\r\n\r\n // assume default scheme if none is given\r\n if (strpos($socksUri, '://') === false) {\r\n $socksUri = 'socks://' . $socksUri;\r\n }\r\n\r\n // parse URI into individual parts\r\n $parts = parse_url($socksUri);\r\n if (!$parts || !isset($parts['scheme'], $parts['host'])) {\r\n throw new \\InvalidArgumentException('Invalid SOCKS server URI \"' . $socksUri . '\"');\r\n }\r\n\r\n // assume default port\r\n if (!isset($parts['port'])) {\r\n $parts['port'] = 1080;\r\n }\r\n\r\n // user or password in URI => SOCKS5 authentication\r\n if (isset($parts['user']) || isset($parts['pass'])) {\r\n if ($parts['scheme'] === 'socks') {\r\n // default to using SOCKS5 if not given explicitly\r\n $parts['scheme'] = 'socks5';\r\n } elseif ($parts['scheme'] !== 'socks5') {\r\n // fail if any other protocol version given explicitly\r\n throw new InvalidArgumentException('Authentication requires SOCKS5. Consider using protocol version 5 or waive authentication');\r\n }\r\n $parts += array('user' => '', 'pass' => '');\r\n $this->setAuth(rawurldecode($parts['user']), rawurldecode($parts['pass']));\r\n }\r\n\r\n // check for valid protocol version from URI scheme\r\n $this->setProtocolVersionFromScheme($parts['scheme']);\r\n\r\n $this->socksUri = $parts['host'] . ':' . $parts['port'];\r\n $this->connector = $connector;\r\n }", "public function createClient():self\n {\n $client = new TwitterOAuth($this->consumerKey, $this->consumerSecret, $this->accessToken, $this->accessTokenSecret);\n $this->client = $client;\n return $this;\n }", "public static function initialize($config = null)\n {\n if (!self::$_instance) self::$_instance = new ConnectionManager();\n\n if (is_callable($config)) {\n\n $config($_config = new Config());\n\n self::$_instance->Config = $_config;\n }\n\n return self::$_instance;\n }", "public function createConnector(array $config)\n {\n if (!isset($config['driver'])) {\n throw new \\InvalidArgumentException('A driver must be specified.');\n }\n\n switch ($config['driver']) {\n case 'buzz':\n return new BuzzConnector();\n case 'guzzle':\n return new GuzzleConnector();\n case 'guzzle5':\n return new Guzzle5Connector();\n }\n\n throw new \\InvalidArgumentException(\"Unsupported driver [{$config['driver']}]\");\n }", "public function __construct($adapter = null)\n {\n if (empty($adapter)) {\n $this->setAdapter(Mage::getSingleton('minkasu_wallet/api_adapter_curl'));\n } elseif ($adapter instanceof Minkasu_Wallet_Model_Api_Adapter_Abstract) {\n $this->setAdapter($adapter);\n } else {\n Mage::throwException('Invalid client');\n }\n }", "public static function client(){\n\t\tif(!self::$client){\n\t\t\tself::$client = new self();\n\t\t}\n\t\treturn self::$client;\n\t}", "protected function getConnection() {\n\t\tstatic $connection;\n\t\tif ($connection === null) {\n\t\t\t$connection = new ASolrConnection();\n\t\t\t$connection->clientOptions->hostname = SOLR_HOSTNAME;\n\t\t\t$connection->clientOptions->port = SOLR_PORT;\n\t\t\t$connection->clientOptions->path = SOLR_PATH;\n\t\t\tASolrDocument::$solr = $connection;\n\t\t}\n\t\treturn $connection;\n\t}", "private function connector(){\n switch ($this->connection_type) {\n case self::CONN_TYPE_PDO:\n return $this->pdo;\n break;\n\n case self::CONN_TYPE_MYSQLI:\n return $this->mysqli;\n break;\n\n default:\n echo \"Error: connection type '\".$this->connection_type.\"' not suppordted\" . PHP_EOL;\n exit;\n break;\n }\n }", "function getConnection()\n\t{\n\t\treturn S3Client::factory(array(\"key\"=>$this->iamkey, \"secret\"=>$this->iamsecret));\n\t}", "protected function initializeSoapClient()\n {\n\n\t\t$authArray = array(\n\t\t\t'location' => 'https://' . $this->server . '/EWS/Exchange.asmx',\n\t\t\t'classmap' => $this->classMap(),\n\t\t\t'curlopts' => $this->curl_options,\n\t\t\t'features' => SOAP_SINGLE_ELEMENT_ARRAYS,\n\t\t); \n\n\t\tif(!empty($this->token)) {\n\n\t\t\t$authArray[\"token\"] = $this->token; \n\n\t\t}\n\t\telse {\n\n\t\t\t$authArray[\"user\"] = $this->username; \n\t\t\t$authArray[\"password\"] = $this->password; \n\n\t\t}\n\n $this->soap = new Oath2Soap(\n dirname(__FILE__) . '/assets/services.wsdl',\n $authArray\n );\n\n return $this->soap;\n }", "private function createGoogleConnection()\n {\n $clientid = \\JComponentHelper::getParams('com_pbbooking')->get('clientid');\n $clientsecret = \\JComponentHelper::getParams('com_pbbooking')->get('clientsecret');\n\n if (!$clientid || !$clientsecret || $clientid == '' || $clientsecret == '')\n {\n throw new \\Exception('clientid or clientsecret is blank or missing',0);\n }\n\n $token = $GLOBALS['com_pbbooking_data']['config']->token;\n\n if (!$token || $token == '')\n {\n throw new \\Exception('token is missing. Ensure calendar is linked correctly',0);\n }\n\n // All settings appear to be available so let's create the client.\n $client = new \\Google_Client();\n\n $client->setClientId($clientid);\n $client->setClientSecret($clientsecret);\n $client->setRedirectUri('urn:ietf:wg:oauth:2.0:oob');\n $client->addScope('https://www.googleapis.com/auth/calendar');\n $client->setAccessType('offline');\n\n $client->setAccessToken($token);\n\n return $client;\n }", "public function __construct($client, callable $connector = null, array $config = [])\n {\n $this->client = $client;\n $this->config = $config;\n $this->connector = $connector;\n }", "protected function initializeClient()\n {\n if ($this->client) {\n return $this->client;\n }\n\n $options = [\n 'base_uri' => static::$baseUrl,\n 'http_errors' => true,\n 'headers' => [\n 'Content-Type' => 'text/xml',\n ],\n ];\n\n return $this->client = new Client($options);\n }", "protected function _getOAuth () {\n\n\t\t$callback = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];\n\t\t$encrypter = new \\Dropbox\\OAuth\\Storage\\Encrypter(self::encrypter_secret);\n\t\t$storage = new \\Dropbox\\OAuth\\Storage\\Session($encrypter);\n\n\t\t// spoof storage using token stored with plugin\n\t\tif ($this->is_authorized()) {\n\t\t\t$storage->set($this->_plugin->setting(self::token_setting), 'access_token');\n\t\t}\n\n\t\t$OAuth = new \\Dropbox\\OAuth\\Consumer\\Curl(self::consumer_key, self::consumer_secret, $storage, $callback);\n\n\t\treturn $OAuth;\n\t}", "protected function _connect()\n {\n if (!is_resource($this->_conn)) {\n if ($this->is_verbose) {\n fputs(STDERR, time() . \" CONN\\n\");\n }\n\n if (!($this->_conn = curl_init())) {\n throw new DeathByCaptcha_RuntimeException(\n 'Failed initializing a CURL connection'\n );\n }\n\n curl_setopt_array($this->_conn, array(\n CURLOPT_TIMEOUT => self::DEFAULT_TIMEOUT,\n CURLOPT_CONNECTTIMEOUT => (int)(self::DEFAULT_TIMEOUT / 4),\n CURLOPT_HEADER => false,\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_FOLLOWLOCATION => true,\n CURLOPT_AUTOREFERER => false,\n CURLOPT_HTTPHEADER => array(\n 'Accept: ' . $this->_response_type,\n 'Expect: ',\n 'User-Agent: ' . self::API_VERSION\n )\n ));\n }\n\n return $this;\n }", "protected function createConnection()\n {\n return new ModernConnection();\n }", "protected function createConnection(array $config): \\InfluxDB2\\Client\n {\n return $this->factory->make($config);\n }", "public function connect(): self\n {\n $this->doHandshake();\n\n return $this;\n }", "protected static function getConn() {\n if (!isset(self::$_conn)) {\n self::setConn(new SforcePartnerClient());\n self::useTheForce();\n }\n return self::$_conn;\n }", "protected function httpClient()\n {\n return new Client([\n 'base_uri' => $this->baseUri(),\n 'timeout' => 10.0,\n 'stream' => false,\n 'headers' => $this->defaultHeaders(),\n 'debug' => false,\n ]);\n }", "public function getTransport()\n {\n return new Curl;\n }", "private function createHttpClient(): Client\n {\n if (null === $this->configuration->getSecurityToken()) {\n throw new MissingCredentialException('Security Token is not set or empty');\n }\n\n $this->addHeader('SECURITY_TOKEN', $this->configuration->getSecurityToken());\n\n return new Client([\n 'base_uri' => $this->configuration->getBaseUrl(),\n 'headers' => $this->getHeaders() \n ]);\n }", "public static function factory($config = array())\n {\n $config = self::getConfigCollection($config);\n\n $client = new EncodingClient($config->get('base_url'), $config->get('userid'), $config->get('userkey'));\n\n $client->setConfig($config);\n\n // Add the XML service description to the client\n $description = ServiceDescription::factory(__DIR__ . DIRECTORY_SEPARATOR . 'guzzle_encoding_com.json');\n $client->setDescription($description);\n\n return $client;\n }", "protected function createClient()\n {\n $oauthClient = $this->getMockBuilder(BaseClient::className())\n ->setMethods(['initUserAttributes'])\n ->getMock();\n return $oauthClient;\n }", "public static function getInstance() {\n\t\twfProfileIn( 'BS::'.__METHOD__ );\n\t\tif ( self::$oInstance === null ) {\n\t\t\tif ( PHP_SAPI === 'cli' ) {\n\t\t\t\t$oDbr = wfGetDB( DB_SLAVE );\n\t\t\t\tif ( $oDbr->tableExists( 'bs_settings' ) ) {\n\t\t\t\t\tBsConfig::loadSettings();\n\t\t\t\t}\n\t\t\t}\n\t\t\t$aUrl = parse_url( BsConfig::get( 'MW::ExtendedSearch::SolrServiceUrl' ) );\n\n\t\t\tif ( empty( $aUrl['host'] ) || empty( $aUrl['port'] ) || empty( $aUrl['path'] ) ) {\n\t\t\t\twfProfileOut( 'BS::'.__METHOD__ );\n\t\t\t\tthrow new Exception( 'Creating instance of ' . __CLASS__ . ' not possible with these params:'\n\t\t\t\t\t.', $host='.( isset( $aUrl['host'] ) ? $aUrl['host'] : '' )\n\t\t\t\t\t.', $port='.( isset( $aUrl['port'] ) ? $aUrl['port'] : '' )\n\t\t\t\t\t.', $path='.( isset( $aUrl['path'] ) ? $aUrl['path'] : '' )\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t$oServer = new self( $aUrl['scheme'], $aUrl['host'], $aUrl['port'], $aUrl['path'] );\n\n\t\t\tself::$oInstance = $oServer;\n\t\t\twfProfileOut( 'BS::'.__METHOD__ );\n\n\t\t\treturn $oServer;\n\t\t}\n\n\t\twfProfileOut( 'BS::'.__METHOD__ );\n\t\treturn self::$oInstance;\n\t}", "public function getGameConnector(): ApiConnector\n {\n return new HighStakesPokerGameApiConnector($this->url, $this->accessKey, new JsonApiResponse);\n }", "public static function getConnection()\n {\n return static::getInstance();\n }", "public static function build(): self\n {\n $localChargers = Charger :: with( 'connector_types' ) -> get();\n $localConnectorTypes = ConnectorType :: all();\n \n return (new self) \n -> setLocalChargers ( $localChargers )\n -> setLocalConnectorTypes( $localConnectorTypes );\n }", "public function getConnectFactory()\n {\n $this->registerMyLibrary();\n\n if (!$this->connectFactory) {\n $this->connectFactory = new ConnectFactory($this->getVersion());\n }\n\n return $this->connectFactory;\n }", "protected function initializeClient() : self {\n $this->client = new GuzzleClient([\n 'headers' => [\n 'Accept' => 'application/json',\n 'Accept-Encoding' => 'gzip, deflate',\n 'Cache-Control' => 'max-age=0',\n 'User-Agent' => sprintf('FreedomCore Media/%s Jackett Client', env('APP_VERSION'))\n ],\n 'timeout' => $this->timeout,\n 'allow_redirects' => [\n 'max' => $this->maxRedirects,\n ],\n 'debug' => $this->debug\n ]);\n return $this;\n }", "public function __construct()\n {\n $this->viaCepUrl = config('external.via_cep');\n $this->clientGuzzle = new Client(['base_uri' => $this->viaCepUrl]);\n }", "public static function getInstance()\n {\n if (self::$instance === null) {\n $config = Config::getInstance()->get(\n 'php-censor.security.auth_providers',\n [\n 'internal' => [\n 'type' => 'internal'\n ]\n ]\n );\n\n $providers = [];\n foreach ($config as $key => $providerConfig) {\n $providers[$key] = self::buildProvider($key, $providerConfig);\n }\n self::$instance = new self($providers);\n }\n\n return self::$instance;\n }", "public function client()\n {\n if (!self::$client) {\n if (is_null($this->subAccount)) {\n MailLog::info(\"Using master account\");\n self::$client = new \\SendGrid($this->api_key);\n } else {\n MailLog::info(\"Using subaccount {$this->subAccount->getSubAccountUsername()}\");\n self::$client = new \\SendGrid($this->subAccount->api_key);\n }\n\n }\n\n return self::$client;\n }", "public function getWssClient() {\n\t\tif ( ! $this->wssClient ) {\n\t\t\t$this->wssClient = new Client( \"wss://socket.bittrex.com/signalr/connect?transport=webSockets&clientProtocol=1.5&connectionToken=GdZ4Rx88j7PkWtqp5ttcw1F%2FDGMFPBegN3KLQi7uK5GyeF5hCH9%2BiV8kPz0hyI%2B0OugNzGbwkoPjRiosWQBQACwZQx2ccxHcEYdev7UeZbjobRR0&connectionData=%5B%7B%22name%22%3A%22corehub%22%7D%5D&tid=3\",\n\t\t\t\t[\n\t\t\t\t\t'headers' =>\n\t\t\t\t\t\t[\n\t\t\t\t\t\t\t'user-agent' => self::$userAgent,\n\t\t\t\t\t\t\t'Cookie' => $this->cookies\n\t\t\t\t\t\t]\n\t\t\t\t]\n\t\t\t);\n\t\t\t$this->wssClient->receive();\n\t\t}\n\n\t\treturn $this->wssClient;\n\t}", "public function __construct()\n {\n $this->client = GuzzleFactory::make([\n 'base_uri' => 'https://min-api.cryptocompare.com/',\n ]);\n }", "protected function getHttp()\n\t{\n\t\treturn new \\Guzzle\\Http\\Client;\n\t}", "public function __construct()\n {\n\n // For Authenticating with Login Credentials\n\n //$this->username = config('whmcs.username');\n //$this->password = config('whmcs.password');\n\n // For Authenticating with API Credentials\n\n $this->api_identifier = config('whmcs.api_identifier');\n $this->api_secret = config('whmcs.api_secret');\n\n $this->api_access_key = config('whmcs.api_access_key');\n\n $this->response_type = strtolower(config('whmcs.response_type'));\n\n $this->client = new Client([\n 'base_uri' => config('whmcs.url'),\n 'timeout' => config('whmcs.timeout'),\n 'headers' => ['Accept' => 'application/json']\n ]);\n }", "private function getClient()\n {\n return new \\GuzzleHttp\\Client([\n 'base_uri' => $this->url,\n 'timeout' => 2.0,\n ]);\n }", "protected function createHttpClient()\n {\n $stack = HandlerStack::create();\n\n $middleware = new Oauth1([\n 'consumer_key' => $this->consumerKey,\n 'consumer_secret' => $this->consumerSecret,\n 'token' => $this->token,\n 'token_secret' => $this->tokenSecret\n ]);\n\n $stack->push($middleware);\n\n $client = new HttpClient([\n 'handler' => $stack\n ]);\n\n return $this->setHttpClient($client);\n }", "public static function create( $connect_token = null ) {\n\t\treturn new ApiClient(\n\t\t\tnew HttpClient(),\n\t\t\tUrlProvider::create( $connect_token )->get_api_url(),\n\t\t\tis_null( $connect_token ) ? new ConnectToken() : $connect_token\n\t\t);\n\t}", "public function getClient()\n {\n if (!$this->getAPIKey() || !$this->isEnabled())\n return null;\n\n if (!$this->client) {\n require_once __DIR__ . '/../Raygun4php/RaygunClient.php'; \n\n $this->client = new \\Raygun4php\\RaygunClient($this->getAPIKey(), $this->getAsync(), false);\n $this->client->SetVersion($this->getVersion());\n\n $customer = Mage::helper('customer')->getCustomer();\n\n if ($customer !== null) {\n $this->client->SetUser(\n $customer->getEmail(), // Unique ID\n $customer->getFirstname(), // First name\n $customer->getName(), // Full name\n $customer->getEmail(), // Email\n ($customer->getEmail() == null), // Anonymous?\n null // UUID\n );\n }\n }\n\n return $this->client;\n }", "public function getHttp()\n\t{\n\t\t$client = new \\Guzzle\\Http\\Client;\n\n\t\t$client->setSslVerification(false, false, false);\n\n\t\treturn $client;\n\t}", "public function getClient()\r\n\t{\r\n\t\tif ($this->_client != NULL)\r\n\t\t\treturn $this->_client;\r\n\r\n\t\tif ($this->useRackspace)\r\n\t\t{\r\n\t\t\tif ($this->identity == NULL)\r\n\t\t\t\t$this->identity = OpenCloud\\Rackspace::US_IDENTITY_ENDPOINT;\r\n\r\n\t\t\t$this->_client = new OpenCloud\\Rackspace($this->identity, array(\r\n\t 'username' => $this->username,\r\n\t 'apiKey' => $this->apiKey\r\n\t ));\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$this->_client = new OpenCloud\\OpenStack($this->identity, array(\r\n\t 'username' => $this->username,\r\n\t 'apiKey' => $this->apiKey\r\n\t\t\t));\r\n\t\t}\r\n\r\n\t\treturn $this->_client;\r\n\t}", "protected function build() \n {\n $client = new Zend_Http_Client();\n $config = array('timeout' => 60);\n $client->setConfig($config);\n $client\n ->setUri($this->getEndpoint())\n ->setMethod($this->getMethod())\n ->setHeaders($this->getHeaders());\n\n return $client;\n }", "protected function createConnection($resource)\n {\n return new Connection($this, $resource);\n }", "public function connect()\n {\n if ( ! $this->_connection) {\n $this->_connection = _class('pubsub_driver_' . $this->driver, 'classes/pubsub/');\n $this->_connection->connect();\n }\n return $this->_connection;\n }", "static function createHttp($host, $port,\n $connectorName='mysource', $connectorType='papi',\n $login=false, $password=false) {\n return new PushAPIv4($host, $port, $connectorName, $connectorType,\n $login=false, $password=false);\n }", "private function initializeClient()\n {\n $this->client = new Client($this->guzzleConfig);\n\n if ($this->isInDebugMode()) {\n $this->setDebugger();\n }\n if ($this->needsAuthentication()) {\n $this->authenticate();\n }\n\n return $this->client;\n }", "public function getClient()\n {\n if (!$this->client instanceof API) {\n $this->client = new API(\n $this->config->get('yandexmoney.access_token')\n );\n }\n return $this->client;\n }", "public function __construct(StreamWrapperConfiguration $config = NULL) {\n if (!$config) {\n if (static::$defaultConfig) {\n $config = static::$defaultConfig;\n }\n else {\n // @codeCoverageIgnoreStart\n $config = StreamWrapperConfiguration::fromDrupalVariables();\n // @codeCoverageIgnoreEnd\n }\n }\n\n $this->config = $config;\n\n if (!$this->getClient()) {\n /** @var S3Client $name */\n $name = static::$s3ClientClass;\n $this->setClient($name::factory(array('region' => $this->config->getRegion())));\n }\n\n if ($this->config->isCaching() && !static::$cache) {\n static::attachCache(\n new DoctrineCacheAdapter(new ChainCache([new ArrayCache(), new Cache()])),\n $this->config->getCacheLifetime()\n );\n }\n }", "private function getClient()\n {\n return new Client([\n 'base_uri' => $this->apiUrl,\n 'headers' => [\n 'Accept' => 'application/vnd.Creative Force.v2.1+json',\n 'x-api-key' => $this->apiKey,\n ],\n 'http_errors' => false,\n ]);\n }", "static function getInstance()\n {\n if (!$instance) {\n $instance = new Connection(); //Chamando o construtor dessa classe\n }\n return $instance;\n }", "public static function getInstance($connect = false, $type = self::MARKETO)\n {\n require_once('modules/Connectors/connectors/sources/ext/soap/marketo/marketo.php');\n require_once('modules/Connectors/connectors/sources/ext/soap/marketo/opportunity/opportunity.php');\n\n switch ($type) {\n case self::MARKETO:\n self::$instance = new ext_soap_marketo();\n break;\n case self::OPPORTUNITY:\n self::$instance = new ext_soap_marketo_opportunity();\n break;\n default:\n throw new SugarApiExceptionNotFound(\"$type is not a valid type of marketo connector\");\n }\n\n if ($connect) {\n self::$instance->init();\n }\n\n return self::$instance;\n }", "public function connect()\n {\n if ($this->getOptions()->isPersistent()) {\n $this->getResource()->pconnect();\n } else {\n $this->getResource()->connect();\n }\n\n return $this;\n }", "public static function getConnection()\n {\n // Check if instance already exists\n if(!isset(self::$instance))\n self::$instance = new self(self::get('dsn'), self::get('username'), self::get('password'));\n\n // Return Connection (mysqli Object)\n return self::$connection;\n }", "public function createConnection()\n {\n $client = DatabaseDriver::create($this->getConfig());\n\n return $client;\n }", "public function getClient()\n {\n if ($this->_client === null) {\n\n if (!$this->_apiEndPoint) {\n throw new Exception('Api endpoint is not configured.');\n }\n\n $this->_client = new Varien_Http_Client($this->_apiEndPoint);\n $this->_client->setHeaders(array('Content-Type: text/xml'));\n $this->_client->setConfig(array('timeout' => 45));\n }\n\n return $this->_client;\n }", "public function __construct(Credentials $apiCredentials, $endpointUrl = null)\n {\n $this->apiCredentials = $apiCredentials;\n if (!empty($endpointUrl)) {\n $this->endpointUrl = $endpointUrl;\n }\n return $this;\n }", "public function __construct() {\n\t\t\t$this->getConfig();\n\t\t\t$this->buildShopUrl();\n\n\t\t\treturn $this;\n\t\t}", "function __construct() {\n $connector = new DbConnection();\n $conn = $connector->connect(); \n }", "private function getClient(): Mailchimp\n {\n $settings = Plugin::$plugin->getSettings();\n return new Mailchimp(Craft::parseEnv($settings->getApiKey()));\n }", "public function connection()\n\t{\n\t\t$config = array(\n\t\t\t'driver' => 'mysql',\n\t\t\t'host' => $this->parser->get('esoTalk.database.host'),\n\t\t\t'database' => $this->parser->get('esoTalk.database.dbName'),\n\t\t\t'username' => $this->parser->get('esoTalk.database.user'),\n\t\t\t'password' => $this->parser->get('esoTalk.database.password'),\n\t\t\t'charset' => 'utf8',\n\t\t\t'collation' => 'utf8_unicode_ci',\n\t\t\t'prefix' => $this->parser->get('esoTalk.database.prefix'),\n\t\t);\n\n\t\treturn $this->factory->make($config, 'esotalk-auth');\n\t}", "public static function factory($config = array())\n {\n $default = array(\n 'api_version' => '1',\n 'base_url' => 'https://{subdomain}.desk.com/api/v{api_version}/'\n );\n\n $required = array(\n 'consumer_key',\n 'consumer_secret',\n 'token',\n 'token_secret',\n );\n\n // Subdomain is required if the base URL is the default (not set), or\n // if it contains {subdomain} somewhere.\n if (!isset($config['base_url']) || strpos($config['base_url'], '{subdomain}') !== false) {\n $required[] = 'subdomain';\n }\n\n // Construct self, using parent::factory()\n $config = Collection::fromConfig($config, $default, $required);\n $client = parent::factory($config);\n\n self::addServiceDescription($client);\n self::addOAuthPlugin($client, $config);\n\n $client->addSubscriber(new PreValidator());\n\n return $client;\n }", "public function connect()\r\n\t{\r\n\t\t$options = array(\r\n\t\t\t'driver' => $this->_driver,\r\n\t\t\t'host' => $this->_host,\r\n\t\t\t'user' => $this->_username,\r\n\t\t\t'password' => $this->_password,\r\n\t\t\t'database' => $this->_database,\r\n\t\t\t'prefix' => $this->_prefix\r\n\t\t);\r\n\t\t\r\n\t\t$this->_instance = JFlappConnectorTypeDatabase::getInstance( $options );\r\n\t\r\n\t\treturn $this->_instance;\r\n\t}", "public function connect()\n {\n $this->connection = mysqli_connect(\n $this->settings['host'],\n $this->settings['user'],\n $this->settings['pass'],\n $this->settings['dbname'],\n $this->settings['port']\n );\n \n if (!$this->connection) {\n throw new \\Exception($this->getLastError());\n }\n\n return $this;\n }", "public function consumer ()\n {\n return new Consumer($this->url, $this->port);\n }", "public function __construct()\n {\n //setup connection\n $this->api = new Connector();\n $this->api->setAuth(config('swimtimes.username'), config('swimtimes.password'));\n\n //setup style json file for fast calculation styles\n $this->createStylesJsonCache();\n }", "function getClient()\n {\n ini_set(\"soap.wsdl_cache_enabled\", \"0\");\n $client = new SoapClient(\"http://smeapps.mobitel.lk:8585/EnterpriseSMSV3/EnterpriseSMSWS?wsdl\");\n return $client;\n }", "public function __construct()\n\t{\n\t\t$this->oauth = new Coinbase_OAuth(\n\t\t\tConfig::get('settings.client_id'),\n\t\t\tConfig::get('settings.client_secret'),\n\t\t\tConfig::get('settings.redirect_uri')\n\t\t);\n\n\t}", "public function connect()\n {\n return $this->connector->connect();\n }", "private function client()\n {\n if (null === $this->client) {\n // https://github.com/deskpro/deskpro-api-client-php\n $client = new Client(['connect_timeout' => 2]);\n $this->client = new DeskproClient($this->config['deskpro_url'], $client);\n $authKey = explode(':', $this->config['deskpro_api_code_key']);\n $this->client->setAuthKey(...$authKey);\n }\n\n return $this->client;\n }", "public function __construct()\n {\n parent::setup();\n\n $this->client = new Client([\n \"base_uri\" => self::URL\n ]);\n }", "public function __construct() {\n parent::__construct();\n $this->client = new Client( [\n 'timeout' => 1000,\n 'verify' => false,\n 'request.options' => [\n 'proxy' => 'tcp://113.160.234.147:47469',\n ],\n ] );\n }", "public function __construct()\n {\n parent::__construct();\n $this->_client = $this->setEndPoint(self::END_POINT);\n }", "private function connectServer() : S3Client\n {\n return new S3Client($this->storageConfig['s3']);\n }", "public static function initialize($host, $user, $pass) {\r\n self::$instance = new GFSalsaConnector($host, $user, $pass);\r\n return self::$instance;\r\n }", "public function http()\n {\n if (!$this->http) {\n $this->http = new GuzzleClient([\n 'base_uri' => $this->baseUri(),\n ]);\n }\n\n return $this->http;\n }", "protected function createConnection(array $config)\n {\n return $this->factory->make($config);\n }", "protected function createConnection(array $config)\n {\n return $this->factory->make($config);\n }", "protected function createConnection(array $config)\n {\n return $this->factory->make($config);\n }", "protected function createConnection(array $config)\n {\n return $this->factory->make($config);\n }" ]
[ "0.7337767", "0.61338425", "0.58795613", "0.5653561", "0.5640269", "0.5604195", "0.5602042", "0.55624455", "0.55569685", "0.5554435", "0.5530111", "0.5485125", "0.544787", "0.5436559", "0.5420473", "0.54167116", "0.5388799", "0.53811467", "0.5368109", "0.5362011", "0.53414065", "0.5304319", "0.52966", "0.5294394", "0.52863604", "0.52731824", "0.52577955", "0.5247373", "0.5246363", "0.5233198", "0.5222642", "0.521974", "0.52181506", "0.52131855", "0.52125347", "0.52122784", "0.52052087", "0.51902163", "0.5185076", "0.5172509", "0.5166558", "0.51429117", "0.51414603", "0.5129267", "0.51265144", "0.5122443", "0.5121141", "0.5104936", "0.51017183", "0.50777704", "0.5077667", "0.5075839", "0.50731105", "0.50691795", "0.5060476", "0.50591916", "0.5058806", "0.5057603", "0.5051068", "0.50507265", "0.504988", "0.504692", "0.50467336", "0.50438195", "0.50398034", "0.5036316", "0.50294405", "0.5018129", "0.5018079", "0.50137013", "0.49988922", "0.49985912", "0.49927706", "0.49923402", "0.49760842", "0.49653494", "0.49646914", "0.4964003", "0.49501604", "0.49466583", "0.49420053", "0.4937559", "0.49317908", "0.49296257", "0.4917511", "0.49164665", "0.491442", "0.4913083", "0.48960397", "0.48893678", "0.48848024", "0.4883654", "0.48798573", "0.48782828", "0.48748282", "0.4873061", "0.48721117", "0.4863073", "0.4863073", "0.4863073", "0.4863073" ]
0.0
-1
Get a singleton instance of the connector. If you will be authenticating with only a single set of credentials, fetching a singleton may be simpler for your code to manage than creating your own instance object which you are required to manage by hand. If, however, you need multiple connectors in order to connect with different sets of credentials, you should call the constructor to obtain individual SilverpopConnector objects. Note that this method is implemented with "static" not "self", so if you extend the connector to add your own functionality, you can continue to use the singleton provided by this method by calling YourChildClassName::getInstance(), but you will need to provide a "protected static $instance=null;" property in your child class for this method to reference.
public static function getInstance($baseUrl='http://api.pilot.silverpop.com', $dateFormat='MM/dd/yyyy', $timeout=10.0) { if (static::$instance == null) { static::$instance = new static($baseUrl); } return static::$instance; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function instance() {\n if (static::$instance === null) {\n static::$instance = static::resolve_connection();\n }\n\n return static::$instance;\n }", "static function getInstance()\n {\n if (!$instance) {\n $instance = new Connection(); //Chamando o construtor dessa classe\n }\n return $instance;\n }", "static public function getInstance()\n\t{\n\t\treturn parent::getInstance();\n\t}", "public static function getInstance() {\n\t\treturn parent::getInstance(__CLASS__); \n\t}", "public function getDatabaseConnectorInstance() {\n return new DatabaseConnector($this->config['general']['db']);\n }", "protected function createConnector()\n {\n // Load credentials:\n $iid = isset($this->libGuidesConfig->General->iid)\n ? $this->libGuidesConfig->General->iid : null;\n // Pick version:\n $ver = isset($this->libGuidesConfig->General->version)\n ? $this->libGuidesConfig->General->version : 1;\n // Build HTTP client:\n $client = $this->serviceLocator->get('VuFind\\Http')->createClient();\n $timeout = isset($this->libGuidesConfig->General->timeout)\n ? $this->libGuidesConfig->General->timeout : 30;\n $client->setOptions(array('timeout' => $timeout));\n $connector = new Connector($iid, $client, $ver);\n $connector->setLogger($this->logger);\n return $connector;\n }", "public static function getInstance() {\n\t\treturn parent::getInstance(__CLASS__);\n\t}", "public static function instance()\n {\n // If the DAO has not been loaded yet, we initialize it now.\n if (self::$m_dao === null)\n {\n global $g_comp_database;\n\n self::$m_dao = new isys_auth_dao($g_comp_database);\n } // if\n\n if (self::$m_instance === null)\n {\n self::$m_instance = new self;\n } // if\n\n return self::$m_instance;\n }", "public static function instance()\n {\n // If the DAO has not been loaded yet, we initialize it now.\n if (self::$m_dao === null)\n {\n global $g_comp_database;\n\n self::$m_dao = new isys_auth_dao($g_comp_database);\n } // if\n\n if (self::$m_instance === null)\n {\n self::$m_instance = new self;\n } // if\n\n return self::$m_instance;\n }", "public static function getInstance() {\n\t\tself::init();\n\t\treturn parent::getInstance();\n\t}", "public static function getConnection()\n {\n return static::getInstance();\n }", "public static function getInstance(){\r\n\r\n\t\t// This method is overriden from the singleton one simply to get correct\r\n\t\t// autocomplete annotations when returning the instance\r\n\t\t$instance = parent::getInstance();\r\n\r\n\t\treturn $instance;\r\n\t}", "public static function getInstance()\n {\n if (is_null(static::$_instance)) {\n static::$_instance = static::_getConnection();\n }\n\n return static::$_instance;\n }", "public function getConnector()\r\n {\r\n return $this->connector;\r\n }", "public static function Instance()\n {\n // until $connection is null until it is set for the first time\n static $connection = null;\n\n // so if $connection is null, then lets set it\n if ($connection === null) {\n\n try {\n\n // we connect to the database via the constants loaded at the start\n $connection = new PDO(\n 'mysql:host='. MY_DATABASE_HOSTNAME .';dbname='. MY_DATABASE_DATABASE .';charset=utf8', \n MY_DATABASE_USERNAME, // username\n MY_DATABASE_PASSWORD // password\n );\n $connection->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n \n } catch (PDOException $e) {\n $dbOutput = [\n 'status' => 'error',\n 'message' => 'Unable to connect to the database server: ' . \n $e->getMessage() . ' in ' . $e->getFile() . ':' . $e->getLine()\n ];\n Logging::writeToFile( json_encode($dbOutput) );\n }\n\n }\n\n // send the singleton version of the connection back\n return $connection;\n }", "public function getConnector();", "private function connector(){\n switch ($this->connection_type) {\n case self::CONN_TYPE_PDO:\n return $this->pdo;\n break;\n\n case self::CONN_TYPE_MYSQLI:\n return $this->mysqli;\n break;\n\n default:\n echo \"Error: connection type '\".$this->connection_type.\"' not suppordted\" . PHP_EOL;\n exit;\n break;\n }\n }", "public static function getInstance() {\n if (is_null(self::$_instance)) {\n self::$_instance = self::bootstrap();\n }\n \n return self::$_instance;\n }", "public static function getInstance()\n {\n if (self::$instance === null) {\n $config = Config::getInstance()->get(\n 'php-censor.security.auth_providers',\n [\n 'internal' => [\n 'type' => 'internal'\n ]\n ]\n );\n\n $providers = [];\n foreach ($config as $key => $providerConfig) {\n $providers[$key] = self::buildProvider($key, $providerConfig);\n }\n self::$instance = new self($providers);\n }\n\n return self::$instance;\n }", "public static function getInstance()\n {\n if (true === is_null(self::$_instance)) {\n ReporticoApp::backtrace();\n echo \"Class Authenticator not initialized\";\n die;\n }\n return self::$_instance;\n }", "public static function getInstance()\n {\n return self::$instance ?? self::getNewInstance();\n }", "public function getConnectorManager()\n {\n if (empty($this->connectorManger)) {\n $this->connectorManager = new ConnectorManager();\n }\n return $this->connectorManager;\n }", "public static function getInstance(){\n\t\treturn parent::_getInstance(get_class());\n\t}", "public static function getInstance() {\n\n\t\t// check for self instance\n\t\tif ( ! self::$instance ) {\n\t\t\tself::$instance = new self;\n\t\t}\n\n\t\t// return the instance\n\t\treturn self::$instance;\n\t}", "public function getInstance()\n {\n return self::$instance;\n }", "public function getInstance()\n {\n return $this->instance;\n }", "public function getInstance()\n {\n return $this->instance;\n }", "public function getInstance()\n {\n return $this->instance;\n }", "public function getInstance()\n {\n return $this->instance;\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 }", "public static function getInstance(): self;", "public static function getInstance() {\n\t\tif(!self::$s_instance) { // If no instance then make one\n\t\t\tself::$s_instance = new self();\n\t\t}\n\t\treturn self::$s_instance;\n\t}", "public static function getInstance() {\n\t\tif(!self::$s_instance) { // If no instance then make one\n\t\t\tself::$s_instance = new self();\n\t\t}\n\t\treturn self::$s_instance;\n\t}", "public static function getInstance() {\n\t\tif(!self::$s_instance) { // If no instance then make one\n\t\t\tself::$s_instance = new self();\n\t\t}\n\t\treturn self::$s_instance;\n\t}", "public static function getInstance()\n {\n if (!isset(self::$instance)) {\n self::$instance = new self;\n }\n \n self::$instance->startSession();\n \n return self::$instance;\n }", "public function getInstance() {\n\t\treturn $this->instance;\n\t}", "public static function getInstance()\n {\n return static::$instance;\n }", "public function getInstance()\n {\n return $this;\n }", "public static function GetConnection() : SELF\r\n {\r\n static $dbInstance = NULL;\r\n\r\n if($dbInstance === NULL)\r\n {\r\n $dbInstance = new static();\r\n }\r\n\r\n return($dbInstance);\r\n }", "public static function getInstance()\n {\n return self::$instance;\n }", "public static function getInstance()\n {\n return self::$instance;\n }", "public static function getInstance() {\n return self::$instance;\n }", "public static function getInstance() {\n if (!self::$instance instanceof self) {\n self::$instance = new self;\n }\n return self::$instance;\n }", "public static function getInstance()\r\n {\r\n // Store a reference of this class if not initiated\r\n if (!isset(self :: $_self))\r\n {\r\n // Singleton creation\r\n self :: $_self = new self;\r\n }\r\n\r\n // Return singleton instance\r\n return self :: $_self;\r\n }", "public static function getInstance()\r\n {\r\n return static::$instance;\r\n }", "static public function getInstance() {\r\n\t\tstatic $instance;\r\n\t\tif (!isset($instance))\r\n\t\t\t$instance = new self();\r\n\t\treturn $instance;\r\n\t}", "static public function getInstance() {\r\n\t\tstatic $instance;\r\n\t\tif (!isset($instance))\r\n\t\t\t$instance = new self();\r\n\t\treturn $instance;\r\n\t}", "public static function getInstance(){\n if(!self::$_instance){\n self::$_instance = new self();\n }\n \n return self::$_instance;\n }", "public static function getInstance(){\n if(!isset(self::$_instance)){\n self::$_instance = new self();\n }\n\n return self::$_instance;\n }", "public\n\tstatic function getInstance() {\n\t\tif ( null == self::$instance ) {\n\t\t\tself::$instance = new self;\n\t\t}\n\n\t\treturn self::$instance;\n\t}", "public static function getInstance() {\n if (!self::$instance instanceof self) {\n self::$instance = new self;\n }\n return self::$instance;\n }", "public static function getInstance() {\n if (!self::$instance instanceof self) {\n self::$instance = new self;\n }\n return self::$instance;\n }", "public static function getInstance() {\n if (!self::$instance instanceof self) {\n self::$instance = new self;\n }\n return self::$instance;\n }", "public static function getInstance() {\n if (!self::$instance instanceof self) {\n self::$instance = new self;\n }\n return self::$instance;\n }", "public static function getInstance() {\n if (self::$_instance === null) {\n self::$_instance = new self;\n }\n \n return self::$_instance;\n }", "static public function getInstance()\n {\n if (is_null(self::$instance)) {\n self::$instance = new self();\n }\n \n return self::$instance;\n }", "public static function getInstance()\n {\n if (!isset(self::$instance))\n {\n self::$instance = new self; \n }\n\n return self::$instance;\n }", "public static function getInstance() {\n if (is_null(self::$_sInstance)) {\n self::$_sInstance = new self();\n }\n return self::$_sInstance;\n }", "public static function getInstance() {\n\t\twfProfileIn( 'BS::'.__METHOD__ );\n\t\tif ( self::$oInstance === null ) {\n\t\t\tif ( PHP_SAPI === 'cli' ) {\n\t\t\t\t$oDbr = wfGetDB( DB_SLAVE );\n\t\t\t\tif ( $oDbr->tableExists( 'bs_settings' ) ) {\n\t\t\t\t\tBsConfig::loadSettings();\n\t\t\t\t}\n\t\t\t}\n\t\t\t$aUrl = parse_url( BsConfig::get( 'MW::ExtendedSearch::SolrServiceUrl' ) );\n\n\t\t\tif ( empty( $aUrl['host'] ) || empty( $aUrl['port'] ) || empty( $aUrl['path'] ) ) {\n\t\t\t\twfProfileOut( 'BS::'.__METHOD__ );\n\t\t\t\tthrow new Exception( 'Creating instance of ' . __CLASS__ . ' not possible with these params:'\n\t\t\t\t\t.', $host='.( isset( $aUrl['host'] ) ? $aUrl['host'] : '' )\n\t\t\t\t\t.', $port='.( isset( $aUrl['port'] ) ? $aUrl['port'] : '' )\n\t\t\t\t\t.', $path='.( isset( $aUrl['path'] ) ? $aUrl['path'] : '' )\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t$oServer = new self( $aUrl['scheme'], $aUrl['host'], $aUrl['port'], $aUrl['path'] );\n\n\t\t\tself::$oInstance = $oServer;\n\t\t\twfProfileOut( 'BS::'.__METHOD__ );\n\n\t\t\treturn $oServer;\n\t\t}\n\n\t\twfProfileOut( 'BS::'.__METHOD__ );\n\t\treturn self::$oInstance;\n\t}", "public static function getInstance(){\r\n if(!isset(self::$_instance)) {\r\n self::$_instance = new self();\r\n }\r\n\r\n return self::$_instance;\r\n }", "public static function getConnection()\n {\n // Check if instance already exists\n if(!isset(self::$instance))\n self::$instance = new self(self::get('dsn'), self::get('username'), self::get('password'));\n\n // Return Connection (mysqli Object)\n return self::$connection;\n }", "public static function getInstance()\n {\n if (is_null(self::$_instance)) {\n self::$_instance = new self();\n }\n return self::$_instance;\n }", "public static function getInstance() {\r\n if ( is_null( self::$_instance ) ) {\r\n self::$_instance = new self();\r\n }\r\n return self::$_instance;\r\n }", "public static function getInstance ()\n {\n if ( is_null ( self::$instance) ) {\n self::$instance = new self();\n }\n return self::$instance;\n }", "public static function getInstance(){\n\t\tif(is_null(self::$instance)){\n\t\t\tself::$instance = new self;\n\t\t}\n\n\t\treturn self::$instance;\n\t}", "public static function getInstance() {\n if (!self::$_instance) {\n self::$_instance = new self;\n }\n return self::$_instance;\n }", "public function getInstance()\r\n {\r\n if (self::$instance === NULL) {\r\n self::$instance = new self;\r\n }\r\n\r\n return self::$instance;\r\n }", "public static function getInstance()\n /**/\n {\n if (is_null(self::$instance)) {\n self::$instance = new static();\n }\n\n return self::$instance;\n }", "public static function getInstance()\n {\n if (! self::$instance) {\n self::$instance = new self;\n }\n return self::$instance;\n }", "public static function getInstance(){\n\n if ( !isset(self::$instance)) {\n self::$instance = new self;\n }\n \n self::$instance->startSession();\n \n return self::$instance;\n }", "public static function getInstance(){\n\t\tif (!isset(self::$_instance)) {\n\t\t\t$c = __CLASS__;\n\t\t\tself::$_instance = new $c;\n\t\t\tself::$_instance->__construct();\n\t\t}\n\t\treturn self::$_instance;\n\t}", "public static function getInstance()\n {\n if (self::$_instance === NULL) {\n self::$_instance = new self;\n }\n return self::$_instance;\n }", "public static function getInstance() {\r\n if (!self::$instance instanceof self) {\r\n self::$instance = new self;\r\n }\r\n return self::$instance;\r\n }", "public static function getInstance() {\r\n if (!self::$instance instanceof self) {\r\n self::$instance = new self;\r\n }\r\n return self::$instance;\r\n }", "public static function getInstance()\n {\n if (null === self::$instance) {\n self::initInstance();\n }\n\n return self::$instance;\n }", "public static function getInstance()\n {\n if (! isset(self::$_instance)) {\n self::$_instance = new self();\n }\n return self::$_instance;\n }", "public static function getInstance() {\n if(!self::$_instance) { // If no instance then make one\n self::$_instance = new self();\n }\n return self::$_instance;\n }", "public static function getInstance() {\n if(!self::$_instance) { // If no instance then make one\n self::$_instance = new self();\n }\n return self::$_instance;\n }", "public static function getInstance() {\n if (!self::$_instance) { // If no instance then make one\n self::$_instance = new self();\n }\n return self::$_instance;\n }", "public function getConnector() {\n\treturn new Agel_Payment_Gateway_Qiwi_Connector();\n }", "public static function getInstance()\n {\n self::$instance === null and self::$instance = new self();\n return self::$instance;\n }", "public static function getSingleton()\n {\n if (self::$singleton === null)\n self::$singleton = new LoginHandler();\n\n return self::$singleton;\n }", "public static function getInstance() {\n\t\treturn self::$instance;\n\t}", "public static function getInstance() {\r\n\t\tif (null === self::$_instance) {\r\n\t\t\tself::$_instance = new self ( );\r\n\t\t}\r\n\t\t\r\n\t\treturn self::$_instance;\r\n\t}", "static function getInstance(){\r\n\r\n\t\tif(!isset(self::$instance)) self::$instance = new self();\r\n\t\treturn self::$instance;\r\n\t}", "public static function getInstance()\n {\n if (!self::$_instance) { // If no instance then make one\n self::$_instance = new self();\n }\n return self::$_instance;\n }", "public static function getInstance()\n {\n if (!self::$_instance) { // If no instance then make one\n self::$_instance = new self();\n }\n return self::$_instance;\n }", "public static function getInstance()\n {\n if (!self::$_instance) { // If no instance then make one\n self::$_instance = new self();\n }\n return self::$_instance;\n }", "public static function getInstance()\n\t{\n\t\tif (is_null (self::$_singleton))\n\t\t{\n\t\t\tself::$_singleton = new conexion;\n\t\t}\n\t\treturn self::$_singleton;\n\t}", "public static function getInstance()\n\t{\n\t\tif (is_null (self::$_singleton))\n\t\t{\n\t\t\tself::$_singleton = new conexion;\n\t\t}\n\t\treturn self::$_singleton;\n\t}", "static public function getInstance()\n {\n if (self::$instance === null) {\n self::$instance = new self();\n }\n\n return self::$instance;\n }", "public static function getInstance() {\n if(!self::$_instance) {\n // If no instance then make one\n self::$_instance = new self();\n }\n return self::$_instance;\n }", "public static function getInstance() {\n\n if (!isset(self::$instance)) {\n self::$instance = new self();\n }\n return self::$instance;\n }", "public static function get_instance() {\r\n // # If the single instance hasn't been set, set it now.\r\n if ( null == self::$instance ) {\r\n self::$instance = new self;\r\n }\r\n\r\n return self::$instance;\r\n }", "protected static function getConn() {\n if (!isset(self::$_conn)) {\n self::setConn(new SforcePartnerClient());\n self::useTheForce();\n }\n return self::$_conn;\n }", "public static function getInstance()\n {\n if (!self::$instance) { // If no instance then make one\n self::$instance = new self();\n }\n return self::$instance;\n }", "public static function getInstance()\n {\n if (!self::$instance) {\n return self::$instance = new self();\n }\n\n return self::$instance;\n }", "public static function getInstance()\n {\n if (is_null(self::$instance)) {\n self::$instance = new self();\n }\n return self::$instance;\n }", "static public function getInstance()\n {\n if (self::$instance == null)\n {\n self::$instance = new self;\n }\n return self::$instance;\n }", "public static function getInstance()\n {\n if (!isset(static::$instance)) {\n static::$instance = new static;\n }\n\n return static::$instance;\n }", "static public function getInstance() {\n\t\treturn\n\t\t\tself::$instance===null\n\t\t\t\t? self::$instance = new static()//new self()\n\t\t\t\t: self::$instance;\n\t}" ]
[ "0.6488335", "0.6382037", "0.63085824", "0.6282427", "0.62810135", "0.6280425", "0.6279016", "0.62561226", "0.62561226", "0.62553424", "0.62490207", "0.62388253", "0.62191755", "0.618432", "0.6157511", "0.6155407", "0.61261684", "0.61245936", "0.61242557", "0.6112829", "0.6109282", "0.6072899", "0.60660034", "0.60541326", "0.60243964", "0.60220885", "0.60220885", "0.60220885", "0.60220885", "0.6015858", "0.60017616", "0.5996193", "0.5996193", "0.5996193", "0.5993983", "0.5993154", "0.59872943", "0.5975125", "0.59666157", "0.596585", "0.596585", "0.5960325", "0.5942962", "0.59426457", "0.5942606", "0.5937968", "0.5937968", "0.59357256", "0.59335", "0.59326357", "0.59320587", "0.59320587", "0.59320587", "0.59320587", "0.5931637", "0.59292984", "0.59288716", "0.5922631", "0.5920141", "0.5914676", "0.591282", "0.59109455", "0.59105647", "0.59103864", "0.5909485", "0.5908336", "0.5907041", "0.59064597", "0.59025973", "0.5900046", "0.5899157", "0.5896681", "0.5896608", "0.5896608", "0.5895348", "0.58915776", "0.5890779", "0.5890779", "0.58907545", "0.58893406", "0.5888034", "0.5887052", "0.5885039", "0.5882813", "0.587962", "0.58779794", "0.58779794", "0.58779794", "0.5877186", "0.5877186", "0.5876796", "0.5871042", "0.5870031", "0.58694786", "0.5869242", "0.5868773", "0.58685124", "0.5864048", "0.5861255", "0.58604914", "0.5859625" ]
0.0
-1
Performs Silverpop authentication using the supplied REST credentials, or with the cached credentials if none are supplied. Any new credentials will be cached for the next request. Overridden to return the SilverpopGuzzleXmlConnector.
public function authenticateXml($username=null, $password=null) { $this->username = empty($username) ? $this->username : $username; $this->password = empty($password) ? $this->password : $password; $this->xmlConnector = SilverpopGuzzleXmlConnector::getInstance(); $this->xmlConnector->authenticate( $this->username, $this->password); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function get_auth() {\n\n\t\t$options = array ('trace' => true, 'style' => SOAP_RPC, 'use' => SOAP_ENCODED);\n\n\t\t$params = array();\n\t\t$params [\"credential\"][\"Type\"] = $this->type;\n\t\t$params [\"credential\"][\"Username\"] = $this->username;\n\t\t$encodedPassword = md5(mb_convert_encoding($this->password, 'utf-16le', 'utf-8'));\n\t\t$params [\"credential\"][\"Password\"] = $this->password;\n\t\t$params [\"credential\"][\"ApplicationId\"] = $this->api_key;\n\n\t\t$params [\"credential\"][\"IdentityId\"] = $this->identity;\n\n\t\t//$authentication = new SoapClient ( \"https://webservices.24sevenoffice.com/authenticate/authenticate.asmx?wsdl\", $options );\n\t\t$authentication = new SoapClient ( \"https://api.24sevenoffice.com/authenticate/v001/authenticate.asmx?wsdl\", $options );\n\n\t\t$login = true;\n\n\t\tif (!empty($_SESSION['ASP.NET_SessionId']))\n\t\t{\n\t\t \n\t\t $authentication->__setCookie(\"ASP.NET_SessionId\", $_SESSION['ASP.NET_SessionId']);\n\t\t try\n\t\t {\n\t\t $login = !($authentication->HasSession()->HasSessionResult);\n\t\t }\n\t\t catch ( SoapFault $fault ) \n\t\t {\n\t\t $login = true;\n\t\t }\n\n\t\t}\n\n\t\tif( $login )\n\t\t{\n\t\t\t\n\t\t $result = ($temp = $authentication->Login($params));\n\t\t // set the session id for next time we call this page\n\t\t $_SESSION['ASP.NET_SessionId'] = $result->LoginResult;\n\t\t // each seperate webservice need the cookie set\n\t\t $authentication->__setCookie(\"ASP.NET_SessionId\", $_SESSION['ASP.NET_SessionId']);\n\t\t // throw an error if the login is unsuccessful\n\n\t\t\t/*echo \"<pre>\";\n\t\t\tprint_r( $authentication );\n\t\t\techo \"</pre>\";*/\n\t\t\t\n\t\t if($authentication->HasSession()->HasSessionResult == false)\n\t\t throw new SoapFault(\"0\", \"Invalid credential information.\");\n\t\t}\n\n\t}", "protected function getService()\n {\n return $this\n ->getLocator()->get('api')\n ->setUserCredentials(\n $this->getRequest()->server()->get('PHP_AUTH_USER', null),\n $this->getRequest()->server()->get('PHP_AUTH_PW', null)\n );\n }", "public function makeAuth()\n {\n $url = $this->environment->getApiUrl() . \"auth/oauth/v2/token\";\n\n $client = new Client();\n\n try {\n $guzzleReturn = $client->request('POST', $url, [\n 'headers' => [\n 'Authorization' => 'Basic ' . $this->authString\n ],\n 'form_params' => [\n 'scope' => 'oob',\n 'grant_type' => 'client_credentials',\n ]\n ]);\n\n $return = json_decode($guzzleReturn->getBody(), true);\n\n $this->getnetResponse = new GetNetResponse(true, $guzzleReturn->getStatusCode(), '');\n\n $this->accessToken = $return['access_token'];\n $this->tokenType = $return['token_type'];\n $this->expiresIn = $return['expires_in'];\n $this->scope = $return['scope'];\n\n } catch (RequestException $e) {\n $this->getnetResponse = new GetNetResponse(false, $e->getCode(), $e->getMessage());\n }\n\n return $this;\n }", "protected function _getOAuth () {\n\n\t\t$callback = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];\n\t\t$encrypter = new \\Dropbox\\OAuth\\Storage\\Encrypter(self::encrypter_secret);\n\t\t$storage = new \\Dropbox\\OAuth\\Storage\\Session($encrypter);\n\n\t\t// spoof storage using token stored with plugin\n\t\tif ($this->is_authorized()) {\n\t\t\t$storage->set($this->_plugin->setting(self::token_setting), 'access_token');\n\t\t}\n\n\t\t$OAuth = new \\Dropbox\\OAuth\\Consumer\\Curl(self::consumer_key, self::consumer_secret, $storage, $callback);\n\n\t\treturn $OAuth;\n\t}", "protected function authenticate()\n\t{\n\t\treturn $this->client;\n\t}", "protected function createAuthenticatedClient()\n {\n $client = static::createClient();\n\n $client->request(\n 'POST',\n '/api/login_check',\n array(\n '_username' => 'myphone',\n '_password' => 'phono'\n )\n );\n\n $data = json_decode($client->getResponse()->getContent(), true);\n\n $client = static::createClient();\n $client->setServerParameter('HTTP_Authorization', sprintf('Bearer %s', $data['token']));\n\n return $client;\n }", "private function auth()\n {\n if (!$this->username)\n {\n throw new PhpOpenSIPsException(\"Missing username\");\n }\n \n if (!$this->password)\n {\n throw new PhpOpenSIPsException(\"Missing password\");\n }\n \n // realm\n $result = array();\n if (!preg_match('/^Proxy-Authenticate: .* realm=\"(.*)\"/imU',$this->response, $result))\n {\n throw new PhpOpenSIPsException(\"Can't find realm in proxy-auth\");\n }\n \n $realm = $result[1];\n \n // nonce\n $result = array();\n if (!preg_match('/^Proxy-Authenticate: .* nonce=\"(.*)\"/imU',$this->response, $result))\n {\n throw new PhpOpenSIPsException(\"Can't find nonce in proxy-auth\");\n }\n \n $nonce = $result[1];\n \n $ha1 = md5($this->username.':'.$realm.':'.$this->password);\n $ha2 = md5($this->method.':'.$this->uri);\n \n $res = md5($ha1.':'.$nonce.':'.$ha2);\n \n $this->auth = 'Proxy-Authorization: Digest username=\"'.$this->username.'\", realm=\"'.$realm.'\", nonce=\"'.$nonce.'\", uri=\"'.$this->uri.'\", response=\"'.$res.'\", algorithm=MD5';\n }", "abstract public function getCredentials();", "public function getCredentialsFetcher()\n {\n if ($this->credentialsFetcher) {\n return $this->credentialsFetcher;\n }\n\n if ($this->keyFile) {\n return CredentialsLoader::makeCredentials($this->scopes, $this->keyFile);\n }\n\n return ApplicationDefaultCredentials::getCredentials($this->scopes, $this->authHttpHandler);\n }", "public static function auth()\n {\n return (new Authenticator(request()));\n }", "protected function shoppersLogin($username = '[email protected]', $password = 'lolamarket')\n {\n $client = static::createClient();\n $client->request(\n 'POST',\n '/shoppersapi/login_check',\n array(),\n array(),\n array('CONTENT_TYPE' => 'application/json'),\n json_encode(array(\n 'username' => $username,\n 'password' => $password,\n ))\n );\n\n $data = json_decode($client->getResponse()->getContent(), true);\n\n $client = static::createClient();\n $client->setServerParameter('HTTP_Authorization', sprintf('Bearer %s', $data['token']));\n\n return $client;\n }", "private function auth()\n {\n if (!$this->username)\n {\n throw new PhpSIPException(\"Missing username\");\n }\n \n if (!$this->password)\n {\n throw new PhpSIPException(\"Missing password\");\n }\n \n // realm\n $result = [];\n if (!preg_match('/^Proxy-Authenticate: .* realm=\"(.*)\"/imU',$this->response, $result))\n {\n throw new PhpSIPException(\"Can't find realm in proxy-auth\");\n }\n \n $realm = $result[1];\n \n // nonce\n $result = [];\n if (!preg_match('/^Proxy-Authenticate: .* nonce=\"(.*)\"/imU',$this->response, $result))\n {\n throw new PhpSIPException(\"Can't find nonce in proxy-auth\");\n }\n \n $nonce = $result[1];\n \n $ha1 = md5($this->username.':'.$realm.':'.$this->password);\n $ha2 = md5($this->method.':'.$this->uri);\n \n $res = md5($ha1.':'.$nonce.':'.$ha2);\n \n $this->auth = 'Proxy-Authorization: Digest username=\"'.$this->username.'\", realm=\"'.$realm.'\", nonce=\"'.$nonce.'\", uri=\"'.$this->uri.'\", response=\"'.$res.'\", algorithm=MD5';\n }", "public function authenticate() {\n $id = $this->_id;\n if (!empty($id)) {\n $consumer = new Zend_OpenId_Consumer($this->_storage);\n $consumer->setHttpClient($this->_httpClient);\n /* login() is never returns on success */\n if (!$this->_check_immediate) {\n if (!$consumer->login($id,\n $this->_returnTo,\n $this->_root,\n $this->_extensions,\n $this->_response)) {\n return new Zend_Auth_Result(\n Zend_Auth_Result::FAILURE,\n $id,\n [\"Authentication failed\", $consumer->getError()]);\n }\n } else {\n if (!$consumer->check($id,\n $this->_returnTo,\n $this->_root,\n $this->_extensions,\n $this->_response)) {\n return new Zend_Auth_Result(\n Zend_Auth_Result::FAILURE,\n $id,\n [\"Authentication failed\", $consumer->getError()]);\n }\n }\n } else {\n $params = (isset($_SERVER['REQUEST_METHOD']) &&\n $_SERVER['REQUEST_METHOD']=='POST') ? $_POST: $_GET;\n $consumer = new Zend_OpenId_Consumer($this->_storage);\n $consumer->setHttpClient($this->_httpClient);\n if ($consumer->verify(\n $params,\n $id,\n $this->_extensions)) {\n return new Zend_Auth_Result(\n Zend_Auth_Result::SUCCESS,\n $id,\n [\"Authentication successful\"]);\n } else {\n return new Zend_Auth_Result(\n Zend_Auth_Result::FAILURE,\n $id,\n [\"Authentication failed\", $consumer->getError()]);\n }\n }\n }", "public function getCredentials()\n { return $this->get('credentials'); }", "public function login()\n {\n $token = $this->guzzleClient()->post($this->getTokenBaseUrl(), [\n 'form_params' => [\n 'grant_type' => 'password',\n 'client_id' => $this->config['client_id'],\n 'client_secret' => $this->config['client_secret'],\n 'username' => $this->config['username'],\n 'password' => $this->config['password'],\n 'redirect_uri' => $this->getRedirectUri()\n ]\n ]);\n\n $token = $this->toArray($token->getBody());\n $this->setToken($token['access_token']);\n $this->setRefreshToken($token['refresh_token']);\n $this->setExpiresAt(strtotime('now') + $token['expires_in']);\n\n return $this;\n }", "protected function createHttpClient(){\n \t\n\t\trequire_once(INSTALL_PATH.\"/server/classes/class.HttpClient.php\");\n\t\t$httpClient = new HttpClient($this->host);\n\t\t$httpClient->cookie_host = $this->host;\n\t\t$httpClient->timeout = 50;\n\t\tAJXP_Logger::debug(\"Creating Http client\", array());\n\t\t//$httpClient->setDebug(true);\n\t\tif(!$this->use_auth){\n\t\t\treturn $httpClient;\n\t\t}\n\t\t\n\t\t$uri = \"\";\n\t\tif($this->auth_path != \"\"){\n\t\t\t$httpClient->setAuthorization($this->user, $this->password);\t\t\t\n\t\t\t$uri = $this->auth_path;\n\t\t}\n\t\tif(!isSet($_SESSION[\"AJXP_REMOTE_SESSION\"])){\t\t\n\t\t\tif($uri == \"\"){\n\t\t\t\t// Retrieve a seed!\n\t\t\t\t$httpClient->get($this->path.\"?get_action=get_seed\");\n\t\t\t\t$seed = $httpClient->getContent();\n\t\t\t\t$user = $this->user;\n\t\t\t\t$pass = $this->password;\n\t\t\t\t$pass = md5(md5($pass).$seed);\n\t\t\t\t$uri = $this->path.\"?get_action=login&userid=\".$user.\"&password=\".$pass.\"&login_seed=$seed\";\n\t\t\t}\n\t\t\t$httpClient->setHeadersOnly(true);\n\t\t\t$httpClient->get($uri);\n\t\t\t$httpClient->setHeadersOnly(false);\n\t\t\t$cookies = $httpClient->getCookies();\t\t\n\t\t\tif(isSet($cookies[\"AjaXplorer\"])){\n\t\t\t\t$_SESSION[\"AJXP_REMOTE_SESSION\"] = $cookies[\"AjaXplorer\"];\n\t\t\t\t$remoteSessionId = $cookies[\"AjaXplorer\"];\n\t\t\t}\n\t\t}else{\n\t\t\t$remoteSessionId = $_SESSION[\"AJXP_REMOTE_SESSION\"];\n\t\t\t$httpClient->setCookies(array(\"AjaXplorer\"=>$remoteSessionId));\n\t\t}\n\t\tAJXP_Logger::debug(\"Http Client created\", array());\n\t\treturn $httpClient; \t\n }", "protected function login() {\n $login_response = $this->call('\n <Envelope>\n <Body>\n <Login>\n <USERNAME>' . $this->username . '</USERNAME>\n <PASSWORD>' . $this->password . '</PASSWORD>\n </Login>\n </Body>\n </Envelope>\n ');\n\n if (!$login_response) {\n // Connection failure (curl returned FALSE).\n throw new SilverpopConnectionException('Could not find the Silverpop XMLAPI at the address \"' . $this->endpoint . '\".');\n }\n\n $xml = new DOMDocument('1.0', 'iso-8859-1');\n $xml->loadXML($login_response);\n $fault_tags = $xml->getElementsByTagName('FaultString');\n $fault_codes = $xml->getElementsByTagName('errorid');\n $id_tag = $xml->getElementsByTagName('SESSIONID');\n\n // Received a fault response from Silverpop.\n if ($fault_tags->length > 0) {\n $message = $fault_tags->item(0)->nodeValue;\n $code = $fault_codes->item(0)->nodeValue;\n throw new SilverpopConnectionException('Could not connect to the Silverpop XMLAPI. Silverpop says: \"' . $message . '\".', $code);\n }\n\n // No fault response and no session ID -- bad endpoint.\n elseif ($id_tag->length == 0) {\n throw new SilverpopConnectionException('Could not find the Silverpop XMLAPI at the address \"' . $this->endpoint . '\".');\n }\n\n // Successfully retrieved session ID.\n else {\n $this->sessionID = $id_tag->item(0)->nodeValue;\n }\n }", "public function setAuthentication($credential);", "public function __construct($endpoint, $username, $password) {\n $this->endpoint = $endpoint;\n $this->username = $username;\n $this->password = $password;\n $this->login();\n\n return $this;\n }", "public function call()\n {\n $req = $this->app->request();\n $res = $this->app->response();\n $authUser = $req->headers('PHP_AUTH_USER');\n $authPass = $req->headers('PHP_AUTH_PW');\n $dbUserAuthenticated = false;\n if ($authUser && $authPass){\n \t$stmt = $this->db->prepare('SELECT * FROM user WHERE username=:username AND password=:password;');\n \t$stmt->bindValue(':username', $authUser);\n \t$stmt->bindValue(':password', $authPass);\n\t\t\t$result = $stmt->execute();\n\t\t\tif($row = $result->fetchArray()){\n\t\t\t\t$dbUserAuthenticated = true;\n\t\t\t}\n }\n \n if ($authUser && $authPass && $dbUserAuthenticated) {\n $this->next->call();\n } \n else {\n \t//Statuscode 403 statt 401 zurückliefern, damit Browser kein Auth Fenster öffnet\n $res->setStatus(403);\n //Auth Header nicht setzen, da Statuscode sonst irgendwie auf 401 geändert wird\n //$res->header('WWW-Authenticate', sprintf('Basic realm=\"%s\"', $this->realm));\n }\n }", "function SugarLogin( $username, $password )\n\t{\n\t\tunset( $_SESSION[ 'sugar_user_id' ] );\n\t\tunset( $_SESSION[ 'sugar_portal_name' ] );\n\t\tunset( $_SESSION[ 'sugar_account_id' ] );\n\t\tunset( $_SESSION[ 'sugar_user_account_name' ] );\n\t\tunset( $_SESSION[ 'sugar_primary_email' ] );\n\n\t\t$url = $this->url;\n\t\t$url = $url . \"/oauth2/token\";\n\n\t\t$oauth2_parameters = array(\n\t\t\t\"grant_type\" => \"password\",\n\t\t\t\"client_id\" => \"support_portal\",\n\t\t\t\"client_secret\" => \"\",\n\t\t\t\"username\" => $username,\n\t\t\t\"password\" => $password,\n\t\t\t\"platform\" => \"portal\"\n\t\t);\n\n\t\t$oauth2_result = self::call($url, '', 'POST', $oauth2_parameters);\n\n\t\tif ( empty( $oauth2_result->access_token ) )\n\t\t{\n\t\t\treturn $oauth2_result;\n\t\t}\n\n\t\t//Retrieve and Set Current User\n\t\t$url = $this->url . \"/me\";\n\n\t\t$retrievedUser = self::call($url, $oauth2_result->access_token, 'GET');\n\n\t\t$current_sugar_user = $retrievedUser->current_user;\n\n\t\t$_SESSION[ 'sugar_user_id' ] = $current_sugar_user->user_id;\n\t\t$_SESSION[ 'sugar_portal_name' ] = $current_sugar_user->portal_name;\n\t\t$_SESSION[ 'sugar_account_id' ] = $current_sugar_user->id;\n\t\t$_SESSION[ 'sugar_user_account_name' ] = $current_sugar_user->full_name;\n\n\t\treturn $oauth2_result;\n\t}", "public function authenticate()\n {\n $username = (getenv('WRAP_USERID') == '') ? getenv('REDIRECT_WRAP_USERID') : getenv('WRAP_USERID');\n\n if ($username == '') {\n $username = getenv('REDIRECT_WRAP_USERID');\n }\n \n if ($username == '') {\n setrawcookie('WRAP_REFERER', $this->_getUrl(), 0, '/', '.ncsu.edu');\n header('location:https://webauth.ncsu.edu/wrap-bin/was16.cgi');\n die();\n }\n \n if (strtolower($username) == 'guest') {\n $this->autoLogout();\n return new Zend_Auth_Result(\n false,\n new stdClass(),\n array('Guest access is not allowed for this application')\n );\n }\n\n $class = new stdClass();\n $class->username = $username;\n $class->realm = 'wrap';\n \n return new Zend_Auth_Result(true, $class, array());\n }", "public function getCredential();", "public function authenticateCredential()\n {\n $sessionToken = $this->login();\n $this->credential->setSessionToken($sessionToken);\n }", "public function authenticate($username, $password)\n {\n curl_setopt($this->ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);\n curl_setopt($this->ch, CURLOPT_USERPWD, \"{$username}:{$password}\");\n return $this;\n }", "public function getClient()\n {\n if (!$this->getAPIKey() || !$this->isEnabled())\n return null;\n\n if (!$this->client) {\n require_once __DIR__ . '/../Raygun4php/RaygunClient.php'; \n\n $this->client = new \\Raygun4php\\RaygunClient($this->getAPIKey(), $this->getAsync(), false);\n $this->client->SetVersion($this->getVersion());\n\n $customer = Mage::helper('customer')->getCustomer();\n\n if ($customer !== null) {\n $this->client->SetUser(\n $customer->getEmail(), // Unique ID\n $customer->getFirstname(), // First name\n $customer->getName(), // Full name\n $customer->getEmail(), // Email\n ($customer->getEmail() == null), // Anonymous?\n null // UUID\n );\n }\n }\n\n return $this->client;\n }", "public function authenticate(): Auth\n {\n if (!$this->methodPathSegment) {\n throw new AuthenticationException('methodPathSegment must be set before usage');\n }\n\n $response = $this->client->write(\n sprintf('/auth/%s/login/%s', $this->methodPathSegment, $this->username),\n ['password' => $this->password]\n );\n\n return $response->getAuth();\n }", "protected function initializeSoapClient()\n {\n\n\t\t$authArray = array(\n\t\t\t'location' => 'https://' . $this->server . '/EWS/Exchange.asmx',\n\t\t\t'classmap' => $this->classMap(),\n\t\t\t'curlopts' => $this->curl_options,\n\t\t\t'features' => SOAP_SINGLE_ELEMENT_ARRAYS,\n\t\t); \n\n\t\tif(!empty($this->token)) {\n\n\t\t\t$authArray[\"token\"] = $this->token; \n\n\t\t}\n\t\telse {\n\n\t\t\t$authArray[\"user\"] = $this->username; \n\t\t\t$authArray[\"password\"] = $this->password; \n\n\t\t}\n\n $this->soap = new Oath2Soap(\n dirname(__FILE__) . '/assets/services.wsdl',\n $authArray\n );\n\n return $this->soap;\n }", "public function xAuth() {\n\t\t// Auth config\n\t\t$auth = \\Config::get('gponster/laravel-oauth-server::auth');\n\n\t\t// ----------------------------------------------------------------------------\n\t\t// IF PASSWORD STORE IN DATABASE AS DIGEST FORMAT, CLIENT APPLICATION\n\t\t// MUST GENERATE PASSWORD DIGEST BEFORE BUILD SIGNATURE WITH SAME ALGORITHM\n\t\t// ----------------------------------------------------------------------------\n\t\t$credentials = [\n\t\t\t$auth['username'] => $this->getParam(self::X_AUTH_USERNAME, true),\n\t\t\t$auth['password'] => $this->getParam(self::X_AUTH_PASSWORD, true),\n\t\t\t$auth['status'] => 1\n\t\t];\n\n\t\tif(empty($credentials[$auth['username']])) {\n\t\t\tthrow OAuthException::make(OAuthException::PARAMETER_ABSENT,\n\t\t\t\t[\n\t\t\t\t\t'name' => self::X_AUTH_USERNAME\n\t\t\t\t]);\n\t\t}\n\n\t\tif(empty($credentials[$auth['password']])) {\n\t\t\tthrow OAuthException::make(OAuthException::PARAMETER_ABSENT,\n\t\t\t\t[\n\t\t\t\t\t'name' => self::X_AUTH_PASSWORD\n\t\t\t\t]);\n\t\t}\n\n\t\t$xAuthMode = $this->getParam(self::X_AUTH_MODE, true);\n\t\t$loggedIn = false;\n\t\t$user = null;\n\n\t\tif($xAuthMode == 'client_auth') {\n\t\t\t$loggedIn = \\Auth::validate($credentials);\n\t\t\tif($loggedIn) {\n\t\t\t\t$user = Auth::getLastAttempted();\n\t\t\t}\n\t\t} else if(! empty($auth['social_login'])) {\n\t\t\t// Try social-login\n\t\t\t$provider = \\App::make(\n\t\t\t\t'Gponster\\\\OAuth\\\\Provider\\\\SocialLoginProviderInterface');\n\t\t\t$user = $provider->login($xAuthMode, $credentials[$auth['username']],\n\t\t\t\t$credentials[$auth['password']], null);\n\t\t}\n\n\t\tif(! $user) {\n\t\t\tthrow OAuthException::make(OAuthException::INVALID_CREDENTIALS,\n\t\t\t\t[\n\t\t\t\t\t'username' => $credentials[$auth['username']]\n\t\t\t\t]);\n\t\t}\n\n\t\t// Verify request if signature not valid\n\t\t$result = $this->verify(false, $this->forceBypassNonce);\n\n\t\t$options = [];\n\t\t$options['callback_url'] = isset($result['callback_url']) ? $result['callback_url'] : null;\n\t\t$options['referer_url'] = isset($result['referer_url']) ? $result['referer_url'] : null;\n\n\t\t// Should have a transaction here?\n\t\t$accessToken = $this->storages['access_token']->createAccessToken(\n\t\t\t$result['consumer_key'], $credentials[$auth['username']], $options);\n\t\tif(! $accessToken) {\n\t\t\tthrow new \\RuntimeException(\n\t\t\t\t'Cannot create new access token for ' . json_encode($result));\n\t\t}\n\n\t\t$data = [];\n\t\t$data[self::OAUTH_TOKEN] = Rfc3986::urlEncode($accessToken['token']);\n\t\t$data[self::OAUTH_TOKEN_SECRET] = Rfc3986::urlEncode($accessToken['token_secret']);\n\t\t$data[self::OAUTH_CALLBACK_CONFIRMED] = 1;\n\n\t\t$data['user'] = [\n\t\t\t$auth['username'] => $user->{$auth['username']}\n\t\t];\n\n\t\t// Get extra information\n\t\tif(! empty($auth['profile'])) {\n\t\t\t$provider = \\App::make(\n\t\t\t\t'Gponster\\\\OAuth\\\\Provider\\\\UserProfileProviderInterface');\n\t\t\t$profile = $provider->profile($user->{$auth['username']}, [\n\t\t\t\t'login' => true\n\t\t\t]);\n\n\t\t\tif(is_array($profile)) {\n\t\t\t\t$data['user'] = array_merge($data['user'], $profile);\n\t\t\t}\n\t\t}\n\n\t\tif(! empty($accessToken['expires_at']) && is_numeric($accessToken['expires_at'])) {\n\t\t\t$expiresAt = Carbon::createFromTimestamp(intval($accessToken['expires_at']));\n\n\t\t\t$data[self::XOAUTH_TOKEN_TTL] = $expiresAt->diffInSeconds();\n\t\t\t$data['expires_at'] = $expiresAt->timestamp;\n\t\t}\n\n\t\treturn $data;\n\t}", "public function getCredentials() {\n return new EndpointsCredentials($this->credentials);\n }", "abstract public function credentials();", "function authenticate()\n {\n $endpoint = $this->endpoints['authenticate'];\n return $this->sendRequest($endpoint['method'], $endpoint['uri']);\n }", "public function _setRawCredentials()\n\t{\n\t\t/* Check if an API Key or Access Token has been passed as a parameter in the query string. Because of the\n\t\t\tobvious security issues with this, we do not recommend it, but sometimes it is the only choice */\n\t\tif ( isset( \\IPS\\Request::i()->key ) )\n\t\t{\n\t\t\t$this->rawApiKey = \\IPS\\Request::i()->key;\n\t\t\treturn;\n\t\t}\n\t\tif ( isset( \\IPS\\Request::i()->access_token ) and ( !\\IPS\\OAUTH_REQUIRES_HTTPS or \\IPS\\Request::i()->isSecure() ) )\n\t\t{\n\t\t\t$this->rawAccessToken = \\IPS\\Request::i()->access_token;\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t/* Look for an API key in an automatically decoded HTTP Basic header */\n\t\tif ( isset( $_SERVER['PHP_AUTH_USER'] ) )\n\t\t{\n\t\t\t$this->rawApiKey = $_SERVER['PHP_AUTH_USER'];\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t/* If we're still here, try to find an Authorization header - start with $_SERVER... */\n\t\t$authorizationHeader = NULL;\n\t\tforeach ( $_SERVER as $k => $v )\n\t\t{\n\t\t\tif ( mb_substr( $k, -18 ) == 'HTTP_AUTHORIZATION' )\n\t\t\t{\n\t\t\t\t$authorizationHeader = $v;\n\t\t\t}\n\t\t}\n\t\t\n\t\t/* ...if we didn't find anything there, try apache_request_headers() */\n\t\tif ( !$authorizationHeader and \\function_exists('apache_request_headers') )\n\t\t{\n\t\t\t$headers = @apache_request_headers();\n\t\t\tif ( isset( $headers['Authorization'] ) )\n\t\t\t{\n\t\t\t\t$authorizationHeader = $headers['Authorization'];\n\t\t\t}\n\t\t}\n\t\t\n\t\t/* If we managed to get one, set if it's an API Key or an Access Token */\n\t\tif ( $authorizationHeader )\n\t\t{\n\t\t\tif ( mb_substr( $authorizationHeader, 0, 7 ) === 'Bearer ' and ( !\\IPS\\OAUTH_REQUIRES_HTTPS or \\IPS\\Request::i()->isSecure() ) )\n\t\t\t{\n\t\t\t\t$this->rawAccessToken = mb_substr( $authorizationHeader, 7 );\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$exploded = explode( ':', base64_decode( mb_substr( $authorizationHeader, 6 ) ) );\n\t\t\t\tif ( isset( $exploded[0] ) )\n\t\t\t\t{\n\t\t\t\t\t$this->rawApiKey = $exploded[0];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function getAuthSubHttpClient()\n{\n global $_SESSION, $_GET;\n if (!isset($_SESSION['docsSampleSessionToken']) && isset($_GET['token'])) {\n $_SESSION['docsSampleSessionToken'] =\n Zend_Gdata_AuthSub::getAuthSubSessionToken($_GET['token']);\n }\n $client = Zend_Gdata_AuthSub::getHttpClient($_SESSION['docsSampleSessionToken']);\n return $client;\n}", "private function performAuth() {\r\n\t\t\r\n\t\tGLOBAL $wgYammerConsumerKey, $wgYammerConsumerSecret, $wgEnableParserCache;\r\n\t\t\r\n\t\t$wgEnableParserCache = false;\r\n\t\t\r\n\t\t$status = $this->namespaceGet('status','init',true);\r\n\t\t\r\n\t\t# Consumer key is required\r\n\t\tif(empty($wgYammerConsumerKey) || empty($wgYammerConsumerSecret)) {\r\n\t\t\treturn $this->createErrorResponse('Please configure <code>$wgYammerConsumerKey</code> and <code>$wgYammerConsumerSecret</code> in your LocalSettings.php. Then <a href=\"'.$_SERVER['REQUEST_URI'].'\">reload the page</a>.');\r\n\t\t}\r\n\t\t\r\n\t\t# If the accesstoken/accesstokensecret are available, display those\r\n\t\tif(($atk =$this->namespaceGet('accesstoken',false)) !== false && ($ats = $this->namespaceGet('accesstokensecret',false)) !== false) {\r\n\t\t\treturn $this->createErrorResponse('Please configure <code>$wgYammerAccessKey=\"'.$atk.'\";</code> and <code>$wgYammerAccessSecret=\"'.$ats.'\";</code> in your LocalSettings.php. Then <a href=\"'.$_SERVER['REQUEST_URI'].'\">reload the page</a>.');\r\n\t\t}\r\n\t\t\r\n\t\t# If the request token/request token secret are not available, request one\r\n\t\t$rtk = $this->namespaceGet('requesttoken', false);\r\n\t\t$rts = $this->namespaceGet('requesttokensecret', false);\r\n\t\tif(false === ($rtk) && false === ($rts)) {\r\n\t\t\t$resp = $this->oauth_get(self::YAMMER_URI_REQUESTTOKEN, $wgYammerConsumerKey, $wgYammerConsumerSecret,'','',false,'PLAINTEXT');//$this->http(self::YAMMER_URI_REQUESTTOKEN, 'get');\r\n\t\t\tparse_str($resp[1], $arr);\r\n\t\t\t\r\n\t\t\tif(!empty($arr['oauth_token']) && !empty($arr['oauth_token_secret'])) {\r\n\t\t\t\t$this->namespaceSet('requesttoken', $arr['oauth_token']);\r\n\t\t\t\t$this->namespaceSet('requesttokensecret', $arr['oauth_token_secret']);\r\n\t\t\t\treturn $this->createErrorResponse('A new request token was retrieved from the Yammer server. Please <a href=\"'.$_SERVER['REQUEST_URI'].'\">reload the page</a> for further instructions');\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn $this->createErrorResponse('<pre>Invalid response: '.htmlspecialchars($resp[1]).'</pre>');\r\n\t\t} else if(!empty($_POST['oauth_verifier'])) {\r\n\t\t\t$verifier = $_POST['oauth_verifier'];\r\n\t\t\t$resp = $this->oauth_get(self::YAMMER_URI_ACCESSTOKEN.'?callback_token='.urlencode($verifier), $wgYammerConsumerKey, $wgYammerConsumerSecret, $rtk, $rts, false, 'PLAINTEXT', 'POST');\r\n\t\t\tparse_str($resp[1], $arr);\r\n\t\t\tif(!empty($arr['oauth_token']) && !empty($arr['oauth_token_secret'])) {\r\n\t\t\t\t$this->namespaceSet('accesstoken', $arr['oauth_token']);\r\n\t\t\t\t$this->namespaceSet('accesstokensecret', $arr['oauth_token_secret']);\r\n\t\t\t\treturn $this->createErrorResponse('Request token was exchanged for an access token. Please <a href=\"'.$_SERVER['REQUEST_URI'].'\">reload the page</a>.');\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn $this->createErrorResponse('Failed to verify using code '.$verifier. '<br />The Yammer server sent the following response:<code>'.htmlspecialchars($resp[1]).'</code>');\r\n\t\t} else {\r\n\t\t\treturn $this->createVerifyFormResponse($rtk);//'rtk='.var_export($rtk, true).', rts='.var_export($rts, true));\r\n\t\t}\r\n\t\t\r\n\t\t# If the request token/request token secret are available\r\n\t\t# a) If the $_POST[verifier] is available, try and exchange the request token with an access token\r\n\t\t# b) Else show the authorisation url + the form where the member can input the Yammer oauth token\r\n\t\tif($rtk = $this->namespaceGet('requesttoken') && $rts = $this->namespaceGet('requesttokensecret', false)) {\r\n\t\t}\r\n\t\t\r\n\t\treturn $this->createErrorResponse('Unexpected error in '.__CLASS__.'::'.__FUNCTION__);\r\n\t}", "function getCredentials()\r\n\t{\r\n\t\t$user = $this->makeRequest('http://api.twitter.com/account/verify_credentials.xml');\r\n\t\tif($user)\r\n\t\t\treturn simplexml_load_string($user);\r\n\t}", "public function authenticate()\n {\n $allowOverride = $this->shardServiceManager->getAllowOverride();\n $this->shardServiceManager->setAllowOverride(true);\n\n $sysUser = new User;\n $sysUser->addRole('sys::authenticate');\n $this->shardServiceManager->setService('user', $sysUser);\n \n $this->doctrineAdapter->setIdentity($this->identity);\n $this->doctrineAdapter->setCredential($this->credential);\n $result = $this->doctrineAdapter->authenticate();\n \n if ($result->isValid()) {\n $this->shardServiceManager->setService('user', $result->getIdentity());\n } else {\n $sysUser->removeRole('sys::authenticate');\n }\n $this->shardServiceManager->setAllowOverride($allowOverride);\n \n return $result;\n }", "public function connect()\n {\n $this->_client = new SoapClient($this->_magentoHost);\n $this->_session = $this->_client->login($this->_apiUser, $this->_apiKey);\n }", "public function setCredentials($username, $password)\n {\n $this->username = $username;\n $this->password = $password;\n $this->token = '';\n $this->accessToken = '';\n return $this;\n }", "private function oauthlogin($credentials){\n try {\n $curl = curl_init();\n // Set some options - we are passing in a useragent too here\n curl_setopt_array($curl, array(\n CURLOPT_RETURNTRANSFER => 1,\n CURLOPT_URL => $this->getParameter('zfzmyrjlmj_api_host') . \"/oauth/v2/token?grant_type=password&client_id=\" . $this->getParameter('oauth_client_id') . \"&client_secret=\" . $this->getParameter('oauth_secret') . \"&username=\" . $credentials['username'] . \"&password=\" . $credentials['password'],\n CURLOPT_USERAGENT => 'Get an Access Token for Yara clinica User'\n ));\n // Send the request & save response to $resp\n $resp = curl_exec($curl);\n // Close request to clear up some resources\n curl_close($curl);\n $oauthResponse = json_decode($resp, true);\n if(isset($oauthResponse['access_token'])){//Make sure access_token is retrieved\n return $oauthResponse;\n }\n return null;\n }catch (\\Exception $e){\n return array(\"error\" => $e->getMessage());\n }\n }", "public function setAuth($username, $password = null)\n {\n if ($username) {\n $this->optionManager->set(['HTTPAUTH' => CURLAUTH_BASIC, 'USERPWD', (string) $username . ':' . (string) $password]); \n }\n \n return $this;\n }", "public function buildAuthenticatedByPassword($username, $password)\n {\n $authentication = Authentication::fromPassword($username, $password);\n\n return $this->buildAuthenticatedClient($authentication);\n }", "public function getApiClient()\n {\n $client = new \\Acelle\\Extra\\SendGrid(['username' => $this->getSubAccountUsername(), 'password' => decrypt($this->password)]);\n return $client;\n }", "public function authorize($scope)\n {\n return CredentialsLoader::makeHttpClient($this->getCredentials($scope));\n }", "public function authenticateByApiTokenForCpanel(string $username, string $apitoken): self;", "public function auth()\n {\n return $this;\n }", "public function getAuthenticationProvider() {\n\t\tif (!$this->authenticationProvider) {\n\t\t\t/** @var Dispatcher $dispatcher */\n\t\t\t$dispatcher = $this->dispatcher ? $this->dispatcher : Dispatcher::getSharedDispatcher();\n\t\t\tlist($vendor, $extension,) = Utility::getClassNamePartsForPath($dispatcher->getPath());\n\n\t\t\t// Check if an extension provides a Authentication Provider\n\t\t\t$authenticationProviderClass = 'Tx_' . $extension . '_Rest_AuthenticationProvider';\n\t\t\tif (!class_exists($authenticationProviderClass)) {\n\t\t\t\t$authenticationProviderClass = ($vendor ? $vendor . '\\\\' : '') . $extension . '\\\\Rest\\\\AuthenticationProvider';\n\t\t\t}\n\n\n\t\t\t// Use the found Authentication Provider\n\t\t\tif (class_exists($authenticationProviderClass)) {\n\t\t\t\t$this->authenticationProvider = $this->get($authenticationProviderClass);\n\t\t\t} else {\n\t\t\t\t// Use the default Authentication Provider\n\t\t\t\t#$authenticationProviderClass = 'Cundd\\\\Rest\\\\Authentication\\\\BasicAuthenticationProvider';\n\t\t\t\t$this->authenticationProvider = $this->get('Cundd\\\\Rest\\\\Authentication\\\\AuthenticationProviderCollection', array(\n\t\t\t\t\t$this->get('Cundd\\\\Rest\\\\Authentication\\\\BasicAuthenticationProvider'),\n\t\t\t\t\t$this->get('Cundd\\\\Rest\\\\Authentication\\\\CredentialsAuthenticationProvider'),\n\t\t\t\t));\n\t\t\t}\n\n\t\t\t$this->authenticationProvider->setRequest($dispatcher->getRequest());\n\t\t}\n\t\treturn $this->authenticationProvider;\n\t}", "public function auth_request()\n {\n // request the user information\n $url = $this->tmhOAuth->url('1.1/account/verify_credentials');\n $file = $this->sanitize($url);\n\n if ($cached_file = $this->get_cached_file($file)) {\n return json_decode($cached_file, true);\n } else {\n $code = $this->tmhOAuth->user_request([\n 'url' => $url\n ]);\n\n // If the request fails, check to see if there's an older cached file we can use\n if ($code <> 200) {\n if ($cached_file = $this->get_cached_file($file, true)) {\n return json_decode($cached_file, true);\n } else {\n if ($code == 429) {\n die(\"Exceeded Twitter API rate limit\");\n }\n\n die(\"verify_credentials connection failure\");\n }\n }\n\n // Decode JSON\n $json = $this->tmhOAuth->response['response'];\n\n $this->set_cached_file($file, $json);\n\n return json_decode($json, true);\n }\n }", "public function auth() {\n \n // state 1 requires a GET variable to exist\n if($this->state == 1 && !isset($_GET['oauth_verifier'])) {\n $this->state = 0;\n }\n\n // Step 1: Get a request token\n if($this->state == 0) {\n return $this->getRequestToken();\n }\n\n // Step 2: Get an access token\n elseif($this->state == 1) {\n return $this->getAccessToken();\n }\n\n // Step 3: Verify the access token\n return $this->verifyAccessToken();\n }", "protected function _getClient()\n {\n $client = new Zend_Http_Client();\n $client->setUri($this->getGatewayUrl())\n ->setConfig(array('maxredirects' => self::REQUEST_MAX_REDIRECTS, 'timeout' => self::REQUEST_TIMEOUT))\n ->setParameterGet('API', $this->getApiCode())\n ->setParameterGet('XML', $this->asXml());\n return $client;\n }", "protected function createAuthenticatedClient($username = 'user', $password = 'password')\n {\n // Create a client\n $client = static::createClient();\n // Send username and password\n $client->request(\n 'POST',\n '/api/login_check',\n array(\n '_username' => $username,\n '_password' => $password,\n )\n );\n // Decode json data to retrieve the token\n $data = json_decode($client->getResponse()->getContent(), true);\n\n // Erase client with new\n $client = static::createClient();\n // Send data with\n $client->setServerParameter('HTTP_Authorization', sprintf('Bearer %s', $data['token']));\n\n // Return the authenticated client\n return $client;\n }", "public function authenticate()\n {\n $response = $this->client->write(\n sprintf('/auth/userpass/login/%s', $this->username),\n ['password' => $this->password]\n );\n\n return $response->getAuth();\n }", "private function auth()\n {\n if ($this->logger)\n $this->logger->notice('SASL Auth, available mechanisms: {mechanisms}', [\n 'mechanisms' => implode(', ', array_map(function (XmlBranch $item) {\n return $item->content;\n }, (array)$this->connector->features->mechanisms[0]->mechanism))\n ]);\n\n $xml = new XmlBranch('auth');\n $xml->addAttribute('xmlns', 'urn:ietf:params:xml:ns:xmpp-sasl');\n\n $mechanism = null;\n $this->connector->features->mechanisms[0]->mechanism->getIterator();\n foreach ($this->connector->features->mechanisms[0]->mechanism as $current) {\n if ($mechanism = SaslFactory::get($current->content, $this->jid, $this->password))\n break;\n }\n\n if (!$mechanism)\n throw new \\RuntimeException('This client is not supporting any of server auth mechanisms.');\n\n if ($this->logger)\n $this->logger->notice('Chosen mechanism: {mechanism}', ['mechanism' => $current->content]);\n\n $this->_mechanism = $mechanism;\n\n $xml->addAttribute('mechanism', $current->content);\n $xml->setContent($mechanism->auth());\n\n $this->write($xml);\n }", "protected function restMarketsEbayAuthLoginGetRequest()\n {\n\n $resourcePath = '/rest/markets/ebay/auth/login';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['*/*']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['*/*'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function login()\n\t{\n\n\t\tif ( ( $this->get_access_key() === null || $this->get_access_secret() === null ) )\n\t\t{\n echo 'case 1';\n $oauth = new \\OAuth( $this->tokens['consumer_key'], $this->tokens['consumer_secret'] );\n\n $request_token_info = $oauth->getRequestToken( $this->request_token_url, $this->get_callback() );\n\n if ($request_token_info)\n {\n\n $this->set_request_tokens( $request_token_info );\n }\n\n // Now we have the temp credentials, let's get the real ones.\n\n // Now let's get the OAuth token\n\t\t\t\\Response::redirect( $this->get_auth_url() );\n return;\n\t\t}\n\n\t\treturn $this->check_login();\n\t}", "public function __invoke($previousCredentials = null)\n {\n $this->attempts = 0;\n return Promise\\Coroutine::of(function () use ($previousCredentials) {\n\n // Retrieve token or switch out of secure mode\n $token = null;\n while ($this->secureMode && is_null($token)) {\n try {\n $token = (yield $this->request(\n self::TOKEN_PATH,\n 'PUT',\n [\n 'x-aws-ec2-metadata-token-ttl-seconds' => 21600\n ]\n ));\n } catch (TransferException $e) {\n if ($this->getExceptionStatusCode($e) === 500\n && $previousCredentials instanceof Credentials\n ) {\n goto generateCredentials;\n }\n else if (!method_exists($e, 'getResponse')\n || empty($e->getResponse())\n || !in_array(\n $e->getResponse()->getStatusCode(),\n [400, 500, 502, 503, 504]\n )\n ) {\n $this->secureMode = false;\n } else {\n $this->handleRetryableException(\n $e,\n [],\n $this->createErrorMessage(\n 'Error retrieving metadata token'\n )\n );\n }\n }\n $this->attempts++;\n }\n\n // Set token header only for secure mode\n $headers = [];\n if ($this->secureMode) {\n $headers = [\n 'x-aws-ec2-metadata-token' => $token\n ];\n }\n\n // Retrieve profile\n while (!$this->profile) {\n try {\n $this->profile = (yield $this->request(\n self::CRED_PATH,\n 'GET',\n $headers\n ));\n } catch (TransferException $e) {\n // 401 indicates insecure flow not supported, switch to\n // attempting secure mode for subsequent calls\n if (!empty($this->getExceptionStatusCode($e))\n && $this->getExceptionStatusCode($e) === 401\n ) {\n $this->secureMode = true;\n }\n $this->handleRetryableException(\n $e,\n [ 'blacklist' => [401, 403] ],\n $this->createErrorMessage($e->getMessage())\n );\n }\n\n $this->attempts++;\n }\n\n // Retrieve credentials\n $result = null;\n while ($result == null) {\n try {\n $json = (yield $this->request(\n self::CRED_PATH . $this->profile,\n 'GET',\n $headers\n ));\n $result = $this->decodeResult($json);\n } catch (InvalidJsonException $e) {\n $this->handleRetryableException(\n $e,\n [ 'blacklist' => [401, 403] ],\n $this->createErrorMessage(\n 'Invalid JSON response, retries exhausted'\n )\n );\n } catch (TransferException $e) {\n // 401 indicates insecure flow not supported, switch to\n // attempting secure mode for subsequent calls\n if (($this->getExceptionStatusCode($e) === 500\n || strpos($e->getMessage(), \"cURL error 28\") !== false)\n && $previousCredentials instanceof Credentials\n ) {\n goto generateCredentials;\n } else if (!empty($this->getExceptionStatusCode($e))\n && $this->getExceptionStatusCode($e) === 401\n ) {\n $this->secureMode = true;\n }\n $this->handleRetryableException(\n $e,\n [ 'blacklist' => [401, 403] ],\n $this->createErrorMessage($e->getMessage())\n );\n }\n $this->attempts++;\n }\n generateCredentials:\n\n if (!isset($result)) {\n $credentials = $previousCredentials;\n } else {\n $credentials = new Credentials(\n $result['AccessKeyId'],\n $result['SecretAccessKey'],\n $result['Token'],\n strtotime($result['Expiration'])\n );\n }\n\n if ($credentials->isExpired()) {\n $credentials->extendExpiration();\n }\n\n yield $credentials;\n });\n }", "public function getClient()\n {\n $options = array(\n 'hostname' => 'login.unl.edu',\n 'port' => 443,\n 'uri' => 'cas'\n );\n \n $protocol = new \\SimpleCAS_Protocol_Version2($options);\n\n /**\n * We need to customize the request to use CURL because \n * php5.4 and ubuntu systems can't verify ssl connections \n * without specifying a CApath. CURL does this automatically\n * based on the system, but openssl does not.\n * \n * It looks like this will be fixed in php 5.6\n * https://wiki.php.net/rfc/tls-peer-verification\n */\n $request = new \\HTTP_Request2();\n $request->setConfig('adapter', 'HTTP_Request2_Adapter_Curl');\n $protocol->setRequest($request);\n\n return \\SimpleCAS::client($protocol);\n }", "public function requestAccessToken()\n {\n try {\n $this->session->requestAccessToken($_GET['code']);\n return $this;\n } catch (Exception $e) {\n $this->redirectToSpotifyAuthorizeUrl();\n return;\n }\n }", "public function retrieveAuthCredentials()\n\t{\n\t\t// Since PHP saves the HTTP Password in a bunch of places, we have to be able to test for all of them\n\t\t$username = $password = NULL;\n\t\t\n\t\t// mod_php\n\t\tif (isset($_SERVER['PHP_AUTH_USER'])) \n\t\t{\n\t\t $username = (isset($_SERVER['PHP_AUTH_USER'])) ? $_SERVER['PHP_AUTH_USER'] : NULL;\n\t\t $password = (isset($_SERVER['PHP_AUTH_PW'])) ? $_SERVER['PHP_AUTH_PW'] : NULL;\n\t\t}\n\n\t\t// most other servers\n\t\telseif ($_SERVER['HTTP_AUTHENTICATION'])\n\t\t{\n\t\t\tif (strpos(strtolower($_SERVER['HTTP_AUTHENTICATION']),'basic') === 0)\n\t\t\t{\n\t\t\t\tlist($username,$password) = explode(':',base64_decode(substr($_SERVER['HTTP_AUTHENTICATION'], 6)));\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Check them - if they're null a/o empty, they're invalid.\n\t\tif ( is_null($username) OR is_null($password) OR empty($username) OR empty($password))\n\t\t\treturn FALSE;\n\t\telse\n\t\t\treturn array('username' => $username, 'password' => $password);\n\t}", "public function authenticate()\n {\n $core = Zend_Controller_Front::getInstance()->getParam(\"bootstrap\")->getResource(\"core\");\n /* @var $response Adsolut_Http_Response */\n $response = $core->get($this->endpoint, \n array(\n 'email' => $this->username,\n 'password' => $this->password));\n $result = Zend_Auth_Result::FAILURE;\n if (!$response->hasErrors()) {\n $result = Zend_Auth_Result::FAILURE_IDENTITY_NOT_FOUND;\n $data = $response->getData();\n if (!empty($data)) {\n $result = Zend_Auth_Result::SUCCESS;\n }\n } \n return new Zend_Auth_Result($result, $response->getData());\n }", "public function login(){\n $wsLogin = new SoapClient($this->url . \"auth.asmx?wsdl\");\n\n try {\n $this->ticket = $wsLogin->Login(\n (object) array(\n \"Username\" => $this->username,\n \"Password\" => $this->password\n ))->LoginResult->ServiceTicket;\n } catch (Exception $e) {\n \n }\n\n }", "public function setAuth($username, $password);", "public function authorize(): ExternalOauth2Credential {\n if (!$this->currentlyHasAToken()) {\n $_credentials = $this->_getAuthenticationCredentialsFromExternalApplication();\n $this->_writeCredentialsToDatabase($_credentials);\n }\n $_credentials = $this->getCredentials();\n if ($this->isTokenExpired()) {\n $this->refreshOauth2Token();\n }\n return $_credentials;\n }", "public function read_credentials() {\n\t\t$connection = $this->post( 'connection' );\n\t\t$mandrill_key = ! empty( $connection['mandrill-key'] ) ? $connection['mandrill-key'] : '';\n\n\t\tif ( isset( $connection['mailchimp_key'] ) ) {\n\t\t\t$connection['mandrill-key'] = $connection['key'];\n\t\t\t$connection['key'] = $connection['mailchimp_key'];\n\t\t\t$mandrill_key = $connection['mandrill-key'];\n\t\t}\n\n\t\tif ( empty( $_POST['connection']['key'] ) ) {\n\t\t\treturn $this->error( __( 'You must provide a valid Mailchimp key', 'thrive-dash' ) );\n\t\t}\n\n\t\t$this->set_credentials( $connection );\n\n\t\t$result = $this->test_connection();\n\n\t\tif ( $result !== true ) {\n\t\t\treturn $this->error( sprintf( __( 'Could not connect to Mailchimp using the provided key (<strong>%s</strong>)', 'thrive-dash' ), $result ) );\n\t\t}\n\n\t\t/**\n\t\t * finally, save the connection details\n\t\t */\n\t\t$this->save();\n\n\t\t/** @var Thrive_Dash_List_Connection_Mandrill $related_api */\n\t\t$related_api = Thrive_Dash_List_Manager::connection_instance( 'mandrill' );\n\n\t\tif ( ! empty( $mandrill_key ) ) {\n\t\t\t/**\n\t\t\t * Try to connect to the email service too\n\t\t\t */\n\n\t\t\t$related_api = Thrive_Dash_List_Manager::connection_instance( 'mandrill' );\n\t\t\t$r_result = true;\n\t\t\tif ( ! $related_api->is_connected() ) {\n\t\t\t\t$r_result = $related_api->read_credentials();\n\t\t\t}\n\n\t\t\tif ( $r_result !== true ) {\n\t\t\t\t$this->disconnect();\n\n\t\t\t\treturn $this->error( $r_result );\n\t\t\t}\n\t\t} else {\n\t\t\t/**\n\t\t\t * let's make sure that the api was not edited and disconnect it\n\t\t\t */\n\t\t\t$related_api->set_credentials( array() );\n\t\t\tThrive_Dash_List_Manager::save( $related_api );\n\t\t}\n\n\t\t/**\n\t\t * Fetch all custom fields on connect so that we have them all prepared\n\t\t * - TAr doesn't need to fetch them from API\n\t\t */\n\t\t$this->get_api_custom_fields( array(), true, true );\n\n\t\treturn $this->success( __( 'Mailchimp connected successfully', 'thrive-dash' ) );\n\t}", "public function auth($auth = true)\n {\n $headers = $this->headers();\n if ($auth === false) {\n unset($headers['Authorization']);\n }\n if (!$auth) {\n return;\n }\n if (is_array($auth) && !empty($auth['nonce'])) {\n $data = ['method' => $this->method(), 'uri' => $this->path()];\n $data += $auth;\n } else {\n $data = [];\n }\n $auth = $this->_classes['auth'];\n $data = $auth::encode($this->username(), $this->password(), $data);\n $headers['Authorization'] = $auth::header($data);\n return $this;\n }", "protected function getCredentialObject()\n {\n if(isset($this->credential))\n return $this->credential;\n\n $this->credential = new Credential;\n return $this->credential;\n }", "public function init(){\n if( !isset($this->access_token) && !StileroFlickrFrob::hasFrobInGetRequest() ){\n $Url = new StileroFlickrUrl($this->Api);\n $Url->redirectToUrl($this->perms);\n }else if( StileroFlickrFrob::hasFrobInGetRequest() ){\n $this->Frob->fetchFrob();\n $Authtoken = new StileroFlickrAuthtoken($this->Api, $this->Frob);\n $Authtoken->requestToken();\n $this->access_token = $Authtoken->token;\n }if(isset($this->access_token)){\n $this->_endpoints();\n }\n return $this;\n }", "abstract public function getAuthenticator();", "public function authenticate(array $credentials)\n {\n foreach ($this->backends as $backend) {\n try {\n // trust the user, and just call the authenticate method.\n $user = $backend->authenticate($credentials);\n } catch (Exceptions\\NotSupportedCredentials $e) {\n // this backend not supported this credentials so continue\n continue;\n } catch (Exceptions\\PermissionDenied $e) {\n // this backend says to stop in our tracks - this user should\n // not be allowed in at all.\n break;\n }\n if ($user === null) {\n continue;\n }\n $user->authBackend = $backend;\n\n return $user;\n }\n\n $this->authenticateFailed($this->cleanUpCredentials($credentials));\n }", "protected function client()\n\t{\n\t\treturn Passport::client();\n\t}", "public function getAccessTokenByCredentials()\n {\n $data = [\n 'client_id' => $this->oauth_client_id,\n 'client_secret' => $this->oauth_client_secret,\n 'grant_type' => 'client_credentials',\n ];\n return $this->sendRequest($this->oauth_access_token_url, $data);\n }", "public function setCredentials($data)\n {\n $this->credentials = new Credentials($data);\n return $this;\n }", "private function createHttpClient(): Client\n {\n if (null === $this->configuration->getSecurityToken()) {\n throw new MissingCredentialException('Security Token is not set or empty');\n }\n\n $this->addHeader('SECURITY_TOKEN', $this->configuration->getSecurityToken());\n\n return new Client([\n 'base_uri' => $this->configuration->getBaseUrl(),\n 'headers' => $this->getHeaders() \n ]);\n }", "public function getClient()\r\n\t{\r\n\t\tif ($this->_client != NULL)\r\n\t\t\treturn $this->_client;\r\n\r\n\t\tif ($this->useRackspace)\r\n\t\t{\r\n\t\t\tif ($this->identity == NULL)\r\n\t\t\t\t$this->identity = OpenCloud\\Rackspace::US_IDENTITY_ENDPOINT;\r\n\r\n\t\t\t$this->_client = new OpenCloud\\Rackspace($this->identity, array(\r\n\t 'username' => $this->username,\r\n\t 'apiKey' => $this->apiKey\r\n\t ));\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$this->_client = new OpenCloud\\OpenStack($this->identity, array(\r\n\t 'username' => $this->username,\r\n\t 'apiKey' => $this->apiKey\r\n\t\t\t));\r\n\t\t}\r\n\r\n\t\treturn $this->_client;\r\n\t}", "public function call()\n {\n try {\n /** @var Principal $principal */\n $principal = Principal::instance();\n\n if ($principal) {\n $this->app->container->set('principal', $principal);\n $data['accessToken'] = $principal->getAccessToken();\n $data['accessTokenExpires'] = $principal->getExpires();\n $user = $principal->getUser();\n if (null !== $user) {\n $data['username'] = $user['username'];\n $data['user_id'] = $user['id'];\n $data['user'] = $user;\n };\n if ($principal->hasRefreshToken()) {\n $data['refreshToken'] = $principal->getRefreshToken();\n }\n $this->app->view()->appendData($data);\n }\n } catch (RestfulException $e) {\n $this->app->getLog()->critical($e->getMessage(), $e->getResource());\n Principal::endSession();\n } catch (\\Exception $e) {\n $this->app->getLog()->critical($e->getMessage());\n Principal::endSession();\n }\n\n $this->next->call();\n }", "public function __invoke()\n {\n if ($this->server) {\n return $this->server;\n }\n\n $config = $this->config;\n\n if (! isset($config['storage']) || empty($config['storage'])) {\n throw new Exception\\RuntimeException(\n 'The storage configuration for OAuth2 is missing'\n );\n }\n\n $storagesServices = [];\n if (is_string($config['storage'])) {\n $storagesServices[] = $config['storage'];\n } elseif (is_array($config['storage'])) {\n $storagesServices = $config['storage'];\n } else {\n throw new Exception\\RuntimeException(\n 'The storage configuration for OAuth2 should be string or array'\n );\n }\n\n $storage = [];\n\n foreach ($storagesServices as $storageKey => $storagesService) {\n $storage[$storageKey] = $this->services->get($storagesService);\n }\n\n $enforceState = $config['enforce_state'] ?? true;\n $allowImplicit = $config['allow_implicit'] ?? false;\n $accessLifetime = $config['access_lifetime'] ?? 3600;\n $audience = $config['audience'] ?? '';\n $options = $config['options'] ?? [];\n $options = array_merge([\n 'enforce_state' => $enforceState,\n 'allow_implicit' => $allowImplicit,\n 'access_lifetime' => $accessLifetime,\n ], $options);\n\n // Pass a storage object or array of storage objects to the OAuth2 server class\n $server = new OAuth2Server($storage, $options);\n $availableGrantTypes = $config['grant_types'];\n\n if (isset($availableGrantTypes['client_credentials']) && $availableGrantTypes['client_credentials'] === true) {\n $clientOptions = [];\n if (isset($options['allow_credentials_in_request_body'])) {\n $clientOptions['allow_credentials_in_request_body'] = $options['allow_credentials_in_request_body'];\n }\n\n // Add the \"Client Credentials\" grant type (it is the simplest of the grant types)\n $server->addGrantType(new ClientCredentials($server->getStorage('client_credentials'), $clientOptions));\n }\n\n if (isset($availableGrantTypes['authorization_code']) && $availableGrantTypes['authorization_code'] === true) {\n // Add the \"Authorization Code\" grant type (this is where the oauth magic happens)\n $server->addGrantType(new AuthorizationCode($server->getStorage('authorization_code')));\n }\n\n if (isset($availableGrantTypes['password']) && $availableGrantTypes['password'] === true) {\n // Add the \"User Credentials\" grant type\n $server->addGrantType(new UserCredentials($server->getStorage('user_credentials')));\n }\n\n if (isset($availableGrantTypes['jwt']) && $availableGrantTypes['jwt'] === true) {\n // Add the \"JWT Bearer\" grant type\n $server->addGrantType(new JwtBearer($server->getStorage('jwt_bearer'), $audience));\n }\n\n if (isset($availableGrantTypes['refresh_token']) && $availableGrantTypes['refresh_token'] === true) {\n $refreshOptions = [];\n if (isset($options['always_issue_new_refresh_token'])) {\n $refreshOptions['always_issue_new_refresh_token'] = $options['always_issue_new_refresh_token'];\n }\n if (isset($options['unset_refresh_token_after_use'])) {\n $refreshOptions['unset_refresh_token_after_use'] = $options['unset_refresh_token_after_use'];\n }\n\n // Add the \"Refresh Token\" grant type\n $server->addGrantType(new RefreshToken($server->getStorage('refresh_token'), $refreshOptions));\n }\n\n return $this->server = $server;\n }", "function restAuth($auth)\n{\n\tif (!CLIENT_ID || !CLIENT_SECRET)\n\t\treturn false;\n\n\tif(!isset($auth['refresh_token']))\n\t\treturn false;\n\n\t$queryUrl = 'https://oauth.bitrix.info/oauth/token/';\n\t$queryData = http_build_query($queryParams = array(\n\t\t'grant_type' => 'refresh_token',\n\t\t'client_id' => CLIENT_ID,\n\t\t'client_secret' => CLIENT_SECRET,\n\t\t'refresh_token' => $auth['refresh_token'],\n\t));\n\n\twriteToLog(Array('URL' => $queryUrl, 'PARAMS' => $queryParams), 'ImBot request auth data');\n\n\t$curl = curl_init();\n\n\tcurl_setopt_array($curl, array(\n\t\tCURLOPT_HEADER => 0,\n\t\tCURLOPT_RETURNTRANSFER => 1,\n\t\tCURLOPT_URL => $queryUrl.'?'.$queryData,\n\t));\n\n\t$result = curl_exec($curl);\n\tcurl_close($curl);\n\n\t$result = json_decode($result, 1);\n\tif (!isset($result['error']))\n\t{\n\t\t$appsConfig = Array();\n\t\tif (file_exists(__DIR__.'/config.php'))\n\t\t\tinclude(__DIR__.'/config.php');\n\n\t\t$result['application_token'] = $auth['application_token'];\n\t\t$appsConfig[$auth['application_token']]['AUTH'] = $result;\n\t\tsaveParams($appsConfig);\n\t}\n\telse\n\t{\n\t\t$result = false;\n\t}\n\n\treturn $result;\n}", "public function retrieveByCredentials(array $credentials);", "public function retrieveByCredentials(array $credentials);", "public function retrieveByCredentials(array $credentials);", "abstract public function init($credentials = false);", "public function setupClient(GuzzleHttp\\HandlerStack $stack = null, array $options = [])\n {\n // Set and override any prevent set Authorization header\n $options['headers'] = [\n 'Authorization' => 'Token token=' . $this->token . ',email=' . $this->email\n ];\n\n $stack = $stack ?: GuzzleHttp\\HandlerStack::create();\n\n if($this->logging) $this->bindLoggingMiddleware($stack);\n\n $this->client = new GuzzleHttp\\Client(array_merge([\n 'handler' => $stack,\n 'base_uri' => $this->getBaseUrl(),\n 'verify' => $this->getVerifyPeer(),\n 'timeout' => $this->getTimeout(),\n ], $options));\n\n return $this;\n }", "public function getShop(RequestCredentialsInterface $credentials): Shop\n {\n $response = $this->asyncGetShop($credentials)->wait();\n\n return $this->shopTransformer->fromResponse($response);\n }", "public function getAuthManager();", "protected function http(){\n\n if( empty($this->HTTPClient) ){\n\n //init stack\n $stack = HandlerStack::create();\n\n if ( $this->token ){\n\n //setup to send the token with each request\n\n $this->addHeader(Headers::AUTHORIZATION, ( \"TOKEN \" . $this->token->getValue() ) );\n\n }\n else{\n\n //setup client to send signed requests\n\n $signer = new Signer(Settings::PROVIDER);\n $middleware = new Middleware($signer, $this->cfg->getKey(), $this->cfg->getSecret());\n\n $stack->push($middleware);\n\n }\n\n //enable debug\n if( $logger = $this->cfg->getLogger() )\n $this->pushRequestLogger($logger, $stack);\n\n //create the client\n $this->HTTPClient = new HTTPClient([\n 'headers' => &$this->headers,\n 'timeout' => $this->cfg->getRequestTimeout(),\n 'handler' => $stack\n ]);\n\n return $this->HTTPClient;\n\n }\n\n return $this->HTTPClient;\n\n }", "public abstract function RefreshAccessToken(array $credentials);", "protected function getRestClient(){\n\n $request = new Zend_Http_Client();\n $request->setUri($this->getUrl())\n ->setHeaders(array(\"Accept\" => \"application/json\") + $this->getHeaders())\n ->setMethod($this->getMethod())\n ->setConfig(\n array(\n 'timeout' => $this->getTimeout()\n )\n );\n if($this->isRawData()) {\n $params = json_encode($this->getData());\n $request->setRawData($params, 'application/json');\n } else if($this->getMethod() == Zend_Http_Client::GET) {\n $request->setParameterGet($this->getData());\n } else {\n $request->setParameterPost($this->getData());\n }\n return $request;\n }", "function login()\n\t{\n\t\t$url = $this->url;\n\t\t$url = $url . \"/oauth2/token\";\n\n\t\t$oauth2_token_parameters = array(\n\t\t\t\"grant_type\" => \"password\",\n\t\t\t\"client_id\" => \"sugar\",\n\t\t\t\"client_secret\" => \"\",\n\t\t\t\"username\" => $this->username,\n\t\t\t\"password\" => $this->password,\n\t\t\t\"platform\" => \"base\"\n\t\t);\n\n\t\t$oauth2_token_result = self::call($url, '', 'POST', $oauth2_token_parameters);\n\n\t\tif ( empty( $oauth2_token_result->access_token ) )\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\treturn $oauth2_token_result->access_token;\n\t}", "public function getCredentials() {\r\n\t\t\r\n\t\treturn $this->_credentials;\r\n\t\t\r\n\t}", "public function asyncGetShop(\n RequestCredentialsInterface $credentials\n ): PromiseInterface {\n $getShopRequest = $this->getShopRequestBuilder\n ->withCredentials($credentials);\n\n return $this->httpClient->sendAsync(\n $getShopRequest->toRequest(),\n $getShopRequest->toRequestOptions()\n );\n }", "protected function getAuthService()\n {\n return $this->services['auth'] = new \\phpbb\\auth\\auth();\n }", "public function execute($inputs = array(), $async = false, $store_results = true)\n {\n return new Google_Spreadsheets_ClientLoginAuthentication_Execution($this->session, $this, $inputs, $async, $store_results);\n }", "public function login($username = false, $password = false)\n {\n $loginClient = new Zend_Http_Client($this->_env . self::ENDPOINT_LOGIN);\n\n if ($username == false || $password == false) {\n $username = Mage::getStoreConfig('stockbase_options/login/username');\n $password = Mage::getStoreConfig('stockbase_options/login/password');\n }\n\n $headers = array(\n 'Content-Type' => 'application/json',\n 'Username' => $username,\n 'Password' => $password,\n );\n $loginClient->setHeaders($headers);\n\n $result = json_decode($loginClient->request('GET')->getBody());\n $response = $result->{'nl.divide.iq'};\n\n if ($response->answer == self::ANSWER_SUCCESS) {\n Mage::getModel('core/config')\n ->saveConfig('stockbase_options/token/auth', $response->{'authentication_token'});\n Mage::getModel('core/config')\n ->saveConfig('stockbase_options/token/auth_expiration_date', $response->{'expiration_date'});\n\n return $response->{'authentication_token'};\n }\n\n return false;\n }", "public function authenticate()\n {\n if (!isset($_SERVER['PHP_AUTH_DIGEST']) || empty($_SERVER['PHP_AUTH_DIGEST'])) {\n\t\t\t//error_log(\"...\".$_SERVER['PHP_AUTH_DIGEST'].\"...\");\n\t\t\terror_log(\"Not Authorized\");\n\t\t\t$e = new Exception('Authentication required.', self::ERROR_DIGEST_MISSING, null);\n $this->handleError($e);\n }\n \n $data = $this->_parseDigest();\n\t\t\n\t\tif (!$data) {\n\t\t\t$e = new Exception('Invalid authorization digest.', self::ERROR_DIGEST_INVALID, null);\n $this->handleError($e); \n }\n\t\tif ($data['username']==\"anonymous\" || $data['username']==\"\") {\n\t\t\tZend_Registry::set('userID', -1);\n\t\t\treturn true;\n\t\t} else if (strpos($data['username'],\"uuid_\")===0) {\n\t\t\tZend_Registry::set('userID', $data['username']);\n\t\t\treturn true;\n\t\t}\n // Make sure the user exists.\n \n $knownUserData = mysql_query(\"SELECT * FROM `accounts` WHERE `username`='\".mysql_real_escape_string($data['username']).\"' OR `email`='\".mysql_real_escape_string($data['username']).\"'\") or die(mysql_error());\n //if (!isset($this->_users[$data['username']])) {\n if (mysql_num_rows($knownUserData)!==1) { \n\t\t\t$e = new Exception('Invalid credentials', self::ERROR_CREDENTIALS_INVALID, null);\n throw $e;\n }\n\t\t\n\t\t$knownUserData = mysql_fetch_assoc($knownUserData);\n\t\t// Save the username so we can use it for access control checks\n // in other scripts.\n Zend_Registry::set('username', $data['username']);\n \n // Generate the server response.\n $password = $knownUserData['lastKnownPassword']; //$this->_users[$data['username']];\n\t\tZend_Registry::set('userID', $knownUserData['userID']);\n\t\tZend_Registry::set('userIDEncrypted', $knownUserData['userIDEncrypted']);\n\t\t//check password & username against thinklg.com data\n\t\t\n\t\t\n $HA1 = md5($data['username'] . ':' . self::AUTH_REALM . ':' . $password);\n\t\t$HA2 = md5($_SERVER['REQUEST_METHOD'] . ':' . $data['uri']);\n\t\t$valid_response = md5(\n $HA1 // hash 1\n . ':' // separator\n . $data['nonce'] // nonce\n . ':' // separator\n . $data['nc'] // nonce count \n . ':' // separator\n . $data['cnonce'] // client nonce\n . ':' // separator\n . $data['qop'] // quality of protection\n . ':' // separator\n . $HA2 // hash 2\n );\n // Compare the server response to the client response.\n if ( $data['response'] != $valid_response ) {\n // The username is ok, but the password is wrong.\n $e = new Exception('Invalid credentials.', self::ERROR_CREDENTIALS_INVALID, null);\n throw $e;\n }\n }", "public function authenticateByApiTokenForWhm(string $username, string $apitoken): self;", "public function fetchAndAddSecurityHeaders() {\n\n /**\n * gets the security and sets it to header\n */\n $this->oSecurityService->setHttpServiceHandler($this->oHttpServiceHandler)->setParams();\n\n /**\n * add to header for next call\n */\n $this->oHttpServiceHandler->addAHeaders(\n $this->oSecurityService->getTokenHeaders()\n );\n\n return $this;\n }", "public function byCredentials(array $credentials)\n {\n return $this->auth->once($credentials);\n }", "public function setCredentials()\n\t{\n\t\t$settings_repo = new \\Kickapoo\\Repositories\\SettingRepository;\n\t\t$this->credentials = $settings_repo->socialCreds();\n\t}", "private function authWWW()\n {\n if (!$this->username)\n {\n throw new PhpSIPException(\"Missing auth username\");\n }\n \n if (!$this->password)\n {\n throw new PhpSIPException(\"Missing auth password\");\n }\n \n $qop_present = false;\n if (strpos($this->response,'qop=') !== false)\n {\n $qop_present = true;\n \n // we can only do qop=\"auth\"\n if (strpos($this->response,'qop=\"auth\"') === false)\n {\n throw new PhpSIPException('Only qop=\"auth\" digest authentication supported.');\n }\n }\n \n // realm\n $result = [];\n if (!preg_match('/^WWW-Authenticate: .* realm=\"(.*)\"/imU',$this->response, $result))\n {\n throw new PhpSIPException(\"Can't find realm in www-auth\");\n }\n \n $realm = $result[1];\n \n // nonce\n $result = [];\n if (!preg_match('/^WWW-Authenticate: .* nonce=\"(.*)\"/imU',$this->response, $result))\n {\n throw new PhpSIPException(\"Can't find nonce in www-auth\");\n }\n \n $nonce = $result[1];\n \n $ha1 = md5($this->username.':'.$realm.':'.$this->password);\n $ha2 = md5($this->method.':'.$this->uri);\n \n if ($qop_present)\n {\n $cnonce = md5(time());\n \n $res = md5($ha1.':'.$nonce.':00000001:'.$cnonce.':auth:'.$ha2);\n }\n else\n {\n $res = md5($ha1.':'.$nonce.':'.$ha2);\n }\n \n $this->auth = 'Authorization: Digest username=\"'.$this->username.'\", realm=\"'.$realm.'\", nonce=\"'.$nonce.'\", uri=\"'.$this->uri.'\", response=\"'.$res.'\", algorithm=MD5';\n \n if ($qop_present)\n {\n $this->auth.= ', qop=\"auth\", nc=\"00000001\", cnonce=\"'.$cnonce.'\"';\n }\n }", "public function execute($inputs = array(), $async = false, $store_results = true)\n {\n return new Google_Documents_ClientLoginAuthentication_Execution($this->session, $this, $inputs, $async, $store_results);\n }" ]
[ "0.60232025", "0.577109", "0.5610275", "0.56068283", "0.55111504", "0.5439042", "0.54227674", "0.5387815", "0.5367534", "0.5346518", "0.5341949", "0.53133327", "0.53030294", "0.5255298", "0.5207437", "0.51961064", "0.51726055", "0.5163502", "0.5152433", "0.51436985", "0.5135671", "0.5122915", "0.5122416", "0.5108645", "0.50874853", "0.50585514", "0.5055926", "0.5051933", "0.5040328", "0.50230616", "0.5014497", "0.49889994", "0.4977145", "0.49718034", "0.4967469", "0.49572107", "0.49542797", "0.49514067", "0.4944342", "0.49356368", "0.49333563", "0.49271816", "0.49226642", "0.4914989", "0.4912526", "0.4912425", "0.4912143", "0.4901949", "0.48979598", "0.4868787", "0.48653072", "0.48517275", "0.48454174", "0.48412204", "0.48052496", "0.47924304", "0.4779109", "0.47787598", "0.47687677", "0.47671723", "0.4763099", "0.47622907", "0.47588658", "0.47541314", "0.47527462", "0.47496545", "0.4741183", "0.4732411", "0.47320077", "0.47234493", "0.47091156", "0.4704484", "0.4703906", "0.46994838", "0.46985027", "0.46936294", "0.46927428", "0.46920383", "0.46920383", "0.46920383", "0.46894598", "0.4687962", "0.4685188", "0.4684209", "0.46837533", "0.46828997", "0.4678656", "0.46763325", "0.46560755", "0.46545944", "0.4653983", "0.46528146", "0.46519858", "0.4650055", "0.46474913", "0.46462616", "0.46458107", "0.46426445", "0.46412706", "0.46370953" ]
0.49549788
36
Assigns the adapter to be used during migrations
public function setAdapter(\Phig\AdapterInterface $adapter) { $this->adapter = $adapter; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setAdapter(AdapterInterface $adapter);", "abstract protected function getAdapter();", "abstract protected function getAdapter();", "abstract protected function createAdapter();", "abstract protected function getDefaultAdapter(): AdapterInterface;", "public function setConnection(AdapterInterface $adapter);", "public function createAdapter() : AdapterInterface;", "public function adapter(string $name): AdapterInterface;", "public function getDbAdapter();", "protected function _getDatabaseAdapter()\n {\n // initialize the Adapter\n $adapter = new TDProject_Core_Model_Auth_Adapter_Database(\n $this->getUsername(),\n $this->getPassword()\n );\n // add it to the internal array\n $this->_adapters[] = $adapter->setContainer($this->getContainer());\n }", "public function get_adapter()\n {\n return $this->_adapter;\n }", "public function setAdapterMethod($adapter);", "public static function adapter()\n {\n return self::connectionManager()->getAdapter(static::connectionName());\n }", "public function getAdapter()\n {\n return $this->adapter;\n }", "public function getAdapter()\n {\n return $this->adapter;\n }", "public function getAdapter()\n {\n return $this->adapter;\n }", "public function getAdapter()\n {\n return $this->adapter;\n }", "public function getAdapter()\n {\n return $this->adapter;\n }", "public function getAdapter()\n {\n return $this->adapter;\n }", "public function getAdapter()\n {\n return $this->adapter;\n }", "public function getAdapter()\n {\n return $this->adapter;\n }", "public function setAdapter(Adapter $adapter) : void\n {\n $this->adapter = $adapter;\n }", "public function getAdapter()\n\t{\n\t\treturn $this->config['adapter'];\n\t}", "public function getAdapter();", "public function getAdapter();", "public function setAdapter(AdapterInterface $adapter)\r\n {\r\n\r\n }", "public function getConnection(): AdapterInterface\n {\n }", "public function getAdapter(): AdapterInterface\n {\n return $this->adapter ?? $this->adapter = $this->getDefaultAdapter();\n }", "public function getAdapter()\n\t{\n\t\treturn $this->adapter;\n\t}", "public function getAdapter()\n\t{\n\t\treturn $this->adapter;\n\t}", "public function getAdapter(): AbstractAdapter\n {\n return Db::getAdapter($this->adapter);\n }", "public function adapter( $adapter = null )\n\t{\n\t\treturn $this->useAdapter( $adapter );\n\t}", "public function getAdapterName()\n {\n return 'Db';\n }", "protected function getAdapter()\n {\n return $this->getConnection()->getConnection();\n }", "protected function getAdapter()\n {\n return $this->getConnection()->getConnection();\n }", "public function getConnection(): AdapterInterface;", "public function getAdapter() : Adapter\n {\n return $this->adapter;\n }", "public function setDefaultAdapter() {\n\t\t$this->setAdapter(new Client());\n\t}", "protected function _setupDatabaseAdapter()\n {\n $zl = Zend_Registry::get('Zend_Locale');\n $this->_db = Zend_Registry::get('db4');\n\n parent::_setupDatabaseAdapter();\n }", "public function getAdapter()\r\n {\r\n }", "public static function setTestAdapter(): void\n {\n self::$adapter = new KvkTestAdapter();\n }", "public static function setProductionAdapter(): void\n {\n self::$adapter = new KvkAdapter();\n }", "public function getAdapter()\n {\n if($this->Adapter !== null)\n {\n return $this->Adapter;\n }\n $db = new DbAdapter();\n return $db->Adapter();\n }", "public function getDBAdapter()\n {\n if (null === $this->_db) {\n $config = $this->getConfig();\n try {\n $this->_db = $this->getAdapter()->initPDO(\n $config->host,\n $config->username,\n $config->password,\n $config->dbname\n );\n\n $sql = \"CREATE TABLE IF NOT EXISTS `\" . $config->table . \"`(\n `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT ,\n `migration` varchar(22) NOT NULL ,\n PRIMARY KEY (`id`)\n )\";\n if (!$this->_db->query($sql)) {\n $errorInfo = $this->_db->errorInfo();\n throw new Exception(\n $errorInfo[0] . ' [' . $errorInfo[1] . '] ' . $errorInfo[2]\n );\n }\n\n } catch (PDOException $e) {\n throw new Exception('Database error: ' . $e->getMessage());\n }\n }\n\n return $this->_db;\n }", "public static function setDefaultAdapter(DbAdapterInterface $dbAdapter = null): void {\r\n self::$defaultAdapter = $dbAdapter;\r\n }", "public function getAdapter(string $connection = null): DBAdapter;", "public function getAdapter(){\n return $this->sm->get('Zend\\Db\\Adapter\\Adapter');\n }", "protected function setMigrator()\n {\n $this->migrator = App::make('migrator');\n }", "public function getAdapterConnection(): ?string\n {\n return $this->adapter;\n }", "public function setAdapter($adapter_name)\n {\n $adapterClass = \"\\Zrashwani\\NewsScrapper\\Adapters\\\\\".$adapter_name.\"Adapter\";\n if (class_exists($adapterClass)) {\n $this->adapter = new $adapterClass();\n } else {\n $this->adapter = null;\n }\n\n return $this;\n }", "public function __construct($adapter = null)\n {\n $this->adapter = $adapter;\n $this->createTable();\n }", "protected function _getDatabaseAdapter($name)\n {\n if (class_exists($name)) {\n $adapter = $name;\n } else {\n $adapter = '\\Engine\\Db\\Adapter\\\\' . ucfirst($name);\n if (!class_exists($adapter)) {\n $adapter = '\\Phalcon\\Db\\Adapter\\\\' . ucfirst($name);\n if (!class_exists($adapter)) {\n return false;\n }\n }\n }\n\n return $adapter;\n }", "public static function setDefaultAdapter($adapter, $options = array()) \n {\n self::$_defaultAdapter = self::factory($adapter, $options);\n }", "public function getAdapterConnection(): string\n {\n return $this->adapter;\n }", "public function setAdapterType($adapterType)\n {\n \t$this->adapterType = $adapterType;\n }", "abstract public function adapter(): FeatureAdapter;", "public static function getDefaultAdapter()\n {\n return self::getAdapter('default');\n }", "protected function fixAdapter(AdapterInterface $adapter = null)\n {\n if ($adapter === null) {\n $adapter = new Adapter\\NullAdapter;\n }\n return $adapter;\n }", "abstract protected function getAdapters(): array;", "private function init()\n {\n if (!$this->adapter instanceof CacheAdapterInterface) {\n $this->adapter = app($this->defaultAdapter);\n }\n }", "public function __construct() {\n $this->adapter = new PDOAdapter();\n }", "protected function _checkAdapter()\n {\n $notDefined = !is_object($this->_adapter);\n $isAdapter = $this->_adapter instanceof AdapterInterface;\n\n if ($notDefined || !$isAdapter) {\n throw new InvalidArgumentException(\n \"You need to set the database adapter for this schema loader.\"\n );\n }\n }", "function addAdapter(\\Tecnocreaciones\\Bundle\\BoxBundle\\Model\\Adapter\\AdapterInterface $adapter)\n {\n if($this->adapters === null){\n $this->adapters = array();\n }\n $adapter->setContainer($this->container);\n $this->adapters[] = $adapter;\n }", "static public function proper_adapter_name($adapter_name)\n {\n $adapter_name = strtolower($adapter_name);\n \n switch ($adapter_name) {\n case 'mysql':\n return 'MySql';\n break;\n \n case 'sqlite':\n return 'Sqlite';\n break;\n \n default:\n return $adapter_name;\n break;\n }\n }", "public function getAdapterClass() {\n return $this->adapterClass;\n }", "public function getAdapter()\n {\n if (!$this->adapter instanceof AbstractAdapter) {\n $adapter = $this->getOption('adapter');\n $class = $this->getOption($adapter, 'class');\n if ($class) {\n $options = (array)$this->getOption($adapter, 'options');\n } else {\n $class = $this->getOption($adapter);\n $options = [];\n }\n\n if ($class) {\n $this->adapter = new $class($options);\n } else {\n $this->adapter = new DefaultAdapter($options);\n }\n }\n\n return $this->adapter;\n }", "protected function createAdapter($config)\n\t{\n\t\t$adapter = new Adapter($config);\n\t\t$this->setDbAdapter($adapter);\n\t}", "protected function _setAclAdapter() {\n\t\tlist($plugin, $name) = pluginSplit(Configure::read('Visualisation.Acl.classname'));\n\t\t$this->Acl->adapter($name);\n\t}", "public function setRequestAdapter($adapter)\n {\n $this->connector->setAdapter($adapter);\n }", "public static function setAdapter(AbstractApiAdapter $adapter): void\n {\n self::$adapter = $adapter;\n }", "public function getDatabaseAdapter()\n {\n return $this->oDatabase;\n }", "public function setSqlAdapter(SqlAdapter $sqlAdapter) {\n\t\t$this->sqlAdapter = $sqlAdapter;\n\t}", "abstract protected function doGetAdapter();", "abstract public function adapter(): ReleaseAdapter;", "public function getDbAdapter($name = 'default')\n {\n if (!isset($this->_dbadapters[$name])) {\n try {\n $this->_dbadapters[$name] = Wacow_Application_Resource::getDbAdapter($this->_dbOptions->$name);\n } catch (Exception $e) {\n throw $e;\n }\n\n if ('default' === $name) {\n Zend_Db_Table::setDefaultAdapter($this->_dbadapters[$name]);\n }\n\n if (!$this->_app->debugMode) {\n $metacacheStorage = 'File';\n $metacacheLifetime = null;\n $metacacheOptions = array('cache_dir' => ':cachePath/tablemeta');\n if (isset($this->_dbOptions->$name->metacache)) {\n $metacacheSettings = $this->_dbOptions->$name->metacache;\n $metacacheStorage = isset($metacacheSettings->storage) ? $metacacheSettings->storage : 'File';\n $metacacheLifetime = isset($metacacheSettings->lifetime) ? (int) $metacacheSettings->lifetime : null;\n if (isset($metacacheSettings->options)) {\n $metacacheOptions = $metacacheSettings->options;\n }\n }\n\n $setting = array(\n 'frontendName' => 'Core',\n 'backendName' => $metacacheStorage,\n 'frontendOptions' => array('lifetime' => $metacacheLifetime, 'automatic_serialization' => true,),\n 'backendOptions' => Wacow_Application::translatePath($metacacheOptions)->toArray(),\n );\n $cache = Wacow_Application_Resource::getCache($setting);\n\n Zend_Db_Table::setDefaultMetadataCache($cache);\n }\n }\n return $this->_dbadapters[$name];\n }", "private function getDefaultConnection()\n {\n # get the selected adapter to be our basis\n $selected_adapter = config()->app->db_adapter;\n\n # here, check selected adapter if empty, then\n # disable this provider\n if (strlen($selected_adapter) == 0 || $selected_adapter === false) {\n return $this;\n }\n\n return $this->connection($selected_adapter);\n }", "public function getAdapter()\n {\n if (!$this->hasAdapter()) {\n return null;\n }\n\n if (!isset($this->adapter)) {\n $this->adapter = $this->sm->get('Zend\\Db\\Adapter\\Adapter');\n }\n\n return $this->adapter;\n }", "public function setAdapter(AdapterInterface $adapter): self\n {\n $this->adapter = $adapter;\n\n return $this;\n }", "public function __construct(AdapterInterface $adapter)\n {\n $this->adapter = $adapter;\n }", "public function __construct(AdapterInterface $adapter)\n {\n $this->adapter = $adapter;\n }", "public function setAdapter(AdapterInterface $adapter)\n {\n $this->adapter = $adapter;\n return $this;\n }", "public static function getDefaultAdapter() \n {\n if (!self::$_defaultAdapter instanceof Adapter) {\n self::setDefaultAdapter(self::$_defaultAdapter);\n }\n return self::$_defaultAdapter;\n }", "protected function registerAdapterFactory()\n {\n $this->app->singleton('digitalocean.adapterfactory', function () {\n return new AdapterFactory();\n });\n\n $this->app->alias('digitalocean.adapterfactory', AdapterFactory::class);\n }", "public function getAdapterName()\n {\n return $this->adapterName;\n }", "public function adapters(): AdapterCollectionInterface;", "public static function adapter($name = null) {\n\t\tif (!$name) {\n\t\t\tif (!$names = array_keys(static::$_configurations)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t$name = end($names);\n\t\t}\n\t\treturn parent::adapter($name);\n\t}", "public static function setDefaultAdapter (Zend_Db_Adapter_Abstract $db) {\n self::$db = $db;\n }", "public function getAdapter()\n\t{\n\t\treturn $this->req->getAdapter();\n\t}", "public static function setAdapterBroker(Broker $broker) \n {\n self::$_adapterBroker = $broker;\n }", "protected function _getEntityAdapter()\n {\n if (!$this->_entityAdapter) {\n $validTypes = array('storelocator' => array('model' => 'storelocator/import_entity_data', 'Label' => 'Storelocator'));\n\n\n if (isset($validTypes[$this->getEntity()])) {\n try {\n $this->_entityAdapter = Mage::getModel($validTypes[$this->getEntity()]['model']);\n } catch (Exception $e) {\n Mage::logException($e);\n Mage::throwException(\n Mage::helper('storelocator')->__('Invalid entity model')\n );\n }\n\n if (!($this->_entityAdapter instanceof Mage_ImportExport_Model_Import_Entity_Abstract)) {\n Mage::throwException(\n Mage::helper('storelocator')->__('Entity adapter object must be an instance of Mage_ImportExport_Model_Import_Entity_Abstract')\n );\n }\n } else {\n Mage::throwException(Mage::helper('storelocator')->__('Invalid entity'));\n }\n\n // check for entity codes integrity\n if ($this->getEntity() != $this->_entityAdapter->getEntityTypeCode()) {\n Mage::throwException(\n Mage::helper('storelocator')->__('Input entity code is not equal to entity adapter code')\n );\n }\n\n $this->_entityAdapter->setParameters($this->getData());\n }\n\n return $this->_entityAdapter;\n }", "public function getSqlAdapter(): SqlAdapter {\n\t\treturn $this->sqlAdapter;\n\t}", "public function setAdapter( $adapter )\n\t{\n\t\t$adapter = strtolower( $adapter );\n\t\tif ( $adapter == 'curl' || $adapter == 'socket' ) {\n\t\t\t$this->config['adapter'] = $adapter;\n\t\t\t// We need to reset the processor too. This is quite crude and messy, but we need to do it.\n\t\t\tif ( function_exists( 'curl_init' ) && ( $adapter == 'curl' )\n\t\t\t\t && ! ( ini_get( 'safe_mode' ) || ini_get( 'open_basedir' ) ) ) {\n\t\t\t\t$this->processor = new PhpSmugCurlRequestProcessor;\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$this->processor = new PhpSmugSocketRequestProcessor;\n\t\t\t}\n\t\t}\n\t}", "protected function getPersistenceAdapter() {\r\n if ($this->persistenceAdapter !== null) {\r\n return $this->persistenceAdapter;\r\n }\r\n throw new Exception('No persistence adapter set. This must be done in the setUp() function of a test class');\r\n }", "private static function defaultAdapters()\n {\n return self::filterByAvailability([\n new ApacheAdapter(),\n new EnvConstAdapter(),\n new ServerConstAdapter(),\n new PutenvAdapter(),\n ]);\n }", "public static function getAdapter(): AbstractApiAdapter\n {\n return self::$adapter;\n }", "public static function getAdaptableClass()\n {\n return DMySQL::class;\n }", "public static function getAdaptableClass()\n {\n return DMySQL::class;\n }", "public function getAdapterClassName() {\n return $this->adapterClassName;\n }", "public function getAdapterType();", "protected function setUp(): void\n {\n $this->servlet_address = \\SolubleTestFactories::getJavaBridgeServerAddress();\n $this->adapter = new Adapter([\n 'driver' => 'Pjb62',\n 'servlet_address' => $this->servlet_address,\n ]);\n }" ]
[ "0.68746096", "0.65750724", "0.65750724", "0.65749216", "0.6572814", "0.6530212", "0.6508116", "0.645123", "0.6425074", "0.63843024", "0.6337954", "0.6335921", "0.62712854", "0.6251806", "0.6251806", "0.6251806", "0.6251806", "0.6251806", "0.6251806", "0.6251806", "0.6251806", "0.6245391", "0.6243894", "0.62322354", "0.62322354", "0.6225325", "0.6206149", "0.61965805", "0.6177226", "0.6177226", "0.61545527", "0.61508495", "0.6150096", "0.61112636", "0.61112636", "0.6110104", "0.60534227", "0.60403174", "0.60138553", "0.5977544", "0.5948547", "0.59115386", "0.59005344", "0.58618605", "0.5842332", "0.58270913", "0.58110976", "0.5810025", "0.5796207", "0.57823914", "0.57725495", "0.5770997", "0.5764871", "0.5756051", "0.5676033", "0.5675623", "0.5653859", "0.56516385", "0.5639329", "0.56203693", "0.5619326", "0.55992883", "0.5587669", "0.5585524", "0.55853224", "0.5584617", "0.557916", "0.5571953", "0.55719423", "0.55598456", "0.5558831", "0.5545052", "0.5483699", "0.54780906", "0.5464927", "0.5455338", "0.54435045", "0.5441916", "0.54181147", "0.54181147", "0.54157543", "0.5415503", "0.5412879", "0.5404789", "0.54029053", "0.5387404", "0.5383678", "0.5369635", "0.53666776", "0.5355627", "0.53400505", "0.5333587", "0.53274083", "0.5326705", "0.5324863", "0.53234607", "0.53234607", "0.5305128", "0.52967757", "0.52953994" ]
0.62140363
26
Returns the assigned adapter
public function getAdapter() { return $this->adapter; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getAdapter()\n {\n return $this->adapter;\n }", "public function getAdapter()\n {\n return $this->adapter;\n }", "public function getAdapter()\n {\n return $this->adapter;\n }", "public function getAdapter()\n {\n return $this->adapter;\n }", "public function getAdapter()\n {\n return $this->adapter;\n }", "public function getAdapter()\n {\n return $this->adapter;\n }", "public function getAdapter()\n {\n return $this->adapter;\n }", "public function getAdapter()\n {\n return $this->adapter;\n }", "public function get_adapter()\n {\n return $this->_adapter;\n }", "public function getAdapter()\n\t{\n\t\treturn $this->config['adapter'];\n\t}", "public function getAdapter();", "public function getAdapter();", "public function getAdapter() : Adapter\n {\n return $this->adapter;\n }", "abstract protected function getAdapter();", "abstract protected function getAdapter();", "public function getAdapter(): AdapterInterface\n {\n return $this->adapter ?? $this->adapter = $this->getDefaultAdapter();\n }", "public function getAdapter()\n\t{\n\t\treturn $this->req->getAdapter();\n\t}", "public function getAdapter()\r\n {\r\n }", "public static function adapter()\n {\n return self::connectionManager()->getAdapter(static::connectionName());\n }", "protected function getAdapter()\n {\n return $this->getConnection()->getConnection();\n }", "protected function getAdapter()\n {\n return $this->getConnection()->getConnection();\n }", "public function getAdapterType();", "function getAdapterName();", "public function getAdapter()\n {\n if($this->Adapter !== null)\n {\n return $this->Adapter;\n }\n $db = new DbAdapter();\n return $db->Adapter();\n }", "public function getAdapterName()\n {\n return $this->adapterName;\n }", "abstract protected function getDefaultAdapter(): AdapterInterface;", "public function getAdapter()\n {\n if (!$this->hasAdapter()) {\n return null;\n }\n\n if (!isset($this->adapter)) {\n $this->adapter = $this->sm->get('Zend\\Db\\Adapter\\Adapter');\n }\n\n return $this->adapter;\n }", "public function getAdapterConnection(): string\n {\n return $this->adapter;\n }", "public function getAdapter(): AbstractAdapter\n {\n return Db::getAdapter($this->adapter);\n }", "public function getAdapter(){\n return $this->sm->get('Zend\\Db\\Adapter\\Adapter');\n }", "public function getAdapter()\n {\n if (!$this->adapter instanceof AbstractAdapter) {\n $adapter = $this->getOption('adapter');\n $class = $this->getOption($adapter, 'class');\n if ($class) {\n $options = (array)$this->getOption($adapter, 'options');\n } else {\n $class = $this->getOption($adapter);\n $options = [];\n }\n\n if ($class) {\n $this->adapter = new $class($options);\n } else {\n $this->adapter = new DefaultAdapter($options);\n }\n }\n\n return $this->adapter;\n }", "public static function getDefaultAdapter() \n {\n if (!self::$_defaultAdapter instanceof Adapter) {\n self::setDefaultAdapter(self::$_defaultAdapter);\n }\n return self::$_defaultAdapter;\n }", "public function getAdapterConnection(): ?string\n {\n return $this->adapter;\n }", "public function getAdapter($identifier)\n {\n if ($this->hasAdapter($identifier) ) {\n return $this->adapters[$identifier];\n }\n }", "public function getAdapterClass() {\n return $this->adapterClass;\n }", "abstract protected function doGetAdapter();", "public function adapter( $adapter = null )\n\t{\n\t\treturn $this->useAdapter( $adapter );\n\t}", "public function getAdapterMethod();", "public function getAdapters()\n {\n return $this->adapters;\n }", "public static function getAdapter(): AbstractApiAdapter\n {\n return self::$adapter;\n }", "public static function getDefaultAdapter()\n {\n return self::getAdapter('default');\n }", "public function adapter(string $name): AdapterInterface;", "public static function getAdapterBroker() \n {\n if (self::$_adapterBroker === null) {\n self::$_adapterBroker = self::_getDefaultAdapterBroker();\n }\n return self::$_adapterBroker;\n }", "protected static function _getDefaultAdapterBroker()\n {\n $broker = new AdapterBroker();\n return $broker;\n }", "abstract protected function getAdapters(): array;", "public function getReadConnection(): AdapterInterface;", "protected function _getReadAdapter()\n {\n return $this->_getConnection();\n }", "public function getAdapterClassName() {\n return $this->adapterClassName;\n }", "public function createAdapter() : AdapterInterface;", "public function getAdapter(): \\Sumrak\\TelegramBot\\ApiAdapterInterface\n {\n return $this->apiAdapter;\n }", "public function getAdapterClassName() {\n if ($this->class) {\n return $this->class;\n } elseif (!$this->getInterface()) {\n return $this->getClassName();\n } else return null;\n }", "public function getDbAdapter();", "public function getConnection(): AdapterInterface;", "public function getConnection(): AdapterInterface\n {\n }", "public function getAdapter()\n {\n return $this->_pdo;\n }", "public function getBackend()\n {\n /** @var ProtectedAdapter $backend */\n $backend = parent::getBackend();\n return $backend;\n }", "public function getDatabaseAdapter()\n {\n return $this->oDatabase;\n }", "function gatekeeper(?string $adapterName = null): AdapterInterface\n\t{\n\t\tstatic $gatekeeper;\n\n\t\tif($gatekeeper === null)\n\t\t{\n\t\t\t$gatekeeper = Application::instance()->getContainer()->get(Gatekeeper::class);\n\t\t}\n\n\t\treturn $gatekeeper->adapter($adapterName);\n\t}", "public function getAdapterFullName()\n {\n return '\\ZendQueue\\Adapter\\\\' . $this->getAdapterName();\n }", "private function getDefaultConnection()\n {\n # get the selected adapter to be our basis\n $selected_adapter = config()->app->db_adapter;\n\n # here, check selected adapter if empty, then\n # disable this provider\n if (strlen($selected_adapter) == 0 || $selected_adapter === false) {\n return $this;\n }\n\n return $this->connection($selected_adapter);\n }", "public static function getDefaultAdapter(): ?DbAdapterInterface {\r\n return self::$defaultAdapter;\r\n }", "public function getAdapter() {\n\t\t\t# Default StyleSheet\n\t\t\tif (! $_REQUEST[\"stylesheet\"]) $_REQUEST[\"stylesheet\"] = 'network.adapter.xsl';\n\t\t\t$response = new \\HTTP\\Response();\n\t\n\t\t\t# Initiate Adapter Object\n\t\t\t$adapter = new \\Network\\Adapter();\n\t\n\t\t\tif (isset($_REQUEST['mac_address']) && strlen($_REQUEST['mac_address']) > 0) {\n\t\t\t\t$adapter->get($_REQUEST['mac_address']);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif (preg_match('/^([\\w\\-]+)\\.(.*)$/',$_REQUEST['host_name'],$matches)) {\n\t\t\t\t\t$_REQUEST['host_name'] = $matches[1];\n\t\t\t\t\t$_REQUEST['domain_name'] = $matches[2];\n\t\t\t\t}\n\t\t\t\tif (isset($_REQUEST['domain_name'])) {\n\t\t\t\t\t$domain = new \\Network\\Domain();\n\t\t\t\t\tif ($domain->get($parameters['domain_name'])) {\n\t\t\t\t\t\t$parameters['domain_id'] = $domain->id;\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t $this->error(\"domain not found\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (isset($_REQUEST['host_name'])) {\n\t\t\t\t\t$host = new \\Network\\Host();\n\t\t\t\t\t$host->get($parameters['host_name']);\n\t\t\t\t\tif ($host->id) {\n\t\t\t\t\t\t$parameters['host_id'] = $host->id;\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t $this->error(\"host not found\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (! isset($_REQUEST['name'])) $this->error(\"name required\");\n\t\t\t\n\t\t\t\t$adapter->get($host->id,$_REQUEST['name']);\n\t\t\t}\n\t\n\t\t\t# Error Handling\n\t\t\tif ($adapter->error()) $this->error($adapter->error());\n\t\t\telseif ($adapter->id) {\n\t\t\t\t$response->adapter = $adapter;\n\t\t\t\t$response->success = 1;\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$response->success = 0;\n\t\t\t\t$response->error = \"Adapter not found\";\n\t\t\t}\n\t\n\t\t\tapi_log('network',$_REQUEST,$response);\n\t\n\t\t\t# Send Response\n\t\t\tprint $this->formatOutput($response);\n\t\t}", "public function getWriteConnection(): AdapterInterface;", "public function getAdapters()\n {\n return $this->storageAdapters;\n }", "public function adapters(): AdapterCollectionInterface;", "public function getAdapterVersion()\n {\n return $this->adapterVersion;\n }", "public function getAdapter($database = null)\n {\n // check if the DB is valid\n $database = $this->isValidDb ( $database, true );\n if (! isset ( $database ) && ! isset ( $this->_defaultDatabase ))\n {\n return null;\n }\n elseif (! isset ( $database ) && isset ( $this->_defaultDatabase ))\n {\n $database = $this->_defaultDatabase;\n\n }\n if (! isset ( $this->_databases [$database] ) && $this->getAdapterType ( $database ) !== null)\n {\n\n $this->_databases [$database] = Zend_Db::factory ( $this->getAdapterType ( $database ), $this->getParams ( $database ) );\n //Zend_Debug::dump($this->_databases[$database], 'default db!');exit;\n }\n return $this->_databases [$database];\n }", "public function get($name)\n {\n if (!isset($this->adapters[$name])) {\n throw new \\InvalidArgumentException(sprintf('No Adapter with name \"%s\" is registered.', $name));\n }\n\n return $this->adapters[$name];\n }", "public function getDriver()\n {\n return $this->_list->getDriver();\n }", "public function getAdapter(string $name, $disabledAlso = false)\n {\n if ($name == null || strlen($name) < 1)\n return null;\n\n foreach ($this->adapters as $class) {\n $id = $class::getId();\n if ($id == $name) {\n // Adapter found - does it need to be enabled?\n if (!$disabledAlso) {\n $metadata = $this->getMetadata($id);\n if ($metadata == null || $metadata->getEnabled()) {\n return $class;\n }\n } else {\n return $class;\n }\n }\n }\n\n return null;\n }", "abstract protected function createAdapter();", "public static function resetAdapterBroker()\n {\n self::$_adapterBroker = self::_getDefaultAdapterBroker();\n return self::$_adapterBroker;\n }", "public function getEngine()\n {\n $adapter = $this->getAdapter();\n\n if ($adapter) {\n return $adapter;\n }\n\n return ucfirst($this->dsn->scheme);\n }", "public function getPasswordAdapter()\n {\n return $this->adapter;\n }", "public function getAdapter(): Filesystem\n {\n return $this->adapter;\n }", "protected function getAdapter(object $container): Adapter\n {\n return $container->get(Adapter::class);\n }", "public function getAdapterSpecification() {\n return $this->getAdapterSpecs();\n }", "public function resetAdapter()\n {\n return $this->adapterInUse = $this->getDefaultAdapter();\n }", "public function getAdapter()\n {\n if (null === $this->adapter) {\n $connection = new RedisService();\n\n $this\n ->checkConnect($connection)\n ->checkAuth($connection)\n ->checkIndex($connection)\n ;\n\n $connection->setOption(RedisService::OPT_PREFIX, $this->prefix);\n\n $this->setSerializer($connection);\n $this->adapter = $connection;\n }\n\n return $this->adapter;\n }", "public function getSqlAdapter(): SqlAdapter {\n\t\treturn $this->sqlAdapter;\n\t}", "public function getCacheAdapter()\n {\n if (!$this->cacheAdapter)\n {\n throw new AppException(\"No cache adapter object set in controller\");\n }\n\n return $this->cacheAdapter;\n }", "public function connect()\n {\n return $this->adapter->attach();\n }", "private static function _getAdapterFromPool($type = 'master')\n {\n \t// Get server pool from the registry\n \t$registry = Zend_Registry::getInstance();\n\t $servers = $registry->get($type.'_servers');\n\t \n \t// Pick a random connection until we have an active connection\n \t$unconnected = true;\n \t$attempts = array();\n\t\tdo {\n\t \t$id = rand(1, sizeof($servers));\n\t \tif ($servers[$id] != null) {\n\t \t\t$db = $servers[$id];\n\t\t\t\t$db->getConnection();\n\t \t\t//$this->_db = $servers[$id];\n\t \t\t//$this->_db->getConnection();\n\t \t\t//$this->setDefaultAdapter($this->_db);\n \t\t\t$unconnected = false;\n \t\t\tlogStd('db', 'Connected to '.$type.': '.$id.' of '.sizeof($servers));\n\t \t} else {\n\t \t\tif (array_key_exists($id, $attempts)){\n\t \t\t\tlogStd('db', 'Skipping failed connection to '.$type.': '.$id.' of '.sizeof($servers));\n\t \t\t} else {\n\t\t \t\t$attempts[$id]=$id;\n\t\t \t\tlogStd('db', 'Connection failed to '.$type.': '.$id.' of '.sizeof($servers));\n\t\t \t\t$id=null;\n\t \t\t}\t\t\n\t \t}\n\t } while ($unconnected && sizeof($attempts)<sizeof($servers)); //ensure we don't loop forever\n\t \t\t\n \t//return $id;\n \treturn $db;\n }", "public function getDriver()\n {\n return $this->_driver;\n }", "public function getDriver()\n {\n return $this->_driver;\n }", "public function chosen() : ?Connection\n {\n if ($this->helperSet->has($this->helperName)) {\n $connectionHelper = $this->helperSet->get($this->helperName);\n\n if ($connectionHelper instanceof ConnectionHelper) {\n return $connectionHelper->getConnection();\n }\n }\n\n return null;\n }", "public function driver()\n {\n return $this->driver;\n }", "public function adapter($type)\n {\n\n foreach($this->storageAdapters as $instance) {\n $type = ucwords($type);\n $lookup = \"\\\\{$type}\\\\\";\n\n if(stripos(get_class($instance), $lookup) !== false) {\n return $instance;\n }\n }\n\n throw new StorageException(\"$type adapter could not be found as registered on the manager\");\n }", "protected static function getAdapter($adapter, $options = array())\n {\n if ($options instanceof Zend_Config) {\n $options = $options->toArray();\n }\n\n if (!class_exists($adapter)) {\n require_once 'Zend/Loader.php';\n Zend_Loader::loadClass($adapter);\n }\n \n return new $adapter($options);\n }", "public static function getAuthAdapter() {\n\t\tif (null == self::$_authAdapter) {\n\t\t\tthrow new Celsus_Exception(\"Auth adapter has not been set!\");\n\t\t}\n\t\treturn self::$_authAdapter;\n\t}", "Public Function getDriver() { Return $this->driver; }", "public function getDriver()\n {\n return $this->driver;\n }", "public function getAdapterName()\n {\n return 'Db';\n }", "public function getOutputAdapterInstance()\n {\n $class = $this->getOutputAdapterClass();\n $adapter = new $class($this);\n return $adapter;\n }", "public static function getAdapter($accessType = 'write')\n {\n \tif ($accessType == 'read' && !self::$_isInTransaction) {\n \t\tlogStd($accessType, 'Slave');\n \t\treturn self::_getAdapterFromPool('slave');\n \t}\n \telse\n \t{\n \t\tlogStd($accessType, 'Master');\n \t\treturn self::_getAdapterFromPool();\n \t}\n \t\n }", "final public function getDriver() {\n return $this->driver;\n }", "abstract public function adapter(): ReleaseAdapter;", "public function get_driver()\n\t{\n\t\treturn $this->driver;\n\t}", "public function getDriver() {\n return $this->_driver;\n }" ]
[ "0.7787258", "0.7787258", "0.7787258", "0.7787258", "0.7787258", "0.7787258", "0.7787258", "0.7787258", "0.7725353", "0.76880276", "0.76491064", "0.76491064", "0.76365167", "0.7589357", "0.7589357", "0.7585564", "0.7583257", "0.747719", "0.74078864", "0.7236702", "0.7236702", "0.7129471", "0.707007", "0.7052421", "0.70380634", "0.6996345", "0.69928116", "0.6992657", "0.6984947", "0.6973203", "0.6937638", "0.6927844", "0.69221765", "0.691504", "0.6844283", "0.68192977", "0.67738426", "0.67306614", "0.67142093", "0.670329", "0.66934973", "0.6580299", "0.6547747", "0.6470081", "0.64324814", "0.63206303", "0.63106203", "0.6291517", "0.62907755", "0.6285223", "0.62663764", "0.62537605", "0.6241118", "0.618791", "0.6181042", "0.6139645", "0.61000603", "0.6091167", "0.6071954", "0.6069875", "0.6067509", "0.60383177", "0.6015674", "0.60079217", "0.59943944", "0.5993617", "0.59935915", "0.598983", "0.5985933", "0.59858215", "0.59549814", "0.59451705", "0.5944518", "0.59200233", "0.5888755", "0.588496", "0.5868536", "0.5826448", "0.58018154", "0.5764992", "0.57638705", "0.573951", "0.5737504", "0.57243794", "0.57243794", "0.57234544", "0.57155275", "0.57059187", "0.5689813", "0.5682275", "0.5680817", "0.56787026", "0.56583226", "0.5655788", "0.5654185", "0.56532514", "0.56495506", "0.56460226", "0.56410795" ]
0.786526
1
Assigns the filter iterator to be used during migrations
public function setFilter(\FilterIterator $filter) { $this->filter = $filter; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract public function prepareFilters();", "private function filters() {\n\n\n\t}", "public function getIterator()\n {\n return new EntityFilterIterator($this->storage);\n }", "private static function _getFilter() {}", "function _dotgo_filter_prepare() {\n\n}", "public function setFilter($filter){ }", "public function setupFilterRules()\n { }", "protected function setFilterArray() {\n $primary_keys = getPrimaryKeys($this->table_name);\n foreach ($primary_keys as $pk) {\n if (isset($_GET[$pk])) {\n $this->filter[$pk] = Mysql::SQLValue($_GET[$pk]);\n }\n }\n }", "protected function set_filters() {\n\t\t# Ignore all items with undefined price\n\t\t$this->generator->addFilter(\n\t\t\tfunction (\n\t\t\t\tarray $sf_product\n\t\t\t) {\n\t\t\t\t$sf_product = reset( $sf_product );\n\n\t\t\t\t/** @var Product $sf_product */\n\t\t\t\treturn ! empty( $sf_product->get_price() );\n\t\t\t}\n\t\t);\n\t}", "public function addFilters()\n {\n }", "private function setFilter()\n\t{\n\t\t// get filter values\n\t\t$this->filter['language'] = ($this->getParameter('language', 'array') != '') ? $this->getParameter('language', 'array') : BL::getWorkingLanguage();\n\t\t$this->filter['application'] = $this->getParameter('application');\n\t\t$this->filter['module'] = $this->getParameter('module');\n\t\t$this->filter['type'] = $this->getParameter('type', 'array');\n\t\t$this->filter['name'] = $this->getParameter('name');\n\t\t$this->filter['value'] = $this->getParameter('value');\n\n\t\t// build query for filter\n\t\t$this->filterQuery = BackendLocaleModel::buildURLQueryByFilter($this->filter);\n\t}", "private function setSearchFilters()\n\t{\n\t\tif(sizeof($this->searchFilters) > 0)\n\t\t{\n\t\t\t$this->taskSearchHelperDA->setSearchFilters($this->searchFilters);\n\t\t}\n\t}", "public function __construct()\n {\n $this->setupFilters();\n }", "abstract public function filters();", "public function getFilters(): FilterCollection;", "public function register_filters() {\n\n\t\t}", "private function setFilter(): void\n {\n // start date is set\n if ($this->getRequest()->query->has('start_date') && $this->getRequest()->query->get('start_date', '') !== '') {\n // redefine\n $startDate = $this->getRequest()->query->get('start_date', '');\n\n // explode date parts\n $chunks = explode('/', $startDate);\n\n // valid date\n if (count($chunks) == 3 && checkdate((int) $chunks[1], (int) $chunks[0], (int) $chunks[2])) {\n $this->filter['start_date'] = $startDate;\n } else {\n // invalid date\n $this->filter['start_date'] = '';\n }\n } else {\n // not set\n $this->filter['start_date'] = '';\n }\n\n // end date is set\n if ($this->getRequest()->query->has('end_date') && $this->getRequest()->query->get('end_date', '') !== '') {\n // redefine\n $endDate = $this->getRequest()->query->get('end_date', '');\n\n // explode date parts\n $chunks = explode('/', $endDate);\n\n // valid date\n if (count($chunks) == 3 && checkdate((int) $chunks[1], (int) $chunks[0], (int) $chunks[2])) {\n $this->filter['end_date'] = $endDate;\n } else {\n // invalid date\n $this->filter['end_date'] = '';\n }\n } else {\n // not set\n $this->filter['end_date'] = '';\n }\n }", "private function loadFiltersFromQuery(): void\n {\n $request = RequestUtil::getMainRequest($this->requestStack) ?? Request::createFromGlobals();\n $requestFilters = $request->query->all('filter');\n\n if (is_array($requestFilters)) {\n foreach ($requestFilters as $name => $limitations) {\n foreach ($limitations as $comparison => $value) {\n $filterField = new FilterField();\n $filterField->setName($name)\n ->setValue($value)\n ->setComparison($comparison)\n ->setFilter($this->getFilterByName($name));\n\n $this->filterFields[] = $filterField;\n }\n }\n }\n }", "public function __construct()\n {\n $this->filterGeneratedData = Ark()->webService()->getFilterGeneratedData();\n }", "function setFilter($filter) {\n\t\t$this->_filter = $filter;\n\t}", "public function applyFilters()\n {\n $filters = sfConfig::get('app_sft_papi_plugin_filters_sequence');\n \n if (!(is_array($filters) && count($filters) > 0))\n {\n return $this;\n }\n\n foreach($filters as $filter)\n { \n $className = $filter['class_name'];\n if(!class_exists($className))\n {\n throw new Exception('The filter \"'.$className. '\" does not exists');\n }\n\n $configuration = $filter['configuration'];\n $this -> attributes = call_user_func(array($className ,'execute'), \n $this -> attributes, $configuration);\n } \n return $this;\n }", "abstract protected function getFilters();", "protected function prepareFilters()\n {\n if(count($this->api_query) === 0){\n return;\n }\n\n // Matched WHERE filters would be all\n // that are not KEYWORDS (count, page, embed...)\n foreach($this->api_query as $column => $value) {\n if(in_array($column, $this->api_keyword_filters)){\n continue;\n }\n\n $this->where_filters[$column]= $value;\n }\n }", "function add_filters()\n {\n }", "protected static function filtes()\n {\n /*\n * The filters fetches are transported\n * to router Bus calls\n **/\n }", "public function CleanFilter(){\n\t\t$this->_objectFilter = new Model_Aclusuariosonline();\n\t}", "public function setIteratorFilter($mask = 0, $base = null)\n {\n $this->_cache['filter'] = array(\n 'base' => $base,\n 'mask' => $mask\n );\n reset($this);\n }", "private function loadFiltersFromAttributes(): void\n {\n $request = RequestUtil::getMainRequest($this->requestStack) ?? Request::createFromGlobals();\n foreach ($request->attributes->getIterator() as $key => $value) {\n $key = (string) $key;\n if ($this->getFilterByName($key) === null) {\n continue;\n }\n\n $filterField = new FilterField();\n $filterField->setName($key)\n ->setValue($value)\n ->setComparison(Api\\Filter::COMPARISON_EQUALS)\n ->setFilter($this->getFilterByName($key));\n\n $this->filterFields[] = $filterField;\n }\n }", "function setFilter($f) {\n\t\tif (!is_subclass_of($f, \"\\Library\\Database\\LinqEquality\")) {\n\t\t\tthrow new DBException(\"Must be a LINQ Equality\");\n\t\t} else {\n\t\t\t$f->setName(trim($this->getTable(),\"`\"));\n\t\t\t$this->filter = $f;\n\t\t}\n\t\treturn $this;\n\t}", "public function createFilter();", "private function setup_filters() {\n\n\t\tadd_filter( 'pre_option_posts_per_page', array( $this, 'filter_posts_per_page' ) );\n\n\t\tadd_filter( 'plugins_url', array( $this, 'filter_plugins_url' ) );\n\n\t}", "protected function applyFiltering()\n\t{\n\t\tif (!$this->hasFilters()) return;\n\n\t\tparse_str($this->filters, $list);\n\t\tforeach ($list as $column => $value) {\n\t\t\tif ($value !== '') {\n\t\t\t\t$this[$column]->applyFilter($value);\n\t\t\t}\n\t\t}\n\t}", "public function setFilter(string $filter);", "private function setFilter()\n {\n $this->filter['value'] = $this->getParameter('value') == null ? '' : $this->getParameter('value');\n }", "public function filterBeforeAll($filter);", "public function filter($filter)\n {\n }", "public function filter() {\r\n\t\t$this->resource->filter();\r\n\t}", "public function filtering();", "public function testFiltering()\n {\n $this->getManager();\n\n $result = $this->getFilerManger()->execute(new Request());\n\n $actual = [];\n foreach ($result->getResult() as $doc) {\n $actual[] = $doc->getId();\n }\n\n $this->assertCount(1, $actual);\n }", "public function __construct()\n {\n $this->beforeFilter(function()\n {\n\n });\n }", "function _prepare_filter_data () {\n\t\t// Filter session array name\n\t\t$this->_filter_name\t= $_GET[\"object\"].\"_filter\";\n\t\t// Connect common used arrays\n\t\tif (file_exists(INCLUDE_PATH.\"common_code.php\")) {\n\t\t\tinclude (INCLUDE_PATH.\"common_code.php\");\n\t\t}\n\t\t// Fields in the filter\n\t\t$this->_fields_in_filter = array(\n\t\t\t\"engine\",\n\t\t\t\"text\",\n\t\t);\n\t}", "public function addFilter(\\NMC\\Migration\\FilterInterface $filter)\n {\n $this->filters[] = $filter;\n }", "protected function initFilterFields(): void\n {\n $this->filterSliderFields = $this->filterSliderFields();\n $this->filterNumericFields = $this->filterNumericFields();\n $this->filterDropdownFields = $this->filterDropdownFields();\n }", "public function setFilters()\n {\n if (class_exists('Twig_SimpleFilter')) {\n $class = 'Twig_SimpleFilter';\n } else {\n $class = 'Twig\\TwigFilter';\n }\n\n $filter_merge_str = new $class('merge_str', function ($attrs, array $options = array()) {\n $key = $options[0];\n $value = $options[1];\n\n if (array_key_exists($key, $attrs)) {\n $attrs[$key] = implode(' ', [$value, $attrs[$key]]);\n } else {\n $attrs[$key] = $value;\n }\n\n return $attrs;\n }, array('is_variadic' => true));\n\n $this->twig->addFilter($filter_merge_str);\n }", "function moveAssignmentFilters() {\n try {\n $assignment_filters_table = TABLE_PREFIX . 'assignment_filters';\n $data_filters_table = TABLE_PREFIX . 'data_filters';\n $homescreen_tabs_table = TABLE_PREFIX . 'homescreen_tabs';\n\n DB::beginWork('Move assignment filters to the new storage @ ' . __CLASS__);\n\n $assignment_filters = DB::execute(\"SELECT * FROM $assignment_filters_table\");\n if($assignment_filters) {\n $assignment_filter_tabs_map = $this->getTabsThatUseAssignmentFilters();\n\n foreach($assignment_filters as $filter) {\n $old_assignment_filter_id = (integer) $filter['id'];\n\n DB::execute(\"INSERT INTO $data_filters_table (type, name, raw_additional_properties, created_on, created_by_id, created_by_name, created_by_email, is_private) VALUES ('AssignmentFilter', ?, ?, ?, ?, ?, ?, ?)\", $filter['name'], $filter['raw_additional_properties'], $filter['created_on'], $filter['created_by_id'], $filter['created_by_name'], $filter['created_by_email'], $filter['is_private']);\n\n $new_assignmnet_filter_id = DB::lastInsertId();\n\n if(isset($assignment_filter_tabs_map[$old_assignment_filter_id]) && count($assignment_filter_tabs_map[$old_assignment_filter_id])) {\n DB::execute(\"UPDATE $homescreen_tabs_table SET raw_additional_properties = ? WHERE id IN (?)\", serialize(array('assignment_filter_id' => $new_assignmnet_filter_id)), $assignment_filter_tabs_map[$old_assignment_filter_id]);\n } // if\n } // foreach\n } // if\n\n DB::commit('Assignment filters moved to the new storage @ ' . __CLASS__);\n } catch(Exception $e) {\n return $e->getMessage();\n } // try\n\n try {\n $table_list = DB::listTables(TABLE_PREFIX);\n\n if(in_array($assignment_filters_table, $table_list)) {\n DB::execute(\"DROP TABLE $assignment_filters_table\");\n } // if\n\n if(in_array(TABLE_PREFIX . 'milestone_filters', $table_list)) {\n DB::execute('DROP TABLE ' . TABLE_PREFIX . 'milestone_filters');\n } // if\n } catch(Exception $e) {\n return $e->getMessage();\n } // try\n\n return true;\n }", "function updateAssignmentFilters() {\n $engine = defined('DB_CAN_TRANSACT') && DB_CAN_TRANSACT ? 'InnoDB' : 'MyISAM';\n\n try {\n $assignment_filters_table = TABLE_PREFIX . 'assignment_filters';\n\n DB::execute(\"CREATE TABLE {$assignment_filters_table}_2 (\n id int unsigned NOT NULL auto_increment,\n name varchar(50) DEFAULT NULL,\n raw_additional_properties longtext,\n created_on datetime DEFAULT NULL,\n created_by_id int(10) unsigned NULL DEFAULT NULL,\n created_by_name varchar(100) DEFAULT NULL,\n created_by_email varchar(150) DEFAULT NULL,\n is_private tinyint(1) unsigned NOT NULL DEFAULT '0',\n PRIMARY KEY (id),\n INDEX created_by_id (created_by_id),\n INDEX name (name)\n ) ENGINE=$engine DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci\");\n\n $rows = DB::execute(\"SELECT * FROM $assignment_filters_table\");\n if($rows) {\n $created_by_ids = $created_by = array();\n\n foreach($rows as $row) {\n $created_by_id = (integer) $row['created_by_id'];\n\n if($created_by_id && !in_array($created_by_id, $created_by_ids)) {\n $created_by_ids[] = $created_by_id;\n } // if\n } // foreach\n\n if(count($created_by_ids)) {\n $user_rows = DB::execute('SELECT id, first_name, last_name, email FROM ' . TABLE_PREFIX . 'users WHERE id IN (?)', $created_by_ids);\n\n if($user_rows) {\n foreach($user_rows as $user_row) {\n $created_by_id = (integer) $user_row['id'];\n\n $created_by[$created_by_id] = array(\n 'email' => $user_row['email']\n );\n\n if($user_row['first_name'] && $user_row['last_name']) {\n $created_by[$created_by_id]['name'] = $user_row['first_name'] . ' ' . $user_row['last_name'];\n } elseif($user_row['first_name']) {\n $created_by[$created_by_id]['name'] = $user_row['first_name'];\n } elseif($user_row['last_name']) {\n $created_by[$created_by_id]['name'] = $user_row['last_name'];\n } else {\n $created_by[$created_by_id]['name'] = substr($user_row['email'], 0, strpos($user_row['email'], '@'));\n } // if\n } // foreach\n } // if\n } // if\n\n foreach($rows as $row) {\n $name = isset($row['group_name']) && $row['group_name'] ? \"$row[group_name] / $row[name]\" : $row['name'];\n\n $attributes = array(\n 'user_filter' => $row['user_filter'],\n 'project_filter' => $row['project_filter'],\n 'due_on_filter' => $row['date_filter'],\n 'created_on_filter' => $row['created_on_filter'],\n 'completed_on_filter' => $row['completed_on_filter'],\n );\n\n if($attributes['completed_on_filter'] == 'any')\n\n if($row['user_filter'] == 'company' || $row['user_filter'] == 'company_responsible') {\n $attributes['company_id'] = isset($row['user_filter_data']) && $row['user_filter_data'] ? unserialize($row['user_filter_data']) : 0;\n } elseif($row['user_filter'] == 'company' || $row['user_filter'] == 'selected_responsible') {\n $attributes['selected_users'] = isset($row['user_filter_data']) && $row['user_filter_data'] ? unserialize($row['user_filter_data']) : array();\n } // if\n\n if($row['project_filter'] == 'selected') {\n $attributes['project_ids'] = isset($row['project_filter_data']) && $row['project_filter_data'] ? unserialize($row['project_filter_data']) : array();\n } // if\n\n if($row['date_filter'] == 'selected_date') {\n $attributes['due_on'] = $row['date_from'];\n } elseif($row['date_filter'] == 'selected_range') {\n $attributes['due_from'] = $row['date_from'];\n $attributes['due_to'] = $row['date_from'];\n } // if\n\n if($row['created_on_filter'] == 'selected_date') {\n $attributes['created_on'] = $row['created_on_from'];\n } elseif($row['created_on_filter'] == 'selected_range') {\n $attributes['created_from'] = $row['created_on_from'];\n $attributes['created_to'] = $row['created_on_to'];\n } // if\n\n if($row['completed_on_filter'] == 'selected_date') {\n $attributes['completed_on'] = $row['completed_on_from'];\n } elseif($row['completed_on_filter'] == 'selected_range') {\n $attributes['completed_from'] = $row['completed_on_from'];\n $attributes['completed_to'] = $row['completed_on_to'];\n } elseif($row['completed_on_filter'] == 'all'){\n if($row['status_filter'] == 'active') {\n $attributes['completed_on_filter'] = 'open';\n } elseif($row['status_filter'] == 'completed') {\n $attributes['completed_on_filter'] = 'completed';\n } // if\n } // if\n\n if(str_starts_with($row['order_by'], 'due_on')) {\n $attributes['group_by'] = 'due_on';\n } elseif(str_starts_with($row['order_by'], 'created_on')) {\n $attributes['group_by'] = 'created_on';\n } else {\n $attributes['group_by'] = 'dont';\n } // if\n\n if($row['tickets_only']) {\n $attributes['include_subtasks'] = false;\n } else {\n $attributes['include_subtasks'] = true;\n } // if\n\n $created_by_id = (integer) $row['created_by_id'];\n\n if($created_by[$created_by_id]) {\n $created_by_name = $created_by[$created_by_id]['name'];\n $created_by_email = $created_by[$created_by_id]['email'];\n } else {\n $created_by_id = 0;\n $created_by_name = '';\n $created_by_email = '[email protected]';\n } // if\n\n DB::execute(\"INSERT INTO {$assignment_filters_table}_2 (name, raw_additional_properties, created_on, created_by_id, created_by_name, created_by_email, is_private) VALUES (?, ?, NOW(), ?, ?, ?, ?)\", $name, serialize($attributes), $created_by_id, $created_by_name, $created_by_email, $row['is_private']);\n } // foreach\n\n DB::execute(\"DROP TABLE $assignment_filters_table\");\n DB::execute(\"RENAME TABLE {$assignment_filters_table}_2 TO $assignment_filters_table\");\n } // if\n } catch(Exception $e) {\n return $e->getMessage();\n } // try\n\n return true;\n }", "public function processFilter()\n {\n call_user_func($this->builder, $this);\n\n return $this->filter->execute();\n }", "private function initInputFilter($di) {\n\t\t\t$di->set('inputFilter', function(){\n\t\t\t\n\t\t\t\treturn new FilterOptions();\n\t\t\t\t\n\t\t\t});\n\t\t\t\n\t\t}", "protected function processFilters()\n {\n $this->filters = [];\n foreach ($this->params as $key => $value) {\n $this->parser->setAlias('_' . $this->contentType);\n $filter = $this->parser->getFilter($key, $value);\n if ($filter) {\n $this->addFilter($filter);\n }\n }\n }", "private function initChunksIterator()\n {\n $cursor = $this->collectionWrapper->findChunksByFileId($this->file->_id, $this->chunkOffset);\n\n $this->chunksIterator = new IteratorIterator($cursor);\n $this->chunksIterator->rewind();\n }", "public function onFilter()\n {\n // $this->currentPageNumber = 1;\n return $this->onRefresh();\n }", "public function testFilterOptimizer(): void\n {\n $optimizer = new FilterOptimizer();\n $collection = LaRepo::newFiltersCollection();\n $nestedIdleCollection = LaRepo::newFiltersCollection();\n\n $filter1 = LaRepo::newFilter(\n 'attr1',\n FilterOperator::IS_LIKE,\n 'val1',\n BooleanOperator::OR\n );\n\n $filter2 = LaRepo::newFilter(\n 'attr2',\n FilterOperator::IS_LIKE,\n 'val2',\n BooleanOperator::AND\n );\n\n $filter3Sub = LaRepo::newFilter(\n 'attr3',\n FilterOperator::EQUALS_TO,\n 'testing',\n BooleanOperator::OR\n );\n\n $filter3 = LaRepo::newFilter(\n 'rel1',\n FilterOperator::EXISTS,\n LaRepo::newFiltersCollection(BooleanOperator::OR, $filter3Sub),\n BooleanOperator::AND\n );\n\n $nestedIdleCollection->setItems($filter1, $filter2, $filter3);\n $collection->setItems($nestedIdleCollection);\n\n $optimizer->optimize($collection);\n\n $this->assertCount(3, $collection);\n $this->assertEquals($filter1, $collection[0]);\n $this->assertEquals($filter2, $collection[1]);\n $this->assertEquals($filter3Sub, $collection[2]);\n $this->assertEquals('rel1.attr3', $collection[2]->getAttr()->getName());\n $this->assertEquals(BooleanOperator::AND, $collection[2]->getBoolean());\n }", "public function setFilter($arrFilter);", "protected function setUp()\n {\n $this->_filter = new Zym_Filter_Float();\n }", "protected function get_initial_filters() {\n $initialfilters = parent::get_initial_filters();\n $initialfilters[] = 'autoass';\n return $initialfilters;\n }", "function initDataFilters() {\n try {\n $engine = defined('DB_CAN_TRANSACT') && DB_CAN_TRANSACT ? 'InnoDB' : 'MyISAM';\n\n DB::execute(\"CREATE TABLE \" . TABLE_PREFIX . \"data_filters (\n id int unsigned NOT NULL auto_increment,\n type varchar(150) NOT NULL DEFAULT 'DataFilter',\n name varchar(50) DEFAULT NULL,\n raw_additional_properties longtext ,\n created_on datetime DEFAULT NULL,\n created_by_id int(10) unsigned NULL DEFAULT NULL,\n created_by_name varchar(100) DEFAULT NULL,\n created_by_email varchar(150) DEFAULT NULL,\n is_private tinyint(1) unsigned NOT NULL DEFAULT '0',\n PRIMARY KEY (id),\n INDEX type (type),\n INDEX created_by_id (created_by_id),\n INDEX name (name)\n ) ENGINE=$engine DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;\");\n } catch(Exception $e) {\n return $e->getMessage();\n } // try\n\n return true;\n }", "public function resetFilters() {\n $this->filters = array();\n }", "abstract public function prepareFilteredCount();", "function _setAllFilters( $objKey )\n {\n $this->_activateFilterLevel($objKey);\n\n // add all pre and post filters, dont use references here, so the filters are each an instance of its own\n // this is necessary since the options might be changed by any xml-config!\n if( sizeof($this->_preFilters) )\n foreach( $this->_preFilters as $aFilter )\n $this->_objectPool[$objKey]->registerPrefilter($aFilter[0],$aFilter[1]);\n if( sizeof($this->_postFilters) )\n foreach( $this->_postFilters as $aFilter )\n $this->_objectPool[$objKey]->registerPostfilter($aFilter[0],$aFilter[1]);\n }", "public function init()\n {\n \t// Get filter form\n \t$filters = $this->_dataGrid->getFilter();\n \t\n \t// If send post request, inject into session\n \tif ($this->_dataGrid->getRequest()->isPost())\n \t{\n \t\t$this->_dataGrid->getSession()->filters = $this->_dataGrid->getRequest()->getPost();\n \t}\n \t \n \t// Get valid datas\n \tif ($this->_dataGrid->getSession()->filters)\n \t{\n \t\t$validDatas = $filters->getValidValues((array) $this->_dataGrid->getSession()->filters);\n \t\t$validDatas = isset($validDatas[$this->_dataGrid->getGridId()]['filter']) ? $validDatas[$this->_dataGrid->getGridId()]['filter'] : array();\n \t\t$this->_validDatas = array_filter($validDatas, 'count');\n \t}\n }", "public function __construct(Iterator $it)\n {\n parent::__construct($it);\n }", "public function registerFilters() {\n//\t $this->addFilter('get_avatar', ['Chayka\\\\LinkedIn\\\\LinkedInHelper', 'filterGetLinkedInAvatar'], 10, 3);\n\t $this->addFilter('CommentModel.created', ['Chayka\\\\LinkedIn\\\\LinkedInHelper', 'filterMarkCommentWithLinkedInUserId']);\n\t $this->addFilter('pre_comment_approved', ['Chayka\\\\LinkedIn\\\\LinkedInHelper', 'filterApproveLinkedInUserComment'], 10, 2);\n\t\t/* chayka: registerFilters */\n }", "public function applyFilters() {\n\t\tforeach ($this->filters as $filter) {\n\t\t\t$filter->apply($this);\n\t\t}\n\t\t$this->removeFilters();\n\t}", "public function init()\n {\n $this->rootPageUid = $this->filterConfig->getSettings('rootPageUid');\n $this->respectEnableFields = $this->filterConfig->getSettings('respectEnableFields');\n $this->respectDeletedField = $this->filterConfig->getSettings('respectDeletedField');\n }", "public function filterProvider()\n {\n $entity1 = $this->createMock(EntityInterface::class);\n $entity2 = $this->createMock(EntityInterface::class);\n $entity3 = $this->createMock(EntityInterface::class);\n $entity4 = $this->createMock(EntityInterface::class);\n $entity5 = $this->createMock(EntityInterface::class);\n $entity6 = $this->createMock(EntityInterface::class);\n\n $entity1->foo = 'bar';\n $entity2->foo = 123;\n $entity4->foo = '123';\n $entity5->foo = ['1230'];\n $entity6->foo = [1234, 123, 'teta'];\n\n $entities = [$entity1, $entity2, $entity3, $entity4, $entity5, $entity6];\n\n $filter = function($entity) {\n return isset($entity->foo) && $entity->foo == 123;\n };\n\n return [\n [$entities, ['foo' => 123], false, [1 => $entity2, 3 => $entity4, 5 => $entity6]],\n [$entities, ['foo' => 123], true, [1 => $entity2, 5 => $entity6]],\n [$entities, $filter, false, [1 => $entity2, 3 => $entity4]],\n [$entities, $filter, true, [1 => $entity2, 3 => $entity4]],\n [$entities, [], false, $entities],\n [$entities, [], true, $entities],\n [[], ['foo' => 123], true, []],\n [[], ['foo' => 123], false, []],\n [[], $filter, true, []],\n [[], $filter, false, []],\n ];\n }", "public function getFilter(){ }", "public function setUp()\n {\n $this->dateFilter = DateFilter::instance();\n parent::setUp();\n }", "public function onFilter()\n {\n $this->currentPageNumber = 1;\n return $this->onRefresh();\n }", "protected function initializePHPUnitFilter() {\n\t\t\\PHPUnit_Util_Filter::addDirectoryToFilter(FLOW3_PATH_ROOT);\n\t\tforeach(explode(':', ini_get('include_path')) as $include_path) {\n\t\t\tif(is_dir($include_path)) {\n\t\t\t\t\\PHPUnit_Util_Filter::addDirectoryToFilter($include_path);\n\t\t\t}\n\t\t}\n\t}", "protected function filterItems()\n\t{\n\t\t// must be in this order\n\t\t$this->applyDefaultFiltering();\n\t\t$this->applyDefaultSorting();\n\t\t$this->applyItems();\n\t\t$this->applyFiltering();\n\t\t$this->applySorting();\n\t\t$this->applyPaging();\n\t}", "function current_filter()\n {\n }", "public function afterFilter()\n\t{\n\n\t}", "protected abstract function filter();", "private function setup_filters() {\n add_filter( 'timber/twig', function( $twig ) {\n\n // ped_icon()\n $twig->addFunction( new \\Twig_SimpleFunction( PEDESTAL_PREFIX . 'icon',\n [ __CLASS__, 'get_icon' ]\n ) );\n\n // ped_logo()\n $twig->addFunction( new \\Twig_SimpleFunction( PEDESTAL_PREFIX . 'logo',\n [ __CLASS__, 'get_logo' ]\n ) );\n\n return $twig;\n }, 99 );\n }", "private function addInputFilter()\n {\n $inputFilter = new InputFilter();\n $this->setInputFilter($inputFilter);\n\n }", "private function _setupFiltering()\n\t{\n\t\tglobal $txt;\n\n\t\t// We'll escape some strings...\n\t\t$db = database();\n\n\t\t// You can filter by any of the following columns:\n\t\t$filters = array(\n\t\t\t'id_member' => $txt['username'],\n\t\t\t'ip' => $txt['ip_address'],\n\t\t\t'session' => $txt['session'],\n\t\t\t'url' => $txt['error_url'],\n\t\t\t'message' => $txt['error_message'],\n\t\t\t'error_type' => $txt['error_type'],\n\t\t\t'file' => $txt['file'],\n\t\t\t'line' => $txt['line'],\n\t\t);\n\n\t\t$filter = $this->_req->getQuery('filter', 'trim', null);\n\t\t$value = $this->_req->getQuery('value', 'trim', null);\n\n\t\t// Set up the filtering...\n\t\tif (isset($value, $filters[$filter]))\n\t\t{\n\t\t\t$filter = array(\n\t\t\t\t'variable' => $filter,\n\t\t\t\t'value' => array(\n\t\t\t\t\t'sql' => in_array($filter, array('message', 'url', 'file'))\n\t\t\t\t\t\t? base64_decode(strtr($value, array(' ' => '+')))\n\t\t\t\t\t\t: $db->escape_wildcard_string($value),\n\t\t\t\t),\n\t\t\t\t'href' => ['filter' => $filter, 'value' => $value],\n\t\t\t\t'entity' => $filters[$filter]\n\t\t\t);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif (isset($filter, $value))\n\t\t\t{\n\t\t\t\tunset($this->_req->query->filter, $this->_req->query->value);\n\t\t\t}\n\n\t\t\t$filter = [];\n\t\t}\n\n\t\treturn $filter;\n\t}", "protected function _prepareCollection()\n {\n $collection = $this->_collectionFactory->create()->addVisibleFilter();\n $vendor_attrs = [];\n $vendor_id = $this->customerSession->getVendorId();\n if ($vendor_id) {\n $attr_model = $this->attribute->getProductAttributes($vendor_id)->getData();\n foreach ($attr_model as $key => $attr_id) {\n $vendor_attrs[] = $attr_id['attribute_id'];\n }\n $collection->addFieldToFilter('main_table.attribute_id', ['in' => $vendor_attrs]);\n $this->setCollection($collection);\n parent::_prepareCollection();\n return $this;\n }\n return $this;\n }", "private function restoreFilters()\n {\n if (count($this->wordpressFilters) > 0) {\n $filters = $this->wordpress->getFilters();\n\n foreach ($this->wordpressFilters as $filterKey => $filter) {\n $filters[$filterKey] = $filter;\n }\n\n $this->wordpress->setFilters($filters);\n $this->wordpressFilters = [];\n }\n }", "abstract public function filter(Builder $dataSource);", "protected function _applyCustomFilter() {\r\n return $this;\r\n }", "public function getIterator(): Traversable\n {\n if ($this->where) {\n $this->limit = 999; //TODO zpracovat lip?\n }\n\n $this->loadData();\n\n // if set order\n if ($this->order) {\n $key = key($this->order);\n $direction = strtolower($this->order[$key]);\n // user order by value\n $this->iterator->uasort(function ($a, $b) use ($key, $direction) {\n if ($direction == 'asc') {\n return $a[$key] > $b[$key];\n }\n if ($direction == 'desc') {\n return $a[$key] < $b[$key];\n }\n return 0;\n });\n }\n\n // if set where\n if ($this->where) {\n// bdump($this->where);\n // transfer to array and filter correct value\n $filter = array_filter((array) $this->iterator, function ($item) {\n $state = false;\n // compare OR logic\n foreach ($this->where as $key => $where) {\n if (is_array($where)) {\n // compare array\n if (in_array($item[$key], $where)) {\n $state = true;\n }\n } else {\n // compare single value\n if ($item[$key] == $where) {\n $state = true;\n }\n }\n }\n return $state;\n });\n // transfer to back ArrayObject\n $this->iterator = new ArrayObject($filter);\n $this->count = $this->iterator->count();\n }\n return $this->iterator;\n }", "private function loadFilters()\n {\n require __DIR__.'/filters.php';\n }", "public static function initialize() {\r\n\t\t/*\r\n\t\t * The filters are only useful in the admin section; exit if in the \"front-end\" posts/pages. \r\n\t\t */\r\n\t\tif ( ! is_admin() )\r\n\t\t\treturn;\r\n\r\n\t\tadd_filter( 'mla_mapping_settings', 'MLAHierarchicalMappingExample::mla_mapping_settings', 10, 4 );\r\n\t\tadd_filter( 'mla_mapping_exif_value', 'MLAHierarchicalMappingExample::mla_mapping_exif_value', 10, 5 );\r\n\t\tadd_filter( 'mla_mapping_updates', 'MLAHierarchicalMappingExample::mla_mapping_updates', 10, 5 );\r\n\t}", "function beforeFilter() {\n }", "function acf_set_filters($filters = array())\n{\n}", "protected function _prepareCollection() {\n $collection = Mage::getModel('vidtest/video')\n ->getCollection()\n ->addProductFilter($this->getProduct()->getId())\n ;\n\n if ($storeId = $this->getProduct()->getStoreId()) {\n $collection->addStoreFilter($storeId);\n }\n $this->setCollection($collection);\n return parent::_prepareCollection();\n }", "public function setUp()\n {\n $this->_filteringEscaping = new \\App\\Security\\FilteringAndEscaping;\n }", "public function autofilterAction()\n {\n $this->aliasAction('index');\n\n // \\MUtil_Model::$verbose = true;\n\n // We do not need to return the layout, just the above table\n $this->disableLayout();\n\n $this->html[] = $this->_createTable();\n $this->html->raw(\\MUtil_Echo::out());\n }", "function filter(){\r\n\r\n return new BFilter();\r\n\r\n}", "public function buildFilters()\n {\n $this->addFilter('name', new ORM\\StringFilterType('name'), 'media.adminlist.configurator.filter.name');\n $this->addFilter('contentType', new ORM\\StringFilterType('contentType'), 'media.adminlist.configurator.filter.type');\n $this->addFilter('updatedAt', new ORM\\NumberFilterType('updatedAt'), 'media.adminlist.configurator.filter.updated_at');\n $this->addFilter('filesize', new ORM\\NumberFilterType('filesize'), 'media.adminlist.configurator.filter.filesize');\n }", "protected function setWhereFilters() : ApiGetService\n {\n if(count($this->where_filters) === 0){\n return $this;\n }\n\n // Traverse prepared filters\n foreach($this->where_filters as $column => $value){\n // {column}:{operator} = {value}\n $column_operator = preg_split('/[:\\s]+/', $column);\n\n // Split value by \" , \"\n $splited_value = preg_split('/[,]+/', $value);\n\n //... and if {value} is not scalar\n if(count($splited_value) > 1){\n // ... we know that we will have SQL IN operator in WHERE\n $in_operator = true;\n }\n // ... else we are good with simple \" = \"\n else{\n $in_operator = false;\n }\n\n // Depending on $in_operator, we know if we are using IN or =\n $this->builder\n ->when($in_operator ,\n // If it is true, we are using IN\n function ($query) use($column_operator, $splited_value){\n if(isset($column_operator[1]) && $column_operator[1] == \"eq\"){\n\n return $query->whereIn($column_operator[0], $splited_value);\n\n }elseif(isset($column_operator[1]) && $column_operator[1] == \"ne\"){\n\n return $query->whereNotIn($column_operator[0], $splited_value);\n\n }else{\n\n return $query->whereIn($column_operator[0], $splited_value);\n }\n },\n // Else, we are using scalar operators...\n function ($query) use($column_operator, $splited_value) {\n\n return $query->where($column_operator[0],\n ((isset($column_operator[1]) && $column_operator[1] != \"\") ? $this->api_operators[$column_operator[1]] : \"=\"),\n $splited_value[0]);\n });\n }\n\n return $this;\n }", "public function beforeFilter() {\n\t}", "public function _post_filter()\n {\n }", "protected function before_filter() {\n\t}", "function get_filters($init_data = true) {\n //no filters by default\n return array();\n }", "public function init() {\n if (is_admin()) {\n return $this;\n }\n add_filter('usces_filter_the_payment_method_row', [$this, 'filterPaymentMethodRow'], 10, 7);\n add_filter('usces_fiter_the_payment_method', [$this, 'filterPaymentMethods'], 10, 2);\n add_filter('usces_filter_the_continue_payment_method', [$this, 'filterContinueChargePaymentMethods'], 10, 1);\n add_filter('usces_filter_delivery_check', [$this, 'multiShippingCheck'], 15, 3);\n return $this;\n }", "private function init_andWhereFilter()\n {\n // RETURN : $this->andWhereFilter was set before\n if ( !( $this->andWhereFilter === null ) )\n {\n return $this->andWhereFilter;\n }\n // RETURN : $this->andWhereFilter was set before\n // RETURN : there isn't any filter\n if ( !$this->bool_isFilter )\n {\n $this->andWhereFilter = false;\n return $this->andWhereFilter;\n }\n // RETURN : there isn't any filter\n\n $arr_andWhereFilter = null;\n\n // Init area\n $this->pObj->objCal->area_init();\n $conf = $this->pObj->conf;\n $viewWiDot = $this->view . '.';\n $conf_view = $conf[ 'views.' ][ $viewWiDot ][ $this->mode . '.' ];\n // Init area\n // LOOP: filter tableFields\n//$this->pObj->dev_var_dump( $this->arr_tsFilterTableFields );\n foreach ( $this->arr_tsFilterTableFields as $tableField )\n {\n list( $table ) = explode( '.', $tableField );\n $str_andWhere = null;\n\n // Get nice_piVar\n $arr_result = $this->zz_getNicePiVar( $tableField );\n $arr_piVar = $arr_result[ 'data' ][ 'arr_piVar' ];\n//var_dump( __METHOD__, __LINE__, $tableField, $arr_piVar );\n unset( $arr_result );\n // Get nice_piVar\n // CONTINUE : There isn't any piVar\n if ( empty( $arr_piVar ) )\n {\n continue;\n }\n // CONTINUE : There isn't any piVar\n // SWITCH : manual mode versus auto mode\n switch ( true )\n {\n case( $this->pObj->b_sql_manual ):\n // SQL manual mode\n $str_andWhere = $this->init_andWhereFilter_manualMode( $arr_piVar, $tableField, $conf_view );\n//$this->pObj->dev_var_dump( $str_andWhere );\n break;\n // SQL manual mode\n case(!$this->pObj->b_sql_manual ):\n default:\n // SQL auto mode\n // SWITCH : local table versus foreign table\n switch ( true )\n {\n case( $table == $this->pObj->localTable ):\n $str_andWhere = $this->init_andWhereFilter_localTable( $arr_piVar, $tableField );\n//$this->pObj->dev_var_dump( $str_andWhere );\n break;\n case( $table != $this->pObj->localTable ):\n default:\n $str_andWhere = $this->init_andWhereFilter_foreignTable( $arr_piVar, $tableField );\n//var_dump( __METHOD__, __LINE__, $str_andWhere );\n break;\n }\n // SWITCH : local table versus foreign table\n break;\n // SQL auto mode\n }\n // SWITCH : manual mode versus auto mode\n\n if ( !empty( $str_andWhere ) )\n {\n $arr_andWhereFilter[ $tableField ] = $str_andWhere;\n // #56329, 140227, dwildt, 1+\n $this->arr_andWhereFilter[ $tableField ] = \" AND \" . $str_andWhere;\n }\n // Build the andWhere statement\n }\n // LOOP: filter tableFields\n // andWhere statement\n $strAndWhere = implode( \" AND \", ( array ) $arr_andWhereFilter );\n\n // #52486, 131002, dwildt, 6+\n if ( $this->radialsearchTable )\n {\n $strAndWhere = $strAndWhere\n . $this->init_andWhereFilter_radialsearch()\n ;\n }\n // #52486, 131002, dwildt, 6+\n // RETURN : there isn't any andWhere statement\n if ( empty( $strAndWhere ) )\n {\n $this->andWhereFilter = false;\n return $this->andWhereFilter;\n }\n // RETURN : there isn't any andWhere statement\n\n $this->andWhereFilter = \" AND \" . $strAndWhere;\n\n // DRS\n if ( $this->pObj->b_drs_filter || $this->pObj->b_drs_sql )\n {\n if ( is_array( $arr_andWhereFilter ) )\n {\n $prompt = 'andWhere statement: ' . $this->andWhereFilter;\n t3lib_div :: devlog( '[INFO/FILTER+SQL] ' . $prompt, $this->pObj->extKey, 0 );\n }\n }\n // DRS\n\n return $this->andWhereFilter;\n }", "public function getIterator()\n {\n // Return an iterator just like the old iteration of the HistoryPlugin for BC compatibility (use getAll())\n return new \\ArrayIterator(array_map(function ($entry) {\n $entry['request']->getParams()->set('actual_response', $entry['response']);\n return $entry['request'];\n }, $this->transactions));\n }", "public function applyFilterSearch() {\n\t\t$this->table->writeFilterToSession();\n\t\t$this->table->resetOffset();\n\t\t$this->search();\n\t}", "public function __construct(\\Iterator $chain) {\n $this->chain = $chain;\n }" ]
[ "0.6466015", "0.6291387", "0.5951684", "0.5930622", "0.5906659", "0.5760304", "0.56612843", "0.5608889", "0.56076866", "0.5572931", "0.55623835", "0.5487783", "0.54589695", "0.5449414", "0.5444809", "0.5436798", "0.54064256", "0.5400307", "0.53803426", "0.53746444", "0.5358228", "0.5341064", "0.53407955", "0.5337057", "0.5327724", "0.5317573", "0.53145176", "0.53078717", "0.53000224", "0.52909255", "0.5288279", "0.52783746", "0.5277437", "0.5276219", "0.52681196", "0.52499396", "0.5245863", "0.5243149", "0.52328986", "0.52262497", "0.5223315", "0.52198535", "0.52139854", "0.5204202", "0.52009034", "0.51968575", "0.51766163", "0.51728517", "0.51553625", "0.5126278", "0.5119568", "0.51162314", "0.5109044", "0.5092725", "0.5092323", "0.50878173", "0.5084528", "0.5080567", "0.5071741", "0.5071047", "0.5068595", "0.505913", "0.5057819", "0.5050179", "0.50445056", "0.50428396", "0.5028289", "0.502808", "0.5027237", "0.5026352", "0.50259954", "0.5024006", "0.5019096", "0.50190943", "0.5010814", "0.5010385", "0.5009422", "0.49993363", "0.49960145", "0.4991552", "0.49843556", "0.4975954", "0.49748123", "0.49714145", "0.4963398", "0.49547425", "0.49536324", "0.49473912", "0.49464184", "0.4945768", "0.4940602", "0.49369395", "0.4933862", "0.49261057", "0.49226478", "0.49100015", "0.4907393", "0.4907313", "0.49072573", "0.48999685" ]
0.66892904
0
Returns the assigned filter iterator
public function getFilter() { return $this->filter; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getIterator()\n {\n return new EntityFilterIterator($this->storage);\n }", "public function getIterator()\n {\n return $this->iterator();\n }", "public function getIterator() {}", "public function getIterator() {}", "public function getIterator();", "public function getIterator();", "public function getIterator();", "public function getIterator();", "public function getIterator();", "public function getIterator();", "public function getIterator()\n {\n return $this->iterator;\n }", "public function iterator();", "public function rewind()\n {\n reset($this->_filters);\n return current($this->_filters);\n }", "public function iterator()\n {\n return $this->getIterator();\n }", "public function getIterator()\n {\n return $this->multi()->load();\n }", "public function getIterator(): Iterator\n {\n return $this->{$this->fnDoGetIterator}();\n }", "abstract public function getIterator();", "public function getTrueIterator();", "public function getIterator()\r\n {\r\n return $this->all();\r\n }", "public function getIterator(): Traversable\n {\n if ($this->where) {\n $this->limit = 999; //TODO zpracovat lip?\n }\n\n $this->loadData();\n\n // if set order\n if ($this->order) {\n $key = key($this->order);\n $direction = strtolower($this->order[$key]);\n // user order by value\n $this->iterator->uasort(function ($a, $b) use ($key, $direction) {\n if ($direction == 'asc') {\n return $a[$key] > $b[$key];\n }\n if ($direction == 'desc') {\n return $a[$key] < $b[$key];\n }\n return 0;\n });\n }\n\n // if set where\n if ($this->where) {\n// bdump($this->where);\n // transfer to array and filter correct value\n $filter = array_filter((array) $this->iterator, function ($item) {\n $state = false;\n // compare OR logic\n foreach ($this->where as $key => $where) {\n if (is_array($where)) {\n // compare array\n if (in_array($item[$key], $where)) {\n $state = true;\n }\n } else {\n // compare single value\n if ($item[$key] == $where) {\n $state = true;\n }\n }\n }\n return $state;\n });\n // transfer to back ArrayObject\n $this->iterator = new ArrayObject($filter);\n $this->count = $this->iterator->count();\n }\n return $this->iterator;\n }", "public function getIterator()\n {\n return $this->getValue();\n }", "public function getIterator()\n {\n }", "final public function filter(): \\RecursiveCallbackFilterIterator\n {\n //filter\n return new \\RecursiveCallbackFilterIterator(\n //callback is not documented yet. All params are of mixed type\n $this->dirIterator, function ($current, $key, $iterator) {\n\n // Allow recursion\n assert($iterator instanceof \\RecursiveDirectoryIterator);\n if ($iterator->hasChildren()) {\n return true;\n }\n\n assert($current instanceof \\SplFileInfo);\n // skip hidden files\n if ($current->getBasename()[0] === '.') {\n return false;\n }\n\n // Check for audio and cover files\n if ($current->isFile() && in_array(strtolower($current->getExtension()), $this->allowedTypes)) {\n return true;\n }\n\n return false;\n }\n );\n }", "public function getIterator()\n\t{\n\t\treturn new \\ArrayIterator($this->params);\n\t}", "function filter($func, $xs) {\n return new \\std\\_FilterIterator($func, $xs);\n}", "public function getIterator(): Iterator {}", "public function getIterator()\n {\n return $this->getItemsWithChanges();\n }", "public function getIterator()\n {\n return $this->matches;\n }", "public function getIterator()\n\t{\n return $this->getData();\n\t\t// return new CMapIterator($this->getData());\n\t}", "function getiterator() {\n\t\treturn new \\ArrayIterator($this->cast());\n\t}", "public function getIterator()\n {\n return $this->collection->getIterator();\n }", "public function getIterator()\n {\n return $this->collection->getIterator();\n }", "function getIterator()\n {\n return new \\ArrayIterator($this->items);\n }", "function getIterator() {\r\n\t\treturn new \\ArrayIterator($this->data);\r\n\t}", "public function getIterator()\n {\n return new \\ArrayIterator($this->rules);\n }", "protected abstract function filter();", "public function getIterator() { return new mfp_iterator($this->list); }", "public function getIterator()\n\t{\n\t\treturn new \\ArrayIterator($this->fetch());\n\t}", "public function getIterator()\n {\n return new Model_Collection_Iterator($this->getQueryResult());\n }", "public function getIterator()\n {\n return new Iterator($this->entities);\n }", "public function current()\r\n {\r\n return $this->_filter->filter(parent::current());\r\n }", "public function getIterator()\n {\n return new ArrayIterator($this->rules);\n }", "public function getIterator()\n\t{\n\t\treturn new ArrayIterator($this->items);\n\t}", "public function getIterator()\n {\n return new \\ArrayIterator($this->attributes, 1);\n }", "public function getIterator()\n {\n return new \\ArrayIterator($this->elements(true));\n }", "public function authorized() {\n\t\treturn new PSU_Student_Finaid_Awards_AuthorizedFilterIterator( $this->getIterator() );\n\t}", "public function getIterator()\n {\n return new \\ArrayIterator($this->items->all());\n }", "public function getIterator()\n {\n return new \\ArrayIterator($this->params);\n }", "public function getIterator()\n {\n foreach ($this->iterable as $item) {\n yield $item;\n }\n }", "public function getIterator()\n {\n return new ArrayIterator($this->items->all());\n }", "public function getIterator()\n {\n return new \\ArrayIterator(array_values($this->collection->getAll()));\n }", "public function getIterator()\n {\n return new ArrayIterator($this->getPipes());\n }", "public function iterator() {\n return new SimpleIterator(array_keys($this->elements));\n }", "public function getIterator()\n {\n return new \\ArrayIterator($this->_items);\n }", "public function getIterator()\n\t{\n\t\treturn new \\ArrayIterator($this->array);\n\t}", "public function getIterator() {\n\n\t\tif ($this->_hasAdapter(get_class(), __FUNCTION__))\n\t\t\treturn $this->_callAdapter(get_class(), __FUNCTION__);\n\n\t\tif ($this->_collection === null) {\n\t\t\t$this->_collection = new Collection();\n\t\t}\n\t\treturn $this->_collection->getIterator();\n\t}", "public function getIterator()\n\t{\n\t\tif($this->_statement == null)\n\t\t\t$this->execute($this->params);\n\t\t//if($this->_statement instanceof PDOStatement)\n\t\t\t//var_dump($this->_statement);\n\t\treturn new IteratorIterator($this->_statement);\n\t}", "public function getIterator() {\n\n\t\treturn new \\ArrayIterator( $this->fields );\n\t}", "abstract protected function getFilters();", "public function getIterator() {\n return new \\ArrayIterator($this->getValues());\n }", "public function getIterator()\n {\n return new \\ArrayIterator($this->defaultVariables);\n }", "private static function _getFilter() {}", "public function getIterator()\n {\n $this->reset();\n return $this->queue;\n }", "public function getIterator()\n {\n // Ensure immutable.\n return new IteratorProxy($this->iterator);\n }", "public function getIterator(): Generator\n {\n return $this->items;\n }", "public function getFilter();", "public function getFilter();", "public function getIterator()\n {\n return new \\ArrayIterator($this->_cache);\n }", "public function getIterator()\n\t{\n\t\t$attributes=$this->getAttributes();\n\t\treturn new CMapIterator($attributes);\n\t}", "public function getIterator()\n {\n return new ArrayIterator($this->items);\n }", "public function getIterator()\n {\n return new ArrayIterator($this->items);\n }", "public function getIterator()\n {\n return new ArrayIterator($this->items);\n }", "public function getIterator()\n {\n return new ArrayIterator($this->items);\n }", "public function getIterator()\n {\n return new ArrayIterator($this->items);\n }", "public function getIterator()\n {\n return new ArrayIterator($this->items);\n }", "public function getIterator()\n {\n return new GroupedCollectionIterator($this->groups);\n }", "public function getIterator()\n {\n return new \\ArrayIterator($this->parameters);\n }", "public function getFilter()\n {\n return $this->filterComposite;\n }", "function getIterator(){\n if(is_null($i=$this->model?:$this->dq?:$this->iter))\n throw $this->exception('Please specify data source with setSource or setModel');\n return $i;\n }", "public function getIterator()\n {\n return new \\ArrayIterator($this->stack);\n }", "public function offered() {\n\t\treturn new PSU_Student_Finaid_Awards_OfferedFilterIterator( $this->getIterator() );\n\t}", "function getInnerIterator()\n\t{\n\t\treturn $this->iterator;\n\t}", "public function iterator()\n {\n $i = new CollectionIterator($this);\n return $i;\n }", "public function filter();", "public function getIterator()\n {\n return new ArrayIterator($this->toArray());\n }", "public function getIterator()\r\n {\r\n return new \\ArrayIterator($this->data);\r\n }", "public function getIterator() {\n return new ArrayIterator($this->getAll());\n }", "public function getIterator()\n {\n return new \\ArrayIterator($this->data);\n }", "public function getIterator()\n {\n return new \\ArrayIterator($this->data);\n }", "public function getIterator()\n {\n return new ArrayIterator($this->attributes);\n }", "public function getIterator()\r\n {\r\n return new ArrayIterator($this->attributes);\r\n }", "public function getIterator()\n {\n return new \\ArrayIterator($this);\n }", "public function current()\n {\n return current($this->_filters);\n }", "public function getIterator()\n {\n return new \\ArrayIterator($this->_data);\n }", "public function getIterator(){\n\t\treturn new \\ArrayIterator($this->getConstantsList());\n\t}", "public function getIterator()\n {\n return new ArrayIterator((array)$this->data);\n }", "public function getIterator()\n {\n $obj = $this->path;\n if (! $obj instanceof SplFileObject) {\n $obj = new SplFileObject($this->getStreamFilterPath(), $this->open_mode);\n }\n $obj->setCsvControl($this->delimiter, $this->enclosure, $this->escape);\n $obj->setFlags($this->flags);\n\n return $obj;\n }", "public function all(): \\Iterator;", "public function getIterator()\n {\n return new ArrayIterator($this->export());\n }", "public function getIterator()\n {\n return new ArrayIterator($this->parameters);\n }", "public function getIterator()\n {\n return new StackIterator($this);//vracamo StackIterator za trenutni objekat\n }" ]
[ "0.740801", "0.6668728", "0.65150416", "0.65150416", "0.6460699", "0.6460699", "0.6460699", "0.6460699", "0.6460699", "0.6460699", "0.64158684", "0.6388515", "0.6372714", "0.6364152", "0.63319945", "0.63037616", "0.63006115", "0.6271245", "0.62501305", "0.6229372", "0.61888015", "0.61876434", "0.61723244", "0.61610496", "0.61442906", "0.6132979", "0.61264205", "0.61224097", "0.6118287", "0.6103128", "0.6095997", "0.6095997", "0.60840267", "0.60777754", "0.60776347", "0.60714066", "0.6068479", "0.60620016", "0.6061407", "0.6042772", "0.6035789", "0.60350573", "0.6025846", "0.60251504", "0.6019209", "0.601825", "0.6004651", "0.6003075", "0.6001912", "0.5994612", "0.5992699", "0.5988462", "0.5981974", "0.59781706", "0.59603554", "0.5959666", "0.594339", "0.59363854", "0.5918541", "0.5913982", "0.5911504", "0.5911274", "0.5909111", "0.5897232", "0.58970284", "0.5894673", "0.5894673", "0.5884882", "0.58832693", "0.5870468", "0.5870468", "0.5870468", "0.5870468", "0.5870468", "0.5870468", "0.58649147", "0.5861146", "0.5860784", "0.5856099", "0.585006", "0.5848672", "0.5844913", "0.5844567", "0.584209", "0.5838245", "0.5836868", "0.58240545", "0.5819726", "0.5819726", "0.5813059", "0.58079404", "0.58049315", "0.5804828", "0.58036506", "0.58016455", "0.5801458", "0.57978237", "0.57895035", "0.57798165", "0.5771804", "0.57686335" ]
0.0
-1
Assigns an array of helpers to be used with migrations
public function setHelpers($helpers) { $this->helpers = $helpers; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function helpers()\n {\n $HELPERS_FILE = [];\n // From base\n if (file_exists($pathHelpers = VENDOR_KNOB_BASE_DIR . '/src/config/' . static::HELPERS_FILE . '.php')) {\n $HELPERS_FILE += include $pathHelpers;\n }\n // From App\n if (file_exists($pathHelpers = APP_DIR . '/config/' . static::HELPERS_FILE . '.php')) {\n $HELPERS_FILE += include $pathHelpers;\n }\n\n return array_merge([\n 'case' => [\n 'lower' => function ($value) {\n return strtolower((string)$value);\n },\n 'upper' => function ($value) {\n return strtoupper((string)$value);\n },\n ],\n 'count' => function ($value = []) {\n return count($value);\n },\n 'moreThan1' => function ($value = []) {\n return count($value) > 1;\n },\n 'date' => [\n 'xmlschema' => function ($value) {\n return date('c', strtotime($value));\n },\n 'string' => function ($value) {\n return date('l, d F Y', strtotime($value));\n },\n 'format' => function ($value) {\n return date(get_option('date_format'), strtotime($value));\n },\n ],\n 'toArray' => function ($value) {\n return explode(',', $value);\n },\n 'ucfirst' => function ($value) {\n return ucfirst($value);\n },\n ], $HELPERS_FILE);\n }", "public function Helpers($helpers){\r\n foreach($helpers as $helper ){\r\n $this->Helper($helper);\r\n }\r\n }", "protected function helpers(array $helpers)\n {\n $this->container->get('loader')->loadHelpers($this, $helpers);\n }", "public function getHelpers()\n {\n return [\n ];\n }", "private function restore_helpers($helpers) {\n foreach ($helpers as $name => $function) {\n // Restore the helper functions. Must call parent::add here to avoid\n // a recursion problem.\n parent::add($name, $function);\n }\n }", "protected function registerHelpers()\n {\n require __DIR__.'/Support/helpers.php';\n }", "protected function getHelpers(): array\n {\n return [];\n }", "public function registerHelpers()\n {\n parent::registerHelpers();\n require __DIR__.'/../src/helpers.php';\n }", "function getHelpers() {\r\n return is_array($this->helpers) ? $this->helpers : array($this->helpers);\r\n }", "private static function _initHelpersNamespaces () {\n\t\t$app = & \\MvcCore\\Application::GetInstance();\n\t\tstatic::$helpersNamespaces = [\n\t\t\t'\\\\MvcCore\\\\Ext\\\\Views\\Helpers\\\\',\n\t\t\t// and '\\App\\Views\\Helpers\\' by default:\n\t\t\t'\\\\' . implode('\\\\', [\n\t\t\t\t$app->GetAppDir(),\n\t\t\t\t$app->GetViewsDir(),\n\t\t\t\tstatic::$helpersDir\n\t\t\t]) . '\\\\',\n\t\t];\n\t}", "public abstract function getSchemaHelperListToGenerate();", "function helper(){\n // vde(Application::$helpers);\n foreach(func_get_args() as $helper)\n Application::$helpers->load($helper);\n // System::include_helper($helper);\n}", "function __buildHelperPaths($helperPaths) {\r\n\t\t$_this =& Configure::getInstance();\r\n\t\t$_this->helperPaths[] = HELPERS;\r\n\t\tif (isset($helperPaths)) {\r\n\t\t\tforeach($helperPaths as $value) {\r\n\t\t\t\t$_this->helperPaths[] = $value;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public function loadHelpers()\n {\n require_once __DIR__.'/helpers.php';\n }", "public function getMigrations();", "private function loadHelpers()\n {\n foreach($this->helpers as $helper)\n {\n require app_path() . '/' . $helper;\n }\n }", "public function provideGetHelper()\n {\n return [\n 'Csv helper' => [\n 'helper' => 'csv',\n ],\n\n 'Exception helper' => [\n 'helper' => 'exception',\n ],\n\n 'InputCheckbox helper' => [\n 'helper' => 'InputCheckbox',\n ],\n\n 'InputPassword helper' => [\n 'helper' => 'InputPassword',\n ],\n\n 'InputPassword helper' => [\n 'helper' => 'InputPassword',\n ],\n\n 'InputSelect helper' => [\n 'helper' => 'InputSelect',\n ],\n\n 'InputSubmit helper' => [\n 'helper' => 'InputSubmit',\n ],\n\n 'InputTextarea helper' => [\n 'helper' => 'InputTextarea',\n ],\n\n 'InputText helper' => [\n 'helper' => 'InputText',\n ],\n\n 'InputText helper, but already has it' => [\n 'Helper' => 'InputText',\n 'helpers' => [\n 'InputText' => new \\MvcLite\\View\\Helper\\InputText,\n ],\n ],\n\n 'Bad Helper, expect exception' => [\n 'helper' => 'does not exist',\n 'helpers' => [],\n 'exception' => true,\n ]\n\n ];\n }", "function _load_helpers()\r\n\t{\r\n\t\t// Load inflector helper for singular and plural functions\r\n\t\t$this->load->helper('inflector');\r\n\r\n\t\t// Load security helper for prepping functions\r\n\t\t$this->load->helper('security');\r\n\t}", "public function collectMigrations(): array;", "public function getMigrations()\n {\n return [\n CreateKeyPairTable::class,\n ];\n }", "protected function registerHelpers() {\r\n $this->service\r\n ->sharedData()\r\n ->set('appHelper', array(\r\n 'absotuleUri' => $this->request->server()->exists('HTTPS') ? \"https://{$this->request->server()->get('SERVER_NAME')}/{$this->request->uri()}\" : \"http://{$this->request->server()->get('SERVER_NAME')}/{$this->request->uri()}\",\r\n ));\r\n }", "public function getMigrations(){\n $migrations[] = new migrateTable0001($this->get('db'));\n $migrations[] = new migrateTable0002($this->get('db'));\n $migrations[] = new migrateTableEvent($this->get('db'));\n $migrations[] = new migrateTableMessages($this->get('db'));\n $migrations[] = new migrateTablePerson($this->get('db'));\n $migrations[] = new migrateTable122320151845($this->get('db'));\n\n return $migrations;\n }", "protected function loadHelpers(): void\n {\n $files = glob(__DIR__ . '/../Helpers/*.php');\n foreach ($files as $file) {\n require_once($file);\n }\n }", "public function get_app_script_helpers()\n {\n }", "public function loadHelpers(){\n $this->file->require('vendor/helpers.php');\n }", "public static function __shortcuts()\n {\n $shortcuts = array('form' => array('form', array('manage_fightus')), 'email' => 'MyMailer');\n return array_merge(parent::$shortcuts, $shortcuts);\n }", "function ptn_migration_migrate_api() {\n $common_arguments = array(\n\n );\n\n $api = array(\n 'api' => 2,\n 'groups' => array(\n 'ptncustom' => array(\n 'title' => t('PTN custom migrations'),\n ),\n ),\n 'migrations' => array(\n 'PtnBooklet' => $common_arguments + array(\n 'class_name' => 'PtnBookletMigration',\n 'destination_type' => 'booklet',\n 'group_name' => 'ptncustom',\n 'description' => 'Custom migration for booklets',\n 'dependencies' => array(\n ),\n ),\n 'PtnSentence' => $common_arguments + array(\n 'class_name' => 'PtnSentenceMigration',\n 'destination_type' => 'sentence',\n 'group_name' => 'ptncustom',\n 'description' => 'Custom migration for sentences',\n 'dependencies' => array(\n 'PtnBooklet',\n ),\n ),\n ),\n );\n return $api;\n}", "protected function _Load_Helpers() {\r\n $dir = untrailingslashit( plugin_dir_path(__FILE__ ) );\r\n // Recurssively load the directory\r\n $this->_Recusive_Load_Dir($dir.'/helpers');\r\n // Fire the shortcode init action\r\n do_action('vcff_supports_helper_init',$this);\r\n }", "public function migrate()\n {\n $fileSystem = new Filesystem();\n $classFinder = new ClassFinder();\n\n foreach ($fileSystem->files(__DIR__.'/../../../../tests/NilPortugues/App/Migrations') as $file) {\n $fileSystem->requireOnce($file);\n $migrationClass = $classFinder->findClass($file);\n (new $migrationClass())->down();\n (new $migrationClass())->up();\n }\n }", "public function migrate() {}", "function _initActionHelpers(){\n Zend_Controller_Action_HelperBroker::addPath(APPLICATION_PATH . '/controllers/helpers', 'My_Action_Helper');\n }", "protected function setUpRenderBuildInHelpers (& $helpers) {\n\t\t$router = $this->controller->GetRouter();\n\t\t$helpers += [\n\t\t\t'url' => function ($controllerActionOrRouteName = 'Index:Index', array $params = []) use (& $router) {\n\t\t\t\t/** @var \\MvcCore\\Router $router */\n\t\t\t\treturn $router->Url($controllerActionOrRouteName, $params);\n\t\t\t},\n\t\t\t'assetUrl' => function ($path = '') use (& $router) {\n\t\t\t\t/** @var \\MvcCore\\Router $router */\n\t\t\t\treturn $router->Url('Controller:Asset', ['path' => $path]);\n\t\t\t},\n\t\t\t'escape' => function ($str, $encoding = NULL) {\n\t\t\t\treturn $this->Escape($str, $encoding);\n\t\t\t},\n\t\t\t'escapeHtml' => function ($str, $encoding = NULL) {\n\t\t\t\treturn $this->EscapeHtml($str, $encoding);\n\t\t\t},\n\t\t\t'escapeAttr' => function ($str, $double = TRUE, $encoding = NULL) {\n\t\t\t\treturn $this->EscapeAttr($str, $double, $encoding);\n\t\t\t},\n\t\t\t'escapeXml' => function ($str, $encoding = NULL) {\n\t\t\t\treturn $this->EscapeXml($str, $encoding);\n\t\t\t},\n\t\t\t'escapeJs' => function ($str, $flags = 0, $depth = 512) {\n\t\t\t\treturn $this->EscapeJs($str, $flags, $depth);\n\t\t\t},\n\t\t\t'escapeCss' => function ($str) {\n\t\t\t\treturn $this->EscapeCss($str);\n\t\t\t},\n\t\t\t'escapeICal' => function ($str) {\n\t\t\t\treturn $this->EscapeICal($str);\n\t\t\t},\n\t\t];\n\t}", "public function supportsMigrations();", "function addHelper() {\r\n $args = func_get_args();\r\n if(!is_array($args)) {\r\n return false;\r\n } // if\r\n \r\n foreach($args as $helper_name) {\r\n if(trim($helper_name) == '') {\r\n continue;\r\n } // if\r\n \r\n if(!in_array($helper_name, $this->helpers) && $this->engine->useHelper($helper_name)) {\r\n $this->helpers[] = $helper_name;\r\n } // if\r\n } // foreach\r\n \r\n return true;\r\n }", "public function includeAppHelpers() {\n\t\tinclude_once( MWW_PATH . '/app/Support/helpers.php' );\n\t}", "private function addHelpers() {\n\n $this->info('Adding helpers to composer.json');\n\n $path = base_path('composer.json');\n $contents = file_get_contents($path);\n $manipulator = new JsonManipulator($contents);\n $jsonContents = $manipulator->getContents();\n $decoded = JsonFile::parseJson($jsonContents);\n $datas = isset($decoded['extra']['include_files']) ? $decoded['extra']['include_files'] : [];\n $value = 'vendor/mediactive-digital/medkit/src/helpers.php';\n\n foreach ($datas as $key => $entry) {\n\n if ($entry == $value) {\n\n $value = '';\n\n break;\n }\n }\n\n if ($value) {\n\n $datas[] = $value;\n $manipulator->addProperty('extra.include_files', $datas);\n $contents = $manipulator->getContents();\n\n file_put_contents($path, $contents);\n }\n else {\n\n $this->error(' #ERR1 [SKIP] ' . $path . ' already has helpers');\n }\n }", "public function migrate()\n\t{\n\t}", "private function getMigrations()\n\t\t{\n\t\t\tif(self::$migrations)\n\t\t\t{\n\t\t\t\treturn self::$migrations;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tforeach(\\System\\DB\\DataAdapter::create(\"adapter=dir;source=\".__MIGRATIONS_PATH__.\";\")->openDataSet()->rows as $row)\n\t\t\t\t{\n\t\t\t\t\tif(\\strpos($row[\"name\"], '.php'))\n\t\t\t\t\t{\n\t\t\t\t\t\trequire $row[\"path\"];\n\t\t\t\t\t\t$migration = \\str_replace(\".php\", \"\", $row[\"name\"]);\n\t\t\t\t\t\teval(\"\\$migration = new \\\\System\\\\Migrate\\\\{$migration}();\");\n\n\t\t\t\t\t\tself::$migrations[] = new $migration();\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$CSort = new MigrationCompare();\n\t\t\t\tusort( self::$migrations, array( &$CSort, 'compareVersion' ));\n\t\t\t\treturn self::$migrations;\n\t\t\t}\n\t\t}", "public function prepareAddOns()\n {\n $this->addOns['tests'] = config('app-generator.add_on.tests', false);\n }", "public function addHelpers(&$view) {\n $view = preg_replace_callback('/({)({)((?:[a-zA-Z0-9_,->()s]*))(})(})/',\n function($match) {\n $func_exp = explode('->', $match[3]);\n $function = trim($func_exp[0]);\n $params = explode(',', trim($func_exp[1]));\n\n return call_user_func_array($this->functions[$function], $params);\n }, $view);\n }", "protected function replacements(): array\n {\n return [\n 'useModel' => $this->useModel(),\n 'modelClass' => $this->modelClass(),\n 'useSeeder' => $this->useSeeder(),\n 'seed' => $this->seed(),\n ];\n }", "public function testCellInheritsHelperConfig(): void\n {\n $request = new ServerRequest();\n $response = new Response();\n $helpers = ['Url', 'Form', 'Banana'];\n\n $view = new View($request, $response, null, ['helpers' => $helpers]);\n\n $cell = $view->cell('Articles');\n $expected = array_combine($helpers, [[], [], []]);\n $this->assertSame($expected, $cell->viewBuilder()->getHelpers());\n }", "public function install()\n\t{\n\t\tif ( $this->db->table_exists('helper') && $this->db->table_exists('helper_categories'))\n\t\t{\n\t\t\t$this->dbforge->drop_table('helper');\n\t\t\t$this->dbforge->drop_table('helper_categories');\n\t\t}\n\n\t\t$tables = [\n\t\t\t'helper'\t=> [\n\t\t\t\t'id'\t\t\t\t=> ['type' => 'INT', 'constraint' => 11, 'auto_increment' => TRUE, 'primary' => TRUE],\n\t\t\t\t'adminId'\t\t\t=> ['type' => 'INT','constraint' => 11],\n\t\t\t\t'slug'\t\t\t\t=> ['type' => 'VARCHAR', 'constraint' => 200, 'key' => TRUE],\n\t\t\t\t'metaTitle'\t\t\t=> ['type' => 'VARCHAR', 'constraint' => 255],\n\t\t\t\t'metaKeyword'\t\t=> ['type' => 'VARCHAR', 'constraint' => 255],\n\t\t\t\t'featured'\t\t\t=> ['type' => 'TINYINT', 'constraint' => 1, 'default' => 0],\n\t\t\t\t'content'\t\t\t=> ['type' => 'TEXT'],\n\t\t\t\t'usefulCount'\t\t=> ['type' => 'INT', 'constraint' => 11, 'default' => 0],\n\t\t\t\t'uselessCount'\t\t=> ['type' => 'INT', 'constraint' => 11, 'default' => 0],\n\t\t\t\t'createOn'\t\t\t=> ['type' => 'INT', 'constraint' => 11]\n\t\t\t],\n\t\t\t'helper_categories' => [\n\t\t\t\t'id'\t\t\t=> ['type' => 'INT', 'constraint' => 11, 'auto_increment' => TRUE, 'primary' => TRUE],\n\t\t\t\t'title'\t\t\t=> ['type' => 'VARCHAR', 'constraint' => 100],\n\t\t\t\t'keywords'\t\t=> ['type' => 'VARCHAR', 'constraint' => 200, 'null' => TRUE],\n\t\t\t\t'description'\t=> ['type' => 'VARCHAR', 'constraint' => 200, 'null' => TRUE],\n\t\t\t\t'faIcon'\t\t=> ['type' => 'VARCHAR', 'constraint' => 50, 'null' => TRUE],\n\t\t\t\t'parent'\t\t=> ['type' => 'INT', 'constraint' => 11, 'default' => 0],\n\t\t\t\t'isDisplay'\t\t=> ['type' => 'TINYINT', 'constraint' => 1, 'default' => 1]\n\t\t\t],\n\t\t];\n\n\t\tif ( ! $this->installTables($tables))\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\n\t\treturn TRUE;\n\t}", "function agnosia_initialize_helpers() {\r\n\r\n\tinclude_once agnosia_get_path( '/inc/utils/agnosia-helpers.php' );\r\n\r\n}", "public function provides()\n {\n return array_merge(array_values($this->devCommands), [ 'migration.creator' ]);\n }", "public function getMigrationPaths();", "private function _addHelper()\n {\n require __DIR__.'/../Support/SsoHelper.php';\n }", "protected function getMigrator_HelperService()\n {\n return $this->services['migrator.helper'] = new \\phpbb\\db\\migration\\helper();\n }", "public function migrate() \n {\n\n Masteryl_Migration::createOrUpdateDir(MASTERYL_MIGRATIONS_PATH, $this);\n\n if(!empty($this->modules)) {\n foreach($this->modules as $mod) {\n $dir = $mod['path'].'migrations';\n \n if(file_exists($dir))\n Masteryl_Migration::createOrUpdateDir($dir, $this);\n }\n }\n\n }", "protected function initShortcuts() {}", "protected function getDefaultHelperSet()\n {\n $helperSet = parent::getDefaultHelperSet();\n\n $helperSet->set(new DialogHelper());\n $helperSet->set(new SymfttpdHelper($this->getServerNames(), $this->getGatewayNames()));\n\n return $helperSet;\n }", "public function testMigrations()\n {\n // dd(Schema::getAllTables());\n $fieldtypes = Schema::getColumnListing('fieldtypes');\n $this->assertEquals([\n 'name',\n 'template'\n ], $fieldtypes);\n\n $forms = Schema::getColumnListing('forms');\n $this->assertEquals([\n 'id',\n 'name',\n 'config',\n 'editor',\n 'handler',\n 'formable_type',\n 'formable_id',\n 'created_at',\n 'updated_at'\n ], $forms);\n\n $fields = Schema::getColumnListing('fields');\n $this->assertEquals([\n 'id',\n 'name',\n 'label',\n 'type',\n 'to_list',\n 'to_edit',\n 'help',\n 'config',\n 'content',\n 'validation',\n 'parent_id',\n 'form_id',\n 'dynamic'\n ], $fields);\n\n\n $field_sources = Schema::getColumnListing('field_sources');\n $this->assertEquals([\n 'id',\n 'sourceable_type',\n 'sourceable_id',\n 'field_id',\n 'related_field',\n 'data',\n 'criteria'\n ], $field_sources);\n }", "public function getHelper()\n {\n }", "public function register()\n {\n foreach (glob(__DIR__ . '/Helpers/*.php') as $filename) {\n require_once $filename;\n }\n }", "function migrate_db() {\r\n \r\n // $migrater->create_migrations_table();\r\n // $migrater->build_schema();\r\n }", "public function boot()\r\n {\r\n Str::mixin(new StrMacros);\r\n\r\n foreach (scandir(__DIR__ . DIRECTORY_SEPARATOR . 'helpers') as $helperFile) {\r\n $path = sprintf(\r\n '%s%s%s%s%s',\r\n __DIR__,\r\n DIRECTORY_SEPARATOR,\r\n 'helpers',\r\n DIRECTORY_SEPARATOR,\r\n $helperFile\r\n );\r\n\r\n if (!is_file($path)) {\r\n continue;\r\n }\r\n\r\n $function = Str::before($helperFile, '.php');\r\n\r\n if (function_exists($function)) {\r\n continue;\r\n }\r\n\r\n require_once $path;\r\n }\r\n }", "protected function getMigrations()\n {\n $finder = new Finder();\n $files = $finder->files()\n ->name('*table.php')\n ->notName('2014*')\n ->in(database_path() . '/migrations');\n\n foreach ($files as $file) {\n $this->migrations[] = $file->getRealPath() ;\n }\n }", "protected function databaseCommands()\n {\n return [\n SeederMakeCommand::class,\n FactoryMakeCommand::class,\n MigrationMakeCommand::class,\n ];\n }", "public function getFunctions()\n {\n return array_merge(parent::getFunctions(), array(\n 'base' => new \\Twig_Function_Function('URL::base'),\n 'form_token' => new \\Twig_Function_Function('Form::token'),\n 'can' => new \\Twig_Function_Function('Auth::can'),\n 'editor' => new \\Twig_Function_Function('\\Ionic\\Editor::create'),\n 'widget' => new \\Twig_Function_Function('\\Ionic\\Widget::factory_show'),\n 'make' => new \\Twig_Function_Function('ionic_make_link'),\n 'thumb' => new \\Twig_Function_Function('ionic_thumb')\n ));\n }", "protected function registerHelperServiceProvider()\n {\n $namespace = Str::replaceLast('\\\\', '', $this->getAppNamespace());\n\n file_put_contents(config_path('app.php'), str_replace(\n \"{$namespace}\\\\Providers\\EventServiceProvider::class,\" . PHP_EOL,\n \"{$namespace}\\\\Providers\\EventServiceProvider::class,\" . PHP_EOL . \" Haxibiao\\Helpers\\HelpersServiceProvider::class,\" . PHP_EOL,\n file_get_contents(config_path('app.php'))\n ));\n }", "function migrate()\r\n\t{\r\n\t\treturn '';\r\n\t}", "protected function _initControllerHelpers()\n\t{\n\t\tZend_Controller_Action_HelperBroker::addPath(APPLICATION_PATH . '/controllers/Helper', 'Tourchhelper');\t\n\t}", "public function registerMigrationService()\n {\n return array(\n 'amforms' => craft()->amForms_schematic,\n );\n }", "public function helpers()\n {\n if ($this->_helpers === null) {\n $this->_helpers = new HelperRegistry($this);\n }\n\n return $this->_helpers;\n }", "public function migrate()\n {\n $fileSystem = new Filesystem();\n\n $fileSystem->copy(\n __DIR__.'/../database/migrations/2018_06_29_032244_create_laravel_follow_tables.php',\n __DIR__.'/database/migrations/create_laravel_follow_tables.php'\n );\n\n foreach ($fileSystem->files(__DIR__.'/database/migrations') as $file) {\n $fileSystem->requireOnce($file);\n }\n\n (new \\CreateLaravelFollowTables())->up();\n (new \\CreateUsersTable())->up();\n (new \\CreateOthersTable())->up();\n }", "public static function __shortcuts()\n {\n $shortcuts = array('user', 'pdc', 'game');\n return array_merge(parent::$shortcuts, $shortcuts);\n }", "function vibrantlife_field_helpers() {\n\n\tif ( ! class_exists( 'RBM_FieldHelpers' ) ) {\n\t require_once 'rbm-field-helpers/rbm-field-helpers.php';\n\t}\n\n\tstatic $field_helpers;\n\n\tif ( $field_helpers === null ) {\n\n\t\t$field_helpers = new RBM_FieldHelpers( array(\n\t\t\t'ID' => 'vibrantlife',\n\t\t) );\n\t}\n\n\treturn $field_helpers;\n}", "public static function webMigrateAll()\n {\n ob_start();\n $controller = new self('migrate', Yii::$app);\n $controller->db = Yii::$app->db;\n $controller->interactive = false;\n $controller->includeModuleMigrations = true;\n $controller->color = false;\n $controller->runAction('up');\n\n\t\treturn ob_get_clean();\n }", "private static function migrationPaths()\n {\n $migrationDirs = [];\n foreach (app('migrator')->paths() as $path) {\n $migrationDirs[] = str_replace([\n '\\\\',\n '/',\n ], [\n DIRECTORY_SEPARATOR,\n DIRECTORY_SEPARATOR,\n ], $path);\n }\n\n /*foreach ($migrationDirs as $dir) {\n $parts = explode(DIRECTORY_SEPARATOR, $dir);\n\n foreach($parts as $part) {\n\n }\n }*/\n\n return $migrationDirs;\n }", "function migrate(){\n\n create_table();\n save_migration_tables();\n\n}", "public function migrateDb();", "private function helpers()\n {\n $relative_location = $this->args['application_folder'] . DIRECTORY_SEPARATOR . 'helpers' . DIRECTORY_SEPARATOR;\n $helper_directory = $this->args['location'] . DIRECTORY_SEPARATOR . 'helpers' . DIRECTORY_SEPARATOR;\n if (!empty($this->args['subdirectories']))\n {\n $relative_location .= $this->args['subdirectories'];\n $helper_directory .= $this->args['subdirectories'] . DIRECTORY_SEPARATOR;\n }\n $relative_helper_location = $relative_location . DIRECTORY_SEPARATOR . strtolower($this->args['name']) . '_helper.php';\n $helper_file = $helper_directory . strtolower($this->args['name']) . '_helper.php';\n\n if (!is_dir($helper_directory))\n {\n $message = \"\\t\";\n if (mkdir($helper_directory, 0755, TRUE))\n {\n $message .= 'Created folder: ';\n if (php_uname(\"s\") !== \"Windows NT\")\n {\n $message = ApplicationHelpers::colorize($message, 'green') . $relative_location;\n }\n else\n {\n $message .= $relative_location;\n }\n fwrite(STDOUT, $message . PHP_EOL);\n unset($message);\n }\n else\n {\n $message .= 'Unable to create folder: ';\n if (php_uname(\"s\") !== \"Windows NT\")\n {\n $message = ApplicationHelpers::colorize($message, 'red') . $relative_location;\n }\n else\n {\n $message .= $relative_location;\n }\n fwrite(STDOUT, $message . PHP_EOL);\n return false;\n }\n }\n\n if (file_exists($helper_file))\n {\n $message = \"\\tHelper already exists: \";\n if (php_uname(\"s\") !== \"Windows NT\")\n {\n $message = ApplicationHelpers::colorize($message, 'light_blue') . $relative_helper_location;\n }\n else\n {\n $message .= $relative_helper_location;\n }\n fwrite(STDOUT, $message . PHP_EOL);\n unset($message);\n return true;\n }\n else\n {\n $content = \"<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');\" . PHP_EOL;\n $content .= PHP_EOL . PHP_EOL . PHP_EOL;\n $content .= '/* End of file ' . strtolower($this->args['name']) . '_helper.php */' . PHP_EOL;\n $content .= '/* Location: ./' . $relative_location . ' */';\n\n $message = \"\\t\";\n if (file_put_contents($helper_file, $content))\n {\n $message .= 'Created helper: ';\n if (php_uname(\"s\") !== \"Windows NT\")\n {\n $message = ApplicationHelpers::colorize($message, 'green') . $relative_helper_location;\n }\n else\n {\n $message .= $relative_helper_location;\n }\n }\n else\n {\n $message .= 'Unable to create helper: ';\n if (php_uname(\"s\") !== \"Windows NT\")\n {\n $message = ApplicationHelpers::colorize($message, 'red') . $relative_helper_location;\n }\n else\n {\n $message .= $relative_helper_location;\n }\n }\n\n fwrite(STDOUT, $message . PHP_EOL);\n unset($message);\n }\n\n return true;\n }", "public function tools()\n {\n return [\n new Viewcache,\n new PriceTracker(),\n new UpdateOrder(),\n ];\n }", "public function getFunctions()\n {\n return [\n new \\Twig_SimpleFunction('get_active_locales', [$this, 'getActiveLocales']),\n new \\Twig_SimpleFunction('set_locale_switch_paths', [$this, 'setSwitchPaths']),\n new \\Twig_SimpleFunction('get_locale_switch_paths', [$this, 'getSwitchPaths']),\n new \\Twig_SimpleFunction('add_locale_switch_path', [$this, 'addSwitchPath']),\n ];\n }", "public function updateClassAliasesDataProvider()\n {\n return [\n 'plain text replace model' => include __DIR__ . '/_files/data_content_plain_model.php',\n 'plain text replace resource' => include __DIR__ . '/_files/data_content_plain_resource.php',\n 'plain text replace with pk field' => include __DIR__ . '/_files/data_content_plain_pk_fields.php',\n 'xml replace' => include __DIR__ . '/_files/data_content_xml.php',\n 'wiki markup replace' => include __DIR__ . '/_files/data_content_wiki.php',\n 'serialized php replace' => include __DIR__ . '/_files/data_content_serialized.php'\n ];\n }", "public function updateIdehelper()\n {\n \t$this->say('Update barryvdh/laravel-ide-helper');\n \t$this->taskExecStack('Update barryvdh/laravel-ide-helper')\n \t\t\t->stopOnFail()\n \t\t\t->exec('php artisan clear-compiled')\n \t\t\t->exec('php artisan ide-helper:generate')\n \t\t\t->exec('php artisan optimize')\n \t\t\t->run();\n }", "function _initViewHelpers()\n {\n // defined in /config/application.ini\n $this->bootstrap('layout');\n $layout = $this->getResource('layout');\n $view = $layout->getView();\n $view->addHelperPath(APPLICATION_PATH . '/common/helpers', 'My_View_Helper');\n $view->addHelperPath(APPLICATION_PATH . '/controllers/helpers', 'My_Action_Helper');\n //$view->addHelperPath(APPLICATION_PATH .'/view/helpers', '');\n\n //enable Zend JQuery\n ZendX_JQuery::enableView($view);\n\n // use zend helpers to generate meta tags\n $view->doctype('HTML4_STRICT');\n $view->headMeta()->appendHttpEquiv('Content-type', 'text/html;charset=utf-8')\n ->appendName('description', 'FACES');\n\n // use zend helpers to seperate major and minor titles\n $view->headTitle()->setSeparator(' - ');\n $view->headTitle('FACES');\n }", "private function _populateMigrationTable()\n\t{\n\t\t$migrations = array();\n\n\t\t// Add the base one.\n\t\t$migration = new MigrationRecord();\n\t\t$migration->version = craft()->migrations->getBaseMigration();\n\t\t$migration->applyTime = DateTimeHelper::currentUTCDateTime();\n\t\t$migrations[] = $migration;\n\n\t\t$migrationsFolder = craft()->path->getAppPath().'migrations/';\n\t\t$migrationFiles = IOHelper::getFolderContents($migrationsFolder, false, \"(m(\\d{6}_\\d{6})_.*?)\\.php\");\n\n\t\tif ($migrationFiles)\n\t\t{\n\t\t\tforeach ($migrationFiles as $file)\n\t\t\t{\n\t\t\t\tif (IOHelper::fileExists($file))\n\t\t\t\t{\n\t\t\t\t\t$migration = new MigrationRecord();\n\t\t\t\t\t$migration->version = IOHelper::getFileName($file, false);\n\t\t\t\t\t$migration->applyTime = DateTimeHelper::currentUTCDateTime();\n\n\t\t\t\t\t$migrations[] = $migration;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tforeach ($migrations as $migration)\n\t\t\t{\n\t\t\t\tif (!$migration->save())\n\t\t\t\t{\n\t\t\t\t\tCraft::log('Could not populate the migration table.', LogLevel::Error);\n\t\t\t\t\tthrow new Exception(Craft::t('There was a problem saving to the migrations table: ').$this->_getFlattenedErrors($migration->getErrors()));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tCraft::log('Migration table populated successfully.');\n\t}", "function register_friendly_toggles($buttons) {\n\t// inserts a separator between existing buttons and our new one\n\t// \"friendly_button\" is the ID of our button\n\tarray_push($buttons, \"friendly_toggle\");\n\treturn $buttons;\n}", "public function FillTable(){\n\n $helpers = Helper::all();\n\n foreach ($helpers as $key=>$helper){\n\n $helper->update(['id'=>$key+1]);\n }\n }", "public function getFunctions(): array {\n\n return [\n new TwigFunction(\"adminBSBButtonDanger\", [$this, \"adminBSBButtonDangerFunction\"], [\"is_safe\" => [\"html\"]]),\n new TwigFunction(\"adminBSBButtonDefault\", [$this, \"adminBSBButtonDefaultFunction\"], [\"is_safe\" => [\"html\"]]),\n new TwigFunction(\"adminBSBButtonInfo\", [$this, \"adminBSBButtonInfoFunction\"], [\"is_safe\" => [\"html\"]]),\n new TwigFunction(\"adminBSBButtonMaterialDesign\", [$this, \"adminBSBButtonMaterialDesignFunction\"], [\"is_safe\" => [\"html\"]]),\n new TwigFunction(\"adminBSBButtonPrimary\", [$this, \"adminBSBButtonPrimaryFunction\"], [\"is_safe\" => [\"html\"]]),\n new TwigFunction(\"adminBSBButtonSuccess\", [$this, \"adminBSBButtonSuccessFunction\"], [\"is_safe\" => [\"html\"]]),\n new TwigFunction(\"adminBSBButtonWarning\", [$this, \"adminBSBButtonWarningFunction\"], [\"is_safe\" => [\"html\"]]),\n ];\n }", "public function getFunctions()\n {\n return array(\n new \\Twig_SimpleFunction('adminlist_widget', array($this, 'renderWidget'), array('needs_environment' => true, 'is_safe' => array('html'))),\n new \\Twig_SimpleFunction('my_router_params', array($this, 'routerParams')),\n new \\Twig_SimpleFunction('supported_export_extensions', array($this, 'getSupportedExtensions')),\n );\n }", "protected function foundationCommands()\n {\n return [\n JobMakeCommand::class,\n MailMakeCommand::class,\n TestMakeCommand::class,\n RuleMakeCommand::class,\n EventMakeCommand::class,\n ModelMakeCommand::class,\n PolicyMakeCommand::class,\n ConsoleMakeCommand::class,\n RequestMakeCommand::class,\n ChannelMakeCommand::class,\n ProviderMakeCommand::class,\n ListenerMakeCommand::class,\n ObserverMakeCommand::class,\n ResourceMakeCommand::class,\n ExceptionMakeCommand::class,\n NotificationMakeCommand::class,\n ];\n }", "public function loadHelpers($var = array())\n {\n $this->load->helper($var);\n }", "public static function SetHelpersNamespaces ($helperNamespaces) {\n\t\tstatic::$helpersNamespaces = [];\n\t\t$args = func_get_args();\n\t\tif (count($args) === 1 && is_array($args[0])) $args = $args[0];\n\t\tforeach ($args as $arg)\n\t\t\tstatic::$helpersNamespaces[] = '\\\\' . trim($arg, '\\\\') . '\\\\';\n\t}", "static public function depends_on()\n {\n return [\n '\\phpbb\\db\\migration\\data\\v31x\\v314',\n '\\oxcom\\phpbbch\\migrations\\add_module',\n ];\n }", "public function getViewHelperConfig()\n {\n return array(\n 'factories' => array(\n 'comments' => function ($serviceManager) {\n return new \\Swaggerdile\\View\\Helper\\Comments($serviceManager);\n },\n 'ads' => function ($serviceManager) {\n return new \\Swaggerdile\\View\\Helper\\Ads($serviceManager);\n },\n 'isAdult' => function($serviceManager) {\n return new \\Swaggerdile\\View\\Helper\\IsAdult($serviceManager);\n },\n )\n );\n }", "public function provides()\n {\n // 因為延遲載入 所以要定義 provides 函式 具體參考laravel 文件\n return ['admin'];\n }", "private function setupMigrations()\n {\n $this->loadMigrationsFrom(__DIR__ . '/../database/migrations');\n }", "function migrate_seed(){\n\n // Pull in Seed Service Provider\n // Loop in the contents of the file specified in the Service provider\n // Run Insert query.\n\n $seedFiles = require BASEPATH.\"/migration/SeedServiceProvider.php\";\n\n //Loop the files\n foreach ( $seedFiles as $file ){\n\n $seeds = require BASEPATH . \"/migration/seed/{$file}.php\";\n\n //Loop In table for insertion\n foreach( $seeds as $table_name => $data ){\n\n insert( $table_name, $data );\n\n }\n\n }\n\n}", "public function migrateAndSeed()\n {\n return $this->migrate();\n }", "public function migrate()\n {\n Artisan::call('migrate', [\n '--seed' => true\n ]);\n }", "public function addHelpers($usuario){\n $helpers = $usuario->getHelpers($_SERVER[\"PHP_SELF\"] );\n if( $helpers && count($helpers) ){\n if( !isset($this->json[\"helpers\"]) ) $this->json[\"helpers\"] = array();\n foreach($helpers as $helper ){\n $this->json[\"helpers\"][] = $helper->getOutputArray();\n }\n }\n }", "public function helper($helper){\n\n include_once (HELPER_PATH . \"{$helper}_helper.php\");\n\n }", "public function createMigrationsTable(): void;", "public function migration_maker(){\n\n $components = Component::orderBy('name','asc')->get()->pluck('name');\n\n for($i=7;$i<20;$i++){\n\n Artisan::call(\"make:model\",['name'=>' IC/'.$components[$i],'-m'=>'--migration']);\n\n }\n return 200;\n\n }", "function tb_string_swap_add_actions() {\n\n\t$new_locals = get_option('tb_string_swap');\n\n\tif ( isset( $new_locals['blog_meta'] ) && $new_locals['blog_meta'] ) {\n\t\tremove_all_actions( 'themeblvd_blog_meta' );\n\t\tadd_action( 'themeblvd_blog_meta', 'tb_string_swap_blog_meta' );\n\t}\n}", "function getActions() {\n return array(\n 'updateUpdateHistoryTable' => 'Update upgrade history storage',\n 'updateModules' => 'Update module definitions',\n 'updateProjectObjectsParentType' => 'Update parent type values',\n 'updateConfigOptions' => 'Update configuration options storage',\n 'updateSystemModuleConfigOptions' => 'Update system configuration',\n 'updateRoles' => 'Update roles',\n 'updateLanguages' => 'Update localization data',\n 'updateSearch' => 'Update search',\n 'updateCompanies' => 'Update company information',\n 'updateUsers' => 'Update user accounts',\n 'updateUserSessions' => 'Add interface support to user sessions',\n 'updateApiSubscriptions' => 'Update API subscriptions',\n 'updateAssignmentFilters' => 'Update assignment filters',\n 'prepareActivityLogs' => 'Prepare activity logs for upgrade',\n 'prepareCategoriesTable' => 'Prepare categories for upgrade',\n 'prepareModificationLog' => 'Prepare modification log for upgrade',\n 'prepareAssignments' => 'Prepare assignments for upgrade',\n 'cleanUpOrphanedSubscriptions' => \"Clean up orphaned subscriptions\",\n 'prepareSubscriptions' => 'Prepare subscriptions for upgrade',\n 'prepareLabels' => 'Prepare labels for upgrade',\n 'prepareFavorites' => 'Prepare favorites storage',\n 'updateProjectGroups' => 'Convert project groups to project categories',\n 'updateProjectLabels' => 'Update project status labels',\n 'updateProjects' => 'Update projects',\n 'updateProjectObjects' => 'Update project objects storage',\n 'updateStateAndVisibility' => 'Update state and visibility values',\n 'updateAttachments' => 'Update attachments storage',\n 'updateSubtasks' => 'Update ticket, checklist and page subtasks',\n 'updateComments' => 'Update comments storage',\n 'updateMilestones' => 'Update project milestones',\n 'updateTicketChanges' => 'Move ticket changes to modification log',\n 'updateTickets' => 'Convert tickets to tasks',\n 'updateChecklists' => 'Convert checklists to to do lists (if used)',\n 'updatePageCategories' => 'Convert pages to notebooks',\n 'updatePages' => 'Update pages',\n 'updateFiles' => 'Update project files',\n 'updateDiscussions' => 'Update project discussions',\n 'updateTracking' => 'Update time tracking module',\n 'updateTimeRecords' => 'Move time records to the new storage',\n\n // We need complete project objects table and updated type field\n\n 'updateProjectPermissionNames' => 'Update project permission names',\n 'updateFavorites' => 'Update pinned projects and starred objects',\n 'updateReminders' => 'Update reminders',\n 'backupTags' => 'Back up tag data',\n 'setUpPayments' => 'Set up payment processing system',\n 'updateInvoicing' => 'Update invoicing module',\n 'updateInvoicingPayments' => 'Register existing payments with the new payment handling system',\n 'updateDocuments' => 'Update documents',\n 'updateDocumentHashes' => 'Update document hashes',\n 'updatePublicSubmit' => 'Upgrade public submit module',\n 'updateSourceModule' => 'Upgrade source module',\n 'finalizeModuleUpgrade' => 'Finalize module upgrade',\n 'rebuildLocalizationIndex' => 'Rebuild localization index',\n 'prepareBodyBackup' => 'Prepare content backup storage',\n 'upgradeProjectSummaries' => 'Update project summaries',\n 'updateDocumentsContent' => 'Update content of global documents',\n 'updateOpenTaskDescriptions' => 'Update open task descriptions',\n 'updateCompletedTaskDescriptions' => 'Update completed task descriptions',\n 'updateOpenTaskComments' => 'Update open task comments',\n 'updateCompletedTaskComments' => 'Update completed task comments',\n 'updateDiscussionDescriptions' => 'Update discussion descriptions',\n 'updateDiscussionComments' => 'Update discussion comments',\n 'updateNotebookPagesComments' => 'Update notebook pages comments',\n 'updateFileDescriptions' => 'Update file descriptions',\n 'updateFileComments' => 'Update file comments',\n 'updateFirstLevelPageContent' => 'Update first level pages',\n 'updateFirstLevelPageVersions' => 'Update first level page versions',\n 'updateFirstLevelPageComments' => 'Update first level page comments',\n 'updateSubpagesContent' => 'Update subpages',\n 'updateSubpageVersions' => 'Update subpage versions',\n 'updateSubpageComments' => 'Update subpage comments',\n );\n }", "private function disable_helpers($names) {\n $disabledhelpers = [];\n\n foreach ($names as $name) {\n if ($this->has($name)) {\n $function = $this->get($name);\n // Null out the helper. Must call parent::add here to avoid\n // a recursion problem.\n parent::add($name, function() {\n return '';\n });\n\n $disabledhelpers[$name] = $function;\n }\n }\n\n return $disabledhelpers;\n }", "public function migrate()\n\t{ \n\t\t(new MigratorInterface)->migrate();\n\t}" ]
[ "0.6675147", "0.6417239", "0.62334156", "0.62015146", "0.615406", "0.6123301", "0.60913455", "0.6050084", "0.6033824", "0.6022729", "0.5984477", "0.5924901", "0.592165", "0.5917061", "0.587137", "0.58669186", "0.57887155", "0.5772779", "0.5767721", "0.5762758", "0.56319374", "0.56259626", "0.5601518", "0.5591951", "0.55616623", "0.5534101", "0.5533789", "0.54948723", "0.5445059", "0.5416144", "0.54114985", "0.53879535", "0.5366774", "0.53433084", "0.53289664", "0.5317203", "0.53168446", "0.5306431", "0.5300054", "0.52761817", "0.5254084", "0.52397037", "0.523261", "0.52220786", "0.5212775", "0.5200638", "0.5196951", "0.5192445", "0.51888424", "0.518394", "0.5177589", "0.51628685", "0.51579016", "0.5127434", "0.5123705", "0.51137996", "0.5103186", "0.510214", "0.5094593", "0.5090839", "0.50865936", "0.50843066", "0.50788075", "0.50747174", "0.50669664", "0.50604826", "0.50579286", "0.5046955", "0.5027361", "0.50080734", "0.4997353", "0.49903408", "0.4980514", "0.49795648", "0.49789152", "0.497794", "0.49773026", "0.49737397", "0.49497625", "0.49471366", "0.4945288", "0.49407023", "0.49331468", "0.49314302", "0.49287024", "0.49283206", "0.49280646", "0.4915628", "0.4909038", "0.4899863", "0.4899819", "0.48854616", "0.48829427", "0.48807928", "0.48679206", "0.48591176", "0.48577455", "0.48561594", "0.48533073", "0.48439202" ]
0.61401784
5
Retrieves the helper associated with the specified name. If no helper found, returns false.
public function getHelper($name) { return (array_key_exists($name, $this->helpers)) ? $this->helpers[$name] : false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getHelper($name)\r\n {\r\n if (isset($this->_helper[$name])) {\r\n return $this->_helper[$name];\r\n }\r\n return null;\r\n }", "public function has($name)\n {\n return isset($this->helpers[$name]);\n }", "public function getHelper(string $name): mixed\n {\n if (null === $this->helperSet) {\n throw new LogicException(sprintf('Cannot retrieve helper \"%s\" because there is no HelperSet defined. Did you forget to add your command to the application or to set the application on the command using the setApplication() method? You can also set the HelperSet directly using the setHelperSet() method.', $name));\n }\n\n return $this->helperSet->get($name);\n }", "public function getHelper($name)\n {\n $name = sfConfig::get('app_helpers_'.$name, $name);\n $helpers = $this->getHelperHolder();\n\n if (! $helpers->has($name))\n {\n //yaApplicationConfiguration::getActive()->loadHelpers($name, yaContext::getInstance()->getModuleName());\n\n $class = $name . 'Helper';\n if (!class_exists($class, true))\n {\n throw new sfViewException(sprintf('Could not load helper %s. Class %s not found.', $name, $class));\n }\n\n $helper = new $class();\n if (method_exists($helper, 'setHelperBroker'))\n {\n $helper->setHelperBroker($this);\n }\n\n $helpers->set($name, $helper);\n }\n\n return $helpers->get($name);\n }", "public function get($name)\n {\n if (!$this->has($name)) {\n throw new InvalidArgumentException(sprintf('The helper \"%s\" is not defined.', $name));\n }\n\n return $this->helpers[$name];\n }", "protected function getHelper($helperName, $isController = true) {\n\t\tif ($isController) {\n\t\t\treturn Application::getInstance()->getDiContainer()->getHelperForController($helperName);\n\t\t}\n\t\telse {\n\t\t\treturn Application::getInstance()->getDiContainer()->getHelper($helperName);\n\t\t}\n\t}", "public function __get($name)\n {\n return $this->getHelper($name);\n }", "private function getHelper(string $helperName) : Helper\n {\n if(!isset($this->loadedHelpers[$helperName])) {\n $helperClass = 'ntentan\\honam\\engines\\php\\helpers\\\\' . ucfirst($helperName) . \"Helper\";;\n $helperInstance = new $helperClass($this->templateRenderer);\n $this->loadedHelpers[$helperName] = $helperInstance;\n }\n return $this->loadedHelpers[$helperName];\n }", "public function & GetHelper ($helperName) {\n\t\t$setUpViewAgain = FALSE;\n\t\t$implementsIHelper = FALSE;\n\t\t$instance = NULL;\n\t\t$helpers = & $this->__protected['helpers'];\n\t\tif (isset($helpers[$helperName])) {\n\t\t\t$instance = & $helpers[$helperName];\n\t\t} else if (isset(self::$_globalHelpers[$helperName])) {\n\t\t\t$globalHelpersRecord = & self::$_globalHelpers[$helperName];\n\t\t\t$instance = & $globalHelpersRecord[0];\n\t\t\t$implementsIHelper = $globalHelpersRecord[1];\n\t\t\t$setUpViewAgain = TRUE;\n\t\t} else {\n\t\t\t$helperFound = FALSE;\n\t\t\tif (self::$_toolClass === NULL)\n\t\t\t\tself::$_toolClass = \\MvcCore\\Application::GetInstance()->GetToolClass();\n\t\t\t$toolClass = self::$_toolClass;\n\t\t\t$helpersInterface = self::HELPERS_INTERFACE_CLASS_NAME;\n\t\t\tif (!static::$helpersNamespaces) self::_initHelpersNamespaces();\n\t\t\tforeach (static::$helpersNamespaces as $helperClassBase) {\n\t\t\t\t$className = $helperClassBase . ucfirst($helperName) . 'Helper';\n\t\t\t\tif (class_exists($className)) {\n\t\t\t\t\t$helperFound = TRUE;\n\t\t\t\t\t$setUpViewAgain = TRUE;\n\t\t\t\t\tif ($toolClass::CheckClassInterface($className, $helpersInterface, TRUE, FALSE)) {\n\t\t\t\t\t\t$implementsIHelper = TRUE;\n\t\t\t\t\t\t$instance = & $className::GetInstance();\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$instance = new $className();\n\t\t\t\t\t}\n\t\t\t\t\tself::$_globalHelpers[$helperName] = [$instance, $implementsIHelper];\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!$helperFound) {\n\t\t\t\t$selfClass = version_compare(PHP_VERSION, '5.5', '>') ? self::class : __CLASS__;\n\t\t\t\tthrow new \\InvalidArgumentException(\n\t\t\t\t\t\"[\".$selfClass.\"] View helper method '$helperName' is not\"\n\t\t\t\t\t.\" possible to handle by any configured view helper (View\"\n\t\t\t\t\t.\" helper namespaces: '\".implode(\"', '\", static::$helpersNamespaces).\"').\"\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\tif ($setUpViewAgain) {\n\t\t\tif ($implementsIHelper) $instance->SetView($this);\n\t\t\t$helpers[$helperName] = & $instance;\n\t\t}\n\t\treturn $instance;\n\t}", "public function getHelper(string $name, array $config = [])\n\t{\n\t\treturn $this->helperFactory->getHelper($name, $config);\n\t}", "public function helper($name)\n {\n // Lowercase the name because it isnt a class file!\n $name = strtolower($name);\n \n // Check the application/helpers folder\n if(file_exists(APP_PATH . DS . 'helpers' . DS . $name . '.php')) \n {\n require_once(APP_PATH . DS . 'helpers' . DS . $name . '.php');\n }\n \n // Check the core/helpers folder\n if(file_exists(SYSTEM_PATH . DS . 'helpers' . DS . $name . '.php')) \n {\n require_once(SYSTEM_PATH . DS . 'helpers' . DS . $name . '.php');\n }\n }", "protected function getViewHelper($helperName)\n\t{\n \treturn $this->getServiceLocator()->get('viewhelpermanager')->get($helperName);\n\t}", "public function setHelper($name, HelperAbstract $helper)\r\n {\r\n if (!isset($this->_helper[$name])) {\r\n $this->_helper[$name] = $helper;\r\n return true;\r\n }\r\n return false;\r\n }", "public function load(string $helperName, array $helperPaths = []): bool\n {\n // Determine what directories should be checked\n $helperPaths = (empty($helperPaths) ? $this->componentPaths : [3 => $helperPaths]);\n\n // Check it is already loaded\n if (isset($this->helpers[$helperName]))\n {\n Logger::log(\"Helper '\".$helperName.\"' is already loaded. Skipping\");\n return false;\n }\n\n /** @var HelperLoadEvent $event */\n try {\n $event = Events::fireEvent('helperLoadEvent', $helperName, $helperPaths);\n\n // @codeCoverageIgnoreStart\n } catch (EventException $e) {\n throw new HelperException(\"Could not load helper. helperLoadEvent failed: '\" . $e->getMessage() . \"''\");\n // @codeCoverageIgnoreEnd\n }\n\n // If cancelled by event, abort loading helper\n if ($event->isCancelled())\n {\n Logger::log(\"Not loading helper. Aborted by event\");\n return false;\n }\n\n // Iterate over helperPaths and attempt to load if helper exists\n for ($i=Priority::getHighestPriority(); $i<=Priority::getLowestPriority(); $i++)\n {\n if (!isset($event->helperPaths[$i]))\n continue;\n\n foreach ($event->helperPaths[$i] as $helperPath)\n {\n $file = $helperPath . DS . $event->helperName . '.php';\n $subfile = $helperPath . DS . $event->helperName . DS . $event->helperName . '.php';\n if (file_exists($file))\n {\n // Load and register\n include_once($file);\n $this->helpers[$event->helperName] = true;\n Logger::log(\"Loaded helper '\".$event->helperName.\"'\");\n return true;\n }\n\n // If php file not in main directory, check subdirectories\n elseif (file_exists($subfile))\n {\n // Load and register\n include_once($subfile);\n $this->helpers[$event->helperName] = true;\n Logger::log(\"Loaded helper '\".$event->helperName.\"''\");\n return true;\n }\n }\n }\n\n throw new HelperException(\"Could not load helper. Helper not found.\", 1);\n }", "public function loadHelper($name) {\r\n\t\t\t\r\n\t\t$viewHelper = null;\r\n\t\t\r\n\t\t\r\n\t\tforeach( $this->helperPath as $path ) { \r\n\t\t \r\n\t\t\t$helperFilePath = $path . $name .'.php' ;\r\n\t\t\t\r\n\t\t\tif( !file_exists( $path . $name .'.php') ) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\t\t\t\r\n\t\r\n\t\t\tif( !include_once $helperFilePath) {\r\n\t\t\t\tthrow new FileIncludeIoException($helperFilePath) ;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$viewHelper = new $name();\r\n\t\t\tbreak;\r\n\t\t}\t\t\r\n\t\t\r\n\t\tif( $viewHelper === null ) {\r\n\t\t throw new ClassNotFoundException( $name);\r\n\t\t}\r\n\t\t\r\n\t\tself::$helpers[$name] = $viewHelper ;\t\t\r\n\t}", "public function getHelper(string $helperName): AbstractViewHelper\n {\n if (!isset($this->helpers[$helperName])) {\n // Check that helper is defined\n if (!isset($this->helperClasses[$helperName])) {\n throw new \\InvalidArgumentException(\"No helper named \\\"{$helperName}\\\"\");\n }\n\n $this->helpers[$helperName] = new $this->helperClasses[$helperName]();\n $this->helpers[$helperName]->setView($this);\n }\n\n return $this->helpers[$helperName];\n }", "public function loadHelper($name)\n {\n $name = ucfirst($name);\n $helper = $this->getHelperNamespace().$name;\n\n return new $helper();\n }", "protected static function getMethod($helper, $name)\n {\n $method = new \\ReflectionMethod($helper, $name);\n $method->setAccessible(true);\n return $method;\n }", "public function getHelper( $handle, $pkg = false ){\n $helper = '_helper_' . preg_replace(\"/[^a-zA-Z0-9]+/\", \"\", $handle);\n if( $this->{$helper} === null ){\n $this->{$helper} = Loader::helper($handle, $pkg);\n }\n return $this->{$helper};\n }", "public function getHelper($method)\n {\n $helper = null;\n if (true === $this->helpers->has($method)) {\n $helper = $this->helpers->get($method);\n }\n\n return $helper;\n }", "public function helper ($name)\n\t{\n\t\t$file = $this->_create_folders_from_name($name, 'helpers');\n\t\t\n\t\t$data = $this->_php_open();\n\t\tstrpos($file['file'], '_helper') || $file['file'] .= '_helper';\n\t\t$path = APPPATH . 'helpers/' . $file['path'] . strtolower($file['file']) . '.php';\n\t\twrite_file($path, $data);\n\t\t$this->msg[] = 'Created helper file at ' . $path;\n\t\t//echo $this->_messages();\n\t\treturn $this->result(true, $this->msg[0]);\n\t}", "public function get($name = \"\")\r\n\t{\r\n\t\tif (empty($name))\r\n\t\t{\r\n\t\t\treturn $this -> gets;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tif (isset($this -> gets[$name]))\r\n\t\t\t{\r\n\t\t\t\treturn $this -> gets[$name];\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public function helper($helperName){\r\n if(file_exists(\"../system/helpers/\" . $helperName . \".php\")){\r\n require_once \"../system/helpers/\" . $helperName . \".php\";\r\n }else{\r\n echo \"<div style='margin:0; padding:10px;background-color:silver;'>Désolé le fichier $helperName.php n'a pas été trouvé</div>\";\r\n } \r\n\r\n }", "public static function getHelper($helperName)\n {\n $helperName = ucfirst($helperName);\n if (class_exists('TH\\\\DG\\\\Helpers\\\\'.$helperName)) {\n $className = 'TH\\\\DG\\\\Helpers\\\\' . $helperName;\n $object = new $className();\n return $object;\n } else {\n throw new Exception('Class \"TH\\\\DG\\\\Helpers\\\\'.$helperName.'\" does not exist.');\n }\n }", "public function getShowHelpers()\n {\n if ($this->hideHelpers) {\n return false;\n }\n\n $helpers = $this->getHelpers();\n if ($helpers->count()) {\n return true;\n } else {\n return false;\n }\n }", "function addHelper() {\r\n $args = func_get_args();\r\n if(!is_array($args)) {\r\n return false;\r\n } // if\r\n \r\n foreach($args as $helper_name) {\r\n if(trim($helper_name) == '') {\r\n continue;\r\n } // if\r\n \r\n if(!in_array($helper_name, $this->helpers) && $this->engine->useHelper($helper_name)) {\r\n $this->helpers[] = $helper_name;\r\n } // if\r\n } // foreach\r\n \r\n return true;\r\n }", "public function get($name)\n\t{\n\t\tif (isset($this->{$name})) {\n\n\t\t\tif (method_exists($this,'get' . Helpers::camelcase($name))) {\n\t\t\t\treturn $this->{'get' . Helpers::camelcase($name)}();\n\t\t\t} else {\n\t\t\t\treturn $this->{$name};\n\t\t\t}\n\n\t\t}\n\n\t\treturn false;\n\t}", "public function __find($name){\n\n\t\t\tif(is_file(EMAILGATEWAYS . \"/email.$name.php\")) return EMAILGATEWAYS;\n\t\t\telse{\n\n\t\t\t\t$extensions = Symphony::ExtensionManager()->listInstalledHandles();\n\n\t\t\t\tif(is_array($extensions) && !empty($extensions)){\n\t\t\t\t\tforeach($extensions as $e){\n\t\t\t\t\t\tif(is_file(EXTENSIONS . \"/$e/email-gateways/email.$name.php\")) return EXTENSIONS . \"/$e/email-gateways\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}", "public function helper($helper = array())\n {\n if (is_array($helper)) {\n return $this->helpers($helper);\n }\n\n if (isset($this->_ci_helpers[$helper])) {\n return;\n }\n\n list($path, $_helper) = Modules::find(\"{$helper}_helper\", $this->_module, 'helpers/');\n\n if ($path === false) {\n // If the helper was not found in a module, check the traditional locations.\n parent::helper($helper);\n return $this;\n }\n\n Modules::load_file($_helper, $path);\n $this->_ci_helpers[$_helper] = true;\n return $this;\n }", "private function detect_helper() {\n\t\t$result = $this->wpdb->get_var( \"SELECT COUNT(*) AS `count` FROM {$this->wpdb->postmeta} WHERE meta_key LIKE '_aioseop_%'\" );\n\t\tif ( $result === '0' ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}", "final public static function getHelper($helper){\n $fileClass = self::getConfig()->path->path_modules.'/'.self::getPathModule().'/helper/'.ucfirst($helper).self::getConfig()->path->ext_file;\n if(file_exists($fileClass)){\n\n $helper = str_replace('/', '\\\\', self::getPathModule().'/helper/'.ucfirst($helper));\n $obj = new $helper();\n return $obj;\n\n }\n\n }", "public function get($name)\n {\n if (array_key_exists($name, $this->cache)) {\n return $this->cache[$name];\n }\n return false;\n }", "public function getDesignModule($name)\n {\n foreach ($this->getDesignModules() as $module) {\n if ($module->getName() == $name) {\n return $module;\n }\n }\n\n return false;\n }", "public function getCommand(string $name)\n {\n $commands = $this->getCommands();\n\n foreach ($commands as $group => $commandsGroup) {\n if (isset($commandsGroup[$name])) {\n return true;\n }\n }\n\n return false;\n }", "public function getHelperName()\n {\n return 'captcha/dumb';\n }", "public function getTest($name)\n {\n if (!$this->extensionInitialized) {\n $this->initExtensions();\n }\n if (isset($this->tests[$name])) {\n return $this->tests[$name];\n }\n return false;\n }", "public function item($name)\n {\n return isset($this->data[$name]) ? $this->data[$name] : false;\n }", "public function getHelperClassName($helperName)\n {\n if (strpos($helperName, '/') === false) {\n $helperName .= '/data';\n }\n return $this->getGroupedClassName('helper', $helperName);\n }", "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 }", "public static function find(String $name) {\n\t\treturn false;\n\t}", "public function getByControllerName($name)\n {\n $result = $this->_module->get(array('modulo'=>$name));\n\n if(!$result)\n return false;\n return $result[0];\n }", "public function get_attr_by_name( $name ) {\n\t\tforeach ( $this->component as $item ) {\n\t\t\tif ( ( $item['name'] == $name ) ) {\n\t\t\t\treturn $item;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "public function testGetHelper($helper, $helpers = [], $exception = false)\n {\n if ($exception) {\n $this->setExpectedException('\\MvcLite\\Exception');\n }\n\n $loader = $this->getMockBuilder(('\\Composer\\Loader\\Autoloader'))\n ->disableOriginalConstructor()\n ->setMethods(['loadClass'])\n ->getMock();\n\n $loader->expects($this->any())\n ->method('loadClass')\n ->will($this->returnValueMap([\n ['\\App\\View\\Helper\\\\' . ucfirst($helper), false],\n ['\\MvcLite\\View\\Helper\\\\' . ucfirst($helper), $exception ? false : true],\n ]));\n\n $sut = \\MvcLite\\View::getInstance();\n $this->getReflectedProperty('\\MvcLite\\View', 'helpers')->setValue($sut, $helpers);\n $sut->setLoader($loader);\n $result = $sut->getHelper($helper);\n $this->assertInstanceOf('\\MvcLite\\View\\HelperAbstract', $result);\n }", "public function getHelperClassName($helperName)\n {\n if (strpos($helperName, '/') === false) {\n $helperName .= '/data';\n }\n\n return $this->getGroupedClassName('helper', $helperName);\n }", "public function lookup($name) {\n return $this->_handler->lookup($name);\n }", "public function getHelper () {\n\t\tif (!$this->initialized)\n\t\t\t$this->init();\n\t\t\n\t\tif (is_null($this->authHelper))\n\t\t\tthrow new Exception(\"No authentication helper is available. Maybe one wasn't configured.\", 450);\n\t\t\n\t\treturn $this->authHelper;\n\t}", "public function __get(string $name)\n {\n if (isset($this->settings[$name])) {\n return $this->settings[$name];\n }\n if (in_array($name, $this->current)) {\n return true;\n }\n return false;\n }", "public function provideGetHelper()\n {\n return [\n 'Csv helper' => [\n 'helper' => 'csv',\n ],\n\n 'Exception helper' => [\n 'helper' => 'exception',\n ],\n\n 'InputCheckbox helper' => [\n 'helper' => 'InputCheckbox',\n ],\n\n 'InputPassword helper' => [\n 'helper' => 'InputPassword',\n ],\n\n 'InputPassword helper' => [\n 'helper' => 'InputPassword',\n ],\n\n 'InputSelect helper' => [\n 'helper' => 'InputSelect',\n ],\n\n 'InputSubmit helper' => [\n 'helper' => 'InputSubmit',\n ],\n\n 'InputTextarea helper' => [\n 'helper' => 'InputTextarea',\n ],\n\n 'InputText helper' => [\n 'helper' => 'InputText',\n ],\n\n 'InputText helper, but already has it' => [\n 'Helper' => 'InputText',\n 'helpers' => [\n 'InputText' => new \\MvcLite\\View\\Helper\\InputText,\n ],\n ],\n\n 'Bad Helper, expect exception' => [\n 'helper' => 'does not exist',\n 'helpers' => [],\n 'exception' => true,\n ]\n\n ];\n }", "protected function _getHelperNameWithAlias($name)\n {\n if (strpos($name, '/') === false) {\n $name .= '/data';\n }\n $helperNames = array($name);\n if (strpos($name, '/data') + 5 == strlen($name)) {\n $helperNames[] = substr($name, 0, strpos($name, '/data'));\n }\n return $helperNames;\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 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}", "public static function loadHelper($file_name, $createObj=FALSE)\n\t{\n return self::load('SHIN_'.$file_name.'_helper', BASEPATH .\"helpers\".DIRECTORY_SEPARATOR, $createObj);\n }", "protected static function getProperty($helper, $name)\n {\n $property = new \\ReflectionProperty($helper, $name);\n $property->setAccessible(true);\n return $property;\n }", "public static function loadHelper($helper)\n {\n $callback = callback(__CLASS__, $helper);\n return ($callback->isCallable()) ? $callback : NULL;\n }", "public function getMasqueradeHelper () {\n\t\t$config = Zend_Registry::getInstance()->config;\n\t\tif (!empty($config->masquerade->enabled) && !empty($config->masquerade->type)) {\n\t\t\treturn $this->getAuthHelperInstance($config->masquerade->type);\n\t\t}\n\t\tthrow new Exception(\"No masquerade auth helper enabled.\");\n\t}", "public function has($name)\n {\n return isset($this->routes[$name]);\n }", "public function find($name) {\r\n if (isset($this->views[$name])) {\r\n return $this->views[$name];\r\n }\r\n\r\n if ($this->hasHintInformation($name = trim($name))) {\r\n return $this->views[$name] = $this->findNamespacedView($name);\r\n }\r\n\r\n return $this->views[$name] = $this->findInPaths($name, $this->paths);\r\n }", "private function helpers()\n {\n $relative_location = $this->args['application_folder'] . DIRECTORY_SEPARATOR . 'helpers' . DIRECTORY_SEPARATOR;\n $helper_directory = $this->args['location'] . DIRECTORY_SEPARATOR . 'helpers' . DIRECTORY_SEPARATOR;\n if (!empty($this->args['subdirectories']))\n {\n $relative_location .= $this->args['subdirectories'];\n $helper_directory .= $this->args['subdirectories'] . DIRECTORY_SEPARATOR;\n }\n $relative_helper_location = $relative_location . DIRECTORY_SEPARATOR . strtolower($this->args['name']) . '_helper.php';\n $helper_file = $helper_directory . strtolower($this->args['name']) . '_helper.php';\n\n if (!is_dir($helper_directory))\n {\n $message = \"\\t\";\n if (mkdir($helper_directory, 0755, TRUE))\n {\n $message .= 'Created folder: ';\n if (php_uname(\"s\") !== \"Windows NT\")\n {\n $message = ApplicationHelpers::colorize($message, 'green') . $relative_location;\n }\n else\n {\n $message .= $relative_location;\n }\n fwrite(STDOUT, $message . PHP_EOL);\n unset($message);\n }\n else\n {\n $message .= 'Unable to create folder: ';\n if (php_uname(\"s\") !== \"Windows NT\")\n {\n $message = ApplicationHelpers::colorize($message, 'red') . $relative_location;\n }\n else\n {\n $message .= $relative_location;\n }\n fwrite(STDOUT, $message . PHP_EOL);\n return false;\n }\n }\n\n if (file_exists($helper_file))\n {\n $message = \"\\tHelper already exists: \";\n if (php_uname(\"s\") !== \"Windows NT\")\n {\n $message = ApplicationHelpers::colorize($message, 'light_blue') . $relative_helper_location;\n }\n else\n {\n $message .= $relative_helper_location;\n }\n fwrite(STDOUT, $message . PHP_EOL);\n unset($message);\n return true;\n }\n else\n {\n $content = \"<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');\" . PHP_EOL;\n $content .= PHP_EOL . PHP_EOL . PHP_EOL;\n $content .= '/* End of file ' . strtolower($this->args['name']) . '_helper.php */' . PHP_EOL;\n $content .= '/* Location: ./' . $relative_location . ' */';\n\n $message = \"\\t\";\n if (file_put_contents($helper_file, $content))\n {\n $message .= 'Created helper: ';\n if (php_uname(\"s\") !== \"Windows NT\")\n {\n $message = ApplicationHelpers::colorize($message, 'green') . $relative_helper_location;\n }\n else\n {\n $message .= $relative_helper_location;\n }\n }\n else\n {\n $message .= 'Unable to create helper: ';\n if (php_uname(\"s\") !== \"Windows NT\")\n {\n $message = ApplicationHelpers::colorize($message, 'red') . $relative_helper_location;\n }\n else\n {\n $message .= $relative_helper_location;\n }\n }\n\n fwrite(STDOUT, $message . PHP_EOL);\n unset($message);\n }\n\n return true;\n }", "abstract public function templateExists($name);", "public function getUserHelper()\r\n {\r\n return $this->userHelper;\r\n }", "function helper_name($name, $spec, $op1, $op2) {\n\tglobal $prefix, $helpers;\n\n\tif (isset($helpers[$name])) {\n\t\t// If we haven't helper with specified spicialized operands then\n\t\t// using unspecialized helper\n\t\tif (!isset($helpers[$name][\"op1\"][$op1]) &&\n\t\t isset($helpers[$name][\"op1\"][\"ANY\"])) {\n\t\t\t$op1 = \"ANY\";\n\t\t}\n\t\tif (!isset($helpers[$name][\"op2\"][$op2]) &&\n\t\t isset($helpers[$name][\"op2\"][\"ANY\"])) {\n\t\t\t$op2 = \"ANY\";\n\t\t}\n\t}\n\treturn $name.($spec?\"_SPEC\":\"\").$prefix[$op1].$prefix[$op2];\n}", "private static function register_helper_functions($helper_name, &$smarty) {\n\t\t\t$helper_class = new ReflectionClass($helper_name);\n\t\t\t$filters = self::find_helper_filters($helper_class);\n\t\t\tforeach($helper_class->getMethods() as $method) {\n\t\t\t\tif(in_array($method->name, $filters)) {\n\t\t\t\t\t$smarty->register_modifier($method->name, array($helper_name, $method->name)); continue; // register filters as such\n\t\t\t\t}\n\t\t\t\t$smarty->register_function($method->name, array($helper_name, $method->name));\n\t\t\t}\n\t\t}", "public function has($name)\n {\n return isset($this->adapters[$name]);\n }", "public function getHelper()\n {\n if ( !($this->helper instanceof DBHelper) ) {\n global $ts_config;\n \n switch ( $ts_config['dbconfig']['db_type'] ) {\n case \"mysql\":\n $my_db_helper = 'MysqlHelper';\n if ( (!isset($ts_config['mysqli_disabled']) \n || $ts_config['mysqli_disabled'] == false)\n && function_exists('mysqli_connect') )\n $my_db_helper = 'MysqliHelper';\n break;\n case \"mssql\":\n if (is_freetds() \n && (empty($config['db_mssql_force_driver']) || $config['db_mssql_force_driver'] == 'freetds' ))\n $my_db_helper = 'FreeTDSHelper';\n elseif (function_exists('mssql_connect')\n && (empty($config['db_mssql_force_driver']) || $config['db_mssql_force_driver'] == 'mssql' ))\n $my_db_helper = 'MssqlHelper';\n else\n $my_db_helper = 'SqlsrvHelper';\n break;\n default:\n $my_db_helper = 'MysqlHelper';\n }\n \n require_once(\"include/db/{$my_db_helper}.php\");\n $this->helper = new $my_db_helper();\n }\n \n return $this->helper;\n }", "public static function find($name);", "public static function find($name);", "public function __get($name)\n {\n if (isset($this->{\"_$name\"})) {\n $requested = $this->getReflectedProperty(\"_$name\", $this);\n } else {\n if (isset($this->{\"$name\"})) {\n $requested = $this->getReflectedProperty(\"$name\", $this);\n } else {\n return false;\n }\n\n }\n return $requested;\n }", "public function toolbox($helper)\n\t{\n\t\treturn $this->toolbox[\"$helper\"];\n\t}", "private function getHelper()\n {\n if ($this->helper === null) {\n $this->helper = new ComposerConfig($this->context);\n }\n \n return $this->helper;\n }", "public function hasShortcut(string $name): bool\n {\n return isset($this->shortcuts[$name]);\n }", "public function currentRouteNamed($name)\n {\n return $this->current() ? $this->current()->getName() == $name : false;\n }", "protected function _getHelper()\n {\n return $this->_wishlistHelper;\n }", "public function get_field( $name ) {\n\t\t$name_ = strtolower( $name );\n\t\tif ( isset( $this->data[$name_] ) ) {\n\t\t\treturn $this->clear_html( $this->data[$name_] );\n\t\t}\n\n\t\t$clear_name = MM_Component_Page::clear_name( $name );\n\t\tif ( isset( $this->data[$clear_name] ) ) {\n\t\t\treturn $this->clear_html( $this->data[$clear_name] );\n\t\t}\n\n\t\treturn false;\n\t}", "public function get($name=false)\n {\n \n if (is_object($name) && method_exists($name, '__toString')) {\n $name = $name->__toString();\n }\n \n if ($name === false || $name === null) {\n return $this->current();\n }\n \n \n return array_key_exists($name, $this->_data) ?\n $this->_data[$name] : null;\n }", "public function has($name)\n {\n return isset($this->suggesters[$name]);\n }", "public function get($name)\n {\n if(!$this->has($name)) {\n return null;\n }\n return $this->routes[$name];\n }", "public function get($name = null)\n {\n return array_key_exists($name, $this->vars) ? $this->vars[$name] : false;\n }", "public function getHelperName()\n {\n return 'znZendFormCaptchaQuestion';\n }", "public function hasGet($name)\n {\n return isset($this->get[$name]) ? $this->get[$name] : false;\n }", "function getAndLoadPlugin($type,$name) {\n\t\t$funcName = 'smarty_'.strtolower($type).'_'.$name;\n\t\tif(!function_exists($funcName)) {\n\t\t\t$plugin = $this->_get_plugin_filepath($type, $name);\n\t\t\tif(!@is_readable($plugin)) {\n\t\t\t\t$this->trigger_error('Smarty plugin \"'.$name.'\" unavailable');\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tinclude_once($plugin);\n\t\t}\n\t\treturn $funcName;\n\t}", "protected function get($name)\n\t{\n\t\treturn isset($this->disks[$name]) ? $this->disks[$name] : $this->resolve($name);\n\t}", "function getDriver($name = null);", "protected function &_helper() {\n\t\t$helper = $this->context(true)->helper($this->_helper);\n\t\treturn $helper;\n\t}", "function getPlugin($name);", "public function __get($name) {\r\n\t\tif (method_exists($this, \"get_\" . $name)) {\r\n\t\t\t$methodName = \"get_\" . $name;\r\n\t\t\t$res = $this->$methodName();\r\n\t\t\treturn $res;\r\n\t\t} else if (property_exists($this, $name)) {\r\n\t\t\treturn $this->$name;\r\n\t\t} else {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "public function canRender($name)\n {\n return $this->resolver->resolve($name, $this);\n }", "public function getTemplateHelper(){\n if( $this->_flexryTemplateHelper === null ){\n $templateHandle = $this->currentTemplateHandle();\n if( empty($templateHandle) ){\n $this->_flexryTemplateHelper = FlexryBlockTemplateOptions::setup(self::TEMPLATE_DEFAULT_HANDLE, self::templateDefaultPath(), $this->parsedTemplateData() );\n }else{\n $templatesList = $this->templateAndDirectoryList();\n $this->_flexryTemplateHelper = FlexryBlockTemplateOptions::setup($templateHandle, $templatesList[$templateHandle], $this->parsedTemplateData() );\n }\n }\n return $this->_flexryTemplateHelper;\n }", "protected function get($name)\n {\n return isset($this->disks[$name]) ? $this->disks[$name] : $this->resolve($name);\n }", "public function canRender($name)\n {\n return $name;\n }", "protected function get($name)\n {\n return isset($this->drivers[$name]) ? $this->drivers[$name] : $this->resolve($name);\n }", "protected function get($name)\n {\n return $this->drivers[$name] ?? $this->resolve($name);\n }", "public function element($name, $params = array(), $loadHelpers = false) {\n\t\t$return = parent::element($name, $params, $loadHelpers);\n\t\tif (strpos($return, 'Not Found:') === 0) {\n\t\t\t$plugin = null;\n\t\t\tif (isset($params['plugin'])) {\n\t\t\t\t$plugin = $params['plugin'];\n\t\t\t}\n\n\t\t\tif (isset($this->plugin) && !$plugin) {\n\t\t\t\t$plugin = $this->plugin;\n\t\t\t}\n\n\t\t\t$paths = $this->_paths($plugin);\n\t\t\t$path = array_pop($paths);\n\t\t\twhile ($paths && strpos($path, DS . 'locale' . DS)) {\n\t\t\t\t$path = array_pop($paths);\n\t\t\t}\n\t\t\t$file = $path . 'elements' . DS . $name . $this->ext;\n\t\t\t$trace = Debugger::trace();\n\t\t\treturn \"Not Found: \" . $file . $trace;\n\t\t}\n\t\treturn $return;\n\t}", "protected function helper($helper)\r\n {\r\n if (file_exists(ROOT_DIR . '/app/include/' . $helper . '.php'))\r\n {\r\n require_once ROOT_DIR . '/app/include/' . $helper . '.php';\r\n return new $helper;\r\n }\r\n return NULL;\r\n }", "public function getHelper()\n {\n }", "public function __get($name)\n {\n if (isset($this->layout->getView()->{$name})) {\n return $this->layout->getView()->{$name};\n }\n\n return null;\n }", "function isRegistered($name)\n {\n return isset($this->directives[$name]);\n }", "protected function get(string $name)\n {\n return $this->drivers[$name] ?? $this->resolve($name);\n }", "public function __get($name) {\n\t\t$data = $this->_cache->load($this->_namespace);\n\t\tif(isset($data[$name])) {\n\t\t\treturn $data[$name];\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public static function find_view($name)\n\t{\n\t\t$dir = path_dir(self::var('gonzo.view_dir'));\n\n\t\t$path = '';\n\t\t$view = '';\n\n\t\t$names = explode(',', $name);\n\n\t\tfor ($i = 0; $i < count($names); $i++)\n\t\t{\n\t\t\t$names[$i] = self::filtered('gonzo.view_name', $names[$i]);\n\n\t\t\t$dirname = path_dir($names[$i], true);\n\t\t\t$ext = path_ext($names[$i]);\n\t\t\t$basename = '_'.path_base($names[$i]);\n\n\t\t\t$plugin_path = self::find_plugin($dirname.$basename, false);\n\n\t\t\tif (file_exists($plugin_path))\n\t\t\t{\n\t\t\t\treturn $plugin_path;\n\t\t\t}\n\n\t\t\t$path = self::find_file($dir.$dirname.$basename);\n\n\t\t\tif (file_exists($path))\n\t\t\t{\n\t\t\t\treturn $path;\n\t\t\t}\n\t\t}\n\n\t\treturn $view;\n\t}", "public function exists()\n {\n try {\n ($this->engine->getResolveTemplatePath())($this->name);\n return true;\n } catch (TemplateNotFound $e) {\n return false;\n }\n }" ]
[ "0.7726096", "0.71455956", "0.6993883", "0.68904454", "0.6689411", "0.65721655", "0.65159667", "0.6507631", "0.64900804", "0.6356164", "0.61649364", "0.6023918", "0.58729756", "0.5868988", "0.5830039", "0.57814246", "0.5742152", "0.5721857", "0.5658632", "0.56465995", "0.5586289", "0.55728686", "0.5552235", "0.55437255", "0.5519934", "0.54692256", "0.53656256", "0.53599375", "0.5349064", "0.53203887", "0.53106916", "0.53003633", "0.52974725", "0.52746725", "0.5272807", "0.5251277", "0.52415824", "0.52251834", "0.52117443", "0.52034533", "0.5188644", "0.51868206", "0.51820046", "0.517524", "0.5159511", "0.5152709", "0.51397634", "0.51350296", "0.51228666", "0.5115144", "0.51096606", "0.5105961", "0.5094727", "0.50909346", "0.5088545", "0.5088064", "0.50704056", "0.5068375", "0.5067825", "0.50530165", "0.5030786", "0.50217265", "0.5021489", "0.5018622", "0.50139093", "0.50139093", "0.5012285", "0.49907875", "0.49888667", "0.49849433", "0.49758086", "0.49624735", "0.4959757", "0.49535936", "0.49424455", "0.49422255", "0.49311617", "0.4919407", "0.4903589", "0.48981056", "0.48940694", "0.4892293", "0.48884755", "0.48818007", "0.48769706", "0.48764455", "0.48619103", "0.4861812", "0.48600176", "0.4858439", "0.4857019", "0.4851226", "0.48506582", "0.4849318", "0.48425665", "0.48326018", "0.48261666", "0.48185703", "0.48138714", "0.48083213" ]
0.84385365
0
Returns true only and only if the target is less or equal than the greatest migration executed so far.
public function isDownwards($target) { return null !== $target && $this->getFilter()->compare($target, $this->getGreatestMigration()) <= 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function reachedMaxMoves(){\r\n if($this->totalMoves == $this->board->getMaxMoves()){\r\n return true;\r\n }\r\n return false;\r\n }", "public function version($target_version)\n\t{ \n\t\t$start = $current_version = $target_version-1;\n\t\t$stop = $target_version;\n \n\t\tif ($target_version > $current_version)\n\t\t{\n\t\t\t// Moving Up\n\t\t\t++$start;\n\t\t\t++$stop;\n\t\t\t$step = 1;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Moving Down\n\t\t\t$step = -1;\n\t\t}\n \n\t\t$method = ($step === 1) ? 'up' : 'down';\n\t\t$migrations = array();\n \n\t\t// We now prepare to actually DO the migrations\n\t\t// But first let's make sure that everything is the way it should be\n\t\tfor ($i = $start; $i != $stop; $i += $step)\n\t\t{ \n\t\t\t$f = glob(sprintf($this->_migration_path . '%03d_*.php', $i));\n\t\t\t// Only one migration per step is permitted\n\t\t\tif (count($f) > 1)\n\t\t\t{\n\t\t\t\t$this->_error_string = sprintf($this->lang->line('migration_multiple_version'), $i);\n\t\t\t\treturn FALSE;\n\t\t\t}\n\n\t\t\tif ( isset( $f[0] ) ) { \n\t\t\t\t$name = basename($f[0], '.php');\n\t\t\t} else {\n\t\t\t\treturn FALSE;\n\t\t\t}\n\n \n\t\t\t// Filename validations\n\t\t\tif (preg_match('/^\\d{3}_(\\w+)$/', $name, $match))\n\t\t\t{\n\t\t\t\t$match[1] = strtolower($match[1]);\n\n\t\t\t\t// Cannot repeat a migration at different steps\n\t\t\t\tif (in_array($match[1], $migrations))\n\t\t\t\t{\n\t\t\t\t\t$this->_error_string = sprintf($this->lang->line('migration_multiple_version'), $match[1]);\n\t\t\t\t\treturn FALSE;\n\t\t\t\t}\n\n\t\t\t\tinclude $f[0];\n\t\t\t\t$class = 'Migration_' . ucfirst($match[1]);\n\n\t\t\t\tif ( ! class_exists($class))\n\t\t\t\t{\n\t\t\t\t\t$this->_error_string = sprintf($this->lang->line('migration_class_doesnt_exist'), $class);\n\t\t\t\t\treturn FALSE;\n\t\t\t\t}\n\n\t\t\t\tif ( ! is_callable(array($class, $method)))\n\t\t\t\t{\n\t\t\t\t\t$this->_error_string = sprintf($this->lang->line('migration_missing_'.$method.'_method'), $class);\n\t\t\t\t\treturn FALSE;\n\t\t\t\t}\n\n\t\t\t\t$migrations[] = $match[1];\n\t\t\t}\n\t\t}\n\n\t\tlog_message('debug', 'Migration atual: ' . $current_version);\n\n\t\t$version = $i + ($step == 1 ? -1 : 0);\n\n\t\t// If there is nothing to do so quit\n\t\tif ($migrations === array())\n\t\t{\n\t\t\treturn TRUE;\n\t\t}\n\n\t\tlog_message('debug', 'Migrating from ' . $method . ' to version ' . $version);\n \n\t\t// Loop through the migrations\n\t\n\t\t\t// Run the migration class\n\t\t\t$class = 'Migration_' . ucfirst(strtolower(end($migrations)));\n\t\t\tcall_user_func(array(new $class, $method));\n\n\t\t\t$current_version += $step;\n\t\t\t$this->_update_version($current_version);\n\t\t\n\n\t\tlog_message('debug', 'Finished migrating to '.$current_version);\n \n\t\treturn end($migrations);\n\t}", "private function shouldExecuteMigration($direction, Version $version, $to, $migrated)\n {\n if ('down' === $direction) {\n if (!in_array($version->getVersion(), $migrated)) {\n return false;\n }\n\n return $version->getVersion() > $to;\n }\n\n if ('up' === $direction) {\n if (in_array($version->getVersion(), $migrated)) {\n return false;\n }\n\n return $version->getVersion() <= $to;\n }\n }", "public function has_goal() {\r\n\t\treturn 0 < $this->get( 'goal' );\r\n\t}", "public function hasAnotherStep()\n {\n return $this->instance->current_step < (count($this->steps) - 1);\n }", "public function isGreaterThanOrEqualTo(self $that): bool;", "public function migrate($target=null)\n\t{\t\n\t\t$migrations = $this->getAvailableMigrations($target);\n\t\tif (null === $target) {\n\t\t\tend($migrations);\n\t\t\t$target = key($migrations);\n\t\t}\n\t\t\n\t\tif (!$this->isDownwards($target)) {\n\t\t\treturn $this->doMigration($migrations, AdapterInterface::UP);\n\t\t} else {\n\t\t\treturn $this->doMigration($migrations, AdapterInterface::DOWN);\n\t\t}\n\t}", "public function isGreaterThan(self $that): bool;", "public function hasTargetNumber() {\n return $this->_has(6);\n }", "public function shouldRunMigration()\n {\n return $this->canRunMigration()\n && !Mage::getStoreConfigFlag(self::MIGRATION_COMPLETE)\n && !Mage::getStoreConfig('payment/gene_braintree/merchant_id')\n && !Mage::getStoreConfig('payment/gene_braintree/sandbox_merchant_id');\n }", "public function latest()\n\t{\n\t\tif ( ! $migrations = $this->find_migrations())\n\t\t{\n\t\t\t$this->_error_string = $this->lang->line('migration_none_found');\n\t\t\treturn false;\n\t\t}\n\n\t\t$last_migration = basename(end($migrations));\n\n\t\t// Calculate the last migration step from existing migration\n\t\t// filenames and procceed to the standard version migration\n\t\treturn $this->version((int) substr($last_migration, 0, 3));\n\t}", "protected function isTargetCorrect() {}", "public function hasMoreSteps()\n {\n return $this->instance->isActionable() ? \n $this->instance->current_step <= count($this->steps) :\n false;\n }", "public function reached()\r\n {\r\n $max = (int) $this->config->get('image_optimizer::settings.tiny_png.max_optimizations_per_month');\r\n\r\n if (empty($max)) {\r\n return false;\r\n }\r\n\r\n if ((bool) $this->config->get('image_optimizer::settings.tiny_png.enabled')\r\n && $this->config->get('image_optimizer::settings.tiny_png.api_key')\r\n ) {\r\n $tinyPngCount = $this->getTinyPngNumberOfCompressions();\r\n\r\n return $tinyPngCount >= $max;\r\n }\r\n\r\n return false;\r\n }", "public function getGreatestMigration()\n\t{\n\t\treturn (string) end(array_keys($this->getExecutedMigrations()));\n\t}", "public function isMigratingUp();", "public function migrationsNeeded() {\n\t\treturn $this->tableManager->migrationsNeeded() || $this->fieldManager->migrationsNeeded() || $this->accessManager->migrationsNeeded();\n\t}", "public function has_achieved_goal() {\r\n\t\treturn $this->get_donated_amount() >= $this->get_goal();\r\n\t}", "public function solved() {\r\n\t\treturn $this->current == $this->expected;\r\n\t}", "public function test_get_runnable_migrations_going_up_with_target_version_no_current()\n {\n $migrator_util = new Ruckusing_Util_Migrator($this->adapter);\n $actual_up_files = $migrator_util->get_runnable_migrations($this->migrations_dirs, 'up', 3, false);\n $expect_up_files = array(\n array(\n 'version' => 1,\n 'class' => 'CreateUsers',\n 'file' => '001_CreateUsers.php',\n 'module' => 'default'\n ),\n array(\n 'version' => 3,\n 'class' => 'AddIndexToBlogs',\n 'file' => '003_AddIndexToBlogs.php',\n 'module' => 'default'\n )\n );\n $this->assertEquals($expect_up_files, $actual_up_files);\n }", "public function test_get_runnable_migrations_going_up_with_target_version_with_current()\n {\n $migrator_util = new Ruckusing_Util_Migrator($this->adapter);\n //pretend we already executed version 1\n $this->insert_dummy_version_data(array(1));\n $actual_up_files = $migrator_util->get_runnable_migrations($this->migrations_dirs, 'up', 3, false);\n $expect_up_files = array(\n array(\n 'version' => 3,\n 'class' => 'AddIndexToBlogs',\n 'file' => '003_AddIndexToBlogs.php',\n 'module' => 'default'\n )\n );\n $this->assertEquals($expect_up_files, $actual_up_files);\n $this->clear_dummy_data();\n\n //now pre-register some migrations that we have already executed\n $this->insert_dummy_version_data(array(1, 3));\n $actual_up_files = $migrator_util->get_runnable_migrations($this->migrations_dirs, 'up', 3, false);\n $this->assertEquals(array(), $actual_up_files);\n }", "protected function computerTurn(){ \r\n\t\t$getMinMaxResult = new MinMax($this); \r\n\t\tif ($getMinMaxResult->move) {\r\n\t\t\treturn $this->_move = $getMinMaxResult->move;\r\n\t\t}\r\n\t\treturn false; \r\n\t}", "public function canUpOrder()\n {\n $orderAble = $this->getOrderAble();\n\n $node = $orderAble->getOrderQuery()\n ->andWhere([\n '<', $orderAble->getOrderFieldName(), $orderAble->getOrderValue()\n ])\n ->one();\n\n if ($node) return true;\n return false;\n }", "function _checkMaxLimt()\r\n {\r\n if ($this->data[$this->name]['max_limit'] >= $this->data[$this->name]['min_limit']) {\r\n return true;\r\n }\r\n return false;\r\n }", "public function checkSize()\r\n\t{\r\n\t\treturn ((abs(@filesize($this->targetFile) - @filesize($this->referenceFile))) < $this->sizeTol);\r\n\t}", "public function doDatabaseUpdate()\n\t{\n\t\ttry\n\t\t{\n\t\t\tif ($this->_backupDb)\n\t\t\t{\n\t\t\t\t$dbBackup = new DbBackup();\n\t\t\t\t$this->_dbBackupPath = $dbBackup->run();\n\t\t\t}\n\n\t\t\tif (blx()->migrations->runToTop())\n\t\t\t{\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\tcatch(\\Exception $e)\n\t\t{\n\t\t\t// We had migrations to run and something went wrong. Let's try to restore the backup database.\n\t\t\tif ($this->_backupDb)\n\t\t\t{\n\t\t\t\tUpdateHelper::rollBackDatabaseChanges($this->_dbBackupPath);\n\t\t\t}\n\n\t\t\tthrow $e;\n\t\t}\n\n\t\t// We had migrations to run and something went wrong. Let's try to restore the backup database.\n\t\tif ($this->_backupDb)\n\t\t{\n\t\t\tUpdateHelper::rollBackDatabaseChanges($this->_dbBackupPath);\n\t\t}\n\n\t\treturn false;\n\t}", "public function isEatenUp()\n {\n return $this->eaten >= 100;\n }", "function _checkGoto($a_target)\n\t{\n\t\tglobal $ilAccess;\n\t\t$t_arr = explode('_', $a_target);\n\t\tif ($t_arr[0] != 'orgu' || ((int)$t_arr[1]) <= 0) {\n\t\t\treturn false;\n\t\t}\n\t\tif ($ilAccess->checkAccess('read', '', $t_arr[1])) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "public function upToDate() {\n\t\tif($this->hasDetails()) {\n\t\t\t$last_score_date = $this->getScores()->max('updated_at');\n\t\t\tYii::trace($last_score_date.' <= '.$this->updated_at, 'Scorecard::upToDate');\n\t\t\treturn $last_score_date <= $this->updated_at;\n\t\t}\n\t\treturn true;\n\t}", "public function passes($attribute, $value)\n {\n return version_compare($this->model->version, $value, '<');\n }", "protected function bowOutEarly()\n {\n return ($this->supportsBelow('5.3') === false || $this->supportsAbove('5.4') === false);\n }", "public function canMoveUp () {\n\t\treturn $this->canMoveUp;\n\t}", "public function isHasNext()\r\n {\r\n return ($this->getCurrentRowNum() < $this->getAgrCountForUnit());\r\n }", "public function inSetup()\n\t{\n\t\t$setupComplete = $this->config()->get('confirm_step') ? 3 : 2;\n\n\t\treturn ($this->get('setup_stage') < $setupComplete);\n\t}", "function _checkMaxQuantityLimt()\r\n {\r\n if ($this->data[$this->name]['buy_max_quantity_per_user'] >= $this->data[$this->name]['buy_min_quantity_per_user']) {\r\n return true;\r\n }\r\n return false;\r\n }", "public function upgradePossible () {\n $locale = git::getTagsInstallLatest();\n $repo = conf::getModuleIni('system_repo');\n $remote = git::getTagsRemoteLatest($repo);\n if ($remote > $locale) {\n return true;\n }\n return false;\n }", "public function passes(): bool {\r\n return $this -> execute();\r\n }", "public function passes($attribute, $value)\n {\n if ($this->min == null) {\n $this->kosong = true;\n } else {\n if ($value > $this->min) {\n return true;\n } else {\n return false;\n }\n }\n\n }", "public function ableToExecute()\n {\n $log = $this->getCommandLog();\n if ($log) {\n return $log->last_succeed_time >= $log->started_at || $log->ended_at >= $log->started_at;\n }\n return true;\n }", "function RunUpgrade()\n\t{\n\t\tif ($this->IndexExists('user_activitylog', array('userid', 'viewed'))) {\n\t\t\treturn true;\n\t\t}\n\n\t\t$query = 'CREATE INDEX ' . SENDSTUDIO_TABLEPREFIX . 'user_activitylog_userid_viewed_idx ON ' . SENDSTUDIO_TABLEPREFIX . 'user_activitylog(userid, viewed)';\n\n\t\t$result = $this->Db->Query($query);\n\t\tif ($result == false) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}", "public function test_get_runnable_migrations_going_up_no_target_version()\n {\n $migrator_util = new Ruckusing_Util_Migrator($this->adapter);\n $actual_up_files = $migrator_util->get_runnable_migrations($this->migrations_dirs, 'up', false);\n $expect_up_files = array(\n array(\n 'version' => 1,\n 'class' => 'CreateUsers',\n 'file' => '001_CreateUsers.php',\n 'module' => 'default'\n ),\n array(\n 'version' => 3,\n 'class' => 'AddIndexToBlogs',\n 'file' => '003_AddIndexToBlogs.php',\n 'module' => 'default'\n ),\n array(\n 'version' => '20090122193325',\n 'class' => 'AddNewTable',\n 'file' => '20090122193325_AddNewTable.php',\n 'module' => 'default'\n )\n );\n $this->assertEquals($expect_up_files, $actual_up_files);\n }", "public function test_get_runnable_migrations_going_down_with_target_version_no_current()\n {\n $migrator_util = new Ruckusing_Util_Migrator($this->adapter);\n $this->insert_dummy_version_data(array(3, '20090122193325'));\n $actual_down_files = $migrator_util->get_runnable_migrations($this->migrations_dirs, 'down', 1, false);\n $expect_down_files = array(\n array(\n 'version' => '20090122193325',\n 'class' => 'AddNewTable',\n 'file' => '20090122193325_AddNewTable.php',\n 'module' => 'default'\n ),\n array(\n 'version' => 3,\n 'class' => 'AddIndexToBlogs',\n 'file' => '003_AddIndexToBlogs.php',\n 'module' => 'default'\n )\n );\n $this->assertEquals($expect_down_files, $actual_down_files);\n $this->clear_dummy_data();\n\n $this->insert_dummy_version_data(array(3));\n $actual_down_files = $migrator_util->get_runnable_migrations($this->migrations_dirs, 'down', 1, false);\n $expect_down_files = array(\n array(\n 'version' => 3,\n 'class' => 'AddIndexToBlogs',\n 'file' => '003_AddIndexToBlogs.php',\n 'module' => 'default'\n )\n );\n $this->assertEquals($expect_down_files, $actual_down_files);\n\n //go all the way down!\n $this->clear_dummy_data();\n $this->insert_dummy_version_data(array(1, 3, '20090122193325'));\n $actual_down_files = $migrator_util->get_runnable_migrations($this->migrations_dirs, 'down', 0, false);\n $expect_down_files = array(\n array(\n 'version' => '20090122193325',\n 'class' => 'AddNewTable',\n 'file' => '20090122193325_AddNewTable.php',\n 'module' => 'default'\n ),\n array(\n 'version' => 3,\n 'class' => 'AddIndexToBlogs',\n 'file' => '003_AddIndexToBlogs.php',\n 'module' => 'default'\n ),\n array(\n 'version' => 1,\n 'class' => 'CreateUsers',\n 'file' => '001_CreateUsers.php',\n 'module' => 'default'\n )\n );\n $this->assertEquals($expect_down_files, $actual_down_files);\n }", "public function getAvailableMigrations($target=null)\n\t{\n\t\t// for normal migration we need all files to target\n\t\t// for rollbacks we need from target to the greatest migration\n\t\t$filter = $this->getFilter();\n\t\tif (!$this->isDownwards($target)) {\n\t\t\tif (null !== $target) {\n\t\t\t\t$filter->setToVersion($target);\n\t\t\t}\n\t\t} else {\t// rollback\n\t\t\t$filter->setFromVersion($target);\n\t\t\t$filter->setToVersion($this->getGreatestMigration());\n\t\t}\n\n\t\t$migration_steps = $this->getMigrationSteps();\n\n\t\t// migrations to be executed\n\t\t$to_execute = array();\n\t\tif ($this->isDownwards($target)) {\n\t\t\t// rollback: execute the common part of $executed and $migration_refs\n\t\t\t$executed = $this->getExecutedMigrations();\n\t\t\tforeach($migration_steps as $ref => $migration_class) {\n\t\t\t\tif (array_key_exists($ref, $executed)) {\n\t\t\t\t\t$to_execute[] = $ref;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t// migration: execute what's missing - the different of $executed and $available\n\t\t\t$to_execute = array_diff(array_keys($migration_steps), array_keys($this->getExecutedMigrations()));\n\t\t}\n\t\t\n\t\t// go through $to_execute and find the migration steps\n\t\t$migrations = array();\n\t\tforeach ($to_execute as $ref) {\n\t\t\t$migrations[$ref] = $migration_steps[$ref];\n\t\t}\n\t\t\n\t\t// sort migrations according to filter and target\n\t\t// remove one so that to avoid executing target in the case of rollback\n\t\t$this->sortMigrations($migrations, $target);\n\t\tif ($this->isDownwards($target)) {\n\t\t\tarray_pop($migrations);\n\t\t}\n\t\treturn $migrations;\n\t}", "public function isGreaterOrEqual($other)\n {\n return $this->level >= $other->level;\n }", "public function hasPassed() {\n \treturn $this < new \\DateTime();\n }", "public function isLessThanOrEqualTo(self $that): bool;", "public function migrateUp($class)\n {\n if ($class === self::BASE_MIGRATION) {\n return true;\n }\n\n $this->stdout(\"*** applying $class\\n\", Console::FG_YELLOW);\n $start = microtime(true);\n $migration = parent::createMigration($class);\n if ($migration->up() !== false) {\n $time = microtime(true) - $start;\n $this->stdout(\"*** applied $class (time: \" . sprintf('%.3f', $time) . \"s)\\n\\n\", Console::FG_GREEN);\n\n return true;\n } else {\n $time = microtime(true) - $start;\n $this->stdout(\"*** failed to apply $class (time: \" . sprintf('%.3f', $time) . \"s)\\n\\n\", Console::FG_RED);\n\n return false;\n }\n }", "public function isHighestPriority(): bool;", "private function sortMigrations(& $migrations, $target)\n\t{\n\t\t$filter = $this->getFilter();\n\t\tif (!$this->isDownwards($target)) {\n\t\t\tuksort($migrations, array($filter, 'compare'));\n\t\t} else {\n\t\t\tuksort($migrations, function($a, $b) use ($filter) {\n\t\t\t\treturn $filter->compare($b, $a);\t// reverse arguments\n\t\t\t} );\n\t\t}\n\t\t\n\t}", "public function test_get_runnable_migrations_going_down_no_target_version()\n {\n $migrator_util = new Ruckusing_Util_Migrator($this->adapter);\n $actual_down_files = $migrator_util->get_runnable_migrations($this->migrations_dirs, 'down', false);\n $this->assertEquals(array() , $actual_down_files);\n }", "protected function bowOutEarly()\n {\n return ($this->supportsBelow('7.3') === false || $this->supportsAbove('7.4') === false);\n }", "public function needs_updating() {\n\t\t// We need updating if we don't need to install, and the current version is less than target version\n\t\tif ( $this->needs_installing() === false && version_compare( $this->get_current_version(), REDIRECTION_DB_VERSION, '<' ) ) {\n\t\t\treturn true;\n\t\t}\n\n\t\t// Also if we're still in the process of upgrading\n\t\tif ( $this->get_current_stage() ) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "public function updateNecessary(): bool\n {\n $upgradeApi = GeneralUtility::makeInstance(UpgradeApi::class);\n $elementCount = 0;\n $tables = explode(',', self::TABLES);\n foreach ($tables as $table) {\n if (!isset($this->tableFields[$table])) {\n continue;\n }\n $fields = $this->tableFields[$table];\n foreach ($fields as $field) { \n $elementCount += \n $upgradeApi->countOfTableFieldMigrations(\n $table,\n $field, \n $field . '_uid', \n ParameterType::STRING,\n \\PDO::PARAM_INT\n );\n if ($elementCount > 0) {\n break;\n }\n }\n if ($elementCount > 0) {\n break;\n }\n }\n return ($elementCount > 0);\n }", "public function isLessThan(self $that): bool;", "public function testErrorOnBelowMinimum()\n {\n $importer = new Importer(1);\n $result = $importer->startImport();\n\n $this->assertEquals($result->result, false);\n }", "function _compareItemAndBuyMaxLimt()\r\n {\r\n if (empty($this->data[$this->name]['max_limit']) || $this->data[$this->name]['max_limit'] >= $this->data[$this->name]['buy_max_quantity_per_user']) {\r\n return true;\r\n }\r\n return false;\r\n }", "function auto_migrate($last_migration_file = null) {\n\t\t$migrations = $this->migration;\n\n\n\t\ttry {\n\t\t\t# get last migration (if not given):\n\t\t\t$last_migration_file = $last_migration_file ??\n\t\t\t $migrations->find()->order(['migration_id' => 'DESC'])->first()->migration_file;\n\t\t} catch(Exception $e) {\n\t\t\ttry {\n\t\t\t\t// commit initial migration\n\t\t\t\t$this->_migrate('0.sql');\n\n\t\t\t\t// check if migration succeeded\n\t\t\t\t$last_migration_file = $migrations->find()->order(['migration_id' => 'DESC'])->first()->migration_file;\n\t\t\t} catch(Exception $e) {\n\t\t\t\t// initial migration failed, give up now\n\t\t\t\thttp_response_code(500);\n\t\t\t\techo 'the database could not be set-up. Please check your initial migration';\n\t\t\t\tdie();\n\t\t\t}\n\n\t\t}\n\n\n\t\t// check if there is a migration file > last_migration and migrate it\n\n\t\t$migration_files = scandir('migrations');\n\t\t$migration_index = array_search($last_migration_file, $migration_files);\n\t\tif ($migration_index == null) {\n\t\t\t// file not found, just stop.\n\t\t\treturn;\n\t\t}\n\t\t$new_file = @$migration_files[$migration_index + 1];\n\t\tif ($new_file) {\n\t\t\t$this->_migrate($new_file);\n\n\t\t\t// continue checking the rest\n\t\t\t$this->auto_migrate($new_file);\n\t\t} // else: no files left\n\n\t}", "public function supports(Target $target): bool;", "public function isSameTendency() {\n \n if (false === isset($this->intRealHomeScore) || false === isset($this->intBetHomeScore)) {\n throw new \\BadMethodCallException(\"Real and bet results must be set\");\n }\n \n return \n ($this->intRealHomeScore < $this->intRealAwayScore && $this->intBetHomeScore < $this->intBetAwayScore) \n || ($this->intRealHomeScore > $this->intRealAwayScore && $this->intBetHomeScore > $this->intBetAwayScore) \n || ($this->intRealHomeScore === $this->intRealAwayScore && $this->intBetHomeScore === $this->intBetAwayScore);\n }", "function _checkGoto($a_target)\n\t{\n\t\tglobal $ilAccess;\n\t\t\n\t\t$t_arr = explode(\"_\", $a_target);\n\n\t\tif ($ilAccess->checkAccess(\"read\", \"\", $t_arr[1]))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "function isOverExecuted()\n {\n if ($this->start_time+$this->max_execution_time<time()) return true;\n else return false;\n }", "public function canDownOrder()\n {\n $orderAble = $this->getOrderAble();\n\n $node = $orderAble->getOrderQuery()\n ->andWhere([\n '>', $orderAble->getOrderFieldName(), $orderAble->getOrderValue()\n ])\n ->one();\n\n if ($node) return true;\n return false;\n }", "public function shouldGoToPenalty()\n {\n if( $this -> charger_connector_type -> isChargerFast() )\n {\n return false;\n }\n\n if( ! $this -> carHasAlreadyStoppedCharging() )\n {\n return false;\n }\n\n if( ! $this -> getCharger() -> penalty_enabled ) \n {\n return false;\n }\n\n $config = Config :: first();\n $penaltyReliefMinutes = $config -> penalty_relief_minutes;\n\n $chargedTime = Timestamp :: build( $this ) -> getStopChargingTimestamp();\n\n if( ! $chargedTime )\n {\n return false;\n }\n\n $elapsedTime = $chargedTime -> diffInMinutes( now() );\n\n return $elapsedTime >= $penaltyReliefMinutes;\n }", "function NeedDatabaseUpgrade()\n\t{\n\t\tif ($this->database_version == -1) {\n\t\t\t$this->CheckCron();\n\t\t}\n\n\t\tif ($this->database_version < SENDSTUDIO_DATABASE_VERSION) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "public function shouldTargetToCurrentTime()\n {\n return $this->targetToCurrentTime;\n }", "public function down($targetMigration)\n {\n $migrationsModel = new Ot_Model_DbTable_Migrations($this->_tablePrefix);\n \n end($this->_appliedMigrations);\n $highestExecutedMigration = current($this->_appliedMigrations);\n reset($this->_appliedMigrations);\n\n if (!isset($this->_availableMigrations[$targetMigration])) {\n throw new Exception('The requested migration ' . $targetMigration . ' was not found.');\n }\n \n if ((int)$highestExecutedMigration <= (int)$targetMigration) {\n throw new Exception('The database is only migrated to migration ' . $highestExecutedMigration . ', which is before the requested migration ' . $targetMigration);\n }\n \n $migrationsToApply = array();\n \n foreach ($this->_appliedMigrations as $a) {\n if ((int)$a > (int)$targetMigration && isset($this->_availableMigrations[$a])) {\n $migrationsToApply[] = $this->_availableMigrations[$a];\n }\n }\n \n $migrationsToApply = array_reverse($migrationsToApply);\n \n if (empty($migrationsToApply)) {\n $this->_messages[] = 'No migrations to apply';\n }\n \n $this->_db->beginTransaction();\n \n foreach ($migrationsToApply as $m) {\n require_once $this->_migrationsPath . '/' . $m;\n $classname = 'Db_' . substr($m, 0, -4); //strip out the .php extension\n $migrationClass = new $classname(array('tablePrefix' => $this->_tablePrefix));\n\n try {\n $migrationClass->down($this->_db, $this->_tablePrefix);\n } catch (Exception $e) {\n $this->_db->rollback();\n throw new Exception('Error applying migration ' . $m . '. ' . $e->getMessage());\n }\n \n try {\n $migrationsModel->removeMigration($this->_getMigrationIdFromFilename($m));\n } catch (Exception $e) {\n $this->_db->rollback();\n throw new Exception('Migration ' . $m . ' was successful, but adding record to migrations table failed. ' . $e->getMessage());\n }\n \n $this->_messages[] = 'Down migration of ' . $m . ' was successful.';\n }\n \n $this->_db->commit();\n }", "public function hasLastrewardtime(){\n return $this->_has(7);\n }", "public function incrementFailures(): bool;", "public function beforeUpdate()\n {\n if($this->ignoreChecks)\n return true;\n\n $total = RoleManager::for($this->group->code)->countRoles();\n\n if(!(($this->sort_order <= $total) && ($this->sort_order > 0)))\n {\n return false;\n }\n }", "private function run() {\n\t\tif ( $this->upgrade_schema->does_table_exist( $this->get_table() ) ) {\n\t\t\tif ( ! $this->upgrade_schema->does_column_exist( $this->get_table(), $this->get_column() ) ) {\n\t\t\t\t$this->upgrade_schema->add_column( $this->get_table(), $this->get_column(), $this->get_column_definition() );\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}", "public function greaterThan(Money $money): bool;", "public function canRunMigration()\n {\n return Mage::helper('core')->isModuleEnabled('Braintree_Payments');\n }", "public function lessThan(Money $money): bool;", "public function hasVigorMax(){\r\n return $this->_has(6);\r\n }", "public function hasMaxAnger(){\r\n return $this->_has(6);\r\n }", "public function hasTimeLimitReached(): bool;", "abstract public function hasAvailableMoves(): bool;", "public function hasMaxVigor(){\r\n return $this->_has(25);\r\n }", "public function isVersionRecommendedOrLarger()\n {\n return (\n (int) implode(null, explode('.', Mage::getVersion())) >=\n (int) implode(null, explode('.', self::RECOMMENDED_VERSION))\n );\n }", "public function valid(): bool\n {\n if ($this->next) {\n return $this->current->toInteger() <= $this->end->toInteger();\n }\n\n return $this->current->toInteger() >= $this->end->toInteger();\n }", "public function up($targetMigration)\n {\n $migrations = new Ot_Model_DbTable_Migrations($this->_tablePrefix);\n \n $migrationsIdsNotApplied = array_diff(array_keys($this->_availableMigrations), $this->_appliedMigrations);\n \n $migrationsToApply = array();\n \n foreach ($migrationsIdsNotApplied as $migrationId) {\n if ($migrationId <= $targetMigration) {\n $migrationsToApply[] = $this->_availableMigrations[$migrationId];\n }\n }\n \n if (empty($migrationsToApply)) {\n $this->_messages[] = 'No migrations to apply';\n return;\n }\n \n $this->_db->beginTransaction();\n \n foreach ($migrationsToApply as $m) {\n \n require_once $this->_migrationsPath . '/' . $m;\n $classname = 'Db_' . substr($m, 0, -4); //strip out the .php extension\n $migrationClass = new $classname(array('tablePrefix' => $this->_tablePrefix));\n\n try {\n $migrationClass->up($this->_db, $this->_tablePrefix);\n } catch (Exception $e) {\n $this->_db->rollback();\n throw new Exception('Error applying migration ' . $m . '. ' . $e->getMessage());\n }\n \n try {\n $migrations->addMigration($this->_getMigrationIdFromFilename($m));\n } catch (Exception $e) {\n $this->_db->rollback();\n throw new Exception('Migration ' . $m . ' was successful, but adding record to migrations table failed. ' . $e->getMessage());\n }\n \n $this->_messages[] = 'Applied ' . $m;\n }\n \n $this->_db->commit();\n }", "public function updateNecessary(): bool\n {\n $updateNeeded = false;\n // Check if the database table even exists\n if ($this->checkIfWizardIsRequired()) {\n $updateNeeded = true;\n }\n return $updateNeeded;\n }", "public function doMigrations() {\n\t\t$tbl = $this->tableManager->doMigrations();\n\t\t$fld = $this->fieldManager->doMigrations();\n\t\t$axs = $this->accessManager->doMigrations();\n\t\treturn $tbl && $fld && $axs;\n\t}", "public function valid()\n {\n return $this->_index < $this->count();\n }", "public function gt(...$comparisonValues): bool\n {\n $this->ensureCompatibleArgs($comparisonValues);\n return static::compare($this->value, $comparisonValues, [1], $this->internalMaxDecPl());\n }", "public function isLastStep();", "public function isCompleted(): bool\n {\n return ($this->progress_error + $this->progress_ok) >= \\count($this->state->getSourceStates());\n }", "public function qualifyToStart(): bool;", "public function migrationsToRun()\n\t{\n\t\t$manifestData = $this->_getManifestData();\n\n\t\tfor ($i = 0; $i < count($manifestData); $i++)\n\t\t{\n\t\t\t$row = explode(';', $manifestData[$i]);\n\n\t\t\t// We found a migration\n\t\t\tif (UpdateHelper::isManifestMigrationLine($row[0]) && $row[1] == PatchManifestFileAction::Add)\n\t\t\t{\n\t\t\t\tBlocks::log('Found migration file: '.$row[0], \\CLogger::LEVEL_INFO);\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}", "public function valid()\n {\n return $this->_position <= $this->_subject->getHighestRow();\n }", "public function scopeMigrated($query)\n {\n //TODO: Custom query to improve performance or Cache!\n return $query->has('migration');\n }", "public function valid()\n {\n return $this->_key + 1 <= $this->_limit;\n }", "public function canMoveDown () {\n\t\treturn $this->canMoveDown;\n\t}", "public function passes($attribute, $value)\n {\n if (is_null($this->checkin)) {\n return false;\n } else if ($value > $this->checkin) {\n return true;\n } else\n return false;\n }", "public function is_possible_upgrade() {\n\t\t\treturn false;\n\t\t}", "public static function promoted($threshold = null)\r\n {\r\n // Promotion has been disabled\r\n if (static::$config['promote'] === false)return false;\r\n\r\n // Use the config threshold\r\n if ($threshold===null)\r\n {\r\n $threshold = static::$config['promote'];\r\n }\r\n\r\n // Compare the valid response count to the threshold\r\n return (static::valid_count()>=$threshold);\r\n }", "public static function isBelow_6_0()\n {\n return (self::getVersionAsInteger() < self::VERSION_6_0);\n }", "public function isValidMove()\n {\n if ($this->getXCor() != $this->getEndXCor()\n && $this->getYCor() != $this->getEndYCor()\n ) {\n return false;\n }\n\n return true;\n }", "protected function matches($other): bool\n {\n /** @var Money $other */\n return $this->upperLimit->greaterThan($other);\n }", "public function test_resolve_current_version_going_down()\n {\n $this->clear_dummy_data();\n $this->insert_dummy_version_data(array(1,2,3));\n\n $migrator_util = new Ruckusing_Util_Migrator($this->adapter);\n $migrator_util->resolve_current_version(3, 'down');\n\n $executed = $migrator_util->get_executed_migrations();\n $this->assertEquals(false, in_array(3, $executed));\n $this->assertEquals(true, in_array(1, $executed));\n $this->assertEquals(true, in_array(2, $executed));\n }" ]
[ "0.61778116", "0.6080323", "0.5946392", "0.5738278", "0.5713029", "0.5688664", "0.5687063", "0.5683649", "0.5628863", "0.56193185", "0.56039834", "0.5579152", "0.5530845", "0.5412094", "0.5401458", "0.5388808", "0.53630245", "0.5322074", "0.5281697", "0.5244626", "0.52423495", "0.52341026", "0.52095246", "0.51953965", "0.51928955", "0.5184861", "0.51369953", "0.51136696", "0.5102146", "0.5098348", "0.50975454", "0.509346", "0.50894254", "0.5087787", "0.5086301", "0.5082214", "0.5078844", "0.50716025", "0.50567734", "0.5053785", "0.50521076", "0.50282604", "0.502178", "0.50203973", "0.50046957", "0.49987966", "0.4996588", "0.49940458", "0.497884", "0.4968918", "0.49586406", "0.4950884", "0.49478352", "0.49427304", "0.4939921", "0.49230063", "0.4890513", "0.48893657", "0.4889083", "0.4869599", "0.48367432", "0.4821722", "0.4817914", "0.48163804", "0.48044312", "0.47991788", "0.4788929", "0.47832114", "0.47759464", "0.47684595", "0.4757802", "0.4750144", "0.47477162", "0.47456443", "0.4743895", "0.47399694", "0.47363627", "0.47362888", "0.47311556", "0.47297913", "0.47239196", "0.4720079", "0.47157082", "0.47143924", "0.4714155", "0.47141108", "0.47060883", "0.4703962", "0.47038677", "0.4703298", "0.4690802", "0.46905786", "0.46901566", "0.4688396", "0.46857947", "0.468357", "0.468223", "0.4679274", "0.46751997", "0.4674755" ]
0.7440257
0
Returns an array of all the migrations that should be executed to reach the provided target, taking into consideration both the executed migrations. This works for both normal migrations and rollbacks.
public function getAvailableMigrations($target=null) { // for normal migration we need all files to target // for rollbacks we need from target to the greatest migration $filter = $this->getFilter(); if (!$this->isDownwards($target)) { if (null !== $target) { $filter->setToVersion($target); } } else { // rollback $filter->setFromVersion($target); $filter->setToVersion($this->getGreatestMigration()); } $migration_steps = $this->getMigrationSteps(); // migrations to be executed $to_execute = array(); if ($this->isDownwards($target)) { // rollback: execute the common part of $executed and $migration_refs $executed = $this->getExecutedMigrations(); foreach($migration_steps as $ref => $migration_class) { if (array_key_exists($ref, $executed)) { $to_execute[] = $ref; } } } else { // migration: execute what's missing - the different of $executed and $available $to_execute = array_diff(array_keys($migration_steps), array_keys($this->getExecutedMigrations())); } // go through $to_execute and find the migration steps $migrations = array(); foreach ($to_execute as $ref) { $migrations[$ref] = $migration_steps[$ref]; } // sort migrations according to filter and target // remove one so that to avoid executing target in the case of rollback $this->sortMigrations($migrations, $target); if ($this->isDownwards($target)) { array_pop($migrations); } return $migrations; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getMigrationsToRun() : array\n {\n $allMigrations = $this->getAllMigrations();\n\n $tableExists = $this->queryBuilderFactory->make()\n ->table_exists($this->table);\n\n if (! $tableExists) {\n return $allMigrations;\n }\n\n /** @var array $runMigrations */\n $runMigrations = $this->queryBuilderFactory->make()\n ->get($this->table)\n ->result();\n\n foreach ($runMigrations as $record) {\n unset($allMigrations[$record->migration]);\n }\n\n return $allMigrations;\n }", "public function get_applied_migrations(): array\n {\n $stmt = $this->pdo->prepare(\"SELECT migration FROM migrations\");\n $stmt->execute();\n\n return $stmt->fetchAll(PDO::FETCH_COLUMN, 0);\n }", "public function getExecutedMigrations()\n\t{\n\t\t$migrations = $this->getAdapter()->getMigrations();\n\t\tuksort($migrations, array($this->getFilter(), 'compare'));\n\t\treturn $migrations;\n\t}", "public function migrate($target=null)\n\t{\t\n\t\t$migrations = $this->getAvailableMigrations($target);\n\t\tif (null === $target) {\n\t\t\tend($migrations);\n\t\t\t$target = key($migrations);\n\t\t}\n\t\t\n\t\tif (!$this->isDownwards($target)) {\n\t\t\treturn $this->doMigration($migrations, AdapterInterface::UP);\n\t\t} else {\n\t\t\treturn $this->doMigration($migrations, AdapterInterface::DOWN);\n\t\t}\n\t}", "public function getMigrationsToRun() : array\n {\n $allMigrations = $this->getAllMigrations();\n $ranMigrations = $this->getRanMigrations();\n\n return array_diff($allMigrations, $ranMigrations);\n }", "protected function getMigrationsToRun()\n {\n $migrations_ran = $this->getMigrationsRan();\n $migrations_in_dir = $this->getMigrationsInDir();\n\n return array_diff($migrations_in_dir, $migrations_ran);\n }", "public function runMigrations() : array\n {\n $migrations = $this->getMigrationsToRun();\n $ran = [];\n\n if (count($migrations) === 0) {\n return $ran;\n }\n\n /** @var string $migration */\n foreach ($migrations as $migration) {\n $this->runMigration($migration);\n $ran[] = $migration;\n }\n\n return $ran;\n }", "private function sortMigrations(& $migrations, $target)\n\t{\n\t\t$filter = $this->getFilter();\n\t\tif (!$this->isDownwards($target)) {\n\t\t\tuksort($migrations, array($filter, 'compare'));\n\t\t} else {\n\t\t\tuksort($migrations, function($a, $b) use ($filter) {\n\t\t\t\treturn $filter->compare($b, $a);\t// reverse arguments\n\t\t\t} );\n\t\t}\n\t\t\n\t}", "public function getMigrations(): array\n {\n $result = [];\n foreach ($this->repository->getMigrations() as $migration) {\n //Populating migration state and execution time (if any)\n $result[] = $migration->withState($this->resolveState($migration));\n }\n\n return $result;\n }", "public function up($targetMigration)\n {\n $migrations = new Ot_Model_DbTable_Migrations($this->_tablePrefix);\n \n $migrationsIdsNotApplied = array_diff(array_keys($this->_availableMigrations), $this->_appliedMigrations);\n \n $migrationsToApply = array();\n \n foreach ($migrationsIdsNotApplied as $migrationId) {\n if ($migrationId <= $targetMigration) {\n $migrationsToApply[] = $this->_availableMigrations[$migrationId];\n }\n }\n \n if (empty($migrationsToApply)) {\n $this->_messages[] = 'No migrations to apply';\n return;\n }\n \n $this->_db->beginTransaction();\n \n foreach ($migrationsToApply as $m) {\n \n require_once $this->_migrationsPath . '/' . $m;\n $classname = 'Db_' . substr($m, 0, -4); //strip out the .php extension\n $migrationClass = new $classname(array('tablePrefix' => $this->_tablePrefix));\n\n try {\n $migrationClass->up($this->_db, $this->_tablePrefix);\n } catch (Exception $e) {\n $this->_db->rollback();\n throw new Exception('Error applying migration ' . $m . '. ' . $e->getMessage());\n }\n \n try {\n $migrations->addMigration($this->_getMigrationIdFromFilename($m));\n } catch (Exception $e) {\n $this->_db->rollback();\n throw new Exception('Migration ' . $m . ' was successful, but adding record to migrations table failed. ' . $e->getMessage());\n }\n \n $this->_messages[] = 'Applied ' . $m;\n }\n \n $this->_db->commit();\n }", "public function test_get_runnable_migrations_going_down_no_target_version()\n {\n $migrator_util = new Ruckusing_Util_Migrator($this->adapter);\n $actual_down_files = $migrator_util->get_runnable_migrations($this->migrations_dirs, 'down', false);\n $this->assertEquals(array() , $actual_down_files);\n }", "public function getMigrationsToExecute($direction, $to)\n {\n if ('down' === $direction) {\n if (count($this->migrations)) {\n $allVersions = array_reverse(array_keys($this->migrations));\n $classes = array_reverse(array_values($this->migrations));\n $allVersions = array_combine($allVersions, $classes);\n } else {\n $allVersions = [];\n }\n } else {\n $allVersions = $this->migrations;\n }\n $versions = [];\n $migrated = $this->getMigratedVersions();\n foreach ($allVersions as $version) {\n if ($this->shouldExecuteMigration($direction, $version, $to, $migrated)) {\n $versions[$version->getVersion()] = $version;\n }\n }\n\n return $versions;\n }", "public function getMigrations()\n {\n return $this->migrations;\n }", "public function pendingMigrations()\r\n\t{\r\n\t\t$outstanding = [];\r\n\t\t$this->ensureMigrationBinExist();\r\n\t\tforeach ($this->localRepository() as $file) {\r\n\t\t\t$line = $this->removeDotPhp($file);\r\n\r\n\t\t\t// Once we grab all of the migration files for the path, we will compare them\r\n\t\t\t// against the migrations that have already been run for this package then\r\n\t\t\t// run each of the outstanding migrations against a database connection.\r\n\t\t\t$result = $this->repository->getRan();\r\n\t\t\tif (!in_array($line, $result)) {\r\n\t\t\t\t$outstanding[] = $file;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn $outstanding;\r\n\t}", "public function applied()\n {\n $migrationFiles = array();\n $sql = new Sql($this->adapter);\n $select = $sql->select();\n $select->from(self::TABLE);\n \n $selectString = $sql->getSqlStringForSqlObject($select);\n $results = $this->adapter->query($selectString, Adapter::QUERY_MODE_EXECUTE);\n \n if ($results->count() > 0) {\n foreach ($results as $migration) {\n $migrationFiles[] = $migration->migration;\n }\n }\n \n return $migrationFiles;\n }", "public function get(string $target = '*'): array\n\t{\n\t\t$segments = explode('.', $target);\n\n\t\tif (count($segments) === 1) {\n\t\t\tarray_unshift($segments, '*');\n\t\t}\n\n\t\tif (count($segments) === 2) {\n\t\t\tif ($this->isBounded()) {\n\t\t\t\tarray_unshift($segments, $this->class);\n\t\t\t} else {\n\t\t\t\tarray_unshift($segments, 'global');\n\t\t\t}\n\t\t}\n\n\t\t$actions = Data::get($this->actions, $segments, []);\n\n\t\tif (!is_array($actions)) {\n\t\t\t$actions = [$actions];\n\t\t} else if (!empty($actions)) {\n\t\t\t$actions = array_values(array_filter($actions));\n\t\t}\n\n\t\treturn $actions;\n\t}", "public function collectMigrations(): array;", "public function getActiveMigrations() {\n\t\tif (!is_array($this->activeMigrations)) {\n\t\t\t$this->activeMigrations = array();\n\t\t\t/** @var Tx_Smoothmigration_Service_RequirementsAnalyzer $requirementsAnalyzer */\n\t\t\t$requirementsAnalyzer = t3lib_div::makeInstance('Tx_Smoothmigration_Service_RequirementsAnalyzer');\n\n\t\t\tforeach ($this->registeredMigrations as $className) {\n\t\t\t\t/** @var Tx_Smoothmigration_Domain_Interface_Migration $check */\n\t\t\t\t$migration = t3lib_div::makeInstance($className);\n\t\t\t\tif ($requirementsAnalyzer->isActive($migration)) {\n\t\t\t\t\t$this->activeMigrations[] = $migration;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $this->activeMigrations;\n\t}", "public function test_get_runnable_migrations_going_up_with_target_version_with_current()\n {\n $migrator_util = new Ruckusing_Util_Migrator($this->adapter);\n //pretend we already executed version 1\n $this->insert_dummy_version_data(array(1));\n $actual_up_files = $migrator_util->get_runnable_migrations($this->migrations_dirs, 'up', 3, false);\n $expect_up_files = array(\n array(\n 'version' => 3,\n 'class' => 'AddIndexToBlogs',\n 'file' => '003_AddIndexToBlogs.php',\n 'module' => 'default'\n )\n );\n $this->assertEquals($expect_up_files, $actual_up_files);\n $this->clear_dummy_data();\n\n //now pre-register some migrations that we have already executed\n $this->insert_dummy_version_data(array(1, 3));\n $actual_up_files = $migrator_util->get_runnable_migrations($this->migrations_dirs, 'up', 3, false);\n $this->assertEquals(array(), $actual_up_files);\n }", "public function test_get_runnable_migrations_going_up_with_target_version_no_current()\n {\n $migrator_util = new Ruckusing_Util_Migrator($this->adapter);\n $actual_up_files = $migrator_util->get_runnable_migrations($this->migrations_dirs, 'up', 3, false);\n $expect_up_files = array(\n array(\n 'version' => 1,\n 'class' => 'CreateUsers',\n 'file' => '001_CreateUsers.php',\n 'module' => 'default'\n ),\n array(\n 'version' => 3,\n 'class' => 'AddIndexToBlogs',\n 'file' => '003_AddIndexToBlogs.php',\n 'module' => 'default'\n )\n );\n $this->assertEquals($expect_up_files, $actual_up_files);\n }", "public function test_get_runnable_migrations_going_up_no_target_version()\n {\n $migrator_util = new Ruckusing_Util_Migrator($this->adapter);\n $actual_up_files = $migrator_util->get_runnable_migrations($this->migrations_dirs, 'up', false);\n $expect_up_files = array(\n array(\n 'version' => 1,\n 'class' => 'CreateUsers',\n 'file' => '001_CreateUsers.php',\n 'module' => 'default'\n ),\n array(\n 'version' => 3,\n 'class' => 'AddIndexToBlogs',\n 'file' => '003_AddIndexToBlogs.php',\n 'module' => 'default'\n ),\n array(\n 'version' => '20090122193325',\n 'class' => 'AddNewTable',\n 'file' => '20090122193325_AddNewTable.php',\n 'module' => 'default'\n )\n );\n $this->assertEquals($expect_up_files, $actual_up_files);\n }", "public function getMigrations();", "private function getMigrations()\n\t\t{\n\t\t\tif(self::$migrations)\n\t\t\t{\n\t\t\t\treturn self::$migrations;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tforeach(\\System\\DB\\DataAdapter::create(\"adapter=dir;source=\".__MIGRATIONS_PATH__.\";\")->openDataSet()->rows as $row)\n\t\t\t\t{\n\t\t\t\t\tif(\\strpos($row[\"name\"], '.php'))\n\t\t\t\t\t{\n\t\t\t\t\t\trequire $row[\"path\"];\n\t\t\t\t\t\t$migration = \\str_replace(\".php\", \"\", $row[\"name\"]);\n\t\t\t\t\t\teval(\"\\$migration = new \\\\System\\\\Migrate\\\\{$migration}();\");\n\n\t\t\t\t\t\tself::$migrations[] = new $migration();\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$CSort = new MigrationCompare();\n\t\t\t\tusort( self::$migrations, array( &$CSort, 'compareVersion' ));\n\t\t\t\treturn self::$migrations;\n\t\t\t}\n\t\t}", "public function get_migrations()\n\t{\n\t\tif ( ! $this->migrations)\n\t\t{\n\t\t\t$migrations = glob($this->config['path'] . DIRECTORY_SEPARATOR . '*' . EXT);\n\t\t\t$ids = array();\n\t\t\tforeach ((array) $migrations as $file)\n\t\t\t{\n\t\t\t\t$name = basename($file, EXT);\n\t\t\t\t$matches = array();\n\t\t\t\tif ( preg_match('/^(\\d+)_(\\w+)$/', $name, $matches))\n\t\t\t\t{\n\t\t\t\t\t$ids[] = intval($matches[1]);\n\t\t\t\t}\n\t\t\t}\n\t\t\t$this->migrations = $ids;\n\t\t}\n\t\treturn $this->migrations;\n\t}", "public function down($targetMigration)\n {\n $migrationsModel = new Ot_Model_DbTable_Migrations($this->_tablePrefix);\n \n end($this->_appliedMigrations);\n $highestExecutedMigration = current($this->_appliedMigrations);\n reset($this->_appliedMigrations);\n\n if (!isset($this->_availableMigrations[$targetMigration])) {\n throw new Exception('The requested migration ' . $targetMigration . ' was not found.');\n }\n \n if ((int)$highestExecutedMigration <= (int)$targetMigration) {\n throw new Exception('The database is only migrated to migration ' . $highestExecutedMigration . ', which is before the requested migration ' . $targetMigration);\n }\n \n $migrationsToApply = array();\n \n foreach ($this->_appliedMigrations as $a) {\n if ((int)$a > (int)$targetMigration && isset($this->_availableMigrations[$a])) {\n $migrationsToApply[] = $this->_availableMigrations[$a];\n }\n }\n \n $migrationsToApply = array_reverse($migrationsToApply);\n \n if (empty($migrationsToApply)) {\n $this->_messages[] = 'No migrations to apply';\n }\n \n $this->_db->beginTransaction();\n \n foreach ($migrationsToApply as $m) {\n require_once $this->_migrationsPath . '/' . $m;\n $classname = 'Db_' . substr($m, 0, -4); //strip out the .php extension\n $migrationClass = new $classname(array('tablePrefix' => $this->_tablePrefix));\n\n try {\n $migrationClass->down($this->_db, $this->_tablePrefix);\n } catch (Exception $e) {\n $this->_db->rollback();\n throw new Exception('Error applying migration ' . $m . '. ' . $e->getMessage());\n }\n \n try {\n $migrationsModel->removeMigration($this->_getMigrationIdFromFilename($m));\n } catch (Exception $e) {\n $this->_db->rollback();\n throw new Exception('Migration ' . $m . ' was successful, but adding record to migrations table failed. ' . $e->getMessage());\n }\n \n $this->_messages[] = 'Down migration of ' . $m . ' was successful.';\n }\n \n $this->_db->commit();\n }", "public function getMigrations(){\n $migrations[] = new migrateTable0001($this->get('db'));\n $migrations[] = new migrateTable0002($this->get('db'));\n $migrations[] = new migrateTableEvent($this->get('db'));\n $migrations[] = new migrateTableMessages($this->get('db'));\n $migrations[] = new migrateTablePerson($this->get('db'));\n $migrations[] = new migrateTable122320151845($this->get('db'));\n\n return $migrations;\n }", "protected function getMigrationsRan()\n {\n // TODO: Move query to a query factory based on db_adapter\n $resource = $this->db_adapter->query(\n \"SELECT file FROM $this->migration_table\"\n );\n\n // TODO: Needs to be abstracted from this class\n $results = pg_fetch_all($resource) ?: [];\n\n // Flatten the array structure to a single dimension\n $migrations_ran = array_map(function ($result) {\n return $result['file'];\n }, $results);\n\n return $migrations_ran;\n }", "protected function getNewMigrations()\n {\n if (!$this->includeModuleMigrations) {\n return parent::getNewMigrations();\n }\n\n $this->migrationPathMap = [];\n $migrations = [];\n foreach ($this->getMigrationPaths() as $migrationPath) {\n $this->migrationPath = $migrationPath;\n $migrations = array_merge($migrations, parent::getNewMigrations());\n $this->migrationPathMap[$migrationPath] = $migrations;\n }\n\n sort($migrations);\n\n\t\treturn $migrations;\n }", "public function getRan()\n {\n global $wpdb;\n\n $sql = \"SELECT migration as name FROM {$wpdb->prefix}exolnet_migration as em\";\n\n $migrations = $wpdb->get_results($sql, 'ARRAY_A');\n\n $migrationCleaned = [];\n if (!empty($migrations) && is_array($migrations)) {\n foreach ($migrations as $migration) {\n $migrationCleaned[] = $migration['name'];\n }\n }\n\n return $migrationCleaned;\n }", "protected function find_migrations()\n\t{\n\t\t// Load all *_*.php files in the migrations path\n\t\t$files = glob($this->_migration_path . '*_*.php');\n\t\t$file_count = count($files);\n\n\t\tfor ($i = 0; $i < $file_count; $i++)\n\t\t{\n\t\t\t// Mark wrongly formatted files as false for later filtering\n\t\t\t$name = basename($files[$i], '.php');\n\t\t\tif ( ! preg_match('/^\\d{3}_(\\w+)$/', $name))\n\t\t\t{\n\t\t\t\t$files[$i] = FALSE;\n\t\t\t}\n\t\t}\n\n\t\tsort($files);\n\t\treturn $files;\n\t}", "public function getMigrations()\n {\n $path = database_path(\n 'migrations' . DIRECTORY_SEPARATOR . '*.php'\n );\n\n return str_replace(\n '.php', '', glob($path)\n );\n }", "protected function getAllMigrationFiles()\n {\n return $this->migrator->getMigrations();\n }", "public function migrationsNeeded() {\n\t\treturn $this->tableManager->migrationsNeeded() || $this->fieldManager->migrationsNeeded() || $this->accessManager->migrationsNeeded();\n\t}", "public function getAllMigrations() : array\n {\n $migrationFiles = $this->filesystem->getDirectoryContents(\n $this->migrationsDir\n );\n\n $allMigrations = [];\n\n foreach ($migrationFiles as $file) {\n $filePathInfo = pathinfo($file);\n $allMigrations[$filePathInfo['filename']] = $filePathInfo['filename'];\n }\n\n ksort($allMigrations);\n\n return $allMigrations;\n }", "private function findComponentsWhichNeedMigrated(): array\n {\n $aModules = Components::available(false);\n $aOut = [];\n\n foreach ($aModules as $oModule) {\n $oState = $this->determineModuleState($oModule);\n if ($oState->start !== $oState->end) {\n $aOut[] = $oState;\n }\n }\n\n // Shift the app migrations onto the end so they are executed last\n if (!empty($aOut)) {\n $oFirst = reset($aOut);\n if ($oFirst->slug === Components::$sAppSlug) {\n $oApp = array_shift($aOut);\n $aOut = array_merge($aOut, [$oApp]);\n $aOut = array_filter($aOut);\n $aOut = array_values($aOut);\n }\n }\n\n return $aOut;\n }", "public function getMigrationPaths();", "public function rebuild($targetMigration = null)\n {\n $migrations = new Ot_Model_DbTable_Migrations($this->_tablePrefix);\n \n $this->_messages[] = 'Dropping all tables';\n \n try {\n $migrations->dropAllTables();\n } catch (Exception $e) {\n throw new Exception('Dropping all the tables failed. ' . $e->getMessage());\n }\n \n $this->_messages[] = 'All tables dropped.';\n \n $this->_messages[] = \"Recreating migration table.\";\n $migrations->createTable(); // create the migrations table\n \n // reset the applied migrations array. it should be empty, but we'll\n // check the db just to make sure\n $this->_appliedMigrations = $migrations->getAppliedMigrations();\n \n if (is_null($targetMigration)) {\n $this->_messages[] = 'Rebuilding database to latest version.';\n return $this->latest();\n } else {\n $this->_messages[] = 'Rebuilding database to version ' . $targetMigration . '.';\n return $this->up($targetMigration);\n }\n }", "protected function get_migration_file_list()\n\t{\n\t\tif ($this->migrations !== false)\n\t\t{\n\t\t\treturn $this->migrations;\n\t\t}\n\n\t\t// Only have the finder search in this extension path directory\n\t\t$migrations = $this->extension_finder\n\t\t\t->extension_directory('/migrations')\n\t\t\t->find_from_extension($this->extension_name, $this->extension_path);\n\n\t\t$migrations = $this->extension_finder->get_classes_from_files($migrations);\n\n\t\t$this->migrator->set_migrations($migrations);\n\n\t\t$migrations = $this->migrator->get_migrations();\n\n\t\treturn $migrations;\n\t}", "protected function getMigrationPaths()\n {\n $migrationPaths = ['base' => $this->migrationPath];\n foreach (Yii::$app->getModules() as $id => $config) {\n if (is_array($config) && isset($config['class'])) {\n $reflector = new \\ReflectionClass($config['class']);\n $path = dirname($reflector->getFileName()) . '/migrations';\n if (is_dir($path)) {\n $migrationPaths[$id] = $path;\n }\n }\n }\n\n\t\treturn $migrationPaths;\n }", "public function test_get_runnable_migrations_going_down_with_target_version_no_current()\n {\n $migrator_util = new Ruckusing_Util_Migrator($this->adapter);\n $this->insert_dummy_version_data(array(3, '20090122193325'));\n $actual_down_files = $migrator_util->get_runnable_migrations($this->migrations_dirs, 'down', 1, false);\n $expect_down_files = array(\n array(\n 'version' => '20090122193325',\n 'class' => 'AddNewTable',\n 'file' => '20090122193325_AddNewTable.php',\n 'module' => 'default'\n ),\n array(\n 'version' => 3,\n 'class' => 'AddIndexToBlogs',\n 'file' => '003_AddIndexToBlogs.php',\n 'module' => 'default'\n )\n );\n $this->assertEquals($expect_down_files, $actual_down_files);\n $this->clear_dummy_data();\n\n $this->insert_dummy_version_data(array(3));\n $actual_down_files = $migrator_util->get_runnable_migrations($this->migrations_dirs, 'down', 1, false);\n $expect_down_files = array(\n array(\n 'version' => 3,\n 'class' => 'AddIndexToBlogs',\n 'file' => '003_AddIndexToBlogs.php',\n 'module' => 'default'\n )\n );\n $this->assertEquals($expect_down_files, $actual_down_files);\n\n //go all the way down!\n $this->clear_dummy_data();\n $this->insert_dummy_version_data(array(1, 3, '20090122193325'));\n $actual_down_files = $migrator_util->get_runnable_migrations($this->migrations_dirs, 'down', 0, false);\n $expect_down_files = array(\n array(\n 'version' => '20090122193325',\n 'class' => 'AddNewTable',\n 'file' => '20090122193325_AddNewTable.php',\n 'module' => 'default'\n ),\n array(\n 'version' => 3,\n 'class' => 'AddIndexToBlogs',\n 'file' => '003_AddIndexToBlogs.php',\n 'module' => 'default'\n ),\n array(\n 'version' => 1,\n 'class' => 'CreateUsers',\n 'file' => '001_CreateUsers.php',\n 'module' => 'default'\n )\n );\n $this->assertEquals($expect_down_files, $actual_down_files);\n }", "public function version($target_version)\n\t{ \n\t\t$start = $current_version = $target_version-1;\n\t\t$stop = $target_version;\n \n\t\tif ($target_version > $current_version)\n\t\t{\n\t\t\t// Moving Up\n\t\t\t++$start;\n\t\t\t++$stop;\n\t\t\t$step = 1;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Moving Down\n\t\t\t$step = -1;\n\t\t}\n \n\t\t$method = ($step === 1) ? 'up' : 'down';\n\t\t$migrations = array();\n \n\t\t// We now prepare to actually DO the migrations\n\t\t// But first let's make sure that everything is the way it should be\n\t\tfor ($i = $start; $i != $stop; $i += $step)\n\t\t{ \n\t\t\t$f = glob(sprintf($this->_migration_path . '%03d_*.php', $i));\n\t\t\t// Only one migration per step is permitted\n\t\t\tif (count($f) > 1)\n\t\t\t{\n\t\t\t\t$this->_error_string = sprintf($this->lang->line('migration_multiple_version'), $i);\n\t\t\t\treturn FALSE;\n\t\t\t}\n\n\t\t\tif ( isset( $f[0] ) ) { \n\t\t\t\t$name = basename($f[0], '.php');\n\t\t\t} else {\n\t\t\t\treturn FALSE;\n\t\t\t}\n\n \n\t\t\t// Filename validations\n\t\t\tif (preg_match('/^\\d{3}_(\\w+)$/', $name, $match))\n\t\t\t{\n\t\t\t\t$match[1] = strtolower($match[1]);\n\n\t\t\t\t// Cannot repeat a migration at different steps\n\t\t\t\tif (in_array($match[1], $migrations))\n\t\t\t\t{\n\t\t\t\t\t$this->_error_string = sprintf($this->lang->line('migration_multiple_version'), $match[1]);\n\t\t\t\t\treturn FALSE;\n\t\t\t\t}\n\n\t\t\t\tinclude $f[0];\n\t\t\t\t$class = 'Migration_' . ucfirst($match[1]);\n\n\t\t\t\tif ( ! class_exists($class))\n\t\t\t\t{\n\t\t\t\t\t$this->_error_string = sprintf($this->lang->line('migration_class_doesnt_exist'), $class);\n\t\t\t\t\treturn FALSE;\n\t\t\t\t}\n\n\t\t\t\tif ( ! is_callable(array($class, $method)))\n\t\t\t\t{\n\t\t\t\t\t$this->_error_string = sprintf($this->lang->line('migration_missing_'.$method.'_method'), $class);\n\t\t\t\t\treturn FALSE;\n\t\t\t\t}\n\n\t\t\t\t$migrations[] = $match[1];\n\t\t\t}\n\t\t}\n\n\t\tlog_message('debug', 'Migration atual: ' . $current_version);\n\n\t\t$version = $i + ($step == 1 ? -1 : 0);\n\n\t\t// If there is nothing to do so quit\n\t\tif ($migrations === array())\n\t\t{\n\t\t\treturn TRUE;\n\t\t}\n\n\t\tlog_message('debug', 'Migrating from ' . $method . ' to version ' . $version);\n \n\t\t// Loop through the migrations\n\t\n\t\t\t// Run the migration class\n\t\t\t$class = 'Migration_' . ucfirst(strtolower(end($migrations)));\n\t\t\tcall_user_func(array(new $class, $method));\n\n\t\t\t$current_version += $step;\n\t\t\t$this->_update_version($current_version);\n\t\t\n\n\t\tlog_message('debug', 'Finished migrating to '.$current_version);\n \n\t\treturn end($migrations);\n\t}", "public function findAllLinks(array $target)\n {\n // Default columns to be selected\n $defaults = array(\n self::column('id'),\n self::column('module')\n );\n\n $columns = array();\n\n // Append static column name\n foreach ($target as $table => $alias) {\n $columns[sprintf('%s.name', $table)] = sprintf('`%s`', $alias);\n }\n\n $db = $this->db->select(array_merge($defaults, $columns))\n ->from(self::getTableName());\n\n // Append relations from dynamic tables\n foreach (array_keys($target) as $table) {\n $db->leftJoin($table, array(\n sprintf('%s.web_page_id', $table) => new RawSqlFragment(self::column('id')),\n sprintf('%s.lang_id', $table) => new RawSqlFragment(self::column('lang_id')),\n ));\n }\n\n // Filter by language ID\n $db->whereEquals(self::column('lang_id'), $this->getLangId())\n ->andWhereIn(self::column('module'), array_values($target));\n\n return $db->queryAll();\n }", "public function getAvailableVersions()\n {\n $availableVersions = [];\n foreach ($this->migrations as $migration) {\n $availableVersions[] = $migration->getVersion();\n }\n\n return $availableVersions;\n }", "protected function _getAvailableMigrations()\n {\n $availableMigrations = array();\n \n $files = scandir($this->_migrationsPath);\n \n foreach ($files as $filename) {\n \n if (substr($filename, -4) == '.php' && $filename != '.' && $filename != '..' && !is_dir($filename)) {\n \n $id = $this->_getMigrationIdFromFilename($filename);\n $availableMigrations[$id] = $filename;\n }\n }\n \n if (empty($availableMigrations)) {\n throw new Exception('No available migrations found');\n }\n \n return $availableMigrations;\n }", "private function getMigrationSteps()\n\t{\n\t\t$migration_steps = array();\n\t\tforeach ($this->getFilter() as $step) {\n\t\t\t$migration_steps[$step->getReference()] = $step;\n\t\t}\n\t\t\n\t\treturn $migration_steps;\n\t}", "protected function getMigrations()\n {\n $params = [\n 'connection' => 'test',\n 'source' => 'TestsMigrations',\n ];\n $migrations = new Migrations($params);\n $adapter = $migrations\n ->getManager($this->command->getConfig())\n ->getEnvironment('default')\n ->getAdapter();\n\n while ($adapter instanceof WrapperInterface) {\n $adapter = $adapter->getAdapter();\n }\n\n $adapter->setConnection($this->pdo);\n\n return $migrations;\n }", "public function getMigrations()\n {\n return [\n CreateKeyPairTable::class,\n ];\n }", "protected function generate_migrations( DI_Container $container ): array {\n\t\t$migrations = array();\n\t\tforeach ( $this->migrations as $migration ) {\n\t\t\tif ( is_string( $migration ) ) {\n\t\t\t\ttry {\n\t\t\t\t\t$instance = $container->create( $migration );\n\t\t\t\t} catch ( \\Throwable $th ) {\n\t\t\t\t\tthrow Migration_Exception::failed_to_construct_migration( $migration );\n\t\t\t\t}\n\n\t\t\t\t// Add to the list if valid.\n\t\t\t\tif ( ! is_object( $instance ) || ! is_a( $instance, Migration::class ) ) {\n\t\t\t\t\tthrow Migration_Exception::failed_to_construct_migration( $migration );\n\t\t\t\t}\n\n\t\t\t\t$migrations[] = $instance;\n\t\t\t}\n\t\t}\n\t\treturn $migrations;\n\t}", "public function migrationPaths()\n {\n return [\n dirname(__DIR__, 3) . '/database/migrations',\n ];\n }", "public function loadMigrationFromModules()\n {\n $paths = [];\n if (!$this->modules) {\n return $paths;\n }\n $modulesCollection = collect($this->modules);\n $activeModules = $modulesCollection->get(self::MODULE_VERSION);\n\n foreach ($activeModules as $key => $moduleName) {\n $paths[] = $this->path . DIRECTORY_SEPARATOR . self::MODULE_VERSION . DIRECTORY_SEPARATOR . $moduleName . DIRECTORY_SEPARATOR . 'Database' . DIRECTORY_SEPARATOR . 'Migrations';\n }\n\n return $paths;\n }", "public function supportsMigrations();", "public function getAppliedMigrations($version = null)\n {\n $result = $this->getDBAdapter()->query(\n \"SELECT migration FROM `\" . $this->getConfig()->table . \"`\"\n );\n\n $migrations = array();\n if (($result) && ($result->rowCount() > 0)) {\n while ($value = $result->fetchColumn()) {\n $migrations[] = $value;\n }\n }\n\n if (!is_null($version)) {\n foreach ($migrations as $key => $migration) {\n if (substr($migration, 0, strlen($version)) != $version) {\n unset($migrations[$key]);\n }\n }\n }\n\n sort($migrations);\n\n return $migrations;\n }", "protected function getMigrations()\n {\n $finder = new Finder();\n $files = $finder->files()\n ->name('*table.php')\n ->notName('2014*')\n ->in(database_path() . '/migrations');\n\n foreach ($files as $file) {\n $this->migrations[] = $file->getRealPath() ;\n }\n }", "public function getTargetFunctions()\n {\n $result = new ArrayCollection();\n if ($this->targetFunction1) { $result[] = $this->targetFunction1; }\n if ($this->targetFunction2) { $result[] = $this->targetFunction2; }\n if ($this->targetFunction3) { $result[] = $this->targetFunction3; }\n return $result;\n }", "public function pending(): array\n {\n $migrationFileCount = (int)iterator_count(\n new FilesystemIterator(\n database_path(\"migrations\"),\n FilesystemIterator::SKIP_DOTS\n )\n );\n\n $migrationTableCount = count(\n $this->connection->select(\"SELECT id FROM migrations;\")\n );\n\n $pending = $migrationFileCount - $migrationTableCount;\n\n return [\n \"pending\" => $pending <= 0 ? 0 : $pending,\n \"total\" => $migrationFileCount,\n ];\n }", "protected function tasks()\n\t{\n\t\t$rollback = $this->getRollbackRelease();\n\n\t\treturn array(\n\t\t\t$this->updateSymlink($rollback),\n\t\t);\n\t}", "public function rollback(): array\n {\n $messages = [];\n // run migrations\n $output = $this->phinxApplication->getRollback(WP_ENV ?: 'testing', 0);\n $this->logger->info($output);\n $messages[] = ['type' => 'success', 'text' => 'Forme Rollback completed, check server logs for more info'];\n\n return $messages;\n }", "public function getUpCandidates()\n {\n $statuses = $this->getStatuses();\n\n // search latest applied migration\n $latest = '';\n foreach ($statuses as $status) {\n if ($status->appliedAt !== \"\") {\n $latest = $status->file->getFileName();\n }\n }\n\n // make statuses without being applied\n $candidates = [];\n $isSkipped = ($latest === '')? false: true;\n foreach ($statuses as $status) {\n if (false === $isSkipped) {\n $candidates[] = $status;\n }\n if($status->file->getFileName() !== $latest) {\n continue;\n } else {\n $isSkipped = false;\n }\n }\n\n return $candidates;\n }", "protected function getMigrationPaths()\n {\n // Here, we will check to see if a path option has been defined. If it has we will\n // use the path relative to the root of the installation folder so our database\n // migrations may be run for any customized path from within the application.\n if ($this->hasOption('path') && $this->option('path')) {\n return collect($this->option('path'))->map(function ($path) {\n return ! $this->usingRealPath()\n ? ROOT_PATH.'/'.$path\n : $path;\n })->all();\n }\n return array_merge(\n $this->migrator->paths(), [$this->getMigrationPath()]\n );\n }", "protected function getMigrationPaths(): array\n {\n // Here, we will check to see if a path option has been defined. If it has we will\n // use the path relative to the root of the installation folder so our database\n // migrations may be run for any customized path from within the application.\n\n $path = CommandManager::getInstance()->getOpt('path', false);\n if ($path) {\n $collect = new Collection($path);\n return $collect->map(function ($path) {\n return ! $this->usingRealPath()\n ? EASYSWOOLE_ROOT . DIRECTORY_SEPARATOR . $path\n : $path;\n })->all();\n }\n\n return array_merge(\n $this->migrator->paths(),\n [$this->getMigrationPath()]\n );\n }", "public function migrationsToRun()\n\t{\n\t\t$manifestData = $this->_getManifestData();\n\n\t\tfor ($i = 0; $i < count($manifestData); $i++)\n\t\t{\n\t\t\t$row = explode(';', $manifestData[$i]);\n\n\t\t\t// We found a migration\n\t\t\tif (UpdateHelper::isManifestMigrationLine($row[0]) && $row[1] == PatchManifestFileAction::Add)\n\t\t\t{\n\t\t\t\tBlocks::log('Found migration file: '.$row[0], \\CLogger::LEVEL_INFO);\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}", "public function migrations_path();", "protected function extractPaths($target) {\n\n $paths = array(array($target));\n\n while (current($paths) !== false) {\n\n $key = key($paths);\n $path = current($paths);\n\n next($paths);\n\n if (!empty($this->previous[$path[0]])) {\n\n foreach ($this->previous[$path[0]] as $previous) {\n\n $copy = $path;\n array_unshift($copy, $previous);\n $paths[] = $copy;\n }\n\n unset($paths[$key]);\n }\n }\n\n return array_values($paths);\n }", "public function doMigrations() {\n\t\t$tbl = $this->tableManager->doMigrations();\n\t\t$fld = $this->fieldManager->doMigrations();\n\t\t$axs = $this->accessManager->doMigrations();\n\t\treturn $tbl && $fld && $axs;\n\t}", "public function provideTargetsToFilter()\n {\n // doesn't affect the return values\n return [\n [ CallableMethodsListTest_Target1::class, [ 'staticMethod1' => 'staticMethod1' ] ],\n [ CallableMethodsListTest_Target1::class, [ 'staticMethod1' => 'staticMethod1' ] ],\n [ new \\stdClass, [ ] ],\n [ new \\stdClass, [ ] ],\n [ new CallableMethodsListTest_Target1, [ 'objectMethod1' => 'objectMethod1' ] ],\n [ new CallableMethodsListTest_Target1, [ 'objectMethod1' => 'objectMethod1' ] ],\n ];\n }", "public function getAvailableMigrations($version = null)\n {\n if (is_null($version)) {\n $version = self::VERSION_REGEXPR;\n }\n\n $dir = PATH . '/' . $this->getConfig()->path;\n\n if (!$this->prepareDir($dir)) {\n throw new Exception ('Migrations path are invalid');\n }\n $migrations = $this->getItemsByRegEx($dir, \"/^(\" . $version . \"_\\d{8}_\\d{6}_\\d{2})_(up|down)\\.sql$/i\");\n\n sort($migrations);\n\n return $migrations;\n }", "protected function getMigrationPaths()\n {\n // use the path relative to the root of the installation folder so our database\n // migrations may be run for any customized path from within the application.\n if ($this->input->hasOption('path') && $this->option('path')) {\n return ws_collect($this->option('path'))->map(function ($path) {\n return !$this->usingRealPath()\n ? $this->laravel->basePath() . '/' . $path\n : $path;\n })->all();\n }\n\n return array_merge(\n $this->migrator->paths(), [$this->getMigrationPath()]\n );\n }", "public function getTargets()\n {\n return array(self::CLASS_CONSTRAINT);\n }", "public function targets()\n {\n return $this->hasMany(\\App\\Target::class);\n }", "protected function getMigrationsPath()\n\t{\n\t\treturn Framework::fw()->buildPath( '__database', 'migrations' );\n\t}", "protected function getMigrationPaths()\n {\n return array_merge(\n $this->getPaths(), $this->migrator->paths()\n );\n }", "protected function getMigrationsInDir()\n {\n $migration_files = [];\n\n $migration_dir = $this->config_file->getMigrationDir();\n\n $dir_contents = scandir($migration_dir);\n\n // Loop through each node in the migrations directory\n foreach ($dir_contents as $node) {\n\n // Verify the node is a file, if not, just skip it\n $is_file = is_file($migration_dir . DIRECTORY_SEPARATOR . $node);\n\n if ($is_file) {\n $migration_files[] = $node;\n }\n }\n\n return $migration_files;\n }", "private function getMigrationPath(){\n global $argv;\n if(isset($argv[2])){\n $this->files[] = [\n 'filepath' => _base_path() . '/database/migrations/', \n 'name' => $argv[2] . '.php'\n ];\n return;\n }\n foreach($this->direcory as $directory){\n $this->getMigrationPathFromDir($directory);\n }\n }", "public function isDownwards($target)\n\t{\n\t\treturn null !== $target && $this->getFilter()->compare($target, $this->getGreatestMigration()) <= 0;\n\t}", "protected function getTargetEntities()\n {\n if (null === $this->targetEntities) {\n $targetEntityClasses = $this->identifyProvider->getEventTargetEntities();\n $this->targetEntityConfigs = [];\n\n $configs = $this->configManager->getProvider('extend')->getConfigs();\n foreach ($configs as $config) {\n if ($config->is('upgradeable')\n && in_array($config->getId()->getClassName(), $targetEntityClasses)\n ) {\n $this->targetEntities[] = $config->getId()->getClassName();\n }\n }\n }\n\n return $this->targetEntities;\n }", "protected function getParameters($target)\n {\n $class = new ReflectionClass($target);\n\n if ( ! $class->hasMethod('__construct')) return [];\n\n return $class->getMethod('__construct')->getParameters();\n }", "public function getUpgradesToRun($from = null)\n {\n if (null === $from) {\n $from = $this->getDataVersion();\n }\n\n $upgrades = array();\n foreach ($this->getUpgrades() as $upgradeVersion) {\n if (version_compare($from, $upgradeVersion) >= 0) {\n continue;\n }\n $upgrades[] = $upgradeVersion;\n }\n\n return $upgrades;\n }", "public function getModulesInMigrationOrder(): array;", "public function applyMigration()\n {\n $this->createMigrationsTable();\n $applied_migrations = $this->get_applied_migrations();\n\n $files = scandir(Application::$ROOT_DIR.'/migrations');\n $to_apply_migrations = array_diff($files, $applied_migrations);\n\n $new_migrations = [];\n\n foreach ($to_apply_migrations as $migration) {\n // skip unwanted folders\n if ($migration === '.' || $migration === '..') {\n continue;\n }\n require_once Application::$ROOT_DIR.'/migrations/'.$migration;\n\n $class_name = pathinfo($migration, PATHINFO_FILENAME);\n $instance = new $class_name();\n $instance->up();\n\n $new_migrations[] = $migration;\n }\n\n if (!empty($new_migrations)) {\n $this->saveMigration($new_migrations);\n }\n else {\n echo $this->log(\"All migrations are applied\");\n }\n }", "public function canActOnTarget($action,$target) {\n // owner of target -> always yes, except for verification\n // all other situatons -> check role action targets\n // - matching globals -> yes\n // - specifics\n // + gets messy\n // - otherwise -> no\n\n if (is_string($action)) {\n global $ACTIONS;\n $action = $ACTIONS[$action];\n }\n\n // system admin -> always yes\n if ($this->flag_is_system_admin) {\n return true;\n }\n\n// util_prePrintR($action);\n// util_prePrintR($target);\n\n // owner of target -> always yes, except for verification\n if ($target->user_id == $this->user_id) {\n if ($action->name != 'verify') { return true; }\n }\n\n\n // view & list is controlled by flags on the object rather than explicit permissions / access records\n if (($action->name == 'view') || ($action->name == 'list')) {\n if (array_key_exists('flag_active',$target->fieldValues)) {\n if ($target->flag_active) {\n return true;\n }\n } elseif (array_key_exists('flag_workflow_published',$target->fieldValues)) {\n if (($target->flag_workflow_published) && (($target->flag_workflow_validated))) {\n return true;\n }\n }\n }\n\n // all other situatons -> check role action targets\n $this->cacheRoleActionTargets();\n\n // - matching globals -> yes\n $target_global_type = Role_Action_Target::getGlobalTargetTypeForObject($target);\n if (in_array($target_global_type,array_keys($this->cached_role_action_targets_hash_by_target_type_by_id))) {\n foreach ($this->cached_role_action_targets_hash_by_target_type_by_id[$target_global_type] as $glob_rat) {\n if ($glob_rat->action_id == $action->action_id) {\n return true;\n }\n }\n }\n\n// util_prePrintR($this->cached_role_action_targets_hash_by_target_type_by_id);\n\n // - specifics\n // + gets messy\n\n // if the allowed target types do not contain the specific type of the target in question, then no need to go further\n\n // get a list of all the specific ids to check. This gets a bit messy as we have to climb or include a hierarchy depending on what exactly the target is\n\n// util_prePrintR($target);\n\n $ids_to_check = array();\n\n $target_class = get_class($target);\n switch ($target_class) {\n case 'Authoritative_Plant':\n $ids_to_check = array($target->authoritative_plant_id);\n break;\n case 'Authoritative_Plant_Extra':\n // can act on this if can act on the plant\n return $this->canActOnTarget($action,$target->getAuthoritativePlant());\n break;\n case 'Metadata_Structure':\n // can edit this if can edit itself or any parent\n $ids_to_check = Db_Linked::arrayOfAttrValues($target->getLineage(),'metadata_structure_id');\n break;\n case 'Metadata_Term_Set':\n // can edit if can edit any structure that uses this term set\n $structures = Metadata_Structure::getAllFromDb(['metadata_term_set_id'=>$target->metadata_term_set_id],$this->dbConnection);\n $ids_to_check = array();\n foreach ($structures as $s) {\n $ids_to_check = array_merge($ids_to_check,Db_Linked::arrayOfAttrValues($s->getLineage(),'metadata_structure_id'));\n }\n break;\n case 'Metadata_Term_Value':\n // can edit if can edit any structure that uses the term set for which this is a value\n return $this->canActOnTarget($action,Metadata_Term_Set::getOneFromDb(['metadata_term_set_id'=>$target->metadata_term_set_id],$this->dbConnection));\n break;\n case 'Metadata_Reference':\n // can edit if can edit anything to which this refers\n return $this->canActOnTarget($action,$target->getReferrent());\n break;\n case 'Notebook':\n $ids_to_check = array($target->notebook_id);\n break;\n case 'Notebook_Page':\n // can act on if can act on the notebook that contains this page\n return $this->canActOnTarget($action,$target->getNotebook());\n break;\n case 'Notebook_Page_Field':\n // can act on if can act on the notebook that contains the notebook page that this page field\n return $this->canActOnTarget($action,$target->getNotebookPage()->getNotebook());\n break;\n case 'Specimen':\n $ids_to_check = array($target->specimen_id);\n break;\n case 'Specimen_Image':\n // can act on if can act on the specimen\n return $this->canActOnTarget($action,$target->getSpecimen());\n break;\n default:\n break;\n }\n\n// util_prePrintR($ids_to_check);\n// util_prePrintR($this->cached_role_action_targets_hash_by_target_type_by_id);\n\n $target_specific_type = Role_Action_Target::getSpecificTargetTypeForObject($target);\n if (! in_array($target_specific_type,array_keys($this->cached_role_action_targets_hash_by_target_type_by_id))) {\n return false;\n }\n\n foreach ($this->cached_role_action_targets_hash_by_target_type_by_id[$target_specific_type] as $spec_rat) {\n if (($spec_rat->action_id == $action->action_id) && (in_array($spec_rat->target_id,$ids_to_check))) {\n if ($action->name == 'view') {\n $actual_target = $spec_rat->getTargets()[0];\n if (array_key_exists('flag_workflow_published',$actual_target->fieldValues)) {\n return $actual_target->flag_workflow_published && $actual_target->flag_workflow_validated;\n }\n }\n return true;\n }\n }\n\n return false;\n }", "protected function getMigrationPaths()\n {\n // Here, we will check to see if a path option has been defined. If it has\n // we will use the path relative to the root of this installation folder\n // so that migrations may be run for any path within the applications.\n if ($this->input->hasOption('path') && $this->option('path')) {\n return [$this->laravel->basePath() . '/' . $this->option('path')];\n }\n\n return array_merge(\n [$this->getMigrationPath()], $this->migrator->paths()\n );\n }", "public function getRan()\n {\n return $this->table()\n ->where('plugin', $this->plugin)\n ->orderBy('batch', 'asc')\n ->orderBy('migration', 'asc')\n ->pluck('migration')->all();\n }", "public function up(){\n $migration_files=dirToArray($this->migrations_dir);\n if(!sizeof($migration_files)){\n die('migration does not exist');\n }\n\n //check MIGRATION_TABLE_NAME\n $this->_check_table();\n\n //check run migrations\n $migration_files=$this->_check_run_migrations($migration_files);\n\n if(sizeof($migration_files)<=0){\n die('migration file does not exist');\n }\n\n $responses = [];\n foreach($migration_files as $file){\n $responses[] = $this->_run($file,'up');\n }\n return $responses;\n }", "protected function getRan()\n {\n if ($this->migrator->repositoryExists()) {\n return $this->migrator->getRepository()->getRan();\n }\n\n return [];\n }", "protected function getMigrationClasses()\n {\n $files = glob(sprintf('%s/Migration/Attribute/*Migration.php', $this->getPath()));\n\n $migrationClasses = [];\n foreach ($files as $file) {\n $class = $this->getName() . '\\Migration\\Attribute\\\\' . basename($file, '.php');\n if (class_exists($class)) {\n $migration = new $class;\n if ($migration instanceof AbstractAttributeMigration) {\n $migrationClasses[] = $migration;\n }\n }\n }\n\n return $migrationClasses;\n }", "public function targets()\n {\n return $this->hasMany('App\\Target');\n }", "abstract public function enumAppliedMigrationSteps();", "public function getMigrations($steps)\n {\n global $wpdb;\n\n $sql = \"SELECT * FROM {$wpdb->prefix}exolnet_migration as em\n WHERE batch >= 1 ORDER BY batch DESC, migration DESC LIMIT {$steps}\";\n\n return $wpdb->get_results($sql, 'ARRAY_A');\n }", "protected function scan_zip($target) {\n return array();\n }", "public function migrations(Request $request) {\n $configuration = $this->create_migration_configuration();\n $migrations = array();\n \n foreach ($configuration->getAvailableVersions() as $order => $name) {\n $migrations[$name] = array(\n \"version\" => $name,\n \"applied\" => false,\n \"current\" => false,\n \"available\" => true,\n );\n }\n \n foreach ($configuration->getMigratedVersions() as $order => $name) {\n if (array_key_exists($name, $migrations)) {\n $migrations[$name][\"applied\"] = true;\n } else {\n $migrations[$name] = array(\n \"version\" => $name,\n \"applied\" => true,\n \"current\" => false,\n \"available\" => false,\n );\n }\n }\n \n $migrations[$configuration->getCurrentVersion()][\"current\"] = true;\n \n krsort($migrations);\n \n return $this->render(\"developer/migrations.html.twig\", array(\n \"migrations\" => $migrations\n ));\n }", "private function getRollbackList(int $batch): array\r\n {\r\n $listRs = DB::table('migrations')->select('id', 'migration')\r\n ->where('batch', $batch)\r\n ->orderBy('id', 'desc')\r\n ->get();\r\n $return = array();\r\n foreach ($listRs as $v) {\r\n $return[] = [\r\n 'id' => $v->id,\r\n 'migration' => $v->migration,\r\n ];\r\n }\r\n return $return;\r\n }", "public function getTargets()\n\t{\n\t\treturn array(self::TARGET_METHOD);\n\t}", "public static function get_table_queries_for_addons(){\n $sqls = [];\n $sqls = apply_filters('latepoint_addons_sqls', $sqls);\n return $sqls;\n }", "public function getMigratedVersions()\n {\n $this->createMigrationCollection();\n\n $cursor = $this->getCollection()->find();\n $versions = [];\n foreach ($cursor as $record) {\n $versions[] = $record['v'];\n }\n\n return $versions;\n }", "public function testFindMigrations()\n {\n $finder = new MigrationsInChangesetsFinder($this->log, '', $this->migrations_path);\n\n $this->assertFalse($finder->isValidChangesetName('2016-01-01'));\n $this->assertFalse($finder->isValidChangesetName('fix-users-table'));\n $this->assertTrue($finder->isValidChangesetName('2016-01-01-fix-users-table'));\n }", "public function needToMigrateList(): array;", "public function getCommandsToExecute()\n {\n return $this->commands()\n ->whereNull('sended_at')\n ->orderBy('created_at', 'ASC')\n ->get();\n }", "function executePhinxMigrations($command, $environment) \n{\n $path=\"../../../vendor/bin/phinx\";\n $cmd=\"$path $command -e $environment\";\n \n $outArray=array();\n $retValue='';\n \n exec($cmd,$outArray,$retValue);\n print_r($outArray);\n}", "public function run()\n {\n \n\n \\DB::table('migrations')->delete();\n \n \\DB::table('migrations')->insert(array (\n 0 => \n array (\n 'id' => 1,\n 'migration' => '2014_10_12_000000_create_users_table',\n 'batch' => 1,\n ),\n 1 => \n array (\n 'id' => 2,\n 'migration' => '2014_10_12_100000_create_password_resets_table',\n 'batch' => 1,\n ),\n 2 => \n array (\n 'id' => 3,\n 'migration' => '2019_01_29_011038_create_categories_table',\n 'batch' => 1,\n ),\n 3 => \n array (\n 'id' => 4,\n 'migration' => '2019_01_29_011130_create_items_table',\n 'batch' => 1,\n ),\n 4 => \n array (\n 'id' => 5,\n 'migration' => '2019_01_29_011207_create_requests_table',\n 'batch' => 1,\n ),\n 5 => \n array (\n 'id' => 6,\n 'migration' => '2019_01_29_011313_create_statuses_table',\n 'batch' => 1,\n ),\n 6 => \n array (\n 'id' => 7,\n 'migration' => '2019_01_29_011320_create_roles_table',\n 'batch' => 1,\n ),\n 7 => \n array (\n 'id' => 8,\n 'migration' => '2019_01_29_011330_create_userstatuses_table',\n 'batch' => 1,\n ),\n 8 => \n array (\n 'id' => 9,\n 'migration' => '2019_01_29_023302_add_roleid_userstatusid_users',\n 'batch' => 1,\n ),\n 9 => \n array (\n 'id' => 10,\n 'migration' => '2019_01_29_023330_add_categoryid_items',\n 'batch' => 1,\n ),\n 10 => \n array (\n 'id' => 11,\n 'migration' => '2019_01_29_023409_add_userid_statusid_itemid_requests',\n 'batch' => 1,\n ),\n 11 => \n array (\n 'id' => 12,\n 'migration' => '2019_01_29_042432_drop_contactnumber_users',\n 'batch' => 2,\n ),\n 12 => \n array (\n 'id' => 13,\n 'migration' => '2019_01_30_064421_add_statusid_items',\n 'batch' => 3,\n ),\n 13 => \n array (\n 'id' => 14,\n 'migration' => '2019_01_31_013147_rename_requests_to_laptoprequests',\n 'batch' => 4,\n ),\n 14 => \n array (\n 'id' => 15,\n 'migration' => '2019_01_31_014418_rename_laptoprequests',\n 'batch' => 5,\n ),\n ));\n \n \n }", "static public function depends_on()\n {\n return [\n '\\phpbb\\db\\migration\\data\\v31x\\v314',\n '\\oxcom\\phpbbch\\migrations\\add_module',\n ];\n }" ]
[ "0.6566407", "0.6549122", "0.65065175", "0.6460152", "0.6412314", "0.63901865", "0.6238462", "0.62335783", "0.6084264", "0.5982342", "0.5952659", "0.59471846", "0.58959377", "0.5857791", "0.5816764", "0.58088714", "0.57287943", "0.56991947", "0.5697555", "0.56852627", "0.5679691", "0.56749874", "0.5658907", "0.5644121", "0.5621736", "0.5595115", "0.55547714", "0.54832864", "0.5458647", "0.54172224", "0.5388424", "0.5369508", "0.534977", "0.5337273", "0.5327349", "0.5302767", "0.52873784", "0.52783597", "0.5275573", "0.52449524", "0.52267", "0.5201336", "0.5142655", "0.51268834", "0.5113044", "0.5109732", "0.5096446", "0.5081051", "0.50633276", "0.5047824", "0.5021606", "0.5012983", "0.50111216", "0.49725306", "0.49478632", "0.4940442", "0.4934446", "0.49137932", "0.4906988", "0.48940715", "0.4860199", "0.48199922", "0.48048267", "0.47975212", "0.4793538", "0.47681138", "0.47181222", "0.47035107", "0.4703297", "0.46950588", "0.46853667", "0.46679407", "0.466634", "0.46580333", "0.46438533", "0.4638014", "0.46334743", "0.46257135", "0.46252194", "0.46235675", "0.4619192", "0.46154988", "0.46093196", "0.4597032", "0.45853102", "0.45826226", "0.4580927", "0.457186", "0.45657438", "0.45581582", "0.45556033", "0.45526788", "0.4545448", "0.45437318", "0.4539676", "0.45379266", "0.45337632", "0.45327672", "0.45262015", "0.45076206" ]
0.8309574
0
Returns all the executed migrations. This acts as a proxy method to AdapterInterface::getMigrations plus the results are sorted according to the assigned filter.
public function getExecutedMigrations() { $migrations = $this->getAdapter()->getMigrations(); uksort($migrations, array($this->getFilter(), 'compare')); return $migrations; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getMigrationsToRun() : array\n {\n $allMigrations = $this->getAllMigrations();\n\n $tableExists = $this->queryBuilderFactory->make()\n ->table_exists($this->table);\n\n if (! $tableExists) {\n return $allMigrations;\n }\n\n /** @var array $runMigrations */\n $runMigrations = $this->queryBuilderFactory->make()\n ->get($this->table)\n ->result();\n\n foreach ($runMigrations as $record) {\n unset($allMigrations[$record->migration]);\n }\n\n return $allMigrations;\n }", "public function get_applied_migrations(): array\n {\n $stmt = $this->pdo->prepare(\"SELECT migration FROM migrations\");\n $stmt->execute();\n\n return $stmt->fetchAll(PDO::FETCH_COLUMN, 0);\n }", "private function getMigrations()\n\t\t{\n\t\t\tif(self::$migrations)\n\t\t\t{\n\t\t\t\treturn self::$migrations;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tforeach(\\System\\DB\\DataAdapter::create(\"adapter=dir;source=\".__MIGRATIONS_PATH__.\";\")->openDataSet()->rows as $row)\n\t\t\t\t{\n\t\t\t\t\tif(\\strpos($row[\"name\"], '.php'))\n\t\t\t\t\t{\n\t\t\t\t\t\trequire $row[\"path\"];\n\t\t\t\t\t\t$migration = \\str_replace(\".php\", \"\", $row[\"name\"]);\n\t\t\t\t\t\teval(\"\\$migration = new \\\\System\\\\Migrate\\\\{$migration}();\");\n\n\t\t\t\t\t\tself::$migrations[] = new $migration();\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$CSort = new MigrationCompare();\n\t\t\t\tusort( self::$migrations, array( &$CSort, 'compareVersion' ));\n\t\t\t\treturn self::$migrations;\n\t\t\t}\n\t\t}", "public function applied()\n {\n $migrationFiles = array();\n $sql = new Sql($this->adapter);\n $select = $sql->select();\n $select->from(self::TABLE);\n \n $selectString = $sql->getSqlStringForSqlObject($select);\n $results = $this->adapter->query($selectString, Adapter::QUERY_MODE_EXECUTE);\n \n if ($results->count() > 0) {\n foreach ($results as $migration) {\n $migrationFiles[] = $migration->migration;\n }\n }\n \n return $migrationFiles;\n }", "protected function getMigrationsToRun()\n {\n $migrations_ran = $this->getMigrationsRan();\n $migrations_in_dir = $this->getMigrationsInDir();\n\n return array_diff($migrations_in_dir, $migrations_ran);\n }", "public function getMigrationsToRun() : array\n {\n $allMigrations = $this->getAllMigrations();\n $ranMigrations = $this->getRanMigrations();\n\n return array_diff($allMigrations, $ranMigrations);\n }", "public function getMigrations()\n {\n return $this->migrations;\n }", "protected function getMigrationsRan()\n {\n // TODO: Move query to a query factory based on db_adapter\n $resource = $this->db_adapter->query(\n \"SELECT file FROM $this->migration_table\"\n );\n\n // TODO: Needs to be abstracted from this class\n $results = pg_fetch_all($resource) ?: [];\n\n // Flatten the array structure to a single dimension\n $migrations_ran = array_map(function ($result) {\n return $result['file'];\n }, $results);\n\n return $migrations_ran;\n }", "public function getMigrations();", "protected function getAllMigrationFiles()\n {\n return $this->migrator->getMigrations();\n }", "public function getMigrations(): array\n {\n $result = [];\n foreach ($this->repository->getMigrations() as $migration) {\n //Populating migration state and execution time (if any)\n $result[] = $migration->withState($this->resolveState($migration));\n }\n\n return $result;\n }", "public function get_migrations()\n\t{\n\t\tif ( ! $this->migrations)\n\t\t{\n\t\t\t$migrations = glob($this->config['path'] . DIRECTORY_SEPARATOR . '*' . EXT);\n\t\t\t$ids = array();\n\t\t\tforeach ((array) $migrations as $file)\n\t\t\t{\n\t\t\t\t$name = basename($file, EXT);\n\t\t\t\t$matches = array();\n\t\t\t\tif ( preg_match('/^(\\d+)_(\\w+)$/', $name, $matches))\n\t\t\t\t{\n\t\t\t\t\t$ids[] = intval($matches[1]);\n\t\t\t\t}\n\t\t\t}\n\t\t\t$this->migrations = $ids;\n\t\t}\n\t\treturn $this->migrations;\n\t}", "public function getMigrations(){\n $migrations[] = new migrateTable0001($this->get('db'));\n $migrations[] = new migrateTable0002($this->get('db'));\n $migrations[] = new migrateTableEvent($this->get('db'));\n $migrations[] = new migrateTableMessages($this->get('db'));\n $migrations[] = new migrateTablePerson($this->get('db'));\n $migrations[] = new migrateTable122320151845($this->get('db'));\n\n return $migrations;\n }", "public function runMigrations() : array\n {\n $migrations = $this->getMigrationsToRun();\n $ran = [];\n\n if (count($migrations) === 0) {\n return $ran;\n }\n\n /** @var string $migration */\n foreach ($migrations as $migration) {\n $this->runMigration($migration);\n $ran[] = $migration;\n }\n\n return $ran;\n }", "public function getAllMigrations() : array\n {\n $migrationFiles = $this->filesystem->getDirectoryContents(\n $this->migrationsDir\n );\n\n $allMigrations = [];\n\n foreach ($migrationFiles as $file) {\n $filePathInfo = pathinfo($file);\n $allMigrations[$filePathInfo['filename']] = $filePathInfo['filename'];\n }\n\n ksort($allMigrations);\n\n return $allMigrations;\n }", "protected function get_migration_file_list()\n\t{\n\t\tif ($this->migrations !== false)\n\t\t{\n\t\t\treturn $this->migrations;\n\t\t}\n\n\t\t// Only have the finder search in this extension path directory\n\t\t$migrations = $this->extension_finder\n\t\t\t->extension_directory('/migrations')\n\t\t\t->find_from_extension($this->extension_name, $this->extension_path);\n\n\t\t$migrations = $this->extension_finder->get_classes_from_files($migrations);\n\n\t\t$this->migrator->set_migrations($migrations);\n\n\t\t$migrations = $this->migrator->get_migrations();\n\n\t\treturn $migrations;\n\t}", "public function collectMigrations(): array;", "protected function getMigrations()\n {\n $finder = new Finder();\n $files = $finder->files()\n ->name('*table.php')\n ->notName('2014*')\n ->in(database_path() . '/migrations');\n\n foreach ($files as $file) {\n $this->migrations[] = $file->getRealPath() ;\n }\n }", "protected function getNewMigrations()\n {\n if (!$this->includeModuleMigrations) {\n return parent::getNewMigrations();\n }\n\n $this->migrationPathMap = [];\n $migrations = [];\n foreach ($this->getMigrationPaths() as $migrationPath) {\n $this->migrationPath = $migrationPath;\n $migrations = array_merge($migrations, parent::getNewMigrations());\n $this->migrationPathMap[$migrationPath] = $migrations;\n }\n\n sort($migrations);\n\n\t\treturn $migrations;\n }", "public function getRan()\n {\n global $wpdb;\n\n $sql = \"SELECT migration as name FROM {$wpdb->prefix}exolnet_migration as em\";\n\n $migrations = $wpdb->get_results($sql, 'ARRAY_A');\n\n $migrationCleaned = [];\n if (!empty($migrations) && is_array($migrations)) {\n foreach ($migrations as $migration) {\n $migrationCleaned[] = $migration['name'];\n }\n }\n\n return $migrationCleaned;\n }", "public function getMigrations()\n {\n $path = database_path(\n 'migrations' . DIRECTORY_SEPARATOR . '*.php'\n );\n\n return str_replace(\n '.php', '', glob($path)\n );\n }", "public function getActiveMigrations() {\n\t\tif (!is_array($this->activeMigrations)) {\n\t\t\t$this->activeMigrations = array();\n\t\t\t/** @var Tx_Smoothmigration_Service_RequirementsAnalyzer $requirementsAnalyzer */\n\t\t\t$requirementsAnalyzer = t3lib_div::makeInstance('Tx_Smoothmigration_Service_RequirementsAnalyzer');\n\n\t\t\tforeach ($this->registeredMigrations as $className) {\n\t\t\t\t/** @var Tx_Smoothmigration_Domain_Interface_Migration $check */\n\t\t\t\t$migration = t3lib_div::makeInstance($className);\n\t\t\t\tif ($requirementsAnalyzer->isActive($migration)) {\n\t\t\t\t\t$this->activeMigrations[] = $migration;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $this->activeMigrations;\n\t}", "protected function find_migrations()\n\t{\n\t\t// Load all *_*.php files in the migrations path\n\t\t$files = glob($this->_migration_path . '*_*.php');\n\t\t$file_count = count($files);\n\n\t\tfor ($i = 0; $i < $file_count; $i++)\n\t\t{\n\t\t\t// Mark wrongly formatted files as false for later filtering\n\t\t\t$name = basename($files[$i], '.php');\n\t\t\tif ( ! preg_match('/^\\d{3}_(\\w+)$/', $name))\n\t\t\t{\n\t\t\t\t$files[$i] = FALSE;\n\t\t\t}\n\t\t}\n\n\t\tsort($files);\n\t\treturn $files;\n\t}", "public function getAvailableMigrations($target=null)\n\t{\n\t\t// for normal migration we need all files to target\n\t\t// for rollbacks we need from target to the greatest migration\n\t\t$filter = $this->getFilter();\n\t\tif (!$this->isDownwards($target)) {\n\t\t\tif (null !== $target) {\n\t\t\t\t$filter->setToVersion($target);\n\t\t\t}\n\t\t} else {\t// rollback\n\t\t\t$filter->setFromVersion($target);\n\t\t\t$filter->setToVersion($this->getGreatestMigration());\n\t\t}\n\n\t\t$migration_steps = $this->getMigrationSteps();\n\n\t\t// migrations to be executed\n\t\t$to_execute = array();\n\t\tif ($this->isDownwards($target)) {\n\t\t\t// rollback: execute the common part of $executed and $migration_refs\n\t\t\t$executed = $this->getExecutedMigrations();\n\t\t\tforeach($migration_steps as $ref => $migration_class) {\n\t\t\t\tif (array_key_exists($ref, $executed)) {\n\t\t\t\t\t$to_execute[] = $ref;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t// migration: execute what's missing - the different of $executed and $available\n\t\t\t$to_execute = array_diff(array_keys($migration_steps), array_keys($this->getExecutedMigrations()));\n\t\t}\n\t\t\n\t\t// go through $to_execute and find the migration steps\n\t\t$migrations = array();\n\t\tforeach ($to_execute as $ref) {\n\t\t\t$migrations[$ref] = $migration_steps[$ref];\n\t\t}\n\t\t\n\t\t// sort migrations according to filter and target\n\t\t// remove one so that to avoid executing target in the case of rollback\n\t\t$this->sortMigrations($migrations, $target);\n\t\tif ($this->isDownwards($target)) {\n\t\t\tarray_pop($migrations);\n\t\t}\n\t\treturn $migrations;\n\t}", "protected function _getAvailableMigrations()\n {\n $availableMigrations = array();\n \n $files = scandir($this->_migrationsPath);\n \n foreach ($files as $filename) {\n \n if (substr($filename, -4) == '.php' && $filename != '.' && $filename != '..' && !is_dir($filename)) {\n \n $id = $this->_getMigrationIdFromFilename($filename);\n $availableMigrations[$id] = $filename;\n }\n }\n \n if (empty($availableMigrations)) {\n throw new Exception('No available migrations found');\n }\n \n return $availableMigrations;\n }", "public function pendingMigrations()\r\n\t{\r\n\t\t$outstanding = [];\r\n\t\t$this->ensureMigrationBinExist();\r\n\t\tforeach ($this->localRepository() as $file) {\r\n\t\t\t$line = $this->removeDotPhp($file);\r\n\r\n\t\t\t// Once we grab all of the migration files for the path, we will compare them\r\n\t\t\t// against the migrations that have already been run for this package then\r\n\t\t\t// run each of the outstanding migrations against a database connection.\r\n\t\t\t$result = $this->repository->getRan();\r\n\t\t\tif (!in_array($line, $result)) {\r\n\t\t\t\t$outstanding[] = $file;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn $outstanding;\r\n\t}", "public function getRan()\n {\n return $this->table()\n ->where('plugin', $this->plugin)\n ->orderBy('batch', 'asc')\n ->orderBy('migration', 'asc')\n ->pluck('migration')->all();\n }", "private function getMigrationSteps()\n\t{\n\t\t$migration_steps = array();\n\t\tforeach ($this->getFilter() as $step) {\n\t\t\t$migration_steps[$step->getReference()] = $step;\n\t\t}\n\t\t\n\t\treturn $migration_steps;\n\t}", "protected function getMigrations()\n {\n $params = [\n 'connection' => 'test',\n 'source' => 'TestsMigrations',\n ];\n $migrations = new Migrations($params);\n $adapter = $migrations\n ->getManager($this->command->getConfig())\n ->getEnvironment('default')\n ->getAdapter();\n\n while ($adapter instanceof WrapperInterface) {\n $adapter = $adapter->getAdapter();\n }\n\n $adapter->setConnection($this->pdo);\n\n return $migrations;\n }", "public function getModulesInMigrationOrder(): array;", "public function getMigrations($steps)\n {\n $query = $this->table()\n ->where('plugin', $this->plugin)\n ->where('batch', '>=', '1');\n\n return $query->orderBy('migration', 'desc')->take($steps)->get()->all();\n }", "public function getMigrationsToExecute($direction, $to)\n {\n if ('down' === $direction) {\n if (count($this->migrations)) {\n $allVersions = array_reverse(array_keys($this->migrations));\n $classes = array_reverse(array_values($this->migrations));\n $allVersions = array_combine($allVersions, $classes);\n } else {\n $allVersions = [];\n }\n } else {\n $allVersions = $this->migrations;\n }\n $versions = [];\n $migrated = $this->getMigratedVersions();\n foreach ($allVersions as $version) {\n if ($this->shouldExecuteMigration($direction, $version, $to, $migrated)) {\n $versions[$version->getVersion()] = $version;\n }\n }\n\n return $versions;\n }", "public function getMigrations($steps)\n {\n global $wpdb;\n\n $sql = \"SELECT * FROM {$wpdb->prefix}exolnet_migration as em\n WHERE batch >= 1 ORDER BY batch DESC, migration DESC LIMIT {$steps}\";\n\n return $wpdb->get_results($sql, 'ARRAY_A');\n }", "private function findComponentsWhichNeedMigrated(): array\n {\n $aModules = Components::available(false);\n $aOut = [];\n\n foreach ($aModules as $oModule) {\n $oState = $this->determineModuleState($oModule);\n if ($oState->start !== $oState->end) {\n $aOut[] = $oState;\n }\n }\n\n // Shift the app migrations onto the end so they are executed last\n if (!empty($aOut)) {\n $oFirst = reset($aOut);\n if ($oFirst->slug === Components::$sAppSlug) {\n $oApp = array_shift($aOut);\n $aOut = array_merge($aOut, [$oApp]);\n $aOut = array_filter($aOut);\n $aOut = array_values($aOut);\n }\n }\n\n return $aOut;\n }", "protected function getMigrationsInDir()\n {\n $migration_files = [];\n\n $migration_dir = $this->config_file->getMigrationDir();\n\n $dir_contents = scandir($migration_dir);\n\n // Loop through each node in the migrations directory\n foreach ($dir_contents as $node) {\n\n // Verify the node is a file, if not, just skip it\n $is_file = is_file($migration_dir . DIRECTORY_SEPARATOR . $node);\n\n if ($is_file) {\n $migration_files[] = $node;\n }\n }\n\n return $migration_files;\n }", "public function getAppliedMigrations($version = null)\n {\n $result = $this->getDBAdapter()->query(\n \"SELECT migration FROM `\" . $this->getConfig()->table . \"`\"\n );\n\n $migrations = array();\n if (($result) && ($result->rowCount() > 0)) {\n while ($value = $result->fetchColumn()) {\n $migrations[] = $value;\n }\n }\n\n if (!is_null($version)) {\n foreach ($migrations as $key => $migration) {\n if (substr($migration, 0, strlen($version)) != $version) {\n unset($migrations[$key]);\n }\n }\n }\n\n sort($migrations);\n\n return $migrations;\n }", "public function applyMigration()\n {\n $this->createMigrationsTable();\n $applied_migrations = $this->get_applied_migrations();\n\n $files = scandir(Application::$ROOT_DIR.'/migrations');\n $to_apply_migrations = array_diff($files, $applied_migrations);\n\n $new_migrations = [];\n\n foreach ($to_apply_migrations as $migration) {\n // skip unwanted folders\n if ($migration === '.' || $migration === '..') {\n continue;\n }\n require_once Application::$ROOT_DIR.'/migrations/'.$migration;\n\n $class_name = pathinfo($migration, PATHINFO_FILENAME);\n $instance = new $class_name();\n $instance->up();\n\n $new_migrations[] = $migration;\n }\n\n if (!empty($new_migrations)) {\n $this->saveMigration($new_migrations);\n }\n else {\n echo $this->log(\"All migrations are applied\");\n }\n }", "private function sortMigrations(& $migrations, $target)\n\t{\n\t\t$filter = $this->getFilter();\n\t\tif (!$this->isDownwards($target)) {\n\t\t\tuksort($migrations, array($filter, 'compare'));\n\t\t} else {\n\t\t\tuksort($migrations, function($a, $b) use ($filter) {\n\t\t\t\treturn $filter->compare($b, $a);\t// reverse arguments\n\t\t\t} );\n\t\t}\n\t\t\n\t}", "public function getAvailableVersions()\n {\n $availableVersions = [];\n foreach ($this->migrations as $migration) {\n $availableVersions[] = $migration->getVersion();\n }\n\n return $availableVersions;\n }", "public function getCommandsToExecute()\n {\n return $this->commands()\n ->whereNull('sended_at')\n ->orderBy('created_at', 'ASC')\n ->get();\n }", "public static function webMigrateAll()\n {\n ob_start();\n $controller = new self('migrate', Yii::$app);\n $controller->db = Yii::$app->db;\n $controller->interactive = false;\n $controller->includeModuleMigrations = true;\n $controller->color = false;\n $controller->runAction('up');\n\n\t\treturn ob_get_clean();\n }", "public function execute() {\n $oldMigrations = new Filesystem(\"App/system/databases/migrations\");\n $oldMigrations->addFilter(new MigrationFilter($this->model->getShortModelName()));\n\n\n //todo: write custom iterator\n $oldMigrations->customCallback([$this, \"applyOldMigrations\"]);\n //todo: get the current model and get the diffrences between that and the migration\n //todo: write a new migration.\n //\n // $this->buildChangeSet();\n //do stuff execute all the things\n $this->createNewMigration();\n\n }", "public function getMigratedVersions()\n {\n $this->createMigrationCollection();\n\n $cursor = $this->getCollection()->find();\n $versions = [];\n foreach ($cursor as $record) {\n $versions[] = $record['v'];\n }\n\n return $versions;\n }", "public function getMigrations()\n {\n return [\n CreateKeyPairTable::class,\n ];\n }", "public function up(){\n $migration_files=dirToArray($this->migrations_dir);\n if(!sizeof($migration_files)){\n die('migration does not exist');\n }\n\n //check MIGRATION_TABLE_NAME\n $this->_check_table();\n\n //check run migrations\n $migration_files=$this->_check_run_migrations($migration_files);\n\n if(sizeof($migration_files)<=0){\n die('migration file does not exist');\n }\n\n $responses = [];\n foreach($migration_files as $file){\n $responses[] = $this->_run($file,'up');\n }\n return $responses;\n }", "public function getAvailableMigrations($version = null)\n {\n if (is_null($version)) {\n $version = self::VERSION_REGEXPR;\n }\n\n $dir = PATH . '/' . $this->getConfig()->path;\n\n if (!$this->prepareDir($dir)) {\n throw new Exception ('Migrations path are invalid');\n }\n $migrations = $this->getItemsByRegEx($dir, \"/^(\" . $version . \"_\\d{8}_\\d{6}_\\d{2})_(up|down)\\.sql$/i\");\n\n sort($migrations);\n\n return $migrations;\n }", "public function getUpCandidates()\n {\n $statuses = $this->getStatuses();\n\n // search latest applied migration\n $latest = '';\n foreach ($statuses as $status) {\n if ($status->appliedAt !== \"\") {\n $latest = $status->file->getFileName();\n }\n }\n\n // make statuses without being applied\n $candidates = [];\n $isSkipped = ($latest === '')? false: true;\n foreach ($statuses as $status) {\n if (false === $isSkipped) {\n $candidates[] = $status;\n }\n if($status->file->getFileName() !== $latest) {\n continue;\n } else {\n $isSkipped = false;\n }\n }\n\n return $candidates;\n }", "public function getMigrationPaths();", "protected function getRan()\n {\n if ($this->migrator->repositoryExists()) {\n return $this->migrator->getRepository()->getRan();\n }\n\n return [];\n }", "public function migrationsToRun()\n\t{\n\t\t$manifestData = $this->_getManifestData();\n\n\t\tfor ($i = 0; $i < count($manifestData); $i++)\n\t\t{\n\t\t\t$row = explode(';', $manifestData[$i]);\n\n\t\t\t// We found a migration\n\t\t\tif (UpdateHelper::isManifestMigrationLine($row[0]) && $row[1] == PatchManifestFileAction::Add)\n\t\t\t{\n\t\t\t\tBlocks::log('Found migration file: '.$row[0], \\CLogger::LEVEL_INFO);\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}", "public function pending(): array\n {\n $migrationFileCount = (int)iterator_count(\n new FilesystemIterator(\n database_path(\"migrations\"),\n FilesystemIterator::SKIP_DOTS\n )\n );\n\n $migrationTableCount = count(\n $this->connection->select(\"SELECT id FROM migrations;\")\n );\n\n $pending = $migrationFileCount - $migrationTableCount;\n\n return [\n \"pending\" => $pending <= 0 ? 0 : $pending,\n \"total\" => $migrationFileCount,\n ];\n }", "public function migrations(Request $request) {\n $configuration = $this->create_migration_configuration();\n $migrations = array();\n \n foreach ($configuration->getAvailableVersions() as $order => $name) {\n $migrations[$name] = array(\n \"version\" => $name,\n \"applied\" => false,\n \"current\" => false,\n \"available\" => true,\n );\n }\n \n foreach ($configuration->getMigratedVersions() as $order => $name) {\n if (array_key_exists($name, $migrations)) {\n $migrations[$name][\"applied\"] = true;\n } else {\n $migrations[$name] = array(\n \"version\" => $name,\n \"applied\" => true,\n \"current\" => false,\n \"available\" => false,\n );\n }\n }\n \n $migrations[$configuration->getCurrentVersion()][\"current\"] = true;\n \n krsort($migrations);\n \n return $this->render(\"developer/migrations.html.twig\", array(\n \"migrations\" => $migrations\n ));\n }", "public function getAvailableMigration($migration)\n {\n $dir = PATH . '/' . $this->getConfig()->path;\n\n if (!$this->prepareDir($dir)) {\n throw new Exception ('Migrations path are invalid');\n }\n $migrations = $this->getItemsByRegEx($dir, \"/^(\" . $migration . \")_(up|down)\\.sql$/i\");\n\n sort($migrations);\n\n return $migrations;\n }", "public function test_get_runnable_migrations_going_down_no_target_version()\n {\n $migrator_util = new Ruckusing_Util_Migrator($this->adapter);\n $actual_down_files = $migrator_util->get_runnable_migrations($this->migrations_dirs, 'down', false);\n $this->assertEquals(array() , $actual_down_files);\n }", "public function getVersions()\n {\n $this->createIfNotExists();\n $sql = 'SELECT version FROM schema_migration ORDER BY version DESC';\n $versions = array();\n foreach ($this->connection->query($sql) as $row) {\n $versions[] = $row['version'];\n }\n\n return $versions;\n }", "public function getUpgrades()\n {\n $upgrades = $this->getData('upgrades');\n if (is_array($upgrades)) {\n return $upgrades;\n }\n\n try {\n $dir = $this->getUpgradesPath();\n if (!is_readable($dir)) {\n return array();\n }\n $dir = new DirectoryIterator($dir);\n } catch (Exception $e) {\n // module doesn't has upgrades\n return array();\n }\n\n $upgrades = array();\n foreach ($dir as $file) {\n $file = $file->getFilename();\n if (false === strstr($file, '.php')) {\n continue;\n }\n $upgrades[] = substr($file, 0, -4);\n }\n usort($upgrades, 'version_compare');\n $this->setData('upgrades', $upgrades);\n return $upgrades;\n }", "protected function getMigrationClasses()\n {\n $files = glob(sprintf('%s/Migration/Attribute/*Migration.php', $this->getPath()));\n\n $migrationClasses = [];\n foreach ($files as $file) {\n $class = $this->getName() . '\\Migration\\Attribute\\\\' . basename($file, '.php');\n if (class_exists($class)) {\n $migration = new $class;\n if ($migration instanceof AbstractAttributeMigration) {\n $migrationClasses[] = $migration;\n }\n }\n }\n\n return $migrationClasses;\n }", "public function findAllAdmin() {\n\t\t\t$result = $this->createQuery()->execute();\n\t\t\treturn $result;\n\t\t}", "public function loadMigrationFromModules()\n {\n $paths = [];\n if (!$this->modules) {\n return $paths;\n }\n $modulesCollection = collect($this->modules);\n $activeModules = $modulesCollection->get(self::MODULE_VERSION);\n\n foreach ($activeModules as $key => $moduleName) {\n $paths[] = $this->path . DIRECTORY_SEPARATOR . self::MODULE_VERSION . DIRECTORY_SEPARATOR . $moduleName . DIRECTORY_SEPARATOR . 'Database' . DIRECTORY_SEPARATOR . 'Migrations';\n }\n\n return $paths;\n }", "protected function getMigsByID() {\n\t\t$migs_applied = array();\n $cmd = 'SELECT * FROM migrations ORDER BY mig_ID ASC';\n $result = $this->mysqli->query($cmd);\n if ($result) {\n\t\t\t//var_dump($result);die();\n\t\t\twhile ($row = $result->fetch_assoc()) {\n\t\t\t\t$migs_applied[$row['mig_ID']] = $row;//['mig_UP_SCRIPT'];\n\t\t\t}\n\t\t}\n\t\treturn $migs_applied;\n\t}", "public static function get_table_queries_for_addons(){\n $sqls = [];\n $sqls = apply_filters('latepoint_addons_sqls', $sqls);\n return $sqls;\n }", "protected function getMigrationPaths()\n {\n $migrationPaths = ['base' => $this->migrationPath];\n foreach (Yii::$app->getModules() as $id => $config) {\n if (is_array($config) && isset($config['class'])) {\n $reflector = new \\ReflectionClass($config['class']);\n $path = dirname($reflector->getFileName()) . '/migrations';\n if (is_dir($path)) {\n $migrationPaths[$id] = $path;\n }\n }\n }\n\n\t\treturn $migrationPaths;\n }", "public function runAction():void{\n $currentVersion = Migration::getCurrentVersion();\n $migrations = glob($this->config->application->migrationsDir.'*.php');\n $version = count($migrations);\n if((int)$version === $currentVersion){\n Cli::error('Nothing to migrate');\n }\n for($i=($currentVersion+1); $i<=$version; $i++){\n $class= \"MigrationVersion\".$i; \n $migration = new $class();\n $this->executeQueries($migration->up());\n\n Migration::setCurrentVersion($i);\n }\n }", "protected function getMigrationPaths()\n {\n // Here, we will check to see if a path option has been defined. If it has we will\n // use the path relative to the root of the installation folder so our database\n // migrations may be run for any customized path from within the application.\n if ($this->hasOption('path') && $this->option('path')) {\n return collect($this->option('path'))->map(function ($path) {\n return ! $this->usingRealPath()\n ? ROOT_PATH.'/'.$path\n : $path;\n })->all();\n }\n return array_merge(\n $this->migrator->paths(), [$this->getMigrationPath()]\n );\n }", "public function runDatabaseMigrations()\n {\n $this->parentRunDatabaseMigrations();\n\n $this->artisan('cms:migrate');\n\n $this->beforeApplicationDestroyed(function () {\n $this->artisan('cms:migrate:rollback');\n });\n }", "public function test_get_runnable_migrations_going_up_no_target_version()\n {\n $migrator_util = new Ruckusing_Util_Migrator($this->adapter);\n $actual_up_files = $migrator_util->get_runnable_migrations($this->migrations_dirs, 'up', false);\n $expect_up_files = array(\n array(\n 'version' => 1,\n 'class' => 'CreateUsers',\n 'file' => '001_CreateUsers.php',\n 'module' => 'default'\n ),\n array(\n 'version' => 3,\n 'class' => 'AddIndexToBlogs',\n 'file' => '003_AddIndexToBlogs.php',\n 'module' => 'default'\n ),\n array(\n 'version' => '20090122193325',\n 'class' => 'AddNewTable',\n 'file' => '20090122193325_AddNewTable.php',\n 'module' => 'default'\n )\n );\n $this->assertEquals($expect_up_files, $actual_up_files);\n }", "public function getMigrationData()\n {\n return [\n 'name' => $this->name,\n 'type' => $this->type,\n 'arguments' => $this->prepareArguments(),\n 'options' => array_except($this->options, $this->excludedOptionsForMigration()),\n ];\n }", "public function runMigrations()\n {\n if (file_exists($this->baseSqlite())) {\n return;\n }\n\n config(['database.connections.sqlite.database' => $this->copySqlite()]);\n if (method_exists($this, 'withoutMockingConsoleOutput')) {\n $this->withoutMockingConsoleOutput()->artisan('migrate');\n } else {\n Artisan::call('migrate');\n }\n\n // Run Seeders\n copy($this->copySqlite(), $this->baseSqlite());\n return;\n }", "public function getSnapshots()\n {\n $dir = PATH . '/' . $this->getConfig()->path;\n\n if (!$this->prepareDir($dir)) {\n throw new Exception ('Migrations path are invalid');\n }\n\n $snapshots = $this->getItemsByRegEx($dir, \"/^(\\d{8}_\\d{6}_\\d{2})_snapshot\\.sql$/i\");\n\n sort($snapshots);\n\n return $snapshots;\n }", "public function execute(): array\n {\n return $this->repository->findAll();\n }", "protected function getMigrationPaths()\n {\n // use the path relative to the root of the installation folder so our database\n // migrations may be run for any customized path from within the application.\n if ($this->input->hasOption('path') && $this->option('path')) {\n return ws_collect($this->option('path'))->map(function ($path) {\n return !$this->usingRealPath()\n ? $this->laravel->basePath() . '/' . $path\n : $path;\n })->all();\n }\n\n return array_merge(\n $this->migrator->paths(), [$this->getMigrationPath()]\n );\n }", "protected function registerMigrations()\n {\n if (Sanctum::shouldRunMigrations()) {\n return $this->loadMigrationsFrom(__DIR__.'/../database/migrations');\n }\n }", "public function getMigrations($path)\n {\n $filenames = [];\n $migrations = [];\n\n $limits = [ 'sequential' => 3, 'timestamp' => 14 ];\n $type = $this->getMigrationType();\n\n // Searches a listing of migration files and sorts them after\n $directory = new \\RecursiveDirectoryIterator($path, \\FilesystemIterator::SKIP_DOTS);\n $iterator = new \\RecursiveIteratorIterator($directory, \\RecursiveIteratorIterator::SELF_FIRST);\n\n foreach ($iterator as $path) {\n array_push($filenames, str_replace('.php', '', $path->getFilename()));\n array_push($migrations, substr($path->getFilename(), 0, $limits[$type]));\n }\n\n sort($filenames);\n sort($migrations);\n\n return [ $filenames, $migrations ];\n }", "protected function getDatabaseDifferences() {}", "function sortedFilesIndexed($mig_dir) {\n // Prepare a sorted list of up and down migrations scripts.\n $mig_files = glob($mig_dir.'*.{sql}', GLOB_BRACE);\n $mig_indexed = array();\n foreach ($mig_files as $idx=>$filename) {\n $timestamp = $this->getTS($filename);\n if ($timestamp) {\n $mig_indexed[$timestamp] = $filename;\n }\n }\n\t\tasort($mig_indexed, SORT_NUMERIC);\n return $mig_indexed;\n }", "public function runPending()\r\n\t{\r\n\t\t$response = \"\";\r\n\t\t$response .= $this->ensureRepositoryExist();\r\n\t\t$migration_batch = $this->repository->getNextBatchNumber();\r\n\t\t$pending_migrations = $this->pendingMigrations();\r\n\t\tif (count($pending_migrations) > 0) {\r\n\t\t\tforeach ($pending_migrations as $file) {\r\n\t\t\t\t$migration_name = $this->removeDotPhp($file);\r\n\t\t\t\t$schema = $this->runUp($file);\r\n\t\t\t\tif ($schema != \"\") {\r\n\t\t\t\t\t$query_response = DB()->query($schema);\r\n\t\t\t\t\tif ($query_response) {\r\n\r\n\t\t\t\t\t\t// Once we have run a migrations file, we will log that it was run in this\r\n\t\t\t\t\t\t// repository so that we don't try to run it next time we do a migration\r\n\t\t\t\t\t\t// in the application. A migration repository keeps the migrate order.\r\n\t\t\t\t\t\t$this->repository->log($migration_name, $migration_batch);\r\n\t\t\t\t\t\t$response .= nl2br(\"Migrated: $migration_name\\n\");\r\n\t\t\t\t\t} else {\r\n\r\n\t\t\t\t\t\t// if the schema failed to execute against the database\r\n\t\t\t\t\t\t$response .= nl2br(\"Failed: $migration_name\\n\");\r\n\t\t\t\t\t\t$response .= nl2br(\"-- $query_response[error]\\n\");\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\r\n\t\t\t\t\t// if the migrations file has nothing\r\n\t\t\t\t\t$response .= nl2br(\"Empty: $migration_name\\n\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} else {\r\n\r\n\t\t\t// if we have no outstanding migrations to migrate\r\n\t\t\t$response .= nl2br(\"Nothing to migrate\\n\");\r\n\t\t}\r\n\r\n\t\treturn $response;\r\n\t}", "public function findAll()\n {\n return DatabaseBackup::where('status', 1)\n ->where('user_id', Auth::user()->id)\n ->orderBy('id','desc')\n ->get();\n }", "protected function getMigrationPaths(): array\n {\n // Here, we will check to see if a path option has been defined. If it has we will\n // use the path relative to the root of the installation folder so our database\n // migrations may be run for any customized path from within the application.\n\n $path = CommandManager::getInstance()->getOpt('path', false);\n if ($path) {\n $collect = new Collection($path);\n return $collect->map(function ($path) {\n return ! $this->usingRealPath()\n ? EASYSWOOLE_ROOT . DIRECTORY_SEPARATOR . $path\n : $path;\n })->all();\n }\n\n return array_merge(\n $this->migrator->paths(),\n [$this->getMigrationPath()]\n );\n }", "private function getMigrationPath(){\n global $argv;\n if(isset($argv[2])){\n $this->files[] = [\n 'filepath' => _base_path() . '/database/migrations/', \n 'name' => $argv[2] . '.php'\n ];\n return;\n }\n foreach($this->direcory as $directory){\n $this->getMigrationPathFromDir($directory);\n }\n }", "function runUp()\n{\n $files = scandir(LIB_ROOT . '/migrations');\n\n $db_migration_version = get_current_migration_version();\n\n $migrations = array();\n\n foreach($files as $file)\n {\n if(preg_match('/migration_([1-9][0-9]*)\\.php/i', $file, $matches))\n {\n $migration_version = $matches[1];\n\n // we only care about this migration if it has not been performed yet\n if($migration_version > $db_migration_version)\n {\n require_once LIB_ROOT . '/migrations/' . $matches[0];\n\n $migrations[$migration_version] = 'Migration_' . $migration_version;\n }\n }\n }\n\n if(count($migrations) == 0)\n echo 'There are no migrations to run; DB is already up to date (at version ' . $db_migration_version . ').' . \"\\n\\n\";\n else\n {\n // sort migrations, so that we execute them in ascending order\n ksort($migrations);\n\n $count = 0;\n\n foreach ($migrations as $id => $class_name)\n {\n $migrationClass = new $class_name();\n\n $count++;\n\n echo 'Running migration ' . $id . ' (' . $count . ' of ' . count($migrations) . ')...' . \"\\n\";\n\n try\n {\n $migrationClass->Up();\n fetch_none('UPDATE migration_version SET version=' . quote_smart($id));\n echo ' done!' . \"\\n\";\n }\n catch(Exception $e)\n {\n echo ' Encountered an exception during migration:' . \"\\n\";\n echo ' ' . $e->getMessage() . \"\\n\";\n echo ' Migration was not completed; the database may be left in a weird state.' . \"\\n\";\n if($count < count($migrations))\n {\n $remaining = (count($migrations) - $count);\n echo $remaining . ' remaining migration' . ($remaining == 1 ? '' : 's') . ' will not be run.' . \"\\n\";\n }\n echo \"\\n\";\n die();\n }\n }\n\n echo 'All done!' . \"\\n\\n\";\n }\n}", "public function run()\n {\n \n\n \\DB::table('migrations')->delete();\n \n \\DB::table('migrations')->insert(array (\n 0 => \n array (\n 'id' => 1,\n 'migration' => '2014_10_12_000000_create_users_table',\n 'batch' => 1,\n ),\n 1 => \n array (\n 'id' => 2,\n 'migration' => '2014_10_12_100000_create_password_resets_table',\n 'batch' => 1,\n ),\n 2 => \n array (\n 'id' => 3,\n 'migration' => '2019_01_29_011038_create_categories_table',\n 'batch' => 1,\n ),\n 3 => \n array (\n 'id' => 4,\n 'migration' => '2019_01_29_011130_create_items_table',\n 'batch' => 1,\n ),\n 4 => \n array (\n 'id' => 5,\n 'migration' => '2019_01_29_011207_create_requests_table',\n 'batch' => 1,\n ),\n 5 => \n array (\n 'id' => 6,\n 'migration' => '2019_01_29_011313_create_statuses_table',\n 'batch' => 1,\n ),\n 6 => \n array (\n 'id' => 7,\n 'migration' => '2019_01_29_011320_create_roles_table',\n 'batch' => 1,\n ),\n 7 => \n array (\n 'id' => 8,\n 'migration' => '2019_01_29_011330_create_userstatuses_table',\n 'batch' => 1,\n ),\n 8 => \n array (\n 'id' => 9,\n 'migration' => '2019_01_29_023302_add_roleid_userstatusid_users',\n 'batch' => 1,\n ),\n 9 => \n array (\n 'id' => 10,\n 'migration' => '2019_01_29_023330_add_categoryid_items',\n 'batch' => 1,\n ),\n 10 => \n array (\n 'id' => 11,\n 'migration' => '2019_01_29_023409_add_userid_statusid_itemid_requests',\n 'batch' => 1,\n ),\n 11 => \n array (\n 'id' => 12,\n 'migration' => '2019_01_29_042432_drop_contactnumber_users',\n 'batch' => 2,\n ),\n 12 => \n array (\n 'id' => 13,\n 'migration' => '2019_01_30_064421_add_statusid_items',\n 'batch' => 3,\n ),\n 13 => \n array (\n 'id' => 14,\n 'migration' => '2019_01_31_013147_rename_requests_to_laptoprequests',\n 'batch' => 4,\n ),\n 14 => \n array (\n 'id' => 15,\n 'migration' => '2019_01_31_014418_rename_laptoprequests',\n 'batch' => 5,\n ),\n ));\n \n \n }", "private function doMigration($migrations, $direction)\n\t{\n\t\t$methods = array(\n\t\t\tAdapterInterface::UP => array('up', 'addMigration'),\n\t\t\tAdapterInterface::DOWN => array('down', 'removeMigration'),\n\t\t);\n\t\t\n\t\t$results = array();\n\t\tforeach($migrations as $ref => $migration) {\n\t\t\tlist($migration_method, $adapter_method) = $methods[$direction];\n\t\t\t\n\t\t\t// assign helpers to instance\n\t\t\t$impl = $migration->getImplementation();\n\t\t\tforeach( get_class_methods($impl) as $method ) {\n\t\t\t\t// get only setters\n\t\t\t\tif ('set' !== substr($method, 0, 3)) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// a quick and dirty way to find the helper method\n\t\t\t\t// need to take care CamelCase methods\n\t\t\t\t$helper_name = strtolower(substr($method, 3));\n\t\t\t\t$helper = $this->getHelper($helper_name);\n\t\t\t\tif (!is_bool($helper)) {\n\t\t\t\t\tcall_user_func(array($impl, $method), $helper);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// call up or down method\n\t\t\t$results[] = call_user_func(array($migration, $migration_method));\n\t\t\tcall_user_func(array($this->getAdapter(), $adapter_method), $impl, $ref);\n\t\t}\n\t\t\n\t\treturn $results;\n\t}", "public function run()\n {\n \n\n \\DB::table('migrations')->delete();\n \n \\DB::table('migrations')->insert(array (\n 0 => \n array (\n 'id' => 1,\n 'migration' => '2019_03_13_181656_create_categories_table',\n 'batch' => 1,\n ),\n 1 => \n array (\n 'id' => 2,\n 'migration' => '2019_03_13_181656_create_failed_jobs_table',\n 'batch' => 1,\n ),\n 2 => \n array (\n 'id' => 3,\n 'migration' => '2019_03_13_181656_create_links_table',\n 'batch' => 1,\n ),\n 3 => \n array (\n 'id' => 4,\n 'migration' => '2019_03_13_181656_create_model_has_permissions_table',\n 'batch' => 1,\n ),\n 4 => \n array (\n 'id' => 5,\n 'migration' => '2019_03_13_181656_create_model_has_roles_table',\n 'batch' => 1,\n ),\n 5 => \n array (\n 'id' => 6,\n 'migration' => '2019_03_13_181656_create_notifications_table',\n 'batch' => 1,\n ),\n 6 => \n array (\n 'id' => 7,\n 'migration' => '2019_03_13_181656_create_password_resets_table',\n 'batch' => 1,\n ),\n 7 => \n array (\n 'id' => 8,\n 'migration' => '2019_03_13_181656_create_permissions_table',\n 'batch' => 1,\n ),\n 8 => \n array (\n 'id' => 9,\n 'migration' => '2019_03_13_181656_create_replies_table',\n 'batch' => 1,\n ),\n 9 => \n array (\n 'id' => 10,\n 'migration' => '2019_03_13_181656_create_role_has_permissions_table',\n 'batch' => 1,\n ),\n 10 => \n array (\n 'id' => 11,\n 'migration' => '2019_03_13_181656_create_roles_table',\n 'batch' => 1,\n ),\n 11 => \n array (\n 'id' => 12,\n 'migration' => '2019_03_13_181656_create_topics_table',\n 'batch' => 1,\n ),\n 12 => \n array (\n 'id' => 13,\n 'migration' => '2019_03_13_181656_create_users_table',\n 'batch' => 1,\n ),\n 13 => \n array (\n 'id' => 14,\n 'migration' => '2019_03_13_181657_add_foreign_keys_to_model_has_permissions_table',\n 'batch' => 1,\n ),\n 14 => \n array (\n 'id' => 15,\n 'migration' => '2019_03_13_181657_add_foreign_keys_to_model_has_roles_table',\n 'batch' => 1,\n ),\n 15 => \n array (\n 'id' => 16,\n 'migration' => '2019_03_13_181657_add_foreign_keys_to_replies_table',\n 'batch' => 1,\n ),\n 16 => \n array (\n 'id' => 17,\n 'migration' => '2019_03_13_181657_add_foreign_keys_to_role_has_permissions_table',\n 'batch' => 1,\n ),\n 17 => \n array (\n 'id' => 18,\n 'migration' => '2019_03_13_181657_add_foreign_keys_to_topics_table',\n 'batch' => 1,\n ),\n ));\n \n \n }", "public function doMigrations() {\n\t\t$tbl = $this->tableManager->doMigrations();\n\t\t$fld = $this->fieldManager->doMigrations();\n\t\t$axs = $this->accessManager->doMigrations();\n\t\treturn $tbl && $fld && $axs;\n\t}", "public function test_get_runnable_migrations_going_up_with_target_version_with_current()\n {\n $migrator_util = new Ruckusing_Util_Migrator($this->adapter);\n //pretend we already executed version 1\n $this->insert_dummy_version_data(array(1));\n $actual_up_files = $migrator_util->get_runnable_migrations($this->migrations_dirs, 'up', 3, false);\n $expect_up_files = array(\n array(\n 'version' => 3,\n 'class' => 'AddIndexToBlogs',\n 'file' => '003_AddIndexToBlogs.php',\n 'module' => 'default'\n )\n );\n $this->assertEquals($expect_up_files, $actual_up_files);\n $this->clear_dummy_data();\n\n //now pre-register some migrations that we have already executed\n $this->insert_dummy_version_data(array(1, 3));\n $actual_up_files = $migrator_util->get_runnable_migrations($this->migrations_dirs, 'up', 3, false);\n $this->assertEquals(array(), $actual_up_files);\n }", "public function supportsMigrations();", "public function runDatabaseMigrations()\n {\n $this->artisan('migrate:fresh', $this->migrateFreshUsing());\n\n $this->app[Kernel::class]->setArtisan(null);\n\n $this->beforeApplicationDestroyed(function () {\n $this->artisan('migrate:rollback');\n\n RefreshDatabaseState::$migrated = false;\n });\n }", "private function _populateMigrationTable()\n\t{\n\t\t$migrations = array();\n\n\t\t// Add the base one.\n\t\t$migration = new MigrationRecord();\n\t\t$migration->version = craft()->migrations->getBaseMigration();\n\t\t$migration->applyTime = DateTimeHelper::currentUTCDateTime();\n\t\t$migrations[] = $migration;\n\n\t\t$migrationsFolder = craft()->path->getAppPath().'migrations/';\n\t\t$migrationFiles = IOHelper::getFolderContents($migrationsFolder, false, \"(m(\\d{6}_\\d{6})_.*?)\\.php\");\n\n\t\tif ($migrationFiles)\n\t\t{\n\t\t\tforeach ($migrationFiles as $file)\n\t\t\t{\n\t\t\t\tif (IOHelper::fileExists($file))\n\t\t\t\t{\n\t\t\t\t\t$migration = new MigrationRecord();\n\t\t\t\t\t$migration->version = IOHelper::getFileName($file, false);\n\t\t\t\t\t$migration->applyTime = DateTimeHelper::currentUTCDateTime();\n\n\t\t\t\t\t$migrations[] = $migration;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tforeach ($migrations as $migration)\n\t\t\t{\n\t\t\t\tif (!$migration->save())\n\t\t\t\t{\n\t\t\t\t\tCraft::log('Could not populate the migration table.', LogLevel::Error);\n\t\t\t\t\tthrow new Exception(Craft::t('There was a problem saving to the migrations table: ').$this->_getFlattenedErrors($migration->getErrors()));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tCraft::log('Migration table populated successfully.');\n\t}", "public function migrationsNeeded() {\n\t\treturn $this->tableManager->migrationsNeeded() || $this->fieldManager->migrationsNeeded() || $this->accessManager->migrationsNeeded();\n\t}", "public function runDatabaseMigrations()\n {\n if (!$this->runMigrations) {\n return;\n }\n\n $this->artisan('migrate:fresh');\n\n $this->app[Kernel::class]->setArtisan(null);\n\n $this->beforeApplicationDestroyed(function () {\n $this->artisan('migrate:rollback');\n });\n }", "public function test_get_runnable_migrations_going_up_with_target_version_no_current()\n {\n $migrator_util = new Ruckusing_Util_Migrator($this->adapter);\n $actual_up_files = $migrator_util->get_runnable_migrations($this->migrations_dirs, 'up', 3, false);\n $expect_up_files = array(\n array(\n 'version' => 1,\n 'class' => 'CreateUsers',\n 'file' => '001_CreateUsers.php',\n 'module' => 'default'\n ),\n array(\n 'version' => 3,\n 'class' => 'AddIndexToBlogs',\n 'file' => '003_AddIndexToBlogs.php',\n 'module' => 'default'\n )\n );\n $this->assertEquals($expect_up_files, $actual_up_files);\n }", "public function run(){\n return Artisan::call('migrate');\n }", "private function saveHistory()\n {\n ksort($this->migrations);\n foreach ($this->migrations as $k => $migration) {\n if ($migration['id'] === 0) {\n // new\n $prep = $this->db->prepare(\"INSERT INTO `{$this->table}` (`created_at`,`name`,`author`,`status`) \"\n . \"VALUES (:time, :name, :author, :status)\");\n $prep->execute([\n ':time' => $migration['time'],\n ':name' => $migration['name'],\n ':author' => $migration['author'],\n ':status' => $migration['status'],\n ]);\n // get inserted id\n $sth = $this->db->query('SELECT LAST_INSERT_ID()');\n $newId = $sth->fetchColumn();\n $this->migrations[$k]['id'] = $newId;\n } else if ($migration['id'] === -100) {\n // delete\n $prep = $this->db->prepare(\"DELETE FROM `{$this->table}` WHERE `id` = :id\");\n $prep->execute([':id' => $migration['id']]);\n } else {\n // update\n $prep = $this->db->prepare(\"UPDATE `{$this->table}` SET `status` = :status WHERE `id` = :id\");\n $prep->execute([':id' => $migration['id'], ':status' => $migration['status']]);\n }\n }\n }", "public function migrate()\n\t{\n\t\treturn $this->getAdapter()->migrate($this->getTable(), $this->fields);\n\t}", "public function getAll()\n {\n return $this->prepare(DB::findAll($this->table));\n }", "protected function reset_migrations($slug)\n\t{\n\t\t// Start the extension so we can find it's bundle path\n\t\t$this->start($slug);\n\t\t$extension = $this->get($slug);\n\n\t\t$files = glob(Bundle::path($slug).'migrations'.DS.'*_*'.EXT);\n\n\t\t// When open_basedir is enabled, glob will return false on an\n\t\t// empty directory, so we will return an empty array in this\n\t\t// case so the application doesn't bomb out.\n\t\tif ($files === false)\n\t\t{\n\t\t\treturn array();\n\t\t}\n\n\t\t// Once we have the array of files in the migration directory,\n\t\t// we'll take the basename of the file and remove the PHP file\n\t\t// extension, which isn't needed.\n\t\tforeach ($files as &$file)\n\t\t{\n\t\t\t$file = str_replace(EXT, '', basename($file));\n\t\t}\n\n\t\t// We'll also sort the files so that the earlier migrations\n\t\t// will be at the front of the array and will be resolved\n\t\t// first by this class' resolve method.\n\t\tsort($files);\n\n\t\t// Now reverse our sort - migrating down\n\t\t$files = array_reverse($files);\n\n\t\t// Loop through files\n\t\tforeach ($files as $file)\n\t\t{\n\t\t\trequire_once Bundle::path($slug).'migrations'.DS.$file.EXT;\n\n\t\t\t// Since the migration name will begin with the numeric ID, we'll\n\t\t\t// slice off the ID so we are left with the migration class name.\n\t\t\t// The IDs are for sorting when resolving outstanding migrations.\n\t\t\t//\n\t\t\t// Migrations that exist within bundles other than the default\n\t\t\t// will be prefixed with the bundle name to avoid any possible\n\t\t\t// naming collisions with other bundle's migrations.\n\t\t\t$prefix = Bundle::class_prefix($slug);\n\n\t\t\t$class = $prefix.\\Laravel\\Str::classify(substr($file, 18));\n\n\t\t\t$migration = new $class;\n\n\t\t\t// Run down the migration\n\t\t\t$migration->down();\n\t\t}\n\n\t\t// Remove the entry from the migrations table\n\t\tDB::table('laravel_migrations')\n\t\t ->where('bundle', '=', $slug)\n\t\t ->delete();\n\n\t\treturn $this;\n\t}", "protected function generate_migrations( DI_Container $container ): array {\n\t\t$migrations = array();\n\t\tforeach ( $this->migrations as $migration ) {\n\t\t\tif ( is_string( $migration ) ) {\n\t\t\t\ttry {\n\t\t\t\t\t$instance = $container->create( $migration );\n\t\t\t\t} catch ( \\Throwable $th ) {\n\t\t\t\t\tthrow Migration_Exception::failed_to_construct_migration( $migration );\n\t\t\t\t}\n\n\t\t\t\t// Add to the list if valid.\n\t\t\t\tif ( ! is_object( $instance ) || ! is_a( $instance, Migration::class ) ) {\n\t\t\t\t\tthrow Migration_Exception::failed_to_construct_migration( $migration );\n\t\t\t\t}\n\n\t\t\t\t$migrations[] = $instance;\n\t\t\t}\n\t\t}\n\t\treturn $migrations;\n\t}", "public function deployments()\n {\n return $this->belongsToMany(Deployment::class)\n ->orderBy('id', 'DESC');\n }", "public function getBackupsList() {\n $config = $this->getConfig();\n $pattern = '/(backup_([0-9_-]*)_id([0-9]+))\\.(zip|sql)/ui';\n $backups = array();\n\n $dir = @scandir($config['warehouse']);\n\n if (!is_array($dir) || empty($dir)) {\n return array();\n }\n\n foreach ($dir as $file) {\n $backupInfo = $this->getBackupInfoByFilename($file);\n\n if (!empty($backupInfo)) {\n\n $backups[$backupInfo['id']]['ftp'][strtolower($backupInfo['ext'])] = array(\n 'id' => $backupInfo['id'],\n 'name' => $backupInfo['name'],\n 'raw' => $backupInfo['raw'],\n 'ext' => $backupInfo['ext'],\n 'date' => $backupInfo['date'],\n 'time' => $backupInfo['time'],\n );\n }\n }\n krsort($backups);\n return $backups;\n }", "public function migrations()\n {\n $this->loadMigrationsFrom(__DIR__.'/Database/Migrations');\n\n $this->publishes([\n __DIR__.'/Database/Migrations/' => database_path('migrations')\n ], $this->packageName.'-migrations');\n }" ]
[ "0.74191535", "0.71839124", "0.7168735", "0.71103656", "0.71043146", "0.70602465", "0.70244503", "0.69008493", "0.6890514", "0.6830789", "0.6803787", "0.67936563", "0.67870224", "0.67685294", "0.6757025", "0.6620823", "0.66137254", "0.6528872", "0.6486937", "0.64458954", "0.6435156", "0.6427179", "0.64236087", "0.63334924", "0.6206203", "0.6162733", "0.6162011", "0.61016816", "0.60197693", "0.5918047", "0.58728254", "0.58542687", "0.577825", "0.5776427", "0.57431686", "0.5616776", "0.55761397", "0.55742097", "0.55695903", "0.55427396", "0.5500487", "0.5488333", "0.5478014", "0.54580545", "0.5449383", "0.5442996", "0.53357744", "0.5302697", "0.5287785", "0.52872074", "0.5264875", "0.52642137", "0.52599996", "0.525475", "0.5190925", "0.5190333", "0.5181351", "0.51745707", "0.5165831", "0.5150039", "0.5136412", "0.5112547", "0.5074341", "0.50440776", "0.5039359", "0.5019205", "0.501502", "0.500363", "0.49848905", "0.4976477", "0.4954496", "0.49309567", "0.49251068", "0.49229917", "0.4910612", "0.4910131", "0.49057332", "0.489255", "0.48878747", "0.48825908", "0.48821414", "0.48774126", "0.4874085", "0.48692116", "0.48552373", "0.4846662", "0.48431706", "0.48391384", "0.48263204", "0.4823879", "0.4814153", "0.47941485", "0.4792948", "0.47835338", "0.47671953", "0.47549108", "0.47475192", "0.4745995", "0.47386816", "0.473823" ]
0.85546994
0
Returns the reference number of the greatest migration
public function getGreatestMigration() { return (string) end(array_keys($this->getExecutedMigrations())); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getLastBatchNumber()\n {\n global $wpdb;\n\n $max = $wpdb->get_results(\n \"SELECT MAX(`batch`) as max FROM {$wpdb->prefix}exolnet_migration as em\",\n 'ARRAY_A'\n );\n\n return absint($max[0]['max']) ?? 0;\n }", "private function getMaxAvailableVersion()\n {\n echo \"Getting the max available version: \";\n\n $maxAvailableVersion = 0;\n\n foreach ($this->getDeltas() as $deltaNum => $delta) {\n if ($maxAvailableVersion < $deltaNum) {\n $maxAvailableVersion = $deltaNum;\n }\n }\n\n echo \"$maxAvailableVersion.\\n\";\n\n return $maxAvailableVersion;\n }", "public function maxSortingNumber(){\n $result = $this->repo->maxSortingNumber();\n return $result;\n }", "public function getLatestVersion()\n {\n $versions = array_keys($this->migrations);\n $latest = end($versions);\n\n return false !== $latest ? (string) $latest : '0';\n }", "public function latest()\n\t{\n\t\tif ( ! $migrations = $this->find_migrations())\n\t\t{\n\t\t\t$this->_error_string = $this->lang->line('migration_none_found');\n\t\t\treturn false;\n\t\t}\n\n\t\t$last_migration = basename(end($migrations));\n\n\t\t// Calculate the last migration step from existing migration\n\t\t// filenames and procceed to the standard version migration\n\t\treturn $this->version((int) substr($last_migration, 0, 3));\n\t}", "protected function _getMax(): int\n {\n $field = $this->_config['right'];\n $rightField = $this->_config['rightField'];\n $edge = $this->_scope($this->_table->find())\n ->select([$field])\n ->orderByDesc($rightField)\n ->first();\n\n if ($edge === null || empty($edge[$field])) {\n return 0;\n }\n\n return $edge[$field];\n }", "function hpm_last_mutation_id () {\n\n global $wpdb;\n $table = $wpdb->prefix . 'hpm_mutations';\n $result = $wpdb->get_var( \"SELECT id FROM $table ORDER BY id DESC LIMIT 1\" );\n return (int) $result;\n\n}", "public function getReferenceNum()\n {\n return $this->referenceNum;\n }", "function cek_rev_lhp($id_p2hp) {\n $sql = \"SELECT max(rev_ke) as no_rev FROM rev_lhp WHERE rev_fk_p2hp='$id_p2hp'\";\n $row = $this->db->query($sql)->row();\n $max_no = $row->no_rev + 1;\n return $max_no;\n }", "public function getLast()\n {\n global $wpdb;\n\n $sql = \"SELECT * FROM {$wpdb->prefix}exolnet_migration as em\n WHERE batch = {$this->getLastBatchNumber()} ORDER BY migration DESC\";\n\n return $wpdb->get_results($sql, 'ARRAY_A');\n }", "public function getNextRevDocNumber(){\n $lastDoc = File::orderBy('id', 'desc')->first();\n\n /*\n In a case where no record is found get 1 as a\n virtual record to generate document number.\n */\n if(is_null($lastDoc)){\n /*\n create an object counter (number) to store document ID and\n initialiaze it to 1.\n */\n $id = File::find(1);\n $number = $id;\n\n //assign and add the number with Doc ID\n $number += File::find(1);\n\n /*\n concatenate BRS-DFT- with the last inserted Doc ID\n that will end with 3 numbers.\n */\n\n return 'BRS-DFT-' . sprintf('%03d', intval($number) + 1);\n\n }else{\n /*\n The document exists then\n create variable number to store document ID\n initialiaze it to 0.\n */\n $number = 0;\n\n //assign and add the number with Doc ID\n $number += $lastDoc->id;\n\n /*\n concatenate BRS-DFT- with the last inserted Doc ID\n that will end with 3 numbers.\n */\n return 'BRS-DFT-' . sprintf('%03d', intval($number) + 1);\n }\n\n }", "public function getLastCol() : int\n {\n\n // Convert A1:D3 to D3.\n list(,$endRef) = explode(':', $this->getTableNode()->getAttribute('ref'));\n\n // Convert D3 to 4.\n $endCol = preg_replace('/([0-9])/', '', $endRef);\n\n return XlsxTools::convRefToNumber($endCol);\n }", "public function getNextNumMvt($mode = '')\n\t{\n\t\tglobal $conf;\n\n\t\t$sql = \"SELECT MAX(piece_num)+1 as max FROM \" . MAIN_DB_PREFIX . $this->table_element.$mode;\n\t\t$sql .= \" WHERE entity IN (\" . getEntity('accountancy') . \")\";\n\n\t\tdol_syslog(get_class($this) . \"getNextNumMvt sql=\" . $sql, LOG_DEBUG);\n\t\t$result = $this->db->query($sql);\n\n\t\tif ($result) {\n\t\t\t$obj = $this->db->fetch_object($result);\n\t\t\tif ($obj) $result = $obj->max;\n\t\t\tif (empty($result)) $result = 1;\n\t\t\treturn $result;\n\t\t} else {\n\t\t\t$this->error = \"Error \" . $this->db->lasterror();\n\t\t\tdol_syslog(get_class($this) . \"::getNextNumMvt \" . $this->error, LOG_ERR);\n\t\t\treturn - 1;\n\t\t}\n\t}", "function get_version_max() {\n return $this->version_max;\n }", "public function max_id()\n\t{\n\t\t$this->db->select_max('id');\n\t\t$query = $this->db->get($this->_tables['fuel_navigation']);\n\t\t$data = $query->row_array();\n\t\treturn $data['id'];\n\t}", "public function getLastBatchNo()\n {\n $query = \"SELECT max(BatchNumber) AS BatchNumber FROM voucherbatch\";\n $sql = Yii::app()->db->createCommand($query);\n $result = $sql->queryRow();\n \n if($result['BatchNumber'] > 0)\n return $result['BatchNumber'] + 1;\n else\n return 1;\n }", "protected function MEMBER_getLastMember()\n\t{\n\t\t$query = $this->db->select(\n\t\t\t\tself::MEMBER_TABLE,\n\t\t\t\t'collab_member_id',\n\t\t\t\t'',\n\t\t\t\t__LINE__,\n\t\t\t\t__FILE__,\n\t\t\t\tfalse,\n\t\t\t\t\"ORDER BY `collab_member_id` DESC LIMIT 1;\"\n\t\t);\n\t\t$last_row = $query->fetchRow();\n\t\treturn is_array($last_row)? $last_row['collab_member_id']: 0;\n\t}", "public function get_last_referral_id(){\n\t\tglobal $con;\n\t\t$query=\"SELECT referral_id FROM referrals ORDER BY referral_id DESC LIMIT 1\";\n\t\t$result=array();\n\t\t$last_id=\"\";\n\t\t$result=$this->select($con,$query);\n\t\tforeach ($result as $key => $value) {\n\t\t\t$last_id=$value['referral_id'];\n\t\t}\n\n\t\treturn $last_id;\n\t}", "public function VerUltimoID()\r\n {\r\n\t\r\n\t$reg=mysql_query(\"select max($this->ID) as maxID from $this->tabla\", $this->con) or die('no se pudo encontrar el ultimo ID en VerUltimoID: ' . mysql_error());\r\n\t$reg=mysql_fetch_array($reg);\t\r\n\t\r\n\treturn($reg[\"maxID\"]);\r\n\t\r\n\t}", "private function get_last_number() {\n\t\treturn $this->settings['last_number'];\n\t}", "public function getNumber()\n {\n foreach ($this->getGame()->getLegs() as $idx=>$leg) {\n if ($leg == $this) {\n return $idx+1;\n }\n }\n\n return null;\n }", "function cek_rev_p2hp($id_p2hp) {\n $sql = \"SELECT max(rev_ke) as no_rev FROM rev_p2hp WHERE rev_p2hp='$id_p2hp'\";\n $row = $this->db->query($sql)->row();\n $max_no = $row->no_rev + 1;\n return $max_no;\n }", "public function getMax(): int;", "protected function _get_version()\n\t{\n\t\t$row = $this->db->get('migrations')->row();\n\t\treturn $row ? $row->version : 0;\n\t}", "function getMaxId($db)\n {\t \n $sql = \"SHOW TABLE STATUS LIKE 'leads'\";\n\t$result = $db->execQuery($sql);\n\t$row = $db->resultArray();\n\treturn $row[0]['Auto_increment'];\t \n }", "function getMaxId($db)\n {\t \n $sql = \"SHOW TABLE STATUS LIKE 'leads'\";\n\t$result = $db->execQuery($sql);\n\t$row = $db->resultArray();\n\treturn $row[0]['Auto_increment'];\t \n }", "public function getMaxOrderNumber()\n {\n $orderNumber = $this->find('all', [\n 'conditions' => [\n 'top_flag' => FLAG_TRUE,\n 'delete_flag' => FLAG_FALSE\n ],\n 'fields' => [\n 'order_number' => 'MAX(News.order_number) + 1 '\n ]\n ]);\n\n if($orderNumber->first()->order_number) {\n $maxOrderNumber = $orderNumber->first()->order_number;\n } else {\n $maxOrderNumber = 1;\n }\n\n return $maxOrderNumber;\n }", "public function getMaxMenuPosition()\n {\n $value=DB::table('links')\n ->max('menu_position');\n return $value;\n }", "public function get_new_id()\n {\n $query = \"select MAX(id) as id from team\";\n $res = $this->db->query($query);\n $res->result_array();\n $last_id = ($res->result()[0]->id)+1;\n return $last_id;\n }", "public function getMaxNumber()\n {\n return $this->maxNumber;\n }", "function get_modul_last_id() {\n $sql = \"SELECT RIGHT(modul_id, 8)'last_number'\n FROM com_modul\n ORDER BY modul_id DESC\n LIMIT 1\";\n $query = $this->db->query($sql);\n if ($query->num_rows() > 0) {\n $result = $query->row_array();\n $query->free_result();\n // create next number\n $number = intval($result['last_number']) + 1;\n if ($number > 99999999) {\n return false;\n }\n $zero = '';\n for ($i = strlen($number); $i < 8; $i++) {\n $zero .= '0';\n }\n return $zero . $number;\n } else {\n // create new number\n return '00000001';\n }\n }", "function minusOneFromMaxID($maxID) {\n\t//Tweet ID is stored a string. We need to subtract 1 from tweet ID in order to get all tweets lower than the last tweet. Because of the\n\t//length of the tweetID, this causes maths problems. I used this string function to subtract 1.\n\t for ($i=strlen($maxID)-1;$i>=0;$i--) {\n\t\t $currentNum=substr($maxID,$i,1) ;\n\t\t if($currentNum==0) {\n\t \t\t$maxID=substr_replace($maxID,9,$i,1);\n\t \t} else {\n\t\t \t$maxID=substr_replace($maxID,$currentNum-1,$i,1) ;\n\t\t \tbreak ;\n\t \t}\n \t}\n\treturn $maxID ;\n}", "public function getLastBase() {\n\n if (\n ($bases = $this->getBases())\n && (is_array($bases))\n )\n return $bases[intval(count($bases)-1)];\n //===\n\n\n return NULL;\n //===\n\n }", "public function idMax ()\n {\n $db = $this->dbConnect ();\n $req = $db->query ('SELECT id_chapter,number_chapter FROM chapter ORDER BY id_chapter DESC LIMIT 0,1');\n $resultat = $req->fetch ();\n return $resultat;\n }", "protected function _get_version()\n\t{\n\t\t$row = $this->db->get($this->_migration_table)->row();\n\t\treturn $row ? $row->version : 0;\n\t}", "function get_latest_booking_number()\n {\n $query = $this->db->query(\"select booking_seed from seeds\");\n foreach ($query->result_array() as $row)\n {\n $bookingNumber = $row['booking_seed'];\n $newBookingNumber = $bookingNumber +1;\n }\n // Increment booking seed by one\n $query = $this->db->query(\"update seeds set booking_seed='$newBookingNumber'\");\n return $bookingNumber;\n }", "public function get_last_contract_number_last_contract_number()\n {\n $this->assertEquals(self::$contract->get_last_contract_number(), Contract::max('contract_number'));\n }", "public function revNum()\n {\n return $this->revNum;\n }", "public function getNextOrderingValue()\n {\n $qb = $this->createQueryBuilder('c')\n ->select('MAX(c.ordering)')\n ->setMaxResults(1);\n\n $ordering = $qb->getQuery()->getSingleScalarResult();\n if ($ordering === null) {\n return 1;\n }\n\n return $ordering + 1;\n }", "private function getLatestPlace(){\n $last = -100000000;\n foreach($this->URLs as $url){\n if($url['url_place'] > $last) $last = $url['url_place'];\n }\n if($last == -100000000) $last = 0;\n return $last;\n }", "function getMaxId($db)\n {\t \n $sql = \"SHOW TABLE STATUS LIKE 'leadtransaction'\";\n\t$result = $db->execQuery($sql);\n\t$row = $db->resultArray();\n\treturn $row[0]['Auto_increment'];\t \n }", "public function getHighestOrderNumber()\n {\n return ((int) self::max($this->determineOrderColumnName())) + 1;\n }", "public function getReferenceNumber()\n {\n return $this->referenceNumber;\n }", "function getLatestRev() {\n\t\t$rev = $this->LatestRevPacked;\n\t\tif(!$rev && $this->URL) {\n\t\t\t$this->NeedsLatestRev = 1;\n\t\t\t$this->update();\n\t\t\t$rev = $this->LatestRevPacked;\n\t\t}\n\t\treturn $rev;\n\t}", "public function getMaxNotaFiscalNumero() {\r\n\r\n $sql = \"SELECT MAX(nflno_numero) + 1 as nflno_numero FROM nota_fiscal WHERE nflserie = 'A'\";\r\n\r\n $result = $this->_fetchAssoc(pg_query($this->_adapter, $sql));\r\n\r\n return $result['nflno_numero']; \r\n }", "function getFreeDrugId()\n {\n $request = \"SELECT id FROM DRUG WHERE id = (SELECT MAX(id) FROM DRUG ORDER BY id ASC)\";\n\n DBConnexion::getInstance()->prepareAndExecuterQuerySelect($request, null);\n $response = DBConnexion::getInstance()->getResult();\n\n return intval($response[0][0]+1);\n }", "public static function get_max_order_id()\n\t{\n\t\t$database\t= new database();\n\t\t$sql\t\t= \"SELECT MAX(order_id) AS order_id FROM planning_gallery\";\n\t\t$result\t\t= $database->query($sql);\n\t\t\n\t\tif ($result->num_rows > 0)\n\t\t{\n\t\t\t$data\t= $result->fetch_object();\n\t\t\treturn $data->order_id > 0 ? $data->order_id : 0;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn 0;\n\t\t}\n\t}", "public function getLast()\n {\n $post = Post::findFirst([\"order\" => \"id DESC\"]);\n\n if($post == true)\n {\n return $post->id + 1;\n }\n else\n {\n return 1;\n }\n }", "static public function mdlObtenerUltimoId() {\r\n\r\n $sql = \"SELECT * FROM compras ORDER BY id DESC Limit 1\";\r\n\r\n $stmt = Conexion::conectar()->prepare($sql);\r\n\r\n $stmt -> execute();\r\n\r\n return $stmt -> fetch();\r\n\r\n }", "public function get_New_CM_NO(){\n\n\t\t$this->db->select_max('CM_NO');\n\t\t$query = $this->db->get('COMPLAINT_MST'); \n\n\t\t$row = $query->row();\n\n\t\tif (isset($row))\n\t\t return $row->CM_NO + 1;\n\t}", "public function getNextNumber()\n {\n $nextNoProc = $this->getAdapter()->prepare(\n \"DECLARE @RESULT int\n EXEC udf_gen_next_number\n @RESULT = @RESULT OUTPUT\"\n );\n $nextNoProc->execute();\n // Is this really necessary? Yes, unfortunately.\n $dereference = $nextNoProc->fetch();\n return array_pop($dereference);\n }", "public function ultimoNumeroFactura(){\n $pdo = Database::connect();\n $sql = \"select max(idfactura) numero from facturas\";\n $consulta = $pdo->prepare($sql);\n $consulta->execute();\n //obtenemos el registro especifico:\n $res=$consulta->fetch(PDO::FETCH_ASSOC);\n $numero=$res['numero'];\n Database::disconnect();\n //retornamos el numero encontrado:\n if(!isset($numero))\n return 0;\n return $numero;\n }", "public function getRefNumber()\n\t{\n\t\treturn $this->get('RefNumber');\n\t}", "public static function getFullLastInvoiceNumber(){\n\t\t//Get Default Number\n\t\t$def = 0;\n\t\t$defnumber = SettingInvoiceReport::model()->findByAttributes(array(\"field_name\"=>\"Default Invoice Number\"));\n\t\tif($defnumber != null){\n\t\t\t$def = $defnumber->field_value*1;\n\t\t}\n\t\t\n\t\treturn $def + InvoiceDB::getLastInvoiceNumber();\n\t}", "public function GetNextMemberNumber()\n {\n $dbTalker = new DbTalker();\n return $dbTalker->GetNextMemberNumber() ?: 0;\n }", "public function getLast(): int {\n return $this->last;\n }", "public function getMaxSequence()\n {\n return $this->max_sequence;\n }", "public function getMaxId($_column = null, $_next = false)\n {\n $column = $_column ? $_column : $this->primary;\n if (!$column) {\n return false;\n }\n\n $select = $this->getSql()->select();\n $select->columns(array('col' => new Expression('MAX(' . $column . ')')));\n $row = $this->selectWith($select)->toArray();\n $val = gv('col', gv(0, $row));\n if ($_next && is_numeric($val)) {\n return (int) $val + 1;\n }\n else {\n return (int) $val;\n }\n }", "public function getLast()\n\t{\n\t\t$this->_db->setQuery(\"SELECT publish_down FROM $this->_tbl ORDER BY publish_down DESC LIMIT 1\");\n\t\treturn $this->_db->loadResult();\n\t}", "protected function _get_next_incrementer() {\n\t\t// Get the old integer\n\t\t$channel_id = $this->EE->input->get('channel_id');\n\t\t$old_number = $this->EE->db->select($this->field_name)\n\t\t\t\t\t\t\t\t ->where('channel_id', $this->EE->input->get('channel_id'))\n\t\t\t\t\t\t\t\t ->order_by('entry_id DESC')\n\t\t\t\t\t\t\t\t ->limit(1)\n\t\t\t\t\t\t\t\t ->get('channel_data')\n\t\t\t\t\t\t\t\t ->row();\n\t\t\n\t\t// Do we have one?\n\t\tif ($old_number) {\n\t\t\t// Increment\n\t\t\t$new_number = (int)$old_number->{$this->field_name} + 1;\n\t\t} else {\n\t\t\t// Start at 1\n\t\t\t$new_number = 1;\n\t\t}\n\t\t\n\t\t// Return it\n\t\treturn $new_number;\n\t}", "public function getRefNo()\n {\n return $this->ref_no;\n }", "public function getReferenceNumber()\n\t{\n\t return $this->referenceNumber;\n\t}", "public function getMaximumDepth()\n\t{\n\t\tglobal $ilDB;\n\t\t\n\t\t$query = 'SELECT MAX(depth) depth FROM '.$this->table_tree;\n\t\t$res = $ilDB->query($query);\t\t\n\t\t\n\t\t$row = $ilDB->fetchAssoc($res);\n\t\treturn $row['depth'];\n\t}", "public static function fetchNextSortOrder()\n {\n $next = Symphony::Database()->fetchVar(\n \"next\",\n 0,\n \"SELECT\n MAX(p.sortorder) + 1 AS `next`\n FROM\n `tbl_fields` AS p\n LIMIT 1\"\n );\n return ($next ? (int)$next : 1);\n }", "public function maxNumber(): int\n {\n try {\n return (int) $this->createQueryBuilder('b')\n ->select('max(b.number) as maxi')\n ->getQuery()\n ->getSingleScalarResult()\n ;\n } catch (NonUniqueResultException $exception) {\n //this should not be reached.\n return 0;\n } catch (NoResultException $exception) {\n return 0;\n }\n }", "public function getMaxTarget()\n {\n $bits = $this->lowestBits();\n $target = $this->math->getCompact($bits);\n\n return $target;\n }", "private function getNextTransactionID(){\n $db = $this->connectDB();\n $query = \"SELECT MAX(id) as curr_max_id FROM transaction;\";\n $stmt = $db->prepare($query);\n $stmt->execute();\n $stmt->store_result();\n $stmt->bind_result($curr_max_id);\n $stmt->fetch();\n // Return the current largest id plus 1 as the new ID.\n return $curr_max_id + 1;\n }", "function get_nav_last_id($portal_id) {\n $sql = \"SELECT RIGHT(nav_id, 8)'last_number'\n FROM com_menu\n WHERE portal_id = ?\n ORDER BY nav_id DESC\n LIMIT 1\";\n $query = $this->db->query($sql, $portal_id);\n if ($query->num_rows() > 0) {\n $result = $query->row_array();\n $query->free_result();\n // create next number\n $number = intval($result['last_number']) + 1;\n if ($number > 99999999) {\n return false;\n }\n $zero = '';\n for ($i = strlen($number); $i < 8; $i++) {\n $zero .= '0';\n }\n return $portal_id . $zero . $number;\n } else {\n // create new number\n return $portal_id . '00000001';\n }\n }", "public function recupereMaxId()\n {\n return $this->getGreaterId('membre_jury');\n }", "public function last($isShow = false)\n {\n $sql = new Sql($this->adapter);\n $select = $sql->select();\n $select->from(self::TABLE);\n $select->columns(array(\n 'last' => new \\Zend\\Db\\Sql\\Expression('MAX(migration)'),\n 'up',\n 'down'\n ));\n \n $selectString = $sql->getSqlStringForSqlObject($select);\n $results = $this->adapter->query($selectString, Adapter::QUERY_MODE_EXECUTE);\n \n return $results->current();\n }", "public function getDernierNumeroDemandeur()\r\n\t{\r\n\t\t$req = \"select max(num_recu) from demandeurs\";\r\n\t\t$res = PdoFredi::$monPdo->query($req);\r\n\t\tif($res->rowCount() != 0)\r\n\t\t\t$num = $res->fetchColumn();\r\n\t\telse\r\n\t\t\t$num = 0;\r\n\t\treturn $num;\r\n\t}", "public function get_New_CAD_NO(){\n\n\t\t$this->db->select_max('MJ_CAD_ID');\n\t\t$query = $this->db->get('MJ_COMPLAINT_ASSIGN_DTL'); \n\t\t$row = $query->row();\n\n\t\tif (isset($row))\n\t\t return $row->MJ_CAD_ID + 1;\n\t}", "public static function getMaxUsedNumber()\n {\n $query = new Query;\n\n $query->select('recepient_num, count(recepient_num) as quan')\n ->from('call')\n ->groupBy('recepient_num')\n ->orderBy('quan desc')\n ->limit(1);\n\n $rows = $query->all();\n\n return $rows[0]['recepient_num'];\n }", "public function test_get_max_version()\n {\n $migrator_util = new Ruckusing_Util_Migrator($this->adapter);\n\n $this->clear_dummy_data();\n $this->assertEquals(null, $migrator_util->get_max_version());\n\n $this->insert_dummy_version_data(array(3));\n $this->assertEquals(\"3\", $migrator_util->get_max_version());\n $this->clear_dummy_data();\n }", "public function getRefNo()\n {\n return $this->refNo;\n }", "public function getRefNo()\n {\n return $this->refNo;\n }", "function get_maxcustindexrecnbr($debug = false) {\n\t\t$q = (new QueryBuilder())->table('custindex');\n\t\t$q->field($q->expr('MAX(recno)'));\n\t\t$sql = DplusWire::wire('database')->prepare($q->render());\n\t\tif ($debug) {\n\t\t\treturn $q->generate_sqlquery();\n\t\t} else {\n\t\t\t$sql->execute();\n\t\t\treturn $sql->fetchColumn();\n\t\t}\n\t}", "function get_latest_customer_number()\n {\n $query = $this->db->query(\"select customer_seed from seeds\");\n foreach ($query->result_array() as $row)\n {\n $customerNumber = $row['customer_seed'];\n $newCustomerNumber = $customerNumber + 1;\n }\n // Increment customer seed by one\n $query = $this->db->query(\"update seeds set customer_seed='$newCustomerNumber'\");\n return $customerNumber;\n }", "function getCalibrationMaxSerial($DbConnection)\n{\n\t$query =\"select Max(sno)+1 as seiral_no from calibration\"; \n\t$result=mysql_query($query,$DbConnection);\n\t$row=mysql_fetch_row($result);\n\treturn $row[0];\n}", "public function getReferenceID()\n\t{\n\t\t$this->db->select('tchr_reference_id');\n\t\t$this->db->from('cms_teachers');\n\t\t$this->db->order_by('tchr_id','desc');\n\t\t$this->db->limit('1');\n\n\t\t$query = $this->db->get();\n\t\t$EMPID = '';\n\t\t$LastInsertedID = 0;\n\t\t$countID = $query->num_rows();\n\t\tif($countID > 0){\n\t\t\t$result = $query->row();\n\t\t\t$EMPID = $result->tchr_reference_id;\n\t\t}else{\n\t\t\t$EMPID = 'THR00000';\n\t\t}\n\t\t$LastInsertedID = substr($EMPID, 3, 5);\n\t\t$NEWIDS = 'THR' . str_pad($LastInsertedID + 1, 5, '0', STR_PAD_LEFT);\n\t\treturn $NEWIDS;\n\n\t}", "public function getPreviousVersion()\n {\n $versions = $this->getVersions();\n\n return count($versions) > 1 ? $versions[1] : 0;\n }", "public function decrementReferenceCount(): int\n {\n assert($this->getGC()->refcount > 0);\n\n return --$this->getGC()->refcount;\n }", "public function get_New_CA_NO(){\n\t\t$this->db->select_max('MJ_CA_ID');\n\t\t$query = $this->db->get('MJ_COMPLAINT_ACTION_DTL'); \n\t\t$row = $query->row();\n \t\t\n\t\tif (isset($row))\n\t\t return $row->MJ_CA_ID + 1;\n\t}", "public function getIdMax() {\n $maxId = myPDO()->query('SELECT MAX(member_id) FROM members');\n return $maxId->fetch()[0];\n }", "public function get_New_FTS_No(){\n\n\t\t$this->db->select_max('FM_FILE_ID');\n\t\t$query = $this->db->get('FILE_MST');\n\t\t$row = $query->row();\n\n\t\tif (isset($row))\n\t\t return $row->FM_FILE_ID + 1;\n\t}", "protected function getLastMatchStepID($userID, $matchID)\n {\n $sql = new Sql($this->dbAdapter);\n \n $where = new \\Zend\\Db\\Sql\\Where();\n $where->nest()\n ->equalTo('tblmatchsteps.mUserID', $userID)\n ->and->equalTo('tblmatchsteps.mMatchID', $matchID)\n ->unnest();\n $select = $sql->select('tblmatchsteps')\n ->columns(array('maxMSID' => new Expression('MAX(msID)')))\n ->where($where); \n\n $stmt = $sql->prepareStatementForSqlObject($select);\n $result = $stmt->execute();\n \n \n $test = $result->current()['maxMSID'];\n \n //If I dont have a MatchStepID return -1\n if (is_null($test) == true)\n { \n $test = -1;\n return $test;\n }\n \n return $test;\n }", "private function getMaxRightKey(){\n\t\t\t$conn = Db::getInstance();\n\t\t\t$st = $conn->prepare(\"SELECT MAX(`right_key`) FROM `\" . static::db_table . \"`\");\n\t\t\t$st->execute();\n\t\t\treturn intval($st->fetchColumn());\n\t\t}", "static Public function mdlgetUltNumCancelado(){\n\ttry{ \n\t $stmt=Conexion::conectar()->prepare(\"SELECT MAX(num_cancelacion)+1 AS num_cancelacion FROM cancela_venta\");\n\n\t $stmt->execute();\n\t \n\t return $stmt->fetch();\n\n\t} catch (Exception $e) {\n\t\techo \"Failed: \" . $e->getMessage();\n }\n\t //$stmt->close();\n\t \n\t $stmt=null;\n }", "public function latest()\n {\n end($this->_availableMigrations);\n $highestAvailableMigration = current($this->_availableMigrations);\n reset($this->_availableMigrations);\n return $this->up($highestAvailableMigration);\n }", "public function getNextSeq(): int\n\t{\n\t\treturn (int) (new \\App\\Db\\Query())->from($this->getTableName())->max('sortorderid') + 1;\n\t}", "public function check_inspect_order_num() {\n\n $query = db_select('checklist_inspections', 'c');\n $query->addExpression('MAX(order_num)');\n $max= $query->execute()->fetchField();\n\n if(empty($max)) {\n $checklist_order_num = 1;\n return $checklist_order_num;\n }\n else {\n $checklist_order_num = $max;\n return $checklist_order_num + 1;\n }\n }", "function get_max_id($table_name) {\n\tglobal $db, $dbname;\n $stmt = $db->prepare(\"SELECT MAX(id) AS max_id FROM `$dbname`.`$table_name`\");\n $stmt->execute();\n $invNum = $stmt->fetch(PDO::FETCH_ASSOC);\n return $invNum['max_id'];\n}", "function getMaxId($db)\n {\t \n $sql = \"SHOW TABLE STATUS LIKE 'country'\";\n\t$result = $db->execQuery($sql);\n\t$row = $db->resultArray();\n\treturn $row[0]['Auto_increment'];\t \n }", "public function up(): int\n {\n if ($this->hasNodeId()) {\n if ($this->rank($this->nodeId) > 1) {\n $key = array_search($this->nodeId, $this->ranks);\n\n return $this->toggle($this->nodeId, $this->ranks[$key - 1]);\n }\n\n return 1;\n }\n }", "private function getCurrentMigrationIndex(Component $oComponent): ?int\n {\n $oResult = $this->oDb->query(sprintf(\n 'SELECT `version` FROM `%s` WHERE `module` = \"%s\";',\n Config::get('NAILS_DB_PREFIX') . 'migration',\n $oComponent->slug\n ));\n\n if ($oResult->rowCount() === 0) {\n\n $oResult = $this->oDb->query(sprintf(\n 'INSERT INTO `%s` (`module`, `version`) VALUES (\"%s\", NULL);',\n Config::get('NAILS_DB_PREFIX') . 'migration',\n $oComponent->slug\n ));\n\n return null;\n }\n\n $iCurrentVersion = $oResult->fetch(\\PDO::FETCH_OBJ)->version;\n return is_null($iCurrentVersion) ? null : (int) $iCurrentVersion;\n }", "public function getNextInitAppDocNumber(){\n $lastDoc = File::orderBy('id', 'desc')->first();\n\n /*\n In a case where no record is found get 1 as a\n virtual record to generate document number.\n */\n if(is_null($lastDoc)){\n /*\n create an object counter (number) to store document ID and\n initialiaze it to 1.\n */\n $id = File::find(1);\n $number = $id;\n\n //assign and add the number with Doc ID\n $number += File::find(1);\n\n /*\n concatenate BRS-DFT- with the last inserted Doc ID\n that will end with 3 numbers.\n */\n\n return 'BRS-DFT-' . sprintf('%03d', intval($number) + 1);\n\n }else{\n /*\n The document exists then\n create variable number to store document ID\n initialiaze it to 0.\n */\n $number = 0;\n\n //assign and add the number with Doc ID\n $number += $lastDoc->id;\n\n /*\n concatenate BRS-DFT- with the last inserted Doc ID\n that will end with 3 numbers.\n */\n return 'BRS-DFT-' . sprintf('%03d', intval($number) + 1);\n }\n\n }", "public function getNextCacheVersion($cache)\n {\n $lastCache = $this->caches()\n ->where('name', $cache)\n ->orderBy('version', 'desc')\n ->first();\n\n if ($lastCache) {\n $currentCache = $this->caches()\n ->where('name', '!=', $cache)\n ->where('version', '>', $lastCache->version + 1)\n ->orderBy('version', 'desc')\n ->first();\n if ($currentCache) {\n return $currentCache->version;\n }\n }\n\n return $lastCache ? $lastCache->version + 1 : 1;\n }", "function getLastPofId()\n\t {\n\t\t \n\t\t $query = $this->db->query('SELECT max(pof_id) as maxid FROM pof');\n $row = $query->row();\n $max_id = $row->maxid; \n\t\t\t return $max_id; \n\t\t }", "function get_max_ordering() {\n $this->db->select_max('ordering');\n $query = $this->db->get($this->get_scope());\n $row = $query->row();\n return $row->ordering;\n }", "public function RemainToGoal() {\n\t\t\n\t\tif (!empty($this->activities)) {\n\t\t\t\n\t\t\t$goal = intval($this->activities['goals']['steps']);\n\t\t\t$steps = intval($this->Steps());\n\t\t\t\n\t\t\tif ($goal > $steps) {\n\t\t\t\t\n\t\t\t\treturn $goal - $steps;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn 0;\n\t}" ]
[ "0.6550333", "0.6362402", "0.6198158", "0.61445165", "0.6137577", "0.60441065", "0.6022636", "0.59896886", "0.5986675", "0.5979175", "0.59742445", "0.5897246", "0.5851074", "0.58434737", "0.58397466", "0.5838604", "0.5832273", "0.5825268", "0.5821111", "0.5814068", "0.58073777", "0.579692", "0.57961655", "0.5792296", "0.5790079", "0.5790079", "0.5779794", "0.57643723", "0.5757299", "0.5746118", "0.5742743", "0.57302815", "0.5724655", "0.570304", "0.56739855", "0.56528604", "0.5650093", "0.5649935", "0.5649683", "0.56327045", "0.5632227", "0.56313175", "0.56286407", "0.5625344", "0.5615485", "0.56110233", "0.5601986", "0.56015337", "0.5596175", "0.5585082", "0.5578855", "0.5578813", "0.5575792", "0.55669916", "0.5543497", "0.5539429", "0.55389845", "0.55377823", "0.55336964", "0.553346", "0.55276984", "0.55122036", "0.5511735", "0.55084985", "0.54900986", "0.54881436", "0.5479058", "0.5471901", "0.5463914", "0.5457481", "0.5452962", "0.5448329", "0.5445563", "0.5442416", "0.5432799", "0.5432799", "0.54174674", "0.5413561", "0.5410639", "0.5404216", "0.5403362", "0.5395856", "0.53956556", "0.539413", "0.537848", "0.5363911", "0.53629154", "0.5354562", "0.5343189", "0.5342441", "0.53407353", "0.5340725", "0.53335756", "0.5321006", "0.53200144", "0.53149617", "0.530883", "0.5298396", "0.52932596", "0.5292683" ]
0.7276018
0
Executes a migration with the purpose to reach the specified target. If target has been already executed we are doing a rollback.
public function migrate($target=null) { $migrations = $this->getAvailableMigrations($target); if (null === $target) { end($migrations); $target = key($migrations); } if (!$this->isDownwards($target)) { return $this->doMigration($migrations, AdapterInterface::UP); } else { return $this->doMigration($migrations, AdapterInterface::DOWN); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function up($targetMigration)\n {\n $migrations = new Ot_Model_DbTable_Migrations($this->_tablePrefix);\n \n $migrationsIdsNotApplied = array_diff(array_keys($this->_availableMigrations), $this->_appliedMigrations);\n \n $migrationsToApply = array();\n \n foreach ($migrationsIdsNotApplied as $migrationId) {\n if ($migrationId <= $targetMigration) {\n $migrationsToApply[] = $this->_availableMigrations[$migrationId];\n }\n }\n \n if (empty($migrationsToApply)) {\n $this->_messages[] = 'No migrations to apply';\n return;\n }\n \n $this->_db->beginTransaction();\n \n foreach ($migrationsToApply as $m) {\n \n require_once $this->_migrationsPath . '/' . $m;\n $classname = 'Db_' . substr($m, 0, -4); //strip out the .php extension\n $migrationClass = new $classname(array('tablePrefix' => $this->_tablePrefix));\n\n try {\n $migrationClass->up($this->_db, $this->_tablePrefix);\n } catch (Exception $e) {\n $this->_db->rollback();\n throw new Exception('Error applying migration ' . $m . '. ' . $e->getMessage());\n }\n \n try {\n $migrations->addMigration($this->_getMigrationIdFromFilename($m));\n } catch (Exception $e) {\n $this->_db->rollback();\n throw new Exception('Migration ' . $m . ' was successful, but adding record to migrations table failed. ' . $e->getMessage());\n }\n \n $this->_messages[] = 'Applied ' . $m;\n }\n \n $this->_db->commit();\n }", "public function down($targetMigration)\n {\n $migrationsModel = new Ot_Model_DbTable_Migrations($this->_tablePrefix);\n \n end($this->_appliedMigrations);\n $highestExecutedMigration = current($this->_appliedMigrations);\n reset($this->_appliedMigrations);\n\n if (!isset($this->_availableMigrations[$targetMigration])) {\n throw new Exception('The requested migration ' . $targetMigration . ' was not found.');\n }\n \n if ((int)$highestExecutedMigration <= (int)$targetMigration) {\n throw new Exception('The database is only migrated to migration ' . $highestExecutedMigration . ', which is before the requested migration ' . $targetMigration);\n }\n \n $migrationsToApply = array();\n \n foreach ($this->_appliedMigrations as $a) {\n if ((int)$a > (int)$targetMigration && isset($this->_availableMigrations[$a])) {\n $migrationsToApply[] = $this->_availableMigrations[$a];\n }\n }\n \n $migrationsToApply = array_reverse($migrationsToApply);\n \n if (empty($migrationsToApply)) {\n $this->_messages[] = 'No migrations to apply';\n }\n \n $this->_db->beginTransaction();\n \n foreach ($migrationsToApply as $m) {\n require_once $this->_migrationsPath . '/' . $m;\n $classname = 'Db_' . substr($m, 0, -4); //strip out the .php extension\n $migrationClass = new $classname(array('tablePrefix' => $this->_tablePrefix));\n\n try {\n $migrationClass->down($this->_db, $this->_tablePrefix);\n } catch (Exception $e) {\n $this->_db->rollback();\n throw new Exception('Error applying migration ' . $m . '. ' . $e->getMessage());\n }\n \n try {\n $migrationsModel->removeMigration($this->_getMigrationIdFromFilename($m));\n } catch (Exception $e) {\n $this->_db->rollback();\n throw new Exception('Migration ' . $m . ' was successful, but adding record to migrations table failed. ' . $e->getMessage());\n }\n \n $this->_messages[] = 'Down migration of ' . $m . ' was successful.';\n }\n \n $this->_db->commit();\n }", "public function up(int $target_version = null): void\n {\n $files = $this->getUpFilesToExecute($target_version);\n if (empty($files)) {\n return;\n }\n\n if (!$target_version) {\n $version_file = array_pop($files);\n $target_version = $this->getVersionFromFile($version_file);\n }\n\n foreach ($files as $file) {\n $file_path = $this->migrationDir . '/up/' . $file;\n $sql_statements = $this->getSQLStatements($file_path);\n $this->executeStatements($sql_statements);\n }\n\n $this->setCurrentVersion($target_version);\n }", "public function execute() {\n $oldMigrations = new Filesystem(\"App/system/databases/migrations\");\n $oldMigrations->addFilter(new MigrationFilter($this->model->getShortModelName()));\n\n\n //todo: write custom iterator\n $oldMigrations->customCallback([$this, \"applyOldMigrations\"]);\n //todo: get the current model and get the diffrences between that and the migration\n //todo: write a new migration.\n //\n // $this->buildChangeSet();\n //do stuff execute all the things\n $this->createNewMigration();\n\n }", "public function test_get_runnable_migrations_going_up_with_target_version_with_current()\n {\n $migrator_util = new Ruckusing_Util_Migrator($this->adapter);\n //pretend we already executed version 1\n $this->insert_dummy_version_data(array(1));\n $actual_up_files = $migrator_util->get_runnable_migrations($this->migrations_dirs, 'up', 3, false);\n $expect_up_files = array(\n array(\n 'version' => 3,\n 'class' => 'AddIndexToBlogs',\n 'file' => '003_AddIndexToBlogs.php',\n 'module' => 'default'\n )\n );\n $this->assertEquals($expect_up_files, $actual_up_files);\n $this->clear_dummy_data();\n\n //now pre-register some migrations that we have already executed\n $this->insert_dummy_version_data(array(1, 3));\n $actual_up_files = $migrator_util->get_runnable_migrations($this->migrations_dirs, 'up', 3, false);\n $this->assertEquals(array(), $actual_up_files);\n }", "public function down(int $target_version = null): void\n {\n $files = $this->getDownFilesToExecute($target_version);\n foreach ($files as $file) {\n $file_path = $this->migrationDir . '/down/' . $file;\n $sql_statements = $this->getSQLStatements($file_path);\n $this->executeStatements($sql_statements);\n }\n\n $this->setCurrentVersion($target_version);\n }", "public function version($target_version)\n\t{ \n\t\t$start = $current_version = $target_version-1;\n\t\t$stop = $target_version;\n \n\t\tif ($target_version > $current_version)\n\t\t{\n\t\t\t// Moving Up\n\t\t\t++$start;\n\t\t\t++$stop;\n\t\t\t$step = 1;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Moving Down\n\t\t\t$step = -1;\n\t\t}\n \n\t\t$method = ($step === 1) ? 'up' : 'down';\n\t\t$migrations = array();\n \n\t\t// We now prepare to actually DO the migrations\n\t\t// But first let's make sure that everything is the way it should be\n\t\tfor ($i = $start; $i != $stop; $i += $step)\n\t\t{ \n\t\t\t$f = glob(sprintf($this->_migration_path . '%03d_*.php', $i));\n\t\t\t// Only one migration per step is permitted\n\t\t\tif (count($f) > 1)\n\t\t\t{\n\t\t\t\t$this->_error_string = sprintf($this->lang->line('migration_multiple_version'), $i);\n\t\t\t\treturn FALSE;\n\t\t\t}\n\n\t\t\tif ( isset( $f[0] ) ) { \n\t\t\t\t$name = basename($f[0], '.php');\n\t\t\t} else {\n\t\t\t\treturn FALSE;\n\t\t\t}\n\n \n\t\t\t// Filename validations\n\t\t\tif (preg_match('/^\\d{3}_(\\w+)$/', $name, $match))\n\t\t\t{\n\t\t\t\t$match[1] = strtolower($match[1]);\n\n\t\t\t\t// Cannot repeat a migration at different steps\n\t\t\t\tif (in_array($match[1], $migrations))\n\t\t\t\t{\n\t\t\t\t\t$this->_error_string = sprintf($this->lang->line('migration_multiple_version'), $match[1]);\n\t\t\t\t\treturn FALSE;\n\t\t\t\t}\n\n\t\t\t\tinclude $f[0];\n\t\t\t\t$class = 'Migration_' . ucfirst($match[1]);\n\n\t\t\t\tif ( ! class_exists($class))\n\t\t\t\t{\n\t\t\t\t\t$this->_error_string = sprintf($this->lang->line('migration_class_doesnt_exist'), $class);\n\t\t\t\t\treturn FALSE;\n\t\t\t\t}\n\n\t\t\t\tif ( ! is_callable(array($class, $method)))\n\t\t\t\t{\n\t\t\t\t\t$this->_error_string = sprintf($this->lang->line('migration_missing_'.$method.'_method'), $class);\n\t\t\t\t\treturn FALSE;\n\t\t\t\t}\n\n\t\t\t\t$migrations[] = $match[1];\n\t\t\t}\n\t\t}\n\n\t\tlog_message('debug', 'Migration atual: ' . $current_version);\n\n\t\t$version = $i + ($step == 1 ? -1 : 0);\n\n\t\t// If there is nothing to do so quit\n\t\tif ($migrations === array())\n\t\t{\n\t\t\treturn TRUE;\n\t\t}\n\n\t\tlog_message('debug', 'Migrating from ' . $method . ' to version ' . $version);\n \n\t\t// Loop through the migrations\n\t\n\t\t\t// Run the migration class\n\t\t\t$class = 'Migration_' . ucfirst(strtolower(end($migrations)));\n\t\t\tcall_user_func(array(new $class, $method));\n\n\t\t\t$current_version += $step;\n\t\t\t$this->_update_version($current_version);\n\t\t\n\n\t\tlog_message('debug', 'Finished migrating to '.$current_version);\n \n\t\treturn end($migrations);\n\t}", "public function runAction():void{\n $currentVersion = Migration::getCurrentVersion();\n $migrations = glob($this->config->application->migrationsDir.'*.php');\n $version = count($migrations);\n if((int)$version === $currentVersion){\n Cli::error('Nothing to migrate');\n }\n for($i=($currentVersion+1); $i<=$version; $i++){\n $class= \"MigrationVersion\".$i; \n $migration = new $class();\n $this->executeQueries($migration->up());\n\n Migration::setCurrentVersion($i);\n }\n }", "public function rebuild($targetMigration = null)\n {\n $migrations = new Ot_Model_DbTable_Migrations($this->_tablePrefix);\n \n $this->_messages[] = 'Dropping all tables';\n \n try {\n $migrations->dropAllTables();\n } catch (Exception $e) {\n throw new Exception('Dropping all the tables failed. ' . $e->getMessage());\n }\n \n $this->_messages[] = 'All tables dropped.';\n \n $this->_messages[] = \"Recreating migration table.\";\n $migrations->createTable(); // create the migrations table\n \n // reset the applied migrations array. it should be empty, but we'll\n // check the db just to make sure\n $this->_appliedMigrations = $migrations->getAppliedMigrations();\n \n if (is_null($targetMigration)) {\n $this->_messages[] = 'Rebuilding database to latest version.';\n return $this->latest();\n } else {\n $this->_messages[] = 'Rebuilding database to version ' . $targetMigration . '.';\n return $this->up($targetMigration);\n }\n }", "private function run($direction) {\n\t\tDB::start_transaction();\n\n\t\ttry {\n\t\t\t$status = call_user_func(array($this, 'do_'.$direction));\n\t\t} catch(\\Exception $e) {\n\t\t\tCli::error($e);\n\t\t\t$status = false;\n\t\t}\n\n\t\tif(! $status) {\n\t\t\tCli::error(\"Something went wrong during the migration, rollback !\");\n\t\t\tDB::rollback_transaction();\n\t\t\tthrow new Database_Exception(\"Migration rolled back due to error.\");\n\t\t}\n\t\tDB::commit_transaction();\n\t\treturn true;\n\t}", "function auto_migrate($last_migration_file = null) {\n\t\t$migrations = $this->migration;\n\n\n\t\ttry {\n\t\t\t# get last migration (if not given):\n\t\t\t$last_migration_file = $last_migration_file ??\n\t\t\t $migrations->find()->order(['migration_id' => 'DESC'])->first()->migration_file;\n\t\t} catch(Exception $e) {\n\t\t\ttry {\n\t\t\t\t// commit initial migration\n\t\t\t\t$this->_migrate('0.sql');\n\n\t\t\t\t// check if migration succeeded\n\t\t\t\t$last_migration_file = $migrations->find()->order(['migration_id' => 'DESC'])->first()->migration_file;\n\t\t\t} catch(Exception $e) {\n\t\t\t\t// initial migration failed, give up now\n\t\t\t\thttp_response_code(500);\n\t\t\t\techo 'the database could not be set-up. Please check your initial migration';\n\t\t\t\tdie();\n\t\t\t}\n\n\t\t}\n\n\n\t\t// check if there is a migration file > last_migration and migrate it\n\n\t\t$migration_files = scandir('migrations');\n\t\t$migration_index = array_search($last_migration_file, $migration_files);\n\t\tif ($migration_index == null) {\n\t\t\t// file not found, just stop.\n\t\t\treturn;\n\t\t}\n\t\t$new_file = @$migration_files[$migration_index + 1];\n\t\tif ($new_file) {\n\t\t\t$this->_migrate($new_file);\n\n\t\t\t// continue checking the rest\n\t\t\t$this->auto_migrate($new_file);\n\t\t} // else: no files left\n\n\t}", "public function test_get_runnable_migrations_going_down_with_target_version_no_current()\n {\n $migrator_util = new Ruckusing_Util_Migrator($this->adapter);\n $this->insert_dummy_version_data(array(3, '20090122193325'));\n $actual_down_files = $migrator_util->get_runnable_migrations($this->migrations_dirs, 'down', 1, false);\n $expect_down_files = array(\n array(\n 'version' => '20090122193325',\n 'class' => 'AddNewTable',\n 'file' => '20090122193325_AddNewTable.php',\n 'module' => 'default'\n ),\n array(\n 'version' => 3,\n 'class' => 'AddIndexToBlogs',\n 'file' => '003_AddIndexToBlogs.php',\n 'module' => 'default'\n )\n );\n $this->assertEquals($expect_down_files, $actual_down_files);\n $this->clear_dummy_data();\n\n $this->insert_dummy_version_data(array(3));\n $actual_down_files = $migrator_util->get_runnable_migrations($this->migrations_dirs, 'down', 1, false);\n $expect_down_files = array(\n array(\n 'version' => 3,\n 'class' => 'AddIndexToBlogs',\n 'file' => '003_AddIndexToBlogs.php',\n 'module' => 'default'\n )\n );\n $this->assertEquals($expect_down_files, $actual_down_files);\n\n //go all the way down!\n $this->clear_dummy_data();\n $this->insert_dummy_version_data(array(1, 3, '20090122193325'));\n $actual_down_files = $migrator_util->get_runnable_migrations($this->migrations_dirs, 'down', 0, false);\n $expect_down_files = array(\n array(\n 'version' => '20090122193325',\n 'class' => 'AddNewTable',\n 'file' => '20090122193325_AddNewTable.php',\n 'module' => 'default'\n ),\n array(\n 'version' => 3,\n 'class' => 'AddIndexToBlogs',\n 'file' => '003_AddIndexToBlogs.php',\n 'module' => 'default'\n ),\n array(\n 'version' => 1,\n 'class' => 'CreateUsers',\n 'file' => '001_CreateUsers.php',\n 'module' => 'default'\n )\n );\n $this->assertEquals($expect_down_files, $actual_down_files);\n }", "public function __invoke()\n {\n $this->migrate();\n }", "public function callMigration()\n {\n Artisan::call('lucy:migration', $this->builder->getAttribute('migration'));\n\n Artisan::call('migrate');\n }", "public function __invoke(RunMigrator $runMigrator): void\n {\n $migratorEntity = $this->migratorRepository->find($runMigrator->getMigratorId());\n if (null === $migratorEntity) {\n $this->failure('Unknown migrator ID.', [\n 'id' => $runMigrator->getMigratorId(),\n ]);\n }\n $this->migratorEntity = $migratorEntity;\n\n if (null === $this->migratorEntity->getMigration()) {\n $this->failure('Migrator has no migration.', [\n 'id' => $this->migratorEntity->getId(),\n ]);\n }\n $this->migrationEntity = $this->migratorEntity->getMigration();\n\n // Do not run migrator multiple times\n if (ComponentStatus::CREATED !== $this->migratorEntity->getStatus()) {\n $this->logger->notice('Migrator already executed.', [\n 'migrator' => $this->migratorEntity->getId(),\n ]);\n return;\n }\n\n // Canceled/failed migration\n if ($this->migrationEntity->getStatus()->isCanceling()) {\n $this->migratorEntity->setStatus(ComponentStatus::CANCELED);\n $this->entityManager->flush();\n $this->logger->notice('Canceled migrator.', [\n 'migrator' => $this->migratorEntity->getId(),\n ]);\n return;\n }\n\n // Update migration status\n try {\n $this->checkMigrationStatus();\n } catch (MigratorNotReadyException $exception) {\n $this->logger->notice($exception->getMessage());\n return;\n }\n\n // Update task status\n $this->migratorEntity\n ->setStatus(ComponentStatus::RUNNING)\n ->setStartedAt();\n $this->entityManager->flush();\n\n // Run migrator\n try {\n $migrator = $this->getMigratorService($this->migratorEntity);\n $totalPushCount = 0;\n\n $puller = $migrator->getPuller();\n $pusher = $migrator->getPusher();\n foreach ($migrator->getExecutor()->execute($puller, $pusher) as $pushedItemCount) {\n $totalPushCount += $pushedItemCount;\n }\n } catch (\\Throwable $error) {\n $this->failure('Migrator failed.', [\n 'id' => $this->migratorEntity->getId(),\n 'error' => $error\n ]);\n }\n\n // Migrator succeeded\n $this->migratorEntity\n ->setStatus(ComponentStatus::FINISHED)\n ->setFinishedAt();\n $this->entityManager->flush();\n\n // Dispatch next messages\n $this->dispatchNextMessages();\n }", "public function test_get_runnable_migrations_going_up_with_target_version_no_current()\n {\n $migrator_util = new Ruckusing_Util_Migrator($this->adapter);\n $actual_up_files = $migrator_util->get_runnable_migrations($this->migrations_dirs, 'up', 3, false);\n $expect_up_files = array(\n array(\n 'version' => 1,\n 'class' => 'CreateUsers',\n 'file' => '001_CreateUsers.php',\n 'module' => 'default'\n ),\n array(\n 'version' => 3,\n 'class' => 'AddIndexToBlogs',\n 'file' => '003_AddIndexToBlogs.php',\n 'module' => 'default'\n )\n );\n $this->assertEquals($expect_up_files, $actual_up_files);\n }", "public function markAsExecuted(MigrationContract $migration): void;", "function migrate($migrateTo){\n\t$settingsModel = new Settings;\n\t(int) $currentVersion = $settingsModel->getVersion();\n\t\n\t//Display current database version\n\tif($migrateTo == 'version'){\n\t\techo \"\\n\\n\";\n\t\tdie(\"Database is currently at version #\".$currentVersion.\"\\n\\n\");\n\t}\n\t\n\t//Die if trying to migrate to current version - duh!\n\tif($migrateTo == $currentVersion){\n\t\techo \"\\n\\n\";\n\t\tdie(\"Database already at version #\".$migrateTo.\"\\n\\n\");\n\t}\n\t\n\t//Get migration scripts\n\t$migrations = scandir(APPLICATION_PATH.\"/../scripts/migrations\");\n\t\n\t//Get latest migration number and filter .. and .\n\tforeach($migrations AS $migration){\n\t\tif($migration<> '.' && $migration <> '..'){\n\t\t\t(int) $number = str_replace(\"migration\",'',str_replace(\".php\",'',$migration));\n\t\t\t\n\t\t\t$latestMigration = $number;\n\t\t}\n\t}\n\t\n\t//decide whether to take user input or migrate to most recent version\n\tif(isset($migrateTo)){\n\t\t(int)$migrateTo = $migrateTo;\n\t} else {\n\t\t(int)$migrateTo = $latestMigration;\n\t}\n\t\n\t//Die if trying to migrate to current version - duh!\n\tif($latestMigration == $currentVersion){\n\t\techo \"\\n\\n\";\n\t\tdie(\"Database already at version #\".$migrateTo.\"\\n\\n\");\n\t}\n\t\n\t//decide whether we are migrating up or down and order scripts accordingly\n\tif($migrateTo <= $currentVersion){\n\t\t$direction = 'down';\n\t\t$migrations = array_reverse($migrations);\n\t} else {\n\t\t$direction = 'up';\n\t}\n\t\n\t//build runFiles array\n\t$runFiles = array();\n\tforeach($migrations AS $migration){\n\t\tif($migration<> '.' && $migration <> '..'){\n\t\t\t//get only the version number\n\t\t\t(int) $number = str_replace(\"migration\",'',str_replace(\".php\",'',$migration));\n\t\t\tif($direction == 'up'){\n\t\t\t\tif($currentVersion < $number && $number <= $migrateTo){\n\t\t\t\t\t//add to runFiles array\n\t\t\t\t\t$runFiles[] = $migration;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif($direction == 'down'){\n\t\t\t\tif($currentVersion >= $number && $number > $migrateTo){\n\t\t\t\t\t//add to runFiles array\n\t\t\t\t\t$runFiles[] = $migration;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}\n\t}\n\t//start counter at 0\n\t$migratedTo = 0;\n\n\t//cycle through scripts\n\tforeach($runFiles AS $file){\n\t\t//get only the version number\n\t\t(int) $number = str_replace(\"migration\",'',str_replace(\".php\",'',$file));\n\t\t\n\t\t//get migration class name\n\t\t$className = ucwords(str_replace(\".php\",'',$file));\n\t\t\n\t\t//include dependencies\n\t\tinclude APPLICATION_PATH.'/../scripts/migrations/'.$file;\n\t\t\n\t\t//instantiate migration class\n\t\t$migration = new $className;\n\t\t\n\t\tif($direction == 'up'){\n\t\t\t//run up() migration method\n\t\t\t$migration->up();\n\t\t\t//mark as last migration run\n\t\t\t$migratedTo = $number;\n\t\t}\n\t\tif($direction == 'down'){\n\t\t\t//run down migration method\n\t\t\t$migration->down();\n\t\t\t//mark as lat migration run\n\t\t\t$migratedTo = $number - 1;\n\t\t}\n\t\t\n\t\t\n\t}\n\t//update db with new version number\n\t$settingsModel->setVersion($migratedTo);\n\t\n\t//output results to terminal\n\techo \"\\n\\n\";\n\techo \"Database Migrated to Version #\".$migratedTo;\n\techo \"\\n\\n\";\n\n}", "public function test_get_runnable_migrations_going_up_no_target_version()\n {\n $migrator_util = new Ruckusing_Util_Migrator($this->adapter);\n $actual_up_files = $migrator_util->get_runnable_migrations($this->migrations_dirs, 'up', false);\n $expect_up_files = array(\n array(\n 'version' => 1,\n 'class' => 'CreateUsers',\n 'file' => '001_CreateUsers.php',\n 'module' => 'default'\n ),\n array(\n 'version' => 3,\n 'class' => 'AddIndexToBlogs',\n 'file' => '003_AddIndexToBlogs.php',\n 'module' => 'default'\n ),\n array(\n 'version' => '20090122193325',\n 'class' => 'AddNewTable',\n 'file' => '20090122193325_AddNewTable.php',\n 'module' => 'default'\n )\n );\n $this->assertEquals($expect_up_files, $actual_up_files);\n }", "public function runRollback()\r\n\t{\r\n\t\t$response = \"\";\r\n\t\t$response .= $this->ensureRepositoryExist();\r\n\t\t$migration_batch = $this->repository->getLastBatchNumber();\r\n\t\t$repository = $this->rollbackRepository();\r\n\t\tif (count($repository) > 0) {\r\n\t\t\tforeach ($repository as $file) {\r\n\t\t\t\t$migration_name = $this->removeDotPhp($file);\r\n\t\t\t\t$schema = $this->runDown($file);\r\n\t\t\t\tif ($schema != \"\") {\r\n\t\t\t\t\t$query_response = DB()->query($schema);\r\n\t\t\t\t\tif ($query_response) {\r\n\r\n\t\t\t\t\t\t// Once we have run a migrations file, we remove migration to repository.\r\n\t\t\t\t\t\t$this->repository->delete($migration_name, $migration_batch);\r\n\t\t\t\t\t\t$response .= nl2br(\"Rolled back: $migration_name\\n\");\r\n\t\t\t\t\t} else {\r\n\r\n\t\t\t\t\t\t$response .= nl2br(\"Failed: $migration_name\\n\");\r\n\t\t\t\t\t\t$response .= nl2br(\"-- $query_response[error]\\n\");\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\r\n\t\t\t\t\t$response .= nl2br(\"Empty: $migration_name\\n\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} else {\r\n\r\n\t\t\t$response .= nl2br(\"Nothing to rollback.\\n\");\r\n\t\t}\r\n\r\n\t\treturn $response;\r\n\t}", "public function rollbackAction(null|int $version=null):void{\n $currentVersion = Migration::getCurrentVersion();\n $migrations = glob($this->config->application->migrationsDir.'*.php');\n if(!isset($version)){\n $version = count($migrations)-1;\n }\n if((int)$version >= $currentVersion){\n Cli::error('Nothing to migrate');\n }\n for($i=$currentVersion; $i>$version; $i--){\n $class= \"MigrationVersion\".$i; \n $migration = new $class();\n $this->executeQueries($migration->down()); \n \n Migration::setCurrentVersion($i-1);\n }\n }", "abstract protected function doRollback();", "public function getAvailableMigrations($target=null)\n\t{\n\t\t// for normal migration we need all files to target\n\t\t// for rollbacks we need from target to the greatest migration\n\t\t$filter = $this->getFilter();\n\t\tif (!$this->isDownwards($target)) {\n\t\t\tif (null !== $target) {\n\t\t\t\t$filter->setToVersion($target);\n\t\t\t}\n\t\t} else {\t// rollback\n\t\t\t$filter->setFromVersion($target);\n\t\t\t$filter->setToVersion($this->getGreatestMigration());\n\t\t}\n\n\t\t$migration_steps = $this->getMigrationSteps();\n\n\t\t// migrations to be executed\n\t\t$to_execute = array();\n\t\tif ($this->isDownwards($target)) {\n\t\t\t// rollback: execute the common part of $executed and $migration_refs\n\t\t\t$executed = $this->getExecutedMigrations();\n\t\t\tforeach($migration_steps as $ref => $migration_class) {\n\t\t\t\tif (array_key_exists($ref, $executed)) {\n\t\t\t\t\t$to_execute[] = $ref;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t// migration: execute what's missing - the different of $executed and $available\n\t\t\t$to_execute = array_diff(array_keys($migration_steps), array_keys($this->getExecutedMigrations()));\n\t\t}\n\t\t\n\t\t// go through $to_execute and find the migration steps\n\t\t$migrations = array();\n\t\tforeach ($to_execute as $ref) {\n\t\t\t$migrations[$ref] = $migration_steps[$ref];\n\t\t}\n\t\t\n\t\t// sort migrations according to filter and target\n\t\t// remove one so that to avoid executing target in the case of rollback\n\t\t$this->sortMigrations($migrations, $target);\n\t\tif ($this->isDownwards($target)) {\n\t\t\tarray_pop($migrations);\n\t\t}\n\t\treturn $migrations;\n\t}", "public function testExecute()\n {\n $params = [\n '--connection' => 'test',\n ];\n $commandTester = $this->getCommandTester($params);\n $migrations = $this->getMigrations();\n $migrations->migrate();\n\n $commandTester->execute([\n 'command' => $this->command->getName(),\n '--connection' => 'test',\n '--seed' => 'NumbersSeed',\n ]);\n\n $display = $this->getDisplayFromOutput();\n $this->assertTextContains('== NumbersSeed: seeded', $display);\n\n $result = $this->connection->selectQuery()\n ->select(['*'])\n ->from('numbers')\n ->order('id DESC')\n ->limit(1)\n ->execute()->fetchAll('assoc');\n $expected = [\n [\n 'id' => '1',\n 'number' => '10',\n 'radix' => '10',\n ],\n ];\n $this->assertEquals($expected, $result);\n\n $migrations->rollback(['target' => 'all']);\n }", "public function execute()\n {\n $configPath = Yii::getAlias($this->consoleConfig);\n $app = new Application(require($configPath));\n\n // Wipe current integration DB\n if ($this->wipeExistingDb) {\n $dbFile = Yii::getAlias($this->dbFile);\n if (file_exists($dbFile)) {\n unlink($dbFile);\n }\n }\n\n $parts = $app->createController('migrate/up');\n\n if ($parts === false) {\n throw new Exception('Could not create controller');\n }\n\n /* @var $controller MigrateController */\n list($controller, $actionID) = $parts;\n\n $controller->interactive = false;\n $result = $controller->runAction($actionID, []);\n if ($result !== null && $result !== MigrateController::EXIT_CODE_NORMAL) {\n throw new Exception('Exit status was ' . VarDumper::dumpAsString($result));\n }\n }", "public function migrate()\n\t{ \n\t\t(new MigratorInterface)->migrate();\n\t}", "public static function executeMigrationQuery($updateSql, $errorToIgnore, $file)\n {\n try {\n Db::exec($updateSql);\n } catch (\\Exception $e) {\n self::handleQueryError($e, $updateSql, $errorToIgnore, $file);\n }\n }", "function rollback(): void;", "function runUp()\n{\n $files = scandir(LIB_ROOT . '/migrations');\n\n $db_migration_version = get_current_migration_version();\n\n $migrations = array();\n\n foreach($files as $file)\n {\n if(preg_match('/migration_([1-9][0-9]*)\\.php/i', $file, $matches))\n {\n $migration_version = $matches[1];\n\n // we only care about this migration if it has not been performed yet\n if($migration_version > $db_migration_version)\n {\n require_once LIB_ROOT . '/migrations/' . $matches[0];\n\n $migrations[$migration_version] = 'Migration_' . $migration_version;\n }\n }\n }\n\n if(count($migrations) == 0)\n echo 'There are no migrations to run; DB is already up to date (at version ' . $db_migration_version . ').' . \"\\n\\n\";\n else\n {\n // sort migrations, so that we execute them in ascending order\n ksort($migrations);\n\n $count = 0;\n\n foreach ($migrations as $id => $class_name)\n {\n $migrationClass = new $class_name();\n\n $count++;\n\n echo 'Running migration ' . $id . ' (' . $count . ' of ' . count($migrations) . ')...' . \"\\n\";\n\n try\n {\n $migrationClass->Up();\n fetch_none('UPDATE migration_version SET version=' . quote_smart($id));\n echo ' done!' . \"\\n\";\n }\n catch(Exception $e)\n {\n echo ' Encountered an exception during migration:' . \"\\n\";\n echo ' ' . $e->getMessage() . \"\\n\";\n echo ' Migration was not completed; the database may be left in a weird state.' . \"\\n\";\n if($count < count($migrations))\n {\n $remaining = (count($migrations) - $count);\n echo $remaining . ' remaining migration' . ($remaining == 1 ? '' : 's') . ' will not be run.' . \"\\n\";\n }\n echo \"\\n\";\n die();\n }\n }\n\n echo 'All done!' . \"\\n\\n\";\n }\n}", "public abstract function rollback();", "private function sortMigrations(& $migrations, $target)\n\t{\n\t\t$filter = $this->getFilter();\n\t\tif (!$this->isDownwards($target)) {\n\t\t\tuksort($migrations, array($filter, 'compare'));\n\t\t} else {\n\t\t\tuksort($migrations, function($a, $b) use ($filter) {\n\t\t\t\treturn $filter->compare($b, $a);\t// reverse arguments\n\t\t\t} );\n\t\t}\n\t\t\n\t}", "public function rollback();", "public function rollback();", "public function rollback();", "public function rollback();", "public function migrate($execute = false)\n {\n }", "protected function execute(InputInterface $input, OutputInterface $output)\n {\n $io = new SymfonyStyle($input, $output);\n\n $migration_dir = $this->config_file->getMigrationDir();\n $migration_table = $this->config_file->getMigrationTable();\n\n // Create migrations table if not yet created.\n if (!$this->isMigrationTableCreated()) {\n\n $this->createMigrationTable();\n\n $output->writeln(\n \"<info>Created migrations table under name '$migration_table'.</info>\"\n );\n }\n\n $migrations_to_run = $this->getMigrationsToRun();\n\n // Kill command if no migrations to run\n if (empty($migrations_to_run)) {\n\n $output->writeln('<comment>No migrations to run.</comment>');\n\n exit;\n }\n\n try {\n\n $this->db_adapter->begin();\n\n $migrated_files = [];\n\n // Run each pending migration\n foreach ($migrations_to_run as $migration) {\n\n // Get the full path to the migration\n $full_path = $migration_dir . DIRECTORY_SEPARATOR . $migration;\n\n // Read out the SQL contents\n $contents = file_get_contents($full_path);\n\n // Attempt to execute the for the current migration\n $this->db_adapter->execute($contents);\n\n $migrated_files[] = $migration;\n }\n\n // Add the files that were migrated to the migrations table.\n $this->markAsMigrated($migrated_files);\n\n $this->db_adapter->commit();\n\n $output->writeln('<info>Your files have made it to the Promised Land.</info>');\n\n // Display files that were migrated\n $io->table(['Files Migrated'], [$migrated_files]);\n\n } catch (\\Exception $e) {\n\n $this->db_adapter->rollback();\n\n $output->writeln('<error>An error occurred while running migrations.</error>');\n\n throw $e;\n }\n }", "protected function runUp($file, $batch, $pretend)\n {\n $migration = $this->resolve(\n $name = $this->getMigrationName($file)\n );\n\n if (!$name) {\n return;\n }\n\n if ($pretend) {\n return $this->pretendToRun($migration, 'up');\n }\n\n try {\n $this->runMigration($migration, 'up');\n $this->repository->log($name, $batch);\n $this->logs[] = [\n 'migration' => $name,\n 'message' => 'Migrated',\n 'success' => true,\n ];\n } catch (\\Exception $e) {\n $this->logs[] = [\n 'migration' => $name,\n 'message' => $e->getMessage(),\n 'success' => false,\n ];\n }\n }", "protected function migrate($path = null, $name = null)\n {\n\t\tif (! $this->confirmToProceed()) {\n return;\n }\n\n $this->prepareDatabase();\n\t\t\n\t\t$path = $module = null;\n\t\tif(!$path && $name) {\n\t\t\t$module = $this->getModule($name);\n\t\t\t$path = $module->getExtraPath('Database/Migrations');\n\t\t} else if($path && !$name) {\n\t\t\t$path = $this->laravel->basePath().'/'.$path;\n\t\t}\n\t\tif(!$path)\n\t\t\t$path = $this->getMigrationPath();\n\n // The pretend option can be used for \"simulating\" the migration and grabbing\n // the SQL queries that would fire if the migration were to be run against\n // a database for real, which is helpful for double checking migrations.\n $pretend = $this->input->getOption('pretend');\n\t\t\n\t\tif($module)\n\t\t\t$this->migrator->setModule($module);\n\t\t\n\t\tif(version_compare(app()->version(), '5.2', '>='))\n\t\t\t$pretend = $this->input->getOptions();\n\t\t\n $this->migrator->run($path, $pretend);\n\n // Once the migrator has run we will grab the note output and send it out to\n // the console screen, since the migrator itself functions without having\n // any instances of the OutputInterface contract passed into the class.\n foreach ($this->migrator->getNotes() as $note) {\n $this->output->writeln($note);\n }\n\n // Finally, if the \"seed\" option has been given, we will re-run the database\n // seed task to re-populate the database, which is convenient when adding\n // a migration and a seed at the same time, as it is only this command.\n if ($this->option('seed')) {\n $this->call('db:seed', ['module' => $name, '--force' => true]);\n }\n\n }", "public function addRunMigration(string $name) : void\n {\n $this->queryBuilderFactory->make()->insert($this->table, ['migration' => $name]);\n }", "public function runMigrations()\n {\n if (file_exists($this->baseSqlite())) {\n return;\n }\n\n config(['database.connections.sqlite.database' => $this->copySqlite()]);\n if (method_exists($this, 'withoutMockingConsoleOutput')) {\n $this->withoutMockingConsoleOutput()->artisan('migrate');\n } else {\n Artisan::call('migrate');\n }\n\n // Run Seeders\n copy($this->copySqlite(), $this->baseSqlite());\n return;\n }", "public function runDatabaseMigrations()\n {\n $this->parentRunDatabaseMigrations();\n\n $this->artisan('cms:migrate');\n\n $this->beforeApplicationDestroyed(function () {\n $this->artisan('cms:migrate:rollback');\n });\n }", "function _migrate($filename) {\n\t\t$migrations = $this->migration;\n\n\t\t$this->conn->execute(file_get_contents(\"migrations/$filename\"));\n\t\t$migrations->save($migrations->newEntity(['migration_file' => $filename]));\n\t}", "abstract protected function doRollback($savepoint = null);", "private function migration()\n {\n $location = $this->args['location'] . DIRECTORY_SEPARATOR . 'migrations' . DIRECTORY_SEPARATOR;\n if (!is_dir($location))\n {\n mkdir($location);\n }\n\n $backtrace = debug_backtrace();\n $calling_function = $backtrace[1]['function'];\n\n if ($calling_function === \"model\")\n {\n $class_name = 'Migration_Add_';\n $filename = 'add_';\n $table_name = '';\n\n if (!empty($this->args['subdirectories']))\n {\n $dirs = explode(DIRECTORY_SEPARATOR, $this->args['subdirectories']);\n $dirs = join('_', $dirs);\n $class_name .= strtolower($dirs) . '_';\n $filename .= strtolower($dirs) . '_';\n $table_name .= strtolower($dirs) . '_';\n }\n $args = array(\n 'class_name' => $class_name . Inflector::pluralize($this->args['name']),\n 'table_name' => $table_name . Inflector::pluralize(strtolower($this->args['name'])),\n 'filename' => $filename . Inflector::pluralize(ApplicationHelpers::underscorify($this->args['name'])) . '.php',\n 'application_folder' => $this->args['application_folder'],\n 'parent_class' => $this->args['parent_migration'],\n 'extra' => $this->extra\n );\n\n $template_name = 'migration';\n }\n else\n {\n $args = array(\n 'class_name' => 'Migration_' . $this->args['name'],\n 'table_name' => $this->get_table_name_out_of_migration_name(),\n 'filename' => $this->args['filename'],\n 'application_folder' => $this->args['application_folder'],\n 'parent_class' => $this->args['parent_migration'],\n 'extra' => $this->extra\n );\n\n $template_name = 'empty_migration';\n }\n\n $template = new TemplateScanner($template_name, $args);\n $migration = $template->parse();\n\n $migration_number = MigrationHelpers::get_migration_number($this->args['location']);\n $filename = $location . $migration_number . '_' . $args['filename'];\n $potential_duplicate_migration_filename = MigrationHelpers::decrement_migration_number($migration_number) . '_' . $args['filename'];\n $potential_duplicate_migration = $location . $potential_duplicate_migration_filename;\n\n $message = \"\\t\";\n if (file_exists($potential_duplicate_migration))\n {\n $message .= 'Migration already exists : ';\n if (php_uname(\"s\") !== \"Windows NT\")\n {\n $message = ApplicationHelpers::colorize($message, 'light_blue');\n }\n $message .= $this->args['application_folder'] . DIRECTORY_SEPARATOR . 'migrations' . DIRECTORY_SEPARATOR . $potential_duplicate_migration_filename;\n }\n else if (file_put_contents($filename, $migration) && MigrationHelpers::add_migration_number_to_config_file($this->args['location'], $migration_number))\n {\n $message .= 'Created Migration: ';\n if (php_uname(\"s\") !== \"Windows NT\")\n {\n $message = ApplicationHelpers::colorize($message, 'green');\n }\n $message .= $this->args['application_folder'] . DIRECTORY_SEPARATOR . 'migrations' . DIRECTORY_SEPARATOR . $migration_number . '_' . $args['filename'];\n }\n else\n {\n $message .= 'Unable to create migration: ';\n if (php_uname(\"s\") !== \"Windows NT\")\n {\n $message = ApplicationHelpers::colorize($message, 'red');\n }\n $message .= $this->args['application_folder'] . DIRECTORY_SEPARATOR . 'migrations' . DIRECTORY_SEPARATOR . $migration_number . '_' . $this->args['filename'];\n }\n\n fwrite(STDOUT, $message . PHP_EOL);\n\n return;\n }", "private function shouldExecuteMigration($direction, Version $version, $to, $migrated)\n {\n if ('down' === $direction) {\n if (!in_array($version->getVersion(), $migrated)) {\n return false;\n }\n\n return $version->getVersion() > $to;\n }\n\n if ('up' === $direction) {\n if (in_array($version->getVersion(), $migrated)) {\n return false;\n }\n\n return $version->getVersion() <= $to;\n }\n }", "public function testMigrationsOptionsRollback()\n {\n $this->exec('completion options migrations.migrations rollback');\n $this->assertCount(1, $this->_out->messages());\n $output = $this->_out->messages()[0];\n $expected = '--connection -c --date -d --dry-run -x --fake --force -f --help -h --no-lock --plugin -p';\n $expected .= ' --quiet -q --source -s --target -t --verbose -v';\n $outputExplode = explode(' ', trim($output));\n sort($outputExplode);\n $expectedExplode = explode(' ', $expected);\n sort($expectedExplode);\n\n $this->assertEquals($outputExplode, $expectedExplode);\n }", "public function migrate()\n {\n $fileSystem = new Filesystem();\n $classFinder = new ClassFinder();\n\n foreach ($fileSystem->files(__DIR__.'/../../../../tests/NilPortugues/App/Migrations') as $file) {\n $fileSystem->requireOnce($file);\n $migrationClass = $classFinder->findClass($file);\n (new $migrationClass())->down();\n (new $migrationClass())->up();\n }\n }", "private function moveMigration($arguments){\n\n $migrationPathWillBeMoved=staticPathModel::getProjectPath($arguments['move']).'/'.utils::getAppVersion($arguments['move']).'/migrations/schemas/'.$arguments['schema'];\n $newPath=root.'/'.staticPathModel::$storeMigrationsPath.'/schemas/'.$arguments['schema'];\n\n\n $migrationPurePath=str_replace(root.'/','',$migrationPathWillBeMoved);\n $migrationNamespace=str_replace('/','\\\\',$migrationPurePath);\n $newMigrationNamespace=str_replace('/','\\\\',str_replace(root.'/','',$newPath));\n\n\n if(rename($migrationPathWillBeMoved,$newPath)){\n\n foreach (glob($newPath.\"/*.php\") as $filename) {\n utils::changeClass($filename,[\n $migrationNamespace=>$newMigrationNamespace\n ]);\n }\n\n echo 'migration named '.$arguments['schema'].' in '.$arguments['move'].' project has been successfully moved';\n echo PHP_EOL;\n }\n\n\n $migrationSeedPathWillBeMoved=staticPathModel::getProjectPath($arguments['move']).'/'.utils::getAppVersion($arguments['move']).'/migrations/seeds';\n $newSeedPath=root.'/'.staticPathModel::$storeMigrationsPath.'/seeds';\n\n\n $migrationSeedPurePath=str_replace(root.'/','',$migrationSeedPathWillBeMoved);\n $migrationSeedNamespace=str_replace('/','\\\\',$migrationSeedPurePath);\n $newMigrationSeedNamespace=str_replace('/','\\\\',str_replace(root.'/','',$newSeedPath));\n\n if(rename($migrationSeedPathWillBeMoved,$newSeedPath)){\n\n foreach (glob($newSeedPath.\"/*.php\") as $filename) {\n utils::changeClass($filename,[\n $migrationSeedNamespace=>$newMigrationSeedNamespace\n ]);\n }\n\n echo 'migration seeds named '.$arguments['schema'].' in '.$arguments['move'].' project has been successfully moved';\n\n }\n }", "public function testExecuteWrongCustomParams()\n {\n $params = [\n '--connection' => 'test',\n '--source' => 'DerpSeeds',\n ];\n $commandTester = $this->getCommandTester($params);\n $migrations = $this->getMigrations();\n $migrations->migrate();\n\n $commandTester->execute([\n 'command' => $this->command->getName(),\n '--connection' => 'test',\n '--source' => 'DerpSeeds',\n ]);\n\n $display = $this->getDisplayFromOutput();\n $this->assertTextNotContains('seeded', $display);\n $migrations->rollback(['target' => 'all']);\n }", "public function execute() {\n\t\t\t$connection = \\Leap\\Core\\DB\\Connection\\Pool::instance()->get_connection($this->data_source);\n\t\t\tif ($this->before !== NULL) {\n\t\t\t\tcall_user_func_array($this->before, array($connection));\n\t\t\t}\n\t\t\t$connection->execute($this->command());\n\t\t\tif ($this->after !== NULL) {\n\t\t\t\tcall_user_func_array($this->after, array($connection));\n\t\t\t}\n\t\t}", "public function deploy(IModel $target);", "function executePhinxMigrations($command, $environment) \n{\n $path=\"../../../vendor/bin/phinx\";\n $cmd=\"$path $command -e $environment\";\n \n $outArray=array();\n $retValue='';\n \n exec($cmd,$outArray,$retValue);\n print_r($outArray);\n}", "public function migrate()\n {\n /**\n * @var $migrator Migrator\n */\n $migrator = $this->app->make('migrator');\n\n /**\n * @var $migratonRepository DatabaseMigrationRepository\n */\n $migratonRepository = $this->app->make('migration.repository');\n\n $migratonRepository->createRepository();\n\n $migrator->run([__DIR__ . \"/../database/migrations\"]);\n\n }", "public function handle($arguments){\n\n //make somethings\n $arg=$this->getArg($arguments);\n if(array_key_exists(\"move\",$arg)){\n return $this->moveMigration($arg);\n }\n $migrationPath=\"\\\\src\\\\store\\\\packages\\\\providers\\\\migrations\\\\manager\";\n $migration=new $migrationPath($arg);\n return $migration->handle();\n }", "public function migrateUp($class)\n {\n if ($class === self::BASE_MIGRATION) {\n return true;\n }\n\n $this->stdout(\"*** applying $class\\n\", Console::FG_YELLOW);\n $start = microtime(true);\n $migration = parent::createMigration($class);\n if ($migration->up() !== false) {\n $time = microtime(true) - $start;\n $this->stdout(\"*** applied $class (time: \" . sprintf('%.3f', $time) . \"s)\\n\\n\", Console::FG_GREEN);\n\n return true;\n } else {\n $time = microtime(true) - $start;\n $this->stdout(\"*** failed to apply $class (time: \" . sprintf('%.3f', $time) . \"s)\\n\\n\", Console::FG_RED);\n\n return false;\n }\n }", "public function test_get_runnable_migrations_going_down_no_target_version()\n {\n $migrator_util = new Ruckusing_Util_Migrator($this->adapter);\n $actual_down_files = $migrator_util->get_runnable_migrations($this->migrations_dirs, 'down', false);\n $this->assertEquals(array() , $actual_down_files);\n }", "function RollbackTrans() {}", "public function rollback()\n {\n }", "public function rollback()\n {\n }", "public function migrate()\n\t{\n\t}", "public function generateAction():void{\n new Migration();\n }", "private function _run($file,$type='up'){\n require rtrim($this->migrations_dir,'/').\"/\".$file;\n $x=explode('_',$file);\n $date=$x[0];\n unset($x[0]);\n $class=rtrim(implode('_',$x),'.php');\n $class=new $class();\n switch ($type) {\n case 'down':\n $res=$class->down();\n if($res){\n $res=$this->db_link->query('DELETE FROM '.$this->tableName.\" WHERE migrate= '$file' \") or die(mysqli_error($this->db_link));\n return '<b style=\"color:green\">drop migration: '.$file.\"<b/><br/>\";\n }\n break;\n default:\n $res=$class->up();\n if($res){\n $res=$this->db_link->query('INSERT INTO '.$this->tableName.\" VALUES ('$file')\") or die(mysqli_error($this->db_link));\n return '<b style=\"color:green\">run: '.$file.\"<b/><br/>\";\n }\n break;\n }\n }", "public function runDatabaseMigrations()\n {\n if (!$this->runMigrations) {\n return;\n }\n\n $this->artisan('migrate:fresh');\n\n $this->app[Kernel::class]->setArtisan(null);\n\n $this->beforeApplicationDestroyed(function () {\n $this->artisan('migrate:rollback');\n });\n }", "public static function migrate()\n {\n\n // If there is not a declaration that migrations have been run'd\n if( ! isset($GLOBALS['migrated_test_database']))\n {\n // Run migrations\n require path('sys').'cli/dependencies'.EXT;\n\n $which_db = \\Config::get('database.default');\n $database = \\Config::get('database.connections.'.$which_db);\n\n $migration_table = null;\n if($which_db == 'mysql')\n {\n $query = \"SELECT COUNT(*) AS count FROM information_schema.tables WHERE table_schema = ? AND table_name = ?\";\n $migration_table = \\DB::query($query, array($database['database'], $database['prefix'].'laravel_migrations'));\n }\n\n // if($which_db == 'sqlite')\n // {\n // //$migration = \"SELECT * FROM {$database['database']}.sqlite_master WHERE type='table'\";\n // //sqlite3_exec(budb, \"SELECT sql FROM sqlite_master WHERE sql NOT NULL\"\n // \\sqlite_open(\":memory:\", $database['database']);\n // $migration = \\sqlite_exec($database['database'], \"SELECT sql FROM sqlite_master WHERE sql NOT NULL\");\n // }\n\n if(isset($migration_table['0']->count) and $migration_table['0']->count == '0')\n {\n Command::run(array('migrate:install'));\n echo \"\\n\";\n Command::run(array('migrate'));\n }\n else\n {\n Command::run(array('migrate:reset'));\n echo \"\\n\";\n Command::run(array('migrate'));\n }\n\n\n //Insert basic data\n\n // Declare that migrations have been run'd\n $GLOBALS['migrated_test_database'] = true;\n }\n }", "public function migrate()\n {\n $fileSystem = new Filesystem();\n\n $fileSystem->copy(\n __DIR__.'/../database/migrations/2018_06_29_032244_create_laravel_follow_tables.php',\n __DIR__.'/database/migrations/create_laravel_follow_tables.php'\n );\n\n foreach ($fileSystem->files(__DIR__.'/database/migrations') as $file) {\n $fileSystem->requireOnce($file);\n }\n\n (new \\CreateLaravelFollowTables())->up();\n (new \\CreateUsersTable())->up();\n (new \\CreateOthersTable())->up();\n }", "public function applyMigration()\n {\n $this->createMigrationsTable();\n $applied_migrations = $this->get_applied_migrations();\n\n $files = scandir(Application::$ROOT_DIR.'/migrations');\n $to_apply_migrations = array_diff($files, $applied_migrations);\n\n $new_migrations = [];\n\n foreach ($to_apply_migrations as $migration) {\n // skip unwanted folders\n if ($migration === '.' || $migration === '..') {\n continue;\n }\n require_once Application::$ROOT_DIR.'/migrations/'.$migration;\n\n $class_name = pathinfo($migration, PATHINFO_FILENAME);\n $instance = new $class_name();\n $instance->up();\n\n $new_migrations[] = $migration;\n }\n\n if (!empty($new_migrations)) {\n $this->saveMigration($new_migrations);\n }\n else {\n echo $this->log(\"All migrations are applied\");\n }\n }", "function rollback();", "private static function execute( $upgrading_from) {\n\t\tif ( version_compare( $upgrading_from, '3.99.0', '<' ) ) {\n\t\t\tself::migrate_from_3x_to_4_0_0();\n\t\t\tself::activate();\n\t\t}\n\t}", "public function migrate()\n {\n $this->syncRepository();\n $this->copyVariables();\n $this->copyDeployKeys();\n $this->reEnableBuilds();\n }", "public function rollback()\n\t{\n\t}", "public function rollback()\n\t{\n\t}", "public function rollBack()\n {\n $this->getActivePdo()->rollBack();\n }", "public function markAsNotExecuted(MigrationContract $migration): void;", "public function migrate($direction)\n\t{\n\t\tif ($direction == self::UP)\n\t\t{\n\t\t\t// Get files\n\t\t\t$files = scandir($this->migration_path);\n\t\t\t$files = array_slice($files, 2, count($files));\n\n\t\t\tif (in_array('migrations', R::inspect()))\n\t\t\t{\n\t\t\t\t// Get migrated records\n\t\t\t\t$migrated_files = R::getCol('SELECT name FROM migrations');\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$migrated_files = array();\n\t\t\t}\n\n\t\t\t// Get non migrated files\n\t\t\t$non_migrated = array_diff($files, $migrated_files);\n\n\t\t\t// Load non migrated files and execute\n\t\t\tforeach ($non_migrated as $file)\n\t\t\t{\n\t\t\t\t$instance = $this->loadMigration($file);\n\t\t\t\t$instance->up();\n\n\t\t\t\t// Record our migration\n\t\t\t\t$this->storeMigration($file);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$migration = R::findOne('migrations', ' ORDER BY created DESC ');\n\n\t\t\t// Load migration and migrate it down\n\t\t\t$instance = $this->loadMigration($migration->name);\n\t\t\t$instance->down();\n\n\t\t\t// Remove migration form database\n\t\t\tR::trash($migration);\n\t\t}\n\t}", "public function run($params){\n if(empty($params['source'])){\n echo 'parametre source manquant'.PHP_EOL;\n $this->show_help();\n }\n\n /** recuperation de la config pour les migrations */\n $migration_config = VekaServer\\Config\\Config::getInstance()->get('Migration');\n\n if(\n !isset( $migration_config[$params['source']])\n || empty( ($migration_config[$params['source']]['path'] ?? ''))\n || empty( ($migration_config[$params['source']]['name'] ?? ''))\n ){\n throw new Exception('No config found for source='.$params['source']);\n }\n\n $path = $migration_config[$params['source']]['path'];\n $name = $migration_config[$params['source']]['name'];\n\n $migration = new \\VekaServer\\Framework\\Migration( $path, $name);\n\n switch($params['action'] ?? ''){\n\n case 'init' :\n $migration->init();\n break;\n\n case 'upgrade' :\n $migration->upgrade();\n break;\n\n case 'downgrade' :\n $migration->downgrade();\n break;\n\n default :\n echo 'parametre action manquant'.PHP_EOL;\n $this->show_help();\n break;\n }\n\n }", "public function queueTarget($target) {\n\t\tif ($this->recipe === null) {\n\t\t\t$this->getRecipe();\n\t\t}\n\t\tif ($this->recipe !== null) {\n\t\t\tif ($this->recipe->hasTarget($target)) {\n\t\t\t\t$process = R::dispense('process');\n\t\t\t\t$process->status = 'Queued';\n\t\t\t\t$process->target = $target;\n\t\t\t\t$process->command = realpath(APPLICATION_PATH.'/../tools/phing/bin/phing');\n\t\t\t\t$debugMode = $this->getRecipe()->getDebugMode();\n\n\t\t\t\tif ($debugMode <= 0) {\n\t\t\t\t\t$process->command .= ' -f \"' . $this->getRecipe()->getPath() . '\" ' . $target;\n\t\t\t\t} elseif ($debugMode == 1) {\n\t\t\t\t\t$process->command .= ' -verbose -f \"' . $this->getRecipe()->getPath() . '\" ' . $target;\n\t\t\t\t} else {\n\t\t\t\t\t$process->command .= ' -verbose -debug -f \"' . $this->getRecipe()->getPath() . '\" ' . $target;\n\t\t\t\t}\n\t\t\t\t$process->percent = 0;\n\t\t\t\t$bean = $this->unbox();\n\t\t\t\t$bean->ownProcess[] = $process;\n\t\t\t} else {\n\t\t\t\tthrow new Exception('Target does not exist in recipe.');\n\t\t\t}\n\t\t} else {\n\t\t\tthrow new Exception('Recipe of this deployment has not been set.');\n\t\t}\n\t}", "public function rollback(){\n $this->db->exec('ROLLBACK TO xyz;');\n }", "public function runDatabaseMigrations()\n {\n $this->artisan('migrate:fresh', $this->migrateFreshUsing());\n\n $this->app[Kernel::class]->setArtisan(null);\n\n $this->beforeApplicationDestroyed(function () {\n $this->artisan('migrate:rollback');\n\n RefreshDatabaseState::$migrated = false;\n });\n }", "protected function updateMigrationTable()\n {\n $migration = str_replace('.php', '', basename(__FILE__));\n $batchResult = \\DB::select(\"SELECT max(batch) as batch FROM {$this->newDbName}.migrations\");\n $batch = $batchResult[0]->batch;\n\n \\DB::getPdo()->exec(\"INSERT INTO {$this->newDbName}.migrations (migration, batch) VALUES ('{$migration}', {$batch} + 1)\");\n }", "public function migrate()\n\t{\n\t\t$this->process( $this->mysql );\n\t}", "public function migrate()\n\t{\n\t\t$this->process( $this->mysql );\n\t}", "private function rollBack()\n\t{\n\t\tif (self::TRANSACTION) {\n\t\t\t$this->database->rollBack();\n\t\t}\n\t}", "public function migrate() {}", "private function migrate($slug)\n {\n $moduleName = studly_case($slug);\n\n if ( ! $this->module->exists($moduleName)) {\n $this->error(\"Module [$moduleName] does not exist.\");\n\n return;\n }\n\n $this->migrator->run(\n $this->getMigrationPath($slug),\n $this->getBooleanOption('pretend')\n );\n\n // Once the migrator has run we will grab the note output and send it out to\n // the console screen, since the migrator itself functions without having\n // any instances of the OutputInterface contract passed into the class.\n foreach ($this->migrator->getNotes() as $note) {\n if ( ! $this->option('quiet')) {\n $this->output->writeln($note);\n }\n }\n\n // Finally, if the \"seed\" option has been given, we will re-run the database\n // seed task to re-populate the database, which is convenient when adding\n // a migration and a seed at the same time, as it is only this command.\n if ($this->getBooleanOption('seed')) {\n $this->call('module:seed', [\n 'module' => $slug,\n '--force' => true\n ]);\n }\n }", "protected function executeSpecificStep() {}", "public function rollback()\n{\n\t$this->query('ROLLBACK');\n}", "public function test_resolve_current_version_going_down()\n {\n $this->clear_dummy_data();\n $this->insert_dummy_version_data(array(1,2,3));\n\n $migrator_util = new Ruckusing_Util_Migrator($this->adapter);\n $migrator_util->resolve_current_version(3, 'down');\n\n $executed = $migrator_util->get_executed_migrations();\n $this->assertEquals(false, in_array(3, $executed));\n $this->assertEquals(true, in_array(1, $executed));\n $this->assertEquals(true, in_array(2, $executed));\n }", "public function run(){\n $argumentAnalyzer = new CommandAnalyzer($this->config, $this->recordMigrator, $this->command);\n $argumentAnalyzer->executeArgs();\n }", "public function rollbackTransaction(): void;", "public function executeTableQuery($sql)\n {\n DEV_Loader::includeWPUpgrade();\n dbDelta($sql);\n }", "public function testExecuteSeedCallingOtherSeeders()\n {\n $params = [\n '--connection' => 'test',\n '--source' => 'CallSeeds',\n ];\n $commandTester = $this->getCommandTester($params);\n $migrations = $this->getMigrations();\n $migrations->migrate();\n\n $commandTester->execute([\n 'command' => $this->command->getName(),\n '--connection' => 'test',\n '--source' => 'CallSeeds',\n '--seed' => 'DatabaseSeed',\n ]);\n\n $display = $this->getDisplayFromOutput();\n $this->assertTextContains('==== NumbersCallSeed: seeded', $display);\n $this->assertTextContains('==== LettersSeed: seeded', $display);\n $migrations->rollback(['target' => 'all']);\n }", "protected function migration_process() {\n\t\t$available_languages = Fusion_Multilingual::get_available_languages();\n\t\tself::$available_languages = ( ! empty( $available_languages ) ) ? $available_languages : [ '' ];\n\n\t\t$this->migrate_options();\n\t}", "public function execute(string $setName, TablesList $tableCollection, ViewsList $viewCollection): void\n {\n foreach ($tableCollection->getTables() as $table => $sampler) {\n try {\n $this->ensureEmptyTargetTable($table, $this->sourceConnection, $this->destConnection);\n $sampler->setTableName($table);\n $sampler->setSourceConnection($this->sourceConnection);\n $sampler->setDestConnection($this->destConnection);\n $rows = $sampler->execute();\n $this->logger->info(\"$setName: migrated '$table' with '\" . $sampler->getName() . \"': $rows rows\");\n } catch (\\Exception $e) {\n $this->logger->error(\n \"$setName: failed to migrate '$table' with '\" . $sampler->getName() . \"': \" . $e->getMessage()\n );\n throw $e;\n }\n }\n\n foreach ($viewCollection->getViews() as $view) {\n $this->migrateView($view, $setName);\n }\n\n $this->migrateTableTriggers($setName, $tableCollection);\n }", "public function doDatabaseUpdate()\n\t{\n\t\ttry\n\t\t{\n\t\t\tif ($this->_backupDb)\n\t\t\t{\n\t\t\t\t$dbBackup = new DbBackup();\n\t\t\t\t$this->_dbBackupPath = $dbBackup->run();\n\t\t\t}\n\n\t\t\tif (blx()->migrations->runToTop())\n\t\t\t{\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\tcatch(\\Exception $e)\n\t\t{\n\t\t\t// We had migrations to run and something went wrong. Let's try to restore the backup database.\n\t\t\tif ($this->_backupDb)\n\t\t\t{\n\t\t\t\tUpdateHelper::rollBackDatabaseChanges($this->_dbBackupPath);\n\t\t\t}\n\n\t\t\tthrow $e;\n\t\t}\n\n\t\t// We had migrations to run and something went wrong. Let's try to restore the backup database.\n\t\tif ($this->_backupDb)\n\t\t{\n\t\t\tUpdateHelper::rollBackDatabaseChanges($this->_dbBackupPath);\n\t\t}\n\n\t\treturn false;\n\t}", "public function rollback() {\n\t\t$this->execute(\"ROLLBACK; SET autocommit = 1;\");\n\t}", "public function test_resolve_current_version_going_up()\n {\n $this->clear_dummy_data();\n $this->insert_dummy_version_data( array(1));\n\n $migrator_util = new Ruckusing_Util_Migrator($this->adapter);\n $migrator_util->resolve_current_version(3, 'up');\n\n $executed = $migrator_util->get_executed_migrations();\n $this->assertEquals(true, in_array(3, $executed));\n $this->assertEquals(true, in_array(1, $executed));\n $this->assertEquals(false, in_array(2, $executed));\n }", "public function rollback($steps=1, $redo=false)\n\t{\n\t\t$migrations = array_slice($this->getExecutedMigrations(), -$steps, null, true);\n\t\t\n\t\t$migration_steps = $this->getMigrationSteps();\n\t\t$to_execute = array();\n\t\tforeach ($migrations as $ref => $migration_class) {\n\t\t\t$to_execute[$ref] = $migration_steps[$ref];\n\t\t}\n\t\t\n\t\t$results = $this->doMigration($to_execute, AdapterInterface::DOWN);\n\t\tif ( $redo ) {\n\t\t\treset($migrations);\n\t\t\t$target = key($migrations);\n\t\t\t$results = array_merge($results,$this->migrate($target));\n\t\t}\n\t\t\n\t\treturn $results;\n\t}", "protected function executeAfter(...$migration_paths)\n {\n $this->execute_after = array_merge($this->execute_after, $migration_paths);\n }", "public function testErrorOnUnknownMigration()\n {\n $command = new MigrationExecuteCommand(new MigrationRegistry());\n $tester = new CommandTester($command);\n\n $tester->execute(\n [\n 'migration' => 'unknown',\n ], [\n // To get a ConsoleOutput\n 'capture_stderr_separately' => true,\n ]\n );\n\n self::assertNotSame(0, $tester->getStatusCode());\n self::assertStringContainsString('[ERROR]', $tester->getDisplay());\n }" ]
[ "0.65986085", "0.64678365", "0.63607174", "0.62464625", "0.59522486", "0.5951001", "0.59134656", "0.5821075", "0.58159983", "0.57255673", "0.5698722", "0.55741066", "0.5521083", "0.5499641", "0.54508257", "0.5421777", "0.54066783", "0.53917277", "0.538161", "0.5372396", "0.5353979", "0.53466886", "0.5333308", "0.52957624", "0.5286613", "0.52563703", "0.52535886", "0.52325636", "0.5214965", "0.52084225", "0.5208401", "0.52062607", "0.52062607", "0.52062607", "0.52062607", "0.5184644", "0.51806414", "0.51744384", "0.5148624", "0.5140525", "0.5138018", "0.51307917", "0.51162046", "0.5115415", "0.51036704", "0.5095538", "0.5073603", "0.5071583", "0.50706846", "0.5067478", "0.50582254", "0.5041846", "0.5025124", "0.5023907", "0.4984484", "0.4978281", "0.49764526", "0.49652106", "0.49492624", "0.49492624", "0.49452612", "0.4943464", "0.49295357", "0.49243996", "0.4918158", "0.4915192", "0.4914506", "0.49079323", "0.4899841", "0.48651403", "0.48629084", "0.48629084", "0.48592272", "0.48573294", "0.48524326", "0.484417", "0.48416296", "0.48399022", "0.48393527", "0.4830728", "0.48244983", "0.48244983", "0.4819132", "0.4814677", "0.48122537", "0.47967523", "0.47911242", "0.4790451", "0.47895017", "0.47849363", "0.4773086", "0.47725755", "0.47654322", "0.4754457", "0.47481567", "0.47459194", "0.4743824", "0.47434184", "0.47433886", "0.47401232" ]
0.72628933
0
Executes rollback. It reverses a given number (steps) of the already executed migrations.
public function rollback($steps=1, $redo=false) { $migrations = array_slice($this->getExecutedMigrations(), -$steps, null, true); $migration_steps = $this->getMigrationSteps(); $to_execute = array(); foreach ($migrations as $ref => $migration_class) { $to_execute[$ref] = $migration_steps[$ref]; } $results = $this->doMigration($to_execute, AdapterInterface::DOWN); if ( $redo ) { reset($migrations); $target = key($migrations); $results = array_merge($results,$this->migrate($target)); } return $results; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function rollbackAction(null|int $version=null):void{\n $currentVersion = Migration::getCurrentVersion();\n $migrations = glob($this->config->application->migrationsDir.'*.php');\n if(!isset($version)){\n $version = count($migrations)-1;\n }\n if((int)$version >= $currentVersion){\n Cli::error('Nothing to migrate');\n }\n for($i=$currentVersion; $i>$version; $i--){\n $class= \"MigrationVersion\".$i; \n $migration = new $class();\n $this->executeQueries($migration->down()); \n \n Migration::setCurrentVersion($i-1);\n }\n }", "public function runRollback()\r\n\t{\r\n\t\t$response = \"\";\r\n\t\t$response .= $this->ensureRepositoryExist();\r\n\t\t$migration_batch = $this->repository->getLastBatchNumber();\r\n\t\t$repository = $this->rollbackRepository();\r\n\t\tif (count($repository) > 0) {\r\n\t\t\tforeach ($repository as $file) {\r\n\t\t\t\t$migration_name = $this->removeDotPhp($file);\r\n\t\t\t\t$schema = $this->runDown($file);\r\n\t\t\t\tif ($schema != \"\") {\r\n\t\t\t\t\t$query_response = DB()->query($schema);\r\n\t\t\t\t\tif ($query_response) {\r\n\r\n\t\t\t\t\t\t// Once we have run a migrations file, we remove migration to repository.\r\n\t\t\t\t\t\t$this->repository->delete($migration_name, $migration_batch);\r\n\t\t\t\t\t\t$response .= nl2br(\"Rolled back: $migration_name\\n\");\r\n\t\t\t\t\t} else {\r\n\r\n\t\t\t\t\t\t$response .= nl2br(\"Failed: $migration_name\\n\");\r\n\t\t\t\t\t\t$response .= nl2br(\"-- $query_response[error]\\n\");\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\r\n\t\t\t\t\t$response .= nl2br(\"Empty: $migration_name\\n\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} else {\r\n\r\n\t\t\t$response .= nl2br(\"Nothing to rollback.\\n\");\r\n\t\t}\r\n\r\n\t\treturn $response;\r\n\t}", "public function rollback();", "public function rollback();", "public function rollback();", "public function rollback();", "function rollback(): void;", "public function rollback()\n {\n }", "public function rollback()\n {\n }", "public abstract function rollback();", "public function rollback()\n\t{\n\t}", "public function rollback()\n\t{\n\t}", "function rollback();", "function RollbackTrans() {}", "public function rollBack()\n {\n if ($this->store->transactions == 1) {\n $this->store->transactions = 0;\n\n $this->store->rollBack();\n } else {\n --$this->transactions;\n }\n }", "public function reverse(): void\n {\n $ranks = $this->ranks;\n\n $this->commit(array_values(collect($ranks)->reverse()->all()));\n }", "public function rollBack()\n {\n if ($this->transactions == 1) {\n $this->transactions = 0;\n\n $this->getPdo()->rollBack();\n } else {\n $this->transactions--;\n }\n }", "public function rollback($totalBatch = 0)\n {\n $migrate = \\Config\\Services::migrations();\n\n try {\n $migrate->regress($totalBatch);\n } catch (\\Exception $e) {\n throw new \\Exception($e->getMessage());\n }\n }", "public function rollback($pretend = false)\n\t{\n\t\t$tenants = $this->getTenants();\n\t\t$migrationsFileList = array();\n\n\t\tif ($this->usePath)\n\t\t{\n\t\t\t$this->note('<info>Rollback command initiated with path \"'.$this->path.'\"</info>');\n\t\t\t$migrationsFileList = $this->includeMigrations($this->path);\n\t\t}\n\n\t\t$everyMigration = 0;\n\n\t\tforeach($tenants as $tenant)\n\t\t{\n\t\t\t$this->manager->bootstrapConnectionByTenantName($tenant->tenant_name);\n\t\t\t$this->note('<info>Bootstrapped connection for:</info> '.$tenant->tenant_name);\n\n\t\t\t$this->setConnection($tenant->tenant_name);\n\t\t\t$this->repository->setSource($tenant->tenant_name);\n\n\t\t\t$migrations = $this->repository->getLast();\n\n\t\t\tif (count($migrations) == 0)\n\t\t\t{\n\t\t\t\t// Move on to the next tenant.\n\t\t\t\t$this->note('<info>Nothing to rollback on \"'.$tenant->tenant_name.'\".</info>');\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tforeach($migrations as $migration)\n\t\t\t{\n\t\t\t\t$this->note('<info>Rolling back \"'.$migration->migration.'\".</info>');\n\t\t\t\t$this->runDown((object) $migration, $pretend);\n\t\t\t}\n\n\t\t\t$everyMigration += count($migrations);\n\n\t\t}\n\n\t\treturn $everyMigration;\n\t}", "public function rollBack()\n {\n if ($this->transactionCount < 1) {\n return;\n }\n $transaction = $this->unprepared(\"ROLLBACK;\");\n if (false !== $transaction) {\n $this->transactionCount--;\n }\n }", "public function rollback()\n{\n\t$this->query('ROLLBACK');\n}", "protected function rollback() {\n $this->objDbConn->rollBack();\n }", "public function testMigrationsOptionsRollback()\n {\n $this->exec('completion options migrations.migrations rollback');\n $this->assertCount(1, $this->_out->messages());\n $output = $this->_out->messages()[0];\n $expected = '--connection -c --date -d --dry-run -x --fake --force -f --help -h --no-lock --plugin -p';\n $expected .= ' --quiet -q --source -s --target -t --verbose -v';\n $outputExplode = explode(' ', trim($output));\n sort($outputExplode);\n $expectedExplode = explode(' ', $expected);\n sort($expectedExplode);\n\n $this->assertEquals($outputExplode, $expectedExplode);\n }", "public function processRollback(array $options = array()) {\n if ($this->enabled) {\n $return = MigrationBase::RESULT_COMPLETED;\n if (method_exists($this, 'rollback')) {\n $this->options = $options;\n // TODO: Validate dependencies (migrations depending on us have no imported rows)\n /* if (!isset($options['force'])) {\n if (!$this->dependenciesComplete()) {\n return Migration::RESULT_SKIPPED;\n }\n }*/\n $this->beginProcess(MigrationBase::STATUS_ROLLING_BACK);\n try {\n $return = $this->rollback();\n }\n catch (Exception $exception) {\n // If something bad happened, make sure we clear the semaphore\n $this->endProcess();\n throw $exception;\n }\n $this->endProcess();\n }\n }\n else {\n $return = MigrationBase::RESULT_DISABLED;\n }\n return $return;\n }", "public function runAction():void{\n $currentVersion = Migration::getCurrentVersion();\n $migrations = glob($this->config->application->migrationsDir.'*.php');\n $version = count($migrations);\n if((int)$version === $currentVersion){\n Cli::error('Nothing to migrate');\n }\n for($i=($currentVersion+1); $i<=$version; $i++){\n $class= \"MigrationVersion\".$i; \n $migration = new $class();\n $this->executeQueries($migration->up());\n\n Migration::setCurrentVersion($i);\n }\n }", "public function rollBack(){\r\n $this->db->rollBack();\r\n }", "public function rollback(){\n $this->db->exec('ROLLBACK TO xyz;');\n }", "function rollback() {\n\t\t\tself::$db->rollback();\n\t\t}", "abstract protected function doRollback();", "public function rollBack()\r\n {\r\n if ($this->_txns == 1) {\r\n $this->getMaster()->rollBack();\r\n $this->_txns = 0;\r\n } else {\r\n --$this->_txns;\r\n }\r\n }", "protected function rollBackTransaction()\n {\n $this->container->make('db')->rollBack();\n }", "public function rollbackTransaction();", "public function test_get_runnable_migrations_going_down_with_target_version_no_current()\n {\n $migrator_util = new Ruckusing_Util_Migrator($this->adapter);\n $this->insert_dummy_version_data(array(3, '20090122193325'));\n $actual_down_files = $migrator_util->get_runnable_migrations($this->migrations_dirs, 'down', 1, false);\n $expect_down_files = array(\n array(\n 'version' => '20090122193325',\n 'class' => 'AddNewTable',\n 'file' => '20090122193325_AddNewTable.php',\n 'module' => 'default'\n ),\n array(\n 'version' => 3,\n 'class' => 'AddIndexToBlogs',\n 'file' => '003_AddIndexToBlogs.php',\n 'module' => 'default'\n )\n );\n $this->assertEquals($expect_down_files, $actual_down_files);\n $this->clear_dummy_data();\n\n $this->insert_dummy_version_data(array(3));\n $actual_down_files = $migrator_util->get_runnable_migrations($this->migrations_dirs, 'down', 1, false);\n $expect_down_files = array(\n array(\n 'version' => 3,\n 'class' => 'AddIndexToBlogs',\n 'file' => '003_AddIndexToBlogs.php',\n 'module' => 'default'\n )\n );\n $this->assertEquals($expect_down_files, $actual_down_files);\n\n //go all the way down!\n $this->clear_dummy_data();\n $this->insert_dummy_version_data(array(1, 3, '20090122193325'));\n $actual_down_files = $migrator_util->get_runnable_migrations($this->migrations_dirs, 'down', 0, false);\n $expect_down_files = array(\n array(\n 'version' => '20090122193325',\n 'class' => 'AddNewTable',\n 'file' => '20090122193325_AddNewTable.php',\n 'module' => 'default'\n ),\n array(\n 'version' => 3,\n 'class' => 'AddIndexToBlogs',\n 'file' => '003_AddIndexToBlogs.php',\n 'module' => 'default'\n ),\n array(\n 'version' => 1,\n 'class' => 'CreateUsers',\n 'file' => '001_CreateUsers.php',\n 'module' => 'default'\n )\n );\n $this->assertEquals($expect_down_files, $actual_down_files);\n }", "protected function rollback()\n\t{\n\t\t$this->db->rollback();\n\t}", "public function rollBack();", "public function rollback($id);", "private function rollBack()\n\t{\n\t\tif (self::TRANSACTION) {\n\t\t\t$this->database->rollBack();\n\t\t}\n\t}", "protected function rollbackToSavePoint(): void\n {\n foreach ($this->getActiveConnections() as $connection) {\n try {\n while ($connection->isTransactionActive()) {\n $connection->rollBack();\n }\n } catch (\\Exception $e) {\n }\n }\n }", "function rollback(){\n\t\ttry {\n\t\t\t$this->dbconn->rollBack();\n\t\t}catch(Exception $e){\n\t\t\t$this->logger->error($e->getMessage());\n\t\t\tthrow $e;\n\t\t}\n\t}", "public function rollbackTransaction() {\r\n\t\t// TODO: Implement transaction stuff.\r\n\t\t//$this->query('ROLLBACK TRANSACTION');\r\n\t}", "public function rollback()\n {\n if (self::$_transactionLevel == 1) {\n $this->getConnection()->rollBack();\n }\n \n if (self::$_transactionLevel > 0) {\n self::$_transactionLevel--;\n }\n }", "public function rollback()\n {\n set_time_limit(0);\n ignore_user_abort(true);\n\n $this->_lastOperationSucceed = false;\n\n $archiveManager = new Archive();\n $source = $archiveManager->unpack($this->getBackupPath(), $this->getBackupsDir());\n\n $file = new File($source);\n foreach ($file as $statement) {\n $this->getResourceModel()->runCommand($statement);\n }\n if ($this->keepSourceFile() === false) {\n @unlink($source);\n }\n\n $this->_lastOperationSucceed = true;\n\n return true;\n }", "private function rollback() {\n\t\tEE::warning( 'Exiting gracefully after rolling back. This may take some time.' );\n\t\tif ( $this->level > 0 ) {\n\t\t\t$this->delete_site();\n\t\t}\n\t\tEE::success( 'Rollback complete. Exiting now.' );\n\t\texit;\n\t}", "abstract protected function doRollback($savepoint = null);", "public function rollbackTransaction(): void;", "public function rollback() {\n\t\t$this->execute(\"ROLLBACK; SET autocommit = 1;\");\n\t}", "public function rollBack()\n {\n $this->getActivePdo()->rollBack();\n }", "public function run()\n {\n \n\n \\DB::table('migrations')->delete();\n \n \\DB::table('migrations')->insert(array (\n 0 => \n array (\n 'id' => 1,\n 'migration' => '2014_10_12_000000_create_users_table',\n 'batch' => 1,\n ),\n 1 => \n array (\n 'id' => 2,\n 'migration' => '2014_10_12_100000_create_password_resets_table',\n 'batch' => 1,\n ),\n 2 => \n array (\n 'id' => 3,\n 'migration' => '2019_01_29_011038_create_categories_table',\n 'batch' => 1,\n ),\n 3 => \n array (\n 'id' => 4,\n 'migration' => '2019_01_29_011130_create_items_table',\n 'batch' => 1,\n ),\n 4 => \n array (\n 'id' => 5,\n 'migration' => '2019_01_29_011207_create_requests_table',\n 'batch' => 1,\n ),\n 5 => \n array (\n 'id' => 6,\n 'migration' => '2019_01_29_011313_create_statuses_table',\n 'batch' => 1,\n ),\n 6 => \n array (\n 'id' => 7,\n 'migration' => '2019_01_29_011320_create_roles_table',\n 'batch' => 1,\n ),\n 7 => \n array (\n 'id' => 8,\n 'migration' => '2019_01_29_011330_create_userstatuses_table',\n 'batch' => 1,\n ),\n 8 => \n array (\n 'id' => 9,\n 'migration' => '2019_01_29_023302_add_roleid_userstatusid_users',\n 'batch' => 1,\n ),\n 9 => \n array (\n 'id' => 10,\n 'migration' => '2019_01_29_023330_add_categoryid_items',\n 'batch' => 1,\n ),\n 10 => \n array (\n 'id' => 11,\n 'migration' => '2019_01_29_023409_add_userid_statusid_itemid_requests',\n 'batch' => 1,\n ),\n 11 => \n array (\n 'id' => 12,\n 'migration' => '2019_01_29_042432_drop_contactnumber_users',\n 'batch' => 2,\n ),\n 12 => \n array (\n 'id' => 13,\n 'migration' => '2019_01_30_064421_add_statusid_items',\n 'batch' => 3,\n ),\n 13 => \n array (\n 'id' => 14,\n 'migration' => '2019_01_31_013147_rename_requests_to_laptoprequests',\n 'batch' => 4,\n ),\n 14 => \n array (\n 'id' => 15,\n 'migration' => '2019_01_31_014418_rename_laptoprequests',\n 'batch' => 5,\n ),\n ));\n \n \n }", "public function rollbackTransaction()\n {\n mysqli_query($this->databaseLink,\"ROLLBACK;\");\n }", "public function runDatabaseMigrations()\n {\n $this->parentRunDatabaseMigrations();\n\n $this->artisan('cms:migrate');\n\n $this->beforeApplicationDestroyed(function () {\n $this->artisan('cms:migrate:rollback');\n });\n }", "function runUp()\n{\n $files = scandir(LIB_ROOT . '/migrations');\n\n $db_migration_version = get_current_migration_version();\n\n $migrations = array();\n\n foreach($files as $file)\n {\n if(preg_match('/migration_([1-9][0-9]*)\\.php/i', $file, $matches))\n {\n $migration_version = $matches[1];\n\n // we only care about this migration if it has not been performed yet\n if($migration_version > $db_migration_version)\n {\n require_once LIB_ROOT . '/migrations/' . $matches[0];\n\n $migrations[$migration_version] = 'Migration_' . $migration_version;\n }\n }\n }\n\n if(count($migrations) == 0)\n echo 'There are no migrations to run; DB is already up to date (at version ' . $db_migration_version . ').' . \"\\n\\n\";\n else\n {\n // sort migrations, so that we execute them in ascending order\n ksort($migrations);\n\n $count = 0;\n\n foreach ($migrations as $id => $class_name)\n {\n $migrationClass = new $class_name();\n\n $count++;\n\n echo 'Running migration ' . $id . ' (' . $count . ' of ' . count($migrations) . ')...' . \"\\n\";\n\n try\n {\n $migrationClass->Up();\n fetch_none('UPDATE migration_version SET version=' . quote_smart($id));\n echo ' done!' . \"\\n\";\n }\n catch(Exception $e)\n {\n echo ' Encountered an exception during migration:' . \"\\n\";\n echo ' ' . $e->getMessage() . \"\\n\";\n echo ' Migration was not completed; the database may be left in a weird state.' . \"\\n\";\n if($count < count($migrations))\n {\n $remaining = (count($migrations) - $count);\n echo $remaining . ' remaining migration' . ($remaining == 1 ? '' : 's') . ' will not be run.' . \"\\n\";\n }\n echo \"\\n\";\n die();\n }\n }\n\n echo 'All done!' . \"\\n\\n\";\n }\n}", "public function execute() {\n $oldMigrations = new Filesystem(\"App/system/databases/migrations\");\n $oldMigrations->addFilter(new MigrationFilter($this->model->getShortModelName()));\n\n\n //todo: write custom iterator\n $oldMigrations->customCallback([$this, \"applyOldMigrations\"]);\n //todo: get the current model and get the diffrences between that and the migration\n //todo: write a new migration.\n //\n // $this->buildChangeSet();\n //do stuff execute all the things\n $this->createNewMigration();\n\n }", "public function rollback(): void\n {\n $ret = $this->mysqli->rollback();\n if (!$ret) $this->mySqlError('mysqli::rollback');\n }", "public function rollBackTransaction()\r\n\t{\r\n\t\t$this->query(\"ROLLBACK TRANSACTION\");\r\n\t}", "public function run()\n {\n \n\n \\DB::table('migrations')->delete();\n \n \\DB::table('migrations')->insert(array (\n 0 => \n array (\n 'id' => 1,\n 'migration' => '2019_03_13_181656_create_categories_table',\n 'batch' => 1,\n ),\n 1 => \n array (\n 'id' => 2,\n 'migration' => '2019_03_13_181656_create_failed_jobs_table',\n 'batch' => 1,\n ),\n 2 => \n array (\n 'id' => 3,\n 'migration' => '2019_03_13_181656_create_links_table',\n 'batch' => 1,\n ),\n 3 => \n array (\n 'id' => 4,\n 'migration' => '2019_03_13_181656_create_model_has_permissions_table',\n 'batch' => 1,\n ),\n 4 => \n array (\n 'id' => 5,\n 'migration' => '2019_03_13_181656_create_model_has_roles_table',\n 'batch' => 1,\n ),\n 5 => \n array (\n 'id' => 6,\n 'migration' => '2019_03_13_181656_create_notifications_table',\n 'batch' => 1,\n ),\n 6 => \n array (\n 'id' => 7,\n 'migration' => '2019_03_13_181656_create_password_resets_table',\n 'batch' => 1,\n ),\n 7 => \n array (\n 'id' => 8,\n 'migration' => '2019_03_13_181656_create_permissions_table',\n 'batch' => 1,\n ),\n 8 => \n array (\n 'id' => 9,\n 'migration' => '2019_03_13_181656_create_replies_table',\n 'batch' => 1,\n ),\n 9 => \n array (\n 'id' => 10,\n 'migration' => '2019_03_13_181656_create_role_has_permissions_table',\n 'batch' => 1,\n ),\n 10 => \n array (\n 'id' => 11,\n 'migration' => '2019_03_13_181656_create_roles_table',\n 'batch' => 1,\n ),\n 11 => \n array (\n 'id' => 12,\n 'migration' => '2019_03_13_181656_create_topics_table',\n 'batch' => 1,\n ),\n 12 => \n array (\n 'id' => 13,\n 'migration' => '2019_03_13_181656_create_users_table',\n 'batch' => 1,\n ),\n 13 => \n array (\n 'id' => 14,\n 'migration' => '2019_03_13_181657_add_foreign_keys_to_model_has_permissions_table',\n 'batch' => 1,\n ),\n 14 => \n array (\n 'id' => 15,\n 'migration' => '2019_03_13_181657_add_foreign_keys_to_model_has_roles_table',\n 'batch' => 1,\n ),\n 15 => \n array (\n 'id' => 16,\n 'migration' => '2019_03_13_181657_add_foreign_keys_to_replies_table',\n 'batch' => 1,\n ),\n 16 => \n array (\n 'id' => 17,\n 'migration' => '2019_03_13_181657_add_foreign_keys_to_role_has_permissions_table',\n 'batch' => 1,\n ),\n 17 => \n array (\n 'id' => 18,\n 'migration' => '2019_03_13_181657_add_foreign_keys_to_topics_table',\n 'batch' => 1,\n ),\n ));\n \n \n }", "public function rollback($line, $file) {\n $rollback = \"ROLLBACK\";\n $this->sql_query($rollback, $line, $file, true);\n }", "public static function RollBackTrans() {\n try {\n if(DB::transactionLevel() > 0) {\n DB::rollBack();\n }\n }\n catch(Exception $e) {\n }\n }", "public function rollBack()\n\t{\n\t\t$this->c->rollBack();\n\t}", "public function rollbackTransaction() {\n\t\t//noop\n\t}", "public function down(int $target_version = null): void\n {\n $files = $this->getDownFilesToExecute($target_version);\n foreach ($files as $file) {\n $file_path = $this->migrationDir . '/down/' . $file;\n $sql_statements = $this->getSQLStatements($file_path);\n $this->executeStatements($sql_statements);\n }\n\n $this->setCurrentVersion($target_version);\n }", "public function transactionRollback()\n\t{\n\t\treturn;\n\t}", "protected function executeAfter(...$migration_paths)\n {\n $this->execute_after = array_merge($this->execute_after, $migration_paths);\n }", "function RollBackTrans()\n\t{\n\t\tif ($this->__transCount > 0) {\n\t\t\t$this->__connection->rollBack();\n\t\t\t$this->__transCount--;\n\t\t}\n\t}", "public function runDatabaseMigrations()\n {\n if (!$this->runMigrations) {\n return;\n }\n\n $this->artisan('migrate:fresh');\n\n $this->app[Kernel::class]->setArtisan(null);\n\n $this->beforeApplicationDestroyed(function () {\n $this->artisan('migrate:rollback');\n });\n }", "public function runDatabaseMigrations()\n {\n $this->artisan('migrate:fresh', $this->migrateFreshUsing());\n\n $this->app[Kernel::class]->setArtisan(null);\n\n $this->beforeApplicationDestroyed(function () {\n $this->artisan('migrate:rollback');\n\n RefreshDatabaseState::$migrated = false;\n });\n }", "public function rollBack()\n {\n if ($this->transactionLevel === 0)\n {\n throw new DatabaseException('transaction-nothing-to-roll-back');\n }\n \n --$this->transactionLevel;\n \n if ($this->transactionLevel === 0)\n {\n if (!$this->pdo->rollBack())\n {\n throw new DatabaseException('transaction-rollback');\n }\n }\n else\n {\n // Rollback to savepoint.\n $this->pdo->exec('ROLLBACK TO SAVEPOINT LEVEL' . $this->transactionLevel);\n }\n }", "public function rollback(array $id) {\n migrate_instrument_start('role rollback');\n $rid = reset($id);\n user_role_delete((int)$rid);\n migrate_instrument_stop('role rollback');\n }", "function RollbackUpload() {\n\t\t\t// Debemos recorrer los dos vectores y eliminar todos los archivos procesados\n\t\t\t// anterior a la llamada a este proceso\n\t\t\t$K = array();\n\t\t\t$K = array_keys($this->BatchProcess);\n\t\t\tforeach ($K as $Val) {\n\t\t\t\t// Si este upload tiene proces recursivos\n\t\t\t\tif (isset($this->BatchRecursiveProcess[$Val])) {\n\t\t\t\t\t// Si es así recorremos los procesos\n\t\t\t\t\tforeach ($this->BatchRecursiveProcess[$Val] as $Value) {\n\t\t\t\t\t\t$this->DeleteFile($Value['new_name'], $Value['dir_file']);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$this->DeleteFile($this->BatchProcess[$Val]['new_name'], $this->BatchProcess[$Val]['dir_file']);\n\t\t\t}\n\t\t\tdie('Rollback: '.$this->GetFileName().' no se ha podido subir este archivo');\n\t\t\tunset($this);\n\t\t}", "public function rollback()\n\t{\n\t\tforeach($this->subformArr as $key => $sf) $sf->rollback();\n\t}", "private function run($direction) {\n\t\tDB::start_transaction();\n\n\t\ttry {\n\t\t\t$status = call_user_func(array($this, 'do_'.$direction));\n\t\t} catch(\\Exception $e) {\n\t\t\tCli::error($e);\n\t\t\t$status = false;\n\t\t}\n\n\t\tif(! $status) {\n\t\t\tCli::error(\"Something went wrong during the migration, rollback !\");\n\t\t\tDB::rollback_transaction();\n\t\t\tthrow new Database_Exception(\"Migration rolled back due to error.\");\n\t\t}\n\t\tDB::commit_transaction();\n\t\treturn true;\n\t}", "public static function rollback($savepoint = NULL)\n\t{\n\t\tself::getConnection()->rollback($savepoint);\n\t}", "function roll_back()\n\t{\n\t\t//return $this->db->rollBack();\n\t}", "public function rollback() {\n parent::rollback();\n $this->activeTransaction = false;\n }", "public function test_get_runnable_migrations_going_up_with_target_version_with_current()\n {\n $migrator_util = new Ruckusing_Util_Migrator($this->adapter);\n //pretend we already executed version 1\n $this->insert_dummy_version_data(array(1));\n $actual_up_files = $migrator_util->get_runnable_migrations($this->migrations_dirs, 'up', 3, false);\n $expect_up_files = array(\n array(\n 'version' => 3,\n 'class' => 'AddIndexToBlogs',\n 'file' => '003_AddIndexToBlogs.php',\n 'module' => 'default'\n )\n );\n $this->assertEquals($expect_up_files, $actual_up_files);\n $this->clear_dummy_data();\n\n //now pre-register some migrations that we have already executed\n $this->insert_dummy_version_data(array(1, 3));\n $actual_up_files = $migrator_util->get_runnable_migrations($this->migrations_dirs, 'up', 3, false);\n $this->assertEquals(array(), $actual_up_files);\n }", "public function redoMetaMigration() {\n\t\taioseo()->transients->update( 'v3_migration_in_progress_posts', time(), WEEK_IN_SECONDS );\n\t\t$this->meta->migrateMeta();\n\t}", "public function completeRollback($menu_name) {\n // We do nothing here but allow child classes to act.\n $migration = Migration::currentMigration();\n // Call any general handlers.\n migrate_handler_invoke_all('menu', 'completeRollback', $menu_name);\n // Then call any complete handler for this specific Migration.\n if (method_exists($migration, 'completeRollback')) {\n $migration->completeRollback($menu_name);\n }\n }", "protected function performRollBack(int $toLevel)\n {\n if ($toLevel == 0) {\n $this->call('rollBack');\n } else {\n $this->exec(\n $this->compileSavepointRollBack('trans' . ($toLevel + 1))\n );\n }\n }", "public function bulkRollback(array $uids) {\n migrate_instrument_start('user_delete_multiple');\n $this->prepareRollback($uids);\n user_delete_multiple($uids);\n $this->completeRollback($uids);\n migrate_instrument_stop('user_delete_multiple');\n }", "protected static function rollbackTransaction()\n\t{\n\t\tAbstractUnit::rollbackTransaction();\n\t}", "public function handle()\n {\n try {\n DB::beginTransaction();\n /*\n * If any tables not migrated last time,\n * it's migrate and continue to update mysql\n * functions, procedures, triggers and views migrations\n */\n if ($this->option('migrate')) {\n $this->call('migrate');\n }\n\n /*\n * If you use this option, re-run the seeders\n */\n if ($this->option('seed')) {\n $this->call('db:seed');\n }\n\n /*\n * Find all of functions, procedures, triggers and views migrations in directories\n */\n $configs = [\n 'functions' => config('cutlet-migrate.functions_path'),\n 'procedures' => config('cutlet-migrate.procedures_path'),\n 'triggers' => config('cutlet-migrate.triggers_path'),\n 'views' => config('cutlet-migrate.views_path'),\n ];\n\n $directories = [\n 'functions' => database_path() . '/migrations/' . $configs['functions'],\n 'procedures' => database_path() . '/migrations/' . $configs['procedures'],\n 'triggers' => database_path() . '/migrations/' . $configs['triggers'],\n 'views' => database_path() . '/migrations/' . $configs['views'],\n ];\n\n foreach ($directories as $key => $value) {\n if (! file_exists( $value ) && ! is_dir( $value )) {\n mkdir($value, 0777, true);\n }\n }\n\n $migrations_to_rerun = array_merge(\n $functions = array_diff( scandir( $directories['functions'] ), [ '.', '..' ] ),\n $procedures = array_diff( scandir( $directories['procedures'] ), [ '.', '..' ] ),\n $triggers = array_diff( scandir( $directories['triggers'] ), [ '.', '..' ] ),\n $views = array_diff( scandir( $directories['views'] ), [ '.', '..' ] )\n );\n\n if (! empty($migrations_to_rerun)) {\n foreach( $migrations_to_rerun as $index => $name ) {\n $migrations_to_rerun[ $index ] = \"'\" . basename( $name, '.php' ) . \"'\";\n }\n\n $migrations_to_rerun = implode( \",\", $migrations_to_rerun );\n\n /*\n * Delete functions, procedures, triggers and views migrations\n * from migrations table and migrate again this migrations ...\n */\n DB::statement(\"delete from migrations where migration in ( $migrations_to_rerun )\");\n\n foreach ($configs as $key => $value) {\n $this->call('migrate', ['--path' => 'database/migrations/' . $value]);\n }\n }\n\n /*\n * If you use this option, show the migrations table status for you after migrated all migrations\n */\n if ($this->option('status')) {\n $this->call('migrate:status');\n }\n\n DB::commit();\n\n } catch (\\Exception $e) {\n DB::rollBack();\n throw $e;\n }\n }", "public static function rollBack() {\n\n\t\tforeach (self::$con as $instanceName => $instance) {\n\t\t\t$instance->rollBack();\n\t\t}\n\t}", "public function rollBack(): void\n {\n try {\n $this->getConnection()->rollBack();\n } catch (DbalConnectionException $e) {\n throw new Exception('Rollback failed', 0, $e);\n }\n }", "public function test_resolve_current_version_going_down()\n {\n $this->clear_dummy_data();\n $this->insert_dummy_version_data(array(1,2,3));\n\n $migrator_util = new Ruckusing_Util_Migrator($this->adapter);\n $migrator_util->resolve_current_version(3, 'down');\n\n $executed = $migrator_util->get_executed_migrations();\n $this->assertEquals(false, in_array(3, $executed));\n $this->assertEquals(true, in_array(1, $executed));\n $this->assertEquals(true, in_array(2, $executed));\n }", "public function doUpgradeAndIncremental() {\n // Start the upgrade process.\n $this->submitCredentialForm();\n $session = $this->assertSession();\n\n $this->submitForm([], 'I acknowledge I may lose data. Continue anyway.');\n $session->statusCodeEquals(200);\n\n // Test the review form.\n $this->assertReviewForm();\n\n $this->useTestMailCollector();\n $this->submitForm([], 'Perform upgrade');\n $this->assertUpgrade($this->getEntityCounts());\n\n \\Drupal::service('module_installer')->install(['forum']);\n \\Drupal::service('module_installer')->install(['book']);\n\n // Test incremental migration.\n $this->createContentPostUpgrade();\n\n $this->drupalGet('/upgrade');\n $session->pageTextContains(\"An upgrade has already been performed on this site. To perform a new migration, create a clean and empty new install of Drupal $this->destinationSiteVersion. Rollbacks are not yet supported through the user interface.\");\n $this->submitForm([], 'Import new configuration and content from old site');\n $this->submitForm($this->edits, 'Review upgrade');\n $this->submitForm([], 'I acknowledge I may lose data. Continue anyway.');\n $session->statusCodeEquals(200);\n\n // Run the incremental migration and check the results.\n $this->submitForm([], 'Perform upgrade');\n $this->assertUpgrade($this->getEntityCountsIncremental());\n }", "public function version($target_version)\n\t{ \n\t\t$start = $current_version = $target_version-1;\n\t\t$stop = $target_version;\n \n\t\tif ($target_version > $current_version)\n\t\t{\n\t\t\t// Moving Up\n\t\t\t++$start;\n\t\t\t++$stop;\n\t\t\t$step = 1;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Moving Down\n\t\t\t$step = -1;\n\t\t}\n \n\t\t$method = ($step === 1) ? 'up' : 'down';\n\t\t$migrations = array();\n \n\t\t// We now prepare to actually DO the migrations\n\t\t// But first let's make sure that everything is the way it should be\n\t\tfor ($i = $start; $i != $stop; $i += $step)\n\t\t{ \n\t\t\t$f = glob(sprintf($this->_migration_path . '%03d_*.php', $i));\n\t\t\t// Only one migration per step is permitted\n\t\t\tif (count($f) > 1)\n\t\t\t{\n\t\t\t\t$this->_error_string = sprintf($this->lang->line('migration_multiple_version'), $i);\n\t\t\t\treturn FALSE;\n\t\t\t}\n\n\t\t\tif ( isset( $f[0] ) ) { \n\t\t\t\t$name = basename($f[0], '.php');\n\t\t\t} else {\n\t\t\t\treturn FALSE;\n\t\t\t}\n\n \n\t\t\t// Filename validations\n\t\t\tif (preg_match('/^\\d{3}_(\\w+)$/', $name, $match))\n\t\t\t{\n\t\t\t\t$match[1] = strtolower($match[1]);\n\n\t\t\t\t// Cannot repeat a migration at different steps\n\t\t\t\tif (in_array($match[1], $migrations))\n\t\t\t\t{\n\t\t\t\t\t$this->_error_string = sprintf($this->lang->line('migration_multiple_version'), $match[1]);\n\t\t\t\t\treturn FALSE;\n\t\t\t\t}\n\n\t\t\t\tinclude $f[0];\n\t\t\t\t$class = 'Migration_' . ucfirst($match[1]);\n\n\t\t\t\tif ( ! class_exists($class))\n\t\t\t\t{\n\t\t\t\t\t$this->_error_string = sprintf($this->lang->line('migration_class_doesnt_exist'), $class);\n\t\t\t\t\treturn FALSE;\n\t\t\t\t}\n\n\t\t\t\tif ( ! is_callable(array($class, $method)))\n\t\t\t\t{\n\t\t\t\t\t$this->_error_string = sprintf($this->lang->line('migration_missing_'.$method.'_method'), $class);\n\t\t\t\t\treturn FALSE;\n\t\t\t\t}\n\n\t\t\t\t$migrations[] = $match[1];\n\t\t\t}\n\t\t}\n\n\t\tlog_message('debug', 'Migration atual: ' . $current_version);\n\n\t\t$version = $i + ($step == 1 ? -1 : 0);\n\n\t\t// If there is nothing to do so quit\n\t\tif ($migrations === array())\n\t\t{\n\t\t\treturn TRUE;\n\t\t}\n\n\t\tlog_message('debug', 'Migrating from ' . $method . ' to version ' . $version);\n \n\t\t// Loop through the migrations\n\t\n\t\t\t// Run the migration class\n\t\t\t$class = 'Migration_' . ucfirst(strtolower(end($migrations)));\n\t\t\tcall_user_func(array(new $class, $method));\n\n\t\t\t$current_version += $step;\n\t\t\t$this->_update_version($current_version);\n\t\t\n\n\t\tlog_message('debug', 'Finished migrating to '.$current_version);\n \n\t\treturn end($migrations);\n\t}", "protected function doRollback( $fname ) {\n\t\tif ( $this->mTrxLevel ) {\n\t\t\t$this->query( 'ROLLBACK', $fname, true );\n\t\t\t$this->mTrxLevel = 0;\n\t\t}\n\t}", "public function rotate($steps)\n {\n $cmd = 'sudo python '. __DIR__ . '/python/stepper.py ' . $steps;\n $this->process->setCommandLine($cmd);\n $this->process->run();\n\n if (!$this->process->isSuccessful()) {\n throw new \\RuntimeException($this->process->getErrorOutput());\n }\n\n }", "public function rollBack() {\r\n\r\n mysql_query(\"ROLLBACK\");\r\n mysql_query(\"SET AUTOCOMMIT=1\");\r\n\r\n }", "public function rollBack()\n {\n if ($this->hasActiveTransaction) {\n parent::rollback();\n $this->hasActiveTransaction = false;\n }\n }", "public function handleTransactionRollback(TransactionRolledBack $event)\n {\n Log::debug('rollback');\n }", "abstract public function revert();", "public function down($targetMigration)\n {\n $migrationsModel = new Ot_Model_DbTable_Migrations($this->_tablePrefix);\n \n end($this->_appliedMigrations);\n $highestExecutedMigration = current($this->_appliedMigrations);\n reset($this->_appliedMigrations);\n\n if (!isset($this->_availableMigrations[$targetMigration])) {\n throw new Exception('The requested migration ' . $targetMigration . ' was not found.');\n }\n \n if ((int)$highestExecutedMigration <= (int)$targetMigration) {\n throw new Exception('The database is only migrated to migration ' . $highestExecutedMigration . ', which is before the requested migration ' . $targetMigration);\n }\n \n $migrationsToApply = array();\n \n foreach ($this->_appliedMigrations as $a) {\n if ((int)$a > (int)$targetMigration && isset($this->_availableMigrations[$a])) {\n $migrationsToApply[] = $this->_availableMigrations[$a];\n }\n }\n \n $migrationsToApply = array_reverse($migrationsToApply);\n \n if (empty($migrationsToApply)) {\n $this->_messages[] = 'No migrations to apply';\n }\n \n $this->_db->beginTransaction();\n \n foreach ($migrationsToApply as $m) {\n require_once $this->_migrationsPath . '/' . $m;\n $classname = 'Db_' . substr($m, 0, -4); //strip out the .php extension\n $migrationClass = new $classname(array('tablePrefix' => $this->_tablePrefix));\n\n try {\n $migrationClass->down($this->_db, $this->_tablePrefix);\n } catch (Exception $e) {\n $this->_db->rollback();\n throw new Exception('Error applying migration ' . $m . '. ' . $e->getMessage());\n }\n \n try {\n $migrationsModel->removeMigration($this->_getMigrationIdFromFilename($m));\n } catch (Exception $e) {\n $this->_db->rollback();\n throw new Exception('Migration ' . $m . ' was successful, but adding record to migrations table failed. ' . $e->getMessage());\n }\n \n $this->_messages[] = 'Down migration of ' . $m . ' was successful.';\n }\n \n $this->_db->commit();\n }", "public function applyMigration()\n {\n $this->createMigrationsTable();\n $applied_migrations = $this->get_applied_migrations();\n\n $files = scandir(Application::$ROOT_DIR.'/migrations');\n $to_apply_migrations = array_diff($files, $applied_migrations);\n\n $new_migrations = [];\n\n foreach ($to_apply_migrations as $migration) {\n // skip unwanted folders\n if ($migration === '.' || $migration === '..') {\n continue;\n }\n require_once Application::$ROOT_DIR.'/migrations/'.$migration;\n\n $class_name = pathinfo($migration, PATHINFO_FILENAME);\n $instance = new $class_name();\n $instance->up();\n\n $new_migrations[] = $migration;\n }\n\n if (!empty($new_migrations)) {\n $this->saveMigration($new_migrations);\n }\n else {\n echo $this->log(\"All migrations are applied\");\n }\n }", "public function testExecute()\n {\n $params = [\n '--connection' => 'test',\n ];\n $commandTester = $this->getCommandTester($params);\n $migrations = $this->getMigrations();\n $migrations->migrate();\n\n $commandTester->execute([\n 'command' => $this->command->getName(),\n '--connection' => 'test',\n '--seed' => 'NumbersSeed',\n ]);\n\n $display = $this->getDisplayFromOutput();\n $this->assertTextContains('== NumbersSeed: seeded', $display);\n\n $result = $this->connection->selectQuery()\n ->select(['*'])\n ->from('numbers')\n ->order('id DESC')\n ->limit(1)\n ->execute()->fetchAll('assoc');\n $expected = [\n [\n 'id' => '1',\n 'number' => '10',\n 'radix' => '10',\n ],\n ];\n $this->assertEquals($expected, $result);\n\n $migrations->rollback(['target' => 'all']);\n }", "public function rollback(array $id) {\n $menu_name = reset($id);\n\n migrate_instrument_start('menu_delete');\n $this->prepareRollback($menu_name);\n if ($menu = menu_load($menu_name)) {\n menu_delete($menu);\n }\n $this->completeRollback($menu_name);\n migrate_instrument_stop('menu_delete');\n }", "public function testTransactionRollback()\n\t{\n\t\t// Remove the following lines when you implement this test.\n\t\t$this->markTestIncomplete(\n\t\t\t'This test has not been implemented yet.'\n\t\t);\n\t}", "public function rollback()\n {\n // my code\n $by = 'id';\n $order = 'desc';\n $eventMessages = CEventMessage::GetList($by, $order, ['TYPE' => self::EVENT_TYPE]);\n $eventMessage = new CEventMessage;\n while ($template = $eventMessages->Fetch()) {\n $eventMessage->Delete((int)$template['ID']);\n }\n CEventType::Delete(self::EVENT_TYPE);\n }", "public function rollback() {\r\n\t\t\tif($this->mysqli) {\r\n\t\t\t\treturn $this->db->rollback();\r\n\t\t\t} else {\r\n\t\t\t\t//no transaction support in mysql module...\n\t\t\t\tmysql_query('ROLLBACK;', $db);\r\n\t\t\t}\n\t\t\t$this->stopTransaction(); \r\n\t\t}", "public function reverse() {}", "public function test_get_runnable_migrations_going_down_no_target_version()\n {\n $migrator_util = new Ruckusing_Util_Migrator($this->adapter);\n $actual_down_files = $migrator_util->get_runnable_migrations($this->migrations_dirs, 'down', false);\n $this->assertEquals(array() , $actual_down_files);\n }" ]
[ "0.70009357", "0.69230497", "0.62698865", "0.62698865", "0.62698865", "0.62698865", "0.6083575", "0.6079513", "0.6079513", "0.60417515", "0.5996267", "0.5996267", "0.59493953", "0.5925792", "0.5922571", "0.5917022", "0.59099555", "0.5871308", "0.5856061", "0.5851709", "0.5839615", "0.58280146", "0.5824733", "0.58047134", "0.57941383", "0.57261837", "0.5708942", "0.56910753", "0.56799966", "0.5664098", "0.5657731", "0.56340593", "0.56304926", "0.56260216", "0.56072927", "0.56068325", "0.55904883", "0.5587793", "0.5576599", "0.5563501", "0.55539006", "0.55456406", "0.55446845", "0.5526041", "0.5513424", "0.54923505", "0.54829293", "0.54812056", "0.5458905", "0.5456798", "0.5455393", "0.5455131", "0.54375696", "0.54283315", "0.54273605", "0.5408617", "0.5396182", "0.5380295", "0.53750503", "0.5333018", "0.5331115", "0.53289694", "0.530822", "0.5301663", "0.52910125", "0.52323216", "0.52176803", "0.5209614", "0.5208398", "0.5202477", "0.5192848", "0.5162918", "0.5147284", "0.51357645", "0.51337785", "0.5133721", "0.5111486", "0.51027334", "0.5090942", "0.50839835", "0.50796735", "0.5070232", "0.5062931", "0.50420696", "0.5025818", "0.50233316", "0.49982077", "0.49977982", "0.49926168", "0.49924162", "0.499014", "0.49827278", "0.49757355", "0.49452588", "0.49441126", "0.49374226", "0.49368522", "0.49134785", "0.49096602", "0.48960456" ]
0.7283617
0
Calls the up or down method on the provided migrations and notifies the adapter to updated its list, based on the provided direction.
private function doMigration($migrations, $direction) { $methods = array( AdapterInterface::UP => array('up', 'addMigration'), AdapterInterface::DOWN => array('down', 'removeMigration'), ); $results = array(); foreach($migrations as $ref => $migration) { list($migration_method, $adapter_method) = $methods[$direction]; // assign helpers to instance $impl = $migration->getImplementation(); foreach( get_class_methods($impl) as $method ) { // get only setters if ('set' !== substr($method, 0, 3)) { continue; } // a quick and dirty way to find the helper method // need to take care CamelCase methods $helper_name = strtolower(substr($method, 3)); $helper = $this->getHelper($helper_name); if (!is_bool($helper)) { call_user_func(array($impl, $method), $helper); } } // call up or down method $results[] = call_user_func(array($migration, $migration_method)); call_user_func(array($this->getAdapter(), $adapter_method), $impl, $ref); } return $results; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function migrate($direction)\n\t{\n\t\tif ($direction == self::UP)\n\t\t{\n\t\t\t// Get files\n\t\t\t$files = scandir($this->migration_path);\n\t\t\t$files = array_slice($files, 2, count($files));\n\n\t\t\tif (in_array('migrations', R::inspect()))\n\t\t\t{\n\t\t\t\t// Get migrated records\n\t\t\t\t$migrated_files = R::getCol('SELECT name FROM migrations');\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$migrated_files = array();\n\t\t\t}\n\n\t\t\t// Get non migrated files\n\t\t\t$non_migrated = array_diff($files, $migrated_files);\n\n\t\t\t// Load non migrated files and execute\n\t\t\tforeach ($non_migrated as $file)\n\t\t\t{\n\t\t\t\t$instance = $this->loadMigration($file);\n\t\t\t\t$instance->up();\n\n\t\t\t\t// Record our migration\n\t\t\t\t$this->storeMigration($file);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$migration = R::findOne('migrations', ' ORDER BY created DESC ');\n\n\t\t\t// Load migration and migrate it down\n\t\t\t$instance = $this->loadMigration($migration->name);\n\t\t\t$instance->down();\n\n\t\t\t// Remove migration form database\n\t\t\tR::trash($migration);\n\t\t}\n\t}", "public function migrateUp()\n {\n //$this->migrate('up');\n $this->artisan('migrate');\n }", "public function up(){\n $migration_files=dirToArray($this->migrations_dir);\n if(!sizeof($migration_files)){\n die('migration does not exist');\n }\n\n //check MIGRATION_TABLE_NAME\n $this->_check_table();\n\n //check run migrations\n $migration_files=$this->_check_run_migrations($migration_files);\n\n if(sizeof($migration_files)<=0){\n die('migration file does not exist');\n }\n\n $responses = [];\n foreach($migration_files as $file){\n $responses[] = $this->_run($file,'up');\n }\n return $responses;\n }", "public function migrate()\n {\n $fileSystem = new Filesystem();\n $classFinder = new ClassFinder();\n\n foreach ($fileSystem->files(__DIR__.'/../../../../tests/NilPortugues/App/Migrations') as $file) {\n $fileSystem->requireOnce($file);\n $migrationClass = $classFinder->findClass($file);\n (new $migrationClass())->down();\n (new $migrationClass())->up();\n }\n }", "public function callMigration()\n {\n Artisan::call('lucy:migration', $this->builder->getAttribute('migration'));\n\n Artisan::call('migrate');\n }", "public function setMigratingUp($isMigratingUp);", "public function isMigratingUp();", "abstract protected function up();", "public function migrate($direction)\n {\n if (!method_exists($this, $direction)) { return; }\n\n if ($direction == 'up') { $this->announce(\"migrating\"); }\n if ($direction == 'down') { $this->announce(\"reverting\"); }\n\n $result = null;\n $t = new Horde_Support_Timer();\n $t->push();\n $result = $this->$direction();\n $time = $t->pop();\n\n if ($direction == 'up') {\n $this->announce(\"migrated (\" . sprintf(\"%.4fs\", $time) . \")\");\n $this->log();\n }\n if ($direction == 'down') {\n $this->announce(\"reverted (\" . sprintf(\"%.4fs\", $time) . \")\");\n $this->log();\n }\n return $result;\n }", "public function migrated(MigrationInterface $migration, $direction, $startTime, $endTime);", "abstract public function up();", "abstract public function up();", "abstract public function up();", "function runUp()\n{\n $files = scandir(LIB_ROOT . '/migrations');\n\n $db_migration_version = get_current_migration_version();\n\n $migrations = array();\n\n foreach($files as $file)\n {\n if(preg_match('/migration_([1-9][0-9]*)\\.php/i', $file, $matches))\n {\n $migration_version = $matches[1];\n\n // we only care about this migration if it has not been performed yet\n if($migration_version > $db_migration_version)\n {\n require_once LIB_ROOT . '/migrations/' . $matches[0];\n\n $migrations[$migration_version] = 'Migration_' . $migration_version;\n }\n }\n }\n\n if(count($migrations) == 0)\n echo 'There are no migrations to run; DB is already up to date (at version ' . $db_migration_version . ').' . \"\\n\\n\";\n else\n {\n // sort migrations, so that we execute them in ascending order\n ksort($migrations);\n\n $count = 0;\n\n foreach ($migrations as $id => $class_name)\n {\n $migrationClass = new $class_name();\n\n $count++;\n\n echo 'Running migration ' . $id . ' (' . $count . ' of ' . count($migrations) . ')...' . \"\\n\";\n\n try\n {\n $migrationClass->Up();\n fetch_none('UPDATE migration_version SET version=' . quote_smart($id));\n echo ' done!' . \"\\n\";\n }\n catch(Exception $e)\n {\n echo ' Encountered an exception during migration:' . \"\\n\";\n echo ' ' . $e->getMessage() . \"\\n\";\n echo ' Migration was not completed; the database may be left in a weird state.' . \"\\n\";\n if($count < count($migrations))\n {\n $remaining = (count($migrations) - $count);\n echo $remaining . ' remaining migration' . ($remaining == 1 ? '' : 's') . ' will not be run.' . \"\\n\";\n }\n echo \"\\n\";\n die();\n }\n }\n\n echo 'All done!' . \"\\n\\n\";\n }\n}", "public function migrate($target=null)\n\t{\t\n\t\t$migrations = $this->getAvailableMigrations($target);\n\t\tif (null === $target) {\n\t\t\tend($migrations);\n\t\t\t$target = key($migrations);\n\t\t}\n\t\t\n\t\tif (!$this->isDownwards($target)) {\n\t\t\treturn $this->doMigration($migrations, AdapterInterface::UP);\n\t\t} else {\n\t\t\treturn $this->doMigration($migrations, AdapterInterface::DOWN);\n\t\t}\n\t}", "public function hookUpgrade($args) {\n\t\t$oldVersion = $args['old_version'];\n $newVersion = $args['new_version'];\n $doMigrate = false;\n\n $versions = array();\n foreach (glob(IIIF_API_BRIDGE_DIRECTORY . '/libraries/IiifApiBridge/Migration/*.php') as $migrationFile) {\n $className = 'IiifApiBridge_Migration_' . basename($migrationFile, '.php');\n include $migrationFile;\n $versions[$className::$version] = new $className();\n }\n uksort($versions, 'version_compare');\n\n foreach ($versions as $version => $migration) {\n if (version_compare($version, $oldVersion, '>')) {\n $doMigrate = true;\n }\n if ($doMigrate) {\n $migration->up();\n if (version_compare($version, $newVersion, '>')) {\n break;\n }\n }\n }\n\t}", "public function runDatabaseMigrations()\n {\n $this->parentRunDatabaseMigrations();\n\n $this->artisan('cms:migrate');\n\n $this->beforeApplicationDestroyed(function () {\n $this->artisan('cms:migrate:rollback');\n });\n }", "private function run($direction) {\n\t\tDB::start_transaction();\n\n\t\ttry {\n\t\t\t$status = call_user_func(array($this, 'do_'.$direction));\n\t\t} catch(\\Exception $e) {\n\t\t\tCli::error($e);\n\t\t\t$status = false;\n\t\t}\n\n\t\tif(! $status) {\n\t\t\tCli::error(\"Something went wrong during the migration, rollback !\");\n\t\t\tDB::rollback_transaction();\n\t\t\tthrow new Database_Exception(\"Migration rolled back due to error.\");\n\t\t}\n\t\tDB::commit_transaction();\n\t\treturn true;\n\t}", "public function action_up_migration_get()\n {\n $this->load->library('migration');\n $this->migration->current();\n }", "public function migrate()\n\t{ \n\t\t(new MigratorInterface)->migrate();\n\t}", "public function applyMigration()\n {\n $this->createMigrationsTable();\n $applied_migrations = $this->get_applied_migrations();\n\n $files = scandir(Application::$ROOT_DIR.'/migrations');\n $to_apply_migrations = array_diff($files, $applied_migrations);\n\n $new_migrations = [];\n\n foreach ($to_apply_migrations as $migration) {\n // skip unwanted folders\n if ($migration === '.' || $migration === '..') {\n continue;\n }\n require_once Application::$ROOT_DIR.'/migrations/'.$migration;\n\n $class_name = pathinfo($migration, PATHINFO_FILENAME);\n $instance = new $class_name();\n $instance->up();\n\n $new_migrations[] = $migration;\n }\n\n if (!empty($new_migrations)) {\n $this->saveMigration($new_migrations);\n }\n else {\n echo $this->log(\"All migrations are applied\");\n }\n }", "protected function migration_process() {\n\t\t$available_languages = Fusion_Multilingual::get_available_languages();\n\t\tself::$available_languages = ( ! empty( $available_languages ) ) ? $available_languages : [ '' ];\n\n\t\t$this->migrate_options();\n\t}", "public function up(): void\n {\n $filename = sprintf('%s/%s', static::UP, static::FILENAME);\n\n $this->execute($filename);\n }", "public function test_get_runnable_migrations_going_down_with_target_version_no_current()\n {\n $migrator_util = new Ruckusing_Util_Migrator($this->adapter);\n $this->insert_dummy_version_data(array(3, '20090122193325'));\n $actual_down_files = $migrator_util->get_runnable_migrations($this->migrations_dirs, 'down', 1, false);\n $expect_down_files = array(\n array(\n 'version' => '20090122193325',\n 'class' => 'AddNewTable',\n 'file' => '20090122193325_AddNewTable.php',\n 'module' => 'default'\n ),\n array(\n 'version' => 3,\n 'class' => 'AddIndexToBlogs',\n 'file' => '003_AddIndexToBlogs.php',\n 'module' => 'default'\n )\n );\n $this->assertEquals($expect_down_files, $actual_down_files);\n $this->clear_dummy_data();\n\n $this->insert_dummy_version_data(array(3));\n $actual_down_files = $migrator_util->get_runnable_migrations($this->migrations_dirs, 'down', 1, false);\n $expect_down_files = array(\n array(\n 'version' => 3,\n 'class' => 'AddIndexToBlogs',\n 'file' => '003_AddIndexToBlogs.php',\n 'module' => 'default'\n )\n );\n $this->assertEquals($expect_down_files, $actual_down_files);\n\n //go all the way down!\n $this->clear_dummy_data();\n $this->insert_dummy_version_data(array(1, 3, '20090122193325'));\n $actual_down_files = $migrator_util->get_runnable_migrations($this->migrations_dirs, 'down', 0, false);\n $expect_down_files = array(\n array(\n 'version' => '20090122193325',\n 'class' => 'AddNewTable',\n 'file' => '20090122193325_AddNewTable.php',\n 'module' => 'default'\n ),\n array(\n 'version' => 3,\n 'class' => 'AddIndexToBlogs',\n 'file' => '003_AddIndexToBlogs.php',\n 'module' => 'default'\n ),\n array(\n 'version' => 1,\n 'class' => 'CreateUsers',\n 'file' => '001_CreateUsers.php',\n 'module' => 'default'\n )\n );\n $this->assertEquals($expect_down_files, $actual_down_files);\n }", "public function postUp(MigrationManager $manager)\n {\n }", "public function postUp(MigrationManager $manager)\n {\n }", "public function postUp(MigrationManager $manager)\n {\n }", "public function runDatabaseMigrations()\n {\n $this->artisan('migrate:fresh', $this->migrateFreshUsing());\n\n $this->app[Kernel::class]->setArtisan(null);\n\n $this->beforeApplicationDestroyed(function () {\n $this->artisan('migrate:rollback');\n\n RefreshDatabaseState::$migrated = false;\n });\n }", "public function migrations()\n {\n $this->loadMigrationsFrom(__DIR__.'/Database/Migrations');\n\n $this->publishes([\n __DIR__.'/Database/Migrations/' => database_path('migrations')\n ], $this->packageName.'-migrations');\n }", "public function updateMigration($type = 'up')\n {\n $file = $class = null;\n\n $file = $this->migrationDir.$this->getVersion().$this->getMigrationClass().self::EXTENSION;\n\n if (is_readable($file)) {\n include_once $file;\n $class = Inflector::classify($this->getMigrationClass());\n }\n\n if ($type == 'down') {\n call_user_func_array(\n array(\n new $class,\n $type\n ),\n array()\n );\n } else {\n call_user_func_array(\n array(\n new $class,\n $type\n ),\n array()\n );\n }\n $this->updateMigrationTable();\n\n }", "public function test_get_runnable_migrations_going_down_no_target_version()\n {\n $migrator_util = new Ruckusing_Util_Migrator($this->adapter);\n $actual_down_files = $migrator_util->get_runnable_migrations($this->migrations_dirs, 'down', false);\n $this->assertEquals(array() , $actual_down_files);\n }", "public function down()\n {\n $this->output->writeln('Down migration is not available.');\n }", "public function migrate() {}", "public function execute() {\n $oldMigrations = new Filesystem(\"App/system/databases/migrations\");\n $oldMigrations->addFilter(new MigrationFilter($this->model->getShortModelName()));\n\n\n //todo: write custom iterator\n $oldMigrations->customCallback([$this, \"applyOldMigrations\"]);\n //todo: get the current model and get the diffrences between that and the migration\n //todo: write a new migration.\n //\n // $this->buildChangeSet();\n //do stuff execute all the things\n $this->createNewMigration();\n\n }", "public function migrate()\n\t{\n\t}", "public function runDatabaseMigrations()\n {\n if (!$this->runMigrations) {\n return;\n }\n\n $this->artisan('migrate:fresh');\n\n $this->app[Kernel::class]->setArtisan(null);\n\n $this->beforeApplicationDestroyed(function () {\n $this->artisan('migrate:rollback');\n });\n }", "public function runAction():void{\n $currentVersion = Migration::getCurrentVersion();\n $migrations = glob($this->config->application->migrationsDir.'*.php');\n $version = count($migrations);\n if((int)$version === $currentVersion){\n Cli::error('Nothing to migrate');\n }\n for($i=($currentVersion+1); $i<=$version; $i++){\n $class= \"MigrationVersion\".$i; \n $migration = new $class();\n $this->executeQueries($migration->up());\n\n Migration::setCurrentVersion($i);\n }\n }", "public function migrate()\n {\n /**\n * @var $migrator Migrator\n */\n $migrator = $this->app->make('migrator');\n\n /**\n * @var $migratonRepository DatabaseMigrationRepository\n */\n $migratonRepository = $this->app->make('migration.repository');\n\n $migratonRepository->createRepository();\n\n $migrator->run([__DIR__ . \"/../database/migrations\"]);\n\n }", "public function up()\n {\n if (!$this->isEdu()) {\n return;\n }\n \n $this->edu_up();\n }", "public function migrate()\n {\n $fileSystem = new Filesystem();\n\n $fileSystem->copy(\n __DIR__.'/../database/migrations/2018_06_29_032244_create_laravel_follow_tables.php',\n __DIR__.'/database/migrations/create_laravel_follow_tables.php'\n );\n\n foreach ($fileSystem->files(__DIR__.'/database/migrations') as $file) {\n $fileSystem->requireOnce($file);\n }\n\n (new \\CreateLaravelFollowTables())->up();\n (new \\CreateUsersTable())->up();\n (new \\CreateOthersTable())->up();\n }", "public function __invoke()\n {\n $this->migrate();\n }", "private function migration()\n {\n $location = $this->args['location'] . DIRECTORY_SEPARATOR . 'migrations' . DIRECTORY_SEPARATOR;\n if (!is_dir($location))\n {\n mkdir($location);\n }\n\n $backtrace = debug_backtrace();\n $calling_function = $backtrace[1]['function'];\n\n if ($calling_function === \"model\")\n {\n $class_name = 'Migration_Add_';\n $filename = 'add_';\n $table_name = '';\n\n if (!empty($this->args['subdirectories']))\n {\n $dirs = explode(DIRECTORY_SEPARATOR, $this->args['subdirectories']);\n $dirs = join('_', $dirs);\n $class_name .= strtolower($dirs) . '_';\n $filename .= strtolower($dirs) . '_';\n $table_name .= strtolower($dirs) . '_';\n }\n $args = array(\n 'class_name' => $class_name . Inflector::pluralize($this->args['name']),\n 'table_name' => $table_name . Inflector::pluralize(strtolower($this->args['name'])),\n 'filename' => $filename . Inflector::pluralize(ApplicationHelpers::underscorify($this->args['name'])) . '.php',\n 'application_folder' => $this->args['application_folder'],\n 'parent_class' => $this->args['parent_migration'],\n 'extra' => $this->extra\n );\n\n $template_name = 'migration';\n }\n else\n {\n $args = array(\n 'class_name' => 'Migration_' . $this->args['name'],\n 'table_name' => $this->get_table_name_out_of_migration_name(),\n 'filename' => $this->args['filename'],\n 'application_folder' => $this->args['application_folder'],\n 'parent_class' => $this->args['parent_migration'],\n 'extra' => $this->extra\n );\n\n $template_name = 'empty_migration';\n }\n\n $template = new TemplateScanner($template_name, $args);\n $migration = $template->parse();\n\n $migration_number = MigrationHelpers::get_migration_number($this->args['location']);\n $filename = $location . $migration_number . '_' . $args['filename'];\n $potential_duplicate_migration_filename = MigrationHelpers::decrement_migration_number($migration_number) . '_' . $args['filename'];\n $potential_duplicate_migration = $location . $potential_duplicate_migration_filename;\n\n $message = \"\\t\";\n if (file_exists($potential_duplicate_migration))\n {\n $message .= 'Migration already exists : ';\n if (php_uname(\"s\") !== \"Windows NT\")\n {\n $message = ApplicationHelpers::colorize($message, 'light_blue');\n }\n $message .= $this->args['application_folder'] . DIRECTORY_SEPARATOR . 'migrations' . DIRECTORY_SEPARATOR . $potential_duplicate_migration_filename;\n }\n else if (file_put_contents($filename, $migration) && MigrationHelpers::add_migration_number_to_config_file($this->args['location'], $migration_number))\n {\n $message .= 'Created Migration: ';\n if (php_uname(\"s\") !== \"Windows NT\")\n {\n $message = ApplicationHelpers::colorize($message, 'green');\n }\n $message .= $this->args['application_folder'] . DIRECTORY_SEPARATOR . 'migrations' . DIRECTORY_SEPARATOR . $migration_number . '_' . $args['filename'];\n }\n else\n {\n $message .= 'Unable to create migration: ';\n if (php_uname(\"s\") !== \"Windows NT\")\n {\n $message = ApplicationHelpers::colorize($message, 'red');\n }\n $message .= $this->args['application_folder'] . DIRECTORY_SEPARATOR . 'migrations' . DIRECTORY_SEPARATOR . $migration_number . '_' . $this->args['filename'];\n }\n\n fwrite(STDOUT, $message . PHP_EOL);\n\n return;\n }", "public function test_resolve_current_version_going_down()\n {\n $this->clear_dummy_data();\n $this->insert_dummy_version_data(array(1,2,3));\n\n $migrator_util = new Ruckusing_Util_Migrator($this->adapter);\n $migrator_util->resolve_current_version(3, 'down');\n\n $executed = $migrator_util->get_executed_migrations();\n $this->assertEquals(false, in_array(3, $executed));\n $this->assertEquals(true, in_array(1, $executed));\n $this->assertEquals(true, in_array(2, $executed));\n }", "private function moveMigration($arguments){\n\n $migrationPathWillBeMoved=staticPathModel::getProjectPath($arguments['move']).'/'.utils::getAppVersion($arguments['move']).'/migrations/schemas/'.$arguments['schema'];\n $newPath=root.'/'.staticPathModel::$storeMigrationsPath.'/schemas/'.$arguments['schema'];\n\n\n $migrationPurePath=str_replace(root.'/','',$migrationPathWillBeMoved);\n $migrationNamespace=str_replace('/','\\\\',$migrationPurePath);\n $newMigrationNamespace=str_replace('/','\\\\',str_replace(root.'/','',$newPath));\n\n\n if(rename($migrationPathWillBeMoved,$newPath)){\n\n foreach (glob($newPath.\"/*.php\") as $filename) {\n utils::changeClass($filename,[\n $migrationNamespace=>$newMigrationNamespace\n ]);\n }\n\n echo 'migration named '.$arguments['schema'].' in '.$arguments['move'].' project has been successfully moved';\n echo PHP_EOL;\n }\n\n\n $migrationSeedPathWillBeMoved=staticPathModel::getProjectPath($arguments['move']).'/'.utils::getAppVersion($arguments['move']).'/migrations/seeds';\n $newSeedPath=root.'/'.staticPathModel::$storeMigrationsPath.'/seeds';\n\n\n $migrationSeedPurePath=str_replace(root.'/','',$migrationSeedPathWillBeMoved);\n $migrationSeedNamespace=str_replace('/','\\\\',$migrationSeedPurePath);\n $newMigrationSeedNamespace=str_replace('/','\\\\',str_replace(root.'/','',$newSeedPath));\n\n if(rename($migrationSeedPathWillBeMoved,$newSeedPath)){\n\n foreach (glob($newSeedPath.\"/*.php\") as $filename) {\n utils::changeClass($filename,[\n $migrationSeedNamespace=>$newMigrationSeedNamespace\n ]);\n }\n\n echo 'migration seeds named '.$arguments['schema'].' in '.$arguments['move'].' project has been successfully moved';\n\n }\n }", "public function up() { return $this->run('up'); }", "protected function registerMigrations(): void\n {\n if (Satifest::$runsMigrations) {\n $this->loadMigrationsFrom(__DIR__.'/../database/migrations');\n\n return;\n }\n }", "private function sortMigrations(& $migrations, $target)\n\t{\n\t\t$filter = $this->getFilter();\n\t\tif (!$this->isDownwards($target)) {\n\t\t\tuksort($migrations, array($filter, 'compare'));\n\t\t} else {\n\t\t\tuksort($migrations, function($a, $b) use ($filter) {\n\t\t\t\treturn $filter->compare($b, $a);\t// reverse arguments\n\t\t\t} );\n\t\t}\n\t\t\n\t}", "public function up() {\n $fields = array(\n 'autodiscount' => array(\n 'name' => 'autodiscount',\n 'type' => 'VARCHAR',\n 'constraint' => 100,\n 'default' => 'off'\n )\n );\n $this->dbforge->modify_column('bookings', $fields);\n\n // update existing autodiscounts to percentage\n $where = array(\n 'autodiscount' => 1\n );\n $data = array(\n 'autodiscount' => 'percentage'\n );\n $this->db->update('bookings', $data, $where);\n\n // update others to off\n $where = array(\n 'autodiscount !=' => 'percentage'\n );\n $data = array(\n 'autodiscount' => 'off'\n );\n $this->db->update('bookings', $data, $where);\n\n // modify fields - remove 1 option\n $fields = array(\n 'autodiscount' => array(\n 'name' => 'autodiscount',\n 'type' => \"ENUM('off', 'percentage', 'amount')\",\n 'null' => FALSE,\n 'default' => 'off'\n ),\n 'autodiscount_amount' => array(\n 'name' => 'autodiscount_amount',\n 'type' => 'DECIMAL(8,2)',\n 'null' => FALSE,\n 'default' => 10\n )\n );\n $this->dbforge->modify_column('bookings', $fields);\n }", "public function run($down = false) {\n if ($down) {\n $this->down();\n } else {\n $this->up();\n }\n }", "public function safeUp()\r\n {\r\n $this->up();\r\n }", "public function migrate() \n {\n\n Masteryl_Migration::createOrUpdateDir(MASTERYL_MIGRATIONS_PATH, $this);\n\n if(!empty($this->modules)) {\n foreach($this->modules as $mod) {\n $dir = $mod['path'].'migrations';\n \n if(file_exists($dir))\n Masteryl_Migration::createOrUpdateDir($dir, $this);\n }\n }\n\n }", "public function safeUp()\n {\n $this->up();\n }", "public function safeUp()\n {\n $this->up();\n }", "private function registerMigrations()\n {\n $this->loadMigrationsFrom($this->migrations);\n }", "public function safeUp()\r\n\t{\r\n\t\t$this->up();\r\n\t}", "protected function markAsMigrated($migrated_files = [])\n {\n foreach ($migrated_files as $migrated_file) {\n $this->db_adapter->execute(\"\n INSERT INTO $this->migration_table (file) VALUES ('$migrated_file')\n \");\n }\n }", "protected abstract function do_down();", "public function migrateUp($class)\n {\n if ($class === self::BASE_MIGRATION) {\n return true;\n }\n\n $this->stdout(\"*** applying $class\\n\", Console::FG_YELLOW);\n $start = microtime(true);\n $migration = parent::createMigration($class);\n if ($migration->up() !== false) {\n $time = microtime(true) - $start;\n $this->stdout(\"*** applied $class (time: \" . sprintf('%.3f', $time) . \"s)\\n\\n\", Console::FG_GREEN);\n\n return true;\n } else {\n $time = microtime(true) - $start;\n $this->stdout(\"*** failed to apply $class (time: \" . sprintf('%.3f', $time) . \"s)\\n\\n\", Console::FG_RED);\n\n return false;\n }\n }", "protected abstract function do_up();", "public function to($args, $assocArgs)\n {\n $version = isset($args[0]) ? (int) $args[0] : PHP_INT_MAX;\n $loader = $this->getRepository($assocArgs);\n $migrations = $loader->getMigrations();\n try {\n // Up\n foreach ($migrations as $migration) {\n if ($migration->getVersion() > $version) {\n break;\n }\n if ($migration->isDown()) {\n $this->migrateUp($migration);\n }\n }\n \n // Down migrations in reverse\n foreach (array_reverse($migrations) as $migration) {\n if ($migration->getVersion() <= $version) {\n break;\n }\n if ($migration->isUp()) {\n $this->migrateDown($migration);\n }\n }\n } catch (Exception $ex) {\n WP_CLI::error(\"Migration failed with message '{$ex->getMessage()}'\");\n }\n \n WP_CLI::success('Migrated to ' . (($version === PHP_INT_MAX) ? 'latest version' : \"version '$version'\") );\n }", "private function setupMigrations()\n {\n $this->loadMigrationsFrom(__DIR__ . '/../database/migrations');\n }", "abstract public function enumAppliedMigrationSteps();", "public function safeUp()\n\t{\n\t\t$this->up();\n\t}", "public function up()\n {\n // This migration was removed, but fails when uninstalling plugin\n }", "public function processMigration(Migration $migration): void;", "private function handleMigrations()\n {\n $this->loadMigrationsFrom(__DIR__.'/Migrations');\n\n // Optional: Publish the migrations:\n $this->publishes([\n __DIR__ . '/Migrations' => base_path('database/migrations'),\n ]);\n }", "private function shouldExecuteMigration($direction, Version $version, $to, $migrated)\n {\n if ('down' === $direction) {\n if (!in_array($version->getVersion(), $migrated)) {\n return false;\n }\n\n return $version->getVersion() > $to;\n }\n\n if ('up' === $direction) {\n if (in_array($version->getVersion(), $migrated)) {\n return false;\n }\n\n return $version->getVersion() <= $to;\n }\n }", "public function test_get_runnable_migrations_going_up_no_target_version()\n {\n $migrator_util = new Ruckusing_Util_Migrator($this->adapter);\n $actual_up_files = $migrator_util->get_runnable_migrations($this->migrations_dirs, 'up', false);\n $expect_up_files = array(\n array(\n 'version' => 1,\n 'class' => 'CreateUsers',\n 'file' => '001_CreateUsers.php',\n 'module' => 'default'\n ),\n array(\n 'version' => 3,\n 'class' => 'AddIndexToBlogs',\n 'file' => '003_AddIndexToBlogs.php',\n 'module' => 'default'\n ),\n array(\n 'version' => '20090122193325',\n 'class' => 'AddNewTable',\n 'file' => '20090122193325_AddNewTable.php',\n 'module' => 'default'\n )\n );\n $this->assertEquals($expect_up_files, $actual_up_files);\n }", "public function up()\n\t{\n\t\techo $this->migration('up');\n\n\t\tci('o_role_model')->migration_add('Cookie Admin', 'Cookie Designer and Eater', $this->hash());\n\t\t\n\t\treturn true;\n\t}", "public function preUp(MigrationManager $manager)\n {\n }", "public function preUp(MigrationManager $manager)\n {\n }", "public function preUp(MigrationManager $manager)\n {\n }", "public static function migrate()\n {\n\n // If there is not a declaration that migrations have been run'd\n if( ! isset($GLOBALS['migrated_test_database']))\n {\n // Run migrations\n require path('sys').'cli/dependencies'.EXT;\n\n $which_db = \\Config::get('database.default');\n $database = \\Config::get('database.connections.'.$which_db);\n\n $migration_table = null;\n if($which_db == 'mysql')\n {\n $query = \"SELECT COUNT(*) AS count FROM information_schema.tables WHERE table_schema = ? AND table_name = ?\";\n $migration_table = \\DB::query($query, array($database['database'], $database['prefix'].'laravel_migrations'));\n }\n\n // if($which_db == 'sqlite')\n // {\n // //$migration = \"SELECT * FROM {$database['database']}.sqlite_master WHERE type='table'\";\n // //sqlite3_exec(budb, \"SELECT sql FROM sqlite_master WHERE sql NOT NULL\"\n // \\sqlite_open(\":memory:\", $database['database']);\n // $migration = \\sqlite_exec($database['database'], \"SELECT sql FROM sqlite_master WHERE sql NOT NULL\");\n // }\n\n if(isset($migration_table['0']->count) and $migration_table['0']->count == '0')\n {\n Command::run(array('migrate:install'));\n echo \"\\n\";\n Command::run(array('migrate'));\n }\n else\n {\n Command::run(array('migrate:reset'));\n echo \"\\n\";\n Command::run(array('migrate'));\n }\n\n\n //Insert basic data\n\n // Declare that migrations have been run'd\n $GLOBALS['migrated_test_database'] = true;\n }\n }", "private function checkMigrationStatus(): void\n {\n // Invalid migration status\n if (!$this->migrationEntity->getStatus()->canRunMigrator()) {\n $this->failure('Migration in invalid state to run migrator.', [\n 'migration' => $this->migrationEntity->getId(),\n 'migration_status' => $this->migrationEntity->getStatus(),\n 'migrator' => $this->migratorEntity->getId(),\n 'migrator_status' => $this->migratorEntity->getStatus(),\n ]);\n }\n\n // Migrators must wait for before tasks to complete\n if (MigrationStatus::MIGRATORS !== $this->migrationEntity->getStatus()) {\n $remainingTasks = $this->migrationEntity->getBeforeTasks()\n ->filter(fn(TaskEntity $task) => false === $task->hasEnded());\n\n if ($remainingTasks->count() > 0) {\n // Migrator is not ready\n throw new MigratorNotReadyException($this->migratorEntity);\n }\n }\n\n // Dependent migrators must wait for the previous ones to complete\n $remainingMigrators = $this->migratorEntity->getPreviousMigrators()\n ->filter(fn(MigratorEntity $migrator) => false === $migrator->hasEnded());\n\n if ($remainingMigrators->count() > 0) {\n // Migrator is not ready\n throw new MigratorNotReadyException($this->migratorEntity);\n }\n\n $this->updateMigrationStatus(MigrationStatus::MIGRATORS);\n }", "public function upgrade($migrationName, array $migrationArray)\n {\n $connection = $this->adapter->getDriver()->getConnection();\n try {\n $connection->beginTransaction();\n\n $queries = explode(';', $migrationArray['up']);\n foreach ($queries as $query) {\n if (trim($query) == '') {\n continue;\n }\n $this->adapter->query($query, Adapter::QUERY_MODE_EXECUTE);\n }\n\n $sql = new Sql($this->adapter);\n $insert = $sql->insert(self::TABLE);\n $insert->values(array(\n 'migration' => $migrationName,\n 'up' => $migrationArray['up'],\n 'down' => $migrationArray['down']\n ));\n $selectString = $sql->getSqlStringForSqlObject($insert);\n $this->adapter->query($selectString, Adapter::QUERY_MODE_EXECUTE);\n\n $connection->commit();\n } catch (\\Exception $exception) {\n $connection->rollback();\n throw new \\Exception($exception->getMessage());\n }\n }", "public function getMigrationsToExecute($direction, $to)\n {\n if ('down' === $direction) {\n if (count($this->migrations)) {\n $allVersions = array_reverse(array_keys($this->migrations));\n $classes = array_reverse(array_values($this->migrations));\n $allVersions = array_combine($allVersions, $classes);\n } else {\n $allVersions = [];\n }\n } else {\n $allVersions = $this->migrations;\n }\n $versions = [];\n $migrated = $this->getMigratedVersions();\n foreach ($allVersions as $version) {\n if ($this->shouldExecuteMigration($direction, $version, $to, $migrated)) {\n $versions[$version->getVersion()] = $version;\n }\n }\n\n return $versions;\n }", "public function postDown(MigrationManager $manager)\n {\n }", "public function postDown(MigrationManager $manager)\n {\n }", "public function postDown(MigrationManager $manager)\n {\n }", "public function up()\n {\n if (is_file(storage_path('framework/down'))) {\n unlink(storage_path('framework/down'));\n\n if (is_file(storage_path('framework/maintenance.php'))) {\n unlink(storage_path('framework/maintenance.php'));\n }\n\n return true;\n }\n\n return false;\n }", "protected function runOctoberUpCommand()\n {\n Artisan::call('october:up');\n }", "public function up()\n {\n $oldStores = $this->getOldStores(); // update to newest data_version\n $newStores = $this->getNewStores(); // run all upgrade files\n if (!count($oldStores) && !count($newStores)) {\n return;\n }\n\n foreach ($this->getDepends() as $moduleCode) {\n if (0 !== strpos($moduleCode, 'TM_')) {\n continue;\n }\n $this->_getModuleObject($moduleCode)->up();\n }\n $saved = false;\n\n // upgrade currently installed version to the latest data_version\n if (count($oldStores)) {\n foreach ($this->getUpgradesToRun() as $version) {\n // customer able to skip upgrading data of installed modules\n if (!$this->getSkipUpgrade()) {\n $this->getUpgradeObject($version)\n ->setStoreIds($oldStores)\n ->upgrade();\n }\n $this->setDataVersion($version)->save();\n $saved = true;\n }\n }\n\n // install module to the new stores\n if (count($newStores)) {\n foreach ($this->getUpgradesToRun(0) as $version) {\n $this->getUpgradeObject($version)\n ->setStoreIds($newStores)\n ->upgrade();\n $this->setDataVersion($version)->save();\n $saved = true;\n }\n }\n\n if (!$saved) {\n $this->save(); // identity key could be updated without running the upgrades\n }\n }", "public function needsUpgrade() {\n $schema = $this->Version->Version->schema();\n\n // Needs upgrade\n if (isset($schema['version'])) {\n return;\n }\n\n // Do not need, 001 already set it as string\n // Unset actions, records and mappings, so it wont try again\n $this->migration = array(\n 'up' => array(),\n 'down' => array(),\n );\n $this->records = array();\n $this->mappings = array();\n }", "private function setDeltasToInstall(array $installedDeltas, array $availableDeltas)\n {\n $deltasToInstall = array();\n\n if (is_null($this->getRequestedVersion())) {\n // scenario 1: updating database with all available deltas - up\n echo \"\\nNo target version was specified. Will process all available deltas.\\n\";\n\n $this->setDirection('up');\n\n foreach($availableDeltas as $deltaOrderCounter => $delta) {\n if (!in_array($delta['deltaNum'], $installedDeltas)) {\n $deltasToInstall[] = $delta;\n }\n }\n } else {\n // user has specified a target version\n echo \"\\nTarget version: \" . $this->getRequestedVersion() . \", processing deltas to get to this version.\\n\";\n\n if (!in_array($this->getRequestedVersion(), $installedDeltas)) {\n echo \"General Direction: up\\n\";\n // scenario 2: updating database up up to a certain delta\n\n $this->setDirection('up');\n\n // This version has not yet been installed, going up\n foreach($availableDeltas as $deltaOrderCounter => $delta) {\n if (!in_array($delta['deltaNum'], $installedDeltas)) {\n $deltasToInstall[] = $delta;\n }\n\n if ($delta['deltaNum'] == $this->getRequestedVersion()) {\n // reached the target version, stop adding versions to install\n break;\n }\n }\n } else {\n echo \"General Direction: down\\n\";\n // This version has already been installed, going down\n\n // scenario 3: downgrading database to specified delta\n\n $this->setDirection('down');\n\n // reverse the array because we're going in the down direction\n $reversedAvailableDeltas = array_reverse($availableDeltas);\n\n foreach ($reversedAvailableDeltas as $deltaOrderCounter => $delta) {\n if ($delta['deltaNum'] == $this->getRequestedVersion()) {\n // do not uninstall the target version, stop adding versions to uninstall\n $deltasToInstall[] = $delta;\n break;\n }\n\n // Uninstall the delta if it's already been installed\n if (in_array($delta['deltaNum'], $installedDeltas)) {\n $deltasToInstall[] = $delta;\n }\n }\n }\n }\n\n $this->_deltasToInstall = $deltasToInstall;\n }", "public function test_get_runnable_migrations_going_up_with_target_version_with_current()\n {\n $migrator_util = new Ruckusing_Util_Migrator($this->adapter);\n //pretend we already executed version 1\n $this->insert_dummy_version_data(array(1));\n $actual_up_files = $migrator_util->get_runnable_migrations($this->migrations_dirs, 'up', 3, false);\n $expect_up_files = array(\n array(\n 'version' => 3,\n 'class' => 'AddIndexToBlogs',\n 'file' => '003_AddIndexToBlogs.php',\n 'module' => 'default'\n )\n );\n $this->assertEquals($expect_up_files, $actual_up_files);\n $this->clear_dummy_data();\n\n //now pre-register some migrations that we have already executed\n $this->insert_dummy_version_data(array(1, 3));\n $actual_up_files = $migrator_util->get_runnable_migrations($this->migrations_dirs, 'up', 3, false);\n $this->assertEquals(array(), $actual_up_files);\n }", "public function markAsExecuted(MigrationContract $migration): void;", "public function up($targetMigration)\n {\n $migrations = new Ot_Model_DbTable_Migrations($this->_tablePrefix);\n \n $migrationsIdsNotApplied = array_diff(array_keys($this->_availableMigrations), $this->_appliedMigrations);\n \n $migrationsToApply = array();\n \n foreach ($migrationsIdsNotApplied as $migrationId) {\n if ($migrationId <= $targetMigration) {\n $migrationsToApply[] = $this->_availableMigrations[$migrationId];\n }\n }\n \n if (empty($migrationsToApply)) {\n $this->_messages[] = 'No migrations to apply';\n return;\n }\n \n $this->_db->beginTransaction();\n \n foreach ($migrationsToApply as $m) {\n \n require_once $this->_migrationsPath . '/' . $m;\n $classname = 'Db_' . substr($m, 0, -4); //strip out the .php extension\n $migrationClass = new $classname(array('tablePrefix' => $this->_tablePrefix));\n\n try {\n $migrationClass->up($this->_db, $this->_tablePrefix);\n } catch (Exception $e) {\n $this->_db->rollback();\n throw new Exception('Error applying migration ' . $m . '. ' . $e->getMessage());\n }\n \n try {\n $migrations->addMigration($this->_getMigrationIdFromFilename($m));\n } catch (Exception $e) {\n $this->_db->rollback();\n throw new Exception('Migration ' . $m . ' was successful, but adding record to migrations table failed. ' . $e->getMessage());\n }\n \n $this->_messages[] = 'Applied ' . $m;\n }\n \n $this->_db->commit();\n }", "public function migrate()\n {\n $this->syncRepository();\n $this->copyVariables();\n $this->copyDeployKeys();\n $this->reEnableBuilds();\n }", "public function alterMigration(FeedsMigrateImporterInterface $importer, Migration $migration);", "public function up(Schema $schema) : void\n {\n $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \\'mysql\\'.');\n\n $this->addSql('ALTER TABLE xenoblade_missions ADD `order` INT NOT NULL');\n\n $queryBuilder = $this->connection->createQueryBuilder();\n $queryBuilder\n ->select('nextmission, mid')\n ->from('xenoblade_missions', 'm');\n\n $queryMissions = $queryBuilder->execute();\n $missions = [];\n foreach ($queryMissions as $mission) {\n array_push($missions, $mission);\n }\n\n $sortedMissions = [];\n $nextMission = 0;\n foreach ($missions as $mission) {\n if ($mission['mid'] == 2) {\n $nextMission = $mission['nextmission'];\n array_push($sortedMissions, $mission);\n break;\n }\n }\n\n for ($i = 1; $i < count($missions); $i++)\n {\n for ($x = 0; $x < count($missions); $x++)\n {\n if ($missions[$x]['mid'] == $nextMission)\n {\n array_push($sortedMissions, $missions[$x]);\n $nextMission = $missions[$x]['nextmission'];\n break;\n }\n }\n }\n\n $order = 0;\n foreach ($sortedMissions as $mission) {\n $this->addSql('UPDATE xenoblade_missions set `order` = '.$order.' WHERE mid = '.$mission['mid']);\n $order++;\n }\n }", "public function up() {\n\n\t$works = $this->select_all(\"SELECT * FROM works\");\n\n\tif($works) {\n\n\t\tforeach ($works as $row) {\n\n\t\t\t$id = $row['id'];\n\t\t\t$name = mysql_real_escape_string($row['title']);\n\t\t\t$controller = 'works';\n\t\t\t$classification = mysql_real_escape_string($row['classification']);\n\t\t\t$catalog_level = 'item';\n\t\t\t$slug = $row['slug'];\n\t\t\t$earliest_date = $row['earliest_date'];\n\t\t\t$latest_date = $row['latest_date'];\n\t\t\t$earliest_date_format = $row['earliest_date_format'];\n\t\t\t$latest_date_format = $row['latest_date_format'];\n\t\t\t$date_created = $row['date_created'];\n\t\t\t$date_modified = $row['date_modified'];\n\t\t\t$user_id = $row['user_id'];\n\t\t\n\t\t\t$this->execute(\"INSERT INTO archives (id, name, controller, classification, catalog_level, slug, earliest_date, latest_date, earliest_date_format, latest_date_format, date_created, date_modified, user_id) VALUES ('$id', '$name', '$controller', '$classification', '$catalog_level', '$slug', '$earliest_date', '$latest_date', '$earliest_date_format', '$latest_date_format', '$date_created', '$date_modified', '$user_id')\");\n\n\t\t}\n\n\t}\n\n\t//The previous inserts created entries in the archives_histories table, but we want to re-construct this manually from the works_histories table\t\n\n\t$works_histories = $this->select_all(\"SELECT * FROM works_histories\");\n\n\tif($works_histories) {\n\n\t\t$this->execute(\"DELETE FROM archives_histories WHERE controller = 'works'\");\n\n\t\tforeach ($works_histories as $row) {\n\n\t\t\t$id = $row['id'];\n\t\t\t$archive_id = $row['work_id'];\n\t\t\t$name = mysql_real_escape_string($row['title']);\n\t\t\t$controller = 'works';\n\t\t\t$classification = mysql_real_escape_string($row['classification']);\n\t\t\t$catalog_level = 'item';\n\t\t\t$slug = $row['slug'];\n\t\t\t$earliest_date = $row['earliest_date'];\n\t\t\t$latest_date = $row['latest_date'];\n\t\t\t$earliest_date_format = $row['earliest_date_format'];\n\t\t\t$latest_date_format = $row['latest_date_format'];\n\t\t\t$date_created = $row['date_created'];\n\t\t\t$date_modified = $row['date_modified'];\n\t\t\t$user_id = $row['user_id'];\n\t\t\t$start_date = $row['start_date'];\n\t\t\t$end_date = $row['end_date'];\n\t\t\t\n\t\t\t$this->execute(\"INSERT INTO archives_histories (id, archive_id, name, controller, classification, catalog_level, slug, earliest_date, latest_date, earliest_date_format, latest_date_format, date_created, date_modified, user_id, start_date, end_date) VALUES ('$id', '$archive_id', '$name', '$controller', '$classification', '$catalog_level', '$slug', '$earliest_date', '$latest_date', '$earliest_date_format', '$latest_date_format', '$date_created', '$date_modified', '$user_id', '$start_date', '$end_date')\");\n\n\t\t}\n\n\t}\n\n\t//Re-do the Works table\n\n\t$this->execute(\"CREATE TEMPORARY TABLE tmp_works AS (SELECT * FROM works)\");\n\t$this->execute(\"CREATE TEMPORARY TABLE tmp_works_histories AS (SELECT * FROM works_histories)\");\n\n\t$this->execute(\"DROP TRIGGER WorksHistoriesTableInsert\");\n\t$this->execute(\"DROP TRIGGER WorksHistoriesTableDelete\");\n\t$this->execute(\"DROP TRIGGER WorksHistoriesTableUpdate\");\n\n\t$tables = array('works', 'works_histories');\n\n\tforeach ($tables as $table) {\n\t\t$this->execute(\"DROP TABLE $table\");\n\n\t\t$t = $this->create_table($table, array(\"id\" => false));\n\n\t\tif ($table == 'works') {\n\t\t\t$t->column(\"id\", \"integer\", array(\"unsigned\" => true, \"primary_key\" => true, \"null\" => false));\n\t\t}\n\n\t\tif ($table == 'works_histories' ) {\n\t\t\t$t->column(\"id\", \"integer\", array(\"unsigned\" => true, \"primary_key\" => true, \"auto_increment\" => true));\n\t\t\t$t->column(\"work_id\", \"integer\", array(\"unsigned\" => true, \"null\" => false));\n\t\t}\n\n\t\t$t->column(\"title\", \"string\", array(\"limit\" => 1024, \"null\" => false));\n\t\t$t->column(\"artist\", \"string\", array(\"null\" => false));\n\t\t$t->column(\"creation_number\", \"string\", array(\"null\" => false));\n\t\t$t->column(\"materials\", \"string\", array(\"limit\" => 1024, \"null\" => false));\n\t\t$t->column(\"techniques\", \"string\", array(\"limit\" => 1024, \"null\" => false));\n\t\t$t->column(\"color\", \"string\", array(\"null\" => false));\n\t\t$t->column(\"format\", \"string\", array(\"null\" => false));\n\t\t$t->column(\"shape\", \"string\", array(\"null\" => false));\n\t\t$t->column(\"size\", \"string\", array(\"null\" => false));\n\t\t$t->column(\"state\", \"string\", array(\"null\" => false));\n\t\t$t->column(\"location\", \"string\", array(\"null\" => false));\n\t\t$t->column(\"quantity\", \"string\", array(\"null\" => false));\n\t\t$t->column(\"annotation\", \"text\", array(\"null\" => false));\n\t\t$t->column(\"inscriptions\", \"text\", array(\"null\" => false));\n\t\t$t->column(\"height\", \"float\", array(\"null\" => false));\n\t\t$t->column(\"width\", \"float\", array(\"null\" => false));\n\t\t$t->column(\"depth\", \"float\", array(\"null\" => false));\n\t\t$t->column(\"length\", \"float\", array(\"null\" => false));\n\t\t$t->column(\"circumference\", \"float\", array(\"null\" => false));\n\t\t$t->column(\"diameter\", \"float\", array(\"null\" => false));\n\t\t$t->column(\"volume\", \"float\", array(\"null\" => false));\n\t\t$t->column(\"weight\", \"float\", array(\"null\" => false));\n\t\t$t->column(\"area\", \"float\", array(\"null\" => false));\n\t\t$t->column(\"base\", \"float\", array(\"null\" => false));\n\t\t$t->column(\"running_time\", \"string\", array(\"null\" => false));\n\t\t$t->column(\"measurement_remarks\", \"text\", array(\"null\" => false));\n\t\t$t->column(\"attributes\", \"text\", array(\"null\" => false));\n\t\t$t->column(\"remarks\", \"text\", array(\"null\" => false));\n\n\t\tif ($table == 'works_histories' ) {\n\t\t\t$t->column(\"start_date\", \"integer\", array(\"unsigned\" => true));\n\t\t\t$t->column(\"end_date\", \"integer\", array(\"unsigned\" => true));\n\t\t}\n\n\t\t$t->finish();\n\t\t\n\t\tif ($table == 'works') {\n\n\t\t\t$tmp_works = $this->select_all(\"SELECT * FROM tmp_works\");\n\n\t\t} elseif ($table == 'works_histories') {\n\n\t\t\t$tmp_works = $this->select_all(\"SELECT * FROM tmp_works_histories\");\n\n\t\t}\t\n\n\t\tif($tmp_works) {\n\t\t\n\t\t\tforeach ($tmp_works as $row) {\n\n\t\t\t\t$id = $row['id'];\n\t\t\t\t$title = mysql_real_escape_string($row['title']);\n\t\t\t\t$artist = mysql_real_escape_string($row['artist']);\n\t\t\t\t$creation_number = mysql_real_escape_string($row['creation_number']);\n\t\t\t\t$materials = mysql_real_escape_string($row['materials']);\n\t\t\t\t$quantity = mysql_real_escape_string($row['quantity']);\n\t\t\t\t$location = mysql_real_escape_string($row['location']);\n\t\t\t\t$annotation = mysql_real_escape_string($row['annotation']);\n\t\t\t\t$height = $row['height'];\n\t\t\t\t$width = $row['width'];\n\t\t\t\t$depth = $row['depth'];\n\t\t\t\t$diameter = $row['diameter'];\n\t\t\t\t$weight = $row['weight'];\n\t\t\t\t$running_time = mysql_real_escape_string($row['running_time']);\n\t\t\t\t$measurement_remarks = mysql_real_escape_string($row['measurement_remarks']);\n\t\t\t\t$remarks = mysql_real_escape_string($row['remarks']);\n\t\t\t\t\n\t\t\t\tif ($table == 'works') {\n\t\t\t\t\t$this->execute(\"INSERT INTO works (id, title, artist, creation_number, materials, quantity, location, height, width, depth, diameter, weight, running_time, measurement_remarks, annotation, remarks) VALUES ('$id', '$title', '$artist', '$creation_number', '$materials', '$quantity', '$location', '$height', '$width', '$depth', '$diameter', '$weight', '$running_time', '$measurement_remarks', '$annotation', '$remarks') \");\n\t\t\t\t} elseif ($table == 'works_histories') {\n\n\t\t\t\t\t$work_id = $row['work_id'];\n\t\t\t\t\t$start_date = $row['start_date'];\n\t\t\t\t\t$end_date = $row['end_date'];\n\n\t\t\t\t\t$this->execute(\"INSERT INTO works_histories (id, work_id, title, artist, creation_number, materials, quantity, location, height, width, depth, diameter, weight, running_time, measurement_remarks, annotation, remarks, start_date, end_date) VALUES ('$id', '$work_id', '$title', '$artist', '$creation_number', '$materials', '$quantity', '$location', '$height', '$width', '$depth', '$diameter', '$weight', '$running_time', '$measurement_remarks', '$annotation', '$remarks', '$start_date', '$end_date') \");\n\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\n\t\t}\n\t}\n\n\t//Any end dates that are 0 should instead be NULL\n\n\t$this->execute(\"UPDATE archives_histories SET end_date = NULL where end_date = 0\");\n\t$this->execute(\"UPDATE works_histories SET end_date = NULL where end_date = 0\");\n\n\t//Finally, create the triggers for Works Histories\n\t\t\n\t$this->execute(\"CREATE TRIGGER WorksHistoriesTableInsert AFTER INSERT ON works FOR EACH ROW BEGIN DECLARE N int(11); SET N = UNIX_TIMESTAMP(); INSERT INTO works_histories (work_id, title, artist, creation_number, materials, techniques, color, format, shape, size, state, location, quantity, annotation, inscriptions, height, width, depth, length, circumference, diameter, volume, weight, area, base, running_time, measurement_remarks, attributes, remarks, start_date, end_date) VALUES (NEW.id, NEW.title, NEW.artist, NEW.creation_number, NEW.materials, NEW.techniques, NEW.color, NEW.format, NEW.shape, NEW.size, NEW.state, NEW.location, NEW.quantity, NEW.annotation, NEW.inscriptions, NEW.height, NEW.width, NEW.depth, NEW.length, NEW.circumference, NEW.diameter, NEW.volume, NEW.weight, NEW.area, NEW.base, NEW.running_time, NEW.measurement_remarks, NEW.attributes, NEW.remarks, N, NULL); END\");\n\t$this->execute(\"CREATE TRIGGER WorksHistoriesTableDelete AFTER DELETE ON works FOR EACH ROW BEGIN DECLARE N int(11); SET N = UNIX_TIMESTAMP(); UPDATE works_histories SET end_date = N WHERE work_id = OLD.id AND end_date IS NULL; END\");\n\t$this->execute(\"CREATE TRIGGER WorksHistoriesTableUpdate AFTER UPDATE ON works FOR EACH ROW BEGIN DECLARE N int(11); SET N = UNIX_TIMESTAMP(); UPDATE works_histories SET end_date = N WHERE work_id = OLD.id AND end_date IS NULL; INSERT INTO works_histories (work_id, title, artist, creation_number, materials, techniques, color, format, shape, size, state, location, quantity, annotation, inscriptions, height, width, depth, length, circumference, diameter, volume, weight, area, base, running_time, measurement_remarks, attributes, remarks, start_date, end_date) VALUES (NEW.id, NEW.title, NEW.artist, NEW.creation_number, NEW.materials, NEW.techniques, NEW.color, NEW.format, NEW.shape, NEW.size, NEW.state, NEW.location, NEW.quantity, NEW.annotation, NEW.inscriptions, NEW.height, NEW.width, NEW.depth, NEW.length, NEW.circumference, NEW.diameter, NEW.volume, NEW.weight, NEW.area, NEW.base, NEW.running_time, NEW.measurement_remarks, NEW.attributes, NEW.remarks, N, NULL); END\");\t\n\n }", "public function test_get_runnable_migrations_going_up_with_target_version_no_current()\n {\n $migrator_util = new Ruckusing_Util_Migrator($this->adapter);\n $actual_up_files = $migrator_util->get_runnable_migrations($this->migrations_dirs, 'up', 3, false);\n $expect_up_files = array(\n array(\n 'version' => 1,\n 'class' => 'CreateUsers',\n 'file' => '001_CreateUsers.php',\n 'module' => 'default'\n ),\n array(\n 'version' => 3,\n 'class' => 'AddIndexToBlogs',\n 'file' => '003_AddIndexToBlogs.php',\n 'module' => 'default'\n )\n );\n $this->assertEquals($expect_up_files, $actual_up_files);\n }", "public function migrate()\n {\n $this->prepareWizardsTable();\n\n $this->processProcessing();\n $this->processLogs();\n $this->processConfigData();\n\n $this->prepareOrdersTables();\n $this->prepareOrdersConfigTable();\n $this->processOrdersData();\n }", "public function upgrade(array $stepParams = [])\n\t{\n\t}", "protected function publishMigrations()\n {\n if (class_exists('CreatePagesTables')) {\n return;\n }\n $timestamp = date('Y_m_d_His', time());\n $stub = __DIR__.'/../database/migrations/create_pages_tables.php';\n $target = $this->app->databasePath().'/migrations/'.$timestamp.'_create_pages_tables.php';\n $this->publishes([$stub => $target], 'ds.pages.migrations');\n }", "public function up(Request $request)\n {\n $this->authorize('isAdmin');\n $id = $request->id;\n $ourteam =Ourteam::findorFail($id);\n $ourteam->moveOrderUp();\n\n return ['message'=>'ourteam reordered'];\n }", "public function up()\n {\n $this->db->createCommand($this->DROP_SQL)->execute();\n $this->db->createCommand($this->CREATE_SQL)->execute();\n }", "public function up()\n {\n $this->db->createCommand($this->DROP_SQL)->execute();\n $this->db->createCommand($this->CREATE_SQL)->execute();\n }", "public function down($targetMigration)\n {\n $migrationsModel = new Ot_Model_DbTable_Migrations($this->_tablePrefix);\n \n end($this->_appliedMigrations);\n $highestExecutedMigration = current($this->_appliedMigrations);\n reset($this->_appliedMigrations);\n\n if (!isset($this->_availableMigrations[$targetMigration])) {\n throw new Exception('The requested migration ' . $targetMigration . ' was not found.');\n }\n \n if ((int)$highestExecutedMigration <= (int)$targetMigration) {\n throw new Exception('The database is only migrated to migration ' . $highestExecutedMigration . ', which is before the requested migration ' . $targetMigration);\n }\n \n $migrationsToApply = array();\n \n foreach ($this->_appliedMigrations as $a) {\n if ((int)$a > (int)$targetMigration && isset($this->_availableMigrations[$a])) {\n $migrationsToApply[] = $this->_availableMigrations[$a];\n }\n }\n \n $migrationsToApply = array_reverse($migrationsToApply);\n \n if (empty($migrationsToApply)) {\n $this->_messages[] = 'No migrations to apply';\n }\n \n $this->_db->beginTransaction();\n \n foreach ($migrationsToApply as $m) {\n require_once $this->_migrationsPath . '/' . $m;\n $classname = 'Db_' . substr($m, 0, -4); //strip out the .php extension\n $migrationClass = new $classname(array('tablePrefix' => $this->_tablePrefix));\n\n try {\n $migrationClass->down($this->_db, $this->_tablePrefix);\n } catch (Exception $e) {\n $this->_db->rollback();\n throw new Exception('Error applying migration ' . $m . '. ' . $e->getMessage());\n }\n \n try {\n $migrationsModel->removeMigration($this->_getMigrationIdFromFilename($m));\n } catch (Exception $e) {\n $this->_db->rollback();\n throw new Exception('Migration ' . $m . ' was successful, but adding record to migrations table failed. ' . $e->getMessage());\n }\n \n $this->_messages[] = 'Down migration of ' . $m . ' was successful.';\n }\n \n $this->_db->commit();\n }", "public function testMigrationsOptionsMarkMigrated()\n {\n $this->exec('completion options migrations.migrations mark_migrated');\n $this->assertCount(1, $this->_out->messages());\n $output = $this->_out->messages()[0];\n $expected = '--connection -c --exclude -x --help -h --only -o --plugin -p --quiet -q';\n $expected .= ' --source -s --target -t --verbose -v';\n $outputExplode = explode(' ', trim($output));\n sort($outputExplode);\n $expectedExplode = explode(' ', $expected);\n sort($expectedExplode);\n\n $this->assertEquals($outputExplode, $expectedExplode);\n }" ]
[ "0.6925409", "0.6138259", "0.6020842", "0.59198284", "0.5851253", "0.5794809", "0.5740674", "0.5654022", "0.5619761", "0.561222", "0.55906004", "0.55906004", "0.55906004", "0.5510452", "0.54333055", "0.5402129", "0.5372516", "0.53548384", "0.5351869", "0.5333748", "0.5321703", "0.5304439", "0.52727246", "0.5260665", "0.52599895", "0.52599895", "0.52599895", "0.52045536", "0.519924", "0.51793325", "0.5177312", "0.5167401", "0.5160765", "0.5160443", "0.5158395", "0.5152151", "0.5122664", "0.51197565", "0.5102616", "0.5096065", "0.5087488", "0.5084955", "0.50827205", "0.50651014", "0.5062034", "0.5050074", "0.5049161", "0.50331163", "0.5023383", "0.50224787", "0.50058055", "0.50033563", "0.50033563", "0.49981788", "0.49937057", "0.4990033", "0.4987737", "0.49776077", "0.49717724", "0.49667376", "0.49569193", "0.49497738", "0.49455246", "0.49395418", "0.49384364", "0.4938209", "0.49369153", "0.49268642", "0.49220443", "0.4902243", "0.4902243", "0.4902243", "0.48955864", "0.48827112", "0.4880044", "0.48667783", "0.48666373", "0.48666373", "0.48666373", "0.48506764", "0.48470673", "0.48458934", "0.48413515", "0.48115206", "0.47975692", "0.47797912", "0.47786772", "0.47675148", "0.4763486", "0.47581345", "0.4757667", "0.47527915", "0.47459614", "0.47417644", "0.47374544", "0.4736325", "0.47351357", "0.47351357", "0.47148222", "0.47131765" ]
0.69424427
0
Provided as a sorter on migrations by using adapter compare method and taking into consideration the active target. If we are looking into a rollback result the array is reversed.
private function sortMigrations(& $migrations, $target) { $filter = $this->getFilter(); if (!$this->isDownwards($target)) { uksort($migrations, array($filter, 'compare')); } else { uksort($migrations, function($a, $b) use ($filter) { return $filter->compare($b, $a); // reverse arguments } ); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getExecutedMigrations()\n\t{\n\t\t$migrations = $this->getAdapter()->getMigrations();\n\t\tuksort($migrations, array($this->getFilter(), 'compare'));\n\t\treturn $migrations;\n\t}", "public function getAvailableMigrations($target=null)\n\t{\n\t\t// for normal migration we need all files to target\n\t\t// for rollbacks we need from target to the greatest migration\n\t\t$filter = $this->getFilter();\n\t\tif (!$this->isDownwards($target)) {\n\t\t\tif (null !== $target) {\n\t\t\t\t$filter->setToVersion($target);\n\t\t\t}\n\t\t} else {\t// rollback\n\t\t\t$filter->setFromVersion($target);\n\t\t\t$filter->setToVersion($this->getGreatestMigration());\n\t\t}\n\n\t\t$migration_steps = $this->getMigrationSteps();\n\n\t\t// migrations to be executed\n\t\t$to_execute = array();\n\t\tif ($this->isDownwards($target)) {\n\t\t\t// rollback: execute the common part of $executed and $migration_refs\n\t\t\t$executed = $this->getExecutedMigrations();\n\t\t\tforeach($migration_steps as $ref => $migration_class) {\n\t\t\t\tif (array_key_exists($ref, $executed)) {\n\t\t\t\t\t$to_execute[] = $ref;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t// migration: execute what's missing - the different of $executed and $available\n\t\t\t$to_execute = array_diff(array_keys($migration_steps), array_keys($this->getExecutedMigrations()));\n\t\t}\n\t\t\n\t\t// go through $to_execute and find the migration steps\n\t\t$migrations = array();\n\t\tforeach ($to_execute as $ref) {\n\t\t\t$migrations[$ref] = $migration_steps[$ref];\n\t\t}\n\t\t\n\t\t// sort migrations according to filter and target\n\t\t// remove one so that to avoid executing target in the case of rollback\n\t\t$this->sortMigrations($migrations, $target);\n\t\tif ($this->isDownwards($target)) {\n\t\t\tarray_pop($migrations);\n\t\t}\n\t\treturn $migrations;\n\t}", "public function test_get_runnable_migrations_going_down_with_target_version_no_current()\n {\n $migrator_util = new Ruckusing_Util_Migrator($this->adapter);\n $this->insert_dummy_version_data(array(3, '20090122193325'));\n $actual_down_files = $migrator_util->get_runnable_migrations($this->migrations_dirs, 'down', 1, false);\n $expect_down_files = array(\n array(\n 'version' => '20090122193325',\n 'class' => 'AddNewTable',\n 'file' => '20090122193325_AddNewTable.php',\n 'module' => 'default'\n ),\n array(\n 'version' => 3,\n 'class' => 'AddIndexToBlogs',\n 'file' => '003_AddIndexToBlogs.php',\n 'module' => 'default'\n )\n );\n $this->assertEquals($expect_down_files, $actual_down_files);\n $this->clear_dummy_data();\n\n $this->insert_dummy_version_data(array(3));\n $actual_down_files = $migrator_util->get_runnable_migrations($this->migrations_dirs, 'down', 1, false);\n $expect_down_files = array(\n array(\n 'version' => 3,\n 'class' => 'AddIndexToBlogs',\n 'file' => '003_AddIndexToBlogs.php',\n 'module' => 'default'\n )\n );\n $this->assertEquals($expect_down_files, $actual_down_files);\n\n //go all the way down!\n $this->clear_dummy_data();\n $this->insert_dummy_version_data(array(1, 3, '20090122193325'));\n $actual_down_files = $migrator_util->get_runnable_migrations($this->migrations_dirs, 'down', 0, false);\n $expect_down_files = array(\n array(\n 'version' => '20090122193325',\n 'class' => 'AddNewTable',\n 'file' => '20090122193325_AddNewTable.php',\n 'module' => 'default'\n ),\n array(\n 'version' => 3,\n 'class' => 'AddIndexToBlogs',\n 'file' => '003_AddIndexToBlogs.php',\n 'module' => 'default'\n ),\n array(\n 'version' => 1,\n 'class' => 'CreateUsers',\n 'file' => '001_CreateUsers.php',\n 'module' => 'default'\n )\n );\n $this->assertEquals($expect_down_files, $actual_down_files);\n }", "public function sortStrategy();", "private function getMigrations()\n\t\t{\n\t\t\tif(self::$migrations)\n\t\t\t{\n\t\t\t\treturn self::$migrations;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tforeach(\\System\\DB\\DataAdapter::create(\"adapter=dir;source=\".__MIGRATIONS_PATH__.\";\")->openDataSet()->rows as $row)\n\t\t\t\t{\n\t\t\t\t\tif(\\strpos($row[\"name\"], '.php'))\n\t\t\t\t\t{\n\t\t\t\t\t\trequire $row[\"path\"];\n\t\t\t\t\t\t$migration = \\str_replace(\".php\", \"\", $row[\"name\"]);\n\t\t\t\t\t\teval(\"\\$migration = new \\\\System\\\\Migrate\\\\{$migration}();\");\n\n\t\t\t\t\t\tself::$migrations[] = new $migration();\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$CSort = new MigrationCompare();\n\t\t\t\tusort( self::$migrations, array( &$CSort, 'compareVersion' ));\n\t\t\t\treturn self::$migrations;\n\t\t\t}\n\t\t}", "abstract public function prepareSort();", "public function sortArraysByKeyCheckIfSortingIsCorrectDataProvider() {}", "public function test_get_runnable_migrations_going_up_with_target_version_with_current()\n {\n $migrator_util = new Ruckusing_Util_Migrator($this->adapter);\n //pretend we already executed version 1\n $this->insert_dummy_version_data(array(1));\n $actual_up_files = $migrator_util->get_runnable_migrations($this->migrations_dirs, 'up', 3, false);\n $expect_up_files = array(\n array(\n 'version' => 3,\n 'class' => 'AddIndexToBlogs',\n 'file' => '003_AddIndexToBlogs.php',\n 'module' => 'default'\n )\n );\n $this->assertEquals($expect_up_files, $actual_up_files);\n $this->clear_dummy_data();\n\n //now pre-register some migrations that we have already executed\n $this->insert_dummy_version_data(array(1, 3));\n $actual_up_files = $migrator_util->get_runnable_migrations($this->migrations_dirs, 'up', 3, false);\n $this->assertEquals(array(), $actual_up_files);\n }", "public function test_get_runnable_migrations_going_down_no_target_version()\n {\n $migrator_util = new Ruckusing_Util_Migrator($this->adapter);\n $actual_down_files = $migrator_util->get_runnable_migrations($this->migrations_dirs, 'down', false);\n $this->assertEquals(array() , $actual_down_files);\n }", "public function getRan()\n {\n return $this->table()\n ->where('plugin', $this->plugin)\n ->orderBy('batch', 'asc')\n ->orderBy('migration', 'asc')\n ->pluck('migration')->all();\n }", "public function sortDirection();", "public function needToMigrateList(): array;", "public function getRan()\n {\n global $wpdb;\n\n $sql = \"SELECT migration as name FROM {$wpdb->prefix}exolnet_migration as em\";\n\n $migrations = $wpdb->get_results($sql, 'ARRAY_A');\n\n $migrationCleaned = [];\n if (!empty($migrations) && is_array($migrations)) {\n foreach ($migrations as $migration) {\n $migrationCleaned[] = $migration['name'];\n }\n }\n\n return $migrationCleaned;\n }", "public function test_get_runnable_migrations_going_up_no_target_version()\n {\n $migrator_util = new Ruckusing_Util_Migrator($this->adapter);\n $actual_up_files = $migrator_util->get_runnable_migrations($this->migrations_dirs, 'up', false);\n $expect_up_files = array(\n array(\n 'version' => 1,\n 'class' => 'CreateUsers',\n 'file' => '001_CreateUsers.php',\n 'module' => 'default'\n ),\n array(\n 'version' => 3,\n 'class' => 'AddIndexToBlogs',\n 'file' => '003_AddIndexToBlogs.php',\n 'module' => 'default'\n ),\n array(\n 'version' => '20090122193325',\n 'class' => 'AddNewTable',\n 'file' => '20090122193325_AddNewTable.php',\n 'module' => 'default'\n )\n );\n $this->assertEquals($expect_up_files, $actual_up_files);\n }", "public function getModulesInMigrationOrder(): array;", "private function sortAdaptors()\n {\n $this->sorted = [];\n\n if (isset($this->adaptors)) {\n krsort($this->adaptors);\n $this->sorted = array_merge(...$this->adaptors);\n }\n }", "public function test_get_runnable_migrations_going_up_with_target_version_no_current()\n {\n $migrator_util = new Ruckusing_Util_Migrator($this->adapter);\n $actual_up_files = $migrator_util->get_runnable_migrations($this->migrations_dirs, 'up', 3, false);\n $expect_up_files = array(\n array(\n 'version' => 1,\n 'class' => 'CreateUsers',\n 'file' => '001_CreateUsers.php',\n 'module' => 'default'\n ),\n array(\n 'version' => 3,\n 'class' => 'AddIndexToBlogs',\n 'file' => '003_AddIndexToBlogs.php',\n 'module' => 'default'\n )\n );\n $this->assertEquals($expect_up_files, $actual_up_files);\n }", "abstract protected function setUpComparator();", "public function migrate($target=null)\n\t{\t\n\t\t$migrations = $this->getAvailableMigrations($target);\n\t\tif (null === $target) {\n\t\t\tend($migrations);\n\t\t\t$target = key($migrations);\n\t\t}\n\t\t\n\t\tif (!$this->isDownwards($target)) {\n\t\t\treturn $this->doMigration($migrations, AdapterInterface::UP);\n\t\t} else {\n\t\t\treturn $this->doMigration($migrations, AdapterInterface::DOWN);\n\t\t}\n\t}", "public function migrateDateDataProvider()\n {\n return [\n [['20120111235330', '20120116183504'], '20120118', '20120116183504', 'Failed to migrate all migrations when migrate to date is later than all the migrations'],\n [['20120111235330', '20120116183504'], '20120115', '20120111235330', 'Failed to migrate 1 migration when the migrate to date is between 2 migrations'],\n [['20120111235330', '20120116183504'], '20120111235330', '20120111235330', 'Failed to migrate 1 migration when the migrate to date is one of the migrations'],\n [['20120111235330', '20120116183504'], '20110115', null, 'Failed to migrate 0 migrations when the migrate to date is before all the migrations'],\n ];\n }", "public function arrange() {}", "function _compareActions($a,$b){\n\t\tif ( @$a['order'] < @$b['order'] ) return -1;\n\t\telse return 1;\n\t}", "protected function applySorting()\n\t{\n\t\t$i = 1;\n\t\tparse_str($this->order, $list);\n\t\tforeach ($list as $field => $dir) {\n\t\t\t$this->dataSource->sort($field, $dir === 'a' ? IDataSource::ASCENDING : IDataSource::DESCENDING);\n\t\t\t$list[$field] = array($dir, $i++);\n\t\t}\n\t\treturn $list;\n\t}", "public function testMigrationsOptionsRollback()\n {\n $this->exec('completion options migrations.migrations rollback');\n $this->assertCount(1, $this->_out->messages());\n $output = $this->_out->messages()[0];\n $expected = '--connection -c --date -d --dry-run -x --fake --force -f --help -h --no-lock --plugin -p';\n $expected .= ' --quiet -q --source -s --target -t --verbose -v';\n $outputExplode = explode(' ', trim($output));\n sort($outputExplode);\n $expectedExplode = explode(' ', $expected);\n sort($expectedExplode);\n\n $this->assertEquals($outputExplode, $expectedExplode);\n }", "public static function sortByStatus(){\n $db = Db::getConnection();\n \n $result = $db->query('SELECT * FROM task ORDER BY status DESC');\n \n return $result->fetchAll();\n }", "private function sortOptions()\r\n {\r\n $pageActions = array(); // For the result\r\n // Sort changes by file\r\n usort($this->changeAr, \"cmp\");\r\n\r\n foreach ($this->changeAr as $line) {\r\n $file = $line['file'];\r\n $action = $line['action'];\r\n if (array_key_exists($file, $pageActions)) {\r\n continue;\r\n }\r\n $pageActions[$file] = $action;\r\n }\r\n// print_r($pageActions);\r\n return $pageActions;\r\n }", "public function test_resolve_current_version_going_down()\n {\n $this->clear_dummy_data();\n $this->insert_dummy_version_data(array(1,2,3));\n\n $migrator_util = new Ruckusing_Util_Migrator($this->adapter);\n $migrator_util->resolve_current_version(3, 'down');\n\n $executed = $migrator_util->get_executed_migrations();\n $this->assertEquals(false, in_array(3, $executed));\n $this->assertEquals(true, in_array(1, $executed));\n $this->assertEquals(true, in_array(2, $executed));\n }", "private function getMigrationSteps()\n\t{\n\t\t$migration_steps = array();\n\t\tforeach ($this->getFilter() as $step) {\n\t\t\t$migration_steps[$step->getReference()] = $step;\n\t\t}\n\t\t\n\t\treturn $migration_steps;\n\t}", "function alistcmp($a,$b) {\n $abook_sort_order=get_abook_sort();\n\n switch ($abook_sort_order) {\n case 0:\n case 1:\n $abook_sort='nickname';\n break;\n case 4:\n case 5:\n $abook_sort='email';\n break;\n case 6:\n case 7:\n $abook_sort='label';\n break;\n case 2:\n case 3:\n case 8:\n default:\n $abook_sort='name';\n }\n\n if ($a['backend'] > $b['backend']) {\n return 1;\n } else {\n if ($a['backend'] < $b['backend']) {\n return -1;\n }\n }\n\n if( (($abook_sort_order+2) % 2) == 1) {\n return (strtolower($a[$abook_sort]) < strtolower($b[$abook_sort])) ? 1 : -1;\n } else {\n return (strtolower($a[$abook_sort]) > strtolower($b[$abook_sort])) ? 1 : -1;\n }\n}", "public function testTableSortQuery() {\n $sorts = [\n ['field' => 'Task ID', 'sort' => 'desc', 'first' => 'perform at superbowl', 'last' => 'eat'],\n ['field' => 'Task ID', 'sort' => 'asc', 'first' => 'eat', 'last' => 'perform at superbowl'],\n ['field' => 'Task', 'sort' => 'asc', 'first' => 'code', 'last' => 'sleep'],\n ['field' => 'Task', 'sort' => 'desc', 'first' => 'sleep', 'last' => 'code'],\n // more elements here\n\n ];\n\n foreach ($sorts as $sort) {\n $this->drupalGet('database_test/tablesort/', ['query' => ['order' => $sort['field'], 'sort' => $sort['sort']]]);\n $data = json_decode($this->getSession()->getPage()->getContent());\n\n $first = array_shift($data->tasks);\n $last = array_pop($data->tasks);\n\n $this->assertEquals($sort['first'], $first->task, 'Items appear in the correct order.');\n $this->assertEquals($sort['last'], $last->task, 'Items appear in the correct order.');\n }\n }", "protected function getMigrationsRan()\n {\n // TODO: Move query to a query factory based on db_adapter\n $resource = $this->db_adapter->query(\n \"SELECT file FROM $this->migration_table\"\n );\n\n // TODO: Needs to be abstracted from this class\n $results = pg_fetch_all($resource) ?: [];\n\n // Flatten the array structure to a single dimension\n $migrations_ran = array_map(function ($result) {\n return $result['file'];\n }, $results);\n\n return $migrations_ran;\n }", "public function getSorting();", "public function getActiveMigrations() {\n\t\tif (!is_array($this->activeMigrations)) {\n\t\t\t$this->activeMigrations = array();\n\t\t\t/** @var Tx_Smoothmigration_Service_RequirementsAnalyzer $requirementsAnalyzer */\n\t\t\t$requirementsAnalyzer = t3lib_div::makeInstance('Tx_Smoothmigration_Service_RequirementsAnalyzer');\n\n\t\t\tforeach ($this->registeredMigrations as $className) {\n\t\t\t\t/** @var Tx_Smoothmigration_Domain_Interface_Migration $check */\n\t\t\t\t$migration = t3lib_div::makeInstance($className);\n\t\t\t\tif ($requirementsAnalyzer->isActive($migration)) {\n\t\t\t\t\t$this->activeMigrations[] = $migration;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $this->activeMigrations;\n\t}", "function cmpByOrderIndexDesc($a, $b)\n{\n if ($a['order_index'] == $b['order_index']) {\n return 0;\n }\n return($a['order_index'] > $b['order_index']) ? -1 : 1;\n}", "public function asort() {}", "private function saveHistory()\n {\n ksort($this->migrations);\n foreach ($this->migrations as $k => $migration) {\n if ($migration['id'] === 0) {\n // new\n $prep = $this->db->prepare(\"INSERT INTO `{$this->table}` (`created_at`,`name`,`author`,`status`) \"\n . \"VALUES (:time, :name, :author, :status)\");\n $prep->execute([\n ':time' => $migration['time'],\n ':name' => $migration['name'],\n ':author' => $migration['author'],\n ':status' => $migration['status'],\n ]);\n // get inserted id\n $sth = $this->db->query('SELECT LAST_INSERT_ID()');\n $newId = $sth->fetchColumn();\n $this->migrations[$k]['id'] = $newId;\n } else if ($migration['id'] === -100) {\n // delete\n $prep = $this->db->prepare(\"DELETE FROM `{$this->table}` WHERE `id` = :id\");\n $prep->execute([':id' => $migration['id']]);\n } else {\n // update\n $prep = $this->db->prepare(\"UPDATE `{$this->table}` SET `status` = :status WHERE `id` = :id\");\n $prep->execute([':id' => $migration['id'], ':status' => $migration['status']]);\n }\n }\n }", "protected function sortAndSavePackageStates() {}", "protected function sortAndSavePackageStates() {}", "protected function sortAndSavePackageStates() {}", "public function test_scan_sort_desc()\n {\n $content = array('.','..','application','.git','.gitignore','.htaccess','index.php','nbproject','README','system');\n $object = Directory::factory(ROOT);\n $res = $object->scan(Directory::SORT_DESC);\n \n $output = array();\n foreach($res as $f) $output[] = $f->get_base_name();\n $this->assertEquals(array_reverse($content), $output);\n }", "private function findComponentsWhichNeedMigrated(): array\n {\n $aModules = Components::available(false);\n $aOut = [];\n\n foreach ($aModules as $oModule) {\n $oState = $this->determineModuleState($oModule);\n if ($oState->start !== $oState->end) {\n $aOut[] = $oState;\n }\n }\n\n // Shift the app migrations onto the end so they are executed last\n if (!empty($aOut)) {\n $oFirst = reset($aOut);\n if ($oFirst->slug === Components::$sAppSlug) {\n $oApp = array_shift($aOut);\n $aOut = array_merge($aOut, [$oApp]);\n $aOut = array_filter($aOut);\n $aOut = array_values($aOut);\n }\n }\n\n return $aOut;\n }", "public function getMigrations(){\n $migrations[] = new migrateTable0001($this->get('db'));\n $migrations[] = new migrateTable0002($this->get('db'));\n $migrations[] = new migrateTableEvent($this->get('db'));\n $migrations[] = new migrateTableMessages($this->get('db'));\n $migrations[] = new migrateTablePerson($this->get('db'));\n $migrations[] = new migrateTable122320151845($this->get('db'));\n\n return $migrations;\n }", "protected function getDatabaseDifferences() {}", "function database_benchmark_sort()\n {\n if( !function_exists('dbtimecmp') )\n {\n function dbtimecmp($a, $b)\n {\n //return ( $a['time']==$b['time'] ? 0 : ($a['time']<$b['time'] ? -1 : 1) );\n return ( (float)$a['time']==(float)$b['time'] ? 0 : ((float)$a['time']>(float)$b['time'] ? -1 : 1) );\n }\n }\n \n usort($this->log_data, 'dbtimecmp');\n \n return '';\n }", "protected function prepareOrderByStatement() {}", "public function getSortOrder(): int;", "public function testSortingOrder2()\n {\n $this->sortingOrderGeneration();\n }", "private function sortQueryOrders() {\n foreach ($this->queryResult as $index => $order) {\n $order = $this->injectKitData($order);\n $this->statusOutputOrder[$order['Order']['status']][$order['Order']['id']] = $order;\n }\n }", "public function getUpCandidates()\n {\n $statuses = $this->getStatuses();\n\n // search latest applied migration\n $latest = '';\n foreach ($statuses as $status) {\n if ($status->appliedAt !== \"\") {\n $latest = $status->file->getFileName();\n }\n }\n\n // make statuses without being applied\n $candidates = [];\n $isSkipped = ($latest === '')? false: true;\n foreach ($statuses as $status) {\n if (false === $isSkipped) {\n $candidates[] = $status;\n }\n if($status->file->getFileName() !== $latest) {\n continue;\n } else {\n $isSkipped = false;\n }\n }\n\n return $candidates;\n }", "public function getMigrationsToRun() : array\n {\n $allMigrations = $this->getAllMigrations();\n $ranMigrations = $this->getRanMigrations();\n\n return array_diff($allMigrations, $ranMigrations);\n }", "public function getMigrations();", "public function getSortOrder();", "public function getSortOrder();", "public function getSortOrder();", "public function sortAction()\n {\n $this->getResponse()->addHeader('Content-type', 'text/plain');\n $this->getResponse()->sendHeaders();\n\n $sql_set = \"SET @sort := 0, @context := ''\";\n\n $sql_context = 'UPDATE `%1$s` SET\n`sort`=(@sort := IF(@context != `%3$s`, 0, @sort +1)),\n`%3$s` = (@context := `%3$s`)\nORDER BY `%3$s`,`sort`,`%2$s`';\n\n $sql_single = 'UPDATE `%1$s` SET\n`sort`=(@sort := @sort +1)\nORDER BY `sort`,`%2$s`';\n\n $tables = array(\n 'shop_plugin' => 'shopPluginModel',\n 'shop_product_skus' => 'shopProductSkusModel',\n 'shop_type' => 'shopTypeModel',\n 'shop_type_features' => 'shopTypeFeaturesModel',\n 'shop_feature_values_dimension' => 'shopFeatureValuesDimensionModel',\n 'shop_feature_values_double' => 'shopFeatureValuesDoubleModel',\n 'shop_feature_values_text' => 'shopFeatureValuesTextModel',\n 'shop_feature_values_varchar' => 'shopFeatureValuesVarcharModel',\n 'shop_feature_values_color' => 'shopFeatureValuesColorModel',\n 'shop_importexport' => 'shopImportexportModel',\n );\n\n $counter = 0;\n\n $trace = waRequest::request('trace');\n\n foreach ($tables as $table => $table_model) {\n if (class_exists($table_model)) {\n $model = new $table_model();\n /**\n * @var $model shopSortableModel\n */\n print sprintf(\"#%d\\tRepair sort field at `%s` table:\\n\", ++$counter, $table);\n try {\n $id = $model->getTableId();\n if (is_array($id)) {\n $id = implode('`, `', $id);\n }\n if ($context = $model->getTableContext()) {\n $sql = sprintf($sql_context, $model->getTableName(), $id, $context);\n } else {\n $sql = sprintf($sql_single, $model->getTableName(), $id);\n }\n if ($trace) {\n print \"{$sql_set};\\n{$sql};\\n\";\n }\n $model->exec($sql_set);\n $model->exec($sql);\n print \"OK\";\n } catch (waDbException $e) {\n print \"ERROR:\".$e->getMessage();\n }\n print \"\\n\\n\";\n }\n }\n if (empty($model)) {\n $model = new waModel();\n }\n\n $tables = array(\n 'shop_product_images' => 'product_id',\n 'shop_product_pages' => 'product_id',\n 'shop_service_variants' => 'service_id',\n //'shop_set_products' => 'set_id',\n //'shop_tax_zip_codes' => 'tax_id',\n );\n foreach ($tables as $table => $context) {\n $sqls = array();\n $sqls[] = \"SET @sort := 0, @context := ''\";\n $sqls[] = \"UPDATE `{$table}` SET\n`sort`=(@sort := IF(@context != `{$context}`, 0, @sort +1)),\n`{$context}` = (@context := `{$context}`)\nORDER BY `{$context}`,`sort`,`id`\";\n\n print sprintf(\"#%d\\tRepair sort field at `%s` table:\\n\", ++$counter, $table);\n while ($sql = array_shift($sqls)) {\n try {\n if ($trace) {\n print \"{$sql};\\n\";\n }\n $model->exec($sql);\n } catch (waDbException $e) {\n print \"ERROR:\".$e->getMessage().\"\\n\\n\";\n break;\n }\n }\n if (!$sqls) {\n print \"OK\\n\\n\";\n }\n }\n\n $tables = array(\n 'shop_currency' => 'code',\n 'shop_service' => 'id',\n 'shop_set' => 'id',\n 'shop_stock' => 'id',\n\n );\n foreach ($tables as $table => $id) {\n $sqls = array();\n $sqls[] = \"SET @sort := 0\";\n $sqls[] = \"UPDATE `{$table}` SET\n`sort`=(@sort := @sort +1)\nORDER BY `sort`,`{$id}`\";\n\n print sprintf(\"#%d\\tRepair sort field at `%s` table:\\n\", ++$counter, $table);\n while ($sql = array_shift($sqls)) {\n try {\n if ($trace) {\n print \"{$sql};\\n\";\n }\n $model->exec($sql);\n } catch (waDbException $e) {\n print \"ERROR:\".$e->getMessage().\"\\n\\n\";\n break;\n }\n }\n if (!$sqls) {\n print \"OK\\n\\n\";\n }\n }\n }", "protected function getAllAvailableSortDescendingOptions() {}", "public function getInvertedCommands()\n {\n $inverted = new Intent();\n\n foreach (array_reverse($this->commands) as $command) {\n switch (true) {\n case $command instanceof CreateTable:\n $inverted->addAction(new DropTable($command->getTable()));\n break;\n\n case $command instanceof RenameTable:\n $inverted->addAction(new RenameTable(new Table($command->getNewName()), $command->getTable()->getName()));\n break;\n\n case $command instanceof AddColumn:\n $inverted->addAction(new RemoveColumn($command->getTable(), $command->getColumn()));\n break;\n\n case $command instanceof RenameColumn:\n $column = clone $command->getColumn();\n $name = $column->getName();\n $column->setName($command->getNewName());\n $inverted->addAction(new RenameColumn($command->getTable(), $column, $name));\n break;\n\n case $command instanceof AddIndex:\n $inverted->addAction(new DropIndex($command->getTable(), $command->getIndex()));\n break;\n\n case $command instanceof AddForeignKey:\n $inverted->addAction(new DropForeignKey($command->getTable(), $command->getForeignKey()));\n break;\n\n default:\n throw new IrreversibleMigrationException(sprintf(\n 'Cannot reverse a \"%s\" command',\n get_class($command)\n ));\n }\n }\n\n return $inverted;\n }", "public function testSort()\n {\n $array = array(\n array('col1' => 20, 'col2' => 20),\n array('col1' => 20, 'col2' => 10),\n array('col1' => 10, 'col2' => 50),\n array('col1' => 10, 'col2' => 10),\n array('col1' => 10, 'col2' => 20),\n );\n\n $expected = array(\n array('col1' => 10, 'col2' => 50),\n array('col1' => 10, 'col2' => 10),\n array('col1' => 10, 'col2' => 20),\n array('col1' => 20, 'col2' => 20),\n array('col1' => 20, 'col2' => 10),\n );\n\n Sort::mergesort($array, function ($row1, $row2) {\n return strcmp($row1['col1'], $row2['col1']);\n });\n\n $this->assertEquals($expected, $array);\n }", "protected function getMigrationsToRun()\n {\n $migrations_ran = $this->getMigrationsRan();\n $migrations_in_dir = $this->getMigrationsInDir();\n\n return array_diff($migrations_in_dir, $migrations_ran);\n }", "public function forceSortAndSavePackageStates() {}", "public function run()\n {\n \n\n \\DB::table('migrations')->delete();\n \n \\DB::table('migrations')->insert(array (\n 0 => \n array (\n 'id' => 1,\n 'migration' => '2019_03_13_181656_create_categories_table',\n 'batch' => 1,\n ),\n 1 => \n array (\n 'id' => 2,\n 'migration' => '2019_03_13_181656_create_failed_jobs_table',\n 'batch' => 1,\n ),\n 2 => \n array (\n 'id' => 3,\n 'migration' => '2019_03_13_181656_create_links_table',\n 'batch' => 1,\n ),\n 3 => \n array (\n 'id' => 4,\n 'migration' => '2019_03_13_181656_create_model_has_permissions_table',\n 'batch' => 1,\n ),\n 4 => \n array (\n 'id' => 5,\n 'migration' => '2019_03_13_181656_create_model_has_roles_table',\n 'batch' => 1,\n ),\n 5 => \n array (\n 'id' => 6,\n 'migration' => '2019_03_13_181656_create_notifications_table',\n 'batch' => 1,\n ),\n 6 => \n array (\n 'id' => 7,\n 'migration' => '2019_03_13_181656_create_password_resets_table',\n 'batch' => 1,\n ),\n 7 => \n array (\n 'id' => 8,\n 'migration' => '2019_03_13_181656_create_permissions_table',\n 'batch' => 1,\n ),\n 8 => \n array (\n 'id' => 9,\n 'migration' => '2019_03_13_181656_create_replies_table',\n 'batch' => 1,\n ),\n 9 => \n array (\n 'id' => 10,\n 'migration' => '2019_03_13_181656_create_role_has_permissions_table',\n 'batch' => 1,\n ),\n 10 => \n array (\n 'id' => 11,\n 'migration' => '2019_03_13_181656_create_roles_table',\n 'batch' => 1,\n ),\n 11 => \n array (\n 'id' => 12,\n 'migration' => '2019_03_13_181656_create_topics_table',\n 'batch' => 1,\n ),\n 12 => \n array (\n 'id' => 13,\n 'migration' => '2019_03_13_181656_create_users_table',\n 'batch' => 1,\n ),\n 13 => \n array (\n 'id' => 14,\n 'migration' => '2019_03_13_181657_add_foreign_keys_to_model_has_permissions_table',\n 'batch' => 1,\n ),\n 14 => \n array (\n 'id' => 15,\n 'migration' => '2019_03_13_181657_add_foreign_keys_to_model_has_roles_table',\n 'batch' => 1,\n ),\n 15 => \n array (\n 'id' => 16,\n 'migration' => '2019_03_13_181657_add_foreign_keys_to_replies_table',\n 'batch' => 1,\n ),\n 16 => \n array (\n 'id' => 17,\n 'migration' => '2019_03_13_181657_add_foreign_keys_to_role_has_permissions_table',\n 'batch' => 1,\n ),\n 17 => \n array (\n 'id' => 18,\n 'migration' => '2019_03_13_181657_add_foreign_keys_to_topics_table',\n 'batch' => 1,\n ),\n ));\n \n \n }", "public function testMigrationsOptionsMarkMigrated()\n {\n $this->exec('completion options migrations.migrations mark_migrated');\n $this->assertCount(1, $this->_out->messages());\n $output = $this->_out->messages()[0];\n $expected = '--connection -c --exclude -x --help -h --only -o --plugin -p --quiet -q';\n $expected .= ' --source -s --target -t --verbose -v';\n $outputExplode = explode(' ', trim($output));\n sort($outputExplode);\n $expectedExplode = explode(' ', $expected);\n sort($expectedExplode);\n\n $this->assertEquals($outputExplode, $expectedExplode);\n }", "protected function getOrderByQuery()\n {\n\t\t$isWhat = $this->model->isWhat();\n\t\t$remoteTable = $this->model->tableName();\n\t\t$localOrderBy = [];\n\t\t$relations = [\n\t\t\t\\nitm\\widgets\\models\\Vote::tableName() => [\n\t\t\t\t'select' => new Expression('COUNT(*)'),\n\t\t\t],\n\t\t\t\\nitm\\widgets\\models\\Issues::tableName() => [\n\t\t\t\t'select' => new Expression('COALESCE(created_at, updated_at)'),\n\t\t\t],\n\t\t\t\\nitm\\widgets\\models\\Replies::tableName() => [\n\t\t\t\t'select' => new Expression('COALESCE(created_at, updated_at)'),\n\t\t\t],\n\t\t\t\\nitm\\widgets\\models\\Revisions::tableName() => [\n\t\t\t\t'select' => ['COUNT(*)'],\n\t\t\t]\n\t\t];\n\t\tforeach($relations as $table=>$relation){\n\t\t\t$localOrderBy[serialize(new Expression('('.(new Query)\n\t\t\t\t->from($table)\n\t\t\t\t->select($relation['select'])\n\t\t\t\t->where([\n\t\t\t\t\t\"$table.parent_id\" => \"$remoteTable.id\",\n\t\t\t\t\t\"$table.parent_type\" => $isWhat\n\t\t\t\t])->createCommand()->getRawSql().')'))] = SORT_DESC;\n\t\t}\n $localOrderBy = array_merge($localOrderBy, [\n serialize(new Expression(\"(CASE $remoteTable.status\n\t\t\t\tWHEN 'normal' THEN 0\n\t\t\t\tWHEN 'important' THEN 1\n\t\t\t\tWHEN 'critical' THEN 2\n\t\t\tEND)\")) => SORT_DESC,\n ]);\n\n return array_merge($localOrderBy, \\nitm\\helpers\\QueryFilter::getOrderByQuery($this->model));\n }", "private function getRollbackList(int $batch): array\r\n {\r\n $listRs = DB::table('migrations')->select('id', 'migration')\r\n ->where('batch', $batch)\r\n ->orderBy('id', 'desc')\r\n ->get();\r\n $return = array();\r\n foreach ($listRs as $v) {\r\n $return[] = [\r\n 'id' => $v->id,\r\n 'migration' => $v->migration,\r\n ];\r\n }\r\n return $return;\r\n }", "function getSort(){ return 301; }", "public function getMigrationsToRun() : array\n {\n $allMigrations = $this->getAllMigrations();\n\n $tableExists = $this->queryBuilderFactory->make()\n ->table_exists($this->table);\n\n if (! $tableExists) {\n return $allMigrations;\n }\n\n /** @var array $runMigrations */\n $runMigrations = $this->queryBuilderFactory->make()\n ->get($this->table)\n ->result();\n\n foreach ($runMigrations as $record) {\n unset($allMigrations[$record->migration]);\n }\n\n return $allMigrations;\n }", "protected function externalSort() {\n\t\t$this->chunk();\n\n\t\t// To be confirmed/implemented\n\t\t// After file split put them back together in the right order\n\t\techo \"External sort TBC\\n\";\n\t}", "protected function getNewMigrations()\n {\n if (!$this->includeModuleMigrations) {\n return parent::getNewMigrations();\n }\n\n $this->migrationPathMap = [];\n $migrations = [];\n foreach ($this->getMigrationPaths() as $migrationPath) {\n $this->migrationPath = $migrationPath;\n $migrations = array_merge($migrations, parent::getNewMigrations());\n $this->migrationPathMap[$migrationPath] = $migrations;\n }\n\n sort($migrations);\n\n\t\treturn $migrations;\n }", "function extSortUpcoming($aItem,$bItem){\n $aBegin = $aItem['mday'] ? $aItem['mday'] : $aItem['begin'];\n $bBegin = $bItem['mday'] ? $bItem['mday'] : $bItem['begin'];\n\n if($aBegin>$bBegin){\n return 1;\n }elseif($aBegin<$bBegin){\n return -1;\n }\n\n if($aItem['uid']<$bItem['uid']){\n return -1;\n }elseif($aItem['uid']>$bItem['uid'])\n return 1;\n return 0;\n }", "public function testMigrationsOptionsMigrate()\n {\n $this->exec('completion options migrations.migrations migrate');\n $this->assertCount(1, $this->_out->messages());\n $output = $this->_out->messages()[0];\n $expected = '--connection -c --date -d --dry-run -x --fake --help -h --no-lock --plugin -p';\n $expected .= ' --quiet -q --source -s --target -t --verbose -v';\n $outputExplode = explode(' ', trim($output));\n sort($outputExplode);\n $expectedExplode = explode(' ', $expected);\n sort($expectedExplode);\n\n $this->assertEquals($outputExplode, $expectedExplode);\n }", "public function run()\n {\n \n\n \\DB::table('migrations')->delete();\n \n \\DB::table('migrations')->insert(array (\n 0 => \n array (\n 'id' => 1,\n 'migration' => '2014_10_12_000000_create_users_table',\n 'batch' => 1,\n ),\n 1 => \n array (\n 'id' => 2,\n 'migration' => '2014_10_12_100000_create_password_resets_table',\n 'batch' => 1,\n ),\n 2 => \n array (\n 'id' => 3,\n 'migration' => '2019_01_29_011038_create_categories_table',\n 'batch' => 1,\n ),\n 3 => \n array (\n 'id' => 4,\n 'migration' => '2019_01_29_011130_create_items_table',\n 'batch' => 1,\n ),\n 4 => \n array (\n 'id' => 5,\n 'migration' => '2019_01_29_011207_create_requests_table',\n 'batch' => 1,\n ),\n 5 => \n array (\n 'id' => 6,\n 'migration' => '2019_01_29_011313_create_statuses_table',\n 'batch' => 1,\n ),\n 6 => \n array (\n 'id' => 7,\n 'migration' => '2019_01_29_011320_create_roles_table',\n 'batch' => 1,\n ),\n 7 => \n array (\n 'id' => 8,\n 'migration' => '2019_01_29_011330_create_userstatuses_table',\n 'batch' => 1,\n ),\n 8 => \n array (\n 'id' => 9,\n 'migration' => '2019_01_29_023302_add_roleid_userstatusid_users',\n 'batch' => 1,\n ),\n 9 => \n array (\n 'id' => 10,\n 'migration' => '2019_01_29_023330_add_categoryid_items',\n 'batch' => 1,\n ),\n 10 => \n array (\n 'id' => 11,\n 'migration' => '2019_01_29_023409_add_userid_statusid_itemid_requests',\n 'batch' => 1,\n ),\n 11 => \n array (\n 'id' => 12,\n 'migration' => '2019_01_29_042432_drop_contactnumber_users',\n 'batch' => 2,\n ),\n 12 => \n array (\n 'id' => 13,\n 'migration' => '2019_01_30_064421_add_statusid_items',\n 'batch' => 3,\n ),\n 13 => \n array (\n 'id' => 14,\n 'migration' => '2019_01_31_013147_rename_requests_to_laptoprequests',\n 'batch' => 4,\n ),\n 14 => \n array (\n 'id' => 15,\n 'migration' => '2019_01_31_014418_rename_laptoprequests',\n 'batch' => 5,\n ),\n ));\n \n \n }", "function bubblSort_String()\n {\n echo \"Total elements of array.\\n\";\n $sizeOfarray = AlgorithmsUtility::get_Integer();\n $arr = array();\n echo \"elements of array: \\n\";\n for ($i = 0; $i < $sizeOfarray; $i++) {\n $arr[$i] = AlgorithmsUtility::get_String();\n }\n\n\n for ($i = 0; $i < $sizeOfarray; $i++) {\n for ($j = 0; $j < $sizeOfarray - 1 - $i; $j++) {\n // swapping logic\n if (strcmp($arr[$j], $arr[$j + 1]) > 0) {\n $t = $arr[$j];\n $arr[$j] = $arr[$j + 1];\n $arr[$j + 1] = $t;\n }\n }\n }\n for ($i = 1; $i < $sizeOfarray; $i++) {\n echo $arr[$i] . \" \";\n }\n echo \"\\n\";\n }", "function getSort(){\n return 301;\n }", "protected function _sortByArray($array) {}", "public function &getOrderBy();", "function awesomeSort($a, $b)\n{\n return $a['amount'] <=> $b['amount'];\n}", "public function collectMigrations(): array;", "public static function getDefaultSorting()\n {\n\n }", "function sortedFilesIndexed($mig_dir) {\n // Prepare a sorted list of up and down migrations scripts.\n $mig_files = glob($mig_dir.'*.{sql}', GLOB_BRACE);\n $mig_indexed = array();\n foreach ($mig_files as $idx=>$filename) {\n $timestamp = $this->getTS($filename);\n if ($timestamp) {\n $mig_indexed[$timestamp] = $filename;\n }\n }\n\t\tasort($mig_indexed, SORT_NUMERIC);\n return $mig_indexed;\n }", "protected function sortDataArray() {}", "public function down($targetMigration)\n {\n $migrationsModel = new Ot_Model_DbTable_Migrations($this->_tablePrefix);\n \n end($this->_appliedMigrations);\n $highestExecutedMigration = current($this->_appliedMigrations);\n reset($this->_appliedMigrations);\n\n if (!isset($this->_availableMigrations[$targetMigration])) {\n throw new Exception('The requested migration ' . $targetMigration . ' was not found.');\n }\n \n if ((int)$highestExecutedMigration <= (int)$targetMigration) {\n throw new Exception('The database is only migrated to migration ' . $highestExecutedMigration . ', which is before the requested migration ' . $targetMigration);\n }\n \n $migrationsToApply = array();\n \n foreach ($this->_appliedMigrations as $a) {\n if ((int)$a > (int)$targetMigration && isset($this->_availableMigrations[$a])) {\n $migrationsToApply[] = $this->_availableMigrations[$a];\n }\n }\n \n $migrationsToApply = array_reverse($migrationsToApply);\n \n if (empty($migrationsToApply)) {\n $this->_messages[] = 'No migrations to apply';\n }\n \n $this->_db->beginTransaction();\n \n foreach ($migrationsToApply as $m) {\n require_once $this->_migrationsPath . '/' . $m;\n $classname = 'Db_' . substr($m, 0, -4); //strip out the .php extension\n $migrationClass = new $classname(array('tablePrefix' => $this->_tablePrefix));\n\n try {\n $migrationClass->down($this->_db, $this->_tablePrefix);\n } catch (Exception $e) {\n $this->_db->rollback();\n throw new Exception('Error applying migration ' . $m . '. ' . $e->getMessage());\n }\n \n try {\n $migrationsModel->removeMigration($this->_getMigrationIdFromFilename($m));\n } catch (Exception $e) {\n $this->_db->rollback();\n throw new Exception('Migration ' . $m . ' was successful, but adding record to migrations table failed. ' . $e->getMessage());\n }\n \n $this->_messages[] = 'Down migration of ' . $m . ' was successful.';\n }\n \n $this->_db->commit();\n }", "public function getVersionOrder();", "function getSort(){\n\treturn 281;\n}", "function payments_table_gateway_column_sortable( $columns ){\r\n //$columns['status'] = array('status', false);\r\n return $columns;\r\n}", "private function compareData() {\n if ($this->remove_table) {\n\n foreach ($this->two_db_tables as $two_table_name => $val2) {\n\n if (!array_key_exists($two_table_name, $this->one_db_tables)) {\n\n array_push($this->delete_tables, $two_table_name);\n }\n }\n }\n\n /*\n * Birini db de olup 2. db de olmayan tablolar\n */\n\n foreach ($this->one_db_tables as $table_name => $val) {\n\n if (array_key_exists($table_name, $this->two_db_tables)) {\n\n if (!array_key_exists($table_name, $this->delete_tables)) {\n\n $this->compareColumns($table_name, $this->one_db_table_columns[$table_name], $this->two_db_table_columns[$table_name]);\n \n \n \n }\n } else {\n\n array_push($this->create_tables, $table_name);\n }\n }\n\n\n\n return $this;\n }", "protected function sortAvailablePackagesByDependencies() {}", "public function sortBy(){\n global $SnickerPlugin;\n\n if($SnickerPlugin->getValue(\"frontend_order\") === \"date_asc\"){\n uasort($this->db, function($a, $b){\n return $a[\"date\"] > $b[\"date\"];\n });\n } else if($SnickerPlugin->getValue(\"frontend_order\") === \"date_desc\"){\n uasort($this->db, function($a, $b){\n return $a[\"date\"] < $b[\"date\"];\n });\n }\n return true;\n }", "protected function get_sort_order() {\n return 111;\n }", "protected function _getSortType() {}", "protected function _getSortType() {}", "public function asort()\n {\n }", "function mmrpg_action_sort_switch($info1, $info2){\n if ($info1['robot_position'] == 'active'){ return -1; }\n elseif ($info2['robot_position'] == 'active'){ return 1; }\n elseif ($info1['robot_key'] < $info2['robot_key']){ return -1; }\n elseif ($info1['robot_key'] > $info2['robot_key']){ return 1; }\n else { return 0; }\n }", "public function sort()\n {\n $column_id = $this->request->getIntegerParam('column_id');\n $project = $this->getProject();\n $search = $this->helper->projectHeader->getSearchQuery($project);\n\n $this->taskVoteModel->sortByVoting($column_id);\n\n $this->response->redirect($this->helper->url->to('BoardViewController', 'show', array('project_id' => $project['id'], 'search' => $search)), true);\n }", "public function testMigrationsOptionsStatus()\n {\n $this->exec('completion options migrations.migrations status');\n $this->assertCount(1, $this->_out->messages());\n $output = $this->_out->messages()[0];\n $expected = '--connection -c --format -f --help -h --plugin -p --quiet -q --source -s --verbose -v';\n $outputExplode = explode(' ', trim($output));\n sort($outputExplode);\n $expectedExplode = explode(' ', $expected);\n sort($expectedExplode);\n\n $this->assertEquals($outputExplode, $expectedExplode);\n }", "function cmpByOrderIndexAsc($a, $b)\n{\n if ($a['order_index'] == $b['order_index']) {\n return 0;\n }\n return($a['order_index'] < $b['order_index']) ? -1 : 1;\n}", "public function get_applied_migrations(): array\n {\n $stmt = $this->pdo->prepare(\"SELECT migration FROM migrations\");\n $stmt->execute();\n\n return $stmt->fetchAll(PDO::FETCH_COLUMN, 0);\n }", "public function applied()\n {\n $migrationFiles = array();\n $sql = new Sql($this->adapter);\n $select = $sql->select();\n $select->from(self::TABLE);\n \n $selectString = $sql->getSqlStringForSqlObject($select);\n $results = $this->adapter->query($selectString, Adapter::QUERY_MODE_EXECUTE);\n \n if ($results->count() > 0) {\n foreach ($results as $migration) {\n $migrationFiles[] = $migration->migration;\n }\n }\n \n return $migrationFiles;\n }", "protected function _getBrowseDefaultSort()\n {\n return array('added', 'd');\n }", "private function doMigration($migrations, $direction)\n\t{\n\t\t$methods = array(\n\t\t\tAdapterInterface::UP => array('up', 'addMigration'),\n\t\t\tAdapterInterface::DOWN => array('down', 'removeMigration'),\n\t\t);\n\t\t\n\t\t$results = array();\n\t\tforeach($migrations as $ref => $migration) {\n\t\t\tlist($migration_method, $adapter_method) = $methods[$direction];\n\t\t\t\n\t\t\t// assign helpers to instance\n\t\t\t$impl = $migration->getImplementation();\n\t\t\tforeach( get_class_methods($impl) as $method ) {\n\t\t\t\t// get only setters\n\t\t\t\tif ('set' !== substr($method, 0, 3)) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// a quick and dirty way to find the helper method\n\t\t\t\t// need to take care CamelCase methods\n\t\t\t\t$helper_name = strtolower(substr($method, 3));\n\t\t\t\t$helper = $this->getHelper($helper_name);\n\t\t\t\tif (!is_bool($helper)) {\n\t\t\t\t\tcall_user_func(array($impl, $method), $helper);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// call up or down method\n\t\t\t$results[] = call_user_func(array($migration, $migration_method));\n\t\t\tcall_user_func(array($this->getAdapter(), $adapter_method), $impl, $ref);\n\t\t}\n\t\t\n\t\treturn $results;\n\t}", "public function testSorting()\r\n\t{\r\n\t\t$this->assertAttributeCount( 0, 'priority_table', $this->list );\r\n\t\t$this->assertAttributeEquals( true, 'priority_resort', $this->list );\r\n\r\n\t\t// add dummy data\r\n\t\t$this->dummyData( true );\r\n\r\n\t\t// check count\r\n\t\t$this->assertEquals( 5, $this->list->count() );\r\n\r\n\t\t// check number items in priority table\r\n\t\t$this->assertAttributeCount( 5, 'priority_table', $this->list );\r\n\t\t$this->assertAttributeEquals( true, 'priority_resort', $this->list );\r\n\r\n\t\t// force a sort\r\n\t\t$this->assertNull( $this->list->rewind() );\r\n\r\n\t\t// check priority sorting toggle, should be off\r\n\t\t$this->assertAttributeEquals( false, 'priority_resort', $this->list );\r\n\t}" ]
[ "0.61306554", "0.5970115", "0.5741293", "0.5612099", "0.5611924", "0.54668725", "0.5440495", "0.5427333", "0.53959805", "0.5364229", "0.53486395", "0.5300365", "0.5291238", "0.5271432", "0.525964", "0.5181459", "0.5163683", "0.5158265", "0.5152694", "0.51272976", "0.51205736", "0.5116024", "0.50736016", "0.50612247", "0.50537723", "0.5049598", "0.5023374", "0.5013744", "0.50022286", "0.499642", "0.4982528", "0.4970651", "0.49532834", "0.49512503", "0.4941387", "0.49309775", "0.49184567", "0.49184567", "0.4917676", "0.49079645", "0.48996374", "0.48868835", "0.48867407", "0.48841244", "0.48784217", "0.48718306", "0.48685807", "0.4855887", "0.48462462", "0.4839583", "0.4838398", "0.4832334", "0.4832334", "0.4832334", "0.4825448", "0.48147947", "0.4811826", "0.48035595", "0.4794724", "0.47913867", "0.47890478", "0.4785839", "0.47856888", "0.47809115", "0.47706735", "0.4765347", "0.47578487", "0.47519228", "0.47504747", "0.47473902", "0.4745509", "0.47444975", "0.4734043", "0.4726996", "0.46996304", "0.4696519", "0.46916533", "0.46815687", "0.4674022", "0.46705317", "0.46656105", "0.46631816", "0.466264", "0.46585077", "0.46564046", "0.4656349", "0.46498927", "0.46456972", "0.4645516", "0.4645516", "0.46371323", "0.46369675", "0.46367273", "0.4636691", "0.46323735", "0.46237883", "0.46157324", "0.46064433", "0.4602954", "0.45919782" ]
0.6849838
0
Go through the filter iterator and stores the fetched migration steps in an associative array with the key holding the reference number for easy access.
private function getMigrationSteps() { $migration_steps = array(); foreach ($this->getFilter() as $step) { $migration_steps[$step->getReference()] = $step; } return $migration_steps; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getMigrations($steps)\n {\n global $wpdb;\n\n $sql = \"SELECT * FROM {$wpdb->prefix}exolnet_migration as em\n WHERE batch >= 1 ORDER BY batch DESC, migration DESC LIMIT {$steps}\";\n\n return $wpdb->get_results($sql, 'ARRAY_A');\n }", "abstract public function enumAppliedMigrationSteps();", "public function undo_get_steps() {\n global $db, $uid;\n $steps = $db->fetch_table(\"SELECT * FROM `\".$this->table.\"_undo` WHERE FK_USER=\".$uid.\" ORDER BY STAMP DESC\");\n for ($i = 0; $i < count($steps); $i++) {\n if ($steps[$i][\"ACTION\"] == \"MOVE\") {\n $node = $this->element_read($steps[$i][\"FK_KAT\"]);\n $node_parent = $this->element_read($steps[$i][\"FK_PARENT\"]);\n $node_parent_prev = $this->element_read($steps[$i][\"FK_PARENT_PREV\"]);\n $steps[$i][\"KAT_NAME\"] = $node[\"V1\"];\n $steps[$i][\"PARENT_NAME\"] = $node_parent[\"V1\"];\n $steps[$i][\"PARENT_PREV_NAME\"] = $node_parent_prev[\"V1\"];\n }\n if ($steps[$i][\"ACTION\"] == \"RESTORE\") {\n $backup_desc = $this->tree_backup_get_desc($steps[$i][\"FK_PARENT\"]);\n $steps[$i][\"BACKUP_STAMP\"] = $backup_desc[\"STAMP\"];\n $steps[$i][\"BACKUP_NAME\"] = $backup_desc[\"DESCRIPTION\"];\n }\n }\n return $steps;\n }", "public function getStepHistory();", "function prepareData(){\n $this->ref = array();\n foreach($this->getIterator() as $junk=>$item){\n // current values\n $id = $item[$this->id_field];\n \n // save item\n $this->items[$id] = $item;\n \n // save relation\n if(isset($item[$this->parent_id_field])) {\n $this->ref[$item[$this->parent_id_field]][] = $id;\n } else {\n $this->ref[undefined][] = $id;\n }\n }\n }", "public function getMigrations($steps)\n {\n $query = $this->table()\n ->where('plugin', $this->plugin)\n ->where('batch', '>=', '1');\n\n return $query->orderBy('migration', 'desc')->take($steps)->get()->all();\n }", "private function getMigrations()\n\t\t{\n\t\t\tif(self::$migrations)\n\t\t\t{\n\t\t\t\treturn self::$migrations;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tforeach(\\System\\DB\\DataAdapter::create(\"adapter=dir;source=\".__MIGRATIONS_PATH__.\";\")->openDataSet()->rows as $row)\n\t\t\t\t{\n\t\t\t\t\tif(\\strpos($row[\"name\"], '.php'))\n\t\t\t\t\t{\n\t\t\t\t\t\trequire $row[\"path\"];\n\t\t\t\t\t\t$migration = \\str_replace(\".php\", \"\", $row[\"name\"]);\n\t\t\t\t\t\teval(\"\\$migration = new \\\\System\\\\Migrate\\\\{$migration}();\");\n\n\t\t\t\t\t\tself::$migrations[] = new $migration();\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$CSort = new MigrationCompare();\n\t\t\t\tusort( self::$migrations, array( &$CSort, 'compareVersion' ));\n\t\t\t\treturn self::$migrations;\n\t\t\t}\n\t\t}", "function doBatchLookups() {\n\t\t$this->mResult->seek( 0 );\n\t\t$revIds = array();\n\t\t$batch = new LinkBatch();\n\t\t# Give some pointers to make (last) links\n\t\tforeach ( $this->mResult as $row ) {\n\t\t\tif ( isset( $row->rev_parent_id ) && $row->rev_parent_id ) {\n\t\t\t\t$revIds[] = $row->rev_parent_id;\n\t\t\t}\n\t\t\tif ( isset( $row->rev_id ) ) {\n\t\t\t\tif ( $this->contribs === 'newbie' ) { // multiple users\n\t\t\t\t\t$batch->add( NS_USER, $row->user_name );\n\t\t\t\t\t$batch->add( NS_USER_TALK, $row->user_name );\n\t\t\t\t}\n\t\t\t\t$batch->add( $row->page_namespace, $row->page_title );\n\t\t\t}\n\t\t}\n\t\t$this->mParentLens = Revision::getParentLengths( $this->mDbSecondary, $revIds );\n\t\t$batch->execute();\n\t\t$this->mResult->seek( 0 );\n\t}", "public function buildRefArray(){\n $query = $this->db->query(\" SELECT `TABLE_NAME`\n FROM `INFORMATION_SCHEMA`.`COLUMNS` \n WHERE `TABLE_SCHEMA`= DATABASE()\n \");\n $tablesTmp = $query->result();\n \n \n /**\n * Get each table's column and referance table name with referance column\n */\n $query = $this->db->query(\" SELECT\n INFORMATION_SCHEMA.COLUMNS.TABLE_NAME AS `table_name`,\n INFORMATION_SCHEMA.COLUMNS.COLUMN_NAME AS `column_name`\n FROM INFORMATION_SCHEMA.COLUMNS \n WHERE INFORMATION_SCHEMA.COLUMNS.TABLE_SCHEMA = DATABASE()\n \");\n \n $query2 = $this->db->query(\" SELECT \n INFORMATION_SCHEMA.KEY_COLUMN_USAGE.TABLE_NAME AS `table_name`,\n INFORMATION_SCHEMA.KEY_COLUMN_USAGE.COLUMN_NAME AS `column_name`,\n INFORMATION_SCHEMA.KEY_COLUMN_USAGE.REFERENCED_COLUMN_NAME AS `referenced_column_name`,\n INFORMATION_SCHEMA.KEY_COLUMN_USAGE.REFERENCED_TABLE_NAME AS `referenced_table_name`\n FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE\n WHERE INFORMATION_SCHEMA.KEY_COLUMN_USAGE.TABLE_SCHEMA = DATABASE()\n AND INFORMATION_SCHEMA.KEY_COLUMN_USAGE.REFERENCED_TABLE_SCHEMA = DATABASE()\n \");\n \n /**\n * Setting query array as $refArr['tableName'][columnName] = [refData]\n */\n \n // Step1: Arrange referance column usage array\n foreach($query2->result_array() as $key => $val){ \n $refArr[$val['table_name']] = [$val['column_name'] => ['ref_table_name' => $val['referenced_table_name'], 'ref_column_name' => $val['referenced_column_name']]];\n }\n \n // Step2: Arrange $refArr\n foreach($query->result_array() as $key => $val){\n \n $refArr[$val['table_name']] = !isset($refArr[$val['table_name']]) ? [] : $refArr[$val['table_name']];\n \n $refArr[$val['table_name']][$val['column_name']] = isset($refArr[$val['table_name']]) && isset($refArr[$val['table_name']][$val['column_name']])\n ? [\n \"refTable\" => $refArr[$val['table_name']][$val['column_name']]['ref_table_name'], \n \"refTableCol\" => $refArr[$val['table_name']][$val['column_name']]['ref_column_name']\n ]\n : false;\n }\n \n return $refArr;\n }", "function get_all_steps() {\r\n return $this->get_assoc();\r\n }", "function migration()\n {\n $this->ci->db->select('students_id');\n $this->ci->db->from('students');\n $result = $this->ci->db->get()->result();\n $fyear = new Financial_lib();\n $i=0;\n \n foreach ($result as $res)\n {\n if ( $this->cek($res->students_id,$fyear->get()) == TRUE )\n { $this->migration_process($res->students_id,$fyear->get()); $i++;}\n }\n return $i;\n }", "public function getPreparationSteps(): array\n {\n return [\n new CallbackStep(function (string $rawValue): array {\n return UnpackCSV::un((string) $rawValue, $this->separator);\n }, 'unpacks value')\n ];\n }", "public function needToMigrateList(): array;", "public function getIterator()\n {\n return new \\ArrayIterator($this->steps);\n }", "public function getHistory()\n\t{\n\t\t$log = $this->getLog();\n\t\t$history = array($this->initial);\n\t\t/* if our log is empty (or incorrect), then we cannot walk it at all */\n\t\tif (!isset($log[$this->initial]))\n\t\t\treturn $history;\n\t\t$next = $log[$this->initial]->next_action_id;\n\t\t/* log always has the latest entry,\n\t\t\t so build it walking to the next item,\n\t\t\t starting from the initial step */\n\t\twhile (!is_null($next)) {\n\t\t\t$history[] = $next;\n\t\t\tif (isset($log[$next])) {\n\t\t\t\t$next = $log[$next]->next_action_id;\n\t\t\t} else {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn $history;\n\t}", "public function applied()\n {\n $migrationFiles = array();\n $sql = new Sql($this->adapter);\n $select = $sql->select();\n $select->from(self::TABLE);\n \n $selectString = $sql->getSqlStringForSqlObject($select);\n $results = $this->adapter->query($selectString, Adapter::QUERY_MODE_EXECUTE);\n \n if ($results->count() > 0) {\n foreach ($results as $migration) {\n $migrationFiles[] = $migration->migration;\n }\n }\n \n return $migrationFiles;\n }", "public function getMigrations(){\n $migrations[] = new migrateTable0001($this->get('db'));\n $migrations[] = new migrateTable0002($this->get('db'));\n $migrations[] = new migrateTableEvent($this->get('db'));\n $migrations[] = new migrateTableMessages($this->get('db'));\n $migrations[] = new migrateTablePerson($this->get('db'));\n $migrations[] = new migrateTable122320151845($this->get('db'));\n\n return $migrations;\n }", "public abstract function getSteps();", "private function bindReferencesGeneratedEvent()\n {\n Event::listen('pages.menu.referencesGenerated', function (&$items) {\n $counter = 0; //closure counter\n $iterator = function ($menuItems) use (&$iterator, &$counter) {\n $result = [];\n foreach ($menuItems as $item) {\n\n /**\n * pages.menuitem.resolveItem is only fired if $item->type != 'url'\n * Mimic logic here.\n */\n if ($item->type != 'url') {\n if ($this->shouldHideIndexes[$counter] ?? false) {\n $item->viewBag['isHidden'] = true;\n }\n $counter++;\n }\n\n if ($item->items) {\n $iterator($item->items);\n }\n $result[] = $item;\n }\n return $result;\n };\n $items = $iterator($items, $counter);\n });\n }", "public function collectMigrations(): array;", "private function processFilterReference($filterReference)\n {\n foreach ($filterReference as $key => $value) {\n $this->cleanFilter($value['ref']);\n if (!isset($this->requestData['filters'][$value['ref']])) {\n unset($filterReference[$key]);\n }\n }\n return $filterReference;\n }", "public function get_applied_migrations(): array\n {\n $stmt = $this->pdo->prepare(\"SELECT migration FROM migrations\");\n $stmt->execute();\n\n return $stmt->fetchAll(PDO::FETCH_COLUMN, 0);\n }", "public function run()\n {\n \n\n \\DB::table('migrations')->delete();\n \n \\DB::table('migrations')->insert(array (\n 0 => \n array (\n 'id' => 1,\n 'migration' => '2014_10_12_000000_create_users_table',\n 'batch' => 1,\n ),\n 1 => \n array (\n 'id' => 2,\n 'migration' => '2014_10_12_100000_create_password_resets_table',\n 'batch' => 1,\n ),\n 2 => \n array (\n 'id' => 3,\n 'migration' => '2019_01_29_011038_create_categories_table',\n 'batch' => 1,\n ),\n 3 => \n array (\n 'id' => 4,\n 'migration' => '2019_01_29_011130_create_items_table',\n 'batch' => 1,\n ),\n 4 => \n array (\n 'id' => 5,\n 'migration' => '2019_01_29_011207_create_requests_table',\n 'batch' => 1,\n ),\n 5 => \n array (\n 'id' => 6,\n 'migration' => '2019_01_29_011313_create_statuses_table',\n 'batch' => 1,\n ),\n 6 => \n array (\n 'id' => 7,\n 'migration' => '2019_01_29_011320_create_roles_table',\n 'batch' => 1,\n ),\n 7 => \n array (\n 'id' => 8,\n 'migration' => '2019_01_29_011330_create_userstatuses_table',\n 'batch' => 1,\n ),\n 8 => \n array (\n 'id' => 9,\n 'migration' => '2019_01_29_023302_add_roleid_userstatusid_users',\n 'batch' => 1,\n ),\n 9 => \n array (\n 'id' => 10,\n 'migration' => '2019_01_29_023330_add_categoryid_items',\n 'batch' => 1,\n ),\n 10 => \n array (\n 'id' => 11,\n 'migration' => '2019_01_29_023409_add_userid_statusid_itemid_requests',\n 'batch' => 1,\n ),\n 11 => \n array (\n 'id' => 12,\n 'migration' => '2019_01_29_042432_drop_contactnumber_users',\n 'batch' => 2,\n ),\n 12 => \n array (\n 'id' => 13,\n 'migration' => '2019_01_30_064421_add_statusid_items',\n 'batch' => 3,\n ),\n 13 => \n array (\n 'id' => 14,\n 'migration' => '2019_01_31_013147_rename_requests_to_laptoprequests',\n 'batch' => 4,\n ),\n 14 => \n array (\n 'id' => 15,\n 'migration' => '2019_01_31_014418_rename_laptoprequests',\n 'batch' => 5,\n ),\n ));\n \n \n }", "public function setReferenceDependencies(array &$definitions) {\n if (empty($this->collectedReferences)) {\n return;\n }\n\n $collectedSubDependencies = [];\n\n foreach ($definitions as $definitionId => $definition) {\n if (!isset($this->collectedReferences[$definitionId])) {\n continue;\n }\n\n $references = $this->collectedReferences[$definitionId];\n\n foreach ($references as $element => $target) {\n $subDependencies = [];\n\n foreach ($target as $reference) {\n $subDefinition = $this->buildMigrationDefinition(\n [\n 'projectId' => $reference['base_data']['projectId'],\n 'templateId' => $reference['base_data']['templateId'],\n 'entityType' => $reference['base_data']['entityType'],\n 'contentType' => $reference['base_data']['contentType'],\n ],\n $reference['data'],\n 'entity_reference_revisions'\n );\n\n $subDependencies[$subDefinition['id']] = $subDefinition;\n\n $key = implode('_', [\n $reference['base_data']['projectId'],\n $reference['base_data']['templateId'],\n $reference['base_data']['entityType'],\n $reference['base_data']['contentType'],\n ]);\n $collectedSubDependencies[$key][$subDefinition['id']] = $subDefinition;\n }\n $this->setReferenceDependencies($subDependencies);\n\n $collected = [];\n\n foreach ($subDependencies as $subDefinitionId => $subDefinition) {\n $this->migrationDefinitionIds[] = $subDefinitionId;\n\n $definitions[$definitionId]['migration_dependencies']['optional'][] = $subDefinitionId;\n $definitions[$definitionId]['process']['collect_' . $subDefinitionId] = [\n 'plugin' => 'migration_lookup',\n 'migration' => $subDefinitionId,\n 'source' => 'id',\n ];\n\n $collected[] = '@collect_' . $subDefinitionId;\n }\n\n if (!empty($collected)) {\n $definitions[$definitionId]['process']['get_collected_' . $element] = [\n 'plugin' => 'get',\n 'source' => $collected,\n ];\n\n $definitions[$definitionId]['process'][$element] = [\n [\n 'plugin' => 'gather_content_reference_revision',\n 'source' => '@get_collected_' . $element,\n ],\n [\n 'plugin' => 'sub_process',\n 'process' => [\n 'target_id' => [\n 'plugin' => 'extract',\n 'source' => 'id',\n 'index' => [0],\n ],\n 'target_revision_id' => [\n 'plugin' => 'extract',\n 'source' => 'id',\n 'index' => [1],\n ],\n ],\n ],\n ];\n }\n }\n }\n\n foreach ($collectedSubDependencies as $dependencies) {\n $this->setLanguageDefinitions($dependencies);\n\n foreach ($dependencies as $subDefinitionId => $subDefinition) {\n $migration = Migration::create($subDefinition);\n $migration->save();\n }\n }\n }", "public function column_next_steps( $item ) {}", "function _calculate_used_indexes($steps) {\n $indexes = array();\n\n // For current slices set 1 for all\n foreach ($this->slices as $slice)\n $this->_inc($indexes, $slice['index']);\n\n // change $indexes like they could be changed if each step in $steps were applied\n foreach ($steps as $step) {\n switch ($step['action']) {\n case 'delete_slice':\n $this->_dec($indexes, $this->slices[$step['id']]['index']);\n break;\n case 'create_slice':\n $this->_inc($indexes, $step['source']['index']);\n break;\n case 'update_slice_attrs':\n $this->_dec($indexes, $this->slices[$step['id']]['index']);\n $this->_inc($indexes, $step['source']['index']);\n break;\n case 'update_slice_geometry':\n break;\n default:\n throw new Exception(\"Unknown step action: \" . $step['action']);\n }\n }\n\n unset($indexes['-1']);\n return $indexes;\n }", "protected function populateInstanceActionIds()\n {\n populateActiveIds($this->instanceActiveIdHash, $this->instanceIdsIdentifier);\n\n // Same, for per-edah filter.\n if ($this->activeEdotFilterTable) {\n $multiColName = $this->activeEdotFilterTable;\n populateActiveIds($this->activeEdotHash, $multiColName);\n }\n }", "public function history()\n\t{\n\t\t$migration = new \\Hubzero\\Content\\Migration();\n\t\t$history = $migration->history();\n\t\t$items = [];\n\t\t$maxFile = 0;\n\t\t$maxUser = 0;\n\t\t$maxScope = 0;\n\n\n\t\tif ($history && count($history) > 0)\n\t\t{\n\t\t\t$items[] = [\n\t\t\t\t'File',\n\t\t\t\t'By',\n\t\t\t\t'Direction',\n\t\t\t\t'Date'\n\t\t\t];\n\n\t\t\tforeach ($history as $entry)\n\t\t\t{\n\t\t\t\t$items[] = [\n\t\t\t\t\t$entry->scope . DS . $entry->file,\n\t\t\t\t\t$entry->action_by,\n\t\t\t\t\t$entry->direction,\n\t\t\t\t\t$entry->date\n\t\t\t\t];\n\t\t\t}\n\n\t\t\t$this->output->addTable($items, true);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->addLine('No history to display.');\n\t\t}\n\t}", "public function processMigration(Migration $migration): void;", "public function getMigrations(): array\n {\n $result = [];\n foreach ($this->repository->getMigrations() as $migration) {\n //Populating migration state and execution time (if any)\n $result[] = $migration->withState($this->resolveState($migration));\n }\n\n return $result;\n }", "function get_campaign_steps() {\r\n $this->db->where('__CampaignId', $this->current_rID); \r\n $this->db->join(\r\n '__template', \r\n '__template.__Id = ' . $this->table_name. '.' . $this->templateId_fieldname, \r\n 'left outer'\r\n ); \r\n $results = $this->get();\r\n \r\n //print_array($results,1);\r\n \r\n //now set up the dropdown array\r\n $retval = array();\r\n foreach ($results as $key => $array)\r\n {\r\n $array['action_dropdown'] = '[' . $array['__ActionType'] . ' ' . $array['__TemplateId'] . '] - ' . $array['__Name'] ;\r\n $retval[$key + 1] = $array;\r\n }\r\n \r\n //if there's no results set up a blank step ready to be duplicated\r\n if ( !$retval)\r\n {\r\n $retval = Array();\r\n $retval[1] = Array\r\n (\r\n '__Id' => '',\r\n '__CampaignId' => $this->current_rID,\r\n '__StepName' => '',\r\n '__ActionType' => '',\r\n '__TemplateId' => 0,\r\n '__TagId' => 0,\r\n '__StepNo' => 1,\r\n '__Delay' => 0,\r\n '__Name' => '',\r\n 'action_dropdown' => ''\r\n );\r\n }\r\n \r\n return $retval;\r\n }", "public function getRan()\n {\n global $wpdb;\n\n $sql = \"SELECT migration as name FROM {$wpdb->prefix}exolnet_migration as em\";\n\n $migrations = $wpdb->get_results($sql, 'ARRAY_A');\n\n $migrationCleaned = [];\n if (!empty($migrations) && is_array($migrations)) {\n foreach ($migrations as $migration) {\n $migrationCleaned[] = $migration['name'];\n }\n }\n\n return $migrationCleaned;\n }", "protected function getMigrationsRan()\n {\n // TODO: Move query to a query factory based on db_adapter\n $resource = $this->db_adapter->query(\n \"SELECT file FROM $this->migration_table\"\n );\n\n // TODO: Needs to be abstracted from this class\n $results = pg_fetch_all($resource) ?: [];\n\n // Flatten the array structure to a single dimension\n $migrations_ran = array_map(function ($result) {\n return $result['file'];\n }, $results);\n\n return $migrations_ran;\n }", "public function run()\n {\n \n\n \\DB::table('migrations')->delete();\n \n \\DB::table('migrations')->insert(array (\n 0 => \n array (\n 'id' => 1,\n 'migration' => '2019_03_13_181656_create_categories_table',\n 'batch' => 1,\n ),\n 1 => \n array (\n 'id' => 2,\n 'migration' => '2019_03_13_181656_create_failed_jobs_table',\n 'batch' => 1,\n ),\n 2 => \n array (\n 'id' => 3,\n 'migration' => '2019_03_13_181656_create_links_table',\n 'batch' => 1,\n ),\n 3 => \n array (\n 'id' => 4,\n 'migration' => '2019_03_13_181656_create_model_has_permissions_table',\n 'batch' => 1,\n ),\n 4 => \n array (\n 'id' => 5,\n 'migration' => '2019_03_13_181656_create_model_has_roles_table',\n 'batch' => 1,\n ),\n 5 => \n array (\n 'id' => 6,\n 'migration' => '2019_03_13_181656_create_notifications_table',\n 'batch' => 1,\n ),\n 6 => \n array (\n 'id' => 7,\n 'migration' => '2019_03_13_181656_create_password_resets_table',\n 'batch' => 1,\n ),\n 7 => \n array (\n 'id' => 8,\n 'migration' => '2019_03_13_181656_create_permissions_table',\n 'batch' => 1,\n ),\n 8 => \n array (\n 'id' => 9,\n 'migration' => '2019_03_13_181656_create_replies_table',\n 'batch' => 1,\n ),\n 9 => \n array (\n 'id' => 10,\n 'migration' => '2019_03_13_181656_create_role_has_permissions_table',\n 'batch' => 1,\n ),\n 10 => \n array (\n 'id' => 11,\n 'migration' => '2019_03_13_181656_create_roles_table',\n 'batch' => 1,\n ),\n 11 => \n array (\n 'id' => 12,\n 'migration' => '2019_03_13_181656_create_topics_table',\n 'batch' => 1,\n ),\n 12 => \n array (\n 'id' => 13,\n 'migration' => '2019_03_13_181656_create_users_table',\n 'batch' => 1,\n ),\n 13 => \n array (\n 'id' => 14,\n 'migration' => '2019_03_13_181657_add_foreign_keys_to_model_has_permissions_table',\n 'batch' => 1,\n ),\n 14 => \n array (\n 'id' => 15,\n 'migration' => '2019_03_13_181657_add_foreign_keys_to_model_has_roles_table',\n 'batch' => 1,\n ),\n 15 => \n array (\n 'id' => 16,\n 'migration' => '2019_03_13_181657_add_foreign_keys_to_replies_table',\n 'batch' => 1,\n ),\n 16 => \n array (\n 'id' => 17,\n 'migration' => '2019_03_13_181657_add_foreign_keys_to_role_has_permissions_table',\n 'batch' => 1,\n ),\n 17 => \n array (\n 'id' => 18,\n 'migration' => '2019_03_13_181657_add_foreign_keys_to_topics_table',\n 'batch' => 1,\n ),\n ));\n \n \n }", "function getUpdateSteps($a_break = 0)\n\t{\n\t\tglobal $ilCtrlStructureReader, $ilMySQLAbstraction;\n\t\t\n\t\t$str = \"\";\n\t\t\n\t\t$f = $this->fileVersion;\n\t\t$c = $this->currentVersion;\n\t\t\n\t\tif ($a_break > $this->currentVersion &&\n\t\t\t$a_break < $this->fileVersion)\n\t\t{\n\t\t\t$f = $a_break;\n\t\t}\n\n\t\tif ($c < $f)\n\t\t{\n\t\t\t$msg = array();\n\t\t\tfor ($i=($c+1); $i<=$f; $i++)\n\t\t\t{\n\t\t\t\t// check wether next update file must be loaded\n\t\t\t\tif ($this->current_file != $this->getFileForStep($i))\n\t\t\t\t{\n\t\t\t\t\t$this->DB_UPDATE_FILE = $this->PATH.\"setup/sql/\".$this->getFileForStep($i);\n\t\t\t\t\t$this->readDBUpdateFile();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$str.= $this->getUpdateStepNr($i);\n\t\t\t}\n\n\t\t}\n\t\treturn $str;\n\t}", "protected function getMigsByID() {\n\t\t$migs_applied = array();\n $cmd = 'SELECT * FROM migrations ORDER BY mig_ID ASC';\n $result = $this->mysqli->query($cmd);\n if ($result) {\n\t\t\t//var_dump($result);die();\n\t\t\twhile ($row = $result->fetch_assoc()) {\n\t\t\t\t$migs_applied[$row['mig_ID']] = $row;//['mig_UP_SCRIPT'];\n\t\t\t}\n\t\t}\n\t\treturn $migs_applied;\n\t}", "public function getUpCandidates()\n {\n $statuses = $this->getStatuses();\n\n // search latest applied migration\n $latest = '';\n foreach ($statuses as $status) {\n if ($status->appliedAt !== \"\") {\n $latest = $status->file->getFileName();\n }\n }\n\n // make statuses without being applied\n $candidates = [];\n $isSkipped = ($latest === '')? false: true;\n foreach ($statuses as $status) {\n if (false === $isSkipped) {\n $candidates[] = $status;\n }\n if($status->file->getFileName() !== $latest) {\n continue;\n } else {\n $isSkipped = false;\n }\n }\n\n return $candidates;\n }", "protected function parseSteps()\r\n {\r\n $this->_steps = $this->_parseSteps($this->steps);\r\n $this->_stepLabels = array_flip($this->_steps);\r\n $this->_steps = $this->_steps;\r\n }", "private function _populateMigrationTable()\n\t{\n\t\t$migrations = array();\n\n\t\t// Add the base one.\n\t\t$migration = new MigrationRecord();\n\t\t$migration->version = craft()->migrations->getBaseMigration();\n\t\t$migration->applyTime = DateTimeHelper::currentUTCDateTime();\n\t\t$migrations[] = $migration;\n\n\t\t$migrationsFolder = craft()->path->getAppPath().'migrations/';\n\t\t$migrationFiles = IOHelper::getFolderContents($migrationsFolder, false, \"(m(\\d{6}_\\d{6})_.*?)\\.php\");\n\n\t\tif ($migrationFiles)\n\t\t{\n\t\t\tforeach ($migrationFiles as $file)\n\t\t\t{\n\t\t\t\tif (IOHelper::fileExists($file))\n\t\t\t\t{\n\t\t\t\t\t$migration = new MigrationRecord();\n\t\t\t\t\t$migration->version = IOHelper::getFileName($file, false);\n\t\t\t\t\t$migration->applyTime = DateTimeHelper::currentUTCDateTime();\n\n\t\t\t\t\t$migrations[] = $migration;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tforeach ($migrations as $migration)\n\t\t\t{\n\t\t\t\tif (!$migration->save())\n\t\t\t\t{\n\t\t\t\t\tCraft::log('Could not populate the migration table.', LogLevel::Error);\n\t\t\t\t\tthrow new Exception(Craft::t('There was a problem saving to the migrations table: ').$this->_getFlattenedErrors($migration->getErrors()));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tCraft::log('Migration table populated successfully.');\n\t}", "public function step18($position, array $stepData)\n\t{\n\t\t$perPage = 1000;\n\t\t$db = $this->db();\n\n\t\tif (!isset($stepData['max']))\n\t\t{\n\t\t\t$stepData['max'] = $db->fetchOne(\"SELECT MAX(content_id) FROM xf_change_log WHERE content_type = 'user' AND field = 'username'\");\n\t\t}\n\n\t\t$userIds = $db->fetchAllColumn($db->limit(\"\n\t\t\tSELECT DISTINCT(content_id)\n\t\t\tFROM xf_change_log\n\t\t\tWHERE content_id > ? AND content_type = 'user' AND field = 'username' \n\t\t\tORDER BY content_id\n\t\t\", $perPage), $position);\n\n\t\tif (!$userIds)\n\t\t{\n\t\t\treturn true;\n\t\t}\n\n\t\t$em = $this->app->em();\n\t\t$db->beginTransaction();\n\n\t\t$next = 0;\n\t\tforeach ($userIds AS $userId)\n\t\t{\n\t\t\t$next = $userId;\n\n\t\t\t$changes = $db->fetchAll(\"\n\t\t\t\tSELECT \n\t\t\t\t\tcontent_id AS user_id,\n\t\t\t\t\told_value AS old_username,\n\t\t\t\t\tnew_value AS new_username,\n\t\t\t\t\t'approved' AS change_state,\n\t\t\t\t\tedit_user_id AS change_user_id,\n\t\t\t\t\tedit_date AS change_date,\n\t\t\t\t\t0 AS moderator_user_id,\n\t\t\t\t\t'' AS reject_reason,\n\t\t\t\t\t0 AS visible\n\t\t\t\tFROM xf_change_log\n\t\t\t\tWHERE content_id = ? AND content_type = 'user' AND field = 'username'\n\t\t\t\tORDER BY change_date\n\t\t\t\", $userId);\n\n\t\t\tif (!$changes)\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$inserts = [];\n\n\t\t\tforeach ($changes AS $change)\n\t\t\t{\n\t\t\t\t// we don't have any unique constraints but this ensures dupes aren't introduced\n\t\t\t\t// in the event that this upgrade step is somehow run multiple times\n\t\t\t\t$exists = $em->findOne('XF:UsernameChange', $change);\n\n\t\t\t\tif ($exists)\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$inserts[] = $change;\n\t\t\t}\n\n\t\t\tif ($inserts)\n\t\t\t{\n\t\t\t\t$db->insertBulk('xf_username_change', $inserts);\n\n\t\t\t\t$dates = array_column($inserts, 'change_date');\n\t\t\t\t$db->update('xf_user', ['username_date' => end($dates)], 'user_id = ?', $userId);\n\t\t\t}\n\t\t}\n\n\t\t$db->commit();\n\n\t\treturn [\n\t\t\t$next,\n\t\t\t\"$next / $stepData[max]\",\n\t\t\t$stepData\n\t\t];\n\t}", "private function findComponentsWhichNeedMigrated(): array\n {\n $aModules = Components::available(false);\n $aOut = [];\n\n foreach ($aModules as $oModule) {\n $oState = $this->determineModuleState($oModule);\n if ($oState->start !== $oState->end) {\n $aOut[] = $oState;\n }\n }\n\n // Shift the app migrations onto the end so they are executed last\n if (!empty($aOut)) {\n $oFirst = reset($aOut);\n if ($oFirst->slug === Components::$sAppSlug) {\n $oApp = array_shift($aOut);\n $aOut = array_merge($aOut, [$oApp]);\n $aOut = array_filter($aOut);\n $aOut = array_values($aOut);\n }\n }\n\n return $aOut;\n }", "public function getReferenceables() {\r\n\r\n $keyFields = array_keys($this->fields);\r\n\r\n $referenciables = array_intersect_key($keyFields, $this->indexReferences);\r\n\r\n $fields = array_flip($referenciables);\r\n\r\n\r\n return $fields;\r\n }", "private function prepareData(&$data, $step = 1) {\n /** @var Table $this */\n $prepareThis = function ($association, array $path, &$current, &$previous) use ($step) {\n\n if (!is_scalar($current)) {\n\n if ($step == 1) {\n foreach ($current as $k => $v) {\n\n if ($fieldName = $this->getFieldByAlias($k, $path)) {\n $current[$fieldName] = $v;\n unset($current[$k]);\n }\n elseif ($this->isEntityFieldDeprecated($k, $path)) {\n unset($current[$k]);\n }\n }\n\n if ($association == 'incorporated') {\n $key = array_pop($path);\n\n foreach ($previous as $k => &$v) {\n\n if ($k != $key && substr($k, 0, 1) != '_') {\n $current[$k] = &$v;\n }\n }\n }\n }\n\n if ($step == 2) {\n // add service fields\n $current['_parent'] = &$previous;\n $current['_manager'] = new Manager($this->currentActionName, $current);\n }\n }\n };\n // prepare self\n $null = null;\n $prepareThis($null, [], $data, $null);\n\n // prepare self associations\n foreach ($this->getSelfAssociations() as $association) {\n\n if (!empty($data[$alias = $association->getAlias()])) {\n\n foreach ($data[$alias] as &$sub) {\n $prepareThis($null, [], $sub, $data);\n }\n }\n }\n // prepare special associations\n $this->walkWithAssociated($data, $prepareThis, true, false);\n }", "public function getSteps(): array\n {\n return $this->steps;\n }", "public function getActiveMigrations() {\n\t\tif (!is_array($this->activeMigrations)) {\n\t\t\t$this->activeMigrations = array();\n\t\t\t/** @var Tx_Smoothmigration_Service_RequirementsAnalyzer $requirementsAnalyzer */\n\t\t\t$requirementsAnalyzer = t3lib_div::makeInstance('Tx_Smoothmigration_Service_RequirementsAnalyzer');\n\n\t\t\tforeach ($this->registeredMigrations as $className) {\n\t\t\t\t/** @var Tx_Smoothmigration_Domain_Interface_Migration $check */\n\t\t\t\t$migration = t3lib_div::makeInstance($className);\n\t\t\t\tif ($requirementsAnalyzer->isActive($migration)) {\n\t\t\t\t\t$this->activeMigrations[] = $migration;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $this->activeMigrations;\n\t}", "public static function bootHistoryTrait() {\n// parent::boot();\n\n foreach (static::getRecordActivityEvents() as $eventName) {\n static::$eventName(function ($model) use ($eventName) {\n try {\n $modelRevisionObj = self::getRevisionObject($model);\n \n $diff = static::getDiff($model);\n\n if (!$diff['before'] && !$diff['after']) {\n return true;\n }\n\n $relations = $model->getRelations();\n \n foreach ($diff['before'] as $key => $value) {\n\n if (static::isRelated($key)) {\n $relatedModel = static::getRelatedModel($model, $key);\n \n //check related model need to be logged\n if(!$relatedModel)\n continue;\n \n //load related model and get old value\n $relatedModelObj = new $relatedModel;\n $relModel = $relatedModelObj::find($value);\n\n $relations = static::getRelatedModelRelations($model, $key);\n\n $modelBefore = $relModel->load($relations);\n\n //get new value\n $relModel = $relatedModelObj::find($diff['after'][$key]);\n $modelAfter = $relModel->load($relations);\n\n $accessColumnValue = static::getRelatedModelColumn($model, $key);\n\n $row['old_value'] = array_get($modelBefore->toArray(), $accessColumnValue);\n $row['new_value'] = array_get($modelAfter->toArray(), $accessColumnValue);\n } else {\n $row['old_value'] = $value;\n $row['new_value'] = $diff['after'][$key];\n }\n\n $mutator = 'get' . studly_case($key) . 'Attribute';\n \n if (method_exists($model, $mutator)) {\n $key = $model->$mutator($key);\n }\n \n $row['column'] = $key;\n\n $foreign_key = $model->foreign_key;\n// \n// //set history relation col to appropriate value\n $row['revisionable_id'] = $model->$foreign_key;\n $row['user_id'] = \\Auth::user()->id;\n\n $modelRevisionObj::create($row);\n }\n } catch (\\Exception $e) {\n return $e->getMessage();\n }\n });\n \n return true;\n }\n }", "public static function getMigrationItems(\\SplFileInfo $migrationFolder, $lastMigration=0 ) {\n\n\t\t$filesToMigrate=[];\n\n\t\t$files = scandir($migrationFolder->getPathname().'\\\\');\n\t\tforeach( $files as $file ) {\n\n\t\t\tif (in_array($file, ['.', '..'])) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tDatabaseMigrationFacade::log(StringUtils::message(\"Found file [{}]\", $file ));\n\n\t\t\t$matches=[];\n\t\t\tif( preg_match('#^(\\d+)_#', $file, $matches)) {\n\t\t\t\tif( $matches[1] > $lastMigration ) {\n\t\t\t\t\t$filesToMigrate[$matches[1]]= new MigrationItem($migrationFolder, $file, $matches[1]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$lastMigration++;\n\n\t\tDatabaseMigrationFacade::log(StringUtils::message(\"Next file ID is [{}]\", $lastMigration ));\n\n\t\tksort($filesToMigrate);\n\n\t\treturn $filesToMigrate;\n\t}", "function listTransitions($workflowId, $page = null, $rownums = null);", "protected function getNewMigrations()\n {\n if (!$this->includeModuleMigrations) {\n return parent::getNewMigrations();\n }\n\n $this->migrationPathMap = [];\n $migrations = [];\n foreach ($this->getMigrationPaths() as $migrationPath) {\n $this->migrationPath = $migrationPath;\n $migrations = array_merge($migrations, parent::getNewMigrations());\n $this->migrationPathMap[$migrationPath] = $migrations;\n }\n\n sort($migrations);\n\n\t\treturn $migrations;\n }", "function moveAssignmentFilters() {\n try {\n $assignment_filters_table = TABLE_PREFIX . 'assignment_filters';\n $data_filters_table = TABLE_PREFIX . 'data_filters';\n $homescreen_tabs_table = TABLE_PREFIX . 'homescreen_tabs';\n\n DB::beginWork('Move assignment filters to the new storage @ ' . __CLASS__);\n\n $assignment_filters = DB::execute(\"SELECT * FROM $assignment_filters_table\");\n if($assignment_filters) {\n $assignment_filter_tabs_map = $this->getTabsThatUseAssignmentFilters();\n\n foreach($assignment_filters as $filter) {\n $old_assignment_filter_id = (integer) $filter['id'];\n\n DB::execute(\"INSERT INTO $data_filters_table (type, name, raw_additional_properties, created_on, created_by_id, created_by_name, created_by_email, is_private) VALUES ('AssignmentFilter', ?, ?, ?, ?, ?, ?, ?)\", $filter['name'], $filter['raw_additional_properties'], $filter['created_on'], $filter['created_by_id'], $filter['created_by_name'], $filter['created_by_email'], $filter['is_private']);\n\n $new_assignmnet_filter_id = DB::lastInsertId();\n\n if(isset($assignment_filter_tabs_map[$old_assignment_filter_id]) && count($assignment_filter_tabs_map[$old_assignment_filter_id])) {\n DB::execute(\"UPDATE $homescreen_tabs_table SET raw_additional_properties = ? WHERE id IN (?)\", serialize(array('assignment_filter_id' => $new_assignmnet_filter_id)), $assignment_filter_tabs_map[$old_assignment_filter_id]);\n } // if\n } // foreach\n } // if\n\n DB::commit('Assignment filters moved to the new storage @ ' . __CLASS__);\n } catch(Exception $e) {\n return $e->getMessage();\n } // try\n\n try {\n $table_list = DB::listTables(TABLE_PREFIX);\n\n if(in_array($assignment_filters_table, $table_list)) {\n DB::execute(\"DROP TABLE $assignment_filters_table\");\n } // if\n\n if(in_array(TABLE_PREFIX . 'milestone_filters', $table_list)) {\n DB::execute('DROP TABLE ' . TABLE_PREFIX . 'milestone_filters');\n } // if\n } catch(Exception $e) {\n return $e->getMessage();\n } // try\n\n return true;\n }", "function yield_fields(){\n //\n //Visit each column of the root entity, resolve it.\n foreach($this->entity->columns as $column){\n //\n //Resolve the current column\n //\n //Primary keys and attributes to not need resolving\n if($column instanceof \\column_primary){\n yield new primary($this->entity, $column->name); \n }\n \n else if ($column instanceof \\column_attribute){\n yield new column($column, $column->name);\n }\n //\n //A forein key needs resolving from e.g., client=4 to\n //client = [4,\"deekos-Deeoks Bakery lt\"]. We need to cocaat 5 pieces\n //of data, $ob, $primary, $comma, $dq, $friendly, $dq, $cb\n else{\n //Start with an empty array \n $args=[];\n //\n //Opening bracket\n $ob= new literal('[');\n array_push($args, $ob);\n //\n //Primary \n $primary = new column($column);\n array_push($args, $primary);\n //\n //Comma\n $comma= new literal(',');\n array_push($args, $comma);\n //\n //Double quote\n $dq= new literal('\"');\n array_push($args, $dq);\n //\n //Yied the fiedly comumn name\n $e2 = $this->entity->dbase->entities[$column->ref_table_name];\n //\n //Take care of the join \n $en= array_search($e2->name, $this->join_entites);\n if ($en == false){\n //\n array_push($this->join_entites, $e2->name);\n array_push($this->editor_joins, new join($e2, [$column]));\n }\n //\n //To obtain the indexed attributes get the identifier\n $db=$e2->get_parent();\n $identify = new identifier($e2->name,$db->name);\n //\n //The friendly are the fields of the identifier\n $friendly= $identify->fields;\n //\n //Retrieve any joins also\n $joins_edit= $identify->joins->get_array();\n foreach ($joins_edit as $join){\n $e= $join->entity->name;\n $en= array_search($e, $this->join_entites);\n if ($en === false){\n //\n array_push($this->join_entites, $e);\n array_push($this->editor_joins, $join);\n }\n }\n //\n //Return an array of the fields \n $fri_fields= $friendly->get_array();\n \n //Loop through the array and pushing every component \n foreach ($fri_fields as $field){\n array_push($args, $field);\n $d= new literal(\"/\");\n array_push($args, $d);\n }\n array_pop($args);\n //\n //Double quote\n array_push($args, $dq);\n //\n $cb= new literal(']');\n array_push($args, $cb);\n //\n yield new concat(new fields($args),$column->name);\n \n }\n }\n }", "public function getChangeset(): array\n\t{\n\t\t$changes = [];\n\n\t\tforeach ($this->getNonMetadataFields() as $key => $value) {\n\t\t\tif (! isset($this->initialFieldValues[$key]) || $value !== $this->initialFieldValues[$key]) {\n\t\t\t\t$changes[$key] = $value;\n\t\t\t}\n\t\t}\n\n\t\treturn $changes;\n\t}", "public function getMigrationsToRun() : array\n {\n $allMigrations = $this->getAllMigrations();\n\n $tableExists = $this->queryBuilderFactory->make()\n ->table_exists($this->table);\n\n if (! $tableExists) {\n return $allMigrations;\n }\n\n /** @var array $runMigrations */\n $runMigrations = $this->queryBuilderFactory->make()\n ->get($this->table)\n ->result();\n\n foreach ($runMigrations as $record) {\n unset($allMigrations[$record->migration]);\n }\n\n return $allMigrations;\n }", "public function run()\n {\n DinteractionHasReference::create( [\n \n 'dinteraction_id'=>21,\n 'reference_id'=>3\n ] );\n \n \n \n DinteractionHasReference::create( [\n \n 'dinteraction_id'=>22,\n 'reference_id'=>13\n ] );\n \n \n \n DinteractionHasReference::create( [\n \n 'dinteraction_id'=>2,\n 'reference_id'=>1\n ] );\n \n \n \n DinteractionHasReference::create( [\n \n 'dinteraction_id'=>3,\n 'reference_id'=>18\n ] );\n \n \n \n DinteractionHasReference::create( [\n \n 'dinteraction_id'=>17,\n 'reference_id'=>4\n ] );\n \n \n \n DinteractionHasReference::create( [\n \n 'dinteraction_id'=>14,\n 'reference_id'=>5\n ] );\n \n \n \n DinteractionHasReference::create( [\n \n 'dinteraction_id'=>15,\n 'reference_id'=>2\n ] );\n \n \n \n DinteractionHasReference::create( [\n \n 'dinteraction_id'=>16,\n 'reference_id'=>18\n ] );\n \n \n \n DinteractionHasReference::create( [\n \n 'dinteraction_id'=>11,\n 'reference_id'=>11\n ] );\n \n \n \n DinteractionHasReference::create( [\n \n 'dinteraction_id'=>2,\n 'reference_id'=>8\n ] );\n \n \n \n DinteractionHasReference::create( [\n \n 'dinteraction_id'=>20,\n 'reference_id'=>4\n ] );\n \n \n \n DinteractionHasReference::create( [\n \n 'dinteraction_id'=>17,\n 'reference_id'=>4\n ] );\n \n \n \n DinteractionHasReference::create( [\n \n 'dinteraction_id'=>18,\n 'reference_id'=>4\n ] );\n \n \n \n DinteractionHasReference::create( [\n \n 'dinteraction_id'=>10,\n 'reference_id'=>17\n ] );\n \n \n \n DinteractionHasReference::create( [\n \n 'dinteraction_id'=>1,\n 'reference_id'=>14\n ] );\n \n \n \n DinteractionHasReference::create( [\n \n 'dinteraction_id'=>2,\n 'reference_id'=>8\n ] );\n \n \n \n DinteractionHasReference::create( [\n \n 'dinteraction_id'=>4,\n 'reference_id'=>8\n ] );\n \n \n \n DinteractionHasReference::create( [\n \n 'dinteraction_id'=>5,\n 'reference_id'=>8\n ] );\n \n \n \n DinteractionHasReference::create( [\n \n 'dinteraction_id'=>6,\n 'reference_id'=>5\n ] );\n \n \n \n DinteractionHasReference::create( [\n \n 'dinteraction_id'=>17,\n 'reference_id'=>11\n ] );\n \n \n \n DinteractionHasReference::create( [\n \n 'dinteraction_id'=>7,\n 'reference_id'=>11\n ] );\n \n \n \n DinteractionHasReference::create( [\n \n 'dinteraction_id'=>4,\n 'reference_id'=>11\n ] );\n \n \n \n DinteractionHasReference::create( [\n \n 'dinteraction_id'=>3,\n 'reference_id'=>11\n ] );\n \n \n \n DinteractionHasReference::create( [\n \n 'dinteraction_id'=>2,\n 'reference_id'=>3\n ] );\n \n \n \n DinteractionHasReference::create( [\n \n 'dinteraction_id'=>4,\n 'reference_id'=>2\n ] );\n }", "function mapper($res)\n{\n foreach ($res as $match)\n {\n /*\n * Here goes your business logic\n * BEGIN\n */\n foreach ($match[\"href\"] as $href)\n {\n if (reset(Finder::where(\"data\", \"href = '$href'\")) === false)\n {\n $row = R::dispense(\"data\");\n $row->href = $href;\n R::store($row);\n }\n }\n /*\n * Here ends your business logic\n * END\n */\n }\n}", "private function parse_references()\n {\n if($html = Functions::lookup_with_cache($this->page['taxa_refs'], $this->download_options)) {\n if(preg_match_all(\"/im_field_taxonomic_name%3A(.*?)\\\"/ims\", $html, $arr)) {\n $total = count($arr[1]); $i = 0;\n // print_r($arr[1]); exit;\n foreach($arr[1] as $taxon_id) {\n $i++; echo \"\\ntaxon [$taxon_id]: $i of $total\\n\";\n $taxon_refs = self::get_taxon_refs($taxon_id);\n self::write_taxon_refs($taxon_refs, $taxon_id);\n // print_r($refs); exit(\"\\nstopx 100\\n\");\n // if($i == 1) break; //debug only\n }\n }\n }\n }", "public function nth(int $step, bool $keepKeys = false): ReferencedCollection\n {\n $result = new ReferencedCollection();\n $this->withNth($step, function ($item, $key) use ($result, $keepKeys) {\n if ($keepKeys) {\n $result->insert($key, $item);\n } else {\n $result->push($item);\n }\n });\n return $result;\n }", "public function getPreparationSteps(): array\n {\n // Most formats do not have extra preparation steps.\n return [];\n }", "public function getMigrationPaths();", "public function getRan()\n {\n return $this->table()\n ->where('plugin', $this->plugin)\n ->orderBy('batch', 'asc')\n ->orderBy('migration', 'asc')\n ->pluck('migration')->all();\n }", "protected function migration_process() {\n\t\t$available_languages = Fusion_Multilingual::get_available_languages();\n\t\tself::$available_languages = ( ! empty( $available_languages ) ) ? $available_languages : [ '' ];\n\n\t\t$this->migrate_options();\n\t}", "function getReferencingTableData($entity)\n{\n $fks = getForeignKeys();\n $tables = array();\n \n foreach($fks as $fk){\n $referencing_table = \"\";\n $title_field = \"\";\n $likely_page = \"\";\n if ($fk['ref_page'] == $entity[\"pagename\"]) {\n $page_info = getPageInfo($fk['page']);\n $referencing_table = $page_info['tablename'];\n if (isMultipage($fk['page'])) {\n $title_field = $page_info['title_field'];\n } else {\n $title_field = 'heading';\n }\n $likely_page = $fk['page'];\n } else if ($fk['ref_table'] == $entity['tablename']) {\n $referencing_table = $fk['table'];\n //in principle, _sys_sections could be referenced - that's easy\n if ($referencing_table == '_sys_sections') {\n $title_field = 'heading';\n $likely_page = $fk['page'];\n } else {\n // more likely are multipages\n $pk_field = getPKName($referencing_table);\n $pq = \"SELECT name, title_field FROM _sys_multipages WHERE tablename = '\".$referencing_table.\"'\";\n $result = pp_run_query($pq);\n $row = $result[0];\n if (count($result)>1) {\n $title_field = $pk_field;\n }\n //no chance of a good choice :-(\n else {\n // we have the one page for this table!\n $title_field = $row['title_field'];\n if ($title_field==\"\") {\n $title_field = $pk_field;\n }\n }\n $likely_page = $row['name'];\n }\n }\n if ($referencing_table != \"\") {\n $tables[] = array('fk'=>$fk,'table_name'=>$referencing_table, 'likely_page' => $likely_page, 'title_field' => $title_field);\n }\n }\n return $tables;\n}", "public function remapListedDBRecords() {}", "public function upgradeRecords() {\n foreach ($this->records as $record) {\n $type = $record[$this->Version->Version->alias]['type'];\n $version = $record[$this->Version->Version->alias]['version'];\n\n $mapping = $this->mappings[$type];\n $migration = $mapping[$version];\n\n $this->Version->Version->id = $record[$this->Version->Version->alias]['id'];\n $this->Version->Version->saveField('class', $migration['class']);\n }\n }", "public function getRecordStrips($step) {\n \n $keys = range(0, count($this->record), $step);\n return array_values(array_intersect_key($this->record, array_combine($keys, $keys)));\n }", "function get_fields(){\n //\n //Start with an empty array that stores the resolved column attributes \n $fields=[];\n // \n //Get the indexed column names\n $index_names = $this->entity->indices;\n //\n //Test if the entity is properly constructed with idices for identification\n $x = \\count($index_names);\n //\n //If the entity does not have an index through an exception since we cannot \n //create an identifier\n if( $x === 0){\n throw new \\Exception(\"Table: {$this->entity->name} does not have indexes check its construction\");\n }\n //\n //Get the first index since I are only using the first index to retrieve \n //the indexed column names\n $index = array_values($index_names)[0];\n //\n //loop through the indexes and push to the fields if it is an attribute \n //else resolve it to its constituent column attributes \n foreach ($index as $cname){\n //\n //Get the root column that if by the indexed name \n $col= $this->entity->columns[$cname];\n //\n //Test if the column is an attribute \n //The column is an attribute it does not need to be resolved \n if($col instanceof \\column_attribute){\n //\n //Push the column it is already resolved \n array_push($fields, new column($col));\n }\n //\n //The column is a foreign it needs to resolved by first principle\n //steps\n //1. get the referenced table name \n //2. get the referenced entity\n //3. get resolved indexes of the referenced entity\n else{\n //\n //1. Get the referenced table name \n $ref= $col->ref_table_name;\n //\n //Test if this entity exists in the join entities list\n //1 if it does not exist push \n $en= array_search($ref, $this->join_entities);\n if ($en === false){\n //\n array_push($this->join_entities, $ref);\n }\n //\n //2. Get the referenced entity \n $entity1= $this->entity->dbase->entities[$ref];\n //\n //Repeat this process for the referenced entity \n $cols2= $this->resolve_ref($entity1);\n //\n //loop through the fields of the new identify pushing them to the \n //fields \n foreach ( $cols2 as $coll) {\n //\n //push the column attribute\n array_push($fields, $coll);\n }\n }\n \n }\n //\n //Update and include any name, title, description , or id fields\n $fields1=$this->update_fields($fields);\n //\n //return the collection of the resolved columns \n return $fields1;\n }", "public function setup() {\n\t\tparent::setup();\n\t\tincrease_time_limit_to();\n\n\t\t$restart = $this->currentStep == 0;\n\n\t\tif ($restart) {\n\t\t\t$this->pagesToProcess = DB::query('SELECT \"ID\" FROM SiteTree_Live WHERE ShowInSearch=1')->column();\n\t\t}\n\t}", "public function getIterator() {\n\t\t// Load related records for current row\n\t\t$data = $this->execute();\n\t\treturn $data ? $data : array();\n\t}", "public function getPendingSteps();", "public function reIndex() {\n $index = collect([]);\n // Loop through each of the blueprints\n $this->getBlueprints()->each(function($blueprint,$k) use ($index) {\n // Pass each blueprint through the to reference process\n $blueprint->toReference($index);\n });\n // Replace the current index value\n $this->index = $index;\n // Return for chaining\n return $this;\n }", "protected function getSteps()\n {\n /**\n * If the opportunity is a direct bid segmentation is skipped\n */\n if (isset($this->opportunity['instructions']['type']) && $this->opportunity['instructions']['type'] == 'direct') {\n $steps = array_flip(Form::$steps);\n unset($steps['segmentation']);\n $steps = array_keys($steps);\n } else {\n $steps = Form::$steps;\n }\n\n return $steps;\n }", "public function fields($migration = NULL) {\n $fields = array();\n // First the core (users table) properties\n $fields['uid'] = t('User: <a href=\"@doc\">Existing user ID</a>',\n array('@doc' => 'http://drupal.org/node/1349632#uid'));\n $fields['mail'] = t('User: <a href=\"@doc\">Email address</a>',\n array('@doc' => 'http://drupal.org/node/1349632#mail'));\n $fields['name'] = t('User: <a href=\"@doc\">Username</a>',\n array('@doc' => 'http://drupal.org/node/1349632#name'));\n $fields['pass'] = t('User: <a href=\"@doc\">Password (plain text)</a>',\n array('@doc' => 'http://drupal.org/node/1349632#pass'));\n $fields['status'] = t('User: <a href=\"@doc\">Status</a>',\n array('@doc' => 'http://drupal.org/node/1349632#status'));\n $fields['created'] = t('User: <a href=\"@doc\">Registered timestamp</a>',\n array('@doc' => 'http://drupal.org/node/1349632#created'));\n $fields['access'] = t('User: <a href=\"@doc\">Last access timestamp</a>',\n array('@doc' => 'http://drupal.org/node/1349632#access'));\n $fields['login'] = t('User: <a href=\"@doc\">Last login timestamp</a>',\n array('@doc' => 'http://drupal.org/node/1349632#login'));\n $fields['roles'] = t('User: <a href=\"@doc\">Role IDs</a>',\n array('@doc' => 'http://drupal.org/node/1349632#roles'));\n $fields['role_names'] = t('User: <a href=\"@doc\">Role Names</a>',\n array('@doc' => 'http://drupal.org/node/1349632#role_names'));\n $fields['picture'] = t('User: <a href=\"@doc\">Picture</a>',\n array('@doc' => 'http://drupal.org/node/1349632#picture'));\n $fields['signature'] = t('User: <a href=\"@doc\">Signature</a>',\n array('@doc' => 'http://drupal.org/node/1349632#signature'));\n $fields['signature_format'] = t('User: <a href=\"@doc\">Signature format</a>',\n array('@doc' => 'http://drupal.org/node/1349632#signature_format'));\n $fields['timezone'] = t('User: <a href=\"@doc\">Timezone</a>',\n array('@doc' => 'http://drupal.org/node/1349632#timezone'));\n $fields['language'] = t('User: <a href=\"@doc\">Language</a>',\n array('@doc' => 'http://drupal.org/node/1349632#language'));\n $fields['theme'] = t('User: <a href=\"@doc\">Default theme</a>',\n array('@doc' => 'http://drupal.org/node/1349632#theme'));\n $fields['init'] = t('User: <a href=\"@doc\">Init</a>',\n array('@doc' => 'http://drupal.org/node/1349632#init'));\n $fields['data'] = t('User: <a href=\"@doc\">Data</a>',\n array('@doc' => 'http://drupal.org/node/1349632#init'));\n $fields['is_new'] = t('Option: <a href=\"@doc\">Indicates a new user with the specified uid should be created</a>',\n array('@doc' => 'http://drupal.org/node/1349632#is_new'));\n\n // Then add in anything provided by handlers\n $fields += migrate_handler_invoke_all('Entity', 'fields', $this->entityType, $this->bundle, $migration);\n $fields += migrate_handler_invoke_all('User', 'fields', $this->entityType, $this->bundle, $migration);\n\n return $fields;\n }", "private function getNextPrevIds() {\n $arrReturn = array();\n\n //Load all images on the current level\n $objCur = class_objectfactory::getInstance()->getObject($this->getSystemid());\n $arrImagesLevel = class_module_mediamanager_file::loadFilesDB($objCur->getPrevId(), class_module_mediamanager_file::$INT_TYPE_FILE, true);\n //Sort out the unallowed ones\n foreach($arrImagesLevel as $intKey => $objOneImage) {\n if(!$objOneImage->rightView())\n unset($arrImagesLevel[$intKey]);\n }\n\n //make array-keys numeric\n /** @var $arrImagesLevel class_module_mediamanager_file[] */\n $arrImagesLevel = array_values($arrImagesLevel);\n //Search the current image\n $intKeyHit = 0;\n foreach ($arrImagesLevel as $intKeyHit => $objOneImage) {\n if($objOneImage->getSystemid() == $this->getSystemid()) {\n break;\n }\n }\n\n $arrReturn[\"forward_1\"] = (isset($arrImagesLevel[$intKeyHit+1]) ? $arrImagesLevel[$intKeyHit+1]->getSystemid() : \"\");\n $arrReturn[\"forward_2\"] = (isset($arrImagesLevel[$intKeyHit+2]) ? $arrImagesLevel[$intKeyHit+2]->getSystemid() : \"\");\n $arrReturn[\"forward_3\"] = (isset($arrImagesLevel[$intKeyHit+3]) ? $arrImagesLevel[$intKeyHit+3]->getSystemid() : \"\");;\n\n $arrReturn[\"backward_1\"] = (isset($arrImagesLevel[$intKeyHit-1]) ? $arrImagesLevel[$intKeyHit-1]->getSystemid() : \"\");;\n $arrReturn[\"backward_2\"] = (isset($arrImagesLevel[$intKeyHit-2]) ? $arrImagesLevel[$intKeyHit-2]->getSystemid() : \"\");;\n $arrReturn[\"backward_3\"] = (isset($arrImagesLevel[$intKeyHit-3]) ? $arrImagesLevel[$intKeyHit-3]->getSystemid() : \"\");;\n\n return $arrReturn;\n }", "public function next() {\n $this->currentRow = $this->result->fetchObject();\n $this->currentKey = array();\n if (!is_object($this->currentRow)) {\n $this->currentRow = NULL;\n }\n else {\n foreach ($this->sourceKeyMap as $map_field) {\n $this->currentKey[$map_field] = $this->currentRow->$map_field;\n // Leave only destination fields\n unset($this->currentRow->$map_field);\n }\n }\n }", "public function getEditSteps()\n {\n return isset($this->source['edit_steps']) ? $this->source['edit_steps'] : [];\n }", "public function testIteratorConvertsOriginalEntriesToArgumentSets()\n {\n $iterator = $this->createIterator(array(1, 2, 3));\n\n $data = iterator_to_array($iterator);\n\n $expectedData = array(\n array(1),\n array(2),\n array(3)\n );\n $this->assertEquals($expectedData, $data);\n }", "public function migrate()\n {\n $this->prepareWizardsTable();\n\n $this->processProcessing();\n $this->processLogs();\n $this->processConfigData();\n\n $this->prepareOrdersTables();\n $this->prepareOrdersConfigTable();\n $this->processOrdersData();\n }", "protected function importPartRelationships()\n {\n $this->updateStatus('Importing Rebrickable Part Relationships into Database...');\n\n $processed = $this->processed;\n\n $this->lazyCollectionFromCsv()\n ->chunk(1000)\n ->each(function ($partRelationships) use (&$processed) {\n $partRelationshipList = [];\n foreach ($partRelationships as $partRelationship) {\n $partRelationshipList[] = [\n 'rel_type' => $partRelationship['rel_type'],\n 'child_part_num' => $partRelationship['child_part_num'],\n 'parent_part_num' => $partRelationship['parent_part_num'],\n ];\n\n $processed++;\n }\n\n if (count($partRelationshipList)) {\n PartRelationship::insert($partRelationshipList);\n }\n });\n\n $this->processed = $processed;\n }", "protected function getMigrations()\n {\n $finder = new Finder();\n $files = $finder->files()\n ->name('*table.php')\n ->notName('2014*')\n ->in(database_path() . '/migrations');\n\n foreach ($files as $file) {\n $this->migrations[] = $file->getRealPath() ;\n }\n }", "public function getMigratedVersions()\n {\n $this->createMigrationCollection();\n\n $cursor = $this->getCollection()->find();\n $versions = [];\n foreach ($cursor as $record) {\n $versions[] = $record['v'];\n }\n\n return $versions;\n }", "private function createNewMigration() {\n // $this->MigrationFieldCollection[$this->getModel()->getShortModelName()];\n $changes = []; //these fields are added or updated if the fieldnames is not in this array delete it.\n foreach ($this->getModel()->getFieldCollection() as $fieldName => $field) {\n //var_dump($this->checkFieldProperties($field)); --mark if the fieldsproperties are default or not\n $this->checkFieldProperties($field);\n var_dump($field);\n\n if (!empty($this->MigrationFieldCollection[$this->getModel()->getShortModelName()][$fieldName])) {\n $reflection = new \\ReflectionObject($field);\n $changes = [];\n $this->checkFieldProperties($field);\n\n foreach ($reflection->getProperties() as $fieldValues) {\n\n }\n //we want to update this field\n } else {\n\n //copy this field since we create\n }\n }\n foreach ($this->MigrationFieldCollection[$this->getModel()->getShortModelName()] as $migrationFieldName => $migrationField) {\n if (!in_array($migrationFieldName, $changes)) {\n $this->newMigrationLines[] = $this->modelFieldToMigrationString($migrationField['dataStructure'], 'delete');\n }\n }\n }", "protected function get_migration_file_list()\n\t{\n\t\tif ($this->migrations !== false)\n\t\t{\n\t\t\treturn $this->migrations;\n\t\t}\n\n\t\t// Only have the finder search in this extension path directory\n\t\t$migrations = $this->extension_finder\n\t\t\t->extension_directory('/migrations')\n\t\t\t->find_from_extension($this->extension_name, $this->extension_path);\n\n\t\t$migrations = $this->extension_finder->get_classes_from_files($migrations);\n\n\t\t$this->migrator->set_migrations($migrations);\n\n\t\t$migrations = $this->migrator->get_migrations();\n\n\t\treturn $migrations;\n\t}", "public function getAvailableMigrations($target=null)\n\t{\n\t\t// for normal migration we need all files to target\n\t\t// for rollbacks we need from target to the greatest migration\n\t\t$filter = $this->getFilter();\n\t\tif (!$this->isDownwards($target)) {\n\t\t\tif (null !== $target) {\n\t\t\t\t$filter->setToVersion($target);\n\t\t\t}\n\t\t} else {\t// rollback\n\t\t\t$filter->setFromVersion($target);\n\t\t\t$filter->setToVersion($this->getGreatestMigration());\n\t\t}\n\n\t\t$migration_steps = $this->getMigrationSteps();\n\n\t\t// migrations to be executed\n\t\t$to_execute = array();\n\t\tif ($this->isDownwards($target)) {\n\t\t\t// rollback: execute the common part of $executed and $migration_refs\n\t\t\t$executed = $this->getExecutedMigrations();\n\t\t\tforeach($migration_steps as $ref => $migration_class) {\n\t\t\t\tif (array_key_exists($ref, $executed)) {\n\t\t\t\t\t$to_execute[] = $ref;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t// migration: execute what's missing - the different of $executed and $available\n\t\t\t$to_execute = array_diff(array_keys($migration_steps), array_keys($this->getExecutedMigrations()));\n\t\t}\n\t\t\n\t\t// go through $to_execute and find the migration steps\n\t\t$migrations = array();\n\t\tforeach ($to_execute as $ref) {\n\t\t\t$migrations[$ref] = $migration_steps[$ref];\n\t\t}\n\t\t\n\t\t// sort migrations according to filter and target\n\t\t// remove one so that to avoid executing target in the case of rollback\n\t\t$this->sortMigrations($migrations, $target);\n\t\tif ($this->isDownwards($target)) {\n\t\t\tarray_pop($migrations);\n\t\t}\n\t\treturn $migrations;\n\t}", "function reArrange($source)\r\n{\r\n\t\r\n\t$i = 0;\r\n\t$fact_id=\"\";\r\n\t\t\t\r\n\tforeach($source as $key=>$val)\r\n\t{\t\r\n\t\t$res[$i]['Zone'] = $val['factories']['Zone'];\r\n\t\t\r\n\t\tif( intval($val['RESULT']['status']) == 0 ) \r\n\t\t{\r\n\t\t\t$fact_id = $val['RESULT']['factory_id'];\r\n\t\t\t\r\n\t\t\t$res[$i]['base_fact_id'] = $val['RESULT']['factory_id'];\r\n\t\t\t$res[$i]['base_fact_name'] = $val['factories']['factory_name'];\r\n\t\t\t$res[$i]['base_point'] = $val['RESULT']['points'];\r\n\t\t\t\r\n\t\t\t$res[$i]['follow_fact_id'] = \"\";\r\n\t\t\t$res[$i]['follow_point'] = \"\";\r\n\t\t}\r\n\t\t\t\r\n\t\telseif( intval($val['RESULT']['status']) != 0 ) \r\n\t\t{\r\n\t\t\tif($val['RESULT']['factory_id'] == $fact_id)\r\n\t\t\t{\r\n\t\t\t\t$res[$i-1]['follow_fact_id'] = $val['RESULT']['factory_id'];\r\n\t\t\t\t$res[$i-1]['follow_point'] = $val['RESULT']['points'];\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$res[$i]['base_fact_id'] = \"\";\r\n\t\t\t\t$res[$i]['base_point'] = \"\";\r\n\t\t\t\t\r\n\t\t\t\t$res[$i]['follow_fact_id'] = $val['RESULT']['factory_id'];\r\n\t\t\t\t$res[$i]['follow_fact_name'] = $val['factories']['factory_name'];\r\n\t\t\t\t$res[$i]['follow_point'] = $val['RESULT']['points'];\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t$i++;\r\n\t}\r\n\t\r\n\treturn $res;\t\t\r\n}", "public function getModulesInMigrationOrder(): array;", "public function getSteps() {\n\t\t/* @var $customSteps Bricks_Checkout_Model_Resource_Step_Collection */\n\t\t$customSteps = Mage::getSingleton('bricks_checkout/step')->getEnabledStepCollection();\n\n\t\tMage::register( 'custom_checkout_steps', $customSteps );\n\n\t\t$_steps = parent::getSteps();\n\t\t$after = array_slice($_steps, -2 );\n\t\t$before = array_slice( $_steps, 0, -2 );\n\t\t$steps = array();\n\n\t\tforeach ( Mage::registry('custom_checkout_steps')->getData() as $step ) {\n\t\t\t$steps[ 'step-' . $step['step_id'] ] = array(\n\t\t\t\t'label'\t\t => $step['name'],\n\t\t\t\t'is_show'\t => true\n\t\t\t);\n\t\t}\n\n\t\treturn array_merge( $before, $steps, $after );\n\t}", "public function get_references()\n\t{\n\t\t$arr = array();\t// returned result\n\t\t$sql = \"SELECT * FROM refs WHERE issue_id = '{$this->id}'\";\n\t\t$this->db->execute_query($sql);\n\t\twhile($line = $this->db->fetch_line()) {\n\t\t\t$arr[] = $line;\n\t\t}\n\t\treturn $arr;\n\t}", "public function getSteps($recipe) {\n\n $query = $this->db\n ->from('steps')\n ->where('id_recipe', $recipe)\n ->order_by('numStep')\n ->get();\n\n return $result = $query->result();\n }", "protected function generate_migrations( DI_Container $container ): array {\n\t\t$migrations = array();\n\t\tforeach ( $this->migrations as $migration ) {\n\t\t\tif ( is_string( $migration ) ) {\n\t\t\t\ttry {\n\t\t\t\t\t$instance = $container->create( $migration );\n\t\t\t\t} catch ( \\Throwable $th ) {\n\t\t\t\t\tthrow Migration_Exception::failed_to_construct_migration( $migration );\n\t\t\t\t}\n\n\t\t\t\t// Add to the list if valid.\n\t\t\t\tif ( ! is_object( $instance ) || ! is_a( $instance, Migration::class ) ) {\n\t\t\t\t\tthrow Migration_Exception::failed_to_construct_migration( $migration );\n\t\t\t\t}\n\n\t\t\t\t$migrations[] = $instance;\n\t\t\t}\n\t\t}\n\t\treturn $migrations;\n\t}", "private function transfer_data()\n\t{\n\t\t$num_rows = db::select_one(\"select count(*) from {$this->table}\");\n\t\t\n\t\tfor ($i = 0; $i < $num_rows; $i += BATCH_SIZE)\n\t\t{\n\t\t\techo \"$i / $num_rows (select {$this->before_alter_select_query} from {$this->table})\\n\";\n\t\t\t$r = mysql_query(\"select {$this->before_alter_select_query} from {$this->table} limit $i, \".BATCH_SIZE);\n\t\t\twhile ($d = mysql_fetch_assoc($r))\n\t\t\t{\n\t\t\t\tif ($this->renamed_cols)\n\t\t\t\t{\n\t\t\t\t\tforeach ($this->renamed_cols as $before_key => $after_key)\n\t\t\t\t\t{\n\t\t\t\t\t\t$d[$after_key] = $d[$before_key];\n\t\t\t\t\t\tunset($d[$before_key]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tdb::insert($this->temp_table, $d);\n\t\t\t}\n\t\t}\n\t}", "public function findIllnessSteps(int $illnessId) : array\n {\n $sql = \"SELECT s.step_num,n.step_name,s.step_text\n FROM steps s INNER JOIN stepname n\n ON s.step_num=n.step_num\n WHERE s.ill_id=?\";\n $stmt = $this->db->prepare($sql);\n $stmt->execute([$illnessId]);\n\n $steps = [];\n\n while ($row = $stmt->fetch(\\PDO::FETCH_ASSOC)){\n $steps[] = new Step(\n $row['step_num'],\n \t$row['step_name']\n );\n }\n\n return $steps;\n }", "public function getStagedActions();", "public function run ()\n {\n $lookupType = array(\n [\n 'id' => 1,\n 'name' => \"Loan status\",\n 'description' => \"Different status of loan\",\n ],\n [\n 'id' => 2,\n 'name' => \"Payment Status\",\n 'description' => \"Different payment status\",\n ],\n );\n\n $lookupValue = array(\n [\n 'id' => 1,\n 'name' => \"NEW\",\n 'description' => \"NEW\",\n 'value' => 1,\n 'lookup_type_id' => 1,\n ],\n [\n 'id' => 2,\n 'name' => \"APPROVED\",\n 'description' => \"APPROVED\",\n 'value' => 1,\n 'lookup_type_id' => 1,\n ],\n [\n 'id' => 3,\n 'name' => \"CLOSED\",\n 'description' => \"CLOSED\",\n 'value' => 1,\n 'lookup_type_id' => 1,\n ],\n [\n 'id' => 4,\n 'name' => \"REJECTED\",\n 'description' => \"REJECTED\",\n 'value' => 1,\n 'lookup_type_id' => 1,\n ],\n [\n 'id' => 5,\n 'name' => \"PENDING\",\n 'description' => \"PENDING\",\n 'value' => 1,\n 'lookup_type_id' => 2,\n ],\n [\n 'id' => 6,\n 'name' => \"PAID\",\n 'description' => \"PAID\",\n 'value' => 1,\n 'lookup_type_id' => 2,\n ],\n [\n 'id' => 7,\n 'name' => \"MISSED\",\n 'description' => \"MISSED\",\n 'value' => 1,\n 'lookup_type_id' => 2,\n ],\n );\n\n LookupType::insert($lookupType);\n LookupValue::insert($lookupValue);\n }", "public function getMigrationData()\n {\n return [\n 'name' => $this->name,\n 'type' => $this->type,\n 'arguments' => $this->prepareArguments(),\n 'options' => array_except($this->options, $this->excludedOptionsForMigration()),\n ];\n }", "public function getIterator()\n {\n // Return an iterator just like the old iteration of the HistoryPlugin for BC compatibility (use getAll())\n return new \\ArrayIterator(array_map(function ($entry) {\n $entry['request']->getParams()->set('actual_response', $entry['response']);\n return $entry['request'];\n }, $this->transactions));\n }", "private function searchDiffs()\n {\n $this->matchedCollection->each(function ($item) {\n\n $newElement = $this->findMeIn($this->mergeCollection,$item);\n\n //Unset primary key property if it's not in associative pivots because it can create Integrity constraint violation: Duplicate ID\n if(!in_array($this->primaryKey,$this->associativeColumns) && !in_array($this->primaryKey,$this->associativePivots))\n unset($newElement->id);\n\n //If found element\n if($newElement)\n $this->fillReport($newElement,$item);\n });\n }", "public function actions_extract($filters){\n\n $extracted_actions = array();\n foreach($this->actions AS $action_key => $action_array){\n $is_match = true;\n if (!empty($filters['this_player_id']) && $action_array['this_player']->player_id != $filters['this_player_id']){ $is_match = false; }\n if (!empty($filters['this_robot_id']) && $action_array['this_robot']->robot_id != $filters['this_robot_id']){ $is_match = false; }\n if (!empty($filters['target_player_id']) && $action_array['target_player']->player_id != $filters['target_player_id']){ $is_match = false; }\n if (!empty($filters['target_robot_id']) && $action_array['target_robot']->robot_id != $filters['target_robot_id']){ $is_match = false; }\n if (!empty($filters['this_action']) && $action_array['this_action'] != $filters['this_action']){ $is_match = false; }\n if (!empty($filters['this_action_token']) && $action_array['this_action_token'] != $filters['this_action_token']){ $is_match = false; }\n if ($is_match){ $extracted_actions = array_slice($this->actions, $action_key, 1, false); }\n }\n return $extracted_actions;\n\n }", "public function addAllFieldProcessesAltersData() {\n return [\n 'Field Instance' => [\n 'field_plugin_method' => 'alterFieldInstanceMigration',\n 'expected_process' => [\n 'settings/title' => [\n 0 => [\n 'plugin' => 'static_map',\n 'source' => 'settings/title',\n 'bypass' => TRUE,\n 'map' => [\n 'disabled' => 0,\n 'optional' => 1,\n 'required' => 2,\n ],\n ],\n ],\n ],\n ],\n 'Field Formatter' => [\n 'field_plugin_method' => 'alterFieldFormatterMigration',\n 'expected_process' => [\n 'options/type' => [\n 0 => [\n 'map' => [\n 'taxonomy_term_reference' => [\n 'taxonomy_term_reference_link' => 'entity_reference_label',\n 'taxonomy_term_reference_plain' => 'entity_reference_label',\n 'taxonomy_term_reference_rss_category' => 'entity_reference_label',\n 'i18n_taxonomy_term_reference_link' => 'entity_reference_label',\n 'entityreference_entity_view' => 'entity_reference_entity_view',\n ],\n 'link_field' => [\n 'link_default' => 'link',\n 'link_title_plain' => 'link',\n 'link_host' => 'link',\n 'link_url' => 'link',\n 'link_plain' => 'link',\n 'link_absolute' => 'link',\n 'link_domain' => 'link',\n 'link_no_protocol' => 'link',\n 'link_short' => 'link',\n 'link_label' => 'link',\n 'link_separate' => 'link_separate',\n ],\n 'entityreference' => [\n 'entityreference_label' => 'entity_reference_label',\n 'entityreference_entity_id' => 'entity_reference_entity_id',\n 'entityreference_entity_view' => 'entity_reference_entity_view',\n ],\n 'node_reference' => [\n 'node_reference_default' => 'entity_reference_label',\n 'node_reference_plain' => 'entity_reference_label',\n 'node_reference_nid' => 'entity_reference_entity_id',\n 'node_reference_node' => 'entity_reference_entity_view',\n 'node_reference_path' => 'entity_reference_label',\n ],\n 'user_reference' => [\n 'user_reference_default' => 'entity_reference_label',\n 'user_reference_plain' => 'entity_reference_label',\n 'user_reference_uid' => 'entity_reference_entity_id',\n 'user_reference_user' => 'entity_reference_entity_view',\n 'user_reference_path' => 'entity_reference_label',\n ],\n 'file' => [\n 'default' => 'file_default',\n 'url_plain' => 'file_url_plain',\n 'path_plain' => 'file_url_plain',\n 'image_plain' => 'image',\n 'image_nodelink' => 'image',\n 'image_imagelink' => 'image',\n ],\n 'datetime' => [\n 'date_default' => 'datetime_default',\n 'format_interval' => 'datetime_time_ago',\n 'date_plain' => 'datetime_plain',\n ],\n 'email' => [\n 'email_formatter_default' => 'email_mailto',\n 'email_formatter_contact' => 'basic_string',\n 'email_formatter_plain' => 'basic_string',\n 'email_formatter_spamspan' => 'basic_string',\n 'email_default' => 'email_mailto',\n 'email_contact' => 'basic_string',\n 'email_plain' => 'basic_string',\n 'email_spamspan' => 'basic_string',\n ],\n 'phone' => [\n 'phone' => 'basic_string',\n ],\n 'telephone' => [\n 'text_plain' => 'string',\n 'telephone_link' => 'telephone_link',\n ],\n ],\n ],\n ],\n ],\n ],\n 'Field Widget' => [\n 'field_plugin_method' => 'alterFieldWidgetMigration',\n 'expected_process' => [\n 'options/type' => [\n 'type' => [\n 'map' => [\n 'd7_text' => 'd7_text_default',\n 'number_default' => 'number_default_default',\n 'taxonomy_term_reference' => 'taxonomy_term_reference_default',\n 'image' => 'image_default',\n 'image_miw' => 'image_image',\n 'link_field' => 'link_default',\n 'entityreference' => 'entityreference_default',\n 'node_reference_select' => 'options_select',\n 'node_reference_buttons' => 'options_buttons',\n 'node_reference_autocomplete' => 'entity_reference_autocomplete_tags',\n 'user_reference_select' => 'options_select',\n 'user_reference_buttons' => 'options_buttons',\n 'user_reference_autocomplete' => 'entity_reference_autocomplete_tags',\n 'list' => 'list_default',\n 'file_mfw' => 'file_generic',\n 'filefield_widget' => 'file_generic',\n 'date' => 'datetime_default',\n 'datetime' => 'datetime_default',\n 'datestamp' => 'datetime_timestamp',\n 'email_textfield' => 'email_default',\n 'phone' => 'phone_default',\n ],\n ],\n ],\n ],\n ],\n ];\n }", "function getReferencedTableData($entity)\n{\n $tables = array();\n foreach($entity['fields'] as $f){\n $fk = getFK($entity['tablename'], $f['name']);\n \n $referenced_table = \"\";\n $title_field = \"\";\n $likely_page = \"\";\n // Get the referenced table and the title field to show\n // Now, what can we show? Is there a more useful field for\n // the valuelist than an id or the like? Maybe the title_field\n // of a page? Let's see if we can get one\n if ($fk['page'] == $entity[\"pagename\"]) {\n $page_info = getPageInfo($fk['ref_page']);\n $referenced_table = $page_info['tablename'];\n if (isMultipage($fk['ref_page'])) {\n $title_field = $page_info['title_field'];\n } else {\n $title_field = 'heading';\n }\n $likely_page = $fk['ref_page'];\n } else if ($fk['table'] == $entity['tablename']) {\n $referenced_table = $fk['ref_table'];\n //in principle, _sys_sections could be referenced - that's easy\n if ($referenced_table == '_sys_sections') {\n $title_field = 'heading';\n $likely_page = $fk['ref_page'];\n } else {\n // more likely are multipages\n $pk_field = getPKName($referenced_table);\n $pq = \"SELECT name,title_field FROM _sys_multipages WHERE tablename = '\".$referenced_table.\"'\";\n $result = pp_run_query($pq);\n $row = $result[0];\n if (count($result)>1) {\n $title_field = $pk_field;\n }\n //no chance of a good choice :-(\n else {\n // we have the one page for this table!\n $title_field = $row['title_field'];\n if ($title_field==\"\") {\n $title_field = $pk_field;\n }\n }\n $likely_page = $row['name'];\n }\n }\n if ($referenced_table != \"\") {\n $tables[] = array('fk'=>$fk,'table_name'=>$referenced_table, 'likely_page' => $likely_page , 'title_field' => $title_field);\n }\n }\n return $tables;\n}", "private function saveHistory()\n {\n ksort($this->migrations);\n foreach ($this->migrations as $k => $migration) {\n if ($migration['id'] === 0) {\n // new\n $prep = $this->db->prepare(\"INSERT INTO `{$this->table}` (`created_at`,`name`,`author`,`status`) \"\n . \"VALUES (:time, :name, :author, :status)\");\n $prep->execute([\n ':time' => $migration['time'],\n ':name' => $migration['name'],\n ':author' => $migration['author'],\n ':status' => $migration['status'],\n ]);\n // get inserted id\n $sth = $this->db->query('SELECT LAST_INSERT_ID()');\n $newId = $sth->fetchColumn();\n $this->migrations[$k]['id'] = $newId;\n } else if ($migration['id'] === -100) {\n // delete\n $prep = $this->db->prepare(\"DELETE FROM `{$this->table}` WHERE `id` = :id\");\n $prep->execute([':id' => $migration['id']]);\n } else {\n // update\n $prep = $this->db->prepare(\"UPDATE `{$this->table}` SET `status` = :status WHERE `id` = :id\");\n $prep->execute([':id' => $migration['id'], ':status' => $migration['status']]);\n }\n }\n }" ]
[ "0.5509165", "0.54006493", "0.5283156", "0.52501714", "0.5166381", "0.50223976", "0.48835343", "0.4878478", "0.48537058", "0.48440874", "0.47927505", "0.4772981", "0.47431618", "0.46935946", "0.465664", "0.46439365", "0.46239606", "0.4562514", "0.45407766", "0.4528245", "0.4506229", "0.44913816", "0.44777125", "0.44717923", "0.4448513", "0.4448209", "0.4448195", "0.44475672", "0.44349796", "0.44299334", "0.44138682", "0.44127718", "0.44125772", "0.44109517", "0.440365", "0.43922377", "0.43722782", "0.43707696", "0.43705374", "0.4366004", "0.43633246", "0.4359992", "0.4353428", "0.43527895", "0.43470794", "0.43457413", "0.433829", "0.43180108", "0.43144602", "0.4303482", "0.42957646", "0.4262531", "0.42624238", "0.4259758", "0.42577285", "0.42568997", "0.4256229", "0.4255044", "0.42541277", "0.42471904", "0.42394456", "0.4239142", "0.4218645", "0.42151454", "0.42043433", "0.41994852", "0.4197117", "0.4189227", "0.41853753", "0.41775292", "0.41714692", "0.41630375", "0.41582283", "0.41483277", "0.4141776", "0.41384652", "0.41364303", "0.41355303", "0.41352826", "0.4133769", "0.41289648", "0.41288662", "0.41288596", "0.41278353", "0.41241947", "0.41231602", "0.4115643", "0.4113504", "0.4109183", "0.41089618", "0.4107522", "0.4106475", "0.4100399", "0.4099926", "0.4083775", "0.4082684", "0.40825564", "0.4078274", "0.40737495", "0.4073387" ]
0.72580534
0
Display a listing of the resource.
public function pangkat(Request $request) { $id_golongan = $request['id_golongan']; $pangkat = pangkat::where('pangkat_golongan_id', '=', $id_golongan)->get(); return response()->json($pangkat); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->resource->getList($offset, $limit, $filter, $sort);\n\n $this->View()->assign($result);\n $this->View()->assign('success', true);\n }", "public function listing();", "function index() {\n\t\t$this->show_list();\n\t}", "public function actionList() {\n $this->_getList();\n }", "public function listAction()\n {\n $model = $this->_getPhotoModel();\n $entries = $model->fetchEntries($this->_getParam('page', 1));\n\n $this->view->url = 'http://' . $this->_request->getHttpHost() . $this->_request->getBaseUrl(); \n $this->view->paginator = $entries;\n }", "public function index()\n {\n $items = Item::all();\n return ItemForShowResource::collection($items);\n }", "public function index()\n {\n return Resource::collection(($this->getModel())::paginate(10));\n }", "function index()\n\t{\n\t\t$this->_list();\n\t\t$this->display();\n\t}", "public function listingAction(){\n if (!LoginHelper::isAdmin()){\n Router::redirect('home', '<p class=\"alert alert-danger\">Unauthorized</p>');\n }\n $this->view->render('patient/list', Patient::all());\n }", "public function index()\n {\n //\n $list = $this->obj->all();\n\n return $this->render('index', compact('list'));\n }", "public function action_index()\n\t{\n\t\t$this->template->title = 'Resources';\n\t\t$this->view = View::factory('admin/resource/index');\n\t\t$this->template->scripts[] = 'media/js/jquery.tablesorter.min.js';\n\t\t$this->template->scripts[] = 'media/js/admin/resource.js';\n\t\t\n\t\t$resources = Sprig::factory('resource')->load(NULL, FALSE);\n\t\tif (!empty($resources))\n\t\t{\n\t\t\t$this->view->resources = $resources->as_array();\n\t\t}\n\t}", "function listing()\n\t\t{\n\t\t// en $this->_view->_listado para poder acceder a el desde la vista.\n\t\t\t$this->_view->_listado = $listado = $this->_instrumentoModel->getInstrumento();\n\t\t\t$this->_view->render('listing', '', '',$this->_sidebar_menu);\n\t\t}", "public function listAction()\n {\n $em = $this->getDoctrine()->getManager();\n \n $todos = $em->getRepository(Todo::class)->findAll();\n \n return $this->render('todo/index.html.twig', array(\n 'todos' => $todos,\n ));\n }", "public function index()\n\t{\n $this->authorize('list', Instance::class);\n\n\t\treturn $this->ok($this->repo->paginate($this->request->all()));\n\t}", "public function actionRestList() {\n\t $this->doRestList();\n\t}", "public function listing()\n\t{\n\t\t$hospitalID = $this->request->getSession()->read(\"hospital_id\") ? $this->request->getSession()->read(\"hospital_id\") : \"\";\n\t\t\n\t\t$patientMonitored = 1;\n\t\t$patientActive = 1;\n\t\t\n\t\t//GET ALL PATIENTS\n\t\t$patientsData = $this->Patients->allPatients($hospitalID,$patientMonitored,$patientActive);\n\t\t//GET ALL PATIENTS\n\t\t\n\t\t//echo \"<pre>\"; print_r($patientsData);die;\n\t\t$this->set(compact(\"patientsData\"));\n\t}", "public function listAction()\n {\n $htmlpage = '<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"UTF-8\">\n <title>todos list!</title>\n </head>\n <body>\n <h1>todos list</h1>\n <p>Here are all your todos:</p>\n <ul>';\n \n $em = $this->getDoctrine()->getManager();\n $todos = $em->getRepository(Todo::class)->findAll();\n foreach($todos as $todo) {\n $htmlpage .= '<li>\n <a href=\"/todo/'.$todo->getid().'\">'.$todo->getTitle().'</a></li>';\n }\n $htmlpage .= '</ul>';\n\n $htmlpage .= '</body></html>';\n \n return new Response(\n $htmlpage,\n Response::HTTP_OK,\n array('content-type' => 'text/html')\n );\n }", "public function index()\n {\n // Get Persons\n $person = Person::paginate(10);\n\n //Return collection of person as a resource\n return PersonResource::collection($person);\n }", "public function listAction() {\n\t\t$this->view->title = $this->translator->translate(\"Invoice list\");\n\t\t$this->view->description = $this->translator->translate(\"Here you can see all the invoices.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"/admin/invoices/new/\", \"label\" => $this->translator->translate('New'), \"params\" => array('css' => null)));\r\n\t\t$this->datagrid->setConfig ( Invoices::grid() )->datagrid ();\n\t}", "public function listAll()\n\t{\n\t\t$this->render(self::PATH_VIEWS . '/list', [\n\t\t\t'pages' => $this->pagesDb->findAll('id', 'DESC'),\n\t\t]);\n\t}", "public function list()\n {\n // récupérer les données : toutes les catégories enregistrées\n $productList = Product::findAll();\n\n $this->show('product/list', [\n 'productList' => $productList\n ]);\n }", "public function index()\n {\n // CRUD -> Retrieve --> List\n // BREAD -> Browse Read Edit Add Delete\n // return Item::all();\n return view('list_items',compact('items'));\n }", "public function index()\n {\n // Get manufacturers\n $manufacturers = Manufacturer::orderBy('created_at', 'desc')->paginate(15);\n\n // Return collection of manufacturers as a resource\n return ManufacturerResource::collection($manufacturers);\n }", "public function index()\n {\n return ArtistResource::collection(Artist::orderBy('created_at', 'desc')->get());\n }", "public function indexAction() {\n\t\t$page = intval($this->getInput('page'));\n\t\t$perpage = $this->perpage;\n\t\t\n\t\tlist(,$files) = Lock_Service_FileType::getAllFileType();\n\t\t$data = array();\n\t\tforeach ($files as $key=>$value) {\n\t\t\t$data[$key]['id'] = $value['id'];\n\t\t\t$data[$key]['title'] = $value['name'];\n\t\t}\n\t\tlist($total, $filetype) = Lock_Service_FileType::getList($page, $perpage);\n\t\t$this->assign('filetype', $filetype);\n\t\t$this->assign('pager', Common::getPages($total, $page, $perpage, $this->actions['listUrl'].'/?'));\n\t\t$this->assign('data', json_encode($data));\n\t}", "public function listAction()\n {\n $qb = $this->getRepository()->queryAll();\n\n $view = new ImportListView;\n $view->imports = $qb->getQuery()->execute();\n\n return $this->templating->renderResponse('InfiniteImportBundle:Import:list.html.twig', array(\n 'data' => $view\n ));\n }", "public function index()\n\t{\n\t\t//Return model all()\n\t\t$instances = $this->decorator->getListingModels();\n\n\t\treturn View::make($this->listingView, array(\n\t\t\t'instances' => $instances,\n\t\t\t'controller' => get_class($this), \n\t\t\t'modelName' => class_basename(get_class($this->decorator->getModel())),\n\t\t\t'columns' => $this->getColumnsForInstances($instances),\n\t\t\t'editable' => $this->editable\n\t\t));\n\t}", "public function index()\n {\n return InfografiResources::collection(\n Infografi::orderBy('date', 'desc')->get()\n );\n }", "public function listAction()\n\t {\n\t\t\t$this->_forward('index');\n \n\t\t}", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function listAction()\n {\n $defaults = array(\n 'page' => null,\n 'order' => null,\n 'limit' => null,\n 'offset' => null,\n 'filter' => array(),\n );\n $body = $this->getRequest()->getBody();\n $options = $body + $defaults;\n\n // Process the options\n if (is_string($options['order'])) {\n $options['order'] = array_map('trim', explode(',', $options['order']));\n }\n if (is_string($options['page'])) {\n $options['page'] = (int)$options['page'];\n }\n if (is_string($options['limit'])) {\n $options['limit'] = (int)$options['limit'];\n }\n if (is_string($options['offset'])) {\n $options['offset'] = (int)$options['offset'];\n }\n $filter = $options['filter'];\n unset($options['filter']);\n\n $options = array_filter($options);\n\n return $this->getBinding()->find($filter, $options);\n }", "public function index()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the resources from the model */\n $resources = $this->resourcesList($this->model);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.index\")) {\n $view = \"admin.{$this->name}.index\";\n } else {\n $view = 'admin.includes.actions.index';\n }\n\n /* Display a listing of the resources */\n return view($view)\n ->with('resources', $resources)\n ->with('module', $this->module);\n }", "public function index()\n\t{\n\t\t$data['lists'] = $this->mdl_student->get_all();\n\t\t$this->template->set('title', 'Student Hostel List');\n\t\t$this->template->load('template', 'contents', 'student_hostel/student_hostel_list', $data);\n\t}", "public function index()\n {\n $modules = Module::all();\n return Resource::collection($modules);\n }", "public function index()\n {\n // List all resources from user entity\n $users = User::all();\n\n return $this->showAll($users);\n }", "public function index()\n {\n // Get todos\n $todos = Todo::orderBy('created_at', 'desc')->paginate(3);\n\n // Return collection of articles as a resource\n return TodoResource::collection($todos);\n }", "public function index()\n {\n return Resources::collection(Checking::paginate());\n }", "public function index()\n {\n return CourseListResource::collection(\n Course::query()->withoutGlobalScope('publish')\n ->latest()->paginate()\n );\n }", "public function index()\n {\n $cars = Car::paginate(15);\n return CarResource::collection($cars);\n }", "public function index()\n {\n // Get articles\n $articles = Article::orderBy('created_at', 'desc')->paginate(5);\n\n // Return collection of articles as a resource\n return ArticleResource::collection($articles);\n }", "public function index()\n {\n $authors = Author::paginate(10);\n\n return AuthorResource::collection($authors);\n }", "public function index()\n {\n //Get Books\n $books = Book::paginate(10);\n \n if ($books) {\n return (BookResource::collection($books))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n } else {\n return (BookResource::collection([]))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n }\n return view('index')->with('data', $books);\n }", "public function view(){\n\t\t$this->buildListing();\n\t}", "public function index()\n {\n $books = Book::latest()\n ->paginate(20);\n\n return BookResource::collection($books);\n }", "public function index()\n {\n $listing = Listing::orderBy('id', 'desc')->paginate(10);\n return view('listings.index')->withListings($listing);\n }", "public function listAction()\n {\n $this->_getSession()->setFormData([]);\n\n $this->_title($this->__('Training Cms'))\n ->_title($this->__('Pages'));\n\n $this->loadLayout();\n\n $this->_setActiveMenu('training_cms');\n $this->_addBreadcrumb($this->__('Training Cms'), $this->__('Training Cms'));\n $this->_addBreadcrumb($this->__('Pages'), $this->__('Pages'));\n\n $this->renderLayout();\n }", "public function index()\n {\n $services = $this->serviceRepository->paginate();\n\n return ServiceResource::collection($services);\n }", "public function index()\n {\n $resources = ResourceManagement::paginate(5);\n $users = User::get();\n\n return view('resources-mgmt/index', ['resources' => $resources, 'users' => $users]);\n }", "public function index()\n {\n $catalogs = Catalog::where('status', '=', Catalog::PUBLICADO)\n ->orderBy('id', 'DESC')->get();\n \n $data = CatalogResource::collection($catalogs);\n\n return [\n 'items' => $data,\n 'mensaje' => ''\n ];\n }", "public function listAction(){\n // In a controller this can be:\n // $this->request->getQuery('page', 'int'); // GET\n $currentPage = $this->request->getPost('pageindex', 'int'); // POST\n $pageNum = ($currentPage == null) ? 1 : $currentPage;\n\n // The data set to paginate\n $message = new Notice();\n $results = $message->getMsg4Admin();\n\n // Create a Model paginator, show 10 rows by page starting from $currentPage\n $paginator = new PaginatorArray(\n array(\n \"data\" => $results,\n \"limit\" => 10,\n \"page\" => $pageNum\n )\n );\n\n // Get the paginated results\n $page = $paginator->getPaginate();\n\n return $this->response->setJsonContent($page);\n\n }", "public function list()\n {\n try {\n return $this->success($this->service->list());\n } catch (\\Exception $exception) {\n return $this->error($exception->getMessage());\n }\n }", "public function index()\n {\n return $this->sendResponse(CrisisResource::collection(Crisis::paginate(10)), 'Data fetched successfully');\n }", "public function index()\n\t{\n\t\t$%Alias = new %Model();\n\t\t$params = array();\n\t\t\n\t\t$Paginator = new Paginator( $%Alias->findSize( $params ), $this->getLimit(), $this->getPage() );\n\t\t$this->getView()->set( '%Aliass', $%Alias->findList( $params, 'Id desc', $this->getOffset(), $this->getLimit() ) );\n\t\t$this->getView()->set( 'Paginator', $Paginator );\n\t\treturn $this->getView()->render();\n\t}", "public function listAction() {}", "public function index()\n {\n\n return RecipeResource::collection(Recipe::all());\n }", "public function index()\n {\n $this->indexPage('list-product', 'List Product');\n }", "public function listAction()\n {\t\n\t\t$this->removeSession();\n\t\t$this->verifySessionRights();\n\t\t$this->setActivity(\"List view\");\n $em = $this->getDoctrine()->getManager();\n $oRepClient = $em->getRepository('BoAdminBundle:Client');\n\t\t$nb_tc = $oRepClient->getTotal();\n\t\t//get page\n\t\t$page = $this->get('session')->get('page');\n\t\tif($page==null){\n\t\t\t$page=1;\n\t\t\t$this->get('session')->set('page',1);\n\t\t}\n\t\t//get number line per page\n\t\t$nb_cpp = $em->getRepository('BoAdminBundle:Param')->getParam(\"display_list_page_number\",1);\n\t\t$nb_pages = ceil($nb_tc/$nb_cpp);\n\t\t$offset = $page>0?($page-1) * $nb_cpp:0;\n\t\t$clients = $em->getRepository('BoAdminBundle:Client')->findBy(array(),array('id' => 'desc'),$nb_cpp,$offset);\n $form = $this->createForm('Bo\\AdminBundle\\Form\\ClientType', new Client());\n return $this->render('client/index.html.twig', array(\n 'clients' => $clients,\n\t\t\t'page' => $page, // forward current page to view,\n\t\t\t'nb_pages' => $nb_pages, //total number page,\n 'form' => $form->createView(),\n\t\t\t'total'=>$nb_tc, // record number.\n\t\t\t'nb_cpp' => $nb_cpp,// line's number to display\n\t\t\t'pm'=>\"contracts\",\n\t\t\t'sm'=>\"client\",\n ));\n }", "public function index()\n {\n return AcResource::collection(Ac::latest()->paginate()); //\n }", "public function executeList()\n {\n $this->setTemplate('list');\n }", "public function indexAction()\n {\n $books = Book::getAll();\n\n View::renderTemplate('Books/index.html', [\n 'books' => $books\n ]);\n }", "function listing() {\r\n\r\n }", "public function listar() {\n $rs = $this->model->listar();\n\n echo $this->toJson($rs);\n }", "public function index()\n {\n return BookResource::collection(Book::orderby('id')->get());\n }", "public function doRestList()\n {\n $this->outputHelper( \n 'Records Retrieved Successfully', \n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->orderBy($this->restSort)->limit($this->restLimit)->offset($this->restOffset)->findAll(),\n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->count()\n );\n\t}", "public function index()\n {\n $client = Client::paginate();\n return ClientResource::collection($client);\n }", "public function index()\n {\n return TagResource::collection(\n Tag::orderBy('name', 'ASC')->paginate(request('per_page', 10))\n );\n }", "public function _index(){\n\t $this->_list();\n\t}", "public function index()\n\t{\n\t\t$data['lists'] = $this->gallery_mdl->get_all();\n\t\t$this->template->set('title', 'Gallery');\n\t\t$this->template->render('template', 'list', $data);\n\t}", "function drush_restapi_list() {\n\n $resources = restapi_get_resources();\n $last_module = NULL;\n $rows = [\n [dt('Module'), dt('Path'), dt('Class')],\n ];\n\n foreach($resources as $resource) {\n if ($last_module != $resource->getModule()) {\n $module = $last_module = $resource->getModule();\n }\n else {\n $module = '';\n }\n $rows[] = [$module, $resource->getPath(), $resource->getClass()];\n }\n\n drush_print_table($rows, TRUE);\n drush_log(dt('Displaying !count total resources', [\n '!count' => count($resources),\n ]), 'ok');\n\n}", "public function index()\n {\n $this->booklist();\n }", "public function index()\n {\n //\n $accounts = accounts::paginate(15);\n\n //return the collection of employees as a resource\n return accountResource::collection($accounts);\n\n\n }", "public function index()\n {\n $items = Item::all();\n return view('items::list_items',compact('items'));\n }", "public function index()\n {\n // Get houses\n $houses = House::orderBy('created_at', 'desc')->paginate(self::PAGINATE);\n \n // Return collection of houses\n \n return HouseResource::collection($houses);\n }", "public function index()\n {\n $products = Product::paginate(6);\n return ProductResource::collection($products);\n }", "public function index() {\n $this->template->allFoundItems = Found::showAll();\n $this->template->display( 'index.html.php' );\n }", "public function indexAction() {\n $this->_forward('list');\n }", "public function index()\n {\n $data = Productcategory::paginate(10);\n\t\treturn ProductcategoryResource::Collection($data);\n }", "public function index()\n {\n return SongResource::collection(\\App\\Song::orderBy('created_at', 'desc')->get());\n }", "public function ListView()\n\t{\n\t\t\n\t\t// Requer permissão de acesso\n\t\t$this->RequirePermission(Usuario::$P_ADMIN,\n\t\t\t\t'SecureExample.LoginForm',\n\t\t\t\t'Autentique-se para acessar esta página',\n\t\t\t\t'Você não possui permissão para acessar essa página ou sua sessão expirou');\n\t\t\n\t\t//$usuario = Controller::GetCurrentUser();\n\t\t//$this->Assign('usuario',$usuario);\n\t\t$this->Render();\n\t}", "public function index () {\n permiss ( 'role.list' );\n\n $data = $this->entity\n ->orderBy('created_at', 'desc')->get();\n\n return new ModelResource($data);\n }", "public function showResources()\n {\n $resources = Resource::get();\n return view('resources', compact('resources'));\n }", "public function index()\n {\n //get articless\n $articles = Article::paginate(15);\n\n //Return collection of article has a resource\n return ArticleResource::collection($articles);\n\n }", "public function actionList() {\n header(\"Content-type: application/json\");\n $verb = $_SERVER[\"REQUEST_METHOD\"];\n\n if ($verb === 'GET') {\n echo \"{\\\"data\\\":\" . CJSON::encode(Donneur::model()->findAll()) . \"}\";\n } else if ($verb == 'POST') {\n if (Donneur::model()->exists('id' === $_POST['id'])) {\n $this->actionListUpdate($_POST);\n } else {\n $this->actionListPost();\n }\n } else if ($verb == 'DELETE') {\n $this->actionListDelete();\n }\n }", "public function list()\n {\n return $this->http->request(HttpMethods::GET, $this->endpoint);\n }", "public function indexAction(){\n $data = array(\n 'collection' => $this->model->getCollection(),\n \n ); \t\n return $this->getView($data);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('DiverPriceLisrBundle:Items')->findAll();\n\n return $this->render('DiverPriceLisrBundle:Items:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => Slaves::find(),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function listAction() {\n\t\t// Recogemos el repositorio\n\t\t$repository = $this->getDoctrine() ->getRepository('AppBundle:Product');\n\t\n\t\t// Recuperamos todos los productos.\n\t\t$products = $repository->findAll();\n\t\t// Pasamos a la plantilla el aray products\n\t\treturn $this->render('product/listActionProduct.html.twig', array( 'products' => $products));\n\t\n\t}", "public function listAction()\n\t {\n\t\t$model = $this->_getModel();\n\t\t$result = $model->getLayouts();\t\n\t\t$page = (int)($this->_request->getParam('page')); \n\t\tif(count($result) > 0)\n\t\t{ \n\t\t\tGlobals::doPaging($result, $page, $this->view);\n\t\t}\n\t\t\t\t\n\t\t$this->view->page = $page;\n\t }", "public function actionList()\n {\n // get model\n $model = new $this->_model('search');\n $model->unsetAttributes();\n\n // set filter\n if (isset($_GET[$this->_model])) {\n $model->attributes = $_GET[$this->_model];\n }\n $model->u_cms_album_id = $_GET['album'];\n\n // search\n $dataProvider = $model->search(Yii::app()->language);\n // sort\n $sort = $dataProvider->getSort();\n // route\n $sort->route = $this->id . '/list';\n\n // pagination parameters\n $pagination = $dataProvider->getPagination();\n $pagination->route = $this->id . '/list';\n $pagination->pageSize = UInterfaceSetting::model()->getSettings($this->id . ':' . $this->module->id, Yii::app()->user->id)->page_size;\n $pagination->itemCount = $dataProvider->totalItemCount;\n\n // datas\n $datas = $dataProvider->getData();\n\n // related datas\n $relatedDatas = $this->_loadRelatedData();\n\n // template\n $template = isset($_REQUEST['partial']) ? 'list/_table' : 'list/main';\n\n $jsonParams = array();\n if (Yii::app()->request->isAjaxRequest) {\n // filters\n $filtersDatas = array();\n if (isset($_GET[$this->_model])) {\n $filtersDatas[$this->_model] = $_GET[$this->_model];\n }\n if (isset($_GET[$sort->sortVar])) {\n $filtersDatas[$sort->sortVar] = $_GET[$sort->sortVar];\n }\n\n $jsonParams = array(\n 'filters' => http_build_query($filtersDatas)\n );\n }\n\n $this->dynamicRender(\n $template,\n array(\n 'dataView' => new $this->crudComponents['listDataView'](\n $datas, $relatedDatas, $model, $sort, $pagination, $this\n )\n ),\n $jsonParams\n );\n }", "public function index()\n {\n return view('listings.index')->with('listings', Listing::all());\n }", "public function get_index()\n\t{\n\t\t$pages = Page::recent_available()->paginate(30);\n\t\t$table = Cello\\Presenter\\Page::table($pages);\n\t\t$data = array(\n\t\t\t'eloquent' => $pages,\n\t\t\t'table' => $table,\n\t\t);\n\n\t\tSite::set('title', __('cello::title.pages.list'));\n\n\t\treturn View::make('cello::api.resources.index', $data);\n\t}", "public function index()\n {\n return ProductResource::collection(Product::latest()->paginate(10));\n }", "public function index()\n {\n $category = GalleryCategory::paginate(15);\n\n // return collection of category as a resource.\n return Resource::collection($category);\n }", "public function index()\n {\n //\n $news = News::latest()->paginate(18);\n\n return NewsResource::collection($news);\n }", "public function indexAction() {\n\t\t$list_info = Zend_Registry::get('list_info');\n if (!Engine_Api::_()->core()->hasSubject('list_listing')) {\n return $this->setNoRender();\n }\n \n $this->view->expiry_setting = Engine_Api::_()->list()->expirySettings();\n\n //GET SUBJECT\n $this->view->list = $list = Engine_Api::_()->core()->getSubject('list_listing');\n\n\t\t//GET CATEGORY TABLE\n\t\t$this->view->tableCategory = Engine_Api::_()->getDbTable('categories', 'list');\n\n //GET CATEGORIES NAME\n\t\t$this->view->category_name = $this->view->subcategory_name = $this->view->subsubcategory_name = '';\n\n\t\tif(!empty($list->category_id)) {\n\t\t\tif($this->view->tableCategory->getCategory($list->category_id))\n\t\t\t$this->view->category_name = $this->view->tableCategory->getCategory($list->category_id)->category_name;\n\n\t\t\tif(!empty($list->subcategory_id)) {\n\t\t\t\tif($this->view->tableCategory->getCategory($list->subcategory_id))\n\t\t\t\t$this->view->subcategory_name = $this->view->tableCategory->getCategory($list->subcategory_id)->category_name;\n\n\t\t\t\tif(!empty($list->subsubcategory_id)) {\n\t\t\t\t\tif($this->view->tableCategory->getCategory($list->subsubcategory_id))\n\t\t\t\t\t$this->view->subsubcategory_name = $this->view->tableCategory->getCategory($list->subsubcategory_id)->category_name;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n //GET LISTING TAGS\n $this->view->listTags = $list->tags()->getTagMaps();\n\n\t\t//GET OTHER DETAILS\n\t\t$this->view->list_description = Zend_Registry::get('list_descriptions');\n $this->view->addHelperPath(APPLICATION_PATH . '/application/modules/Fields/View/Helper', 'Fields_View_Helper');\n $this->view->fieldStructure = Engine_Api::_()->fields()->getFieldsStructurePartial($list);\n\t\tif(empty($list_info)){ return $this->setNoRender(); }\n }", "public function index()\n {\n return $this->service->fetchResources(Author::class, 'authors');\n }", "public function index()\n {\n return view('admin.resources.index');\n }", "public function doRestList() {\n\t\t$this->outputHelper ( 'Collections Retrieved Successfully', $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->orderBy ( $this->restSort )->limit ( $this->restLimit )->offset ( $this->restOffset )->findAll (), $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->count () );\n\t}" ]
[ "0.7446777", "0.736227", "0.73005503", "0.72478926", "0.71631265", "0.71489686", "0.7131636", "0.7105969", "0.71029514", "0.7101372", "0.70508176", "0.6995128", "0.69890636", "0.6934895", "0.6900203", "0.6899281", "0.6891734", "0.6887235", "0.68670005", "0.6849741", "0.6830523", "0.6802689", "0.6797", "0.67957735", "0.67871135", "0.6760129", "0.67427456", "0.6730486", "0.67272323", "0.67255723", "0.67255723", "0.67255723", "0.67177945", "0.6707866", "0.6706713", "0.6704375", "0.6664782", "0.6662871", "0.6660302", "0.6659404", "0.6656656", "0.6653517", "0.6647965", "0.6620322", "0.66185474", "0.6618499", "0.6606105", "0.6600617", "0.65996987", "0.6594775", "0.6587389", "0.6585109", "0.6581641", "0.6581017", "0.6577157", "0.65747666", "0.6572513", "0.65721947", "0.6570553", "0.65646994", "0.6563556", "0.6554194", "0.65529937", "0.65460825", "0.65368485", "0.653429", "0.65328294", "0.6526759", "0.6526695", "0.6526284", "0.65191334", "0.65183175", "0.65174305", "0.651703", "0.65141153", "0.6507088", "0.65061647", "0.6504046", "0.64942145", "0.6491893", "0.64883405", "0.6486392", "0.6485077", "0.64846045", "0.6478858", "0.64756656", "0.64726377", "0.6471126", "0.64701074", "0.6467418", "0.6462195", "0.64618355", "0.6459199", "0.6457831", "0.6454631", "0.64533997", "0.6451915", "0.6450861", "0.6449301", "0.64492667", "0.64469045" ]
0.0
-1
Show the form for creating a new resource.
public function create() { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return view('admin.resources.create');\n }", "public function create(){\n\n return view('resource.create');\n }", "public function create()\n\t{\n\t\treturn $this->showForm('create');\n\t}", "public function create()\n {\n return \"Display a form for creating a new catalogue\";\n }", "public function newAction()\n {\n $entity = new Resource();\n $current = $this->get('security.context')->getToken()->getUser();\n $entity->setMember($current);\n $form = $this->createCreateForm($entity);\n\n return array(\n 'nav_active'=>'admin_resource',\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }", "public function create()\n {\n return view ('forms.create');\n }", "public function create ()\n {\n return view('forms.create');\n }", "public function create()\n\t{\n\t\treturn view('faith.form');\n\t}", "public function create(NebulaResource $resource): View\n {\n $this->authorize('create', $resource->model());\n\n return view('nebula::resources.create', [\n 'resource' => $resource,\n ]);\n }", "public function create()\n {\n return view(\"request_form.form\");\n }", "public function create()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.create\")) {\n $view = \"admin.{$this->name}.create\";\n } else {\n $view = 'admin.includes.actions.create';\n }\n\n /* Show the form for creating a new resource. */\n return view($view)\n ->with('name', $this->name);\n }", "public function newAction()\n\t{\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => 'Ajouter une nouvelle &eacute;cole'\n\t\t) ) );\n\t}", "public function create()\n {\n return view($this->forms . '.create');\n }", "public function create()\n {\n return view('restful.add');\n }", "public function create()\n {\n $resource = (new AclResource())->AclResource;\n\n //dd($resource);\n return view('Admin.acl.role.form', [\n 'resource' => $resource\n ]);\n }", "public function create()\n {\n return view('admin.createform');\n }", "public function create()\n {\n return view('admin.forms.create');\n }", "public function create()\n {\n return view('backend.student.form');\n }", "public function newAction()\n {\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Nuevo');\n\n $entity = $this->getManager()->create();\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function create()\n {\n return view('client.form');\n }", "public function create()\n {\n // Nos regresa la vista del formulario\n return view('project.form');\n }", "public function create()\n {\n return view('Form');\n }", "public function newAction(){\n \n $entity = new Resourceperson();\n $form = $this->createAddForm($entity);\n\n \n return $this->render('ABCRspBundle:rsp:add.html.twig',array('entity'=>$entity,'form'=> $form->createView()));\n }", "public function createForm()\n\t{\n\t\treturn view('post.new');\n\t}", "public function create()\n {\n return view('admin.form.create', ['form' => new Form]);\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n $title = $this->title;\n $subtitle = \"Adicionar cliente\";\n\n return view('admin.clients.form', compact('title', 'subtitle'));\n }", "public function create()\n {\n return view('backend.schoolboard.addform');\n }", "public function create()\n\t{\n\t\treturn view('info.forms.createInfo');\n\t}", "public function create()\n {\n //\n return view('form');\n }", "public function create()\n {\n return view('rests.create');\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return view(\"Add\");\n }", "public function create(){\n return view('form.create');\n }", "public function create()\n {\n // Show the page\n return view('admin.producer.create_edit');\n }", "public function create()\n {\n\n return view('control panel.student.add');\n\n }", "public function newAction() {\n\t\t\n\t\t$this->view->form = $this->getForm ( \"/admin/invoices/process\" );\n\t\t$this->view->title = $this->translator->translate(\"New Invoice\");\n\t\t$this->view->description = $this->translator->translate(\"Create a new invoice using this form.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"#\", \"label\" => $this->translator->translate('Save'), \"params\" => array('css' => null,'id' => 'submit')),\r\n\t\t\t\t\t\t\t array(\"url\" => \"/admin/invoices/list\", \"label\" => $this->translator->translate('List'), \"params\" => array('css' => null)));\n\t\t$this->render ( 'applicantform' );\n\t}", "public function create()\n {\n $data['action'] = 'pengiriman.store';\n return view('pengiriman.form', $data);\n }", "public function create()\n {\n return $this->cView(\"form\");\n }", "public function newAction()\n {\n // Création de l'entité et du formulaire.\n $client = new Client();\n $formulaire = $this->createForm(new ClientType(), $client);\n \n \n \n // Génération de la vue.\n return $this->render('KemistraMainBundle:Client:new.html.twig',\n array('formulaire' => $formulaire->createView()));\n }", "public function create()\n {\n return view(\"dresses.form\");\n }", "public function create()\n\t{\n\t\treturn View::make('new_entry');\n\t}", "public function createAction()\n {\n// $this->view->form = $form;\n }", "public function create()\n {\n return view('bank_account.form', ['mode' => 'create']);\n }", "public function create()\n {\n return view('fish.form');\n }", "public function create()\n {\n return view('users.forms.create');\n }", "public function create()\n {\n $this->setFormFields($this->getCreateFormFields());\n $form = $this->getCreateForm();\n\n return view($this->getViewName('create'), [\n 'crudSlug' => $this->slug,\n 'form' => $form,\n ]);\n }", "public function create()\n\t{\n\t\treturn view('admin.estadoflete.new');\n\t}", "public function create()\n {\n $person = new Person;\n return view('contents.personform')->with(compact('person') );\n }", "public function createAction(){\n \t$this->view->placeholder('title')->set('Create');\n \t$this->_forward('form');\n }", "public function create()\n {\n Gate::authorize('app.products.create');\n\n return view('backend.products.form');\n }", "public function create()\n {\n return view('essentials::create');\n }", "public function create()\n {\n return view('student.add');\n }", "public function create()\n\t{\n\t\treturn view('loisier/create');\n\t}", "public function create()\n {\n return view('url.form');\n }", "public function newAction()\n {\n $entity = new Facture();\n $factureType = new FactureType();\n\t\t$factureType->setUser($this->get('security.context')->getToken()->getUser());\n $form = $this->createForm($factureType, $entity);\n\n return $this->render('chevPensionBundle:Facture:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function newAction()\n {\n $entity = new Chofer();\n $form = $this->createForm(new ChoferType(), $entity, ['user' => $this->getUser()]);\n\n return $this->render('ChoferesBundle:Chofer:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'css_active' => 'chofer',\n ));\n }", "public function create()\n\t{\n\t\treturn View::make('crebos.create');\n\t}", "public function create() : View\n {\n $fieldset = $this->menuFieldset();\n\n return $this->view('create', [\n 'title' => trans('addons.Aardwolf::titles.create'),\n 'data' => [],\n 'fieldset' => $fieldset->toPublishArray(),\n 'suggestions' => [],\n 'submitUrl' => route('aardwolf.postCreate')\n ]);\n }", "public function create()\n {\n return view('libro.create');\n }", "public function create()\n {\n return view('libro.create');\n }", "public function newAction()\n {\n $entity = new Species();\n $form = $this->createForm(new SpeciesType(), $entity);\n\n return $this->render('InfectBackendBundle:Species:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view('crud/add'); }", "public function create()\n\t{\n\t\treturn View::make('supplier.create');\n\t}", "public function newAction()\n {\n $entity = new Company();\n $form = $this->createForm(new CompanyType(), $entity);\n\n return $this->render('SiteSavalizeBundle:Company:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view(\"List.form\");\n }", "public function index_onCreateForm()\n\t{\n\t\tparent::create();\n\t\treturn $this->makePartial('create');\n\t}", "public function create()\n {\n //load create form\n return view('products.create');\n }", "public function create()\n {\n return view('article.addform');\n }", "public function create()\n {\n // Mengarahkan ke halaman form\n return view('buku.form');\n }", "public function create()\n\t{\n\t\t// load the create form (app/views/material/create.blade.php)\n\t\t$this->layout->content = View::make('material.create');\n\t}", "public function create()\n {\n return view('saldo.form');\n }", "public function create()\n\t\t{\n\t\t\treturn view('kuesioner.create');\n\t\t}", "public function view_create_questioner_form() {\n \t// show all questioner\n \t// send questioner to form\n \treturn view(\"create_questioner\");\n }", "public function newAction() {\n $entity = new Question();\n $form = $this->createCreateForm($entity);\n\n return $this->render('CdlrcodeBundle:Question:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n $data['companies'] = Company::select('id', 'name')->where('status', 1)->orderBy('id', 'desc')->get();\n return view('admin.outlet.outlet_form', $data);\n }", "public function create()\n {\n return view('admin.inverty.add');\n }", "public function create()\n {\n return view('Libro.create');\n }", "public function create()\n {\n $title = trans('entry_mode.new');\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n $breadcrumb='car.create';\n return view('admin.partials.cars.form', compact('breadcrumb'));\n }", "public function create()\n {\n return view(\"familiasPrograma.create\");\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n\t{\n\t\treturn View::make('perusahaans.create');\n\t}", "public function create()\n {\n return view(\"create\");\n }", "public function create()\n\t{\n //echo 'show form';\n\t\treturn View::make('gaans.create');\n\t}", "public function create()\n {\n $title = trans('dormitorybed.new');\n $this->generateParams();\n\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n return view('forming');\n }", "public function formNew() {\n $this->data->options = array(\n 'RJ' => 'Rio de Janeiro',\n 'MG' => 'Minas Gerais',\n 'SP' => 'São Paulo',\n 'ES' => 'Espírito Santo',\n 'BA' => 'Bahia',\n 'RS' => 'Rio Grande do Sul'\n );\n $this->data->action = \"@exemplos/pessoa/save\";\n $this->render();\n }", "public function create()\n {\n \t\n \treturn view('supplies.create');\n\n }", "public function createAction()\n {\n if ($form = $this->processForm()) {\n $this->setPageTitle(sprintf($this->_('New %s...'), $this->getTopic()));\n $this->html[] = $form;\n }\n }", "public function create()\n {\n $page_title = \"Add New\";\n return view($this->path.'create', compact('page_title'));\n }", "public function create()\n {\n // not sure what to do with the form since im\n // using ame partial for both create and edit\n return view('plants.create')->with('plant', new Plant);\n }", "public function create() {\n\t\t$title = 'Create | Show';\n\n\t\treturn view('admin.show.create', compact('title'));\n\t}", "public function create()\n {\n return view('student::students.student.create');\n }", "public function newAction(){\n\t\t$entity = new Reserva();\n\t\t$form = $this->createCreateForm($entity);\n\n\t\treturn $this->render('LIHotelBundle:Reserva:new.html.twig', array(\n\t\t\t'entity' => $entity,\n\t\t\t'form' => $form->createView(),\n\t\t));\n\t}" ]
[ "0.75948673", "0.75948673", "0.75863165", "0.7577412", "0.75727344", "0.7500887", "0.7434847", "0.7433956", "0.73892003", "0.73531085", "0.73364776", "0.73125", "0.7296102", "0.7281891", "0.72741455", "0.72424185", "0.7229325", "0.7226713", "0.7187349", "0.7179176", "0.7174283", "0.7150356", "0.71444064", "0.71442676", "0.713498", "0.71283126", "0.7123691", "0.71158516", "0.71158516", "0.71158516", "0.7112176", "0.7094388", "0.7085711", "0.708025", "0.70800644", "0.70571953", "0.70571953", "0.70556754", "0.70396435", "0.7039549", "0.7036275", "0.703468", "0.70305896", "0.7027638", "0.70265305", "0.70199823", "0.7018007", "0.7004984", "0.7003889", "0.7000935", "0.69973785", "0.6994679", "0.6993764", "0.6989918", "0.6986989", "0.6966502", "0.69656384", "0.69564354", "0.69518244", "0.6951109", "0.6947306", "0.69444615", "0.69423944", "0.6941156", "0.6937871", "0.6937871", "0.6936686", "0.69345254", "0.69318026", "0.692827", "0.69263744", "0.69242257", "0.6918349", "0.6915889", "0.6912884", "0.691146", "0.69103104", "0.69085974", "0.69040126", "0.69014287", "0.69012105", "0.6900397", "0.68951064", "0.6893521", "0.68932164", "0.6891899", "0.6891616", "0.6891616", "0.6889246", "0.68880934", "0.6887128", "0.6884732", "0.68822503", "0.68809193", "0.6875949", "0.68739206", "0.68739134", "0.6870358", "0.6869779", "0.68696856", "0.686877" ]
0.0
-1
Store a newly created resource in storage.
public function store(Request $request) { // }
{ "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(keterlambatan $keterlambatan) { // }
{ "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(keterlambatan $keterlambatan) { // }
{ "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, keterlambatan $keterlambatan) { // }
{ "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(keterlambatan $keterlambatan) { // }
{ "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
Determine if the user is authorized to make this request.
public function authorize() { return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function authorize()\n {\n if ($this->user() !== null) {\n return true;\n }\n return false;\n }", "public function authorize()\n {\n return $this->user() !== null;\n }", "public function authorize()\n {\n return $this->user() !== null;\n }", "public function authorize()\n {\n return $this->user() != null;\n }", "public function authorize(): bool\n {\n return $this->user() !== null;\n }", "public function authorize(): bool\n {\n return $this->isUserAuthorised();\n }", "public function authorize()\n {\n return !is_null($this->user());\n }", "public function authorize()\n {\n return request()->user() != null;\n }", "public function authorize()\n\t{\n\t\t// if user is updating his profile or a user is an admin\n\t\tif( $this->user()->isSuperAdmin() || !$this->route('user') ){\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function authorize()\n {\n // this was my best guess\n return $this->user()->id === $this->route('user')->id;\n }", "public function isAuthorized()\n {\n return $this->cookieHelper->requestCookieExists('auth');\n }", "public function authorize()\n {\n return !empty(Auth::user()) && ($this->user()->isAnAdmin() || $this->user()->hasRole('user'));\n }", "public function authorize()\n {\n $originAccount = Account::find($this->get('origin_account_id'));\n return $originAccount->user_id == auth()->id();\n }", "public function authorize()\n {\n switch ($this->method()) {\n case 'GET':\n case 'POST':\n case 'PUT':\n case 'PATCH':\n case 'DELETE':\n default:\n return $this->user()->type == 'App\\\\Staff' ? true : false;\n break;\n }\n\n return false;\n }", "public function authorize()\n {\n if($this->user()->role == \"admin\" || $this->user()->id == $this->request->get('author_id')) return true;\n else return false;\n }", "public function authorize()\n {\n if(\\Auth::guest())\n {\n return false;\n } else {\n // Action 1 - Check if authenticated user is a superadmin\n if(\\Auth::User()->hasRole('superadmin'))\n return true;\n\n // Action 2 - Find UUID from request and compare to authenticated user\n $user = User::where('uuid', $this->user_uuid)->firstOrFail();\n if($user->id == \\Auth::User()->id)\n return true;\n\n // Action 3 - Fail request\n return false;\n }\n }", "public function authorize()\n {\n $this->model = $this->route('user');\n\n $this->model = is_null($this->model) ? User::class : $this->model;\n\n return $this->isAuthorized();\n }", "public function isAuthorized(): bool\n {\n // TODO: implement authorization check\n\n return true;\n }", "public function isAuthorized() {}", "public function authorize()\n {\n return request()->loggedin_role === 1;\n }", "public function authorize()\n {\n $this->model = $this->route('user');\n\n if ($this->isEdit() && !is_null($this->model)) {\n if (!user()->hasPermissionTo('Administrations::admin.user') && $this->model->id != user()->id) {\n return false;\n }\n }\n\n $this->model = is_null($this->model) ? User::class : $this->model;\n\n return $this->isAuthorized();\n }", "public function authorize()\n {\n $accessor = $this->user();\n\n return $accessor->isAdmin() || $accessor->hasKey('post-users');\n }", "public function authorize()\n {\n $user = \\Auth::getUser();\n\n return $user->user_type == 1;\n }", "public function authorize()\n {\n return auth()->check() ? true : false;\n }", "public function authorize()\n {\n return auth()->check() ? true : false;\n }", "public function authorize()\n {\n /**\n * @var User $user\n * @var Document $document\n */\n $user = Auth::user();\n $document = $this->route('document');\n\n return (int)$user->id === (int)$document->user_id;\n }", "public function authorize()\n {\n switch (true) {\n case $this->wantsToList():\n case $this->wantsToShow():\n if ($this->hasRoles(['owner', 'administrator'])) {\n return true;\n }\n break;\n case $this->wantsToStore():\n case $this->wantsToUpdate():\n case $this->wantsToDestroy():\n if ($this->hasRoles(['owner'])) {\n return true;\n }\n break;\n }\n\n return false;\n }", "public function authorize()\n {\n $user = JWTAuth::parseToken()->authenticate();\n $organisation = Organization::findOrFail($this->route('organizations'));\n return $organisation->admin_id == $user->id;\n }", "public function authorize()\n {\n if($this->user()->isAdmin())\n return true;\n\n return false;\n }", "function isAuthorized()\n {\n $authorized = parent::isAuthorized();\n return $authorized;\n }", "public function authorize()\n {\n $user = auth('web')->user();\n if ($user && $user->active) {\n return true;\n }\n\n return false;\n }", "public function authorize()\n {\n $this->user = User::query()->find($this->route()->parameter('user'));\n $this->merge(['verified' => $this->get('verified') ? 1 : 0]);\n\n return true;\n }", "public function authorize()\n {\n $user = request()->user('api');\n return $user->isSenior();\n }", "public function authorize()\n {\n return is_client_or_staff();\n }", "public function isAuthorized() {\n\t\treturn true;\n\t}", "public function authorize()\n {\n switch ($this->method()) {\n case 'POST':\n return true;\n case 'GET':\n default:\n {\n return false;\n }\n }\n }", "public function authorize()\n {\n switch ($this->method()) {\n case 'POST':\n return true;\n case 'GET':\n default:\n {\n return false;\n }\n }\n }", "public function authorize()\n {\n //Check if user is authorized to access this page\n if($this->user()->authorizeRoles(['admin'])) {\n return true;\n } else {\n return false;\n }\n }", "public function isAuthorized()\n\t{\n\t\t$sessionVal = Yii::$app->session->get($this->sessionParam);\n\t\treturn (!empty($sessionVal));\n\t}", "public function authorize() {\n\n return auth()->user() && auth()->user()->username === $this->user->username;\n }", "public function authorize()\n {\n return session('storefront_key') || request()->session()->has('api_credential');\n }", "public function authorize()\n {\n if ($this->user()->isAdmin($this->route('organization'))) {\n return true;\n }\n\n return false;\n\n }", "public function authorize()\n {\n return $this->user() && $this->user()->role === Constants::USER_ROLE_ADMIN;\n }", "public function authorized()\n {\n return $this->accepted && ! $this->test_mode;\n }", "public function authorize()\n {\n if (!auth()->check()) {\n return false;\n }\n return true;\n }", "public function hasAuthorized() {\n return $this->_has(1);\n }", "public function authorize()\n {\n $resource = Resource::find($this->route('id'));\n\n if (!$resource) {\n return true;\n }\n\n return $resource && $this->user()->can('access', $resource);\n }", "public function authorize()\n {\n /*\n if ($this->loan_id && is_numeric($this->loan_id) && $loan = Loan::whereId($this->loan_id)->first()) {\n // loan_id belongs to requesting user\n return $loan && $this->user()->id == $loan->user_id;\n }\n */\n return true; // let rules handle it\n }", "public function authorize()\n {\n //TODO Authorice Request (without Controller)\n return auth()->user()->role_id === 1;\n }", "public function authorize(): bool\n {\n return $this->user()->id === $this->article->user->id;\n }", "public function authorize()\n {\n return $this->user()->rol == 'admin' ? true : false;\n }", "public function isAuth()\n {\n return $this->session->hasAuthorisation();\n }", "public function authorize()\n {\n if(Auth::user())\n {\n return true;\n }\n else\n {\n return false;\n }\n }", "public function authorize()\n {\n //Check if user is authorized to access this page\n if($this->user()->authorizeRoles(['admin', 'hrmanager', 'hruser'])) {\n return true;\n } else {\n return false;\n }\n }", "public function authorize()\n {\n return \\Auth::check() ? true : false;\n }", "public function authorize()\n\t{\n\t\treturn true; //no user checking\n\t}", "public function authorize()\n {\n return $this->user()->id === $this->route('report')->user_id;\n }", "public function authorize()\n {\n return $this->user()->id === $this->route('report')->user_id;\n }", "public function authorize()\n {\n return !empty(Auth::user());\n }", "public function authorize()\n {\n return $this->groupHasUser() || $this->hasSeller();\n }", "public function authorize()\n\t{\n\t\t//@todo check with perissions\n\t\treturn (request()->user()->user_type == ADMIN_USER);\n\t}", "public function authorize()\n\t{\n\t\t//@todo check with perissions\n\t\treturn (request()->user()->user_type == ADMIN_USER);\n\t}", "public function isAuthorized() {\n\t\t\n\t}", "public function authorize()\n {\n if(Auth::check())\n {\n return (Auth::user()->has_world_admin_access);\n }\n return false;\n }", "public function authorize()\n {\n if (!\\Auth::guest()) {\n $user = \\Auth::getUser();\n if ($user->type == User::USER_TYPE_ADMIN) {\n return true;\n }\n }\n\n return false;\n }", "public function authorize()\n {\n if (auth()->user()->is_admin) {\n return true;\n }\n return false;\n }", "public function authorize()\n {\n if ($this->user()->is_admin){\n return true;\n }\n else if ($this->method == \"PUT\"){\n if ($this->user()->id == $this->input('id')){\n return true;\n }\n }\n return false;\n }", "public function authorize(): bool\n {\n return parent::authorize() && (int)$this->playList->user_id === auth()->user()->id;\n }", "public function authorize() {\n\t\treturn $this->user()->is_admin;\n\t}", "public function authorize()\n {\n if (Auth::check()) {\n \n return true;\n \n }\n return false;\n }", "public function authorize()\n {\n $user = Auth::user();\n return $user && $user->rol == 'admin';\n }", "public function authorize()\n\t{\n\t\t// Nutzern akzeptiert werden\n\t\tif(Auth::check())\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function authorize()\n {\n // TODO: Check if has business\n return session()->has('id');\n }", "public function authorize()\n {\n if (auth()->check() && auth()->user()->isAdmin()) {\n return true;\n }\n\n return false;\n }", "public function authorize()\n {\n return $this->auth->check();\n }", "public function authorize() {\n\t\t$user = \\Auth::user();\n\n\t\tif ( $user->isAdmin() ) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "public function authorize()\n {\n if (auth()->user()->isAdmin() || auth()->user()->isCustomer()) {\n return true;\n }\n return false;\n }", "public function authorize()\n {\n return $this->container['auth']->check();\n }", "function isAuthorized($request) {\n return true;\n }", "public function authorize()\n {\n return Auth::guest() || isMember();\n }", "public function authorize()\n {\n return auth()->user() && auth()->user()->isCeo();\n }", "public function authorize(): bool\n {\n $deckId = $this->request->get('deck_id');\n $userId = Deck::whereKey($deckId)->value('user_id');\n\n return $userId === user()->id;\n }", "public function authorize()\n {\n return Auth::check() && Auth::user()->is_contractor;\n }", "public function authorize()\n {\n return TRUE;\n }", "public function authorize()\n {\n $user = User::find($this->id);\n\n if (!$user) {\n $user = User::where('no_ahli', $this->no_ahli)->first();\n }\n if ($user && $user->id == auth()->user()->id) return true;\n if (auth()->user()->is('admin')) return true;\n\n return false;\n }", "public function authorize()\n {\n # if it's false, it will rejected\n return true;\n }", "public function authorize()\n {\n $isValid = auth()->user()->is($this->route('task')->attempt->checklist->owner);\n\n return $isValid;\n }", "public function authorize()\n {\n $user = Auth::user();\n\n return ($user->getRole() == 'admin');\n }", "public function is_authorized() {\n\t\t$authorized = true;\n\t\tif ( $this->is_access_token_expired() ) {\n\t\t\t$authorized = false;\n\t\t}\n\n\t\treturn $authorized;\n\t}", "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 $project = \\App\\Project::find($this->request->get('project'));\n return $project && $project->isManager($this->user()->name);\n }", "public function isAuthorized() {\n\t\treturn (bool)$this->_storage->hasData();\n\t}", "public function authorize()\n {\n $idExpense = $this->input('expense');\n $expense = Expense::find($idExpense);\n\n return $expense && $this->user()->id == $expense->user_id;\n }", "public function authorize()\n {\n // User system not implemented\n return true;\n }", "public function authorize() : bool\n {\n // TODO check request to xhr in middleware\n return true;\n }", "public function authorize()\n {\n $organizationId = (string) $this->route('id');\n\n $this->organization = Organization::findByUuidOrFail($organizationId);\n\n return $this->user()->can('show', [Organization::class, $this->organization]);\n }", "public function authorize()\n {\n $user = $this->findFromUrl('user');\n return $this->user()->can('update', $user);\n }", "public function authorize()\n {\n $user = Auth::user();\n $orderElement = OrderElement::find($this->input(\"order_element_id\"));\n $order = $orderElement->order;\n\n if ($user->id == $order->user_id) {\n return true;\n } else {\n return false;\n }\n }", "public function authorize()\n {\n $current_user = auth()->user();\n $convention = Convention::find($this->route('convention_id'));\n\n // Use ClientPolicy here to authorize before checking the fields\n return $current_user->can('store', Convention::class)\n || $current_user->can('update', $convention);\n }", "public function authorize()\n {\n if (session()->has('user'))\n {\n $participantController = new ParticipantController();\n\n return !$participantController->isParticipating($this->input('id_user'), $this->input('id_event'));\n }\n else\n {\n return false;\n }\n }", "public function authorize()\n {\n return (Auth::user()->allowSuperAdminAccess || Auth::user()->allowAdminAccess);\n }" ]
[ "0.8401071", "0.8377486", "0.8377486", "0.8344406", "0.8253731", "0.824795", "0.8213121", "0.8146598", "0.81115526", "0.8083369", "0.7991986", "0.79907674", "0.79836637", "0.79604936", "0.79516214", "0.79494005", "0.79265946", "0.7915068", "0.79001635", "0.7894822", "0.7891453", "0.7890965", "0.7862504", "0.78414804", "0.78414804", "0.7837965", "0.78248763", "0.7812292", "0.7809632", "0.77928597", "0.7788316", "0.7781619", "0.77815884", "0.7763308", "0.7754035", "0.7717961", "0.7717961", "0.77171147", "0.77138597", "0.7705001", "0.7693082", "0.7692783", "0.76915383", "0.76909506", "0.76733255", "0.7667128", "0.7665592", "0.7656238", "0.7650853", "0.764326", "0.76431626", "0.76431614", "0.7635147", "0.76311624", "0.76294273", "0.7627076", "0.76207024", "0.76207024", "0.76139116", "0.76036394", "0.76035625", "0.76035625", "0.76032084", "0.7602515", "0.76007926", "0.75971127", "0.7588128", "0.7586303", "0.7581912", "0.7563037", "0.7554785", "0.75526226", "0.755171", "0.75436753", "0.75432944", "0.7540682", "0.7538806", "0.75280696", "0.751548", "0.75149626", "0.7501161", "0.74959517", "0.74956346", "0.74911124", "0.7489147", "0.74858016", "0.748033", "0.7478443", "0.7472642", "0.7472576", "0.7465409", "0.7464371", "0.74630046", "0.7462218", "0.7461453", "0.7449168", "0.74399257", "0.74358094", "0.7433247", "0.7432659", "0.74248093" ]
0.0
-1
Get the validation rules that apply to the request.
public function rules() { return [ 'name' => [ 'required_without_all:about,location', 'nullable', 'string', new AlphaNumSpace(), 'max:30' ], 'about' => 'required_without_all:name,location|nullable|string|max:150', 'location' => 'required_without_all:name,about|nullable|string|max:50', ]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function rules()\n {\n $commons = [\n\n ];\n return get_request_rules($this, $commons);\n }", "public function getRules()\n {\n return $this->validator->getRules();\n }", "public function getValidationRules()\n {\n $rules = [];\n\n // Get the schema\n $schema = $this->getSchema();\n\n return $schema->getRules($this);\n }", "public function rules()\n {\n return $this->validationRules;\n }", "public function rules()\n {\n $rules = [];\n switch ($this->getMethod()):\n case \"POST\":\n $rules = [\n 'course_id' => 'required|numeric',\n 'questions' => 'required|array',\n ];\n break;\n case \"PUT\":\n $rules = [\n 'id' => 'required|numeric',\n 'course_id' => 'required|numeric',\n 'questions' => 'required|array',\n ];\n break;\n case \"DELETE\":\n $rules = [\n 'id' => 'required|numeric'\n ];\n break;\n endswitch;\n return $rules;\n }", "public static function getRules()\n {\n return (new static)->getValidationRules();\n }", "public function getRules()\n {\n return $this->validation_rules;\n }", "public function getValidationRules()\n {\n return [];\n }", "public function getValidationRules() {\n return [\n 'email' => 'required|email',\n 'name' => 'required|min:3',\n 'password' => 'required',\n ];\n }", "public function rules()\n {\n if($this->isMethod('post')){\n return $this->post_rules();\n }\n if($this->isMethod('put')){\n return $this->put_rules();\n }\n }", "public function rules()\n {\n $rules = [];\n\n // Validation request for stripe keys for stripe if stripe status in active\n if($this->has('stripe_status')){\n $rules[\"api_key\"] = \"required\";\n $rules[\"api_secret\"] = \"required\";\n $rules[\"webhook_key\"] = \"required\";\n }\n\n if($this->has('razorpay_status')){\n $rules[\"razorpay_key\"] = \"required\";\n $rules[\"razorpay_secret\"] = \"required\";\n $rules[\"razorpay_webhook_secret\"] = \"required\";\n }\n\n // Validation request for paypal keys for paypal if paypal status in active\n if($this->has('paypal_status')){\n $rules[\"paypal_client_id\"] = \"required\";\n $rules[\"paypal_secret\"] = \"required\";\n $rules[\"paypal_mode\"] = \"required_if:paypal_status,on|in:sandbox,live\";\n }\n\n\n return $rules;\n }", "protected function getValidationRules()\n {\n $rules = [\n 'title' => 'required|min:3|max:255',\n ];\n\n return $rules;\n }", "public function getRules()\n\t{\n\t\t$rules['user_id'] = ['required', 'exists:' . app()->make(User::class)->getTable() . ',id'];\n\t\t$rules['org_id'] = ['required', 'exists:' . app()->make(Org::class)->getTable() . ',id'];\n\t\t$rules['role'] = ['required', 'string', 'in:' . implode(',', Static::ROLES)];\n\t\t$rules['scopes'] = ['nullable', 'array'];\n\t\t$rules['ended_at'] = ['nullable', 'date'];\n\t\t$rules['photo_url'] = ['nullable', 'string'];\n\n\t\treturn $rules;\n\t}", "public function rules()\n {\n switch ($this->method()) {\n case 'POST':\n return [\n 'username' => 'required|max:255',\n 'user_id' => 'required',\n 'mobile' => 'required|regex:/^1[34578][0-9]{9}$/',\n 'birthday' => 'required',\n 'cycle_id' => 'required',\n 'expired_at' => 'required',\n 'card_price' => 'required',\n ];\n case 'PUT':\n return [\n 'username' => 'required|max:255',\n 'user_id' => 'required',\n 'mobile' => 'required|regex:/^1[34578][0-9]{9}$/',\n 'birthday' => 'required',\n 'cycle_id' => 'required',\n 'expired_at' => 'required',\n 'card_price' => 'required',\n ];\n }\n }", "public function rules()\n {\n\n switch ($this->method()) {\n case 'GET':\n case 'POST':\n $rules = [\n 'name' => 'required|max:255',\n 'email' => 'required|email|max:255|unique:users',\n 'password' => 'required|min:6|confirmed',\n 'password_confirmation' => 'min:6|same:password',\n 'role_id' => 'required'\n ];\n break;\n case 'PUT':\n case 'PATCH':\n $rules = [\n 'name' => 'required|max:255',\n 'email' => 'required|email|max:255|unique:users,email,'.$this->id,\n ];\n break;\n\n default:\n $rules = [\n 'name' => 'required|max:255',\n 'email' => 'required|email|max:255|unique:users,email,'.$this->id,\n ];\n break;\n }\n return $rules;\n }", "public function rules()\n {\n return $this->rules;\n }", "public function rules()\n {\n return $this->rules;\n }", "public function rules()\n {\n return $this->rules;\n }", "public function rules()\n {\n return $this->rules;\n }", "public function rules()\n {\n return $this->rules;\n }", "public function rules()\n {\n return $this->rules;\n }", "public function rules()\n {\n switch($this->method()) {\n case 'GET':\n return [];\n case 'POST':\n return [\n 'name' => 'required|max:50',\n 'company' => 'required|max:100',\n 'position' => 'required|max:50',\n 'email' => 'required|email|max:150',\n 'phone' => 'required|max:25',\n 'description' => 'nullable|max:500',\n ];\n case 'PUT':\n case 'PATCH':\n return [\n 'name' => 'required|max:50',\n 'company' => 'required|max:100',\n 'position' => 'required|max:50',\n 'email' => 'required|email|max:150',\n 'phone' => 'required|max:25',\n 'description' => 'nullable|max:500',\n ];\n case 'DELETE':\n return [];\n default:break;\n }\n \n }", "public function rules($request) {\n $function = explode(\"@\", $request->route()[1]['uses'])[1];\n return $this->getRouteValidateRule($this->rules, $function);\n // // 获取请求验证的函数名\n // // ltrim(strstr($a,'@'),'@')\n // if (count(explode(\"@\", Request::route()->getActionName())) >= 2) {\n // $actionFunctionName = explode(\"@\", Request::route()->getActionName()) [1];\n // }\n\n // // 取配置并返回\n // if (isset($this->rules[$actionFunctionName])) {\n // if (is_array($this->rules[$actionFunctionName])) {\n // return $this->rules[$actionFunctionName];\n // }\n // else {\n // return $this->rules[$this->rules[$actionFunctionName]];\n // }\n // }\n // else {\n // return [];\n // }\n }", "function getValidationRules() {\n\t\treturn array(\n\t\t\t'_MovieID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_UserID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_CountryID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_BroadCastDate' => array(\n\t\t\t\t'dateTime' => array(),\n\t\t\t),\n\t\t\t'_CreatedDate' => array(\n\t\t\t\t'dateTime' => array(),\n\t\t\t),\n\t\t);\n\t}", "public function rules()\n {\n if ($this->method() === 'POST') {\n return $this->rulesForCreating();\n }\n\n return $this->rulesForUpdating();\n }", "public function rules()\n {\n $validation = [];\n if ($this->method() == \"POST\") {\n $validation = [\n 'name' => 'required|unique:users',\n 'email' => 'required|unique:users|email',\n 'password' => 'required|min:6|confirmed',\n 'password_confirmation' => 'required|min:6',\n 'roles' => 'required',\n ];\n } elseif ($this->method() == \"PUT\") {\n $validation = [\n 'name' => 'required|unique:users,name,' . $this->route()->parameter('id') . ',id',\n 'email' => 'required|unique:users,email,' . $this->route()->parameter('id') . ',id|email',\n 'roles' => 'required',\n ];\n\n if ($this->request->get('change_password') == true) {\n $validation['password'] = 'required|min:6|confirmed';\n $validation['password_confirmation'] = 'required|min:6';\n }\n }\n\n return $validation;\n }", "protected function getValidationRules()\n {\n $class = $this->model;\n\n return $class::$rules;\n }", "public function rules()\n {\n $data = $this->request->all();\n $rules['username'] = 'required|email';\n $rules['password'] = 'required'; \n\n return $rules;\n }", "public function rules()\n {\n $rules = $this->rules;\n\n $rules['fee'] = 'required|integer';\n $rules['phone'] = 'required|min:8|max:20';\n $rules['facebook'] = 'required|url';\n $rules['youtube'] = 'required|url';\n $rules['web'] = 'url';\n\n $rules['requestgender'] = 'required';\n $rules['serviceaddress'] = 'required|max:150';\n $rules['servicetime'] = 'required|max:150';\n $rules['language'] = 'required|max:150';\n $rules['bust'] = 'required|max:100|integer';\n $rules['waistline'] = 'required|max:100|integer';\n $rules['hips'] = 'required|max:100|integer';\n $rules['motto'] = 'max:50';\n\n return $rules;\n }", "protected function getValidRules()\n {\n return $this->validRules;\n }", "public function rules()\n {\n switch($this->method())\n {\n case 'GET':\n case 'DELETE':\n {\n return [];\n }\n case 'POST':\n case 'PUT':\n {\n return [\n 'name' => 'required',\n ];\n }\n default:break;\n }\n }", "public function rules()\n {\n switch ($this->method()) {\n case 'GET':\n case 'POST':\n {\n return [\n 'mobile' => ['required','max:11','min:11'],\n 'code' => ['required','max:6','min:6'],\n 'avatar' => ['required'],\n 'wx_oauth' => ['required'],\n 'password' => ['nullable','min:6','max:20']\n ];\n }\n case 'PUT':\n case 'PATCH':\n case 'DELETE':\n default: {\n return [];\n }\n }\n }", "public function rules()\n {\n switch ($this->getRequestMethod()) {\n case 'index':\n return [\n 'full_name' => 'nullable|string',\n 'phone' => 'nullable|string',\n ];\n break;\n case 'store':\n return [\n 'crm_resource_id' => 'required|exists:crm_resources,id',\n 'channel' => 'required|in:' . get_validate_in_string(CrmResourceCallLog::$channel),\n 'call_status' => 'required|in:' . get_validate_in_string(CrmResourceCallLog::$call_statuses),\n ];\n break;\n default:\n return [];\n break;\n }\n }", "public function rules()\n {\n //With password\n if(request('password') || request('password_confirmation')) {\n return array_merge($this->passwordRules(), $this->defaultRules());\n }\n //Without password\n return $this->defaultRules();\n }", "public function rules()\n {\n $rules = [\n '_token' => 'required'\n ];\n\n foreach($this->request->get('emails') as $key => $val) {\n $rules['emails.'.$key] = 'required|email';\n }\n\n return $rules;\n }", "function getValidationRules() {\n\t\treturn array(\n\t\t\t'_ID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_CoverImageID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_TrackID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_Status' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_Rank' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_CreateDate' => array(\n\t\t\t\t'dateTime' => array(),\n\t\t\t),\n\t\t);\n\t}", "public function rules()\n { \n return $this->rules;\n }", "public function getValidationRules()\n {\n if (method_exists($this, 'rules')) {\n return $this->rules();\n }\n\n $table = $this->getTable();\n $cacheKey = 'validate.' . $table;\n\n if (config('validate.cache') && Cache::has($cacheKey)) {\n return Cache::get($cacheKey);\n }\n\n // Get table info for model and generate rules\n $manager = DB::connection()->getDoctrineSchemaManager();\n $details = $manager->listTableDetails($table);\n $foreignKeys = $manager->listTableForeignKeys($table);\n\n $this->generateRules($details, $foreignKeys);\n\n if (config('validate.cache')) {\n Cache::forever($cacheKey, $this->rules);\n }\n\n return $this->rules;\n }", "public function getValidationRules()\n {\n $rules = $this->getBasicValidationRules();\n\n if (in_array($this->type, ['char', 'string', 'text', 'enum'])) {\n $rules[] = 'string';\n if (in_array($this->type, ['char', 'string']) && isset($this->arguments[0])) {\n $rules[] = 'max:' . $this->arguments[0];\n }\n } elseif (in_array($this->type, ['timestamp', 'date', 'dateTime', 'dateTimeTz'])) {\n $rules[] = 'date';\n } elseif (str_contains(strtolower($this->type), 'integer')) {\n $rules[] = 'integer';\n } elseif (str_contains(strtolower($this->type), 'decimal')) {\n $rules[] = 'numeric';\n } elseif (in_array($this->type, ['boolean'])) {\n $rules[] = 'boolean';\n } elseif ($this->type == 'enum' && count($this->arguments)) {\n $rules[] = 'in:' . join(',', $this->arguments);\n }\n\n return [$this->name => join('|', $rules)];\n }", "public function rules()\n {\n $rules = [];\n if ($this->isMethod('post')) {\n $rules = [\n 'vacancy_name' => 'required|string|min:4|max:20',\n 'workers_amount' => 'required|integer|min:1|max:10',\n 'organization_id'=> 'required|integer|exists:organizations,id',\n 'salary' => 'required|integer|min:1|max:10000000',\n ];\n } elseif ($this->isMethod('put')) {\n $rules = [\n 'vacancy_name' => 'required|string|min:4|max:20',\n 'workers_amount' => 'required|integer|min:1|max:10',\n 'organization_id'=> 'required|integer|exists:organizations,id',\n 'salary' => 'required|integer|min:1|max:10000000',\n ];\n }\n return $rules;\n }", "public function validationRules()\n {\n return [];\n }", "public function rules()\n {\n $rules = $this->rules;\n if(Request::isMethod('PATCH')){\n $rules['mg_name'] = 'required|min:2,max:16';\n }\n return $rules;\n }", "function getValidationRules() {\n\t\treturn array(\n\t\t\t'_ID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_EventID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_SourceID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_UserID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_HasEvent' => array(\n\t\t\t\t'inArray' => array('values' => array(self::HASEVENT_0, self::HASEVENT_1),),\n\t\t\t),\n\t\t);\n\t}", "public function rules()\n {\n $rules = [];\n switch ($this->method()){\n case 'GET':\n $rules['mobile'] = ['required', 'regex:/^1[3456789]\\d{9}$/'];\n break;\n case 'POST':\n if($this->route()->getActionMethod() == 'sms') {\n $rules['area_code'] = ['digits_between:1,6'];\n if(in_array($this->get('type'), ['signup', 'reset_pay_pwd'])) {\n $rules['mobile'] = ['required', 'digits_between:5,20'];\n if($this->get('type') == 'signup' && !$this->get('area_code')) {\n $this->error('请选择区号');\n }\n }\n $rules['type'] = ['required', Rule::in(\\App\\Models\\Captcha::getSmsType())];\n }\n break;\n }\n return $rules;\n }", "public function rules()\n {\n if ($this->isMethod('post')) {\n return $this->createRules();\n } elseif ($this->isMethod('put')) {\n return $this->updateRules();\n }\n }", "public function rules()\n {\n $rules = [\n 'first_name' => ['required'],\n 'birthdate' => ['required', 'date', 'before:today'],\n ];\n\n if (is_international_session()) {\n $rules['email'] = ['required', 'email'];\n }\n\n if (should_collect_international_phone()) {\n $rules['phone'] = ['phone'];\n }\n\n if (is_domestic_session()) {\n $rules['phone'] = ['required', 'phone'];\n }\n\n return $rules;\n }", "public function rules()\n {\n dd($this->request->get('answer'));\n foreach ($this->request->get('answer') as $key => $val)\n {\n $rules['answer.'.$key] = 'required';\n }\n\n return $rules;\n }", "public function rules()\n {\n return static::$rules;\n }", "function getRules() {\n\t\t$fields = $this->getFields();\n\t\t$allRules = array();\n\n\t\tforeach ($fields as $field) {\n\t\t\t$fieldRules = $field->getValidationRules();\n\t\t\t$allRules[$field->getName()] = $fieldRules;\n\t\t}\n\n\t\treturn $allRules;\n\t}", "public static function getValidationRules(): array\n {\n return [\n 'name' => 'required|string|min:1|max:255',\n 'version' => 'required|float',\n 'type' => 'required|string',\n ];\n }", "public function rules()\n {\n $rules = [\n 'name' => 'required',\n 'phone' => 'required|numeric',\n 'subject' => 'required',\n 'message' => 'required',\n 'email' => 'required|email',\n ];\n\n return $rules;\n }", "public function getValidationRules(): array\n {\n return [\n 'email_address' => 'required|email',\n 'email_type' => 'nullable|in:html,text',\n 'status' => 'required|in:subscribed,unsubscribed,cleaned,pending',\n 'merge_fields' => 'nullable|array',\n 'interests' => 'nullable|array',\n 'language' => 'nullable|string',\n 'vip' => 'nullable|boolean',\n 'location' => 'nullable|array',\n 'location.latitude' => ['regex:/^[-]?(([0-8]?[0-9])\\.(\\d+))|(90(\\.0+)?)$/'], \n 'location.longitude' => ['regex:/^[-]?((((1[0-7][0-9])|([0-9]?[0-9]))\\.(\\d+))|180(\\.0+)?)$/'],\n 'marketing_permissions' => 'nullable|array',\n 'tags' => 'nullable|array'\n ];\n }", "protected function getValidationRules()\n {\n return [\n 'first_name' => 'required|max:255',\n 'last_name' => 'required|max:255',\n 'email' => 'required|email|max:255',\n 'new_password' => 'required_with:current_password|confirmed|regex:' . config('security.password_policy'),\n ];\n }", "public function rules()\n {\n // get 直接放行\n if( request()->isMethod('get') ){\n return []; // 规则为空\n }\n\n // 只在post的时候做验证\n return [\n 'username' => 'required|min:2|max:10', \n 'password' => 'required|min:2|max:10', \n 'email' => 'required|min:2|max:10|email', \n 'phoneNumber' => 'required|min:2|max:10', \n\n ];\n }", "public function rules()\n {\n\n $rules = [\n 'id_tecnico_mantenimiento' => 'required',\n 'id_equipo_mantenimiento' => 'required'\n ];\n\n if ($this->request->has('status')) {\n $rules['status'] = 'required';\n }\n\n if ($this->request->has('log_mantenimiento')) {\n $rules['log_mantenimiento'] = 'required';\n }\n\n return $rules;\n }", "public function rules()\n {\n $this->buildRules();\n return $this->rules;\n }", "public function rules()\n {\n $rules = [];\n\n if ($this->isUpdate() || $this->isStore()) {\n $rules = array_merge($rules, [\n 'name' => 'required|string',\n 'email' => 'email',\n 'password' => 'confirmed|min:6',\n\n ]);\n }\n\n if ($this->isStore()) {\n $rules = array_merge($rules, [\n\n ]);\n }\n\n if ($this->isUpdate()) {\n $rules = array_merge($rules, [\n ]);\n }\n\n return $rules;\n }", "public function rules()\n {\n switch (true) {\n case $this->wantsToList():\n $rules = $this->listRules;\n break;\n case $this->wantsToStore():\n $rules = $this->storeRules;\n break;\n case $this->wantsToUpdate():\n $this->storeRules['email'] = 'required|email|between:5,100|unique:users,email,' . $this->route('administrators');\n\n $rules = $this->storeRules;\n break;\n default:\n $rules = [];\n }\n\n return $rules;\n }", "public function rules()\n {\n if($this->isMethod('post')) {\n return $this->storeRules();\n }\n else if($this->isMethod('put') || $this->isMethod('patch')){\n return $this->updateRules();\n }\n }", "abstract protected function getValidationRules();", "public function rules()\n\t{\n\t\treturn ModelHelper::getRules($this);\n\t}", "public function rules()\n {\n switch ($this->method()) {\n case 'POST':\n return $this->getPostRules();\n case 'PUT':\n return $this->getPutRules();\n }\n }", "public function rules()\n {\n $rules = [\n 'name' => 'required|string|min:2',\n 'email' => \"required|email|unique:users,email, {$this->request->get('user_id')}\",\n 'role_id' => 'required|numeric',\n 'group_id' => 'required|numeric',\n ];\n\n if ($this->request->has('password')){\n $rules['password'] = 'required|min:6';\n }\n\n return $rules;\n }", "public function rules()\n {\n if($this->method() == 'POST')\n {\n return [\n 'reason'=>'required',\n 'date_from'=>'required',\n 'date_to'=>'required',\n 'attachment'=>'required',\n ];\n }\n }", "public function rules()\n {\n $method = $this->method();\n if ($this->get('_method', null) !== null) {\n $method = $this->get('_method');\n }\n // $this->offsetUnset('_method');\n switch ($method) {\n case 'DELETE':\n case 'GET':\n break; \n case 'POST':\n $mailRules = \\Config::get('database.default').'.users';\n break;\n case 'PUT':\n $user = $this->authService->authJWTUserForm();\n $mailRules = \\Config::get('database.default').'.users,email,'.$user->getKey();\n break;\n case 'PATCH':\n break;\n default:\n break;\n }\n \n return [\n 'name' => 'required|string|max:256',\n 'email' => 'required|string|email|max:255|unique:'.$mailRules,\n 'password' => 'required|string|min:3',\n ];\n }", "public function rules() {\n $rule = [\n 'value' => 'bail|required',\n ];\n if ($this->getMethod() == 'POST') {\n $rule += ['type' => 'bail|required'];\n }\n return $rule;\n }", "public function rules()\n {\n switch ($this->method()) {\n case 'GET':\n case 'DELETE': {\n return [];\n }\n case 'POST': {\n return [\n 'from' => 'required|max:100',\n 'to' => 'required|max:500',\n 'day' => 'required|max:500',\n ];\n }\n case 'PUT':\n case 'PATCH': {\n return [\n 'from' => 'required|max:100',\n 'to' => 'required|max:500',\n 'day' => 'required|max:500',\n ];\n }\n default:\n break;\n }\n\n return [\n //\n ];\n }", "public function rules()\n {\n switch ($this->method()) {\n case 'GET':\n case 'DELETE': {\n return [];\n }\n case 'POST':\n case 'PUT':\n case 'PATCH': {\n return [\n 'name' => 'required|string|max:255',\n 'iso_code_2' => 'required|string|size:2',\n 'iso_code_3' => 'required|string|size:3',\n ];\n }\n default:\n return [];\n }\n }", "public function rules()\n {\n switch ($this->method()) {\n case 'GET':\n case 'DELETE':\n return [];\n case 'POST':\n return [\n 'name' => 'required|string',\n 'lastName' => 'string',\n 'gender' => 'boolean',\n 'avatar' => 'sometimes|mimes:jpg,png,jpeg|max:3048'\n ];\n case 'PUT':\n case 'PATCH':\n return [\n 'oldPassword' => 'required|string',\n 'newPassword' => 'required|string',\n ];\n default:\n break;\n }\n }", "public function rules()\n {\n switch ($this->method()) {\n case 'GET':\n case 'DELETE':\n {\n return [\n 'validation' => [\n 'accepted'\n ]\n ];\n }\n case 'POST':\n {\n return [\n 'title' => [\n 'required',\n 'string',\n 'min:3',\n 'max:250'\n ],\n 'body' => [\n 'required',\n 'string',\n 'min:3',\n 'max:250000'\n ],\n 'online' => [\n 'required',\n ],\n 'indexable' => [\n 'required',\n ],\n 'published_at' => [\n 'required',\n ],\n 'published_at_time' => [\n 'required',\n ],\n 'unpublished_at' => [\n 'nullable',\n ],\n 'unpublished_time' => [\n 'nullable',\n ],\n ];\n }\n case 'PUT':\n {\n return [\n 'title' => [\n 'required',\n 'string',\n 'min:3',\n 'max:250'\n ],\n 'body' => [\n 'required',\n 'string',\n 'min:3',\n 'max:250000'\n ],\n 'online' => [\n 'required',\n ],\n 'indexable' => [\n 'required',\n ],\n 'published_at' => [\n 'required',\n ],\n 'unpublished_at' => [\n 'nullable',\n ],\n ];\n }\n case 'PATCH':\n {\n return [];\n }\n default:\n break;\n }\n }", "public function rules()\n {\n if (in_array($this->method(), ['PUT', 'PATCH'])) {\n $user = User::findOrFail(\\Request::input('id'))->first();\n\n array_forget($this->rules, 'email');\n $this->rules = array_add($this->rules, 'email', 'required|email|max:255|unique:users,email,' . $user->id);\n }\n\n return $this->rules;\n }", "public function rules()\n {\n $method = explode('@', $this->route()->getActionName())[1];\n return $this->get_rules_arr($method);\n }", "public function rules()\n {\n $rules = parent::rules();\n $extra_rules = [];\n $rules = array_merge($rules, $extra_rules);\n return $rules;\n }", "public function rules()\n {\n\t\tswitch($this->method()) {\n\t\t\tcase 'POST':\n\t\t\t\t{\n\t\t\t\t\treturn [\n\t\t\t\t\t\t'field_id' => 'integer|required',\n\t\t\t\t\t\t'label' => 'string|required',\n\t\t\t\t\t\t'value' => 'alpha_dash|required',\n\t\t\t\t\t\t'selected' => 'boolean',\n\t\t\t\t\t\t'actif' => 'boolean',\n\t\t\t\t\t];\n\t\t\t\t}\n\t\t\tcase 'PUT':\n\t\t\t\t{\n\t\t\t\t\treturn [\n\t\t\t\t\t\t'field_id' => 'integer|required',\n\t\t\t\t\t\t'label' => 'string|required',\n\t\t\t\t\t\t'value' => 'alpha_dash|required',\n\t\t\t\t\t\t'selected' => 'boolean',\n\t\t\t\t\t\t'actif' => 'boolean',\n\t\t\t\t\t];\n\t\t\t\t}\n\t\t\tdefault:break;\n\t\t}\n }", "public function rules()\n {\n $this->sanitize();\n return [\n 'event_id' => 'required',\n 'member_id' => 'required',\n 'guild_pts' => 'required',\n 'position' => 'required',\n 'solo_pts' => 'required',\n 'league_id' => 'required',\n 'solo_rank' => 'required',\n 'global_rank' => 'required',\n ];\n }", "public function rules()\n {\n $this->rules['email'] = ['required', 'min:6', 'max:60', 'email'];\n $this->rules['password'] = ['required', 'min:6', 'max:60'];\n\n return $this->rules;\n }", "public function getValidatorRules()\n {\n if ($validator = $this->getValidator()) {\n return $validator->getRulesForField($this->owner);\n }\n \n return [];\n }", "public function getValidationRules() : array;", "public function rules()\n {\n switch ($this->route()->getActionMethod()) {\n case 'login': {\n if ($this->request->has('access_token')) {\n return [\n 'access_token' => 'required',\n 'driver' => 'required|in:facebook,github,google',\n ];\n }\n return [\n 'email' => 'required|email',\n 'password' => 'required|min:6',\n ];\n }\n case 'register': {\n return [\n 'email' => 'required|email|unique:users,email',\n 'password' => 'required|min:6',\n 'name' => 'required',\n ];\n }\n default: return [];\n }\n }", "public function rules()\n {\n Validator::extend('mail_address_available', function($attribute, $value, $parameters, $validator){\n return MailAddressSpec::isAvailable($value);\n });\n Validator::extend('password_available', function($attribute, $value, $parameters, $validator){\n return PassWordSpec::isAvailable($value);\n });\n\n return [\n 'mail_address' => [\n 'required',\n 'mail_address_available'\n ],\n 'password' => [\n 'required',\n 'password_available',\n ],\n ];\n }", "public function rules()\n {\n switch (strtolower($this->method())) {\n case 'get':\n return $this->getMethodRules();\n case 'post':\n return $this->postMethodRules();\n case 'put':\n return $this->putMethodRules();\n case 'patch':\n return $this->patchMethodRules();\n case 'delete':\n return $this->deleteMethodRules();\n }\n }", "public function rules()\n {\n /**\n * This is the original way, expecting post params for each user value\n */\n return [\n 'firstName' => 'required|min:2|max:255',\n 'lastName' => 'required|min:2|max:255',\n 'phone' => 'min:9|max:25',\n 'gender' => 'in:M,V',\n 'dateOfBirth' => 'before:today|after:1890-01-01',\n 'email' => 'email|min:12|max:255',\n ];\n }", "public function getValidationRules(): array {\n\t\t$result = [];\n\t\t\n\t\tforeach ($this->getSections() as $section) {\n\t\t\t$result = array_merge($result, $section->getValidationRules());\n\t\t}\n\t\t\n\t\treturn $result;\n\t}", "public function rules()\n\t{\n\t\t$rule = [];\n\t\tif(Request::path() == 'api/utility/upload-image'){\n\t\t\t$rule = [\n\t\t\t\t'imagePath' => 'required',\n\t\t\t];\n\t\t}else if(Request::path() == 'api/utility/check-transaction'){\n\t\t\t$rule = [\n\t\t\t\t'countNumber' => 'required',\n\t\t\t];\n\t\t}\n\t\treturn $rule;\n\t}", "public function rules()\n {\n $rules = array();\n return $rules;\n }", "public function rules()\n {\n $this->setValidator($this->operation_type);\n return $this->validator;\n }", "public function rules()\n {\n switch($this->method()){\n case 'POST':\n return [\n 'name' => 'required',\n 'app_id' => 'required',\n 'account_id' => 'required',\n 'start_at' => 'required',\n 'end_at' => 'required',\n 'content' => 'required',\n ];\n break;\n default:\n return [];\n break;\n }\n\n }", "protected function get_validation_rules()\n {\n }", "public function rules()\n {\n $rules = [\n 'users' => 'required|array',\n ];\n\n foreach($this->request->get('users') as $key => $user) {\n $rules['users.'. $key . '.name'] = 'required|string|min:3|max:255';\n $rules['users.'. $key . '.phone'] = 'required|regex:/^[0-9\\+\\s]+$/|min:10|max:17';\n $rules['users.'. $key . '.country'] = 'required|string|min:2:max:3';\n }\n\n return $rules;\n }", "public function rules()\n {\n $rules = [\n 'mail_driver' => 'required',\n 'mail_name' => 'required',\n 'mail_email' => 'required',\n ];\n\n $newRules = [];\n\n if($this->mail_driver == 'smtp') {\n $newRules = [\n 'mail_host' => 'required',\n 'mail_port' => 'required|numeric',\n 'mail_username' => 'required',\n 'mail_password' => 'required',\n 'mail_encryption' => 'required',\n ];\n }\n\n return array_merge($rules, $newRules);\n }", "public function rules()\n {\n $rules['name'] = 'required';\n $rules['poa'] = 'required';\n $rules['background'] = 'required';\n $rules['tester_name'] = 'required';\n $rules['location'] = 'required';\n $rules['end_recruit_date'] = 'required';\n $rules['time_taken'] = 'required';\n $rules['payment'] = 'required';\n $rules['objective'] = 'required';\n $rules['method_desc'] = 'required';\n $rules['health_condition'] = 'required';\n $rules['required_applicant'] = 'required|integer';\n $rules['applicant'] = 'nullable';\n $rules['datetime'] = 'required';\n\n return $rules;\n }", "public function rules()\n {\n switch($this->method()) {\n\n case 'PUT':\n {\n return [\n 'company_name' => 'required',\n 'status' => 'required|integer',\n 'notify_url' => 'required',\n 'name' => 'required'\n ];\n }\n case 'POST':\n {\n return [\n 'company_name' => 'required',\n 'status' => 'required|integer',\n 'notify_url' => 'required',\n 'name' => 'required'\n ];\n }\n default:\n return [];\n }\n\n }", "public function rules()\n {\n $rules['name'] = 'required';\n $rules['poa'] = 'required';\n $rules['background'] = 'required';\n $rules['tester_name'] = 'required';\n\n return $rules;\n }", "public function rules()\n {\n switch(Route::currentRouteName()){\n case 'adminBinding' :\n return [\n 'order_id' => 'required|integer',\n 'money' => 'required|numeric',\n ];\n case 'adminUnbinding' :\n return [\n 'order_id' => 'required|integer',\n 'pivot_id' => 'required|integer',\n ];\n case 'adminReceiptSave' :\n case 'adminReceiptUpdate' :\n return [\n 'customer_id' => 'required',\n 'receiptcorp' => 'required',\n 'account' => 'required',\n 'account_id' => 'required',\n 'bank' => 'required',\n 'currency_id' => 'required',\n 'advance_amount' => 'required|numeric',\n 'picture' => 'required',\n 'business_type' => 'required|in:1,2,3,4,5',\n 'exchange_type' => 'required_unless:currency_id,354|in:1,2',\n 'expected_received_at' => 'required|date_format:Y-m-d',\n ];\n case 'adminReceiptExchange' :\n return [\n 'rate' => 'required|numeric',\n ];\n default :\n return [];\n }\n }", "public function rules()\n {\n $rules = [];\n $method = $this->getMethod();\n switch ($method) {\n case 'GET':\n if (Route::currentRouteName() === 'schoolActivity.getSchoolActivity') {\n $rules = [\n ];\n }\n break;\n }\n return $rules;\n }", "public function rules()\n {\n $rules = new Collection();\n\n if (!$this->user() or !$this->user()->addresses()->count()) {\n $rules = $rules->merge($this->addressRules('billing'));\n if ($this->has('different_shipping_address')) {\n $rules = $rules->merge($this->addressRules('shipping'));\n }\n\n return $rules->toArray();\n }\n\n return $rules->merge([\n 'billing_address_id' => 'required|numeric',\n 'shipping_address_id' => 'required|numeric',\n ])->toArray();\n }", "public function rules(): array\n {\n switch ($this->method()) {\n case 'POST':\n return $this->__rules() + $this->__post();\n case 'PUT':\n return $this->__rules() + $this->__put();\n default:\n return [];\n }\n }", "public function defineValidationRules()\n {\n return [];\n }", "public function rules(Request $request)\n {\n return Qc::$rules;\n }", "public function rules()\n {\n switch ($this->method()) {\n case 'POST':\n return [\n 'user_name' => 'nullable|string',\n 'excel' => 'nullable|file|mimes:xlsx',\n 'category' => 'required|int|in:' . implode(',', array_keys(UserMessage::$categories)),\n 'content' => 'required|string|max:500',\n 'member_status' => 'required|int|in:' . implode(',', array_keys(User::$statuses)),\n ];\n break;\n }\n }", "public function rules()\n {\n return [\n 'lead_id' => [\n 'required', 'string',\n ],\n 'api_version' => [\n 'required', 'string',\n ],\n 'form_id' => [\n 'required', 'int',\n ],\n 'campaign_id' => [\n 'required', 'int',\n ],\n 'google_key' => [\n 'required', 'string', new GoogleKeyRule,\n ],\n ];\n }" ]
[ "0.8342703", "0.80143493", "0.7937251", "0.79264987", "0.79233825", "0.79048395", "0.78603816", "0.7790699", "0.77842164", "0.77628785", "0.7737272", "0.7733618", "0.7710535", "0.7691693", "0.76849866", "0.7683038", "0.7683038", "0.7683038", "0.7683038", "0.7683038", "0.7683038", "0.7675849", "0.76724476", "0.76665044", "0.7657698", "0.7641827", "0.7630892", "0.76293766", "0.7617708", "0.76102096", "0.7607475", "0.7602442", "0.7598732", "0.7597544", "0.75924", "0.75915384", "0.7588146", "0.7581354", "0.7555758", "0.755526", "0.7551423", "0.7546329", "0.7541439", "0.75366044", "0.75363225", "0.7530296", "0.7517988", "0.75155175", "0.7508439", "0.75069886", "0.7505724", "0.749979", "0.7495976", "0.74949056", "0.7492888", "0.7491117", "0.74901396", "0.7489651", "0.7486808", "0.7486108", "0.7479687", "0.7478561", "0.7469412", "0.74635684", "0.74619836", "0.7461325", "0.74591017", "0.7455279", "0.745352", "0.7453257", "0.7449877", "0.74486", "0.7441391", "0.7440429", "0.7435489", "0.7435326", "0.74341524", "0.7430354", "0.7429103", "0.7423808", "0.741936", "0.74152505", "0.7414828", "0.741382", "0.74126065", "0.74105227", "0.740555", "0.7404385", "0.74040926", "0.74015605", "0.73905706", "0.73837525", "0.73732615", "0.7371123", "0.7369176", "0.73619753", "0.73554605", "0.73448825", "0.7344659", "0.73427117", "0.73357755" ]
0.0
-1
Get the error messages for the defined validation rules.
public function messages() { return [ 'required_without_all' => 'Please fill up at least one field', ]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getValidationMessages();", "public function errorMessages()\n {\n return [\n self::RULE_REQUIRED => 'This field is required',\n self::RULE_EMAIL => 'This field must be a valid email address',\n self::RULE_MIN => 'Min length of this field must be {min}',\n self::RULE_MAX => 'Max length of this field must be {max}',\n self::RULE_MATCH => 'This field must be the same as {match}',\n self::RULE_UNIQUE => 'Record with this {field} already exists'\n ];\n }", "public function getValidationErrorMessages() {}", "public function getValidationMessages()\n {\n return $this->validationMessages;\n }", "public function errorMessages() : array\n {\n return [\n self::RULE_REQUIRED => 'Required.',\n self::RULE_EMAIL => 'Must be a valid email address.',\n self::RULE_MIN => 'Must be at least {min} characters.',\n self::RULE_MAX => 'Must be less than {max} characters.',\n self::RULE_MATCH => 'Must match {match}.',\n self::RULE_UNIQUE => '{column} is already in use.'\n ];\n }", "protected function validationErrorMessages()\n {\n return [];\n }", "protected function validationErrorMessages()\n {\n return [];\n }", "public function getErrorMessages() {}", "public function getValidatorMessages()\n {\n $messages = [];\n \n foreach ($this->owner->getValidatorRules() as $rule) {\n \n if ($rule->hasMessage()) {\n $messages[$rule->getType()] = $rule->getMessage();\n }\n \n }\n \n return $messages;\n }", "public function messages()\n {\n return VALIDATION_MESSAGE;\n }", "public function messages()\n {\n return VALIDATION_MESSAGE;\n }", "public function errors()\n {\n return $this->getRules()->getMessageBag()->all();\n }", "public function get_validation_messages() {\n\t\t$field = $this->field;\n\t\t$id = $this->get_id( $field );\n\t\t$is_required = $this->is_required( $field );\n\t\t$messages = '';\n\n\t\t$post_title = self::get_property( 'post_title', $field, '' );\n\t\t$post_content = self::get_property( 'post_content', $field, '' );\n\t\t$post_excerpt = self::get_property( 'post_excerpt', $field, '' );\n\t\t$post_image = self::get_property( 'post_image', $field, '' );\n\t\t$setting_required_message = self::get_property( 'required_message', $field, '' );\n\t\t$post_type = self::get_property( 'post_type', $field, 'post' );\n\n\t\t$post_title_enabled = ! empty( $post_title );\n\t\t$post_content_enabled = ! empty( $post_content );\n\t\t$post_excerpt_enabled = ! empty( $post_excerpt );\n\t\t$post_image_enabled = ! empty( $post_image );\n\t\t$category_list = forminator_post_categories( $post_type );\n\n\t\tif ( $is_required ) {\n\t\t\tif ( $post_title_enabled ) {\n\t\t\t\t$messages .= '\"' . $id . '-post-title\": {' . \"\\n\";\n\n\t\t\t\t$required_message = apply_filters(\n\t\t\t\t\t'forminator_postdata_field_post_title_validation_message',\n\t\t\t\t\t( ! empty( $setting_required_message ) ? $setting_required_message : __( 'This field is required. Please enter the post title', Forminator::DOMAIN ) ),\n\t\t\t\t\t$id,\n\t\t\t\t\t$field\n\t\t\t\t);\n\t\t\t\t$messages = $messages . '\"required\": \"' . forminator_addcslashes( $required_message ) . '\",' . \"\\n\";\n\n\t\t\t\t$messages .= '},' . \"\\n\";\n\t\t\t}\n\t\t\tif ( $post_content_enabled ) {\n\t\t\t\t$messages .= '\"' . $id . '-post-content\": {' . \"\\n\";\n\n\t\t\t\t$required_message = apply_filters(\n\t\t\t\t\t'forminator_postdata_field_post_content_validation_message',\n\t\t\t\t\t( ! empty( $setting_required_message ) ? $setting_required_message : __( 'This field is required. Please enter the post content', Forminator::DOMAIN ) ),\n\t\t\t\t\t$id,\n\t\t\t\t\t$field\n\t\t\t\t);\n\t\t\t\t$messages = $messages . '\"required\": \"' . forminator_addcslashes( $required_message ) . '\",' . \"\\n\";\n\n\t\t\t\t$messages .= '},' . \"\\n\";\n\t\t\t}\n\t\t\tif ( $post_excerpt_enabled ) {\n\t\t\t\t$messages .= '\"' . $id . '-post-excerpt\": {' . \"\\n\";\n\n\t\t\t\t$required_message = apply_filters(\n\t\t\t\t\t'forminator_postdata_field_post_excerpt_validation_message',\n\t\t\t\t\t( ! empty( $setting_required_message ) ? $setting_required_message : __( 'This field is required. Please enter the post excerpt', Forminator::DOMAIN ) ),\n\t\t\t\t\t$id,\n\t\t\t\t\t$field\n\t\t\t\t);\n\t\t\t\t$messages = $messages . '\"required\": \"' . forminator_addcslashes( $required_message ) . '\",' . \"\\n\";\n\n\t\t\t\t$messages .= '},' . \"\\n\";\n\t\t\t}\n\t\t\tif ( $post_image_enabled ) {\n\t\t\t\t$messages .= '\"' . $id . '-post-image\": {' . \"\\n\";\n\n\t\t\t\t$required_message = apply_filters(\n\t\t\t\t\t'forminator_postdata_field_post_image_validation_message',\n\t\t\t\t\t( ! empty( $setting_required_message ) ? $setting_required_message : __( 'This field is required. Please upload a post image', Forminator::DOMAIN ) ),\n\t\t\t\t\t$id,\n\t\t\t\t\t$field\n\t\t\t\t);\n\t\t\t\t$messages = $messages . '\"required\": \"' . forminator_addcslashes( $required_message ) . '\",' . \"\\n\";\n\n\t\t\t\t$messages .= '},' . \"\\n\";\n\t\t\t}\n\t\t\tif( ! empty( $category_list ) ) {\n\t\t\t\tforeach ( $category_list as $category ) {\n\t\t\t\t\t$post_category_enabled = self::get_property( $category['value'], $field, '' );\n\t\t\t\t\tif ( $post_category_enabled ) {\n\t\t\t\t\t\t$post_category_multiple = self::get_property( $category['value'].'_multiple', $field, '' );\n\t\t\t\t\t\tif( $post_category_multiple ){\n\t\t\t\t\t\t\t$messages .= '\"' . $id . '-' . $category['value'] . '[]\": {' . \"\\n\";\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t$messages .= '\"' . $id . '-' . $category['value'] . '\": {' . \"\\n\";\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$required_message = apply_filters(\n\t\t\t\t\t\t\t'forminator_postdata_field_' . $category['value'] . '_validation_message',\n\t\t\t\t\t\t\t( ! empty( $setting_required_message ) ? $setting_required_message : __( 'This field is required. Please select a '. $category['singular'], Forminator::DOMAIN ) ),\n\t\t\t\t\t\t\t$id,\n\t\t\t\t\t\t\t$field\n\t\t\t\t\t\t);\n\t\t\t\t\t\t$messages = $messages . '\"required\": \"' . forminator_addcslashes( $required_message ) . '\",' . \"\\n\";\n\n\t\t\t\t\t\t$messages .= '},' . \"\\n\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $messages;\n\t}", "public function validation_errors()\n\t{\n\t\t$errors = array();\n\n\t\tforeach ($this->validators as $fld=>$arr)\n\t\t{\n\t\t\tforeach ($arr as $vl)\n\t\t\t{\n\t\t\t\t$vl->page = $this;\n\n\t\t\t\tif (!$vl->validate($fld, $this->vars))\n\t\t\t\t{\n\t\t\t\t\t$errors[$fld] = $vl->error_message($fld, $this->vars);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $errors;\n\t}", "public function errors()\n {\n return $this->validation->messages()->messages();\n }", "public function getErrors()\n {\n return $this->getInputFilter()->getMessages();\n }", "public function getErrorMessages() {\n\t\t$errorMessages = '';\n\t\tforeach ($this->errorMessages as $index => $error) {\n\t\t\t$errorMessages .= \"[Error:\" . $index . '] ' . $error . \"\\n<br />\";\n\t\t}\n\t\treturn $errorMessages;\n\t}", "public static function getMessageRule(){\n return [\n 'title.required' => 'Please input the title',\n 'cat_id.required' => 'Please chose a category',\n 'country_id.required' => 'Please chose a country',\n ];\n }", "public function getValidationErrors();", "public function getValidationErrors();", "public function getErrorMessages()\n {\n return $this->errorMessages;\n }", "public function messages()\n {\n return [\n 'started_at.required_if' => __('validation.required'),\n 'ended_at.required_if' => __('validation.required'),\n 'subject_id.required_if' => __('validation.required'),\n 'competency.required_if' => __('validation.required'),\n 'learning_goals.required_if' => __('validation.required'),\n 'behavior.required_if' => __('validation.required'),\n ];\n }", "public function get_error_messages();", "function getMessages() {\n\t\t$fields = $this->getFields();\n\t\t$allMessages = array();\n\n\t\tforeach ($fields as $field) {\n\t\t\t$fieldMessages = $field->getValidationMessages();\n\t\t\tif ($fieldMessages) {\n\t\t\t\t$allMessages[$field->getName()] = $fieldMessages;\n\t\t\t}\n\n\t\t}\n\n\t\treturn $allMessages;\n\t}", "public function getErrorMessage()\n {\n return $this->validator->errors()->all();\n }", "public function getErrorMessages()\n {\n $errors = [];\n foreach ($this->fields as $field) {\n if ($field instanceof AbstractFormField && !$field->isValid()) {\n $fldErrors = $field->getErrorMessages();\n $errors = array_merge($errors, $fldErrors);\n }\n }\n\n return $errors;\n }", "public function errors()\n {\n return $this->validator->errors()->messages();\n }", "public function getErrorMessages() : array\n {\n return $this->errors_messages;\n }", "public function getMessages()\n {\n return $this->_errorMessages;\n }", "public function getMandatoryValidationMessages() {}", "public function getValidationErrors()\n {\n $fields = $this->getFields();\n if (!$fields) {\n return [];\n }\n\n $result = [];\n foreach ($fields as $field) {\n if ($field instanceof AbstractFormField) {\n if (!$field->isValid()) {\n $result = array_merge($result, $field->getErrorMessages());\n }\n }\n }\n\n return $result;\n }", "protected function validationErrorMessages()\n {\n return [\n 'password.required' => trans('strings.request_password_required'),\n 'password.confirmed' => trans('strings.request_password_confirmed'),\n 'password.min' => trans('strings.request_password_min', ['chars' => config('db_limits.users.minPasswordLength')]),\n ];\n }", "protected function getValidationErrors()\n {\n return $this->validation->errors();\n }", "protected function getValidationRules()\n {\n $rules = [\n 'title' => 'required|min:3|max:255',\n ];\n\n return $rules;\n }", "public function messages()\n {\n return [\n 'file.required' => trans('validation.downloadable_required'),\n 'category_list.required' => trans('validation.category_list_required'),\n ];\n }", "public function getMessages()\n {\n foreach (parent::getMessages() as $message) {\n switch ($message->getType()) {\n case 'PresenceOf':\n $message->setMessage('The field ' . $message->getField() . ' is required');\n break;\n case 'Uniqueness':\n $message->setMessage('The field ' . $message->getField() . ' must be unique');\n break;\n case 'Email':\n $message->setMessage('The field ' . $message->getField() . ' must contain a valid email');\n break;\n case 'Url':\n $message->setMessage('The field ' . $message->getField() . ' must contain a valid url');\n break;\n case 'InclusionIn':\n $message->setMessage('The field ' . $message->getField() . ' must contain a value in [' . implode(',', $message->getDomain()) . ']');\n break;\n case 'DateValidator':\n $message->setMessage('The field ' . $message->getField() . ' must contain a valid date.');\n break;\n case 'TimestampValidator':\n $message->setMessage('The field ' . $message->getField() . ' must contain a valid timestamps.');\n break;\n }\n }\n\n return parent::getMessages();\n }", "public function getValidationErrors() {\n if (true == ($this->validation instanceof Validation)) {\n return $this->validation->getErrors();\n }\n\n return array();\n }", "public function getErrorMessagesList(){\n \t$errors = $this->getMessages();\n \tif(count($errors)){\n \t\t$result = [];\n \t\tforeach ($errors as $elementName => $elementErrors){\n \t\t\tforeach ($elementErrors as $errorMsg){\n \t\t\t\t$result[] = $errorMsg;\n \t\t\t}\n \t\t}\n \t\treturn $result;\n \t}\n \treturn null;\n }", "protected function get_errors_description() {\n $errors = array();\n if ($this->options->is_check_errors == true) {\n\n $i = 0;\n $rules_names = $this->get_error_hints_names();\n\n foreach($rules_names as $rule_name) {\n $rule = new $rule_name($this->get_dst_root());\n $rhr = $rule->check_hint();\n\n if (count($rhr->problem_ids) > 0) {\n $errors[$i] = array();\n\n $errors[$i][\"problem\"] = $rhr->problem;\n $errors[$i][\"solve\"] = $rhr->solve;\n $errors[$i][\"problem_ids\"] = $rhr->problem_ids;\n $errors[$i][\"problem_type\"] = $rhr->problem_type;\n $errors[$i][\"problem_indfirst\"] = $rhr->problem_indfirst;\n $errors[$i][\"problem_indlast\"] = $rhr->problem_indlast;\n\n ++$i;\n }\n }\n }\n return $errors;\n }", "protected function validationErrorMessages()\n {\n return [\n 'password.regex' => 'Password must contain at least 1 uppercase letter and 1 number.',\n ];\n }", "public function customValidationMessages()\n {\n return [\n 'role_id.required' => 'The role ID is required.',\n 'role_id.exists' => 'The role ID provided does not exist.',\n 'staff_code.required' => 'The staff code is required.',\n 'name.required' => 'The name field is required.',\n 'name.max' => 'The name field exceeds the maximum length of 255.',\n 'email.email' => 'Please provide an email address.',\n ];\n }", "public function _getValidationErrors()\n {\n $errs = parent::_getValidationErrors();\n $validationRules = $this->_getValidationRules();\n if ([] !== ($vs = $this->getDataRequirement())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_DATA_REQUIREMENT, $i)] = $fieldErrs;\n }\n }\n }\n if (null !== ($v = $this->getEncounter())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_ENCOUNTER] = $fieldErrs;\n }\n }\n if ([] !== ($vs = $this->getEvaluationMessage())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_EVALUATION_MESSAGE, $i)] = $fieldErrs;\n }\n }\n }\n if ([] !== ($vs = $this->getIdentifier())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_IDENTIFIER, $i)] = $fieldErrs;\n }\n }\n }\n if (null !== ($v = $this->getModuleCanonical())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_MODULE_CANONICAL] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getModuleCodeableConcept())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_MODULE_CODEABLE_CONCEPT] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getModuleUri())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_MODULE_URI] = $fieldErrs;\n }\n }\n if ([] !== ($vs = $this->getNote())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_NOTE, $i)] = $fieldErrs;\n }\n }\n }\n if (null !== ($v = $this->getOccurrenceDateTime())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_OCCURRENCE_DATE_TIME] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getOutputParameters())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_OUTPUT_PARAMETERS] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getPerformer())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_PERFORMER] = $fieldErrs;\n }\n }\n if ([] !== ($vs = $this->getReasonCode())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_REASON_CODE, $i)] = $fieldErrs;\n }\n }\n }\n if ([] !== ($vs = $this->getReasonReference())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_REASON_REFERENCE, $i)] = $fieldErrs;\n }\n }\n }\n if (null !== ($v = $this->getRequestIdentifier())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_REQUEST_IDENTIFIER] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getResult())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_RESULT] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getStatus())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_STATUS] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getSubject())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_SUBJECT] = $fieldErrs;\n }\n }\n if (isset($validationRules[self::FIELD_DATA_REQUIREMENT])) {\n $v = $this->getDataRequirement();\n foreach($validationRules[self::FIELD_DATA_REQUIREMENT] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_DATA_REQUIREMENT, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_DATA_REQUIREMENT])) {\n $errs[self::FIELD_DATA_REQUIREMENT] = [];\n }\n $errs[self::FIELD_DATA_REQUIREMENT][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_ENCOUNTER])) {\n $v = $this->getEncounter();\n foreach($validationRules[self::FIELD_ENCOUNTER] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_ENCOUNTER, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ENCOUNTER])) {\n $errs[self::FIELD_ENCOUNTER] = [];\n }\n $errs[self::FIELD_ENCOUNTER][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_EVALUATION_MESSAGE])) {\n $v = $this->getEvaluationMessage();\n foreach($validationRules[self::FIELD_EVALUATION_MESSAGE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_EVALUATION_MESSAGE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_EVALUATION_MESSAGE])) {\n $errs[self::FIELD_EVALUATION_MESSAGE] = [];\n }\n $errs[self::FIELD_EVALUATION_MESSAGE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_IDENTIFIER])) {\n $v = $this->getIdentifier();\n foreach($validationRules[self::FIELD_IDENTIFIER] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_IDENTIFIER, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_IDENTIFIER])) {\n $errs[self::FIELD_IDENTIFIER] = [];\n }\n $errs[self::FIELD_IDENTIFIER][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_MODULE_CANONICAL])) {\n $v = $this->getModuleCanonical();\n foreach($validationRules[self::FIELD_MODULE_CANONICAL] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_MODULE_CANONICAL, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_MODULE_CANONICAL])) {\n $errs[self::FIELD_MODULE_CANONICAL] = [];\n }\n $errs[self::FIELD_MODULE_CANONICAL][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_MODULE_CODEABLE_CONCEPT])) {\n $v = $this->getModuleCodeableConcept();\n foreach($validationRules[self::FIELD_MODULE_CODEABLE_CONCEPT] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_MODULE_CODEABLE_CONCEPT, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_MODULE_CODEABLE_CONCEPT])) {\n $errs[self::FIELD_MODULE_CODEABLE_CONCEPT] = [];\n }\n $errs[self::FIELD_MODULE_CODEABLE_CONCEPT][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_MODULE_URI])) {\n $v = $this->getModuleUri();\n foreach($validationRules[self::FIELD_MODULE_URI] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_MODULE_URI, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_MODULE_URI])) {\n $errs[self::FIELD_MODULE_URI] = [];\n }\n $errs[self::FIELD_MODULE_URI][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_NOTE])) {\n $v = $this->getNote();\n foreach($validationRules[self::FIELD_NOTE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_NOTE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_NOTE])) {\n $errs[self::FIELD_NOTE] = [];\n }\n $errs[self::FIELD_NOTE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_OCCURRENCE_DATE_TIME])) {\n $v = $this->getOccurrenceDateTime();\n foreach($validationRules[self::FIELD_OCCURRENCE_DATE_TIME] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_OCCURRENCE_DATE_TIME, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_OCCURRENCE_DATE_TIME])) {\n $errs[self::FIELD_OCCURRENCE_DATE_TIME] = [];\n }\n $errs[self::FIELD_OCCURRENCE_DATE_TIME][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_OUTPUT_PARAMETERS])) {\n $v = $this->getOutputParameters();\n foreach($validationRules[self::FIELD_OUTPUT_PARAMETERS] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_OUTPUT_PARAMETERS, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_OUTPUT_PARAMETERS])) {\n $errs[self::FIELD_OUTPUT_PARAMETERS] = [];\n }\n $errs[self::FIELD_OUTPUT_PARAMETERS][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_PERFORMER])) {\n $v = $this->getPerformer();\n foreach($validationRules[self::FIELD_PERFORMER] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_PERFORMER, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_PERFORMER])) {\n $errs[self::FIELD_PERFORMER] = [];\n }\n $errs[self::FIELD_PERFORMER][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_REASON_CODE])) {\n $v = $this->getReasonCode();\n foreach($validationRules[self::FIELD_REASON_CODE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_REASON_CODE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_REASON_CODE])) {\n $errs[self::FIELD_REASON_CODE] = [];\n }\n $errs[self::FIELD_REASON_CODE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_REASON_REFERENCE])) {\n $v = $this->getReasonReference();\n foreach($validationRules[self::FIELD_REASON_REFERENCE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_REASON_REFERENCE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_REASON_REFERENCE])) {\n $errs[self::FIELD_REASON_REFERENCE] = [];\n }\n $errs[self::FIELD_REASON_REFERENCE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_REQUEST_IDENTIFIER])) {\n $v = $this->getRequestIdentifier();\n foreach($validationRules[self::FIELD_REQUEST_IDENTIFIER] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_REQUEST_IDENTIFIER, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_REQUEST_IDENTIFIER])) {\n $errs[self::FIELD_REQUEST_IDENTIFIER] = [];\n }\n $errs[self::FIELD_REQUEST_IDENTIFIER][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_RESULT])) {\n $v = $this->getResult();\n foreach($validationRules[self::FIELD_RESULT] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_RESULT, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_RESULT])) {\n $errs[self::FIELD_RESULT] = [];\n }\n $errs[self::FIELD_RESULT][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_STATUS])) {\n $v = $this->getStatus();\n foreach($validationRules[self::FIELD_STATUS] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_STATUS, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_STATUS])) {\n $errs[self::FIELD_STATUS] = [];\n }\n $errs[self::FIELD_STATUS][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_SUBJECT])) {\n $v = $this->getSubject();\n foreach($validationRules[self::FIELD_SUBJECT] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_SUBJECT, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_SUBJECT])) {\n $errs[self::FIELD_SUBJECT] = [];\n }\n $errs[self::FIELD_SUBJECT][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_CONTAINED])) {\n $v = $this->getContained();\n foreach($validationRules[self::FIELD_CONTAINED] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE, self::FIELD_CONTAINED, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_CONTAINED])) {\n $errs[self::FIELD_CONTAINED] = [];\n }\n $errs[self::FIELD_CONTAINED][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_EXTENSION])) {\n $v = $this->getExtension();\n foreach($validationRules[self::FIELD_EXTENSION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE, self::FIELD_EXTENSION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_EXTENSION])) {\n $errs[self::FIELD_EXTENSION] = [];\n }\n $errs[self::FIELD_EXTENSION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_MODIFIER_EXTENSION])) {\n $v = $this->getModifierExtension();\n foreach($validationRules[self::FIELD_MODIFIER_EXTENSION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE, self::FIELD_MODIFIER_EXTENSION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_MODIFIER_EXTENSION])) {\n $errs[self::FIELD_MODIFIER_EXTENSION] = [];\n }\n $errs[self::FIELD_MODIFIER_EXTENSION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_TEXT])) {\n $v = $this->getText();\n foreach($validationRules[self::FIELD_TEXT] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE, self::FIELD_TEXT, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_TEXT])) {\n $errs[self::FIELD_TEXT] = [];\n }\n $errs[self::FIELD_TEXT][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_ID])) {\n $v = $this->getId();\n foreach($validationRules[self::FIELD_ID] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_RESOURCE, self::FIELD_ID, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ID])) {\n $errs[self::FIELD_ID] = [];\n }\n $errs[self::FIELD_ID][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_IMPLICIT_RULES])) {\n $v = $this->getImplicitRules();\n foreach($validationRules[self::FIELD_IMPLICIT_RULES] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_RESOURCE, self::FIELD_IMPLICIT_RULES, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_IMPLICIT_RULES])) {\n $errs[self::FIELD_IMPLICIT_RULES] = [];\n }\n $errs[self::FIELD_IMPLICIT_RULES][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_LANGUAGE])) {\n $v = $this->getLanguage();\n foreach($validationRules[self::FIELD_LANGUAGE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_RESOURCE, self::FIELD_LANGUAGE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_LANGUAGE])) {\n $errs[self::FIELD_LANGUAGE] = [];\n }\n $errs[self::FIELD_LANGUAGE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_META])) {\n $v = $this->getMeta();\n foreach($validationRules[self::FIELD_META] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_RESOURCE, self::FIELD_META, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_META])) {\n $errs[self::FIELD_META] = [];\n }\n $errs[self::FIELD_META][$rule] = $err;\n }\n }\n }\n return $errs;\n }", "public function getErrors()\n {\n $errors = $this->getValue('klarna_validation_errors');\n return $errors ? $errors : array();\n }", "public function getMessage(): array\n {\n return [\n self::RULE_REQUIRED => 'This Field is required',\n self::RULE_EMAIL => 'Please input valid email address',\n self::RULE_MATCH => 'The Passwords must match',\n self::RULE_UNIQUE => 'This record exists in the database',\n self::RULE_VALID_START_DATE => 'Project start date cannot be before today',\n self::RULE_VALID_END_DATE => 'Project end date cannot be before start date'\n\n ];\n }", "public function getErrorMessages()\n {\n $translator = Mage::helper('importexport');\n $messages = array();\n\n foreach ($this->_errors as $errorCode => $errorRows) {\n if (isset($this->_messageTemplates[$errorCode])) {\n $errorCode = $translator->__($this->_messageTemplates[$errorCode]);\n }\n foreach ($errorRows as $errorRowData) {\n $key = $errorRowData[1] ? sprintf($errorCode, $errorRowData[1]) : $errorCode;\n $messages[$key][] = $errorRowData[0];\n }\n }\n return $messages;\n }", "public function getErrors(): array\n {\n return $this->getInputFilter()->getMessages();\n }", "protected function _getValidationErrors()\n {\n if (is_null($this->validationErrors)) {\n return array();\n }\n\n return $this->validationErrors;\n }", "public function _getValidationErrors(): array\n\t{\n\t\t$errs = parent::_getValidationErrors();\n\t\t$validationRules = $this->_getValidationRules();\n\t\tif (null !== ($v = $this->getUrl())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_URL] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif ([] !== ($vs = $this->getIdentifier())) {\n\t\t\tforeach ($vs as $i => $v) {\n\t\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t\t$errs[sprintf('%s.%d', self::FIELD_IDENTIFIER, $i)] = $fieldErrs;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getVersion())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_VERSION] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getName())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_NAME] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getDisplay())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_DISPLAY] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getStatus())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_STATUS] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getExperimental())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_EXPERIMENTAL] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getPublisher())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_PUBLISHER] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif ([] !== ($vs = $this->getContact())) {\n\t\t\tforeach ($vs as $i => $v) {\n\t\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t\t$errs[sprintf('%s.%d', self::FIELD_CONTACT, $i)] = $fieldErrs;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getDate())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_DATE] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getDescription())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_DESCRIPTION] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif ([] !== ($vs = $this->getUseContext())) {\n\t\t\tforeach ($vs as $i => $v) {\n\t\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t\t$errs[sprintf('%s.%d', self::FIELD_USE_CONTEXT, $i)] = $fieldErrs;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getRequirements())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_REQUIREMENTS] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getCopyright())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_COPYRIGHT] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif ([] !== ($vs = $this->getCode())) {\n\t\t\tforeach ($vs as $i => $v) {\n\t\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t\t$errs[sprintf('%s.%d', self::FIELD_CODE, $i)] = $fieldErrs;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getFhirVersion())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_FHIR_VERSION] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif ([] !== ($vs = $this->getMapping())) {\n\t\t\tforeach ($vs as $i => $v) {\n\t\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t\t$errs[sprintf('%s.%d', self::FIELD_MAPPING, $i)] = $fieldErrs;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getKind())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_KIND] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getConstrainedType())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_CONSTRAINED_TYPE] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getAbstract())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_ABSTRACT] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getContextType())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_CONTEXT_TYPE] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif ([] !== ($vs = $this->getContext())) {\n\t\t\tforeach ($vs as $i => $v) {\n\t\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t\t$errs[sprintf('%s.%d', self::FIELD_CONTEXT, $i)] = $fieldErrs;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getBase())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_BASE] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getSnapshot())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_SNAPSHOT] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getDifferential())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_DIFFERENTIAL] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_URL])) {\n\t\t\t$v = $this->getUrl();\n\t\t\tforeach ($validationRules[self::FIELD_URL] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_URL,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_URL])) {\n\t\t\t\t\t\t$errs[self::FIELD_URL] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_URL][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_IDENTIFIER])) {\n\t\t\t$v = $this->getIdentifier();\n\t\t\tforeach ($validationRules[self::FIELD_IDENTIFIER] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_IDENTIFIER,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_IDENTIFIER])) {\n\t\t\t\t\t\t$errs[self::FIELD_IDENTIFIER] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_IDENTIFIER][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_VERSION])) {\n\t\t\t$v = $this->getVersion();\n\t\t\tforeach ($validationRules[self::FIELD_VERSION] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_VERSION,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_VERSION])) {\n\t\t\t\t\t\t$errs[self::FIELD_VERSION] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_VERSION][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_NAME])) {\n\t\t\t$v = $this->getName();\n\t\t\tforeach ($validationRules[self::FIELD_NAME] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_NAME,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_NAME])) {\n\t\t\t\t\t\t$errs[self::FIELD_NAME] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_NAME][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_DISPLAY])) {\n\t\t\t$v = $this->getDisplay();\n\t\t\tforeach ($validationRules[self::FIELD_DISPLAY] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_DISPLAY,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_DISPLAY])) {\n\t\t\t\t\t\t$errs[self::FIELD_DISPLAY] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_DISPLAY][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_STATUS])) {\n\t\t\t$v = $this->getStatus();\n\t\t\tforeach ($validationRules[self::FIELD_STATUS] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_STATUS,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_STATUS])) {\n\t\t\t\t\t\t$errs[self::FIELD_STATUS] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_STATUS][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_EXPERIMENTAL])) {\n\t\t\t$v = $this->getExperimental();\n\t\t\tforeach ($validationRules[self::FIELD_EXPERIMENTAL] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_EXPERIMENTAL,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_EXPERIMENTAL])) {\n\t\t\t\t\t\t$errs[self::FIELD_EXPERIMENTAL] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_EXPERIMENTAL][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_PUBLISHER])) {\n\t\t\t$v = $this->getPublisher();\n\t\t\tforeach ($validationRules[self::FIELD_PUBLISHER] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_PUBLISHER,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_PUBLISHER])) {\n\t\t\t\t\t\t$errs[self::FIELD_PUBLISHER] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_PUBLISHER][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_CONTACT])) {\n\t\t\t$v = $this->getContact();\n\t\t\tforeach ($validationRules[self::FIELD_CONTACT] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_CONTACT,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_CONTACT])) {\n\t\t\t\t\t\t$errs[self::FIELD_CONTACT] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_CONTACT][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_DATE])) {\n\t\t\t$v = $this->getDate();\n\t\t\tforeach ($validationRules[self::FIELD_DATE] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_DATE,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_DATE])) {\n\t\t\t\t\t\t$errs[self::FIELD_DATE] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_DATE][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_DESCRIPTION])) {\n\t\t\t$v = $this->getDescription();\n\t\t\tforeach ($validationRules[self::FIELD_DESCRIPTION] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_DESCRIPTION,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_DESCRIPTION])) {\n\t\t\t\t\t\t$errs[self::FIELD_DESCRIPTION] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_DESCRIPTION][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_USE_CONTEXT])) {\n\t\t\t$v = $this->getUseContext();\n\t\t\tforeach ($validationRules[self::FIELD_USE_CONTEXT] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_USE_CONTEXT,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_USE_CONTEXT])) {\n\t\t\t\t\t\t$errs[self::FIELD_USE_CONTEXT] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_USE_CONTEXT][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_REQUIREMENTS])) {\n\t\t\t$v = $this->getRequirements();\n\t\t\tforeach ($validationRules[self::FIELD_REQUIREMENTS] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_REQUIREMENTS,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_REQUIREMENTS])) {\n\t\t\t\t\t\t$errs[self::FIELD_REQUIREMENTS] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_REQUIREMENTS][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_COPYRIGHT])) {\n\t\t\t$v = $this->getCopyright();\n\t\t\tforeach ($validationRules[self::FIELD_COPYRIGHT] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_COPYRIGHT,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_COPYRIGHT])) {\n\t\t\t\t\t\t$errs[self::FIELD_COPYRIGHT] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_COPYRIGHT][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_CODE])) {\n\t\t\t$v = $this->getCode();\n\t\t\tforeach ($validationRules[self::FIELD_CODE] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_CODE,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_CODE])) {\n\t\t\t\t\t\t$errs[self::FIELD_CODE] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_CODE][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_FHIR_VERSION])) {\n\t\t\t$v = $this->getFhirVersion();\n\t\t\tforeach ($validationRules[self::FIELD_FHIR_VERSION] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_FHIR_VERSION,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_FHIR_VERSION])) {\n\t\t\t\t\t\t$errs[self::FIELD_FHIR_VERSION] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_FHIR_VERSION][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_MAPPING])) {\n\t\t\t$v = $this->getMapping();\n\t\t\tforeach ($validationRules[self::FIELD_MAPPING] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_MAPPING,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_MAPPING])) {\n\t\t\t\t\t\t$errs[self::FIELD_MAPPING] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_MAPPING][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_KIND])) {\n\t\t\t$v = $this->getKind();\n\t\t\tforeach ($validationRules[self::FIELD_KIND] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_KIND,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_KIND])) {\n\t\t\t\t\t\t$errs[self::FIELD_KIND] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_KIND][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_CONSTRAINED_TYPE])) {\n\t\t\t$v = $this->getConstrainedType();\n\t\t\tforeach ($validationRules[self::FIELD_CONSTRAINED_TYPE] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_CONSTRAINED_TYPE,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_CONSTRAINED_TYPE])) {\n\t\t\t\t\t\t$errs[self::FIELD_CONSTRAINED_TYPE] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_CONSTRAINED_TYPE][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_ABSTRACT])) {\n\t\t\t$v = $this->getAbstract();\n\t\t\tforeach ($validationRules[self::FIELD_ABSTRACT] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_ABSTRACT,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_ABSTRACT])) {\n\t\t\t\t\t\t$errs[self::FIELD_ABSTRACT] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_ABSTRACT][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_CONTEXT_TYPE])) {\n\t\t\t$v = $this->getContextType();\n\t\t\tforeach ($validationRules[self::FIELD_CONTEXT_TYPE] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_CONTEXT_TYPE,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_CONTEXT_TYPE])) {\n\t\t\t\t\t\t$errs[self::FIELD_CONTEXT_TYPE] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_CONTEXT_TYPE][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_CONTEXT])) {\n\t\t\t$v = $this->getContext();\n\t\t\tforeach ($validationRules[self::FIELD_CONTEXT] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_CONTEXT,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_CONTEXT])) {\n\t\t\t\t\t\t$errs[self::FIELD_CONTEXT] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_CONTEXT][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_BASE])) {\n\t\t\t$v = $this->getBase();\n\t\t\tforeach ($validationRules[self::FIELD_BASE] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_BASE,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_BASE])) {\n\t\t\t\t\t\t$errs[self::FIELD_BASE] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_BASE][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_SNAPSHOT])) {\n\t\t\t$v = $this->getSnapshot();\n\t\t\tforeach ($validationRules[self::FIELD_SNAPSHOT] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_SNAPSHOT,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_SNAPSHOT])) {\n\t\t\t\t\t\t$errs[self::FIELD_SNAPSHOT] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_SNAPSHOT][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_DIFFERENTIAL])) {\n\t\t\t$v = $this->getDifferential();\n\t\t\tforeach ($validationRules[self::FIELD_DIFFERENTIAL] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_DIFFERENTIAL,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_DIFFERENTIAL])) {\n\t\t\t\t\t\t$errs[self::FIELD_DIFFERENTIAL] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_DIFFERENTIAL][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_TEXT])) {\n\t\t\t$v = $this->getText();\n\t\t\tforeach ($validationRules[self::FIELD_TEXT] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE,\n\t\t\t\t\tself::FIELD_TEXT,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_TEXT])) {\n\t\t\t\t\t\t$errs[self::FIELD_TEXT] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_TEXT][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_CONTAINED])) {\n\t\t\t$v = $this->getContained();\n\t\t\tforeach ($validationRules[self::FIELD_CONTAINED] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE,\n\t\t\t\t\tself::FIELD_CONTAINED,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_CONTAINED])) {\n\t\t\t\t\t\t$errs[self::FIELD_CONTAINED] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_CONTAINED][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_EXTENSION])) {\n\t\t\t$v = $this->getExtension();\n\t\t\tforeach ($validationRules[self::FIELD_EXTENSION] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE,\n\t\t\t\t\tself::FIELD_EXTENSION,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_EXTENSION])) {\n\t\t\t\t\t\t$errs[self::FIELD_EXTENSION] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_EXTENSION][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_MODIFIER_EXTENSION])) {\n\t\t\t$v = $this->getModifierExtension();\n\t\t\tforeach ($validationRules[self::FIELD_MODIFIER_EXTENSION] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE,\n\t\t\t\t\tself::FIELD_MODIFIER_EXTENSION,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_MODIFIER_EXTENSION])) {\n\t\t\t\t\t\t$errs[self::FIELD_MODIFIER_EXTENSION] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_MODIFIER_EXTENSION][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_ID])) {\n\t\t\t$v = $this->getId();\n\t\t\tforeach ($validationRules[self::FIELD_ID] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_RESOURCE,\n\t\t\t\t\tself::FIELD_ID,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_ID])) {\n\t\t\t\t\t\t$errs[self::FIELD_ID] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_ID][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_META])) {\n\t\t\t$v = $this->getMeta();\n\t\t\tforeach ($validationRules[self::FIELD_META] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_RESOURCE,\n\t\t\t\t\tself::FIELD_META,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_META])) {\n\t\t\t\t\t\t$errs[self::FIELD_META] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_META][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_IMPLICIT_RULES])) {\n\t\t\t$v = $this->getImplicitRules();\n\t\t\tforeach ($validationRules[self::FIELD_IMPLICIT_RULES] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_RESOURCE,\n\t\t\t\t\tself::FIELD_IMPLICIT_RULES,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_IMPLICIT_RULES])) {\n\t\t\t\t\t\t$errs[self::FIELD_IMPLICIT_RULES] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_IMPLICIT_RULES][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_LANGUAGE])) {\n\t\t\t$v = $this->getLanguage();\n\t\t\tforeach ($validationRules[self::FIELD_LANGUAGE] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_RESOURCE,\n\t\t\t\t\tself::FIELD_LANGUAGE,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_LANGUAGE])) {\n\t\t\t\t\t\t$errs[self::FIELD_LANGUAGE] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_LANGUAGE][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $errs;\n\t}", "public function get_errors() {\n\t\treturn $this->errors->get_error_messages();\n\t}", "public function getValidationErrors()\n\t{\n\t\treturn $this->validationErrors;\n\t}", "public function messages() \n {\n return[\n 'name.required' => ['code' => 'ERROR-1', 'title' => 'Unprocessable Entity'],\n 'price.required' => ['code' => 'ERROR-1', 'title' => 'Unprocessable Entity'],\n 'price.numeric' => ['code' => 'ERROR-1', 'title' => 'Unprocessable Entity'],\n 'price.major' => ['code' => 'ERROR-1', 'title' => 'Unprocessable Entity']\n ];\n }", "public function get_clear_error_msgs()\n {\n $msgs = array();\n foreach ($this->errors as $e) {\n $msgs[$e['field']][$e['rule']] = $this->get_validation_error_msg($e['field'], $e['rule'], $e['value']);\n\n }\n return $msgs;\n }", "public function messages()\n {\n $items = [];\n foreach (static::attributes() as $key => $val) {\n $items[$key . '.required'] = t('common.form.errors.required', [\n 'attribute' => $val,\n ]);\n }\n \n return $items;\n }", "public function messages()\n {\n return [\n 'name.required' => 'A Team Name is required',\n 'filename.required' => 'A Team Logo is required',\n 'club_state.required' => 'A Club state is required',\n ];\n }", "public function messages()\n {\n return [\n 'code_day.required' => 'Code day must required!',\n 'name.required' => 'Name must required!',\n ];\n }", "public function messages()\n {\n return [\n 'name.required' => 'Email is required!',\n 'year.required' => 'Year is required!',\n 'artist_id.required' => 'Artist is required!'\n ];\n }", "public function messages()\n {\n return [\n 'required' => ':attribute field must be filled',\n 'email' => ':attribute field must be an email',\n 'unique' => ':attribute field already registered',\n ];\n }", "public function _getValidationErrors()\n {\n $errs = parent::_getValidationErrors();\n $validationRules = $this->_getValidationRules();\n if (null !== ($v = $this->getAccident())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_ACCIDENT] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getAccidentType())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_ACCIDENT_TYPE] = $fieldErrs;\n }\n }\n if ([] !== ($vs = $this->getAdditionalMaterials())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_ADDITIONAL_MATERIALS, $i)] = $fieldErrs;\n }\n }\n }\n if ([] !== ($vs = $this->getCondition())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_CONDITION, $i)] = $fieldErrs;\n }\n }\n }\n if ([] !== ($vs = $this->getCoverage())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_COVERAGE, $i)] = $fieldErrs;\n }\n }\n }\n if (null !== ($v = $this->getCreated())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_CREATED] = $fieldErrs;\n }\n }\n if ([] !== ($vs = $this->getDiagnosis())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_DIAGNOSIS, $i)] = $fieldErrs;\n }\n }\n }\n if (null !== ($v = $this->getEnterer())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_ENTERER] = $fieldErrs;\n }\n }\n if ([] !== ($vs = $this->getException())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_EXCEPTION, $i)] = $fieldErrs;\n }\n }\n }\n if (null !== ($v = $this->getFacility())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_FACILITY] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getFundsReserve())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_FUNDS_RESERVE] = $fieldErrs;\n }\n }\n if ([] !== ($vs = $this->getIdentifier())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_IDENTIFIER, $i)] = $fieldErrs;\n }\n }\n }\n if ([] !== ($vs = $this->getInterventionException())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_INTERVENTION_EXCEPTION, $i)] = $fieldErrs;\n }\n }\n }\n if ([] !== ($vs = $this->getItem())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_ITEM, $i)] = $fieldErrs;\n }\n }\n }\n if ([] !== ($vs = $this->getMissingTeeth())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_MISSING_TEETH, $i)] = $fieldErrs;\n }\n }\n }\n if (null !== ($v = $this->getOrganization())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_ORGANIZATION] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getOriginalPrescription())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_ORIGINAL_PRESCRIPTION] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getOriginalRuleset())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_ORIGINAL_RULESET] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getPatient())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_PATIENT] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getPayee())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_PAYEE] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getPrescription())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_PRESCRIPTION] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getPriority())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_PRIORITY] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getProvider())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_PROVIDER] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getReferral())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_REFERRAL] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getRuleset())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_RULESET] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getSchool())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_SCHOOL] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getTarget())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_TARGET] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getType())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_TYPE] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getUse())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_USE] = $fieldErrs;\n }\n }\n if (isset($validationRules[self::FIELD_ACCIDENT])) {\n $v = $this->getAccident();\n foreach($validationRules[self::FIELD_ACCIDENT] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_ACCIDENT, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ACCIDENT])) {\n $errs[self::FIELD_ACCIDENT] = [];\n }\n $errs[self::FIELD_ACCIDENT][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_ACCIDENT_TYPE])) {\n $v = $this->getAccidentType();\n foreach($validationRules[self::FIELD_ACCIDENT_TYPE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_ACCIDENT_TYPE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ACCIDENT_TYPE])) {\n $errs[self::FIELD_ACCIDENT_TYPE] = [];\n }\n $errs[self::FIELD_ACCIDENT_TYPE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_ADDITIONAL_MATERIALS])) {\n $v = $this->getAdditionalMaterials();\n foreach($validationRules[self::FIELD_ADDITIONAL_MATERIALS] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_ADDITIONAL_MATERIALS, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ADDITIONAL_MATERIALS])) {\n $errs[self::FIELD_ADDITIONAL_MATERIALS] = [];\n }\n $errs[self::FIELD_ADDITIONAL_MATERIALS][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_CONDITION])) {\n $v = $this->getCondition();\n foreach($validationRules[self::FIELD_CONDITION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_CONDITION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_CONDITION])) {\n $errs[self::FIELD_CONDITION] = [];\n }\n $errs[self::FIELD_CONDITION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_COVERAGE])) {\n $v = $this->getCoverage();\n foreach($validationRules[self::FIELD_COVERAGE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_COVERAGE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_COVERAGE])) {\n $errs[self::FIELD_COVERAGE] = [];\n }\n $errs[self::FIELD_COVERAGE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_CREATED])) {\n $v = $this->getCreated();\n foreach($validationRules[self::FIELD_CREATED] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_CREATED, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_CREATED])) {\n $errs[self::FIELD_CREATED] = [];\n }\n $errs[self::FIELD_CREATED][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_DIAGNOSIS])) {\n $v = $this->getDiagnosis();\n foreach($validationRules[self::FIELD_DIAGNOSIS] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_DIAGNOSIS, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_DIAGNOSIS])) {\n $errs[self::FIELD_DIAGNOSIS] = [];\n }\n $errs[self::FIELD_DIAGNOSIS][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_ENTERER])) {\n $v = $this->getEnterer();\n foreach($validationRules[self::FIELD_ENTERER] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_ENTERER, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ENTERER])) {\n $errs[self::FIELD_ENTERER] = [];\n }\n $errs[self::FIELD_ENTERER][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_EXCEPTION])) {\n $v = $this->getException();\n foreach($validationRules[self::FIELD_EXCEPTION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_EXCEPTION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_EXCEPTION])) {\n $errs[self::FIELD_EXCEPTION] = [];\n }\n $errs[self::FIELD_EXCEPTION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_FACILITY])) {\n $v = $this->getFacility();\n foreach($validationRules[self::FIELD_FACILITY] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_FACILITY, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_FACILITY])) {\n $errs[self::FIELD_FACILITY] = [];\n }\n $errs[self::FIELD_FACILITY][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_FUNDS_RESERVE])) {\n $v = $this->getFundsReserve();\n foreach($validationRules[self::FIELD_FUNDS_RESERVE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_FUNDS_RESERVE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_FUNDS_RESERVE])) {\n $errs[self::FIELD_FUNDS_RESERVE] = [];\n }\n $errs[self::FIELD_FUNDS_RESERVE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_IDENTIFIER])) {\n $v = $this->getIdentifier();\n foreach($validationRules[self::FIELD_IDENTIFIER] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_IDENTIFIER, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_IDENTIFIER])) {\n $errs[self::FIELD_IDENTIFIER] = [];\n }\n $errs[self::FIELD_IDENTIFIER][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_INTERVENTION_EXCEPTION])) {\n $v = $this->getInterventionException();\n foreach($validationRules[self::FIELD_INTERVENTION_EXCEPTION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_INTERVENTION_EXCEPTION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_INTERVENTION_EXCEPTION])) {\n $errs[self::FIELD_INTERVENTION_EXCEPTION] = [];\n }\n $errs[self::FIELD_INTERVENTION_EXCEPTION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_ITEM])) {\n $v = $this->getItem();\n foreach($validationRules[self::FIELD_ITEM] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_ITEM, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ITEM])) {\n $errs[self::FIELD_ITEM] = [];\n }\n $errs[self::FIELD_ITEM][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_MISSING_TEETH])) {\n $v = $this->getMissingTeeth();\n foreach($validationRules[self::FIELD_MISSING_TEETH] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_MISSING_TEETH, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_MISSING_TEETH])) {\n $errs[self::FIELD_MISSING_TEETH] = [];\n }\n $errs[self::FIELD_MISSING_TEETH][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_ORGANIZATION])) {\n $v = $this->getOrganization();\n foreach($validationRules[self::FIELD_ORGANIZATION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_ORGANIZATION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ORGANIZATION])) {\n $errs[self::FIELD_ORGANIZATION] = [];\n }\n $errs[self::FIELD_ORGANIZATION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_ORIGINAL_PRESCRIPTION])) {\n $v = $this->getOriginalPrescription();\n foreach($validationRules[self::FIELD_ORIGINAL_PRESCRIPTION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_ORIGINAL_PRESCRIPTION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ORIGINAL_PRESCRIPTION])) {\n $errs[self::FIELD_ORIGINAL_PRESCRIPTION] = [];\n }\n $errs[self::FIELD_ORIGINAL_PRESCRIPTION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_ORIGINAL_RULESET])) {\n $v = $this->getOriginalRuleset();\n foreach($validationRules[self::FIELD_ORIGINAL_RULESET] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_ORIGINAL_RULESET, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ORIGINAL_RULESET])) {\n $errs[self::FIELD_ORIGINAL_RULESET] = [];\n }\n $errs[self::FIELD_ORIGINAL_RULESET][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_PATIENT])) {\n $v = $this->getPatient();\n foreach($validationRules[self::FIELD_PATIENT] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_PATIENT, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_PATIENT])) {\n $errs[self::FIELD_PATIENT] = [];\n }\n $errs[self::FIELD_PATIENT][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_PAYEE])) {\n $v = $this->getPayee();\n foreach($validationRules[self::FIELD_PAYEE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_PAYEE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_PAYEE])) {\n $errs[self::FIELD_PAYEE] = [];\n }\n $errs[self::FIELD_PAYEE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_PRESCRIPTION])) {\n $v = $this->getPrescription();\n foreach($validationRules[self::FIELD_PRESCRIPTION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_PRESCRIPTION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_PRESCRIPTION])) {\n $errs[self::FIELD_PRESCRIPTION] = [];\n }\n $errs[self::FIELD_PRESCRIPTION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_PRIORITY])) {\n $v = $this->getPriority();\n foreach($validationRules[self::FIELD_PRIORITY] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_PRIORITY, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_PRIORITY])) {\n $errs[self::FIELD_PRIORITY] = [];\n }\n $errs[self::FIELD_PRIORITY][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_PROVIDER])) {\n $v = $this->getProvider();\n foreach($validationRules[self::FIELD_PROVIDER] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_PROVIDER, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_PROVIDER])) {\n $errs[self::FIELD_PROVIDER] = [];\n }\n $errs[self::FIELD_PROVIDER][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_REFERRAL])) {\n $v = $this->getReferral();\n foreach($validationRules[self::FIELD_REFERRAL] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_REFERRAL, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_REFERRAL])) {\n $errs[self::FIELD_REFERRAL] = [];\n }\n $errs[self::FIELD_REFERRAL][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_RULESET])) {\n $v = $this->getRuleset();\n foreach($validationRules[self::FIELD_RULESET] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_RULESET, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_RULESET])) {\n $errs[self::FIELD_RULESET] = [];\n }\n $errs[self::FIELD_RULESET][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_SCHOOL])) {\n $v = $this->getSchool();\n foreach($validationRules[self::FIELD_SCHOOL] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_SCHOOL, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_SCHOOL])) {\n $errs[self::FIELD_SCHOOL] = [];\n }\n $errs[self::FIELD_SCHOOL][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_TARGET])) {\n $v = $this->getTarget();\n foreach($validationRules[self::FIELD_TARGET] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_TARGET, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_TARGET])) {\n $errs[self::FIELD_TARGET] = [];\n }\n $errs[self::FIELD_TARGET][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_TYPE])) {\n $v = $this->getType();\n foreach($validationRules[self::FIELD_TYPE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_TYPE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_TYPE])) {\n $errs[self::FIELD_TYPE] = [];\n }\n $errs[self::FIELD_TYPE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_USE])) {\n $v = $this->getUse();\n foreach($validationRules[self::FIELD_USE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_USE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_USE])) {\n $errs[self::FIELD_USE] = [];\n }\n $errs[self::FIELD_USE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_CONTAINED])) {\n $v = $this->getContained();\n foreach($validationRules[self::FIELD_CONTAINED] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE, self::FIELD_CONTAINED, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_CONTAINED])) {\n $errs[self::FIELD_CONTAINED] = [];\n }\n $errs[self::FIELD_CONTAINED][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_EXTENSION])) {\n $v = $this->getExtension();\n foreach($validationRules[self::FIELD_EXTENSION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE, self::FIELD_EXTENSION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_EXTENSION])) {\n $errs[self::FIELD_EXTENSION] = [];\n }\n $errs[self::FIELD_EXTENSION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_MODIFIER_EXTENSION])) {\n $v = $this->getModifierExtension();\n foreach($validationRules[self::FIELD_MODIFIER_EXTENSION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE, self::FIELD_MODIFIER_EXTENSION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_MODIFIER_EXTENSION])) {\n $errs[self::FIELD_MODIFIER_EXTENSION] = [];\n }\n $errs[self::FIELD_MODIFIER_EXTENSION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_TEXT])) {\n $v = $this->getText();\n foreach($validationRules[self::FIELD_TEXT] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE, self::FIELD_TEXT, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_TEXT])) {\n $errs[self::FIELD_TEXT] = [];\n }\n $errs[self::FIELD_TEXT][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_ID])) {\n $v = $this->getId();\n foreach($validationRules[self::FIELD_ID] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_RESOURCE, self::FIELD_ID, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ID])) {\n $errs[self::FIELD_ID] = [];\n }\n $errs[self::FIELD_ID][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_IMPLICIT_RULES])) {\n $v = $this->getImplicitRules();\n foreach($validationRules[self::FIELD_IMPLICIT_RULES] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_RESOURCE, self::FIELD_IMPLICIT_RULES, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_IMPLICIT_RULES])) {\n $errs[self::FIELD_IMPLICIT_RULES] = [];\n }\n $errs[self::FIELD_IMPLICIT_RULES][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_LANGUAGE])) {\n $v = $this->getLanguage();\n foreach($validationRules[self::FIELD_LANGUAGE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_RESOURCE, self::FIELD_LANGUAGE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_LANGUAGE])) {\n $errs[self::FIELD_LANGUAGE] = [];\n }\n $errs[self::FIELD_LANGUAGE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_META])) {\n $v = $this->getMeta();\n foreach($validationRules[self::FIELD_META] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_RESOURCE, self::FIELD_META, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_META])) {\n $errs[self::FIELD_META] = [];\n }\n $errs[self::FIELD_META][$rule] = $err;\n }\n }\n }\n return $errs;\n }", "public function messages()\n {\n return [\n 'baskets.required' => trans('validation.recipe baskets'),\n 'steps.required' => trans('validation.recipe steps'),\n 'ingredients.required' => trans('validation.recipe ingredients'),\n ];\n }", "public function getValidationErrors() {\n\t\t$out = array();\n\t\t$this->loadFields();\n\t\tforeach($this->fields as $field) {\n\t\t\t$out = array_merge($out, $field->getValidationErrors());\n\t\t}\n\t\tif ((!$this->lat || !$this->lng) && !$this->feature_id) {\n\t\t\t$out[] = \"You must set a location!\";\n\t\t}\n\t\treturn $out;\n\t}", "public function errors() {\n $errors = array();\n foreach ($this->properties as $property) {\n if (!$property->rulesPassed()) {\n $errors[$property->getName()] = $property->getErrors();\n }\n }\n return $errors;\n }", "public function messages()\n {\n return [\n 'curp.required' => 'Falta la C.U.R.P.',\n 'curp.unique' => 'Esta C.U.R.P. ya existe',\n 'curp.min' => 'C.U.R.P. incorrecta',\n 'curp.max' => 'C.U.R.P. incorrecta',\n 'nombre1.required' => 'Falta el nombre',\n 'nombre1.min' => 'Nombre incorrecto',\n 'nombre1.max' => 'Nombre incorrecto',\n 'apellido1.required' => 'Falta el apellido',\n 'apellido1.min' => 'Apellido incorrecto',\n 'apellido1.max' => 'Apellido incorrecto',\n 'fechanacimiento.required' => 'Falta la fecha de nac.',\n 'genero.required' => 'Obligatorio'\n ];\n }", "public function getValidationErrors() {\n\t\treturn $this->_validationErrors;\n\t}", "private function getErrorMessages(): array\n {\n return [\n 'notEmpty' => 'Campo {{name}} obligatorio',\n 'date' => '{{name}} debe tener una fecha valida. Ejemplo de formato: {{format}}\\'',\n 'intVal' => '',\n 'between' => '',\n 'in' => '',\n 'floatVal' => '',\n 'length' => '',\n 'stringType' => '',\n 'objectType' => '',\n 'cantidadRegistros' => 'dsfsdfsd',\n 'periodo.notEmpty' => 'Campo Periodo: es obligatorio',\n 'periodo' => 'Campo Periodo: Debe tener el formato AAAAMM, donde AAAA indica el año y MM el mes en números',\n 'orden.notEmpty' => 'Campo Orden: es obligatorio',\n 'orden' => 'Campo Orden: Debe ser igual a 1 ó 2.',\n 'codigoComprobante.notEmpty' => 'Campo Codigo de Comprobante: es obligatorio',\n 'codigoComprobante' => 'Campo Codigo de Comprobante: Debe debe estar comprendido entre 1 y 9998.',\n 'numeroComprobante.notEmpty' => 'Campo Numero de Comprobante: es obligatorio',\n 'numeroComprobante' => 'Campo Numero de Comprobante: Debe debe estar comprendido entre 1 y 99999999.',\n 'puntoVenta.notEmpty' => 'Punto de venta: es obligatorio',\n 'puntoVenta' => 'Punto de venta: Debe debe estar comprendido entre 1 y 9998.',\n ];\n }", "public function messages()\n {\n return [\n 'code_area.required' => 'Code area cannot be blank',\n 'name.required' => 'Name area cannot be blank'\n ];\n }", "public function messages()\n {\n return [\n 'zipcode.required' => 'A Zipcode is required',\n 'publicPlace.required' => 'A Public Place is required',\n 'neighbordhood.required' => 'A Neighbordhood is required',\n 'complement.required' => 'A Complement Name is required',\n 'number.required' => 'A Number is required',\n 'city.required' => 'A City is required',\n 'state.required' => 'A State is required',\n\n 'zipcode.max' => 'A Zipcode max 255 characteres required.',\n 'publicPlace.max' => 'A Public Place max 255 characteres required.',\n 'neighbordhood.max' => 'A Neighbordhood max 255 characteres required.',\n 'complement.max' => 'A Complementmax 255 characteres required.',\n 'number.max' => 'A Number max 255 characteres required.',\n 'city.max' => 'A City max 255 characteres required.',\n 'state.max' => 'A State max 255 characteres required.',\n ];\n }", "public function validateAll()\n {\n $errorMsgs = array();\n return $errorMsgs;\n }", "public function _getValidationErrors()\n {\n $errs = parent::_getValidationErrors();\n $validationRules = $this->_getValidationRules();\n if ([] !== ($vs = $this->getCountry())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_COUNTRY, $i)] = $fieldErrs;\n }\n }\n }\n if (null !== ($v = $this->getDataExclusivityPeriod())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_DATA_EXCLUSIVITY_PERIOD] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getDateOfFirstAuthorization())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_DATE_OF_FIRST_AUTHORIZATION] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getHolder())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_HOLDER] = $fieldErrs;\n }\n }\n if ([] !== ($vs = $this->getIdentifier())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_IDENTIFIER, $i)] = $fieldErrs;\n }\n }\n }\n if (null !== ($v = $this->getInternationalBirthDate())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_INTERNATIONAL_BIRTH_DATE] = $fieldErrs;\n }\n }\n if ([] !== ($vs = $this->getJurisdiction())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_JURISDICTION, $i)] = $fieldErrs;\n }\n }\n }\n if ([] !== ($vs = $this->getJurisdictionalAuthorization())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_JURISDICTIONAL_AUTHORIZATION, $i)] = $fieldErrs;\n }\n }\n }\n if (null !== ($v = $this->getLegalBasis())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_LEGAL_BASIS] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getProcedure())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_PROCEDURE] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getRegulator())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_REGULATOR] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getRestoreDate())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_RESTORE_DATE] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getStatus())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_STATUS] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getStatusDate())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_STATUS_DATE] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getSubject())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_SUBJECT] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getValidityPeriod())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_VALIDITY_PERIOD] = $fieldErrs;\n }\n }\n if (isset($validationRules[self::FIELD_COUNTRY])) {\n $v = $this->getCountry();\n foreach($validationRules[self::FIELD_COUNTRY] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_COUNTRY, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_COUNTRY])) {\n $errs[self::FIELD_COUNTRY] = [];\n }\n $errs[self::FIELD_COUNTRY][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_DATA_EXCLUSIVITY_PERIOD])) {\n $v = $this->getDataExclusivityPeriod();\n foreach($validationRules[self::FIELD_DATA_EXCLUSIVITY_PERIOD] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_DATA_EXCLUSIVITY_PERIOD, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_DATA_EXCLUSIVITY_PERIOD])) {\n $errs[self::FIELD_DATA_EXCLUSIVITY_PERIOD] = [];\n }\n $errs[self::FIELD_DATA_EXCLUSIVITY_PERIOD][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_DATE_OF_FIRST_AUTHORIZATION])) {\n $v = $this->getDateOfFirstAuthorization();\n foreach($validationRules[self::FIELD_DATE_OF_FIRST_AUTHORIZATION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_DATE_OF_FIRST_AUTHORIZATION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_DATE_OF_FIRST_AUTHORIZATION])) {\n $errs[self::FIELD_DATE_OF_FIRST_AUTHORIZATION] = [];\n }\n $errs[self::FIELD_DATE_OF_FIRST_AUTHORIZATION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_HOLDER])) {\n $v = $this->getHolder();\n foreach($validationRules[self::FIELD_HOLDER] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_HOLDER, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_HOLDER])) {\n $errs[self::FIELD_HOLDER] = [];\n }\n $errs[self::FIELD_HOLDER][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_IDENTIFIER])) {\n $v = $this->getIdentifier();\n foreach($validationRules[self::FIELD_IDENTIFIER] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_IDENTIFIER, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_IDENTIFIER])) {\n $errs[self::FIELD_IDENTIFIER] = [];\n }\n $errs[self::FIELD_IDENTIFIER][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_INTERNATIONAL_BIRTH_DATE])) {\n $v = $this->getInternationalBirthDate();\n foreach($validationRules[self::FIELD_INTERNATIONAL_BIRTH_DATE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_INTERNATIONAL_BIRTH_DATE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_INTERNATIONAL_BIRTH_DATE])) {\n $errs[self::FIELD_INTERNATIONAL_BIRTH_DATE] = [];\n }\n $errs[self::FIELD_INTERNATIONAL_BIRTH_DATE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_JURISDICTION])) {\n $v = $this->getJurisdiction();\n foreach($validationRules[self::FIELD_JURISDICTION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_JURISDICTION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_JURISDICTION])) {\n $errs[self::FIELD_JURISDICTION] = [];\n }\n $errs[self::FIELD_JURISDICTION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_JURISDICTIONAL_AUTHORIZATION])) {\n $v = $this->getJurisdictionalAuthorization();\n foreach($validationRules[self::FIELD_JURISDICTIONAL_AUTHORIZATION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_JURISDICTIONAL_AUTHORIZATION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_JURISDICTIONAL_AUTHORIZATION])) {\n $errs[self::FIELD_JURISDICTIONAL_AUTHORIZATION] = [];\n }\n $errs[self::FIELD_JURISDICTIONAL_AUTHORIZATION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_LEGAL_BASIS])) {\n $v = $this->getLegalBasis();\n foreach($validationRules[self::FIELD_LEGAL_BASIS] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_LEGAL_BASIS, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_LEGAL_BASIS])) {\n $errs[self::FIELD_LEGAL_BASIS] = [];\n }\n $errs[self::FIELD_LEGAL_BASIS][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_PROCEDURE])) {\n $v = $this->getProcedure();\n foreach($validationRules[self::FIELD_PROCEDURE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_PROCEDURE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_PROCEDURE])) {\n $errs[self::FIELD_PROCEDURE] = [];\n }\n $errs[self::FIELD_PROCEDURE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_REGULATOR])) {\n $v = $this->getRegulator();\n foreach($validationRules[self::FIELD_REGULATOR] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_REGULATOR, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_REGULATOR])) {\n $errs[self::FIELD_REGULATOR] = [];\n }\n $errs[self::FIELD_REGULATOR][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_RESTORE_DATE])) {\n $v = $this->getRestoreDate();\n foreach($validationRules[self::FIELD_RESTORE_DATE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_RESTORE_DATE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_RESTORE_DATE])) {\n $errs[self::FIELD_RESTORE_DATE] = [];\n }\n $errs[self::FIELD_RESTORE_DATE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_STATUS])) {\n $v = $this->getStatus();\n foreach($validationRules[self::FIELD_STATUS] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_STATUS, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_STATUS])) {\n $errs[self::FIELD_STATUS] = [];\n }\n $errs[self::FIELD_STATUS][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_STATUS_DATE])) {\n $v = $this->getStatusDate();\n foreach($validationRules[self::FIELD_STATUS_DATE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_STATUS_DATE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_STATUS_DATE])) {\n $errs[self::FIELD_STATUS_DATE] = [];\n }\n $errs[self::FIELD_STATUS_DATE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_SUBJECT])) {\n $v = $this->getSubject();\n foreach($validationRules[self::FIELD_SUBJECT] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_SUBJECT, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_SUBJECT])) {\n $errs[self::FIELD_SUBJECT] = [];\n }\n $errs[self::FIELD_SUBJECT][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_VALIDITY_PERIOD])) {\n $v = $this->getValidityPeriod();\n foreach($validationRules[self::FIELD_VALIDITY_PERIOD] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_VALIDITY_PERIOD, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_VALIDITY_PERIOD])) {\n $errs[self::FIELD_VALIDITY_PERIOD] = [];\n }\n $errs[self::FIELD_VALIDITY_PERIOD][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_CONTAINED])) {\n $v = $this->getContained();\n foreach($validationRules[self::FIELD_CONTAINED] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE, self::FIELD_CONTAINED, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_CONTAINED])) {\n $errs[self::FIELD_CONTAINED] = [];\n }\n $errs[self::FIELD_CONTAINED][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_EXTENSION])) {\n $v = $this->getExtension();\n foreach($validationRules[self::FIELD_EXTENSION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE, self::FIELD_EXTENSION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_EXTENSION])) {\n $errs[self::FIELD_EXTENSION] = [];\n }\n $errs[self::FIELD_EXTENSION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_MODIFIER_EXTENSION])) {\n $v = $this->getModifierExtension();\n foreach($validationRules[self::FIELD_MODIFIER_EXTENSION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE, self::FIELD_MODIFIER_EXTENSION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_MODIFIER_EXTENSION])) {\n $errs[self::FIELD_MODIFIER_EXTENSION] = [];\n }\n $errs[self::FIELD_MODIFIER_EXTENSION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_TEXT])) {\n $v = $this->getText();\n foreach($validationRules[self::FIELD_TEXT] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE, self::FIELD_TEXT, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_TEXT])) {\n $errs[self::FIELD_TEXT] = [];\n }\n $errs[self::FIELD_TEXT][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_ID])) {\n $v = $this->getId();\n foreach($validationRules[self::FIELD_ID] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_RESOURCE, self::FIELD_ID, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ID])) {\n $errs[self::FIELD_ID] = [];\n }\n $errs[self::FIELD_ID][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_IMPLICIT_RULES])) {\n $v = $this->getImplicitRules();\n foreach($validationRules[self::FIELD_IMPLICIT_RULES] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_RESOURCE, self::FIELD_IMPLICIT_RULES, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_IMPLICIT_RULES])) {\n $errs[self::FIELD_IMPLICIT_RULES] = [];\n }\n $errs[self::FIELD_IMPLICIT_RULES][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_LANGUAGE])) {\n $v = $this->getLanguage();\n foreach($validationRules[self::FIELD_LANGUAGE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_RESOURCE, self::FIELD_LANGUAGE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_LANGUAGE])) {\n $errs[self::FIELD_LANGUAGE] = [];\n }\n $errs[self::FIELD_LANGUAGE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_META])) {\n $v = $this->getMeta();\n foreach($validationRules[self::FIELD_META] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_RESOURCE, self::FIELD_META, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_META])) {\n $errs[self::FIELD_META] = [];\n }\n $errs[self::FIELD_META][$rule] = $err;\n }\n }\n }\n return $errs;\n }", "public function _getValidationErrors()\n {\n $errs = parent::_getValidationErrors();\n $validationRules = $this->_getValidationRules();\n if (null !== ($v = $this->getCity())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_CITY] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getCountry())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_COUNTRY] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getDistrict())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_DISTRICT] = $fieldErrs;\n }\n }\n if ([] !== ($vs = $this->getLine())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_LINE, $i)] = $fieldErrs;\n }\n }\n }\n if (null !== ($v = $this->getPeriod())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_PERIOD] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getPostalCode())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_POSTAL_CODE] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getState())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_STATE] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getText())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_TEXT] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getType())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_TYPE] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getUse())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_USE] = $fieldErrs;\n }\n }\n if (isset($validationRules[self::FIELD_CITY])) {\n $v = $this->getCity();\n foreach($validationRules[self::FIELD_CITY] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_ADDRESS, self::FIELD_CITY, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_CITY])) {\n $errs[self::FIELD_CITY] = [];\n }\n $errs[self::FIELD_CITY][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_COUNTRY])) {\n $v = $this->getCountry();\n foreach($validationRules[self::FIELD_COUNTRY] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_ADDRESS, self::FIELD_COUNTRY, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_COUNTRY])) {\n $errs[self::FIELD_COUNTRY] = [];\n }\n $errs[self::FIELD_COUNTRY][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_DISTRICT])) {\n $v = $this->getDistrict();\n foreach($validationRules[self::FIELD_DISTRICT] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_ADDRESS, self::FIELD_DISTRICT, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_DISTRICT])) {\n $errs[self::FIELD_DISTRICT] = [];\n }\n $errs[self::FIELD_DISTRICT][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_LINE])) {\n $v = $this->getLine();\n foreach($validationRules[self::FIELD_LINE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_ADDRESS, self::FIELD_LINE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_LINE])) {\n $errs[self::FIELD_LINE] = [];\n }\n $errs[self::FIELD_LINE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_PERIOD])) {\n $v = $this->getPeriod();\n foreach($validationRules[self::FIELD_PERIOD] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_ADDRESS, self::FIELD_PERIOD, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_PERIOD])) {\n $errs[self::FIELD_PERIOD] = [];\n }\n $errs[self::FIELD_PERIOD][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_POSTAL_CODE])) {\n $v = $this->getPostalCode();\n foreach($validationRules[self::FIELD_POSTAL_CODE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_ADDRESS, self::FIELD_POSTAL_CODE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_POSTAL_CODE])) {\n $errs[self::FIELD_POSTAL_CODE] = [];\n }\n $errs[self::FIELD_POSTAL_CODE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_STATE])) {\n $v = $this->getState();\n foreach($validationRules[self::FIELD_STATE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_ADDRESS, self::FIELD_STATE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_STATE])) {\n $errs[self::FIELD_STATE] = [];\n }\n $errs[self::FIELD_STATE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_TEXT])) {\n $v = $this->getText();\n foreach($validationRules[self::FIELD_TEXT] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_ADDRESS, self::FIELD_TEXT, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_TEXT])) {\n $errs[self::FIELD_TEXT] = [];\n }\n $errs[self::FIELD_TEXT][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_TYPE])) {\n $v = $this->getType();\n foreach($validationRules[self::FIELD_TYPE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_ADDRESS, self::FIELD_TYPE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_TYPE])) {\n $errs[self::FIELD_TYPE] = [];\n }\n $errs[self::FIELD_TYPE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_USE])) {\n $v = $this->getUse();\n foreach($validationRules[self::FIELD_USE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_ADDRESS, self::FIELD_USE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_USE])) {\n $errs[self::FIELD_USE] = [];\n }\n $errs[self::FIELD_USE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_EXTENSION])) {\n $v = $this->getExtension();\n foreach($validationRules[self::FIELD_EXTENSION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_ELEMENT, self::FIELD_EXTENSION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_EXTENSION])) {\n $errs[self::FIELD_EXTENSION] = [];\n }\n $errs[self::FIELD_EXTENSION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_ID])) {\n $v = $this->getId();\n foreach($validationRules[self::FIELD_ID] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_ELEMENT, self::FIELD_ID, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ID])) {\n $errs[self::FIELD_ID] = [];\n }\n $errs[self::FIELD_ID][$rule] = $err;\n }\n }\n }\n return $errs;\n }", "public function messages() : array\n {\n return [\n 'department_id.required' => 'The department field is required.',\n 'user_group_id.required' => 'The user group field is required.',\n 'password.required_if' => 'The password field is required.',\n ];\n }", "public function messages()\n {\n return [\n 'style.required' => 'Please the style is required',\n 'service.required' => 'Please select service type',\n 'session.required' => 'Please select session'\n ];\n }", "public function messages()\n {\n return [\n 'candidates_needed.required' => 'The candidates number field is required!',\n 'start_posting_date.required' => 'The start posting date field is required!',\n 'end_posting_date.required' => 'The end posting date field is required!',\n 'appl_deadline_date.required' => 'The application deadline field is required!',\n 'start_trial_date.required' => 'The start trial field is required!',\n 'end_trial_date.required' => 'The end trial field is required!',\n ];\n }", "public function messages()\n {\n return [\n 'title.required' => 'A title is required',\n 'title.max' => 'Title is too long',\n 'image.required' => 'An image is required',\n ];\n }", "public function messages()\n {\n return [\n 'name.required' => 'A name is required.',\n 'color.required' => 'Please select a color.'\n ];\n }", "public function messages() {\n\t\treturn [\n\t\t\t'titulo.required' => 'El :attribute es obligatorio.',\n\t\t\t'descripcion.required' => 'La :attribute es obligatoria',\n\t\t\t'ciudad.required' => 'La :attribute es obligatoria',\n\t\t\t'telefono.required' => 'El :attribute es obligatorio.',\n\t\t\t'latitud.required' => 'La :attribute es obligatoria',\n\t\t\t'longitud.required' => 'La :attribute es obligatoria',\n\t\t\t'subcategoria.required' => 'La :attribute es obligatoria',\n\t\t\t'tags.required' => 'Los :attribute son obligatorios',\n\t\t];\n\t}", "public function messages() {\n return [\n 'name.required' => 'Missing name.',\n 'description.required' => 'Missing description.',\n 'max_level.required' => 'Missing max level.',\n 'bonus_per_level.required' => 'Missing bonus per level.',\n 'effect_type.required' => 'Missing effect type.',\n 'hours_per_level.required' => 'Missing length of time per level.'\n ];\n }", "public function messages()\n {\n return [\n 'contractor_account_id.exists' => 'Invalid data.',\n 'truck_id.exists' => 'Invalid data.',\n 'source_id.exists' => 'Invalid data.',\n 'destination_id.exists' => 'Invalid data.',\n 'driver_id.exists' => 'Invalid data.',\n 'material_id.exists' => 'Invalid data.',\n ];\n }", "public function getErrors()\n {\n return $this->_arrValidationErrors;\n }", "public function messages()\n {\n return [\n 'origin.required' => 'INVALID_PARAMETERS',\n 'destination.required' => 'INVALID_PARAMETERS',\n ];\n }", "public function messages()\n {\n return [\n 'name.required' => 'Name is required!',\n 'category.required' => 'category is required!',\n 'price.required' => 'price is required!',\n 'price.regex' => 'invalid price!',\n 'weight.required' => 'weight is required!',\n 'stock.required' => 'stock is required!',\n 'stock.integer' => 'invalid stock!',\n 'files.mimes' => 'invalid File(s)!',\n 'files.max' => 'File size must be 2MB or lesser !',\n ];\n }", "public function messages()\n {\n return [\n 'first_name.required' => 'First name cannot be blank.',\n 'first_name.string' => 'First name must be formatted as a string.',\n 'first_name.max' => 'First name exceeded the max number of characters.',\n 'last_name.required' => 'Last name cannot be blank.',\n 'last_name.string' => 'Last name must be formatted as a string.',\n 'last_name.max' => 'Last name exceeded the max number of characters.',\n 'email.required' => 'Email cannot be blank.',\n 'email.string' => 'Email name must be formatted as a string.',\n 'email.email' => 'Email must be formatted as a valid email address',\n 'email.max' => 'Email exceeded the max number of characters.',\n ];\n }", "public function messages()\n {\n return [\n 'name' => 'required',\n 'address' => 'required',\n 'city' => 'required',\n 'latitude' => 'required',\n 'longitude' => 'required',\n 'type' => 'required',\n 'is_public' => 'required',\n 'school_zone' => 'required',\n ];\n }", "public function getErrors()\n {\n return $this->validator->errors();\n }", "public function getValidationErrors()\n\t{\n\t\tif(is_array($this->validation_errors) && \n\t\t\tsizeof($this->validation_errors))\n\t\t{\n\t\t\treturn array_unique($this->validation_errors);\n\t\t}\n\t\treturn array();\n\t}", "public function messages()\n {\n return [\n 'name.required' => 'Full Name is required',\n 'name.min' => 'Name must be of minimum 3 characters',\n 'name.max' => 'Name can be of maximum 190 characters',\n 'support_pin.required' => 'Support PIN is required',\n 'support_pin.numeric' => 'Support PIN can only be numeric',\n 'support_pin.digits' => 'Only 4 digit Support PIN is accepted',\n 'rng_level.required' => 'Random Generator Difficutly is required',\n 'rng_level.numeric' => 'Invalid Random Generator Setting',\n 'rng_level.digits' => 'Invalid Random Generator Setting',\n 'dob.required' => 'Date of Birth is required',\n 'mobile.required' => 'Mobile Number is required',\n 'mobile.numeric' => 'Mobile Number can only be numeric',\n 'country' => 'Country is required',\n ];\n }", "public function getErrors()\n\t{\n\t\t$errors = array();\n\t\t/** @var Miao_Form_Control $control */\n\t\t/** @var Miao_Form_Validate $validator */\n\t\tforeach ( $this->getControls() as $control )\n\t\t{\n\t\t\tif ( !$control->isValid() )\n\t\t\t{\n\t\t\t\t$validator = $control->error();\n\t\t\t\t$errors[] = array(\n\t\t\t\t\t'name' => $control->getName(),\n\t\t\t\t\t'error' => $validator->getMessage() );\n\t\t\t}\n\t\t}\n\t\treturn $errors;\n\t}", "public function messages()\n {\n return [\n 'title.required' => Lang::get('controller.title_required'),\n 'title.string' => Lang::get('controller.title_required'),\n 'description.required' => Lang::get('controller.description_required'),\n 'topic_id.required' => Lang::get('controller.topic_id_required'),\n 'grade_id.required' => Lang::get('controller.grade_id_required'),\n 'skill_category_id.required' => Lang::get('controller.skill_category_id_required'),\n 'language_id.required' => Lang::get('controller.language_id_required'),\n 'publish_status.required' => Lang::get('controller.publish_status_required'),\n 'minimum_age.required' => Lang::get('controller.minimum_age_required'),\n 'maximum_age.required' => Lang::get('controller.maximum_age_required'),\n ];\n }", "public function messages()\n {\n return [\n 'created_by_id.required' => 'Employer Id is required',\n 'created_by_id.numeric' => 'Employer Id must be an integer type',\n 'team_name.required' => 'Team Name is required',\n 'team_name.string' => 'Team Name must be a string type',\n 'company_id.required' => 'Company Id is required',\n 'company_id.numeric' => 'Company Id must be an integer',\n ];\n }", "public function messages()\n {\n return array_merge(trans('news::validation'), trans('news::validation.custom'));\n }", "protected function messages()\n {\n return [\n 'id.required' => HttpAttributeInvalidCode::ID_REQUIRED,\n 'password.required' => HttpAttributeInvalidCode::PASSWORD_REQUIRED,\n 'password.same' => HttpAttributeInvalidCode::CONFIRM_PASSWORD_NOT_SAME,\n 'display_name.required' => HttpAttributeInvalidCode::DISPLAY_NAME_REQUIRED,\n 'role_id.required' => HttpAttributeInvalidCode::ROLE_REQUIRED,\n 'status.required' => HttpAttributeInvalidCode::STATUS_REQUIRE\n ];\n }", "function getValidationRules() {\n\t\treturn array(\n\t\t\t'_MovieID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_UserID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_CountryID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_BroadCastDate' => array(\n\t\t\t\t'dateTime' => array(),\n\t\t\t),\n\t\t\t'_CreatedDate' => array(\n\t\t\t\t'dateTime' => array(),\n\t\t\t),\n\t\t);\n\t}", "public function messages()\n {\n $illegalFields = [ 'email', 'type', 'status', 'branches', ];\n $messages = [];\n\n foreach ($illegalFields as $key => $attribute) {\n $messages[\"{$attribute}.not_present\"] = __('The field :attribute must not be present.');\n }\n\n return $messages;\n }", "public function messages()\n {\n return [\n 'truck_id.required' => 'The truck field is required.',\n 'truck_id.exists' => 'Invalid data.',\n 'account_id.required' => 'The supplier field is required.',\n 'account_id.exists' => 'Invalid data.'\n ];\n }", "public function getValidationErrors() {\n\t\tif ($this->_errors === null) {\n\t\t\treturn array();\n\t\t}\n\n\t\treturn $this->_errors->toArray();\n\t}", "public function getErrors(): array {\n return $this->validationError;\n }", "function getErrors()\n {\n $errMsg = '';\n foreach ($this->errors as $error) {\n $errMsg .= $error;\n $errMsg .= '<br/>';\n }\n return $errMsg;\n }", "public function messages()\n {\n return $messages = [\n 'source_funds.required' => trans('common.error_messages.req_this_field'),\n 'jurisdiction_funds.required' => trans('common.error_messages.req_this_field'),\n 'annual_income.required' => trans('common.error_messages.req_this_field'),\n 'other_source.required' => trans('common.error_messages.req_this_field'),\n 'estimated_wealth.required' => trans('common.error_messages.req_this_field'),\n 'wealth_source.required' => trans('common.error_messages.req_this_field'),\n 'other_wealth_source.required' => trans('common.error_messages.req_this_field'),\n 'tin_code.required' => trans('common.error_messages.req_this_field'),\n 'is_abandoned.required' => trans('common.error_messages.req_this_field'),\n 'date_of_abandonment.required' => trans('common.error_messages.req_this_field'),\n 'abandonment_reason.required' => trans('common.error_messages.req_this_field'),\n 'justification.required' => trans('common.error_messages.req_this_field'),\n 'tin_country_name.required' => trans('common.error_messages.req_this_field'),\n 'tin_number.required' => trans('common.error_messages.req_this_field'),\n ];\n }", "function getValidationRules() {\n\t\treturn array(\n\t\t\t'_ID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_CoverImageID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_TrackID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_Status' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_Rank' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_CreateDate' => array(\n\t\t\t\t'dateTime' => array(),\n\t\t\t),\n\t\t);\n\t}", "public function messages()\n {\n /*\n return [\n 'bio.required' => 'Bio is required',\n 'state.required' => 'State is required',\n 'city.required' => 'City name is required',\n 'postalcode.required' => 'Postal Code is required',\n 'gender.required' => 'Gender is required',\n 'seeking_gender.requred' => 'Gender you are searching for is required',\n ];\n */\n }", "private function getValidationRules(): array\n {\n return [\n 'year_month' => new Assert\\DateTime(\n [\n 'format' => 'Y-m',\n 'message' => 'Unexpected $yearMonth value. `Y-m` format is expected.',\n ]\n ),\n 'months_count' => new Assert\\Range(\n [\n 'min' => 1,\n 'max' => 12,\n 'minMessage' => 'Months count must be at least {{ limit }}',\n 'maxMessage' => 'Months count must not be greater than {{ limit }}',\n ]\n ),\n ];\n }", "public function getErrorMessages(){\n return $this->arr_msg; \n }" ]
[ "0.82462656", "0.8072122", "0.79855305", "0.7869173", "0.7831077", "0.7776483", "0.7776483", "0.7589036", "0.75582355", "0.75402904", "0.75402904", "0.7525044", "0.75227535", "0.7516879", "0.7475822", "0.7457696", "0.7425241", "0.74180096", "0.7405273", "0.7405273", "0.7400484", "0.7395581", "0.7392798", "0.7389888", "0.7360024", "0.73180616", "0.73162127", "0.7305573", "0.7279752", "0.7274237", "0.7268171", "0.7261277", "0.7242113", "0.72149134", "0.7214028", "0.7211038", "0.72069424", "0.7205835", "0.71890676", "0.7186795", "0.7184488", "0.71786416", "0.7169952", "0.7161326", "0.715333", "0.7151148", "0.7149324", "0.7133506", "0.712178", "0.7110109", "0.71095705", "0.7093795", "0.7087011", "0.70712256", "0.7070143", "0.70600915", "0.7059444", "0.7056968", "0.704947", "0.70437986", "0.70437384", "0.7041736", "0.7038512", "0.7036984", "0.7032627", "0.70229805", "0.70208246", "0.702044", "0.7007877", "0.7000938", "0.69963926", "0.69936424", "0.69912916", "0.6985551", "0.6982829", "0.6981308", "0.6980877", "0.6979931", "0.69782096", "0.6977083", "0.69753224", "0.69692177", "0.6966572", "0.6958873", "0.6957573", "0.6957456", "0.6944549", "0.69384116", "0.6934856", "0.69259256", "0.6918059", "0.6914203", "0.6909962", "0.69095904", "0.6906319", "0.6900933", "0.6900174", "0.6893932", "0.6892958", "0.68911815", "0.6887292" ]
0.0
-1
get post request data for title and article
public function create(TaskRequest $request) { $data = $request->only(["task", "priority"]); // create article with data and store in DB $task = Task::create($data); // return the article along with a 201 status code return response($task, 201); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function post_params() {\n return [\n 'title' => $this->params['title'],\n 'excerpt' => $this->params['excerpt'],\n 'content' => $this->params['content'],\n 'tags' => $this->params['tags']\n ];\n }", "function fetch_data_from_post()\n{\n $data['title'] = $this->input->post('title', TRUE);\n $data['url'] = $this->input->post('url', TRUE);\n $data['description'] = $this->input->post('description', TRUE);\n $data['content'] = $this->input->post('content', TRUE);\n $data['date'] = $this->input->post('date', TRUE);\n $data['keywords'] = $this->input->post('keywords', TRUE);\n return $data;\n}", "public function getPost ();", "private function getCategoryPostData()\n {\n // Get data from form fields\n $this->data['category_title'] = $this->input->post('category_title');\n }", "public function get_post_data() {\n\t\treturn $this->post;\n\t}", "public function ParsePostData() {}", "public function getPost($param);", "protected function articleData(Request $request)\n {\n $path = $this->handlePhoto($request);\n $articleData= $request->only( 'title', 'description', 'photo', 'summary' );\n $articleData['photo'] = $path;\n return $articleData;\n }", "public function getPostContent();", "public function getPostParams()\n {\n return $this->post;\n }", "public function showRequestPost();", "function getFromPost() {\r\n\t\t\r\n\t\t//Event Page variables.\r\n\t\t$this->name = $_POST['eventName'];\r\n\t\t$this->date = $_POST['eventDate'];\r\n\t\t$this->time = $_POST['eventTime'];\r\n\t\t$this->time_before = $_POST['time_before'];\r\n\t\t$this->freq = $_POST['frequency'];\r\n\t\t$this->notif_method = $_POST['method'];\r\n\t}", "protected function getPostValues() {}", "public function getPost()\n {\n $request = $this->getRequest();\n return $request->getPost();\n }", "public function getPostVariables();", "public function getData()\n {\n return Post::find(request()->id);\n }", "public function getRequestData();", "function readFromPost() {\n\t\t$this->idt = requestVar('idt');\n\t\t$this->newIdt = requestVar('template');\n\t\t$this->description = requestVar('description');\n\t\t$this->postsHeader = requestVar('postListHeader');\n\t\t$this->postBody = requestVar('postBody');\n\t\t$this->postsFooter = requestVar('postListFooter');\n\t\t$this->formLogged = requestVar('formLogged');\n\t\t$this->form = requestVar('formNotLogged');\n\t\t$this->navigation = requestVar('navigation');\n\t\t$this->name = requestVar('nameNoUrl');\n\t\t$this->nameLin = requestVar('nameUrl');\n\t\t$this->memberName = requestVar('memberName');\n\t\t$this->date = requestVar('date');\n\t\t$this->time = requestVar('time'); \n\t\t$this->nextPage = requestVar('nextPage');\n\t\t$this->previousPage =requestVar('previousPage');\n\t\t$this->firstPage = requestVar('firstPage');\n\t\t$this->lastPage = requestVar('lastPage');\t\n\n\t\t$this->urlToLink = (requestVar('urlToLink') == 'yes') ? true : false;\n\t\t$this->emoToImg = \t (requestVar('emoToImg') == 'yes') ?true : false;\n\t\t$this->gravSize = \t (int)requestVar('gravSize');\n\t\t$this->gravDefault = requestVar('gravDefault');;\n\n\n\t\t\n\t\t$this->action = requestVar('action');\n\t}", "public function post_post()\n\t{\n\t\ttry {\n\t\t\t$results = Articles::regist( self::$_JSON );\n\t\t\t//\\Log::warning(print_r($results, true));\n\n\t\t\treturn $this->response($results, 200);\n\t\t} catch (\\MarcoPandaException $e) {\n\t\t\t$this->error($e);\n\t\t}\n\t}", "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 }", "public function parsePostData()\n {\n }", "public function getPostRequest(): ParameterBag { return $this->post; }", "public function getPostParams()\n {\n return $this->request->all();\n }", "function prePost(){\t\n\t\t\n\t\tif( !$_GET['cod'] ) \n\t\t\t$_POST['DataPublicacao'] = date(\"d/m/Y H:i:s\");\n\t\t\t\n\t\t$utils = new Utils();\n\t\t\n\t\t$Url = $utils->cleanUrl($_POST['Nome']);\n\t\t\n\t\t$_POST['Url'] = $Url;\n\t\t\n\t\treturn $_POST;\t\n\t\n\t}", "public function createPostFromInput() {\n\n $record = [\n 'id_config' => post_config()->getCurrent()->get('id'),\n 'id_user' => user()->getCurrent()->get('id'),\n 'id_parent' => in('id_parent', 0),\n 'subject' => in('subject', ''),\n 'content' => in('content', ''),\n 'content_stripped' => strip_tags(in('content')),\n 'content_type' => in('content_type'),\n 'id_browser' => getBrowserID(),\n 'ip' => getIP(),\n 'domain' => getDomain(),\n 'user_agent' => getUserAgent(),\n 'country' => in('country'),\n 'province' => in('province'),\n 'city' => in('city'),\n 'link' => in('link'),\n ];\n $post = $this->createPost($record);\n\n $this->updateData($post);\n return $post;\n }", "public function storePost($title,$description);", "private function getParameterFromCreateNewsForm($res)\n {\n $params = null;\n if (isset($res) && !empty($res)) {\n if (!empty($res['filter'])) {\n $filter = implode(\",\", $res['filter']);\n } else {\n $filter = null;\n }\n\n $params = array(\n 'id' => null,\n 'title' => htmlentities($res['title'], null, 'UTF-8'),\n 'data' => htmlentities($res['data'], null, 'UTF-8'),\n 'filter' => $filter,\n 'author' => null,\n 'category' => $res['category'],\n 'published' => htmlentities($res['published'], null, 'UTF-8'),\n 'deleted' => null\n );\n }\n\n return $params;\n }", "public function paramsPost()\r\n {\r\n return $this->params_post;\r\n }", "public function inputPost(){\n\n \tpostInput::create(request([\n\t\t 'title',\n\t\t 'content',\n \t\t]));\n\n \t// Redirect to schedule\n \treturn redirect('index');\n }", "public function post($post);", "public function getPost(): array;", "function readInputData() {\r\n\t\t$this->readUserVars(array(\r\n\t\t\t'articleId'\t\r\n\t\t\t));\r\n\t}", "function get_post_data() {\n\t\tif (empty($this->post)) :\n\t\t\t$this->post = get_post( $this->id );\n\t\tendif;\n\t\t\n\t\treturn $this->post;\n\t}", "public function post();", "public function post();", "public function post();", "protected function getFormData() {\n\t\treturn $this->stripNonPrintables(json_decode($this->request->postVar('Details'), true));\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}", "public function getPostFields()\n {\n return $this->invokeWrappedIfEntityEnclosed(__FUNCTION__, func_get_args());\n }", "protected function setPostData()\n\t{\n\t\t$this->request->addPostFields($this->query->getParams());\n\t}", "abstract public function post($data);", "public static function postContent( $request ) {\n $postData = self::_getPostFromId( $request->get_param('id') );\n\n $data = new stdClass();\n $data->id = $postData->ID;\n $data->lead = $postData->lead;\n $data->content = $postData->content_wo_lead;\n \n return $data;\n }", "abstract public function post();", "private function postData()\n {\n $post = array_filter($this->post);\n\n return http_build_query($post);\n }", "abstract public function parsePostData() : array;", "public function getPost()\n {\n return $this->post;\n }", "private function _fill_insert_data() {\n $data = array();\n $data['numero_ticket'] = $this->_generate_numero_ticket();\n $data['descripcion'] = $this->post('descripcion');\n $data['soporte_categoria_id'] = $this->post('soporte_categoria_id');\n $data['persona_id'] = get_persona_id();\n $data['created_at'] = date('Y-m-d H:i:s');\n $data['status'] = 1;\n return $data;\n }", "public function getPostData() {\n \t\n \t// Return POST\n \treturn $this->oPostData;\n }", "private static function getPostParams()\n\t{\n\t\treturn (count($_POST) > 0) ? $_POST : json_decode(file_get_contents('php://input'), true);\n\t}", "public function provideAction(){\n if($this->request->hasArgument('post')){\n $post = $this->postRepository->findByUid($this->request->getArgument('post'));\n if($post){\n $array['uid'] = $this->request->getArgument('post');\n $array['content'] = $post->getContent();\n $array['crdate'] = $post->getCrdate();\n $array['owner'] = $post->getOwner();\n $this->view->assign('dataJson',json_encode($array));\n }\n else{\n $this->view->assign('dataJson',json_encode(['content' => '<div class=\"alert alert-warning\">Post ('.$this->request->getArgument('post').') is not accessible or could not be loaded!</div>']));\n }\n }\n else{\n $this->view->assign('dataJson',json_encode(['content' => '<div class=\"alert alert-danger\">No post ID given!</div>']));\n }\n }", "public function postAction()\n {\n \t$this->_object->title = $this->getRequest()->getParam('title');\n \t$this->_object->text = $this->getRequest()->getParam('text');\n \t$this->_object->answer = $this->getRequest()->getParam('answer');\n\t\t$this->_object->tag = $this->getRequest()->getParam('tags');\n\t\t$this->_objectMapper->save($this->_object);\n \t$this->getResponse()\n ->setHttpResponseCode(201);\n }", "public function getFormData(){\n\n\t\t\t\n\t\t\t$expectedVariables = ['title','email','checkbox'];\n\n\n\t\t\tforeach ($expectedVariables as $variable) {\n\n\t\t\t\t// creating entries for error field\t\n\t\t\t\t$this->moviesuggest['errors'][$variable]=\"\";\n\n\t\t\t\t// move all $_POST values into MovieSuggest array\n\t\t\t\tif(isset($_POST[$variable])){\n\t\t\t\t\t$this->moviesuggest[$variable] = $_POST[$variable];\n\t\t\t\t}else{\n\t\t\t\t\t$this->moviesuggest[$variable] = \"\";\n\t\t\t\t}\n\t\t\t}\n\n\n\t\t\t// var_dump($moviesuggest);\n\t\t\t// die();\n\t}", "function getFromPost()\r\n {\r\n $CI = &get_instance();\r\n $note = new Note;\r\n //correct form?\r\n if ($CI->input->post('formname')!='note') {\r\n return null;\r\n }\r\n //get basic data\r\n $note->note_id = $CI->input->post('note_id');\r\n $note->text = $CI->input->post('text');\r\n $note->pub_id = $CI->input->post('pub_id');\r\n $note->user_id = $CI->input->post('user_id');\r\n\r\n return $note;\r\n }", "function gatherMovieInfoFromPost( $params ) \n\t{\n\t\tif (!empty($params['localdbid']))\n\t\t\t$movieinfo['localdbid'] = $params['localdbid'];\n\t\t$movieinfo['filepath'] = $params['filepath'];\n\t\t$movieinfo['duration'] = $params['duration'];\n\t\t$movieinfo['title'] = $params['title'];\n\t\t$movieinfo['imdbid'] = $params['imdbid'];\n\t\t$movieinfo['original_title'] = $params['original_title'];\n\t\t$movieinfo['year'] = $params['year'];\n\t\t$movieinfo['mpaa'] = $params['mpaa'];\n\t\t$movieinfo['director'] = $params['director'];\n\t\t$movieinfo['writers'] = $params['writers'];\n\t\t$movieinfo['tagline'] = $params['tagline'];\n\t\t$movieinfo['genres'] = $params['genres'];\n\t\t$movieinfo['overview'] = $params['overview'];\n\t\t$movieinfo['plot'] = $params['overview'];\n\t\t$movieinfo['actors'] = $params['actors'];\n\t\t$movieinfo['thumb'] = isset($params['thumb']) ? urldecode($params['thumb']) : '';\n\t\t$movieinfo['allthumbs'] = urldecode($params['allthumbs']);\n\n\t\treturn $movieinfo;\n\t}", "public function get_request_content();", "function lesson_title(){\n return $_POST['lesson-title'];\n}", "public function createFromPost($info)\n\t{\n\t\t//task info\n\t\tif (isset($_SESSION['userid'])) $this->userid = $_SESSION['userid'];\n\t\t\n\t\tif (isset($info['title'])) $this->title = $info['title'];\n\t\t\n\t\tif (isset($info['description'])) $this->description = $info['description'];\n\t\t\n\t\tif (isset($info['content'])) $this->content = $info['content'];\n\t\t\n\t\tif (isset($info['location'])) $this->location = $info['location'];\n\t\t\n\t\tif (isset($info['price'])) $this->price = $info['price'];\n\t\t\n\t\t//metadata\n\t\tif (isset($info['category'])) $this->category = $info['category'];\n\t\t\n\t\tif (isset($info['tags'])) $this->tags = $info['tags'];\n\t\t\n\t\tif (isset($info['numimg'])) $this->numimg = $info['numimg'];\n\t\t\n\t\tif (isset($info['enddatetime'])) $this->enddatetime = $info['enddatetime'];\n\t}", "public function parsePost($post){\n\t\t\n\t\t$postData = array();\n\t\t$postData['id'] = $post->id;\n\t\t$postData['title'] = $post->title;\n\t\t$postData['slug'] = $post->slug;\n\t\t$postData['url'] = Yii::app()->createAbsoluteUrl('/news/'.$post->id.'/'.$post->slug);\n\t\t$postData['description'] = $post->description;\n\t\t$postData['source'] = $post->source;\n\t\t$postData['source_title'] = $post->source_title;\n\t\t$postData['created_dt'] = $this->time2StringFormatted($post->created_dt);\n\t\t$postData['updated_dt'] = $this->time2StringFormatted($post->updated_dt);\n\t\t$postData['image'] = $post->image != '' ? Yii::app()->request->hostInfo . Yii::app()->request->baseUrl . '/static/' . $post->image : Yii::app()->request->hostInfo . Yii::app()->request->baseUrl . '/static/default_image.png';\n\t\t$postData['category'] = array();\n\t\tif($post->cat_id){\n\t\t\t$postData['category']['cat_id'] = $post->cat_id;\n\t\t\t$postData['category']['title'] = $post->Cat->title;\n\t\t}\n\t\t$postData['author'] = array();\n\t\tif($post->user_id){\n\t\t\t$postData['author']['user_id'] = $post->user_id;\n\t\t\t$postData['author']['user_full_name'] = $post->User->user_full_name;\n\t\t}\n\t\treturn $postData;\n\t\t\n\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}", "public function OrderDataPost($postData){\n //do something awesome with that post data\n return \"I am in\";\n }", "public function formData()\n {\n return array(\n 'id' => $this->_id,\n 'name' => $this->_name,\n 'content' => $this->_content,\n 'categoryId' => $this->_category_id,\n 'userId' => $this->_user_id\n );\n }", "public function methodPost() {\n $jsondata= file_get_contents('php://input');\n $data= json_decode($jsondata,false);\n \n if (!empty($data)) {\n $model= new News();\n $model->saveItem($data);\n return array('ok'=>'ok');\n } else {\n throw new Exception('You must specify an id.');\n }\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}", "protected function getPost(): array {\n\t\t$post = array_diff_key($this->request->getParams(), array_flip(array( '_METHOD', )));\n\n\t\treturn $post;\n\t}", "public function createActionPost() : object\n {\n $request = $this->app->request;\n $session = $this->app->session;\n $response = $this->app->response;\n $title = $request->getPost(\"contentTitle\");\n $doCreate = $request->getPost(\"doCreate\");\n $db = $this->app->db;\n $db->connect();\n $sql = \"SELECT title FROM content\";\n $titles = $db->executeFetchAll($sql);\n\n if (isset($doCreate)) {\n foreach ($titles as $t) {\n if ($t->title == $title) {\n $session->set(\"existError\", true);\n return $response->redirect(\"cms/create\");\n }\n }\n $db->connect();\n $sql = \"INSERT INTO content (title) VALUES (?);\";\n $db->execute($sql, [$title]);\n $contentId = $db->lastInsertId();\n $slug = slugify($title);\n $session->set(\"adminid\", $contentId);\n return $response->redirect(\"cms/edit/${slug}\");\n }\n }", "abstract public function getRequestBody();", "public function getPostParam($title)\n {\n $result = false;\n if (isset($this->postParams[$title])) {\n $result = $this->postParams[$title];\n }\n return $result;\n }", "protected function obtainPostRequest() {\n /*\n * If the request was sent in JSON format (for example from an mobile app) \n * we will transform it into a format that can be interpreted by PHP\n */ \n $request = Request::createFromGlobals();\n if ($request->headers->get('Content-Type') == 'application/json') {\n $data = json_decode($request->getContent(), true);\n $request->request->replace(is_array($data) ? $data : array());\n }\n return $request->request;\n }", "protected function getJsonDecodedFromPost(){\n // $this->app->response()->header(\"Content-Type\", \"application/json\");\n // obtain the JSON of the body of the request\n $post = json_decode($this->app->request()->getBody(), true); // make it a PHP associative array\n return $post;\n }", "public static function post( $request ) {\n $postData = self::_getPostFromId( $request->get_param('id') );\n\n $data = self::_getPostDataFromWPOOPost( $postData );\n return $data;\n }", "protected function getPostData(Request $request) {\n\t\tif (!isset($this->postData)) {\n\t\t\t$body = $request->Body;\n\t\t\t/** @var array $postVars */\n\t\t\t$postVars = $request->Post();\n\n\t\t\tif (isset($postVars['model'])) {\n\t\t\t\t$this->postData = json_decode($postVars['model'], true);\n\t\t\t} elseif (!empty($postVars)) {\n\t\t\t\t$this->postData = $postVars;\n\t\t\t} elseif (strlen($body) > 0) {\n\t\t\t\t$this->postData = json_decode($body, true);\n\t\t\t} else {\n\t\t\t\t$this->postData = [];\n\t\t\t}\n\t\t}\n\t\treturn $this->postData;\n\t}", "public function get_payload_request();", "public function post_body() {\n\t\treturn file_get_contents( 'php://input' );\n\t}", "protected function loadFormData()\n {\n $data = JFactory::getApplication()->getUserState('com_labgeneagrogene.requests.data', array());\n\n if (empty($data)) {\n $id = JFactory::getApplication()->input->get('id');\n $data = $this->getData($id);\n }\n\n return $data;\n }", "public function postAction()\n {\n $manager = new \\Art4\\JsonApiClient\\Utils\\Manager();\n $manager->setConfig('optional_item_id', true);\n // @todo handle validation errors\n $document = $manager->parse($this->request->getRawBody());\n $resource = $this->resource->getModel();\n\n // basic attributes\n foreach ($document->get('data')->get('attributes')->asArray(true) as $key => $value) {\n $resource->{$key} = $value;\n }\n\n // @todo handle saving errors\n $resource->save();\n\n return $this->renderSerialized($resource);\n }", "protected function getHttpPostFields()\n {\n $config = $this->getConfig();\n $request = $this->getRequest();\n $context = $request->getContext();\n\n $params = array();\n\n $params['aid'] = $config->getAccountId();\n\n $params['type'] = $request->getType();\n $params['wid'] = $request->getWidgetId();\n $params['start'] = $request->getStartIndex();\n if($chunkSize = $request->getChunkSize()) {\n $params['csize'] = $chunkSize;\n }\n $params['widgetdetails'] = $request->getIncludeWidgetDetails() ? '1' : '0';\n\n if($productIdsToExclude = $request->getExcludeProductIds()) {\n $params['excl'] = $productIdsToExclude;\n }\n\n // context\n if($visitorId = $context->getVisitorId()) {\n $params['emvid'] = $visitorId;\n }\n if($productIds = $context->getProductIds()) {\n $params['pid'] = $productIds;\n }\n $categories = $context->getCategories();\n if(count($categories) > 0) {\n if(count($categories) > 1) {\n throw new RuntimeException(\"Only one or zero categories in context allowed in current implementation.\");\n }\n $cat = $categories[0]; /* @var $cat Context\\Category */\n $params['ctxcat.ct'] = $cat->getType();\n if($catId = $cat->getId()) {\n $params['ctxcat.cid'] = $catId;\n } else {\n $params['ctxcat.paa'] = $cat->getPath();\n $params['ctxcat.pv'] = $cat->getVariant();\n }\n }\n\n return $params;\n }", "function getPOSTData() {\n // check headers for one of two specific content-types\n $headers = getallheaders();\n $headerError = 'You must specify a Content-Type of either `application/x-www-form-urlencoded` or `application/json`';\n if ( !isset($headers['Content-Type']) ) {\n errorExit( 400, $headerError );\n }\n\n if ( $headers['Content-Type'] === 'application/json' ) {\n // parse the input as json\n $requestBody = file_get_contents( 'php://input' );\n $data = json_decode( $requestBody );\n if ( $data === null ) {\n errorExit( 400, 'Error parsing JSON' );\n }\n return $data;\n } else if ( $headers['Content-Type'] === 'application/x-www-form-urlencoded' ) {\n // convert the $_POST data from an associative array to an object\n return (object)$_POST;\n } else {\n errorExit( 400, $headerError );\n }\n}", "function rest_prepare($data, $post = null, $request = 0)\n {\n\n $response_data = $data->get_data();\n\n $response_data['_meta'] = get_post_meta($response_data['id']);\n $response_data['_terms'] = wp_get_post_terms( $response_data['id'], 'link-types' );\n $data->set_data($response_data);\n\n return $data;\n }", "public function post( array $postFields );", "function populateFromPost()\n\t{\n\t}", "public static function getPostData() {\n\n $DataObj = new stdClass();\n\n foreach ($_POST as $name => $value)\n $DataObj->$name = $value;\n\n return $DataObj;\n }", "public function postAuthor() {\n $data = Request;\n //Add Author fields sent to Author Table\n //AuthorsController->AuthorsController::store($request);\n $p = sizeof($data);\n // $p = $data;\n //print_r($_POST);\n //$l = fopen('/home/sudipta/check.log','w+');\n //fwrite($l,\" SIZEOF \".$p);\n //Author::create($request);\n //AuthorsController->store($request);\n return;\n }", "private function getPreparedPostData($request) {\n\n $title = $request->data['Post']['title'];\n $body = $request->data['Post']['body'];\n $file = $request->data['Post']['image'];\n\n $imageContent = null;\n $tempName = $file['tmp_name'];\n $imageSize = $file['size'];\n $imageType = $file['type'];\n $imageName = $file['name'];\n\n if (!empty($tempName)) {\n $imageContent = addslashes(fread(fopen($tempName, \"rb\"), filesize($tempName)));\n move_uploaded_file($tempName, WWW_ROOT . 'img/' . $imageName);\n }\n\n $data = array(\n 'title' => $title,\n 'body' => $body,\n 'image_name' => $imageName,\n 'image_type' => $imageType,\n 'image_size' => $imageSize,\n 'image_content' => $imageContent,\n 'created_date' => date('Y-m-d H:i:s')\n );\n\n return $data;\n }", "protected function sendNewArticle(){\n if (!empty($_POST['title'] && !empty($_POST['article']))) {\n $this->sendArticle();\n header('Location: index.php');\n }\n else {\n $this->prepareCreateArticle();\n }\n }", "private function getPostData(): array\n {\n return [\n 'product' => [\n 'attribute_set_id' => '4',\n 'status' => '1',\n 'name' => 'Simple Product',\n 'sku' => 'simple',\n 'url_key' => 'simple-product',\n 'type_id' => \\Magento\\Catalog\\Model\\Product\\Type::TYPE_SIMPLE\n ],\n 'links' => [\n 'upsell' => [\n ['id' => '10'],\n ],\n 'crosssell' => [\n ['id' => '11'],\n ],\n 'related' => [\n ['id' => '12'],\n ],\n ]\n ];\n }", "public function getTitle()\n {\n return $this->input('title');\n }", "public function getPost() {\n //get json post list\n echo $this->model->getPost();\n }", "function getData()\r\n {\r\n //if POST or PUT get the data wiht file_get_contents\r\n if ($this->request === \"POST\" || $this->request === \"PUT\") {\r\n $this->preCleanData = JSON_decode(file_get_contents(\"php://input\"));\r\n //else get the ID from $_get\r\n } else if ($this->request === \"GET\" || $this->request === \"DELETE\") {\r\n if (isset($_GET['ID'])) {\r\n $this->data = $_GET['ID'];\r\n return;\r\n } else {\r\n return;\r\n }\r\n }\r\n $this->cleanData();\r\n }", "function collectDataFromInput()\n\t{\n\t\t$id= FormUtil :: getPassedValue('id', null);\n\t\t$objectid= FormUtil :: getPassedValue('objectid', null);\n\n\t\tif (!empty ($objectid))\n\t\t{\n\t\t\t$id= $objectid;\n\t\t}\n\n\t\t$license= FormUtil :: getPassedValue('license', null, 'POST');\n\t\t$license_image= FormUtil :: getPassedValue('license_image', null, 'FILES');\n\n\t\t(!empty ($license['objectid'])) ? $license['id']= $license['objectid'] : '';\n\n\t\t// get all module vars\n\t\t$modvars= pnModGetVar('crpLicense');\n\n\t\t$data= compact('id', 'objectid', 'license', 'license_image', 'modvars');\n\n\t\treturn $data;\n\t}", "public static function post($variable='*'){\n \n self::load();\n \n if($variable!='*'){\n return self::$request->request->get($variable); \n }\n else{\n return self::$request->request->all();\n }\n }", "public function extract_data_post()\r\n {\r\n if(isset($_POST['search_term']) == true && empty($_POST['search_term']) == false){\r\n $text = filter_input(INPUT_POST, 'search_term', FILTER_SANITIZE_STRING);\r\n $search = $this->Ajax->extract($text);\r\n foreach ($search as $row) {\r\n echo '<li>'.$row['word'].'<li>';\r\n }\r\n }\r\n }", "function parseData(){\r\n\t\t$content = array();\r\n\t\t$this->page_id = $this->CFG->PostVars['pageid'];\r\n\t\tforeach($this->CFG->PostVars as $key=>$value){\r\n\t\t\tif(preg_match(\"/content_(.*)_(.*)/\", $key, $arr)){\r\n\t\t\t\t$field\t= $arr[1];\r\n\t\t\t\t$lang \t= $arr[2];\r\n\t\t\t\tif(is_array($content[$lang])){\r\n\t\t\t\t\t$content[$lang][$field] = $value;\r\n\t\t\t\t}\r\n\t\t\t\telse $content[$lang] = array($field => $value);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t$this->content = $content;\r\n\t}", "public function getRequestData(){\n\t\treturn array( \n \t\t\t'cmd' => $this->getRequestCommand(), \n \t\t\t'params' => $this->getParams() \n\t\t); \n\t}", "public function get_input_content();", "public function postTitulo()\r\n\t{\r\n\t\t$desc = trim(Input::get(\"txtDescTitle\"));\r\n\t\t$fecha = date('Y-m-d');\r\n $validator = Validator::make(['desc' => $desc],['desc' => 'exists:tituloshabilitantes,descripcion']);\r\n\t\tif ($validator->fails()) {\r\n\t\t\tDB::insert('insert into tituloshabilitantes (descripcion, usuario_alta, fecha_alta) values (?, ?, ?)', [$desc, Auth::user()->usuario, $fecha]);\r\n\t\t\treturn TituloHabilitante::lists('descripcion', 'id');\r\n\t\t} else {\r\n\t\t\treturn Response::json(['error' => 'Ya existe el título ingresado']);\r\n\t\t}\r\n\r\n\t}", "public function insertArticleAction() {\n $requiredParams = ['author', 'text'];\n if ($params = __request::checkParams($requiredParams)) {\n $article_id = $this->datasource->insertArticle($params['author'], $params['text']);\n\n return ['id' => $article_id];\n }\n\n __::bad_request('Missing parameters');\n }", "public function getData()\n\t{\n if ( is_string($this->_data) ) {\n return $this->_data; \n }\n\t\telse \n return $this->_internal_request->to_postdata();\n\t}", "abstract public function get_posted_value();", "private function getDataByPost($params){\n $content = http_build_query($params);\n $options = array('http'=>array(\n 'method' => 'POST',\n 'header' => \"Content-type: application/x-www-form-urlencoded\\r\\n\", 'content' => $content)\n );\n $context = stream_context_create($options);\n $val = file_get_contents($this->url, false, $context);\n return $val;\n }", "public function post($request);", "public function getPostParams(): array\n {\n return $this->postParams;\n }" ]
[ "0.654665", "0.6526921", "0.60151565", "0.5998064", "0.59265625", "0.58936846", "0.58553374", "0.58448684", "0.58430845", "0.58318704", "0.58240616", "0.5821348", "0.5817795", "0.5793661", "0.57903755", "0.57631826", "0.5747316", "0.57437843", "0.57194936", "0.5714725", "0.56896144", "0.5678357", "0.5667318", "0.55755126", "0.55589676", "0.55538595", "0.55449563", "0.55310977", "0.5521866", "0.55151016", "0.5513613", "0.5502327", "0.54856837", "0.5483941", "0.5483941", "0.5483941", "0.5468465", "0.54631597", "0.5455626", "0.5453513", "0.5436962", "0.54335093", "0.54312193", "0.5424124", "0.53961426", "0.53862274", "0.5379087", "0.5375773", "0.537533", "0.5365287", "0.5355399", "0.53514874", "0.5349519", "0.5332717", "0.5318686", "0.53124785", "0.5280415", "0.52770066", "0.5272513", "0.524025", "0.52253795", "0.5225321", "0.522327", "0.5215669", "0.52110684", "0.5203422", "0.52025515", "0.51971483", "0.519199", "0.51826495", "0.51763", "0.51754844", "0.5171877", "0.5167595", "0.5154968", "0.51506585", "0.5139477", "0.51265854", "0.51224405", "0.5121964", "0.51142716", "0.5113798", "0.51089275", "0.5105238", "0.51033384", "0.509823", "0.5098028", "0.50966996", "0.50959367", "0.5092364", "0.5092265", "0.50914335", "0.50859755", "0.5082619", "0.5075467", "0.50740224", "0.5070973", "0.5070488", "0.50676197", "0.50672793", "0.50551414" ]
0.0
-1
get all the articles
public function list() { return Task::all(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getArticles();", "public function showArticles()\n\t{\n\n\t\t$req = $this->db->query('SELECT id, article_number, title FROM articles ORDER BY date_creation DESC');\n\n\t\t$req->execute();\n\n\t\t$values = $req->fetchAll(PDO::FETCH_ASSOC);\n\n\t\tforeach ($values as $value)\n\t\t{\n\t\t\t$articles[] = new Article($value);\n\t\t}\n\n\t\treturn $articles;\n\t}", "public function getArticles()\n\t{\n\t$qb = $this ->createQueryBuilder(\"a\")\n\t\t\t\t->leftJoin('a.image','i')\n\t\t\t\t->addSelect('i')\n\n\t\t\t\t->leftJoin('a.categories','c')\n\t\t\t\t->addSelect('c')\n\n\t\t\t\t->where('a.publication = :val')\n\t\t\t\t->setParameter('val', 1)\n\n\t\t\t\t->orderBy('a.datecreation', 'DESC');\n\t$query = $qb->getQuery();\n\treturn $query->getResult();\n\t}", "public static function getArticles()\n {\n // $url = \"https://n161.tech/api/dummyapi/post?page=1&limit=100\";\n // $curl = curl_init();\n // curl_setopt($curl, CURLOPT_URL, $url);\n // curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\n // curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);\n // curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);\n // $response = curl_exec($curl);\n // $array_data = json_decode($response, true);\n // curl_close($curl);\n // return $array_data;\n return Article::orderBy('updated_at', 'desc')->paginate(5);\n }", "public function getAllArticles()\r\n\t{\r\n\t\t$bdd\t=\tmyConnection();\r\n\r\n\t\t$sqlSelect\t=\t$bdd\t->\tprepare(\"SELECT * FROM article ORDER BY designation\");\r\n\r\n\r\n\t\t$sqlSelect\t->\texecute();\r\n\r\n\t\t$resultat\t=\t$sqlSelect->fetchAll(PDO::FETCH_ASSOC);\r\n\r\n\t\treturn $resultat;\r\n\t}", "public function index()\n {\n return Article::all();\n }", "public function articles()\n {\n $get = $this->getGet('pageSize', 'pageNumber');\n $result = Db::sharedDb()->articles($get['pageNumber'], $get['pageSize']);\n\n return $this->successResponse($result);\n }", "public function index(){\n $articles = Article::all();\n\n \n\n }", "private function getArticles() {\n $param = array(\n 'where' => 'registered = 1'\n );\n\n $articles = $this->bankReg->gets($param);\n\n return $articles;\n }", "public function getArticles()\n {\n // TODO: prepare the database connection\n // Note: you might want to use a re-usable databaseManager class - the choice is yours\n // obtain the passed params from array in the config file\n // TODO: fetch all articles as $rawArticles (as a simple array)\n $sql = \"SELECT * FROM articles\";\n $result = $this->databaseManager->connection->query($sql)->fetchAll();\n $rawArticles = $result;\n\n $articles = [];\n foreach ($rawArticles as $rawArticle) {\n // We are converting an article from a \"dumb\" array to a much more flexible class\n\n $articles[] = new Article($rawArticle['title'], $rawArticle['description'], $rawArticle['publish_date']);\n\n }\n\n return $articles;\n }", "function getArticles() \t{\n \t\treturn $this->getArticleUids();\n \t}", "public function showArticles(){\n\n $res = $this->db->prepare(\"SELECT * FROM articles\");\n $res->execute(); \n return $res->fetchall();\n }", "function getArticleObjects() \t{\n \t\treturn $this->articles;\n \t}", "public function read_all_posts()\n {\n $result = array(\n \"status\" => \"\" ,\n \"body\" => array(\n \"articles\" => array(),\n \"count\" => 0\n ),\n \"error\" => array()\n );\n $sql = \"SELECT * FROM articles\";\n $stmt = $this->db->prepare($sql);\n $stmt->execute();\n $res = $stmt->get_result();\n if ($res->num_rows > 0){\n $result['status'] = \"Article read successful\";\n $result['body']['count'] = $res->num_rows;\n while($row = $res->fetch_assoc()){\n $data = [\n 'id' => $row['id'],\n 'url' => $row['url'],\n 'headline' => $row['headline'],\n 'content' => html_entity_decode($row['content']),\n 'user_id' => $row['userID'],\n 'created' => $row['created'],\n 'last_updated' => $row['lastUpdated']\n ];\n array_push($result['body']['articles'], $data);\n }\n } else {\n $result['status'] = \"No Articles yet! \";\n }\n return $result;\n }", "public function index()\n {\n // return collection of articles\n return ArticleResource::collection(Article::orderBy('created_at', 'desc')->paginate(6));\n }", "public function index()\n {\n $articles = $this->articlesRepository->all();\n\n return ArticleResource::collection($articles);\n }", "public function getAll()\n {\n $query = $this->dc->qb()\n ->select('*')\n ->from($this->dc->p('plugin_ff_articles'), 'a');\n\n if (!$this->getAuth()->hasAccess('maccess.mod')) {\n $query->where('hidden = 0');\n }\n\n $result = $query->orderBy('title', 'asc')\n ->execute()\n ->fetchAll();\n\n return $result;\n }", "function getAllArticle()\n{\n $bdd = dbConnection();\n $rs = $bdd->query(\"select * from article\");\n $articleList = $rs->fetchAll(PDO::FETCH_ASSOC);\n $rs->closeCursor();\n return $articleList;\n}", "public function index()\n {\n $articles = Article::all();\n\n return ArticlesResource::collection($articles);\n }", "public function articleList()\n {\n \t$articles=DB::table('articles')->orderBy('id', 'desc')->limit(10)->get();\n \t$list=array();\n \tforeach($articles as $k=>$article) {\n \t\t$list[$k]['id']=$article->id;\n \t\t$list[$k]['title']=$article->title;\n \t\t$list[$k]['body']=$article->body;\n \t\t$list[$k]['type_name']=Type::find($article->typeId)->name;\n \t\t$list[$k]['created_at']=$article->created_at;\n \t}\n \techo json_encode($list);\n }", "public function readAllArticles(): array\n {\n // On se connecte à la base de donnée\n $db = DbConnexion::openConnexion();\n\n // Après avoir tout sélectionné dans la table article\n // On le stoocke dans un tableau\n $articlesAllList = [];\n\n // On séléctionne tout dans la table article\n $request = \"SELECT * FROM article\" ;\n\n // On prépare et exécute la requête\n $stmt = $db->prepare($request);\n $stmt->execute();\n\n /*\n On crée une boucle tant que ...\n FETCH-ASSOC = mode de récupération de données qui retourne un tableau indéxé par colonne\n Ne permet pas d'appeler plusieurs colonnes du même nom\n */\n while ($articlesFromDb = $stmt->fetch(\\PDO::FETCH_ASSOC)) {\n // On instancie un nouvel article\n $articleAll = new Article($articlesFromDb['title'], $articlesFromDb['content'], $articlesFromDb['image'], $articlesFromDb['ref_page']);\n $articleAll->setId($articlesFromDb['id']);\n $articleAll->setCreationDate($articlesFromDb['creation_date']);\n $articleAll->setUpdateDate($articlesFromDb['update_date']);\n\n $articlesAllList [] = $articleAll;\n }\n\n $db = DbConnexion::closeConnexion();\n\n return $articlesAllList;\n }", "public function articles_get(){\r\n if($this->dx_auth->is_logged_in())\r\n $__uri = $this->get(\"m_uri\");\r\n else\r\n $__uri=array(\"id\"=>0);\r\n\r\n // $art[\"domain\"] = $__uri[\"domain\"];\r\n $art[\"art\"] = $this->articles(\"\",\"\",$__uri[\"id\"]);\r\n\r\n foreach ($art[\"art\"] as $key => &$value) {\r\n $img=explode(\",\",$value[\"name\"]);\r\n $value[\"name\"]=site_url('application/assets/application/img/post/post_'.$__uri[\"id\"].'/'.$img[0]);\r\n $value[\"description\"]=strip_tags(html_entity_decode($value[\"description\"]),\"<p>\");\r\n $value[\"description\"]=substr(strip_tags(html_entity_decode($value[\"description\"])),0,150).(strlen(html_entity_decode($value[\"description\"]))>150?\"....\":\"\");\r\n //$value[\"video\"]=($value[\"video\"] ? html_entity_decode($value[\"video\"]) : \"\");\r\n // $value[\"url_title\"]=site_url($__uri[\"domain\"].\"/\".urls_amigables($value['category']).\"/$value[id]/\".urls_amigables($value['title']));\r\n //$value[\"url_cat\"]=site_url($__uri[\"domain\"].\"/\".urls_amigables($value['category']));\r\n \r\n }\r\n\r\n if(count($art[\"art\"])==0)\r\n $art=\"\";\r\n \r\n $_res = format_response($art,'success','ok',false);\r\n $this->response($_res,200); \r\n\r\n }", "public function allArticles()\n {\n $articles = Article::where('public', '=', 0)->latest()->paginate(10);\n $this->parseArticle($articles);\n return view('articles.index',compact('articles'))\n ->with('i', (request()->input('page', 1) - 1) * 5);\n }", "public function getArticles()\n {\n return $this->articles;\n }", "public function findAll()\r\n {\r\n $posts = [];\r\n $req = $this->connexion->connect()->prepare('SELECT id, title, content, DATE_FORMAT(dateposts, \\' % d /%m /%Y à % Hh % imin % ss\\') AS creation_date_fr FROM posts ORDER BY dateposts DESC LIMIT 0, 5');\r\n $req->execute();\r\n $datas = $req->fetchAll();\r\n foreach ($datas as $data) {\r\n $posts[] = new Article($data);\r\n }\r\n return $posts;\r\n\r\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 getArticles() {\n return $this->articles;\n }", "public function get_articles() {\n return $this->linkemperor_exec(null, null,\"/api/v2/customers/articles.json\");\n }", "public function index()\n {\n return Article::latest()->paginate(20);\n }", "public function allArticles(){\n\t\t$articles = $this->all(); \n\t\tforeach ($articles as $key => $value) {\n\t\t\tif (array_key_exists(\"content\",$value)){\n\t\t\t\t($articles[$key]['content'] = htmlspecialchars_decode($value['content'])); \n\t\t\t}\n\t\t}\n\t\treturn $articles; \n\t}", "public function findArticles() : Collection\n {\n return $this->model->articles;\n }", "public function get()\n\t{\n\t\t$limit = 5;\n\t\t\n\t\t# type, limit, channel, isASubChannel, ignoreChannel, \n $articles = App::make('ArticleRepository')->getArticles( \n \t'featured', // type of articles to get\n \t$limit, // the number to return\n \tnull, // channel identifier\n \tfalse, // whether the channel is a sub channel\n \ttrue // whether to ignore the channel identifier (we do on the homepage as we want articles for all channels) \n );\n\n return App::make('ArticleTransformer')->transformCollection( $articles );\n\t}", "public function getListeArticles()\n {\n $rowset = $this->tableGateway->select(array('type'=> 'article'));\n return $rowset;\n }", "public function index()\n {\n return Article::orderBy('id','desc')->paginate(10);\n }", "public function getArticles()\n\t{\n\t\treturn $this\n\t\t\t->hasMany(Article::className(), ['id'=>'article_id'])\n\t\t\t->viaTable('{{%article_article_category}}', ['article_category_id'=>'id']);\n\t}", "public function getList(){\r\n $listArticles =[]; ///on creer une liste vide ou ont mettra tous les articles\r\n\r\n\r\n //prepare une requete de type select\r\n $sql='SELECT * FROM articles';\r\n $req = $this->bdd->prepare($sql);\r\n\r\n//////execution de la requete avec attribution des valeurs\r\n$req->execute();\r\n\r\n/////on stocke les données obtenues dans un tableau\r\nwhile ($donnees = $req->fetch(PDO::FETCH_ASSOC)){///tant que il y a des article alors on boucle\r\n ////on cree des objets avec les données issue de la bdd\r\n $articles = new articles();\r\n $articles->hydrate($donnees);\r\n $listArticles[] = $articles;\r\n}\r\n///print_r2($listArticles)\r\nreturn $listArticles;\r\n\r\n}", "public function get_all_academic_article()\n {\n echo $this->academic_article_model->get_all_academic_article();\n }", "public function actionListArticles()\n {\n $query = Articles::find()->orderBy(['id'=>SORT_DESC]);\n $countQuery = clone $query;\n $pages = new Pagination(['pageSize' => 5,'totalCount' => $countQuery->count()]);\n $models = $query->offset($pages->offset)\n ->limit($pages->limit)\n ->all();\n $catArticles = CatArticles::find()->all();\n// $articles = Articles::find()->orderBy(['id'=>SORT_DESC])->all();\n return $this->render('list-articles', [\n// 'articles' => $articles,\n 'models' => $models,\n 'pages' => $pages,\n 'catArticles' => $catArticles,\n ]);\n }", "function articles(){\n $articles = new ArticleManager();\n $allArticles = $articles->getArticles();\n\n require 'app/views/back/articles.php';\n }", "public function getArticles(int $page = 1) \n\t{\n\t\t$articlesPerPage = 3;\n\n\n\t\t$page = (int)($page);\n\t\t$begin = ($page - 1) * $articlesPerPage ;\n\t\t\n\t\t$req = $this->db->query('SELECT id, article_number, title, content, DATE_FORMAT(date_creation, \\'%d/%m/%Y\\') AS dateCreation FROM articles ORDER BY date_creation DESC LIMIT ' . $begin . ',' . $articlesPerPage);\n\n\t\t$req->execute();\n\n\t\t$values = $req->fetchAll(PDO::FETCH_ASSOC);\n\n\t\tforeach ($values as $value)\n\t\t{\n\t\t\t\n\t\t\t$value['content']= $this->getExtract($value['content'], 0, 600, ' ');\n\t\t\t$articles[] = new Article($value);\n\t\t}\n\n\t\treturn $articles;\n\t}", "public function getAllArticles()\n {\n $user = \\BackendUser::getInstance();\n $pids = array();\n $articles = array();\n\n // Limit pages to the user's pagemounts\n if ($user->isAdmin) {\n $objArticle = \\Database::getInstance()->execute(\n 'SELECT a.id, a.pid, a.title, a.inColumn, p.title AS parent FROM tl_article a\n LEFT JOIN tl_page p ON p.id=a.pid ORDER BY parent, a.sorting'\n );\n } else {\n foreach ($user->pagemounts as $id) {\n $pids[] = $id;\n $pids = array_merge($pids, \\Database::getInstance()->getChildRecords($id, 'tl_page'));\n }\n\n if (empty($pids)) {\n return $articles;\n }\n\n $pids = implode(',', array_map('intval', array_unique($pids)));\n\n $objArticle = \\Database::getInstance()->execute(\n 'SELECT a.id, a.pid, a.title, a.inColumn, p.title AS parent\n FROM tl_article a LEFT JOIN tl_page p ON p.id=a.pid WHERE a.pid IN(' . $pids . ')\n ORDER BY parent, a.sorting'\n );\n }\n\n // Edit the result\n if ($objArticle->numRows) {\n \\Controller::loadLanguageFile('tl_article');\n\n while ($objArticle->next()) {\n $key = $objArticle->parent . ' (ID ' . $objArticle->pid . ')';\n $articles[$key][$objArticle->id] = $objArticle->title\n . ' (' . ($GLOBALS['TL_LANG']['tl_article'][$objArticle->inColumn] ?: $objArticle->inColumn)\n . ', ID ' . $objArticle->id . ')';\n }\n }\n\n return $articles;\n }", "public function getArticlesAction()\n {\n $params = $this->Request()->getParams();\n $search = $params['filter'][0]['value'];\n\n\n if (!isset($params['filter'][0]['value'])) {\n $search = '%' . $this->Request()->get('searchParam') . '%';\n }\n\n $builder = Shopware()->Models()->createQueryBuilder();\n\n /**\n * query to search for article variants or the article ordernumber\n * the query concats the article name and the additional text field for the search\n */\n $builder->select(\n 'articles.id AS articleId,\n details.number,\n articles.name,\n details.id,\n details.inStock,\n articles.taxId,\n prices.price,\n details.additionalText,\n tax.tax'\n );\n $builder->from('Shopware\\Models\\Article\\Article', 'articles')\n ->leftJoin('articles.details', 'details')\n ->leftJoin('details.prices', 'prices')\n ->leftJoin('articles.tax', 'tax')\n ->where(\n $builder->expr()->like(\n $builder->expr()->concat(\n 'articles.name',\n $builder->expr()->concat(\n $builder->expr()->literal(' '),\n 'details.additionalText'\n )\n ),\n $builder->expr()->literal($search)\n )\n )\n ->orWhere('details.number LIKE :number')\n ->andWhere('articles.active = 1')\n ->andWhere('articles.active = 1')\n ->setParameter('number', $search)\n ->orderBy('details.number')\n ->groupBy('details.number')\n ->setMaxResults(8);\n $result = $builder->getQuery()->getArrayResult();\n $total = count($result);\n\n foreach ($result as &$article) {\n $article['price'] = $this->calculateGrossPrice($article['price'], $article['tax']);\n }\n\n $this->view->assign(\n [\n 'success' => true,\n 'data' => $result,\n 'total' => $total\n ]\n );\n }", "public function articlesPaginated(){\n return Article::paginate(10);\n }", "public function getAdminArticles()\n\t{\n\t\t$articles = [];\n\n\t\t$req = $this->db->query('SELECT id, article_number, title FROM articles ORDER BY date_creation DESC LIMIT 0, 5');\n\t\t$req->execute();\n\n\t\t$values = $req->fetchAll(PDO::FETCH_ASSOC);\n\n\t\tforeach ($values as $value)\n\t\t{\n\t\t\t$articles[] = new Article($value);\n\t\t}\n\t\t\n\t\treturn $articles;\n\t}", "public function articles()\n {\n return $this->hasMany(Article::class);\n }", "public static function getAll($conn) {\n\n $sql = \"SELECT *\n FROM article\n ORDER BY published_at\";\n\n $results = $conn->query($sql);\n\n return $results->fetchAll(PDO::FETCH_ASSOC);\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 return Article::where('visible',1)->with(['user:id,name','category:id,visible,category_title'])->get();\n }", "public function index()\n {\n return $this->respondWithPaginator($this->article->page(), new ArticleTransformer);\n }", "function index() {\n\t\t$this->set('title_for_layout', 'Artykuły - Serwis społecznościowy dla właścicieli zwierząt');\n\t\t$this->Article->recursive = 0;\n\t\t$articles = $this->paginate();\n\t\t$this->set('articles', $articles);\n\t}", "public function index()\n {\n //$articles = Articles::all(); //get all the articles\n //get a list of articles by pagination\n $articles = Articles::take(20)->paginate(10);\n return ArticlesApiResource::collection($articles);\n }", "private function getItems()\n\t{\n\t\tglobal $objPage;\n\t\t$objDatabase = \\Database::getInstance();\n\t\t\n\t\t$time = time();\n\t\t$strBegin;\n\t\t$strEnd;\n\t\t$arrArticles = array();\n\t\t\n\t\t// Create a new data Object\n\t\t$objDate = new \\Date();\n\t\t\n\t\t// Set scope of pagination\n\t\tif($this->pagination_format == 'news_year')\n\t\t{\n\t\t\t// Display current year only\n\t\t\t$strBegin = $objDate->__get('yearBegin');\n\t\t\t$strEnd = $objDate->__get('yearEnd');\n\t\t}\n\t\telseif ($this->pagination_format == 'news_month')\t\n\t\t{\n\t\t\t// Display current month only\n\t\t\t$strBegin = $objDate->__get('monthBegin');\n\t\t\t$strEnd = $objDate->__get('monthEnd');\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Display all\n\t\t}\n\t\t\n\t\t$strCustomWhere = '';\n\t\t// HOOK: allow other extensions to modify the sql WHERE clause\n\t\tif (isset($GLOBALS['TL_HOOKS']['readerpagination']['customsql_where']) && count($GLOBALS['TL_HOOKS']['readerpagination']['customsql_where']) > 0)\n\t\t{\n\t\t\tforeach($GLOBALS['TL_HOOKS']['readerpagination']['customsql_where'] as $callback)\n\t\t\t{\n\t\t\t\t$this->import($callback[0]);\n\t\t\t\t$strCustomWhere = $this->$callback[0]->$callback[1]('news',$this);\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Fetch all news that fit in the scope\n\t\t$objArticlesStmt = $objDatabase->prepare(\"\n \tSELECT * FROM tl_news\n \tWHERE \n \t\tpid IN(\" . implode(',', $this->archives) . \") AND published=1 AND hide_in_pagination!=1\n \t\t\" . (!BE_USER_LOGGED_IN ? \" AND (start='' OR start<$time) AND (stop='' OR stop>$time)\" : \"\") . \"\n \t\t\" . ($strBegin ? \" AND (date>$strBegin) AND (date<$strEnd)\" : \"\" ) .\" \".$strCustomWhere. \"\n \tORDER BY date DESC\");\n\t \n\t\t$objArticles = $objArticlesStmt->execute();\n\t\t\n\t\tif ($objArticles->numRows < 1)\n\t\t{\n\t\t\treturn array();\n\t\t}\n\t\t\n\t\t// get all articles\n\t\t$arrArticles = $objArticles->fetchAllAssoc();\n\t\t\n\t\t// HOOK: allow other extensions to modify the items\n\t\tif (isset($GLOBALS['TL_HOOKS']['readerpagination']['getItems']) && count($GLOBALS['TL_HOOKS']['readerpagination']['getItems']) > 0)\n\t\t{\n\t\t\tforeach($GLOBALS['TL_HOOKS']['readerpagination']['getItems'] as $callback)\n\t\t\t{\n\t\t\t\t$this->import($callback[0]);\n\t\t\t\t$arrArticles = $this->$callback[0]->$callback[1]('news',$arrArticles,$this);\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(count($arrArticles) < 1)\n\t\t{\n\t\t\treturn array();\n\t\t}\n\t\t\n\t\t// add keys for pagination (title, href)\n\t\tforeach($arrArticles as $i => $article)\n\t\t{\n\t\t\t// get alias\n \t\t$strAlias = (!$GLOBALS['TL_CONFIG']['disableAlias'] && $article['alias'] != '') ? $article['alias'] : $article['id'];\n \t\t\t\n \t\t\t$arrTmp = array\n \t\t\t(\n \t\t\t\t'href' => ampersand($this->generateFrontendUrl($objPage->row(), ((isset($GLOBALS['TL_CONFIG']['useAutoItem']) && $GLOBALS['TL_CONFIG']['useAutoItem']) ? '/' : '/items/') . $strAlias)),\n 'title' => specialchars($article['headline']),\n \t);\n \t\t\t\n \t\t\t$arrResult[] = array_merge($arrArticles[$i], $arrTmp);\n \t\t\tunset($arrTmp);\n\t\t}\n\t\t$arrArticles = $arrResult;\n\t\tunset($arrResult);\n\t\t\n\t\tif(count($arrArticles) < 1)\n\t\t{\n\t\t\treturn array();\n\t\t}\n\t\t\n\t\t// Higher the keys of the array by 1\n\t\t$arrTmp = array();\n\t\tforeach($arrArticles as $key => $value)\n\t\t{\n\t\t\t$arrTmp[$key+1] = $value;\n\t\t}\n\t\tksort($arrTmp);\n\t\t\n\t\t$arrArticles = $arrTmp;\n\t\tunset($arrTmp);\n\t\t\n\t\treturn $arrArticles;\n\t}", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $articles = $em->getRepository('IrvyneBlogBundle:Article')->findAll();\n\n return array('entities' => $articles);\n }", "public function actionArticles()\n\t{\n\t\t$this -> layout = 'mainLayout';\n\t\t/*$stack = $this -> human_verbiages;\n\t\t$arts = Articles::GiveArticlesById(0, true);*/\n\t\t\n\t\t$criteria = new CDbCriteria;\n\t\t$criteria -> compare('level',0);\n\t\t$criteria -> compare('parent_id',0);\n\t\t$criteria -> compare('id_type',ArticleType::model() -> getNumber('bibl'));\n\t\t$articles = Articles::model() -> findAll($criteria);\n\t\t\n\t\t$arts = array();\n\t\tforeach ($articles as $art) {\n\t\t\t$arr = array();\n\t\t\t$arr['name'] = $art -> name;\n\t\t\t$arr['verbiage'] = $art -> verbiage;\n\t\t\t$arr['id'] = $art -> id;\n\t\t\t$arr['text'] = $art -> text;\n\t\t\t\n\t\t\t$arts[] = $arr;\n\t\t}\n\t\t\n\t\t/*$arts = array_filter($arts,function ($art) use ($stack){\n\t\t\treturn (!in_array($art [\"verbiage\"], $stack));\n\t\t});*/\n\t\t$this->render('//articles/show_all', array(\n\t\t\t//'articles' => Articles::GiveArticlesById(0, true)\n\t\t\t'articles' => $arts\n\t\t));\n\t}", "public function articles()\n {\n return $this->hasMany('Article', 'category_id');\n }", "public function indexAction()\n {\n $article = $this->getDoctrine()\n ->getManager()\n ->getRepository('BlogBundle:Articles')\n ->findAll();\n\n return array('articles' => $article);\n }", "public function getListItems()\n {\n return $this->getArticles();\n }", "function showArticles($con) {\n\t\ttry {\n\t\t\t$stm = $con->prepare(\"SELECT * FROM articulos\");\n\t\t\t$stm->execute();\n\t\t\treturn $stm->fetchAll();\t\t\t\n\t\t} catch (PDOException $e) {\n\t\t\techo $e->getMessage();\t\n\t\t}\n\t}", "public function articles()\n\t{\n\t\treturn $this->morphedByMany(Article::class, 'taggable');\n\t}", "public function articles()\n {\n return $this->morphedByMany('App\\Article', 'taggable');\n }", "function getItems()\n\t{\n\t\t$limit = $this->getState('list.limit');\n\n\t\tif ($this->_articles === null && $category = $this->getCategory())\n\t\t{\n\t\t\t$model = JModelLegacy::getInstance('Articles', 'ContentModel', array('ignore_request' => true));\n\t\t\t$model->setState('params', JFactory::getApplication()->getParams());\n\t\t\t$model->setState('filter.category_id', $category->id);\n\t\t\t$model->setState('filter.published', $this->getState('filter.published'));\n\t\t\t$model->setState('filter.access', $this->getState('filter.access'));\n\t\t\t$model->setState('filter.language', $this->getState('filter.language'));\n\t\t\t$model->setState('list.ordering', $this->_buildContentOrderBy());\n\t\t\t$model->setState('list.start', $this->getState('list.start'));\n\t\t\t$model->setState('list.limit', $limit);\n\t\t\t$model->setState('list.direction', $this->getState('list.direction'));\n\t\t\t$model->setState('list.filter', $this->getState('list.filter'));\n\t\t\t// filter.subcategories indicates whether to include articles from subcategories in the list or blog\n\t\t\t$model->setState('filter.subcategories', $this->getState('filter.subcategories'));\n\t\t\t$model->setState('filter.max_category_levels', $this->getState('filter.max_category_levels'));\n\t\t\t$model->setState('list.links', $this->getState('list.links'));\n\n\t\t\tif ($limit >= 0)\n\t\t\t{\n\t\t\t\t$this->_articles = $model->getItems();\n\n\t\t\t\tif ($this->_articles === false)\n\t\t\t\t{\n\t\t\t\t\t$this->setError($model->getError());\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->_articles = array();\n\t\t\t}\n\n\t\t\t$this->_pagination = $model->getPagination();\n\t\t}\n\n\t\treturn $this->_articles;\n\t}", "public function articles() {\n //hasMany representa la relacion de un a muchos\n return $this->hasMany(\"App\\Article\");\n }", "public function articles() \n {\n return $this->hasMany(Article::class);\n }", "public function publishedArticles()\n {\n return Courses::loadAllPublished();\n }", "protected function actionGetAll() {\n $result= $this->cachedCall('news', 'getAll', 'getAllNews');\n return $result;\n }", "public function getArticles()\n\t{\n\t\treturn $this->getOptionData('tl_article');\n\t}", "public function getArticles(){\n\t\t$placeRepository = t3lib_div::makeInstance('Tx_Wpj_Domain_Repository_PlaceRepository');\n\t\treturn $placeRepository->getArticlesOfPlace($this);\n\t}", "public function getArticles()\n {\n return NewsArticle::get()->filter('ParentID', $this->AllChildren()->column('ID') ?: null);\n }", "public function index()\n {\n if(request()->ajax())\n { \n return Article::allArticles();\n }\n return view('site.wordify.articles.list');\n }", "protected function getAllNews() {\n $model = new News();\n \n $result= $model->getAll();\n return $result;\n }", "public function getArticles($cat) \n {\n \n $res = $this->idbd->query(\"SELECT articles.*, categories.categorie_titre\n FROM articles\n INNER JOIN categories\n ON articles.categorie_ID=categories.categorie_ID\n WHERE (articles.categorie_ID = '\". $cat .\"')\");\n \n if($res->rowCount() > 0)\n {\n while($row = $res->fetch(PDO::FETCH_ASSOC)) {\n $this->aArticles[] = $row;\n }\n }\n return $this->aArticles;\n }", "public function all()\n {\n\n // dd($articles);\n\n $articles = Post::all();\n // $articles = Post::limit(1)->get();\n\n // $articles = [\n // [\n // \"id\" => 1,\n // \"title\" => \"Break a leg!\",\n // \"content\" => \"<p>Lorem ipsum dolor sit amet </p>consectetur adipisicing elit. Totam, dolor. Minima, accusamus praesentium iste tempora quod quisquam pariatur esse explicabo consectetur alias sapiente. Facere ducimus similique quae, laborum veniam exercitationem!\"\n // ],\n // [\n // \"id\" => 2,\n // \"title\" => \"Go jump in a lake!\",\n // \"content\" => \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Totam, dolor. Minima, accusamus praesentium iste tempora quod quisquam pariatur esse explicabo consectetur alias sapiente. Facere ducimus similique quae, laborum veniam exercitationem!\"\n // ],\n // [\n // \"id\" => 2,\n // \"title\" => \" You can’t fight the city hall.\",\n // \"content\" => \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Totam, dolor. Minima, accusamus praesentium iste tempora quod quisquam pariatur esse explicabo consectetur alias sapiente. Facere ducimus similique quae, laborum veniam exercitationem!\"\n // ]\n // ];\n\n \n return view('db_posts.all', compact('articles'));\n }", "public function article(): Response \n {\n $bdd_article = $this->getDoctrine()->getRepository(Article::class)->findAll();\n \n return $this->render('article/article.html.twig', [\n 'articles'=>$bdd_article\n ]);\n }", "public static function get_all()\n {\n $data = DB::table('artikel')->get();\n return $data;\n }", "public function getList2(){\r\n $listArticles =[]; ///on creer une liste vide ou ont mettra tous les articles\r\n\r\n\r\n //prepare une requete de type select\r\n $sql= 'SELECT id, ' \r\n .'titre, '\r\n .'texte, '\r\n .'publie, '\r\n .'DATE_FORMAT(date, \"%d/%m/%Y\")as date '\r\n .'FROM articles ';\r\n \r\n \r\n $req = $this->bdd->prepare($sql);\r\n\r\n//////execution de la requete avec attribution des valeurs\r\n$req->execute();\r\n\r\n/////on stocke les données obtenues dans un tableau\r\nwhile ($donnees = $req->fetch(PDO::FETCH_ASSOC)){///tant que il y a des article alors on boucle\r\n ////on cree des objets avec les données issue de la bdd\r\n $articles = new articles();\r\n $articles->hydrate($donnees);\r\n $listArticles[] = $articles;\r\n}\r\n///print_r2($listArticles)\r\nreturn $listArticles;\r\n\r\n\r\n}", "public function index()\n {\n $articles = Article::with(['category', 'author'])->visible()->paginate(2);\n\n return view('article.index')->with('articles', $articles);\n }", "public function articles(){ //establece la relacion entre modelos, en este caso 1 a muchos\n return $this -> hasMany('App\\Article');\n }", "public function index()\n\t{\n\t\t$articles = Article::all();\n return Response::json($articles);\n\t}", "public function articles()\n {\n return $this->hasMany('App\\Article', 'client_id', 'id');\n }", "public function index()\n {\n return response()->json([\"content\" => $this->resourceArticleArray(Article::latest()->get())]);\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}", "abstract public function getArticles($lang = null, $offset = 0, $limit = 10);", "public static function retrieveAllNews() {\n return R::getAll('SELECT * FROM news');\n }", "public function it_allows_anyone_to_see_list_all_article()\n {\n $response = $this->get(route('api/v1/books'));\n $response->assertSuccessful();\n $response->assertViewIs('.index');\n $response->assertViewHas('articles');\n }", "public function articles()\n {\n return $this->hasMany('App\\Article', 'author_id');\n }", "public function get_all ();", "public function getFeedArticles()\n {\n return $this->getArticles()->limit($this->FeedNumberOfArticles);\n }", "static function getAllArticles($resourceName, $limit)\n {\n //important for pagination. DON'T DELETE!\n if (isset($_GET[\"page\"])) {\n $page = $_GET[\"page\"];\n } else {\n $page = 1;\n }\n //important for pagination. DON'T DELETE!\n $start_from = ($page - 1) * $limit;\n\n $con = $GLOBALS['con'];\n $resource_id = self::getResourceIdByResourceName($resourceName);\n $sql = \"SELECT content_id, content_title, content_text, content_description, date_format(date_created, '%m/%d/%y') as date_created FROM content WHERE resource_id = $resource_id ORDER BY date_created DESC LIMIT $start_from, $limit\";\n\n $result = mysqli_query($con, $sql);\n while ($row = mysqli_fetch_assoc($result)) {\n $date_created = $row[\"date_created\"];\n echo \"<div class=\\\"the-content\\\">\n <a class=\\\"text-dark\\\" href=\\\"#\\\" onclick=\\\"ReadArticle(\" . $row['content_id'] . \")\\\">\n <p class=\\\"h1 text-dark\\\">\" . $row['content_title'] . \"</p></a>\n <hr><span class=\\\"badge badge-pill badge-light\\\">Created on: $date_created</span>\n <p class=\\\"content_text\\\">\" . $row['content_description'] . \"</p>\n <a class=\\\"btn btn-outline-ngreen\\\" href=\\\"#\\\" onclick=\\\"ReadArticle(\" . $row['content_id'] . \")\\\">Read More</a>\n </div>\";\n }\n\n //pagination function: Parameters (table's name, articles number limit, link path (without '.php'))\n $result = self::pagePagination(\"content\", $limit, \"articles\");\n echo $result;\n }", "function getArticles() {\n global $db;\n $query = $db->query('SELECT * FROM article, auteur\n WHERE article.auteur_id = auteur.id ORDER BY article.id DESC');\n return $query->fetchAll();\n \n}", "public function index()\n {\n $articles = Article::latest()->with('user')->paginate(4);\n foreach ($articles as $article){\n $article->setAttribute('added_at',$article->created_at->diffForHumans());\n $article->setAttribute('comments_count',$article->comments->count());\n }\n return response()->json($articles);\n }", "public function index()\n {\n return view('articles.index')->with('articles', Article::all());\n }", "public function index()\n {\n $info=article::orderBy('arti_id','asc')->paginate(8);\n return view('Admin.Article.list',compact('info'));\n }", "public function articles()\n {\n $data = Article::where(['is_active'=> 1])->get();\n return view('frontend.article',['data' => $data]);\n }", "function getArticleList($search_content, $nbArticles) {\r\n $query1 = createQuery($search_content, '%20');\r\n $query2 = 'http://lemoteur.orange.fr/?module=lemoteur&bhv=actu&kw='.$query1;\r\n // The DOM variable contains the DOM of the search result\r\n $dom = getPageContent($query2);\r\n\r\n $articles = array();\r\n $cursor = 0;\r\n foreach ($dom->find('div.entry') as $articleContent) {\r\n $articleText = $articleContent->plaintext;\r\n $articleLink = $articleContent->find('a')[0];\r\n $articleTitle = $articleLink->plaintext;\r\n $articleUrl = $articleContent->find('a')[0]->href;\r\n\r\n $articleArray = [\r\n \"text\" => $articleText,\r\n \"link\" => $articleLink,\r\n \"title\" => $articleTitle,\r\n \"url\" => $articleUrl,\r\n ];\r\n\r\n array_push($articles, $articleArray);\r\n $cursor++;\r\n if ($cursor > $nbArticles) {\r\n break;\r\n }\r\n }\r\n\r\n return $articles;\r\n\r\n}", "public function index() {\n\t\t$items = $this->user->getAllArticles();\n\t\t$id = 'all';\n\t\treturn View::make('front.articles.index', compact('items', 'id'));\n\t}", "public function indexAction()\n {\n $page = $this->request->getQuery('page', array('int'), 1);\n $limit = $this->config->application->pagination_limit;\n $params = array(\n 'conditions' => array(\n 'module' => \\ITECH\\Data\\Lib\\Constant::ARTICLE_MODULE_POST,\n 'status' => \\ITECH\\Data\\Lib\\Constant::ARTICLE_STATUS_ACTIVE\n ),\n 'page' => $page,\n 'limit' => $limit\n );\n\n $articleRepo = new \\ITECH\\Data\\Repo\\ArticleRepo();\n $articles = $articleRepo->getPaginationList($params);\n $categoryLayout = array();\n\n if ($articles->total_items > 0) {\n foreach ($articles->items as $item) {\n $params = array(\n 'conditions' => array(\n 'article_id' => $item->id\n )\n );\n $articleCategoryRepo = new \\ITECH\\Data\\Repo\\ArticleCategoryRepo();\n $articleCategory = $articleCategoryRepo->getList($params);\n if (count($articleCategory)) {\n foreach ($articleCategory as $category) {\n $categoryLayout[$item->id][] = $category->category_name;\n }\n }\n }\n }\n\n $query = array();\n $query['page'] = $page;\n\n $url = $this->url->get(array('for' => 'article'));\n $options = array(\n 'url' => $url,\n 'query' => $query,\n 'total_pages' => isset($articles->total_pages) ? $articles->total_pages : 0,\n 'page' => $page,\n 'pages_display' => 3\n );\n\n $layoutComponent = new \\ITECH\\Admin\\Component\\LayoutComponent();\n $paginationLayout = $layoutComponent->pagination(parent::$theme, $options);\n\n $breadcrumbs = [\n [\n 'title' => 'Dashboard',\n 'url' => $this->config->application->base_url,\n 'active' => false\n ],\n [\n 'title' => 'Danh sách bài viết',\n 'url' => $this->url->get([\n 'for' => 'article'\n ]),\n 'active' => true\n ]\n ];\n\n $this->view->setVars(array(\n 'breadcrumbs' => $breadcrumbs,\n 'paginationLayout' => $paginationLayout,\n 'articles' => $articles->items,\n 'categoryLayout' => $categoryLayout\n ));\n\n $this->view->pick(parent::$theme . '/article/index');\n }", "public function index()\n {\n $articles = Articles::all();\n return view('articles.articles',compact('articles'));\n }", "public function get_all_academic_article()\n {\n $academic_articleAll = $this->db->get($this->academic_article)->result(); \n return json_encode($academic_articleAll); \n }", "public function all()\n {\n $res['news'] = $this->db->get($this->table)->result();\n $res['featured'] = $this->getFeatured();\n\n $this->formatFields($res['news']);\n\n return $res;\n }", "public function index()\n {\n $article = Article::orderBy('id','DESC')-> paginate(5);\n// $article = Article::all();\n return response()->json($article,200);\n }", "public function indexAction() {\n // on récupère l'entity manager à l'aide du service Doctrine\n $em = $this->getDoctrine()->getManager();\n\n // on récupère le repository de Article et on lui demande \n // tous les articles\n $entities = $em->getRepository('HBBlogBundle:Article')->findAll();\n\n // on transmet la liste d'article au template en la nommant entities\n return array(\n 'entities' => $entities,\n );\n }" ]
[ "0.84823924", "0.8125418", "0.8012138", "0.7984742", "0.79539484", "0.78782076", "0.7873627", "0.78444636", "0.7752233", "0.7686997", "0.7642229", "0.7632033", "0.76269895", "0.75772554", "0.7543043", "0.75326926", "0.752989", "0.7529652", "0.7509475", "0.7492319", "0.74911386", "0.7467344", "0.74528116", "0.74336165", "0.7407748", "0.73970765", "0.73909706", "0.7367873", "0.7357967", "0.7356928", "0.73548996", "0.7297194", "0.72855794", "0.72188205", "0.72107965", "0.71918607", "0.7191545", "0.7173513", "0.71699804", "0.71607214", "0.7154159", "0.71490896", "0.7145905", "0.7123164", "0.7100589", "0.7093033", "0.7070186", "0.70641565", "0.70593435", "0.70567685", "0.7053409", "0.7047908", "0.7026192", "0.7022673", "0.7022191", "0.70153356", "0.69951236", "0.6985028", "0.6976552", "0.6974851", "0.6958899", "0.69537145", "0.69489056", "0.693505", "0.6920582", "0.69196874", "0.6915198", "0.6910628", "0.6890481", "0.6888593", "0.68878156", "0.6864915", "0.6857517", "0.685361", "0.6827797", "0.6810857", "0.6809513", "0.6803584", "0.6802537", "0.68000257", "0.67995983", "0.67848593", "0.6784647", "0.67769027", "0.67631125", "0.6755942", "0.6750937", "0.6750356", "0.67469347", "0.6746682", "0.6743669", "0.6743321", "0.67255753", "0.6720257", "0.670629", "0.67057055", "0.670424", "0.67041236", "0.67014015", "0.6699169", "0.6693223" ]
0.0
-1
get post request data for title and article
public function update(TaskRequest $request, Task $task) { $data = $request->only(["task", "priority"]); // create article with data and store in DB $task->fill($data)->save(); // return the article along with a 201 status code return response($task, 201); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function post_params() {\n return [\n 'title' => $this->params['title'],\n 'excerpt' => $this->params['excerpt'],\n 'content' => $this->params['content'],\n 'tags' => $this->params['tags']\n ];\n }", "function fetch_data_from_post()\n{\n $data['title'] = $this->input->post('title', TRUE);\n $data['url'] = $this->input->post('url', TRUE);\n $data['description'] = $this->input->post('description', TRUE);\n $data['content'] = $this->input->post('content', TRUE);\n $data['date'] = $this->input->post('date', TRUE);\n $data['keywords'] = $this->input->post('keywords', TRUE);\n return $data;\n}", "public function getPost ();", "private function getCategoryPostData()\n {\n // Get data from form fields\n $this->data['category_title'] = $this->input->post('category_title');\n }", "public function get_post_data() {\n\t\treturn $this->post;\n\t}", "public function ParsePostData() {}", "public function getPost($param);", "protected function articleData(Request $request)\n {\n $path = $this->handlePhoto($request);\n $articleData= $request->only( 'title', 'description', 'photo', 'summary' );\n $articleData['photo'] = $path;\n return $articleData;\n }", "public function getPostContent();", "public function getPostParams()\n {\n return $this->post;\n }", "public function showRequestPost();", "function getFromPost() {\r\n\t\t\r\n\t\t//Event Page variables.\r\n\t\t$this->name = $_POST['eventName'];\r\n\t\t$this->date = $_POST['eventDate'];\r\n\t\t$this->time = $_POST['eventTime'];\r\n\t\t$this->time_before = $_POST['time_before'];\r\n\t\t$this->freq = $_POST['frequency'];\r\n\t\t$this->notif_method = $_POST['method'];\r\n\t}", "protected function getPostValues() {}", "public function getPost()\n {\n $request = $this->getRequest();\n return $request->getPost();\n }", "public function getPostVariables();", "public function getData()\n {\n return Post::find(request()->id);\n }", "public function getRequestData();", "function readFromPost() {\n\t\t$this->idt = requestVar('idt');\n\t\t$this->newIdt = requestVar('template');\n\t\t$this->description = requestVar('description');\n\t\t$this->postsHeader = requestVar('postListHeader');\n\t\t$this->postBody = requestVar('postBody');\n\t\t$this->postsFooter = requestVar('postListFooter');\n\t\t$this->formLogged = requestVar('formLogged');\n\t\t$this->form = requestVar('formNotLogged');\n\t\t$this->navigation = requestVar('navigation');\n\t\t$this->name = requestVar('nameNoUrl');\n\t\t$this->nameLin = requestVar('nameUrl');\n\t\t$this->memberName = requestVar('memberName');\n\t\t$this->date = requestVar('date');\n\t\t$this->time = requestVar('time'); \n\t\t$this->nextPage = requestVar('nextPage');\n\t\t$this->previousPage =requestVar('previousPage');\n\t\t$this->firstPage = requestVar('firstPage');\n\t\t$this->lastPage = requestVar('lastPage');\t\n\n\t\t$this->urlToLink = (requestVar('urlToLink') == 'yes') ? true : false;\n\t\t$this->emoToImg = \t (requestVar('emoToImg') == 'yes') ?true : false;\n\t\t$this->gravSize = \t (int)requestVar('gravSize');\n\t\t$this->gravDefault = requestVar('gravDefault');;\n\n\n\t\t\n\t\t$this->action = requestVar('action');\n\t}", "public function post_post()\n\t{\n\t\ttry {\n\t\t\t$results = Articles::regist( self::$_JSON );\n\t\t\t//\\Log::warning(print_r($results, true));\n\n\t\t\treturn $this->response($results, 200);\n\t\t} catch (\\MarcoPandaException $e) {\n\t\t\t$this->error($e);\n\t\t}\n\t}", "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 }", "public function parsePostData()\n {\n }", "public function getPostRequest(): ParameterBag { return $this->post; }", "public function getPostParams()\n {\n return $this->request->all();\n }", "function prePost(){\t\n\t\t\n\t\tif( !$_GET['cod'] ) \n\t\t\t$_POST['DataPublicacao'] = date(\"d/m/Y H:i:s\");\n\t\t\t\n\t\t$utils = new Utils();\n\t\t\n\t\t$Url = $utils->cleanUrl($_POST['Nome']);\n\t\t\n\t\t$_POST['Url'] = $Url;\n\t\t\n\t\treturn $_POST;\t\n\t\n\t}", "public function createPostFromInput() {\n\n $record = [\n 'id_config' => post_config()->getCurrent()->get('id'),\n 'id_user' => user()->getCurrent()->get('id'),\n 'id_parent' => in('id_parent', 0),\n 'subject' => in('subject', ''),\n 'content' => in('content', ''),\n 'content_stripped' => strip_tags(in('content')),\n 'content_type' => in('content_type'),\n 'id_browser' => getBrowserID(),\n 'ip' => getIP(),\n 'domain' => getDomain(),\n 'user_agent' => getUserAgent(),\n 'country' => in('country'),\n 'province' => in('province'),\n 'city' => in('city'),\n 'link' => in('link'),\n ];\n $post = $this->createPost($record);\n\n $this->updateData($post);\n return $post;\n }", "public function storePost($title,$description);", "private function getParameterFromCreateNewsForm($res)\n {\n $params = null;\n if (isset($res) && !empty($res)) {\n if (!empty($res['filter'])) {\n $filter = implode(\",\", $res['filter']);\n } else {\n $filter = null;\n }\n\n $params = array(\n 'id' => null,\n 'title' => htmlentities($res['title'], null, 'UTF-8'),\n 'data' => htmlentities($res['data'], null, 'UTF-8'),\n 'filter' => $filter,\n 'author' => null,\n 'category' => $res['category'],\n 'published' => htmlentities($res['published'], null, 'UTF-8'),\n 'deleted' => null\n );\n }\n\n return $params;\n }", "public function paramsPost()\r\n {\r\n return $this->params_post;\r\n }", "public function inputPost(){\n\n \tpostInput::create(request([\n\t\t 'title',\n\t\t 'content',\n \t\t]));\n\n \t// Redirect to schedule\n \treturn redirect('index');\n }", "public function post($post);", "public function getPost(): array;", "function readInputData() {\r\n\t\t$this->readUserVars(array(\r\n\t\t\t'articleId'\t\r\n\t\t\t));\r\n\t}", "function get_post_data() {\n\t\tif (empty($this->post)) :\n\t\t\t$this->post = get_post( $this->id );\n\t\tendif;\n\t\t\n\t\treturn $this->post;\n\t}", "public function post();", "public function post();", "public function post();", "protected function getFormData() {\n\t\treturn $this->stripNonPrintables(json_decode($this->request->postVar('Details'), true));\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}", "public function getPostFields()\n {\n return $this->invokeWrappedIfEntityEnclosed(__FUNCTION__, func_get_args());\n }", "protected function setPostData()\n\t{\n\t\t$this->request->addPostFields($this->query->getParams());\n\t}", "abstract public function post($data);", "public static function postContent( $request ) {\n $postData = self::_getPostFromId( $request->get_param('id') );\n\n $data = new stdClass();\n $data->id = $postData->ID;\n $data->lead = $postData->lead;\n $data->content = $postData->content_wo_lead;\n \n return $data;\n }", "abstract public function post();", "private function postData()\n {\n $post = array_filter($this->post);\n\n return http_build_query($post);\n }", "abstract public function parsePostData() : array;", "public function getPost()\n {\n return $this->post;\n }", "private function _fill_insert_data() {\n $data = array();\n $data['numero_ticket'] = $this->_generate_numero_ticket();\n $data['descripcion'] = $this->post('descripcion');\n $data['soporte_categoria_id'] = $this->post('soporte_categoria_id');\n $data['persona_id'] = get_persona_id();\n $data['created_at'] = date('Y-m-d H:i:s');\n $data['status'] = 1;\n return $data;\n }", "public function getPostData() {\n \t\n \t// Return POST\n \treturn $this->oPostData;\n }", "private static function getPostParams()\n\t{\n\t\treturn (count($_POST) > 0) ? $_POST : json_decode(file_get_contents('php://input'), true);\n\t}", "public function provideAction(){\n if($this->request->hasArgument('post')){\n $post = $this->postRepository->findByUid($this->request->getArgument('post'));\n if($post){\n $array['uid'] = $this->request->getArgument('post');\n $array['content'] = $post->getContent();\n $array['crdate'] = $post->getCrdate();\n $array['owner'] = $post->getOwner();\n $this->view->assign('dataJson',json_encode($array));\n }\n else{\n $this->view->assign('dataJson',json_encode(['content' => '<div class=\"alert alert-warning\">Post ('.$this->request->getArgument('post').') is not accessible or could not be loaded!</div>']));\n }\n }\n else{\n $this->view->assign('dataJson',json_encode(['content' => '<div class=\"alert alert-danger\">No post ID given!</div>']));\n }\n }", "public function postAction()\n {\n \t$this->_object->title = $this->getRequest()->getParam('title');\n \t$this->_object->text = $this->getRequest()->getParam('text');\n \t$this->_object->answer = $this->getRequest()->getParam('answer');\n\t\t$this->_object->tag = $this->getRequest()->getParam('tags');\n\t\t$this->_objectMapper->save($this->_object);\n \t$this->getResponse()\n ->setHttpResponseCode(201);\n }", "public function getFormData(){\n\n\t\t\t\n\t\t\t$expectedVariables = ['title','email','checkbox'];\n\n\n\t\t\tforeach ($expectedVariables as $variable) {\n\n\t\t\t\t// creating entries for error field\t\n\t\t\t\t$this->moviesuggest['errors'][$variable]=\"\";\n\n\t\t\t\t// move all $_POST values into MovieSuggest array\n\t\t\t\tif(isset($_POST[$variable])){\n\t\t\t\t\t$this->moviesuggest[$variable] = $_POST[$variable];\n\t\t\t\t}else{\n\t\t\t\t\t$this->moviesuggest[$variable] = \"\";\n\t\t\t\t}\n\t\t\t}\n\n\n\t\t\t// var_dump($moviesuggest);\n\t\t\t// die();\n\t}", "function getFromPost()\r\n {\r\n $CI = &get_instance();\r\n $note = new Note;\r\n //correct form?\r\n if ($CI->input->post('formname')!='note') {\r\n return null;\r\n }\r\n //get basic data\r\n $note->note_id = $CI->input->post('note_id');\r\n $note->text = $CI->input->post('text');\r\n $note->pub_id = $CI->input->post('pub_id');\r\n $note->user_id = $CI->input->post('user_id');\r\n\r\n return $note;\r\n }", "function gatherMovieInfoFromPost( $params ) \n\t{\n\t\tif (!empty($params['localdbid']))\n\t\t\t$movieinfo['localdbid'] = $params['localdbid'];\n\t\t$movieinfo['filepath'] = $params['filepath'];\n\t\t$movieinfo['duration'] = $params['duration'];\n\t\t$movieinfo['title'] = $params['title'];\n\t\t$movieinfo['imdbid'] = $params['imdbid'];\n\t\t$movieinfo['original_title'] = $params['original_title'];\n\t\t$movieinfo['year'] = $params['year'];\n\t\t$movieinfo['mpaa'] = $params['mpaa'];\n\t\t$movieinfo['director'] = $params['director'];\n\t\t$movieinfo['writers'] = $params['writers'];\n\t\t$movieinfo['tagline'] = $params['tagline'];\n\t\t$movieinfo['genres'] = $params['genres'];\n\t\t$movieinfo['overview'] = $params['overview'];\n\t\t$movieinfo['plot'] = $params['overview'];\n\t\t$movieinfo['actors'] = $params['actors'];\n\t\t$movieinfo['thumb'] = isset($params['thumb']) ? urldecode($params['thumb']) : '';\n\t\t$movieinfo['allthumbs'] = urldecode($params['allthumbs']);\n\n\t\treturn $movieinfo;\n\t}", "public function get_request_content();", "function lesson_title(){\n return $_POST['lesson-title'];\n}", "public function createFromPost($info)\n\t{\n\t\t//task info\n\t\tif (isset($_SESSION['userid'])) $this->userid = $_SESSION['userid'];\n\t\t\n\t\tif (isset($info['title'])) $this->title = $info['title'];\n\t\t\n\t\tif (isset($info['description'])) $this->description = $info['description'];\n\t\t\n\t\tif (isset($info['content'])) $this->content = $info['content'];\n\t\t\n\t\tif (isset($info['location'])) $this->location = $info['location'];\n\t\t\n\t\tif (isset($info['price'])) $this->price = $info['price'];\n\t\t\n\t\t//metadata\n\t\tif (isset($info['category'])) $this->category = $info['category'];\n\t\t\n\t\tif (isset($info['tags'])) $this->tags = $info['tags'];\n\t\t\n\t\tif (isset($info['numimg'])) $this->numimg = $info['numimg'];\n\t\t\n\t\tif (isset($info['enddatetime'])) $this->enddatetime = $info['enddatetime'];\n\t}", "public function parsePost($post){\n\t\t\n\t\t$postData = array();\n\t\t$postData['id'] = $post->id;\n\t\t$postData['title'] = $post->title;\n\t\t$postData['slug'] = $post->slug;\n\t\t$postData['url'] = Yii::app()->createAbsoluteUrl('/news/'.$post->id.'/'.$post->slug);\n\t\t$postData['description'] = $post->description;\n\t\t$postData['source'] = $post->source;\n\t\t$postData['source_title'] = $post->source_title;\n\t\t$postData['created_dt'] = $this->time2StringFormatted($post->created_dt);\n\t\t$postData['updated_dt'] = $this->time2StringFormatted($post->updated_dt);\n\t\t$postData['image'] = $post->image != '' ? Yii::app()->request->hostInfo . Yii::app()->request->baseUrl . '/static/' . $post->image : Yii::app()->request->hostInfo . Yii::app()->request->baseUrl . '/static/default_image.png';\n\t\t$postData['category'] = array();\n\t\tif($post->cat_id){\n\t\t\t$postData['category']['cat_id'] = $post->cat_id;\n\t\t\t$postData['category']['title'] = $post->Cat->title;\n\t\t}\n\t\t$postData['author'] = array();\n\t\tif($post->user_id){\n\t\t\t$postData['author']['user_id'] = $post->user_id;\n\t\t\t$postData['author']['user_full_name'] = $post->User->user_full_name;\n\t\t}\n\t\treturn $postData;\n\t\t\n\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}", "public function OrderDataPost($postData){\n //do something awesome with that post data\n return \"I am in\";\n }", "public function formData()\n {\n return array(\n 'id' => $this->_id,\n 'name' => $this->_name,\n 'content' => $this->_content,\n 'categoryId' => $this->_category_id,\n 'userId' => $this->_user_id\n );\n }", "public function methodPost() {\n $jsondata= file_get_contents('php://input');\n $data= json_decode($jsondata,false);\n \n if (!empty($data)) {\n $model= new News();\n $model->saveItem($data);\n return array('ok'=>'ok');\n } else {\n throw new Exception('You must specify an id.');\n }\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}", "protected function getPost(): array {\n\t\t$post = array_diff_key($this->request->getParams(), array_flip(array( '_METHOD', )));\n\n\t\treturn $post;\n\t}", "public function createActionPost() : object\n {\n $request = $this->app->request;\n $session = $this->app->session;\n $response = $this->app->response;\n $title = $request->getPost(\"contentTitle\");\n $doCreate = $request->getPost(\"doCreate\");\n $db = $this->app->db;\n $db->connect();\n $sql = \"SELECT title FROM content\";\n $titles = $db->executeFetchAll($sql);\n\n if (isset($doCreate)) {\n foreach ($titles as $t) {\n if ($t->title == $title) {\n $session->set(\"existError\", true);\n return $response->redirect(\"cms/create\");\n }\n }\n $db->connect();\n $sql = \"INSERT INTO content (title) VALUES (?);\";\n $db->execute($sql, [$title]);\n $contentId = $db->lastInsertId();\n $slug = slugify($title);\n $session->set(\"adminid\", $contentId);\n return $response->redirect(\"cms/edit/${slug}\");\n }\n }", "abstract public function getRequestBody();", "public function getPostParam($title)\n {\n $result = false;\n if (isset($this->postParams[$title])) {\n $result = $this->postParams[$title];\n }\n return $result;\n }", "protected function obtainPostRequest() {\n /*\n * If the request was sent in JSON format (for example from an mobile app) \n * we will transform it into a format that can be interpreted by PHP\n */ \n $request = Request::createFromGlobals();\n if ($request->headers->get('Content-Type') == 'application/json') {\n $data = json_decode($request->getContent(), true);\n $request->request->replace(is_array($data) ? $data : array());\n }\n return $request->request;\n }", "protected function getJsonDecodedFromPost(){\n // $this->app->response()->header(\"Content-Type\", \"application/json\");\n // obtain the JSON of the body of the request\n $post = json_decode($this->app->request()->getBody(), true); // make it a PHP associative array\n return $post;\n }", "public static function post( $request ) {\n $postData = self::_getPostFromId( $request->get_param('id') );\n\n $data = self::_getPostDataFromWPOOPost( $postData );\n return $data;\n }", "protected function getPostData(Request $request) {\n\t\tif (!isset($this->postData)) {\n\t\t\t$body = $request->Body;\n\t\t\t/** @var array $postVars */\n\t\t\t$postVars = $request->Post();\n\n\t\t\tif (isset($postVars['model'])) {\n\t\t\t\t$this->postData = json_decode($postVars['model'], true);\n\t\t\t} elseif (!empty($postVars)) {\n\t\t\t\t$this->postData = $postVars;\n\t\t\t} elseif (strlen($body) > 0) {\n\t\t\t\t$this->postData = json_decode($body, true);\n\t\t\t} else {\n\t\t\t\t$this->postData = [];\n\t\t\t}\n\t\t}\n\t\treturn $this->postData;\n\t}", "public function get_payload_request();", "public function post_body() {\n\t\treturn file_get_contents( 'php://input' );\n\t}", "protected function loadFormData()\n {\n $data = JFactory::getApplication()->getUserState('com_labgeneagrogene.requests.data', array());\n\n if (empty($data)) {\n $id = JFactory::getApplication()->input->get('id');\n $data = $this->getData($id);\n }\n\n return $data;\n }", "public function postAction()\n {\n $manager = new \\Art4\\JsonApiClient\\Utils\\Manager();\n $manager->setConfig('optional_item_id', true);\n // @todo handle validation errors\n $document = $manager->parse($this->request->getRawBody());\n $resource = $this->resource->getModel();\n\n // basic attributes\n foreach ($document->get('data')->get('attributes')->asArray(true) as $key => $value) {\n $resource->{$key} = $value;\n }\n\n // @todo handle saving errors\n $resource->save();\n\n return $this->renderSerialized($resource);\n }", "protected function getHttpPostFields()\n {\n $config = $this->getConfig();\n $request = $this->getRequest();\n $context = $request->getContext();\n\n $params = array();\n\n $params['aid'] = $config->getAccountId();\n\n $params['type'] = $request->getType();\n $params['wid'] = $request->getWidgetId();\n $params['start'] = $request->getStartIndex();\n if($chunkSize = $request->getChunkSize()) {\n $params['csize'] = $chunkSize;\n }\n $params['widgetdetails'] = $request->getIncludeWidgetDetails() ? '1' : '0';\n\n if($productIdsToExclude = $request->getExcludeProductIds()) {\n $params['excl'] = $productIdsToExclude;\n }\n\n // context\n if($visitorId = $context->getVisitorId()) {\n $params['emvid'] = $visitorId;\n }\n if($productIds = $context->getProductIds()) {\n $params['pid'] = $productIds;\n }\n $categories = $context->getCategories();\n if(count($categories) > 0) {\n if(count($categories) > 1) {\n throw new RuntimeException(\"Only one or zero categories in context allowed in current implementation.\");\n }\n $cat = $categories[0]; /* @var $cat Context\\Category */\n $params['ctxcat.ct'] = $cat->getType();\n if($catId = $cat->getId()) {\n $params['ctxcat.cid'] = $catId;\n } else {\n $params['ctxcat.paa'] = $cat->getPath();\n $params['ctxcat.pv'] = $cat->getVariant();\n }\n }\n\n return $params;\n }", "function getPOSTData() {\n // check headers for one of two specific content-types\n $headers = getallheaders();\n $headerError = 'You must specify a Content-Type of either `application/x-www-form-urlencoded` or `application/json`';\n if ( !isset($headers['Content-Type']) ) {\n errorExit( 400, $headerError );\n }\n\n if ( $headers['Content-Type'] === 'application/json' ) {\n // parse the input as json\n $requestBody = file_get_contents( 'php://input' );\n $data = json_decode( $requestBody );\n if ( $data === null ) {\n errorExit( 400, 'Error parsing JSON' );\n }\n return $data;\n } else if ( $headers['Content-Type'] === 'application/x-www-form-urlencoded' ) {\n // convert the $_POST data from an associative array to an object\n return (object)$_POST;\n } else {\n errorExit( 400, $headerError );\n }\n}", "function rest_prepare($data, $post = null, $request = 0)\n {\n\n $response_data = $data->get_data();\n\n $response_data['_meta'] = get_post_meta($response_data['id']);\n $response_data['_terms'] = wp_get_post_terms( $response_data['id'], 'link-types' );\n $data->set_data($response_data);\n\n return $data;\n }", "public function post( array $postFields );", "function populateFromPost()\n\t{\n\t}", "public static function getPostData() {\n\n $DataObj = new stdClass();\n\n foreach ($_POST as $name => $value)\n $DataObj->$name = $value;\n\n return $DataObj;\n }", "public function postAuthor() {\n $data = Request;\n //Add Author fields sent to Author Table\n //AuthorsController->AuthorsController::store($request);\n $p = sizeof($data);\n // $p = $data;\n //print_r($_POST);\n //$l = fopen('/home/sudipta/check.log','w+');\n //fwrite($l,\" SIZEOF \".$p);\n //Author::create($request);\n //AuthorsController->store($request);\n return;\n }", "private function getPreparedPostData($request) {\n\n $title = $request->data['Post']['title'];\n $body = $request->data['Post']['body'];\n $file = $request->data['Post']['image'];\n\n $imageContent = null;\n $tempName = $file['tmp_name'];\n $imageSize = $file['size'];\n $imageType = $file['type'];\n $imageName = $file['name'];\n\n if (!empty($tempName)) {\n $imageContent = addslashes(fread(fopen($tempName, \"rb\"), filesize($tempName)));\n move_uploaded_file($tempName, WWW_ROOT . 'img/' . $imageName);\n }\n\n $data = array(\n 'title' => $title,\n 'body' => $body,\n 'image_name' => $imageName,\n 'image_type' => $imageType,\n 'image_size' => $imageSize,\n 'image_content' => $imageContent,\n 'created_date' => date('Y-m-d H:i:s')\n );\n\n return $data;\n }", "protected function sendNewArticle(){\n if (!empty($_POST['title'] && !empty($_POST['article']))) {\n $this->sendArticle();\n header('Location: index.php');\n }\n else {\n $this->prepareCreateArticle();\n }\n }", "private function getPostData(): array\n {\n return [\n 'product' => [\n 'attribute_set_id' => '4',\n 'status' => '1',\n 'name' => 'Simple Product',\n 'sku' => 'simple',\n 'url_key' => 'simple-product',\n 'type_id' => \\Magento\\Catalog\\Model\\Product\\Type::TYPE_SIMPLE\n ],\n 'links' => [\n 'upsell' => [\n ['id' => '10'],\n ],\n 'crosssell' => [\n ['id' => '11'],\n ],\n 'related' => [\n ['id' => '12'],\n ],\n ]\n ];\n }", "public function getTitle()\n {\n return $this->input('title');\n }", "public function getPost() {\n //get json post list\n echo $this->model->getPost();\n }", "function getData()\r\n {\r\n //if POST or PUT get the data wiht file_get_contents\r\n if ($this->request === \"POST\" || $this->request === \"PUT\") {\r\n $this->preCleanData = JSON_decode(file_get_contents(\"php://input\"));\r\n //else get the ID from $_get\r\n } else if ($this->request === \"GET\" || $this->request === \"DELETE\") {\r\n if (isset($_GET['ID'])) {\r\n $this->data = $_GET['ID'];\r\n return;\r\n } else {\r\n return;\r\n }\r\n }\r\n $this->cleanData();\r\n }", "function collectDataFromInput()\n\t{\n\t\t$id= FormUtil :: getPassedValue('id', null);\n\t\t$objectid= FormUtil :: getPassedValue('objectid', null);\n\n\t\tif (!empty ($objectid))\n\t\t{\n\t\t\t$id= $objectid;\n\t\t}\n\n\t\t$license= FormUtil :: getPassedValue('license', null, 'POST');\n\t\t$license_image= FormUtil :: getPassedValue('license_image', null, 'FILES');\n\n\t\t(!empty ($license['objectid'])) ? $license['id']= $license['objectid'] : '';\n\n\t\t// get all module vars\n\t\t$modvars= pnModGetVar('crpLicense');\n\n\t\t$data= compact('id', 'objectid', 'license', 'license_image', 'modvars');\n\n\t\treturn $data;\n\t}", "public static function post($variable='*'){\n \n self::load();\n \n if($variable!='*'){\n return self::$request->request->get($variable); \n }\n else{\n return self::$request->request->all();\n }\n }", "public function extract_data_post()\r\n {\r\n if(isset($_POST['search_term']) == true && empty($_POST['search_term']) == false){\r\n $text = filter_input(INPUT_POST, 'search_term', FILTER_SANITIZE_STRING);\r\n $search = $this->Ajax->extract($text);\r\n foreach ($search as $row) {\r\n echo '<li>'.$row['word'].'<li>';\r\n }\r\n }\r\n }", "function parseData(){\r\n\t\t$content = array();\r\n\t\t$this->page_id = $this->CFG->PostVars['pageid'];\r\n\t\tforeach($this->CFG->PostVars as $key=>$value){\r\n\t\t\tif(preg_match(\"/content_(.*)_(.*)/\", $key, $arr)){\r\n\t\t\t\t$field\t= $arr[1];\r\n\t\t\t\t$lang \t= $arr[2];\r\n\t\t\t\tif(is_array($content[$lang])){\r\n\t\t\t\t\t$content[$lang][$field] = $value;\r\n\t\t\t\t}\r\n\t\t\t\telse $content[$lang] = array($field => $value);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t$this->content = $content;\r\n\t}", "public function getRequestData(){\n\t\treturn array( \n \t\t\t'cmd' => $this->getRequestCommand(), \n \t\t\t'params' => $this->getParams() \n\t\t); \n\t}", "public function get_input_content();", "public function postTitulo()\r\n\t{\r\n\t\t$desc = trim(Input::get(\"txtDescTitle\"));\r\n\t\t$fecha = date('Y-m-d');\r\n $validator = Validator::make(['desc' => $desc],['desc' => 'exists:tituloshabilitantes,descripcion']);\r\n\t\tif ($validator->fails()) {\r\n\t\t\tDB::insert('insert into tituloshabilitantes (descripcion, usuario_alta, fecha_alta) values (?, ?, ?)', [$desc, Auth::user()->usuario, $fecha]);\r\n\t\t\treturn TituloHabilitante::lists('descripcion', 'id');\r\n\t\t} else {\r\n\t\t\treturn Response::json(['error' => 'Ya existe el título ingresado']);\r\n\t\t}\r\n\r\n\t}", "public function insertArticleAction() {\n $requiredParams = ['author', 'text'];\n if ($params = __request::checkParams($requiredParams)) {\n $article_id = $this->datasource->insertArticle($params['author'], $params['text']);\n\n return ['id' => $article_id];\n }\n\n __::bad_request('Missing parameters');\n }", "public function getData()\n\t{\n if ( is_string($this->_data) ) {\n return $this->_data; \n }\n\t\telse \n return $this->_internal_request->to_postdata();\n\t}", "abstract public function get_posted_value();", "private function getDataByPost($params){\n $content = http_build_query($params);\n $options = array('http'=>array(\n 'method' => 'POST',\n 'header' => \"Content-type: application/x-www-form-urlencoded\\r\\n\", 'content' => $content)\n );\n $context = stream_context_create($options);\n $val = file_get_contents($this->url, false, $context);\n return $val;\n }", "public function post($request);", "public function getPostParams(): array\n {\n return $this->postParams;\n }" ]
[ "0.654665", "0.6526921", "0.60151565", "0.5998064", "0.59265625", "0.58936846", "0.58553374", "0.58448684", "0.58430845", "0.58318704", "0.58240616", "0.5821348", "0.5817795", "0.5793661", "0.57903755", "0.57631826", "0.5747316", "0.57437843", "0.57194936", "0.5714725", "0.56896144", "0.5678357", "0.5667318", "0.55755126", "0.55589676", "0.55538595", "0.55449563", "0.55310977", "0.5521866", "0.55151016", "0.5513613", "0.5502327", "0.54856837", "0.5483941", "0.5483941", "0.5483941", "0.5468465", "0.54631597", "0.5455626", "0.5453513", "0.5436962", "0.54335093", "0.54312193", "0.5424124", "0.53961426", "0.53862274", "0.5379087", "0.5375773", "0.537533", "0.5365287", "0.5355399", "0.53514874", "0.5349519", "0.5332717", "0.5318686", "0.53124785", "0.5280415", "0.52770066", "0.5272513", "0.524025", "0.52253795", "0.5225321", "0.522327", "0.5215669", "0.52110684", "0.5203422", "0.52025515", "0.51971483", "0.519199", "0.51826495", "0.51763", "0.51754844", "0.5171877", "0.5167595", "0.5154968", "0.51506585", "0.5139477", "0.51265854", "0.51224405", "0.5121964", "0.51142716", "0.5113798", "0.51089275", "0.5105238", "0.51033384", "0.509823", "0.5098028", "0.50966996", "0.50959367", "0.5092364", "0.5092265", "0.50914335", "0.50859755", "0.5082619", "0.5075467", "0.50740224", "0.5070973", "0.5070488", "0.50676197", "0.50672793", "0.50551414" ]
0.0
-1
Set complete prop of task to true
public function complete(Task $task) { $task->complete = true; //Use model to save task in table $task->save(); // return the article along with a 201 status code return $task; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function completing($task)\n {\n $task->update(['complete' => true]);\n\n $this->createActive('create_with_complete_task', 'App\\Models\\Task', $this->id);\n }", "public function inCompleting($task)\n {\n $task->update(['complete' => false]);\n\n $this->createActive('create_with_incomplete_task', 'App\\Models\\Task', $this->id);\n }", "public function complete();", "public function complete();", "public function complete($completed = true)\n {\n $this->update(compact('completed'));\n }", "public static function maybe_mark_complete() {\n\t\t// The install notice still exists so don't complete the profiler.\n\t\tif ( ! class_exists( 'WC_Admin_Notices' ) || \\WC_Admin_Notices::has_notice( 'install' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$onboarding_data = get_option( self::PROFILE_DATA_OPTION, array() );\n\t\t// Don't make updates if the profiler is completed, but task list is potentially incomplete.\n\t\tif ( isset( $onboarding_data['completed'] ) && $onboarding_data['completed'] ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$onboarding_data['completed'] = true;\n\t\tupdate_option( self::PROFILE_DATA_OPTION, $onboarding_data );\n\t\tupdate_option( 'woocommerce_task_list_hidden', 'yes' );\n\t}", "public function setTaskDone()\n {\n // Simply unlink our task file.\n unlink($this->taskFilePath);\n }", "public function isComplete() {\n return $this->getDescription() == 'Done';\n }", "public function incomplete()\n {\n $this->update(['completion_date' => null]);\n LogController::set(get_class($this).'@'.__FUNCTION__);\n // $this->recordActivity('incompleted_task');\n }", "protected function resolveStatusAndSetCompletedFields()\n {\n if ($this->status != Task::STATUS_COMPLETED)\n {\n $this->completed = false;\n }\n else\n {\n $this->completed = true;\n }\n\n if ($this->completed == true)\n {\n if ($this->completedDateTime == null)\n {\n $this->completedDateTime = DateTimeUtil::convertTimestampToDbFormatDateTime(time());\n }\n $this->unrestrictedSet('latestDateTime', $this->completedDateTime);\n }\n }", "public function toggleComplete(Task $task)\n {\n $task->is_complete = ! $task->is_complete;\n $task->save();\n\n $redirect = Redirect::route('task.index');\n return $redirect->with('success', 'Status updated successfully.');\n }", "public function taskComplete(){\n $taskId = $_POST[\"taskId\"];\n\n $this->individualGroupModel->changeTaskCompletion($taskId, true);\n\n //redirect\n $path = '/IndividualGroupController/individualGroup?groupId=' . $_SESSION['current_group']; \n redirect($path);\n }", "function complete();", "public function isCompleted();", "public function onComplete(\n /** @noinspection PhpUnusedParameterInspection */\n SyncTaskCompleteEvent $event\n ) {\n $this->isCalled = true;\n }", "abstract public function isComplete();", "protected function complete()\n {\n parent::complete();\n }", "public function isCompleted() {\n return $this->state->getCode() == TaskState::Completed;\n }", "public function mark_complete() {\n // Create record\n $this->timecompleted = time();\n\n // Save record\n if ($this->id) {\n $this->update();\n } else {\n $this->insert();\n }\n\n // Mark course completion record as started (if not already)\n $cc = array(\n 'course' => $this->course,\n 'userid' => $this->userid\n );\n $ccompletion = new completion_completion($cc);\n $ccompletion->mark_inprogress($this->timecompleted);\n }", "function isComplete()\n {\n return $this->complete;\n }", "public function isCompleted(): bool\n {\n return $this->status == 'completed';\n }", "public function taskIsDone()\n {\n // If file exists, the related task is still busy.\n return ! file_exists($this->taskFilePath);\n }", "protected function completeRunningJob()\n {\n $runningJob = $this->objFromFixture(QueuedJobDescriptor::class, 'runningjob');\n $runningJob->JobStatus = 'Complete';\n $runningJob->write();\n\n $runningJob = $this->objFromFixture(QueuedJobDescriptor::class, 'immediatependingjob');\n $runningJob->JobStatus = 'Complete';\n $runningJob->write();\n }", "protected function complete() {\n\t\t\tparent::complete();\n\n\t\t\tastra_sites_error_log( esc_html__( 'All processes are complete', 'astra-sites' ) );\n\t\t\tupdate_site_option( 'astra-sites-batch-status-string', 'All processes are complete', 'no' );\n\t\t\tdelete_site_option( 'astra-sites-batch-status' );\n\t\t\tupdate_site_option( 'astra-sites-batch-is-complete', 'yes', 'no' );\n\n\t\t\tdo_action( 'astra_sites_site_import_batch_complete' );\n\t\t}", "public function completed() {\n\t}", "public function done(){\n\t\t$this->done=true;\n\t}", "function complete() \n {\n if (!($this->activity->isInteractive()))\n {\n $this->error[] = tra('interactive activities should not call the complete() method');\n return false;\n }\n \n return $this->instance->complete($this->activity_id);\n }", "public function markComplete($id) {\n\n // Recover the task.\n $task = Task::find($id);\n\n // Verify it's actually recovered\n if(is_null($task)) {\n Session::flash('flash_message', 'Unable to locate task');\n return redirect('/tasks');\n }\n\n // Mark complete\n $task->complete = 1;\n\n // save\n $task->save();\n\n // Let the user know, get on with it.\n Session::flash('flash_message', 'Completed: '.$task->description);\n return redirect('/tasks');\n }", "public function isComplete()\n\t{\n\t\treturn $this->status == 'Complete';\n\t}", "public function isComplete()\n {\n return $this->status == 'success';\n }", "public function can_be_completed(): bool {\n\t\t// TODO: Implement this.\n\t\treturn false;\n\t}", "public function markAsDone() {\n\t\t$sql = \"UPDATE\twbb\".WBB_N.\"_thread\n\t\t\tSET\tisDone = 1\n\t\t\tWHERE\tthreadID = \".$this->threadID;\n\t\tWCF::getDB()->sendQuery($sql);\n\t}", "public function incomplete()\n {\n $this->complete(false);\n }", "function isComplete()\r\n {\r\n return $this->_complete;\r\n }", "public function applyTask()\n\t{\n\t\t$this->saveTask(false);\n\t}", "public function isCompleted()\n {\n return $this->completed;\n }", "public function completeTask(){\n $query = \"UPDATE \" . $this->table_name . \" \n SET \n stato = 3\n WHERE id_ordine = :id_ordine\";\n \n $stmt = $this->conn->prepare($query);\n\n $this->id_ordine=htmlspecialchars(strip_tags($this->id_ordine));\n\n $stmt->bindParam(\":id_ordine\", $this->id_ordine);\n\n if($stmt->execute()){\n return true;\n }\n \n return false;\n }", "public function is_complete() {\n return (bool) $this->timecompleted;\n }", "public function hasCompleted() : bool\n {\n return $this->completed_at !== null;\n }", "public function completeFlow();", "protected function completeJob() {\n\t\t$this->isComplete = 1;\n\t\t$nextgeneration = new CheckExternalLinksJob();\n\t\tsingleton('QueuedJobService')->queueJob($nextgeneration,\n\t\t\tdate('Y-m-d H:i:s', time() + self::$regenerate_time));\n\t}", "public function setUploadCompleted(bool $completed = true): void\n {\n $this->uploadCompletedAt = $completed ? new DateTime() : null;\n }", "function setComplete()\n {\n $this->complete = true;\n return $this;\n }", "public function getComplete()\n {\n return $this->complete;\n }", "public function getComplete()\n {\n return $this->complete;\n }", "public function isCompleted()\r\n {\r\n return $this->status >= 100 || $this->status == 2;\r\n }", "public function testCompletesWithCorrectResultWhenOneSubTaskCompletes() {\n $tasks = [new TaskStub(), new TaskStub(), new TaskStub(), new TaskStub()];\n \n $task = new \\Async\\Task\\AnyTask($tasks);\n \n $this->assertFalse($task->isComplete());\n \n // Fail a task and check that the task has not completed\n $tasks[0]->setException(new \\Exception(\"failure\"));\n $task->tick($this->getMock(\\Async\\Scheduler\\Scheduler::class));\n $this->assertFalse($task->isComplete());\n \n // Complete a task and check that the task completes successfully with\n // the correct result\n $tasks[1]->setResult(10);\n $task->tick($this->getMock(\\Async\\Scheduler\\Scheduler::class));\n \n $this->assertTrue($task->isComplete());\n $this->assertFalse($task->isFaulted());\n $this->assertEquals(10, $task->getResult());\n }", "public function showComplete(){\n\t\t\n\t\t//our tasks\n\t\t$this->set('tasks', $this->Task->find('all', array(\n\t\t\t'conditions' => array('Task.status_id' => '2'),\n\t\t\t'order' => array('Task.completed_on'),\n\t\t)));\n\t\t\n\t\t//our statuses\n\t\t$this->set('statuses', $this->Task->Status->find('list'));\n\t\t\n\t\t//our locations\n\t\t$this->set('locations', $this->Task->Location->find('list'));\n\t\t\n\t\t//our keywords\n\t\t$this->set('keywords', $this->Task->Keyword->find('list'));\n\t\t\n\t\t//our link locations\n\t\t$linkLocation['/foundersFactory/tasks/'] = \"Show by Location\";\n\t\tforeach($this->Task->Location->find('list') as $key => $location){\n\t\t\t$linkLocation['/foundersFactory/tasks/showByLocation/'.$key] = $location;\n\t\t}\n\t\t$this->set('linkLocations', $linkLocation);\n\t}", "public function finishJob()\r\n {\r\n $this->done = true;\r\n }", "public function done()\n {\n $this->setStatus(self::STATUS_DONE);\n }", "protected function completePending($async)\n {\n $async->setIsPending(false)->save();\n }", "public function isDone(){\n\t\treturn $this->done;\n\t}", "private function setAutogradingCompleteInternal($complete) {\n $this->autograding_complete = $complete === 'true' || $complete === true;\n }", "public function toggle(){\n \n $taskId = $this->request->data('id');\n\n $task = $this->Task->find('first', array(\n 'contain' => array(),\n 'conditions' => array(\n 'Task.id' => $taskId\n )\n ));\n\n if(empty($task))\n throw new NotFoundException('This task does not exist');\n\n $this->Task->id = $taskId;\n $result = $this->Task->save(array(\n 'Task' => array(\n 'completed' => ($task['Task']['completed'] ? '0' : '1')\n )\n ));\n\n if(!$result)\n throw new InternalErrorException('Failed to update task');\n\n $task = $this->Task->read(null, $taskId); \n\n $this->set(array(\n 'isCompleted' => $task['Task']['completed'],\n 'completedOn' => date('M j, g:i a', strtotime($task['Task']['updated'])),\n '_serialize' => array(\n 'isCompleted',\n 'completedOn'\n )\n ));\n }", "public function isComplete() \n\t{\n\t\treturn (($this->status == self::STATUS_COMPLETED_IMPORT) || \n\t\t ($this->status == self::STATUS_COMPLETED_UNDO_IMPORT));\n\t}", "function setComplete($complete = 1) {\n $this->fulfillment['complete'] = $complete;\n return $this;\n }", "public function setCompleted($completed) {\n\t\t// if passed in completed is not Y or N\n\t\tif(strtoupper($completed) !== 'Y' && strtoupper($completed) !== 'N') {\n\t\t\tthrow new TaskException(\"Task completed is not Y or N\");\n\t\t}\n\t\t$this->_completed = strtoupper($completed);\n\t}", "public function applyTask()\n\t{\n\t\t$this->saveTask();\n\t}", "public function getIsCompleteAttribute()\n {\n return $this->isComplete();\n }", "public function complete()\n {\n $this->stopped();\n\n $this->setStatus(Job::STATUS_COMPLETE);\n\n $this->redis->zadd(Queue::redisKey($this->queue, 'processed'), time(), $this->payload);\n $this->redis->lrem(Queue::redisKey($this->queue, $this->worker->getId() . ':processing_list'), 1, $this->payload);\n Stats::incr('processed', 1);\n Stats::incr('processed', 1, Queue::redisKey($this->queue, 'stats'));\n\n Event::fire(Event::JOB_COMPLETE, $this);\n }", "public function hasComplete(){\n return $this->_has(2);\n }", "public function isCompleted()\n {\n return static::STATUS_SUCCESS == $this->getStatus();\n }", "public function complete(){\n try{\n $stmt = $this->conn->prepare(\"UPDATE tbltodo SET completed='1'\n WHERE id=:id \");\n $stmt->bindparam(\":id\",$this->id);\n $stmt->execute();\n return true;\n }catch(PDOException $e){\n echo $e->getMessage();\n return false;\n }\n\n }", "public function getCompleted() {\n\t\treturn $this->_completed;\n\t}", "function isCompleted(){\r\n\t\treturn $this->status==IFocusModel::COMPLETE;\r\n\t}", "function completeCallback()\r\n { }", "function isComplete() {\n return (bool) $this->fulfillment['complete'];\n }", "public function isCompleted()\n\t{\n\t\treturn $this->status == AdFox::OBJECT_STATUS_COMPLETED;\n\t}", "public function markCompeted() {\n $this->status = self::COMPLETED;\n }", "public function markAsUndone() {\n\t\t$sql = \"UPDATE\twbb\".WBB_N.\"_thread\n\t\t\tSET\tisDone = 0\n\t\t\tWHERE\tthreadID = \".$this->threadID;\n\t\tWCF::getDB()->sendQuery($sql);\n\t}", "protected function done()\n {\n }", "public function isIncomplete(): bool\n {\n return $this->status === self::INCOMPLETE;\n }", "public function hasTasks()\n {\n return $this->count() > 0;\n }", "public function isCompleted()\n\t{\n\t\tif($this->test_status_id == Test::COMPLETED)\n\t\t\treturn true;\n\t\telse \n\t\t\treturn false;\n\t}", "public function toggle()\n {\n $this->isDone = !$this->isDone;\n }", "public function done();", "public function markAsCompleted()\n {\n $this->forceFill(['completed_at' => now()])->save();\n\n return $this;\n }", "protected function hasCompleted()\r\n {\r\n return !(bool)$this->getExpectedStep();\r\n }", "public function done()\r\n {\r\n return $this->done;\r\n }", "public function isComplete(Context $context)\n\t{\n\t\treturn true;\n\t}", "protected function isTaskFull($result)\n {\n return (count($result) == count($this->steps));\n }", "public function complete()\n {\n if ($this->withdrawal->status == Withdrawal::STATUS_IN_PROGRESS) {\n // update withdrawal model\n $this->withdrawal->status = Withdrawal::STATUS_COMPLETED;\n $this->withdrawal->save();\n }\n }", "public function completeAction() {\n\n }", "public function isComplete()\n {\n return !$this->isOpen();\n }", "public function isComplete() {\n if ( !empty($this->aliasId) && !empty($this->email) && !empty($this->username)) {\n return true;\n } else {\n return false;\n }\n }", "public function alive()\n {\n $this->assert();\n $this->task->setState($this->task->getState());\n $this->taskRepository->update($this->task);\n }", "public function getDone()\n {\n return $this->done;\n }", "public function getWorkCompleted()\n {\n return $this->work_completed;\n }", "public function isCompleted(): bool\n {\n return ($this->progress_error + $this->progress_ok) >= \\count($this->state->getSourceStates());\n }", "public static function MarkOrderProcessAsCompleted()\n {\n $_SESSION[self::SESSION_KEY_NAME_ORDER_SUCCESS] = true;\n }", "public function setIsComplete(?bool $value): void {\n $this->getBackingStore()->set('isComplete', $value);\n }", "public function complete()\n {\n // Restore the current working directory, if we redirected it.\n if ($this->cwd) {\n chdir($this->savedWorkingDirectory);\n }\n $this->task('taskDeleteDir', $this->dirs)->run();\n }", "public function qualifyAsFinished(): bool;", "public function markCompletedFor($a_user_id) {\n\t\tglobal $ilAppEventHandler;\n\n\t\t$ilAppEventHandler->raise(\"Services/Tracking\", \"updateStatus\", array(\n\t\t\t\"obj_id\" => $this->getId(),\n\t\t\t\"usr_id\" => $a_user_id,\n\t\t\t\"status\" => ilLPStatus::LP_STATUS_COMPLETED_NUM,\n\t\t\t\"percentage\" => 100\n\t\t\t));\n\t}", "public function completeTask($taskId)\n {\n $updateStatus = $this->taskRepository->saveUpdatedTask($taskId, [\n 'status' => config('enums.task_status.Completed')\n ]);\n\n if ($updateStatus) {\n Session::flash('status', \"Task Marked as Completed\");\n } else {\n Session::flash('status', \"Failed to update Task\");\n }\n return redirect()->back();\n }", "public function setComplete($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->complete !== $v) {\n $this->complete = $v;\n $this->modifiedColumns[AliMemberTableMap::COL_COMPLETE] = true;\n }\n\n return $this;\n }", "public function hasNotCompleted() : bool\n {\n return $this->completed_at === null;\n }", "public static function complete($taskId, $userId) {\n\t\t$response = self::loadResponse($taskId, $userId);\n\n\t\t$response->scenario = self::SCENARIO_COMPLETE;\n\t\treturn $response->updateStatus(self::STATUS_COMPLETED);\n\t}", "public function completed()\n {\n return $this->state(function (array $attributes) {\n return [\n 'completed' => 1,\n 'time_completed' => Carbon::now(),\n ];\n });\n }", "public function testUpdateTask()\n {\n }" ]
[ "0.7398641", "0.735716", "0.6903572", "0.6903572", "0.6879162", "0.67618924", "0.67569566", "0.66411525", "0.6571187", "0.6519457", "0.65129405", "0.6509925", "0.6492991", "0.6463528", "0.6449909", "0.6434067", "0.64310855", "0.6405827", "0.6325141", "0.6306397", "0.63054764", "0.62838024", "0.62721235", "0.6249399", "0.62396336", "0.6235616", "0.61863315", "0.61533517", "0.6151263", "0.61469793", "0.6144776", "0.6105147", "0.60974205", "0.6060702", "0.60583097", "0.6055665", "0.6045208", "0.6043051", "0.60263574", "0.60146946", "0.5955819", "0.59504616", "0.5942272", "0.5931674", "0.5931674", "0.59277064", "0.59071493", "0.58958", "0.5886902", "0.5885169", "0.5867363", "0.5852764", "0.58499056", "0.5832206", "0.58045465", "0.5790096", "0.5760962", "0.57360965", "0.57276434", "0.5717167", "0.5697521", "0.5692214", "0.56749237", "0.56739163", "0.56608546", "0.5649368", "0.5643551", "0.5624581", "0.56239223", "0.5623144", "0.56183565", "0.56099933", "0.56019473", "0.55978554", "0.5597277", "0.5596855", "0.5592013", "0.55880773", "0.55817086", "0.5575648", "0.55691165", "0.55665225", "0.55588686", "0.5556367", "0.55310404", "0.5511705", "0.5503456", "0.5493788", "0.54854435", "0.5482024", "0.54813075", "0.5475922", "0.5438132", "0.54370075", "0.54282624", "0.54256326", "0.54182386", "0.54090035", "0.53983945", "0.53956866" ]
0.6679409
7
Show the edit form for dock permissions
public function edit(Dock $dock) { $this->authorize(get_class($dock) . '.edit-permissions'); return view('admin::docks.' . $dock->name . '.permissions.edit')->withDock($dock); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function edit()\n {\n return view('permission::edit');\n }", "public function editPasswordAdmin()\n {\t\n \treturn view('setting.edit-password-admin');\n }", "function displayEditScreen()\t{\t \n\t\t// We handle here Edit mode or Preview Mode\n\t\t// Edit Mode : User can edit fields\n\t\t// Preview Mode : user can only see fields\t\n\t\tif ($this->conf['debug']) echo Tx_MetaFeedit_Lib_ViewArray::viewArray(array('displayEditScreen'=>'on'));\n\t\t$exporttype=$this->piVars['exporttype'];\n\t\t$print=$this->piVars['print'];\n\t\t$printerName=$this->piVars['printername'];\n\t\t$printServerName=$this->piVars['printservename'];\n\t\tif ($exporttype == 'PDF') $exporttype = \"PDFDET\";\n\t\t$this->conf['cmdmode']='edit';\t\n\t\t// We handle here Edit mode or Preview Mode\n\t \t// Edit Mode : User can edit fields\n\t \t// Preview Mode : user can only see fields\t \n\t \t//$this->markerArray['###BACK_URL###'] = \"\";\n\t \t\n\t\t//We handle backurl...\n\t\t/*if ($this->conf['edit.']['backPagePid'] && !$this->conf['no_action']) {\n\t\t\t$this->backURL=$this->pi_getPageLink($this->conf['edit.']['backPagePid']);\n\t\t\tif (!strpos($this->backURL,'?')) $this->backURL.='?';\n\t\t\t$this->markerArray['###BACK_URL###'] = $this->backURL;\n\t\t}*/\n\t\t// If editing is enabled\n\t\tif ($this->conf['edit'] || $this->preview || $this->conf['list'] )\t{\t\n\t\t\t// hack for lists in second plugin ... to be checked.., Will not work if we want to edit in second plugin ...\n\t\t\tif ($this->conf['debug']) echo Tx_MetaFeedit_Lib_ViewArray::viewArray(array('Edit or preview'=>'on'));\n\t\t\t$uid=$this->dataArr[$this->conf['uidField']]?$this->dataArr[$this->conf['uidField']]:$this->recUid;\n \t\t\tif ($this->conf['list.']['rUJoinField']=='uid' && $uid){\n \t\t\t\t\n\t\t\t\tif ($this->conf['debug']) echo Tx_MetaFeedit_Lib_ViewArray::viewArray(array('UIDFIELD'=>$this->conf['uidField'].' : '.$this->recUid));\n\t\t\t\tif ($this->conf['debug']) echo Tx_MetaFeedit_Lib_ViewArray::viewArray(array('dataArr'=>$this->dataArr[$this->conf['uidField']]));\n\t\t\t\t$origArr = $this->metafeeditlib->getRawRecord($this->theTable,$uid,$this->conf);\n\t\t\t\tif (!$origArr) die(__METHOD__.\":Detail mode and no id given for $this->theTable,$uid\");\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tif ($this->conf['debug']) echo Tx_MetaFeedit_Lib_ViewArray::viewArray(array('editMode'=>'on'));\n\n\t\t\t// here we handle foreign tables not the best way , we should work on join tables especially if we handle lists...\n\t\t\t\n\t\t\tif ($this->conf['foreignTables'] && is_array($origArr)) {\n\t\t\t\t\n\t\t\t\t//MM not implemented\n\t\t\t\t//Not MM\n\t\t\t\t\n\t\t\t\t$FTRels=t3lib_div::trimexplode(',',$this->conf['foreignTables']);\n\t\t\t\tforeach($FTRels as $FTRel) {\n\t\t\t\t\t$FTable=$GLOBALS['TCA'][$this->theTable]['columns'][$FTRel]['config']['foreign_table'];\n\t\t\t\t\t$FTUid=$origArr[$FTRel];\n\t\t\t\t\t// what if multiple ???\n\t\t\t\t\t// what if editmenu list ???\n\t\t\t\t\tif ($FTUid) {\n\t\t\t\t\t\t //on recup l'id de l'enregistrement a associer\n\t\t\t\t\t\tif ($GLOBALS['TCA'][$this->theTable]['columns'][$FTRel]['config']['MM']) { //si on est dans une MM faut d'abord recup les id de la table MM\n\t\t\t\t\t\t\t$MMT = $GLOBALS['TCA'][$this->theTable]['columns'][$FTRel]['config']['MM'];\n\t\t\t\t\t\t\t$LTUid=$origArr[\"uid\"];\n\t\t\t\t\t\t\t$MMTreq = $GLOBALS['TYPO3_DB']->exec_SELECT_mm_query('*',$this->theTable,$MMT,$FTable,'AND '.$this->theTable.'.uid='.$origArr['uid']);\n\t\t\t\t\t\t\t$resu=$GLOBALS['TYPO3_DB']->sql_num_rows($MMTreq);\n\t\t\t\t\t\t\tif ($resu>=1) {\n\t\t\t\t\t\t\t\twhile($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($MMTreq)) {\n\t\t\t\t\t\t\t\t\tforeach($row as $key =>$val) $origArr[$FTRel.'.'.$key]=$val;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// originally there only these 2 lines in this condition (if ($FTUid) )\n\t\t\t\t\t\t\t$FTorigArr = $GLOBALS['TSFE']->sys_page->getRawRecord($FTable, $FTUid);\n\t\t\t\t\t\t\tif (is_array($FTorigArr)) foreach($FTorigArr as $key =>$val) $origArr[$FTRel.'.'.$key]=$val;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$FTCA=$GLOBALS['TCA'][$FTable]['columns'];\n\t\t\t\t\t\t//krumo ($FTCA);\n\t\t\t\t\t\tif (is_array($FCTA)) foreach($FTCA as $key=>$val) {\n\t\t\t\t\t\t\tif (in_array(substr($FTCA,0,11),array('--div--;Tab','--fsb--;FSB','--fse--;FSE'))) continue;\n\t\t\t\t\t\t\t$this->markerArray['###FIELD_'.$FTRel.'.'.$key.'###']='';\n\t\t\t\t\t\t\t$this->markerArray['###FIELD_EVAL_'.$FTRel.'.'.$key.'###']='';\n\t\t\t\t\t\t\t$this->markerArray['###EVAL_ERROR_FIELD_'.$FTRel.'.'.$key.'###']='';\n\t\t\t\t\t\t\t$this->markerArray['###EVAL_ERROR_FIELD_'.$FTRel.'_'.$key.'###']='';\n\t\t\t\t\t\t\t$this->markerArray['###CSS_ERROR_FIELD_'.$FTRel.'.'.$key.'###']='';\n\t\t\t\t\t\t\t$this->markerArray['###CSS_ERROR_FIELD_'.$FTRel.'_'.$key.'###']='';\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}\n\t\t\t\n\t\t\t//<CBY> We go to detail mode directly if editUnique is true and there is only one elment to edit.\n\t\t\t$DBSELECT=$this->metafeeditlib->DBmayFEUserEditSelectMM($this->theTable,$GLOBALS['TSFE']->fe_user->user, $this->conf['allowedGroups'],$this->conf['fe_userEditSelf'],$mmTable,$this->conf).$GLOBALS['TSFE']->sys_page->deleteClause($this->theTable);\n\n\t\t\t$TABLES=$mmTable?$this->theTable.','.$mmTable:$this->theTable;\n\t\t\tif ($this->conf['debug']) echo Tx_MetaFeedit_Lib_ViewArray::viewArray(array('EDIT'=>$origArr));\n\t\t\tif (!is_array($origArr)&&$this->conf['editUnique']) {\n\t\t\t\t$lockPid = ($this->conf['edit.']['menuLockPid'] && $this->conf['pid'])? ' AND pid='.intval($this->thePid) : '';\n\t\t\t\t$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*', $TABLES, '1 '.$lockPid.$DBSELECT);\n\t\t\t\tif ($this->conf['debug']) \techo Tx_MetaFeedit_Lib_ViewArray::viewArray(array('EDITUNIQUE TEST'=>$GLOBALS['TYPO3_DB']->SELECTquery('*', $TABLES, '1 '.$lockPid.$DBSELECT)));\n\t\t\t\t$resu=$GLOBALS['TYPO3_DB']->sql_num_rows($res);\n\t\t\t\tif ($resu>=1)\t{\n \t\t\t\t\twhile($menuRow = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {\n\t\t\t\t\t\t$origArr = $GLOBALS['TSFE']->sys_page->getRawRecord($this->theTable, $menuRow[$this->conf['uidField']]);\n\t\t\t\t\t\t$this->recUid=$menuRow[$this->conf['uidField']];\n\t\t\t\t\t\t$this->conf['recUid']=$this->recUid;\n\t\t\t\t\t}\n\t\t\t\t} \n\t\t\t}\n\t\t\t// <CBY>\n\t\t\t$this->markerArray['###REC_UID###']=$this->recUid;\n\t\t\t//if ($GLOBALS['TSFE']->loginUser || $this->aCAuth($origArr))\t{\t// Must be logged in OR be authenticated by the aC code in order to edit\n\t\t\tif (($GLOBALS['TSFE']->loginUser && $this->conf['requireLogin']) || ( $this->aCAuth($origArr)&& $this->conf['requireLogin'])||!$this->conf['requireLogin'])\t{\n\t\t\t\t// Must be logged in OR be authenticated by the aC code in order to edit\n\t\t\t\t// If the recUid selects a record.... (no check here)\n\t\t\t\tif ($this->conf['debug']) echo Tx_MetaFeedit_Lib_ViewArray::viewArray(array('EDIT'=>\"No login\"));\n\t\t\t\n\t\t\t\t// We come from ??\n\t\t\t\tif (is_array($origArr) && !($this->conf['inputvar.']['BACK'] && $this->conf['inputvar.']['cameFromBlog']))\t{\n\t\t\t\t\tif ($this->conf['blogData']) $this->preview=1; \n\t\t\t\t\t// we check if edit or preview mode is allowed ...\n\t\t\t\t\tif (!$this->conf['edit'] && !$this->preview )\t{\t// If editing is enabled\n\t\t\t\t\t\t$content.='meta_feedit : feadminlib.inc, Edit-option is not set and Preview-option is not set in TypoScript';\n\t\t\t\t\t\treturn $content;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif ($this->conf['disableEdit'] && !$this->preview )\t{\t// If editing is enabled\n\t\t\t\t\t\t$content.='meta_feedit : feadminlib.inc, Edit-option disabled and Preview-option is not set in TypoScript';\n\t\t\t\t\t\treturn $content;\n\t\t\t\t\t}\n\n\t\t\t\t\tif ($this->aCAuth($origArr) || $this->metafeeditlib->DBmayFEUserEdit($this->theTable,$origArr, $GLOBALS['TSFE']->fe_user->user,$this->conf['allowedGroups'],$this->conf['fe_userEditSelf'],$this->conf))\t{\t\n\t\t\t\t\t\t// Display the form, if access granted.\n\t\t\t\t\t\tif ($this->conf['debug']) echo Tx_MetaFeedit_Lib_ViewArray::viewArray(array('EDIT'=>\"User may edit\"));\n\t\t\t\t\t\tif \t($this->conf['evalFunc'])\t{\n\t\t\t\t\t\t\t$origArr = $this->userProcess('evalFunc',$origArr);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$this->markerArray = $this->setfixed($this->markerArray, $this->conf['setfixed.'], $origArr);\n\t\t\t\t\t\t$content=$this->displayEditForm($origArr,$this->conf,$exporttype,$print,$printerName,$printServerName);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Else display error, that you could not edit that particular record...\t\n\t\t\t\t\t\t$content = $this->metafeeditlib->getPlainTemplate($this->conf,$this->markerArray,'###TEMPLATE_NO_PERMISSIONS###');\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// If the recUid did not select a record, we display a menu of records. (eg. if no recUid)\n\t\t\t\t\t// we check if list mode is allowed ...\n\t\t\t\t\tif (!$this->conf['list'])\t{\t// If editing is enabled\n\t\t\t\t\t\t\t$content.='List-option is not set in TypoScript';\n\t\t\t\t\t\t return $content;\n\t\t\t\t\t}\n\t\t\t\t\t//$content=($this->conf['general.']['listMode']==2)?$this->metafeeditgrid->displayGridScreen($TABLES,$DBSELECT,$this->conf):$this->displayListScreen($TABLES,$DBSELECT,$this->conf);\n\t\t\t\t\tswitch($this->conf['general.']['listMode']) {\n\t\t\t\t\t\tcase 2 :\n\t\t\t\t\t\t\t$content=$this->metafeeditgrid->displayGridScreen($TABLES,$DBSELECT,$this->conf);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 1 :\n\t\t\t\t\t\t\t\t//$content=$this->metafecalendar->displayCalendarScreen($TABLES,$DBSELECT,$this->conf);\n\t\t\t\t\t\t\t$cal=t3lib_div::makeInstance('tx_metafeedit_calendar');\n\t\t\t\t\t\t $cal->initObj($this->metafeeditlib,$this->cObj);\n\t\t\t\t\t\t\t$content=$cal->displayCalendarScreen($TABLES,$DBSELECT,$this->conf);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault :\n\t\t\t\t\t\t\t$content=$this->displayListScreen($TABLES,$DBSELECT,$this->conf);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// Finally this is if there is no login user. This must tell that you must login. Perhaps link to a page with create-user or login information.\n\t\t\t\t$content = $this->metafeeditlib->getPlainTemplate($this->conf,$this->markerArray,'###TEMPLATE_AUTH###');\n\t\t\t}\n\t\t} else {\n\t\t\t$content.='Display Edit Screen : Edit-option , Preview-option or List-option is not set in TypoScript';\n\t\t}\n\t\treturn $content;\n\t}", "public function modifyView() {\n $this->object = $this->object->readObject($this->id);\n $uiObjectName = $this->type.'_Ui';\n $uiObject = new $uiObjectName($this->object);\n $values = array_merge($this->object->valuesArray(), $this->values);\n return $uiObject->renderForm(array_merge(\n array('values'=>$values,\n 'action'=>url($this->type.'/modify', true),\n 'class'=>'formAdmin formAdminModify'),\n array('submit'=>array('save'=>__('save'),\n 'saveCheck'=>__('saveCheck')))));\n }", "public function editformAction(){\n\t\t$this->loadLayout();\n $this->renderLayout();\n\t}", "function edit()\r\n\t{\r\n\t\tJRequest::setVar('view', 'groups');\r\n\t\tJRequest::setVar('layout', 'edit');\r\n\t\tparent::display();\r\n\t}", "protected function AdminPage() {\n\t$oPathIn = fcApp::Me()->GetKioskObject()->GetInputObject();\n\t$oFormIn = fcHTTP::Request();\n\n\t$doSave = $oFormIn->GetBool('btnSave');\n\n\t// save edits before showing events\n\tif ($doSave) {\n\t $frm = $this->PageForm();\n\t $frm->Save();\n\t $this->SelfRedirect();\n\t}\n\n\t$oMenu = fcApp::Me()->GetHeaderMenu();\n\t // ($sGroupKey,$sKeyValue=TRUE,$sDispOff=NULL,$sDispOn=NULL,$sPopup=NULL)\n\t $oMenu->SetNode($ol = new fcMenuOptionLink('do','edit',NULL,NULL,'edit this record'));\n\n\t $doEdit = $ol->GetIsSelected();\n\n\t$frmEdit = $this->PageForm();\n\tif ($this->IsNew()) {\n\t $frmEdit->ClearValues();\n\t} else {\n\t $frmEdit->LoadRecord();\n\t}\n\t$oTplt = $this->PageTemplate();\n\t$arCtrls = $frmEdit->RenderControls($doEdit);\n\t\n\t$out = NULL;\n\t$arCtrls['!ID'] = $this->SelfLink();\n\tif ($doEdit) {\n\t $out .= \"\\n<form method=post>\";\n\t $arCtrls['!extra'] = '<tr>\t<td colspan=2><b>Edit notes</b>: <input type=text name=\"'\n\t .KS_FERRETERIA_FIELD_EDIT_NOTES\n\t .'\" size=60></td></tr>'\n\t ;\n\t $arCtrls['isType'] .= ' is a type';\n\t} else {\n\t $arCtrls['!extra'] = NULL;\n\t $arCtrls['isType'] = $this->IsType()?'type':'folder';\n\t}\n\n\t$oTplt->SetVariableValues($arCtrls);\n\t$out .= $oTplt->RenderRecursive();\n\t\n\tif ($doEdit) {\t \n\t $out .= <<<__END__\n<input type=submit name=\"btnSave\" value=\"Save\">\n<input type=reset value=\"Reset\">\n</form>\n__END__;\n\t}\n\treturn $out;\n }", "function path_admin_edit($pid = 0) {\n if ($pid) {\n $alias = path_load($pid);\n drupal_set_title(check_plain($alias['dst']));\n $output = drupal_get_form('path_admin_form', $alias);\n }\n else {\n $output = drupal_get_form('path_admin_form');\n }\n\n return $output;\n}", "public function isEditFormShown() {}", "public function edit()\n { \n return view('admin.control.edit');\n }", "public function getEditForm();", "function canEdit() {\n\t\t\treturn true;\n\t\t}", "public function displayAdminPanel() {}", "public function can_edit() {\n return true;\n }", "protected function canEdit() {}", "public function editPrivacyAction()\n {\n if (!$this->_helper->requireUser()->isValid())\n return;\n\n $this->view->project_id = $project_id = $this->_getParam('project_id');\n //GET PROJECT ITEM\n $this->view->project = $project = Engine_Api::_()->getItem('sitecrowdfunding_project', $project_id);\n //SHOW THE TAB ACTIVE IN DASHBOARD\n $this->view->activeItem = 'sitecrowdfunding_dashboard_editprivacy';\n //IF THERE IS NO PROJECT.\n if (empty($project)) {\n return $this->_forward('requireauth', 'error', 'core');\n }\n if (!$project->isOpen()) {\n return $this->_forward('requireauth', 'error', 'core');\n }\n Engine_Api::_()->core()->setSubject($project);\n\n //GET VIEWER\n $viewer = Engine_Api::_()->user()->getViewer();\n\n $this->view->form = $form = new Sitecrowdfunding_Form_Project_Privacy();\n $form->removeDecorator('title');\n $form->removeDecorator('description');\n\n $tableProjects = Engine_Api::_()->getDbTable('projects', 'sitecrowdfunding');\n\n $leaderList = $project->getLeaderList();\n //SAVE PROJECT ENTRY\n if (!$this->getRequest()->isPost()) {\n\n //prepare tags\n $projectTags = $project->tags()->getTagMaps();\n $tagString = '';\n\n foreach ($projectTags as $tagmap) {\n $temp = $tagmap->getTag();\n if (!empty($temp)) {\n if ($tagString != '')\n $tagString .= ', ';\n $tagString .= $tagmap->getTag()->getTitle();\n }\n }\n\n $this->view->tagNamePrepared = $tagString;\n if (isset($form->tags))\n $form->tags->setValue($tagString);\n\n $auth = Engine_Api::_()->authorization()->context;\n $roles = array('leader', 'parent_member', 'owner_member', 'owner_member_member', 'owner_network', 'registered', 'everyone');\n foreach ($roles as $roleString) {\n\n $role = $roleString;\n if ($role === 'leader') {\n $role = $leaderList;\n }\n\n if ($form->auth_view) {\n if (1 == $auth->isAllowed($project, $role, \"view\")) {\n $form->auth_view->setValue($roleString);\n }\n }\n\n if ($form->auth_comment) {\n if (1 == $auth->isAllowed($project, $role, \"comment\")) {\n $form->auth_comment->setValue($roleString);\n }\n }\n }\n $ownerList = '';\n $roles_photo = array('leader', 'parent_member', 'owner_member', 'owner_member_member', 'owner_network', 'registered');\n\n foreach ($roles_photo as $roleString) {\n\n $role = $roleString;\n if ($role === 'leader') {\n $role = $leaderList;\n }\n\n //Here we change isAllowed function for like privacy work only for populate.\n $sitecrowdfundingAllow = Engine_Api::_()->getApi('allow', 'sitecrowdfunding');\n if ($form->auth_topic && 1 == $sitecrowdfundingAllow->isAllowed($project, $role, 'topic')) {\n $form->auth_topic->setValue($roleString);\n }\n\n if (isset($form->auth_post) && $form->auth_post && 1 == $sitecrowdfundingAllow->isAllowed($project, $role, 'post')) {\n $form->auth_post->setValue($roleString);\n }\n }\n if (Engine_Api::_()->sitecrowdfunding()->listBaseNetworkEnable()) {\n if (empty($project->networks_privacy)) {\n $form->networks_privacy->setValue(array(0));\n } else {\n $form->networks_privacy->setValue(explode(\",\", $project->networks_privacy));\n }\n }\n\n // Set the member_invite, member_approval options\n $form->member_invite->setValue($tableProjects->getColumnValue($project_id, 'member_invite'));\n $form->member_approval->setValue($tableProjects->getColumnValue($project_id, 'member_approval'));\n\n // $form->payment_action_label->setValue($tableProjects->getColumnValue($project_id, 'payment_action_label'));\n\n\n $notify_project_comment = $tableProjects->getColumnValue($project_id, 'notify_project_comment');\n $notify_project_donate = $tableProjects->getColumnValue($project_id, 'notify_project_donate');\n $is_user_followed_after_comment_yn = $tableProjects->getColumnValue($project_id, 'is_user_followed_after_comment_yn');\n $is_user_followed_after_donate_yn = $tableProjects->getColumnValue($project_id, 'is_user_followed_after_donate_yn');\n\n $form->notify_project_comment->setValue((explode(\",\",$notify_project_comment)));\n $form->notify_project_donate->setValue((explode(\",\",$notify_project_donate)));\n $form->is_user_followed_after_comment_yn->setValue($is_user_followed_after_comment_yn);\n $form->is_user_followed_after_donate_yn->setValue($is_user_followed_after_donate_yn);\n\n return;\n }\n\n\n if ($this->getRequest()->isPost() && $form->isValid($this->getRequest()->getPost())) {\n\n $values = $form->getValues();\n\n $notifyProjectCommentIdAsStr = null;\n $notifyProjectDonateIdAsStr = null;\n\n // check if user selected anyone in notification\n if(isset($values['notify_project_comment'])){\n $notifyProjectCommentIdAsArray = array();\n $notifyProjectCommentIdAsArray = $values['notify_project_comment'];\n $notifyProjectCommentIdAsStr = implode(\",\",$notifyProjectCommentIdAsArray);\n }\n\n // check if user selected anyone in notification\n if(isset($values['notify_project_donate'])){\n $notifyProjectDonateAsArray = array();\n $notifyProjectDonateAsArray = $values['notify_project_donate'];\n $notifyProjectDonateIdAsStr = implode(\",\",$notifyProjectDonateAsArray);\n }\n\n if (empty($values))\n return;\n\n $projectModel = $project;\n\n // Update the member_invite, member_approval options\n $tableProjects->update(array(\n // 'payment_action_label' => $values['payment_action_label'],\n 'member_invite' => $values['member_invite'],\n 'member_approval' => $values['member_approval'],\n 'is_privacy_edited_yn' => 1,\n 'notify_project_donate' => $notifyProjectDonateIdAsStr,\n 'notify_project_comment' => $notifyProjectCommentIdAsStr,\n 'is_user_followed_after_comment_yn' => $values['is_user_followed_after_comment_yn'],\n 'is_user_followed_after_donate_yn' => $values['is_user_followed_after_donate_yn']\n ), array('project_id = ?' => $project_id));\n\n //PRIVACY WORK\n $auth = Engine_Api::_()->authorization()->context;\n\n $roles = array('leader', 'parent_member', 'owner_member', 'owner_member_member', 'owner_network', 'registered', 'everyone');\n $leaderList = $projectModel->getLeaderList();\n\n if (empty($values['auth_view'])) {\n $values['auth_view'] = \"everyone\";\n }\n\n if (empty($values['auth_comment'])) {\n $values['auth_comment'] = \"registered\";\n }\n\n $viewMax = array_search($values['auth_view'], $roles);\n $commentMax = array_search($values['auth_comment'], $roles);\n\n foreach ($roles as $i => $role) {\n\n if ($role === 'leader') {\n $role = $leaderList;\n }\n\n $auth->setAllowed($projectModel, $role, \"view\", ($i <= $viewMax));\n $auth->setAllowed($projectModel, $role, \"comment\", ($i <= $commentMax));\n }\n $ownerList = '';\n $roles = array('leader', 'parent_member', 'owner_member', 'owner_member_member', 'owner_network', 'registered');\n if (empty($values['auth_topic'])) {\n $values['auth_topic'] = \"registered\";\n }\n if (isset($values['auth_post']) && empty($values['auth_post'])) {\n $values['auth_post'] = \"registered\";\n }\n\n $topicMax = array_search($values['auth_topic'], $roles);\n $postMax = '';\n if (isset($values['auth_post']) && !empty($values['auth_post']))\n $postMax = array_search($values['auth_post'], $roles);\n\n foreach ($roles as $i => $role) {\n\n if ($role === 'leader') {\n $role = $leaderList;\n }\n $auth->setAllowed($projectModel, $role, \"topic\", ($i <= $topicMax));\n if (!is_null( $postMax ) ) {\n $auth->setAllowed($projectModel, $role, \"post\", ($i <= $postMax));\n }\n }\n // Create some auth stuff for all leaders\n $auth->setAllowed($projectModel, $leaderList, 'topic.edit', 1);\n $auth->setAllowed($projectModel, $leaderList, 'edit', 1);\n $auth->setAllowed($projectModel, $leaderList, 'delete', 1);\n //UPDATE KEYWORDS IN SEARCH TABLE\n if (!empty($keywords)) {\n Engine_Api::_()->getDbTable('search', 'core')->update(array('keywords' => $keywords), array('type = ?' => 'sitecrowdfunding_project', 'id = ?' => $projectModel->project_id));\n }\n if (!empty($project_id)) {\n $projectModel->setLocation();\n }\n $actionTable = Engine_Api::_()->getDbtable('actions', 'activity');\n foreach ($actionTable->getActionsByObject($projectModel) as $action) {\n $actionTable->resetActivityBindings($action);\n }\n }\n\n }", "public function showEdit()\n {\n\n }", "function mda_settings_form() {\n\t$form['mda_resources_access'] = array(\n\t\t\t'#type' => 'fieldset',\n\t\t\t'#title' => 'Page d\\'infos sur l\\'accès aux ressources MDA',\n\t\t\t'#description' => 'Information affichée à un utilisateur non connecté essayant de voir une ressource dont la visibilité est \"professionnels\".',\n\t);\n\t\n\t$default_text = \"<p>L'accès à cette ressource est réservée aux professionnels possédant un compte sur ce site.</p>\\n\";\n\t$default_text .= \"<p><a href=\" . \"/user\" . \">Accès au formulaire de connexion</a>.</p>\\n\";\n\t$default_text .= '<p>Si vous êtes un professionnel et que vous ne possédez pas de compte,';\n\t$default_text .= ' rendez-vous sur la page de création d\\'un <a href=\"/user/register\">nouveau compte</a>.';\n\n\t$form['mda_resources_access']['mda_restricted_access_text'] = array(\n\t\t\t'#type' => 'text_format',\n\t\t\t'#title' => 'Texte d\\'information',\n\t\t\t'#size' => 100,\n\t\t\t'#default_value' => variable_get('mda_restricted_access_text', $default_text),\n\t\t\t'#format'=> 'full_html',\n\t);\n\n\treturn system_settings_form($form);\n}", "function show_edit()\n\t{\n\t\treturn '';\n\t}", "public function editView() {\n Template_Module::setFullWidth(true);\n $this->edit = true;\n $this->addView();\n // cestak obrázků\n $this->imagePath = $this->category()->getModule()->getDataDir(true);\n }", "public function edit()\n {\n return view('theme::user.settings');\n }", "public function edit($id) {\n\n if (Sentinel::hasAccess(['role.permissions'])) {\n // Execute this code if the user has permission\n //find role by id\n $roles = Sentinel::findRoleById($id);\n // find all package with his permissions\n $modules = Module::with('menus.permissions', 'permissions')->get()->toArray();\n\n return view('permissions::create', compact('modules', 'roles'));\n } else {\n\n alert()->error('No tiene permisos para acceder a esta area.', 'Oops!')->persistent('Cerrar');\n return back();\n }\n }", "function show_acl_form() {\n\t$formDefaults = array(\n\t\t\tarray(\n\t\t\t\t\t'type' => variable_get(\"ACL_RED_READ\"),\n\t\t\t\t\t'name' => t('Reduced Read'),\n\t\t\t\t\t'value' => FALSE,\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t\t'type' => variable_get(\"ACL_READ\"),\n\t\t\t\t\t'name' => t('Read'),\n\t\t\t\t\t'value' => TRUE,\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t\t'type' => variable_get(\"ACL_RED_WRITE\"),\n\t\t\t\t\t'name' => t('Reduces Write'),\n\t\t\t\t\t'value' => FALSE,\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t\t'type' => variable_get(\"ACL_WRITE\"),\n\t\t\t\t\t'name' => t('Write'),\n\t\t\t\t\t'value' => FALSE,\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t\t'type' => variable_get(\"ACL_ADMIN\"),\n\t\t\t\t\t'name' => t('Admin'),\n\t\t\t\t\t'value' => FALSE,\n\t\t\t),\n\t);\n\n\t$groupDefaults = array(\n\t\t\t(object) array(\n\t\t\t\t\t'id' => variable_get(\"ACL_GROUP_ALL_ID\"),\n\t\t\t\t\t'name' => \"All\",\n\t\t\t\t\t'level' => variable_get(\"ACL_READ\"),\n\t\t\t),\n\t);\n\t$render_array['test'] = array(\n\t\t\t'#theme' => 'c_acl',\n\t\t\t'#defaults' => $formDefaults,\n\t\t\t'#defaults_group' => $groupDefaults,\n\t\t\t'#acl_id' => 21, /*'#child_acl_ids' => array(\n\t\t\t\t\t\t\t 54,\n\t\t\t\t\t\t\t 55,\n\t\t\t\t\t\t\t 56,\n\t\t\t\t\t\t\t ),*/\n\t);\n\n\treturn $render_array;\n}", "public function setModifyMode() {\n $this->getElement('submit')->setLabel('Edit Test');\n }", "function edit() {\n\t\tglobal $tpl;\n\n\t\t$form = $this->initForm();\n\t\t$tpl->setContent($form->getHTML());\n\t}", "protected function _edit(){\n\t\treturn $this->_editForm();\n\t}", "public function edit()\n {\n $this->set('groupSelector', $this->app->make(GroupSelector::class));\n $this->set('form', $this->app->make('helper/form'));\n if ($this->config->has('auth.external_concrete')) {\n $this->set('data', (array)$this->config->get('auth.external_concrete', []));\n } else {\n // legacy support\n $this->set('data', (array)$this->config->get('auth.external_concrete5', []));\n }\n $this->set('redirectUri', $this->urlResolver->resolve(['/ccm/system/authentication/oauth2/external_concrete/callback']));\n\n $list = $this->app->make(GroupList::class);\n $this->set('groups', $list->getResults());\n }", "public function edit_howto() {\n\t\tif ($this->session->session_admin != \"\") {\n\t\t\t$this->load->view('open_html');\n\t\t\t$this->load->view('header');\n\t\t\t$this->load->view('edit_howto');\n\t\t\t$this->load->view('close_html');\n\t\t} else {\n\t\t\t$this->load->view('open_html');\n\t\t\t$this->load->view('header');\n\t\t\t$this->load->view('index');\n\t\t\t$this->load->view('close_html');\n\t\t}\n\t}", "function showPageEditorSettingsObject()\n\t{\n\t\tglobal $tpl, $ilTabs, $ilCtrl;\n\t\t\n\t\t$this->addPageEditorSettingsSubTabs();\n\t\t\n\t\tinclude_once(\"./Services/COPage/classes/class.ilPageEditorSettings.php\");\n\t\t$grps = ilPageEditorSettings::getGroups();\n\t\t\n\t\t$this->cgrp = $_GET[\"grp\"];\n\t\tif ($this->cgrp == \"\")\n\t\t{\n\t\t\t$this->cgrp = key($grps);\n\t\t}\n\n\t\t$ilCtrl->setParameter($this, \"grp\", $this->cgrp);\n\t\t$ilTabs->setSubTabActive(\"adve_grp_\".$this->cgrp);\n\t\t\n\t\t$this->initPageEditorForm();\n\t\t$tpl->setContent($this->form->getHtml());\n\t}", "public function edit()\n {\n //\n\t\treturn 'ini halaman edit';\n }", "public function getEdit() {\n\n\t\t$title = '系统设置';\n\t\t$system = System::find( 1 );\n\n\t\treturn View::make( 'system.edit', array( 'title' => $title, 'system' => $system ) );\n\t}", "public function edit()\n\t{\n\t\tJRequest::setVar( 'view', 'player' );\n\t\tJRequest::setVar( 'layout', 'form' );\n\t\tJRequest::setVar('hidemainmenu', 1);\n\t \t \n\t\tparent::display();\n\t}", "public function index()\n {\n //if (!Auth::user()->security)\n // return view('errors/404');\n\n return view('manage/settings/edit');\n }", "function edit()\n\t{\n\t\t$user\t= & JFactory::getUser();\n\n\t\t// Make sure you are logged in\n\t\tif (!$user->authorise('com_weblink.weblink.edit')) {\n\t\t\tJError::raiseError(403, JText::_('ALERTNOTAUTH'));\n\t\t\treturn;\n\t\t}\n\n\t\tJRequest::setVar('view', 'weblink');\n\t\tJRequest::setVar('layout', 'form');\n\n\t\t$model = &$this->getModel('weblink');\n\t\t$model->checkout();\n\n\t\tparent::display();\n\t}", "function mmf_admin_actions() {\n\t\tadd_options_page(\"MapMyFitness\", \"MapMyFitness\", 1, \"mmf\", \"mmf_admin\");\n\t}", "public function editSettings() {\n $name = $this->schema->name();\n $form = new Fragment($name);\n\n if ($this->schema->newgroup()) { // définit dans la vue fields.php\n $form->hidden('type');\n // pour un nouveau groupe, il faut que le groupe soit créé avec le bon type\n // pour un groupe existant, inutile : on a déjà le bon type dans le schéma\n }\n\n $form->input('name')\n ->attribute('class', 'name')\n ->label(__('Nom du groupe', 'docalist-biblio'))\n ->description(__(\"Le nom du groupe doit être unique (ni un nom de champ, ni le nom d'un autre groupe).\", 'docalist-biblio'));\n\n $form->input('label')\n ->attribute('id', $name . '-label')\n ->attribute('class', 'label regular-text')\n ->label(__('Titre du groupe', 'docalist-biblio'))\n ->description(__(\"C'est le titre qui sera affiché dans la barre de titre du groupe et dans les options de l'écran de saisie. Valeur par défaut : type de la notice\", 'docalist-biblio'));\n\n $form->input('capability')\n ->attribute('id', $name . '-capability')\n ->attribute('class', 'capability regular-text')\n ->label(__('Droit requis', 'docalist-biblio'))\n ->description(__(\"Droit requis pour afficher ce groupe de champs. Ce groupe (et tous les champs qu'il contient) sera masqué si l'utilisateur ne dispose pas du droit indiqué. Si vous laissez vide, aucun test ne sera effectué.\", 'docalist-biblio'));\n\n $form->textarea('description')\n ->attribute('id', $name . '-description')\n ->attribute('class', 'description large-text')\n ->attribute('rows', 2)\n ->label(__(\"Texte d'introduction\", 'docalist-biblio'))\n ->description(__(\"Ce texte sera affiché entre la barre de titre et le premier champ du groupe. Vous pouvez utiliser cette zone pour donner des consignes de saisie ou toute autre information utile aux utilisateurs.\", 'docalist-biblio'));\n\n $form->select('state')\n ->attribute('id', $name . '-state')\n ->attribute('class', 'state')\n ->label(__(\"Etat initial du groupe\", 'docalist-biblio'))\n ->description(__(\"Dans l'écran de saisie, chaque utilisateur peut choisir comment afficher chacun des groupes : il peut replier ou déplier un groupe ou utiliser les options de l'écran de saisie pour masquer ou afficher certains groupes. Ce paramètre indique comment le groupe sera affiché initiallement (pour un nouvel utilisateur).\", 'docalist-biblio'))\n ->options([\n '' => __('Ouvert', 'docalist-biblio'),\n 'collapsed' => __('Replié', 'docalist-biblio'),\n 'hidden' => __('Masqué', 'docalist-biblio'),\n ])\n ->firstOption(false);\n\n $form->button(__('Supprimer ce groupe', 'docalist-biblio'))\n ->attribute('class', 'delete-group button right');\n\n return $form;\n }", "function editFormBookmarkFolder()\n\t{\n\t\tif(!$this->tree->isInTree($_GET[\"obj_id\"]))\n\t\t{\n\t\t\t$this->ctrl->setParameter($this, 'bmf_id', '');\n\t\t\t$this->ctrl->setParameter($this, 'obj_id', '');\n\t\t\t$this->ctrl->redirect($this);\n\t\t}\n\t\t\n\t\t$bmf = new ilBookmarkFolder($_GET[\"obj_id\"]);\n\t\t$form = $this->initFormBookmarkFolder('updateBookmarkFolder', $this->id);\n\t\t$form->setValuesByArray\n\t\t(\n\t\t\tarray\n\t\t\t(\n\t\t\t\t\"title\" => $this->get_last(\"title\", $bmf->getTitle()),\n\t\t\t\t\"obj_id\" => $_GET[\"obj_id\"],\n\t\t\t)\n\t\t);\n\t\t$this->tpl->setVariable(\"ADM_CONTENT\", $form->getHTML());\n\t}", "public function edit($pid)\n {\n $permissions = UserPermissions::find($pid);\n return view('layouts.dashboard.admin.crud.permissions.edit',compact('permissions','pid'));\n }", "public function edit()\n {\n return view('admincp::edit');\n }", "function user_login_edit()\n{\n\t$Feul = new Feul;\n\t$member_checkbox = '';\n\tif($Feul->showMembersPermBox() == true)\n\t{\n\t\t$member_checkbox = \"checked\";\t\n\t}\n\t?>\n\t\t<div style=\"margin-top:20px;\">\n\t\t\t<p>\n\t\t\t\t<label style=\"display:inline!important; margin-right:10px;\" for=\"member-only\">Только для зарегистрированных:</label>\n\t\t\t\t<input style=\"width:auto;\" type=\"checkbox\" value=\"yes\" name=\"member-only\" <?php echo $member_checkbox; ?> />\n\t\t\t</p>\n\t\t</div> \n\t<?php\n}", "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 showForm()\n\t{\n echo view($this->config->views['login']);\n\t}", "public function canEdit()\n {\n return true;\n }", "public function adminViewFileEdits()\r\n\t{\r\n\t\treturn false;\r\n\t}", "public function edit(Permission $lokasi)\n {\n //\n }", "public function editSystemSetting()\n {\n return view('admin.setting.system.edit');\n }", "function jen_panels_book_top_ctools_access_settings($form, &$form_state, $conf) { \n // @todo: do I need any settings?\n return $form;\n}", "function formPermissions($branch) {\n\t\tglobal $perm_defaults;\n\n\t\t// Set output text\n\n\t\t// Create a object of the class dynamicControls\n\t\t$dynamic_controls = new we_dynamicControls();\n\t\t// Now we create the overview of the user rights\n\t\t$content = $dynamic_controls->fold_checkbox_groups(\t$this->permissions_slots,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$this->permissions_main_titles,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$this->permissions_titles,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$this->Name,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$branch,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tarray(\"administrator\"),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttrue,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttrue,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"we_form\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"perm_branch\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttrue,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttrue);\n\n\n\n\t\t$javascript ='\n\t\t\t<script language=\"JavaScript\" type=\"text/javascript\"><!--\n\n\t\t\t\tfunction rebuildCheckboxClicked() {\n\t\t\t\t\ttoggleRebuildPerm(false);\n\t\t\t\t}\n\n\t\t\t\tfunction toggleRebuildPerm(disabledOnly) {\n\n\t\t\t\t';\n\t\tif(isset($this->permissions_slots['rebuildpermissions']) && is_array($this->permissions_slots['rebuildpermissions'])) {\n\n\n\n\t\t\tforeach($this->permissions_slots['rebuildpermissions'] as $pname=>$pvalue) {\n\t\t\t\tif($pname!='REBUILD') {\n\t\t\t\t\t$javascript .= '\n\t\t\t\t\tif (document.we_form.' . $this->Name . '_Permission_REBUILD && document.we_form.' . $this->Name . '_Permission_' . $pname . ') {\n\t\t\t\t\t\tif(document.we_form.' . $this->Name . '_Permission_REBUILD.checked) {\n\t\t\t\t\t\t\tdocument.we_form.' . $this->Name . '_Permission_' . $pname . '.disabled = false;\n\t\t\t\t\t\t\tif (!disabledOnly) {\n\t\t\t\t\t\t\t\tdocument.we_form.' . $this->Name . '_Permission_' . $pname . '.checked = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tdocument.we_form.' . $this->Name . '_Permission_' . $pname . '.disabled = true;\n\t\t\t\t\t\t\tif (!disabledOnly) {\n\t\t\t\t\t\t\t\tdocument.we_form.' . $this->Name . '_Permission_' . $pname . '.checked = false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t';\n\t\t\t\t} else {\n\t\t\t\t\t$handler = \"\n\t\t\t\t\tif (document.we_form.\" . $this->Name . \"_Permission_\" . $pname . \") {\n\t\t\t\t\t\tdocument.we_form.\" . $this->Name . \"_Permission_\" . $pname . \".onclick = rebuildCheckboxClicked;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tdocument.we_form.\" . $this->Name . \"_Permission_\" . $pname . \".onclick = top.content.setHot();\n\t\t\t\t\t}\n\t\t\t\t\ttoggleRebuildPerm(true);\n\t\t\t\t\t\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$javascript .= '\n\t\t\t\t}\n\t\t\t\t\t\t';\n\t\tif(isset($handler)) {\n\t\t\t$javascript .= $handler;\n\t\t}\n\t\t$javascript .= '\n\t\t\t//--></script>';\n\n\t\t$parts = array();\n\n\t\tarray_push($parts,\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\"headline\"=>\"\",\n\t\t\t\t\t\t\t\t\"html\"=>$content,\n\t\t\t\t\t\t\t\t\"space\"=>0,\n\t\t\t\t\t\t\t\t\"noline\"=>1\n\t\t\t\t\t\t\t\t)\n\t\t);\n\n\t\t// js to uncheck all permissions\n\t\t$uncheckjs = '';\n\t\t$checkjs = '';\n\t\tforeach($this->permissions_slots as $group) {\n\t\t\tforeach($group as $pname=>$pvalue) {\n\t\t\t\tif($pname!='ADMINISTRATOR') {\n\t\t\t\t\t$uncheckjs .= 'document.we_form.' . $this->Name . '_Permission_' . $pname . '.checked = false;';\n\t\t\t\t\t$checkjs .= 'document.we_form.' . $this->Name . '_Permission_' . $pname . '.checked = true;';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$we_button = new we_button();\n\t\t$button_uncheckall = $we_button->create_button('uncheckall', 'javascript:' . $uncheckjs);\n\t\t$button_checkall = $we_button->create_button('checkall', 'javascript:' . $checkjs);\n\t\tarray_push($parts,\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'headline'=>'',\n\t\t\t\t\t\t\t\t'html'=>$we_button->create_button_table(array($button_uncheckall,$button_checkall)),\n\t\t\t\t\t\t\t\t'space'=>0\n\t\t\t\t\t\t\t\t)\n\t\t);\n\n\n\n\t\t// Check if user has right to decide to give administrative rights\n\t\tif(is_array($this->permissions_slots[\"administrator\"]) && we_hasPerm(\"ADMINISTRATOR\") && $this->Type==0) {\n\t\t\tforeach($this->permissions_slots[\"administrator\"] as $k=>$v) {\n\t\t\t\t$content='\n\t\t\t\t\t<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" width=\"500\">\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t' . getPixel(1, 5) . '</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t' . we_forms::checkbox(($v ? $v : \"0\"), ($v ? true : false), $this->Name . \"_Permission_\" . $k , $this->permissions_titles[\"administrator\"][$k], false, \"defaultfont\", ($k==\"REBUILD\"?\"setRebuidPerms();\":\"\")) . '</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</table>';\n\t\t\t}\n\t\t\tarray_push($parts,\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\"headline\"=>\"\",\n\t\t\t\t\t\t\t\t\"html\"=>$content,\n\t\t\t\t\t\t\t\t\"space\"=>0\n\t\t\t\t\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\n\n\t\tarray_push($parts,\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\"headline\"=>\"\",\n\t\t\t\t\t\t\t\t\"html\"=>$this->formInherits(\"_ParentPerms\",$this->ParentPerms,$GLOBALS['l_users'][\"inherit\"]),\n\t\t\t\t\t\t\t\t\"space\"=>0\n\t\t\t\t\t\t\t\t)\n\t\t);\n\n\n\n\t\treturn we_multiIconBox::getHTML(\"\",\"100%\",$parts,30).$javascript;\n\t}", "function content() {\n echo \"\n <form action='' method='post'>\n <input name='token' type='hidden' value='{$this->params['editToken']}'>\n <input name='editId' type='hidden' value='{$this->params['editId']}'>\n <label for='username'>Username</label>\n <input name='username' placeholder='Username' id='username' type='text' value='{$this->params['username']}'>\n <label for='password'>Password</label>\n <input name='password' placeholder='Replace password (Optional)' id='password' type='password'>\n <label for='role'>Role</label>\n <select name='role' id='role' {$this->params['rolePower']}>\n <option value='1' {$this->params['isAdmin']}>Admin</option>\n <option value='2' {$this->params['isAgent']}>Agent</option>\n </select>\n <input type='submit' value='Edit Account'>\n </form>\n \";\n }", "public function edit()\n {\n return view('user.settings', ['user' => Auth::user()]);\n }", "public function edit_action() {\n Utils\\verifyPermission($this->edit_permission);\n $this->actionHeader();\n $this->addScript('jquery.autosize-min.js');\n $this->addScript('vendor/jquery.ui.widget.js');\n $this->addScript('jquery.iframe-transport.js');\n $this->addScript('jquery.fileupload.js');\n $this->addScript('ckeditor/ckeditor.js');\n $this->renderBodyTemplate('edit');\n }", "function forum_perms()\n\t{\n\t\tif ($this->ipsclass->input['id'] == \"\")\n\t\t{\n\t\t\t$this->ipsclass->admin->error(\"Нельзя изменить ID группы, попытайтесь снова\");\n\t\t}\n\n\t\t//-----------------------------------------\n\n\t\t$this->ipsclass->admin->page_title = \"Управление масками доступа\";\n\t\t$this->ipsclass->admin->page_detail = \"В этой секции вы можете изменить выбранную маску доступа.\";\n\t\t$this->ipsclass->admin->nav[] = array( $this->ipsclass->form_code.'&code=permsplash', 'Управление масками доступа' );\n\t\t$this->ipsclass->admin->nav[] = array( '', 'Добавление/изменение масок доступа' )\t\t;\n\n\t\t$this->ipsclass->admin->page_detail .= \"<br />Для разрешения выполнения действия поставьте галочку, для запрета выполнения действия просто не ставьте или уберите галочку.\n\t\t\t\t\t\t\t <br />Атрибут &laquo;<b>Глобальный</b>&raquo; означает, что все маски доступа имеют права на выполнение этого действия, поэтому изменить этот параметр здесь нельзя.\n\t\t\t\t\t\t\t <br />Категории имеют настройки доступа только на просмотр, потому что остальные действия просто не применимы для категорий.\";\n\n\t\t//-----------------------------------------\n\n\t\t$this->ipsclass->DB->simple_construct( array( 'select' => '*', 'from' => 'forum_perms', 'where' => \"perm_id=\".intval($this->ipsclass->input['id']) ) );\n\t\t$this->ipsclass->DB->simple_exec();\n\n\t\t$group = $this->ipsclass->DB->fetch_row();\n\n\t\t$gid = $group['perm_id'];\n\t\t$gname = $group['perm_name'];\n\n\t\t//-----------------------------------------\n\t\t//| EDIT NAME\n\t\t//-----------------------------------------\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->start_form( array( 1 => array( 'code' , 'donameedit' ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 2 => array( 'act' , 'group' ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 3 => array( 'id' , $gid ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 4 => array( 'section', $this->ipsclass->section_code ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t), \"nameForm\" );\n\n\t\t$this->ipsclass->adskin->td_header[] = array( \"&nbsp;\" , \"40%\" );\n\t\t$this->ipsclass->adskin->td_header[] = array( \"&nbsp;\" , \"60%\" );\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->start_table( \"Изменение названия: \".$group['perm_name'] );\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( \"<b>Название маски</b>\" ,\n\t\t\t\t\t\t\t\t\t\t\t\t $this->ipsclass->adskin->form_input(\"perm_name\", $gname )\n\t\t\t\t\t\t\t\t\t ) );\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->end_form(\"Изменить\");\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->end_table();\n\n\n\t\t//-----------------------------------------\n\t\t//| MAIN FORM\n\t\t//-----------------------------------------\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->start_form( array( 1 => array( 'code' , 'dofedit' ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 2 => array( 'act' , 'group' ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 3 => array( 'id' , $gid ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 4 => array( 'section', $this->ipsclass->section_code ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t) \t);\n\n\t\t$this->ipsclass->adskin->td_header[] = array( \"Форум\" , \"25%\" );\n\t\t$this->ipsclass->adskin->td_header[] = array( \"Просмотр форума<br /><input id='show' type='checkbox' onclick='checkcol(\\\"show\\\", this.checked );' />\" , \"10%\" );\n\t\t$this->ipsclass->adskin->td_header[] = array( \"Чтение тем<br /><input id='read' type='checkbox' onclick='checkcol(\\\"read\\\", this.checked );' />\" , \"10%\" );\n\t\t$this->ipsclass->adskin->td_header[] = array( \"Ответ в темы<br /><input id='reply' type='checkbox' onclick='checkcol(\\\"reply\\\", this.checked );' />\" , \"10%\" );\n\t\t$this->ipsclass->adskin->td_header[] = array( \"Создание тем<br /><input id='start' type='checkbox' onclick='checkcol(\\\"start\\\", this.checked );' />\" , \"10%\" );\n\t\t$this->ipsclass->adskin->td_header[] = array( \"Загрузка файлов<br /><input id='upload' type='checkbox' onclick='checkcol(\\\"upload\\\", this.checked );' />\" , \"10%\" );\n\t\t$this->ipsclass->adskin->td_header[] = array( \"Скачивание файлов<br /><input id='download' type='checkbox' onclick='checkcol(\\\"download\\\", this.checked );' />\" , \"10%\" );\n\n\t\t$forum_data = $this->forumfunc->ad_forums_forum_data();\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->start_table( \"Параметры доступа: \".$group['perm_name'] );\n\n\t\tforeach( $forum_data as $r )\n\t\t{\n\t\t\t$show = \"\";\n\t\t\t$read = \"\";\n\t\t\t$start = \"\";\n\t\t\t$reply = \"\";\n\t\t\t$upload = \"\";\n\n\t\t\t$global = '<center>Глобальный</center>';\n\n\t\t\tif ($r['show_perms'] == '*')\n\t\t\t{\n\t\t\t\t$show = $global;\n\t\t\t}\n\t\t\telse if ( preg_match( \"/(^|,)\".$gid.\"(,|$)/\", $r['show_perms'] ) )\n\t\t\t{\n\t\t\t\t$show = \"<center><input type='checkbox' name='show_\".$r['id'].\"' id='show_\".$r['id'].\"' onclick=\\\"obj_checked('show', {$r['id']} );\\\" value='1' checked></center>\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$show = \"<center><input type='checkbox' name='show_\".$r['id'].\"' id='show_\".$r['id'].\"' onclick=\\\"obj_checked('show', {$r['id']} );\\\" value='1'></center>\";\n\t\t\t}\n\n\t\t\t//-----------------------------------------\n\n\t\t\t$global = '<center>Глобальный</center>';\n\n\t\t\tif ($r['read_perms'] == '*')\n\t\t\t{\n\t\t\t\t$read = $global;\n\t\t\t}\n\t\t\telse if ( preg_match( \"/(^|,)\".$gid.\"(,|$)/\", $r['read_perms'] ) )\n\t\t\t{\n\t\t\t\t$read = \"<center><input type='checkbox' name='read_\".$r['id'].\"' id='read_\".$r['id'].\"' onclick=\\\"obj_checked('read', {$r['id']} );\\\" value='1' checked></center>\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$read = \"<center><input type='checkbox' name='read_\".$r['id'].\"' id='read_\".$r['id'].\"' onclick=\\\"obj_checked('read', {$r['id']} );\\\" value='1'></center>\";\n\t\t\t}\n\n\t\t\t//-----------------------------------------\n\n\t\t\t$global = '<center>Глобальный</center>';\n\n\t\t\tif ($r['start_perms'] == '*')\n\t\t\t{\n\t\t\t\t$start = $global;\n\t\t\t}\n\t\t\telse if ( preg_match( \"/(^|,)\".$gid.\"(,|$)/\", $r['start_perms'] ) )\n\t\t\t{\n\t\t\t\t$start = \"<center><input type='checkbox' name='start_\".$r['id'].\"' id='start_\".$r['id'].\"' onclick=\\\"obj_checked('start', {$r['id']} );\\\" value='1' checked></center>\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$start = \"<center><input type='checkbox' name='start_\".$r['id'].\"' id='start_\".$r['id'].\"' onclick=\\\"obj_checked('start', {$r['id']} );\\\" value='1'></center>\";\n\t\t\t}\n\n\t\t\t//-----------------------------------------\n\n\t\t\t$global = '<center>Глобальный</center>';\n\n\t\t\tif ($r['reply_perms'] == '*')\n\t\t\t{\n\t\t\t\t$reply = $global;\n\t\t\t}\n\t\t\telse if ( preg_match( \"/(^|,)\".$gid.\"(,|$)/\", $r['reply_perms'] ) )\n\t\t\t{\n\t\t\t\t$reply = \"<center><input type='checkbox' name='reply_\".$r['id'].\"' id='reply_\".$r['id'].\"' onclick=\\\"obj_checked('reply', {$r['id']} );\\\" value='1' checked></center>\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$reply = \"<center><input type='checkbox' name='reply_\".$r['id'].\"' id='reply_\".$r['id'].\"' onclick=\\\"obj_checked('reply', {$r['id']} );\\\" value='1'></center>\";\n\t\t\t}\n\n\t\t\t//-----------------------------------------\n\n\t\t\t$global = '<center>Глобальный</center>';\n\n\t\t\tif ($r['upload_perms'] == '*')\n\t\t\t{\n\t\t\t\t$upload = $global;\n\t\t\t}\n\t\t\telse if ( preg_match( \"/(^|,)\".$gid.\"(,|$)/\", $r['upload_perms'] ) )\n\t\t\t{\n\t\t\t\t$upload = \"<center><input type='checkbox' name='upload_\".$r['id'].\"' id='upload_\".$r['id'].\"' onclick=\\\"obj_checked('upload', {$r['id']} );\\\" value='1' checked></center>\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$upload = \"<center><input type='checkbox' name='upload_\".$r['id'].\"' id='upload_\".$r['id'].\"' onclick=\\\"obj_checked('upload', {$r['id']} );\\\" value='1'></center>\";\n\t\t\t}\n\n\t\t\t//-----------------------------------------\n\n\t\t\t$global = '<center>Глобальный</center>';\n\n\t\t\tif ($r['download_perms'] == '*')\n\t\t\t{\n\t\t\t\t$download = $global;\n\t\t\t}\n\t\t\telse if ( preg_match( \"/(^|,)\".$gid.\"(,|$)/\", $r['download_perms'] ) )\n\t\t\t{\n\t\t\t\t$download = \"<center><input type='checkbox' name='download_\".$r['id'].\"' id='download_\".$r['id'].\"' onclick=\\\"obj_checked('download', {$r['id']} );\\\" value='1' checked></center>\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$download = \"<center><input type='checkbox' name='download_\".$r['id'].\"' id='download_\".$r['id'].\"' onclick=\\\"obj_checked('download', {$r['id']} );\\\" value='1'></center>\";\n\t\t\t}\n\n\t\t\t//-----------------------------------------\n\n\t\t\tif ( $r['root_forum'] )\n\t\t\t{\n\t\t\t\t$css = 'tablerow4';\n\t\t\t\t$download = $upload = $reply = $start = $read = \"<center>Не&nbsp;используется</center>\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$css = '';\n\t\t\t}\n\n\t\t\t$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"<div style='float:right;width:auto;'>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t<input type='button' id='button' value='+' onclick='checkrow({$r['id']},true)' />&nbsp;<input type='button' id='button' value='-' onclick='checkrow({$r['id']},false)' />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t </div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t <b>\".$r['depthed_name'].\"</b>\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"<div style='background-color:#ecd5d8; padding:4px;'>\".$show.\"</div>\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"<div style='background-color:#dbe2de; padding:4px;'>\".$read.\"</div>\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"<div style='background-color:#dbe6ea; padding:4px;'>\".$reply.\"</div>\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"<div style='background-color:#d2d5f2; padding:4px;'>\".$start.\"</div>\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"<div style='background-color:#ece6d8; padding:4px;'>\".$upload.\"</div>\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"<div style='background-color:#dfdee9; padding:4px;'>\".$download.\"</div>\",\n\t\t\t\t\t\t\t\t\t\t \t\t\t\t\t) ,$css );\n\n\t\t}\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->end_form(\"Обновить настройки доступа\");\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->end_table();\n\n\t\t$this->ipsclass->html .= $this->html->permissions_js();\n\n\t\t$this->ipsclass->admin->output();\n\t}", "public function gluu_sso_form()\n {\n // add taskbar button\n\n $boxTitle = html::div(array('id' => \"prefs-title\", 'class' => 'boxtitle'), $this->gettext('hederGluu'));\n $this->include_stylesheet('GluuOxd_Openid/css/gluu-oxd-css.css');\n $this->include_script('GluuOxd_Openid/js/scope-custom-script.js');\n\n $tableHtml=$this->admin_html();\n unset($_SESSION['message_error']);\n unset($_SESSION['message_success']);\n return html::div(array('class' => ''),$boxTitle . html::div(array('class' => \"boxcontent\"), $tableHtml ));\n }", "function pa_edit() {\n\t\t\t\t$edit_pid = (int)UTIL::get_post('edit_pid');\n\t\t\t\t\n\t\t\t\t//-- haben wir keine edit-id, gibts eine seiten-tabelle zur auswahl\n\t\t\t\tif (!$edit_pid) {\n\t\t\t\t\techo 'error: no pid';\n\t\t\t\t\texit;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$form = MC::create('form');\n\t\t\t\t$form->init('page', 'mod_page');\n\t\t\t\t$form->add_hidden('edit_pid', $edit_pid);\n\t\t\t\t\n\t\t\t\t// hatten wir fehler\n\t\t\t\tif ($this->get_var('error')) {\n\t\t\t\t\t$form->set_values($this->get_var('data'));\n\t\t\t\t\t$form->set_error_fields($this->get_var('error'));\n\t\t\t\t}\t\n\t\t\t\telse {\n\t\t\t\t\t// frisch aus db lesen\n\t\t\t\t\t$sql = 'SELECT * FROM '.$this->mod_tbl.' WHERE id='.$edit_pid;\n\t\t\t\t\t$res = $this->DB->query($sql);\n\t\t\t\t\t$data = $res->r();\n\t\t\t\t\t$form->set_values($data);\n\t\t\t\t}\n\n\t\t\t\t$this->set_var('path', $this->_get_path_print($edit_pid));\n\t\t\t\t$this->set_var('form', $form);\n\t\t\t\t\n\t\t\t\t$this->OPC->generate_view($this->tpl_dir.'pa_edit.php');\n\n\t\t\t}", "public function edit_admin_show($edit)\n\t{\n\t\t$sql=\"SELECT * FROM `create_admin` WHERE id = '$edit'\";\n\t\t$result=$this->db->query($sql);\n\t\t$data= $result->fetch_array();\n\t\techo \"<input class='id' type='text' name='id' value='$data[serial_id]'>\n <br><br>\n <input class='name' type='text' name='name' value='$data[name]'>\n <br><br>\n <input class='email' type='email' name='email' value='$data[email]'>\n <br><br>\n <input class='pass' type='password' name='pass' value='$data[password]'>\n <br><br>\n <select class='categore' name='categore'>\n <option value='$data[categore]' selected='selected'>$data[categore]</option>\n <option value='super-admin'>Super-Admin</option>\n <option value='admin'>Admin</option>\n <option value='sub-admin'>Sub-Admin</option>\n </select>\n \n <select class='stat' name='stat'>\n \t<option value='$data[stat]'>$data[stat]</option>\n <option value='1'>Active</option>\n <option value='0'>Inactive</option>\n </select>\n <br><br>\n <button type='submit' class='submit' name='update' >Update Admin</button>\";\n\t}", "public function edit($id)\n {\n $perm = Perm::find($id);\n return view('dashboard.perms.edit', compact('perm'));\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\n {\n return view('admin::edit');\n }", "function postageapp_admin_form() {\n $form = array();\n \n $form['settings'] = array(\n '#type' => 'fieldset',\n '#title' => t('Postageapp settings'),\n );\n \n $form['settings']['postageapp_api_key'] = array(\n '#type' => 'textfield',\n '#title' => t('PostageApp API Key'),\n '#required' => TRUE,\n '#default_value' => variable_get('postageapp_api_key', ''),\n '#description' => t('The API key for your PostageApp account. Get or generate a valid API key at your PostageApp dashboard which is available at yourusername.postageapp.com')\n );\n \n return system_settings_form($form);\n}", "public function edit()\n {\n return \"Ini Halaman Edit\";\n }", "public function edit(){\r\n\t\t//$this->auth->set_access('edit');\r\n\t\t//$this->auth->validate();\r\n\r\n\t\t//call save method\r\n\t\t$this->save();\r\n\t}", "public function editView() {\n $this->template()->addTplFile('edit.phtml');\n $this->setTinyMCE($this->formEdit->text, 'advanced');\n $this->setTinyMCE($this->formEdit->textPanel, 'advanced', array('height' => 300));\n if(isset($this->formEdit->textFooter)){\n $this->setTinyMCE($this->formEdit->textFooter, 'advanced', array('height' => 300));\n }\n Template_Module::setEdit(true);\n }", "public function editAction() {\n $uid = $this->getInput('uid');\n $userInfo = Admin_Service_User::getUser(intval($uid));\n list(, $groups) = Admin_Service_Group::getAllGroup();\n $this->assign('userInfo', $userInfo);\n $this->assign('groups', $groups);\n $this->assign('status', $this->status);\n $this->assign(\"meunOn\", \"sys_user\");\n }", "abstract function allowEditAction();", "public function form()\n {\n $form = new Form(new PermissionCategory());\n $form->tab('Общее', function (Form $form) {\n $form->display('id', 'ID');\n\n $form->text('name', trans('admin.name'))->rules('required');\n });\n\n return $form;\n }", "function showGeneralPageEditorSettingsObject()\n\t{\n\t\tglobal $tpl, $ilTabs;\n\n\t\t$this->addPageEditorSettingsSubTabs();\n\t\t$ilTabs->activateTab(\"adve_page_editor_settings\");\n\t\t\n\t\t$form = $this->initGeneralPageSettingsForm();\n\t\t$tpl->setContent($form->getHTML());\n\t}", "public function edit($id)\n {\n // Si no tiene permisos para modificar o visualizar lo echamos\n if (!auth()->user()->can('admin-roles-update') && !auth()->user()->can('admin-roles-read')) {\n app()->abort(403);\n }\n\n $permissionsTree = PermissionsTree::withDepth()->with('permission')->get()->sortBy('_lft');\n\n $role = Role::find($id);\n $a_arrayPermisos = $role->getArrayPermissions();\n\n if (is_null($role)) {\n app()->abort(500);\n }\n\n\n return view('modules.roles.admin_permissions_form', compact(\n 'permissionsTree',\n 'id',\n 'role',\n 'a_arrayPermisos'\n ));\n }", "public function form()\n {\n\t\t$xapp = Xapp::findOrFail(request('id'));\n\t\t$xapp_fields = Schema::getColumnListing($xapp->table);\n\t\t$this->hidden('id');\n\t\tforeach(config('xapp.xappset') as $name=>$set){\t\t\n\t\t\tif( empty($set['field']) ){\n\t\t\t\t$this->switch($name, '启用'.$set['title'])->help('是否启用'.$set['title'].'功能');\n\t\t\t}elseif(in_array($set['field'],$xapp_fields)){\n\t\t\t\t$this->switch($name, '启用'.$set['title'])->help('是否启用'.$set['title'].'功能,本功能依赖'.$set['field'].'字段');\n\t\t\t}\n\t\t}\n }", "public function _showForm()\n\t{\n\t\t$this->registry->output->setTitle( \"Log In\" );\n\t\t$this->registry->output->setNextAction( 'index&do=login' );\n\t\t$this->registry->output->addContent( $this->registry->legacy->fetchLogInForm() );\n\t\t$this->registry->output->sendOutput();\n\t\texit();\n\t}", "public function isEditOnlyMode();", "public function edit_subadmin_form()\n\t{\n\t\tif ($this->checkLogin('A') == '') \n\t\t{\n\t\t\tredirect('admin');\n\t\t} \n\t\telse \n\t\t{\n\t\t\t$this->data['heading'] = 'Edit Sub-Admin';\n\t \t $adminid = $this->uri->segment(4,0);\n\t \t\t$condition = array('id' => $adminid);\n\t \t\t$this->data['admin_details'] = $this->subadmin_model->get_all_details(SUBADMIN,$condition);\n\t\t\t \n\t\t\tif ($this->data['admin_details']->num_rows() == 1) \n\t\t\t{\n\t\t\t\t$this->data['privArr'] = unserialize($this->data['admin_details']->row()->privileges);\t\n\t\t\t\t\t\n\t\t\t\tif (!is_array($this->data['privArr'])) \n\t\t\t\t{\n\t\t\t\t\t$this->data['privArr'] = array();\n\t\t\t\t}\n\n\t\t\t\t$this->load->view('admin/subadmin/edit_subadmin', $this->data);\n\t\t\t} \n\t\t\telse \n\t\t\t{\n\t\t\t\tredirect('admin');\n\t\t\t}\n\t\t}\n\t}", "public function edit()\n\t{\n\t\t//\n\t}", "public function edit($id)\n {\n $permType = PermType::find($id);\n return view('dashboard.permTypes.edit', compact('permType'));\n }", "public function formAction()\r\n {\r\n \r\n\t\t$this->loadLayout();\r\n\t\t\r\n\t\t$root = $this->getLayout()->getBlock('root');\r\n\t\t$settemplate = \"page/1column.phtml\";\r\n\t\t$root->setTemplate($settemplate);\r\n\t\t\r\n $block = $this->getLayout()->createBlock(\r\n 'Mage_Core_Block_Template',\r\n 'advancedpermissions.vendor_form',\r\n array(\r\n 'template' => 'advancedpermissions/vendor_form.phtml'\r\n )\r\n );\r\n\r\n $this->getLayout()->getBlock('content')->append($block);\r\n $this->_initLayoutMessages('core/session');\r\n\t\t\r\n $this->renderLayout();\r\n\t\t\r\n }", "public function showAddAdminPanel(){\n return $this->view('frontend/admin/addadmin.twig');\n }", "function manage_form( ) {\n\t\t\n\t\t// Exit if user not logged in\n\t\t// TODO: MAKE THIS WORK\n/*\t\tif( ! current_user_can( 'administrator' ) ) {\n\t\t\tcpd_not_logged_in_message();\n\t\t\treturn;\n\t\t}\n*/\n\n\t\t$org = new Organisation();\n\n\t\t// Check if an Org has been selected - ie: has a number value for $_GET['id']\n\t\t// This covers resposnes both when selecting an org for editing, or for saving an org\n\t\tif( isset( $_REQUEST['id'] ) && is_int( (int) $_REQUEST['id'] ) ) {\n\t\t\t$org->load_org_details( $_REQUEST['id'] );\n\t\t}\n\n\t\t$this->display_form( $org );\n\t}", "public function edit(AdminPanel $adminPanel)\n {\n //\n }", "public function ShowForm()\n\t\t{\n\t\t\tif (!$this->HasPermission()) {\n\t\t\t\t$this->NoPermission();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$GLOBALS['AddonId'] = $this->GetId();\n\t\t\t$GLOBALS['Message'] = GetFlashMessageBoxes();\n\t\t\t$this->ParseTemplate('emailchange.form');\n\t\t}", "function show_forms()\n {\n }", "public function index ($id=false)\n\t\t{\n\n\t\t // if(!in_array('viewPermission', $this->permission)) {\n\t\t\t\t// redirect('dashboard', 'refresh'); \n\t\t // \t}\n\t\t\t\n\t\t\t$data_info = $this->Model_group->lister();\n\t\t\t$fields = $this->Model_group->fields(TRUE);\n\t\t $this->template->assign('action_mode', 'edit');\n\t\t\t$this->template->assign('permission_fields', $fields);\n\t\t\t$this->template->assign('permission_data', $data_info);\n\t\t\t$this->template->assign('table_name', 'Permissions');\n\t\t\t$this->template->assign('template', 'list_group');\n\t\t\t$this->template->display('frame_admin.tpl');\n\n\t\t}", "protected function editLockPermissions() {}", "public function update(SaveDockPermissionsForm $form, Dock $dock)\n {\n $this->authorize(get_class($dock) . '.edit-permissions');\n\n $form->process($dock);\n\n flasher()->alert($dock->name . ' dock permissions updated successfully', Notifier::SUCCESS);\n\n return redirect()->route('admin.docks.index');\n }", "function cjpopups_admin_form($options){\n\trequire_once(sprintf('%s/admin_form.php', cjpopups_item_path('includes_dir')));\n}", "public static function _EDIT(){\n\t\tglobal $id;\n\n\t\tif(!$id){\n\t\t\t$cid = josGetArrayInts('cid');\n\t\t\t$id = $cid[0];\n\t\t}\n\t\t$menutype = strval(mosGetParam($_REQUEST, 'menutype', 'mainmenu'));\n\n\t\tLibMenuBar::startTable();\n\t\tif(!$id){\n\t\t\t$link = 'index2.php?option=com_menus&menutype=' . $menutype . '&task=new&hidemainmenu=1';\n\t\t\tLibMenuBar::back(_MENU_BACK, $link);\n\t\t\tLibMenuBar::spacer();\n\t\t}\n\t\tLibMenuBar::custom('save_and_new', '-save-and-new', '', _SAVE_AND_ADD, false);\n\t\tLibMenuBar::save();\n\t\tLibMenuBar::spacer();\n\t\tLibMenuBar::apply();\n\t\tLibMenuBar::spacer();\n\t\tif($id){\n\t\t\t// for existing content items the button is renamed `close`\n\t\t\tLibMenuBar::cancel('cancel', _CLOSE);\n\t\t} else{\n\t\t\tLibMenuBar::cancel();\n\t\t}\n\t\tLibMenuBar::spacer();\n\t\tLibMenuBar::help('screen.menus.edit');\n\t\tLibMenuBar::endTable();\n\t}", "public function edit($id)\n {\n $permiso = Permission::find($id);\n\n return view('intranet.permisos.edit', compact('permiso'));\n }", "public function edit()\n {\n $form = FormBuilder::create(UserSettingsForm::class, [\n 'url' => route('admin.user_settings.update'),\n 'method' => 'PUT'\n ]);\n return view('admin.auth.setting', compact('form'));\n }", "function show_settings_tab(){\n woocommerce_admin_fields($this->get_settings());\n }", "static function has_edit_screen(): bool { return true; }", "public function edit() {\n\t\t\t\n\t\t}", "function fed_get_admin_up_display_permission( $row, $action, $type = '' ) {\n\t?>\n\t<div class=\"row fed_admin_up_display_permission\">\n\t\t<?php\n\t\tif ( $action === 'profile' ) {\n\t\t\tif ( $type === 'file' ) {\n\t\t\t\t$value = 'Disable';\n\t\t\t\t$others = true;\n\t\t\t\t$notification = '<i class=\"fa fa-info bg-info-font\" data-toggle=\"popover\" data-trigger=\"hover\" title=\" Status\" data-content=\"Only registered user can upload the files.\"></i>';\n\t\t\t} else {\n\t\t\t\t$value = $row['show_register'];\n\t\t\t\t$others = '';\n\t\t\t\t$notification = '';\n\t\t\t} ?>\n\t\t\t<div class=\"form-group col-md-4\">\n\t\t\t\t<?php echo fed_input_box( 'show_register', array(\n\t\t\t\t\t'default_value' => 'Enable',\n\t\t\t\t\t'label' => __( 'Show this field on Register Form', 'frontend-dashboard' ) . ' ' . $notification,\n\t\t\t\t\t'value' => $value,\n\t\t\t\t\t'disabled' => $others\n\t\t\t\t), 'checkbox' );\n\n\t\t\t\t?>\n\n\t\t\t</div>\n\n\t\t\t<div class=\"form-group col-md-4\">\n\t\t\t\t<?php echo fed_input_box( 'show_dashboard', array(\n\t\t\t\t\t'default_value' => 'Enable',\n\t\t\t\t\t'label' => __( 'Show this field on User Dashboard', 'frontend-dashboard' ),\n\t\t\t\t\t'value' => $row['show_dashboard']\n\t\t\t\t), 'checkbox' ); ?>\n\t\t\t</div>\n\t\t<?php } ?>\n\n\t\t<?php if ( $action == 'post' ) {\n\t\t\t?>\n\t\t\t<div class=\"form-group col-md-4\">\n\t\t\t\t<label><?php _e( 'Post Type', 'frontend-dashboard' ) ?></label>\n\t\t\t\t<?php echo fed_input_box( 'post_type', array(\n\t\t\t\t\t'default_value' => 'Post',\n\t\t\t\t\t'value' => $row['post_type'],\n\t\t\t\t\t'options' => fed_get_public_post_types(),\n\t\t\t\t), 'select' ); ?>\n\t\t\t</div>\n\t\t<?php } ?>\n\t\t<div class=\"form-group col-md-4\">\n\t\t\t<?php echo fed_input_box( 'is_required', array(\n\t\t\t\t'default_value' => 'true',\n\t\t\t\t'label' => __( 'Is this required Field', 'frontend-dashboard' ),\n\t\t\t\t'value' => $row['is_required'],\n\t\t\t), 'checkbox' ); ?>\n\t\t</div>\n\n\t</div>\n\t<?php\n}", "public function form( $instance ) {\n \t// outputs the options form on admin\n }", "function showForm() {\n \tglobal $pluginpath;\n \t\n \tif ($this->idt == \"\") {\n \t //user is creating new template\n \t\t$title = MF_NEW_TEMPLATE;\n \t\t$this->action = 'createtempl';\n\t\t$btnText = MF_CREATE_TEMPLATE_BUTTON; \n \t} else {\n \t //user is editing old template\n \t\t$title = \tMF_CHANGE_TEMPLATE;\n \t\t$this->action = 'changetempl';\n\t\t$btnText = MF_CHANGE_FORUM_BUTTON;\n \t}\n \t\n\t$this->doHtmlSpecChars();\n\t\t\n\tinclude \"admin/tempForm.php\";\n \t\n }", "public function edit($id)\n {\n $permission = $this->model->find($id);\n // $this->authorize('update', $permission);\n\n return view('core::permissions.edit', compact('permission'));\n }", "protected function Form_Run() {\n\t\t\tparent::Form_Run();\n\n\t\t\t// Security check for ALLOW_REMOTE_ADMIN\n\t\t\t// To allow access REGARDLESS of ALLOW_REMOTE_ADMIN, simply remove the line below\n\t\t\tQApplication::CheckRemoteAdmin();\t\t \n\t\t}", "function opciones_admin(){\n\tif ($_SESSION[\"tipo_user\"] === \"admin\"){\n\t\t$href = [\"miembros\", \"biografia\", \"discografia\", \"conciertos\", \"usuarios\", \"backup\",\"restore\",\"borrarBD\", \"log\", \"logout\"];\n\t\t$name = [\"Editar miembros Grupo\", \"Editar biografía\", \"Editar discografía\", \"Editar conciertos\", \"Editar usuarios\", \"BackUp\",\"Restore\",\"Borrar BD\",\"Ver log del servidor\", \"Desconectarse\"];\n\t\techo '<div id=\"panel_control\" align=\"center\">';\n\t\t\techo '<div class=\"login\">';\n\t\t\t\techo \"<ul>\";\n\t\t\t\tforeach($href as $i => $val){\n\t\t\t\t\techo \"<li><a href='dashboard.php?accion=$val#panel_control'>{$name[$i]}</a></li>\";\n\t\t\t\t}\n\t\t\t\techo \"</ul>\";\n\t\t\techo \"</div>\";\n\t\techo \"</div>\";\n\t\t\n\t\tacciones();\n\t}\n}", "function lb_show_edit_page_action() {\n\tlb_show_templates(\n\t\tarray(\n\t\t\t'name' => 'edit',\n\t\t\t'this_cafe' => lb_get_this_cafe_from_cafe( $_GET['edit-id'] ),\n\t\t)\n\t);\n}", "protected function actionEdit() {\r\n\r\n //try 1: get the object type and names based on the current object\r\n $objInstance = class_objectfactory::getInstance()->getObject($this->getSystemid());\r\n if($objInstance != null) {\r\n $strObjectTypeName = uniSubstr($this->getActionNameForClass(\"edit\", $objInstance), 4);\r\n if($strObjectTypeName != \"\") {\r\n $strType = get_class($objInstance);\r\n $this->setCurObjectClassName($strType);\r\n $this->setStrCurObjectTypeName($strObjectTypeName);\r\n }\r\n }\r\n\r\n //try 2: regular, oldschool resolving based on the current action-params\r\n $strType = $this->getCurObjectClassName();\r\n\r\n if(!is_null($strType)) {\r\n\r\n $objEdit = new $strType($this->getSystemid());\r\n $objForm = $this->getAdminForm($objEdit);\r\n $objForm->addField(new class_formentry_hidden(\"\", \"mode\"))->setStrValue(\"edit\");\r\n\r\n return $objForm->renderForm(getLinkAdminHref($this->getArrModule(\"modul\"), \"save\".$this->getStrCurObjectTypeName()));\r\n }\r\n else\r\n throw new class_exception(\"error editing current object type not known \", class_exception::$level_ERROR);\r\n }", "public function showEditPassword()\n {\n return view('pages.settings.password.index');\n }", "function gdata_admin_settings_form() {\n /*\n $form['oauth_google_default_scope'] = array(\n '#type' => 'textarea',\n '#title' => t('Scope'),\n '#default_value' => variable_get('oauth_google_default_scope', OAUTH_GOOGLE_DEFAULT_SCOPE),\n '#required' => TRUE,\n );\n $form['oauth_google_default_domain'] = array(\n '#type' => 'textfield',\n '#title' => t('Domain'),\n '#default_value' => variable_get('oauth_google_default_domain', 'default'),\n '#description' => t('Google Apps domain. Let default value to use regular Google accounts.'),\n );\n */\n $form['keys'] = array(\n '#type' => 'fieldset',\n '#title' => t('Private keys'),\n '#collapsible' => TRUE,\n '#collapsed' => TRUE,\n '#description' => t('You need an RSA private key only to use AuthSub requests.'),\n );\n // http://code.google.com/apis/gdata/authsub.html#Registered\n $form['keys']['gdata_default_private_key'] = array(\n '#type' => 'textarea',\n '#title' => t('Private RSA key'),\n '#default_value' => variable_get('gdata_default_private_key', ''),\n );\n return system_settings_form($form);\n}", "public function edit($id) {\n $title = \"Privilege\";\n $privilege = Privilege::find($id);\n\n $module = ['' => 'Select'];\n $modules = DB::table('tbl_module')->where('parent_id', '>', 0)->pluck('module_name', 'id');\n $modules = $module + $modules;\n\n return view('user::privilege.edit', compact('title', 'privilege', 'modules'));\n }" ]
[ "0.6422253", "0.61636156", "0.6157416", "0.611119", "0.61099756", "0.61066806", "0.609607", "0.6063194", "0.60629123", "0.60542154", "0.6043232", "0.59932494", "0.5989941", "0.59705395", "0.5970034", "0.5966621", "0.59541345", "0.5934438", "0.59246933", "0.58985114", "0.5880055", "0.5872501", "0.58676153", "0.5841578", "0.58386964", "0.5834013", "0.58187884", "0.58184445", "0.58133554", "0.58080554", "0.5794952", "0.579434", "0.5776933", "0.57742494", "0.5769619", "0.575855", "0.5747842", "0.5741505", "0.5736151", "0.57236946", "0.57231516", "0.5722458", "0.57209843", "0.57069117", "0.5706679", "0.5695861", "0.56720483", "0.56707126", "0.5657218", "0.5655351", "0.5652216", "0.56434625", "0.56431586", "0.5642807", "0.5641151", "0.5640179", "0.56303245", "0.56303245", "0.5626158", "0.562492", "0.5623007", "0.5622843", "0.56174546", "0.56162775", "0.56160086", "0.5615846", "0.5615839", "0.5611441", "0.56074023", "0.5601386", "0.5598754", "0.5587325", "0.55873096", "0.55743694", "0.5564234", "0.5549166", "0.5549077", "0.5547547", "0.55471134", "0.55430114", "0.55410916", "0.55407447", "0.55385995", "0.5538005", "0.5537822", "0.5536827", "0.55358803", "0.5534528", "0.55311674", "0.55239964", "0.5521496", "0.5520615", "0.55106264", "0.5506257", "0.55037475", "0.5503057", "0.54965043", "0.5494825", "0.54923767", "0.54865754" ]
0.70208114
0
Update the dock permissions
public function update(SaveDockPermissionsForm $form, Dock $dock) { $this->authorize(get_class($dock) . '.edit-permissions'); $form->process($dock); flasher()->alert($dock->name . ' dock permissions updated successfully', Notifier::SUCCESS); return redirect()->route('admin.docks.index'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updatePermissions()\n {\n if(! array_key_exists( 'permissions', $this->options['paths'] )) {\n return;\n }\n $file = base_path($this->options['paths']['stubs']) . '/views/components/permissions.blade.php';\n $target = base_path($this->options['paths']['permissions']);\n $hook = '<!-- bread_permissions -->';\n $this->updateFileContent($target, $hook, $file);\n }", "public function testUpdatePermissionSet()\n {\n }", "protected function editLockPermissions() {}", "public function run()\n {\n Artisan::call('permissions:update', ['--yes' => true]);\n }", "function layout_builder_post_update_update_permissions() {\n foreach (Role::loadMultiple() as $role) {\n if ($role->hasPermission('configure any layout')) {\n $role->grantPermission('create and edit custom blocks')->save();\n }\n }\n}", "protected function fixPermission() {}", "protected function setApplicationPermissions()\n\t{\n\t\t$base = $this->app['path.base'].'/';\n\t\t$app = str_replace($base, null, $this->app['path']);\n\t\t$storage = str_replace($base, null, $this->app['path.storage']);\n\t\t$public = str_replace($base, null, $this->app['path.public']);\n\n\t\t$this->setPermissions($app.'/database/production.sqlite');\n\t\t$this->setPermissions($storage);\n\t\t$this->setPermissions($public);\n\t}", "public function updateJsPermissions()\n {\n if(! array_key_exists( 'js_permissions', $this->options['paths'] )) {\n return;\n }\n $target = base_path($this->options['paths']['js_permissions']);\n $hook = '/* bread_js_permissions */';\n\n $file = base_path($this->options['paths']['stubs']) . '/resources/assets/js/components/permissions.js';\n $this->updateFileContent($target, $hook, $file);\n }", "function correct_perms()\n\t{\n\t\t$mes = e107::getMessage();\n\t\t$fl = e107::getFile();\n\t\tob_start();\n\t\t$fl->chmod(e_BASE);\n\t\t$fl->chmod(e_BASE.\"cron.php\",0755);\n\t\t$errors = ob_get_clean();\n\t\t\n\t\tif($errors !='')\n\t\t{\n\t\t\t$mes->addError($errors);\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$mes->addSuccess(DBLAN_72);\n\t\t}\n\t\t\n\t\te107::getRender()->tablerender(DBLAN_10.SEP.DBLAN_73, $mes->render());\n\t\t\n\t}", "private function savePermissions(): void\n {\n $this->client->isPayor = $this->isPayor;\n $this->client->isAgencyBankAccountSetup = $this->isAgencyBankAccountSetup;\n $this->client->canViewDocumentation = $this->canViewDocumentation;\n }", "public function setPermissions() {\r\n\t\tif ($this->canSave) {\r\n\t\t\t$this->canSave = $this->resource->checkPolicy('save');\r\n\t\t}\r\n\t\t$this->canEdit = $this->modx->hasPermission('edit_document');\r\n\t\t$this->canCreate = $this->modx->hasPermission('new_document');\r\n\t\t$this->canPublish = $this->modx->hasPermission('publish_document');\r\n\t\t$this->canDelete = ($this->modx->hasPermission('delete_document') && $this->resource->checkPolicy(array('save' => true, 'delete' => true)));\r\n\t\t$this->canDuplicate = $this->resource->checkPolicy('save');\r\n\t}", "function virustotalscan_admin_permissions(&$admin_permissions)\r\n{\r\n \tglobal $lang;\r\n // se incarca fisierul de limba\r\n \t$lang->load(\"virustotalscan\", false, true);\r\n // se seteaza textul permisiunii\r\n\t$admin_permissions['virustotalscan'] = $lang->virustotalscan_canmanage;\r\n}", "function forum_perms()\n\t{\n\t\tif ($this->ipsclass->input['id'] == \"\")\n\t\t{\n\t\t\t$this->ipsclass->admin->error(\"Нельзя изменить ID группы, попытайтесь снова\");\n\t\t}\n\n\t\t//-----------------------------------------\n\n\t\t$this->ipsclass->admin->page_title = \"Управление масками доступа\";\n\t\t$this->ipsclass->admin->page_detail = \"В этой секции вы можете изменить выбранную маску доступа.\";\n\t\t$this->ipsclass->admin->nav[] = array( $this->ipsclass->form_code.'&code=permsplash', 'Управление масками доступа' );\n\t\t$this->ipsclass->admin->nav[] = array( '', 'Добавление/изменение масок доступа' )\t\t;\n\n\t\t$this->ipsclass->admin->page_detail .= \"<br />Для разрешения выполнения действия поставьте галочку, для запрета выполнения действия просто не ставьте или уберите галочку.\n\t\t\t\t\t\t\t <br />Атрибут &laquo;<b>Глобальный</b>&raquo; означает, что все маски доступа имеют права на выполнение этого действия, поэтому изменить этот параметр здесь нельзя.\n\t\t\t\t\t\t\t <br />Категории имеют настройки доступа только на просмотр, потому что остальные действия просто не применимы для категорий.\";\n\n\t\t//-----------------------------------------\n\n\t\t$this->ipsclass->DB->simple_construct( array( 'select' => '*', 'from' => 'forum_perms', 'where' => \"perm_id=\".intval($this->ipsclass->input['id']) ) );\n\t\t$this->ipsclass->DB->simple_exec();\n\n\t\t$group = $this->ipsclass->DB->fetch_row();\n\n\t\t$gid = $group['perm_id'];\n\t\t$gname = $group['perm_name'];\n\n\t\t//-----------------------------------------\n\t\t//| EDIT NAME\n\t\t//-----------------------------------------\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->start_form( array( 1 => array( 'code' , 'donameedit' ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 2 => array( 'act' , 'group' ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 3 => array( 'id' , $gid ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 4 => array( 'section', $this->ipsclass->section_code ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t), \"nameForm\" );\n\n\t\t$this->ipsclass->adskin->td_header[] = array( \"&nbsp;\" , \"40%\" );\n\t\t$this->ipsclass->adskin->td_header[] = array( \"&nbsp;\" , \"60%\" );\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->start_table( \"Изменение названия: \".$group['perm_name'] );\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( \"<b>Название маски</b>\" ,\n\t\t\t\t\t\t\t\t\t\t\t\t $this->ipsclass->adskin->form_input(\"perm_name\", $gname )\n\t\t\t\t\t\t\t\t\t ) );\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->end_form(\"Изменить\");\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->end_table();\n\n\n\t\t//-----------------------------------------\n\t\t//| MAIN FORM\n\t\t//-----------------------------------------\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->start_form( array( 1 => array( 'code' , 'dofedit' ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 2 => array( 'act' , 'group' ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 3 => array( 'id' , $gid ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 4 => array( 'section', $this->ipsclass->section_code ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t) \t);\n\n\t\t$this->ipsclass->adskin->td_header[] = array( \"Форум\" , \"25%\" );\n\t\t$this->ipsclass->adskin->td_header[] = array( \"Просмотр форума<br /><input id='show' type='checkbox' onclick='checkcol(\\\"show\\\", this.checked );' />\" , \"10%\" );\n\t\t$this->ipsclass->adskin->td_header[] = array( \"Чтение тем<br /><input id='read' type='checkbox' onclick='checkcol(\\\"read\\\", this.checked );' />\" , \"10%\" );\n\t\t$this->ipsclass->adskin->td_header[] = array( \"Ответ в темы<br /><input id='reply' type='checkbox' onclick='checkcol(\\\"reply\\\", this.checked );' />\" , \"10%\" );\n\t\t$this->ipsclass->adskin->td_header[] = array( \"Создание тем<br /><input id='start' type='checkbox' onclick='checkcol(\\\"start\\\", this.checked );' />\" , \"10%\" );\n\t\t$this->ipsclass->adskin->td_header[] = array( \"Загрузка файлов<br /><input id='upload' type='checkbox' onclick='checkcol(\\\"upload\\\", this.checked );' />\" , \"10%\" );\n\t\t$this->ipsclass->adskin->td_header[] = array( \"Скачивание файлов<br /><input id='download' type='checkbox' onclick='checkcol(\\\"download\\\", this.checked );' />\" , \"10%\" );\n\n\t\t$forum_data = $this->forumfunc->ad_forums_forum_data();\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->start_table( \"Параметры доступа: \".$group['perm_name'] );\n\n\t\tforeach( $forum_data as $r )\n\t\t{\n\t\t\t$show = \"\";\n\t\t\t$read = \"\";\n\t\t\t$start = \"\";\n\t\t\t$reply = \"\";\n\t\t\t$upload = \"\";\n\n\t\t\t$global = '<center>Глобальный</center>';\n\n\t\t\tif ($r['show_perms'] == '*')\n\t\t\t{\n\t\t\t\t$show = $global;\n\t\t\t}\n\t\t\telse if ( preg_match( \"/(^|,)\".$gid.\"(,|$)/\", $r['show_perms'] ) )\n\t\t\t{\n\t\t\t\t$show = \"<center><input type='checkbox' name='show_\".$r['id'].\"' id='show_\".$r['id'].\"' onclick=\\\"obj_checked('show', {$r['id']} );\\\" value='1' checked></center>\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$show = \"<center><input type='checkbox' name='show_\".$r['id'].\"' id='show_\".$r['id'].\"' onclick=\\\"obj_checked('show', {$r['id']} );\\\" value='1'></center>\";\n\t\t\t}\n\n\t\t\t//-----------------------------------------\n\n\t\t\t$global = '<center>Глобальный</center>';\n\n\t\t\tif ($r['read_perms'] == '*')\n\t\t\t{\n\t\t\t\t$read = $global;\n\t\t\t}\n\t\t\telse if ( preg_match( \"/(^|,)\".$gid.\"(,|$)/\", $r['read_perms'] ) )\n\t\t\t{\n\t\t\t\t$read = \"<center><input type='checkbox' name='read_\".$r['id'].\"' id='read_\".$r['id'].\"' onclick=\\\"obj_checked('read', {$r['id']} );\\\" value='1' checked></center>\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$read = \"<center><input type='checkbox' name='read_\".$r['id'].\"' id='read_\".$r['id'].\"' onclick=\\\"obj_checked('read', {$r['id']} );\\\" value='1'></center>\";\n\t\t\t}\n\n\t\t\t//-----------------------------------------\n\n\t\t\t$global = '<center>Глобальный</center>';\n\n\t\t\tif ($r['start_perms'] == '*')\n\t\t\t{\n\t\t\t\t$start = $global;\n\t\t\t}\n\t\t\telse if ( preg_match( \"/(^|,)\".$gid.\"(,|$)/\", $r['start_perms'] ) )\n\t\t\t{\n\t\t\t\t$start = \"<center><input type='checkbox' name='start_\".$r['id'].\"' id='start_\".$r['id'].\"' onclick=\\\"obj_checked('start', {$r['id']} );\\\" value='1' checked></center>\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$start = \"<center><input type='checkbox' name='start_\".$r['id'].\"' id='start_\".$r['id'].\"' onclick=\\\"obj_checked('start', {$r['id']} );\\\" value='1'></center>\";\n\t\t\t}\n\n\t\t\t//-----------------------------------------\n\n\t\t\t$global = '<center>Глобальный</center>';\n\n\t\t\tif ($r['reply_perms'] == '*')\n\t\t\t{\n\t\t\t\t$reply = $global;\n\t\t\t}\n\t\t\telse if ( preg_match( \"/(^|,)\".$gid.\"(,|$)/\", $r['reply_perms'] ) )\n\t\t\t{\n\t\t\t\t$reply = \"<center><input type='checkbox' name='reply_\".$r['id'].\"' id='reply_\".$r['id'].\"' onclick=\\\"obj_checked('reply', {$r['id']} );\\\" value='1' checked></center>\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$reply = \"<center><input type='checkbox' name='reply_\".$r['id'].\"' id='reply_\".$r['id'].\"' onclick=\\\"obj_checked('reply', {$r['id']} );\\\" value='1'></center>\";\n\t\t\t}\n\n\t\t\t//-----------------------------------------\n\n\t\t\t$global = '<center>Глобальный</center>';\n\n\t\t\tif ($r['upload_perms'] == '*')\n\t\t\t{\n\t\t\t\t$upload = $global;\n\t\t\t}\n\t\t\telse if ( preg_match( \"/(^|,)\".$gid.\"(,|$)/\", $r['upload_perms'] ) )\n\t\t\t{\n\t\t\t\t$upload = \"<center><input type='checkbox' name='upload_\".$r['id'].\"' id='upload_\".$r['id'].\"' onclick=\\\"obj_checked('upload', {$r['id']} );\\\" value='1' checked></center>\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$upload = \"<center><input type='checkbox' name='upload_\".$r['id'].\"' id='upload_\".$r['id'].\"' onclick=\\\"obj_checked('upload', {$r['id']} );\\\" value='1'></center>\";\n\t\t\t}\n\n\t\t\t//-----------------------------------------\n\n\t\t\t$global = '<center>Глобальный</center>';\n\n\t\t\tif ($r['download_perms'] == '*')\n\t\t\t{\n\t\t\t\t$download = $global;\n\t\t\t}\n\t\t\telse if ( preg_match( \"/(^|,)\".$gid.\"(,|$)/\", $r['download_perms'] ) )\n\t\t\t{\n\t\t\t\t$download = \"<center><input type='checkbox' name='download_\".$r['id'].\"' id='download_\".$r['id'].\"' onclick=\\\"obj_checked('download', {$r['id']} );\\\" value='1' checked></center>\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$download = \"<center><input type='checkbox' name='download_\".$r['id'].\"' id='download_\".$r['id'].\"' onclick=\\\"obj_checked('download', {$r['id']} );\\\" value='1'></center>\";\n\t\t\t}\n\n\t\t\t//-----------------------------------------\n\n\t\t\tif ( $r['root_forum'] )\n\t\t\t{\n\t\t\t\t$css = 'tablerow4';\n\t\t\t\t$download = $upload = $reply = $start = $read = \"<center>Не&nbsp;используется</center>\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$css = '';\n\t\t\t}\n\n\t\t\t$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"<div style='float:right;width:auto;'>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t<input type='button' id='button' value='+' onclick='checkrow({$r['id']},true)' />&nbsp;<input type='button' id='button' value='-' onclick='checkrow({$r['id']},false)' />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t </div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t <b>\".$r['depthed_name'].\"</b>\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"<div style='background-color:#ecd5d8; padding:4px;'>\".$show.\"</div>\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"<div style='background-color:#dbe2de; padding:4px;'>\".$read.\"</div>\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"<div style='background-color:#dbe6ea; padding:4px;'>\".$reply.\"</div>\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"<div style='background-color:#d2d5f2; padding:4px;'>\".$start.\"</div>\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"<div style='background-color:#ece6d8; padding:4px;'>\".$upload.\"</div>\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"<div style='background-color:#dfdee9; padding:4px;'>\".$download.\"</div>\",\n\t\t\t\t\t\t\t\t\t\t \t\t\t\t\t) ,$css );\n\n\t\t}\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->end_form(\"Обновить настройки доступа\");\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->end_table();\n\n\t\t$this->ipsclass->html .= $this->html->permissions_js();\n\n\t\t$this->ipsclass->admin->output();\n\t}", "private function loadPermissions() {\n\tif ($this->permissionsloaded) {return;}\n\t//$mem = DStructMemCache::getInstance();\n\t//if (!$this->permissions = $mem->get(md5(get_class($this->activecontainer).$this->areaname.$this->activecontainer->getID()))) {\n\t\t$this->permissions = $this->activecontainer->permissions();\n\t//\t$mem->set(md5(get_class($this->activecontainer).$this->areaname.$this->activecontainer->getID()), $this->permissions);\n\t//}\n\t$this->permissionsloaded = true;\n}", "public function doesCheckModifyAccessListHookModifyAccessAllowed() {}", "public function setPermissions($permissions) {}", "public function actionPermissions()\n {\n FileHelper::createDirectory(Yii::getAlias('@webroot/css'));\n FileHelper::createDirectory(Yii::getAlias('@webroot/js'));\n\n foreach (['@webroot/assets', '@webroot/uploads', '@runtime'] as $path) {\n try {\n chmod(Yii::getAlias($path), 0777);\n } catch (\\Exception $e) {\n $this->stderr(\"Failed to change permissions for directory \\\"{$path}\\\": \" . $e->getMessage());\n $this->stdout(PHP_EOL);\n }\n }\n }", "function update_role_permision() {\n\t\t$user_role = $this->get_role_permission($_POST['role_id']);\n\t\tforeach ($user_role->result() as $role) {\n\t\t\t\n\t\t\t$this->db->where('entry_id', $role->entry_id);\n\t\t\t$list = $_POST['role_permission'];\n\t\t\t$allow = isset($list[$role->entry_id]) ? 1 : 0;\n\t\t\t$this->db->update('system_security.security_role_permission', array('allow_deny' => $allow));\n\t\t}\n\t}", "private function config_OSF_PermissionsManagementTool()\n {\n // Get package info\n $configPath = \"{$this->permissions_management_tool_folder}\";\n\n // Configure\n $this->span(\"Configuring...\", 'info');\n // OSF Web Service paths\n $this->setIni(\"config\", \"osfWebServicesFolder\", \"\\\"{$this->osf_web_services_folder}\\\"\",\n \"{$configPath}/pmt.ini\");\n $this->setIni(\"config\", \"osfWebServicesEndpointsUrl\", \"\\\"http://{$this->osf_web_services_domain}/ws/\\\"\",\n \"{$configPath}/pmt.ini\");\n // OSF Web Service credentials\n $this->setIni(\"credentials\", \"application-id\", \"\\\"{$this->application_id}\\\"\",\n \"{$configPath}/pmt.ini\");\n $this->setIni(\"credentials\", \"api-key\", \"\\\"{$this->api_key}\\\"\",\n \"{$configPath}/pmt.ini\");\n $this->setIni(\"credentials\", \"user\", \"\\\"http://{$this->osf_web_services_domain}/wsf/users/admin\\\"\",\n \"{$configPath}/pmt.ini\");\n }", "function updateProjectPermissionNames() {\n $project_roles_table = TABLE_PREFIX . 'project_roles';\n $project_users_table = TABLE_PREFIX . 'project_users';\n\n try {\n DB::beginWork('Updating project role keys @ ' . __CLASS__);\n\n $rename = array(\n 'ticket' => 'task',\n 'checklist' => 'todo_list',\n 'page' => 'notebook',\n 'timerecord' => 'tracking',\n );\n\n $rows = DB::execute(\"SELECT id, permissions FROM $project_roles_table\");\n if(is_foreachable($rows)) {\n foreach($rows as $row) {\n $permissions = $row['permissions'] ? unserialize($row['permissions']) : array();\n\n foreach($rename as $k => $v) {\n if(isset($permissions[$k])) {\n $permissions[$v] = $permissions[$k];\n unset($permissions[$k]);\n } // if\n } // foreach\n\n DB::execute(\"UPDATE $project_roles_table SET permissions = ? WHERE id = ?\", serialize($permissions), $row['id']);\n } // foreach\n } // if\n\n $rows = DB::execute(\"SELECT user_id, project_id, permissions FROM $project_users_table\");\n if(is_foreachable($rows)) {\n foreach($rows as $row) {\n $permissions = $row['permissions'] ? unserialize($row['permissions']) : null;\n\n if(is_array($permissions)) {\n foreach($rename as $k => $v) {\n if(isset($permissions[$k])) {\n $permissions[$v] = $permissions[$k];\n unset($permissions[$k]);\n } // if\n } // foreach\n } // if\n\n DB::execute(\"UPDATE $project_users_table SET permissions = ? WHERE user_id = ? AND project_id = ?\", serialize($permissions), $row['user_id'], $row['project_id']);\n } // foreach\n } // if\n\n DB::commit('Project role keys updated @ ' . __CLASS__);\n } catch(Exception $e) {\n DB::rollback('Failed to update project role keys @ ' . __CLASS__);\n\n return $e->getMessage();\n } // try\n\n return true;\n }", "public function setAdminPermissions(array $permissions): void;", "public function permissions();", "public function permissions();", "public function permissions();", "public function permissions();", "public function permissions();", "protected function setApplicationPermissions()\n {\n $files = (array) $this->rocketeer->getOption('remote.permissions.files');\n foreach ($files as &$file) {\n $this->setPermissions($file);\n }\n\n return true;\n }", "public function edit(Dock $dock)\n {\n $this->authorize(get_class($dock) . '.edit-permissions');\n\n return view('admin::docks.' . $dock->name . '.permissions.edit')->withDock($dock);\n }", "public function run()\n {\n Permission::insert(config('permissions', true));\n }", "function permissions_upgrade($oldversion)\n{\n // Update successful\n return true;\n}", "protected function buildSetterPermission() {\n }", "public function setPermissions($folder)\n\t{\n\t\t$commands = array();\n\n\t\t// Get path to folder\n\t\t$folder = $this->releasesManager->getCurrentReleasePath($folder);\n\t\t$this->command->comment('Setting permissions for '.$folder);\n\n\t\t// Get permissions options\n\t\t$callback = $this->rocketeer->getOption('remote.permissions.callback');\n\t\t$commands = (array) $callback($this, $folder);\n\n\t\t// Cancel if setting of permissions is not configured\n\t\tif (empty($commands)) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn $this->runForCurrentRelease($commands);\n\t}", "function set_permissions($permessi_abilitati)\n {\n $permissions_data=$this->config->item(\"permissions\");\n $permissions_data=array_reverse($permissions_data['mask'],true);\n\n foreach($permissions_data as $value)\n {\n if(in_array($value,array_keys($permessi_abilitati)))\n $this->_permissions[$value]=$permessi_abilitati[$value];\n else\n $this->_permissions[$value]=false;\n }\n\n $bitmask=$this->to_bitmask($this->_permissions);\n return($bitmask);\n }", "public function SavePermissions()\n\t{\n\t\treturn true;\n\t}", "public function setPermissions($permissions);", "public function run()\n {\n DB::table('permissions');\n Artisan::call('permission:cache-reset');\n\n Permission::updateOrCreate(['name' => 'settings.create']);\n Permission::updateOrCreate(['name' => 'settings.view']);\n Permission::updateOrCreate(['name' => 'settings.update']);\n Permission::updateOrCreate(['name' => 'settings.delete']);\n\n Permission::updateOrCreate(['name' => 'crm_talent.create']);\n Permission::updateOrCreate(['name' => 'crm_talent.view']);\n Permission::updateOrCreate(['name' => 'crm_talent.update']);\n Permission::updateOrCreate(['name' => 'crm_talent.delete']);\n\n Permission::updateOrCreate(['name' => 'crm_client.create']);\n Permission::updateOrCreate(['name' => 'crm_client.view']);\n Permission::updateOrCreate(['name' => 'crm_client.update']);\n Permission::updateOrCreate(['name' => 'crm_client.delete']);\n\n Permission::updateOrCreate(['name' => 'weeklydoses.view']);\n\n Permission::updateOrCreate(['name' => 'library_books.create']);\n Permission::updateOrCreate(['name' => 'library_books.view']);\n Permission::updateOrCreate(['name' => 'library_books.update']);\n Permission::updateOrCreate(['name' => 'library_books.delete']);\n\n Permission::updateOrCreate(['name' => 'library_book_category.create']);\n Permission::updateOrCreate(['name' => 'library_book_category.view']);\n Permission::updateOrCreate(['name' => 'library_book_category.update']);\n Permission::updateOrCreate(['name' => 'library_book_category.delete']);\n }", "function setPermissions($component, $group, $actions, $permissions)\n\t{\n\t\t$this->jClick($component);\n\t\tif ($component == 'Global Configuration')\n\t\t{\n\t\t\t$this->click('permissions');\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->jClick('Options');\n\t\t\t$this->click(\"//dt[contains(span,'Permissions')]\");\n\t\t}\n\t\tif (!is_array($actions)) {\n\t\t\t$actions = array($actions);\n\t\t}\n\t\tif (!is_array($permissions)) {\n\t\t\t$permissions = array($permissions);\n\t\t}\n\t\techo \"Open panel for group '$group'\\n\";\n\t\t$this->click(\"//ul[@id='rules']//li/div[@class='panel']//h3[contains(.,'$group')]\");\n\n\t\tfor ($i = 0; $i < count($actions); $i++) {\n\t\t\t$action = $actions[$i];\n\t\t\t$permission = $permissions[$i];\n\t\t\techo \"Setting $action action for $group to $permission in $component.\\n\";\n\t\t\tswitch ($action)\n\t\t\t{\n\t\t\t\tcase 'Site Login':\n\t\t\t\t\t$doAction = 'login.site';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'Admin Login':\n\t\t\t\t\t$doAction = 'login.admin';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'Configure':\n\t\t\t\tcase 'Super Admin':\n\t\t\t\t\t$doAction = 'core.admin';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'Access Component':\n\t\t\t\t\t$doAction = 'core.manage';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'Create':\n\t\t\t\t\t$doAction = 'create';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'Delete':\n\t\t\t\t\t$doAction = 'delete';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'Edit':\n\t\t\t\t\t$doAction = 'edit';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'Edit State':\n\t\t\t\t\t$doAction = 'edit.state';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'Edit Own':\n\t\t\t\t\t$doAction = 'edit.own';\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t$this->select(\"//select[contains(@id,'$doAction')][contains(@title,'$group')]\", \"label=$permission\");\n\t\t}\n\n\t\techo \"Close panel for group '$group'\\n\";\n\t\t$this->click(\"//ul[@id='rules']//li/div[@class='panel']//h3[contains(.,'Public')]\");\n\n\t\tif ($component == 'Global Configuration') {\n\t\t\t$this->click(\"//li[@id='toolbar-save']/a/span\");\n\t\t\t$this->waitForPageToLoad(\"30000\");\n\t\t\ttry {\n\t\t\t\t$this->assertTrue($this->isElementPresent(\"//dl[@id='system-message'][contains(., 'success')]\"));\n\t\t\t}\n\t\t\tcatch (PHPUnit_Framework_AssertionFailedError $e) {\n\t\t\t\tarray_push($this->verificationErrors, $this->getTraceFiles($e));\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\t// Need to click the Save & Close button\n\t\t\t$this->click(\"//button[contains(text(),'Save')][contains(text(),'Close')]\");\n\t\t\tfor ($second = 0; ; $second++) {\n\t\t\t\tif ($second >= 60) $this->fail(\"timeout\");\n\t\t\t\ttry {\n\t\t\t\t\tif (!$this->isElementPresent(\"//dl[contains(@id, 'configuration')]\")) break;\n\t\t\t\t} catch (Exception $e) {}\n\t\t\t\tsleep(1);\n\t\t\t}\n\t\t}\n\t}", "protected function assignPermissions()\n {\n $role = Role::whereName(config('system.default_role.admin'))->first();\n $role->syncPermissions(config('system.default_permission'));\n }", "public function SetPermissions ($permissions);", "public function checkPermission()\n {\n if ($this->User->isAdmin)\n {\n return;\n }\n\n // Set root IDs\n if (!is_array($this->User->calendars) || empty($this->User->calendars))\n {\n $root = [0];\n }\n else\n {\n $root = $this->User->calendars;\n }\n\n $id = strlen(Input::get('id')) ? Input::get('id') : CURRENT_ID;\n\n // Check current action\n switch (Input::get('act'))\n {\n case 'paste':\n // Allow\n break;\n\n case 'create':\n if (!strlen(Input::get('pid')) || !in_array(Input::get('pid'), $root))\n {\n $this->log('Not enough permissions to create promoters in calendar ID \"' . Input::get('pid') . '\"', __METHOD__, TL_ERROR);\n $this->redirect('contao/main.php?act=error');\n }\n break;\n\n case 'cut':\n case 'copy':\n if (!in_array(Input::get('pid'), $root))\n {\n $this->log('Not enough permissions to ' . Input::get('act') . ' promoters ID \"' . $id . '\" to calendar ID \"' . Input::get('pid') . '\"', __METHOD__, TL_ERROR);\n $this->redirect('contao/main.php?act=error');\n }\n // NO BREAK STATEMENT HERE\n\n case 'edit':\n case 'show':\n case 'delete':\n case 'toggle':\n $objPromoter = $this->Database->prepare(\"SELECT pid FROM tl_calendar_promoters WHERE id=?\")->limit(1)->execute($id);\n\n if ($objPromoter->numRows < 1)\n {\n $this->log('Invalid event ID \"' . $id . '\"', __METHOD__, TL_ERROR);\n $this->redirect('contao/main.php?act=error');\n }\n\n if (!in_array($objPromoter->pid, $root))\n {\n $this->log('Not enough permissions to ' . Input::get('act') . ' promoters ID \"' . $id . '\" of calendar ID \"' . $objCalendar->pid . '\"', __METHOD__, TL_ERROR);\n $this->redirect('contao/main.php?act=error');\n }\n break;\n\n case 'select':\n case 'editAll':\n case 'deleteAll':\n case 'overrideAll':\n case 'cutAll':\n case 'copyAll':\n if (!in_array($id, $root))\n {\n $this->log('Not enough permissions to access calendar ID \"' . $id . '\"', __METHOD__, TL_ERROR);\n $this->redirect('contao/main.php?act=error');\n }\n\n $objPromoter = $this->Database->prepare(\"SELECT id FROM tl_calendar_promoters WHERE pid=?\")->execute($id);\n\n if ($objPromoter->numRows < 1)\n {\n $this->log('Invalid calendar ID \"' . $id . '\"', __METHOD__, TL_ERROR);\n $this->redirect('contao/main.php?act=error');\n }\n\n $session = $this->Session->getData();\n $session['CURRENT']['IDS'] = array_intersect($session['CURRENT']['IDS'], $objPromoter->fetchEach('id'));\n $this->Session->setData($session);\n break;\n\n default:\n if (strlen(Input::get('act')))\n {\n $this->log('Invalid command \"' . Input::get('act') . '\"', __METHOD__, TL_ERROR);\n $this->redirect('contao/main.php?act=error');\n }\n elseif (!in_array($id, $root))\n {\n $this->log('Not enough permissions to access calendar ID \"' . $id . '\"', __METHOD__, TL_ERROR);\n $this->redirect('contao/main.php?act=error');\n }\n break;\n }\n }", "public function getWorkspacePermission() {}", "protected function configurePermissions()\n {\n Jetstream::defaultApiTokenPermissions(['read']);\n\n Jetstream::role('admin', __('Yonetici'), [\n 'create',\n 'read',\n 'update',\n 'delete',\n ])->description(__('Şirket hakkındaki herşeyi yapabilir'));\n\n Jetstream::role('editor', __('İlan Yöneticisi'), [\n 'read',\n 'create',\n 'update',\n ])->description(__('Sadece ilanları yönetebilir'));\n Jetstream::role('operasyon', __('Operasyon Yöneticisi'), [\n 'read',\n 'create',\n 'update',\n ])->description(__('Sadece operasyonları yönetebilir'));\n\n }", "public function registerPermissions()\n {\n // Remove this line and uncomment block to activate\n return [\n 'IgniterLabs.Shipday.ManageSettings' => [\n 'description' => 'lang:igniterlabs.shipday::default.help_permission',\n 'group' => 'module',\n ],\n ];\n }", "public function doesCheckModifyAccessListHookGetsCalled() {}", "public function actionReloadPermissions()\n {\n $result = Manager::getInstance()->processLoadModulesPermissions();\n $message = UsniAdaptor::t('auth', 'Rebuild Permissions');\n if($result == true)\n {\n FlashUtil::setMessage('success', UsniAdaptor::t('serviceflash', '{service} execution is successful.', ['service' => $message]));\n return $this->redirect(UsniAdaptor::createUrl('service/default/index'));\n }\n if($result == false)\n {\n FlashUtil::setMessage('error', UsniAdaptor::t('serviceflash', '{service} execution fails.', ['service' => $message]));\n return $this->redirect(UsniAdaptor::createUrl('service/default/index'));\n }\n }", "public function update_permissions($rules = array())\n\t{\n\t\tif (empty($rules))\n\t\t{\n\t\t\treturn $this->update(array('permissions' => array()));\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// let's update the permissions column.\n\t\t\treturn $this->update(array('permissions' => $rules));\n\t\t}\n\t}", "protected function configurePermissions()\n {\n Jetstream::defaultApiTokenPermissions(['read']);\n\n Jetstream::permissions([\n 'create',\n 'read',\n 'update',\n 'delete',\n ]);\n }", "protected function checkPermissions () {\n foreach ($this->aSequences as $sType => $aActions) {\n foreach ($aActions as $sAction => $aAction) {\n if (!empty($sAction)) {\n foreach ($aAction as $sIdent => $aFile) {\n if (!$this->isWriteable($aFile)) {\n throw MLException::factory(\n 'update', \n 'File `{#path}` is not writable.', \n 1407759765\n )->setData(array('path' => MLHelper::getFilesystemInstance()->getFullPath($aFile['dst'])));\n }\n }\n }\n }\n }\n return $this;\n }", "function add_new_perm()\n\t{\n\t\t$this->ipsclass->input['new_perm_name'] = trim($this->ipsclass->input['new_perm_name']);\n\n\t\tif ($this->ipsclass->input['new_perm_name'] == \"\")\n\t\t{\n\t\t\t$this->ipsclass->admin->error(\"Необходимо ввести имя\");\n\t\t}\n\n\t\t$copy_id = $this->ipsclass->input['new_perm_copy'];\n\n\t\t//-----------------------------------------\n\t\t// UPDATE DB\n\t\t//-----------------------------------------\n\n\t\t$this->ipsclass->DB->do_insert( 'forum_perms', array( 'perm_name' => $this->ipsclass->input['new_perm_name'] ) );\n\n\t\t$new_id = $this->ipsclass->DB->get_insert_id();\n\n\t\tif ( $copy_id != 'none' )\n\t\t{\n\t\t\t//-----------------------------------------\n\t\t\t// Add new mask to forum accesses\n\t\t\t//-----------------------------------------\n\n\t\t\t$old_id = intval($copy_id);\n\n\t\t\tif ( ($new_id > 0) and ($old_id > 0) )\n\t\t\t{\n\t\t\t\t$this->ipsclass->DB->simple_construct( array( 'select' => 'id, permission_array', 'from' => 'forums' ) );\n\t\t\t\t$get = $this->ipsclass->DB->simple_exec();\n\n\t\t\t\twhile( $f = $this->ipsclass->DB->fetch_row($get) )\n\t\t\t\t{\n\t\t\t\t\t$d_str = \"\";\n\t\t\t\t\t$d_arr = unserialize(stripslashes( $f['permission_array'] ) );\n\n\t\t\t\t\t$perms = unserialize(stripslashes( $f['permission_array'] ) );\n\n\t\t\t\t\tforeach( array( 'read_perms', 'reply_perms', 'start_perms', 'upload_perms', 'show_perms', 'download_perms' ) as $perm_bit )\n\t\t\t\t\t{\n\t\t\t\t\t\tif ( $perms[ $perm_bit ] != '*')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif ( preg_match( \"/(^|,)\".$old_id.\"(,|$)/\", $perms[ $perm_bit ]) )\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$d_arr[ $perm_bit ] = $this->clean_perms( $perms[ $perm_bit ] ) . \",\".$new_id;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t//-----------------------------------------\n\t\t\t\t\t// Do we have anything to save?\n\t\t\t\t\t//-----------------------------------------\n\n\t\t\t\t\tif ( count($d_arr) > 0 )\n\t\t\t\t\t{\n\t\t\t\t\t\t$string = addslashes(serialize( $d_arr ) );\n\n\t\t\t\t\t\t//-----------------------------------------\n\t\t\t\t\t\t// Sure?..\n\t\t\t\t\t\t//-----------------------------------------\n\n\t\t\t\t\t\tif ( strlen($string) > 5)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$this->ipsclass->DB->do_update( 'forums', array( 'permission_array' => $string ), 'id='.$f['id'] );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t//-----------------------------------------\n\t\t// Recache forums\n\t\t//-----------------------------------------\n\n\t\trequire_once( ROOT_PATH.'sources/action_admin/forums.php' );\n\t\t$ad_forums = new ad_forums();\n\t\t$ad_forums->ipsclass =& $this->ipsclass;\n\t\t$ad_forums->recache_forums();\n\n\t\t$this->ipsclass->main_msg = \"Маска доступа «{$this->ipsclass->input['new_perm_name']}» добавлена.\";\n\t\t$this->permsplash();\n\t}", "public function updateRolePermissions()\n\t{\n\t\t$input = Input::all();\n\n\t\tforeach ($input['permissions'] as $role => $permissions) {\n\t\t\tRole::whereName($role)->first()->perms()->sync($permissions);\n\t\t}\n\n\t\treturn Redirect::route('role.permissions.edit')\n\t\t\t\t\t\t\t->with('message', 'Successfully updated role permissions')\n\t\t\t\t\t\t\t->with('alert-class', 'success');\n\t}", "public function permissionChange()\n {\n $data = $this->request->all();\n unset($data['_token']);\n $arr = explode('_', $data['id']);\n $permissions = Permission::all()->sortBy('name')->pluck('name', 'id');\n $roles = Role::all()->sortBy('name')->pluck('name');//return json_encode($roles);\n $data['permission'] = $permissions[$arr[1]];\n $data['role'] = $roles[$arr[2]];\n $role = Role::findByName($data['role']);\n\n //first check if there are admin changes, only super admins have access to this\n if (strstr($data['permission'], 'admin')) {\n if (!Auth::user()->hasRole('super admin')) {\n $data['error'] = 'Only super administrators can edit this permission';\n } else {\n if ($data['val'] === '1') {\n $role->revokePermissionTo($data['permission']);\n $data['val'] = '0';\n } else {\n $role->givePermissionTo($data['permission']);\n $data['val'] = '1';\n }\n }\n } //check all other requests\n else if ($data['val'] === '1') {\n $role->revokePermissionTo($data['permission']);\n $data['val'] = '0';\n } else {\n $role->givePermissionTo($data['permission']);\n $data['val'] = '1';\n }\n\n return json_encode($data);\n }", "public static function setPermission($event)\n\t{\n\t\t$options = array_merge([\n\t\t\tself::EXTRA_WRITABLE => [],\n\t\t\tself::EXTRA_EXECUTABLE => [],\n\t\t], $event->getComposer()->getPackage()->getExtra());\n\n\t\tforeach ((array)$options[self::EXTRA_WRITABLE] as $path) {\n\t\t\techo \"Setting writable: $path ...\";\n\t\t\tif (is_dir($path)) {\n\t\t\t\tchmod($path, 0777);\n\t\t\t\techo \"done\\n\";\n\t\t\t} else {\n\t\t\t\techo \"The directory was not found: \" . getcwd() . DIRECTORY_SEPARATOR . $path;\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tforeach ((array)$options[self::EXTRA_EXECUTABLE] as $path) {\n\t\t\techo \"Setting executable: $path ...\";\n\t\t\tif (is_file($path)) {\n\t\t\t\tchmod($path, 0755);\n\t\t\t\techo \"done\\n\";\n\t\t\t} else {\n\t\t\t\techo \"\\n\\tThe file was not found: \" . getcwd() . DIRECTORY_SEPARATOR . $path . \"\\n\";\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t}", "public function save()\n\t{\n\t\tparent::save();\n\t\t\n\t\tif ( $this instanceof \\IPS\\Node\\Permissions and $this->_permissions !== NULL and $this->_permissions != $this->_originalPermissions )\n\t\t{\n\t\t\tif ( !isset( $this->_permissions['perm_id'] ) )\n\t\t\t{\n\t\t\t\tforeach ( array( 'app' => static::$permApp, 'perm_type' => static::$permType, 'perm_type_id' => $this->_id ) as $k => $v )\n\t\t\t\t{\n\t\t\t\t\tif ( !isset( $this->_permissions[ $k ] ) )\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->_permissions[ $k ] = $v;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\\IPS\\Db::i()->replace( 'core_permission_index', $this->_permissions );\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t\\IPS\\Db::i()->update( 'core_permission_index', $this->_permissions, array( 'perm_id=?', $this->_permissions['perm_id'] ) );\n\t\t\t}\n\t\t}\n\t}", "private function cachePermissions(): void\n {\n Cache::put($this->cacheKey(), [\n 'isPayor' => $this->isPayor,\n 'isAgencyBankAccountSetup' => $this->isAgencyBankAccountSetup,\n 'canViewDocumentation' => $this->canViewDocumentation,\n ]);\n }", "private function upgrade_OSF_PermissionsManagementTool($pkgVersion = '')\n {\n // Get package info\n $installPath = \"{$this->permissions_management_tool_folder}\";\n $bckPath = \"/tmp/osf/pmt-\" . date('Y-m-d_H-i-s');\n\n // Backup\n $this->span(\"Making backup...\", 'info');\n $this->mkdir(\"{$bckPath}/\");\n $this->mv(\"{$installPath}/.\", \"{$bckPath}/.\");\n\n // Install\n $this->install_OSF_PermissionsManagementTool($pkgVersion);\n\n // Restore\n $this->span(\"Restoring backup...\", 'info');\n $this->mv(\"{$bckPath}/pmt.ini\", \"{$installPath}/\");\n\n // Cleanup\n $this->span(\"Cleaning backup...\", 'info');\n $this->rm(\"{$bckPath}/\", TRUE);\n }", "function formPermissions($branch) {\n\t\tglobal $perm_defaults;\n\n\t\t// Set output text\n\n\t\t// Create a object of the class dynamicControls\n\t\t$dynamic_controls = new we_dynamicControls();\n\t\t// Now we create the overview of the user rights\n\t\t$content = $dynamic_controls->fold_checkbox_groups(\t$this->permissions_slots,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$this->permissions_main_titles,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$this->permissions_titles,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$this->Name,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$branch,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tarray(\"administrator\"),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttrue,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttrue,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"we_form\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"perm_branch\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttrue,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttrue);\n\n\n\n\t\t$javascript ='\n\t\t\t<script language=\"JavaScript\" type=\"text/javascript\"><!--\n\n\t\t\t\tfunction rebuildCheckboxClicked() {\n\t\t\t\t\ttoggleRebuildPerm(false);\n\t\t\t\t}\n\n\t\t\t\tfunction toggleRebuildPerm(disabledOnly) {\n\n\t\t\t\t';\n\t\tif(isset($this->permissions_slots['rebuildpermissions']) && is_array($this->permissions_slots['rebuildpermissions'])) {\n\n\n\n\t\t\tforeach($this->permissions_slots['rebuildpermissions'] as $pname=>$pvalue) {\n\t\t\t\tif($pname!='REBUILD') {\n\t\t\t\t\t$javascript .= '\n\t\t\t\t\tif (document.we_form.' . $this->Name . '_Permission_REBUILD && document.we_form.' . $this->Name . '_Permission_' . $pname . ') {\n\t\t\t\t\t\tif(document.we_form.' . $this->Name . '_Permission_REBUILD.checked) {\n\t\t\t\t\t\t\tdocument.we_form.' . $this->Name . '_Permission_' . $pname . '.disabled = false;\n\t\t\t\t\t\t\tif (!disabledOnly) {\n\t\t\t\t\t\t\t\tdocument.we_form.' . $this->Name . '_Permission_' . $pname . '.checked = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tdocument.we_form.' . $this->Name . '_Permission_' . $pname . '.disabled = true;\n\t\t\t\t\t\t\tif (!disabledOnly) {\n\t\t\t\t\t\t\t\tdocument.we_form.' . $this->Name . '_Permission_' . $pname . '.checked = false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t';\n\t\t\t\t} else {\n\t\t\t\t\t$handler = \"\n\t\t\t\t\tif (document.we_form.\" . $this->Name . \"_Permission_\" . $pname . \") {\n\t\t\t\t\t\tdocument.we_form.\" . $this->Name . \"_Permission_\" . $pname . \".onclick = rebuildCheckboxClicked;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tdocument.we_form.\" . $this->Name . \"_Permission_\" . $pname . \".onclick = top.content.setHot();\n\t\t\t\t\t}\n\t\t\t\t\ttoggleRebuildPerm(true);\n\t\t\t\t\t\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$javascript .= '\n\t\t\t\t}\n\t\t\t\t\t\t';\n\t\tif(isset($handler)) {\n\t\t\t$javascript .= $handler;\n\t\t}\n\t\t$javascript .= '\n\t\t\t//--></script>';\n\n\t\t$parts = array();\n\n\t\tarray_push($parts,\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\"headline\"=>\"\",\n\t\t\t\t\t\t\t\t\"html\"=>$content,\n\t\t\t\t\t\t\t\t\"space\"=>0,\n\t\t\t\t\t\t\t\t\"noline\"=>1\n\t\t\t\t\t\t\t\t)\n\t\t);\n\n\t\t// js to uncheck all permissions\n\t\t$uncheckjs = '';\n\t\t$checkjs = '';\n\t\tforeach($this->permissions_slots as $group) {\n\t\t\tforeach($group as $pname=>$pvalue) {\n\t\t\t\tif($pname!='ADMINISTRATOR') {\n\t\t\t\t\t$uncheckjs .= 'document.we_form.' . $this->Name . '_Permission_' . $pname . '.checked = false;';\n\t\t\t\t\t$checkjs .= 'document.we_form.' . $this->Name . '_Permission_' . $pname . '.checked = true;';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$we_button = new we_button();\n\t\t$button_uncheckall = $we_button->create_button('uncheckall', 'javascript:' . $uncheckjs);\n\t\t$button_checkall = $we_button->create_button('checkall', 'javascript:' . $checkjs);\n\t\tarray_push($parts,\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'headline'=>'',\n\t\t\t\t\t\t\t\t'html'=>$we_button->create_button_table(array($button_uncheckall,$button_checkall)),\n\t\t\t\t\t\t\t\t'space'=>0\n\t\t\t\t\t\t\t\t)\n\t\t);\n\n\n\n\t\t// Check if user has right to decide to give administrative rights\n\t\tif(is_array($this->permissions_slots[\"administrator\"]) && we_hasPerm(\"ADMINISTRATOR\") && $this->Type==0) {\n\t\t\tforeach($this->permissions_slots[\"administrator\"] as $k=>$v) {\n\t\t\t\t$content='\n\t\t\t\t\t<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" width=\"500\">\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t' . getPixel(1, 5) . '</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t' . we_forms::checkbox(($v ? $v : \"0\"), ($v ? true : false), $this->Name . \"_Permission_\" . $k , $this->permissions_titles[\"administrator\"][$k], false, \"defaultfont\", ($k==\"REBUILD\"?\"setRebuidPerms();\":\"\")) . '</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</table>';\n\t\t\t}\n\t\t\tarray_push($parts,\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\"headline\"=>\"\",\n\t\t\t\t\t\t\t\t\"html\"=>$content,\n\t\t\t\t\t\t\t\t\"space\"=>0\n\t\t\t\t\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\n\n\t\tarray_push($parts,\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\"headline\"=>\"\",\n\t\t\t\t\t\t\t\t\"html\"=>$this->formInherits(\"_ParentPerms\",$this->ParentPerms,$GLOBALS['l_users'][\"inherit\"]),\n\t\t\t\t\t\t\t\t\"space\"=>0\n\t\t\t\t\t\t\t\t)\n\t\t);\n\n\n\n\t\treturn we_multiIconBox::getHTML(\"\",\"100%\",$parts,30).$javascript;\n\t}", "public function givePermission($permissions);", "public function syncPermissions(): void {\n\t\t$FinalPermissions = discover_permissions( false );\n\t\t$RolesExists = Permission::query()->whereIn( 'name', $FinalPermissions )->get();\n\t\tif ( $RolesExists->count() > 0 ) {\n\t\t\t$FinalPermissionsCollection = collect( $FinalPermissions )->filter( static function ( $item ) use ( $RolesExists ) {\n\t\t\t\treturn ! $RolesExists->contains( 'name', '=', $item );\n\t\t\t} );\n\t\t\t$CreateRoles = [];\n\t\t\tforeach ( $FinalPermissionsCollection as $finalPermission ) {\n\t\t\t\t$CreateRoles[] = [\n\t\t\t\t\t'name' => $finalPermission,\n\t\t\t\t\t'guard_name' => 'admin',\n\t\t\t\t\t'updated_at' => Carbon::now(),\n\t\t\t\t\t'created_at' => Carbon::now(),\n\t\t\t\t];\n\t\t\t}\n\t\t\tif ( ! empty( $CreateRoles ) ) {\n\t\t\t\tPermission::query()->insert( $CreateRoles );\n\t\t\t}\n\t\t} else {\n\t\t\t$CreateRoles = [];\n\t\t\tforeach ( $FinalPermissions as $finalPermission ) {\n\t\t\t\t$CreateRoles[] = [\n\t\t\t\t\t'name' => $finalPermission,\n\t\t\t\t\t'guard_name' => 'admin',\n\t\t\t\t\t'updated_at' => Carbon::now(),\n\t\t\t\t\t'created_at' => Carbon::now(),\n\t\t\t\t];\n\t\t\t}\n\t\t\tPermission::query()->insert( $CreateRoles );\n\t\t}\n\t}", "function check_permission()\n\t{\n\t\t$CFG = $this->config->item('permission_modify_configure');\n\t\tif( ! addPermission( $CFG[\"sector\"][\"add\"] ) )\n\t\t{\n\t\t\t$this->form_validation->set_message('check_permission', _e('access denied'));\n\t\t\treturn false;\t\t\t\t\n\t\t}\n\t}", "public function updatePerm($id,$perms){\n\t\t$this->db->where('id',$id);\n\t\t$this->db->update('user_admin',$perms);\n\t}", "public function checkPermissions();", "function permissions() {\r\n\t\treturn false;\r\n\t}", "public function getFileOperationPermissions() {}", "private function setSpecialBits() {\n if (Request::has(\"include-setuid\") && Request::input(\"include-setuid\") === \"true\") { $permissionSetuid = 4; } else { $permissionSetuid = 0; }\n if (Request::has(\"include-setgid\") && Request::input(\"include-setgid\") === \"true\") { $permissionSetgid = 2; } else { $permissionSetgid = 0; }\n if (Request::has(\"include-sticky\") && Request::input(\"include-sticky\") === \"true\") { $permissionSticky = 1; } else { $permissionSticky = 0; }\n return $permissionSetuid + $permissionSetgid + $permissionSticky;\n }", "public function checkFolderPermissionsFilesystemPermissionsDataProvider() {}", "public function fixPerms($group = 'www-data')\n {\n $this->taskExecStack()\n ->dir(\"web\")\n ->exec(\"chown -R $(whoami):{$group} .\")\n ->exec(\"find . -type d -exec chmod u=rwx,g=rx,o= '{}' \\;\")\n ->exec(\"find . -type f -exec chmod u=rw,g=r,o= '{}' \\;\")\n ->run();\n\n $this->taskExecStack()\n ->dir(\"web/sites\")\n ->exec(\"find . -type d -name files -exec chmod ug=rwx,o= '{}' \\;\")\n ->exec(\"for d in ./*/files; do find \\$d -type d -exec chmod ug=rwx,o= '{}' \\;; find \\$d -type f -exec chmod ug=rw,o= '{}' \\;; done\")\n ->run();\n\n }", "public static function uses_permissions(): bool;", "public function setDefaultPermissions()\n {\n $this->allow('guest', 'default_error');\n $this->allow('guest', 'default_uploader');\n $this->allow('guest', 'default_lang');\n $this->allow('guest', 'people_auth');\n $this->allow('guest', 'api_auth');\n $this->allow('guest', 'api_search');\n $this->allow('guest', 'api_company');\n $this->allow('guest', 'api_entidad');\n $this->allow('guest', 'frontend_index');\n $this->allow('guest', 'frontend_auth');\n $this->allow('guest', 'frontend_account');\n $this->allow('guest', 'frontend_auction');\n $this->allow('guest', 'frontend_search');\n $this->allow('guest', 'frontend_product');\n $this->allow('guest', 'frontend_page');\n /**\n * User Access Level Permissions\n */\n $this->allow('user', 'default_index');\n $this->allow('user', 'default_error');\n $this->allow('user', 'default_uploader');\n $this->allow('user', 'default_lang');\n $this->allow('user', 'people_auth');\n $this->allow('user', 'search_index');\n $this->allow('user', 'frontend_search');\n $this->allow('user', 'frontend_product');\n $this->allow('user', 'frontend_page');\n $this->allow('user', 'people_user', array(\n 'my', // View My Details Page\n 'view', // View User Details Page\n 'changepassword', // Change Password Page\n 'updateavatar', // Update Avatar Lightbox\n 'getavatar', // Get Avatar JSON Call\n 'get-addr-avatar','setavatar', // Set Avatar JSON Call\n 'removeavatar' // Remove Avatar JSON Call\n ));\n\n /* $this->allow('user', 'company_manage', array(\n 'index', // Company List Page\n 'view' // Company View Page\n ));*/\n }", "public function switch_OSF_PermissionsManagementTool($op = 'install', $pkgVersion = '')\n {\n // Get package info\n $pkgName = \"OSF Permissions Management Tool\";\n switch ($pkgVersion) {\n case 'dev':\n $pkgVersion = 'master';\n break;\n default:\n $pkgVersion = $this->permissions_management_tool_version;\n break;\n }\n $installPath = \"{$this->permissions_management_tool_folder}\";\n\n // Check operation mode\n switch ($op) {\n case 'install':\n $this->h2(\"Installing {$pkgName} {$pkgVersion}\");\n // Check if is installed\n if (is_dir(\"{$installPath}/\")) {\n $this->span(\"The package is already installed. Consider upgrading it with the option: --upgrade-osf-permissions-management-tool\", 'warn');\n return;\n }\n $this->install_OSF_PermissionsManagementTool($pkgVersion);\n $this->config_OSF_PermissionsManagementTool();\n break;\n case 'upgrade':\n $this->h2(\"Upgrading {$pkgName} {$pkgVersion}\");\n // Check if is not installed\n if (!is_dir(\"{$installPath}/\")) {\n $this->span(\"The package is not installed. Consider installing it with the option: --install-osf-permissions-management-tool\", 'warn');\n return;\n }\n $this->upgrade_OSF_PermissionsManagementTool($pkgVersion);\n break;\n case 'uninstall':\n $this->h2(\"Uninstalling {$pkgName} {$pkgVersion}\");\n // Check if is not installed\n if (!is_dir(\"{$installPath}/\")) {\n $this->span(\"The package is not installed. Nothing to do.\", 'warn');\n return;\n }\n $this->uninstall_OSF_PermissionsManagementTool($pkgVersion);\n break;\n case 'configure':\n $this->h2(\"Configuring {$pkgName} {$pkgVersion}\");\n // Check if is not installed\n if (!is_dir(\"{$installPath}/\")) {\n $this->span(\"The package is not installed. Consider installing it with the option: --install-osf-permissions-management-tool\", 'warn');\n return;\n }\n $this->config_OSF_PermissionsManagementTool($pkgVersion);\n break;\n default:\n $this->h2(\"{$pkgName} {$pkgVersion}\");\n $this->span(\"Wrong operation. Nothing to do.\", 'warn');\n return;\n break;\n }\n }", "public function setObjectPermissions(array $permissions): void;", "private function validateUpdate() {\n\t\t$this->context->checkPermission(\\Scrivo\\AccessController::WRITE_ACCESS);\n\t}", "function clean_project_permissions_cache($project) {\n \tclean_permissions_cache();\n }", "function install_acpperms()\n\t{\n\t\t//-----------------------------------------\n\t\t// INIT\n\t\t//-----------------------------------------\n\t\t\n\t\t$cur_perms = array();\n\t\t\n\t\t//-----------------------------------------\n\t\t// Get DB\n\t\t//-----------------------------------------\n\t\t\n\t\trequire_once( INS_KERNEL_PATH . 'class_db_' . $this->install->saved_data['sql_driver'] . '.php' );\t\t\n\t\t\n\t\t$this->install->ipsclass->init_db_connection( $this->install->saved_data['db_name'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t $this->install->saved_data['db_user'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t $this->install->saved_data['db_pass'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t $this->install->saved_data['db_host'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t $this->install->saved_data['db_pre'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t $this->install->ipsclass->vars['mysql_codepage'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t $this->install->saved_data['sql_driver'] );\n\t\t//-----------------------------------------\n\t\t// Install settings\n\t\t//-----------------------------------------\n\t\n\t\t$output[] = \"Создание прав доступа к АЦ...\";\n\t\t$xml = new class_xml();\n\t\t$xml->lite_parser = 1;\n\t\t\n\t\t$content = implode( \"\", file( INS_DOC_ROOT_PATH . 'resources/acpperms.xml' ) );\n\t\t$xml->xml_parse_document( $content );\n\t\t\n\t\t//-----------------------------------------\n\t\t// Loop through and sort out settings...\n\t\t//-----------------------------------------\n\n\t\tforeach( $xml->xml_array['permsexport']['permsgroup']['perm'] as $id => $entry )\n\t\t{\n\t\t\t//-----------------------------------------\n\t\t\t// Do we have a row matching this already?\n\t\t\t//-----------------------------------------\n\n\t\t\t$_perm_main = $entry['acpperm_main']['VALUE'];\n\t\t\t$_perm_child = $entry['acpperm_child']['VALUE'];\n\t\t\t$_perm_bit = $entry['acpperm_bit']['VALUE'];\n\n\t\t\t$_perm_key = $_perm_main.':'.$_perm_child.':'.$_perm_bit;\n\n\t\t\tif ( ! $cur_perms[ $_perm_key ] )\n\t\t\t{\n\t\t\t\t$this->install->ipsclass->DB->do_insert( 'admin_permission_keys', array( 'perm_key' => $_perm_key,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t\t\t\t 'perm_main' => $_perm_main,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t\t\t\t 'perm_child' => $_perm_child,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t\t\t\t 'perm_bit' => $_perm_bit ) );\n\n\t\t\t\t$inserted++;\n\t\t\t}\n\t\t}\n\t\t\n\t\t//-----------------------------------------\n\t\t// Next...\n\t\t//-----------------------------------------\n\t\t\n\t\t$this->install->template->append( $this->install->template->install_page_refresh( $output ) );\n\t\t$this->install->template->next_action = '?p=install&sub=templates';\n\t\t$this->install->template->hide_next = 1;\n\t}", "public function testPostUpdatePermissionKeys() {\n // Login using root user.\n $this->drupalLogin($this->rootUser);\n $this->drupalGet('admin/people/permissions');\n\n // Tests to ensure that before updates the permission keys are in camelcase.\n /** @var \\Drupal\\user\\RoleInterface $testfor2774143 */\n $testfor2774143 = Role::load('testfor2774143');\n $this->assertTrue($testfor2774143->hasPermission('administer EU Cookie Compliance popup'));\n $this->assertFalse($testfor2774143->hasPermission('administer eu cookie compliance popup'));\n /** @var \\Drupal\\user\\RoleInterface $secondtestfor2774143 */\n $secondtestfor2774143 = Role::load('secondtestfor2774143');\n $this->assertTrue($secondtestfor2774143->hasPermission('display EU Cookie Compliance popup'));\n $this->assertFalse($secondtestfor2774143->hasPermission('display eu cookie compliance popup'));\n\n $this->runUpdates();\n\n $this->drupalGet('admin/people/permissions');\n\n // Tests to ensure that after updates the permission keys are in lowercase.\n /** @var \\Drupal\\user\\RoleInterface $testfor2774143 */\n $testfor2774143 = Role::load('testfor2774143');\n $this->assertFalse($testfor2774143->hasPermission('administer EU Cookie Compliance popup'));\n $this->assertTrue($testfor2774143->hasPermission('administer eu cookie compliance popup'));\n /** @var \\Drupal\\user\\RoleInterface $secondtestfor2774143 */\n $secondtestfor2774143 = Role::load('secondtestfor2774143');\n $this->assertFalse($secondtestfor2774143->hasPermission('display EU Cookie Compliance popup'));\n $this->assertTrue($secondtestfor2774143->hasPermission('display eu cookie compliance popup'));\n }", "public function permisos(){\n \n $permisos =config('installer.folder_permissions');\n \n foreach ($permisos as $path => $perm) {\n $formData[] = [\n 'label' => 'Carpeta '.$path.' Permiso: '.$perm,\n 'check' => $this->checkFolderPermission($path,$perm)\n ];\n }\n \n return view('installer::permisos', compact('formData'));\n }", "public function attachPermissions($permissions, $reload = true);", "function update_access_allowed() {\n global $update_free_access, $user;\n\n // Allow the global variable in settings.php to override the access check.\n if (!empty($update_free_access)) {\n return TRUE;\n }\n // Calls to user_access() might fail during the Drupal 6 to 7 update process,\n // so we fall back on requiring that the user be logged in as user #1.\n try {\n require_once DRUPAL_ROOT . '/' . drupal_get_path('module', 'user') . '/user.module';\n return user_access('administer software updates');\n }\n catch (Exception $e) {\n return ($user->uid == 1);\n }\n}", "function update_access_allowed() {\n global $update_free_access, $user;\n\n // Allow the global variable in settings.php to override the access check.\n if (!empty($update_free_access)) {\n return TRUE;\n }\n // Calls to user_access() might fail during the Drupal 6 to 7 update process,\n // so we fall back on requiring that the user be logged in as user #1.\n try {\n require_once DRUPAL_ROOT . '/' . drupal_get_path('module', 'user') . '/user.module';\n return user_access('administer software updates');\n }\n catch (Exception $e) {\n return ($user->uid == 1);\n }\n}", "function hook_roomify_rights_alter(&$permissions) {\n // Remove permission 'access content' for anonymous users.\n unset($permissions['anonymous user']['access content']);\n}", "public function run()\n {\n App\\Role::find(1)->attachPermission(1);\n App\\Role::find(1)->attachPermission(2);\n App\\Role::find(1)->attachPermission(3);\n }", "public function updateFolderPermission($path, $permission) {\n $ret = chmod($path,$permission);\n\n if ($ret === true) {\n $oct = decoct($permission);\n $this->_log->log(LogLevel::info, \"Permissions set to {$oct} for: {$path}\\n\");\n } else {\n $this->_log->log(LogLevel::info, \"Permissions could not be set for: {$path}\\n\");\n }\n }", "function SettingsController_DefineAdminPermissions_Handler(&$Sender) {\n if (isset($Sender->RequiredAdminPermissions)) {\n $Sender->RequiredAdminPermissions[] = 'Vanilla.Settings.Manage';\n $Sender->RequiredAdminPermissions[] = 'Vanilla.Categories.Manage';\n $Sender->RequiredAdminPermissions[] = 'Vanilla.Spam.Manage';\n }\n }", "public function update($permiso);", "public function actionUpdate()\n {\n\t\t/**\n\t\t * @author \t: ptrnov <[email protected]>\n\t\t * @since \t\t: 1.2\n\t\t * Subject\t\t: PERMISSION PER MODUL.\n\t\t * Metode\t\t: PUT (Update)\n\t\t * URL\t\t\t: http://production.kontrolgampang.com/login/user-permissions\n\t\t * Body Param\t: ACCESS_ID (key),MODUL_ID (key), BTN_VIEW/BTN_CREATE/BTN_UPDATE/BTN_DELETE/STATUS.\n\t\t * Alert\t\t: {\"result\": \"ACCESS_ID-Empty\"}=> Field ACCESS_ID Param tidak ada.\n\t\t *\t\t\t\t {\"result\": \"User-Not-Exist\"}=> user tidak di temukan.\n\t\t */\n\t\t$paramsBody \t\t= Yii::$app->request->bodyParams;\n\t\t$accessId\t\t\t= isset($paramsBody['ACCESS_ID'])!=''?$paramsBody['ACCESS_ID']:'';\n\t\t$modulId\t\t\t= isset($paramsBody['MODUL_ID'])!=''?$paramsBody['MODUL_ID']:'';\n\t\t$btnView\t\t\t= isset($paramsBody['BTN_VIEW'])!=''?$paramsBody['BTN_VIEW']:'';\n\t\t$btnCreate\t\t\t= isset($paramsBody['BTN_CREATE'])!=''?$paramsBody['BTN_CREATE']:'';\n\t\t$btnUpdate\t\t\t= isset($paramsBody['BTN_UPDATE'])!=''?$paramsBody['BTN_UPDATE']:'';\n\t\t$btnDelete\t\t\t= isset($paramsBody['BTN_DELETE'])!=''?$paramsBody['BTN_DELETE']:'';\n\t\t$status\t\t\t\t= isset($paramsBody['STATUS'])!=''?$paramsBody['STATUS']:'';\n\t\t\n\t\tif($accessId){\n\t\t\t$cntUser= User::find()->where(['ACCESS_ID'=>$accessId])->count();\n\t\t\tif($cntUser){\n\t\t\t\t$modalPermission = AppModulPermission::find()->where(['ACCESS_ID'=>$accessId,'MODUL_ID'=>$modulId])->one();\n\t\t\t\tif ($btnView!=''){$modalPermission->BTN_VIEW=$btnView;};\n\t\t\t\tif ($btnCreate!=''){$modalPermission->BTN_CREATE=$btnCreate;};\n\t\t\t\tif ($btnUpdate!=''){$modalPermission->BTN_UPDATE=$btnUpdate;};\n\t\t\t\tif ($btnDelete!=''){$modalPermission->BTN_DELETE=$btnDelete;};\n\t\t\t\tif ($status!=''){$modalPermission->STATUS=$status;};\n\t\t\t\tif($modalPermission->save()){\n\t\t\t\t\t$modalView = AppModulPermission::find()->where(['ACCESS_ID'=>$accessId,'MODUL_ID'=>$modulId])->one();\n\t\t\t\t\treturn array('USER_PERMISSIONS'=>$modalView);\t\n\t\t\t\t}else{\n\t\t\t\t\treturn array('result'=>'permission-Not-Exist');\n\t\t\t\t}\t\t\t\t\n\t\t\t}else{\n\t\t\t\treturn array('result'=>'User-Not-Exist');\n\t\t\t}\n\t\t}else{\n\t\t\treturn array('result'=>'ACCESS_ID-Empty');\n\t\t}\n\t}", "function allowUpdate($allow){\n\t\t$this->canUpdate=$allow;\n\t}", "public function registerPermissions()\n {\n return []; // Remove this line to activate\n\n return [\n 'milo.food.some_permission' => [\n 'tab' => 'Food',\n 'label' => 'Some permission'\n ],\n ];\n }", "function edit_name_perm()\n\t{\n\t\t//-----------------------------------------\n\t\t// Check for legal ID\n\t\t//-----------------------------------------\n\n\t\tif ($this->ipsclass->input['id'] == \"\")\n\t\t{\n\t\t\t$this->ipsclass->admin->error(\"Нельзя изменить ID группы, попытайтесь снова\");\n\t\t}\n\n\t\tif ( $this->ipsclass->input['perm_name'] == \"\" )\n\t\t{\n\t\t\t$this->ipsclass->admin->error(\"Необходимо ввести имя\");\n\t\t}\n\n\t\t$gid = $this->ipsclass->input['id'];\n\n\t\t//-----------------------------------------\n\n\t\t$this->ipsclass->DB->simple_construct( array( 'select' => '*', 'from' => 'forum_perms', 'where' => \"perm_id=\".intval($this->ipsclass->input['id']) ) );\n\t\t$this->ipsclass->DB->simple_exec();\n\n\t\tif ( ! $gr = $this->ipsclass->DB->fetch_row() )\n\t\t{\n\t\t\t$this->ipsclass->admin->error(\"Не действительный ID группы\");\n\t\t}\n\n\t\t$this->ipsclass->DB->do_update( 'forum_perms', array( 'perm_name' => $this->ipsclass->input['perm_name'] ), 'perm_id='.intval($this->ipsclass->input['id']) );\n\n\t\t$this->ipsclass->admin->save_log(\"Права доступа на форум отредактированы для маски: '{$gr['perm_name']}'\");\n\n\t\t$this->ipsclass->main_msg = \"Permission Set Name Updated\";\n\n\t\t$this->forum_perms( );\n\t}", "public function permissions(Storable $storable, Acl $acl): void;", "protected function setupPermissions( $package, $gateway )\n {\n \n $request = $this->getRequest();\n \n $codeRoot = $gateway->getCodeRoot();\n \n $gwName = $gateway->getName();\n $gwSrc = $gateway->getSrc();\n \n $this->protocol->subHead( 'Setup Permissions Gw: '.$gwName );\n \n $codePermission = $gateway->getCodePermission();\n if( $codePermission )\n {\n Fs::setPermission( $codePermission, $this->protocol );\n }\n \n $permissions = $gateway->getCustomPermissions();\n foreach( $permissions as /* @var StructPermission $permission */ $permission )\n {\n Fs::setPermission( $permission, $this->protocol );\n }\n \n // fix the permissions\n $gwPermission = $gateway->getGwPermission();\n $gwEditPermissions = $gateway->getGwEditPermissions();\n \n if( $gwPermission )\n {\n Fs::setPermission( $gwPermission, $this->protocol );\n }\n \n foreach( $gwEditPermissions as $perm )\n {\n try \n {\n Fs::setPermission( $perm, $this->protocol );\n }\n catch( GaiaException $exc )\n {\n $this->protocol->warning( $exc->getMessage() );\n }\n }\n\n }", "function ProcessLibraryPermissions()\n {\n if ($this->debug_mode)\n echo $this->ClassName . \"::ProcessLibraryPermissions();\" . \"<HR>\";\n if ($this->listSettings->HasItem(\"MAIN\", \"DISABLED_DELETE\")) {\n $this->disabled_delete = $this->listSettings->GetItem(\"MAIN\", \"DISABLED_DELETE\");\n }\n else {\n $this->disabled_delete = 0;\n }\n if ($this->listSettings->HasItem(\"MAIN\", \"DISABLED_EDIT\")) {\n $this->disabled_edit = $this->listSettings->GetItem(\"MAIN\", \"DISABLED_EDIT\");\n }\n else {\n $this->disabled_edit = 0;\n }\n if ($this->listSettings->HasItem(\"MAIN\", \"DISABLED_ADD\")) {\n $this->disabled_add = $this->listSettings->GetItem(\"MAIN\", \"DISABLED_ADD\");\n }\n else {\n $this->disabled_add = 0;\n }\n if ($this->listSettings->HasItem(\"MAIN\", \"DISABLED_APPLY\")) {\n $this->disabled_apply = $this->listSettings->GetItem(\"MAIN\", \"DISABLED_APPLY\");\n }\n else {\n $this->disabled_apply = 0;\n }\n if ($this->listSettings->HasItem(\"MAIN\", \"DISABLED_COPY\")) {\n $this->disabled_copy = $this->listSettings->GetItem(\"MAIN\", \"DISABLED_COPY\");\n }\n else {\n $this->disabled_copy = 0;\n }\n\n if ($this->listSettings->HasItem(\"MAIN\", \"DISABLED_MOVE\")) {\n $this->disabled_move = $this->listSettings->GetItem(\"MAIN\", \"DISABLED_MOVE\");\n }\n else {\n $this->disabled_move = 1;\n }\n\n if (! $this->disabled_move) {\n if ($this->listSettings->HasItem(\"MAIN\", \"MOVE_FIELD\")) {\n $this->move_field = $this->listSettings->GetItem(\"MAIN\", \"MOVE_FIELD\");\n }\n else {\n if ($this->Storage->HasColumn(\"_priority\") !== false) {\n $this->move_field = \"_priority\";\n }\n else {\n $_inc_column = $this->Storage->GetIncrementalColumn();\n $this->move_field = $_inc_column[\"name\"];\n }\n }\n }\n\n if ($this->listSettings->HasItem(\"MAIN\", \"IS_READONLY\")) {\n $this->read_only = $this->listSettings->GetItem(\"MAIN\", \"IS_READONLY\");\n if ($this->read_only) {\n $this->disabled_delete = 1;\n $this->disabled_edit = 1;\n $this->disabled_add = 1;\n $this->disabled_move = 1;\n }\n }\n else {\n $this->read_only = 0;\n }\n\n }", "function hook_roomify_rights_group_alter(&$permissions) {\n // Remove permission 'add member' for group_manager users.\n unset($permissions['group_manager']['add member']);\n}", "public function canSetControllableAcl();", "private function loadPermissions(): void\n {\n $permissions = Cache::get($this->cacheKey());\n\n $this->isPayor = $permissions['isPayor'];\n $this->isAgencyBankAccountSetup = $permissions['isAgencyBankAccountSetup'];\n $this->canViewDocumentation = $permissions['canViewDocumentation'];\n }", "public function testPostPermissionsToResource_addsPermissionCorrectly() {\r\n $this->jc->putResource('/', $this->test_folder);\r\n $resource = JasperTestUtils::createImage($this->test_folder);\r\n $this->jc->putResource('', $resource, dirname(__FILE__).'/resources/pitbull.jpg');\r\n $resource = $this->jc->getResource($resource->getUriString());\r\n $joeuser = $this->jc->getUsers('joeuser');\r\n $perms = $this->jc->getPermissions($resource->getUriString());\r\n\r\n $perm = new Permission('32', $joeuser[0], $resource->getUriString());\r\n $perms[] = $perm;\r\n $this->jc->updatePermissions($resource->getUriString(), $perms);\r\n\r\n $updated_perms = $this->jc->getPermissions($resource->getUriString());\r\n\r\n $this->jc->deleteResource($this->test_folder->getUriString());\r\n\r\n $this->assertEquals(sizeof($perms), sizeof($updated_perms));\r\n $this->assertEquals($perm->getPermissionMask(), $updated_perms[count($updated_perms)-1]->getPermissionMask());\r\n $this->assertEquals($perm->getPermissionRecipient(), $updated_perms[count($updated_perms)-1]->getPermissionRecipient());\r\n }", "protected function setupPermissionFields()\n {\n $tab = 'Permission';\n\n// $form->appendField(new Field\\Checkbox(\\Bs\\Db\\Permission::MANAGE_STAFF))->setLabel('Manage Staff')->setTabGroup($tab)\n// ->setNotes('Add/Edit Staff user accounts');\n// $form->appendField(new Field\\Checkbox(\\Bs\\Db\\Permission::MANAGE_STUDENT))->setLabel('Manage Students')->setTabGroup($tab)\n// ->setNotes('Add/Edit Student user accounts');\n// $form->appendField(new Field\\Checkbox(\\Bs\\Db\\Permission::MANAGE_SUBJECT))->setLabel('Manage Subjects')->setTabGroup($tab)\n// ->setNotes('Add/Edit subject and student enrollments');\n }", "protected function getDefaultPermissions(): int\n {\n return 0666;\n }", "public function run()\n {\n $this->createPermission();\n// $this->removePermission();\n }", "function update_preferences ($req)\n {\n global $fm_config, $logmessage;\n \n $home_folder = '';\n if (!empty($req['preferences_homefolder_prepend'])) $home_folder .= $req['preferences_homefolder_prepend'];\n if (!empty($req['preferences_homefolder'])) $home_folder .= '/'.$req['preferences_homefolder'];\n $home_folder = validate_folder($home_folder);\n if (empty($home_folder)) $home_folder = $_SESSION['fileman_allowtree'][0];\n $fm_config['HOME_FOLDER']=$home_folder;\n \n if (!empty($req['preferences_sortorder']) && in_array($req['preferences_sortorder'], array('nametype', 'name', 'sizetype', 'size', 'type')))\n {\n $preferences_sortorder = $req['preferences_sortorder'];\n }\n else\n {\n $preferences_sortorder = DEFAULT_SORT_ORDER;\n }\n $fm_config['SORT_ORDER']=$preferences_sortorder;\n\n //SIZE_UINT\n if (!empty($req['preferences_sizeunit']) && in_array($req['preferences_sizeunit'], array('b', 'kb', 'mb')))\n {\n $preferences_sizeunit = $req['preferences_sizeunit'];\n }\n else\n {\n $preferences_sizeunit = DEFAULT_SIZE_UNIT;\n }\n $fm_config['SIZE_UNIT']=$preferences_sizeunit;\n \n //FOLDER_SIZES\n if (!empty($req['preferences_dirdu']) && in_array($req['preferences_dirdu'], array('enabled', 'disabled')))\n {\n $preferences_dirdu = $req['preferences_dirdu'];\n }\n else\n {\n $preferences_dirdu = DEFAULT_FOLDER_SIZES;\n }\n $fm_config['FOLDER_SIZES']=$preferences_dirdu;\n \n //FILE_MASK\n if (is_numeric($req['preferences_fileumask']))\n {\n $preferences_fileumask = $req['preferences_fileumask'];\n }\n elseif (is_numeric($req['preferences_fileumask_custom']))\n {\n $preferences_fileumask = $req['preferences_fileumask_custom'];\n }\n else\n {\n $preferences_fileumask = 'n/a';\n }\n while (strlen($preferences_fileumask)<3) $preferences_fileumask='0'.$preferences_fileumask;\n //print ($preferences_fileumask);\n \n if (preg_match('/^\\d\\d\\d$/', $preferences_fileumask))\n {\n $preferences_fileumask = $preferences_fileumask[0]*64 + $preferences_fileumask[1]*8 + $preferences_fileumask[2];\n }\n else\n {\n $preferences_fileumask = DEFAULT_FILE_UMASK;\n }\n $fm_config['DEFAULT_FILE_UMASK']=$preferences_fileumask;\n \n //DIR_MASK\n //preferences_dirumask\n if (is_numeric($req['preferences_dirumask']))\n {\n $preferences_dirumask = $req['preferences_dirumask'];\n }\n elseif (is_numeric($req['preferences_dirumask_custom']))\n {\n $preferences_dirumask = $req['preferences_dirumask_custom'];\n }\n else\n {\n $preferences_dirumask = 'n/a';\n }\n while (strlen($preferences_dirumask)<3) $preferences_dirumask='0'.$preferences_dirumask;\n \n if (preg_match('/^\\d\\d\\d$/', $preferences_dirumask))\n {\n $preferences_dirumask = $preferences_dirumask[0]*64 + $preferences_dirumask[1]*8 + $preferences_dirumask[2];\n }\n else\n {\n $preferences_dirumask = DEFAULT_DIR_UMASK;\n }\n //print ($preferences_dirumask);\n $fm_config['DEFAULT_DIR_UMASK']=$preferences_dirumask;\n \n //EDITOR_MAX_SIZE\n if (!empty($req['preferences_editormaxsize']) && is_numeric($req['preferences_editormaxsize']))\n {\n $preferences_editormaxsize = $req['preferences_editormaxsize'];\n if ($preferences_editormaxsize<5000) $preferences_editormaxsize = 5000;\n if ($preferences_editormaxsize>655360) $preferences_editormaxsize = 655360; //640K\n }\n else\n {\n $preferences_editormaxsize = EDITOR_MAX_SIZE;\n }\n $fm_config['EDITOR_MAX_SIZE']=$preferences_editormaxsize;\n \n //ARCHIVE_FORMAT\n if (!empty($req['preferences_downloadformat']) && in_array($req['preferences_downloadformat'], array('zip', 'tar', 'tar.gz', 'tar.bz2')))\n {\n $preferences_downloadformat = $req['preferences_downloadformat'];\n }\n else\n {\n $preferences_downloadformat = DEFAULT_ARCHIVE_FORMAT;\n }\n $fm_config['ARCHIVE_FORMAT']=$preferences_downloadformat;\n \n //MULTI_UPLOAD\n if (!empty($req['preferences_uploadslots']) && is_numeric($req['preferences_uploadslots']))\n {\n $preferences_uploadslots = $req['preferences_uploadslots'];\n if ($preferences_uploadslots<3) $preferences_uploadslots = 3;\n if ($preferences_uploadslots>30) $preferences_uploadslots = 30; //640K\n }\n else\n {\n $preferences_uploadslots = DEFAULT_UPLOAD_SLOTS;\n }\n $fm_config['MULTI_UPLOAD']=$preferences_uploadslots;\n \n $_SESSION['fileman_config']=$fm_config;\n \n return true;\n }", "public function setPermissions()\n\t{\n\t\treturn [\n\t\t\t'product.create',\n\t\t 'issue.create',\n\t\t 'issue.edit'\n\t\t];\n\t}", "public function procMenuAdminUpdateAuth()\n\t{\n\t\t$menuItemSrl = Context::get('menu_item_srl');\n\t\t$exposure = Context::get('exposure');\n\t\t$htPerm = Context::get('htPerm');\n\n\t\t$oMenuModel = getAdminModel('menu');\n\t\t$itemInfo = $oMenuModel->getMenuItemInfo($menuItemSrl);\n\t\t$args = $itemInfo;\n\n\t\t// Menu Exposure update\n\t\t// if exposure target is only login user...\n\t\tif(!$exposure)\n\t\t{\n\t\t\t$args->group_srls = '';\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$exposure = explode(',', $exposure);\n\t\t\tif(in_array($exposure, array('-1','-3')))\n\t\t\t{\n\t\t\t\t$args->group_srls = $exposure;\n\t\t\t}\n\n\t\t\tif($exposure) $args->group_srls = implode(',', $exposure);\n\t\t}\n\n\t\t$output = executeQuery('menu.updateMenuItem', $args);\n\t\tif(!$output->toBool())\n\t\t{\n\t\t\treturn $output;\n\t\t}\n\n\t\t// Module Access update\n\t\tunset($args);\n\t\t$oMenuAdminModel = getAdminModel('menu');\n\t\t$menuInfo = $oMenuAdminModel->getMenu($itemInfo->menu_srl);\n\n\t\t$oModuleModel = getModel('module');\n\t\t$moduleInfo = $oModuleModel->getModuleInfoByMid($itemInfo->url, $menuInfo->site_srl);\n\n\t\t$xml_info = $oModuleModel->getModuleActionXML($moduleInfo->module);\n\n\t\t$grantList = $xml_info->grant;\n\t\tif(!$grantList) $grantList = new stdClass;\n\n\t\t$grantList->access = new stdClass();\n\t\t$grantList->access->default = 'guest';\n\t\t$grantList->manager = new stdClass();\n\t\t$grantList->manager->default = 'manager';\n\n\t\t$grant = new stdClass;\n\t\tforeach($grantList AS $grantName=>$grantInfo)\n\t\t{\n\t\t\tif(!$htPerm[$grantName])\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$htPerm[$grantName] = explode(',', $htPerm[$grantName]);\n\n\t\t\t// users in a particular group\n\t\t\tif(is_array($htPerm[$grantName]))\n\t\t\t{\n\t\t\t\t$grant->{$grantName} = $htPerm[$grantName];\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t// -1 = Log-in user only, -2 = site members only, 0 = all users\n\t\t\telse\n\t\t\t{\n\t\t\t\t$grant->{$grantName}[] = $htPerm[$grantName];\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$grant->{$group_srls} = array();\n\t\t}\n\n\t\tif(count($grant))\n\t\t{\n\t\t\t$oModuleController = getController('module');\n\t\t\t$oModuleController->insertModuleGrants($moduleInfo->module_srl, $grant);\n\t\t}\n\n\t\t// recreate menu cache file\n\t\t$this->makeXmlFile($itemInfo->menu_srl);\n\t}" ]
[ "0.685086", "0.6643186", "0.65937537", "0.62557334", "0.61091924", "0.6047599", "0.6001417", "0.595264", "0.59489715", "0.5849822", "0.58387226", "0.5790018", "0.5735801", "0.57334685", "0.5728764", "0.57051873", "0.56894743", "0.56836206", "0.5644883", "0.5618109", "0.55946773", "0.55544674", "0.55544674", "0.55544674", "0.55544674", "0.55544674", "0.554671", "0.5506518", "0.54361963", "0.54150355", "0.54077953", "0.54028875", "0.53956103", "0.5375598", "0.5369245", "0.5364521", "0.533595", "0.53200537", "0.53172374", "0.5313408", "0.5312437", "0.53080475", "0.53058326", "0.5300398", "0.5300101", "0.527405", "0.5273534", "0.52639186", "0.5259122", "0.52451116", "0.52363056", "0.52181846", "0.52096325", "0.5194395", "0.519395", "0.51928896", "0.5188309", "0.5187717", "0.5173714", "0.5158337", "0.51517415", "0.5143521", "0.5143053", "0.51372826", "0.51315683", "0.5130335", "0.51290673", "0.5120487", "0.5097397", "0.5097373", "0.5095216", "0.50894195", "0.5079902", "0.50787586", "0.50766975", "0.5071876", "0.5069664", "0.5069664", "0.50653476", "0.5060213", "0.50570893", "0.50475353", "0.5045605", "0.5045314", "0.5036769", "0.50283086", "0.5021039", "0.50202864", "0.5020175", "0.5020045", "0.5014975", "0.5014948", "0.5012713", "0.50089365", "0.5005402", "0.5002482", "0.49969792", "0.49965227", "0.49958673", "0.4994396" ]
0.67591196
1
Creating new appointment. Can't add multiple appointments on same day with same doctor
public function store(Request $request) { $user=auth()->user(); $doctor=Doctor::find($request->doctor); $patient=Patient::find($user->foreign_id); $date=$request->input('date'); if(Appointment::where(['date'=>$date,'doc_id'=>$doctor->doc_id, 'patient_id'=>$patient->patient_id])->count()>0) return redirect('dashboard')->with('failure','You already have an appointment on that day with '.$doctor->name); $serialNo=Appointment::where(['date'=>$date,'doc_id'=>$doctor->doc_id])->max('serial_no'); if(!$serialNo) $serialNo=1; else $serialNo++; $appointment=new Appointment; $appointment->date=$date; $appointment->serial_no=$serialNo; $appointment->doc_id=$doctor->doc_id; $appointment->patient_id=$patient->patient_id; $appointment->save(); return redirect('dashboard')->with('success','Appointment Added!'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function add_appointment(){\n $data = array(\n 'appointmentID' => $this->randomString_appointmentID(),\n 'counsellingID' => $this->input->post('counsellingID'),\n 'clientID' => $this->input->post('clientID'),\n 'psyID' => $this->input->post('psyID'),\n 'date' => $this->input->post('date'), //need to take care of, because the type is date\n 'time' => $this->input->post('time'),\n 'status' => $this->input->post('status')\n );\n\n $this->db->insert('appointment', $data);\n\t\treturn ($this->db->affected_rows() > 0); /* if success return true, false otherwise */\n }", "public function newappointment(){\n $appointments_table = TableRegistry::get('Appointments');\n $users_table = TableRegistry::get('Users');\n $appointment = $appointments_table->newEntity();\n if ($this->request->is('post')) {\n $appointment_time = $this->request->getData('appointment_time');\n $appointment_date = $this->request->getData('appointment_date');\n $time = $appointment_date.' '.$appointment_time;\n $appointment = $appointments_table->patchEntity($appointment, $this->request->getData());\n $appointment->appointment_date = date('Y-m-d H:i A', strtotime($time));\n $appointment->user_id = $this->Auth->user('id');\n if ( $appointments_table->save($appointment)) {\n //log what just happened\n $userscontroller = new UsersController();\n $ip = $userscontroller->get_client_ip();\n $userscontroller->makeLog('Scheduled Appointment', $this->Auth->user('id'), 'Doctor scheduled an appointment', $ip, 'Add');\n $this->Flash->success(__('The appointment has been saved.'));\n\n return $this->redirect(['action' => 'viewappointments']);\n }\n $this->Flash->error(__('The appointment could not be saved. Please, try again.'));\n }\n $doctors = $users_table->find('list', ['limit' => 200])->where(['role_id'=>2]);\n $patients = $appointments_table->Patients->find('list', ['limit' => 200]);\n $this->set(compact('appointment', 'doctors', 'patients'));\n \n \n $this->viewBuilder()->setLayout('backend');\n }", "public function addAppointment(){\n\t\t$cameras = Camera::all();\n\n\t\tforeach($cameras as $camera){\n\t\t\t$cameraAppointment = new CameraAppointment;\n\t\t\t$cameraAppointment->Date_Taken = date(\"Y-m-d H:i:j\", strtotime(Input::get('Date_Taken')));\n\t\t\t$cameraAppointment->Camera_ID = $camera->ID;\n\t\t\t$cameraAppointment->Interval = Input::get('Interval');\n\t\t\t$cameraAppointment->save();\n\t\t}\n\n\t\treturn Redirect::to('/');\n\t}", "public function actionCreate()\n {\n $model = new Appointment();\n $model->creator_id = Yii::$app->user->identity->id;\n\n if ($model->load(Yii::$app->request->post()) && $model->validate() && $model->save()) {\n DoctorPatientPivot::createNewRecordIfNotExist($model->doctor_id, $model->patient_id);\n NursePatientPivot::createNewRecordIfNotExist($model->nurse_id, $model->patient_id);\n Yii::$app->session->addFlash( 'success', Yii::t('auth', 'You have successfully create Appointment №:'\n . $model->id .' for patient: ' . Patient::findOne($model->patient_id)->name )\n );\n $this->redirect('index');\n } else {\n return $this->render('create', [\n 'model' => $model,\n 'patientsList' => Patient::getPatientsListDropDown(),\n 'doctorsList' => Doctor::getDoctorsListDropDown(),\n 'nursesList' => Nurse::getNursesListDropDown(),\n 'statusesList' => Appointment::STATUSES_ARRAY,\n 'createFromPatient' => false,\n 'createFromDoctor' => false,\n 'createFromNurse' => false\n ]);\n }\n }", "public function store(Request $request)\n {\n $end_time_arr = explode(\" \", $request->input('endtime'));\n $endtime = $end_time_arr[0]; $format = $end_time_arr[1];\n $endtime = explode(\":\", $endtime);\n $hr = $endtime[0]; $min = $endtime[1];\n if($format == \"PM\")\n {\n $hr = 12 + (int)$hr;\n }\n $endtime = implode(\":\", array($hr, $min));\n $enddatetime = array($request->input('enddate'), strval($endtime));\n $enddatetime = implode(\" \", $enddatetime);\n\n $start_time_arr = explode(\" \", $request->input('starttime'));\n $starttime = $start_time_arr[0]; $format = $start_time_arr[1];\n $starttime = explode(\":\", $starttime);\n $hr = $starttime[0]; $min = $starttime[1];\n if($format == \"PM\")\n {\n $hr = 12 + (int)$hr;\n }\n $starttime = implode(\":\", array($hr, $min));\n $startdatetime = array($request->input('startdate'), strval($starttime));\n $startdatetime = implode(\" \", $startdatetime);\n $patient = $request->patient;\n $nurse = $request->nurse;\n $physician = $request->physician;\n $appointment = new Appointment;\n $appointment->examinationroom = $request->input('exaroom');\n $appointment->start_date_time = $startdatetime;\n $appointment->end_date_time = $enddatetime;\n $appointment->patient_id = $patient;\n $appointment->nurse_id = $nurse;\n $appointment->physician_id = $physician;\n $appointment->save();\n $appointment->patient->status = 'curing';\n $appointment->push();\n\n //Redirect\n return redirect()->route('appointments.index')->with('status', 'stored');\n }", "public function store(Request $request)\n {\n// dd($request);\n $request->validate([\n 'patient_id' => 'required',\n 'doctor_id' => 'required',\n 'doctor_schedule_id' => 'required',\n 'time' => 'required',\n 'type' => 'required',\n 'description' => 'required'\n ]);\n $appointmentNumber = sprintf(\"%03u-%s-%s\", $request->doctor_id, $request->date, $request->time);\n $oldApp = Appointment::where('appointment_number',$appointmentNumber)->where('status',0)->get();\n if ($oldApp->count() > 0){\n return back()->with('warning','You have already booked Appoitment for the selected date and time');\n }\n // dd($appointmentNumber);\n $data = [\n 'doctor_id' => $request->doctor_id,\n 'patient_id' => $request->patient_id,\n 'doctor_schedule_id' => $request->doctor_schedule_id,\n 'appointment_number' => $appointmentNumber,\n 'reason' => $request->description,\n 'time' => $request->time,\n 'type' => $request->type,\n ];\n // dd($data);\n $newApp = Appointment::create($data);\n $notification = [\n 'message' => 'appointment Has Been Created',\n 'date' => $request->date,\n 'time' => $request->time,\n 'patient' => $newApp->patient->name,\n 'doctor' => $newApp->doctor->name,\n ];\n\n if (isset($request->referral)) {\n $newApp->update(['referred_from' => $request->referral]);\n Appointment::findOrFail($request->referral)->update(['status' => 2, 'referred_to' => $newApp->id]);\n $notification['message'] = 'Appointment Referred';\n $newApp->patient->user->notify(new AppointmentNotification($notification));\n $newApp->doctor->user->notify(new AppointmentNotification($notification));\n return back()->with('success', 'Referred to another doctor successfully');\n }\n $newApp->patient->user->notify(new AppointmentNotification($notification));\n $newApp->doctor->user->notify(new AppointmentNotification($notification));\n if (isset($request->payment) && $request->payment == 'true'){\n $newApp->update(['isPaid'=>true]);\n Payment::create([\n 'appointment_id' => $newApp->id,\n 'amount' => $newApp->doctor->fees\n ]);\n }\n if ($newApp->type == 'Video'){\n $newApp->update(['meeting_link'=>$request->meeting_link]);\n }\n return back()->with('success', 'Appointment Created Successfully');\n // dd($request);\n }", "public function actionCreate() {\n $model = new Bookings();\n\n $model->load(Yii::$app->request->post());\n $query = Bookings::find()\n ->andWhere(['patients_id' => $model->patients_id])\n ->andWhere(['date' => $model->date])->one();\n\n\n if (!empty($query->doctors_id)) {\n Yii::$app->session->setFlash('error', 'You already have an appointment on this date');\n return $this->redirect(['view', 'id' => $query->id]);\n }\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n\n// $model->time = Yii::$app->formatter->\n// asDate($_POST['hours'].$_POST['minutes'], 'HH:mm');\n\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "function createAppointment(){\n\t\t\t$query = \"INSERT INTO appointment set appTime=?, custId=?\";\n\t\t\t$stmt = $this->conn->prepare($query);\n\t\t\t// $stmt->bindparam(1, $this->serviceType);\n\t\t\t// $stmt->bindparam(2, $this->serviceName);\n\t\t\t// $stmt->bindparam(3, $this->appDate);\n\t\t\t$stmt->bindparam(1, $this->appTime);\n\t\t\t$stmt->bindparam(2, $_SESSION['username']);\n\n\t\t\tif($stmt->execute()){\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\telse{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}", "public function actionCreateappointment(): bool\n {\n $request = Yii::$app->request;\n \n if ($request->isPost) { \n $appointment = new Appointments;\n $appointment->client_id = $request->post('user_id');\n $appointment->service_id = $request->post('service_id');\n $appointment->date = substr(str_replace('T', ' ', $request->post('date')), 0, 18);\n $appointment->status = Appointments::STATUS_ACTIVE;\n\n return ($appointment->save()) ? true : false;\n }\n \n return false;\n }", "public function store(Request $request)\n {\n $the_apt_date= ($request->apt_date.\" \".$request->apt_time);\n $date= Carbon::parse($the_apt_date)->format('Y-m-d H:i:s');\n\n $now=Carbon::now();\n if($date>=$now){\n\n $date0= Carbon::parse($date);\n $date_end1=$date0->addHour(1);\n\n $p_id= $request->patient_id;\n $d_id= $request->doctor;\n\n if($p_id!=null && $d_id!=null){\n if($request->apt_time==null ){\n return redirect()->back()->with(\"warning\",\"Saat bilgisi alınamadı. Lütfen tekrar deneyiniz!\");\n }\n if($request->apt_date==null ){\n return redirect()->back()->with(\"warning\",\"Tarih bilgisi alınamadı. Lütfen tekrar deneyiniz!\");\n }\n\n $chk_if_exist= Appointments::where(['patients_id'=>$p_id,'doctors_id'=>$d_id])->where('apt_date',\"=\",$date)->first();\n if($chk_if_exist==null){\n Appointments::create([\n 'patients_id' => $p_id,\n 'doctors_id' => $d_id,\n 'apt_date' => $date,\n 'apt_date_end' => $date_end1,\n 'apt_time' => $request->apt_time,\n 'apt_status' => $request->apt_status,\n ]);\n\n return redirect()->back()->with('success','Randevu Kaydı Başarıyla Yapılmıştır');\n }else{\n return redirect()->back()->with('warning','Bu Hasta İçin, Aynı Tarihte Zaten Bir Randevu Kaydı Açılmıştır. ');\n }\n }else{\n return redirect()->back()->with('warning', 'Lütfen Geçerli Bir Hasta Adı Seçiniz.');\n }\n }else{\n\n return redirect()->back()->with('warning','Geçmiş Bir Tarih İçin Randevu Alınamaz.');\n }\n\n }", "public function addAppointment($id){\n try{\n \n \n $sql = 'INSERT INTO `appointments` (dateHour, idPatients) VALUE (:dateHour , :idPatients);';\n $sth = $this->_pdo->prepare($sql);\n $sth->bindValue(':idPatients',$id, PDO::PARAM_INT);\n $sth->bindValue(':dateHour', $this->_dateHour, PDO::PARAM_STR);\n \n $appoint = $sth->execute();\n \n return $appoint;\n\n }catch(PDOException $e) {\n echo 'Connexion échouée : ' . $e->getMessage();\n return false;\n } \n }", "public function book_appointment(Request $request)\n {\n $booking = array(\n 'patient_id' => Auth::user()->id,\n 'doctor_id' => $request->id,\n 'status' => '0',\n 'details' => $request->details,\n 'appointment' => $request->datetime\n );\n $id = DB::table('appointments')->insertGetId($booking);\n \n return redirect('/patient');\n }", "public function store(CreateAppointmentRequest $request)\n {\n return $this->makeAppointment($request);\n }", "public function actionCreate()\n {\n $model = new TabelAppointment();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id_appointment]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function validate_date()\n {\n if( is_null( $this->participant_id ) )\n throw lib::create( 'exception\\runtime',\n 'Cannot validate appointment date, participant id is not set.', __METHOD__ );\n\n $db_participant = lib::create( 'database\\participant', $this->participant_id );\n $db_site = $db_participant->get_primary_site();\n if( is_null( $db_site ) )\n throw lib::create( 'exception\\runtime',\n 'Cannot validate an appointment date, participant has no primary address.', __METHOD__ );\n \n $shift_template_class_name = lib::get_class_name( 'database\\shift_template' );\n $shift_class_name = lib::get_class_name( 'database\\shift' );\n\n // determine the full and half appointment intervals\n $setting_manager = lib::create( 'business\\setting_manager' );\n $half_duration = $setting_manager->get_setting( 'appointment', 'half duration' );\n $full_duration = $setting_manager->get_setting( 'appointment', 'full duration' );\n\n $start_datetime_obj = util::get_datetime_object( $this->datetime );\n $next_day_datetime_obj = clone $start_datetime_obj;\n $next_day_datetime_obj->add( new\\DateInterval( 'P1D' ) );\n $end_datetime_obj = clone $start_datetime_obj;\n $duration = 'full' == $this->type ? $full_duration : $half_duration;\n $end_datetime_obj->add( new \\DateInterval( sprintf( 'PT%dM', $duration ) ) );\n\n // determine whether to test for shifts or shift templates on the appointment day\n $modifier = lib::create( 'database\\modifier' );\n $modifier->where( 'site_id', '=', $db_site->id );\n $modifier->where( 'start_datetime', '>=', $start_datetime_obj->format( 'Y-m-d' ) );\n $modifier->where( 'start_datetime', '<', $next_day_datetime_obj->format( 'Y-m-d' ) );\n\n $diffs = array();\n\n if( 0 == $shift_class_name::count( $modifier ) )\n { // determine slots using shift template\n $modifier = lib::create( 'database\\modifier' );\n $modifier->where( 'site_id', '=', $db_site->id );\n $modifier->where( 'start_date', '<=', $start_datetime_obj->format( 'Y-m-d' ) );\n foreach( $shift_template_class_name::select( $modifier ) as $db_shift_template )\n {\n if( $db_shift_template->match_date( $start_datetime_obj->format( 'Y-m-d' ) ) )\n {\n $start_time_as_int =\n intval( preg_replace( '/[^0-9]/', '',\n substr( $db_shift_template->start_time, 0, -3 ) ) );\n if( !array_key_exists( $start_time_as_int, $diffs ) ) $diffs[$start_time_as_int] = 0;\n $diffs[$start_time_as_int] += $db_shift_template->operators;\n\n $end_time_as_int =\n intval( preg_replace( '/[^0-9]/', '',\n substr( $db_shift_template->end_time, 0, -3 ) ) );\n if( !array_key_exists( $end_time_as_int, $diffs ) ) $diffs[$end_time_as_int] = 0;\n $diffs[$end_time_as_int] -= $db_shift_template->operators;\n }\n }\n }\n else // determine slots using shifts\n {\n $modifier = lib::create( 'database\\modifier' );\n $modifier->where( 'site_id', '=', $db_site->id );\n $modifier->where( 'start_datetime', '<', $end_datetime_obj->format( 'Y-m-d H:i:s' ) );\n $modifier->where( 'end_datetime', '>', $start_datetime_obj->format( 'Y-m-d H:i:s' ) );\n foreach( $shift_class_name::select( $modifier ) as $db_shift )\n {\n $start_time_as_int =\n intval( preg_replace( '/[^0-9]/', '',\n substr( $db_shift->start_datetime, -8, -3 ) ) );\n $end_time_as_int =\n intval( preg_replace( '/[^0-9]/', '',\n substr( $db_shift->end_datetime, -8, -3 ) ) );\n\n if( !array_key_exists( $start_time_as_int, $diffs ) ) $diffs[$start_time_as_int] = 0;\n $diffs[$start_time_as_int]++;\n if( !array_key_exists( $end_time_as_int, $diffs ) ) $diffs[$end_time_as_int] = 0;\n $diffs[$end_time_as_int]--;\n }\n }\n \n // and how many appointments are during this time?\n $modifier = lib::create( 'database\\modifier' );\n $modifier->where( 'datetime', '>=', $start_datetime_obj->format( 'Y-m-d' ) );\n $modifier->where( 'datetime', '<', $next_day_datetime_obj->format( 'Y-m-d' ) );\n if( !is_null( $this->id ) ) $modifier->where( 'appointment.id', '!=', $this->id );\n $appointment_class_name = lib::get_class_name( 'database\\appointment' );\n foreach( $appointment_class_name::select_for_site( $db_site, $modifier ) as $db_appointment )\n {\n $state = $db_appointment->get_state();\n if( 'reached' != $state && 'not reached' != $state )\n { // incomplete appointments only\n $appointment_datetime_obj = util::get_datetime_object( $db_appointment->datetime );\n \n $start_time_as_int = intval( $appointment_datetime_obj->format( 'Gi' ) );\n \n $duration = 'full' == $db_appointment->type ? $full_duration : $half_duration;\n $appointment_datetime_obj->add( new \\DateInterval( sprintf( 'PT%dM', $duration ) ) );\n $end_time_as_int = intval( $appointment_datetime_obj->format( 'Gi' ) );\n \n if( !array_key_exists( $start_time_as_int, $diffs ) ) $diffs[ $start_time_as_int ] = 0;\n $diffs[ $start_time_as_int ]--;\n if( !array_key_exists( $end_time_as_int, $diffs ) ) $diffs[ $end_time_as_int ] = 0;\n $diffs[ $end_time_as_int ]++;\n }\n }\n \n // if we have no diffs on this day, then we have no slots\n if( 0 == count( $diffs ) ) return false;\n\n // use the 'diff' arrays to define the 'times' array\n $times = array();\n ksort( $diffs );\n $num_operators = 0;\n foreach( $diffs as $time => $diff )\n {\n $num_operators += $diff;\n $times[$time] = $num_operators;\n }\n\n // end day with no operators (4800 is used because it is long after the end of the day)\n $times[4800] = 0;\n \n // Now search the times array for any 0's inside the appointment time\n // NOTE: we need to include the time immediately prior to the appointment start time\n $start_time_as_int = intval( $start_datetime_obj->format( 'Gi' ) );\n $end_time_as_int = intval( $end_datetime_obj->format( 'Gi' ) );\n $match = false;\n $last_slots = 0;\n $last_time = 0;\n\n foreach( $times as $time => $slots )\n {\n // check the start time\n if( $last_time <= $start_time_as_int &&\n $time > $start_time_as_int &&\n 1 > $last_slots ) return false;\n\n // check the end time\n if( $last_time < $end_time_as_int &&\n $time >= $end_time_as_int &&\n 1 > $last_slots ) return false;\n\n $last_slots = $slots;\n $last_time = $time;\n }\n \n return true;\n }", "public function run()\n {\n DB::table('appointments')->insert([\n 'nameCustomer' => 'Francisco',\n 'emailCustomer' => '[email protected]',\n 'telephoneCustomer' => '9985043136',\n 'date' => date('Y-m-d', time()), \n 'time' => date('H:i:s', mktime(7,30,0)),\n 'companyId' => 1,\n 'branchOfficeId' => 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 DB::table('appointments')->insert([\n 'nameCustomer' => 'Eduardo',\n 'emailCustomer' => '[email protected]',\n 'telephoneCustomer' => '9994994199',\n 'date' => date('Y-m-d', time()), \n 'time' => date('H:i:s', mktime(8,0,0)),\n 'companyId' => 1,\n 'branchOfficeId' => 2,\n 'created_at' => date('Y-m-d H:i:s', time()),\n 'updated_at' => date('Y-m-d H:i:s', time())\n ]);\n DB::table('appointments')->insert([\n 'nameCustomer' => 'Maria',\n 'emailCustomer' => '[email protected]',\n 'telephoneCustomer' => '9987340321',\n 'date' => date('Y-m-d', time()), \n 'time' => date('H:i:s', mktime(7,30,0)),\n 'companyId' => 2,\n 'branchOfficeId' => 3,\n 'created_at' => date('Y-m-d H:i:s', time()),\n 'updated_at' => date('Y-m-d H:i:s', time())\n ]);\n DB::table('appointments')->insert([\n 'nameCustomer' => 'Rosa',\n 'emailCustomer' => '[email protected]',\n 'telephoneCustomer' => '9981228714',\n 'date' => date('Y-m-d', time()), \n 'time' => date('H:i:s', mktime(8,0,0)),\n 'companyId' => 2,\n 'branchOfficeId' => 4,\n 'created_at' => date('Y-m-d H:i:s', time()),\n 'updated_at' => date('Y-m-d H:i:s', time())\n ]);\n }", "public function created(Appointment $appointment)\n {\n $appointment->saveToHistory();\n }", "public function store(AppointmentCreateRequest $request)\n {\n return $this->repository->save($request);\n }", "public function store(Request $request)\n {\n $this->validate($request, [\n 'service_id' => 'required',\n 'doctor' => 'required',\n 'start_date' => 'required|date',\n 'end_date' => 'required|date',\n ]);\n\n DB::beginTransaction();\n try {\n $appointment = Appointment::create([\n 'service_id' => $request->service_id,\n 'doctor_id' => $request->doctor,\n 'start_date' => Carbon::parse($request->start_date),\n 'end_date' => Carbon::parse($request->end_date),\n ]);\n\n $patient = Patient::find(Auth::user()->id);\n\n $appointment->patients()->attach($patient);\n\n DB::commit();\n return response()->json(['success' => true, 'appointment_id' => $appointment->id]);\n } catch (Exception $e) {\n DB::rollback();\n }\n }", "public function create()\n {\n $patients = Patient::all();\n $doctors = Doctor::all();\n return view('admin.appointments.create')->with([\n 'doctors' => $doctors,\n 'patients' => $patients\n ]);\n }", "public function saveApps(Request $request)\n {\n $apps=$request->results;\n\n foreach(json_decode($apps, true) as $app)\n {\n $appt=Appointment::where('day', '=', $app['day'])->where('doc_id','=', $request->doc_id)->first();\n\n if($app['start'] == \"-\" || $app['end'] == \"-\")\n {\n //Check if appointment already exists in database\n //If exists delete\n if($appt!=null) $appt->delete();\n\n }\n else\n {\n //Check if appointment already exists in database\n //If appointment does not exist create new one\n if($appt==null) $appt= new Appointment();\n\n //Set appointment data\n $appt->doc_id= $request->doc_id;\n $appt->start=$app['start'];\n $appt->end=$app['end'];\n $appt->day=$app['day'];\n $appt->slots=$app['slots'];\n $appt->free_slots=$app['slots'];\n\n //Save appointment\n $appt->save(); \n \n } \n }\n}", "protected function registeredAppointment(Request $request)\n {\n $schedules = [];\n\n // DB Query\n //User Table query\n $dbUser = User::select('id','first_name','last_name')\n ->where('id', $request->DoctorID)\n ->first()\n ->toArray();\n\n //personal_info Query\n $personalInfoData = personal_info::select('imageUrl')\n ->where('id', $request->DoctorID)\n ->first()\n ->toArray();\n\n //Assemble the user and personal_info part of infos\n $schedules['id'] = $request->DoctorID;\n $schedules['fullName'] = $dbUser['first_name'] . \" \" . $dbUser['last_name'];\n $schedules['imageUrl'] = $personalInfoData['imageUrl'];\n //Specialty Query\n $dbSpecialty = specialty::select('specialty')\n ->orderBy('specialty','asc')\n ->where('user_id', $request->DoctorID)\n ->get()\n ->toArray();\n //change multi level result array to single level array and assign it to $doctor array Item\n foreach ($dbSpecialty as $key => $value) {\n $schedules['specialty'][] = $value['specialty'];\n }\n\n //Education Query\n $dbEducation = education::select('degree_name')\n ->orderBy('pass_year','dsc')\n ->where('user_id', $request->DoctorID)\n ->get()\n ->toArray();\n //change multi level result array to single level array and assign it to $doctor array Item\n foreach ($dbEducation as $key => $value){\n $schedules['degree_name'][] = $value['degree_name'];\n }\n\n //Schedule Query\n $dbSchedules = schedule::select('schedule_id','chamber_id','schedule_date')\n ->where('user_id', $request->DoctorID)\n ->whereDate('schedule_date', '>=', Carbon::now(+6)->toDateString())\n ->get()\n ->toArray();\n$tmp = $dbSchedules;\n $schedules['schedule'] = [];\n\n foreach($dbSchedules as $dbschedule){\n //dbChamber query\n $dbChamber = chamber::select('chamber_name')\n ->where('chamber_id', $dbschedule['chamber_id'])\n ->where('user_id', $request->DoctorID)\n ->first()\n ->toArray();\n\n $chamber['schedule_id'] = $dbschedule['schedule_id'];\n $chamber['schedule_date'] = $dbschedule['schedule_date'];\n $chamber['chamber_name'] = $dbChamber['chamber_name'];\n\n $schedules['schedule'][] = $chamber;\n }\n\n return view('patient.doctorAppointment', ['schedules'=>$schedules]);\n }", "public function store(Request $request)\n\t{\n\t\t//\n\t\t$rules=$this->getAppointValRules(); \n\t\t//dd($request->all()); \n\t\t$validator = Validator::make($request->all(),$rules);\n\t\tif ($validator->fails()) {\n\t\t \t# code...\n\t\t\treturn redirect()->back()->withErrors($validator); \n\t\t } \n\t\t $input=$request->all(); \n\t\t $appointment = Appointment::create(\n\t\t \t[\n\t\t \t\t'user_id'=>Auth::user()->id,\n\t\t \t\t'appoint_date'=>$input['appoint_date'],\n\t\t \t\t'appoint_time'=>$input['appoint_time'],\n\t\t \t\t'available'=>true\n\t\t \t]); \n\t\t return redirect('doctor/appointment'); \n\t}", "public function store(Request $request)\n {\n $data = $request->all();\n\n $validator = Validator::make($data,[\n 'category_id' => 'required',\n 'service_id' => 'required',\n ]);\n if($validator->fails()) {\n return redirect()->back()->withInput()->with('errors', $validator->errors()->first());\n }\n $data['date'] = isset($request->date) ? date('Y-m-d',strtotime($request->date)) : date('Y-m-d');\n\n $result = Appointment::updateOrCreate(['id' => $data['id'] ],$data);\n\n $message = trans('messages.update_form',['form' => trans('messages.appointment')]);\n if($result->wasRecentlyCreated){\n $message = trans('messages.save_form',['form' => trans('messages.appointment')]);\n }\n return redirect(route('appointment.index'))->withSuccess($message);\n }", "public function store(Request $request)\n {\n $input = $request->all();\n\n $input['date'] = $input['date'] . \" \" . $input['hour'];\n\n Appointment::create($input);\n\n return redirect('citas');\n }", "public function store(Request $request)\n {\n $officehours = new officehours();\n $officehours->startDate = $request['startDate'];\n $officehours->startTime = $request['startTime'];\n $officehours->endTime = $request['endTime'];\n $officehours->length = $request['length'];\n\n $dt1 = Carbon::create($officehours->startDate . $officehours->startTime);\n $dt2 = Carbon::create($officehours->startDate . $officehours->endTime);\n\n for ($i = $dt1->timestamp; $i <=$dt2->timestamp; $i+=$officehours->length*60) {\n $appointment = new Appointment(Carbon::createFromTimestamp($i));\n $appointment->save();\n }\n\n return redirect('officehours');\n // goes to officehours/index\n }", "public function onValidateAppointments() {\nglobal $_LW;\nif (!empty($_LW->save_data['title'])) { // format title\n\t$_LW->save_data['title']=rawurldecode($_LW->save_data['title']); // decode title\n\t$_LW->save_data['title']=preg_replace('~[^a-zA-Z0-9 \\-\\.,&;:\\'\"“”‘’]~', '', $_LW->save_data['title']); // strip disallowed chars from title\n\t$_LW->save_data['title']=preg_replace('~&([^\\s])|&$~', '\\\\1', $_LW->save_data['title']); // force amps to be followed by a space\n\t$_LW->save_data['title']=$_LW->setFormatSanitize($_LW->save_data['title']); // sanitize title\n\t$_LW->save_data['title']=str_replace(['’', '”', '‘', '“'], [\"'\", '\"', \"'\", '\"'], $_LW->save_data['title']); // convert smart quotes\n\tif ($_LW->save_mode=='update') { // if updating appointment\n\t\tif ($_LW->dbo->query('select', '1', 'livewhale_appointments', 'id!='.(int)$_LW->save_id.' AND title='.$_LW->escape($_LW->save_data['title']))->exists()->run()) { // if there is already an appointment slot by that name\n\t\t\t$_LW->REGISTERED_MESSAGES['failure'][]='An appointment slot by that name already exists.';\n\t\t};\n\t}\n\telse if ($_LW->save_mode=='create') { // else if creating appointment\n\t\tif ($_LW->dbo->query('select', '1', 'livewhale_appointments', 'title='.$_LW->escape($_LW->save_data['title']))->exists()->run()) { // if there is already an appointment slot by that name\n\t\t\t$_LW->REGISTERED_MESSAGES['failure'][]='An appointment slot by that name already exists.';\n\t\t};\n\t};\n};\n}", "public function create(AppointmentEntity $resource): Response\n {\n return $this->client->post(\"Appointments\", $resource->toArray());\n }", "public function store(Request $request)\n {\n $this->validate($request,[\n 'doc_id'=>'required',\n 'start'=>'required',\n 'end'=>'required',\n 'day'=>'required',\n 'slots'=>'required'\n ]);\n\n //Create Appointment\n $app= new Appointment();\n\n //Get appointment data\n $app->doc_id= $request->doc_id;\n $app->start=$request->start;\n $app->end=$request->end;\n $app->day=$request->day;\n $app->slots=$request->slots;\n\n //Save appointment\n $app->save();\n }", "public function run()\n {\n DB::table('appointmentslottbl')->insert([\n 'sunday' => 1,\n 'monday' => 1,\n 'tuesday' => 1,\n 'wednesday' => 1,\n 'thursday' => 1,\n 'friday' => 1,\n 'saturday' => 1,\n 'slot' => 5,\n 'noofday' => 10,\n ]);\n\n $appointmentdate = [\n ['date' => Carbon::today()],\n ['date' => Carbon::today()->addDays(1)],\n ['date' => Carbon::today()->addDays(2)],\n ['date' => Carbon::today()->addDays(3)],\n ['date' => Carbon::today()->addDays(4)],\n ['date' => Carbon::today()->addDays(5)],\n ['date' => Carbon::today()->addDays(6)],\n ['date' => Carbon::today()->addDays(7)],\n ['date' => Carbon::today()->addDays(8)],\n ['date' => Carbon::today()->addDays(9)],\n ];\n DB::table('appointmentdatetbl')->insert($appointmentdate);\n\n $appointment = [\n ['applicantid' => 1, 'appointmentdateid' => 1],\n ['applicantid' => 2, 'appointmentdateid' => 1],\n ['applicantid' => 3, 'appointmentdateid' => 1],\n ['applicantid' => 4, 'appointmentdateid' => 1],\n ];\n DB::table('appointmenttbl')->insert($appointment);\n }", "function appointment_edit_form_submit(&$form, &$form_state) {\n \n global $user;\n // Save the entity and go back to the list of Appointment.\n /** @var Appointment $appointment */\n $appointment = entity_ui_controller('appointment')->entityFormSubmitBuildEntity($form, $form_state);\n \n $trigger = $form_state['triggering_element']['#name'];\n switch ($trigger) {\n case 'delete':\n $appointment->delete();\n break;\n case 'save':\n case 'add_one':\n $appointment->date = strtotime($form_state['values']['date']);\n // Add in created and changed times.\n $is_new_entity = $appointment->is_new = isset($appointment->is_new) ? $appointment->is_new : 0;\n if ($is_new_entity) {\n $appointment->created = time();\n $appointment->state = APPOINTMENT_STATE_SCHEDULED;\n }\n \n $appointment->changed = time();\n $appointment->uid = $user->uid;\n $appointment->save();\n \n // Send feedback message to the user.\n $message = t(\"Appointment updated.\");\n if ($is_new_entity) {\n $message = t(\"Appointment booked.\");\n }\n drupal_set_message($message);\n break;\n }\n \n // set redirect\n switch ($trigger) {\n case 'add_one':\n \n $date = date('Y-m-d', $appointment->date);\n $time_start = str_pad((int) substr($appointment->time_start, 0, 2) + 1, 1, 0, STR_PAD_LEFT) . ':' . substr($appointment->time_start, 3, 2);\n $time_end = str_pad((int) substr($time_start, 0, 2) + 1, 1, 0, STR_PAD_LEFT) . ':' . substr($time_start, 3, 2);\n \n $query = [\n 'date' => $date,\n 'time_start' => $time_start,\n 'time_end' => $time_end,\n ];\n \n if (user_access('administer appointment') || user_access('edit any appointment')) {\n $form_state['redirect'] = [\n 'admin/content/appointment/add',\n ['query' => $query],\n ];\n }\n else {\n $form_state['redirect'] = [\n 'user/' . $user->uid . '/counselling/practitioner/create-appointment/',\n ['query'=> $query],\n ];\n }\n break;\n \n default:\n if (user_access('administer appointment')) {\n $form_state['redirect'] = 'admin/content/appointment';\n }\n elseif (user_access('edit any appointment')) {\n $form_state['redirect'] = 'admin/counselling/appointments';\n }\n else {\n $form_state['redirect'] = 'user/' . $user->uid . '/counselling/practitioner/appointments';\n }\n break;\n }\n \n\n \n}", "public function store(Request $request)\n {\n $now = Carbon::now();\n $this->validate(request(), [\n 'name' => 'required|string|max:255',\n 'sns' => 'required|integer',\n 'especialidade' => 'required',\n 'data' => 'required|date|after_or_equal:tomorrow',\n 'user_id' => 'required|integer',\n ]);\n\n $appointment = Appointment::create([\n \n 'name' => request('name'),\n 'sns' => request ('sns'),\n 'especialidade' => request ('especialidade'),\n 'data' => request ('data'),\n 'user_id' => request ('user_id'),\n 'realizada' => (0)\n ]);\n\n session()->flash('message', 'Appointment created successfully!');\n \n return redirect('/help/appointment/home');\n }", "public function store(Request $request)\n {\n $request->validate([\n 'first_name'=>'required|max:50',\n 'last_name'=>'required|max:50',\n 'phone'=>'required|numeric', \n ],[\n 'phone.required'=>'Phone must be a valid phone number.'\n ]); \n\n $appointment = new Appointment();\n $appointment->first_name = $request->get('first_name');\n $appointment->last_name = $request->get('last_name');\n $appointment->setServiceTypeId($request->get('service_type_id'));\n $appointment->phone = $request->get('phone');\n $appointment->setDate($request->get('date'));\n $appointment->setTime($request->get('time'));\n $appointment->message = $request->get('message');\n $appointment->save();\n return view('drcare.booking-result', ['appointment' => $appointment])->with('message', 'Create Successfull !');\n }", "public function create()\n {\n $records = Record::all();\n $doctors = Doctor::all();\n $patients = Patient::all();\n return view('appointments.create', compact('records', 'doctors', 'patients'));\n }", "public function store(StoreAppointmentRequest $request)\n {\n \n $count = Appointment::whereDate('created_at',Carbon::now())->where('time_id',$request->input('time_id'))->count();\n if($count >= 5){\n Toastr::error('No more slot for this time duration','Appointment Failed');\n return redirect()->route('frontend.appointments.create');\n }else {\n $appointment = Appointment::create($request->all());\n Toastr::success('No more slot for this time duration','Appointment Success');\n return redirect()->route('frontend.appointments.index');\n }\n }", "public function create()\n {\n $physicians = Physician::all();\n $patients = Patient::all();\n $nurses = Nurse::all();\n return view('backend.appointments.create', compact('physicians', 'patients', 'nurses'));\n }", "public function store(Request $request)\n {\n\n \n $data = $this->getData($request);\n \n Appointment::create($data);\n\n return redirect()->route('appointments.appointment.index')\n ->with('success_message', 'Appointment was successfully added.');\n\n }", "public function create()\n {\n $closeDays = CloseDay::allDay();\n $doctors = Doctor::active()->get();\n $services = Service::all();\n return view('patient.appointment.create', compact('doctors', 'services', 'closeDays'));\n }", "public function create()\n {\n $doctors = Doctor::pluck('name','id')->all();\n$patients = Patient::pluck('name','id')->all();\n\n return view('appointments.create', compact('doctors','patients'));\n }", "public function saveNewAppointment(NewAppointmentViewModel $appointmentVM)\n {\n $status = true;\n $patientPrescription = null;\n\n try\n {\n $doctorId = $appointmentVM->getDoctorId();\n $patientId = $appointmentVM->getPatientId();\n $hospitalId = $appointmentVM->getHospitalId();\n\n $doctorUser = User::find($doctorId);\n $hospitalUser = User::find($hospitalId);\n $patientUser = User::find($patientId);\n\n if (!is_null($doctorUser) && !is_null($hospitalUser) && !is_null($patientUser))\n {\n $appointment = new DoctorAppointments();\n $appointment->patient_id = $patientId;\n $appointment->hospital_id = $hospitalId;\n $appointment->brief_history = $appointmentVM->getBriefHistory();\n $appointment->appointment_date = $appointmentVM->getAppointmentDate();\n $appointment->appointment_time = $appointmentVM->getAppointmentTime();\n $appointment->created_by = $appointmentVM->getCreatedBy();\n $appointment->modified_by = $appointmentVM->getUpdatedBy();\n $appointment->created_at = $appointmentVM->getCreatedAt();\n $appointment->updated_at = $appointmentVM->getUpdatedAt();\n\n $doctorUser->appointments()->save($appointment);\n }\n\n }\n catch(QueryException $queryEx)\n {\n $status = false;\n throw new HospitalException(null, ErrorEnum::PATIENT_NEW_APPOINTMENT_ERROR, $queryEx);\n }\n catch(Exception $exc)\n {\n $status = false;\n throw new HospitalException(null, ErrorEnum::PATIENT_NEW_APPOINTMENT_ERROR, $exc);\n }\n\n return $status;\n }", "public function bookAppointments(Request $request){\n try {\n $token = $request->get('token');\n $teacherId = $request->get('teacherId');\n $eventId = $request->get('eventId');\n $reasonOfAppointment = $request->get('reasonOfAppointment');\n $parentContact = $request->get('parentContact');\n if ((is_null($token))\n ||(is_null($teacherId))\n ||(is_null($eventId))\n ||(is_null($reasonOfAppointment))\n ||(is_null($parentContact))){\n return Response::json([\"No content. Fill all the details\",HttpResponse::HTTP_NO_CONTENT]);\n }\n $parent = JWTAuth::toUser($token);\n $parentId= $parent->id;\n $parentDetails = UserDetails::where('user_id',$parentId)->first();\n $parentName = $parentDetails->name;\n }catch (TokenExpiredException $e){\n return Response::json (['Token expired'],498);\n }\n catch (TokenInvalidException $e){\n return Response::json (['Token invalid']);\n }\n $teacherDetails = UserDetails::where('user_id',$teacherId)->first();\n $contactNo = $teacherDetails->contact;\n $teacherSlot = \\DB::table('teacherAppointmentsSlots')\n ->where('teacher_id',$teacherId)\n ->where('calendarEventsId',$eventId)\n ->first();\n $slotId = $teacherSlot->id;\n try {\n \\DB::beginTransaction();\n \\DB::table('teacherAppointmentsSlots')\n ->where('id', $slotId)\n ->update(['isBooked' => 1]);\n \\DB::table('calendar_events')\n ->where('id', $eventId)\n ->update(['eventType' => 'Teacher Appointment']);\n $appointmentRequest = new AppointmentRequest();\n $appointmentRequest->parent_id = $parentId;\n $appointmentRequest->teacher_id = $teacherId;\n $appointmentRequest->teacherAppointmentsSlot_id = $slotId;\n $appointmentRequest->reasonOfAppointment= $reasonOfAppointment;\n $appointmentRequest->isAwaited=1;\n $appointmentRequest->isApproved=0;\n $appointmentRequest->isCancel=0;\n $appointmentRequest->contactNo=$contactNo;\n $appointmentRequest->parentContact = $parentContact;\n $appointmentRequest->requestType =\"Parent Request\";\n $appointmentRequest->save();\n $appointmentLog = new AuditAppointments();\n $appointmentLog->eventId = $eventId;\n $appointmentLog->Appointmentstate = 1;\n $appointmentLog->triggeredBy = $parentName;\n $appointmentLog->save();\n }catch (Exception $e){\n \\DB::rollBack();\n $httpStatus = HttpResponse::HTTP_PARTIAL_CONTENT;\n return Response::json([\"Partial Content\",$httpStatus]);\n }\n \\DB::commit();\n $httpStatus = HttpResponse::HTTP_OK;\n return Response::json([\"Success\",$httpStatus]);\n\n }", "public function create($id=-1)\n {\n if($id == '-1'){\n $pageTitle = trans('messages.add_button_form',['form' => trans('messages.appointment')]);\n $appointmentdata = new Appointment;\n $appointmentdata->date = date('d-m-Y');\n $appointmentdata->time = date('H:i');\n }else{\n $pageTitle = trans('messages.update_form_title',['form'=>trans('messages.appointment')]);\n $appointmentdata = Appointment::find($id);\n $appointmentdata->date = date('d-m-Y',strtotime($appointmentdata->date));\n }\n return view('appointment.create', compact('pageTitle' ,'appointmentdata' ));\n }", "function addAppointment($id = null)\n\n\t{\n\t\tif(status() == 1)\n\t\t{\n\t\t\tif($this->session->userdata('logged_in'))\n\t\t\t{\n\t\t\t\tif($id == null)\n\t\t\t\t{\n\t\t\t\t\t$data['patients'] = $this->Patients_model->get_list();\n\t\t\t\t\t$this->load->view('includes/header');\n\t\t\t\t\t$this->load->view('appointment/addAppointment', $data);\n\t\t\t\t\t$this->load->view('includes/footer');\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$data['patients'] = $this->Patients_model->get_list();\n\t\t\t\t\t$this->load->view('includes/header');\n\t\t\t\t\t$this->load->view('appointment/addAppointment', $data);\n\t\t\t\t\t$this->load->view('includes/footer');\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->load->view('users/login');\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->load->view('errors/not_found');\n\t\t}\n\t}", "public function store(Request $request)\n {\n $input = $request->all();\n\n $validator = Validator::make($input, [\n 'office_id' => 'required',\n 'date' => 'required',\n 'time' => 'required',\n 'stretcher_no' => 'required',\n 'is_save'=> 'required',\n ],[\n 'is_save.required' => 'Office is closed'\n \n ]);\n\n if ($validator->fails()) {\n return redirect('appointment/create')->withErrors($validator)->withInput();\n }\n\n $model = new Appointment();\n $model->office_id = $input['office_id'];\n $model->date = $input['date'];\n $model->time = $input['time'];\n $model->stretcher_no = $input['stretcher_no'];\n $model->create_user_id =Auth::user()->id;\n\n $model->save();\n return redirect('/appointment');\n }", "public function store(Request $request)\n {\n try{\n $input=$request->all();\n\n $rules=[\n 'date' => 'required|min:10',\n 'hour' => 'required',\n 'symptoms' => 'required'\n ];\n\n $messages=[\n 'date.required' => 'No has introducido una fecha',\n 'date.min' => 'El formato de fecha debe ser YYYY-MM-DD',\n 'hour.required' => 'Escoge una hora para la cita',\n 'symptoms.required' => 'No has introducido ningún síntoma'\n ];\n\n $validator = Validator::make($input,$rules,$messages);\n\n if ($validator->fails()) {\n return response()->json([$validator->errors()],400);\n }\n\n $user = Auth::user();\n $appointment = new Appointment($input);\n $appointment->user_id = $user->id;\n $appointment->save();\n return response()->json($appointment, 201);\n } catch (\\Exception $e) {\n return response()->json($e, 400);\n }\n }", "public function store(Request $request)\n {\n try{\n // Start Db transaction\n DB::beginTransaction();\n\n // Validate incoming request\n $validation = $this->validator($request);\n if ($validation->fails()) {\n return response($validation->errors(), 400);\n }\n\n $appointment = new Record();\n $appointment->patient_id = $request->patient_id;\n $appointment->doctor_id = $request->doctor_id;\n $appointment->appointment_date = $request->appointment_date;\n $appointment->save();\n\n DB::commit();\n $request->session()->flash('successful', \"New appointment was created successfully!\");\n return redirect()->route('appointments.index');\n\n }catch(\\Exception $error){\n DB::rollBack();\n return $error;\n $request->session()->flash('error', \"Appointment creation failed!\");\n return redirect()->back();\n } \n }", "public function run()\n {\n\n DB::table('appointments')->insert([\n [\n 'title' => 'Mogelijk gebroken been',\n 'date' => '2017-06-07',\n 'location' => 'LUMC Leiden',\n 'description' => 'Patiënt is van de trap af gevallen en vermoedt dat hij een gebroken been heeft. Hij heeft pijn aan zijn onderbeen\n en de pijn straalt door het hele been naar boven. Grote kans op een botbreuk.',\n 'patient_id' => 1,\n 'docter_id' => 1,\n ]\n ]);\n factory(App\\Appointment::class, 1000)->create();\n\n }", "public function store(Request $request)\n {\n $request->validate([\n 'duration' => 'required|integer',\n 'price' => 'required|integer',\n 'date' => 'required|date',\n 'time' => 'required',\n 'doctor_id' => 'required|integer',\n 'patient_id' => 'required|integer'\n ]);\n $appointment = new Appointment();\n $appointment->duration = $request->input('duration');\n $appointment->price = $request->input('price');\n $appointment->date = $request->input('date');\n $appointment->time = $request->input('time');\n $appointment->doctor_id = $request->input('doctor_id');\n $appointment->patient_id = $request->input('patient_id');\n\n $appointment->save();\n return view('admin.appointments.show')->with([\n 'appointment' => $appointment\n ]);\n }", "public function testSaveAppointment()\r\n\t{\r\n\t\t// Set testing timezone\r\n\t\t$cur_tz = date_default_timezone_get();\r\n\t\tdate_default_timezone_set('America/Los_Angeles'); // -8\r\n\r\n\t\t$app = new SyncAppointment();\r\n\t\t$app->timezone = base64_encode($this->backend->getSyncBlobFromTZ(TimezoneUtil::GetFullTZ()));\r\n\t\t$app->starttime = strtotime(\"1/1/2011 11:11 AM\");\r\n\t\t$app->endtime = strtotime(\"1/1/2011 12:11 PM\");\r\n\t\t$app->subject = \"New async unit test event\";\r\n\t\t$app->uid = 'unittestevnt1';\r\n\t\t$app->location = 'My House';\r\n\t\t$app->recurrence = new SyncRecurrence();\r\n\t\t$app->alldayevent = null;\r\n\t\t//$app->reminder = null;\r\n\t\t//$app->attendees = null;\r\n\t\t$app->body = \"Notes here\";\r\n\t\t//$app->exceptions = null;\r\n\t\t$app->recurrence->type = 1; // weekly\r\n\t\t$app->recurrence->interval = 1; // Every week\r\n\t\t$app->recurrence->dayofweek = $app->recurrence->dayofweek | WEEKDAY_WEDNESDAY; // Every wednesday\r\n\t\t$app->recurrence->until = strtotime(\"3/1/2011\");\r\n\r\n\t\t$obj = $this->backend->saveAppointment(\"\", $app);\r\n\t\t$eid = $obj->id;\r\n\r\n\t\t// Test timezone by making the local timezone New York +3 hours\r\n\t\tdate_default_timezone_set('America/New_York'); // -5\r\n\r\n\t\t// Make sure we have a new event id\r\n $this->assertTrue(is_numeric($eid) && $eid > 0);\r\n\r\n\t\t// Test stat\r\n\t\t//$stat = $this->backend->StatMessage(\"calendar_root\", $eid);\r\n\t\t//$this->assertEquals($stat['id'], $eid);\r\n\r\n\t\t// Make sure backend had fully populated contact\r\n\t\t$obj = new CAntObject_CalendarEvent($this->dbh, $eid, $this->user);\r\n\t\t$this->assertEquals($obj->getValue(\"name\"), $app->subject);\r\n\t\t// Because we changed timezones, the times should be 3 hours later in EST\r\n\t\t$this->assertEquals(strtotime($obj->getValue(\"ts_start\")), strtotime(\"01/01/2011 02:11 pm\"));\r\n\t\t$this->assertEquals(strtotime($obj->getValue(\"ts_end\")), strtotime(\"01/01/2011 03:11 pm\"));\r\n\r\n\t\t// Check recurrence\r\n\t\t$recur = $obj->getRecurrencePattern();\r\n\t\t$this->assertEquals($recur->type, RECUR_WEEKLY);\r\n\t\t$this->assertEquals(strtotime($recur->dateEnd), strtotime(\"3/1/2011\"));\r\n\t\t$this->assertEquals($recur->dayOfWeekMask, WEEKDAY_WEDNESDAY);\r\n\r\n\t\t// Cleanup\r\n\t\t$obj->removeHard();\r\n\t\tdate_default_timezone_set($cur_tz);\r\n }", "public function addAction()\n {\n // Instantiate AppointmentForm and set the label on submit button to \"Add\"\n $form = new AppointmentForm();\n $form->get('submit')->setValue('Add');\n // get the request and fetch data from the form\n $request = $this->getRequest();\n // if request->ispost() is true ,it indicates form is submitted successfully\n if ($request->isPost()) {\n $appointment = new Appointment();\n // set the form's input filter from appointment instance\n $form->setInputFilter($appointment->getInputFilter());\n $form->setData($request->getPost());\n\n // if form form data is valid ,get data from form and call saveAppointment() to save the data into database\n if ($form->isValid()) {\n $appointment->exchangeArray($form->getData());\n $this->getAppointmentTable()->saveAppointment($appointment);\n\n // Redirect to list of appointments\n return $this->redirect()->toRoute('appointment');\n }\n }\n // return variables to assign to view i.e. form object\n return array('form' => $form);\n \n }", "public function registrarCitaPaciente (Request $request)\n {\n $cita = new Appointment();\n\n $cita->patient_id = $request->get('patient_id');\n $cita->professional_id = $request->get('professional_id');\n\n $cita->asunto = $request->get('asunto');\n $cita->fecha = $request->get('fecha');\n $cita->hora = $request->get('hora');\n $cita->duracion = $request->get('duracion');\n $cita->recomendacion = $request->get('recomendacion');\n\n $cita->save();\n return redirect('pacientes/listado');\n\n }", "public function create()\n\t{\n\t\t$appointment = Appointment::findOrFail(Input::get('id'));\n\n\t\treturn View::make('vitalsigns.create', compact('appointment'));\n\t}", "public function addAction()\n {\n $form = new AppointmentForm();\n $form->get('submit')->setValue('Add');\n // If the request is not a POST request, then no form data has been\n // submitted, and we need to display the form\n $request = $this->getRequest();\n \n if ($request->isPost()) {\n $appointment = new Appointment();\n $form->setData($request->getPost());\n $form->setInputFilter($appointment->getInputFilter());\n \n if ($form->isValid()) {\n \n $appointment->exchangeArray($form->getData());\n // Inserting appointment data in the datbase table\n $this->appointmentTable->saveAppointment($appointment);\n } else {\n \n return array(\n 'form' => $form\n );\n }\n }\n \n return array(\n 'form' => $form\n );\n // if it is invalid return form\n // we redirect back to the list of appointments using the Redirect\n }", "public function create($client_form_id)\n {\n //dd('working');\n {\n \n $time_before_interval = available_doctor::all()->where('client_forms_id', $client_form_id)->first();\n if($time_before_interval)\n {\n $time_before_interval->time_before_appointment;\n }\n else\n {\n $time_before_interval = '';\n }\n $appoint_date_range = appointment_limits::all()->where('client_forms_id', $client_form_id)->first(); \n return view('forms.pedim.pedim-consent-for-rapid-covid-19-testing.create')->with(array('time_before_interval'=>$time_before_interval, 'client_form_id' => $client_form_id, 'appoint_date_range' => $appoint_date_range)); \n \n //\n }\n //return view('forms.pedim.pedim-consent-for-rapid-covid-19-testing.create');\n //\n }", "public function saveCalendar($appointment = null){\n $client = Yii::$app->calendarService;\n return $client->save(['sid'=>$this->sid,'appointment'=>$appointment]);\n }", "public function createAction(Request $request)\n {\n $entity = new Appointment();\n $form = $this->createCreateForm($entity);\n $form->handleRequest($request);\n\n if ($form->isValid()) {\n $em = $this->getDoctrine()->getManager();\n $em->persist($entity);\n $em->flush();\n\n return $this->redirect($this->generateUrl('appointment_show', array('id' => $entity->getId())));\n }\n\n return array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }", "public function save()\n {\n // make sure there is a maximum of 1 unassigned appointment\n if( is_null( $this->assignment_id ) )\n {\n $modifier = lib::create( 'database\\modifier' );\n $modifier->where( 'participant_id', '=', $this->participant_id );\n $modifier->where( 'assignment_id', '=', NULL );\n if( !is_null( $this->id ) ) $modifier->where( 'id', '!=', $this->id );\n if( 0 < static::count( $modifier ) )\n throw lib::create( 'exception\\runtime',\n 'Cannot have more than one unassigned appointment per participant.', __METHOD__ );\n }\n\n parent::save();\n }", "public function create()\n {\n $model = new Appointment();\n\n return view('appointment.create', compact('model'));\n }", "public function store(Request $request)\n {\n $validatedData = $request->validate([\n 'title'=>'required|max:100',\n 'startDate' => 'required',\n 'endDate' => 'required',\n 'location'=> 'required',\n 'user_id'=>'required|max:100',\n 'technician_id'=>'required|max:100',\n 'approved'=>'required|boolean',\n 'rated'=>'required'\n ]);\n\n $appointment = Appointment::create($validatedData);\n AppointmentRequested::dispatch($appointment);\n\n return response(['appointment' => new AppointmentResource($appointment), 'message' => 'Created successfully'], 200);\n }", "public function create()\n {\n if (Sentry::check()) {\n // Find active user and set default variables to null\n $user = Sentry::getUser();\n $groups = null;\n $schoolName = null;\n\n // Permission checks\n if ($user->hasAnyAccess(['school', 'event'])) {\n\n // If user is a superAdmin, show all possible groups to add an event to\n if ($user->hasAccess(['school'])) {\n $groups = Group::where('school_id', '<>', '')->get();\n $opening = '';\n } else {\n // If the user isn't a superAdmin, only show the groups to which the user has permissions\n $user->load('school.groups.appointments');\n $groups = $user->school->groups;\n $opening = $user->school->opening;\n }\n\n // Transform recieved objectList (from database) into array to send with view\n $smartgroup = [];\n foreach ($groups as $group) {\n $smartgroup[$group->id] = $group->name;\n }\n\n // Show the form where users can add appointments\n return View::make('calendar.create')->with('groups', $smartgroup)->with('opening', $opening);\n\n } else {\n // If no permissions, redirect the user to the calendar index page\n return Redirect::route('calendar.index');\n }\n } else {\n return Redirect::route('landing');\n }\n }", "public function bookingCreate($empID, $dt, $custEmail = '', $typeId='')\n {\n require_once('models/Customer.class.php');\n require_once('models/Calendar.class.php');\n require_once('models/CanWork.class.php');\n require_once('models/AppType.class.php');\n require_once('views/BookingView.class.php');\n\n $site = new SiteContainer($this->db);\n $bkv = new BookingView();\n $cal = new Calendar($this->db);\n $cust = null; // Needed in order to not print a customer dropdown if logged in as customer\n \n // If no email supplied, we are booking for the current customer\n if ($this->custLoggedIn() && empty($custEmail))\n {\n $custEmail = $_SESSION['email'];\n } else if ($this->ownerLoggedIn() && empty($custEmail))\n {\n $errors= \"Please provide a valid email address to create this appointment\";\n $this->bookingConfirm($empID, $dt, $typeId, $errors);\n return;\n } else if ($this->ownerLoggedIn()) // email not empty\n {\n try{\n $cust = new Customer($custEmail, $this->db);\n } catch(Exception $e){\n // Was unable to find customer with this email\n $errors = \"Email must be of an existing valid customer\";\n // Re=present the booking confirmation\n $this->bookingConfirm($empID, $dt, $typeId, $errors);\n return;\n }\n }\n \n // Grab the canwork from the databse\n $cw = new CanWork($empID, $dt, $this->db); // Still not a booking!!\n $appType = new AppType($typeId, $this->db);\n \n // Grab the employee from the database\n if (! ($empdata = $this->fetchEmployeeFromDb($empID)) )\n throw new Exception(\"Employee $empID could not be found for booking at time: \".$dt->format('Y-m-d H:i:s'));\n\n // check that it hasnt already been taken\n try {\n $b_meta = $cal->bookingCheckAndReturnMeta($empID, $dt, $appType);\n } catch (Exception $e) {\n $site->printHeader();\n $site->printNav($_SESSION['type']);\n $bkv->printError($e->getMessage());\n $site->printFooter();\n $this->writeLog(\"Creation of booking failed: \" . $e->getMessage());\n return; // Its not possible to create this booking\n }\n \n // Here we want to insert the booking\n $sql = \"INSERT INTO Bookings (empID, email, datetime, startTime, endTime, appType) VALUES (?,?,?,?,?,?);\";\n $stmt = $this->db->prepare($sql);\n\n // Insert our given username into the statement safely\n $stmt->bind_param('sssssi',\n $empID,\n $custEmail,\n $b_meta['dateTime'],\n $b_meta['startTime'],\n $b_meta['endTime'],\n $b_meta['typeid']\n );\n \n \n $site->printHeader();\n $site->printNav($_SESSION['type']);\n \n if( $stmt->execute() ) // Our appointment was successfully booked, now it is a booking\n {\n $bk = new Booking($empID, $cw->get_dateTime(), $this->db);\n $this->writeLog(\"Booking for a \" . $bk->get_type() . \" successfully created at \" . $dt->format('Y-m-d H:i:s')\n . \" with employee \" . $empdata->fullName\n . \" for customer with email \" . $custEmail);\n $bkv->printSuccess($bk, $empdata, $cust);\n } else\n {\n $this->writeLog(\"Creation of a booking failed: \" . $stmt->error);\n $bkv->printError($stmt->error);\n }\n\n $site->printFooter(); \n \n }", "public function bookappointment($input) {\n $appointments = new UserAppointments();\n $appointments->user_id = access()->id();\n $appointments->service_provider_id = $input['touser'];\n $appointments->appointment_date = date('Y-m-d h:i:s', strtotime($input['appointmentdate']));\n $appointments->services = $input['appointmentservices'];\n $appointments->save();\n $servicesSelected = json_decode($input['appointmentservices'], true);\n\n $fromuser = User::findOrFail(access()->id());\n $touser = User::findOrFail($input['touser']);\n\n Mail::send('emails.appointmentfrom', ['appointment' => $appointments->appointment_date, 'servicesSelected' => $servicesSelected], function ($message) use ($fromuser, $touser) {\n $message->from($touser->email, app_name());\n $message->to($fromuser->email, $fromuser->name)->subject(app_name() . ': New Appointment');\n });\n\n return Mail::send('emails.appointmentwith', ['appointment' => $appointments->appointment_date, 'servicesSelected' => $servicesSelected], function ($message) use ($fromuser, $touser) {\n\n $message->from($fromuser->email, app_name());\n $message->to($touser->email, $touser->name)->subject(app_name() . ': New Appointment');\n });\n }", "public function create(){\n $this->isAuthorize();\n\n // Load the Create View\n $userID = $this->request->session()->get('userID');\n //echo $userID;die();\n $allEvents = Apt_event::where('userID','=',$userID)->pluck('evtName', 'id');\n //DB::enableQueryLog();\n $allEmployee = DB::table('users AS u')\n ->join('role_user AS ur', 'u.id', '=', 'ur.id')\n ->select('u.id','u.name')\n ->where('ur.userType', '=', 4)\n ->where('ur.parentID', '=', $userID)\n ->orderBy('ur.user_id', 'ASC')\n ->pluck('name', 'id');\n //dd(DB::getQueryLog());\n return view('appointments.timeslot.create', compact('allEvents', 'allEmployee'));\n }", "public function create()\n {\n $validated = request()->validate([\n 'title' => 'required',\n 'day' => 'required|date',\n 'start_date' => 'required|date_format:H:i',\n 'end_date' => 'required|date_format:H:i',\n 'id_paciente' => 'required|integer',\n 'id_personal' => 'required|integer',\n ]);\n\n Agenda::create($validated);\n\n $paciente = Paciente::find($validated['id_paciente']);\n $colaborador = Personal::find($validated['id_personal']);\n\n \\Mail::to($paciente->correo)->send(new AgendaCreate($validated, $paciente, $colaborador));\n\n return redirect()->route('agenda.index')->with('success', 'Hora agendada correctamente');\n }", "public function store(Request $request)\n {\n $data = $request->all()['appointmentBook'];\n // dd($data);\n $appointmentBookCreate = AppointmentBook::create([\n // 'date' => $request->date,\n // 'time' => $request->time,\n 'date' => $data['date'],\n 'name_of_patient' => $data['name_of_patient'],\n 'contact_no' => $data['contact_no'],\n 'appointment_time' => $data['appointment_time'],\n 'consultant_name' => $data['consultant_name'],\n ]);\n if ($appointmentBookCreate) {\n return ['code' => '200','appointmentBook'=>$appointmentBookCreate->id, 'message' => 'Data Sucessfully InCreate'];\n }\n }", "public function store(ReservationRequest $request)\n {\n\n try {\n // return $request;\n DB::beginTransaction();\n\n $DoctorSchedule= DoctorSchedule::create([\n 'doctor_id' => (int)$request->doctor_id,\n 'scheduleDate' => $request->scheduleDate,\n 'startTime' => $request->startTime,\n 'endTime' => $request->endTime,\n 'bookAvailable' => $request->bookAvailable,\n ]);\n\n Appointment::create([\n 'doctor_id' => (int)$DoctorSchedule->id,\n 'name' => $request->name,\n 'phone' => $request->phone,\n ]);\n DB::commit();\n return redirect()->route('reservation.index')->with(['success' => 'تم ألاضافة بنجاح']);\n } catch (\\Exception $ex) {\n DB::rollback();\n return redirect()->route('reservation.index')->with(['error' => 'حدث خطا ما برجاء المحاوله لاحقا']);\n }\n }", "public function store(DoctorScheduleRequest $request)\n {\n try {\n // return $request;\n DB::beginTransaction();\n if (isset($request->bookAvailable) && $request->bookAvailable == 1){\n $request->request->add(['bookAvailable' => 1]);\n }\n else{\n $request->request->add(['bookAvailable' => 0]);\n\n }\n // return $request;\n foreach ($request->Doctors as $Doctor) {\n DoctorSchedule::create([\n 'doctor_id' => (int)$Doctor,\n 'scheduleDate' => $request->scheduleDate,\n 'startTime' => $request->startTime,\n 'endTime' => $request->endTime,\n 'bookAvailable' => $request->bookAvailable,\n ]);\n\n }\n\n DB::commit();\n return redirect()->route('DoctorSchedule.index')->with(['success' => 'تم ألاضافة بنجاح']);\n } catch (\\Exception $ex) {\n DB::rollback();\n return redirect()->route('DoctorSchedule.index')->with(['error' => 'حدث خطا ما برجاء المحاوله لاحقا']);\n }\n }", "public function __construct(appointment $appointment)\n {\n //\n $this->appointment = $appointment;\n }", "public function create()\n {\n if(!empty(Auth::id())){\n return view('appointments.create');\n }\n else{\n echo \"You need to login first\";\n }\n \n }", "public function store(Request $request)\n {\n // 2019-09-17 dte format\n $day_arr = ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'];\n $day_clone = [];\n $day_avail = $request->input('days');\n $startTime = strtotime( $request->from_date );\n $endTime = strtotime( $request->to_date );\n // $day_for_testing = [];\n \n if ($day_avail) {\n for ($i=0; $i < count($day_avail); $i++) { \n array_push($day_clone, ($day_avail[$i]-1)); \n }\n // arr(2,3,4)\n }\n\n if ($day_clone) {\n if(!empty($request->event) && $day_avail && ($startTime <= $endTime)) { \n \n \n // Loop between timestamps, 24 hours at a time\n for ( $a = $startTime; $a <= $endTime; $a = $a + 86400 ) {\n for ($i=0; $i < count($day_clone); $i++) { \n $day_save = $day_arr[$day_clone[$i]] === date( 'D', $a );\n $check_if_exist = Calendar::where('date', '=', date( 'Y-m-d', $a ))->where('day_id', '=', $day_clone[$i]+1)->first();\n \n if ($check_if_exist) {\n $calendar = Calendar::find($check_if_exist->id); //to update\n $calendar->event = $request->event;\n $calendar->save();\n } \n if ($day_save && !$check_if_exist) {\n $calendar1 = new Calendar;\n $calendar1->day_id = $day_clone[$i]+1;\n $calendar1->event = $request->event;\n $calendar1->date = date( 'Y-m-d', $a );\n $calendar1->save();\n }\n }\n } \n // dd($day_for_testing);\n \n \n $notification = array(\n 'message' => 'Event successfully saved.',\n 'alert-type' => 'success'\n );\n } else {\n $notification = array(\n 'message' => 'Make sure to fill in all fields correctly.',\n 'alert-type' => 'warning'\n ); \n }\n \n } else {\n $notification = array(\n 'message' => 'Choose weekdays.',\n 'alert-type' => 'warning'\n );\n }\n\n // return redirect('/');\n return back()->withInput()->with($notification);\n }", "public function store(Request $request)\n {\n //\n /**\n * Find patient in database\n *\n * @var <type>\n */\n $patient = Patient::find($request->patient);\n\n /**\n * Find service in database\n *\n * @var <type>\n */\n $service = Service::find($request->service);\n\n /**\n * initial where array to find patient service\n * based on posted service id\n *\n * @var array\n */\n $where2 = array('service_id'=>$request->service,'patient_id'=>$request->patient);\n\n /**\n * find patient service\n *\n * @var <type>\n */\n $patientService = $patient->reminderService()->where($where2)->first();\n\n \n /**\n * check current patient service \n * active or not if action then \n * change its is changed value\n */\n \n if($patientService->status==1):\n\n /**\n * Assign value one for ischanged object\n */\n $patientService->ischanged = 1;\n\n /**\n * Save patient service\n */\n $patientService->save();\n\n endif;\n\n /**\n * check current action \n * if current action is add\n * then insert patient reminder times in db\n */\n if($request->action=='add'):\n\n /**\n * intialize patient reminder time object\n * and assign service ,patient and patient service\n * and time id to patientReminderDays object\n * and save it\n * @var <type>\n */\n $patientReminderTime = new PatientReminderTime;\n $patientReminderTime->service_id = $request->service;\n $patientReminderTime->patient_id = $request->patient;\n $patientReminderTime->pat_ser_id = $patientService->id;\n $patientReminderTime->time_id = $request->time_id;\n $patientReminderTime->save();\n else:\n\n /**\n * initialize where for service_id,patient_id and time_id\n *\n * @var array\n */\n $where = array('service_id'=>$request->service,'patient_id'=>$request->patient,'time_id'=>$request->time_id);\n \n /**\n * delete day id based on service_id,patient_id and time_id\n *\n * @var <type>\n */\n \n $patientReminderTime = PatientReminderTime::where($where)->delete(); \n endif;\n \n /**\n * Pass pateient and service object in \n * service view and return view for ajax response\n */\n return \\Response::view('partials.ajax.service',compact('patient','service'));\n\n }", "public function makeAppointment($appointmentFields = [])\n {\n /** @var AppointmentRepository $appointmentRepo */\n $appointmentRepo = App::make(AppointmentRepository::class);\n $theme = $this->fakeAppointmentData($appointmentFields);\n return $appointmentRepo->create($theme);\n }", "public function store(Request $request)\n {\n try {\n\n $dentalLogInfo = Session::get('request');\n\n $date = $dentalLogInfo['date'];\n $time = $dentalLogInfo['time'];\n $datetime = date('Y-m-d H:i:s');\n\n $logPatient = new DentalLog;\n\n $logPatient->patientID = Session::get('patientInfo.patientID');\n $logPatient->dentistID = Session::get('accountInfo.id');\n $logPatient->clinicType = 'D';\n $logPatient->nurseID = \" \";\n $logPatient->symptoms = $request->symptoms;\n $logPatient->clinicLogDateTime = $datetime;\n $logPatient->concern = Session::get('patientInfo.concern');\n\n $logPatient->save();\n\n // SAVE TO PRESCRIPTION\n\n //TAKING RECENTLY ADDED CLINIC LOG\n $clinicLogID = DentalLog::orderBy('created_at', 'desc')\n ->select('cliniclogs.clinicLogID')\n ->where([['cliniclogs.isDeleted', '<>', '1'],['cliniclogs.clinicType', '=', 'D']])\n ->first();\n\n //SAVE TO DIAGNOSIS\n $diagnosis = new Diagnosis;\n\n $diagnosis->clinicLogID = $clinicLogID['clinicLogID'];\n // $diagnosis->logReferralID = ' ';\n $diagnosis->diagnosisDescription = Session::get('diagnosis');\n $diagnosis->save();\n\n //SAVE CLINICLOGID TO VITALSIGNS\n $vitalSigns = VitalSigns::orderBy('created_at', 'desc')\n ->where('vitalsigns.isDeleted', '<>', '1')\n ->first();\n\n $vitalSigns->clinicLogID = $clinicLogID['clinicLogID'];\n $vitalSigns->save();\n\n if(Input::get('appointmentDate') != ''){\n //SAVE CLINICLOGID TO APPOINTMENTS\n $appointments = new Appointments;\n\n $appointments->clinicLogID = $clinicLogID['clinicLogID'];\n $appointments->appointmentLogID = $clinicLogID['clinicLogID'];\n $appointments->appointmentType = 2;\n $appointments->appointmentDesc = $request->appointmentDesc;\n $appointments->appointmentDate = $request->appointmentDate;\n $appointments->save();\n }\n\n $consultAppointment = Appointments::join('cliniclogs', 'cliniclogs.clinicLogID', '=', 'appointments.appointmentLogID')\n ->join('patients', 'patients.patientID', '=', 'cliniclogs.patientID')\n ->select('cliniclogs.*', 'patients.*', 'appointments.*')\n // ->where('cliniclogs','cliniclogs.clinicLogID', '=', 'appointments.appointmentLogID')\n // ->where('cliniclogs', 'cliniclogs.patientID', '=', 'patients.patientID')\n ->orderBy('appointments.created_at', 'desc')\n // ->where('patients', 'patients.patientID', '=', 'cliniclogs.patientID')\n ->first();\n \n $consultAppointment->isAppointed = 3;\n $consultAppointment->save();\n\n //TAKING RECENTLY ADDED DIAGNOSIS FOR DIAGNOSIS ID INSERTION IN TREATMENT TABLE.\n $diagnosisID = Diagnosis::orderBy('created_at', 'desc')\n ->select('diagnoses.diagnosisID')\n ->where('diagnoses.isDeleted', '<>', '1')\n ->first();\n // SAVE TO TREATMENT\n $patientTreatment = new Treatment;\n\n $patientTreatment->clinicLogID = $clinicLogID['clinicLogID'];\n $patientTreatment->dentalExamination = $request->dentalExam;\n $patientTreatment->oralProphylaxis = $request->oralProphylaxis;\n $patientTreatment->othersTreatment = $request->othersTreatment;\n $patientTreatment->treatmentDescription = $request->treatment;\n $patientTreatment->restoration = $request->restorationChk;\n $patientTreatment->restorationTooth = $request->restorationTxt;\n $patientTreatment->extraction = $request->extractionChk;\n $patientTreatment->extractionTooth = $request->extractionTxt;\n $patientTreatment->diagnosisID = $diagnosisID['diagnosisID'];\n $patientTreatment->save();\n $patientTreatmentID = $patientTreatment->treatmentID;\n\n \n $outsideReferral = OutsideReferrals::orderBy('created_at', 'desc')\n ->where('outsidereferrals.isDeleted', '<>', '1')\n ->first();\n\n if(!empty($outsideReferral)){\n $outsideReferral->treatmentID = $patientTreatmentID;\n $outsideReferral->save();\n }\n \n \n\n for ($i=0; $i < count(Input::get('medArray')) ; $i++) {\n\n $prescription = new Prescription;\n $prescription->treatmentID = $patientTreatmentID;\n // $prescription->medicineID = Input::get('medicineID')[$i];\n // $prescription->quantity = Input::get('medQuantity')[$i];\n // $prescription->medicineUnit = Input::get('medicineUnit')[$i];\n // $prescription->medication = Input::get('medication')[$i];\n // $prescription->dosage = Input::get('dosage')[$i];\n // $prescription->isPrescribed = Input::get('isPrescribed')[$i];\n // $prescription->isGiven = Input::get('isGiven')[$i];\n $prescription->medicineID = Input::get('medArray')[$i]['medicineID'];\n $prescription->quantity = Input::get('medArray')[$i]['medicineQuantity'];\n $prescription->dosage = Input::get('medArray')[$i]['medicineDosage'];\n $prescription->medication = Input::get('medArray')[$i]['medicineMedication'];\n $prescription->isPrescribed = Input::get('medArray')[$i]['isPrescribed'];\n $prescription->isGiven = Input::get('medArray')[$i]['isGiven'];\n $prescription->save();\n }\n\n for ($i=0; $i < count(Input::get('prescribedArray')) ; $i++) {\n\n $prescription = new Prescription;\n $prescription->treatmentID = $patientTreatmentID;\n $prescription->medicineID = Input::get('prescribedArray')[$i]['medicineID'];\n $prescription->quantity = Input::get('prescribedArray')[$i]['medicineQuantity'];\n $prescription->dosage = Input::get('prescribedArray')[$i]['medicineDosage'];\n $prescription->medication = Input::get('prescribedArray')[$i]['medicineMedication'];\n $prescription->isPrescribed = Input::get('prescribedArray')[$i]['isPrescribed'];\n $prescription->isGiven = Input::get('prescribedArray')[$i]['isGiven'];\n $prescription->save();\n }\n\n for ($i=0; $i < count(Input::get('suppArray')) ; $i++){\n\n $usedMedSupply = new UsedMedSupply;\n $usedMedSupply->treatmentID = $patientTreatmentID;\n $usedMedSupply->medSupplyID = Input::get('suppArray')[$i]['medicalSupplyID'];\n $usedMedSupply->quantity = Input::get('suppArray')[$i]['medicalSupplyQuantity'];\n $usedMedSupply->suppliesUnit = Input::get('suppArray')[$i]['medicalSupplyUnit'];\n $usedMedSupply->save();\n }\n \n return Response::json(['message' => 'Successfully Added!']);\n\n } catch (Exception $e) {\n\n $error = $e->getMessage();\n\n return Redirect::back()->with('error', $error)->withInput();\n }\n\n }", "public function save_appointment_notes ()\n {\n if (post_data('appointment_id') == NULL)\n {\n return;\n }\n $table_data = array();\n $presc_status = FALSE;\n $app_response = $app_return_response = $app_status = array();\n\n $table_data['id'] = post_data('id') != NULL ? post_data('id') : 0;\n $table_data['appointment_id'] = post_data('appointment_id');\n $table_data['history'] = post_data('history') != NULL ? post_data('history') : NULL;\n $table_data['examination'] = post_data('examination') != NULL ? post_data('examination') : NULL;\n $table_data['diagnosis'] = post_data('diagnosis') != NULL ? post_data('diagnosis') : NULL;\n $table_data['management'] = post_data('management') != NULL ? post_data('management') : NULL;\n $table_data['medicine_prescription'] = post_data('prescription') != NULL ? json_encode(post_data('prescription')) : NULL;\n $table_data['icd_description'] = post_data('icd_list') != NULL ? json_encode(post_data('icd_list')) : NULL;\n $table_data['repeat_prescription'] = post_data('repeat_prescription') != NULL ? post_data('repeat_prescription') : 0;\n\t\t\n /*--------------------Updating third party's API----------------------------------------*/\n if (post_data('create_prescription') == TRUE)\n {\n $prescription = make_prescription_format(post_data('prescription'));\n\n /*Creating Prescription at Third Party's database*/\n $app_response = post_curl_request(THIRD_PARTY_API_URL, json_encode(array(\n \"action\" => \"postcreateprescription\",\n \"patientid\" => post_data('patient_id'),\n \"appointmentid\" => post_data('appointment_id'),\n \"doctorid\" => session_data('app_user_id'),\n \"endorsements\" => count(post_data('prescription')),\n \"patientname\" => post_data('PatientForename') . ' ' . post_data('PatientSurname'),\n \"deliveryaddress\" => post_data('PatientAddress1') . ' ' .\n post_data('PatientAddress2') . ' ' . post_data('PatientAddress3') . ' ' .\n post_data('PatientAddress3') . '' . post_data('PatientAddress4') . ' ' .\n post_data('PatientAddress5'),\n \"DOB\" => post_data('PatientDOB'),\n \"Age\" => post_data('PatientDOB') != NULL ? date('Y') - date('Y', uk_date_to_stamp(post_data('PatientDOB'))) : NULL,\n \"telephone\" => post_data('PatientMobile'),\n \"deliverynote\" => \"New Prescription\",\n \"repeatprescription\" => post_data('repeat_prescription'),\n \"endorsement\" => $prescription\n )));\n\n /* Updating Icd at Third Party's database */\n if (post_data('icd_list') != NULL)\n {\n $app_return_response['icd_response'] = post_curl_request(THIRD_PARTY_API_URL, json_encode(array(\n \"action\" => \"postICDtopatient\",\n \"patientid\" => post_data('patient_id'),\n \"appointmentid\" => post_data('appointment_id'),\n \"icdcodeselected\" => post_data('icd_list')['key'],\n \"icdtitleselected\" => post_data('icd_list')['value'],\n )));\n }\n\n /*Creating patient notes at Third Party's database*/\n $app_return_response['patient_notes_response'] = post_curl_request(THIRD_PARTY_API_URL, json_encode(array(\n \"action\" => \"postpatientnotes\",\n \"patientid\" => post_data('patient_id'),\n \"appointmentid\" => post_data('appointment_id'),\n \"doctorid\" => session_data('app_user_id'),\n \"history\" => post_data('history'),\n \"examination\" => post_data('examination'),\n \"diagnosis\" => post_data('diagnosis'),\n \"management\" => post_data('management'),\n )));\n \n if (!empty($app_response) && json_decode($app_response))\n {\n $presc_status = TRUE;\n $table_data['app_id'] = json_decode($app_response);\n\n /* Signing Prescription and updating Third Party's database*/\n $app_return_response['sign_response'] = post_curl_request(THIRD_PARTY_API_URL, json_encode(array(\n \"action\" => \"prescriptionsign\",\n \"prescriptionid\" => $table_data['app_id'],\n \"doctorid\" => session_data('app_user_id')\n )));\n\n }\n\t\t\t/*-------------------------Updating third party's Database Ends-------------------------*/\n if (!empty($app_return_response))\n {\n\t\t\t\tforeach ($app_return_response as $key => $val)\n\t\t\t\t{\n\t\t\t\t\tif (!empty($val) && json_decode($val) && !empty(json_decode($val)->Status) && json_decode($val)->Status == 1)\n\t\t\t\t\t{\n\t\t\t\t\t\t$app_status[$key] = TRUE;\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$app_status[$key] = FALSE;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n \n }\n \n $presc_id = $this->appointment_model->save_prescription($table_data);\n \n exit(json_encode(array(\n 'presc_id' => $presc_id,\n 'presc_status' => $presc_status,\n 'app_status' => $app_status,\n )));\n }", "public function create()\n {\n return view('drcare.appointment');\n }", "public function getAppointments ($id){\n $appointmentRequest = AppointmentRequest::where('id',$id)->first();\n $appointmentRequestId=$id;\n $parentId = $appointmentRequest->parent_id;\n //Retrieve parent and student details corresponding to the appointment request\n $parentDetails = UserDetails::where('user_id',$parentId)->first();\n $parentName = $parentDetails->name;\n $parentContact = $appointmentRequest->parentContact;\n $studentDetails = Student::where('parent_id',$parentId)->first();\n $studentId = $studentDetails->id;\n $studentName = $studentDetails->name;\n $gradeId = $studentDetails->grade_id;\n $gradeDetails = Grade::where('id',$gradeId)->first();\n $gradeName = $gradeDetails->grade_name;\n $reasonOfAppointment = $appointmentRequest->reasonOfAppointment;\n $cancellationReason = $appointmentRequest->cancellationReason;\n $requestType = $appointmentRequest->requestType;\n if($requestType == \"Parent Request\")\n $requestedBy = \"Parent\";\n else\n $requestedBy = \"You\";\n //Retrieve appointment slot corresponding to the appointment request\n $slotId=$appointmentRequest->teacherAppointmentsSlot_id;\n $slot = TeacherAppointmentSlots::where('id',$slotId)->first();\n $booked= $slot->isBooked;\n $awaited = $appointmentRequest->isAwaited;\n $confirmed = $appointmentRequest->isApproved;\n $cancelled = $appointmentRequest->isCancel;\n if ($awaited==1 && $confirmed==0 && $cancelled==0){\n $status = \"Awaited\";\n }\n elseif ($awaited==0 && $confirmed==1 && $cancelled==0){\n $status = \"Confirmed\";\n }\n elseif($awaited==0 && $confirmed==0 && $cancelled==1) {\n $status=\"Cancelled\";\n }\n else{\n $status = \"Invalid Status\";\n }\n //Retrieve appointment event corresponding to the appointment slot\n $eventId = $slot->calendarEventsId;\n $event = CalendarEvent::where('id',$eventId)->first();\n $title=$event->title;\n $start=$event->start;\n $end=$event->end;\n $teacherId = $appointmentRequest->teacher_id;\n $contactNo = $appointmentRequest->contactNo;\n $appointmentDetails= array(\n 'requestId' => $appointmentRequestId,\n 'parentName'=>$parentName,\n 'parentContact'=>$parentContact,\n 'studentId'=>$studentId,\n 'studentName'=>$studentName,\n 'grade'=>$gradeName,\n 'eventId'=>$eventId,\n 'title'=>$title,\n 'reasonOfAppointment'=>$reasonOfAppointment,\n 'cancellationReason'=>$cancellationReason,\n 'start'=>$start,\n 'end'=>$end,\n 'requestedBy'=>$requestedBy,\n 'status'=>$status,\n 'contact'=>$contactNo,\n 'teacherId'=>$teacherId\n );\n return $appointmentDetails;\n }", "public function createRecurringCalendarEvent(Request $request)\n {\n $site = site(config('app.base_domain'));\n $user = auth()->guard(User::GUARD)->user();\n\n if ($user->hasRole(Role::OWNER)) {\n $rules = [\n 'recurring_appointments_type' => ['required', 'string', 'max:50', new SanitizeHtml()],\n 'section_type' => ['required', 'string', Rule::in(CalendarEvent::VISIT_TYPES)],\n 'start_time' => ['required', 'date_format:h:i A', 'before:end_time'],\n 'end_time' => ['required', 'date_format:h:i A', 'after:start_time'],\n 'repeat_type' => ['required', 'string', Rule::in(CalendarEvent::REPEAT_TYPES)],\n 'repeat_day' => ['required_if:repeat_type,weekly', 'string', Rule::in(CalendarEvent::DAYS)],\n 'repeat_month_day' => ['required_if:repeat_type,monthly', 'string', 'date_format:m/d/Y']\n ];\n\n $validator = Validator::make($request->all(), $rules);\n\n if ($validator->passes()) {\n $office = $user->offices()->first();\n $title = $request->input('recurring_appointments_type');\n $sectionType = $request->input('section_type');\n $startTime = $request->input('start_time');\n $endTime = $request->input('end_time');\n $repeatType = $request->input('repeat_type');\n $repeatDay = $request->input('repeat_day');\n $repeatMonthDay = $request->input('repeat_month_day');\n $startTimeFormated = \\Carbon\\Carbon::parse($startTime);\n $endTimeFormated = \\Carbon\\Carbon::parse($endTime);\n\n $calendarEvent = new CalendarEvent();\n $calendarEvent->uuid = Str::uuid();\n $calendarEvent->title = $title;\n $calendarEvent->recurring = CalendarEvent::RECURRING;\n $calendarEvent->status = CalendarEvent::ACTIVE;\n $calendarEvent->start_at = $startTimeFormated;\n $calendarEvent->ends_at = $endTimeFormated;\n $calendarEvent->setMetaField('type', $sectionType);\n $calendarEvent->setMetaField('repeat_type', $repeatType);\n\n if ($repeatType == CalendarEvent::REPEAT_WEEKLY) {\n $calendarEvent->setMetaField('repeat_day', $repeatDay);\n } else {\n $calendarEvent->setMetaField('repeat_month_day', $repeatMonthDay);\n }\n\n $calendarEvent->save();\n\n $office->assignCalendarEvent($calendarEvent);\n $site->assignCalendarEvent($calendarEvent);\n\n flash(__('Successfully saved recurring appointment.'));\n\n return redirect()->route('office.settings.edit.general.section', [\n 'section' => 'recurring_appointments'\n ]);\n }\n\n return redirect()->route('office.settings.edit.general.section', [\n 'section' => 'recurring_appointments',\n 'modal' => 'true'\n ])->withErrors($validator)\n ->withInput();\n }\n\n flash(__('Unauthorized Access'));\n return redirect('/');\n }", "public function store(Request $request)\n {\n $id = $request->session()->get('id');\n $user = \\DB::table('users')->whereId($id)->first();\n $data['user'] = $user;\n $roleId = $user->role_id;\n $rules = array(\n 'parentId' => 'required',\n 'startDate' => 'required|date|after:today',\n 'startTime'=>'required|date_format:H:i',\n //'endDate'=>'required|date|after_or_equal:startDate',\n 'endTime'=>'required|after:startTime|date_format:H:i',\n 'appointmentReason'=>'required',\n 'contactNo'=>'required|digits:10',\n );\n $this->validate($request,$rules);\n $teacherDetails = UserDetails::where('user_id',$id)->first();\n $teacherName = $teacherDetails->name;\n $parentId = Input::get('parentId');\n $parentDetails = UserDetails::where('user_id',$parentId)->first();\n $gcmRegistrationId[0] = $parentDetails->gcmRegistrationId;\n// $title = Input::get('title');\n $appointmentReason = Input::get('appointmentReason');\n $contactNo = Input::get(\"contactNo\");\n $startDate = Input::get('startDate');\n $startDate = Carbon::parse($startDate);\n $endDate = $startDate;\n $endDate = Carbon::parse($endDate);\n $startTime =Input::get('startTime');\n $startTime = Carbon::parse($startTime);\n $hours = (double)$startTime->format('H');\n $minutes = (double)$startTime->format('i');\n $seconds = (double)$startTime->format('s');\n $startDateTime = date_time_set($startDate,$hours,$minutes,$seconds);\n //$endDate = Carbon::parse(Input::get('endDate'));\n $endTime =Input::get(\"endTime\");\n $endTime = Carbon::parse($endTime);\n $hours = (double)$endTime->format('H');\n $minutes = (double)$endTime->format('i');\n $seconds = (double)$endTime->format('s');\n $endDateTime = date_time_set($endDate,$hours,$minutes,$seconds);\n $teacherSlots = TeacherAppointmentSlots::all()->where('teacher_id',$id);\n $flag = 0;\n\n foreach ($teacherSlots as $teacherSlot){\n $slotId = $teacherSlot->id;\n $calendarEventId = $teacherSlot->calendarEventsId;\n $calendarEvent = CalendarEvent::where('id',$calendarEventId)->first();\n $slotStart = $calendarEvent->start;\n $slotEnd = $calendarEvent->end;\n //If requested time is clashing with the existing slots\n if(($startDateTime==$slotStart)|| ($endDateTime==$slotEnd)||\n ($startDateTime>$slotStart && $startDateTime<$slotEnd)||\n ($endDateTime<$slotEnd && $endDateTime>$slotStart))\n {\n //If the existing slot is not booked\n if($teacherSlot->isBooked == 0){\n $flag=1;\n try{\n \\DB::beginTransaction();\n \\DB::table('teacherAppointmentsSlots')\n ->where('id', $slotId)\n ->update(['isBooked' => 1]);\n $calendarEvent = new CalendarEvent();\n $calendarEvent->title = \"Parent Appointment\";\n $calendarEvent->start = $startDateTime;\n $calendarEvent->end = $endDateTime;\n $calendarEvent->eventType = \"Parent Appointment\";\n $imageUrl = Storage::url('public/default/request.jpg');\n $calendarEvent->imageUrl = $imageUrl;\n $calendarEvent->school_id = $user->school_id;\n $calendarEvent->save();\n $slot = new TeacherAppointmentSlots();\n $slot->teacher_id = $id;\n $slot->isBooked = 1;\n $slot->calendarEventsId=$calendarEvent->id;\n $slot->save();\n $apppointmentRequest = new AppointmentRequest();\n $apppointmentRequest->parent_id = $parentId;\n $apppointmentRequest->teacher_id = $id;\n $apppointmentRequest->teacherAppointmentsSlot_id = $slot->id;\n $apppointmentRequest->reasonOfAppointment = $appointmentReason;\n $apppointmentRequest->contactNo = $contactNo;\n $apppointmentRequest->isAwaited = 1;\n $apppointmentRequest->isCancel = 0;\n $apppointmentRequest->isApproved = 0;\n //Admin or Principal's request\n if ($roleId ==1){\n $apppointmentRequest->requestType = \"Principal Request\";\n }\n else{\n $apppointmentRequest->requestType = \"Teacher Request\";\n }\n $apppointmentRequest->save();\n $appointmentLog = new AuditAppointments();\n $appointmentLog->eventId = $calendarEvent->id;\n //Appointment Request initiation state\n $appointmentLog->Appointmentstate = 1;\n $appointmentLog->triggeredBy = $teacherName;\n $appointmentLog->save();\n\n }catch (Exception $e){\n \\DB::rollback();\n return redirect(route('appointments.index'))->with('failure', 'Could not send appointment request. Please try again');\n }\n \\DB::commit();\n $eventDetails = CalendarEvent::where('id',$calendarEvent->id)->first();\n $url = $eventDetails->imageUrl;\n return $message = array(\"message\"=>\"Request of Appointment by $teacherName on $startDate /n from $startTime to $endTime.Whatsapp Video Call Number : $contactNo\",\n \"eventId\"=> $calendarEvent->id,\"imageUrl\"=>$url,\"type\"=>4);\n $this->sendPushNotificationToGCM($gcmRegistrationId,$message);\n }\n //If existing slot is booked\n else{\n return redirect(route('appointments.index'))->with('failure','Slot is already booked');\n }\n }\n }\n if ($flag == 1){\n return redirect(route('appointments.index'))->with('success', 'Appointment Request Sent Successfully');\n }\n //If requested time is not clashing with the existing slots\n else{\n try{\n \\DB::beginTransaction();\n $calendarEvent = new CalendarEvent();\n $calendarEvent->title = \"Parent Appointment\";\n $calendarEvent->start = $startDateTime;\n $calendarEvent->end = $endDateTime;\n $calendarEvent->eventType = \"Parent Appointment\";\n $imageUrl = Storage::url('public/default/request.jpg');\n $calendarEvent->imageUrl = $imageUrl;\n $calendarEvent->school_id = $user->school_id;\n $calendarEvent->save();\n $slot = new TeacherAppointmentSlots();\n $slot->teacher_id = $id;\n $slot->isBooked = 1;\n $slot->calendarEventsId=$calendarEvent->id;\n $slot->save();\n $apppointmentRequest = new AppointmentRequest();\n $apppointmentRequest->parent_id = $parentId;\n $apppointmentRequest->teacher_id = $id;\n $apppointmentRequest->teacherAppointmentsSlot_id = $slot->id;\n $apppointmentRequest->reasonOfAppointment = $appointmentReason;\n $apppointmentRequest->contactNo = $contactNo;\n $apppointmentRequest->isAwaited = 1;\n $apppointmentRequest->isCancel = 0;\n $apppointmentRequest->isApproved = 0;\n $apppointmentRequest->requestType = \"Teacher Request\";\n $apppointmentRequest->save();\n $appointmentLog = new AuditAppointments();\n $appointmentLog->eventId = $calendarEvent->id;\n //Appointment Request initiation state\n $appointmentLog->Appointmentstate = 1;\n $appointmentLog->triggeredBy = $teacherName;\n $appointmentLog->save();\n\n } catch (Exception $e) {\n \\DB::rollback();\n redirect(route('appointments.index'))->with('failure', 'Could not send appointment request. Please try again');\n }\n \\DB::commit();\n $eventDetails = CalendarEvent::where('id', $calendarEvent->id)->first();\n $url = $eventDetails->imageUrl;\n $message = array(\"message\" => \"Request of Appointment by $teacherName on $startDate from $startTime to $endTime.Whatsapp Video Call Number : $contactNo\",\n \"eventId\" => $calendarEvent->id, \"imageUrl\" => $url, \"type\" => 4);\n// $this->sendPushNotificationToGCM($gcmRegistrationId, $message);\n if($this->addMessageToNoticeBoard($parentId, $message)) {\n $this->sendPushNotificationToGCM($gcmRegistrationId, $message);\n// return redirect(route('appointments.index'));\n return redirect(route('appointments.index'))->with('success', 'Appointment Request Sent Successfully');\n }\n// return redirect(route('appointments.index'))->with('success', 'Appointment Request Sent Successfully');\n\n }\n }", "function appointmentRecord($id_cliente)\r\n{\r\n\t//arreglo para captura de datos\r\n\t$cap = array();\r\n\t//arreglo para lmacenar los indices del checked\r\n\t$indice = array();\r\n\t//arreglos para almacenar lo que arroje la base\r\n\t$id_serivice = array();\r\n\t$price = array();\r\n\t\r\n\t$cap[4] = trim($_POST[\"horario\"]);\r\n\t$cap[3] = trim($_POST[\"fecha\"]);\r\n\t$cap[0] = trim($_POST[\"txtMarca\"]);\r\n\t$cap[2] = trim($_POST[\"txtSubMarca\"]);\r\n\t$cap[1] = trim($_POST[\"txtModelo\"]);\r\n\t$cap[6] = $id_cliente;\r\n\t$cap[5] = 0;\r\n\t\r\n\t$id_serivice = extractColumnForTable('clave_servicio', 'catalogo_servicios', \"\");\r\n\t$price = extractColumnForTable('precio', 'catalogo_servicios', \"\");\r\n\t\r\n\t//obtenemos el precio total\r\n\tfor($i = 0; count($id_serivice) > $i; $i++)\r\n\t{\r\n\t\tif(isset($_POST[$id_serivice[$i]]))\r\n\t\t{\r\n\t\t\t$cap[5] += $price[$i];\r\n\t\t\tif($i == 0)\r\n\t\t\t\t$indice[0] = \"0\";\r\n\t\t\telse \r\n\t\t\t\t$indice[$i] = $i;\r\n\t\t}\r\n\t\telse \r\n\t\t\t$indice[$i] = \"\";\r\n\t}\r\n\t\r\n\t//retorna \r\n\t//$base[0] = numero de la cita\r\n\t//$base[1] = resulset de la captura de la cita\r\n\t\r\n\t$insert = 0;\r\n\t$idCita = 0;\r\n\t\r\n\tif(insertCita($cap) > 0)\r\n\t{\r\n\t\t$idCita = extractIdCita($cap[4], $cap[3]);\r\n\t\t\r\n\t\tfor($i = 0; count($id_serivice) > $i; $i++)\r\n\t\t{\r\n\t\t\tif($indice[$i] != \"\")\r\n\t\t\t{\r\n\t\t\t\t//message(\"id cita=\".$idCita.\" id servicio\".$id_serivice[$i] , \"\");\r\n\t\t\t\t$insert = insertDetalleServicio($idCita, $id_serivice[$i]);\r\n\t\t\t}\r\n\t\t}\r\n\t\tif($insert > 0)\r\n\t\t\tmessage(\"El registro de su cita se completo con exito\", \"../acount/ConsultAppointment.php\");\r\n\t\telse\r\n\t\t\tmessage(\"Error al intentar registrar su cita\\\\nIntente de nuevo\", \"../acount/appointmentRecord.php\");\r\n\t}\r\n\telse \r\n\t\tmessage(\"Error al intentar registrar su cita\\\\nIntente de nuevo\", \"../acount/appointmentRecord.php\");\r\n\t\r\n}", "public function appointments()\n\t{\n\t\tif (!is_cli())\n\t\t{\n\t\t\techo \"This script can only be accessed via the command line\" . PHP_EOL;\n\t\t\treturn;\n\t\t}\n\n\t\t$participations = $this->participationModel->get_confirmed_participations();\n\t\tforeach ($participations as $participation)\n\t\t{\n\t\t\t$appointment = strtotime($participation->appointment); \n\t\t\tif ($appointment > strtotime('tomorrow') && $appointment <= strtotime('tomorrow + 1 day')) \n\t\t\t{\t\t\t\t\t\n\t\t\t\treset_language(L::DUTCH);\n\t\t\t\t\n\t\t\t\t$participant = $this->participationModel->get_participant_by_participation($participation->id);\n\t\t\t\t$experiment = $this->participationModel->get_experiment_by_participation($participation->id);\n\t\t\t\t$message = email_replace('mail/reminder', $participant, $participation, $experiment);\n\t\t\n\t\t\t\t$this->email->clear();\n\t\t\t\t$this->email->from(FROM_EMAIL, FROM_EMAIL_NAME);\n\t\t\t\t$this->email->to(in_development() ? TO_EMAIL_DEV_MODE : $participant->email);\n\t\t\t\t$this->email->subject('Babylab Utrecht: Herinnering deelname');\n\t\t\t\t$this->email->message($message);\n\t\t\t\t$this->email->send();\n\t\t\t\t// DEBUG: $this->email->print_debugger();\n\t\t\t}\n\t\t}\n\t}", "function addPatientNotesToDatabase($fileNumber, $name, $phoneNo, $dateOfBirth, $progressNotes, $dentist)\n{\n $result = ['result' => false, 'message' => 'Unable to save patient Notes !'];\n $isPatientDataValid = isPatientDataValid($fileNumber, $name, $phoneNo, $dateOfBirth);\n if (!$isPatientDataValid['result']) {\n $result['message'] = $isPatientDataValid['message'];\n return $result;\n }\n $data = [\n 'FileNumber' => $fileNumber,\n 'PatientName' => $name,\n 'PatientNo' => $phoneNo,\n 'DOB' => $dateOfBirth,\n 'DentistName' => $dentist,\n ];\n $data['AppointmentDate'] = getDefaultDate();\n $data['AppointmentTime'] = getDefaultDate(null, true);\n $isDentistAvailable = isDentistAvailable($data['DentistName'], $data['AppointmentTime']);\n if (!$isDentistAvailable['result']) {\n $result['message'] = $isDentistAvailable['message'];\n return $result;\n }\n $data['ProgressNotes'] = $progressNotes;\n $appObject = getAppointmentObject($data);\n $appObject = setAppointmentId($appObject);\n $patientSaved = saveRecord(APPOINTMENTS_COLLECTION, $appObject, true);\n\n if ($patientSaved) {\n $result['message'] = \"Patient Notes Saved Successfully\";\n $result['result'] = true;\n return $result;\n }\n return $result;\n}", "public function insertcreatedperiods()\n {\n if (!Gate::allows('Administrator')) return redirect('/home')->with('warning', __('Somehow you the system tried to let you do something which is not allowed. So you are sent home!'));\n Input::merge(['test' => 'redirected']);\n $seasons = Input::get('seasons', 5);\n $periodlength = Input::get('periodlength', 7);\n $houseid = Input::get('houseid', 1);\n $ownerid = House::Find($houseid)->ownerid;\n $errors = [];\n $success = __('No new period have been created');\n $houses = House::filter(Input::all())->pluck('name', 'id')->toArray();\n $thisyear = Carbon::now()->year;\n\n\n\n //Set default data for each season\n $defaultperiod = [];\n $data = Input::get('data');\n\n $defaultperiod['basepersons'] = $data['basepersons'];\n $defaultperiod['maxpersons'] = $data['maxpersons'];\n $defaultperiod['baseprice'] = $data['baseprice'];\n $defaultperiod['personprice'] = $data['personprice'];\n $seasonstart = $data['seasonstart'];\n $seasonend = $data['seasonend'];\n\n\n for($i=0;$i<$seasons;$i++)\n {\n $seasonstart[$i] = Carbon::parse($seasonstart[$i]);\n $seasonend[$i] = Carbon::parse($seasonend[$i]);\n if ($seasonstart[$i]->gte($seasonend[$i])) $errors[$i] = __('Season').$i.': '.__('The end date must be after start date.');\n if ($i > 0)\n {\n if ($seasonend[$i-1]->gt($seasonstart[$i])) $errors[$i] = __('The start date must be after the previous end date.');\n }\n }\n\n //echo('Redirecting test: '.Input::get('test', 'nothing') . ' seasonend 0: ' .$seasonend[0]->format('d-m-Y'));\n if (sizeof($errors) > 0)\n {\n $success = __('Noting created, please check the errors below.');\n }\n\n //Find Easter sundays\n for($i=0;$i<6;$i++)\n {\n $year[$i] = $thisyear + $i;\n $easter[$i] = date('d-m-Y',easter_date($year[$i]));\n }\n\n //We create periods\n if (sizeof($errors) == 0)\n {\n for($i=0;$i<$seasons;$i++)\n {\n $from = clone($seasonstart[$i]);\n $to = clone($from);\n $to->addDays($periodlength);\n $counter = 0;\n //die(\"Periodlength: $periodlength from: \".$from.\" to: \".$to);\n while ($to->lte($seasonend[$i]))\n {\n //check for committed periods\n $count = Periodcontract::where('houseid', $houseid)->where('committed', 1)->whereDate('from', '<=', $from)->whereDate('to', '>=', $to)->count();\n $count += Periodcontract::where('houseid', $houseid)->where('committed', 1)->whereDate('from', '<=', $to)->whereDate('to', '>=', $to)->count();\n $count += Periodcontract::where('houseid', $houseid)->where('committed', 1)->whereDate('from', '<=', $from)->whereDate('to', '>=', $from)->count();\n\n if($count > 0)\n {\n $errors[] = __('There are committed periods among the new, it will not be saved').'.';\n }\n else\n {\n //Check for overlapping non-committed periods and delete them\n $periodfrom = Periodcontract::where('houseid', $houseid)->where('committed', null)->whereDate('from', '<=', $from)->whereDate('to', '>', $from)->orderBy('to', 'desc')->first();\n $periodto = Periodcontract::where('houseid', $houseid)->where('committed', null)->whereDate('from', '<', $to)->whereDate('to', '>=', $to)->orderBy('to')->first();\n if (($periodfrom) && ($periodto))\n {\n $overlappingtpdelete = Period::where('houseid', $houseid)->whereDate('to', '>=', $periodfrom->from)->whereDate('from', '<=', $periodto->to)->count();\n if ($overlappingtpdelete > 0) $errors[] = __('At least one existing overlapping period has been deleted.');\n Period::where('houseid', $houseid)->whereDate('to', '>=', $periodfrom->from)->whereDate('from', '<=', $periodto->to)->delete();\n }\n elseif($periodfrom)\n {\n Period::where('id', $periodfrom->id)->delete();\n $errors[] = __('One existing overlapping period has been deleted.');\n }\n\n //There are no committed period clashing with the period we will create no, so we go ahead\n //die(var_dump($defaultperiod));\n //if (!array_key_exists($i, $defaultperiod)) die(\"Key $i does not exist in array:\".var_dump($defaultperiod));\n $period = new Period(['basepersons' => $defaultperiod['basepersons'][$i],\n 'maxpersons' => $defaultperiod['maxpersons'][$i],\n 'baseprice' => $defaultperiod['baseprice'][$i],\n 'personprice' => $defaultperiod['personprice'][$i],\n 'houseid' => $houseid,\n 'ownerid' => $ownerid]);\n $period->from = $from;\n $period->to = $to;\n $period->year = $from->year;\n $period->weeknumber = $to->weekOfYear;\n if(!$period->save())\n {\n die(\"Errors: \".var_dump($period->getErrors()));\n }\n $counter++;\n $success = $counter.' '.__('new periods created');\n }\n $from = clone($to);\n $to = $to->addDays($periodlength);\n }\n }\n }\n\n session()->flash('success', $success);\n return view('house/createperiods', [\n 'houses' => $houses,\n 'houseid' => $houseid,\n 'seasons' => $seasons,\n 'periodlength' => $periodlength, 'seasons' => $seasons,\n 'year' => $year,\n 'errors' => $errors,\n 'easter' => $easter,\n 'data' => $data]);\n\n }", "public function __construct(Appointment $appointment)\n {\n $this->appointment = $appointment;\n }", "public function store()\n\t{\n\t\t$MDTMeeting = new MDTMeeting;\n $MDTMeeting ->date = Input::get('date');\n $MDTMeeting ->location = Input::get('location');\n $MDTMeeting ->center_id = Auth::User()->center_id;\n $MDTMeeting->save();\n $case = Input::get('case');\n for($i=0;$i<count($case);$i++)\n {\n $MDTCase = new MDTCase;\n $MDTCase->case_id = $case[$i];\n $MDTCase->MDTMeeting_id = $MDTMeeting->id;\n $MDTCase->recommendation = Input::get('recommendation')[$i];\n $MDTCase->save();\n }\n \n return Redirect::to('MDTReport/'.$MDTMeeting->id);\n\t}", "function gen_apmt_calendar($PID) {\n\n $conn = sql_connect();\n $sql_apmt = mysqli_query($conn, \"SELECT * FROM Appointments WHERE Patient_ID=\".$PID.\";\") or die(mysqli_error($conn));\n\n if(mysqli_num_rows($sql_apmt) == 0) {\n echo \"No appointments found\";\n return;\n }\n\n echo \"<table><tr><th> Appointment ID </th><th> Doctor </th><th> Patient </th><th> Clinic </th><th> Appointment Time </th><th>Action</th></tr>\";\n\n while($apmt = mysqli_fetch_assoc($sql_apmt)) {\n \n $sql_patient = mysqli_query($conn, \"SELECT * FROM Patients WHERE PID=\".$apmt['Patient_ID'].\";\");\n $patient = mysqli_fetch_assoc($sql_patient);\n\n $sql_doc = mysqli_query($conn, \"SELECT * FROM Doctors WHERE NPI=\".$apmt['Doctor_ID'].\";\");\n $doc = mysqli_fetch_assoc($sql_doc);\n\n $sql_clinic = mysqli_query($conn, \"SELECT * FROM Clinics WHERE Clinic_ID=\".$apmt['Clinic_ID'].\";\");\n $clinic = mysqli_fetch_assoc($sql_clinic);\n\n echo \"<tr><td>\".$apmt['Appt_ID'].\"</td><td>\".$doc['Name'].\" (\".$doc['NPI'].\")</td><td>\".$patient['Last_Name'].\", \".$patient['First_Name'].\" (\".$patient['PID'].\") </td><td>\".$clinic['Clinic_name'].\"</td><td>\".$apmt['Appointment_time'].\"</td>\";\n\n echo \"<td><form action='patient_delete_appointment.php' method='POST'><input type='hidden' name='Appt_ID' value=\".$apmt['Appt_ID'].\"><input type='submit' value='Delete Appt' onclick='return confirm_delete()'></form></td></tr>\";\n\n }\n\n echo \"</table>\";\n\n }", "public function postCreate(){\n\t\t\n\t\t//read from date\n\t\t$date = date('Y-m-d', strtotime(Input::get('from').' +0 day'));\t\n\t\t$to_d = date('Y-m-d', strtotime(Input::get('to').' +0 day'));\n\n\t\t$room_type_id = Input::get('roomType');\n\t\t$service_id = Input::get('service');\n\n\t\t//check for availability of date range for selected room type and service type\n\t\t$fdate = DB::table('room_price_calenders')\n\t\t\t->where('start_date','=',$date)\n\t\t\t->where('room_type_id','=',$room_type_id)\n\t\t\t->where('service_id','=',$service_id)\n\t\t\t->get();\n\n\t\t//if such date range does not exist for the selected room type and service type\n\t\tif(!$fdate){\n\t\t\t//convert from date to dateTime format\n\t\t\t$from = new DateTime($date );\n\t\t\t//convert to date to dateTime format\n\t\t\t$to = new DateTime($to_d);\n\n\t\t\t//finds the days between from and to dates\n\t\t\t$days = $to->diff($from)->format(\"%a\");\t\t\n\n\t\t\t//loop inserts new rows for all days between from and to dates\n\t\t\tfor ($i=0; $i <= $days; $i++) { \n\t\t\t\t$calendar = new Calendar;\n\t\t\t\t$calendar->room_type_id = $room_type_id;\n\t\t\t\t$calendar->service_id = $service_id;\n\t\t\t\t$calendar->start_date = $date;\n\t\t\t\t$calendar->end_date = new DateTime($to_d);\n\t\t\t\t$calendar->price = Input::get('price');\n\t\t\t\t$calendar->discount_rate = Input::get('discount');\t\t\t\n\t\t\t\t$calendar->save();\n\n\t\t\t\t//get next date\n\t\t\t\t$date = date('Y-m-d', strtotime($date.' +1 day'));\t\n\n\t\t\t}\t\n\t\t\t\treturn 1;\t\t\n\t\t\t\n\t\t\t}\n\t\t\t//if the given date range existing for the selected room type and service type\n\t\t\telse{\n\t\t\t\treturn 2;\n\t\t\t}\t\t\n\n\t\t\n\t}", "function addPatientToDatabase($fileNumber, $name, $phoneNo, $dateOfBirth, $progressNotes = null)\n{\n $result = ['result' => false, 'message' => 'Unable to save patient !'];\n $isPatientDataValid = isPatientDataValid($fileNumber, $name, $phoneNo, $dateOfBirth);\n if (!$isPatientDataValid['result']) {\n $result['message'] = $isPatientDataValid['message'];\n return $result;\n }\n $patients = getPatients();\n $patientExists = false;\n // good for adding sorting before searching\n foreach ($patients as $patient) {\n $valuesExist = $patient['FileNumber'] === $fileNumber || ($patient['PatientNo'] === $phoneNo && $patient['PatientName'] === $name);\n if ($valuesExist) {\n $patientExists = true;\n break;\n }\n }\n if ($patientExists) {\n $result['message'] = \"Similar Patient Already Exists !\";\n return $result;\n }\n $data = [\n 'FileNumber' => $fileNumber,\n 'PatientName' => $name,\n 'PatientNo' => $phoneNo,\n 'DOB' => $dateOfBirth,\n ];\n\n if ($progressNotes) {\n $data['ProgressNotes'] = $progressNotes;\n $appObject = getAppointmentObject($data);\n $appObject = setAppointmentId($appObject);\n // $appObject['FirebaseId'] = null;\n $patientSaved = saveRecord(APPOINTMENTS_COLLECTION, $appObject, true);\n } else {\n $patientSaved = saveRecord(PATIENTS_COLLECTION, $data, true);\n }\n if ($patientSaved) {\n $result['message'] = \"Patient Saved Successfully\";\n $result['result'] = true;\n return $result;\n }\n return $result;\n}", "public function store()\n { \n $days = $this->vacationDays();\n $date = Carbon\\Carbon::create(request('from_date'));\n \n for ($i=0;$i<=$days;$i++){\n $date_holiday = $date->format('Y-m-d');\n request()->user()->holidayDays()->create([\n 'holiday_id' => request('holiday_id'),\n 'date_holiday' => $date_holiday,\n 'description' => request('description'), \n ]);\n $date->addDays(1);\n }\n toast(trans('msg.stored_successfully'),'success');\n return redirect()->route('holidays-days.index',request('holiday_id'));\n }", "public function __construct(Appointment $appointment)\n\t{\n\t\t$this->appointment = $appointment;\n\t}", "public function actionCreate($id) {\n $appointment = Appointment::find($id)->one();\n $model = new PortCallData();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n 'appointment' => $appointment,\n ]);\n }\n }", "public function attendance_calendar($action = 'calendar_list', $attendance_id = 0, $calendar_id = 0)\n {\n $attendance = new Attendance();\n $calendar_id = intval($calendar_id);\n $data = array();\n $data['attendance_id'] = $attendance_id;\n $attendance_id = intval($attendance_id);\n $groupList = isset($_POST['groups']) ? array($_POST['groups']) : array();\n\n if ($action == 'calendar_add') {\n if (strtoupper($_SERVER['REQUEST_METHOD']) == \"POST\") {\n if (!isset($_POST['cancel'])) {\n if (isset($_POST['repeat'])) {\n //@todo check this error_logs\n $start_datetime = api_strtotime(\n api_get_utc_datetime($_POST['date_time']), 'UTC'\n );\n\n $end_datetime = api_strtotime(api_get_utc_datetime($_POST['end_date_time'].' 23:59:59'), 'UTC');\n $checkdate = api_is_valid_date(api_get_utc_datetime($_POST['end_date_time'].' 23:59:59'));\n\n $repeat_type = $_POST['repeat_type'];\n if (($end_datetime > $start_datetime) && $checkdate) {\n $attendance->attendance_repeat_calendar_add(\n $attendance_id,\n $start_datetime,\n $end_datetime,\n $repeat_type,\n $groupList\n );\n $action = 'calendar_list';\n } else {\n if (!$checkdate) {\n $data['error_checkdate'] = true;\n } else {\n $data['error_repeat_date'] = true;\n }\n $data['repeat'] = true;\n $action = 'calendar_add';\n }\n } else {\n $datetime = $_POST['date_time'];\n $datetimezone = api_get_utc_datetime($datetime);\n if (!empty($datetime)) {\n $attendance->set_date_time($datetimezone);\n $attendance->attendance_calendar_add($attendance_id, $groupList);\n $action = 'calendar_list';\n } else {\n $data['error_date'] = true;\n $action = 'calendar_add';\n }\n }\n } else {\n $action = 'calendar_list';\n }\n }\n } else if ($action === 'calendar_edit') {\n $data['calendar_id'] = $calendar_id;\n if (strtoupper($_SERVER['REQUEST_METHOD']) == \"POST\") {\n if (!isset($_POST['cancel'])) {\n $datetime = $_POST['date_time'];\n $datetimezone = api_get_utc_datetime($datetime);\n $attendance->set_date_time($datetimezone);\n $attendance->attendance_calendar_edit($calendar_id, $attendance_id);\n $data['calendar_id'] = 0;\n $action = 'calendar_list';\n } else {\n $action = 'calendar_list';\n }\n }\n } else if ($action == 'calendar_delete') {\n $attendance->attendance_calendar_delete($calendar_id, $attendance_id);\n $action = 'calendar_list';\n } else if ($action == 'calendar_all_delete') {\n $attendance->attendance_calendar_delete(0, $attendance_id, true);\n $action = 'calendar_list';\n }\n\n $data['action'] = $action;\n $data['attendance_calendar'] = $attendance->get_attendance_calendar(\n $attendance_id,\n 'all',\n null,\n null,\n true\n );\n $data['is_locked_attendance'] = $attendance->is_locked_attendance($attendance_id);\n // render to the view\n $this->view->set_data($data);\n $this->view->set_layout('layout');\n $this->view->set_template('attendance_calendar');\n $this->view->render();\n }", "public function onManagerSubmitAppointments() {\nglobal $_LW;\nif (!empty($_LW->_POST['dropdown_checked']) && !empty($_LW->_POST['items'])) { // handle checked item requests\n\t$this->saveChecked($_LW->_POST['dropdown_checked'], $_LW->_POST['items']);\n};\n}", "public function store(CreateJourneyRequest $request)\n { \n $journey = new Journey;\n //$journey->applicant_id = '000004';\n $journey->applicant_id = Auth::user()->emp_id;\n $journey->vehical_id = $request->vehical_id;\n if ($vehicle = Vehical::whereId($request->vehical_id)->first()){\n $journey->driver_id = $vehicle->driver->id;\n }\n $string=$request->time_range;\n $pos = strrpos($string, ' - ');\n $first = substr($string, 0, $pos);\n $second = substr($string, $pos + 3); \n if($expected_start_date_time = Carbon::parse($first)){\n $journey->expected_start_date_time = $expected_start_date_time;\n }\n if($expected_end_date_time = Carbon::parse($second)){\n $journey->expected_end_date_time = $expected_end_date_time;\n } \n $journey->purpose = $request->purpose;\n $journey->places_to_be_visited = $request->places_to_be_visited;\n $journey->number_of_persons = $request->number_of_persons;\n $journey->expected_distance = $request->expected_distance;\n \n /* check long distance */\n if($request->expected_distance>=150){\n $journey->is_long_distance = 1;\n }\n\n // if(Auth::user()->role_id == 1){ // for director level approve already\n // $journey->journey_status_id = 2;\n // $journey->approved_at = Carbon::now();\n // $journey->approved_by = Auth::user()->emp_id;\n // }\n\n $journey->funds_allocated_from_id = $request->funds_allocated_from_id;\n $journey->divisional_head_id = $request->divisional_head_id;\n\n $journey->save(); \n\n $devHead_id =$request->divisional_head_id;\n\n /* Divisional head Email */\n $emailAddress = Employee::where('r_id','=',$devHead_id)->first()->emp_email.'@ucsc.cmb.ac.lk';\n //$emailAddress= '[email protected]'; //test\n\n $place= 'PLACE -- '.$journey->places_to_be_visited;\n $start= 'START -- '.$journey->expected_start_date_time->toDayDateTimeString();\n $end=' END -- '.$journey->expected_end_date_time->toDayDateTimeString();\n $applicant= 'APPLICANT -- '.$journey->applicant->emp_title.' '.$journey->applicant->emp_initials.'. '.$journey->applicant->emp_surname;\n\n //Mail::send(new JourneyRequestMail($emailAddress,$place,$start,$end,$applicant));\n\n return redirect()->back()->with(['success'=>'Journey added successfully !']);\n }", "public function makeBooking(Request $request){\n\t\t//dd($request->get('booking')); \n\t\tif (Auth::user()->type!=4) {\n\t\t\t# code...\n\t\t\treturn redirect()->back(); \n\t\t}\n\n\t\t$val=$this->customValidation($request->get('booking')); \n\t\tif ($val==0) {\n\t\t\t# code...\n\t\t\treturn redirect()->back()->withErrors(\"You haven't made a booking.\"); \n\t\t}elseif($val>1){\n\t\t\treturn redirect()->back()->withErrors(\"You can only book one appointment at a time.\"); \n\t\t}\n\t\tforeach ($request->get('booking') as $_temp) {\n\t\t\t# code...\n\t\t\tif ($_temp!=\"none\") {\n\t\t\t\t# code...\n\t\t\t\t$appointId=$_temp; \n\t\t\t}\n\t\t}\n\t\t//dd($appointId);\n\t\t$appointment = Appointment::findOrFail($appointId); \n\t\tif ($appointment->available==1) {\n\t\t\t# code...\n\t\t\t$booking = Booking::create(['appointment_id'=>$appointment->id,'user_id'=>Auth::user()->id]);\n\t\t\t$appointment->update(['available'=>0]); \n\t\t\treturn redirect('home/patient'); \n\t\t}\n\t\treturn redirect()->back()->withErrors(\"Error creating the booking\"); \n\t}", "public function create()\n {\n //\n $startDate = Input::get('start_date');\n $endDate = Input::get('end_date');\n $holidays = Holiday::where('holiday_type', 'holiday')->lists('holiday');\n $bridges = Holiday::where('holiday_type', 'bridge')->lists('holiday');\n\n /* \n * Mantendo as linhas abaixo como referência\n */\n\n // echo 'Data de início: ' . date('d-m-Y', strtotime($startDate)) . \"<br>\";\n // echo 'Um dia pra frente: ' . date('d-m-Y', strtotime('+1 day', strtotime($startDate))) . \"<br>\";\n // echo 'Uma semana pra frente: ' . date('d-m-Y', strtotime('+1 week', strtotime($startDate))) . \"<br>\";\n // echo 'Um mês pra frente: ' . date('d-m-Y', strtotime('+1 month', strtotime($startDate))) . \"<br>\";\n\n /*echo 'sábados: ' . Input::get('saturdays') . '<br>';\n echo 'domingos: ' . Input::get('sundays') . '<br>';\n echo 'feriados: ' . Input::get('holidays') . '<br>';\n echo 'dias ponte: ' . Input::get('bridges') . '<br>';*/\n\n while (strtotime($startDate) <= strtotime($endDate)) {\n\n $allocation = new Allocation();\n $allocation->service_order_id = Input::get('service_order_id');\n $allocation->workforce_id = Input::get('workforce_id');\n $allocation->service_id = Input::get('service_id');\n $allocation->function = Input::get('function');\n // Carbon::createFromFormat('d/m/Y', Input::get('holiday'));\n $allocation->date = Carbon::createFromFormat('Y-m-d', $startDate);\n $allocation->start_time = Input::get('start_time');\n $allocation->end_time = Input::get('end_time');\n\n switch (true) {\n \n // Dia de semana E não feriado E não ponte\n case ((date('N', strtotime($startDate)) < 6) \n && (array_search(date('Y-m-d', strtotime($startDate)), $holidays->toArray()) === FALSE) \n && (array_search(date('Y-m-d', strtotime($startDate)), $bridges->toArray()) === FALSE)):\n // echo 'dia de semana, não feriado e não ponte <br>';\n \n $allocation->save();\n break;\n\n // Sábado com opção selecionada\n case ((date('D', strtotime($startDate)) === 'Sat') && (Input::get('saturdays'))):\n // echo 'sabado válido' . '<br>';\n $allocation->save();\n break;\n\n // Domingo com opção selecionada\n case ((date('D', strtotime($startDate)) == \"Sun\") && (Input::get('sundays'))):\n // echo 'domingo válido' . '<br>';\n $allocation->save();\n break;\n\n // feriado DURANTE A SEMANA com a opção selecionada\n case ((array_search(date('Y-m-d', strtotime($startDate)), $holidays->toArray()) !== FALSE)\n && (date('N', strtotime($startDate)) < 6)\n && (Input::get('holidays'))):\n // echo 'feriado válido' . '<br>';\n $allocation->save();\n break;\n\n // // dia-ponte DURANTE A SEMANA com a opção selecionada\n case ((array_search(date('Y-m-d', strtotime($startDate)), $bridges->toArray()) !== FALSE)\n && (date('N', strtotime($startDate)) < 6)\n && (Input::get('bridges'))):\n // echo 'ponte válido' . '<br>';\n $allocation->save();\n break;\n\n }\n\n $startDate = date (\"Y-m-d\", strtotime(\"+1 day\", strtotime($startDate)));\n }\n\n // echo $daysAllocated . ' dias alocados';\n echo 'Finalizado';\n }", "private function createMeeting($data)\n {\n $user = Auth::user(); //get authenticated user\n $meeting = new \\App\\Meeting();\n $meeting->course_id = $data->course_id;\n $meeting->instructorMeeting = $data->instructorMeeting;\n $meeting->start_time = $data->start_time;\n $meeting->end_time = $data->end_time;\n $meeting->save();\n //attach authenticated user and instructor XOR student to the meeting\n $meeting->users()->attach($user);\n if($data->instructorMeeting){\n $meeting->users()->attach($data->instructor);\n }else{\n $meeting->users()->attach($data->student);\n }\n }", "public function createAppointmentRequest($appointment_base, $x_access_token = null, $x_secret_token = null, $authorization = null, $ehelply_active_participant = null, $ehelply_project = null, $ehelply_data = null)\n {\n // verify the required parameter 'appointment_base' is set\n if ($appointment_base === null || (is_array($appointment_base) && count($appointment_base) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $appointment_base when calling createAppointment'\n );\n }\n\n $resourcePath = '/appointments/appointments';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // header params\n if ($x_access_token !== null) {\n $headerParams['x-access-token'] = ObjectSerializer::toHeaderValue($x_access_token);\n }\n // header params\n if ($x_secret_token !== null) {\n $headerParams['x-secret-token'] = ObjectSerializer::toHeaderValue($x_secret_token);\n }\n // header params\n if ($authorization !== null) {\n $headerParams['authorization'] = ObjectSerializer::toHeaderValue($authorization);\n }\n // header params\n if ($ehelply_active_participant !== null) {\n $headerParams['ehelply-active-participant'] = ObjectSerializer::toHeaderValue($ehelply_active_participant);\n }\n // header params\n if ($ehelply_project !== null) {\n $headerParams['ehelply-project'] = ObjectSerializer::toHeaderValue($ehelply_project);\n }\n // header params\n if ($ehelply_data !== null) {\n $headerParams['ehelply-data'] = ObjectSerializer::toHeaderValue($ehelply_data);\n }\n\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($appointment_base)) {\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($appointment_base));\n } else {\n $httpBody = $appointment_base;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = ObjectSerializer::buildQuery($formParams);\n }\n }\n\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = ObjectSerializer::buildQuery($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public static function deleteAppointments($a_obj_id)\n\t{\n\t\tinclude_once('./Services/Calendar/classes/class.ilCalendarCategoryAssignments.php');\n\t\tinclude_once('./Services/Calendar/classes/class.ilCalendarEntry.php');\n\t\t\n\t\tforeach(ilCalendarCategoryAssignments::_getAutoGeneratedAppointmentsByObjId($a_obj_id) as $app_id)\n\t\t{\n\t\t\tilCalendarCategoryAssignments::_deleteByAppointmentId($app_id);\n\t\t\tilCalendarEntry::_delete($app_id);\n\t\t}\n\t}", "public function create()\n\t{\n\t\t$appointment = Appointment::find(Input::get('id'));\n $patient_id = $appointment->patient->id;\n $doctors = Employee::where('role', 'Doctor')->where('status', 'Active')->get();\n $medicines = Medicine::all()->lists('name', 'id');\n\n return View::make('prescriptions.create', compact('medicines', 'appointment', 'patient_id', 'doctors'));\n\t}", "public function store(Request $request)\n {\n // return $request->all();\n $date = $request->att_date;\n $att_date = DB::table('attandances')->where('att_date', $date)->first();\n if($att_date == null){\n foreach($request->user_id as $id){\n $data[] = [\n \"user_id\" => $id,\n \"attandance\" => $request->attandance[$id],\n \"att_date\" => $request->att_date,\n \"att_year\" => $request->att_year,\n \"month\" => $request->month,\n ];\n }\n $att = DB::table('attandances')->insert($data);\n return redirect()->back()->with('message','Attadanse Added Successfully');\n\n }else{\n return redirect()->back()->with('error','Attadanse Already Taken');\n\n }\n }" ]
[ "0.7162468", "0.7064329", "0.6987327", "0.69535434", "0.68258727", "0.68108785", "0.6755043", "0.67542505", "0.6692809", "0.6560941", "0.6493482", "0.64893854", "0.6486579", "0.6480774", "0.6464899", "0.64502203", "0.64326054", "0.64122593", "0.6402608", "0.6377845", "0.6321739", "0.6265498", "0.62283194", "0.62126833", "0.6206251", "0.6195471", "0.6177427", "0.614847", "0.6121327", "0.6110321", "0.6101483", "0.61001897", "0.6087038", "0.6080255", "0.6075182", "0.6072344", "0.60666996", "0.6059227", "0.6048995", "0.6038971", "0.6022823", "0.5983679", "0.5982656", "0.59739345", "0.5966944", "0.59407747", "0.5934096", "0.5931782", "0.5929904", "0.5910499", "0.5909207", "0.59068847", "0.5905084", "0.58966666", "0.587474", "0.5868077", "0.5859555", "0.5854242", "0.58333594", "0.5819219", "0.58156824", "0.5807428", "0.5796587", "0.57950467", "0.5793781", "0.5770308", "0.576064", "0.5760024", "0.5755147", "0.57529616", "0.57369155", "0.5733676", "0.57298464", "0.57264394", "0.5720826", "0.57150364", "0.56971824", "0.5672407", "0.56709045", "0.5670311", "0.5648176", "0.5642517", "0.5629504", "0.5628981", "0.5628182", "0.56206894", "0.56102383", "0.56085706", "0.56064343", "0.5596453", "0.5580599", "0.5574878", "0.55735356", "0.55734795", "0.55730176", "0.5569442", "0.5562992", "0.555208", "0.554754", "0.5537061" ]
0.67864233
6
Destroying appointment. Patient will be able to destroy appointment if needed.
public function destroy($id) { $appointment=Appointment::find($id); $nextAppointments=Appointment::where(['date'=>$appointment->date,'doc_id'=>$appointment->doc_id, ['serial_no','>',$appointment->serial_no]])->get(); if($appointment->delete()) { foreach($nextAppointments as $appt) { $appt->serial_no--; $appt->save(); } return redirect('dashboard')->with('success','Appointment Deleted!'); } else return redirect('dashboard')->with('failure','Appointment Deletion Failed!'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function destroy(Appointment $appointment)\n {\n //\n }", "public function destroy(appointment $appointment)\n {\n //\n }", "public function destroy(Appointments $appointments)\n {\n //\n }", "public function destroy(SubscriptionAppointment $subscriptionAppointment)\n {\n //\n }", "public function destroy(Appointment $appointment, $id)\n {\n $appointment = Appointment::find($id);\n $appointment->delete();\n\n session()->flash('message', 'Appointment deleted successfully!');\n \n return redirect('/help/appointment/home');\n }", "public function destroy(PatientAppointmentReminders $patientAppointmentReminders)\n {\n //\n }", "public function destroy($id)\n {\n $appointment = Appointment::findOrFail($id);\n $appointment->delete();\n return redirect()->route('admin.appointments.index');\n }", "public function delAppointMent(appointmentClass $info)\n { \n $values=array($info->getAppointmentID());\n $sqlDel=\"DELETE FROM appointment WHERE appointment_id=?\";\n $this->execute($sqlDel,$values);\n }", "public function destroy(Admission $admission)\n {\n //\n }", "public function destroy($id)\n {\n //\n DB::table('appointments')->where('id', $id)->delete();\n $dp = DB::table('appointments')->get();\n $dp_obj = $dp->map(function ($element){\n $startdatetime = new Carbon($element->start_date_time);\n $enddatetime = new Carbon($element->end_date_time);\n $patient = Patient::find($element->patient_id)->user->name;\n $physician = Physician::find($element->physician_id)->user->name;\n $nurse = Nurse::find($element->nurse_id)->user->name;\n return [\n 'patient' => $patient, \n 'physician' => $physician,\n 'nurse' => $nurse,\n 'url' => url('admin/appointments'),\n 'id' => $element->id,\n 'exaroom' => $element->examinationroom,\n 'startdatetime' => $startdatetime->toDayDateTimeString(),\n 'enddatetime' => $enddatetime->toDayDateTimeString()\n ];\n });\n return response()->json($dp_obj);\n }", "public function destroy($id)\n {\n $model = Appointment::whereId($id)->first();\n if (empty($model)) {\n return abort('404');\n }\n $model->delete();\n return redirect('/appointment');\n }", "public function destroy($id)\n {\n $appointmentdata = Appointment::where('id',$id)->first();\n if($appointmentdata != ''){\n $appointmentdata->delete();\n $message = trans('messages.delete_form',['form' => trans('messages.appointment')]);\n }\n else{\n $message = trans('messages.not_found_entry',['form' => trans('messages.appointment')]);\n }\n return redirect(route('appointment.index'))->withSuccess($message);\n }", "public static function deleteAppointments($a_obj_id)\n\t{\n\t\tinclude_once('./Services/Calendar/classes/class.ilCalendarCategoryAssignments.php');\n\t\tinclude_once('./Services/Calendar/classes/class.ilCalendarEntry.php');\n\t\t\n\t\tforeach(ilCalendarCategoryAssignments::_getAutoGeneratedAppointmentsByObjId($a_obj_id) as $app_id)\n\t\t{\n\t\t\tilCalendarCategoryAssignments::_deleteByAppointmentId($app_id);\n\t\t\tilCalendarEntry::_delete($app_id);\n\t\t}\n\t}", "public function destroy(Employeepatient $employeepatient)\n {\n //\n }", "public function destroy(Patient $patient)\n {\n //\n }", "public function destroy(Patient $patient)\n {\n //\n }", "public function destroy(Patient $patient)\n {\n //\n }", "public function destroy(Attendance $attendance)\n {\n //\n }", "public function destroy(Attendance $attendance)\n {\n //\n }", "public function destroy(Attendance $attendance)\n {\n //\n }", "public function destroy($id)\n {\n if (Sentry::check()) {\n // Find active user\n $user = Sentry::getUser();\n $event = Appointment::find($id);\n\n // Check if User belongs to group/school which the appointment is from\n if ($user->hasAccess('school') || ($user->hasAccess('event') && $user->school_id == $event->group->school_id)) {\n $event->delete();\n }\n\n return Redirect::route('calendar.index');\n } else {\n return Redirect::route('landing');\n }\n }", "public function destroy($id)\n {\n Appointment::destroy($id);\n return Redirect::route('admin-appointments-index')->with('message', 'Delete Successfull !');\n }", "public function destroy(PatientReminderTime $patientReminderTime)\n {\n //\n }", "public function destroy($id)\n {\n try {\n $appointment = Appointment::findOrFail($id);\n $appointment->delete();\n\n return redirect()->route('appointments.appointment.index')\n ->with('success_message', 'Appointment was successfully deleted.');\n } catch (Exception $exception) {\n\n return back()->withInput()\n ->withErrors(['unexpected_error' => 'Unexpected error occurred while trying to process your request.']);\n }\n }", "public function destroy($patient_id)\n {\n $patient = Patient::find($patient_id)->delete();\n }", "public function destroy(Attendace $attendace)\n {\n //\n }", "public function destroy(Request $request)\n {\n $appointment = Appointment::find($request->id);\n AppointmentWasCancelled::dispatch($appointment);\n $appointment->delete();\n\n\n return response(['message' => 'Deleted']);\n }", "public function destroy(int $id)\n {\n try {\n $deleted = Appointment::whereId($id)->delete();\n if ($deleted)\n return response()->json(['message' => 'Appointment deleted succesfully.'], 200);\n else\n return response()->json(['message' => 'Nothing to delete.'], 200);\n } catch (\\Exception $e) {\n return response()->json($e, 400);\n }\n }", "public function deleteById(int $id): void\n {\n $this->client->delete(\"Appointments/$id\");\n }", "public function destroy(PatientRecord $patientRecord)\n {\n //\n }", "public function destroy(Agenda $agenda)\n {\n //\n }", "public function destroy(attendence $attendence)\n\t{\n\t\t//\n\t}", "public function destroy($id)\n {\n //\n $attendance= PhysiotherapyRegister::find($id);\n $attendance->delete();\n }", "public function destroy(int $id)\n {\n $destroyReponse = $this->appointmentService->destroy($id);\n\n if (!$destroyReponse->success) {\n return redirect()->route('appointments.index')->withError('Erro ao deletar consulta');\n }\n\n return redirect()->route('appointments.index')->withSuccess('Consulta deletada!');\n }", "public function destroy($timeslotID){\n $this->isAuthorize();\n\n // Delete the Specific Data\n $userID = $this->request->session()->get('userID');\n $timeslot = Apt_time_slot::where('userID','=',$userID)->where('id','=',$timeslotID)->firstOrFail();\n $timeslot->forceDelete();\n return redirect('appointments/timeslot')->with('status', 'Successfully Time Slot Deleted!');\n }", "public function destroy($id){ // id del meeting\n\n $meeting = Meeting::findOrFail($id);\n\n //ACTUALIZAMOS EL HORARIO DEL DOCTOR\n $meeting->schedule->update([\"estado\"=>\"0\"]);\n\n //BORRAMOS LA CITA CREADA\n $meeting->delete();\n\n return redirect()->route('cita.ver.index')\n ->with('mensaje','ok',);\n }", "public function destroy($id)\n {\n \tPatientWeek::destroy($id);\n }", "public function destroy($id)\n\t{\n\t\t//\n\t\tpatient::destroy($id);\n\t\t\n\t}", "public function delete($id)\n {\n $appointmentDeletedToPusher = $this->appointmentRepo->findById($id);\n $appointment = $this->appointmentRepo->delete($id);\n \n if($appointment !== true) return $appointment; //no se elimino correctamente\n\n event(new AppointmentDeleted($appointmentDeletedToPusher));\n event(new AppointmentDeletedToAssistant($appointmentDeletedToPusher));\n\n return '';\n\n\n }", "public function destroy(Attandance $attandance)\n {\n //\n }", "public function destroy(Anime $anime)\n {\n //\n }", "public function destroy(TiendaApi $tiendaApi)\n {\n //\n }", "public function patientRemove() {\n $this->pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n try {\n //On démarre la transaction, toujours mettre la table enfant avant la table parente pour éviter les soucis de suppression.\n $this->pdo->beginTransaction();\n $queryAppointment = 'DELETE FROM `appointments` WHERE `idPatients` = :idPatients';\n $deleteAppointmentResult = $this->pdo->prepare($queryAppointment);\n $deleteAppointmentResult->bindValue(':idPatients', $this->id, PDO::PARAM_INT);\n $deleteAppointmentResult->execute();\n $queryPatient = 'DELETE FROM `patients` WHERE `id` = :id';\n $deletePatientResult = $this->pdo->prepare($queryPatient);\n $deletePatientResult->bindValue(':id', $this->id, PDO::PARAM_INT);\n $deletePatientResult->execute();\n //On valide la transaction.\n $this->pdo->commit();\n } catch (Exception $ex) {\n //Si une erreur survient, on annule les changements.\n $this->pdo->rollBack();\n echo 'Erreur : ' . $ex->getMessage();\n }\n }", "public function destroy($ID,Request $request)\n {\n $data = Appointment::findOrFail($ID);\n\n // Delete Data\n $data->delete();\n\n if($request->ajax()){\n return ['status'=> true,'msg'=> __('Appointment has been deleted successfully')];\n }else{\n redirect()\n ->route('system.appointment.index')\n ->with('status','success')\n ->with('msg',__('This Appointment has been deleted'));\n }\n }", "public function deleteAppointmentRequest($appointment_uuid, $x_access_token = null, $x_secret_token = null, $authorization = null, $ehelply_active_participant = null, $ehelply_project = null, $ehelply_data = null)\n {\n // verify the required parameter 'appointment_uuid' is set\n if ($appointment_uuid === null || (is_array($appointment_uuid) && count($appointment_uuid) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $appointment_uuid when calling deleteAppointment'\n );\n }\n\n $resourcePath = '/appointments/appointments/{appointment_uuid}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // header params\n if ($x_access_token !== null) {\n $headerParams['x-access-token'] = ObjectSerializer::toHeaderValue($x_access_token);\n }\n // header params\n if ($x_secret_token !== null) {\n $headerParams['x-secret-token'] = ObjectSerializer::toHeaderValue($x_secret_token);\n }\n // header params\n if ($authorization !== null) {\n $headerParams['authorization'] = ObjectSerializer::toHeaderValue($authorization);\n }\n // header params\n if ($ehelply_active_participant !== null) {\n $headerParams['ehelply-active-participant'] = ObjectSerializer::toHeaderValue($ehelply_active_participant);\n }\n // header params\n if ($ehelply_project !== null) {\n $headerParams['ehelply-project'] = ObjectSerializer::toHeaderValue($ehelply_project);\n }\n // header params\n if ($ehelply_data !== null) {\n $headerParams['ehelply-data'] = ObjectSerializer::toHeaderValue($ehelply_data);\n }\n\n // path params\n if ($appointment_uuid !== null) {\n $resourcePath = str_replace(\n '{' . 'appointment_uuid' . '}',\n ObjectSerializer::toPathValue($appointment_uuid),\n $resourcePath\n );\n }\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = ObjectSerializer::buildQuery($formParams);\n }\n }\n\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = ObjectSerializer::buildQuery($queryParams);\n return new Request(\n 'DELETE',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function destroy(Apartments $apartment)\n {\n //\n }", "public function destroy($id)\n {\n Appointments::where('id',$id)->delete();\n Clinic_Problems::where('apt_problmes_id',$id)->delete();\n Clinic_Investigations::where('apt_investigations_id',$id)->delete();\n Clinic_Diagnosis::where('apt_diagnoses_id',$id)->delete();\n Clinic_Observations::where('apt_observations_id',$id)->delete();\n clinicNotes_advices::where('apt_notes_adv_id',$id)->delete();\n\n return redirect()->back()->with(\"success\",\"Randevu kayıt Silme İşlemi Başarıyla Tamamlandı\");\n }", "public function cancel(Appointment $appointment)\n {\n // dd($appointment);\n $appointment->update(['status' => 3]);\n $notification = [\n 'message' => 'appointment Has beeb Cancelled',\n 'date' => $appointment->schedule->date,\n 'time' => $appointment->time,\n 'patient' => $appointment->patient->name,\n 'doctor' => $appointment->doctor->name,\n ];\n $appointment->patient->user->notify(new AppointmentNotification($notification));\n $appointment->doctor->user->notify(new AppointmentNotification($notification));\n return back()->with('success', 'Appointment Cancelled Successfully');\n }", "public function destroy($doctor_timeslot)\n {\n Doctor_timeslot::find($doctor_timeslot)->delete();\n return response(array(\n 'error' => false,\n 'message' =>'Doctor time slot Record deleted successfully',\n ),200);\n }", "public function destroy($id)\n {\n $patients = Patients::find($id);\n $patients->delete();\n $patients->save();\n }", "public function destroy(Doctor $doctor)\n {\n \n }", "public function destroy(AttendanceRequest $attendanceRequest)\n {\n //\n }", "public function destroy(PregnancyMedicalProcedure $pregnancyMedicalProcedure)\n {\n //\n }", "public function destroy(Anexo7ds $anexo7ds)\n {\n //\n }", "public function destroy(Doctor $doctor)\n {\n\n }", "public function destroy(Acaramodel $acaramodel)\n {\n //\n }", "public function destroy(ApartmentReservations $apartmentReservations)\n {\n //\n }", "public function Appointment_deleteById($id)\n\t{\n\t\t// Suppression des dépendances dans les autres tables\n\t\t$this->db->where($this->table . '_id', $id)\n\t\t\t\t ->delete($this->table . 'Customer');\n\t\t$this->db->where($this->table . '_id', $id)\n\t\t\t\t ->delete($this->table . 'Hosting');\n\t\t$this->db->where($this->table . '_id', $id)\n\t\t\t\t ->delete($this->table . 'Activity');\n\t\t$this->db->where($this->table . '_id', $id)\n\t\t\t\t ->delete($this->table . 'Country');\n\t\t\n\t\t// Suppression du rendez-vous\n\t\treturn $this->db->where($this->table . '_id', $id)\n\t\t\t\t \t\t->delete($this->table);\n\t}", "public function delete($id)\n {\n try{\n $record = Appointment::find($id);\n if(!is_null($record)){\n $record->delete();\n return $this->respondWithSuccess(ApiCode::NOTIFICATION_DELETE_SUCCESS);\n }\n else{\n return $this->respondNotFound(ApiCode::ERROR_GET_DATA);\n }\n }\n catch(Exception $ex){\n return $this->respondWithError(ApiCode::ERROR_REQUEST, 402);\n }\n }", "public function destroy($id)\n {\n $deleted = $this->repository->delete($id);\n\n if (request()->wantsJson()) {\n\n return response()->json([\n 'message' => 'Appointment deleted.',\n 'deleted' => $deleted,\n ]);\n }\n\n return redirect()->back()->with('message', 'Appointment deleted.');\n }", "public function destroy($id)\n\t{\n\t\t$patient = Patient::find($id);\n foreach($patient->visit() as $visit){\n $visit->delete();\n }foreach($patient->info() as $visit){\n $visit->delete();\n }foreach($patient->via() as $visit){\n $visit->delete();\n }foreach($patient->papsmear() as $visit){\n $visit->delete();\n }foreach($patient->hiv() as $visit){\n $visit->delete();\n }foreach($patient->intervention() as $visit){\n $visit->delete();\n }foreach($patient->contraceptive() as $visit){\n $visit->delete();\n }foreach($patient->gynocology() as $visit){\n $visit->delete();\n }\n $patient->delete();\n\t}", "public function actionDelete($id)\n {\n $model = $this->findModel($id);\n if ( $model->delete()) {\n Yii::$app->session->addFlash(\n 'warning',\n Yii::t(\n 'auth',\n 'You have successfully deleted Appointment №: ' . $model->id\n )\n );\n\n } else {\n Yii::$app->session->addFlash(\n 'error',\n Yii::t(\n 'auth',\n 'Something went wrong, Appointment №: ' . $model->id . ' not deleted'\n )\n );\n }\n return $this->redirect(['index']);\n }", "public function destroy(Booking $booking)\n {\n //\n }", "public function destroy(Booking $booking)\n {\n //\n }", "public function destroy(Booking $booking)\n {\n //\n }", "public function destroy(Dateplanner $dateplanner)\n {\n //\n }", "public function destroy(Venta $venta)\n {\n //\n }", "public function destroy(Venta $venta)\n {\n //\n }", "public function destroy(peserta $peserta)\n {\n //\n }", "public function destroy(AppSettings $appSettings)\n {\n //\n }", "public function destroy(Appel $appel)\n {\n $appel->delete();\n\n return redirect()->route('appels.index')\n ->with('success','Appel surpprime avec success');\n }", "public function destroy($id)\n {\n $this->timeperiodManager->delete($id);\n }", "public function destroy(Volunteer $volunteer)\n {\n //\n }", "public function destroy($id)\n {\n $data = Reservation::findOrFail($id);\n $data->delete();\n }", "public function destroy(Rezervation $rezervation)\n {\n //\n }", "public function destroy(Almacen $almacen)\n {\n //\n }", "public function destroy(reciclaeducate $reciclaeducate)\n {\n //\n }", "public function destroy(int $id)\n {\n $educationalActivityAttendance = EducationalActivityAttendance::findOrFail($id);\n $educationalActivityAttendance->delete();\n }", "public function destroy(TimeSlot $timeSlot)\n {\n //\n }", "function gen_apmt_calendar($PID) {\n\n $conn = sql_connect();\n $sql_apmt = mysqli_query($conn, \"SELECT * FROM Appointments WHERE Patient_ID=\".$PID.\";\") or die(mysqli_error($conn));\n\n if(mysqli_num_rows($sql_apmt) == 0) {\n echo \"No appointments found\";\n return;\n }\n\n echo \"<table><tr><th> Appointment ID </th><th> Doctor </th><th> Patient </th><th> Clinic </th><th> Appointment Time </th><th>Action</th></tr>\";\n\n while($apmt = mysqli_fetch_assoc($sql_apmt)) {\n \n $sql_patient = mysqli_query($conn, \"SELECT * FROM Patients WHERE PID=\".$apmt['Patient_ID'].\";\");\n $patient = mysqli_fetch_assoc($sql_patient);\n\n $sql_doc = mysqli_query($conn, \"SELECT * FROM Doctors WHERE NPI=\".$apmt['Doctor_ID'].\";\");\n $doc = mysqli_fetch_assoc($sql_doc);\n\n $sql_clinic = mysqli_query($conn, \"SELECT * FROM Clinics WHERE Clinic_ID=\".$apmt['Clinic_ID'].\";\");\n $clinic = mysqli_fetch_assoc($sql_clinic);\n\n echo \"<tr><td>\".$apmt['Appt_ID'].\"</td><td>\".$doc['Name'].\" (\".$doc['NPI'].\")</td><td>\".$patient['Last_Name'].\", \".$patient['First_Name'].\" (\".$patient['PID'].\") </td><td>\".$clinic['Clinic_name'].\"</td><td>\".$apmt['Appointment_time'].\"</td>\";\n\n echo \"<td><form action='patient_delete_appointment.php' method='POST'><input type='hidden' name='Appt_ID' value=\".$apmt['Appt_ID'].\"><input type='submit' value='Delete Appt' onclick='return confirm_delete()'></form></td></tr>\";\n\n }\n\n echo \"</table>\";\n\n }", "public function destroy($id)\n { $patient = Patient::find($id);\n $patient->delete();\n return redirect('patient');\n }", "public function destroy($id)\n {\n //\n $vital = Vital::findOrFail($id);\n \n $vital->delete(); \n }", "public function destroy(PetitionTool $petitionTool)\n {\n //\n }", "public function destroy(pdp $pdp)\n {\n //\n }", "public function destroy(Attendance $attendance)\n {\n $attendance->delete();\n return response()->json(null, 204);\n }", "public function destroy(Periodo $periodo)\n {\n //\n }", "public function destroy(Exam $exam)\n {\n //\n }", "public function destroy(Exam $exam)\n {\n //\n }", "public function destroy(RapportIntervention $rapportIntervention)\n {\n //\n }", "public function cancelAppointment(appointmentClass $info)\n {\n //Query To Delete The Appointment From The DataBase\n $sql = \"DELETE FROM appointment WHERE customer_id=? AND appointment_id=? AND customer_mail=?\";\n $values = array($info->getCustomerID(),$info->getAppointmentID(),$info->getCustomerMail());\n \n //Check If The Appointment Still Exist In The DataBase\n $check=$this->getInfo(\"SELECT * FROM appointment WHERE customer_id=? AND appointment_id=? AND customer_mail=?\",$values);\n \n //If EveryThing Okay We Send A Message Conatain Confirm Deletion\n if($check)\n {\n $this->execute($sql,$values);\n \n //Send Email\n $to = $info->getCustomerMail();\n $subject = \"Queue Order\";\n $message = \"Hi \".$check[0]['customer_name'].\"\\n Your Queue Is Canceled , Thanks for Choosing Q.S.M \";\n $headers = 'From: [email protected]'.\"\\r\\n\".'X-Mailer: PHP/'.phpversion();\n \n mail($to, $subject, $message, $headers);\n die(\"התור בוטל בהצלחה ,נשלחה הודעה למייל\");\n }\n else \n die('התור לא קיים');\n }", "public function destroy(Survey $survey)\n {\n //\n }", "public function destroy($id)\n {\n Attendance::destroy($id);\n return Reply::success(__('messages.attendanceDelete'));\n }", "public function destroy($id)\n {\n //\n $personas = Persona::find($id);\n $personas->delete();\n }", "public function destroy($id)\n {\n //\n $atm=Atm::destroy($id);\n return redirect('admin/atm');\n}", "public function destroy(MedicalRequest $medicalRequest)\n {\n //\n }", "public function destroy() {\n $this->accessory->destroy();\n redirect('/backend/accessories', ['notice' => 'Successfully destroyed.']);\n }", "public function destroy(Pharmacy $pharmacy)\n {\n $this->authorize('update', $pharmacy);\n Mail::to('[email protected]')->send(new PharmacyDeleted($pharmacy));\n $pharmacy = $pharmacy->delete();\n return redirect('/pharmacies');\n }", "public function destroy(Patient $patient)\n{\n\n $patient->delete();\n return redirect('/pacientes')->with('status', 'La enfermera se elimino de forma permanente!');\n \n\n}", "public function destroy($id)\n {\n $pacijent = Pacijent::find($id);\n\n$pacijent->delete();\nreturn redirect('/asistent')->with('success', 'Uspesno obrisano');\n }", "public function destroy($id)\n {\n $patient = Patient::find($id);\n $patient->delete(); //método para eliminar\n return redirect('/patients');\n }" ]
[ "0.832684", "0.8076637", "0.75682503", "0.7217254", "0.68720305", "0.68189025", "0.6673944", "0.65527964", "0.6440619", "0.64358056", "0.64018357", "0.63991725", "0.6387532", "0.63800013", "0.63750666", "0.63750666", "0.63750666", "0.6357572", "0.6357572", "0.6357572", "0.62579614", "0.6237023", "0.62014407", "0.6182552", "0.61825496", "0.6157054", "0.6149271", "0.6114899", "0.6109179", "0.60770047", "0.6061059", "0.6040928", "0.5961278", "0.5949295", "0.5890373", "0.58887726", "0.58667535", "0.58633196", "0.58618057", "0.58463955", "0.5817034", "0.5812906", "0.57949173", "0.57744557", "0.5745118", "0.5736971", "0.5736508", "0.5735087", "0.57341397", "0.572337", "0.5704024", "0.5690956", "0.5675435", "0.56649834", "0.56396693", "0.56363803", "0.56332624", "0.5583902", "0.5575934", "0.5571756", "0.5571127", "0.5563204", "0.5512922", "0.5512922", "0.5512922", "0.5501576", "0.5496408", "0.5496408", "0.54754376", "0.5467864", "0.5461521", "0.54519385", "0.5442481", "0.5425157", "0.5410532", "0.5408199", "0.53924924", "0.5389811", "0.5389292", "0.5382658", "0.5381934", "0.5378558", "0.53751934", "0.5375005", "0.53694504", "0.536818", "0.53668815", "0.53668815", "0.5363329", "0.5362172", "0.53569806", "0.5352788", "0.5338936", "0.5338038", "0.532796", "0.53272486", "0.532679", "0.532402", "0.53202945", "0.53123194" ]
0.6849003
5
Creates a new Scripted question instance.
public function __construct() { parent::__construct(new question_first_matching_answer_grading_strategy($this)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function create() {\n\t\t$ret = new self();\n\t\t$params = func_get_args();\n\t\tif (count($params) > 0) {\n\t\t\tforeach($params as $key => $param) {\n\t\t\t\tif ($key == 0) $ret->setQuestion ($param);\n\t\t\t\t$ret->addAnswer($param);\n\t\t\t}\n\t\t}\n\t\treturn $ret;\n\t}", "abstract protected function create(string $name, string $description, array $variants): Question;", "public function create(\\FanFerret\\QuestionBundle\\Entity\\Question $question);", "public function create($question, $type = ObjectFactory::TEXT_QUESTION) {\n $questionObj = $this->objectFactory->createQuestion($type);\n $questionObj->setQuestion($question);\n $this->poll->addItem($questionObj);\n return $questionObj;\n\t}", "public function __construct(Question $question)\n {\n $this->question = $question;\n }", "public function create($question, $type = ObjectFactory::TEXT_QUESTION)\n\t{\n\t\t// echo $type;\n\t\t$newQuestion = $this->objectFactory->createQuestion($type);\n\t\t// if ($type == ObjectFactory::SINGLE_CHOICE_QUESTION) echo \"single\";\n\t\t// echo $question;\n\t\t$newQuestion->setQuestion($question);\n\t\t$this->questions[$newQuestion->getId()] = $newQuestion;\n\t\treturn $newQuestion;\n\t}", "public function question($id)\n {\n return $this->create($id);\n }", "function &_instanciateQuestion($question_id) \n\t{\n\t\tif ($question_id < 1) return FALSE;\n\t\tinclude_once \"./Modules/SurveyQuestionPool/classes/class.SurveyQuestion.php\";\n\t\t$question_type = SurveyQuestion::_getQuestionType($question_id);\n\t\tif (strlen($question_type) == 0) return FALSE;\n\t\tSurveyQuestion::_includeClass($question_type);\n\t\t$question = new $question_type();\n\t\t$question->loadFromDb($question_id);\n\t\treturn $question;\n }", "function questionnaire_add_instance($questionnaire) {\n // (defined by the form in mod.html) this function\n // will create a new instance and return the id number\n // of the new instance.\n global $COURSE, $DB, $CFG;\n require_once($CFG->dirroot.'/mod/questionnaire/questionnaire.class.php');\n require_once($CFG->dirroot.'/mod/questionnaire/locallib.php');\n\n // Check the realm and set it to the survey if it's set.\n\n if (empty($questionnaire->sid)) {\n // Create a new survey.\n $cm = new Object();\n $qobject = new questionnaire(0, $questionnaire, $COURSE, $cm);\n\n if ($questionnaire->create == 'new-0') {\n $sdata = new Object();\n $sdata->name = $questionnaire->name;\n $sdata->realm = 'private';\n $sdata->title = $questionnaire->name;\n $sdata->subtitle = '';\n $sdata->info = '';\n $sdata->theme = ''; // Theme is deprecated.\n $sdata->thanks_page = '';\n $sdata->thank_head = '';\n $sdata->thank_body = '';\n $sdata->email = '';\n $sdata->owner = $COURSE->id;\n if (!($sid = $qobject->survey_update($sdata))) {\n print_error('couldnotcreatenewsurvey', 'questionnaire');\n }\n } else {\n $copyid = explode('-', $questionnaire->create);\n $copyrealm = $copyid[0];\n $copyid = $copyid[1];\n if (empty($qobject->survey)) {\n $qobject->add_survey($copyid);\n $qobject->add_questions($copyid);\n }\n // New questionnaires created as \"use public\" should not create a new survey instance.\n if ($copyrealm == 'public') {\n $sid = $copyid;\n } else {\n $sid = $qobject->sid = $qobject->survey_copy($COURSE->id);\n // All new questionnaires should be created as \"private\".\n // Even if they are *copies* of public or template questionnaires.\n $DB->set_field('questionnaire_survey', 'realm', 'private', array('id' => $sid));\n }\n }\n $questionnaire->sid = $sid;\n }\n\n $questionnaire->timemodified = time();\n\n // May have to add extra stuff in here.\n if (empty($questionnaire->useopendate)) {\n $questionnaire->opendate = 0;\n }\n if (empty($questionnaire->useclosedate)) {\n $questionnaire->closedate = 0;\n }\n\n if ($questionnaire->resume == '1') {\n $questionnaire->resume = 1;\n } else {\n $questionnaire->resume = 0;\n }\n\n // Field questionnaire->navigate used for branching questionnaires. Starting with version 2.5.5.\n /* if ($questionnaire->navigate == '1') {\n $questionnaire->navigate = 1;\n } else {\n $questionnaire->navigate = 0;\n } */\n\n if (!$questionnaire->id = $DB->insert_record(\"questionnaire\", $questionnaire)) {\n return false;\n }\n\n questionnaire_set_events($questionnaire);\n\n return $questionnaire->id;\n}", "public static function create($type, $array)\n {\n switch ($type) {\n case \"mcq\":\n return new QuestionMcq($array);\n break;\n case \"mrq\":\n return new QuestionMrq($array);\n break;\n case \"text\":\n return new QuestionText($array);\n break;\n case \"textlong\":\n return new QuestionTextLong($array);\n break;\n default:\n throw new Exception(\"QuestionFactory_ClassNotFoundException\");\n }\n }", "public function testCreateSurveyQuestion0()\n {\n }", "public function testCreateSurveyQuestion0()\n {\n }", "public function createQuestionAndAnswers () {\n global $tpl, $lng, $ilCtrl, $ilTabs;\n\n // create wizard object\n include_once('class.ilObjMobileQuizWizard.php');\n $wiz = new ilObjMobileQuizWizard();\n\n\n $ilTabs->activateTab(\"editQuiz\");\n\n\n if ($wiz->checkInput()){\n $wiz->createQuestionAndAnswers($this->object);\n ilUtil::sendSuccess($this->txt(\"question_obj_create\"), true);\n $ilCtrl->redirect($this, \"editQuiz\");\n }\n $this->initAddQuestionAndAnswersFormAfterError();\n //$tpl->setContent(\"Test\");\n }", "public function create()\n {\n $placeholders = [\n 'Why do pigs like to roll around in the mud?',\n 'Do you speak Pig Latin?',\n 'What\\'s your opinion on Porky Pig?',\n 'Do pigs like pineapples?',\n 'Are you scared of the big bad wolf?',\n 'Have you ever had the swine flu?',\n 'Why did the pig cross the road?'];\n $randomPlaceholder = $placeholders[array_rand($placeholders)];\n return view('questions-create', compact('randomPlaceholder'));\n }", "public function createQuestion($Question){\n\n\t\t$Result = new Result();\t\n\t\t$Result = $this->_QuestionDAO->createQuestion($Question);\n\t\t\n\t\tif(!$Result->getIsSuccess())\n\t\t\t$Result->setResultObject(\"Database failure in QuestionDAO.createQuestion()\");\t\t\n\n\t\treturn $Result;\n\n\t\n\t}", "public function create()\n {\n //get new question instance\n $question = new Question;\n\n //set edit variable as false : new question\n $edit = FALSE;\n\n //display the question view\n return view('questionForm', ['question' => $question,'edit' => $edit ]);\n }", "public function create()\n {\n $question = new Question();\n return view('questions.create', compact('question'));\n }", "public function createAction()\n {\n\n if (!$this->request->isPost()) {\n return $this->dispatcher->forward(array(\n \"controller\" => \"question\",\n \"action\" => \"index\"\n ));\n }\n\n $que = new Question();\n\n $que->setQuesId($this->request->getPost(\"quesid\"));\n $que->setDesc($this->request->getPost(\"desc\"));\n $que->setOrder($this->request->getPost(\"order\"));\n $que->setBkgrId($this->request->getPost(\"bkgrid\"));\n $que->setQtype($this->request->getPost(\"qtype\"));\n $que->setAmtText($this->request->getPost(\"amttext\"));\n $que->setAmtType($this->request->getPost(\"amttype\"));\n $que->setCrdt($this->request->getPost(\"crdt\"));\n $que->setCrdtId($this->request->getPost(\"crdtid\"));\n $que->setUpdt($this->request->getPost(\"updt\"));\n $que->setUpdtId($this->request->getPost(\"updtid\"));\n $que->setDelmark($this->request->getPost(\"delmark\"));\n \n\n if (!$que->save()) {\n foreach ($que->getMessages() as $message) {\n $this->flash->error($message);\n }\n\n return $this->dispatcher->forward(array(\n \"controller\" => \"ques\",\n \"action\" => \"new\"\n ));\n }\n\n $this->flash->success(\"Question was created successfully\");\n\n return $this->dispatcher->forward(array(\n \"controller\" => \"question\",\n \"action\" => \"index\"\n ));\n\n }", "public function run()\n {\n $i = 1;\n $question = Question::create(\n [\n 'title' => '前端工程师的技术进阶点在哪里?',\n 'description' => <<<'EOT'\n这个问题是一个比较全能的Java工程师提出来的,总结一下大家的回答:\n\n需求变化快,需要良好的复用、可拓展能力,否则动不动重写。\n兼容性问题,需要兼容各种移动设备的各种浏览器。\nCSS非正交,对于绝大多数人来说属于『玄学』。\n\n\n那么问题来了,普通前端工程师的技术进阶突破点在什么地方?\n\n有哪些方向可以突破,以后端为例\n\n全局方向: 做业务整体架构\n深度方向: 做性能调优、高并发、分布式等专业要求很高的领域\n延伸方向: 以Java 为例很多大神转移到大数据、分布式计算这个方面,算是传统Java Web的延伸方向\nEOT\n,\n 'user_id' => $i,\n ]);\n $question->answers()->create([\n 'user_id' => ++$i,\n 'content' => <<<'EOT'\n基于上面这个我个人认为的前提,我觉得前端的技术进阶并不像 Java 那样,对技术本身有很深度的研究,我个人规划更倾向于选择偏业务性的突破点:快速学习技术的能力前端时不时出来很多新东西,然后总是先于当前实现写未来代码,快速学习新事物的能力是最基础的。出来的新东西,能不能快速了解用法、特性、适用场景和底层实现?这是后面的基础。突破方法:对新事物保持好奇而非恐惧和抵触,跳出舒适区掌握学习的方法论,比如先看文档、再跑 Demo、提出问题、源码验证学习一些学习技巧业务抽象能力和技术选型、设计能力一个产品不是一夜建设出来的,但前端可以加速这个过程。使用 Node.js 可以写一个 index.js 文件执行下就跑起来一个各种功能的 Web 服务器,这个时间放在 Java 可能刚用 Spring Boot 创建好项目目录?\nEOT\n ]);\n\n }", "public function setUp()\n {\n $this->answers = self::answersFromArray([\n ['my first answer', true],\n ['my second answer', true],\n ['my third answer', false],\n ['my fourth answer', false],\n ]);\n\n $this->question = new Question('my question', 'my category', $this->answers);\n }", "public function createComponentQuestionForm() {\n $form = new Form;\n\n $form->addHidden('test_id');\n $form->addHidden('id');\n $form->addTextArea('text', 'Text')->setRequired();\n $form->addSubmit('submit');\n $form->setDefaults($this->questions->getById($this->questionId));\n $form->onSuccess[] = $this->questionFormSucceeded;\n\n return $form;\n }", "public function create(Productquestion $productquestion)\n {\n //\n }", "public function __construct($questions)\n\t{\n\t\t$this->questions = $questions;\n\t\tparent::__construct();\n\t}", "public function setQuestion($q)\n {\n $this->question = $q;\n return $this;\n }", "public function __construct(Question $question)\n {\n $this->questionRepo = new \\App\\Repositories\\QuestionRepository($question);\n }", "public function run()\n {\n $question = new TemplateQuestion();\n $question->question = 'Conducted by?';\n $question->template_section_id = 1;\n $question->save();\n\n $question = new TemplateQuestion();\n $question->question = 'date?';\n $question->template_section_id = 1;\n $question->save();\n\n $question = new TemplateQuestion();\n $question->question = 'Location';\n $question->template_section_id = 1;\n $question->save();\n\n //seed another section\n\n $question = new TemplateQuestion();\n $question->question = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.';\n $question->template_section_id = 2;\n $question->save();\n\n $question = new TemplateQuestion();\n $question->question = 'trash empty?';\n $question->template_section_id = 2;\n $question->save();\n\n $question = new TemplateQuestion();\n $question->question = 'Water shut off?';\n $question->template_section_id = 2;\n $question->save();\n\n\n }", "public function create()\n\t{\n\t\treturn view('questions.createQuestion');\n\t}", "function __construct($id,$question,$description,$number,$inputtype)\n\t{#constructor sets stage by adding data to an instance of the object\n\t\t$this->QuestionID = (int)$id;\n\t\t$this->Text = $question;\n\t\t$this->Description = $description;\n\t\t$this->Number = (int)$number; # number of current question in sequence - added in v2\n\t\t$this->InputType = $inputtype; #added v4\n\t}", "public function constructQuestionFromGUID($guid, $questionId = null, $responseId = null)\n {\n $this->loadQuestionObjects();\n if (isset($this->guidToQuestion[$guid]))\n {\n $questionClass = $this->guidToQuestion[$guid]['class'];\n $questionObject = new $questionClass($this->loadPlugin($this->guidToQuestion[$guid]['plugin']), $this->api, $questionId, $responseId);\n return $questionObject;\n }\n }", "public static function create_question($question, $answer)\n {\n global $DB;\n $params = self::validate_parameters(self::create_question_parameters(), array('question' => $question, 'answer' => $answer));\n if ($DB->record_exists('quiz', array('id' => $question[0]['quizid'])) == false && $question[0]['quizid'] != 0) {\n print_error('quiz does not exist', 'quiz', null, null, 'choose correct quiz id');\n } elseif ($DB->record_exists('question_categories', array('id' => $question[0]['question_category'])) == false && $question[0]['question_category']) {\n print_error('categorydoesnotexist', 'question', null, null, 'choose correct category id');\n }\n\n $questionBuilder = new QuestionBuilder();\n $__question = $questionBuilder->questionMaker($question);\n $answerBuilder = new AnswerBuilder($__question);\n\n $answerBuilder->answerMaker($answer);\n\n return $__question;\n }", "private function addQuestion() : void\n {\n $question = $this->console->ask(__('Type your question'));\n\n $this->console->info('Question successfully added ');\n\n $answer = $this->console->ask(__('Type your answer'));\n\n $this->console->info('Answer successfully added ');\n\n $this->questionRepository->create([\n 'question' => $question,\n 'valid_answer' => $answer,\n ]);\n }", "public static function create() {\n global $DB;\n\n $record = new stdClass();\n $record->useand = true;\n\n $id = $DB->insert_record('ddtaquiz_condition', $record);\n\n return new condition($id, array(), $record->useand);\n }", "public function actionCreate($question_id)\n {\n $model = new QuestionAnswer();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['question/view', 'id' => $question_id]);\n }\n return $this->render('create', [\n 'model' => $model,\n 'question' => $this->findQuestionModel($question_id)\n ]);\n }", "public function create()\n\t{\n\t\treturn view('admin.question.create');\n\t}", "public function run()\n {\n $class = QuizAnswer::create([\n \t'quiz_id' => 1,\n \t'attempts' => 4,\n \t'correct' => 0,\n \t'fail' => 2,\n ]);\n\n }", "static function createWithData($questionData)\n {\n return new QuestionValueObject($questionData[QuestionQueries::ID_FIELD], $questionData);\n }", "function __construct($id)\n\t{#constructor sets stage by adding data to an instance of the object\n\t\t$this->SurveyID = (int)$id;\n\t\tif($this->SurveyID == 0){return FALSE;}\n\t\t$iConn = IDB::conn(); #uses a singleton DB class to create a mysqli improved connection \n\t\t\n\t\t#get Survey data from DB - v5 adds TotalResponses\n\t\t$sql = sprintf(\"select Title, Description, TotalResponses from \" . PREFIX . \"surveys Where SurveyID =%d\",$this->SurveyID);\n\t\t\n\t\t#in mysqli, connection and query are reversed! connection comes first\n\t\t$result = mysqli_query($iConn,$sql) or die(trigger_error(mysqli_error($iConn), E_USER_ERROR));\n\t\tif (mysqli_num_rows($result) > 0)\n\t\t{#Must be a valid survey!\n\t\t\t$this->isValid = TRUE;\n\t\t\twhile ($row = mysqli_fetch_assoc($result))\n\t\t\t{#dbOut() function is a 'wrapper' designed to strip slashes, etc. of data leaving db\n\t\t\t $this->Title = dbOut($row['Title']);\n\t\t\t $this->Description = dbOut($row['Description']);\n\t\t $this->TotalResponses = (int)$row['TotalResponses']; # v5: stores number of responses\t\t\t \n\t\t\t}\n\t\t}\n\t\t@mysqli_free_result($result); #free resources\n\t\tif(!$this->isValid){return;} #exit, as Survey is not valid\n\t\t\n\t\t#attempt to create question objects - InputType field is v4\n\t\t$sql = sprintf(\"select QuestionID, Question, Description, InputType from \" . PREFIX . \"questions where SurveyID =%d\",$this->SurveyID);\n\t\t$result = mysqli_query($iConn,$sql) or die(trigger_error(mysqli_error($iConn), E_USER_ERROR));\n\t\tif (mysqli_num_rows($result) > 0)\n\t\t{#show results\n\t\t while ($row = mysqli_fetch_assoc($result))\n\t\t {\n\t\t\t\t$this->TotalQuestions += 1; #increment total number of questions\n\t\t\t\t#Current TotalQuestions added to Question object as Number property - added in v2 - InputType v4\n\t\t\t\t$this->aQuestion[] = new Question(dbOut($row['QuestionID']),dbOut($row['Question']),dbOut($row['Description']),$this->TotalQuestions,dbOut($row['InputType']));\n\t\t }\n\t\t}\n\t\t$this->TotalQuestions = count($this->aQuestion); #TotalQuestions derived above - consider deleting this line! v2 \n\t\t@mysqli_free_result($result); #free resources\n\t\t\n\t\t#attempt to load all Answer objects into cooresponding Question objects \n\t $sql = \"select a.AnswerID, a.Answer, a.Description, a.QuestionID from \n\t\t\" . PREFIX . \"surveys s inner join \" . PREFIX . \"questions q on q.SurveyID=s.SurveyID \n\t\tinner join \" . PREFIX . \"answers a on a.QuestionID=q.QuestionID \n\t\twhere s.SurveyID = %d \n\t\torder by a.AnswerID asc\";\n\t\t$sql = sprintf($sql,$this->SurveyID); #process SQL\n\t\t$result = mysqli_query($iConn,$sql) or die(trigger_error(mysqli_error($iConn), E_USER_ERROR));\n\t\tif (mysqli_num_rows($result) > 0)\n\t\t{#at least one answer!\n\t\t while ($row = mysqli_fetch_assoc($result))\n\t\t {#match answers to questions\n\t\t\t $QuestionID = (int)$row['QuestionID']; #process db var\n\t\t\t\tforeach($this->aQuestion as $question)\n\t\t\t\t{#Check db questionID against Question Object ID\n\t\t\t\t\tif($question->QuestionID == $QuestionID)\n\t\t\t\t\t{\n\t\t\t\t\t\t$question->TotalAnswers += 1; #increment total number of answers\n\t\t\t\t\t\t#create answer, and push onto stack!\n\t\t\t\t\t\t$question->aAnswer[] = new Answer((int)$row['AnswerID'],dbOut($row['Answer']),dbOut($row['Description']));\n\t\t\t\t\t\tbreak; \n\t\t\t\t\t}\n\t\t\t\t}\t\n\t\t }\n\t\t}\n\t}", "public function create()\n {\n $question = new Question;\n $edit = FALSE;\n return view('questionForm', ['question' => $question, 'edit' => $edit]);\n }", "public function create()\n {\n $questionData = getQuestionsData(); //Helper function in app\\Support\\helpers.php\n $numberAnswers = $questionData[0];\n $typeKeys = $questionData[1];\n $typeValues = $questionData[2];\n \n return view('questions.create', compact('typeKeys', 'typeValues', 'numberAnswers')); \n }", "public function createQuestionAction(int $id) : object\n {\n $page = $this->di->get(\"page\");\n $form = new CreateQuestionForm($this->di, $id);\n $form->check();\n\n $page->add(\"questions/crud/create-question\", [\n \"form\" => $form->getHTML(),\n ]);\n\n return $page->render([\n \"title\" => \"Create a question\",\n ]);\n }", "public function testCreateSurveyQuestionChoice0()\n {\n }", "public function testCreateSurveyQuestionChoice0()\n {\n }", "public function newQuestion($question, $connection) {\r\n\t\t$connection -> exec(\"INSERT INTO `\".$GLOBALS['dbPrefix'].\"question_question` (`set`, `question`, `mode`) VALUES (\" . $this -> setid . \", '\" . $question -> getQuestion() . \"', '\" . $question -> getMode() . \"')\");\r\n\t\t$question -> setId($connection -> lastInsertId());\r\n\t\tarray_push($this -> questions, $question);\r\n\t}", "public function getPostCreateQuestion()\n {\n $title = \"Ask Question\";\n $view = $this->di->get(\"view\");\n $pageRender = $this->di->get(\"pageRender\");\n $user = $this->di->get(\"authHelper\")->getLoggedInUser();\n\n if (!$user) {\n $this->di->get(\"response\")->redirect(\"user/login\");\n }\n\n $form = new QuestionForm($this->di);\n $form->check();\n $view->add(\"comment/question-form\", [\"form\" => $form->getHTML([\"use_buttonbar\" => false])]);\n return $pageRender->renderPage([\"title\" => $title]);\n }", "public function create()\n {\n $animals = Animal::all();\n $ani = [];\n foreach ($animals as $animal) {\n $ani[$animal -> animal_id] = $animal -> animal_name;\n }\n\n $worksheets = Worksheet::all();\n $works = [];\n foreach ($worksheets as $worksheet) {\n $works[$worksheet -> worksheet_id] = $worksheet -> worksheet_name;\n }\n\n $descriptions = Question_description::all();\n $descrip = [];\n foreach ($descriptions as $description) {\n $descrip[$description -> description_id] = $description -> description;\n }\n\n\n return view('pages/data_manage/question/create') -> withAni($ani) \n -> withAnimals($animals)\n -> withWorks($works)\n -> withDescrip($descrip);\n }", "function __construct() {\n $this->contact = new QuadernoContact(array(\n 'first_name' => 'Joseph',\n 'last_name' => 'Tribbiani',\n 'contact_name' => 'Friends Staff'));\n $this->contact->save();\n\n $this->item = new QuadernoDocumentItem(array(\n 'description' => 'concepto 1',\n 'price' => 100.0,\n 'quantity' => 20\n ));\n }", "public function create(){\n\n // returning view and results\n return view('create_question');\n }", "public function create()\n {\n return view('admin.questions.create');\n }", "public function create()\n {\n return view('admin.questions.create');\n }", "public function createQuestion($examID, $text){\n \n $data = array(\n 'examID' => $examID,\n 'text' => $text\n );\n \n return $this->insert($data);\n }", "public function create()\n {\n \n \n\n return view('questions.create');\n \n\n }", "public function create()\n {\n return view('questions.create');\n }", "public function create()\n {\n return view('questions.create');\n }", "public function create()\n {\n return view('questions.create');\n }", "public function __construct($questions,$answers)\r\n\t{\r\n\t\t$this->questions = $questions;\r\n\t\t$this->answers = $answers;\r\n\t\tparent::__construct();\r\n\t}", "public function create( Question $question)\n {\n return view('admin.pages.answer.create',compact('question'));\n\n\n }", "public function run()\n {\n $question = new \\App\\ContentModels\\Question();\n $question->question_category_id = \"3\";\n $question->question = \"What is Vaixel\";\n $question->answer = \"e are a transit advertising company headquartered in Casablanca, Morocco which services markets nationwide. As a new communication channel, we specialize in getting a brand’s message seen in geographies of interest through the means of car wrap advertising applied on everyday driver’s cars.\nWe work with our brand partners in understanding their marketing goals. If hyper-targeted brand-awareness is an important piece of the media plan, we will make an appropriate campaign recommendation regarding the wrap style, quantity of cars, and campaign duration.\nOnce confirmed, we then recruit, screen, and admit drivers into our brand partner’s campaign who drive in the region of interest and who hit all four of our needed driver quality check points. At a confirmed start date, all admitted drivers come to our facility and their vehicles are wrapped in our brand partner’s advertisement in a matter of hours. The car is then returned to the owner, and for the next several months the car is generating powerful impressions everywhere they drive in their community. Through the use of our phone app, all driving activity is tracked and reported back to our brand partner on a monthly basis.\n\";\n $question->save();\n\n $question = new \\App\\ContentModels\\Question();\n $question->question_category_id = \"1\";\n $question->question = \"How am I paid as a Driver ?\";\n $question->answer = \"We take your bank details the day of the fitting. The payments are then made into your account via a secured transfer at the end of each month.\n Three weeks into the campaign you will be asked to complete a short form which will require you to upload photos of your car and a mileage reading. If this is returned by Thursday 5pm we will check it and payments will be made before the following Monday. If returned after this time then payments will be made the following Friday. This process repeats each month until the end of the campaign. \";\n $question->save();\n\n $question = new \\App\\ContentModels\\Question();\n $question->question_category_id = \"1\";\n $question->question = \"How can I, as a driver, get paid ?\";\n $question->answer = \"It depends on the advertisers and length of a campaign that you are matched with as well as the size and type of advert applied to your car\";\n $question->save();\n\n\n $question = new \\App\\ContentModels\\Question();\n $question->question_category_id = \"1\";\n $question->question = \"Is it free to register as a Driver ?\";\n $question->answer = \"It's completely free to register. You will never have to pay for anything throughout the campaign. Our income is from the brands that want to advertise on your car, never from car owners.\";\n $question->save();\n\n\n $question = new \\App\\ContentModels\\Question();\n $question->question_category_id = \"1\";\n $question->question = \"Is my car suitable ?\";\n $question->answer = \"We have all sorts of cars on our campaigns. For the majority of campaigns, your car will need to be 2009 or newer, that's not to say there isn't a campaign for you if your car is older. It just might take a while longer to find the right one for you.\n\nWe do not accept motorbikes or convertibles unfortunately. This is because of the way in which we apply the adverts. We require the back window of a car to display an advert at all times.\";\n $question->save();\n\n\n $question = new \\App\\ContentModels\\Question();\n $question->question_category_id = \"2\";\n $question->question = \"How can I, as a brand, verify the reliability of Vaixel drivers ?\";\n $question->answer = \"We use KYC/AML Application to get the best security possible for both the driver and the company. Using an AI-based identity verification software, we guarantee to both parties, the highest level of security. Also, a personal data protection is insured, no matter where you are located.\";\n $question->save();\n\n\n $question = new \\App\\ContentModels\\Question();\n $question->question_category_id = \"3\";\n $question->question = \"How do you pick drivers for a campaign ?\";\n $question->answer = \"We select drivers for our brand partner’s campaign by reaching into our expansive driver network and hand selecting the drivers who generate the most exposure in the geographic areas we are targeting.\";\n $question->save();\n\n $question = new \\App\\ContentModels\\Question();\n $question->question_category_id = \"3\";\n $question->question = \"Can we pick the drivers ?\";\n $question->answer = \"Due to the privacy policies we have in place with our network of registered drivers, we do not open sheet our inventory of drivers for our brand partners to select from. Our brand partner select the location and quantity of cars, and we screen and select the car drivers within our network that match the driver quality criteria.\";\n $question->save();\n\n $question = new \\App\\ContentModels\\Question();\n $question->question_category_id = \"3\";\n $question->question = \"How long does it take to set up a campaign ?\";\n $question->answer = \"Vaixel requires at least one month from agreement signing to having all cars wrapped and on the road. The driver screening and selection process requires at least two weeks, and, depending upon how many cars are being wrapped, another two weeks to wrap and roll-out all drivers we select for the campaign.\";\n $question->save();\n\n }", "public function create()\n {\n return view('questions.create');\n\n }", "public function create()\n {\n $question=new Question();\n return view('questions.create',compact('question'));\n }", "public function test_post_question() {\n global $DB;\n\n // Create user\n $user = $this->getDataGenerator()->create_user();\n\n // create a course\n $course = $this->getDataGenerator()->create_course();\n\n // enrol the user on the course\n $this->getDataGenerator()->enrol_user($user->id, $course->id, $DB->get_field('role', 'id', array(\n 'shortname' => 'student',\n )));\n\n // create a course module\n $videoquanda = $this->getDataGenerator()->create_module('videoquanda', array(\n 'course' => $course->id\n ));\n\n // enrol the user on the course\n $this->getDataGenerator()->enrol_user($user->id, $course->id, $DB->get_field('role', 'id', array(\n 'shortname' => 'student',\n )));\n\n $question = array(\n 'seconds' => '2',\n 'text' => 'dummy text'\n );\n\n $this->setUser($user);\n\n $client = new Client($this->_app);\n $client->request('POST', '/api/v1/' . $videoquanda->id . '/questions', array(), array(), array(), json_encode($question));\n\n $this->assertEquals(201, $client->getResponse()->getStatusCode());\n $this->assertEquals(1, $DB->count_records('videoquanda_questions', array('instanceid' => $videoquanda->id)));\n }", "public function create() {\n\n\n $result[0] = new QuestionAnswerCreator($this->request);\n $result[1] = new SurveyCreator($this->request);\n\n $result[0]->createSurvey();\n $result[1]->createSurvey();\n\n return $result;\n }", "public function createComponentQuestion() {\n return new Multiplier(function ($testId) {\n $question = new \\App\\Components\\QuestionControl($this->questions, $testId);\n return $question;\n });\n }", "public function create()\n {\n $quest = Quest::make();\n\n return view('system.quests.create', compact('quest'));\n }", "public function createAssessmentQuestionsTable()\n {\n $query = \"CREATE TABLE IF NOT EXISTS assessment_questions(\n id INT(2) UNSIGNED PRIMARY KEY AUTO_INCREMENT,\n question VARCHAR(150) NOT NULL,\n options VARCHAR(255) NOT NULL\n )\";\n $this->execQuery($query);\n return true;\n }", "public function create()\n {\n return view('backend.question.create');\n }", "public function create()\n {\n //\n $this->authorize('create', Question::class);\n $quizzes= Quiz::all();\n return view('question.create' compact('quizzes'));\n\n }", "public function create()\n {\n return view('admin.question.create');\n }", "public function store(Request $request)\n {\n $question = new Question;\n $question->prompt = $request->prompt;\n $question->difficulty = $request->difficulty;\n $question->total_score = $request->total_score;\n $question->subject_id = 1;\n $question->save();\n\n $a1 = new Answer;\n $a2 = new Answer;\n $a3 = new Answer;\n $a4 = new Answer;\n $a5 = new Answer;\n \n $a1->text = $request->choice1;\n $a2->text = $request->choice2;\n $a3->text = $request->choice3;\n $a4->text = $request->choice4;\n $a5->text = $request->choice5;\n\n $a1->save();\n $a2->save();\n $a3->save();\n $a4->save();\n $a5->save();\n\n $question->answers()->attach($a1->id, array('is_correct' => ($request->isCorrect1 != 1 ? 0 : 1)));\n $question->answers()->attach($a2->id, array('is_correct' => ($request->isCorrect2 != 1 ? 0 : 1)));\n $question->answers()->attach($a3->id, array('is_correct' => ($request->isCorrect3 != 1 ? 0 : 1)));\n $question->answers()->attach($a4->id, array('is_correct' => ($request->isCorrect4 != 1 ? 0 : 1)));\n $question->answers()->attach($a5->id, array('is_correct' => ($request->isCorrect5 != 1 ? 0 : 1)));\n\n // return Redirect::back()->withMsg('Quiz Question Created');\n return redirect('/question');\n }", "public function run()\n {\n $survey = \\App\\Models\\Survey::create([\n 'availability' => true,\n 'camunda_identifier' => 'survey_001',\n 'title' => 'Diabetes Quality of Life',\n 'description' => 'Diabetes Quality of Life survey captures your satisfaction, impact and worry related to living with the diagnosis of diabetes (Type 1 or 2).',\n 'explanation' => 'Please rate your answers from 1 (least impact on you) to 5 (highest impact on you). Please choose only one response for each question.',\n ]);\n\n \\App\\Models\\Question::create([\n 'survey_id' => $survey->id,\n 'type' => 'satisfaction_01',\n 'text' => 'How satisfied are you with the amount of time it takes to manage your diabetes?',\n ]);\n\n \\App\\Models\\Question::create([\n 'survey_id' => $survey->id,\n 'type' => 'satisfaction_02',\n 'text' => 'How satisfied are you with the amount of time you spend getting checkups?',\n ]);\n\n \\App\\Models\\Question::create([\n 'survey_id' => $survey->id,\n 'type' => 'satisfaction_03',\n 'text' => 'How satisfied are you with the time it takes to determine your sugar level?',\n ]);\n\n \\App\\Models\\Question::create([\n 'survey_id' => $survey->id,\n 'type' => 'satisfaction_04',\n 'text' => 'How satisfied are you with your current treatment?',\n ]);\n\n \\App\\Models\\Question::create([\n 'survey_id' => $survey->id,\n 'type' => 'satisfaction_05',\n 'text' => 'How satisfied are you with your knowledge about your diabetes?',\n ]);\n\n \\App\\Models\\Question::create([\n 'survey_id' => $survey->id,\n 'type' => 'satisfaction_06',\n 'text' => 'How satisfied are you with life in general?',\n ]);\n\n\n \\App\\Models\\Question::create([\n 'survey_id' => $survey->id,\n 'type' => 'impact_01',\n 'text' => 'How often do you feel pain associated with the treatment for your diabetes?',\n ]);\n\n \\App\\Models\\Question::create([\n 'survey_id' => $survey->id,\n 'type' => 'impact_02',\n 'text' => 'How often do you feel physically ill?',\n ]);\n\n \\App\\Models\\Question::create([\n 'survey_id' => $survey->id,\n 'type' => 'impact_03',\n 'text' => 'How often does your diabetes interfere with your family life?',\n ]);\n \\App\\Models\\Question::create([\n 'survey_id' => $survey->id,\n 'type' => 'impact_04',\n 'text' => 'How often do you find your diabetes limiting your social relationships and friendships?',\n ]);\n\n \\App\\Models\\Question::create([\n 'survey_id' => $survey->id,\n 'type' => 'impact_05',\n 'text' => 'How often do you find your diabetes limiting your sexual life?',\n ]);\n \\App\\Models\\Question::create([\n 'survey_id' => $survey->id,\n 'type' => 'impact_06',\n 'text' => 'How often do you find your diabetes limiting your life plans such as employment, education or training?',\n ]);\n\n \\App\\Models\\Question::create([\n 'survey_id' => $survey->id,\n 'type' => 'impact_07',\n 'text' => 'How often do you find your diabetes limiting your leisure activities or travels?',\n ]);\n\n \\App\\Models\\Question::create([\n 'survey_id' => $survey->id,\n 'type' => 'worry_01',\n 'text' => 'How often do you worry about whether you will pass out?',\n ]);\n\n \\App\\Models\\Question::create([\n 'survey_id' => $survey->id,\n 'type' => 'worry_02',\n 'text' => 'How often do you worry that your body looks different because you have diabetes?',\n ]);\n\n \\App\\Models\\Question::create([\n 'survey_id' => $survey->id,\n 'type' => 'worry_03',\n 'text' => 'How often do your worry that you will get complications from your diabetes?',\n ]);\n\n\n $questions = \\App\\Models\\Question::where('survey_id', $survey->id)->get();\n\n foreach ($questions as $question) {\n $index = 0;\n\n while ($index <= 4) {\n $index++;\n \\App\\Models\\Answer::create([\n 'question_id' => $question->id,\n 'text' => $index,\n 'value' => $index,\n ]);\n }\n }\n }", "public function testCreateSurvey0()\n {\n }", "public function testCreateSurvey0()\n {\n }", "public function create()\n {\n if(!Auth::user()->is_admin == 1){\n abort(404, 'Page not found');\n }\n return view('Question.create');\n }", "public function create(){}", "public function create()\n {\n //\n return view('question.create');\n }", "public function testCreateSurvey()\n {\n $data = [\n 'year' => 2020,\n 'type' => Survey::TRAINER,\n 'title' => 'My Awesome Survey',\n 'prologue' => 'Take the survey',\n 'epilogue' => 'Did you take it?'\n ];\n\n $response = $this->json('POST', 'survey', [\n 'survey' => $data\n ]);\n\n $response->assertStatus(200);\n $this->assertDatabaseHas('survey', $data);\n }", "protected function initialise_question_instance(question_definition $question, $questiondata) {\n parent::initialise_question_instance($question, $questiondata);\n $question->parts = array();\n if (!empty($questiondata->options->answers)) {\n foreach ($questiondata->options->answers as $ans) {\n $part = new qtype_formulas_part();\n foreach ($ans as $key => $value) {\n $part->{$key} = $value;\n }\n $question->parts[$part->partindex] = $part;\n }\n }\n $question->varsrandom = $questiondata->options->varsrandom;\n $question->varsglobal = $questiondata->options->varsglobal;\n $question->answernumbering = $questiondata->options->answernumbering;\n $question->qv = new qtype_formulas\\variables();\n $question->numpart = $questiondata->options->numpart;\n if ($question->numpart != 0) {\n $question->fractions = array_fill(0, $question->numpart, 0);\n $question->anscorrs = array_fill(0, $question->numpart, 0);\n $question->unitcorrs = array_fill(0, $question->numpart, 0);\n }\n $question->textfragments = $this->split_questiontext($question->questiontext, $question->parts);\n $this->initialise_combined_feedback($question, $questiondata, true);\n }", "public function create()\n {\n return view('admin.typeQuestion.create');\n }", "public function created(InterviewQuestion $interviewQuestion): void\n {\n //\n }", "public function create(Test $test, Question $question)\n {\n return view('choice.create', ['test' => $test, 'question' => $question]);\n }", "public function create() {\n $this->form_validation->set_rules($this->item_validation_rules);\n \n // check if the form validation passed\n if ($this->form_validation->run())\n {\n // See if the model can create the record\n if ($this->personality_quizzes_m->create($this->input->post()))\n {\n // All good...\n $this->session->set_flashdata('success', lang('personality_quizzes.success'));\n redirect('admin/personality_quizzes');\n }\n // Something went wrong. Show them an error\n else\n {\n $this->session->set_flashdata('error', lang('personality_quizzes.error'));\n redirect('admin/personality_quizzes/create');\n }\n }\n \n\n $quiz = new stdClass;\n foreach ($this->item_validation_rules['new'] as $rule)\n {\n $quiz->{$rule['field']} = $this->input->post($rule['field']);\n }\n // Build the view using sample/views/admin/form.php\n $this->template\n ->title($this->module_details['name'], lang('personality_quizzes.new_item'))\n ->append_metadata($this->load->view('fragments/wysiwyg', $this->data, TRUE))\n ->set('quiz', $quiz)\n ->append_css('jquery/jquery.tagsinput.css')\n ->append_css('module::jquery.fileupload-ui.css')\n ->append_css('module::files.css')\n ->append_js('jquery/jquery.tagsinput.js')\n ->append_js('module::jquery.fileupload.js')\n ->append_js('module::jquery.fileupload-ui.js')\n ->append_js('module::functions.js')\n ->build('admin/form');\n }", "public function createAnswer()\n {\n $this->is_answer = true;\n $this->topic->is_answered = true;\n $post = $this;\n\n Db::transaction(function() use ($post)\n {\n $post->topic->save();\n $post->save();\n });\n }", "public static function create() {}", "public static function create() {}", "public static function create() {}", "public function create() {}", "public function create()\n {\n $rewards = Reward::all();\n $types = QuestType::all();\n $items = Item::all();\n $field = AdditionalQuestsField::where('name', 'itemID')->first();\n $descriptions = Description::all();\n $speakers = Speaker::pluck('name');\n $modes = DescriptionMode::all();\n $languages = Language::all();\n\n return view('admin.quests.create', compact('rewards', 'types', 'items', 'field', 'descriptions',\n 'modes', 'speakers', 'languages', 'notes'));\n }", "public function actionCreate() {\n $test = $this->tests->add($this->user->id);\n $values['test_id'] = $test->id;\n $this->questions->add($values);\n $this->redirect('Test:edit', $test->id);\n }", "public function create()\n {\n return view('question.create');\n }", "public function create()\n {\n $data=SetInformationLang(auth()->user(),$this->defaultPosition,$this->defaultCode);\n\n $trans=$data['trans'];\n $code=$data['code'];\n $position=$data['position'];\n return view(\"admin.question.create\",compact(\"code\",\"position\",\"trans\"));\n }", "function newLorAnswer(\\Foundation\\Form\\Input $input, \\Jazzee\\Entity\\Answer $answer);", "public function generateQuestion()\n\t{\n\t\t//get random question type\n\t\t$type = $this->questionTypes[array_rand($this->questionTypes)];\n\n\t\t//get random section\n\t\t$section = $this->getRandomSection();\n\n\t\t//get random function (within the above section)\n\t\t$function = $this->getRandomFunction($section);\n\n\t\t$question = [];\n\t\t$question['type'] = $type;\n\t\t$question['section'] = $section;\n\t\t$question['function'] = $function;\n\t\t$question['text'] = \"{$section} now, {$this->questionTextPerType[$type]}\";\n\t\t$question['choices'] = [];\n\t\t$question['answer_text'] = '';\n\t\t$question['answer_index'] = '';\t//in ['choices'] array\n\n\n\t\treturn $this->fillQuestion($question);\n\t}", "function readquestion($lines) {\n \t// converts it into a question object suitable for processing and insertion.\n\n $question = $this->defaultquestion();\n $comment = NULL;\n \n // define replaced by simple assignment, stop redefine notices\n $gift_answerweight_regex = \"^%\\-*([0-9]{1,2})\\.?([0-9]*)%\"; \n\n // REMOVED COMMENTED LINES and IMPLODE\n foreach ($lines as $key => $line) {\n $line = trim($line);\n if (substr($line, 0, 2) == \"//\") {\n $lines[$key] = \" \";\n }\n }\n\n $text = trim(implode(\" \", $lines));\n\n if ($text == \"\") {\n return false;\n }\n\n // Substitute escaped control characters with placeholders\n $text = $this->escapedchar_pre($text);\n\n // Look for category modifier ---------------------------------------------------------\n if (ereg( '^\\$CATEGORY:', $text)) {\n // $newcategory = $matches[1];\n $newcategory = trim(substr( $text, 10 ));\n $newcategory = trim(substr( $newcategory, 0, strpos($newcategory, \"::\")));\n\t\t\t\n $question->setCategoryFromName($newcategory);\n $text = trim(substr($text, 10+strlen($newcategory)));\n \n // build fake question to contain category\n \n \t// XXX: create a category !\n //return true;\n }\n \n // QUESTION NAME parser --------------------------------------------------------------\n if (substr($text, 0, 2) == \"::\") {\n $text = substr($text, 2);\n\n $namefinish = strpos($text, \"::\");\n if ($namefinish === false) {\n $question->prompt = false;\n // name will be assigned after processing question text below\n } else {\n $questionname = substr($text, 0, $namefinish);\n $question->prompt = addslashes(trim($this->escapedchar_post($questionname)));\n $text = trim(substr($text, $namefinish+2)); // Remove name from text\n }\n } else {\n $question->prompt = false;\n }\n\n\n // FIND ANSWER section -----------------------------------------------------------------\n // no answer means its a description\n $answerstart = strpos($text, \"{\");\n $answerfinish = strpos($text, \"}\");\n\n $description = false;\n if (($answerstart === false) and ($answerfinish === false)) {\n $description = true;\n $answertext = '';\n $answerlength = 0;\n }\n elseif (!(($answerstart !== false) and ($answerfinish !== false))) {\n //$this->error( get_string( 'braceerror', 'quiz' ), $text );\n return false;\n }\n else {\n $answerlength = $answerfinish - $answerstart;\n $answertext = trim(substr($text, $answerstart + 1, $answerlength - 1));\n }\n\n \n\t\t// Format QUESTION TEXT without answer, inserting \"_____\" as necessary\n if ($description) {\n $text = $text;\n }\n elseif (substr($text, -1) == \"}\") {\n // no blank line if answers follow question, outside of closing punctuation\n $text = substr_replace($text, \"\", $answerstart, $answerlength+1);\n } else {\n // inserts blank line for missing word format\n $text = substr_replace($text, \"_____\", $answerstart, $answerlength+1);\n }\n\n // get text format from text\n $oldtext = $text;\n $textformat = 0;\n if (substr($text,0,1)=='[') {\n $text = substr( $text,1 );\n $rh_brace = strpos( $text, ']' );\n $qtformat= substr( $text, 0, $rh_brace );\n $text = substr( $text, $rh_brace+1 );\n \n }\n // i must find out for what this param is used\n $question->textformat = $textformat;\n \t\t\n \t\t// question text \n $question->quest_text = addslashes(trim($this->escapedchar_post($text)));\n\n // set question name if not already set\n\t\tif ($question->prompt === false) {\n\t\t\t$question->prompt = $question->quest_text;\n\t\t}\n\n // ensure name is not longer than 250 characters\n $question->prompt = $question->prompt ;\n $question->prompt = strip_tags(substr( $question->prompt, 0, 250 ));\n\n // determine QUESTION TYPE -------------------------------------------------------------\n $question->qtype = NULL;\n\n // give plugins first try\n // plugins must promise not to intercept standard qtypes\n // MDL-12346, this could be called from lesson mod which has its own base class =(\n /*\n if (method_exists($this, 'try_importing_using_qtypes') && ($try_question = $this->try_importing_using_qtypes( $lines, $question, $answertext ))) {\n return $try_question;\n }\n\t\t*/\n if ($description) {\n $question->qtype = 'title';\n }\n elseif ($answertext == '') {\n $question->qtype = 'extended_text';\n }\n elseif ($answertext{0} == \"#\"){\n $question->qtype = 'numerical';\n\n\t\t} elseif (strpos($answertext, \"~\") !== false) {\n\t\t\t\n\t\t\t// only Multiplechoice questions contain tilde ~\n\t\t\tif (strpos($answertext,\"=\") === false) {\n\t\t\t\t\n\t\t\t\t// multiple answers are enabled if no single answer is 100% correct\n\t\t\t\t$question->qtype = 'choice_multiple'; \n\t\t\t} else {\n\t\t\t\t\n\t\t\t\t// only one answer allowed (the default)\n\t\t\t\t$question->qtype = 'choice';\n\t\t\t}\n }", "public function createquestionAction()\r\n {\r\n\r\n // Check Post\r\n if ($this->getRequest()->isPost()) {\r\n\r\n $params = $this->getRequest()->getParams();\r\n $questionname = trim($params['questionNameCreate']);\r\n\r\n\r\n $error = \"\";\r\n \r\n\r\n if (strlen($questionname)>50)\r\n $error .= \"Le nom de la question doit être compris entre 1 et 50 caractères. \";\r\n if (!empty($error)) {\r\n $this->_helper->json(array(\r\n 'code' => $error\r\n ));\r\n }\r\n $auth = Zend_Auth::getInstance();\r\n $userGroupId = $auth->getIdentity()->UserGroupIdF;\r\n\r\n $question = new Application_Model_DbTable_FicheQuestion();\r\n // create the new group\r\n $idInsert = $question->createQuestion($questionname, $userGroupId);\r\n\r\n if ($idInsert == \"nok\") {\r\n $msg = \"Contactez un administrateur svp.\";\r\n $this->_helper->json(array(\r\n 'code' => $msg\r\n ));\r\n }\r\n $this->_helper->json(array(\r\n 'code' => '42'\r\n ));\r\n }\r\n }", "public function setQuestion(Question $question)\n\t{\n\t\tif (!$question)\n\t\t{\n\t\t\tthrow new \\LogicException(\"Question cannot be empty!\");\n\t\t}\n\t\tif ($question instanceof TextQuestionImpl)\n\t\t{\n\t\t\t$this->question = $question;\n\t\t\t$question->addAnswer($this);\n\t\t}\n\t\telse throw new IncompatibleClassException();\n\t\t\n\t\treturn $this;\n\t}", "private function question()\n\t{\n\t\t$this->qns['questionnaire']['questionnairecategories_id'] = $this->allinputs['questioncat'];\n\t\t$this->qns['questionnaire']['questionnairesubcategories_id'] = $this->allinputs['questionsubcat'];\n\t\t$this->qns['questionnaire']['label'] = $this->allinputs['question_label'];\n\n\n\t\t$this->qns['questionnaire']['question'] = $this->allinputs['question'];\n\t\t$this->qns['questionnaire']['has_sub_question'] = $this->allinputs['subquestion'];\n\n\t\tif( $this->qns['questionnaire']['has_sub_question'] == 0 )\n\t\t{\n\t\t\t$this->qns['answers']['answer_type'] = $this->allinputs['optiontype'];\n\t\t}\n\n\t\t$this->qns['questionnaire']['active'] = 1;\n\n\t\tif( $this->qns['questionnaire']['has_sub_question'] == 0 ){\n\t\t\t//This code must be skipped if sub_question is 1\n\t\t\t$optionCounter = 0;\n\t\t\tforeach ($this->allinputs as $key => $value) {\n\n\t\t\t\tif( str_is('option_*', $key) ){\n\t\t\t\t\t$optionCounter++;\n\t\t\t\t\t$this->qns['answers'][$optionCounter] = ( $this->qns['answers']['answer_type'] == 'opentext' ) ? 'Offered answer text' : $value;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function create()\n\t{\n\t\t$tags = Tag::pluck('name', 'id')->all();\n\t\treturn view('questions.createQuestion', compact('tags'));\n\t}", "public static function addSubmit($sessionIdentifier) {\n /**\n * Setup basic session variables (Type hinting below to avoid IDE error messages)\n * @var $templates League\\Plates\\Engine\n * @var $data array\n * @var $config array\n * @var $user User\n * @var $mysqli mysqli\n * @var $session Session\n */\n extract(self::setup($sessionIdentifier));\n\n // Attempt to create a new question for this question type\n try {\n $question = QuestionFactory::create($_POST[\"questionType\"], $_POST);\n }\n\n // If error creating question, log the error and display an error page\n catch(Exception $e) {\n Error::exception($e, __LINE__, __FILE__);\n die();\n }\n\n // If MCQ or MRQ question\n if(in_array(get_class($question), [\"QuestionMcq\", \"QuestionMrq\"])) {\n\n // Loop for every posted value\n foreach($_POST as $key => $value) {\n\n // Use regex to check if this is a \"mcq-choice-1\" field\n preg_match(\"/(mcq-choice-)(\\w*[0-9]\\w*)/\", $key, $matches);\n\n // If there are matches then this is a \"mcq-choice-1\" field\n if($matches) {\n\n // Get the index\n $index = $matches[2];\n\n // Boolean for if this is correct\n $correct = text2bool(array_key_exists(\"mcq-choice-correct-$index\", $_POST) ? $_POST[\"mcq-choice-correct-$index\"] : \"false\");\n\n // Add choice\n $question->addChoice($value, $correct);\n }\n }\n }\n\n // Insert question into the database\n $questionID = DatabaseQuestion::insert($question, $mysqli);\n\n // Load the session ID\n $sessionID = DatabaseSessionIdentifier::loadSessionID($sessionIdentifier, $mysqli);\n\n // If invalid session identifier, display 404\n if($sessionID === null) {\n PageError::error404();\n die();\n }\n\n // Insert question session combo into DatabaseSession\n DatabaseSessionQuestion::insert($sessionID, $questionID, $mysqli);\n\n header(\"Location: \" . $config[\"baseUrl\"] . \"session/$sessionIdentifier/edit/\");\n die();\n }", "public function create()\n {\n $tags = QuestionTag::allTags();\n \n return view('questions.create', compact('tags'));\n }", "public function test_for_quiz_question()\n {\n $this->withOutExceptionHandling();\n\n $user = $this->actingAs(User::factory()->make());\n\n $session = QuizSession::factory()->create();\n $schedule = ClassSchedule::factory()->create();\n\n $response = $this->post('api/v1/quiz/question',\n array_merge($this->data(), [\n 'quiz_session_id' => $session->id,\n 'class_schedule_id' => $schedule->id,\n ]\n )\n );\n\n $response->assertStatus(200);\n }", "public function create()\n {\n return view('admin/question/create');\n }", "public function create()\n {\n //\n if (\\Auth::guest())\n return redirect()->guest('login');\n\n $sections = null;\n\n $data = [\n 'pagetitle' => 'Draft a Question',\n 'sections' => $sections\n ];\n return view('questions.create',$data);\n }" ]
[ "0.6880315", "0.6879712", "0.6776003", "0.67745227", "0.66602445", "0.653403", "0.6470659", "0.6459158", "0.63735795", "0.63231426", "0.6248225", "0.6248225", "0.61635864", "0.60748094", "0.60739934", "0.60608894", "0.59879136", "0.59683454", "0.5963257", "0.594916", "0.5927588", "0.5925194", "0.59003836", "0.58899575", "0.5881711", "0.5868963", "0.58249974", "0.5821301", "0.5808306", "0.580515", "0.58030206", "0.58007616", "0.579841", "0.5770604", "0.57473385", "0.5738988", "0.5732691", "0.57302004", "0.57256055", "0.57240206", "0.57121706", "0.57121706", "0.57071286", "0.5699674", "0.5686342", "0.5681734", "0.5673568", "0.56629044", "0.56629044", "0.5657858", "0.56555337", "0.56531966", "0.56531966", "0.56531966", "0.56489384", "0.563396", "0.5633598", "0.56307954", "0.5628233", "0.56268495", "0.56258094", "0.561752", "0.5610182", "0.56048024", "0.5602746", "0.55970335", "0.55940515", "0.55902034", "0.55791163", "0.55723625", "0.55723625", "0.55723315", "0.5570229", "0.5566553", "0.5561306", "0.5539083", "0.5536985", "0.5535618", "0.5535614", "0.55349636", "0.55046505", "0.55031776", "0.55031776", "0.55031776", "0.5499914", "0.549367", "0.5492363", "0.54774266", "0.5473791", "0.54668665", "0.5457427", "0.54568595", "0.54544425", "0.54494005", "0.5444271", "0.5431327", "0.54307604", "0.54273707", "0.54249334", "0.5415571", "0.5401119" ]
0.0
-1
Indicates the type of answer data which Moodle expects to recieve; the scripted quesiton type always recieves the same, single answer.
public function get_expected_data() { return array('answer' => PARAM_RAW_TRIMMED); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getTypeQuestion()\n {\n return $this->typeQuestion;\n }", "function getType(){\r\n\t\tif($this->inDB==false||$this->type==null){\r\n\t\t\t$temp=$this->dbq->getAnswerType($this->answer_id);\r\n\t\t\t$this->type = $temp;\r\n\t\t}\r\n\t\treturn $this->type;\r\n\t}", "function getQuestionType()\n\t{\n\t\treturn $this->getPlugin()->getQuestionType();\n\t}", "function answer()\r\n {\r\n //option 1) check for already defined\r\n if (strlen($this->Answer)) {\r\n return $this->Answer;\r\n }\r\n\r\n $http = eZHTTPTool::instance();\r\n $prefix = eZSurveyType::PREFIX_ATTRIBUTE;\r\n\r\n //option 2) check for answer in $_POST (trick from processViewAction or normal post)\r\n $postSurveyAnswer = $prefix . '_ezsurvey_answer_' . $this->ID . '_' . $this->contentObjectAttributeID();\r\n if ($http->hasPostVariable($postSurveyAnswer) && strlen($http->postVariable($postSurveyAnswer))) {\r\n $surveyAnswer = $http->postVariable($postSurveyAnswer);\r\n\r\n return $surveyAnswer;\r\n }\r\n\r\n return $this->Default;\r\n }", "function getQuestionType()\n\t{\n\t\treturn \"assTextSubset\";\n\t}", "function ipal_get_qtype($questionid){\r\n\tglobal $DB;\r\n\t$questiontype=$DB->get_record('question',array('id'=>$questionid));\r\n\treturn($questiontype->qtype); \r\n}", "function getQuestionType() {\n\t\treturn 'extended_text';\n\t}", "public function get_expected_data() \n {\n return array('answer' => PARAM_INTEGER);\n }", "function ipal_acceptable_qtype($questionid) {\n global $DB;\n\n // An array of acceptable qutypes supported in ipal.\n $acceptableqtypes = array('multichoice', 'truefalse', 'essay');\n $qtype = $DB->get_field('question', 'qtype', array('id' => $questionid));\n if (in_array($qtype, $acceptableqtypes)) {\n return true;\n } else {\n return $qtype;\n }\n}", "function answer()\n {\n if( $this->Answer !== false )\n return $this->Answer;\n\n $http = eZHTTPTool::instance();\n $prefix = eZSurveyType::PREFIX_ATTRIBUTE;\n $postSurveyAnswer = $prefix . '_ezsurvey_answer_' . $this->ID . '_' . $this->contentObjectAttributeID();\n if( $http->hasPostVariable( $postSurveyAnswer ) )\n {\n $surveyAnswer = $http->postVariable( $postSurveyAnswer );\n return $surveyAnswer;\n }\n\n return false;\n }", "public function question_type() {\r\n $this->check_permission(18);\r\n $content_data['add'] = $this->check_page_action(18, 'add');\r\n $this->quick_page_setup(Settings_model::$db_config['adminpanel_theme'], 'adminpanel', $this->lang->line('question_type'), 'operation/question_type', 'header', 'footer', '', $content_data);\r\n }", "private function question()\n\t{\n\t\t$this->qns['questionnaire']['questionnairecategories_id'] = $this->allinputs['questioncat'];\n\t\t$this->qns['questionnaire']['questionnairesubcategories_id'] = $this->allinputs['questionsubcat'];\n\t\t$this->qns['questionnaire']['label'] = $this->allinputs['question_label'];\n\n\n\t\t$this->qns['questionnaire']['question'] = $this->allinputs['question'];\n\t\t$this->qns['questionnaire']['has_sub_question'] = $this->allinputs['subquestion'];\n\n\t\tif( $this->qns['questionnaire']['has_sub_question'] == 0 )\n\t\t{\n\t\t\t$this->qns['answers']['answer_type'] = $this->allinputs['optiontype'];\n\t\t}\n\n\t\t$this->qns['questionnaire']['active'] = 1;\n\n\t\tif( $this->qns['questionnaire']['has_sub_question'] == 0 ){\n\t\t\t//This code must be skipped if sub_question is 1\n\t\t\t$optionCounter = 0;\n\t\t\tforeach ($this->allinputs as $key => $value) {\n\n\t\t\t\tif( str_is('option_*', $key) ){\n\t\t\t\t\t$optionCounter++;\n\t\t\t\t\t$this->qns['answers'][$optionCounter] = ( $this->qns['answers']['answer_type'] == 'opentext' ) ? 'Offered answer text' : $value;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function get_multianswer_question_data_twosubq() {\n $qdata = new stdClass();\n test_question_maker::initialise_question_data($qdata);\n\n $qdata->name = 'Simple multianswer';\n $qdata->questiontext =\n 'Complete this opening line of verse: \"The {#1} and the {#2} went to sea\".';\n $qdata->generalfeedback = 'General feedback: It\\'s from \"The Owl and the Pussy-cat\" by Lear: ' .\n '\"The owl and the pussycat went to sea';\n\n $qdata->defaultmark = 2.0;\n $qdata->qtype = 'multianswer';\n\n $sa = new stdClass();\n test_question_maker::initialise_question_data($sa);\n\n $sa->name = 'Simple multianswer';\n $sa->questiontext = '{1:SHORTANSWER:Dog#Wrong, silly!~=Owl#Well done!~*#Wrong answer}';\n $sa->generalfeedback = '';\n $sa->penalty = 0.0;\n $sa->qtype = 'shortanswer';\n\n $sa->options = new stdClass();\n $sa->options->usecase = 0;\n\n $sa->options->answers = array(\n 13 => new question_answer(13, 'Dog', 0, 'Wrong, silly!', FORMAT_HTML),\n 14 => new question_answer(14, 'Owl', 1, 'Well done!', FORMAT_HTML),\n 15 => new question_answer(15, '*', 0, 'Wrong answer', FORMAT_HTML),\n );\n\n $mc = new stdClass();\n test_question_maker::initialise_question_data($mc);\n\n $mc->name = 'Simple multianswer';\n $mc->questiontext = '{1:MULTICHOICE:Bow-wow#You seem to have a dog obsessions!~' .\n 'Wiggly worm#Now you are just being ridiculous!~=Pussy-cat#Well done!}';\n $mc->generalfeedback = '';\n $mc->penalty = 0.0;\n $mc->qtype = 'multichoice';\n\n $mc->options = new stdClass();\n $mc->options->layout = 0;\n $mc->options->single = 1;\n $mc->options->shuffleanswers = 0;\n $mc->options->correctfeedback = '';\n $mc->options->correctfeedbackformat = 1;\n $mc->options->partiallycorrectfeedback = '';\n $mc->options->partiallycorrectfeedbackformat = 1;\n $mc->options->incorrectfeedback = '';\n $mc->options->incorrectfeedbackformat = 1;\n $mc->options->answernumbering = 0;\n $mc->options->shownumcorrect = 0;\n\n $mc->options->answers = array(\n 23 => new question_answer(23, 'Bow-wow', 0,\n 'You seem to have a dog obsessions!', FORMAT_HTML),\n 24 => new question_answer(24, 'Wiggly worm', 0,\n 'Now you are just being ridiculous!', FORMAT_HTML),\n 25 => new question_answer(25, 'Pussy-cat', 1,\n 'Well done!', FORMAT_HTML),\n );\n\n $qdata->options = new stdClass();\n $qdata->options->questions = array(\n 1 => $sa,\n 2 => $mc,\n );\n\n $qdata->hints = array(\n new question_hint_with_parts(0, 'Hint 1', FORMAT_HTML, 0, 0),\n new question_hint_with_parts(0, 'Hint 2', FORMAT_HTML, 0, 0),\n );\n\n return $qdata;\n }", "public function responseType ();", "function question_type_class($type)\n {\n switch($type) {\n case QUESTION_TYPE_MULTIPLE_CHOICE :\n return ''; // Default, no class\n case QUESTION_TYPE_ONE_OF_VALUES :\n return 'type-ofc';\n }\n\n return '';\n }", "public function getAnswer() {\n return $this->answer;\n }", "public function getAnswer()\n {\n return $this->answer;\n }", "public function test_export_multichoice_1() {\n $qdata = new stdClass();\n $qdata->id = 123;\n $qdata->contextid = 0;\n $qdata->qtype = 'multichoice';\n $qdata->name = 'Multiple choice question';\n $qdata->questiontext = 'Questiontext of muliple choice question.';\n $qdata->questiontextformat = FORMAT_HTML;\n $qdata->generalfeedback = 'General feedback';\n $qdata->generalfeedbackformat = FORMAT_HTML;\n $qdata->defaultmark = 23;\n $qdata->length = 1;\n $qdata->penalty = 0.3333333;\n $qdata->hidden = 0;\n \n $qdata->options = new stdClass();\n $qdata->options->single = 0;\n $qdata->options->shuffleanswers = 0;\n $qdata->options->answernumbering = 'abc';\n $qdata->options->correctfeedback = '<p>Your answer is correct.</p>';\n $qdata->options->correctfeedbackformat = FORMAT_HTML;\n $qdata->options->partiallycorrectfeedback = '<p>Your answer is partially correct.</p>';\n $qdata->options->partiallycorrectfeedbackformat = FORMAT_HTML;\n $qdata->options->shownumcorrect = 1;\n $qdata->options->incorrectfeedback = '<p>Your answer is incorrect.</p>';\n $qdata->options->incorrectfeedbackformat = FORMAT_HTML;\n \n $qdata->options->answers = array(\n 13 => new question_answer(13, 'answer 1', 0, '', FORMAT_HTML),\n 14 => new question_answer(14, 'answer 2', 1, '', FORMAT_HTML),\n 15 => new question_answer(15, 'answer 3', 0, '', FORMAT_HTML),\n 16 => new question_answer(16, 'answer 4', 0, '', FORMAT_HTML),\n );\n \n $qdata->hints = array(\n new question_hint_with_parts(0, 'Hint 1.', FORMAT_HTML, false, false),\n new question_hint_with_parts(0, 'Hint 2.', FORMAT_HTML, false, false),\n );\n \n \n // Export the question.\n $exporter = new qformat_smart();\n $questions = array($qdata);\n $zipcontent = $exporter->export_questions($questions);\n \n // Open exported question as import_data.\n $import_data = $this->zip_to_import_data($zipcontent);\n \n /*\n * Test content of imsmanifest.xml\n */\n \n $imsmanifest = $import_data->imsmanifest;\n \n $expected = '<resource identifier=\"group0_pages\" href=\"page0.svg\" type=\"webcontent\" adlcp:scormType=\"asset\"><file href=\"page0.svg\"/></resource>';\n $actual = $imsmanifest->resources->resource[0]->asXML();\n $this->assert_same_xml($expected, $actual);\n \n $expected = '<resource identifier=\"pages\" href=\"page0.svg\" type=\"webcontent\" adlcp:scormType=\"asset\"><file href=\"page0.svg\"/></resource>';\n $actual = $imsmanifest->resources->resource[1]->asXML();\n $this->assert_same_xml($expected, $actual);\n \n /*\n * Test content of page.\n */\n \n // Test number of pages.\n $this->assertCount(1, $import_data->pages);\n \n $page = $import_data->pages[0];\n \n // Test the number of question elements.\n $questions = $page->xpath('//g[@class=\"question\"]');\n $this->assertCount(1, $questions);\n \n // Test the question element.\n $question = $questions[0];\n $expectedvotemetadata = '<votemetadata><questiontext format=\"choice\" labelstyle=\"upper-alpha\" correct=\"2\" points=\"23\" tags=\"\" explanation=\"General feedback\" mathgradingoption=\"\" likert=\"false\"/></votemetadata>';\n $votemetadata = $question->votemetadata->asXML();\n $this->assert_same_xml($expectedvotemetadata, $votemetadata);\n \n // Test the question number.\n $expectedquestionnumber = '1';\n $questionnumber = strip_tags($question->text[0]->asXML());\n $this->assertEquals($expectedquestionnumber, $questionnumber);\n \n // Test the question text without formattings.\n $expectedquestiontext = 'Questiontext of muliple choice question.';\n $questiontext = strip_tags($question->text[1]->asXML());\n $this->assertEquals($expectedquestiontext, $questiontext);\n \n // Test the number of choices.\n $choices = $page->xpath('//g[@class=\"questionchoice\"]');\n $this->assertCount(4, $choices);\n \n // Test the 1. choice element.\n $choice = $choices[0];\n $expectedvotemetadata = '<votemetadata><choicetext label=\"1\" format=\"choice\"/></votemetadata>';\n $votemetadata = $choice->votemetadata->asXML();\n $this->assert_same_xml($expectedvotemetadata, $votemetadata);\n \n // Test the numbering of the choice text without formattings.\n $expectedchoicetext = 'A';\n $choicetext = strip_tags($choice->text[0]->asXML());\n $this->assertEquals($expectedchoicetext, $choicetext);\n \n // Test the choice text without formattings.\n $expectedchoicetext = 'answer 1';\n $choicetext = strip_tags($choice->text[1]->asXML());\n $this->assertEquals($expectedchoicetext, $choicetext);\n \n // Test the 2. choice element.\n $choice = $choices[1];\n $expectedvotemetadata = '<votemetadata><choicetext label=\"2\" format=\"choice\"/></votemetadata>';\n $votemetadata = $choice->votemetadata->asXML();\n $this->assert_same_xml($expectedvotemetadata, $votemetadata);\n \n // Test the numbering of the choice text without formattings.\n $expectedchoicetext = 'B';\n $choicetext = strip_tags($choice->text[0]->asXML());\n $this->assertEquals($expectedchoicetext, $choicetext);\n \n // Test the choice text without formattings.\n $expectedchoicetext = 'answer 2';\n $choicetext = strip_tags($choice->text[1]->asXML());\n $this->assertEquals($expectedchoicetext, $choicetext);\n \n // Test the 3. choice element.\n $choice = $choices[2];\n $expectedvotemetadata = '<votemetadata><choicetext label=\"3\" format=\"choice\"/></votemetadata>';\n $votemetadata = $choice->votemetadata->asXML();\n $this->assert_same_xml($expectedvotemetadata, $votemetadata);\n \n // Test the numbering of the choice text without formattings.\n $expectedchoicetext = 'C';\n $choicetext = strip_tags($choice->text[0]->asXML());\n $this->assertEquals($expectedchoicetext, $choicetext);\n \n // Test the choice text without formattings.\n $expectedchoicetext = 'answer 3';\n $choicetext = strip_tags($choice->text[1]->asXML());\n $this->assertEquals($expectedchoicetext, $choicetext);\n \n // Test the 4. choice element.\n $choice = $choices[3];\n $expectedvotemetadata = '<votemetadata><choicetext label=\"4\" format=\"choice\"/></votemetadata>';\n $votemetadata = $choice->votemetadata->asXML();\n $this->assert_same_xml($expectedvotemetadata, $votemetadata);\n \n // Test the numbering of the choice text without formattings.\n $expectedchoicetext = 'D';\n $choicetext = strip_tags($choice->text[0]->asXML());\n $this->assertEquals($expectedchoicetext, $choicetext);\n \n // Test the choice text without formattings.\n $expectedchoicetext = 'answer 4';\n $choicetext = strip_tags($choice->text[1]->asXML());\n $this->assertEquals($expectedchoicetext, $choicetext);\n }", "function correctAnswerWithTypo() {\n\t}", "public function get_correct_response()\n {\n //if the question is a \"must eval true\" question, we can't easily determine the answer\n if($this->answer_mode == qtype_scripted_answer_mode::MODE_MUST_EVAL_TRUE) {\n return null;\n }\n\n // Evaluate the given answer, and return a correct-response array.\n $answer = $this->evaluate_answer(parent::get_correct_answer());\n return array('answer' => $answer->answer);\n }", "public function test_export_multichoice_2() {\n $qdata = new stdClass();\n $qdata->id = 123;\n $qdata->contextid = 0;\n $qdata->qtype = 'multichoice';\n $qdata->name = 'Multiple choice question';\n $qdata->questiontext = 'Questiontext of muliple choice question.';\n $qdata->questiontextformat = FORMAT_HTML;\n $qdata->generalfeedback = 'General feedback';\n $qdata->generalfeedbackformat = FORMAT_HTML;\n $qdata->defaultmark = 23;\n $qdata->length = 1;\n $qdata->penalty = 0.3333333;\n $qdata->hidden = 0;\n \n $qdata->options = new stdClass();\n $qdata->options->single = 0;\n $qdata->options->shuffleanswers = 0;\n $qdata->options->answernumbering = 'abc';\n $qdata->options->correctfeedback = '<p>Your answer is correct.</p>';\n $qdata->options->correctfeedbackformat = FORMAT_HTML;\n $qdata->options->partiallycorrectfeedback = '<p>Your answer is partially correct.</p>';\n $qdata->options->partiallycorrectfeedbackformat = FORMAT_HTML;\n $qdata->options->shownumcorrect = 1;\n $qdata->options->incorrectfeedback = '<p>Your answer is incorrect.</p>';\n $qdata->options->incorrectfeedbackformat = FORMAT_HTML;\n \n $qdata->options->answers = array(\n 13 => new question_answer(13, 'answer 1', 0, '', FORMAT_HTML),\n 14 => new question_answer(14, 'answer 2', 1, '', FORMAT_HTML),\n 15 => new question_answer(15, 'answer 3', 0, '', FORMAT_HTML),\n 16 => new question_answer(16, 'answer 4', 1, '', FORMAT_HTML),\n );\n \n $qdata->hints = array(\n new question_hint_with_parts(0, 'Hint 1.', FORMAT_HTML, false, false),\n new question_hint_with_parts(0, 'Hint 2.', FORMAT_HTML, false, false),\n );\n \n \n // Export the question.\n $exporter = new qformat_smart();\n $questions = array($qdata);\n $zipcontent = $exporter->export_questions($questions);\n \n // Open exported question as import_data.\n $import_data = $this->zip_to_import_data($zipcontent);\n \n /*\n * Test content of imsmanifest.xml\n */\n \n $imsmanifest = $import_data->imsmanifest;\n \n $expected = '<resource identifier=\"group0_pages\" href=\"page0.svg\" type=\"webcontent\" adlcp:scormType=\"asset\"><file href=\"page0.svg\"/></resource>';\n $actual = $imsmanifest->resources->resource[0]->asXML();\n $this->assert_same_xml($expected, $actual);\n \n $expected = '<resource identifier=\"pages\" href=\"page0.svg\" type=\"webcontent\" adlcp:scormType=\"asset\"><file href=\"page0.svg\"/></resource>';\n $actual = $imsmanifest->resources->resource[1]->asXML();\n $this->assert_same_xml($expected, $actual);\n \n /*\n * Test content of page.\n */\n \n // Test number of pages.\n $this->assertCount(1, $import_data->pages);\n \n $page = $import_data->pages[0];\n \n // Test the number of question elements.\n $questions = $page->xpath('//g[@class=\"question\"]');\n $this->assertCount(1, $questions);\n \n // Test the question element.\n $question = $questions[0];\n $expectedvotemetadata = '<votemetadata><questiontext format=\"selection\" labelstyle=\"upper-alpha\" correct=\"2 4\" points=\"23\" tags=\"\" explanation=\"General feedback\" mathgradingoption=\"\" likert=\"\"/></votemetadata>';\n $votemetadata = $question->votemetadata->asXML();\n $this->assert_same_xml($expectedvotemetadata, $votemetadata);\n \n // Test the question number.\n $expectedquestionnumber = '1';\n $questionnumber = strip_tags($question->text[0]->asXML());\n $this->assertEquals($expectedquestionnumber, $questionnumber);\n \n // Test the question text without formattings.\n $expectedquestiontext = 'Questiontext of muliple choice question.';\n $questiontext = strip_tags($question->text[1]->asXML());\n $this->assertEquals($expectedquestiontext, $questiontext);\n \n // Test the number of choices.\n $choices = $page->xpath('//g[@class=\"questionchoice\"]');\n $this->assertCount(4, $choices);\n \n // Test the 1. choice element.\n $choice = $choices[0];\n $expectedvotemetadata = '<votemetadata><choicetext label=\"1\" format=\"selection\"/></votemetadata>';\n $votemetadata = $choice->votemetadata->asXML();\n $this->assert_same_xml($expectedvotemetadata, $votemetadata);\n \n // Test the numbering of the choice text without formattings.\n $expectedchoicetext = 'A';\n $choicetext = strip_tags($choice->text[0]->asXML());\n $this->assertEquals($expectedchoicetext, $choicetext);\n \n // Test the choice text without formattings.\n $expectedchoicetext = 'answer 1';\n $choicetext = strip_tags($choice->text[1]->asXML());\n $this->assertEquals($expectedchoicetext, $choicetext);\n \n // Test the 2. choice element.\n $choice = $choices[1];\n $expectedvotemetadata = '<votemetadata><choicetext label=\"2\" format=\"selection\"/></votemetadata>';\n $votemetadata = $choice->votemetadata->asXML();\n $this->assert_same_xml($expectedvotemetadata, $votemetadata);\n \n // Test the numbering of the choice text without formattings.\n $expectedchoicetext = 'B';\n $choicetext = strip_tags($choice->text[0]->asXML());\n $this->assertEquals($expectedchoicetext, $choicetext);\n \n // Test the choice text without formattings.\n $expectedchoicetext = 'answer 2';\n $choicetext = strip_tags($choice->text[1]->asXML());\n $this->assertEquals($expectedchoicetext, $choicetext);\n \n // Test the 3. choice element.\n $choice = $choices[2];\n $expectedvotemetadata = '<votemetadata><choicetext label=\"3\" format=\"selection\"/></votemetadata>';\n $votemetadata = $choice->votemetadata->asXML();\n $this->assert_same_xml($expectedvotemetadata, $votemetadata);\n \n // Test the numbering of the choice text without formattings.\n $expectedchoicetext = 'C';\n $choicetext = strip_tags($choice->text[0]->asXML());\n $this->assertEquals($expectedchoicetext, $choicetext);\n \n // Test the choice text without formattings.\n $expectedchoicetext = 'answer 3';\n $choicetext = strip_tags($choice->text[1]->asXML());\n $this->assertEquals($expectedchoicetext, $choicetext);\n \n // Test the 4. choice element.\n $choice = $choices[3];\n $expectedvotemetadata = '<votemetadata><choicetext label=\"4\" format=\"selection\"/></votemetadata>';\n $votemetadata = $choice->votemetadata->asXML();\n $this->assert_same_xml($expectedvotemetadata, $votemetadata);\n \n // Test the numbering of the choice text without formattings.\n $expectedchoicetext = 'D';\n $choicetext = strip_tags($choice->text[0]->asXML());\n $this->assertEquals($expectedchoicetext, $choicetext);\n \n // Test the choice text without formattings.\n $expectedchoicetext = 'answer 4';\n $choicetext = strip_tags($choice->text[1]->asXML());\n $this->assertEquals($expectedchoicetext, $choicetext);\n }", "public function getAnswerInputType()\n {\n if (array_key_exists(\"answerInputType\", $this->_propDict)) {\n if (is_a($this->_propDict[\"answerInputType\"], \"\\Beta\\Microsoft\\Graph\\Model\\VirtualEventRegistrationQuestionAnswerInputType\") || is_null($this->_propDict[\"answerInputType\"])) {\n return $this->_propDict[\"answerInputType\"];\n } else {\n $this->_propDict[\"answerInputType\"] = new VirtualEventRegistrationQuestionAnswerInputType($this->_propDict[\"answerInputType\"]);\n return $this->_propDict[\"answerInputType\"];\n }\n }\n return null;\n }", "public function get_response_type()\n\t{\n\t\treturn $this->response_type;\n\t}", "public function get_response_type()\n\t{\n\t\treturn $this->response_type;\n\t}", "public function getResponceType()\n {\n return $this->responceType;\n }", "public function get_correct_response() \n {\n return array('answer' => 0);\n }", "public function getFaqAnswer () {\n\t$preValue = $this->preGetValue(\"faqAnswer\"); \n\tif($preValue !== null && !\\Pimcore::inAdmin()) { \n\t\treturn $preValue;\n\t}\n\t$data = $this->getClass()->getFieldDefinition(\"faqAnswer\")->preGetData($this);\n\treturn $data;\n}", "public function getResponseType(){\n return $this->response_type;\n }", "function getType($id)\n\t{\n\t\tif (empty($id)) //safe because we never use 0 as an id\n\t\t{\n\t\t\t$currentID = $this->getID();\n\t\t\tif (empty($currentID)) return false;\n\t\t\t$id = $currentID;\n\t\t}\n\t\t$result = $this->find('first', array(\n\t\t\t'conditions' => array('id' => $id),\n\t\t\t'fields' => array('ans_type')\n\t\t));\n\t\tif (empty($result)) return false;\n\t\treturn $result['Answer']['ans_type'];\n\t}", "public function AskQuestion($data);", "public function answer()\n\t{\n\t\tif (!$this->typeResponseCode)\n\t\t\treturn $this->answerTwoHundred($this->data);\n\t\telse\n\t\t\treturn $this->answerThroughHeader($this->data);\n\t}", "public function get_multianswer_question_form_data_twosubq() {\n $formdata = new stdClass();\n $formdata->name = 'Simple multianswer';\n $formdata->questiontext = array('text' => 'Complete this opening line of verse: \"The ' .\n '{1:SHORTANSWER:Dog#Wrong, silly!~=Owl#Well done!~*#Wrong answer} ' .\n 'and the {1:MULTICHOICE:Bow-wow#You seem to have a dog obsessions!' .\n '~Wiggly worm#Now you are just being ridiculous!~=Pussy-cat#Well done!}' .\n ' went to sea\".', 'format' => FORMAT_HTML);\n $formdata->generalfeedback = array('text' => 'General feedback: It\\'s from \"The Owl and the Pussy-cat\" ' .\n 'by Lear: \"The owl and the pussycat went to sea', 'format' => FORMAT_HTML);\n\n $formdata->hint = array(\n 0 => array('text' => 'Hint 1', 'format' => FORMAT_HTML, 'itemid' => 0),\n 1 => array('text' => 'Hint 2', 'format' => FORMAT_HTML, 'itemid' => 0),\n );\n\n return $formdata;\n }", "public function getQuestionData()\n {\n return $this->_coreRegistry->registry('current_question');\n }", "function writequestion( $question ) {\n\t // question reflects database fields for general question and specific to type\n\t\n\t // initial string;\n\t $expout = \"\";\n\t\n\t // add comment\n\t $expout .= \"// question: $question->id \\n\";\n\n\t if ($question->id_category != \"\"){\n\t $expout .= \"\\$CATEGORY:$question->id_category\\n\";\n\t }\n\t\t\n\t // get question text format\n\t /*$textformat = $question->textformat;\n\t $question->text = \"\";\n\t if ($textformat!=FORMAT_MOODLE) {\n\t $question->text = text_format_name( (int)$textformat );\n\t $question->text = \"[$question->text]\";\n\t }*/\n\t $qtext_format = \"[\".$question->qtype.\"]\";\n\t // output depends on question type\n\t switch($question->qtype) {\n\t\t\tcase 'category' : {\n\t\t\t\t// not a real question, used to insert category switch\n\t\t\t\t$expout .= \"\\$CATEGORY: $question->category\\n\"; \n\t\t\t};break;\n\t\t\tcase 'title' : {\n\t\t\t\tif($question->prompt != '') $expout .= '::'.$this->repchar($question->prompt).'::';\n\t\t\t\t$expout .= $qtext_format;\n\t\t\t\t$expout .= $this->repchar( $question->quest_text);\n\t\t\t};break;\n\t\t case 'extended_text' : {\n\t\t $expout .= '::'.$this->repchar($question->prompt).'::';\n\t\t $expout .= $qtext_format;\n\t\t $expout .= $this->repchar( $question->quest_text);\n\t\t $expout .= \"{}\\n\";\n\t\t };break;\n\t\t case 'truefalse' : {/*\n\t\t $trueanswer = $question->options->answers[$question->options->trueanswer];\n\t\t $falseanswer = $question->options->answers[$question->options->falseanswer];\n\t\t if ($trueanswer->fraction == 1) {\n\t\t $answertext = 'TRUE';\n\t\t $right_feedback = $trueanswer->feedback;\n\t\t $wrong_feedback = $falseanswer->feedback;\n\t\t } else {\n\t\t $answertext = 'FALSE';\n\t\t $right_feedback = $falseanswer->feedback;\n\t\t $wrong_feedback = $trueanswer->feedback;\n\t\t }\n\t\t\n\t\t $wrong_feedback = $this->repchar($wrong_feedback);\n\t\t $right_feedback = $this->repchar($right_feedback);\n\t\t $expout .= \"::\".$this->repchar($question->prompt).\"::\".$qtext_format.$this->repchar( $question->quest_text ).\"{\".$this->repchar( $answertext );\n\t\t if ($wrong_feedback) {\n\t\t $expout .= \"#\" . $wrong_feedback;\n\t\t } else if ($right_feedback) {\n\t\t $expout .= \"#\";\n\t\t }\n\t\t if ($right_feedback) {\n\t\t $expout .= \"#\" . $right_feedback;\n\t\t }\n\t\t $expout .= \"}\\n\";*/\n\t\t }//;break;\n\t\t \n\t\t case 'shortanswer' : {/*\n\t\t $expout .= \"::\".$this->repchar($question->prompt).\"::\".$qtext_format.$this->repchar( $question->quest_text ).\"{\\n\";\n\t\t foreach($question->options->answers as $answer) {\n\t\t $weight = 100 * $answer->score_correct;\n\t\t $expout .= \"\\t=%\".$weight.\"%\".$this->repchar( $answer->text ).\"#\".$this->repchar( $answer->comment ).\"\\n\";\n\t\t }\n\t\t $expout .= \"}\\n\";*/\n\t\t }//;break;\n\t\t\tcase 'choice' : {\n\t\t\t\t$expout .= \"::\".$this->repchar($question->prompt).\"::\".$qtext_format.$this->repchar( $question->quest_text ).\"{\\n\";\n\t\t\t\t\n\t\t\t\tforeach($question->answers as $answer) {\n\t\t\t\t\tif (($answer->score_correct == 1) || ($answer->score_correct == 0 && $answer->is_correct == 1) ) {\n\t\t\t\t\t\t$answertext = '=';\n\t\t\t\t\t}\n\t\t\t\t\telseif ($answer->score_correct > 1) {\n\t\t\t\t\t\t$export_weight = $answer->score_correct*100;\n\t\t\t\t\t\t$answertext = \"=%$export_weight%\";\n\t\t\t\t\t}\n\t\t\t\t\telseif ($answer->score_correct==0) {\n\t\t\t\t\t\t$answertext = '~';\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t$export_weight = $answer->score_correct*100;\n\t\t\t\t\t\t$answertext = \"~%$export_weight%\";\n\t\t\t\t\t}\n\t\t\t\t\t$expout .= \"\\t\".$answertext.$this->repchar( $answer->text );\n\t\t\t\t\tif ($answer->comment!=\"\") {\n\t\t\t\t\t\t$expout .= \"#\".$this->repchar( $answer->comment );\n\t\t\t\t\t}\n\t\t\t\t\t$expout .= \"\\n\";\n\t\t\t\t}\n\t\t\t\t$expout .= \"}\\n\";\n\t\t\t};break;\n\t\t\tcase 'choice_multiple' : {\n\t\t\t\t$expout .= \"::\".$this->repchar($question->prompt).\"::\".$qtext_format.$this->repchar( $question->quest_text ).\"{\\n\";\n\t\t\t\t\n\t\t\t\tforeach($question->answers as $answer) {\n\t\t\t\t\tif ($answer->score_correct==1) {\n\t\t\t\t\t\t$answertext = '=';\n\t\t\t\t\t}\n\t\t\t\t\telseif ($answer->score_correct==0) {\n\t\t\t\t\t\t$answertext = '~';\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t$export_weight = $answer->score_correct*100;\n\t\t\t\t\t\t$answertext = \"~%$export_weight%\";\n\t\t\t\t\t}\n\t\t\t\t\t$expout .= \"\\t\".$answertext.$this->repchar( $answer->text );\n\t\t\t\t\tif ($answer->comment!=\"\") {\n\t\t\t\t\t\t$expout .= \"#\".$this->repchar( $answer->comment );\n\t\t\t\t\t}\n\t\t\t\t\t$expout .= \"\\n\";\n\t\t\t\t}\n\t\t\t\t$expout .= \"}\\n\";\n\t\t\t};break;\n\t\t case 'associate' : {\n\t\t\t\t$expout .= \"::\".$this->repchar($question->prompt).\"::\".$qtext_format.$this->repchar( $question->quest_text ).\"{\\n\";\n\t\t\t\tforeach($question->answers as $i => $subquestion) {\n\t\t\t\t\t$expout .= \"\\t=\".$this->repchar( $subquestion->text ).\" -> \".$this->repchar( $question->extra_info[$i]->text ).\"\\n\";\n\t\t\t\t}\n\t\t\t\t$expout .= \"}\\n\";\n\t\t };break;\n\t\t case NUMERICAL:\n\t\t $expout .= \"::\".$this->repchar($question->prompt).\"::\".$qtext_format.$this->repchar( $question->quest_text ).\"{#\\n\";\n\t\t foreach ($question->options->answers as $answer) {\n\t\t if ($answer->text != '') {\n\t\t $percentage = '';\n\t\t if ($answer->score_correct < 1) {\n\t\t $pval = $answer->score_correct * 100;\n\t\t $percentage = \"%$pval%\";\n\t\t }\n\t\t $expout .= \"\\t=$percentage\".$answer->text.\":\".(float)$answer->tolerance.\"#\".$this->repchar( $answer->comment ).\"\\n\";\n\t\t } else {\n\t\t $expout .= \"\\t~#\".$this->repchar( $answer->comment ).\"\\n\";\n\t\t }\n\t\t }\n\t\t $expout .= \"}\\n\";\n\t\t break;\n\t\t case DESCRIPTION:\n\t\t $expout .= \"// DESCRIPTION type is not supported\\n\";\n\t\t break;\n\t\t case MULTIANSWER:\n\t\t $expout .= \"// CLOZE type is not supported\\n\";\n\t\t break;\n\t\t default:\n\t\t \n\t\t\t\treturn false;\n\t\t}\n\t // add empty line to delimit questions\n\t $expout .= \"\\n\";\n\t return $expout;\n\t}", "function getAnswerText(){\r\n\t\tif($this->inDB==false||$this->answer==null){\r\n\t\t\t$type = $this->dbq->getAnswerType($this->answer_id);\r\n\t\t\tif($type==3 || $type==7 || $type==8){\r\n\t\t\t\t$io = new FileIOHandler();\r\n\t\t\t\t$this->answer=$io->MediaRead($type,$this->answer_id);\r\n\t\t\t}else{\r\n\t\t\t\t$temp = $this->dbq->getAnswer($this->answer_id);\r\n\t\t\t\t$num=mysql_numrows($temp);\r\n\t\t\t\t\tif($num==1){\r\n\t\t\t\t\t\tif($type==1){\r\n\t\t\t\t\t\t\t$this->answer=mysql_result($temp,0,\"text\");\r\n\t\t\t\t\t\t}elseif($type== 2 || $type==4 || $type==5 || $type==9){\r\n\t\t\t\t\t\t\t$this->answer=mysql_result($temp,0,\"num\");\t\t\t\t\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\treturn $this->answer;\t\t\r\n\t}", "function get_question_type() {\n $ci = & get_instance();\n //load databse library\n $ci->load->database();\n //get data from database\n $ci->db->select(\"*\");\n $ci->db->from('tbl_question_type_master');\n $query = $ci->db->get();\n if ($query->num_rows() > 0) {\n $result = $query->result();\n return $result;\n } else {\n return false;\n }\n }", "public function getResponseType()\n {\n return $this->response_type;\n }", "public function getForumTypeAttribute()\n\t{\n\t\treturn 'reply';\n\t}", "public function get_multianswer_question_data_dollarsigns() {\n $qdata = new stdClass();\n test_question_maker::initialise_question_data($qdata);\n\n $qdata->name = 'Multianswer with $s';\n $qdata->questiontext =\n 'Which is the right order? {#1}';\n $qdata->generalfeedback = '';\n\n $qdata->defaultmark = 1.0;\n $qdata->qtype = 'multianswer';\n\n $mc = new stdClass();\n test_question_maker::initialise_question_data($mc);\n\n $mc->name = 'Multianswer with $s';\n $mc->questiontext = '{1:MULTICHOICE:=y,y,$3~$3,y,y}';\n $mc->generalfeedback = '';\n $mc->penalty = 0.0;\n $mc->qtype = 'multichoice';\n\n $mc->options = new stdClass();\n $mc->options->layout = 0;\n $mc->options->single = 1;\n $mc->options->shuffleanswers = 0;\n $mc->options->correctfeedback = '';\n $mc->options->correctfeedbackformat = 1;\n $mc->options->partiallycorrectfeedback = '';\n $mc->options->partiallycorrectfeedbackformat = 1;\n $mc->options->incorrectfeedback = '';\n $mc->options->incorrectfeedbackformat = 1;\n $mc->options->answernumbering = 0;\n $mc->options->shownumcorrect = 0;\n\n $mc->options->answers = array(\n 23 => new question_answer(23, 'y,y,$3', 0, '', FORMAT_HTML),\n 24 => new question_answer(24, '$3,y,y', 0, '', FORMAT_HTML),\n );\n\n $qdata->options = new stdClass();\n $qdata->options->questions = array(\n 1 => $mc,\n );\n\n $qdata->hints = array(\n );\n\n return $qdata;\n }", "public function getQuestionnaireTypeId()\n {\n return $this->questionnaire_type_id;\n }", "public function get_correct_answer() {\n return isset($this->answer) ? array('answer' => $this->answer) : array();\n }", "public function check_answer() {\n $result = new stdClass;\n $result->answerid = 0;\n $result->noanswer = false;\n $result->correctanswer = false;\n $result->isessayquestion = false; // Use this to turn off review button on essay questions\n $result->response = '';\n $result->newpageid = 0; // Stay on the page\n $result->studentanswer = ''; // Use this to store student's answer(s) in order to display it on feedback page\n $result->userresponse = null;\n $result->feedback = '';\n $result->nodefaultresponse = false; // Flag for redirecting when default feedback is turned off\n return $result;\n }", "function get_correct_answer(){\n return $this->correct_answer;\n }", "public static function client_request_type()\n {\n if( $_POST['catId']=='false' &&\n $_POST['catDrop']=='false') {\n return 'client_responce_default';\n\n } elseif( $_POST['catId']!='false' &&\n $_POST['catNew']!='false') {\n return 'client_responce_category';\n\n } elseif( $_POST['catId']!='false' &&\n $_POST['catNew']=='false') {\n return 'client_responce_category_load_more';\n\n } elseif( $_POST['catDrop']=='true' ) {\n return 'client_responce_category_drop';\n }\n }", "public function getResponseType()\n {\n return $this->_requestType;\n }", "function question()\r\n {\r\n return $this->Question;\r\n }", "function run()\n\t{\n\t\trequire_code('quiz');\n\n\t\t$questions=array();\n\n\t\t$text=post_param('text');\n\t\t$type=post_param('type');\n\n\t\t$_qs=explode(chr(10).chr(10),$text);\n\t\t$qs=array();\n\t\tforeach ($_qs as $q)\n\t\t{\n\t\t\t$q=trim($q);\n\t\t\tif ($q!='') $qs[]=$q;\n\t\t}\n\t\t$num_q=0;\n\n\t\t$qs2=array();\n\t\tforeach ($qs as $i=>$q)\n\t\t{\n\t\t\t$_as=explode(chr(10),$q);\n\t\t\t$as=array();\n\t\t\tforeach ($_as as $a)\n\t\t\t{\n\t\t\t\tif ($a!='') $as[]=$a;\n\t\t\t}\n\t\t\t$q=array_shift($as);\n\t\t\t$matches=array();\n\t\t\t//if (preg_match('#^(\\d+)\\)?(.*)#',$q,$matches)===false) continue;\n\t\t\tif (preg_match('#^(.*)#',$q,$matches)===false) continue;\n\t\t\tif (count($matches)==0) continue;\n\n\t\t\t$implicit_question_number=$i;//$matches[1];\n\n\t\t\t$qs2[$implicit_question_number]=$q.chr(10).implode(chr(10),$as);\n\t\t}\n\t\tksort($qs2);\n\n\t\tforeach (array_values($qs2) as $i=>$q)\n\t\t{\n\t\t\t$_as=explode(chr(10),$q);\n\t\t\t$as=array();\n\t\t\tforeach ($_as as $a)\n\t\t\t{\n\t\t\t\tif ($a!='') $as[]=$a;\n\t\t\t}\n\t\t\t$q=array_shift($as);\n\t\t\t$matches=array();\n\t\t\t//if (preg_match('#^(\\d+)\\)?(.*)#',$q,$matches)===false) continue;\n\t\t\tif (preg_match('#^(.*)#',$q,$matches)===false) continue;\n\t\t\tif (count($matches)==0) continue;\n\t\t\t$question=trim($matches[count($matches)-1]);\n\t\t\t$long_input_field=(strpos($question,' [LONG]')!==false)?1:0;\n\t\t\t$question=str_replace(' [LONG]','',$question);\n\t\t\t$num_choosable_answers=(strpos($question,' [*]')!==false)?count($as):((count($as)>0)?1:0);\n\t\t\t$question=str_replace(' [*]','',$question);\n\t\t\t$required=(strpos($question,' [REQUIRED]')!==false)?1:0;\n\t\t\t$question=str_replace(' [REQUIRED]','',$question);\n\n\t\t\t// Now we add the answers\n\t\t\t$answers=array();\n\t\t\tforeach ($as as $x=>$a)\n\t\t\t{\n\t\t\t\t$is_correct=((($x==0) && (strpos($qs2[$i],' [*]')===false) && ($type!='SURVEY')) || (strpos($a,' [*]')!==false))?1:0;\n\t\t\t\t$a=str_replace(' [*]','',$a);\n\n\t\t\t\tif (substr($a,0,1)==':') continue;\n\n\t\t\t\t$answers[]=array(\n\t\t\t\t\t'id'=>$x,\n\t\t\t\t\t'q_answer_text'=>$a,\n\t\t\t\t\t'q_is_correct'=>$is_correct,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t$questions[]=array(\n\t\t\t\t'id'=>$i,\n\t\t\t\t'q_long_input_field'=>$long_input_field,\n\t\t\t\t'q_num_choosable_answers'=>$num_choosable_answers,\n\t\t\t\t'q_question_text'=>$question,\n\t\t\t\t'answers'=>$answers,\n\t\t\t\t'q_required'=>$required,\n\t\t\t);\n\n\t\t\t$num_q++;\n\t\t}\n\n\t\t$preview=render_quiz($questions);\n\n\t\treturn array(do_template('FORM',array('SUBMIT_NAME'=>'','TEXT'=>'','URL'=>'','HIDDEN'=>'','FIELDS'=>$preview)),NULL);\n\t}", "public function qtype() \n {\n return 'scripted';\n }", "public function getAnswer() {\n return $this->program->getAnswer();\n }", "function answer_status_class($answer)\n {\n if($answer['is_correct']) {\n return 'correct';\n } else if($answer['is_unanswered']) {\n return 'unanswered';\n } else {\n return 'incorrect';\n }\n }", "function reqType($data, $type = \"string\") {\n\t\tif (!settype($data, $type))\n\t\t\tstop(3, \"Type Mismatch! \\\"$data\\\" is not a $type\", 400);\n\t\t\n\t\treturn $data;\n\t}", "public function getQuestion(): string\n {\n return $this->question;\n }", "public function getUserAnswer() : string {\n return $this->_userAnswer;\n }", "public static function answer_question(array $question);", "public function getReasonType()\n {\n return $this->reasonType;\n }", "function examTypes() {\n return array('General', 'IIT', 'NEET', 'Eamcet', 'NTSE');\n}", "function insert_message_answer($answer, $sender_email, $message_id, $message_type){\n\t\tif( isset($_POST[$answer]) ){\n\t\t\tglobal $base;\n\t\t\t\n\t\t\t$answer_msg\t\t= $_POST[$answer];\n\t\t\t$sender_email \t= $_POST[$sender_email];\n\t\t\t$message_id \t= $_POST[$message_id];\n\t\t\t$message_type \t= $_POST[$message_type];\n\n\t\t\tswitch ($message_type) {\n\t\t\t\tcase 'user':\n\t\t\t\t\t$messages = new messages();\n\t\t\t\t\t$messages->user_id \t\t\t\t= $base->clear_string($_SESSION['user_id']);\n\t\t\t\t\t$messages->message_content \t\t= $answer_msg;\n\t\t\t\t\t$messages->message_answer_time \t= date('Y/m/d H:i:s');\n\t\t\t\t\t$messages->message_read \t\t= 1;\n\t\t\t\t\t$messages->message_answer \t\t= $message_id;\n\n\t\t\t\t\t$messages->create();\n\n\t\t\t\t\t$user = user::find_this_id( $_SESSION['user_id'] );\n\t\t\t\t\t\n\t\t\t\t\tmail($base->clear_string($sender_email), 'Unilink-finance, Odgovor', 'Poruka od: '. $user->email .'<br>'. $base->clear_string($answer_msg) );\n\n\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tcase 'master_user':\n\t\t\t\t\t// In every \"client_id\" field into MASTER ADMIN ACCOUNT, when master admin answering on question, we will insert master admin id into client_id field\n\t\t\t\t\t// On that way, we will recognize distinguish between answers and questions.\n\t\t\t\t\t// Answers HAS THE SAME ID into \"admin_id\" and \"client_id\" fields\n\t\t\t\t\t$messages_admin = new messages_admin();\n\t\t\t\t\t$messages_admin->admin_id\t = $base->clear_string($_SESSION['user_id']);\n\t\t\t\t\t$messages_admin->client_id \t = $base->clear_string($_SESSION['user_id']); \n\t\t\t\t\t$messages_admin->read_msg \t = 1;\n\t\t\t\t\t$messages_admin->content \t = $answer_msg;\n\t\t\t\t\t$messages_admin->answer \t = $message_id;\n\t\t\t\t\t$messages_admin->answer_time = date('Y-m-d H:i:s');\n\n\t\t\t\t\t\n\t\t\t\t\t$messages_admin->create();\n\n\t\t\t\t\tmail($base->clear_string($sender_email), 'Unilink-finance, Odgovor', $base->clear_string($answer_msg), 'From: [email protected]');\n\t\t\t\tbreak;\n\t\t\t}\n\n\n\n\t\t}\t\n\t}", "function qtype_calculated_calculate_answer($formula, $individualdata,\n $tolerance, $tolerancetype, $answerlength, $answerformat='1', $unit='') {\n/// ->answer the correct answer\n/// ->min the lower bound for an acceptable response\n/// ->max the upper bound for an accetpable response\n\n /// Exchange formula variables with the correct values...\n global $QTYPES;\n $answer = $QTYPES['calculated']->substitute_variables_and_eval($formula, $individualdata);\n if ('1' == $answerformat) { /* Answer is to have $answerlength decimals */\n /*** Adjust to the correct number of decimals ***/\n if (stripos($answer,'e')>0 ){\n $answerlengthadd = strlen($answer)-stripos($answer,'e');\n }else {\n $answerlengthadd = 0 ;\n }\n $calculated->answer = round(floatval($answer), $answerlength+$answerlengthadd);\n\n if ($answerlength) {\n /* Try to include missing zeros at the end */\n\n if (ereg('^(.*\\\\.)(.*)$', $calculated->answer, $regs)) {\n $calculated->answer = $regs[1] . substr(\n $regs[2] . '00000000000000000000000000000000000000000x',\n 0, $answerlength)\n . $unit;\n } else {\n $calculated->answer .=\n substr('.00000000000000000000000000000000000000000x',\n 0, $answerlength + 1) . $unit;\n }\n } else {\n /* Attach unit */\n $calculated->answer .= $unit;\n }\n\n } else if ($answer) { // Significant figures does only apply if the result is non-zero\n\n // Convert to positive answer...\n if ($answer < 0) {\n $answer = -$answer;\n $sign = '-';\n } else {\n $sign = '';\n }\n\n // Determine the format 0.[1-9][0-9]* for the answer...\n $p10 = 0;\n while ($answer < 1) {\n --$p10;\n $answer *= 10;\n }\n while ($answer >= 1) {\n ++$p10;\n $answer /= 10;\n }\n // ... and have the answer rounded of to the correct length\n $answer = round($answer, $answerlength);\n\n // Have the answer written on a suitable format,\n // Either scientific or plain numeric\n if (-2 > $p10 || 4 < $p10) {\n // Use scientific format:\n $eX = 'e'.--$p10;\n $answer *= 10;\n if (1 == $answerlength) {\n $calculated->answer = $sign.$answer.$eX.$unit;\n } else {\n // Attach additional zeros at the end of $answer,\n $answer .= (1==strlen($answer) ? '.' : '')\n . '00000000000000000000000000000000000000000x';\n $calculated->answer = $sign\n .substr($answer, 0, $answerlength +1).$eX.$unit;\n }\n } else {\n // Stick to plain numeric format\n $answer *= \"1e$p10\";\n if (0.1 <= $answer / \"1e$answerlength\") {\n $calculated->answer = $sign.$answer.$unit;\n } else {\n // Could be an idea to add some zeros here\n $answer .= (ereg('^[0-9]*$', $answer) ? '.' : '')\n . '00000000000000000000000000000000000000000x';\n $oklen = $answerlength + ($p10 < 1 ? 2-$p10 : 1);\n $calculated->answer = $sign.substr($answer, 0, $oklen).$unit;\n }\n }\n\n } else {\n $calculated->answer = 0.0;\n }\n\n /// Return the result\n return $calculated;\n}", "public function generateQuestion()\n\t{\n\t\t//get random question type\n\t\t$type = $this->questionTypes[array_rand($this->questionTypes)];\n\n\t\t//get random section\n\t\t$section = $this->getRandomSection();\n\n\t\t//get random function (within the above section)\n\t\t$function = $this->getRandomFunction($section);\n\n\t\t$question = [];\n\t\t$question['type'] = $type;\n\t\t$question['section'] = $section;\n\t\t$question['function'] = $function;\n\t\t$question['text'] = \"{$section} now, {$this->questionTextPerType[$type]}\";\n\t\t$question['choices'] = [];\n\t\t$question['answer_text'] = '';\n\t\t$question['answer_index'] = '';\t//in ['choices'] array\n\n\n\t\treturn $this->fillQuestion($question);\n\t}", "function answerOf(){\r\n\t\tif($this->inDB==false||$this->answerOf==null){\r\n\t\t\t$temp=$this->dbq->answerOf($this->answer_id);\r\n\t\t\tif($temp!=\"SelectError\" || $temp!=null){\r\n\t\t\t\t$this->answerOf = $temp;\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\treturn $this->answerOf;\r\n\t}", "public function extra_answer_fields() {\n return array(\n 'qtype_calculatedfmt',\n 'tolerance',\n 'tolerancetype',\n );\n }", "public function logSurveyAnswer($type, $suId, $quesId, $myVal) {\n $insertArray = array();\n if ($type == 'comment' || $type == 'text') {\n $insertArray = array(\n 'ans_su_id' => $suId,\n 'ans_que_id' => $quesId,\n 'ans_yes_no' => '',\n 'ans_comment' => $myVal\n );\n } elseif ($type == 'yesno') {\n if (empty($myVal))\n $myVal = 0;\n $insertArray = array(\n 'ans_su_id' => $suId,\n 'ans_que_id' => $quesId,\n 'ans_yes_no' => $myVal,\n 'ans_comment' => ''\n );\n }\n $lastId = 0;\n if (!empty($insertArray)) {\n $whereArr = array(\n 'ans_su_id' => $suId,\n 'ans_que_id' => $quesId\n );\n $this->db->where($whereArr);\n $this->db->select('ans_id');\n $result = $this->db->get('plused_survey_answers'); // CHECK FOR UPDATE\n if ($result->num_rows()) {\n $ansId = $result->row()->ans_id;\n $this->db->flush_cache();\n $this->db->where('ans_id', $ansId);\n $this->db->update('plused_survey_answers', $insertArray); // UDPATE EXISTING \n $lastId = $ansId;\n } else {\n $this->db->flush_cache();\n $this->db->insert('plused_survey_answers', $insertArray); // INSERT NEW RECORD\n $lastId = $this->db->insert_id();\n }\n }\n return $lastId;\n }", "public function getAskMagicsoulReply()\n {\n return $this->get(self::_ASK_MAGICSOUL_REPLY);\n }", "public function get_expected_data()\n {\n //expect the submission of one or more files\n //return array('answer' => question_attempt::PARAM_FILES);\n return array('answer' => question_attempt::PARAM_FILES, 'answerraw' => PARAM_RAW, 'attemptid' => PARAM_INT);\n }", "public function answer() {\n\n\t\t/**\n\t\t * Fires right before giving the answer.\n\t\t */\n\t\tdo_action( self::ACTION );\n\n\t\t/**\n\t\t * Filters the answer.\n\t\t *\n\t\t * @param string $answer The answer.\n\t\t */\n\t\treturn (string) apply_filters( self::FILTER, '42' );\n\t}", "public function get_question() {\n\t\t\treturn $this->question;\n\t\t}", "function getType() { return $this->readType(); }", "public function getQuestion() {\n return $this->question;\n }", "function getQuestionType($question_id) \n\t{\n\t\tglobal $ilDB;\n\t\tif ($question_id < 1) return -1;\n\t\t$result = $ilDB->queryF(\"SELECT type_tag FROM svy_question, svy_qtype WHERE svy_question.question_id = %s AND \" .\n\t\t\t\"svy_question.questiontype_fi = svy_qtype.questiontype_id\",\n\t\t\tarray('integer'),\n\t\t\tarray($question_id)\n\t\t);\n\t\tif ($result->numRows() == 1) \n\t\t{\n\t\t\t$data = $ilDB->fetchAssoc($result);\n\t\t\treturn $data[\"type_tag\"];\n\t\t} \n\t\telse \n\t\t{\n\t\t\treturn \"\";\n\t\t}\n\t}", "function type () {\r\n return $this->_type;\r\n }", "public function getQuestion() {\n\t\t\treturn $this->question;\n\t\t}", "function getType(){\n\t\t\treturn $this->message_type;\n\t\t}", "public function setAnswerInputType($val)\n {\n $this->_propDict[\"answerInputType\"] = $val;\n return $this;\n }", "public function getQuestiontype()\n {\n return $this->hasOne(QuestionType::className(), ['id' => 'question_type_id']);\n }", "public function getDataType() {\n return $this->dataType;\n }", "public function getAnswer()\n {\n return $this->answerModel;\n }", "function get_type() {\n\t\treturn $this->get_data( 'type' );\n\t}", "public function getResponseType() {\n return NoNull($this->settings['type'], 'application/json');\n }", "public function getDataType() {\n\t\treturn $this -> dataType;\n\t}", "public function getCorrectResponse() {\r\n return new qti_variable($this->cardinality, $this->type, array('value' => $this->correctResponse));\r\n }", "public function make_multianswer_question_twosubq() {\n question_bank::load_question_definition_classes('multianswer');\n $q = new qtype_multianswer_question();\n test_question_maker::initialise_a_question($q);\n $q->name = 'Simple multianswer';\n $q->questiontext =\n 'Complete this opening line of verse: \"The {#1} and the {#2} went to sea\".';\n $q->generalfeedback = 'General feedback: It\\'s from \"The Owl and the Pussy-cat\" by Lear: ' .\n '\"The owl and the pussycat went to sea';\n $q->qtype = question_bank::get_qtype('multianswer');\n\n $q->textfragments = array(\n 'Complete this opening line of verse: \"The ',\n ' and the ',\n ' went to sea\".',\n );\n $q->places = array('1' => '1', '2' => '2');\n\n // Shortanswer subquestion.\n question_bank::load_question_definition_classes('shortanswer');\n $sa = new qtype_shortanswer_question();\n test_question_maker::initialise_a_question($sa);\n $sa->name = 'Simple multianswer';\n $sa->questiontext = '{1:SHORTANSWER:Dog#Wrong, silly!~=Owl#Well done!~*#Wrong answer}';\n $sa->questiontextformat = FORMAT_HTML;\n $sa->generalfeedback = '';\n $sa->generalfeedbackformat = FORMAT_HTML;\n $sa->usecase = true;\n $sa->answers = array(\n 13 => new question_answer(13, 'Dog', 0.0, 'Wrong, silly!', FORMAT_HTML),\n 14 => new question_answer(14, 'Owl', 1.0, 'Well done!', FORMAT_HTML),\n 15 => new question_answer(15, '*', 0.0, 'Wrong answer', FORMAT_HTML),\n );\n $sa->qtype = question_bank::get_qtype('shortanswer');\n $sa->maxmark = 1;\n\n // Multiple-choice subquestion.\n question_bank::load_question_definition_classes('multichoice');\n $mc = new qtype_multichoice_single_question();\n test_question_maker::initialise_a_question($mc);\n $mc->name = 'Simple multianswer';\n $mc->questiontext = '{1:MULTICHOICE:Bow-wow#You seem to have a dog obsessions!' .\n '~Wiggly worm#Now you are just being rediculous!~=Pussy-cat#Well done!}';\n $mc->questiontextformat = FORMAT_HTML;\n $mc->generalfeedback = '';\n $mc->generalfeedbackformat = FORMAT_HTML;\n\n $mc->shuffleanswers = 0;\n $mc->answernumbering = 'none';\n $mc->layout = qtype_multichoice_base::LAYOUT_DROPDOWN;\n\n $mc->answers = array(\n 13 => new question_answer(13, 'Bow-wow', 0,\n 'You seem to have a dog obsessions!', FORMAT_HTML),\n 14 => new question_answer(14, 'Wiggly worm', 0,\n 'Now you are just being rediculous!', FORMAT_HTML),\n 15 => new question_answer(15, 'Pussy-cat', 1,\n 'Well done!', FORMAT_HTML),\n );\n $mc->qtype = question_bank::get_qtype('multichoice');\n $mc->maxmark = 1;\n\n $q->subquestions = array(\n 1 => $sa,\n 2 => $mc,\n );\n\n return $q;\n }", "function questionTypes($key = false) {\n $questionTypes = array(\n 1 => 'Single answer',\n 2 => 'More than one answer',\n 3 => 'Comprehension',\n 4 => 'Matrix matching',\n 5 => 'Integer'\n );\n return $key === false ? $questionTypes : $questionTypes[$key];\n}", "public function getDataType()\n {\n return $this->dataType;\n }", "public function getDataType()\n {\n return $this->dataType;\n }", "public function getDataType()\n {\n return $this->dataType;\n }", "public function getDataType()\n {\n return $this->dataType;\n }", "public function getResponseType();", "public function getResponseType();", "public function model()\n {\n return Answer::class;\n }", "public function getInputType(): string\n {\n return $this->expectArray\n ? \"array of {$this->type}\"\n : $this->type;\n }", "public static function types() : array\n {\n return ['questions', 'pictures', 'video'];\n }", "public function getType()\n {\n $rtn = $this->data['type'];\n\n return $rtn;\n }", "public function get_possible_responses( $questiondata )\n\t{\n\t\treturn array();\n\t}", "public function getFaqQuestion () {\n\t$preValue = $this->preGetValue(\"faqQuestion\"); \n\tif($preValue !== null && !\\Pimcore::inAdmin()) { \n\t\treturn $preValue;\n\t}\n\t$data = $this->faqQuestion;\n\treturn $data;\n}", "public function getKeyword()\n {\n return 'ANSWERED';\n }", "public function getAnswers();", "private function getQuizzStatusTypes() {\n global $wpdb;\n $res = $wpdb->get_results('SELECT DATA_TYPE FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA=\"irish_wp\" AND TABLE_NAME = \"IRQ_quizzes\" AND COLUMN_NAME=\"quizz_status\"');\n $this->varDD($res);\n return explode(',',$res['quizz_status']->Type); \n \n }", "function getQuestions($type = NULL){\n\t\trequire('quizrooDB.php');\n\t\t$query = sprintf(\"SELECT question_id FROM q_questions WHERE fk_quiz_id = %d\", $this->quiz_id);\n\t\t$getQuery = mysql_query($query, $quizroo) or die(mysql_error());\n\t\t$row_getQuery = mysql_fetch_assoc($getQuery);\n\t\t$totalRows_getQuery = mysql_num_rows($getQuery);\n\t\t\n\t\tif($type == \"count\"){\n\t\t\t// return the count\n\t\t\treturn $totalRows_getQuery;\n\t\t}else{\n\t\t\t// return the list\n\t\t\tif($totalRows_getQuery != 0){\n\t\t\t\t$results = \"\";\n\t\t\t\tdo{\n\t\t\t\t\t$results .= $row_getQuery['question_id'].\",\";\n\t\t\t\t}while($row_getQuery = mysql_fetch_assoc($getQuery));\n\t\t\t\treturn substr($results, 0, -1);\n\t\t\t}else{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t}", "protected function get_current_mediatype(): string {\n $mediatype = $this->optional_param('mediatype', '', PARAM_ALPHA);\n if ($mediatype) {\n // Form has been submitted, but it being re-displayed.\n return $mediatype;\n }\n if (isset($this->question->id)) {\n // Form is being loaded to edit an existing question.\n return $this->question->options->mediatype;\n }\n // Creating new question.\n // The next line needs to match the default below.\n return $this->get_default_value('mediatype', qtype_recordrtc::MEDIA_TYPE_AUDIO);\n }", "public function getType() : string\n {\n $rtn = $this->data['type'];\n\n return $rtn;\n }", "function getType()\t { return $this->type;\t }" ]
[ "0.6921463", "0.6757646", "0.67077535", "0.66610116", "0.6352605", "0.62965155", "0.6291463", "0.6215404", "0.61729527", "0.6148668", "0.613878", "0.60491884", "0.59351885", "0.5897173", "0.58738583", "0.5848187", "0.5839798", "0.58369523", "0.58150405", "0.5796098", "0.57774395", "0.5764432", "0.57255036", "0.57255036", "0.5711412", "0.5695674", "0.56757617", "0.5673134", "0.5671971", "0.5668245", "0.5654567", "0.56472856", "0.56428725", "0.56106275", "0.5608611", "0.55979747", "0.55692524", "0.55541164", "0.55011666", "0.54815286", "0.54701704", "0.5453231", "0.5448286", "0.54416376", "0.54413134", "0.5438225", "0.54367393", "0.5433786", "0.54319686", "0.5431263", "0.540953", "0.5407532", "0.5393921", "0.5385732", "0.537488", "0.53522414", "0.5344747", "0.5344232", "0.532492", "0.53150004", "0.5302877", "0.5302389", "0.52978987", "0.52876604", "0.52800184", "0.52717626", "0.5252651", "0.52514356", "0.52477086", "0.52406716", "0.5239879", "0.52392066", "0.5236049", "0.52351075", "0.5232336", "0.5231278", "0.52306706", "0.5208224", "0.5185484", "0.5184735", "0.5180954", "0.5179375", "0.5174538", "0.5174538", "0.5174538", "0.5174538", "0.5174049", "0.5174049", "0.51720864", "0.5169354", "0.5164532", "0.51584816", "0.51584023", "0.51572186", "0.51505196", "0.51473045", "0.51365095", "0.51356703", "0.51180536", "0.51116914", "0.5110852" ]
0.0
-1
Applies the result of a given script to the given step. Used to handle the result of the initialization script, as well as by extension question types such as Multianswer.
public function apply_code_result(question_attempt_step $step, array $vars, array $funcs) { //store the list of variables after the execution, for storage in the database $step->set_qt_var('_vars', json_encode($vars)); $step->set_qt_var('_funcs', json_encode($funcs)); //store a local copy of the script state $this->vars = $vars; $this->funcs = $funcs; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function executeSpecificStep() {}", "public function execute(StepExecution $stepExecution);", "public function evaluate(Script $script): void\n {\n $builder = Functions::callAwait(\"$this->pageVarName.evaluate\",$script->getJs());\n\n $this->merge($builder);\n }", "protected function ProcessStepSuccessHook()\n {\n }", "protected function outputSpecificStep() {}", "protected function injectScript($step)\n {\n if (in_array(Input::get('import'), array('prepare', 'import'), null)) {\n return;\n }\n\n if (!array_key_exists($step, $this->settings)) {\n $GLOBALS['TL_MOOTOOLS'][] =\n \"<script>location.href = 'contao/main.php\" .\n \"?do=member_import&import=prepare&rt=\" . REQUEST_TOKEN . \"&ref=\" . TL_REFERER_ID .\n \"'</script>\";\n\n return;\n }\n\n $GLOBALS['TL_MOOTOOLS'][] =\n \"<script>location.href = 'contao/main.php\" .\n \"?do=member_import&import=load&step=\" . $step . \"&rt=\" . REQUEST_TOKEN . \"&ref=\" . TL_REFERER_ID .\n \"'</script>\";\n }", "public function execute()\n {\n $resultJson = $this->jsonFactory->create();\n $answer = null;\n $success = true;\n $question = $this->getQuestion();\n if ($question) {\n try {\n $answer = $this->helperData->getAnswer($question);\n } catch (\\Exception $e) {\n $answer = $e->getMessage();\n $success = false;\n }\n if (!empty($answer)) {\n $answer = trim($answer);\n }\n } else {\n $success = false;\n $answer = __('Please add some context so the AI can come up with the right content.');\n }\n\n return $resultJson->setData([\n 'answer' => $answer,\n 'success' => $success\n ]);\n }", "function learn_press_single_quiz_result() {\n\t\tlearn_press_get_template( 'content-quiz/result.php' );\n\t}", "function updateAutomatedResultForATestCase($testCaseID, $subjectID, $roundID, $clientID) {\n global $definitions;\n\n //DEFINITIONS FOR ITEM TYPES\n $resultsRelationsID = getClientItemTypeID_RelatedWith_byName($definitions['automatizationResultsRelations'], $clientID);\n\n //DEFINITIONS FOR PROPERTIES\n $parentTestCategoryPropertyID = getClientPropertyID_RelatedWith_byName($definitions['testcasesFolderID'], $clientID);\n $parentStudyForSubjectPropertyID = getClientPropertyID_RelatedWith_byName($definitions['subjectStudyID'], $clientID);\n $autResRelRoundPropertyID = getClientPropertyID_RelatedWith_byName($definitions['automatizationResultsRelationsRoundID'], $clientID);\n $autResRelSubjectPropertyID = getClientPropertyID_RelatedWith_byName($definitions['automatizationResultsRelationsSubjectID'], $clientID);\n $autResRelParentCatPropertyID = getClientPropertyID_RelatedWith_byName($definitions['automatizationResultsRelationsTestCategoryParentID'], $clientID);\n $autResRelCatPropertyID = getClientPropertyID_RelatedWith_byName($definitions['automatizationResultsRelationsTestCategoryID'], $clientID);\n $autResRelTestCasesCountPropertyID = getClientPropertyID_RelatedWith_byName($definitions['automatizationResultsRelationsTestCasesCount'], $clientID);\n $autResRelTestCasesOKPropertyID = getClientPropertyID_RelatedWith_byName($definitions['automatizationResultsRelationsTestCasesOKCount'], $clientID);\n $autResRelTestCasesNOKPropertyID = getClientPropertyID_RelatedWith_byName($definitions['automatizationResultsRelationsTestCasesNOKCount'], $clientID);\n $categoryParentPropertyID = getClientPropertyID_RelatedWith_byName($definitions['testcasescategoryParentID'], $clientID);\n\n //Next, get the parentID value\n $parentFolderID = getItemPropertyValue($testCaseID, $parentTestCategoryPropertyID, $clientID);\n\n //Get the studyID value for this subject\n $studyID = getItemPropertyValue($subjectID, $parentStudyForSubjectPropertyID, $clientID);\n\n //We need also, the related items\n $relations = getRelations($roundID, $subjectID, $clientID);\n\n //When we've the relations, we need count the steps for every test\n if (count($relations) - 1 == 0) {\n $theTestCases = explode(\",\", $relations[0]['testCasesIDs']);\n\n $totalTc = 0;\n $totalOK = 0;\n $totalNOK = 0;\n\n //Get directly testcases that are related\n $relatedTestCases = getFilteredTestCasesInsideCategory($parentFolderID, $theTestCases, $clientID);\n\n foreach ($relatedTestCases as $tc) {\n $detailedTc = getTestCaseData($tc['ID'], $subjectID, $roundID, $studyID, $clientID);\n\n //print(\"DetailedTC for tc \".$tc['ID'].\" in testCategory $testCategory \\n\\r\");\n //print_r($detailedTc);\n\n if ($detailedTc != null) {\n //print (\"process automated testcase \".$tc['ID'].\":\\n\\r\" );\n //print(\"TestCase Data for testCase \".$tc['ID'].\":\\n\\r\");\n //print_r($detailedTc);\n\n $totalTc++;\n $counter = 0;\n $counterOK = 0;\n $counterNOK = 0;\n\n //Search their steps results for Selenium results\n while (isset($detailedTc['STEP_ID_' . $counter])) {\n\n if (isset($detailedTc['STEP_STEPUNITS_SELENIUMRESULTEXECVALUE_' . $counter])) {\n if (base64_decode($detailedTc['STEP_STEPUNITS_SELENIUMRESULTEXECVALUE_' . $counter]) == 'OK') {\n $counterOK++;\n\n } elseif (base64_decode($detailedTc['STEP_STEPUNITS_SELENIUMRESULTEXECVALUE_' . $counter]) == 'NOK') {\n $counterNOK++;\n\n }\n }\n $counter++;\n }//End while\n\n //Check if the final state for the tc is ok, nok or not executed\n if ($counterNOK > 0) {\n //Any step nok. Final result NOK\n $totalNOK++;\n } else {\n if ($counterOK > 0) {\n //NOK = 0, any tc OK. Final result OK\n $totalOK++;\n } else {\n //all values 0.Do nothing\n }\n }\n } //End if detailed TC\n\n }//End foreach related test cases\n\n //Finally, check if relation results exists for this relation, round and testCategory\n if ($totalTc > 0) {\n // build return properties array\n $returnProperties = array();\n\n //build the filter\n $filters = array();\n $filters[] = array('ID' => $autResRelRoundPropertyID, 'value' => $roundID);\n $filters[] = array('ID' => $autResRelSubjectPropertyID, 'value' => $subjectID);\n $filters[] = array('ID' => $autResRelCatPropertyID, 'value' => $parentFolderID);\n\n // get relations\n $resultRelation = getFilteredItemsIDs($resultsRelationsID, $clientID, $filters, $returnProperties);\n\n if (count($resultRelation) - 1 == 0) {\n //exists\n //Update the values\n //print (\"updating total tc for itemRelation: TestCategory: $testCategory, RoundID: $roundID, SubjectID: $subject, totalTC value:$totalTc \\n\\r\");\n //flush();\n setPropertyValueByID($autResRelTestCasesCountPropertyID, $resultsRelationsID, $resultRelation[0]['ID'], $clientID, $totalTc);\n\n //print (\"updating tc OK for itemRelation: TestCategory: $testCategory, RoundID: $roundID, SubjectID: $subject, testCases OK value:$totalOK \\n\\r\");\n //flush();\n setPropertyValueByID($autResRelTestCasesOKPropertyID, $resultsRelationsID, $resultRelation[0]['ID'], $clientID, $totalOK);\n\n //print (\"updating tc NOK for itemRelation: TestCategory: $testCategory, RoundID: $roundID, SubjectID: $subject, testCases NOK value:$totalNOK \\n\\r\");\n //flush();\n setPropertyValueByID($autResRelTestCasesNOKPropertyID, $resultsRelationsID, $resultRelation[0]['ID'], $clientID, $totalNOK);\n\n } else {\n if (count($resultRelation) - 1 > 0) {\n //error. More than 1 relation\n print(\"Error. Found more than one automated results relation:\\n\");\n print_r($resultRelation);\n flush();\n exit ;\n } else {\n //does not exists\n //Create a new relation\n //First, get the parent TCategory\n\n $parentCategoryID = getItemPropertyValue($parentFolderID, $categoryParentPropertyID, $clientID);\n //print(\"Parent category id for testCategory $testCategory = $parentCategoryID \\n\\r\");\n //flush();\n $propertiesValues = array( array('ID' => $autResRelRoundPropertyID, 'value' => $roundID), array('ID' => $autResRelSubjectPropertyID, 'value' => $subjectID), array('ID' => $autResRelCatPropertyID, 'value' => $parentFolderID), array('ID' => $autResRelParentCatPropertyID, 'value' => $parentCategoryID), array('ID' => $autResRelTestCasesCountPropertyID, 'value' => $totalTc), array('ID' => $autResRelTestCasesOKPropertyID, 'value' => $totalOK), array('ID' => $autResRelTestCasesNOKPropertyID, 'value' => $totalNOK));\n\n }//end if count resultRelation>0\n\n }//end if count resultRelation==0\n }//End if totalTC>0\n\n }//End if count relations\n\n}", "private function log_task_shell_result($step, $result)\n\t{\n\t\tif(is_array($result))\n\t\t{\n\t\t\t$this->task->steps[$step]['shell_result'] = implode('|', $result);\n\t\t}\n\t\telse\n\t\t\t{\n\t\t\t\t$this->task->steps[$step]['shell_result'] = trim($result);\n\t\t\t}\n\t}", "abstract protected function setresults();", "public function onFinished(Step $step): void\n {\n }", "function getStepsScriptsForTestCase($theTC_ID, $theSubjectID, $roundID, $studyID, $clientID) {\n global $definitions;\n\n $stepsItemTypeID = getClientItemTypeID_RelatedWith_byName($definitions['steps'], $clientID);\n $stepParentTestCasePropertyID = getClientPropertyID_RelatedWith_byName($definitions['stepsTestCaseParentID'], $clientID);\n $stepDescriptionPropertyID = getClientPropertyID_RelatedWith_byName($definitions['stepsDescription'], $clientID);\n $stepOrderPropertyID = getClientPropertyID_RelatedWith_byName($definitions['stepsOrder'], $clientID);\n $stepCheckedStepUnitsPropertyID = getClientPropertyID_RelatedWith_byName($definitions['stepsCheckedStepUnits'], $clientID);\n $stepRoundSubjectTestCasePropertyID = getClientPropertyID_RelatedWith_byName($definitions['stepsRoundSubjectRelationID'], $clientID);\n $stepMainPropertyID = getMainPropertyID($stepsItemTypeID, $clientID);\n $stepStepTypePropertyID = getClientPropertyID_RelatedWith_byName($definitions['stepsType'], $clientID);\n $stepStepScriptPropertyID = getClientPropertyID_RelatedWith_byName($definitions['stepsScript'], $clientID);\n\n $typesListID = getAppListID('stepsTypes');\n\n $relations = getRelations($roundID, $theSubjectID, $clientID);\n\n $finalResult = array();\n //Next, check that has one $relation\n if ((count($relations) - 1) == 0) {\n\n // build return properties array\n $returnProperties = array();\n $returnProperties[] = array('ID' => $stepMainPropertyID, 'name' => 'stepsMainValue');\n $returnProperties[] = array('ID' => $stepDescriptionPropertyID, 'name' => 'description');\n $returnProperties[] = array('ID' => $stepOrderPropertyID, 'name' => 'order');\n $returnProperties[] = array('ID' => $stepStepTypePropertyID, 'name' => 'stepType');\n $returnProperties[] = array('ID' => $stepStepScriptPropertyID, 'name' => 'stepScript');\n $returnProperties[] = array('ID' => $stepCheckedStepUnitsPropertyID, 'name' => 'checkedValues');\n\n //build the filter\n $filters = array();\n $filters[] = array('ID' => $stepParentTestCasePropertyID, 'value' => $theTC_ID);\n $filters[] = array('ID' => $stepRoundSubjectTestCasePropertyID, 'value' => $relations[0]['ID']);\n\n // get steps\n $orderedSteps = getFilteredItemsIDs($stepsItemTypeID, $clientID, $filters, $returnProperties, 'order');\n\n //Get the id of the list client related\n $clientListID = getClientListID_RelatedWith($typesListID, $clientID);\n\n //Get all the values for this list and client\n $ClientValues = getListValues($clientListID, $clientID);\n\n //Add the \"isStep\" parameter\n for ($i = 0; $i < count($orderedSteps); $i++) {\n\n //First, encode the name and the description\n $orderedSteps[$i]['stepsMainValue'] = base64_encode($orderedSteps[$i]['stepsMainValue']);\n $orderedSteps[$i]['description'] = base64_encode($orderedSteps[$i]['description']);\n\n //for every system list value, get the client list value\n\n for ($j = 0; $j < count($ClientValues); $j++) {\n if (strcmp($ClientValues[$j]['value'], $orderedSteps[$i]['stepType']) == 0) {\n //get the client id value\n $AppValueID = getAppListValueID_RelatedWith($ClientValues[$j]['valueID'], $clientID);\n\n if ($AppValueID > 0) {\n //Get the app value and add to client values\n $orderedSteps[$i]['scriptAppValue'] = getAppValue($AppValueID);\n } else {\n //Not related. Add an empty value\n $orderedSteps[$i]['scriptAppValue'] = 'undefined';\n }\n break;\n }\n }\n\n //Also, get their units and results\n // get params\n // get checked values\n $markedStepsUnitsIDs = explode(',', $orderedSteps[$i]['checkedValues']);\n\n $params = getParamsAndResultsForAStep($orderedSteps[$i], $studyID, $theSubjectID, $markedStepsUnitsIDs, $clientID);\n\n //Add every parameter to the results\n foreach ($params as $p) {\n\n //Check if the systemConversion value is a Selenium type\n\n if (base64_decode($p['systemConversionValue']) == 'stepUnit.type.seleniumResult') {\n $orderedSteps[$i]['stepUnit_SELENIUMRESULT_ID'] = $p['ID'];\n //Add the result id\n $orderedSteps[$i]['stepUnit_SELENIUM_LASTRESULT_ID'] = $p['resultID'];\n //Add the execution value\n $orderedSteps[$i]['stepUnit_SELENIUMRESULT_EXECVALUE'] = $p['executionValue'];\n }\n if (base64_decode($p['systemConversionValue']) == 'stepUnit.type.seleniumResultDescription') {\n $orderedSteps[$i]['stepUnit_SELENIUMRESULT_DESCRIPTION_ID'] = $p['ID'];\n //Add the result id\n $orderedSteps[$i]['stepUnit_SELENIUMDESCRIPTION_LASTRESULT_ID'] = $p['resultID'];\n\n }\n }\n $finalResult[] = $orderedSteps[$i];\n }\n\n }\n\n return $finalResult;\n}", "public function onAjaxSampledataApplyStep3()\n\t{\n\t\tif (!Session::checkToken('get') || $this->app->input->get('type') != $this->_name)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\tif (!ComponentHelper::isEnabled('com_languages'))\n\t\t{\n\t\t\t$response = array();\n\t\t\t$response['success'] = true;\n\t\t\t$response['message'] = Text::sprintf('PLG_SAMPLEDATA_MULTILANG_STEP_SKIPPED', 3, 'com_languages');\n\n\t\t\treturn $response;\n\t\t}\n\n\t\tif (!$this->publishContentLanguages())\n\t\t{\n\t\t\t$response = array();\n\t\t\t$response['success'] = false;\n\t\t\t$response['message'] = Text::sprintf('PLG_SAMPLEDATA_MULTILANG_ERROR_CONTENTLANGUAGES', 3);\n\n\t\t\treturn $response;\n\t\t}\n\n\t\t$response = new stdClass;\n\t\t$response->success = true;\n\t\t$response->message = Text::_('PLG_SAMPLEDATA_MULTILANG_STEP3_SUCCESS');\n\n\t\treturn $response;\n\t}", "private function evaluateThisResult($result, $data){\n\t\t\t//Test to make sure this result has everything we need.\n\n\t\t\tif(array_key_exists('action', $result)){\n\t\t\t\treturn (bool) $this->processResult($result, $data);\n\t\t\t} else {\n\t\t\t\treturn (bool) false;\n\t\t\t}\n\t\t}", "public function ExecuteStep()\n {\n if ($this->ProcessStep()) {\n $this->ProcessStepSuccessHook();\n $oBasket = TShopBasket::GetInstance();\n $oBasket->aCompletedOrderStepList[$this->fieldSystemname] = true;\n $oNextStep = $this->GetNextStep();\n $this->JumpToStep($oNextStep);\n }\n }", "public function postProcess($results);", "protected\n function do_execution( $execution )\n {\n $this->current_enzyme = $execution;\n preg_match($this->grammar_rule('execution'), $execution, $matches);\n $post_item = $this->value($matches, 'post_item');\n $author_item = $this->value($matches, 'author_item');\n $num_args = (int) $this->value($matches, 'num_args');\n switch (true) {\n case (strpos($execution, 'array(') === 0 && $num_args > 0):\n $result = $this->catalyzed->pop($num_args);\n break;\n case (strpos($execution, 'hash(') === 0 && $num_args > 0):\n $result = array();\n $arguments = $this->catalyzed->pop(2 * $num_args);\n for ($i = 0, $i_top = 2 * $num_args; $i < $i_top; $i += 2) {\n $key = $arguments[$i];\n $value = $arguments[$i + 1];\n $result[$key] = $value;\n }\n break;\n case ($post_item != ''):\n $result = $this->execute_post_item($post_item, $num_args);\n break;\n case ($author_item != ''):\n $result = $this->execute_author_item($author_item, $num_args);\n break;\n default:\n $result = null;\n break;\n }\n return $result;\n }", "public function addStep(ScriptStep $step): Script\n {\n $this->steps[] = $step;\n return $this;\n }", "protected function afterAction(\n string $method,\n array $arguments,\n bool $ran,\n mixed $result\n ) : mixed {\n return $result;\n }", "abstract protected function define_my_steps();", "private function setResult() {\n $result = 0;\n foreach ($this->process AS $key => $value) {\n $total = $value['pivot'] * $value['adj']['result'];\n if($key == 0) {\n $result = $result + $total;\n }\n elseif($key == 1) {\n $result = $result - $total;\n }\n else {\n if($key % 2 == 0) {\n $result = $result + $total;\n }\n else {\n $result = $result - $total;\n }\n }\n }\n unset($key, $value, $total);\n return $result;\n }", "public function redirect_script() {\n\t\t$languages = $this->available_languages;\n\t\t$current_step = intval( $this->step );\n\t\t$next_step = $current_step + 1;\n\t\t// Add 500ms delay for refreshes.\n\t\t$delay = 500;\n\t\tif ( ( $current_step + 1 ) <= count( $this->steps ) && $this->proceed ) {\n\t\t\t// Redirect to next step.\n\t\t\t$lang = ( isset( $_GET['lang'] ) ) ? sanitize_text_field( wp_unslash( $_GET['lang'] ) ) : '';\n\t\t\treturn '<script type=\"text/javascript\">setTimeout(function () {window.location.href = \"' . admin_url( 'index.php?avada_update=1&ver=400&lang=' . $lang . '&step=' . $next_step ) . '\";}, ' . $delay . ');</script>';\n\t\t} else {\n\t\t\t// Check if this is a multilingual site.\n\t\t\tif ( ! empty( $languages ) ) {\n\t\t\t\t// Get the next language code.\n\t\t\t\t$next_lang = $this->get_next_language();\n\t\t\t\tif ( 'finished' === $next_lang ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\treturn '<script type=\"text/javascript\">setTimeout(function () {window.location.href = \"' . admin_url( 'index.php?avada_update=1&ver=400&new=1&lang=' . $next_lang ) . '\";}, ' . $delay . ');</script>';\n\t\t\t}\n\t\t}\n\t}", "public function run(Experiment $experiment)\n {\n return new Result(\n $experiment->getName(),\n $control = $this->runControl($experiment),\n $this->runTrials($experiment, $control)\n );\n }", "public function run()\n {\n //Data Type\n $dataType = $this->dataType('name', 'survey_answer');\n if (!$dataType->exists) {\n $dataType->fill([\n 'name' => 'survey_answer',\n 'slug' => 'survey-answer',\n 'display_name_singular' => 'Survey Answer',\n 'display_name_plural' => 'Survey Answers',\n 'icon' => 'voyager-check',\n 'model_name' => 'Andalusia\\\\Survey\\\\Models\\\\SurveyAnswer',\n 'controller' => '',\n 'generate_permissions' => 1,\n 'description' => '',\n ])->save();\n }\n //Data Rows\n $questionDataType = DataType::where('slug', 'survey-answer')->firstOrFail();\n $dataRowOrder = 0;\n\n $dataRow = $this->dataRow($questionDataType, 'id');\n if (!$dataRow->exists) {\n $dataRow->fill([\n 'type' => 'number',\n 'display_name' => __('voyager::seeders.data_rows.id'),\n 'required' => 1,\n 'browse' => 0,\n 'read' => 0,\n 'edit' => 0,\n 'add' => 0,\n 'delete' => 0,\n 'order' => $dataRowOrder++,\n ])->save();\n }\n\n $dataRow = $this->dataRow($questionDataType, 'question_id');\n if (!$dataRow->exists) {\n $dataRow->fill([\n 'type' => 'text',\n 'display_name' => ucwords(str_replace(\"_\", \" \", \"question_id\")),\n 'required' => 1,\n 'browse' => 1,\n 'read' => 1,\n 'edit' => 1,\n 'add' => 1,\n 'delete' => 1,\n 'order' => $dataRowOrder++,\n 'details' => [\n 'validation' => [\n 'rule' => 'required'\n ]\n ],\n ])->save();\n }\n\n $dataRow = $this->dataRow($questionDataType, 'survey_answer_belongsto_survey_question_relationship');\n if (!$dataRow->exists) {\n $dataRow->fill([\n 'type' => 'relationship',\n 'display_name' => 'Question',\n 'required' => 1,\n 'browse' => 1,\n 'read' => 1,\n 'edit' => 1,\n 'add' => 1,\n 'delete' => 1,\n 'details' => [\n 'model' => 'Andalusia\\\\Survey\\\\Models\\\\SurveyQuestion',\n 'table' => 'survey_question',\n 'type' => 'belongsTo',\n 'column' => 'question_id',\n 'key' => 'id',\n 'label' => 'question',\n 'pivot_table' => 'admins',\n 'pivot' => '0',\n 'taggable' => '0'\n ],\n 'order' => $dataRowOrder++,\n ])->save();\n }\n\n $dataRow = $this->dataRow($questionDataType, 'order');\n if (!$dataRow->exists) {\n $dataRow->fill([\n 'type' => 'number',\n 'display_name' => ucwords(str_replace(\"_\", \" \", \"order\")),\n 'required' => 0,\n 'browse' => 1,\n 'read' => 1,\n 'edit' => 1,\n 'add' => 1,\n 'delete' => 1,\n 'order' => $dataRowOrder++,\n ])->save();\n }\n\n $dataRow = $this->dataRow($questionDataType, 'answer');\n if (!$dataRow->exists) {\n $dataRow->fill([\n 'type' => 'text',\n 'display_name' => ucwords(str_replace(\"_\", \" \", \"answer\")),\n 'required' => 1,\n 'browse' => 1,\n 'read' => 1,\n 'edit' => 1,\n 'add' => 1,\n 'delete' => 1,\n 'order' => $dataRowOrder++,\n ])->save();\n }\n\n $dataRow = $this->dataRow($questionDataType, 'points');\n if (!$dataRow->exists) {\n $dataRow->fill([\n 'type' => 'number',\n 'display_name' => ucwords(str_replace(\"_\", \" \", \"points\")),\n 'required' => 0,\n 'browse' => 1,\n 'read' => 1,\n 'edit' => 1,\n 'add' => 1,\n 'delete' => 1,\n 'order' => $dataRowOrder++,\n ])->save();\n }\n\n $dataRow = $this->dataRow($questionDataType, 'created_at');\n if (!$dataRow->exists) {\n $dataRow->fill([\n 'type' => 'timestamp',\n 'display_name' => __('voyager::seeders.data_rows.created_at'),\n 'required' => 0,\n 'browse' => 0,\n 'read' => 1,\n 'edit' => 0,\n 'add' => 0,\n 'delete' => 0,\n 'order' => $dataRowOrder++,\n ])->save();\n }\n\n $dataRow = $this->dataRow($questionDataType, 'updated_at');\n if (!$dataRow->exists) {\n $dataRow->fill([\n 'type' => 'timestamp',\n 'display_name' => __('voyager::seeders.data_rows.updated_at'),\n 'required' => 0,\n 'browse' => 0,\n 'read' => 0,\n 'edit' => 0,\n 'add' => 0,\n 'delete' => 0,\n 'order' => $dataRowOrder++,\n ])->save();\n }\n\n //Menu Item\n $menu = Menu::where('name', 'admin')->firstOrFail();\n $parent = MenuItem::where('title', 'Survey Module')->firstOrFail();\n $menuItem = MenuItem::firstOrNew([\n 'menu_id' => $menu->id,\n 'title' => 'Answers',\n 'url' => '',\n 'route' => 'voyager.survey-answer.index',\n ]);\n if (!$menuItem->exists) {\n $menuItem->fill([\n 'target' => '_self',\n 'icon_class' => 'voyager-check',\n 'color' => null,\n 'parent_id' => $parent->id,\n 'order' => 3,\n ])->save();\n }\n\n //Permissions\n Permission::generateFor('survey_answer');\n\n //Content\n SurveyAnswer::create([\n 'question_id' => 1,\n 'order' => 1,\n 'answer' => 'blue',\n 'points' => 20\n ]);\n }", "protected function processPart($step) {\n $curWorkPackageDef = $this->workPackages[$step-1];\n $request = $this->getRequest();\n $response = $this->getResponse();\n if (strlen($curWorkPackageDef['callback']) == 0) {\n throw new ApplicationException($request, $response, ApplicationError::getGeneral(\"Empty callback name.\"));\n }\n if (!method_exists($this, $curWorkPackageDef['callback'])) {\n throw new ApplicationException($request, $response,\n ApplicationError::getGeneral(\"Method '\".$curWorkPackageDef['callback'].\"' must be implemented by \".get_class($this)));\n }\n\n // unserialize oids\n $oids = array_map(function($oidStr) {\n $oid = ObjectId::parse($oidStr);\n return $oid != null ? $oid : $oidStr;\n }, $curWorkPackageDef['oids']);\n call_user_func([$this, $curWorkPackageDef['callback']], $oids, $curWorkPackageDef['args']);\n }", "function zg_ai_do_goal($bot, $goal, $last_result) {\n\n global $last_value;\n\n if (!is_array($goal)) {\n $goal = [$goal];\n }\n\n $result = [\n 'original goal' => $goal,\n ];\n\n if (!is_array($last_result)) {\n $last_result = [$last_result];\n }\n\n zg_ai_out($last_result, 'last result');\n if (array_key_exists('return value', $last_result)) {\n $last_value = zg_ai_get_data($last_result);\n }\n else {\n $last_value = [];\n }\n zg_ai_out($last_value, 'last value');\n\n $goal_function = 'zg_ai_' . str_replace(' ', '_', reset($goal));\n $args = array_slice($goal, 1);\n array_unshift($args, $bot);\n// zg_ai_out($args, 'args');\n\n if (!function_exists($goal_function)) {\n zg_ai_out($goal, \"*FIXME: MISSING* $goal_function\");\n $result['error'] = \"Missing function $goal_function()\";\n $result['success'] = FALSE;\n return $result;\n }\n\n zg_ai_out('calling ' . $goal_function . '($bot, ' . implode(', ', array_slice($args, 1)) . ')');\n $return = call_user_func_array($goal_function, $args);\n// zg_ai_out('returned: ' . zg_print_r($return));\n\n $result['return value'] = $return;\n $result['success'] = TRUE;\n// zg_ai_out('result: ' . zg_print_r($result));\n return $result;\n}", "public function execute_hook() {\n\n\t\t$hook = current_filter();\n\t\t$content = simplehooks_get_option( $hook, 'content' );\n\n\t\tif ( ! $hook || ! $content ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$shortcodes = simplehooks_get_option( $hook, 'shortcodes' );\n\t\t$php = simplehooks_get_option( $hook, 'php' );\n\n\t\t$value = $shortcodes ? do_shortcode( $content ) : $content;\n\n\t\tif ( $php ) {\n\t\t\t//phpcs:ignore\n\t\t\teval( \"?>$value \" );\n\t\t} else {\n\t\t\t//phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped\n\t\t\techo ( $value );\n\t\t}\n\n\t}", "public function runStep($step)\n\t{\n\t\tif (REQ == 'CLI')\n\t\t{\n\t\t\tstdout($this->getLanguageForStep($step).'...', CLI_STDOUT_BOLD);\n\t\t}\n\n\t\ttry\n\t\t{\n\t\t\t$this->runStepParent($step);\n\t\t}\n\t\tcatch (\\Exception $e)\n\t\t{\n\t\t\t$this->logger->log($e->getMessage());\n\t\t\t$this->logger->log($e->getTraceAsString());\n\n\t\t\t// Send it up the chain\n\t\t\tthrow $e;\n\t\t}\n\n\t\t// We may have shifted files around\n\t\tif (function_exists('opcache_reset'))\n\t\t{\n\t\t\t// Check for restrict_api path restriction\n\t\t\tif (($opcache_api_path = ini_get('opcache.restrict_api')) && stripos(SYSPATH, $opcache_api_path) !== 0)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\topcache_reset();\n\t\t}\n\t}", "final public function record_attempt($context) {\n global $DB, $USER, $OUTPUT;\n /**\n * This should be overridden by each page type to actually check the response\n * against what ever custom criteria they have defined\n */\n $result = $this->check_answer();\n $result->attemptsremaining = 0;\n $result->maxattemptsreached = false;\n $lesson = $this->lesson;\n $modid = $DB->get_field('modules', 'id', array('name'=>'languagelesson'));\n $cmid = $DB->get_field('course_modules', 'id', array('module'=>$modid, 'instance'=>$this->lesson->id));\n\n if ($result->noanswer) {\n $result->newpageid = $this->properties->id; // Display same page again.\n $result->feedback = get_string('noanswer', 'languagelesson');\n } else {\n switch ($result->typeid) {\n \n case LL_ESSAY :\n $isessayquestion = true;\n \n $attempt = new stdClass;\n $attempt->lessonid = $this->lesson->id;\n $attempt->pageid = $this->properties->id;\n $attempt->userid = $USER->id;\n $attempt->type = $result->typeid;\n $attempt->answerid = $result->answerid;\n \n $useranswer = $result->userresponse;\n $useranswer = clean_param($useranswer, PARAM_RAW);\n $attempt->useranswer = $useranswer; \n // If the student had previously submitted an attempt on this question, and it has since been graded,\n\t\t // Mark this new submission as a resubmit.\n if ($prevAttempt = languagelesson_get_most_recent_attempt_on($attempt->pageid, $USER->id)) {\n $attempt->retry = $prevAttempt->retry;\n if (! $oldManAttempt = $DB->get_record('languagelesson_attempts', array('id'=>$prevAttempt->id))) {\n error('Failed to fetch matching manual_attempt record for old attempt on this question!');\n }\n if ($oldManAttempt->graded && !$lesson->autograde) {\n $attempt->resubmit = 1;\n $attempt->viewed = 0;\n $attempt->graded = 0;\n }\n } else {\n $attempt->retry = 0;\n }\n /*if (!$answer = $DB->get_record(\"languagelesson_answers\", array(\"pageid\"=>$page->id))) {\n print_error(\"Continue: No answer found\");\n }*/\n $correctanswer = false;\n\t\t //$newpageid = $this->nextpageid;\n\n // AUTOMATIC GRADING.\n // If this lesson is to be auto-graded...\n if ($lesson->autograde === 1) {\n $correctanswer = true;\n // Flag it as graded\n $attempt->graded = 1;\n $attempt->viewed = 1;\n // Set the grade to the maximum point value for this question.\n $maxscore = $DB->get_field('languagelesson_pages', 'maxscore', array('id'=>$attempt->pageid));\n $score = $maxscore;\n } else {\n \t\t // If it's not, mark these submissions as ungraded.\n $score = 0;\n }\n \n $attempt->iscurrent = 1;\n $attempt->score = $score;\n $attempt->timeseen = time();\n \n // Check for maxattempts, 0 means unlimited attempts are allowed.\n $nattempts = $attempt->retry;\n if ($this->lesson->maxattempts != 0) { // Don't bother with message if unlimited.\n if ($nattempts >= $this->lesson->maxattempts || $this->lesson->maxattempts == 1){\n $result->maxattemptsreached = true;\n $result->newpageid = LL_NEXTPAGE;\n $result->attemptsremaining = 0;\n } else {\n $result->attemptsremaining = $this->lesson->maxattempts - $nattempts;\n }\n }\n \n // Insert/update some records.\n if (!has_capability('mod/languagelesson:manage', $context)) {\n // Pull the retry value for this attempt, and handle deflagging former current attempt \n\t\t\t\n if ($oldAttempt = languagelesson_get_most_recent_attempt_on($attempt->pageid, $USER->id)) {\n $nretakes = $oldAttempt->retry + 1;\n\n // Update the old attempt to no longer be marked as the current one.\n $attempt->id = $oldAttempt->id;\n \n // Set the retake value.\n $attempt->retry = $nretakes;\n \n // Flag this as the current attempt.\n $attempt->correct = $correctanswer;\n \n if (! $DB->update_record('languagelesson_attempts', $attempt)) {\n error('Failed to update previous attempt!');\n }\n \n } else {\n $nretakes = 1;\n \n // Set the retake value.\n $attempt->retry = $nretakes;\n \n // Flag this as the current attempt.\n $attempt->correct = $correctanswer;\n \n // Every try is recorded as a new one (by increasing retry value), so just insert this one.\n if (!$newattemptid = $DB->insert_record(\"languagelesson_attempts\", $attempt)) {\n error(\"Continue: attempt not inserted\");\n }\n }\n } \n break;\n \n default :\n \n // Record student's attempt.\n $attempt = new stdClass;\n $attempt->lessonid = $this->lesson->id;\n $attempt->pageid = $this->properties->id;\n $attempt->userid = $USER->id;\n \n if ($result->answerid != null) {\n $attempt->answerid = $result->answerid;\n } else {\n $attempt->answerid = 0;\n }\n \n $attempt->type = $result->typeid;\n $attempt->correct = $result->correctanswer;\n $attempt->iscurrent = 1;\n \n if ($result->score == null) {\n $attempt->score = 0;\n } else if ($result->correctanswer) {\n $maxscore = $DB->get_field('languagelesson_pages', 'maxscore', array('id'=>$attempt->pageid));\n $attempt->score = $maxscore;\n } else {\n $attempt->score = $result->score;\n }\n \n if ($result->userresponse !== null) {\n $attempt->useranswer = $result->userresponse;\n }\n \n $attempt->timeseen = time();\n \n if ($previousattempt = $DB->get_record('languagelesson_attempts',\n array('lessonid'=> $attempt->lessonid, 'pageid'=>$attempt->pageid,\n 'userid'=>$attempt->userid, 'iscurrent'=>1))) {\n $attempt->id = $previousattempt->id;\n $attempt->retry = $previousattempt->retry + 1;\n if ($oldFile = $DB->get_record('files', array('id'=>$previousattempt->fileid))) {\n // Delete the previous audio file.\n languagelesson_delete_submitted_file($oldFile);\n }\n if ($previousattempt->graded = 1) {\n // Set it as resubmit.\n $attempt->resubmit = 1;\n // Remove old feedback files if they exist\n if ($oldfeedback = $DB->get_records('languagelesson_feedback', array('attemptid'=>$attempt->id), null, 'id, fileid')) {\n if ($oldfeedback->fileid != NULL) {\n foreach ($oldfeedback as $oldrecord) {\n $oldfilerecord = $DB->get_record('files', array('id'=>$oldrecord->fileid));\n languagelesson_delete_submitted_file($oldfilerecord);\n $DB->delete_records('languagelesson_feedback', array('fileid'=>$oldrecord->fileid));\n }\n }\n }\n }\n if (($this->lesson->maxattempts == 0) || ($this->lesson->maxattempts >= $attempt->retry)) {\n $DB->update_record(\"languagelesson_attempts\", $attempt, true);\n }\n } else {\n $attempt->retry = 1;\n $DB->insert_record('languagelesson_attempts', $attempt, true);\n }\n $recordedattemptid = $DB->get_field('languagelesson_attempts', 'id',\n array('lessonid'=>$attempt->lessonid, 'userid'=>$attempt->userid,\n 'pageid'=>$attempt->pageid));\n\n } // End switch.\n \n // And update the languagelesson's grade.\n\t\t// NOTE that this happens no matter the question type.\n\n if ($lesson->type != LL_TYPE_PRACTICE) {\n // Get the lesson's graded information.\n\n if ($gradeinfo = $DB->get_record('languagelesson_grades', array('lessonid'=>$lesson->id, 'userid'=>$USER->id))){\n $gradeinfo->grade = languagelesson_calculate_user_lesson_grade($lesson->id, $USER->id);\n } else {\n $gradeinfo = new stdClass;\n $gradeinfo->grade = languagelesson_calculate_user_lesson_grade($lesson->id, $USER->id);\n }\n \n // Save the grade.\n languagelesson_save_grade($lesson->id, $USER->id, $gradeinfo->grade);\n \n // Finally, update the records in the gradebook.\n languagelesson_grade_item_update($lesson);\n \n $gradeitem = $DB->get_record('grade_items', array('iteminstance'=>$lesson->id, 'itemmodule'=>'languagelesson'));\n $DB->set_field('grade_grades', 'finalgrade', $gradeinfo->grade, array('userid'=>$USER->id, 'itemid'=>$gradeitem->id));\n \n languagelesson_update_grades($lesson, $USER->id);\n \n }\n \n // \"number of attempts remaining\" message if $this->lesson->maxattempts > 1\n // Displaying of message(s) is at the end of page for more ergonomic display.\n \n // IT'S NOT HITTING THIS CONTROL GROUP BELOW FOR SOME REASON.\n if ((!$result->correctanswer && ($result->newpageid == 0)) || $result->typeid == LL_AUDIO) {\n // Wrong answer and student is stuck on this page - check how many attempts.\n // The student has had at this page/question.\n $nattempts = $attempt->retry;\n // $nattempts = $DB->count_records(\"languagelesson_attempts\", array(\"pageid\"=>$this->properties->id,\n // \"userid\"=>$USER->id, \"retry\" => $attempt->retry));\n // Retreive the number of attempts left counter for displaying at bottom of feedback page.\n if ($this->lesson->maxattempts != 0) { // Don't bother with message if unlimited.\n if ($nattempts >= $this->lesson->maxattempts || $this->lesson->maxattempts == 1){\n $result->maxattemptsreached = true;\n $result->newpageid = LL_NEXTPAGE;\n $result->attemptsremaining = 0;\n } else {\n $result->attemptsremaining = $this->lesson->maxattempts - $nattempts;\n }\n }\n }\n \n // TODO: merge this code with the jump code below. Convert jumpto page into a proper page id.\n if ($result->newpageid == 0) {\n $result->newpageid = $this->properties->id;\n } else if ($result->newpageid == LL_NEXTPAGE) {\n $result->newpageid = $this->lesson->get_next_page($this->properties->nextpageid);\n }\n\n // Determine default feedback if necessary.\n if (empty($result->response)) {\n if (!$this->lesson->feedback && !$result->noanswer && !($this->lesson->review & !$result->correctanswer && !$result->isessayquestion)) {\n // These conditions have been met:\n // 1. The lesson manager has not supplied feedback to the student\n // 2. Not displaying default feedback\n // 3. The user did provide an answer\n // 4. We are not reviewing with an incorrect answer (and not reviewing an essay question).\n\n $result->nodefaultresponse = true; // This will cause a redirect below.\n } else if ($result->isessayquestion) {\n $result->response = get_string('defaultessayresponse', 'languagelesson');\n } else if ($result->correctanswer) {\n if ($this->lesson->defaultfeedback == true) {\n $result->response = $this->lesson->defaultcorrect;\n } else {\n $result->response = get_string('thatsthecorrectanswer', 'languagelesson');\n }\n } else {\n if ($this->lesson->defaultfeedback == true) {\n $result->response = $this->lesson->defaultwrong;\n } else {\n $result->response = get_string('thatsthewronganswer', 'languagelesson');\n }\n }\n }\n \n if ($result->typeid == LL_AUDIO) {\n if ($result->audiodata) {\n $uploadData = $result->audiodata;\n $mp3data = json_decode($uploadData, true, 5);\n $recordedattempt = $DB->get_record('languagelesson_attempts', array('id'=>$recordedattemptid));\n \n foreach ($mp3data['mp3Data'] as $newfilename => $newfilebits) {\n // Send the file to the pool and return the file id.\n $recordedattempt->fileid = upload_audio_file($USER->id, $cmid, $recordedattemptid, $newfilename, $newfilebits);\n $DB->update_record('languagelesson_attempts', $recordedattempt);\n }\n }\n } else if ($result->response) {\n if ($this->lesson->review && !$result->correctanswer && !$result->isessayquestion) {\n $nretakes = $DB->count_records(\"languagelesson_grades\", array(\"lessonid\"=>$this->lesson->id, \"userid\"=>$USER->id));\n $qattempts = $DB->count_records(\"languagelesson_attempts\",\n array(\"userid\"=>$USER->id, \"retry\"=>$nretakes, \"pageid\"=>$this->properties->id));\n if ($qattempts == 1) {\n $result->feedback = $OUTPUT->box(get_string(\"firstwrong\", \"languagelesson\"), 'feedback');\n } else {\n $result->feedback = $OUTPUT->BOX(get_string(\"secondpluswrong\", \"languagelesson\"), 'feedback');\n }\n }\n else\n {\n \t$class = 'response';\n if ($result->correctanswer) {\n $class .= ' correct'; // CSS over-ride this if they exist (!important).\n } else if (!$result->isessayquestion) {\n $class .= ' incorrect'; // CSS over-ride this if they exist (!important).\n }\n $options = new stdClass;\n $options->noclean = true;\n $options->para = true;\n $options->overflowdiv = true;\n \n if ($result->typeid == LL_CLOZE)\n {\n \t// Lets do our own thing for CLOZE - get question_html.\n \t$my_page = $DB->get_record('languagelesson_pages', array('id'=>$attempt->pageid));\n \t$question_html = $my_page->contents;\n \t\n \t// Get user answers from the attempt.\n \t$attempt_answers = $DB->get_record('languagelesson_attempts', array('id'=>$recordedattemptid));\n \t$user_answers_str = $attempt_answers->useranswer;\n \t\t\n \t// Get the lesson page so we can use functions from cloze.php.\n \t$manager = languagelesson_page_type_manager::get($lesson);\n\t\t\t$page = $manager->load_page($attempt->pageid, $lesson);\n\t \t\t\t\t\n\t \t\t// Get our cloze_correct_incorrect_view html.\n\t \t\t$html = $page->get_cloze_correct_incorrect_view($user_answers_str, $question_html);\n\t \t\t$result->feedback = $html;\n }\n else\n {\n \t$result->feedback = $OUTPUT->box(format_text($this->get_contents(), $this->properties->contentsformat, $options), 'generalbox boxaligncenter');\n \t$result->feedback .= '<div class=\"correctanswer generalbox\"><em>'.get_string(\"youranswer\", \"languagelesson\").'</em> : '.$result->studentanswer; // Already in clean html\n \t$result->feedback .= $OUTPUT->box($result->response, $class); // Already conerted to HTML\n \t$result->feedback .= '</div>';\n }\n }\n }\n }\n \n // Update completion state\n $course = get_course($lesson->course);\n $cm = get_coursemodule_from_id('languagelesson', $cmid, 0, false, MUST_EXIST);\n $completion=new completion_info($course);\n if ($completion->is_enabled($cm) && $lesson->completionsubmit) {\n $completion->update_state($cm, COMPLETION_COMPLETE, $USER->id);\n }\n \n return $result;\n }", "public function onFinishing(Step $step): void\n {\n }", "public function setPaymentExecutionResult($response, $request) {\n $this->paymentExecutionResult = $response;\n }", "public function runSuccess();", "public function executeStepOutput(&$markers, $step, &$callerObject) {\n\n\t\t// So that PHPStorm can find the classes following code is needed...\n\t\t/** @var $configuration tx_introduction_configuration */\n\t\t$configuration = t3lib_div::makeInstance('tx_introduction_configuration');\n\t\t$this->configuration = $configuration;\n\n\t\t/** @var $databaseImporter tx_introduction_import_database */\n\t\t$databaseImporter = t3lib_div::makeInstance('tx_introduction_import_database');\n\t\t$this->databaseImporter = $databaseImporter;\n\n\t\t/** @var $filestructureImporter tx_introduction_import_filestructure */\n\t\t$filestructureImporter = t3lib_div::makeInstance('tx_introduction_import_filestructure');\n\t\t$this->filestructureImporter = $filestructureImporter;\n\n\t\t$this->installer = $callerObject;\n\t\t$this->configuration->setInstallerObject($callerObject);\n\t\t$message = '';\n\n\t\tswitch($step) {\n\t\t\tcase '4':\n\t\t\t\t$markers['header'] = 'Choose a package';\n\t\t\t\t$this->installPackageAction($message);\n\t\t\t\tbreak;\n\t\t\tcase '5':\n\t\t\t\tif ($this->installer->INSTALL['database_import_all']) {\n\t\t\t\t\t$this->importDefaultTables();\n\t\t\t\t}\n\n\t\t\t\tif (t3lib_div::_GP('systemToInstall') == 'blank') {\n\t\t\t\t\t$markers['header'] = 'Congratulations,';\n\t\t\t\t\t$this->finishBlankAction($message);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tif ((t3lib_div::_GP('systemToInstall') != '') && (t3lib_div::_GP('systemToInstall') != 'blank')) {\n\t\t\t\t\t$subpackageToInstall = $this->getValidSubpackage(t3lib_div::_GP('systemToInstall'));\n\t\t\t\t\t$this->configuration->applyDefaultConfiguration();\n\t\t\t\t\t$this->configuration->applySubpackageSpecificConfiguration($subpackageToInstall);\n\t\t\t\t\t$this->configuration->modifyLocalConfFile();\n\t\t\t\t}\n\n\t\t\t\t$subpackageToInstall = $this->getValidSubpackage(t3lib_div::_GP('subpackage'));\n\t\t\t\t$this->performUpdates($subpackageToInstall);\n\t\t\t\t$markers['header'] = 'Introduction package';\n\t\t\t\t$this->passwordAction($message);\n\t\t\t\tbreak;\n\t\t\tcase '6':\n\t\t\t\t$markers['header'] = 'Congratulations,';\n\t\t\t\t$this->finishAction($message);\n\t\t\t\tbreak;\n\t\t}\n\t\tif ($message != '') {\n\t\t\t$markers['step'] = $message;\n\t\t}\n\t}", "function getTestCaseData($testCaseID, $theSubjectID, $roundID, $studyID, $clientID) {\n global $definitions;\n\n $testCaseParentTestCategoryPropertyID = getClientPropertyID_RelatedWith_byName($definitions['testcasesFolderID'], $clientID);\n\n $theTestCase = array();\n $theTestCase['TC_ID'] = $testCaseID;\n $theTestCase['ROUND_ID'] = $roundID;\n $theTestCase['STUDY_ID'] = $studyID;\n $theTestCase['SUBJECT_ID'] = $theSubjectID;\n\n //Also, get the parent testCategory for the test case\n $theTestCase['PARENT_TC_ID'] = getItemPropertyValue($testCaseID, $testCaseParentTestCategoryPropertyID, $clientID);\n\n //Get the steps for this testCase\n $theSteps = array();\n\n $theSteps = getStepsScriptsForTestCase($testCaseID, $theSubjectID, $roundID, $studyID, $clientID);\n //print(\"Steps scritps details for testCase $testCaseID and subject $theSubjectID\\n\\r\" );\n //print_r($theSteps);\n $stepsCount = 0;\n //Only returns the testcase if any step of the test case is automated and has the type passed (TODO this last)\n $hasAutomatedSteps = \"NO\";\n\n //Add the steps to the result\n for ($i = 0; $i < count($theSteps); $i++) {\n if ($theSteps[$i]['scriptAppValue'] == 'steps.types.php') {\n //print(\"found automated step\\n\\r\");\n $theTestCase['STEP_ID_' . $stepsCount] = $theSteps[$i]['ID'];\n $theTestCase['STEP_TYPE_' . $stepsCount] = $theSteps[$i]['stepType'];\n $theTestCase['STEP_APPTYPE_' . $stepsCount] = $theSteps[$i]['scriptAppValue'];\n $theTestCase['STEP_RESULT_ID_' . $stepsCount] = $theSteps[$i]['stepUnit_Result_ID'];\n //Get the stepUnits values\n\n if (isset($theSteps[$i]['stepUnit_SELENIUMRESULT_ID'])) {\n $theTestCase['STEP_STEPUNITS_SELENIUMRESULT_ID_' . $stepsCount] = $theSteps[$i]['stepUnit_SELENIUMRESULT_ID'];\n }\n if (isset($theSteps[$i]['stepUnit_SELENIUMRESULT_DESCRIPTION_ID'])) {\n $theTestCase['STEP_STEPUNITS_SELENIUMRESULT_DESCRIPTION_ID_' . $stepsCount] = $theSteps[$i]['stepUnit_SELENIUMRESULT_DESCRIPTION_ID'];\n }\n if (isset($theSteps[$i]['stepUnit_SELENIUM_LASTRESULT_ID'])) {\n $theTestCase['STEP_STEPUNITS_SELENIUMRESULT_LASTRESULT_ID_' . $stepsCount] = $theSteps[$i]['stepUnit_SELENIUM_LASTRESULT_ID'];\n\n }\n if (isset($theSteps[$i]['stepUnit_SELENIUMDESCRIPTION_LASTRESULT_ID'])) {\n $theTestCase['STEP_STEPUNITS_SELENIUMRESULTDESCRIPTION_LASTRESULT_ID_' . $stepsCount] = $theSteps[$i]['stepUnit_SELENIUMDESCRIPTION_LASTRESULT_ID'];\n\n }\n if (isset($theSteps[$i]['stepUnit_SELENIUMRESULT_EXECVALUE'])) {\n $theTestCase['STEP_STEPUNITS_SELENIUMRESULTEXECVALUE_' . $stepsCount] = $theSteps[$i]['stepUnit_SELENIUMRESULT_EXECVALUE'];\n\n }\n\n $stepsCount++;\n $hasAutomatedSteps = \"YES\";\n }\n }\n\n if ($hasAutomatedSteps == \"YES\") {\n //And return the test case\n //print (\"Return automated testCase: $testCaseID\\n\\r\");\n return $theTestCase;\n } else {\n //print (\"Not automated testCase $testCaseID. Return null\\n\\r\");\n return null;\n }\n\n}", "protected function runBeforeResponseSet(&$actionResult) {\n\t\t// Empty default implementation. Should be implemented by descendant classes if needed\n\t}", "protected function runScript(UpgradeScript $script)\n {\n set_error_handler(array($this, 'scriptErrorHandler'), E_ALL & ~E_STRICT & ~E_DEPRECATED);\n ob_start();\n try {\n $script->run($this);\n } catch (Exception $e) {\n $this->error(\"Exception: \" . $e->getMessage());\n }\n $out = ob_get_clean();\n if ($out) {\n $this->log(\"OUTPUT: $out\");\n }\n restore_error_handler();\n }", "public function setResult(?SubmissionResult $value): void {\n $this->getBackingStore()->set('result', $value);\n }", "public function getScriptResult()\n {\n return $this->restAPI->scriptResult;\n }", "public function run()\n {\n $results = [\n [1, 0, 'soso...'],\n [1, 2, 'good!'],\n [1, 3, 'perfect!!!']\n ];\n foreach ($results as $result) {\n DB::table('results')->insert([\n 'quiz_id' => $result[0],\n 'correct_number' => $result[1],\n 'comment' => $result[2]\n ]);\n }\n }", "public function process()\n\t{\n\t\t$aVals = $this->request()->getArray('val');\n\t\t$this->testInstall();\n\n\t\t// $this->testInstall();\n\n\t\tif($aVals) {\n\t\t\tPhpfox::getService('unittest.test.socialad')->test($aVals['test_suite']);\n\n\t\t\t$sContent = ob_get_contents();\n\t\t\tob_clean();\n\t\t\techo(str_replace(\"\\n\", \"</br>\", $sContent));\n\t\t\tob_end_flush();\n\t\t\texit;\n\t\t}\n\n\t\t$this->template()->assign(array(\n\t\t\t'aTestSuites' => Phpfox::getService('unittest.test.socialad')->getTestSuites()\n\t\t));\n\t}", "public function answer() {\n\n\t\t/**\n\t\t * Fires right before giving the answer.\n\t\t */\n\t\tdo_action( self::ACTION );\n\n\t\t/**\n\t\t * Filters the answer.\n\t\t *\n\t\t * @param string $answer The answer.\n\t\t */\n\t\treturn (string) apply_filters( self::FILTER, '42' );\n\t}", "public function setApplyResult(?string $value): void {\n $this->getBackingStore()->set('applyResult', $value);\n }", "function processData($step) {\n\t\t\t// if already successfully submitted, we skip any further processing\n\t\tif ( $GLOBALS[\"TSFE\"]->fe_user->getKey(\"ses\",$this->extKey . \"_successfully_submitted\") ) {\n\t\t\treturn;\n\t\t}\n\n\t\t\t// After successful form submission\n\t\tif( $step === $this->lastStep ) {\n\t\t\t$this->sendEmails();\n\t\t\t$this->addNewsletter();\n\n\t\t\t\t// remember that we finished\n\t\t\t$GLOBALS[\"TSFE\"]->fe_user->setKey(\"ses\", $this->extKey . \"_successfully_submitted\", 1);\n\t\t\t\t// clear caches\n\t\t\t$GLOBALS[\"TSFE\"]->fe_user->setKey(\"ses\", $this->extKey . \"_captcha_verified\", NULL);\n\t\t}\n\t}", "function applyFinal($q, $settings, $trail_mlids);", "public function assignStepToRecipe($recipeId, Step $step): Step;", "protected function doExecute(StepExecution $stepExecution)\n {\n $jobParameters = $stepExecution->getJobParameters();\n\n $location = rtrim($jobParameters->get('exportDir'), '/') . DIRECTORY_SEPARATOR . 'metadata.json';\n\n $content = $this->generateContent($stepExecution, $jobParameters);\n\n if (false === file_put_contents($location, $content)) {\n $stepExecution->addFailureException(\n new \\RuntimeException('Cannot create metadata file.')\n );\n }\n\n $stepExecution->addSummaryInfo('metadata_location', $location);\n }", "protected function definition_inner($mform) {\n \tglobal $CFG;\n\n //determine how the response will be interepteted (e.g. as a number)\n \t$types = array(\n qtype_scripted_response_mode::MODE_STRING => get_string('resp_string', 'qtype_scripted'),\n qtype_scripted_response_mode::MODE_STRING_CASE_SENSITIVE => get_string('resp_string_case', 'qtype_scripted'),\n qtype_scripted_response_mode::MODE_NUMERIC => get_string('resp_numeric', 'qtype_scripted'),\n qtype_scripted_response_mode::MODE_HEXADECIMAL => get_string('resp_hexadecimal', 'qtype_scripted'),\n qtype_scripted_response_mode::MODE_BINARY => get_string('resp_binary', 'qtype_scripted'),\n qtype_scripted_response_mode::MODE_OCTAL => get_string('resp_octal', 'qtype_scripted')\n \t);\n \t$mform->addElement('select', 'response_mode', get_string('responseform', 'qtype_scripted'), $types);\n\n //prompt the user for the scripting language to work with\n $languages = array(\n 'lua' => get_string('lua', 'qtype_scripted'),\n 'mathscript' => get_string('mathscript', 'qtype_scripted')\n );\n $mform->addElement('select', 'language', get_string('language', 'qtype_scripted'), $languages);\n\n \t//prompt the user for simple answer or boolean expression evaluation\n \t$types = array(\n qtype_scripted_answer_mode::MODE_MUST_EQUAL => get_string('eval_direct', 'qtype_scripted'),\n qtype_scripted_answer_mode::MODE_MUST_EVAL_TRUE => get_string('eval_boolean', 'qtype_scripted')\n \t);\n $mform->addElement('select', 'answer_mode', get_string('answerform', 'qtype_scripted'), $types);\n\n //Render the \n $mform->addElement('scripteditor', 'init_code', get_string('initscript', 'qtype_scripted'));\n \n //add settings for interactive (and similar) modes\n \t$this->add_interactive_settings();\n \t\n \t//allow more than one possible answer (including distractors)\n \t$this->add_per_answer_fields($mform, get_string('answerno', 'qtype_scripted', '{no}'), question_bank::fraction_options(), 2, 2);\n }", "function post_process(&$results) {\n }", "public function test_interactive_behaviour() {\n $dd = test_question_maker::make_question('ddimageortext');\n $dd->hints = array(\n new question_hint_with_parts(13, 'This is the first hint.', FORMAT_HTML, false, false),\n new question_hint_with_parts(14, 'This is the second hint.', FORMAT_HTML, true, true),\n );\n $dd->shufflechoices = false;\n $this->start_attempt_at_question($dd, 'interactive', 12);\n\n // Check the initial state.\n $this->check_current_state(question_state::$todo);\n $this->check_current_mark(null);\n\n $this->check_current_output(\n $this->get_contains_drag_image_home_expectation(1, 1, 1),\n $this->get_contains_drag_image_home_expectation(2, 2, 1),\n $this->get_contains_drag_image_home_expectation(3, 1, 2),\n $this->get_contains_drag_image_home_expectation(4, 2, 2),\n $this->get_contains_hidden_expectation(\n $this->quba->get_field_prefix($this->slot) . 'p1'),\n $this->get_contains_hidden_expectation(\n $this->quba->get_field_prefix($this->slot) . 'p2'),\n $this->get_contains_hidden_expectation(\n $this->quba->get_field_prefix($this->slot) . 'p3'),\n $this->get_contains_hidden_expectation(\n $this->quba->get_field_prefix($this->slot) . 'p4'),\n $this->get_contains_submit_button_expectation(true),\n $this->get_does_not_contain_feedback_expectation(),\n $this->get_tries_remaining_expectation(3),\n $this->get_no_hint_visible_expectation());\n\n // Save the wrong answer.\n $this->process_submission(array('p1' => '2', 'p2' => '1', 'p3' => '2', 'p4' => '1'));\n // Verify.\n $this->check_current_state(question_state::$todo);\n $this->check_current_mark(null);\n\n $this->check_current_output(\n $this->get_contains_drag_image_home_expectation(1, 1, 1),\n $this->get_contains_drag_image_home_expectation(2, 2, 1),\n $this->get_contains_drag_image_home_expectation(3, 1, 2),\n $this->get_contains_drag_image_home_expectation(4, 2, 2),\n $this->get_contains_hidden_expectation(\n $this->quba->get_field_prefix($this->slot) . 'p1', 2),\n $this->get_contains_hidden_expectation(\n $this->quba->get_field_prefix($this->slot) . 'p2', 1),\n $this->get_contains_hidden_expectation(\n $this->quba->get_field_prefix($this->slot) . 'p3', 2),\n $this->get_contains_hidden_expectation(\n $this->quba->get_field_prefix($this->slot) . 'p4', 1),\n $this->get_contains_submit_button_expectation(true),\n $this->get_does_not_contain_feedback_expectation(),\n $this->get_tries_remaining_expectation(3),\n $this->get_no_hint_visible_expectation());\n // Submit the wrong answer.\n $this->process_submission(\n array('p1' => '2', 'p2' => '1', 'p3' => '2', 'p4' => '1', '-submit' => 1));\n\n // Verify.\n $this->check_current_state(question_state::$todo);\n $this->check_current_mark(null);\n $this->check_current_output(\n $this->get_contains_drag_image_home_expectation(1, 1, 1),\n $this->get_contains_drag_image_home_expectation(2, 2, 1),\n $this->get_contains_drag_image_home_expectation(3, 1, 2),\n $this->get_contains_drag_image_home_expectation(4, 2, 2),\n $this->get_contains_hidden_expectation(\n $this->quba->get_field_prefix($this->slot) . 'p1', 2),\n $this->get_contains_hidden_expectation(\n $this->quba->get_field_prefix($this->slot) . 'p2', 1),\n $this->get_contains_hidden_expectation(\n $this->quba->get_field_prefix($this->slot) . 'p3', 2),\n $this->get_contains_hidden_expectation(\n $this->quba->get_field_prefix($this->slot) . 'p4', 1),\n $this->get_contains_try_again_button_expectation(true),\n $this->get_contains_hint_expectation('This is the first hint'));\n\n // Do try again.\n $this->process_submission(array('-tryagain' => 1));\n\n // Verify.\n $this->check_current_state(question_state::$todo);\n $this->check_current_mark(null);\n\n $this->check_current_output(\n $this->get_contains_drag_image_home_expectation(1, 1, 1),\n $this->get_contains_drag_image_home_expectation(2, 2, 1),\n $this->get_contains_drag_image_home_expectation(3, 1, 2),\n $this->get_contains_drag_image_home_expectation(4, 2, 2),\n $this->get_contains_hidden_expectation(\n $this->quba->get_field_prefix($this->slot) . 'p1', '2'),\n $this->get_contains_hidden_expectation(\n $this->quba->get_field_prefix($this->slot) . 'p2', '1'),\n $this->get_contains_hidden_expectation(\n $this->quba->get_field_prefix($this->slot) . 'p3', '2'),\n $this->get_contains_hidden_expectation(\n $this->quba->get_field_prefix($this->slot) . 'p4', '1'),\n $this->get_contains_submit_button_expectation(true),\n $this->get_does_not_contain_correctness_expectation(),\n $this->get_does_not_contain_feedback_expectation(),\n $this->get_tries_remaining_expectation(2),\n $this->get_no_hint_visible_expectation());\n\n // Submit the right answer.\n $this->process_submission(\n array('p1' => '1', 'p2' => '2', 'p3' => '1', 'p4' => '2', '-submit' => 1));\n\n // Verify.\n $this->check_current_state(question_state::$gradedright);\n $this->check_current_mark(8);\n $this->check_current_output(\n $this->get_contains_drag_image_home_expectation(1, 1, 1),\n $this->get_contains_drag_image_home_expectation(2, 2, 1),\n $this->get_contains_drag_image_home_expectation(3, 1, 2),\n $this->get_contains_drag_image_home_expectation(4, 2, 2),\n $this->get_contains_hidden_expectation(\n $this->quba->get_field_prefix($this->slot) . 'p1', '1'),\n $this->get_contains_hidden_expectation(\n $this->quba->get_field_prefix($this->slot) . 'p2', '2'),\n $this->get_contains_hidden_expectation(\n $this->quba->get_field_prefix($this->slot) . 'p3', '1'),\n $this->get_contains_hidden_expectation(\n $this->quba->get_field_prefix($this->slot) . 'p4', '2'),\n $this->get_does_not_contain_submit_button_expectation(),\n $this->get_contains_correct_expectation(),\n $this->get_no_hint_visible_expectation());\n\n // Check regrading does not mess anything up.\n $this->quba->regrade_all_questions();\n\n // Verify.\n $this->check_current_state(question_state::$gradedright);\n $this->check_current_mark(8);\n }", "function run($script): Promise\n{\n return factory()->run($script);\n}", "protected function doSuccess( $step ) {\n\t\tstatic $inSuccess = false;\n\t\tif ( $inSuccess ) {\n\t\t\tthrow new ErrorPageError(\n\t\t\t\t\"mabs-wizard-success-loop\", \"mabs-dev-needed-callback\", [ $step, $this->page ]\n\t\t\t);\n\t\t}\n\t\t$inSuccess = true;\n\n\t\t$allSteps = $this->steps;\n\t\t$pos = array_search( $step, $allSteps );\n\t\tif ( is_int( $pos ) && $pos + 1 <= count( $allSteps ) - 1 ) {\n\t\t\t$this->pageClass = $this;\n\t\t\t$this->doWizard( $allSteps[ $pos + 1 ] );\n\t\t\treturn;\n\t\t}\n\t\t$out = RequestContext::getMain()->getOutput();\n\t\t$out->redirect( $this->getNextPage( $step )->getFullUrl() );\n\t}", "public function run()\n {\n $steps = ['listcatimage','listcatthumb'];\n //get argument passed to shell script\n $step = $this->getArg('step');\n if (in_array($step, $steps)) {\n $this->$step();\n } else {\n echo \"STEP MUST BE ONE OF THESE:\\n\";\n foreach ($steps as $s) {\n echo $s.\",\\n\";\n }\n }\n }", "public function step()\n {\n }", "public function setUpDefaultVars() {\n $this->response['numAttempts'] = new qti_variable('single', 'integer', array('value' => 0));\n $this->response['duration'] = new qti_variable('single', 'float', array('value' => 0));\n $this->outcome['completionStatus'] = new qti_variable('single', 'identifier', array('value' => 'not_attempted'));\n \n // TODO: We have this to get around mistakes (?) in the example QTI - should we?\n $this->outcome['completion_status'] = $this->outcome['completionStatus'];\n }", "public function quiz_result() {\n\n\t\t$this->page_data['page_name'] = \"quiz_result\";\n\t\t$this->page_data['page_title'] = 'Quiz Result';\n\t\t$this->page_data['page_view'] = 'user/quiz_result';\n\t\t$this->page_data['sub_page_name'] = \"quiz_result\";\n\n\t\t$this->page_data['enrollment_list'] = $this->crud_model->get_enrollment_info_by_user_id(\"OBJECT\", $this->session->userdata('user_id'), array(\n\t\t\t\"enrollment\" => array('id as enrollment_id'),\n\t\t\t\"course\" => array('id as course_id', 'title as course_title'),\n\t\t));\n\t\t$this->page_data['user_assessment_all'] = [];\n\t\tif (isset($_GET['enrollment_id'])) {\n\t\t\t$this->page_data['user_assessment_all'] = $this->quiz_model->get_quiz_result_by_enroll_id($_GET['enrollment_id']);\n\t\t}\n\n\t\tif (isset($_GET['enrollment_id']) && isset($_GET['set_id'])) {\n\n\t\t\t$this->page_data['user_assessment'] = $this->quiz_model->get_assessment_by_enroll_id(\n\t\t\t\t\"OBJECT\",\n\t\t\t\tarray(\n\t\t\t\t\t\"user_assessment\" => array(\"id\", \"set_id\", \"question_and_answer_list\", \"question_and_explanation\"),\n\t\t\t\t\t'quiz_set' => array('quiz_result')\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t\"user_assessment.enrollment_id\" => $_GET['enrollment_id'],\n\t\t\t\t\t\"user_assessment.set_id\" => $_GET['set_id'],\n\t\t\t\t)\n\t\t\t\t\n\t\t\t);\n\n\t\t\t // debug($this->page_data['user_assessment']);\n\n\n\t\t}\n\t\t$this->load->view('index', $this->page_data);\n\t}", "public function setReduceScript(string $script): self\n {\n return $this->setParam('reduce_script', $script);\n }", "protected function after_execute() {\n // Add iadlearning related files, no need to match by itemname (just internally handled context).\n $this->add_related_files('mod_iadlearning', 'intro', null);\n }", "public function execute() {\n\t\t$data = $this->getResultData();\n\t\t$this->printText($data[0]);\n\t}", "public function updateTraitResultInJobApplication($traits_result, $data)\n {\n $total = array_sum($traits_result);\n $div = count($traits_result)*5;\n $traits_result = ceil(($total/$div)*100);\n $this->db->where('job_applications.candidate_id', $data['candidate_id']);\n $this->db->where('job_applications.job_id', $data['job_id']);\n $this->db->update('job_applications', array('traits_result' => $traits_result));\n }", "protected function migrate_question_attempt_steps($questionid, $subs, $correctresponse, $currentresponse) {\n global $DB;\n\n // the SQL to determine the length of the name field\n // this is used for \"natural sorting\" of the step data\n $sql_length_dname = $DB->sql_length('d.name');\n\n // convert any responses for this question\n // (stored in the \"question_attempt_step_data\" table)\n $select = 'd.id, d.attemptstepid, d.name, d.value, '.\n 's.questionattemptid, s.sequencenumber, s.state, '.\n 'a.questionusageid, a.slot, a.questionid, a.questionsummary, a.rightanswer, a.responsesummary';\n $from = '{question_attempt_step_data} d '.\n 'LEFT JOIN {question_attempt_steps} s ON s.id = d.attemptstepid '.\n 'LEFT JOIN {question_attempts} a ON a.id = s.questionattemptid';\n $where = 'a.questionid = ?';\n $order = \"a.questionusageid, a.slot, s.sequencenumber, $sql_length_dname, d.name\"; // natural sort of d.name\n $params = array($questionid);\n if ($datas = $DB->get_records_sql(\"SELECT $select FROM $from WHERE $where ORDER BY $order\", $params)) {\n\n // cache of which question_attempts have been updated\n $question_attempts = array();\n\n // search string to locate qtype_order info in question summary\n $qsummary_search = '/\\s*\\{[^\\}]*\\}\\s*$/';\n\n // set names of first and last attempt_step_data records\n // that are used to denote the current order of items\n if ($count = count($subs)) {\n $i_min = 0;\n $i_max = ($count - 1);\n } else {\n $i_min = -1;\n $i_max = -1;\n }\n\n // initialize array use to hold unique md5keys for answers\n $md5keys = array();\n\n foreach ($datas as $data) {\n\n $id = $data->questionattemptid;\n if (empty($question_attempts[$id])) {\n $question_attempts[$id] = true;\n if ($attempt = $DB->get_record('question_attempts', array('id' => $id))) {\n $attempt->questionsummary = preg_replace($qsummary_search, '', $attempt->questionsummary);\n $attempt->rightanswer = '';\n $attempt->responsesummary = '';\n $DB->update_record('question_attempts', $attempt);\n }\n }\n\n switch ($data->name) {\n\n case '_stemorder': // the order displayed at the start of this attempt\n $this->convert_step_data($subs, $data, '_currentresponse', $currentresponse);\n $i_max = (count($currentresponse) - 1);\n break;\n\n case '_choiceorder': // the correct order\n $this->convert_step_data($subs, $data, '_correctresponse', $correctresponse);\n break;\n\n case '_correctresponse':\n // these data records have already been migrated\n // and are waiting for the question type\n // to be changed from \"order\" to \"ordering\"\n // this should only happen during development of this tool\n $this->revert_step_data($subs, $data, $correctresponse);\n break;\n\n case '_currentresponse':\n // these data records have already been migrated\n // and are waiting for the question type\n // to be changed from \"order\" to \"ordering\"\n // this should only happen during development of this tool\n $this->revert_step_data($subs, $data, $currentresponse);\n break;\n\n case '-finish':\n // do nothing\n break;\n\n default:\n if (substr($data->name, 0, 3)=='sub') {\n $i = intval(substr($data->name, 3));\n if ($i==$i_min) {\n $md5keys = array();\n }\n if ($pos = intval($data->value)) {\n $id = $currentresponse[$i];\n $md5keys[$pos] = $subs[$id]->md5key;\n }\n if ($i==$i_max) {\n // update this $data record\n ksort($md5keys);\n $this->update_step_data($data, 'response_'.$questionid, implode(',', $md5keys));\n $md5keys = array();\n } else {\n // remove this $data record\n $this->delete_step_data($data);\n }\n } else {\n // unknown step data - shouldn't happen !!\n $this->delete_step_data($data);\n }\n } // end switch $data->name\n } // end foreach $datas\n } // end if $datas\n }", "public function run (CIUnit_Framework_TestResult $result = NULL)\n {\n // Check for existing result object and create new if current is NULL\n if (NULL == $result) {\n $result = $this->createResult();\n }\n \n if (! $this instanceof CIUnit_Framework_TestWarning) {\n $this->result = $result;\n }\n \n // check for any dependencies ???\n \n $result->run($this);\n \n $this->result = NULL;\n \n return $result;\n }", "public function process() {\n\t\t$service = $this->getService();\n\t\t$service->hsts = HTTP_Helper::retrievePost( 'hsts_preload' );\n\t\t$service->include_subdomain = HTTP_Helper::retrievePost( 'include_subdomain' );\n\t\t$service->hsts_cache_duration = HTTP_Helper::retrievePost( 'hsts_cache_duration' );\n\t\t$service->scenario = HTTP_Helper::retrievePost( 'scenario' );\n\t\t$ret = $service->process();\n\t\tif ( is_wp_error( $ret ) ) {\n\t\t\twp_send_json_error( [\n\t\t\t\t'message' => $ret->get_error_message()\n\t\t\t] );\n\t\t} else {\n\t\t\tSettings::instance()->addToResolved( Sh_Strict_Transport::$slug );\n\t\t}\n\t}", "public function completedStep($step)\n {\n \t$validation = 'validateStep' . studly_case(str_replace('.', '-', $step->slug));\n\n \tif (method_exists($this, $validation)) {\n \t\t$result = $this->{$validation}();\n \t}else {\n \t\t$result = true;\n \t}\n\n \treturn $result;\n }", "function applies()\n\t{\n\t\t$applies=(get_param('page','')=='admin_setupwizard') && (get_param('type')=='step6');\n\t\treturn array($applies,NULL,false);\n\t}", "protected function setResult($value)\n {\n $this->result = $value;\n }", "public function test_quizp_with_question_with_variants_attempt_walkthrough($variantno, $correctresponse, $done = false) {\n global $SITE;\n\n $this->resetAfterTest($done);\n\n $this->setAdminUser();\n\n if ($this->quizpwithvariants === null) {\n // Make a quizp.\n $quizpgenerator = $this->getDataGenerator()->get_plugin_generator('mod_quizp');\n\n $this->quizpwithvariants = $quizpgenerator->create_instance(array('course'=>$SITE->id,\n 'questionsperpage' => 0,\n 'grade' => 100.0,\n 'sumgrades' => 1));\n\n $questiongenerator = $this->getDataGenerator()->get_plugin_generator('core_question');\n\n $cat = $questiongenerator->create_question_category();\n $calc = $questiongenerator->create_question('calculatedsimple', 'sumwithvariants', array('category' => $cat->id));\n quizp_add_quizp_question($calc->id, $this->quizpwithvariants, 0);\n }\n\n\n // Make a new user to do the quizp.\n $user1 = $this->getDataGenerator()->create_user();\n $this->setUser($user1);\n $quizpobj = quizp::create($this->quizpwithvariants->id, $user1->id);\n\n // Start the attempt.\n $quba = question_engine::make_questions_usage_by_activity('mod_quizp', $quizpobj->get_context());\n $quba->set_preferred_behaviour($quizpobj->get_quizp()->preferredbehaviour);\n\n $timenow = time();\n $attempt = quizp_create_attempt($quizpobj, 1, false, $timenow);\n\n // Select variant.\n quizp_start_new_attempt($quizpobj, $quba, $attempt, 1, $timenow, array(), array(1 => $variantno));\n $this->assertEquals('1,0', $attempt->layout);\n quizp_attempt_save_started($quizpobj, $quba, $attempt);\n\n // Process some responses from the student.\n $attemptobj = quizp_attempt::create($attempt->id);\n $this->assertFalse($attemptobj->has_response_to_at_least_one_graded_question());\n\n $tosubmit = array(1 => array('answer' => $correctresponse));\n $attemptobj->process_submitted_actions($timenow, false, $tosubmit);\n\n // Finish the attempt.\n $attemptobj = quizp_attempt::create($attempt->id);\n $this->assertTrue($attemptobj->has_response_to_at_least_one_graded_question());\n\n $attemptobj->process_finish($timenow, false);\n\n // Re-load quizp attempt data.\n $attemptobj = quizp_attempt::create($attempt->id);\n\n // Check that results are stored as expected.\n $this->assertEquals(1, $attemptobj->get_attempt_number());\n $this->assertEquals(1, $attemptobj->get_sum_marks());\n $this->assertEquals(true, $attemptobj->is_finished());\n $this->assertEquals($timenow, $attemptobj->get_submitted_date());\n $this->assertEquals($user1->id, $attemptobj->get_userid());\n $this->assertTrue($attemptobj->has_response_to_at_least_one_graded_question());\n\n // Check quizp grades.\n $grades = quizp_get_user_grades($this->quizpwithvariants, $user1->id);\n $grade = array_shift($grades);\n $this->assertEquals(100.0, $grade->rawgrade);\n\n // Check grade book.\n $gradebookgrades = grade_get_grades($SITE->id, 'mod', 'quizp', $this->quizpwithvariants->id, $user1->id);\n $gradebookitem = array_shift($gradebookgrades->items);\n $gradebookgrade = array_shift($gradebookitem->grades);\n $this->assertEquals(100, $gradebookgrade->grade);\n }", "function execute() {\n\t\tif (empty($this->args)) {\n\t\t\t$this->__interactive();\n\t\t}\n\n\t\tif (count($this->args) == 1) {\n\t\t\t$this->__interactive($this->args[0]);\n\t\t}\n\n\t\tif (count($this->args) > 1) {\n\t\t\t$type = Inflector::underscore($this->args[0]);\n\t\t\tif ($this->bake($type, $this->args[1])) {\n\t\t\t\t$this->out('done');\n\t\t\t}\n\t\t}\n\t}", "public function onAjaxSampledataApplyStep1()\n\t{\n\t\tif (!Session::checkToken('get') || $this->app->input->get('type') != $this->_name)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t$languages = LanguageHelper::getContentLanguages(array(0, 1));\n\n\t\tif (count($languages) < 2)\n\t\t{\n\t\t\t$response = array();\n\t\t\t$response['success'] = false;\n\t\t\t$response['message'] = Text::_('PLG_SAMPLEDATA_MULTILANG_MISSING_LANGUAGE');\n\n\t\t\treturn $response;\n\t\t}\n\n\t\tif (!$this->enablePlugin('plg_system_languagefilter'))\n\t\t{\n\t\t\t$response = array();\n\t\t\t$response['success'] = false;\n\n\t\t\t$lang = Factory::getLanguage()->getTag();\n\t\t\t$lang->load('plg_system_languagefilter', JPATH_ADMINISTRATOR);\n\t\t\t$message = $lang->_('PLG_SYSTEM_LANGUAGEFILTER');\n\n\t\t\t$response['message'] = Text::sprintf('PLG_SAMPLEDATA_MULTILANG_ERROR_LANGFILTER', 2, $message);\n\n\t\t\treturn $response;\n\t\t}\n\n\t\t$response = new stdClass;\n\t\t$response->success = true;\n\t\t$response->message = Text::_('PLG_SAMPLEDATA_MULTILANG_STEP1_SUCCESS');\n\n\t\treturn $response;\n\t}", "public function executeStep(string $step, array $data = []): array\n {\n // or leave this and implement for each step executeStepXXX\n // where XXX is the camel cased name of your step\n throw new SharpMethodNotImplementedException();\n }", "public function setResult(string $result): void\n {\n $this->result = $result;\n }", "public abstract function response_area_input($name, question_attempt $qa,\n question_attempt_step $step, $lines, $context);", "public function after_install( $response, $hook_extra, $result ) {\n global $wp_filesystem;\n $install_directory = SALESFORCE__PLUGIN_DIR;\n $wp_filesystem->move( $result['destination'], $install_directory );\n $result['destination'] = $install_directory;\n if ( $this->active ) {\n activate_plugin( $this->basename );\n }\n return $result;\n }", "public function process($step)\r\n {\r\n if (isset($_REQUEST[$this->cancelButton])) {\r\n return $this->cancelled($step); // Ends the wizard\r\n } elseif (isset($_REQUEST[$this->resetButton]) && !$this->forwardOnly) {\r\n $this->resetWizard($step); // Restarts the wizard\r\n $step = null;\r\n }\r\n\r\n if (empty($step)) {\r\n if (!$this->hasStarted() && !$this->start()) {\r\n return $this->finished(false);\r\n }\r\n if ($this->hasCompleted()) {\r\n return $this->finished(true);\r\n } else {\r\n return $this->nextStep();\r\n }\r\n } else {\r\n if ($this->isValidStep($step)) {\r\n $this->_currentStep = $step;\r\n if (!$this->forwardOnly && isset($_REQUEST[$this->previousButton])) {\r\n return $this->previousStep();\r\n } elseif ($this->processStep()) {\r\n if (isset($_REQUEST[$this->saveDraftButton])) {\r\n return $this->saveDraft($step); // Ends the wizard\r\n }\r\n return $this->nextStep();\r\n }\r\n } else {\r\n return $this->invalidStep($step);\r\n }\r\n }\r\n }", "public function do_tests()\n {\n foreach ($this->tests as $test) {\n $test->do_test($this->parse_script, $this->interpret_script);\n }\n }", "public static function _switch()\n {\n //get the argument list, and extract $self\n $args = func_get_args();\n $self = array_shift($args);\n\n //get the item we're comparing to\n $comparison_base = array_shift($args);\n\n //split the arguments into two separate lists\n $count = count($args);\n for($i = 0; $i + 1 < $count; $i += 2)\n {\n //if the condition evalutes to true, run the body code\n if($self->evaluate($args[$i]) == $comparison_base)\n {\n //run the associated code\n $self->evaluate_script($args[$i + 1]);\n }\n }\n }", "public function onAjaxSampledataApplyStep6()\n\t{\n\t\tif (!Session::checkToken('get') || $this->app->input->get('type') != $this->_name)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\tif (!ComponentHelper::isEnabled('com_content') || !Factory::getUser()->authorise('core.create', 'com_content'))\n\t\t{\n\t\t\t$response = array();\n\t\t\t$response['success'] = true;\n\t\t\t$response['message'] = Text::sprintf('PLG_SAMPLEDATA_MULTILANG_STEP_SKIPPED', 6, 'com_content');\n\n\t\t\treturn $response;\n\t\t}\n\n\t\tif (!ComponentHelper::isEnabled('com_categories') || !Factory::getUser()->authorise('core.create', 'com_content.category'))\n\t\t{\n\t\t\t$response = array();\n\t\t\t$response['success'] = true;\n\t\t\t$response['message'] = Text::sprintf('PLG_SAMPLEDATA_MULTILANG_STEP_SKIPPED', 6, 'com_categories');\n\n\t\t\treturn $response;\n\t\t}\n\n\t\t$siteLanguages = $this->getInstalledlangsFrontend();\n\n\t\tComponentHelper::getParams('com_content')->set('workflow_enabled', 0);\n\n\t\tforeach ($siteLanguages as $siteLang)\n\t\t{\n\t\t\tif (!$tableCategory = $this->addCategory($siteLang))\n\t\t\t{\n\t\t\t\t$response = array();\n\t\t\t\t$response['success'] = false;\n\t\t\t\t$response['message'] = Text::sprintf('PLG_SAMPLEDATA_MULTILANG_ERROR_CATEGORY', 6, $siteLang->language);\n\n\t\t\t\treturn $response;\n\t\t\t}\n\n\t\t\t$groupedAssociations['com_categories.item'][$siteLang->language] = $tableCategory->id;\n\n\t\t\tif (!$tableArticle = $this->addArticle($siteLang, $tableCategory->id))\n\t\t\t{\n\t\t\t\t$response = array();\n\t\t\t\t$response['success'] = false;\n\t\t\t\t$response['message'] = Text::sprintf('PLG_SAMPLEDATA_MULTILANG_ERROR_ARTICLE', 6, $siteLang->language);\n\n\t\t\t\treturn $response;\n\t\t\t}\n\n\t\t\t$groupedAssociations['com_content.item'][$siteLang->language] = $tableArticle->id;\n\n\t\t\tif (!$tableMenuItem = $this->addBlogMenuItem($siteLang, $tableCategory->id))\n\t\t\t{\n\t\t\t\t$response = array();\n\t\t\t\t$response['success'] = false;\n\t\t\t\t$response['message'] = Text::sprintf('PLG_SAMPLEDATA_MULTILANG_ERROR_BLOG', 6, $siteLang->language);\n\n\t\t\t\treturn $response;\n\t\t\t}\n\n\t\t\t$groupedAssociations['com_menus.item'][$siteLang->language] = $tableMenuItem->id;\n\t\t}\n\n\t\tif (!$this->addAssociations($groupedAssociations))\n\t\t{\n\t\t\t$response = array();\n\t\t\t$response['success'] = false;\n\t\t\t$response['message'] = Text::sprintf('PLG_SAMPLEDATA_MULTILANG_ERROR_ASSOC_VARIOUS', 6);\n\n\t\t\treturn $response;\n\t\t}\n\n\t\t$response = new stdClass;\n\t\t$response->success = true;\n\t\t$response->message = Text::_('PLG_SAMPLEDATA_MULTILANG_STEP6_SUCCESS');\n\n\t\treturn $response;\n\t}", "function my_post_callback_function_test( $result ) {\n\tupdate_post_meta( $result->ID, 'custom-key', 'my-value' );\n}", "public static function executeStepHandler2()\n {\n // Invoke plugins\n \\Includes\\Decorator\\Utils\\PluginManager::invokeHook(static::HOOK_STEP_SECOND);\n }", "function getSeleniumResultsForTestCase($testCaseID, $relationID, $studyID, $subjectID, $clientID) {\n\n global $definitions;\n $stepsItemTypeID = getClientItemTypeID_RelatedWith_byName($definitions['steps'], $clientID);\n\n $stepParentTestCasePropertyID = getClientPropertyID_RelatedWith_byName($definitions['stepsTestCaseParentID'], $clientID);\n $stepOrderPropertyID = getClientPropertyID_RelatedWith_byName($definitions['stepsOrder'], $clientID);\n $stepCheckedStepUnitsPropertyID = getClientPropertyID_RelatedWith_byName($definitions['stepsCheckedStepUnits'], $clientID);\n $stepRoundSubjectTestCasePropertyID = getClientPropertyID_RelatedWith_byName($definitions['stepsRoundSubjectRelationID'], $clientID);\n\n //First, we need the steps for this testCase\n\n //Next, get the results fo the step\n // get checked values\n // build return properties array\n $returnProperties = array();\n $returnProperties[] = array('ID' => $stepOrderPropertyID, 'name' => 'order');\n $returnProperties[] = array('ID' => $stepCheckedStepUnitsPropertyID, 'name' => 'checkedValues');\n\n //build the filter\n $filters = array();\n $filters[] = array('ID' => $stepParentTestCasePropertyID, 'value' => $testCaseID);\n $filters[] = array('ID' => $stepRoundSubjectTestCasePropertyID, 'value' => $relationID);\n\n // get steps\n $orderedSteps = getFilteredItemsIDs($stepsItemTypeID, $clientID, $filters, $returnProperties, 'order');\n\n $totalOK = 0;\n $totalNOK = 0;\n $hasSeleniumResults = False;\n\n for ($i = 0; $i < count($orderedSteps); $i++) {\n\n $markedStepsUnitsIDs = explode(',', $orderedSteps[$i]['checkedValues']);\n\n $params = getParamsAndResultsForAStep($orderedSteps[$i], $studyID, $subjectID, $markedStepsUnitsIDs, $clientID);\n\n //Add every parameter to the results\n foreach ($params as $p) {\n\n //Check if the systemConversion value is a Selenium type\n\n if (base64_decode($p['systemConversionValue']) == 'stepUnit.type.seleniumResult') {\n $hasSeleniumResults = True;\n $theResult = base64_decode($p['executionValue']);\n if ($theResult == 'OK') {\n $totalOK++;\n } elseif ($theResult == 'NOK') {\n $totalNOK++;\n }\n }\n\n }\n }\n if ($hasSeleniumResults == True) {\n if ($totalOK > 0 && $totalNOK == 0) {\n return 'OK';\n } elseif ($totalNOK > 0) {\n return 'NOK';\n } elseif ($totalOK == 0 && $totalNOK == 0) {\n return 'NOT_EXECUTED';\n }\n } else {\n return 'NOSELENIUM';\n }\n\n}", "public function run() {\n Preview::$config->reporter->before_suite($this->result);\n\n if ($this->runnable()) {\n $this->timer->start();\n $this->extend_context_with_parent();\n\n // run before hooks if error occured\n // force all its children tests set to error.\n try {\n $this->run_before();\n } catch (\\Exception $e) {\n $this->force_error($e);\n }\n\n // run all its children test cases/suites.\n foreach ($this->cases as $case) {\n $case->run();\n }\n foreach ($this->suites as $suite) {\n $suite->run();\n }\n\n // run after hooks.\n // do not handle any exceptions,\n // since reporter has printed results out.\n $this->run_after();\n $this->finish();\n\n $this->timer->stop();\n }\n\n Preview::$config->reporter->after_suite($this->result);\n }", "public function postExecute() {\n\t\t// someone retrieves a bench value from \n\t\t// Benchmark class.\n\t}", "function pmproex_setupJS($experiment, $goal = false)\r\n{\r\n\t//register\r\n\twp_register_script('pmproex', plugin_dir_url( __FILE__ ) . 'js/pmpro-experiments.js');\r\n\t\r\n\t//get values\r\n\t$vars = array(\r\n\t\t'experiment' => $experiment,\r\n\t\t'ajaxurl' => admin_url('admin-ajax.php'),\r\n\t\t'timeout' => apply_filters(\"pmpro_ajax_timeout\", 5000, \"pmpro-experiment\"),\r\n\t);\r\n\tif($goal)\r\n\t\t$vars['goal'] = $goal;\r\n\twp_localize_script('pmproex', 'pmproex', $vars);\r\n\t//enqueue\r\n\twp_enqueue_script('pmproex', NULL, array('jquery'), '.1');\r\n}", "public function proceed();", "public function setResult(?EvaluateLabelJobResultGroup $value): void {\n $this->getBackingStore()->set('result', $value);\n }", "public function onAjaxSampledataApplyStep7()\n\t{\n\t\tif (!Session::checkToken('get') || $this->app->input->get('type') != $this->_name)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\tif (!ComponentHelper::isEnabled('com_modules'))\n\t\t{\n\t\t\t$response = array();\n\t\t\t$response['success'] = true;\n\t\t\t$response['message'] = Text::sprintf('PLG_SAMPLEDATA_MULTILANG_STEP_SKIPPED', 7, 'com_modules');\n\n\t\t\treturn $response;\n\t\t}\n\n\t\tif (!$this->disableModuleMainMenu())\n\t\t{\n\t\t\t$response = array();\n\t\t\t$response['success'] = false;\n\t\t\t$response['message'] = Text::sprintf('PLG_SAMPLEDATA_MULTILANG_ERROR_MAINMENU_MODULE', 7);\n\n\t\t\treturn $response;\n\t\t}\n\n\t\t$response = new stdClass;\n\t\t$response->success = true;\n\t\t$response->message = Text::_('PLG_SAMPLEDATA_MULTILANG_STEP7_SUCCESS');\n\n\t\treturn $response;\n\t}", "public function getStep();", "public abstract function afterExec();", "public function hookTestHook($result)\n {\n return \"<$result>\";\n }", "function getParamsAndResultsForAStep($step, $parentStudyID, $parentSubjectID, $markedStepsUnitsIDs, $clientID) {\n\n global $definitions;\n\n //we need get the associated parameters and their result\n $itemTypeID = getClientItemTypeID_RelatedWith_byName($definitions['stepUnits'], $clientID);\n\n $parentStepPropertyID = getClientPropertyID_RelatedWith_byName($definitions['stepUnitsStepParentID'], $clientID);\n $unitPropertyID = getClientPropertyID_RelatedWith_byName($definitions['stepUnitsUnit'], $clientID);\n $conversionValuePropertyID = getClientPropertyID_RelatedWith_byName($definitions['stepUnitsConversionValue'], $clientID);\n $parentStudyPropertyID = getClientPropertyID_RelatedWith_byName($definitions['stepUnitsParentStudy'], $clientID);\n $isGlobalPropertyID = getClientPropertyID_RelatedWith_byName($definitions['stepUnitsIsGlobal'], $clientID);\n $valuesListPropertyID = getClientPropertyID_RelatedWith_byName($definitions['stepUnitsValuesList'], $clientID);\n\n $mainPropertyID = getMainPropertyID($itemTypeID, $clientID);\n\n // build return properties array\n $returnProperties = array();\n $returnProperties[] = array('ID' => $mainPropertyID, 'name' => 'mainValue');\n $returnProperties[] = array('ID' => $unitPropertyID, 'name' => 'unit');\n $returnProperties[] = array('ID' => $conversionValuePropertyID, 'name' => 'conversionValue');\n $returnProperties[] = array('ID' => $parentStudyPropertyID, 'name' => 'studyID');\n $returnProperties[] = array('ID' => $isGlobalPropertyID, 'name' => 'isGlobal');\n $returnProperties[] = array('ID' => $valuesListPropertyID, 'name' => 'valuesList');\n\n //build the filter for all the units that are global to the study\n $filters = array();\n $filters[] = array('ID' => $parentStudyPropertyID, 'value' => $parentStudyID);\n $filters[] = array('ID' => $isGlobalPropertyID, 'value' => 1);\n\n $stepUnits = getFilteredItemsIDs($itemTypeID, $clientID, $filters, $returnProperties);\n\n //Seguidamente, cogemos las unidades própias del step\n // build return properties array\n $returnProperties = array();\n $returnProperties[] = array('ID' => $mainPropertyID, 'name' => 'mainValue');\n $returnProperties[] = array('ID' => $unitPropertyID, 'name' => 'unit');\n $returnProperties[] = array('ID' => $conversionValuePropertyID, 'name' => 'conversionValue');\n $returnProperties[] = array('ID' => $parentStudyPropertyID, 'name' => 'studyID');\n $returnProperties[] = array('ID' => $isGlobalPropertyID, 'name' => 'isGlobal');\n $returnProperties[] = array('ID' => $valuesListPropertyID, 'name' => 'valuesList');\n\n //build the filter for all the units that are global to the study\n $filters = array();\n $filters[] = array('ID' => $parentStudyPropertyID, 'value' => $parentStudyID);\n $filters[] = array('ID' => $parentStepPropertyID, 'value' => $step['stepRelated']);\n $filters[] = array('ID' => $isGlobalPropertyID, 'value' => 0);\n\n $noGlobalStepUnits = getFilteredItemsIDs($itemTypeID, $clientID, $filters, $returnProperties);\n\n //Juntamos los dos arrays\n $stepUnits = array_merge($stepUnits, $noGlobalStepUnits);\n\n //añadimos más informaciones a los stepUnits\n for ($i = 0; $i < count($stepUnits); $i++) {\n $stepUnits[$i]['parentStepID'] = $step['ID'];\n $stepUnits[$i]['isStep'] = 'False';\n $stepUnits[$i]['order'] = $i;\n $stepUnits[$i]['unit'] = base64_encode($stepUnits[$i]['unit']);\n $stepUnits[$i]['mainValue'] = base64_encode($stepUnits[$i]['mainValue']);\n $stepUnits[$i]['systemConversionValue'] = base64_encode(getAppRelatedListUnitValue($stepUnits[$i]['conversionValue']));\n $stepUnits[$i]['conversionValue'] = base64_encode($stepUnits[$i]['conversionValue']);\n\n }\n\n //añadimos el valor de conversión de la lista de tipos de valores\n\n $stepUnitsChecked = array();\n for ($i = 0; $i < count($stepUnits); $i++) {\n if (in_array($stepUnits[$i]['ID'], $markedStepsUnitsIDs)) {\n $stepUnitsChecked[] = $stepUnits[$i];\n }\n }\n\n //Seguidamente, hemos de coger el order que tiene cada una de las unidades dentro del estudio\n $orderUnitsItemTypeID = getClientItemTypeID_RelatedWith_byName($definitions['orderUnits'], $clientID);\n $orderUnitsStepPropID = getClientPropertyID_RelatedWith_byName($definitions['orderUnitsStepID'], $clientID);\n $orderUnitsUnitPropID = getClientPropertyID_RelatedWith_byName($definitions['orderUnitsUnitID'], $clientID);\n $orderUnitsOrderPropID = getClientPropertyID_RelatedWith_byName($definitions['orderUnitsOrder'], $clientID);\n\n // build return properties array\n $returnPropertiesOrder = array();\n $returnPropertiesOrder[] = array('ID' => $orderUnitsOrderPropID, 'name' => 'order');\n $returnPropertiesOrder[] = array('ID' => $orderUnitsUnitPropID, 'name' => 'unitID');\n\n //build the filter\n $filtersOrder = array();\n $filtersOrder[] = array('ID' => $orderUnitsStepPropID, 'value' => $step['ID']);\n\n $OrderUnits = getFilteredItemsIDs($orderUnitsItemTypeID, $clientID, $filtersOrder, $returnPropertiesOrder);\n\n $orders = array();\n foreach ($OrderUnits as $order) {\n $orders[$order['unitID']] = $order['order'];\n }\n\n for ($i = 0; $i < count($stepUnitsChecked); $i++) {\n\n if (isset($orders[$stepUnitsChecked[$i]['ID']])) {\n $stepUnitsChecked[$i]['order'] = $orders[$stepUnitsChecked[$i]['ID']];\n } else {\n $stepUnitsChecked[$i]['order'] = 0;\n }\n }\n\n //Reordenamos el array en función del orden\n usort($stepUnitsChecked, make_comparer(array('order', SORT_DESC)));\n\n //Una vez tenemos los parámetros ordenados, hemos de coger sus valores\n for ($i = 0; $i < count($stepUnitsChecked); $i++) {\n $resultsValues = array();\n $resultsValues = getValuesForAStepUnit($stepUnitsChecked[$i]['ID'], $parentSubjectID, $step['ID'], $clientID);\n\n $stepUnitsChecked[$i]['executionValue'] = $resultsValues['executionValue'];\n $stepUnitsChecked[$i]['resultID'] = $resultsValues['resultID'];\n }\n\n return $stepUnitsChecked;\n}", "public function onAjaxSampledataApplyStep2()\n\t{\n\t\tif (!Session::checkToken('get') || $this->app->input->get('type') != $this->_name)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\tif (!ComponentHelper::isEnabled('com_modules') || !Factory::getUser()->authorise('core.create', 'com_modules'))\n\t\t{\n\t\t\t$response = array();\n\t\t\t$response['success'] = true;\n\t\t\t$response['message'] = Text::sprintf('PLG_SAMPLEDATA_MULTILANG_STEP_SKIPPED', 2, 'com_modules');\n\n\t\t\treturn $response;\n\t\t}\n\n\t\tif (!$this->addModuleLanguageSwitcher())\n\t\t{\n\t\t\t$response = array();\n\t\t\t$response['success'] = false;\n\n\t\t\t$lang = Factory::getLanguage()->getTag();\n\t\t\t$lang->load('mod_languages', JPATH_SITE);\n\t\t\t$message = $lang->_('MOD_LANGUAGES');\n\n\t\t\t$response['message'] = Text::sprintf('PLG_SAMPLEDATA_MULTILANG_ERROR_SWITCHER', 2, $message);\n\n\t\t\treturn $response;\n\t\t}\n\n\t\t$response = new stdClass;\n\t\t$response->success = true;\n\t\t$response->message = Text::_('PLG_SAMPLEDATA_MULTILANG_STEP2_SUCCESS');\n\n\t\treturn $response;\n\t}", "public static function run($script)\n {\n $script = self::openTag($script);\n //\n $script = self::closeTag($script);\n //\n return $script;\n }", "public function onAjaxSampledataApplyStep5()\n\t{\n\t\tif (!Session::checkToken('get') || $this->app->input->get('type') != $this->_name)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\tif (!ComponentHelper::isEnabled('com_modules') || !Factory::getUser()->authorise('core.create', 'com_modules'))\n\t\t{\n\t\t\t$response = array();\n\t\t\t$response['success'] = true;\n\t\t\t$response['message'] = Text::sprintf('PLG_SAMPLEDATA_MULTILANG_STEP_SKIPPED', 5, 'com_modules');\n\n\t\t\treturn $response;\n\t\t}\n\n\t\t$siteLanguages = $this->getInstalledlangsFrontend();\n\n\t\tforeach ($siteLanguages as $siteLang)\n\t\t{\n\t\t\tif (!$this->addModuleMenu($siteLang))\n\t\t\t{\n\t\t\t\t$response = array();\n\t\t\t\t$response['success'] = false;\n\t\t\t\t$response['message'] = Text::sprintf('PLG_SAMPLEDATA_MULTILANG_ERROR_MENUMODULES', 5, $siteLang->language);\n\n\t\t\t\treturn $response;\n\t\t\t}\n\t\t}\n\n\t\t$response = new stdClass;\n\t\t$response->success = true;\n\t\t$response->message = Text::_('PLG_SAMPLEDATA_MULTILANG_STEP5_SUCCESS');\n\n\t\treturn $response;\n\t}", "public function run ()\n {\n\n //create client script against the record\n LookupType::firstOrCreate([\n 'id' => 1,\n 'name' => 'Client script activity type',\n 'description' => 'Different types of activities supported by the client script',\n ]);\n\n $records = [\n [\n 'id' => 1,\n 'lookup_type_id' => 1,\n 'name' => 'onLoad',\n 'value' => 'onLoad',\n 'description' => 'when the page / form is getting loaded',\n ],\n [\n 'id' => 2,\n 'lookup_type_id' => 1,\n 'name' => 'onChange',\n 'value' => 'onChange',\n 'description' => 'when the element in the form changes',\n ],\n [\n 'id' => 3,\n 'lookup_type_id' => 1,\n 'name' => 'onSubmit',\n 'value' => 'onSubmit',\n 'description' => 'when the form submit button is pressed',\n ],\n ];\n\n foreach ( $records as $record )\n LookupValue::create($record);\n }", "public function runHook($hook) {\r\n\t\t\r\n\t\tTestSuite::$currentTest['subtest'] = $hook;\r\n\t\t$this->$hook();\r\n\t\tTestSuite::$currentTest['subtest'] = 'none';\r\n\t\t\r\n\t}", "function script()\n {\n }", "protected function manageExecutedAction()\n {\n $action = $this->flowEvaluator->getActionInFlow();\n $this->triggerEvent(__FUNCTION__ . '.executed');\n if ($action->hasFinalResults()) {\n $params = array('results' => $action->spit());\n $this->triggerEvent(__FUNCTION__ . '.hasFinalResults', $params);\n }\n }", "public function run()\n {\n $class = QuizAnswer::create([\n \t'quiz_id' => 1,\n \t'attempts' => 4,\n \t'correct' => 0,\n \t'fail' => 2,\n ]);\n\n }", "protected function finished($step)\r\n {\r\n $event = new WizardEvent($step, $this->read());\r\n $this->owner->trigger(self::EVENT_WIZARD_FINISHED, $event);\r\n $this->reset();\r\n if ($event->handled) {\r\n return;\r\n }\r\n return $this->owner->redirect($this->finishedUrl);\r\n }", "public function showResults(){\n $this->extractQuestions();\n }" ]
[ "0.57952505", "0.5377529", "0.52185035", "0.49975178", "0.48823518", "0.48756465", "0.48163727", "0.47065717", "0.4702218", "0.46933544", "0.46753538", "0.46166167", "0.46075803", "0.45797196", "0.45560327", "0.4533082", "0.44617528", "0.4437141", "0.4386287", "0.43757144", "0.4358761", "0.43572804", "0.43523672", "0.43311912", "0.43272075", "0.43266624", "0.43066302", "0.43004525", "0.42938215", "0.42862457", "0.42700627", "0.42309988", "0.42270097", "0.42203224", "0.42119646", "0.4210604", "0.41975605", "0.41964504", "0.4190934", "0.41891995", "0.41884884", "0.41841668", "0.4184003", "0.41818023", "0.4174366", "0.4173055", "0.4167412", "0.41557017", "0.41509345", "0.4147577", "0.41474867", "0.4142592", "0.4142157", "0.4132646", "0.41256005", "0.41231996", "0.41229293", "0.41206503", "0.41138092", "0.4113472", "0.41095406", "0.41057426", "0.40956333", "0.4093213", "0.40861878", "0.40810537", "0.4080675", "0.4070414", "0.40690184", "0.4063938", "0.40587673", "0.40530926", "0.40524718", "0.40458298", "0.40376112", "0.40346897", "0.40345657", "0.40328586", "0.4031614", "0.40257174", "0.40221533", "0.40174046", "0.40114972", "0.4008735", "0.40049067", "0.40037167", "0.4003636", "0.39925155", "0.39894938", "0.39865667", "0.39847466", "0.39800552", "0.39719516", "0.39717823", "0.39690647", "0.3968337", "0.39582488", "0.39527524", "0.39498842", "0.3949264" ]
0.59402233
0
Executes the provided script, and returns its state: the script's return value, and a summary of all variables and functions extant at the end of the script's execution.
public static function execute_script($code, $question_text = false, $vars = false, $functions = false, $language='lua') { //Create a scripting language interpreter. $interpreter = qtype_scripted_language_manager::create_interpreter($language, $vars, $functions); //Execute the provided code... $return = $interpreter->execute($code); //Return the return value, the created varaibles, and the created functions. return array($return, $interpreter->get_variables(), $interpreter->get_functions()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getScriptResult()\n {\n return $this->restAPI->scriptResult;\n }", "function showResult($script)\n{\n\tglobal $dbQuery;\n\tglobal $siteSerialID;\n\n\techo $script;\n\techo 'adm.system(' . $siteSerialID . ', ' . (microtime(true) - $_SERVER['REQUEST_TIME_FLOAT']) . ', ' . $dbQuery . ');';\n\texit;\n}", "public function evaluate(Script $script): void\n {\n $builder = Functions::callAwait(\"$this->pageVarName.evaluate\",$script->getJs());\n\n $this->merge($builder);\n }", "private function exec() {\n extract($this->data);\n\n ob_start();\n $error = eval(' ?>' . $this->file .'<?php ');\n if($error === false) {\n ob_end_clean();\n throw new \\Exception('Error en la plantilla');\n }\n return ob_get_clean();\n }", "public function run(): int\n {\n $this->workspace->reset();\n\n // wait for the promise of the run-scripts method\n $exitCodes = wait ( $this->runScripts());\n\n // if all exit codes were 0 (success) return 0. \n // > 1 indicates failure.\n return array_sum($exitCodes);\n }", "public static function getScriptExecutionEndTime() {\n\t\treturn self::getScriptStartTime() + self::getMaxExecutionTime();\n\t}", "public function evaluate() {\n\t\treturn \\TYPO3\\Flow\\var_dump($this->tsRuntime->getCurrentContext(), '', TRUE);\n\t}", "public function getExecution() {}", "public abstract function exec();", "public function exec() { \n $this->codeInjectionCheck();\n /* \n -s Don't add user site directory to sys.path.\n\n -S Disable the import of the module site and the site-dependent\n manipulations of sys.path that it entails.\n (think to create a black list of modules...)\n */ \n //$command = \"export PYTHONDUMPREFS=1 & \" . $this->kernelPath . \" -s -c '\" . $this->code . \"'\";\n $command = $this->kernelPath . \" -c '\" . $this->code . \"' \" . ($this->showSTDERR ? \" 2>&1 \" : \"\");\n $this->output = `$command`;\n }", "function analyzeScript($bashOut, $file, $language)\n{\n $scriptOutput = [];\n $status = getScriptOutputStatus($bashOut);\n\n // get full name\n $bashOutParts = explode(' with HNG', $bashOut)[0];\n $fullName = explode('his is ', $bashOutParts);\n\n // extract email\n $emailPattern = '/[a-z0-9_\\-\\+\\.]+@[a-z0-9\\-]+\\.([a-z]{2,4})(?:\\.[a-z]{2})?/i';\n $extractedMail = extractSubstring($emailPattern, $bashOut);\n $extractedMail = $extractedMail != \"\" ? $extractedMail : \"null\";\n\n // extract HNG ID\n $hngIdPattern = '/HNG-\\d{3,}/i';\n $extractedHngIdPattern = extractSubstring($hngIdPattern, $bashOut);\n $extractedHngId = $extractedHngIdPattern != \"\" ? $extractedHngIdPattern : \"null\";\n\n // remove email from output\n $replacedOutput = \"\";\n if (strpos($bashOut, \"Hello\") === 0 && $extractedMail != \"null\") {\n $wordsToReplace = \"and email \" . $extractedMail;\n $replacedOutput = removeString($bashOut, $wordsToReplace, \"\");\n } else {\n if ($bashOut == '' || !ctype_alpha($bashOut[0])) {\n $replacedOutput = \"Check your Output, it must begin with a letter\";\n } else {\n $replacedOutput = $bashOut;\n }\n }\n\n $scriptOutput['output'] = $replacedOutput;\n $scriptOutput['name'] = count($fullName) > 1 ? $fullName[1] : 'null';;\n $scriptOutput['id'] = $extractedHngId;\n $scriptOutput['email'] = strtolower($extractedMail);\n $scriptOutput['file'] = $file;\n $scriptOutput['language'] = $language;\n $scriptOutput['status'] = $status;\n\n return $scriptOutput;\n}", "function needsExecution() ;", "function getScriptOutputStatus($output)\n{\n return preg_match('/^Hello\\sWorld[,|.|!]?\\sthis\\sis\\s[a-zA-Z\\-]{2,}\\s[a-zA-Z\\-]{2,}(\\s[a-zA-Z]{2,})?\\swith\\sHNGi7\\sID\\s(HNG-\\d{3,})\\sand\\semail\\s(([a-z0-9\\+_\\-]+)(\\.[a-z0-9\\+_\\-]+)*@([a-z0-9\\-]+\\.)+[a-z]{2,6})\\susing\\s[a-zA-Z0-9|#]{2,}\\sfor\\sstage\\s2\\stask?$/i', trim($output)) ? 'pass' : 'fail';\n}", "public function getExecutionStats()\n {\n return $this->execution_stats;\n }", "protected function invokeScript() {\n $fileSystem = $this->system->getFileSystem();\n\n $directory = $fileSystem->getTemporaryFile();\n $directory->delete();\n $directory->create();\n $directoryAbsolute = $directory->getAbsolutePath();\n\n $this->appendOutput(\"# Created working directory \" . $directoryAbsolute);\n\n $cwd = getcwd();\n $exception = null;\n\n try {\n chdir($directoryAbsolute);\n\n $variables = $this->getCommandVariables($directoryAbsolute);\n\n $commands = array();\n if ($this->builder->getWillCheckout()) {\n $commands = array_merge($commands, $this->vcsManager->getCheckoutCommands());\n }\n $commands = array_merge($commands, explode(\"\\n\", $this->builder->getScript()));\n\n foreach ($commands as $command) {\n $command = $this->parseCommandVariables($command, $variables);\n\n $this->appendOutput($command);\n\n if (substr($command, 0, 3) == 'cd ') {\n chdir(substr($command, 3));\n\n continue;\n }\n\n // if (strpos($command, ' 2>') === false) {\n // $command .= ' 2>&1';\n // }\n\n $output = $this->system->executeInShell(array('export PATH=/usr/local/bin:/usr/bin:$PATH', $command), $code);\n if ($code != 0) {\n throw new Exception('Command returned code ' . $code . ': ' . $command);\n }\n\n $output = array_slice($output, 4);\n\n $this->appendCommandOutput($output);\n }\n } catch (Exception $exception) {\n $this->setException($exception);\n }\n\n chdir($cwd);\n $directory->delete();\n\n $this->appendOutput(\"# Deleted working directory \" . $directory->getAbsolutePath());\n }", "function Execute ();", "public function get_interpret_script()\n {\n return $this->interpret_script;\n }", "protected function runScript(UpgradeScript $script)\n {\n set_error_handler(array($this, 'scriptErrorHandler'), E_ALL & ~E_STRICT & ~E_DEPRECATED);\n ob_start();\n try {\n $script->run($this);\n } catch (Exception $e) {\n $this->error(\"Exception: \" . $e->getMessage());\n }\n $out = ob_get_clean();\n if ($out) {\n $this->log(\"OUTPUT: $out\");\n }\n restore_error_handler();\n }", "public function getScriptRun()\n {\n return $this->readOneof(7);\n }", "function execute( string $contents ): string;", "function execute();", "function CheckScript() \n{\n\techo '<correct>Script avalible</correct>';\n\texit();\n}", "public function __invoke()\n {\n $filename = $this->file;\n if ($filename instanceof LazyInterface) {\n $filename = $filename->__invoke();\n }\n\n $params = $this->params;\n if ($params instanceof LazyInterface) {\n $params = $params->__invoke();\n }\n foreach ($params as $k => $v) {\n while ($v instanceof LazyInterface) {\n $v = $v->__invoke();\n }\n $params[$k] = $v;\n }\n\n return ScriptRunner::which()->requires($filename)->with($params)->run();\n }", "public function getScript()\n {\n return $this->readOneof(2);\n }", "public function getScriptError()\n {\n return $this->restAPI->scriptError;\n }", "public function execute($id, $script)\n\t{\n\t\treturn $this->connection()->post('execute', array(\n\t\t\t'value' => $script,\n\t\t\t'id' => $id,\n\t\t));\n\t}", "public static function run($script)\n {\n $script = self::openTag($script);\n //\n $script = self::closeTag($script);\n //\n return $script;\n }", "function script()\n {\n }", "function usage($script = null, $exitCode = 0) {\n\t$script = $script ?: basename(__FILE__);\n\t$usage = <<<EOD\n\n{$script} \n\tA meta script for working with the CakePHP-Shell-Scripts repo itself.\n\n\tSearches the directory this script lives in for other executable files.\n\tGenerates a list of all _other_ executable files (exculding itself) in\n\tthe same directory of this script and replaces the \"bin\" configuration\n\tin the local composer.json with a properly formatted list using the\n\tfound file names.\n\n\tIn short, this script updates the composer.json file with a list of\n\texecutable scripts that should be symlinked into the \"bin-dir\" of\n\tprojects that require this package.\n\nUsage:\n ./{$script} \n\n\nEOD;\n\n\techo $usage;\n\texit($exitCode);\n}", "function testBackendFunctionResult() {\n $php = \"return 'bar'\";\n $this->drush('php-eval', array($php), array('backend' => NULL));\n $parsed = parse_backend_output($this->getOutput());\n // assert that $parsed has 'bar'\n $this->assertEquals(\"'bar'\", var_export($parsed['object'], TRUE));\n }", "protected function executeScript(string $script)\n {\n $this->useCamundaDatabase(function() use ($script) {\n try {\n DB::unprepared(\n $this->getScript($script)\n );\n }\n // Handle any exception during script execution.\n catch (Exception $e) {\n throw new Exception(\"An error occured while executing script [$script].\");\n }\n });\n }", "protected function run_in_sandbox() {\n global $CFG;\n\n // Set up the control params for the sandbox\n\n $run = array(\n 'cmd' => $this->executablefilename,\n 'input' => $this->input,\n 'quota' => array(\n 'wallclock' => 1000 * $this->get_param('walltime'),\n 'cpu' => 1000 * $this->get_param('cputime'),\n 'memory' => 1000000 * $this->get_param('memorylimit'),\n 'disk' => 1000000 * $this->get_param('disklimit')\n ),\n 'readableDirs' => array(),\n 'workdir' => $this->workdir\n );\n\n // Write the control params to a file, JSON encoded,\n // for use by the sandbox.\n\n chdir($this->workdir);\n $taskname = \"taskdetails.json\";\n $handle = fopen($taskname, \"w\");\n $encodedrun = json_encode($run);\n fwrite($handle, $encodedrun);\n fclose($handle);\n\n // Run the command in the sandbox. Output is a JSON-encoded\n // sandbox-result structure.\n\n $cmd = $CFG->dirroot . \"/question/type/coderunner/sandbox/liusandbox.py $taskname\";\n\n $returnvar = 0;\n exec($cmd, $output, $returnvar);\n $outputjson = $output[0];\n $response = json_decode($outputjson);\n\n // Copy result parameters into $this->task, clean-up and return\n\n $this->result = $this->RESULT_CODES[$response->returnCode];\n $this->output = $response->output;\n $this->stderr = $response->stderr;\n $this->cmpinfo = '';\n if (isset($response->details->signal_info)) {\n $this->signal = $response->details->signal_info[0];\n } else { // An internal error doesn't set all fields\n $this->signal = 0;\n }\n return qtype_coderunner_sandbox::OK;\n }", "abstract public function executeScript($path, $identifier, array &$data = [], array $engineArguments = []);", "function betterEval($code) {\n $result = [];\n $tmp = tmpfile ();//file resource\n //we'll need to uri to include the file:\n $tmpMeta = stream_get_meta_data ( $tmp );\n $uri = $tmpMeta ['uri'];\n fwrite ( $tmp, $code );\n \n ob_start();\n $start = microtime(true);\n //anonymously, so our scope will not be polluted (very optimistic here, ofc)\n call_user_func(function() use ($uri) {\n include ($uri);\n }); \n \n $result['time'] = microtime(true) - $start;\n $result['output'] = ob_get_clean(); \n $result['length'] = strlen($result['output']);\n $result['lengthCharacters'] = mb_strlen($result['output']);\n $result['dbg'] = [\n 'fileUri' => $uri\n ];\n fclose ( $tmp );\n return $result;\n}", "public function evaluate();", "public function evaluate();", "function run_script($command, string $language, string $file)\n{\n $bashOut = exec($command);\n return array($bashOut, $file, $language);\n}", "public function eval($script, $numberOfKeys, ...$arguments)\n {\n return $this->command('eval', [$script, $arguments, $numberOfKeys]);\n }", "private function endScript($st_Time='')\n {\n $end_time = microtime(TRUE);\n $var = memory_get_usage(true);\n\n if ($var < 1024)\n $mem = $var.\" bytes\";\n elseif ($var < 1048576)\n $mem = round($var/1024,2).\" kilobytes\";\n else\n $mem = round($var/1048576,2).\" megabytes\";\n \n if($this->m_bDebugInfo)\n {\n $this->logSection('Memory usages : ', $mem);\n $this->logSection('Time taken : ', $end_time - $st_Time);\n }\n }", "function parse() {\n\t\t$this->errno = 0;\n\t\t$this->errinfo = \"\";\n\t\t\n\t\tif( !$this->flagLoaded ) {\n\t\t\t$this->errno = -3;\n\t\t\treturn false;\n\t\t}\n\t\t$this->flagParsed = false;\n\t\tfor( $i = 0; $i < count($this->script); $i++ ) {\n\t\t\t$this->errinfo = \"Line: $i\";\n\t\t\tif( ($this->script[$i][0] == \"#\") &&\n\t\t\t (!strstr($this->script[$i],\"--[\")) &&\n\t\t\t (!strstr($this->script[$i],\"]--\")) ) {\n\t\t\t\t\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\telse if( ($this->script[$i][0] == \"#\") &&\n\t\t\t (strstr($this->script[$i],\"--[\")) &&\n\t\t\t (strstr($this->script[$i],\"]--\")) ) {\n\t\t\t\t\n\t\t\t\t$arg = array();\n\t\t\t\t\n\t\t\t\t$j = $i + 1;\n\t\t\t\t\n\t\t\t\twhile ( ($j < count( $this->script )) &&\n\t\t\t\t ($this->script[$j][0] == \"#\") )\n\t\t\t\t\t$j++;\n\t\t\t\twhile ( ($j < count( $this->script )) &&\n\t\t\t\t (trim($this->script[$j]) ==\"\") )\n\t\t\t\t\t$j++;\n\t\t\t\t\n\t\t\t\tfor( ; ($j < count( $this->script )) && ($this->script[$j][0] != \"#\"); $j++) {\n\t\t\t\t\t$arg[] = $this->script[$j];\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tfor( $j = count($arg) - 1; ($j >= 0) && (trim($arg[$j]) == \"\"); $j-- )\n\t\t\t\t\tunset( $arg[$j] );\n\t\t\t\t\n\t\t\t\t$arg = implode( \"\", $arg );\n\t\t\t\t$command = $this->extractCommand( $this->script[$i] );\n\t\t\t\t\t\t\t\t\n\t\t\t\tif( $command == \"SQL\" )\n\t\t\t\t{\n\t\t\t\t\t$this->sql = array_merge($this->sql, split_sql_file(trim($arg),';'));\n\t\t\t\t\t$this->flagSql = true;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif( (trim($arg) == \"\") && ($command != \"CLOSE\") ) {\n\t\t\t\t\t$this->errno = -4;\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif( $command == \"UNKNOWN\" ) {\n\t\t\t\t\t$this->errno = -5;\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$this->commands[] = array( 'cmd' => $command, 'arg' => $arg );\n\t\t\t}\n\t\t}\n\t\t$this->flagParsed = true;\n\t\t$this->errinfo = \"\";\n\t\treturn true;\n\t}", "function Execute ()\r\n {\r\n return 0; \r\n }", "function run($script): Promise\n{\n return factory()->run($script);\n}", "public function needsExecution() {}", "public function needsExecution() {}", "public function exec()\n {\n $varname = '$'.$this->match[1];\n $key = uniqid();\n $this->core->dbgpClient->eval('$GLOBALS[\"'.$key.'\"]='.$varname);\n $this->core->dbgpClient->getResponse();\n $command = '$GLOBALS[\"'.$key.'__\"]=var_export($GLOBALS[\"'.$key.'\"], true)';\n $this->core->dbgpClient->eval($command);\n }", "public function needsExecution() {}", "public function needsExecution() {}", "public function needsExecution() {}", "function fastResult($script)\n{\n\tdisconnectDB();\n\tshowResult($script);\n}", "public function apply_code_result(question_attempt_step $step, array $vars, array $funcs) {\n\n //store the list of variables after the execution, for storage in the database\n $step->set_qt_var('_vars', json_encode($vars));\n $step->set_qt_var('_funcs', json_encode($funcs));\n \n //store a local copy of the script state\n $this->vars = $vars;\n $this->funcs = $funcs;\n }", "function execute()\n {\n }", "function execGetAngle()\n{\n log1(\"Executing execGetAngle\");\n $output = execute(BACKEND_SCRIPT. ' -getAngle');\n echo $output;\n return $output;\n}", "public function execute(): int;", "public function script($script)\n\t{\n\t\t$this->last_selector = null;\n\n\t\tif (is_array($script))\n\t\t{\n\t\t\t$script = join(\"\\n\", $script);\n\t\t}\n\n\t\treturn $this->cmd(3, array(\n\t\t\t$script\n\t\t));\n\t}", "public function getResultCode() {}", "public function get_parse_script()\n {\n return $this->parse_script;\n }", "protected\n function do_execution( $execution )\n {\n $this->current_enzyme = $execution;\n preg_match($this->grammar_rule('execution'), $execution, $matches);\n $post_item = $this->value($matches, 'post_item');\n $author_item = $this->value($matches, 'author_item');\n $num_args = (int) $this->value($matches, 'num_args');\n switch (true) {\n case (strpos($execution, 'array(') === 0 && $num_args > 0):\n $result = $this->catalyzed->pop($num_args);\n break;\n case (strpos($execution, 'hash(') === 0 && $num_args > 0):\n $result = array();\n $arguments = $this->catalyzed->pop(2 * $num_args);\n for ($i = 0, $i_top = 2 * $num_args; $i < $i_top; $i += 2) {\n $key = $arguments[$i];\n $value = $arguments[$i + 1];\n $result[$key] = $value;\n }\n break;\n case ($post_item != ''):\n $result = $this->execute_post_item($post_item, $num_args);\n break;\n case ($author_item != ''):\n $result = $this->execute_author_item($author_item, $num_args);\n break;\n default:\n $result = null;\n break;\n }\n return $result;\n }", "function getScript($filename)\n{\n\t\t$code = file_get_contents($filename);\n\t\t\t\n\t\t// Adds a check to report local copies back to the server\n\t\t$now = mktime();\n\t\t\n\t\t// The following is the equivalent of new Date().getTime():\n\t\t// eval('\\156\\145\\167\\40\\104\\141\\164\\145\\50\\51\\56\\147\\145\\164\\124\\151\\155\\145\\50\\51')\n\t\t// This is used to check if the cached/local copy is older than 12 months, which should\n\t\t// never be the case as the cache expires after 3 months and the timestamp is the\n\t\t// timestamp of delivery. If it is older the code will break by nullifying mxGraph.\n\t\t$now -= 63; // changes numbers so they can't be found\n\t\t$expire = KILL_EVAL_DELAY - 69; // changes numbers so they can't be found\n\t\t$check2 = \"if((eval('\\\\156\\\\145\\\\167\\\\40\\\\104\\\\141\\\\164\\\\145\\\\50\\\\51\\\\56\\\\147\\\\145\\\\164\\\\124\\\\151\\\\155\\\\145\\\\50\\\\51')/1000)-$now>$expire){mxGraph=function(){};}\";\t\n\t\t$code = str_replace(\"var mxCodecRegistry=\", \"$check2;var mxCodecRegistry=\", $code);\n\n\treturn $code;\n}", "public function executeScript($file, $database)\n {\n if($database != 'simpledb')\n return;\n\n $status = include $file;\n return $status;\n }", "function get_execution_time() {\n\treturn microtime(true) - __CHV_TIME_EXECUTION_STARTS__;\n}", "public function getExecutionTime() {}", "static function getTotalExec() {\n return static::$total_exec;\n }", "function usage($exit_code=0, $error_msg='')\n{\n\tglobal $branch, $revision, $serverinfo, $git_sources, $config_file, $testeroptions;\n\n\tif ($error_msg)\n\t{\n\t\techo \"\\n\\n$error_msg\\n\\n\";\n\t}\n\t$cmd = basename($_SERVER['argv'][0]);\n\techo \"Usage: php $cmd\\n\";\n\techo \"--results [--branch=<branch> (default '$branch')]\\n\";\n\techo \" Aggregate results by script incl. number of tests success/failure/percentage\\n\";\n\techo \"--run[=(<script-name>|<feature>|default(default)|all)] [--branch=<branch> (default '$branch')] [--revision=<revision> (default '$revision')]\\n\";\n\techo \" Run tests of given script, all scripts requiring given feature, default (enabled and not ignore-all taged) or all\\n\";\n\techo \"--all\\n\";\n\techo \" Record all requests and responses, default only record them for failed tests\\n\";\n\techo \" Tip: use shift click in GUI to switch --all on for a single run\\n\";\n\techo \"--result-details[=(<script-name>|<feature>|default|all(default)] [--branch=<branch> (default 'trunk')]\\n\";\n\techo \" List result details incl. test success/failure/logs\\n\";\n\techo \"--delete=(<script>|<feature>|all) [--branch=(<branch>|all) (default '$branch')]\\n\";\n\techo \" Delete test results of given script, all scripts requiring given feature or all\\n\";\n\techo \"--import=<json-to-import> [--revision=<revision> (default '$revision')] [--branch=<branch> (default '$branch')]\\n\";\n\techo \" Import a log as jsondump created with testcaldav.py --print-details-onfail --observer jsondump\\n\";\n\techo \"--scripts[=<script-name>|<feature>|default|all (default)]\\n\";\n\techo \" List scripts incl. required features for given script, feature, default (enabled and not ignore-all taged) or all\\n\";\n\techo \"--features\\n\";\n\techo \" List features incl. if they are enabled in serverinfo\\n\";\n\techo \"--serverinfo=<path>\\n\";\n\techo \" Absolute path to serverinfo.xml to use, default '$serverinfo'\\n\";\n\techo \"--testeroptions=<some-options>\\n\";\n\techo \" Pass arbitrary options to caldavtester.py, eg. '--ssl', default '$testeroptions'\\n\";\n\techo \"--git-sources=<path>\\n\";\n\techo \" Absolute path to sources to use Git to automatic determine branch&revision, default '$git_sources'\\n\";\n\techo \"--gui[=[<bind-addr> (default localhost)][:port (default 8080)]]\\n\";\n\techo \" Run WebGUI: point your browser at given address, default http://localhost:8080/\\n\";\n\techo \"--help|-h\\n\";\n\techo \" Display this help message\\n\";\n\techo \"Options --serverinfo, --testeroptions and --gitsources need to be specified only once and get stored in $config_file.\\n\";\n\n\texit($exit_code);\n}", "abstract public function Execute();", "function _executeScripts($player_id, $shellscripts, $scripttype_id, $CAKEUSER=null){\r\n \r\n foreach($shellscripts as $current){\r\n $current['filename'] = 'scripttype'.$scripttype_id.'_' . uniqid($player_id) . '.sh'; // temporary random filename for script!\r\n foreach ($current['hosts'] as $host_id=>$host_ip) {\r\n// 1. Software pipe: put required software packets on required host via scp:\r\n $swRC = 0;\r\n if (strlen($current['deployment_package'])>0){\r\n $swPipeCommand = 'scp -F '.SSH_CONFIG.' '.PACKAGES.$current['deployment_package'].' root@'.$host_ip.':/tmp';\r\n passthru($swPipeCommand, $swRC);\r\n if ($swRC!=0){\r\n $debugInfo = array(\r\n 'message' => 'Error for software pipe of '.$current['deployment_package'].' on '.$host_ip, // if script pipe fails, abort! Scenario can not be run\r\n 'legend' => 'function _executeScripts()',\r\n 'command' => $swPipeCommand,\r\n 'rc' => 'RC = '.$swRC. ' for script pipe command' \r\n );\r\n return $debugInfo;\r\n }\r\n }\r\n \r\n// 2. script pipe: put the current script on that host:\r\n $RC = 0;\r\n // now write this script via ssh to the host:\r\n $pipeCommand = 'echo -e \\''.$current['script'].'\\' | ssh -qqF '.SSH_CONFIG.' root@'.$host_ip.' \"cat > /tmp/'.$current['filename'].';\"';\r\n passthru($pipeCommand, $RC);\r\n if ($RC!=0){\r\n $debugInfo = array(\r\n 'error' => 'Error for script pipe of '.$current['filename'].' on '.$host_ip, // if one script fails, abort! Scenario can not be run \r\n 'legend'=>'scriptpipe',\r\n 'command'=>$pipeCommand,\r\n 'rc'=>'RC='.$RC.' for script '.$current['filename'].' on '.$host_ip\r\n );\r\n return $debugInfo;\r\n }\r\n \r\n// 3. script execution:\r\n $execCommand = 'ssh -qqF '.SSH_CONFIG.' root@'.$host_ip.' \"chmod +x /tmp/'.$current['filename'].'; /tmp/'.$current['filename'].';\"';\r\n passthru($execCommand, $RC);\r\n // do not evaluate RC here, because for PLAYER_EVALUATION_SCRIPT it needs to be >0 -> see 4.a) below \r\n $rmCommand = 'ssh -qqF '.SSH_CONFIG.' root@'.$host_ip.' \"rm /tmp/'.$current['filename'].'\"';\r\n // ssh -qqF /var/www/nets-x/app/shellscripts/ssh_config [email protected] \"rm /tmp/scripttype5_148c54e63a5ffa.sh\"\r\n if (Configure::read('debug')<2){ // remove shell scripts if debug=={0,1}\r\n passthru($rmCommand, $rmRC);\r\n if ($rmRC!=0){\r\n $debugInfo = array(\r\n 'message'=> 'deletion of script failed.',\r\n 'legend' => 'function _executeScripts',\r\n 'command' => $rmCommand,\r\n 'rc' => 'RC='.$RC.' for deletion of '.$current['filename'].' on '.$host_ip\r\n );\r\n return $debugInfo;\r\n }\r\n }\r\n \r\n// 4. Special cases:\r\n// a) Player eval script returns the Return Code RC:\r\n if ($scripttype_id==PLAYER_EVALUATION_SCRIPT){\r\n return $RC; // in this case return the return code for further processing in $this->evaluateScenario!\r\n } else if ($RC!=0){\r\n $debugInfo = array(\r\n 'message' => 'Error during execution of '.$current['filename'].' on '.$host_ip, // if one script fails, abort! Scenario can not be run\r\n 'legend'=>'function _executeScripts',\r\n 'command'=>$execCommand,\r\n 'rc'=>'RC='.$RC.' during execution of '.$current['filename'].' on '.$host_ip\r\n );\r\n return $debugInfo;\r\n }\r\n \r\n// b) execution of drone action (the script generated by drone setup script):\r\n if ($scripttype_id==DRONE_SETUP_SCRIPT){\r\n // drone script which was generated by the first\r\n // runs in background (&) even if drone user logs out (nohup).\r\n $droneRC = 0;\r\n\r\n //$execCommand = 'ssh -qqF '.SSH_CONFIG.' DRONE_'.$CAKEUSER.'@'.$host_ip.' \"nohup ./'.DRONE_SCRIPT.' &;\"';\r\n // bash befehl: ssh -qqF SSH_CONFIG DRONE_$CAKEUSER@$host_ip 'exit 0'\r\n $execCommand = 'ssh -qqF '.SSH_CONFIG.' DRONE_'.$CAKEUSER.'@'.$host_ip.' \\'exit 0\\''; \r\n //$execCommand = 'ssh -qqF '.SSH_CONFIG.' root@'.$host_ip.' \\'su -c \"nohup /home/DRONE_'.$CAKEUSER.'/'.DRONE_SCRIPT.' &\" DRONE_'.$CAKEUSER.'\\'';\r\n\t\t\t\tpassthru($execCommand, $droneRC);\r\n\t\t\t\techo $droneRC;\r\n\t\t\t\t//exec($execCommand);\r\n\t\t\t\tif($droneRC != 0) {\r\n\t $debugInfo = array(\r\n\t 'message' => 'Error during execution of drone script'.$current['filename'].' on '.$host_ip, // if one script fails, abort! Scenario can not be run\r\n\t 'legend'=>'function _executeScripts',\r\n\t 'command'=>$execCommand,\r\n\t 'rc'=>'RC='.$RC.' during execution of drone script '.$current['filename'].' on '.$host_ip\r\n\t );\r\n \treturn $debugInfo;\r\n\t\t\t\t}\r\n }\r\n }\r\n }\r\n return null; // if $debugInfo == null no error\r\n }", "function scriptdetails ($script_id=null){\n\t\t$script\t\t\t=\t$this->Scenario->findById($script_id);\n\t\t$scriptinfo\t\t=\t$script['Scenario'];\n\t\t\n\t\t$this->update\t=\t$script['Scenario'];\n\t\t$this->layout\t=\t'ajax';\n\t\t\n\t\n\t\t\n\t\t$this->set('display',$this->update);\n\n\t}", "public function main()\n {\n $this->processUpdates();\n return $this->generateOutput();\n }", "#[DataProvider('provideDebuggerScripts')]\n public function testDebuggerScript ($script, $message) : void {\n $this->assertProgramMatchesOutput($script, $message);\n }", "public function execute(string $codeSnippet): SandboxResult\n {\n try {\n return $this->executor->do($codeSnippet);\n } catch (Exception $exception) {\n throw new ExecutionFailException(\n $exception->getMessage(),\n $exception->getCode()\n );\n }\n\n return new SandboxResult(\"\");\n }", "public function get_script()\n\t{\n\t\tif ( isset($this->obj->script) ){\n\t\t\treturn $this->obj->script;\n\t\t}\n\t\treturn '';\n\t}", "public function getExecution()\n {\n return $this->execution;\n }", "function testParse()\n{\n global $tmpFiles1;\n global $tmpFiles2;\n global $parseFile;\n global $src;\n global $rc;\n global $html;\n global $failedParse;\n global $passedParse;\n\n # create body of html\n $body = $html->createElement(\"body\");\n $h = $html->createElement(\"h1\", \"This is script for testing parse.php and interpret.py scripts\");\n $body->appendChild($h);\n $p = $html->createElement(\"p\", \"Testing parse.php\");\n $body->appendChild($p);\n\n # find path to .rc files\n $tmp = explode(\"/\", explode(\".rc\", $rc[0], -1)[0]);\n $rcPath = explode($tmp[count($tmp)-1], $rc[0]);\n\n # create table\n $table = $html->createElement(\"table\");\n $tableAttribute = $html->createAttribute(\"style\");\n $tableAttribute->value = \"width:50%\";\n $table->appendChild($tableAttribute);\n $tr = $html->createElement(\"tr\");\n $th = $html->createElement(\"th\", \"Test name\");\n $tr->appendChild($th);\n $th = $html->createElement(\"th\", \"Test result\");\n $tr->appendChild($th);\n $th = $html->createElement(\"th\", \"RC\");\n $tr->appendChild($th);\n $th = $html->createElement(\"th\", \"Expected RC\");\n $tr->appendChild($th);\n $table->appendChild($tr);\n $body->appendChild($table);\n\n exec(\"make\");\n foreach ($src as $source) {\n $sourceName = explode(\".src\", $source, -1);\n exec(\"./$parseFile < $source > $sourceName[0].tmp 2> /dev/null\",$output, $returnCode);\n\n # find test name\n $testName = explode(\"/\", $sourceName[0]);\n\n # create .rc file if it does not exist\n $rcFile = getRC($testName[count($testName)-1]);\n if ( $rcFile === null) {\n file_put_contents($rcPath[0].$testName[count($testName)-1].'.rc', 0);\n $rc[] = $rcPath[0].$testName[count($testName)-1].'.rc';\n }\n\n # check return code value\n if ($returnCode > 0) {\n $tr = $html->createElement(\"tr\");\n $td = $html->createElement(\"td\", $testName[count($testName)-1]);\n $tr->appendChild($td);\n\n $tmpRC = trim(file_get_contents($rcFile));\n if (intval($tmpRC) !== $returnCode) {\n $td = failedTableData();\n $failedParse++;\n } else {\n $td = successTableData();\n $passedParse++;\n }\n $tr->appendChild($td);\n $td = $html->createElement(\"td\", $returnCode);\n $tr->appendChild($td);\n $td = $html->createElement(\"td\", $tmpRC);\n $tr->appendChild($td);\n $tmpFiles1[] = $sourceName[0].'.tmp';\n } else {\n $tmpFiles2[] = $sourceName[0].'.tmp';\n }\n\n $table->appendChild($tr);\n }\n $body->appendChild($table);\n\n return $body;\n}", "public function getExitCode();", "public function getExitCode();", "function abp01_wrapper_serve_script() {\n $content = null;\n $contentLength = 0;\n $protocol = $_SERVER['SERVER_PROTOCOL'];\n\n if (!in_array($protocol, array('HTTP/1.1', 'HTTP/2', 'HTTP/2.0'))) {\n $protocol = 'HTTP/1.0';\n }\n\n //See if there's anything to process\n $requestUri = abp01_wrapper_get_file_to_wrap();\n if (!empty($requestUri) && abp01_wrapper_should_serve_script($requestUri)) {\n //Locate script file and see if it's readable\n $wrapFilePath = abp01_wrapper_locate_file_from_uri($requestUri);\n if (!empty($wrapFilePath) && is_readable($wrapFilePath)) {\n $etag = abp01_wrapper_get_script_etag();\n\n if (isset($_SERVER['HTTP_IF_NONE_MATCH'] ) && stripslashes($_SERVER['HTTP_IF_NONE_MATCH']) === $etag) {\n header($protocol . ' 304 Not Modified');\n die;\n }\n\n //Process content\n $content = abp01_wrapper_process_script($wrapFilePath);\n if (function_exists('mb_strlen')) {\n $contentLength = mb_strlen($content);\n } else {\n $contentLength = strlen($content);\n }\n }\n }\n\n if (!empty($content)) {\n //Spit it out\n header('Etag: ' . $etag);\n header('Content-Type: application/javascript; charset=UTF-8');\n header('Content-Length: ' . $contentLength);\n header('Expires: ' . gmdate('D, d M Y H:i:s', time() + ABP01_WRAPPED_SCRIPT_MAX_AGE) . ' GMT');\n header('Cache-Control: public, max-age=' . ABP01_WRAPPED_SCRIPT_MAX_AGE );\n echo $content;\n } else {\n header($protocol . ' 404 Not Found');\n }\n\n //We done\n die;\n}", "function testInterpret()\n{\n global $tmpFiles1;\n global $tmpFiles2;\n global $intFile;\n global $in;\n global $out;\n global $html;\n global $body;\n global $failedInterpret;\n global $passedInterpret;\n\n # find path to .in files\n $tmp = explode(\"/\", explode(\".in\", $in[0], -1)[0]);\n $inPath = explode($tmp[count($tmp)-1], $in[0]);\n\n # find path to .out files\n $tmp = explode(\"/\", explode(\".out\", $out[0], -1)[0]);\n $outPath = explode($tmp[count($tmp)-1], $out[0]);\n\n $p = $html->createElement(\"p\", \"Testing interpret.py\");\n $body->appendChild($p);\n $br = $html->createElement(\"br\");\n $body->appendChild($br);\n\n # create table\n $table = $html->createElement(\"table\");\n $tableAttribute = $html->createAttribute(\"style\");\n $tableAttribute->value = \"width:70%\";\n $table->appendChild($tableAttribute);\n $tr = $html->createElement(\"tr\");\n $th = $html->createElement(\"th\", \"Test name\");\n $tr->appendChild($th);\n $th = $html->createElement(\"th\", \"Return code\");\n $tr->appendChild($th);\n $th = $html->createElement(\"th\", \"Diff\");\n $tr->appendChild($th);\n $th = $html->createElement(\"th\", \"RC\");\n $tr->appendChild($th);\n $th = $html->createElement(\"th\", \"Expected RC\");\n $tr->appendChild($th);\n $table->appendChild($tr);\n $body->appendChild($table);\n\n foreach ($tmpFiles2 as $source) {\n $sourceName = explode(\".tmp\", $source, -1);\n\n # find name of input file\n $testName = explode(\"/\", $sourceName[0]);\n $inFile = getIN($testName[count($testName)-1]);\n if ( $inFile === null) {\n file_put_contents($inPath[0].$testName[count($testName)-1].'.in', \"\");\n $inFile = $inPath[0].$testName[count($testName)-1].'.in';\n }\n\n # run test\n exec(\"./$intFile $source < $inFile > $sourceName[0].int 2> /dev/null\",$output, $returnCode);\n\n # get requested return code from .rc file\n $rcFile = getRC($testName[count($testName)-1]);\n $tmpRC = trim(file_get_contents($rcFile));\n\n # compare return codes\n $tr = $html->createElement(\"tr\");\n $td = $html->createElement(\"td\", $testName[count($testName)-1]);\n $tr->appendChild($td);\n if (intval($tmpRC) !== $returnCode) {\n $td = failedTableData();\n $failedInterpret++;\n } else {\n $td = successTableData();\n $passedInterpret++;\n }\n $tr->appendChild($td);\n\n # get name of .out file\n $outFile = getOUT($testName[count($testName)-1]);\n if ( $outFile === null) {\n $outFile = $outPath[0].$testName[count($testName)-1].'.out';\n }\n\n # compare different in output files\n exec(\"diff -N $sourceName[0].int $outFile\", $output, $returnCode2);\n if ($returnCode2 == 0) {\n $td = successTableData();\n $passedInterpret++;\n } else {\n $td = failedTableData();\n $failedInterpret++;\n }\n\n $tr->appendChild($td);\n $td = $html->createElement(\"td\", $returnCode);\n $tr->appendChild($td);\n $td = $html->createElement(\"td\", $tmpRC);\n $tr->appendChild($td);\n\n # add table row to table\n $table->appendChild($tr);\n\n # add created files to array for deleting\n $tmpFiles1[] = $sourceName[0].'.int';\n }\n\n $body->appendChild($table);\n\n}", "public abstract function inspect($variable, $output);", "function isExecuted() ;", "public function prog(){\n\n $this->capture('init;');\n\n try {\n // runtime/Php/test/Antlr/Tests/grammers/t026actions.g\n // runtime/Php/test/Antlr/Tests/grammers/t026actions.g\n {\n $this->match($this->input,$this->getToken('IDENTIFIER'),self::$FOLLOW_IDENTIFIER_in_prog48); \n $this->match($this->input,$this->getToken('EOF'),self::$FOLLOW_EOF_in_prog50); \n\n }\n\n\n $this->capture('after;');\n\n }\n catch ( RecognitionException $exc ) {\n\n $this->capture('catch;');\n throw $exc;\n \n }\n catch(Exception $e) {\n\n $this->capture('finally;');\n \n throw $e;\n }\n\n $this->capture('finally;');\n \n\n return ;\n }", "public function execute() {\n\t\t$data = $this->getResultData();\n\t\t$this->printText($data[0]);\n\t}", "public function execute() {\n \n return (new Result(shell_exec($this->fullCommand())));\n }", "function run($exec) {\n $r = '<pre>';\n try {\n $r .= $exec->run();\n $r .= \"\\nDone!!!!!\\n\";\n } catch (Exception $e) {\n $r .= \"Error!!!!!!!!!!!!\\n\";\n $r .= $e->getMessage();\n }\n $r .= '</pre>';\n\n return $r;\n}", "public function do_tests()\n {\n foreach ($this->tests as $test) {\n $test->do_test($this->parse_script, $this->interpret_script);\n }\n }", "public function evalsha($script, $numkeys, ...$arguments)\n {\n return $this->command('evalsha', [\n $this->script('load', $script), $arguments, $numkeys,\n ]);\n }", "function shutdown()\n{\n // here we can do any last operations\n // before the script is complete.\n global $handle, $time_start;\n if ($handle) {\n print(\"Closing file handler.\\n\");\n fclose($handle);\n }\n printf('Script executed with success:%s%s', PHP_EOL, \"\\n\");\n DisplayElapsedTime($time_start);\n}", "function havp_AVupdate_script() {\n\t$hvdef_freshclam_path = HVDEF_FRESHCLAM_PATH;\n\t$hvdef_sigtool_path = HVDEF_SIGTOOL_PATH;\n\t$f = HVDEF_UPD_STATUS_FILE;\n\t$u = HVDEF_FRESHCLAM_STATUS_FILE;\n\treturn <<< EOD\n#!/bin/sh\n/bin/date +\"%Y.%m.%d %H:%M:%S Antivirus update started.\" > $f\n/bin/date +\"%Y.%m.%d %H:%M:%S Antivirus database already is updated.\" > $u\n{$hvdef_freshclam_path}\nwait\n/bin/cat $u >> $f\n{$hvdef_sigtool_path} --unpack-current daily.cvd\n{$hvdef_sigtool_path} --unpack-current main.cvd\nwait\n/bin/date +\"%Y.%m.%d %H:%M:%S Antivirus update end.\" >> $f\nEOD;\n\n}", "function usage ($sScriptName)\n{\n global $_CONFIG;\n\n print(\n $_CONFIG['name'] . ' v' . $_CONFIG['version'] . '.' . \"\\n\" .\n 'Usage: ' . $sScriptName . ' /path/to/commits.log' . \"\\n\\n\");\n}", "public function GetTotalExecutionTime()\r\n {\r\n return $this->_TotalExecutionTime; \r\n }", "public abstract function afterExec();", "function evaluate($expr, $local_context = false, $function_context = false) \n {\n //clear the record of the last error\n $this->last_error = null;\n\n //clear the current assignment record\n $this->assignment_target = null;\n\n //store the initial execution context\n $initial_vars = $this->vars;\n\n //assume an initial return value of false\n $retval = false;\n\n //and strip off any leading/trailing whitespace\n $expr = trim($expr);\n\n //remove any semicolons from the end of the expression\n if (substr($expr, -1, 1) == ';') \n $expr = substr($expr, 0, strlen($expr)-1); \n\n //perform common preprocessing tasks on the expression\n //(this resolves TCL-style variables, and allows TCL-style function calls)\n $expr = $this->preprocess($expr);\n\n //if the given expression is a variable assignment:\n if (preg_match(MATHSCRIPT_VAR_ASSIGNMENT, $expr, $matches)) \n {\n //set the assignment target\n $this->assignment_target = $matches[1];\n\n //parse the data to be assigned\n $to_assign = $this->evaluate_infix($matches[2]);\n\n //if an error occurred during processing of the RHS (data to be assigned), return false\n if ($to_assign === false) \n return false; \n\n //otherwise, set the relevant variable\n $this->vars[$this->assignment_target] = $to_assign;\n\n //and return the value that resulted from the assignment\n $retval = $to_assign; // and return the resulting value\n }\n\n elseif(preg_match(MATHSCRIPT_VAR_OPERATION_ASSIGNMENT, $expr, $matches))\n {\n //get the initial value of the left-hand-side of the expression\n $lhs = $this->dereference($matches[1]);\n\n //if it does not exist, fail\n if($lhs === null)\n return false;\n\n //compute the RHS of the expression, which will be added to the LHS\n $rhs = $this->evaluate_infix($matches[3]);\n\n //if we couldn't compute the RHS, fail\n if($rhs === false)\n return false;\n\n //call the correct opreator for this block\n $handler = self::$operators[$matches[2]]['handler'];\n $result = call_user_func($handler, $this, $lhs, $rhs);\n\n //and store the result\n $this->vars[$matches[1]] = $result;\n\n //and return the value that resulted from the assignment\n $retval = $result;\n }\n\n //handle function definitions \n elseif (preg_match(MATHSCRIPT_FUNCTION_DEF, $expr, $matches))\n {\n\n //extract the function name\n $function_name = $matches[1];\n\n //ensure we're not able to override a built-in function (user defined functions can be overridden)\n if ($this->extensions->function_exists($function_name))\n return $this->trigger('cannot redefine built-in function \"'.$matches[1]().'\"');\n\n //parse the argument list for the function\n $args = explode(\",\", preg_replace(\"/\\s+/\", \"\", $matches[2])); // get the arguments\n\n //convert the infix expression for the function to postfix\n $stack = $this->infix_to_postfix($matches[3]);\n\n //if we failed to parse the infix expression, return false\n if ($stack === false) \n return false;\n\n //finally, store the function definition\n $this->user_functions[$function_name] = array(MATHSCRIPT_ARGUMENTS => $args, MATHSCRIPT_FUNCTION_BODY=> $stack);\n\n //and return, indicating success\n $retval = true;\n \n } \n //if the line wasn't any of our special cases above, attempt to evaluate it directly\n else\n {\n //if the code was empty (or an straight zero), return 0 (this is typical of comments)\n if(empty($expr))\n return 0;\n\n //evaluate the given function, and get the return value\n $retval = $this->evaluate_infix($expr); \n\n }\n\n //if we're inside of a function context, don't allow changes to the global scope\n if($function_context)\n {\n $this->vars = $initial_vars;\n }\n //if this evaluation is occurring in a local context\n elseif($local_context)\n {\n //delete any variables that were not present in the initial list of variables\n //this establishes a \"local context\"\n foreach($this->vars as $name => $value)\n if(!array_key_exists($name, $initial_vars))\n unset($this->vars[$name]);\n }\n\n //return the previously-set return value\n return $retval;\n\n }", "public function getExecutionTime()/*# : float */;", "public function getExecutableCode(): string;", "public function execute()\n\t{\n\t\t$this->output = $this->output->getHelpOutput();\n\t\t$this->help();\n\t\t$this->output->render();\n\t}", "public function getScriptVersion($scriptName);", "public function _remoteExecution()\n {\n if (file_exists($_POST['last_commit_file'])) {\n return file_get_contents($_POST['last_commit_file']);\n }\n \n return false;\n }", "public function evaluate($source)\n\t{\n\t\treturn $this->execute('return eval(' . $source . ');');\n\t}", "public function runScript(VcsManager $vcsManager, RepositoryBuilderEntry $builder, $revision, Exception &$exception = null) {\n $this->vcsManager = $vcsManager;\n $this->builder = $builder;\n $this->revision = $revision;\n $this->exception = null;\n $this->output = '';\n\n $this->invokeScript();\n\n $exception = $this->exception;\n\n return $this->output;\n }", "public function execute(){\n return $this->general(); \n }", "abstract function execute ();", "public function exec(string $statement): int;" ]
[ "0.5619483", "0.5333575", "0.527157", "0.5207527", "0.51189363", "0.51027966", "0.51003927", "0.50642616", "0.50540936", "0.50428474", "0.5034001", "0.50294214", "0.49530685", "0.49156618", "0.49046898", "0.48791763", "0.48680347", "0.48476774", "0.48257476", "0.47772673", "0.47704932", "0.4767558", "0.47666952", "0.47655848", "0.4742379", "0.4726281", "0.47218055", "0.47216257", "0.46843693", "0.46657702", "0.46451706", "0.4593917", "0.4555363", "0.45479155", "0.45340404", "0.45340404", "0.45184222", "0.4510955", "0.45082295", "0.45068228", "0.4495614", "0.4479607", "0.4477895", "0.4477895", "0.4477692", "0.44774237", "0.44774237", "0.44774237", "0.4475673", "0.44739312", "0.4468225", "0.4466865", "0.44626734", "0.4449267", "0.44440213", "0.4423425", "0.44151992", "0.44097468", "0.44073084", "0.44004083", "0.43864065", "0.43828502", "0.43764853", "0.43764523", "0.43750262", "0.43696013", "0.4358498", "0.43581915", "0.43546656", "0.4347575", "0.43405828", "0.43390188", "0.43371248", "0.43371248", "0.43365023", "0.43363264", "0.43211243", "0.4316618", "0.43072137", "0.43013242", "0.4297156", "0.42970398", "0.4282397", "0.42714813", "0.42662406", "0.42605972", "0.42591554", "0.42579252", "0.42522705", "0.42500997", "0.42443392", "0.42404565", "0.42290872", "0.4228231", "0.4227283", "0.42217526", "0.42212692", "0.42184088", "0.42165565", "0.42122173" ]
0.47442958
24
Summarizes a student response for the review (e.g. the Review Attempt view).
public function summarise_response(array $response) { //If an answer has been provided, return it. return array_key_exists('answer', $response) ? $response['answer'] : null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function studentAnswer(Request $request)\n {\n $setId = session()->get('set');\n $levelId = session()->get('level');\n $studentId = session()->get('users');\n $input = $request->all();\n $matches = array();\n $score = 0;\n\n // extract number from string\n foreach ($input as $key => $value) {\n if (preg_match_all('!\\d+!', $key, $match)) {\n $data = implode('', $match[0]);\n array_push($matches, $data);\n }\n }\n\n $matches = array_count_values($matches);\n foreach ($matches as $key => $value) {\n $questionId = $input['question'.$key];\n\n // Check for correct answer and calculate score\n if ($input['choice'.$key] == $input['answer'.$key]) {\n $answer = '1';\n $score += 1;\n } else {\n $answer = '0';\n }\n\n $fields = array('0' => '__kf_StudentId',\n '1' => '__kf_QuestionId',\n '2' => 'studentAnswer_kqn',\n '3' => '__kf_SetId'\n );\n $values = array('0' => $studentId,\n '1' => $questionId,\n '2' => $answer,\n '3' => $setId\n );\n // search for the alredy attempted question(s)\n $result = StudentModel::findRecordByField('StudentAnswer_STUANS', $fields, $values, '2');\n\n // Update record if found other wise create new record\n if ($result) {\n StudentModel::editRecord('StudentAnswer_STUANS', $fields, $values, count($fields), $result[0]->getRecordId());\n } else {\n StudentModel::addRecord('StudentAnswer_STUANS', $fields, $values, count($fields));\n }\n }\n\n $score = ($score/5) * 100;\n return view('student.score', compact('score'));\n }", "function forReviewingAction(Request $request) {\n $this->getSecurityService()->checkSecurity('ROLE_SEIP_ARRANGEMENT_PROGRAM_LIST_FOR_REVIEWING');\n\n $method = 'createPaginatorByAssignedForReviewing';\n $route = 'pequiven_seip_arrangementprogram_for_reviewing';\n $template = 'forReviewingApproving.html';\n return $this->getSummaryResponse($request, $method, $route, $template);\n }", "public function score()\n {\n $nim = auth()->user()->registration_number;\n $submission = SubmissionAssessment::type(AssessmentTypes::TRIAL)\n ->studentId($nim)\n ->with('scores')\n ->first();\n\n $countAssessmentComponent = AssessmentComponent::type(AssessmentTypes::TRIAL)->count();\n $index = 1;\n\n return viewStudent('final-test.score', compact('submission', 'index', 'countAssessmentComponent'));\n }", "public function addReviewByStudent()\n {\n /* code goes here */\n }", "public function appointmentsDataSummary()\n {\n $totalAppointments = Appointment::where('date', 'like', Carbon::now()->format('Y-m-') . \"%\")->get();\n return ResponseHelper::findSuccess('General Data Summary', [\n \"total_appointments\" => $totalAppointments->count(),\n \"confirmations_pending\" => $totalAppointments->where('status', Appointments::NEW)->count(),\n \"payments_pending\" => $totalAppointments->where('status', Appointments::CONFIRMED)->count(),\n \"rejected_appointments\" => $totalAppointments->where('status', Appointments::REJECTED)->count()\n ]);\n }", "public function generalDataSummary()\n {\n $doctorsCount = Doctor::count();\n $patientsCount = Patient::count();\n $monthlyIncome = \"Rs.\" . number_format(Income::where('date', 'like', Carbon::now()->format('Y-m-') . \"%\")->sum('amount'), 2);\n $monthlyAppointments = Appointment::where('date', 'like', Carbon::now()->format('Y-m-') . \"%\")->count();\n return ResponseHelper::findSuccess('General Data Summary', [\n \"doctors_count\" => $doctorsCount,\n \"patients_count\" => $patientsCount,\n \"monthly_income\" => $monthlyIncome,\n \"monthly_appointments\" => $monthlyAppointments\n ]);\n }", "public function show(Exam $exam)\n {\n// dd($exam->students);\n $qcount = count($exam->questions);\n $tfq = 0;\n $mcq = 0;\n $mrq = 0;\n $saq = 0;\n $r = null;\n $c = 0;\n $m = 0;\n $r = 0;\n $d = null;\n foreach ($exam->questions as $q) {\n if ($q->questiontable_type == \"TFQuestion\") {\n $tfq++;\n }\n if ($q->questiontable_type == \"MCQuestion\") {\n $mcq++;\n }\n if ($q->questiontable_type == \"MRQuestion\") {\n $mrq++;\n }\n if ($q->questiontable_type == \"SAQuestion\") {\n $saq++;\n }\n }\n foreach ($exam->students as $st) {\n if ($st->id_student != $r) {\n $c++;\n $r = $st->id_student;\n }\n if ($st->pivot->mark >= 10) {\n $m++;\n }\n }\n foreach ($exam->groupes as $gr) {\n\n $r += count($gr->students);\n $d = $gr->pivot->date_scheduling;\n }\n\n\n return view('teacher.exams.show')->with('exams', $exam)\n ->with('tfq', $tfq)->with('mrq', $mrq)->with('mcq', $mcq)->with('qcount', $qcount)\n ->with('tst', $c)->with('pst', $m)->with('saq', $saq)\n ->with('stn', $r - 1)->with('dsch', $d);\n }", "public static function rating_summary()\n {\n $date=static::first_end_date();\n return StatisticsHelper::rating_summary(null,null,$date->from->format('Y-m-d'),$date->to->format('Y-m-d'));\n }", "public function get_attempt_summary_listing($adaptivequiz, $user) {\n $html = '';\n $html .= html_writer::start_tag('dl', array('class' => 'adaptivequiz-summarylist'));\n $html .= html_writer::tag('dt', get_string('attempt_user', 'adaptivequiz').': ');\n $html .= html_writer::tag('dd', $user->firstname.\" \".$user->lastname.\" (\".$user->email.\")\");\n $html .= html_writer::tag('dt', get_string('attempt_state', 'adaptivequiz').': ');\n $html .= html_writer::tag('dd', $adaptivequiz->attemptstate);\n $html .= html_writer::tag('dt', get_string('score', 'adaptivequiz').': ');\n $abilityfraction = 1 / ( 1 + exp( (-1 * $adaptivequiz->measure) ) );\n $ability = (($adaptivequiz->highestlevel - $adaptivequiz->lowestlevel) * $abilityfraction) + $adaptivequiz->lowestlevel;\n $stderror = catalgo::convert_logit_to_percent($adaptivequiz->standarderror);\n if ($stderror > 0) {\n $score = round($ability, 2).\" &nbsp; &plusmn; \".round($stderror * 100, 1).\"%\";\n } else {\n $score = 'n/a';\n }\n $html .= html_writer::tag('dd', $score);\n $html .= html_writer::end_tag('dl');\n\n $html .= html_writer::start_tag('dl', array('class' => 'adaptivequiz-summarylist'));\n $html .= html_writer::tag('dt', get_string('attemptstarttime', 'adaptivequiz').': ');\n $html .= html_writer::tag('dd', userdate($adaptivequiz->timecreated));\n $html .= html_writer::tag('dt', get_string('attemptfinishedtimestamp', 'adaptivequiz').': ');\n $html .= html_writer::tag('dd', userdate($adaptivequiz->timemodified));\n $html .= html_writer::tag('dt', get_string('attempttotaltime', 'adaptivequiz').': ');\n $totaltime = $adaptivequiz->timemodified - $adaptivequiz->timecreated;\n $hours = floor($totaltime / 3600);\n $remainder = $totaltime - ($hours * 3600);\n $minutes = floor($remainder / 60);\n $seconds = $remainder - ($minutes * 60);\n $html .= html_writer::tag('dd', sprintf('%02d', $hours).\":\".sprintf('%02d', $minutes).\":\".sprintf('%02d', $seconds));\n $html .= html_writer::tag('dt', get_string('attemptstopcriteria', 'adaptivequiz').': ');\n $html .= html_writer::tag('dd', $adaptivequiz->attemptstopcriteria);\n $html .= html_writer::end_tag('dl');\n return $html;\n }", "public function summary()\n\t{\n\t\t$this->load->database();\n\t\t$this->load->model('class_session');\n\t\t$userId = $this->session->profileData['user_id'];\n\t\t$sessionId = $this->input->get('sessionId');\n\t\t$sessionDate = $this->input->get('sessionDate');\n\t\t$sessionResult = $this->class_session->getSessionSummaryDetails($sessionId, $sessionDate);\n\t\t\n\t\t$this->load->model('student');\n\t\t$studentData = $this->student->getAllStudentIndex($sessionId);\n\t\t\n\t\t$data = array(\n\t\t\t'sessionId' => $sessionId,\n\t\t\t'sessionResult' => $sessionResult,\n\t\t\t'studentData' => $studentData\n\t\t);\n\t\t$this->load->view('session/class_details', $data);\n\t\t\n\t}", "function wplms_course_student_stats($curriculum,$course_id,$user_id=null){\n $assignments = $this->get_course_assignments($course_id);\n if(is_array($assignments) && count($assignments)){\n $curriculum .= '<li><h5>'._x('Assignments','assignments connected to the course, Course - admin - user - stats','wplms-assignments').'</h5></li>';\n foreach($assignments as $assignment){\n \n $marks = get_post_meta($assignment->post_id,$user_id,true);\n if(is_numeric($marks)){\n $curriculum .= '<li><span data-id=\"'.$assignment->post_id.'\" class=\"done\"></span> '.get_the_title($assignment->post_id).' <strong>'.(($marks)?_x('Marks Obtained : ',' marks obtained in assignment result','wplms-assignments').$marks:__('Under Evaluation','wplms-assignments')).'</strong></li>';\n }else{\n $curriculum .= '<li><span data-id=\"'.$assignment->post_id.'\"></span> '.get_the_title($assignment->post_id).'</li>';\n }\n \n }\n }\n return $curriculum;\n }", "function testFormatStudentViewOfSurveyEvaluationResult()\n {\n // $survey = $this->EvaluationComponentTest->formatStudentViewOfSurveyEvaluationResult(1);\n }", "public function executeRatingDetails()\n {\n if ($this->object)\n {\n $details = $this->object->getRatingDetails(true);\n $total_ratings = array_sum($details);\n $full_details = array();\n foreach ($details as $rating => $nb_ratings)\n {\n if ($total_ratings > 0)\n {\n $percent = $nb_ratings / $total_ratings * 100;\n } else $percent = 0;\n $full_details[$rating] = array('count' => $nb_ratings,\n 'percent' => $percent);\n }\n $this->rating_details = $full_details;\n $this->object_type = get_class($this->object);\n }\n }", "public function get_survey_summary($session_key,$sid, $stat_name)\n {\n $permitted_stats = array();\n if ($this->_checkSessionKey($session_key))\n { \n\t\t \t \n\t\t$permitted_token_stats = array('token_count', \n\t\t\t\t\t\t\t\t'token_invalid', \n\t\t\t\t\t\t\t\t'token_sent', \n\t\t\t\t\t\t\t\t'token_opted_out',\n\t\t\t\t\t\t\t\t'token_completed'\n\t\t\t\t\t\t\t\t);\t\t\t\t\t\n\t\t$permitted_survey_stats = array('completed_responses', \n\t\t\t\t\t\t\t\t'incomplete_responses', \n\t\t\t\t\t\t\t\t'full_responses' \n\t\t\t\t\t\t\t\t); \n\t\t$permitted_stats = array_merge($permitted_survey_stats, $permitted_token_stats);\t\t\t\t\t\t\n\t\t$surveyidExists = Survey::model()->findByPk($sid);\t\t \n\t\tif (!isset($surveyidExists))\n\t\t\tthrow new Zend_XmlRpc_Server_Exception('Invalid surveyid', 22);\t\n\t\t\t\n\t\tif(in_array($stat_name, $permitted_token_stats))\t\n\t\t{\n\t\t\tif (tableExists('{{tokens_' . $sid . '}}'))\n\t\t\t\t$summary = Tokens_dynamic::model($sid)->summary();\n\t\t\telse\n\t\t\t\tthrow new Zend_XmlRpc_Server_Exception('No available data', 23);\n\t\t}\n\t\t\n\t\tif(in_array($stat_name, $permitted_survey_stats) && !tableExists('{{survey_' . $sid . '}}'))\t\n\t\t\tthrow new Zend_XmlRpc_Server_Exception('No available data', 23);\n\t\t\t\t\t\t\t\t\n\t\tif (!in_array($stat_name, $permitted_stats)) \n\t\t\tthrow new Zend_XmlRpc_Server_Exception('No such property', 23);\n\t\n\t\tif (hasSurveyPermission($sid, 'survey', 'read'))\n\t\t{\t\n\t\t\tswitch($stat_name) \n\t\t\t{\n\t\t\t\tcase 'token_count':\n\t\t\t\t\tif (isset($summary))\n\t\t\t\t\t\treturn $summary['tkcount'];\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'token_invalid':\n\t\t\t\t\tif (isset($summary))\n\t\t\t\t\t\treturn $summary['tkinvalid'];\n\t\t\t\t\tbreak;\t\n\t\t\t\tcase 'token_sent':\n\t\t\t\t\tif (isset($summary))\n\t\t\t\t\t\treturn $summary['tksent'];\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'token_opted_out':\n\t\t\t\t\tif (isset($summary))\n\t\t\t\t\t\treturn $summary['tkoptout'];\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'token_completed';\n\t\t\t\t\tif (isset($summary))\n\t\t\t\t\t\treturn $summary['tkcompleted'];\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'completed_responses':\n\t\t\t\t\treturn Survey_dynamic::model($sid)->count('submitdate IS NOT NULL');\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'incomplete_responses':\n\t\t\t\t\treturn Survey_dynamic::model($sid)->countByAttributes(array('submitdate' => null));\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'full_responses';\n\t\t\t\t\treturn Survey_dynamic::model($sid)->count();\n\t\t\t\t\tbreak;\t\t\t\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new Zend_XmlRpc_Server_Exception('Data is not available', 23);\n\t\t\t}\n\t\t}\n\t\telse\n\t\tthrow new Zend_XmlRpc_Server_Exception('No permission', 2); \t\t\n }\n }", "public function overallSubjectAnalysis($slug)\n {\n \n $user = User::getRecordWithSlug($slug);\n if($isValid = $this->isValidRecord($user))\n return redirect($isValid); \n \n if(!isEligible($slug))\n return back();\n\n $records = array();\n $records = ( new App\\QuizResult())->getOverallSubjectsReport($user);\n if(!$records)\n {\n flash('Ooops..!','No Records available', 'overlay'); \n return back();\n }\n $color_correct = getColor('background',rand(00,9999));\n $color_wrong = getColor('background', rand(00,9999));\n $color_not_attempted = getColor('background', rand(00,9999)); \n $i=0;\n $labels = [];\n $dataset = [];\n $dataset_label = [];\n $bgcolor = [];\n $border_color = [];\n \n $marks_labels = [getPhrase('correct'), getPhrase('wrong'), getPhrase('not_answered')];\n $time_labels = [getPhrase('time_spent_on_correct_answers'), getPhrase('time_spent_on_wrong_answers')];\n\n foreach($records as $record) {\n $record = (object)$record;\n \n //Marks\n $subjects_display[$i]['subject_name'] = $record->subject_name;\n $subjects_display[$i]['correct_answers'] = $record->correct_answers;\n $subjects_display[$i]['wrong_answers'] = $record->wrong_answers;\n $subjects_display[$i]['not_answered'] = $record->not_answered;\n\n // Time\n $subjects_display[$i]['time_spent_on_correct_answers'] = $record->time_spent_on_correct_answers;\n $subjects_display[$i]['time_spent_on_wrong_answers'] = $record->time_spent_on_wrong_answers;\n $subjects_display[$i]['time_to_spend'] = $record->time_to_spend;\n $subjects_display[$i]['time_spent'] = $record->time_spent;\n\n \n $marks_dataset = [$record->correct_answers, $record->wrong_answers, $record->not_answered];\n $time_dataset = [$record->time_spent_on_correct_answers, $record->time_spent_on_wrong_answers];\n $dataset_label = $record->subject_name;\n \n $bgcolor = [$color_correct,$color_wrong,$color_not_attempted];\n \n $border_color = [$color_correct,$color_wrong,$color_not_attempted];\n\n \n $marks_data['type'] = 'pie'; \n //horizontalBar, bar, polarArea, line, doughnut, pie\n $marks_data['title'] = $record->subject_name; \n\n $marks_data['data'] = (object) array(\n 'labels' => $marks_labels,\n 'dataset' => $marks_dataset,\n 'dataset_label' => $dataset_label,\n 'bgcolor' => $bgcolor,\n 'border_color' => $border_color\n );\n \n $data['chart_data'][] = (object)$marks_data;\n\n\n $time_data['type'] = 'bar'; \n //horizontalBar, bar, polarArea, line, doughnut, pie\n $time_data['title'] = $record->subject_name; \n\n $time_data['data'] = (object) array(\n 'labels' => $time_labels,\n 'dataset' => $time_dataset,\n 'dataset_label' => $dataset_label,\n 'bgcolor' => $bgcolor,\n 'border_color' => $border_color\n );\n \n $data['time_data'][] = (object)$time_data;\n\n $i++;\n } \n \n $data['chart_data'][] = (object)$marks_data;\n\n $overall_correct_answers = 0;\n $overall_wrong_answers = 0;\n $overall_not_answered = 0;\n\n $overall_time_spent_correct_answers = 0;\n $overall_time_spent_wrong_answers = 0;\n \n foreach($records as $r)\n {\n $r = (object)$r;\n $overall_correct_answers += $r->correct_answers;\n $overall_wrong_answers += $r->wrong_answers;\n $overall_not_answered += $r->not_answered;\n \n $overall_time_spent_correct_answers += $r->time_spent_on_correct_answers;\n $overall_time_spent_wrong_answers += $r->time_spent_on_wrong_answers;\n }\n\n $overall_marks_dataset = [$overall_correct_answers, $overall_wrong_answers, $overall_not_answered];\n $overall_time_dataset = [$overall_time_spent_correct_answers, $overall_time_spent_wrong_answers];\n\n $overall_marks_data['type'] = 'doughnut'; \n //horizontalBar, bar, polarArea, line, doughnut, pie\n $overall_marks_data['title'] = getPhrase('overall_marks_analysis');\n $overall_marks_data['data'] = (object) array(\n 'labels' => $marks_labels,\n 'dataset' => $overall_marks_dataset,\n 'dataset_label' => getPhrase('overall_marks_analysis'),\n 'bgcolor' => $bgcolor,\n 'border_color' => $border_color\n );\n\n $data['right_bar_path'] = 'student.exams.subject-analysis.right-bar-performance-chart';\n $data['right_bar_data'] = array('right_bar_data' => (object)$overall_marks_data);\n \n $data['overall_data'][] = (object)$overall_marks_data;\n \n $data['subjects_display'] = $records;\n $data['active_class'] = 'analysis';\n $data['title'] = getPhrase('overall_subject_wise_analysis');\n $data['user'] = $user;\n $userid = $user->id;\n $data['layout'] = getLayout();\n\n return view('student.exams.subject-analysis.subject-analysis', $data); \n }", "public function showSurveyResult($survey)\n\t{\n\t\t$data['answers'] = DB::table('answers')\n\t\t\t\t\t\t\t\t->leftJoin('questions', 'answers.q_id', '=', 'questions.id')\n\t\t\t\t\t\t\t\t->where('lead_id', base64_decode(Request::segment(2)))\n\t\t\t\t\t\t\t\t->where('answers.form_id', 1)\n\t\t\t\t\t\t\t\t->get();\n\n\t\t//Lets figure out the results from the answers\n\t\t$data['rediness'] = $data['answers'] = DB::table('answers')\n\t\t\t\t\t\t\t\t->leftJoin('questions', 'answers.q_id', '=', 'questions.id')\n\t\t\t\t\t\t\t\t->where('lead_id', base64_decode(Request::segment(2)))\n\t\t\t\t\t\t\t\t->where('answers.form_id', 1)\n\t\t\t\t\t\t\t\t->where('answers.q_id', 4)\n\t\t\t\t\t\t\t\t->first();\n\n\t\t//Get my goals\n\t\t$data['goals'] = $data['answers'] = DB::table('answers')\n\t\t\t\t\t\t\t\t->leftJoin('questions', 'answers.q_id', '=', 'questions.id')\n\t\t\t\t\t\t\t\t->where('lead_id', base64_decode(Request::segment(2)))\n\t\t\t\t\t\t\t\t->where('answers.form_id', 1)\n\t\t\t\t\t\t\t\t->where('answers.q_id', 5)\n\t\t\t\t\t\t\t\t->first();\n\n\t\t$data['goals'] = json_decode($data['goals']->answer);\n\n\t\t//Figure out the rediness score\n\t\t$data['rediness_percentage'] = $data['answers'] = DB::table('answers')\n\t\t\t\t\t\t\t\t->leftJoin('questions', 'answers.q_id', '=', 'questions.id')\n\t\t\t\t\t\t\t\t->where('lead_id', base64_decode(Request::segment(2)))\n\t\t\t\t\t\t\t\t->where('answers.form_id', 1)\n\t\t\t\t\t\t\t\t->where('answers.q_id', '>', 6)\n\t\t\t\t\t\t\t\t->where('answers.q_id','<' , 12)\n\t\t\t\t\t\t\t\t->get();\n\t\t//Calculate the readiness\n\t\t$myscore = 0;\n\t\t$total = count($data['rediness_percentage']);\n\t\tfor ($i=0; $i < $total; $i++) {\n\t\t\t$cr = $data['rediness_percentage'][$i];\n\n\t\t\t$myscore += $cr->answer;\n\t\t}\n\n\t\t$data['rediness_percentage'] = ($myscore/50) * 100;\n\n\t\t//Figure out the matching programs\n\t\t$data['strengths'] = $data['answers'] = DB::table('answers')\n\t\t\t\t\t\t\t\t->leftJoin('questions', 'answers.q_id', '=', 'questions.id')\n\t\t\t\t\t\t\t\t->where('lead_id', base64_decode(Request::segment(2)))\n\t\t\t\t\t\t\t\t->where('answers.form_id', 1)\n\t\t\t\t\t\t\t\t->where('answers.q_id', 11)\n\t\t\t\t\t\t\t\t->first();\n\t\t//Parse out the strenghts\n\t\t$data['strengths'] = json_decode($data['strengths']->answer);\n\t\t$program_codes = '';\n\t\t$total = count($data['strengths']);\n\t\tfor ($i=0; $i < $total; $i++) {\n\t\t\t$matching_programs = DB::table('matching_programs')\n\t\t\t\t\t\t\t\t\t\t->where('answer', $data['strengths'][$i])\n\t\t\t\t\t\t\t\t\t\t->first();\n\t\t\tif($program_codes == '') {\n\t\t\t\t$program_codes = $matching_programs->program_codes;\n\t\t\t}else {\n\t\t\t\t$program_codes .= ','.$matching_programs->program_codes;\n\t\t\t}\n\t\t}\n\n\t\t$program_codes = explode(',', $program_codes);\n\t\t$program_codes = array_unique($program_codes);\n\t\tforeach ($program_codes as $key => $value) {\n\t\t\t$program_codes[$key] = trim($program_codes[$key]);\n\t\t}\n\n\n\t\t$data['programs'] = DB::table('programs')\n\t\t\t\t\t\t\t->whereIn('program_code', $program_codes)\n\t\t\t\t\t\t\t->get();\n\n\t\t//Get the user information\n\t\t$data['lead'] = DB::table('leads')\n\t\t\t\t\t\t\t->where('id', base64_decode(Request::segment(2)))\n\t\t\t\t\t\t\t->first();\n\n\t\t//Get the articles that we are going to display\n $data['articles'] = Tools::getBlogPosts();\n\n\n\t\t//Create the view\n\t\t$this->layout->content = View::make('survey-result.content', $data);\n\n\t\t$this->layout->header = View::make('includes.header');\n\t}", "public function showScore($response, $quiz)\n {\n $max_score = $quiz->getMaxScore($quiz);\n $score = $_SESSION[$quiz->getSlug()];\n $percentage = round($score / $max_score * 100);\n\n return $this->view->render($response, 'score.html', [\n 'quiz' => $quiz,\n 'score' => $score,\n 'max_score' => $max_score,\n 'percentage' => $percentage\n ]);\n }", "private function fraudReviewFrom($response)\n {\n\n }", "public function actionRate()\n\t{\n\t\t$note_id = $_POST['note_id'];\n\t\t$student_id = $_POST['student_id'];\n\t\t$rating = $_POST['rating'];\n\n\t\t$model = $this->loadModel($note_id);\n\t\t$model->rate($student_id, $rating);\n\n\t\t$totalRating = $model->getTotalRating();\n\t\t$ratersCount = $model->getRatersCount();\n\n\t\tif ( ! $totalRating)\n\t\t\techo 'N/A';\n\t\telse\n\t\t\techo '' . ((double)$totalRating / $ratersCount) . ' (dari ' . $ratersCount . ' pengguna)';\n\t}", "private function ga_api_account_summaries() {\n\t\t$request = Ga_Lib_Api_Request::get_instance();\n\t\t$request = $this->sign( $request );\n\t\t$response = $request->make_request( self::GA_ACCOUNT_SUMMARIES_ENDPOINT );\n\n\t\treturn new Ga_Lib_Api_Response( $response );\n\t}", "public function stats($id)\n {\n $survey = Survey::findOrFail($id);\n// dd($survey);\n $responses = array();\n foreach ($survey->questions as $question)\n {\n switch ($question->getQuestionType()->name) {\n case 'single_choice':\n $single_choice = new Single_Choice_Response;\n $single_choice_response = $single_choice::where('question_id', $question->id)->get();\n $responses[] = $single_choice_response;\n break;\n case 'multiple_choice':\n $multiple_choice = new Multiple_Choice_Response;\n $multiple_choice_response = $multiple_choice::where('question_id', $question->id)->get();\n $responses[] = $multiple_choice_response;\n break;\n case 'text':\n $text = new Text_Response;\n $text_response = $text::where('question_id', $question->id)->get();\n $responses[] = $text_response;\n break;\n case 'rating':\n $rating = new Rating_Response;\n $rating_response = $rating::where('question_id', $question->id)->get();\n $responses[] = $rating_response;\n break;\n }\n }\n return view('survey.admin.stats', compact('survey','responses'));\n }", "public function viewMyExamReport(Request $request){\n\t\t$data['question']=ExamManagementQuestions::where([['exam_management_id',$request->exam_id]])\n\t\t\t\t\t\t\t ->leftJoin('questions','questions.id','=','exam_management_questions.question_id')\n\t\t\t\t\t\t\t ->leftJoin('segregations','segregations.id','=','questions.segregation_id')\n\t\t\t\t\t\t\t ->select('questions.id as q_id','questions.*','segregations.*','exam_management_questions.*')\n\t\t\t\t\t\t\t->get();\n\t\t\t\t\t\t\tforeach($data['question'] as $key=>$que_details){\n\t\t\t\t\t\t\t\t $quest_id=$que_details->q_id;\n\t\t\t\t\t\t\t\t $data['question'][$key]['student_answer']=StudentAnswer::where([['exam_id',$request->exam_id],['student_id', auth()->user()->id],['question_id',$quest_id]])->get();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\treturn view('student.exam.examreport',$data);\n\t}", "public function summary(Request $request)\n {\n try{\n if($request->ajax()) {\n $rides = UserRequests::where('provider_id', Auth::user()->id)->count();\n $revenue = UserRequestPayment::whereHas('request', function($query) use ($request) {\n $query->where('provider_id', Auth::user()->id);\n })\n ->sum('total');\n $cancel_rides = UserRequests::where('status','CANCELLED')->where('provider_id', Auth::user()->id)->count();\n $scheduled_rides = UserRequests::where('status','SCHEDULED')->where('provider_id', Auth::user()->id)->count();\n\n return response()->json([\n 'rides' => $rides, \n 'revenue' => $revenue,\n 'cancel_rides' => $cancel_rides,\n 'scheduled_rides' => $scheduled_rides,\n ]);\n }\n\n } catch (Exception $e) {\n return response()->json(['error' => trans('api.something_went_wrong')]);\n }\n\n }", "public function getTotalStudents(){\n $total_stds = $this->getTotalStds();\n $total_stds_men = $this->getTotalStdsMen();\n $total_stds_women = $this->getTotalStdsWomen();\n\n $htmlResumenTotal = $this->str_students(1,\"\").' <tr class=\"numbers\">\n <td class=\"color-indico\">'.number_format($total_stds).'</td>\n <td class=\"color-blue\">'.number_format($total_stds_men).'('.number_format($total_stds_men * 100 / $total_stds).'%)</td>\n <td class=\"color-orange\">'.number_format($total_stds_women).' ('.number_format($total_stds_women * 100 / $total_stds).'%)</td>\n </tr>\n '.$this->str_students(2,\"\");\n return $htmlResumenTotal;\n }", "public function apprentice_summary(){\n\t\tif($this->session->userdata('status') !== 'admin_logged_in'){\n\t\tredirect('pages/Login');\n\t\t}\n\t\t$this->M_auditTrail->auditTrailRead('Apprentice Summary', $this->session->userdata['type']);\n\t\t\n\t\t$data = [\n\t\t\t'total_internship' => $this->M_apprenticeGraph->get_total_internship(),\n\t\t\t'contract_expiredApprentice' => $this->M_apprenticeGraph->get_contract_expiredApprentice(),\n\t\t\t'graphAlumniInt' => $this->M_apprenticeGraph->getGraphMemberAlumniInt(),\n\t\t\t'internship_expired' => $this->M_apprenticeGraph->get_internship_expired(),\n\t\t\t'graphApprYear' => $this->M_apprenticeGraph->getGraphApprByYear(),\n\t\t\t'graphApprUniv' => $this->M_apprenticeGraph->getGraphApprByUniversity(),\n\t\t\t'graphApprSpv' => $this->M_apprenticeGraph->getGraphApprBySpv(),\n\t\t\t'judul' => 'Apprentice Summary - INSIGHT',\n\t\t\t'konten' => 'adm_views/home/monitoringApprentice',\n\t\t\t'admModal' => [],\n\t\t\t'footerGraph' => ['apprenticeSummary/apprenticeSummaryGraph']\n\t\t];\n\n\t\t$this->load->view('adm_layout/master', $data);\n\t}", "public function index()\n {\n $reviews = DB::table('ratings')->get();\n\n foreach ($reviews as $review) {\n \t# code...\n \t$patient = Patient::where('user_id',$review->author_id)->first();\n\n \t$doctor = Doctor::findOrFail($review->rateable_id);\n\n \t$review->patient_name = $patient->name;\n \t$review->patient_firstname = $patient->firstname;\n \t$review->patient_image = $patient->profile_picture;\n \t$review->doctor_name = $doctor->name;\n \t$review->doctor_firstname = $doctor->firstname;\n \t$review->doctor_image = $doctor->profile_picture;\n \t$review->created_at = Carbon::parse($review->created_at);\n }\n\n return view('admin.reviews.index')->with('reviews', $reviews);\n }", "public function showRating(Request $request){\n $this->validate($request, [\n 'product_id' => 'required'\n ]);\n // get rating\n \n $auth_id = Auth::id();\n $rating = Review::where([\"user_id\" => $auth_id, \"product_id\" => $request->product_id])->get();\n if(count($rating) > 0){\n $rating = json_decode(json_encode($rating));\n // avg ratings\n $review = Review::where('product_id', '=', $request->product_id)->avg('ratings');\n $avgRating = number_format($review, 0);\n return response()->json([$rating[0], $avgRating], 200);\n }\n \n \n \n }", "public function rating()\n {\n return $this->hasOne('App\\Review')\n ->selectRaw('user_id, count(*) as count, avg(would_recommend) as avg, avg(communication) as communication, avg(as_described) as as_described')\n ->groupBy('user_id');\n }", "function viewStudentAdvisor( $sessionID, $studentID ) {\r\n\t\tif( $this->userCanViewStudent( $sessionID )) {\r\n\t\t\t$query = \"SELECT ADVISOR FROM X_PNSY_STUDENT WHERE ID = '$studentID'\";\r\n\t\t\t$result = mysql_fetch_assoc(mysql_query($query));\r\n\t\t\textract($result);\r\n\t\t\r\n\t\t\t$query = \"SELECT FIRST_NAME, LAST_NAME, WOOSTER_EMAIL FROM X_PNSY_FACULTY WHERE ID = '$ADVISOR'\";\r\n\t\t\t$result = mysql_fetch_assoc(mysql_query($query));\r\n\t\t\t\r\n\t\t\treturn $result;\r\n\t\t}\r\n\t}", "function response_summary($question, $state, $length=80, $formatting=true) {\n return substr($state->answer, strpos($state->answer, '-')+1, $length);\n }", "public function getSummaryInfo(){\n \n if (!$this->student) return false;\n \n $output = \"\";\n \n $output .= \"<table>\";\n \n // Target grade\n $output .= \"<tr>\";\n \n $output .= \"<td>\".get_string('mintargetgrades', 'block_bcgt').\"</td>\";\n $output .= \"<td>{$this->getUserGrades(\"target\")}</td>\";\n \n $output .= \"</tr>\";\n \n // Target grade\n $output .= \"<tr>\";\n \n $output .= \"<td>\".get_string('asptargetgrades', 'block_bcgt').\"</td>\";\n $output .= \"<td>{$this->getUserGrades(\"aspirational\")}</td>\";\n \n $output .= \"</tr>\";\n \n $output .= \"</table>\";\n \n return $output;\n \n }", "public function summarizeApprovalStages($appID) {\n\t\t\t$statuses['Sponsor'] = $this->CI->db->query(\"\n\t\t\t\tSELECT * FROM Approval appr\n\t\t\t\t\tJOIN VenueUserRole vur ON vur.VenueUserRoleID = appr.VenueUserRoleID\n\t\t\t\t\tJOIN Venue v ON v.VenueID = vur.VenueID\n\t\t\t\t\tJOIN Application a ON a.ApplicationID = v.ApplicationID\n\t\t\t\t\tJOIN UserRole ur ON ur.UserRoleID = vur.UserRoleID\n\t\t\t\tWHERE a.ApplicationID = {$appID}\n\t\t\t\t\tAND ApprovalType = 'Sponsor'\n\t\t\t\")->result_array();\n\t\t\t$statuses['Venue'] = $this->CI->db->query(\"\n\t\t\tSELECT * FROM Approval appr\n\t\t\t\tJOIN VenueUserRole vur ON vur.VenueUserRoleID = appr.VenueUserRoleID\n\t\t\t\tJOIN Venue v ON v.VenueID = vur.VenueID\n\t\t\t\tJOIN Application a ON a.ApplicationID = v.ApplicationID\n\t\t\t\tJOIN UserRole ur ON ur.UserRoleID = vur.UserRoleID\n\t\t\tWHERE a.ApplicationID = {$appID}\n\t\t\t\tAND ApprovalType = 'VenueOperator'\n\t\t\t\")->result_array();\n\t\t\t$statuses['Committee'] = $this->CI->db->query(\"\n\t\t\t\tSELECT * FROM Approval appr\n\t\t\t\t\tJOIN VenueUserRole vur ON vur.VenueUserRoleID = appr.VenueUserRoleID\n\t\t\t\t\tJOIN Venue v ON v.VenueID = vur.VenueID\n\t\t\t\t\tJOIN Application a ON a.ApplicationID = v.ApplicationID\n\t\t\t\t\tJOIN UserRole ur ON ur.UserRoleID = vur.UserRoleID\n\t\t\t\tWHERE a.ApplicationID = {$appID}\n\t\t\t\t\tAND ApprovalType = 'Committee'\n\t\t\t\")->result_array();\n\n\t\t\tforeach($statuses as $key => $status) {\n\t\t\t\t//echo 'status: ';\n\t\t\t\t//var_dump($status);\n\t\t\t\t# For all stages there can be a mix of approvals and denials\n\t\t\t\t# Search for both and summarize the status accordingly\n\t\t\t\t$column = array_column($status, 'Descision');\n\t\t\t\t$approved = array_search('approved', $column);\n\t\t\t\t$denied = array_search('denied', $column);\n\n\t\t\t\t# If we see at least one approval, assume the status is approved\n\t\t\t\t# Else if we see no approvals and at least one denial, status is denied\n\t\t\t\t# Pending otherwise\n\t\t\t\tif($approved !== false) {\n\t\t\t\t\t$statuses[$key] = array(\n\t\t\t\t\t\t\t\t\t\t$key . \"Decision\" => $status[$approved]['Descision'], \n\t\t\t\t\t\t\t\t\t\t$key . \"DecisionRemark\" => $status[$approved]['DescisionRemark'],\n\t\t\t\t\t\t\t\t\t\t$key . \"ApprovalDate\" => $status[$approved]['ApprovalEndDate']\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t} else if ($denied !== false) {\n\t\t\t\t\t$statuses[$key] = array(\n\t\t\t\t\t\t\t\t\t\t$key . \"Decision\" => $status[$denied]['Descision'], \n\t\t\t\t\t\t\t\t\t\t$key . \"DecisionRemark\" => $status[$denied]['DescisionRemark'],\n\t\t\t\t\t\t\t\t\t\t$key . \"ApprovalDate\" => $status[$denied]['ApprovalEndDate']\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\t$statuses[$key] = array(\n\t\t\t\t\t\t\t\t\t\t$key . \"Decision\" => 'Pending', \n\t\t\t\t\t\t\t\t\t\t$key . \"DecisionRemark\" => null,\n\t\t\t\t\t\t\t\t\t\t$key . \"ApprovalDate\" => 'Pending'\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\t//var_dump($status);\n\t\t\t}\n\t\t\t# var_dump($statuses);\n\t\t\treturn $statuses;\n\t\t}", "public function reviews()\n {\n try {\n //init\n $input = Input::all();\n $current = date('Y-m-d H:i:s');\n if (!empty($input['review']) && !empty($input['rating']) && !empty($input['show_id'])) {\n DB::table('show_reviews')->insert([\n 'show_id' => $input['show_id'],\n 'user_id' => Auth::user()->id,\n 'rating' => $input['rating'],\n 'review' => $input['review'],\n 'created' => $current,\n 'updated' => $current\n ]);\n $posts = DB::table('show_reviews')->where('show_id', $input['show_id'])->groupBy('show_id')->count();\n return ['success' => true, 'posts' => $posts, 'msg' => 'Review posted successfully!'];\n }\n return ['success' => false, 'msg' => 'You must fill out the form correctly.'];\n } catch (Exception $ex) {\n return ['success' => false, 'msg' => 'There is an error posting your reviews. Please, contact us.'];\n }\n }", "function forReviewingSigAction(Request $request) {\n $this->getSecurityService()->checkSecurity('ROLE_SEIP_SIG_ARRANGEMENT_PROGRAM_LIST_FOR');\n\n $method = 'createPaginatorByAssignedForReviewing';\n $route = 'pequiven_seip_arrangementprogram_for_reviewing';\n $template = 'forReviewingApproving.html';\n return $this->getSummaryResponse($request, $method, $route, $template);\n }", "function questionssummary($survey_id, $question_id=null, $move=null)\r\n\t{\r\n\t\t$this->set('survey_id', $survey_id);\r\n\r\n\t\t// Move request for a question\r\n\t\tif( $move != null && $question_id != null){\r\n\t\t\t//$this->SurveyQuestion->moveQuestion($survey_id, $question_id, $move);\r\n\t\t\t$this->SurveyHelper->moveQuestion($survey_id, $question_id, $move);\r\n\t\t}\r\n\r\n\t\t// Get all required data from each table for every question\r\n\t\t$tmp = $this->SurveyQuestion->getQuestionsID($survey_id);\r\n\t\t$tmp = $this->Question->fillQuestion($tmp);\r\n\t\t$tmp = $this->Response->fillResponse($tmp);\r\n\t\t$result = null;\r\n\r\n\t\t// Sort the resultant array by question number\r\n\t\t$count = 1;\r\n\t\tfor( $i=0; $i<=$tmp['count']; $i++ ){\r\n\t\t\tfor( $j=0; $j<$tmp['count']; $j++ ){\r\n\t\t\t\tif( $i == $tmp[$j]['Question']['number'] ){\r\n\t\t\t\t\t$result[$count]['Question'] = $tmp[$j]['Question'];\r\n\t\t\t\t\t$count++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t$survey = $this->Survey->findById($survey_id);\r\n $this->set('data',$survey);\r\n\t\t$this->set('questions', $result);\r\n\t\t$this->render('questionssummary');\r\n\t}", "public function getAllStudentsResults() {\n try {\n if(BaseController::isLoggedIn() && BaseController::isTeacher()) {\n $user = new UserModel();\n $user->id = BaseController::getUserId();\n $user_data = $user->getUserDataById();\n \n $student = new StudentModel();\n $results = $student->getAllStudentsResults();\n \n $model = array(\n 'user_data' => $user_data,\n 'results' => $results\n );\n BaseController::display(self::$controller . '/student-results.php', $model);\n } else {\n BaseController::load('user/login.php', array('error_description' => 'Изисква се регистрация.'));\n }\n } catch (Exception $e) {\n BaseController::load('error.php');\n }\n }", "public function review($id)\n {\n // Get all the things.\n $application = Application::getUserApplication($id);\n $profile = Profile::getUserProfile($id);\n $scholarship = Scholarship::getScholarshipLabels();\n\n $vars = (object) $this->settings->getSpecifiedSettingsVars(['application_submit_help_text']);\n\n $prof_complete = Profile::isComplete(Auth::user()->id);\n if (!$prof_complete) {\n return Redirect::route('status')->with('flash_message', ['text' => 'Please go back and answer all required questions in ' . link_to_route('profile.create', 'basic info.'), 'class' => '-warning']);\n }\n\n return View::make('status.review', compact('application', 'profile', 'scholarship', 'vars'));\n }", "public function qestionresponse($id)\n {\n\n $responses = DB::table('applicantresponse') ->where('applicantresponse.applicant_id', '=', $id)->get();\n\n\n $response_array = array();\n $assess_array = array();\n $count = 0;\n\n $array_of_assessment = array();\n $number_of_assessment_taken = 0;\n foreach($responses as $single_response ) {\n if(in_array($single_response->assessment_id,$array_of_assessment)){\n $number_of_assessment_taken++;\n }else{\n array_push($array_of_assessment,$single_response->assessment_id);\n }\n }\n\n foreach($responses as $single_response ) {\n\n\n foreach($response_array as $index=>$arr){\n if(array_key_exists($single_response->assessment_id,$response_array[$index])){\n $response_array[$index][$single_response->assessment_id]+=$single_response->score;\n }else{\n if($count<$number_of_assessment_taken){\n $assess_array = array($single_response->assessment_id=>$single_response->score);\n $assess_array[$single_response->assessment_id]=$single_response->score;\n array_push($response_array,$assess_array);\n }\n\n }\n\n }\n\n if(array_key_exists($single_response->assessment_id,$assess_array)){\n $assess_array[$single_response->assessment_id]+=$single_response->score;\n }else{\n $assess_array = array($single_response->assessment_id=>$single_response->score);\n $assess_array[$single_response->assessment_id]=$single_response->score;\n }\n\n if($count==1){\n array_push($response_array,$assess_array);\n }\n\n $count++;\n }\n\n return json_encode($response_array);\n }", "public function view(stdClass $submission) {\n global $OUTPUT, $DB;\n\n // Get the items.\n $items = $this->get_models($submission);\n\n // Build the html.\n $responses = array();\n\n foreach ($items as $item) {\n\n // Output metadata tags.\n $metahtml = html_writer::start_tag('table', array('class' => 'sketchfab-stats table table-bordered table-striped'));\n\n // Polygons.\n $metahtml .= html_writer::start_tag('tr');\n $metahtml .= html_writer::tag(\n 'th',\n get_string('metapolygons', 'assignsubmission_sketchfab')\n );\n $metahtml .= html_writer::tag(\n 'td',\n html_writer::tag(\n 'span',\n $item->facecount,\n array('class' => 'value')\n ) .\n $this->build_meta_label(\n $item->facecount,\n intval($this->get_config('polylimitenabled')) === 1,\n $this->get_config('polylimit')\n )\n );\n $metahtml .= html_writer::end_tag('tr');\n\n // Vertexes.\n $metahtml .= html_writer::start_tag('tr');\n $metahtml .= html_writer::tag(\n 'th',\n get_string('metavertexes', 'assignsubmission_sketchfab')\n );\n $metahtml .= html_writer::tag(\n 'td',\n html_writer::tag(\n 'span',\n $item->vertexcount,\n array('class' => 'value')\n )\n );\n $metahtml .= html_writer::end_tag('tr');\n\n // Materials.\n $metahtml .= html_writer::start_tag('tr');\n $metahtml .= html_writer::tag(\n 'th',\n get_string('metamaterials', 'assignsubmission_sketchfab'),\n array(\n 'rowspan' => $item->matcount + 1\n )\n );\n\n $matinner = $item->matcount;\n $usematcount = intval($item->matcount) > 0;\n if ($usematcount) {\n $matinner .= $this->build_meta_label(\n $item->matcount,\n intval($this->get_config('matlimitenabled')) === 1,\n $this->get_config('matlimit')\n );\n }\n\n $metahtml .= html_writer::tag(\n 'td',\n html_writer::tag(\n 'span',\n $item->matcount,\n array('class' => 'value')\n )\n );\n $metahtml .= html_writer::end_tag('tr');\n\n // Textures.\n $metahtml .= html_writer::start_tag('tr');\n $metahtml .= html_writer::tag(\n 'th',\n get_string('metatextures', 'assignsubmission_sketchfab'),\n array(\n 'rowspan' => $item->texcount + 1\n )\n );\n\n $texinner = $item->texcount;\n if (!$usematcount) {\n $texinner .= $this->build_meta_label(\n $item->texcount,\n intval($this->get_config('matlimitenabled')) === 1,\n $this->get_config('matlimit')\n );\n }\n\n $metahtml .= html_writer::tag(\n 'td',\n html_writer::tag(\n 'span',\n $texinner,\n array('class' => 'value')\n )\n );\n $metahtml .= html_writer::end_tag('tr');\n\n $allownpot = intval($this->get_config('allownpot')) === 1;\n $texsizeenabled = intval($this->get_config('texsizeenabled')) === 1;\n $texsizelimit = intval($this->get_config('texsize'));\n foreach ($item->textures as $key => $tex) {\n $metahtml .= html_writer::start_tag('tr');\n\n $inner = html_writer::tag(\n 'a',\n $tex['name'],\n array(\n 'href' => $tex['url']\n )\n );\n $inner .= \" ($tex[w]x$tex[h])\";\n\n $inner .= html_writer::start_tag('div', array('class' => 'flags'));\n\n // If texture size is restricted, show a flag as to whether its\n // size is over the limit.\n if (!$texsizeenabled) {\n $inner .= $this->build_meta_label_boolean(\n get_string(\"texsizegood\", \"assignsubmission_sketchfab\"),\n get_string(\"texsizebad\", \"assignsubmission_sketchfab\"),\n $tex['largestdimension'] <= $texsizelimit\n );\n }\n\n // If NPOT textures are not allowed, show a flag as to whether\n // or not this texture is POT.\n if (!$allownpot) {\n $inner .= $this->build_meta_label_boolean(\"POT\", \"NPOT\", $tex['poweroftwo']);\n }\n\n $inner .= html_writer::end_tag('div');\n\n $metahtml .= html_writer::tag(\n 'td',\n html_writer::tag(\n 'small',\n $inner,\n array('class' => 'value')\n )\n );\n $metahtml .= html_writer::end_tag('tr');\n }\n\n\n $metahtml .= html_writer::end_tag('table');\n\n $thishtml = html_writer::tag(\n 'div',\n $item->oembed . $metahtml,\n array('class' => 'sketchfab-oembed-outer')\n );\n\n $responses[] = $thishtml;\n }\n\n\n return implode($responses);\n }", "public function see_student_list($teacher_id, $course_id, $exam_id)\n {\n $exam_row = Exam::where('id', $exam_id)->first();\n $studentReq = StudentRequest::where('teacher_id', $teacher_id)->where('course_id', $course_id)->where('exam_id', $exam_id)->get();\n return view('teacher_panel.see_req')->with([\n 'studentReq' => $studentReq,\n 'exam_row' => $exam_row,\n ]);\n }", "public function report(Request $request, $event_id, $review_id)\n {\n $this->eventReviewService->report($event_id,$review_id, $request->get('volunteer'));\n return response()->json(['message' => 'Success.'], 200);\n }", "public function toArray($request)\n {\n $member_sejak = $this->created_at->isoFormat('MMMM Y');\n $photo_backcover = $this->getPhotoBackcoverAttribute();\n $user = new UserResource(User::find($this->user_id));\n $level = (int) $this->level / 20;\n $level = ($level > 4 ? 4 : $level);\n $level_statistisi = $this->getLevelStatistisi($level);\n\n $reviews = ReviewResource::collection(Review::where('to_id', $user->id)->get());\n $reviews = json_decode(json_encode($reviews));\n // dd($reviews);\n $star_review = [];\n foreach ($reviews as $review) {\n array_push($star_review, $review->star);\n }\n // dd(count($star_review));\n if (count($star_review)) {\n $avg_star_review = array_sum($star_review) / count($star_review);\n }\n\n return [\n 'id' => $this->id,\n 'user' => $user ?? '',\n 'level' => $this->level,\n 'cover_letter' => $this->cover_letter,\n 'tools' => explode('|', $this->tools),\n 'services' => explode('|', $this->services),\n 'visitor_count' => $this->visitor,\n 'photo_backcover' => $this->getPhotoBackcoverAttribute() ?? '',\n 'st_user_namecode' => implode('_', [$this->id, $this->user_id]),\n 'member_sejak' => $member_sejak ?? '',\n 'level_statistisi' => $level_statistisi,\n 'reviews' => $reviews ?? '',\n 'avg_star_review' => $avg_star_review ?? 0,\n 'count_star_review' => count($star_review),\n 'link_profil' => config('custom.app_url') . '/statistisi/' . implode('_', [$this->id, $this->user_id]),\n ];\n }", "public function summaryAction()\n {\n $reporter = $this->getDI()->get('reporter');\n\n $this->getOutput()->last_15_min_mo_count = $reporter->getLastMoCount(new DateTime('15 minutes ago'));\n $this->getOutput()->time_span_last_10k = $reporter->getTimeSpan(10000);\n return $this->initResponse();\n }", "public function summarise_response(array $response)\n {\n //TODO: fixme\n return 'waveform';\n }", "function employer_review_action() {\n global $user_ID, $current_user;\n $args = $_POST;\n \n if (!isset($args['project_id'])) {\n wp_send_json(array(\n 'success' => false,\n 'msg' => __('Invalid project id.', ET_DOMAIN)\n ));\n }\n \n $project_id = $args['project_id'];\n \n $author_id = (int)get_post_field('post_author', $project_id);\n \n $result = array(\n 'succes' => false,\n 'msg' => __('You can\\'t not access this action.', ET_DOMAIN)\n );\n \n $bid_id_accepted = get_post_meta($project_id, 'accepted', true);\n \n $author_bid = get_post_field('post_author', $bid_id_accepted);\n \n $profile_id = get_user_meta($author_bid, 'user_profile_id', true);\n \n /*\n * validate data\n */\n if (!$bid_id_accepted) {\n $result = array(\n 'succes' => false,\n 'msg' => __('Please assign project before complete.', ET_DOMAIN)\n );\n wp_send_json($result);\n }\n \n if (!isset($args['score']) || empty($args['score'])) {\n $result = array(\n 'succes' => false,\n 'msg' => __('You have to rate for this profile.', ET_DOMAIN)\n );\n wp_send_json($result);\n }\n if (!isset($args['comment_content']) || empty($args['comment_content'])) {\n $result = array(\n 'succes' => false,\n 'msg' => __('Please post a review for this freelancer.', ET_DOMAIN)\n );\n wp_send_json($result);\n }\n \n /*\n * check permission for review action\n */\n \n if (!$user_ID || $user_ID !== $author_id) wp_send_json($result);\n \n $args['comment_post_ID'] = $bid_id_accepted;\n $args['comment_approved'] = 1;\n \n // insert review\n $review = Fre_Review::get_instance();\n $comment = $review->insert($args);\n \n if (!is_wp_error($comment)) {\n \n /**\n * fire an acction after project owner complete his project\n * @param int $project_id\n * @param Array $args\n * @since v1.2\n * @author Dakachi\n */\n do_action('fre_complete_project', $project_id, $args);\n \n /**\n * update project, bid, user rating scrore after review a project\n */\n $this->update_after_empoyer_review($project_id, $comment);\n \n $project_title = get_the_title($project_id);\n $freelancer_name = get_the_author_meta('display_name', $author_bid);\n wp_send_json(array(\n 'success' => true,\n 'msg' => sprintf(__(\"You have completed project %s and reviewed %s.\", ET_DOMAIN) , $project_title, $freelancer_name)\n ));\n } else {\n wp_send_json(array(\n 'success' => false,\n 'msg' => $comment->get_error_message()\n ));\n }\n }", "public function getAverageReviews()\n {\n /* code goes here */\n }", "function questionnaire_user_outline($course, $user, $mod, $questionnaire) {\n global $CFG;\n require_once($CFG->dirroot . '/mod/questionnaire/locallib.php');\n\n $result = new stdClass();\n if ($responses = questionnaire_get_user_responses($questionnaire->sid, $user->id, $complete = true)) {\n $n = count($responses);\n if ($n == 1) {\n $result->info = $n.' '.get_string(\"response\", \"questionnaire\");\n } else {\n $result->info = $n.' '.get_string(\"responses\", \"questionnaire\");\n }\n $lastresponse = array_pop($responses);\n $result->time = $lastresponse->submitted;\n } else {\n $result->info = get_string(\"noresponses\", \"questionnaire\");\n }\n return $result;\n}", "public function getReviewAction()\n\t{\n\t\t$this->_ajaxValidation();\n\t\t$response['content']=$this->_getReviewHtml();\n\t\t$this->getResponse()->setBody(json_encode($response));\n\t}", "public function students()\r\n {\r\n $students = $this->student->GetAllStudents();\r\n $view = new view(\"Students\");\r\n $view->generate(array('students' => $students));\r\n\r\n }", "public function index()\n {\n $totalWeightMainStandard = MainStandard::sum('weight');\n $readyModelFields = MainStandard::all();\n $totalMarks = TotalMark::first();\n $total=0;\n $compaby_id=1;\n if (isset($totalMarks->total))\n $total=$totalMarks->total;\n $restOftotal = $total/*fhad total fin kayn error*/ - $totalWeightMainStandard;\n //get sub standars\n $reviews= DB::table('sub_standards')\n ->select('review_items.arabic_name','review_items.id', 'sub_standards.arabic_name as standard_title', 'ready_model_replies.value','ready_model_replies.company_id')\n ->join('association', 'sub_standards.id', '=', 'association.id_sub_standar')\n ->join('ready_model_replies', 'ready_model_replies.sub_standard_id', '=', 'association.id_sub_standar')\n ->join('review_items', 'review_items.id', '=', 'association.id_review')->where('ready_model_replies.company_id','=',$compaby_id)->orderBy('sub_standards.arabic_name')->get();\n echo \"<script>console.log(\".json_encode( $reviews).\");</script>\";\n return view('reviews.readyModelReply', ['readyModelFields' => $readyModelFields, 'totalMarks' => $totalMarks,\n 'totalWeightMainStandard' => $totalWeightMainStandard, 'restOftotal' => $restOftotal,'reviews'=>$reviews\n ]);\n }", "public function toArray($request)\n {\n $authors = explode(';',$this->authors);\n $five_star_count = Rating::where('book_id', $this->id)->where('rating',5)->count();\n $four_star_count = Rating::where('book_id', $this->id)->where('rating',4)->count();\n $three_star_count = Rating::where('book_id', $this->id)->where('rating',3)->count();\n $two_star_count = Rating::where('book_id', $this->id)->where('rating',2)->count();\n $one_star_count = Rating::where('book_id', $this->id)->where('rating',1)->count();\n $total_rating = Rating::where('book_id', $this->id)->count();\n $reviews = Review::where('book_id',$this->id)->orderBy('updated_at','desc')->get();\n $ratings = Rating::where('book_id', $this->id)->avg('rating');\n \n unset($authors[count($authors)-1]);\n return [\n 'title' => $this->title,\n 'pages' => $this->pages,\n 'isbn' => $this->isbn,\n 'authors' => $authors,\n 'added_by' => $this->added_by,\n 'rating' => [\n 'total' => $total_rating,\n 'average' => number_format($ratings,2,',',','),\n 'five_star_count' => $five_star_count,\n 'five_star_percentage' => number_format(($five_star_count/($total_rating==0?1:$total_rating)*100),2,',',','),\n 'four_star_count' => $four_star_count,\n 'four_star_percentage' => number_format(($four_star_count/($total_rating==0?1:$total_rating)*100),2,',',','),\n 'three_star_count' => $three_star_count,\n 'three_star_percentage' => number_format(($three_star_count/($total_rating==0?1:$total_rating)*100),2,',',','),\n 'two_star_count' => $two_star_count,\n 'two_star_percentage' => number_format(($two_star_count/($total_rating==0?1:$total_rating)*100),2,',',','),\n 'one_star_count' => $one_star_count,\n 'one_star_percentage' => number_format(($one_star_count/($total_rating==0?1:$total_rating)*100),2,',',','),\n ],\n 'review' => [\n 'total' => $this->reviews->count(),\n 'data' => ReviewResource::collection($reviews)\n ],\n 'created_at' => $this->created_at\n ];\n return parent::toArray($request);\n }", "public function submissions()\n {\n $segregatedSubmissions = Submissions::getStudentSubmissions();\n //dd($segregatedSubmissions);\n $upcoming_submissions = $segregatedSubmissions[0];\n $ongoing_submissions = $segregatedSubmissions[1];\n $finished_submissions = $segregatedSubmissions[2];\n\n //dd($upcoming_submissions);\n //dd($ongoing_submissions);\n //dd($finished_submissions);\n $unReadNotifCount = StudentCalls::getUnReadNotifCount();\n return view('student/submissions', compact('upcoming_submissions', 'ongoing_submissions', 'finished_submissions','unReadNotifCount'));\n }", "function getFormattedScorers()\n\t{\n\t\t$data = array();\n\t\t// get the match scorers\n\t\t$scorer_query = 'SELECT u.username, u.user_id FROM users AS u, scorers AS s '.\n\t\t\t\t\t\t'WHERE s.report_id = '.$this->id.' '.\n\t\t\t\t\t\t'AND s.user_id = u.user_id';\n\t\t$scorer_result = mysql_query($scorer_query)\n\t\t\tor die(mysql_error());\n\t\tif (mysql_num_rows($scorer_result) != 0)\n\t\t{\n\t\t\twhile ($scorer_row = mysql_fetch_array($scorer_result))\n\t\t\t{\n\t\t\t\t$scorer[] = $scorer_row['username'];\n\t\t\t\t$scorerid[] = $scorer_row['user_id'];\n\t\t\t}\n\t\t\t\n\t\t\t$scorername = array_unique($scorer);\n\t\t\t$scorername = array_values($scorername);\n\t\t\t$scorernameid = array_unique($scorerid);\n\t\t\t$scorernameid = array_values($scorernameid);\n\t\t\t\n\t\t\t// Works out how many goals each person scored.\n\t\t\t// This could be done by SQL, but it's fine in PHP\n\t\t\t$goals = array();\n\t\t\tfor ($r=0; $r<sizeof($scorername);$r++)\n\t\t\t{\n\t\t\t\tfor ($s=0; $s<sizeof($scorer); $s++)\n\t\t\t\t{\n\t\t\t\t\tif ($scorer[$s] == $scorername[$r])\n\t\t\t\t\t{\n\t\t\t\t\t\t$goals[$r]++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// print out nicely.\n\t\t\tfor ($t=0;$t<sizeof($scorername);$t++)\n\t\t\t{\n\t\t\t\t$g = '';\n\t\t\t\tif ($goals[$t] >1)\n\t\t\t\t{\n\t\t\t\t\t$g = ' ('.$goals[$t].')';\n\t\t\t\t}\n\t\t\t\t$data[] = array('link'=>'viewprofile.php?action=view&amp;uid='.$scorernameid[$t],\n\t\t\t\t\t\t\t\t'name'=>$scorername[$t].$g);\n\t\t\t}\n\t\t}\n\t\treturn $data;\n\t}", "public function prescriptionsDataSummary()\n {\n $prescriptions = Prescription::where('date', 'like', Carbon::now()->format('Y-m-') . \"%\")->get();\n $prescriptionBills = $prescriptions->whereIn('status', [Prescriptions::PENDING_PRESCRIPTION, Prescriptions::CONFIRMED_PRESCRIPTION])->count();\n $internalPrescriptions = $prescriptions->where('status', Prescriptions::NEW_PRESCRIPTION)->count();\n $paidPrescriptions = $prescriptions->where('status', Prescriptions::PAID_PRESCRIPTION)->count();\n return ResponseHelper::findSuccess('Explorations Data', [\n 'total_prescriptions' => $prescriptions->count(),\n 'prescription_bills' => $prescriptionBills,\n 'internal_prescriptions' => $internalPrescriptions,\n 'paid_prescriptions' => $paidPrescriptions\n ]);\n }", "public function getResultsCategoryStage() {\n try {\n if(BaseController::isLoggedIn() && BaseController::isTeacher()) {\n $student = new StudentModel();\n $students = $student->getResultsCategoryStage();\n \n $student_ids = array();\n $category_stage = array();\n $gender = array();\n $marks = array();\n\n foreach ($students as $row) {\n array_push($student_ids, $row['student_id']);\n array_push($category_stage, $row['category_name'].'_'.$row['stage']);\n array_push($gender, $row['gender']);\n array_push($marks, $row['mark_value']);\n }\n\n $model = array(\n 'student_id' => $student_ids,\n 'category_stage' => $category_stage,\n 'gender' => $gender,\n 'mark_value' => $marks,\n );\n echo json_encode($model,JSON_UNESCAPED_UNICODE);\n return;\n } else {\n echo json_encode(array('message' => 'error'),JSON_UNESCAPED_UNICODE);\n return;\n }\n } catch (Exception $e) {\n echo json_encode(array('message' => 'error'),JSON_UNESCAPED_UNICODE);\n return;\n } \n }", "public function GetResults()\n {\n $res = DB::table(\"doexam\")\n ->where(\"IdStudent\", session(\"student\"))\n ->get();\n return view(\"student.results\", [\"results\" => $res]);\n }", "public function toArray($request)\n {\n $user = auth()->user();\n\n $isEnrolled = false;\n $userGrade = null;\n if($user){\n $enrollment = $this->users->where('id', $user->id)->first();\n if($enrollment) {\n $isEnrolled = true;\n $userGrade = $enrollment->pivot->grade;\n }\n }\n $isReviewedByUser = false;\n\n $finalExamQuestions = $this->exam->questions->all();\n shuffle($finalExamQuestions);\n $finalExam = [];\n $finalExam['id'] = $this->exam->id;\n foreach ($finalExamQuestions as $finalExamQuestion) {\n $finalExam['questions'][] = new QuestionResource($finalExamQuestion);\n }\n\n $reviews = [];\n foreach ($this->usersThatReviewed()->orderBy('created_at', 'desc')->get() as $u) {\n\n $review = [\n 'score' => $u->pivot->score,\n 'text' => $u->pivot->text,\n 'created_at' => $u->pivot->created_at,\n 'user' => new UserResource($u),\n ];\n\n array_push($reviews, $review);\n\n if($user && $u->id == $user->id) {\n $isReviewedByUser = true;\n }\n }\n\n return [\n 'id' => $this->id,\n 'name' => $this->name,\n 'description' => $this->description,\n 'category' => $this->category,\n 'price' => $this->price,\n 'image_url' => $this->image_url,\n 'teacher' => new UserResource($this->teacher),\n 'isEnrolled' => $isEnrolled,\n 'userGrade' => $userGrade,\n 'isReviewedByUser' => $isReviewedByUser,\n 'reviews' => $reviews,\n 'finalExam' => $finalExam,\n 'sections' => SectionResource::collection($this->sections),\n ];\n\n /*return [\n 'data' =>\n [\n 'id' => $this->id,\n 'name' => $this->name,\n 'description' => $this->description,\n 'category' => $this->category,\n ],\n 'links' => [\n 'self' => 'link-value',\n ],\n ];*/\n\n }", "public function reviews($id)\n {\n $record=Social::where('social_id', 1, true)->where('user_id', Auth::user()->id)->first();\n try \n {\n $fb = new \\Facebook\\Facebook([\n 'app_id' => $record['api'],\n 'app_secret' => $record['secret'],\n ]);\n $response = $fb->get(\n '/'.$record['page_id'].'?fields=ratings',$record['access_token']\n );\n } \n catch(\\Facebook\\Exceptions\\FacebookResponseException $e) \n {\n //When Graph returns an error\n //echo 'Graph returned an error: ' . $e->getMessage();\n return Redirect::back()->withErrors([$e->getMessage(), 'The Message']);\n exit;\n } \n catch(\\Facebook\\Exceptions\\FacebookSDKException $e) \n {\n // When validation fails or other local issues\n echo 'Facebook SDK returned an error: ' . $e->getMessage();\n exit;\n }\n $graphNode = $response->getGraphNode();\n $response=json_decode($response->getBody(), true);\n \n try\n { \n foreach($response['ratings']['data'] as $rating) \n {\n $url=Rating::where('review_type', 1)->where('user_url', $rating['reviewer']['id'])->where('customer_id', Auth::user()->id)->get()->count(); \n if($url==0)\n {\n $rating=Rating::create([\n 'customer_id'=>Auth::user()->id,\n 'comment'=> (isset($rating['review_text'])) ? $rating['review_text'] : '',\n 'rating'=> $rating['rating'],\n 'name'=> $rating['reviewer']['name'],\n 'user_url'=> $rating['reviewer']['id'],\n 'email'=> '',\n 'contact'=> '',\n 'review_type'=>1, \n ]);\n return redirect('manage_site')->with('success', 'Successfully Added');\n }\n else \n {\n $msg=\"Feedback is already exists\";\n }\n }\n return Redirect::back()->withErrors([$msg, 'The Message']);\n } \n catch(\\Exception $ex) \n {\n return Redirect::back()->withErrors([$ex->getMessage(), 'The Message']);\n }\n }", "public function mes_ratings()\n {\n $this->load->model('rating_model');\n $this->load->view(\"header\");\n $idUserRated = $this->session->userdata('user_id');\n $data['ratings'] = $this->rating_model->show_ratings($idUserRated);\n //$data['average'] = $this->rating_model->get_avg_rating($idUserRated);\n $this->load->view(\"list_my_ratings\", $data);\n $this->load->view(\"footer\");\n }", "public function showStudentProfile($stud_admission_id)\n\t{\n\t\t\t$student_query = \"SELECT * from edu_admission WHERE admission_id='$stud_admission_id' AND status = 'Active'\";\n\t\t $student_res = $this->db->query($student_query);\n\t\t\t$student_profile= $student_res->result();\n\n\t\t\t if($student_res->num_rows()==0){\n\t\t\t\t $response = array(\"status\" => \"error\", \"msg\" => \"student Not Found\");\n\t\t\t}else{\n\t\t\t\t$response = array(\"status\" => \"success\", \"msg\" => \"Student Profile\", \"studentProfile\"=>$student_profile);\n\t\t\t}\n\n\t\t\treturn $response;\n\t}", "public function responded(){\n\t$comment_id = ee()->TMPL->fetch_param('comment_id');\n\tee()->db->where('parent_id',$comment_id);\n\t$count = ee()->db->count_all_results('exp_mtt_ratings');\n\tif($count > 0){return 'y';}\n\telse{return 'n';}\t\n\t}", "function EWD_URP_Display_Summary_Statistics($atts) {\n\tglobal $EWD_URP_Summary_Statistics_Array;\n\t$EWD_URP_Summary_Statistics_Array = array();\n\n\t$Custom_CSS = get_option(\"EWD_URP_Custom_CSS\");\n\t$Maximum_Score = get_option(\"EWD_URP_Maximum_Score\");\n\n\t$Summary_Statistics = get_option(\"EWD_URP_Summary_Statistics\");\n\t$Review_Weights = get_option(\"EWD_URP_Review_Weights\");\n\t$Email_Confirmation = get_option(\"EWD_URP_Email_Confirmation\");\n\t\n\t// Get the attributes passed by the shortcode, and store them in new variables for processing\n\textract( shortcode_atts( array(\n\t\t\t'product_name' => \"\",\n\t\t\t'include_category' => \"\",\n\t\t\t'exclude_category' => \"\",\n\t\t\t'all_products' => \"No\",\n\t\t\t'summary_type' => \"\"),\n\t\t\t$atts\n\t\t)\n\t);\n\n\t$Review_Params = array();\n\t$Current_Product_Group = \"\";\n\n\tif ($Summary_Statistics == \"None\") {$Summary_Statistics = \"Limited\";}\n\n\tif ($summary_type != \"\") {$Summary_Statistics = $summary_type;}\n\n\tif (isset($_GET['Product_Reviews'])) {return do_shortcode(\"[ultimate-reviews product_name='\" . $_GET['Product_Reviews'] . \"']\") .\"<div class='ewd-urp-return'><a href='\" . get_permalink() . \"'>\" . __(\"Back to Summary\", 'ultimate-reviews') . \"</a></div>\";}\n\n\t$Reviews = json_decode(do_shortcode(\"[ultimate-reviews product_name='\" . $product_name . \"' include_category='\" . $include_category . \"' exclude_category='\" . $exclude_category . \"' reviews_objects='Yes' group_by_product='Yes']\"));\n\n\t$HeaderString = EWD_URP_Add_Modified_Styles();\n\t$HeaderString .= \"<div class='ewd-urp-review-list ewd-urp-review-summaries' id='ewd-urp-review-list'>\";\n\t\n\t$Counter = 0;\n\tforeach ($Reviews as $Review) {\n\t\tif ($Email_Confirmation == \"Yes\") {\n\t\t\t$Email_Confirmed = get_post_meta($Review->ID, 'EWD_URP_Email_Confirmed', true);\n\n\t\t\tif ($Email_Confirmed != \"Yes\") {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\n\t\tif ($all_products != \"Yes\") {\n\t\t\t$Product_Name = get_post_meta($Review->ID, 'EWD_URP_Product_Name', true);\n\t\t}\n\t\telse {\n\t\t\t$Product_Name = \"All Products\";\n\t\t}\n\t\t$Product_Names[] = $Product_Name;\n\n\t\t$Weight = get_post_meta( $Review->ID, 'EWD_URP_Review_Weight', true );\t\t\n\t\t$Overall_Score = get_post_meta($Review->ID, 'EWD_URP_Overall_Score', true);\n\t\n\t\tif (!isset($EWD_URP_Summary_Statistics_Array[$Product_Name][$Overall_Score])) {$EWD_URP_Summary_Statistics_Array[$Product_Name][$Overall_Score] = 0;}\n\t\tif ($Review_Weights == \"Yes\") {\n\t\t\tif ($Review_Weight == \"\") {$Review_Weight = 0;}\n\t\t\t$EWD_URP_Summary_Statistics_Array[$Product_Name]['Total Weights'] += $Weight;\n\t\t\t$EWD_URP_Summary_Statistics_Array[$Product_Name][$Overall_Score] += $Weight;\n\t\t}\n\t\telse {\n\t\t\t$EWD_URP_Summary_Statistics_Array[$Product_Name][$Overall_Score]++;\n\t\t}\n\n\t\tif ($Current_Product_Group != $Product_Name) {\n\t\t\t$SummaryString = EWD_URP_Build_Summary_Statistics_String($Current_Product_Group, $Review_Params, $Summary_Statistics, \"<a href='\" . get_permalink() . \"?Product_Reviews=\" . $Current_Product_Group . \"'>\", \"</a>\");\n\t\t\t$ReviewsString = str_replace(\"%PRODUCT_SUMMARY_STATISTICS_PLACEHOLDER%\", $SummaryString, $ReviewsString);\n\t\t\t$ReviewsString .= \"%PRODUCT_SUMMARY_STATISTICS_PLACEHOLDER%\";\n\t\t\t$Current_Product_Group = $Product_Name;\n\t\t}\n\n\t\t$Counter++;\n\n\t}\n\n\t$SummaryString = EWD_URP_Build_Summary_Statistics_String($Current_Product_Group, $Review_Params, $Summary_Statistics, \"<a href='#\" . \"?Product_Reviews=\" . $Current_Product_Group . \"'>\", \"</a>\");\n\t$ReviewsString = str_replace(\"%PRODUCT_SUMMARY_STATISTICS_PLACEHOLDER%\", $SummaryString, $ReviewsString);\n\n\t$FooterString = \"<div class='ewd-urp-clear'></div>\";\n\n\t$FooterString .= \"</div>\";\n\n\tif (($Summary_Statistics == \"Full\" or $Summary_Statistics == \"Limited\") and $product_name != \"\") {\n\t\t$SummaryString = EWD_URP_Build_Summary_Statistics_String($product_name, $Review_Params, $Summary_Statistics, \"<a href='#\" . \"?Product_Reviews=\" . $Current_Product_Group . \"'>\", \"</a>\");\n\t\t$HeaderString = str_replace(\"%SUMMARY_STATISTICS_PLACEHOLDER%\", $SummaryString, $HeaderString);\n\t}\n\n\t$ReturnString = $HeaderString . $ReviewsString . $FooterString;\n\n\treturn $ReturnString;\n}", "public function usecase_summary(){\n\t\tif($this->session->userdata('status') !== 'admin_logged_in'){\n\t\tredirect('pages/Login');\n\t\t}\n\t\t$this->M_auditTrail->auditTrailRead('Usecase Summary', $this->session->userdata['type']);\n\n\t\t$data = [\n\t\t\t'graphGroup' => $this->M_assignmentsGraph->getTotalGroup(),\n\t\t\t'graphGroupApp' => $this->M_assignmentsGraph->getTotalGroupApp(),\n\t\t\t'graphSquad'=> $this->M_assignmentsGraph->getTotalSquad(),\n\t\t\t'graphSquadApp' => $this->M_assignmentsGraph->getTotalSquadApp(),\n\t\t\t'countUsecae' => $this->M_assignmentsGraph->getCountUsecase(),\n\t\t\t'total_mdscinassigments' => $this->M_assignmentsGraph->get_total_mdscinassigments(),\n\t\t\t'total_mdscnotinassigments' => $this->M_assignmentsGraph->get_total_mdscnotinassigments(),\n\t\t\t'total_appinassigments' => $this->M_assignmentsGraph->get_total_appinassigments(),\n\t\t\t'total_appnotinassigments' => $this->M_assignmentsGraph->get_total_appnotinassigments(),\n\t\t\t'total_groups' => $this->M_assignmentsGraph->get_total_groups(),\n\t\t\t'total_tribe' => $this->M_assignmentsGraph->get_total_tribe(),\n\t\t\t'total_squad' => $this->M_assignmentsGraph->get_total_squad(),\n\t\t\t'total_usecase' => $this->M_assignmentsGraph->get_total_usecase(),\n\t\t\t'labe_perusecase' => $this->M_assignmentsGraph->getNameLabelPerusecase(),\n\t\t\t'member_perusecase' => $this->M_assignmentsGraph->get_member_perusecase(),\n\t\t\t'member_perusecaseApp' => $this->M_assignmentsGraph->get_member_perusecaseApp(), \n\t\t\t'member_pertribe' => $this->M_assignmentsGraph->get_member_pertribe(),\n\t\t\t'member_pertribeApp' => $this->M_assignmentsGraph->get_member_pertribeApp(),\n\t\t\t'inprogressUsecase' => $this->M_assignmentsGraph->progress_usecase_inprogress(),\n\t\t\t'doneUsecase' => $this->M_assignmentsGraph->progress_usecase_done(),\n\t\t\t'cancelUsecase' => $this->M_assignmentsGraph->progress_usecase_cancel(),\n\t\t\t'judul' => 'Use Case Summary - INSIGHT',\n\t\t\t'konten' => 'adm_views/home/monitoringUsecase',\n\t\t\t'admModal' => [],\n\t\t\t'footerGraph' => ['usecaseSummary/usecaseGraph']\n\t\t];\n\n\t\t$this->load->view('adm_layout/master', $data);\n\t}", "public function admitCardIndex(Request $request) {\n $students = collect();\n\n $class_id = $request->query->get('class_id',0);\n $exam_id = $request->query->get('exam_id',0);\n\n if($class_id && $exam_id){\n $settings = AppHelper::getAppSettings();\n $acYear = $settings['academic_year'];\n $students = Registration::where('class_id', $class_id)\n ->where('academic_year_id', $acYear)\n ->with('student')\n ->orderBy('student_id','asc')\n ->get();\n }\n\n $classes = IClass::where('status', AppHelper::ACTIVE)->orderBy('order', 'asc')->pluck('name', 'id');\n $exams = Exam::where('class_id', $class_id)->where('status', AppHelper::ACTIVE)->pluck('name', 'id');\n\n return view('backend.exam.admitCard.list', compact('students', 'classes', 'exams','class_id','exam_id'));\n }", "public function getSummary();", "public function index()\n {\n $students = Student::all()->take(5);\n \n $result = [];\n foreach ($students as $student) {\n $result [] = $this->ResultFormatter($student);\n }\n return $result;\n }", "public function show(Request $request)\n {\n\n $escuela = $request->input('school_name');\n\n\n $nota = DB::table('reviews')\n ->select(DB::raw('(AVG(puntuality)+ AVG(knowledge) + AVG(presentation) + AVG(notes)+ AVG(assistance)) as total'),'id_user_evaluated')\n ->whereIn('id_user_evaluated',\n $realuser = DB::table('teachers')\n ->select('id_user')\n ->whereIn('id_user', \n $review = DB::table('reviews')\n ->select('id_user_evaluated')\n ->whereIn('id_course',\n $cursos = DB::table('courses')\n ->select('id')\n ->whereIn('id_school',\n $id_escuelas = DB::table('schools')\n ->select('id')\n ->where('name',$escuela))->distinct())))->groupBy('id_user_evaluated')->orderByRaw('total DESC');\n\n $users = DB::table('users')\n ->joinSub($nota, 'reviewed', function($join){\n $join->on('reviewed.id_user_evaluated','=','users.id');\n })->limit(10)->get();\n\n //dd($users);\n $users->escuela = $escuela;\n return view('teacher.show_top')->with(compact('users'));\n\n }", "public function userReviews(): IActionResult\n {\n if ($this->isRoleError(\"reviewer\")) {\n return $this->redirectToHome();\n }\n\n $user = $this->ulm->getCurrentUser();\n\n $reviews = $this->db->getUserReviews($user->id);\n\n return $this->viewResultDB(\"UserReviews\", \"Moje recenze\", \"reviews\", $reviews);\n }", "public function showStatistics()\n {\n if(\\Entrust::can('see-statistics')){\n $nbOfGradesPerSubject = DB::table('grades')\n ->select(['subject_id', DB::raw('count(*)')])\n ->groupBy('subject_id')\n ->get();\n\n $nbOfGradesPerSubjectArray = array_pluck($nbOfGradesPerSubject, 'count(*)', 'subject_id');\n\n $subjects = Subject::all();\n $subjects = array_pluck($subjects, 'name');\n\n // $classroomId = $classroom->id;\n // $classroom = Classroom::findOrFail($classroomId);\n //\n // $students = User::where(\"usertable_type\", \"=\", \"class\")\n // ->where(\"usertable_id\", \"=\", $classroom->id)->orderBy('name', 'asc')->get();\n //\n //\n // $subjectIds = DB::table('classroom_subject')\n // ->select('subject_id')\n // ->where('classroom_id', '=', $classroom->id)\n // ->get();\n // $subjectIds = array_pluck($subjectIds, 'subject_id');\n // $subjects = Subject::find($subjectIds);\n return view('grade.statistics', ['nbOfGradesPerSubjectArray' => $nbOfGradesPerSubjectArray, 'subjects' => $subjects]);\n\n\n\n\n }\n\n }", "public function summaryAction()\n {\n // handle unfiltered collection\n $collection = $this->getCollection();\n return $this->toJson([\n 'numberOfTotalItems' => $collection->queryCount(),\n ]);\n }", "function processreviewAction()\r\n {\r\n if (!$this->config->isPhaseOpen(Config::REVIEWING_PHASE)) {\r\n $this->view->content = $this->texts->reviewer->review_phase_is_closed;\r\n echo $this->view->render(\"layout\");\r\n return;\r\n }\r\n\r\n $this->view->setFile(\"content\", \"processreview.xml\");\r\n $this->view->setBlock(\"content\", \"review\");\r\n // Extract the block with marks.\r\n $this->view->set_block('review', \"review_mark\", \"review_marks\");\r\n // Extracts the block with answers\r\n $this->view->set_block('review', \"review_answer\", \"review_answers\");\r\n\r\n\r\n // Actions if the id of a paper is submitted\r\n if (isSet($_REQUEST['idPaper'])) {\r\n $idPaper = $this->getRequest()->getParam(\"idPaper\");\r\n $reviewTbl = new Review();\r\n $review = $reviewTbl->find($idPaper, $this->user->id)->current();\r\n\r\n // Check that the paper is REALLY assigned to the reviewer\r\n if (is_object($review)) {\r\n\r\n // Put the review in the database\r\n $review->updateFromArray ($_POST);\r\n\r\n // Create the review presentation\r\n $this->view->review = $review->showReview($this->view, true) ;\r\n // Resolve the entities replacement\r\n $this->view->assign(\"content\", \"content\");\r\n \r\n // Send a mail to confirm review submission\r\n $mail = new Mail (Mail::SOME_USER, $this->texts->mail->subj_ack_review,\r\n $this->view->getScriptPaths());\r\n $mail->setFormat(Mail::FORMAT_HTML);\r\n $mail->setTo($this->user->email);\r\n\r\n $mail->loadTemplate ($this->lang, \"ack_review\");\r\n $mailViewEngine = $mail->getEngine();\r\n $mailViewEngine->setBlock(\"template\", \"template_mark\", \"template_marks\");\r\n $mailViewEngine->setBlock(\"template\", \"template_answer\", \"template_answers\");\r\n\r\n $instantiatedMail = $review->showReview($mailViewEngine, true, \"template\");\r\n $mail->setTemplate ($instantiatedMail);\r\n if ($this->config->mailOnReview == \"Y\") {\r\n $mail->setCopyToChair(true);\r\n }\r\n\r\n $mail->send();\r\n }\r\n else {\r\n $this->view->content = $this->texts->def->access_denied;;\r\n }\r\n }\r\n else {\r\n $this->view->content = \"Invalid action<br/>\";\r\n }\r\n echo $this->view->render(\"layout\");\r\n }", "static function getUserSummary($obj) {\n // Although the bookings field is not in use,\n // I've kept it to maintain compatibility with current Millenium responses\n\n return [\n 'recordNumber' => self::getAlmaBarCode($obj),\n 'bookings' => \"\",\n 'fines' => self::getField($obj, 'fees'),\n 'holds' => self::getField($obj, 'requests'),\n 'checkedOutItems' => self::getField($obj, 'loans')\n ];\n }", "public function postStudent(Request $request)\n {\n $l1t1=Exam::with('subject')\n ->where('department_id', $request->input('department_id'))\n ->where('students_id', $request->input('students_id'))\n ->where('quiz', $request->input('quiz'))\n ->where('levelTerm', 'l1t1')\n ->get();\n //check if first year first semester request quiz data present\n if(!count($l1t1)) {\n $notification= array('title' => 'Not Found!', 'body' => 'Any subject of first year first semester for '.$request->input('quiz').' not present!');\n return redirect()->back()->with(\"error\", $notification);\n }\n\n $L1T1data=(object)$this->dataManupulator($l1t1);\n $l1t2=Exam::with('subject')\n ->where('department_id', $request->input('department_id'))\n ->where('students_id', $request->input('students_id'))\n ->where('quiz', $request->input('quiz'))\n ->get();\n //check if first year second semester request quiz data present\n if(!count($l1t2)) {\n $notification= array('title' => 'Not Found!', 'body' => 'Any subject of first year second semester for '.$request->input('quiz').' not present!');\n return redirect()->back()->with(\"error\", $notification);\n }\n\n $L1T2data=(object)$this->dataManupulator($l1t2);\n $fyp=($L1T1data->totalPoint+$L1T2data->totalPoint);\n $fyc=$L1T1data->totalCredit+$L1T2data->totalCredit;\n $fyGPA=$fyp/$fyc;\n $fyData =[\n 'grade' => $this->yearGrade($fyGPA),\n 'point' => $fyGPA,\n 'credit' => $fyc,\n ];\n //First Year data colection code end\n $l2t1=Exam::with('subject')\n ->where('department_id', $request->input('department_id'))\n ->where('students_id', $request->input('students_id'))\n ->where('quiz', $request->input('quiz'))\n ->get();\n //check if second year first semester request quiz data present\n if(!count($l2t1)) {\n $notification= array('title' => 'Not Found!', 'body' => 'Any subject of second year first semester for '.$request->input('quiz').' not present!');\n return redirect()->back()->with(\"error\", $notification);\n }\n $L2T1data=(object)$this->dataManupulator($l2t1);\n $l2t2=Exam::with('subject')\n ->where('department_id', $request->input('department_id'))\n ->where('students_id', $request->input('students_id'))\n ->where('quiz', $request->input('quiz'))\n ->get();\n //check if second year second semester request quiz data present\n if(!count($l2t2)) {\n $notification= array('title' => 'Not Found!', 'body' => 'Any subject of second year second semester for '.$request->input('quiz').' not present!');\n return redirect()->back()->with(\"error\", $notification);\n }\n $L2T2data=(object)$this->dataManupulator($l2t2);\n $syp=($L2T1data->totalPoint+$L2T2data->totalPoint);\n $syc=$L2T1data->totalCredit+$L2T2data->totalCredit;\n $syGPA=$syp/$syc;\n $syData =[\n 'grade' => $this->yearGrade($syGPA),\n 'point' => $syGPA,\n 'credit' => $syc,\n ];\n //Second Year data colection code end\n $l3t1=Exam::with('subject')\n ->where('department_id', $request->input('department_id'))\n ->where('students_id', $request->input('students_id'))\n ->where('quiz', $request->input('quiz'))\n ->get();\n //check if third year first semester request quiz data present\n if(!count($l3t1)) {\n $notification= array('title' => 'Not Found!', 'body' => 'Any subject of Third year first semester for '.$request->input('quiz').' not present!');\n return redirect()->back()->with(\"error\", $notification);\n }\n $L3T1data=(object)$this->dataManupulator($l3t1);\n $l3t2=Exam::with('subject')\n ->where('department_id', $request->input('department_id'))\n ->where('session', $request->input('session'))\n ->where('students_id', $request->input('students_id'))\n ->where('quiz', $request->input('quiz'))\n ->where('levelTerm', 'l3t2')\n ->get();\n //check if third year second semester request quiz data present\n if(!count($l3t2)) {\n $notification= array('title' => 'Not Found!', 'body' => 'Any subject of third year second semester for '.$request->input('quiz').' not present!');\n return redirect()->back()->with(\"error\", $notification);\n }\n $L3T2data=(object)$this->dataManupulator($l3t2);\n $typ=($L3T1data->totalPoint+$L3T2data->totalPoint);\n $tyc=$L3T1data->totalCredit+$L3T2data->totalCredit;\n $tyGPA=$typ/$tyc;\n $tyData =[\n 'grade' => $this->yearGrade($tyGPA),\n 'point' => $tyGPA,\n 'credit' => $tyc,\n ];\n //third Year data colection code end\n\n\n $l4t1=Exam::with('subject')\n ->where('department_id', $request->input('department_id'))\n ->where('session', $request->input('session'))\n ->where('students_id', $request->input('students_id'))\n ->where('quiz', $request->input('quiz'))\n ->where('levelTerm', 'l4t1')\n ->get();\n\n //check if 4th year first semester request quiz data present\n if(!count($l4t1)) {\n $notification= array('title' => 'Not Found!', 'body' => 'Any subject of 4th year first semester for '.$request->input('quiz').' not present!');\n return redirect()->back()->with(\"error\", $notification);\n }\n $L4T1data=(object)$this->dataManupulator($l4t1);\n $l4t2=Exam::with('subject')\n ->where('department_id', $request->input('department_id'))\n ->where('session', $request->input('session'))\n ->where('students_id', $request->input('students_id'))\n ->where('quiz', $request->input('quiz'))\n ->where('levelTerm', 'l4t2')\n ->get();\n //check if 4th year second semester request quiz data present\n if(!count($l4t2)) {\n $notification= array('title' => 'Not Found!', 'body' => 'Any subject of 4th year second semester for '.$request->input('quiz').' not present!');\n return redirect()->back()->with(\"error\", $notification);\n }\n $L4T2data=(object)$this->dataManupulator($l4t2);\n\n $t4yp=($L4T1data->totalPoint+$L4T2data->totalPoint);\n $t4yc=$L4T1data->totalCredit+$L4T2data->totalCredit;\n $t4yGPA=$typ/$tyc;\n $t4yData =[\n 'grade' => $this->yearGrade($t4yGPA),\n 'point' => $t4yGPA,\n 'credit' => $t4yc,\n ];\n //4th Year data colection code end\n\n\n //result Data\n $fPoint = (($fyp+$syp+$typ+$t4yp)/($fyc+$syc+$tyc+$t4yc));\n $fGrade= $this->yearGrade($fPoint);\n $fResult=\"FAIL\";\n if($fPoint>0.00) {\n $fResult=\"PASS\";\n }\n $result=[\n 'point' => $fPoint,\n 'grade' =>$fGrade,\n 'result' => $fResult,\n ];\n $student= Student::findOrFail($request->input('students_id'));\n $metaDatas= [\n 'name' => $student->firstName.' '.$student->middleName.' '.$student->lastName,\n 'dob' => $student->dob->format('F j,Y'),\n ];\n $metaData= (object)$metaDatas;\n return view(\n 'reports.result.transcript', compact(\n 'metaData',\n 'L1T1data', 'L1T2data', 'fyData',\n 'L2T1data', 'L2T2data', 'syData',\n 'L3T1data', 'L3T2data', 'tyData',\n 'L4T1data', 'L4T2data', 't4yData',\n 'result'\n )\n );\n }", "function getReview()\n {\n $this->logged_in = $this->flexi_auth->is_logged_in();\n if (!$this->logged_in) {\n # if not logged show error message\n $dataArr = array();\n $pageArr = array('controller' => 'review', 'view' => 'error');\n $this->ajax->render($pageArr, $dataArr);\n }\n\n $receiver_id = intval($this->input->post('receiver_id'));\n if (!$receiver_id) {\n $dataArr = array();\n $pageArr = array('controller' => 'review', 'view' => 'error');\n $this->ajax->render($pageArr, $dataArr);\n }\n\n $login_id = $this->flexi_auth->get_user_id();\n $reviewDtlArr = $this->review->getReviewsByReceiver($receiver_id);\n $receiverArr = array();\n $userDtlArr = array();\n if (count($reviewDtlArr)) {\n foreach ($reviewDtlArr as $key => $value) {\n # code...\n array_push($receiverArr, $value['sender_id']);\n }\n array_push($receiverArr, $receiver_id);\n $receiverArr = array_unique($receiverArr);\n $receiverArr = array_filter($receiverArr);\n\n if (count($receiverArr)) {\n\n foreach ($receiverArr as $key_2 => $value_2) {\n # code...\n $tempUserArr = array();\n array_push($tempUserArr, $this->user->getUserDetailsById($value_2));\n $userDtlArr[$value_2] = isset($tempUserArr[0][0]) ? $tempUserArr[0][0] : '';\n }\n }\n $userDtlArr = array_filter($userDtlArr);\n\n $pageArr = array(\n 'controller' => 'review',\n 'view' => 'show_review'\n );\n $dataArr = array(\n 'receiver_id' => $receiver_id,\n 'review_count' => true,\n 'userDtlArr' => $userDtlArr,\n 'reviewDtlArr' => $reviewDtlArr\n );\n $this->ajax->render($pageArr, $dataArr);\n\n } else {\n $tempUserArr = $this->user->getUserDetailsById($receiver_id);\n $userDtlArr[$receiver_id] = isset($tempUserArr[0]) ? $tempUserArr[0] : '';\n #print_r($userDtlArr);\n $pageArr = array(\n 'controller' => 'review',\n 'view' => 'show_review'\n );\n $dataArr = array(\n 'receiver_id' => $receiver_id,\n 'review_count' => false,\n 'userDtlArr' => $userDtlArr\n );\n $this->ajax->render($pageArr, $dataArr);\n }\n\n\n }", "protected function score(): JsonResponse\n {\n $user = Auth::user();\n if ($user) {\n return response()->json([\n 'score' => $user->score,\n 'number_of_new_changelogs' => $user->unreadNotifications()->count(),\n 'number_of_questions' => $user->dailyQuestions()->count(),\n 'numberOfMentalQuestions' => $user->dailyMentalQuestions()->count(),\n 'userId' => $user->id,\n ]);\n }\n }", "public function showResults(){\n $this->extractQuestions();\n }", "function getReviewInfo($reviewPassed) {\n $author = $reviewPassed[0][1];\n $timestamp = $reviewPassed[1];\n $content = $reviewPassed[3];\n $stars = $reviewPassed[4];\n $fullreview = [$author, $timestamp, $content, $stars];\n return $fullreview;\n}", "public function view_summary(stdClass $submission, & $showviewlink) {\n global $DB;\n\n $showviewlink = true;\n\n $count = $DB->count_records(\n SKETCHFAB_DB_TABLE,\n array(\n 'assignment' => $this->assignment->get_instance()->id,\n 'submission' => $submission->id\n )\n );\n return get_string(\n $count == 1 ? 'countitem_single' : 'countitem_plural',\n 'assignsubmission_sketchfab',\n $count\n );\n }", "function block_risk_monitor_generate_student_view($userid, $courseid) {\n \n global $CFG, $USER, $COURSE, $DB;\n \n $content = '';\n if(count($questionnaires = block_risk_monitor_get_questionnaires($userid, $courseid)) !== 0) {\n $content = '<b>Questionnaires:</b><br>';\n foreach($questionnaires as $questionnaire) {\n if($questionnaire->title != null) {\n $title = $questionnaire->title;\n }\n else {\n $title = \"Questionnaire\";\n }\n $content .= html_writer::link(new moodle_url('/blocks/risk_monitor/student_block/student_questionnaire.php', array('userid' => $USER->id, 'courseid' => $COURSE->id, 'questionnaireid' => $questionnaire->id)), $title.\"<br>\");\n }\n $content .= \"<br>\";\n }\n \n if(count($interventions = block_risk_monitor_get_interventions($userid, $courseid)) !== 0) {\n $content .= '<b>Helpful resources:</b><br>';\n foreach($interventions as $intervention) {\n $intervention_template = $DB->get_record('block_risk_monitor_int_tmp', array('id' => $intervention->interventiontemplateid));\n $content .= html_writer::link(new moodle_url('/blocks/risk_monitor/student_block/student_help.php', array('userid' => $USER->id, 'courseid' => $COURSE->id, 'interventionid' => $intervention_template->id)), $intervention_template->title.\"<br>\");\n }\n }\n \n return $content;\n}", "public function mortality_summary()\n {\n if(Auth::user()->access != 1 )\n {\n abort(403);\n }\n $action = route('people_show');\n\n $data = compact('action');\n\n return view('hact.reports.mortality', $data);\n }", "public static function employer_rating_score($employer_id) {\n global $wpdb;\n $sql = \"SELECT AVG(M.meta_value) as rate_point, COUNT(C.comment_ID) as count\n FROM $wpdb->posts as p \n join $wpdb->comments as C \n ON p.ID = c.comment_post_ID \n join $wpdb->commentmeta as M \n ON C.comment_ID = M.comment_id\n WHERE \n p.post_author = $employer_id\n AND p.post_status ='complete'\n AND p.post_type ='\" . PROJECT . \"' \n AND M.meta_key = 'et_rate'\n AND C.comment_type ='fr_review'\n AND C.comment_approved = 1\";\n \n $results = $wpdb->get_results($sql);\n if($results) {\n return array('rating_score' => $results[0]->rate_point , 'review_count' => $results[0]->count );\n }else {\n return array('rating_score' => 0 , 'review_count' => 0 ); \n }\n }", "public function view(User $user, Student $student)\n {\n if($user->hasPermissionTo(\"view students\")){\n return Response::allow();\n }\n return Response::deny(__('message.UnauthorizedViewStd'),401);\n }", "public function view(Review $review);", "public function store(Request $request)\n {\n $submitted_exam = $request->all();\n $exam_id = $submitted_exam['exam_id'];\n $user_id = Auth::user()->id;\n $score = 0;\n $each_question_marks = 5;\n $total_questions = $submitted_exam['total_questions'];\n for($x=1;$x<=$total_questions;$x++)\n {\n if($submitted_exam['answer'.$x]==$submitted_exam['correct_answer'.$x])\n {\n $score = $score + $each_question_marks;\n }\n }\n \\App\\AssignExam::where('exam_id',$exam_id)->where('user_id',$user_id)->update(['score'=>$score,'test_status'=>1]);\n return redirect('student')->with('success', 'Your exam has been submitted');\n }", "function outputAttemptedTests() {\n $con = mysqli_connect('localhost', 'root', '', 'online-examination-system');\n if($con == false){\n die(\"Error: Could not connect \". mysqli_connect_errno());\n }else{\n $student = $_COOKIE[\"student_loggedIn\"];\n \n $query = \"\n SELECT test_id , marks_obtained\n FROM responses \n WHERE student_id = '$student'\n \"; \n\n $result = mysqli_query($con, $query);\n $row_count = mysqli_num_rows($result);\n if($row_count == 0){\n $mssg = '\n <div class=\"alert alert-danger container\" role=\"alert\" style>\n There are no test to show.\n </div>\n ';\n echo $mssg;\n }\n while($row = mysqli_fetch_array($result, MYSQLI_NUM)){\n \n $test_id = $row[0];\n $marks_obtained = $row[1];\n\n $query2 = \"\n SELECT test_subject, test_topic, test_num_of_ques\n FROM test_details\n WHERE test_id = '$test_id'\n \";\n\n $result2 = mysqli_query($con, $query2);\n\n if(!$result){\n die(\"Error: Could not connect.\");\n }else{\n $row2 = mysqli_fetch_array($result2, MYSQLI_NUM);\n $subject = $row2[0];\n $topic = $row2[1];\n $number_of_ques = $row2[2];\n\n $HTML = \"\n <div class=\\\"card col-sm-6 col-md-4\\\" style=\\\"width: 8rem; padding: 1rem;\\\">\n <img src=\\\"./../img/\".$subject.\".jpg\\\" class=\\\"card-img-top\\\" alt=\\\"\".$subject.\"\\\" style=\\\"height:30vh;\\\">\n <div class=\\\"card-body\\\">\n <h5 class=\\\"card-title\\\">\".$subject.\"</h5>\n <p class=\\\"card-text\\\">\n <p>TOPIC : <span style=\\\"font-weight:bold;\\\">\".$topic.\"</span></p>\n <p>MARKS OBTAINED : <span style=\\\"font-weight:bold;\\\">\".$marks_obtained.\" out of \".$number_of_ques.\"</span></p>\n </p>\n <form method=\\\"GET\\\" action=\\\"./test_responses.php\\\">\n <input type=\\\"submit\\\" id=\\\"\".$test_id.\"\\\" name=\\\"\".$test_id.\"\\\" value=\\\"Check answers\\\" class=\\\"btn btn-info\\\" >\n </form>\n </div>\n </div>\n \";\n\n echo $HTML;\n }\n \n }\n }\n }", "public function getTotalStudentWithCourse(Student $student)\n {\n \\DB::connection()->enableQueryLog();\n $data = Student::with('payments')->whereHas('payments')->get();\n $queries = \\DB::getQueryLog();\n return view('other.index', [ 'students' => $data, 'query' => $queries, 'name' => 'Get Total Student with at least 1 course' ]);\n }", "public function postAction(){\n $return_result = array(\n 'code'=> 0,\n 'model'=> null,\n );\n $params = $this->postJsonParams();\n $product_id = $params('product_id');\n\n if ($data = Mage::getSingleton('review/session')->getFormData(true)) {\n $rating = array();\n if (isset($data['ratings']) && is_array($data['ratings'])) {\n $rating = $data['ratings'];\n }\n } else {\n $data = $params;\n $rating = isset($params['ratings'])?$params['ratings']:array();\n }\n $product = Mage::getModel('catalog/product')->setStoreId(Mage::app()->getStore()->getId())->load($product_id);\n if (($product) && !empty($data)) {\n $session = Mage::getSingleton('core/session');\n /* @var $session Mage_Core_Model_Session */\n $review = Mage::getModel('review/review')->setData($data);\n /* @var $review Mage_Review_Model_Review */\n $validate = $review->validate();\n if ($validate === true) {\n try {\n $review->setEntityId($review->getEntityIdByCode(Mage_Review_Model_Review::ENTITY_PRODUCT_CODE))\n ->setEntityPkValue($product->getId())\n ->setStatusId(Mage_Review_Model_Review::STATUS_PENDING)\n ->setCustomerId(Mage::getSingleton('customer/session')->getCustomerId())\n ->setStoreId(Mage::app()->getStore()->getId())\n ->setStores(array(Mage::app()->getStore()->getId()))\n ->save();\n foreach ($rating as $ratingId => $optionId) {\n Mage::getModel('rating/rating')\n ->setRatingId($ratingId)\n ->setReviewId($review->getId())\n ->setCustomerId(Mage::getSingleton('customer/session')->getCustomerId())\n ->addOptionVote($optionId, $product->getId());\n }\n $review->aggregate();\n $return_result['message'] = 'Your review has been accepted for moderation.';\n }\n catch (Exception $e) {\n $return_result['code'] = 1;\n $return_result['error'] = 'Unable to post the review.';\n }\n }\n else {\n $session->setFormData($data);\n if (is_array($validate)) {\n foreach ($validate as $errorMessage) {\n $return_result['error'] = $errorMessage;\n }\n }\n else {\n $return_result['error'] = 'Unable to post the review.';\n }\n }\n }\n echo json_encode($return_result);\n }", "public function index(){\n\t\t$sessionId = $_POST[\"sessionId\"];\n\t\t$serviceCode = $_POST[\"serviceCode\"];\n\t\t$phoneNumber = $_POST[\"phoneNumber\"];\n\t\t$text = $_POST[\"text\"];\n\n\t\t$user_responses = explode('*', $text);\n\t\t$personal_info = personal_info::all();\n\n\t\tif ($text == \"\") {\n\t\t // This is the first request. Note how we start the response with CON\n\t\t $response = \"CON Welcome to SMPS Parent Portal \\n\";\n\t\t $response .= \"Please enter your child's registration number\\n\";\n\n\t\t} else if (((count($user_responses)) == 1) && ($user_responses[0] !== \"\")){\n\t\t foreach ($personal_info as $student) {\n\t if ($user_responses[0] == $student->reg_no){\n\t $response = \"CON Enter service number: \\n\";\n\t\t \t\t$response .= \"(Use the parent phone number submitted during student registration) \\n\";\n\t\t \t\tbreak;\n\t }\n\n\t $response = \"END Registration number not found.\";\n }\n\t\t \n\n\t\t} else if (((count($user_responses)) == 2) && ($user_responses[1] !== \"\")){\n\t\t\tforeach ($personal_info as $student) {\n\t if ($user_responses[1] == $student->parent_phone){\n\t\t\t\t $response = \"CON Please select an option: \\n\";\n\t\t\t\t $response .= \"1. Discipline status \\n\";\n\t\t\t\t $response .= \"2. Exam results \\n\";\n\t\t\t\t $response .= \"3. Financial information \\n\";\n\t\t \t\tbreak;\n\t }\n\n\t $response = \"END Invalid service number\";\n\t\t\t}\n\t \n\n\n\t\t} else if($user_responses[2] == \"1\") { \n\t\t\t$student = Discipline::where('reg_no', $user_responses[0])->first();\n\n\t\t $response = \"END Discipline status:\\n\" .$student->reg_no.\"\\n\" .$student->student_name .\"\\n\" .$student->status;\n\n\t\t} else if($user_responses[2] == \"2\") {\n\t\t\t$student = Exam1::where('reg_no', $user_responses[0])->first();\n\n\t\t $response = \"END Exam results:\\n\" .$student->reg_no.\"\\n\" .$student->student_name .\"\\nCIT 3451:\" .$student->unit_code1 .\"\\nCIT 3451:\" .$student->unit_code2 .\"\\nCIT 3451:\" .$student->unit_code3 .\"\\nCCS 3350:\" .$student->unit_code4 .\"\\nBFB 3252:\" .$student->unit_code5 .\"\\nCIT 2252:\" .$student->unit_code6 .\"\\nCIc 3454:\" .$student->unit_code7 .\"\\nCIT 3453:\" .$student->unit_code8 .\"\\nSPS 3300:\" .$student->unit_code9;\n\n\t\t} else if($user_responses[2] == \"3\") {\n\t\t\t$student = Financials::where('reg_no', $user_responses[0])->first();\n\t\t $response = \"END Financial information\\n\" .$student->reg_no.\"\\n\" .$student->student_name .\"\\nAmount to be paid: \" .$student->amount_to_be_paid .\"\\nAmount paid: \" .$student->amount_paid .\"\\nBalance: \" .$student->balance;\n\t\t}\n\n\t\t// Echo the response back to the API\n\t\theader('Content-type: text/plain');\n\t\techo $response;\n\n\n }", "public function calc_score($stud_id = null)\r\n {\r\n \t$tbl_stats = Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_EXERCICES);\r\n \t$sql = 'SELECT * FROM '.$tbl_stats\r\n \t\t\t.\" WHERE exe_cours_id = '\".$this->get_course_code().\"'\"\r\n \t\t\t.' AND exe_exo_id = '.$this->get_ref_id();\r\n \t\r\n \tif (isset($stud_id))\r\n \t\t$sql .= ' AND exe_user_id = '.$stud_id;\r\n \t\t\r\n \t// order by id, that way the student's first attempt is accessed first\r\n\t\t$sql .= ' ORDER BY exe_id';\r\n\r\n \t$scores = api_sql_query($sql, __FILE__, __LINE__);\r\n\r\n\t\t// for 1 student\r\n \tif (isset($stud_id))\r\n \t{\r\n \t\tif ($data=mysql_fetch_array($scores))\r\n \t\t\treturn array ($data['exe_result'], $data['exe_weighting']);\r\n \t\telse\r\n \t\t\treturn null;\r\n \t}\r\n \t\r\n \t// all students -> get average\r\n \telse\r\n \t{\r\n \t\t$students=array(); // user list, needed to make sure we only\r\n \t\t\t\t\t\t\t// take first attempts into account\r\n\t\t\t$rescount = 0;\r\n\t\t\t$sum = 0;\r\n\r\n\t\t\twhile ($data=mysql_fetch_array($scores))\r\n\t\t\t{\r\n\t\t\t\tif (!(array_key_exists($data['exe_user_id'],$students)))\r\n\t\t\t\t{\r\n\t\t\t\t\tif ($data['exe_weighting'] != 0)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$students[$data['exe_user_id']] = $data['exe_result'];\r\n\t\t\t\t\t\t$rescount++;\r\n\t\t\t\t\t\t$sum += ($data['exe_result'] / $data['exe_weighting']);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif ($rescount == 0)\r\n\t\t\t\treturn null;\r\n\t\t\telse\r\n\t\t\t\treturn array ($sum , $rescount);\r\n \t}\r\n }", "public function buildResponseExport($studentResponse, $attempt, $answerDictionary) {\n $this->answerDictionary = $answerDictionary;\n $response = StudentResponse::addGeneralInfoToResponse($studentResponse, $attempt);\n $selectedAnswers = $studentResponse[$this->RESPONSE_TYPE];\n $response['answer'] = $selectedAnswers[0][$this->TEXT_FIELD];\n $this->addQuestionToExport($selectedAnswers, $response);\n return $response;\n }", "public function index()\n {\n $result = student::orderBy('Answer', 'desc')->get();\n return view('/exam.result', compact('result'));\n }", "public function showStudentAttendance(Request $request, $student_id)\n {\n $class_id = $request->class_id;\n $role = Auth::user()->userable->userable_type;\n $student = Student::find($student_id);\n $class = Room::find($class_id);\n $attendances = $student->attendances()->where('room_id', '=', $class_id)->get();\n $num = 1;\n $chartNum = 1;\n\n return view('admin.attendance.attendance-show', compact('student', 'attendances', 'class', 'num', 'chartNum','role'));\n }", "public function studentsListing() {\n \t$students = Student::all();\n \tif(count($students) > 0) {\n \t\treturn response() -> json([\"status\" => $this->status, \"success\" => true, \"count\" => count($students), \"data\" => $students]);\n \t}\n \telse {\n \t\treturn response()->json([\"status\" => \"failed\", \"success\" => false, \"message\" => \"Whoops! no record found\"]);\n \t}\n }", "public function scores($id){\n\t\t$user_id = Auth::user()->id;\n\n\t\t$quiz_schedule = QuizSchedule::find($id);\n\n\t\tif($quiz_schedule->user_id != $user_id){\n\t\t\treturn Redirect::to('/finished')\n\t\t\t\t->with('message', array('type' => 'danger', 'text' => 'You do not have the permission to view scores for this quiz.'));\n\t\t}\n\n\t\t$quiz = Quiz::find($quiz_schedule->quiz_id);\n\n\t\t$quiz_item_count = DB::table('quiz_items')\n\t\t\t->where('quiz_id', '=', $quiz_schedule->quiz_id)\n\t\t\t->count();\n\n\t\t$class = DB::table('classes')\n\t\t\t->where('id', '=', $quiz_schedule->class_id)\n\t\t\t->first();\n\n\t\t$scores = DB::table('student_quizzes')\n\t\t\t->where('quiz_schedule_id', '=', $id)\n\t\t\t->lists('score', 'student_id');\n\n\t\t$students = DB::table('students')\n\t\t\t->join('student_classes', 'students.id', '=', 'student_classes.student_id')\n\t\t\t->select('students.id', 'last_name', 'first_name', 'middle_initial')\n\t\t\t->where('student_classes.class_id', '=', $class->id)\n\t\t\t->orderBy('gender', 'DESC')\n\t\t\t->orderBy('last_name', 'ASC')\n\t\t\t->get();\n\n\t\t$student_scores = array();\n\n\t\tforeach($students as $student){\n\n\t\t\t$score = '';\n\t\t\n\t\t\tif(isset($scores[$student->id])){\n\t\t\t\t$score = $scores[$student->id];\n\t\t\t}\n\n\t\t\t$student_scores[] = array(\n\t\t\t\t'id' => $student->id,\n\t\t\t\t'last_name' => $student->last_name,\n\t\t\t\t'first_name' => $student->first_name,\n\t\t\t\t'middle_initial' => $student->middle_initial,\n\t\t\t\t'score' => $score\n\t\t\t);\n\n\t\t}\n\n\t\t\n\t\t$page_data = array(\n\t\t\t'class' => $class,\n\t\t\t'quiz' => $quiz,\n\t\t\t'quiz_item_count' => $quiz_item_count,\n\t\t\t'quiz_schedule' => $quiz_schedule,\n\t\t\t'student_scores' => $student_scores\n\t\t);\n\n\t\t$this->layout->title = 'Scores in ' . $quiz->title;\n\t\t$this->layout->content = View::make('admin.scores', $page_data);\n\n\t}", "public function index()\n {\n $results = new Result();\n $subjects = new Subject();\n $students = new Student();\n $result_list = Result::orderBy('student_id')->get()->groupBy(function ($item) {\n return $item->student_id;\n });\n\n return view('manage-results.report-test', compact('results', 'subjects', 'result_list', 'students'));\n }", "public function getReviewerCountAction(Request $request)\n {\n if ($request->get('_format') == \"html\") {\n throw new NotFoundHttpException();\n }\n if (!$this->isGranted(\"IS_AUTHENTICATED_FULLY\")) {\n throw new AccessDeniedHttpException();\n }\n\n $articleManager = $this->getJsService()->getArticleManager();\n $reviewRequestmanager=$this->getJsService()->getReviewREquestManager();\n $reviewManager=$this->getJsService()->getReviewManager();\n\n $user = $articleManager->getConnectedUser();;\n\n $reviewRequest=$reviewRequestmanager->countPendingByReviewer($user, \"\");\n $revisionInProgress=$reviewManager->countAllByReviewerByStatus($user, Review::$REVIEW_IN_PROGRESS);\n $submittedReviews=$reviewManager->countAllByReviewerByStatus($user, Review::$REVIEW_SUBMITTED);\n $validatedReviews=$reviewManager->countAllByReviewerByStatus($user, Review::$REVIEW_VALIDATED);\n $rejectedReviews=$reviewManager->countAllByReviewerByStatus($user, Review::$REVIEW_REJECTED);\n $completedReview=3;\n\n return array(\n \"reviewRequest\" => $reviewRequest,\n \"reviewInProgress\" => $revisionInProgress,\n \"submittedReviews\" => $submittedReviews,\n \"validatedReviews\" => $validatedReviews,\n \"rejectedReviews\" => $rejectedReviews\n );\n }", "function get_user_score() \n\t{\n\t\t$this->load->model('frontendmodel');\n\n\t\t$arrResult = $this->frontendmodel->FetchResult();\n\n\t\t$intCounter = 0;\n\n\t\tforeach ($arrResult as $key => $value) \n\t\t{\n\t\t\tif($value['result'] && $value['includeinscoring'])\n\t\t\t{\n\t\t\t\t$intCounter = $intCounter + 1;\n\t\t\t}\n\t\t}\n\t\t\n\t\techo $intCounter;\n\t}", "public function indexResults(Request $request)\n {\n $this->authorize('manage', MrAndMissVote::class);\n\n $results = MrAndMissVote::select(DB::raw('count(*) as count, users.name, votee_name, title, mr, custom'))\n ->where('semester', Semester::current()->id)\n ->join('mr_and_miss_categories', 'mr_and_miss_categories.id', '=', 'mr_and_miss_votes.category')\n ->leftJoin('users', 'users.id', '=', 'mr_and_miss_votes.votee_id')\n ->groupBy(['title', 'users.name', 'votee_name', 'mr', 'custom'])\n ->orderBy('mr_and_miss_categories.id')\n ->get();\n\n return view('student-council.mr-and-miss.results', ['results' => $results]);\n }", "function result_summary() {\n global $db;\n\n $scoring_expr = sql_scoring_expression('finishtime', 'finishplace');\n $raw_expr = read_raceinfo_boolean('use-points') ? 'finishplace' : 'finishtime';\n if (read_raceinfo_boolean('use-points')) {\n if (read_raceinfo_boolean('drop-slowest')) {\n $avg_expr = (1 + get_lane_count()).' * (COUNT(*) - 1) - (SUM(finishplace) - MAX(finishplace))';\n } else {\n $avg_expr = (1 + get_lane_count()).' * COUNT(*) - SUM(finishplace)';\n }\n } else {\n $avg_expr = $scoring_expr;\n }\n\n // GROUP BY makes each returned row a summary of the outcome for one racer in\n // one round.\n //\n // ORDER BY means rows are ordered from best showing to worst, which means\n // they're also ordered best to worst within any given group.\n $stmt = $db->query('SELECT Rounds.roundid,'\n .' Rounds.classid as round_classid, '\n .' RegistrationInfo.racerid, firstname, lastname, carnumber, carname,'\n // classid is the racer's 'native' class, not the round's class (e.g. Grand Finals)\n .' RegistrationInfo.classid, class, RegistrationInfo.rankid, rank,'\n // base is the number of heats in the round\n .' COUNT(*) AS base, '\n .$scoring_expr.' AS score, '.$avg_expr.' AS avg,'\n .' MIN('.$raw_expr.') AS best, MAX('.$raw_expr.') AS worst'\n .' FROM '.inner_join('RegistrationInfo', 'RaceChart',\n 'RaceChart.racerid = RegistrationInfo.racerid',\n 'Rounds',\n 'RaceChart.roundid = Rounds.roundid',\n 'Classes',\n 'RegistrationInfo.classid = Classes.classid',\n 'Ranks',\n 'RegistrationInfo.rankid = Ranks.rankid')\n .' WHERE passedinspection = 1 AND exclude = 0'\n .' AND (finishtime IS NOT NULL OR finishplace IS NOT NULL)'\n // Of these, only the roundid and racerid are meaningful grouping keys; each of the other\n // values is uniquely determined by the racerid.\n .' GROUP BY Rounds.roundid, RegistrationInfo.racerid, RegistrationInfo.classid, '\n .' Rounds.classid, class, RegistrationInfo.rankid, rank, firstname, lastname, carnumber'\n // lastname, firstname for reproducible ordering in the event of a tie\n .' ORDER BY '.$scoring_expr.', lastname, firstname');\n $stmt->setFetchMode(PDO::FETCH_ASSOC);\n $result = array();\n foreach ($stmt as $row) {\n $result[] = $row;\n }\n\n return $result;\n}", "public function index()\n\t{\n\t\t$reviews = Review::all();\n\t\tforeach ($reviews as $key => $value) {\n\t\t\t$value->number = count($value->solutions);\n\t\t}\n\t\treturn $reviews;\n\t}" ]
[ "0.62471807", "0.5637715", "0.5610492", "0.55261534", "0.55089617", "0.5500859", "0.54301894", "0.5415672", "0.54149866", "0.5366875", "0.53526556", "0.53455746", "0.5342067", "0.5313038", "0.5310777", "0.52997404", "0.52992296", "0.5277592", "0.5263583", "0.5248486", "0.5234824", "0.5232053", "0.5225814", "0.5201436", "0.517936", "0.5157612", "0.5149631", "0.5146641", "0.51250124", "0.51177585", "0.510022", "0.50951284", "0.5083947", "0.5067499", "0.5047691", "0.50040203", "0.49932143", "0.4993086", "0.49838012", "0.4983635", "0.49811056", "0.49797925", "0.4975823", "0.49732348", "0.49684554", "0.49648872", "0.49611077", "0.4947909", "0.494077", "0.49341515", "0.49235922", "0.49107164", "0.48995242", "0.4892584", "0.4889696", "0.48888102", "0.4887863", "0.48793995", "0.48792154", "0.4879012", "0.487358", "0.48698992", "0.48690838", "0.48645067", "0.48545364", "0.4850216", "0.48442754", "0.4837007", "0.48366228", "0.48266864", "0.48213106", "0.48195845", "0.4816667", "0.4810125", "0.4807923", "0.4805233", "0.48012805", "0.48007867", "0.47993922", "0.4792289", "0.4791547", "0.47908294", "0.47881782", "0.47851884", "0.47812876", "0.47791666", "0.47755972", "0.4769471", "0.47601554", "0.47587487", "0.47546813", "0.47509038", "0.47466353", "0.47434092", "0.47407135", "0.472752", "0.47174653", "0.4715668", "0.47103363", "0.4707498" ]
0.58027303
1
Returns true if the given response is considered valid or complete.
public function is_complete_response(array $response) { //a response without an answer is not a compelte response if(!array_key_exists('answer', $response)) { return false; } //determine gradability based on response type switch($this->response_mode) { //in string mode, accept any non-empty string case qtype_scripted_response_mode::MODE_STRING: case qtype_scripted_response_mode::MODE_STRING_CASE_SENSITIVE: return $response['answer'] !== ''; //in numeric mode, accept any numeric string case qtype_scripted_response_mode::MODE_NUMERIC: return is_numeric($response['answer']); //in binary mode, check to see if the number is valid binary using a regex case qtype_scripted_response_mode::MODE_BINARY: return preg_match('#^(0b|\%)?[01]+$#', $response['answer']) !== 0 || (array_key_exists('answer', $response) && empty($response['answer'])); //do the same for hexadecimal case qtype_scripted_response_mode::MODE_HEXADECIMAL: return preg_match('#^(0x|\$)?[0-9a-fA-F]+$#', $response['answer']) !== 0; //do the same for octal case qtype_scripted_response_mode::MODE_OCTAL: return preg_match('#^(0o|\@)?[0-7]+$#', $response['answer']) !== 0; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function isValid()\n\t{\n\t\treturn $this->response\n\t\t\t&& $this->response->isValid();\n\t}", "public function is_complete_response(array $response)\n {\n //otherwise, try processing it\n try\n {\n //process the user's response\n $this->process_response($response);\n return true;\n }\n catch(SimulationException $e)\n {\n return false; \n }\n }", "public function isValidResponse(){\n\t\treturn $this->isLoaded(); \n\t}", "public function hasResponse()\n {\n return null !== $this->response;\n }", "public function hasResponse(): bool\n {\n return $this->response !== null;\n }", "public function hasResponse(): bool\n {\n return null !== $this->response;\n }", "public function hasResponse(): bool\n {\n return ! ($this->response === null);\n }", "public function isOk()\n {\n return $this->status == 'success' || $this->status == 'incomplete';\n }", "public function isSuccess()\n {\n return ($this->isValidArray($this->response) && !isset($this->errorStack['error']));\n }", "public function isSuccessful()\n {\n return isset($this->data['response_code']) \n && \n ( substr($this->data['response_code'], 2) == '000' );\n }", "private function successFrom($response)\n {\n return $response['success'] == 1\n || $response['token'] != null;\n }", "public function isOk() : bool\n {\n return $this->m_responseCode === 200;\n }", "public function isSuccessful()\n {\n return $this->response->getStatusCode() >= 200 && $this->response->getStatusCode() < 300;\n }", "public function isOk()\n {\n $result = false;\n \n if ($this->m_responseArray['result'] == 'success')\n {\n $result = true;\n }\n \n return $result;\n }", "private function is_successful(array $response)\n {\n $status_code = $this->get_response_status_code($response);\n\n if (null === $status_code) {\n return false;\n }\n\n return $status_code >= 200 && $status_code < 300;\n }", "public function isResponse(): bool {\n return $this->options['response'] ?? false;\n }", "public function isOk() : bool\n {\n return $this->m_responseCode === 201;\n }", "public function isValid() : bool\n {\n return in_array($this->getStatusCode(), Response::CODE_LIST);\n }", "protected function validateResponse(array $response)\n {\n return (isset($response['response'])\n && ($response['response'] == self::RESPONSE_SUCCESS && isset($response['data'])\n || $response['response'] == self::RESPONSE_FAILED && isset($response['info'])));\n }", "public function isValid() {\n\n $valid = true;\n\n if ($this->isSecure()) {\n $valid = $valid && ($this->secureResponseCode == 200) && ($this->insecureResponseCode >= 200) && ($this->insecureResponseCode < 303);\n } else {\n $valid = $this->insecureResponseCode == 200;\n }\n\n return $valid;\n }", "public function isOk()\n {\n if ($this->statusCode >= 200 && $this->statusCode < 400) {\n return true;\n }\n\n return false;\n }", "public function isValid() {\n\t\t$isValid = true;\n\t\tif(ResponseValidator::isStringValid($this->contextCode) == false) {\n\t\t\t$isValid = false;\n\t\t}\n\t\telse if(ResponseValidator::isStringValid($this->ns) == false) {\n\t\t\t$isValid = false;\n\t\t}\n\t\telse if(ResponseValidator::isStringValid($this->pubContent) == false) {\n\t\t\t$isValid = false;\n\t\t}\n\t\treturn $isValid;\n\t}", "public function isOK()\n {\n return $this->getHTTPCode() == 200;\n }", "function getResponseStatus( $response ) {\n\t\t//this function is only supposed to make sure the communication was well-formed... \n\t\tif ( is_array( $response ) && array_key_exists( 'RESULT', $response ) ) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "function isComplete() {\n return (bool) $this->fulfillment['complete'];\n }", "public function isComplete()\n {\n return $this->status == 'success';\n }", "function cp_CheckResponse($response)\n{\n $requiredParameters = array(\n 'merchantAccount',\n 'orderReference',\n 'amount',\n 'currency',\n 'merchantSignature',\n 'transactionStatus',\n 'type'\n );\n\n $result = true;\n if (empty($response)) {\n return false;\n }\n\n foreach ($requiredParameters as $param) {\n if (!isset($response[$param]) || empty($response[$param])) {\n $result = false;\n break;\n }\n }\n\n return $result;\n}", "public function validateResponse($response): bool\n {\n if (null === $response) {\n return false;\n }\n\n if (200 === ($statusCode = $response->getStatusCode())) {\n return true;\n }\n\n $responseContents = $response->getBody()->getContents();\n if (400 === $statusCode) {\n \\Yii::error(ErrorsHelper::getStatusCodeErrorMessage($statusCode, $responseContents, $this), ErrorsHelper::GUZZLE_HTTP_CLIENT_ERROR);\n \\Yii::error('Something in the request data was wrong: check if all data{...}values are converted to strings.', ErrorsHelper::GUZZLE_HTTP_CLIENT_ERROR);\n $this->setErrorStatusDescription(ErrorsHelper::STATUS_CODE_400, $responseContents);\n\n return false;\n }\n\n if (401 === $statusCode) {\n \\Yii::error(ErrorsHelper::getStatusCodeErrorMessage($statusCode, self::UNAUTHORIZED_REQUEST_EXCEPTION_MESSAGE, $this), ErrorsHelper::GUZZLE_HTTP_CLIENT_ERROR);\n \\Yii::error('To use the new FCM HTTP Legacy API, you need to enable FCM API on your Google API dashboard first - https://console.developers.google.com/apis/library/fcm.googleapis.com/.', ErrorsHelper::GUZZLE_HTTP_CLIENT_ERROR);\n $this->setErrorStatusDescription(ErrorsHelper::STATUS_CODE_403, $responseContents);\n return false;\n }\n\n \\Yii::error(ErrorsHelper::getStatusCodeErrorMessage($statusCode, $responseContents, $this), ErrorsHelper::GUZZLE_HTTP_CLIENT_OTHER_ERRORS);\n $this->setErrorStatusDescription(ErrorsHelper::OTHER_STATUS_CODES, $responseContents);\n $this->setRetryAfter($response);\n\n return false;\n }", "private function successFrom($response)\n {\n return $response['ResponseCode'] == self::APPROVED;\n }", "function IsOK()\n\t{\n\t\treturn ($this->status == 200);\n\t}", "public function isRequestSuccess(): bool\n {\n return count($this->errors) === 0;\n }", "public function isValid(){\n $bool = false;\n if($this->res) {\n $bool = true;\n }\n return $bool;\n }", "public function parseResponse() {\r\r\n\r\r\n return true;\r\r\n }", "protected function isInvalid($response)\n {\n return false;\n }", "public function isComplete()\n {\n return\n $this->Status == 'CardCreated' ||\n $this->Status == 'Captured' ||\n $this->Status == 'Refunded' ||\n $this->Status == 'Void';\n }", "public function valid() {\n return $this->isValid && $this->futures;\n }", "public function isSuccessful() {\n\t\treturn isset($this->data['status']) && $this->data['status'] >= 200 && $this->data['status'] < 300;\n\t}", "private function _validateResponse($response)\n {\n $timestamp = $response['TIMESTAMP'];\n $result = $response['RESULT'];\n $orderid = $response['ORDER_ID'];\n $message = $response['MESSAGE'];\n $authcode = $response['AUTHCODE'];\n $pasref = $response['PASREF'];\n $paycometsha1 = $response['SHA1HASH'];\n\n $merchantid = $this->_helper->getConfigData('merchant_id');\n\n $sha1hash = $this->_helper->signFields(\"$timestamp.$merchantid.$orderid.$result.$message.$pasref.$authcode\");\n\n //Check to see if hashes match or not\n if (strcmp($sha1hash, $paycometsha1) != 0) {\n return false;\n }\n\n return true;\n }", "protected function responseIsFine($response)\n {\n return ! $response->isClientError() && ! $response->isServerError();\n }", "public function isValid()\n {\n if ($this->_code == self::RESULT_OK) {\n return true;\n }\n\n return false;\n }", "public function isValid()\n {\n $valid = TRUE;\n\n if ($this->body && !$this->hasHeader('Content-Length')) {\n $valid = 400;\n }\n\n return $valid;\n }", "public function valid()\n {\n\n if ($this->container['correlation_id'] === null) {\n return false;\n }\n if ($this->container['provider_id'] === null) {\n return false;\n }\n if ($this->container['response_code'] === null) {\n return false;\n }\n if ($this->container['response_detail'] === null) {\n return false;\n }\n return true;\n }", "public function isSuccess(): bool\n {\n return $this->code >= CODE_OK && $this->code < CODE_BAD_REQUEST;\n }", "public function is_complete() {\n return $this->remaining_length() == 0;\n }", "public function isSuccess(): bool\n {\n return $this->get('json', 'error') === false;\n }", "public function hasResponse($responseID);", "public function isSuccessful(): bool\n {\n return $this->getStatusCode() >= 200 && $this->getStatusCode() < 300;\n }", "protected function isApiResponseSuccess(array $response)\n\t{\n\t\treturn in_array($response['ResponseCode'], [1, -290]);\n\t}", "public function isRespond()\n {\n return null !== $this->accepted;\n }", "public function valid(): bool\n {\n return null !== \\key($this->responseData->_embedded->items);\n }", "public function isSuccess(): bool\n {\n return $this->code >= 200 && $this->code < 300;\n }", "public function successful()\n {\n return $this->status() >= 200 && $this->status() < 300;\n }", "public function isSuccessful()\n {\n return ($this->statusCode >= 200) && ($this->statusCode < 300);\n }", "public function isOk();", "public function isSuccessful()\n {\n $status = (int)$this->get('status');\n return $status >= 200 && $status <= 299;\n }", "public function isSuccess ()\n {\n return $this->info[ 'http_code' ] == '200';\n }", "protected function parsePostResponse()\n\t{\n\t\t$this->validateErrorsInBody($this->decodedBody());\n\t\treturn true;\n\t}", "public function has_actual_responses() {\n foreach ($this->get_response_class_ids() as $responseclassid) {\n if ($this->get_response_class($responseclassid)->has_actual_responses()) {\n return true;\n }\n }\n return false;\n }", "public function get_valid_response()\n {\n return $this->valid_response;\n }", "public function isOK()\n {\n if($this -> status == \"OK\")\n return true;\n else\n return false;\n }", "public function response_valid($responsedata) {\n if (isset($responsedata->{'q'.$this->id})) {\n $validresponse = true;\n if ($responsedata->{'q'.$this->id} != '') {\n $validresponse = $this->check_date_format($responsedata->{'q'.$this->id});\n }\n return $validresponse;\n } else {\n return parent::response_valid($responsedata);\n }\n }", "public function isCompleted()\r\n {\r\n return $this->status >= 100 || $this->status == 2;\r\n }", "public function hasValidResult()\n {\n return ( $this->result !== null );\n }", "function ok()\r\n {\r\n \tif (!$this->_socket || !is_resource($this->_socket)) {\r\n \t\treturn FALSE;\r\n \t}\r\n \t\r\n \t$response = $this->getresp();\r\n\t\tforeach ($response as $v)\r\n\t\t{\r\n\t\t\tif (!empty($v) && !preg_match(\"/^[123]/\", $v)) return false;\r\n\t\t}\r\n\t\treturn true;\r\n\t\t/*\r\n\t\tif (ereg(\"^[123]\", $response)) {\r\n \t\treturn TRUE;\r\n \t} else {\r\n \t\treturn FALSE;\r\n \t}*/\r\n }", "public function hasValidResponse(RequestEntity $request);", "public function isSuccessful(): bool\n {\n return $this->json('statusCode') === '00'\n && $this->json('errorCode') === null;\n }", "public function isSuccessful(): bool\n {\n return \\in_array($this->getStatusCode(), [200, 201, 202, 204, 205]);\n }", "public function isSuccessful() {\n\n return $this->result->success && 200 == $this->result->status_code;\n }", "public function isComplete()\n\t{\n\t\treturn $this->status == 'Complete';\n\t}", "public function request_succeeded()\n {\n return curl_errno($this->ch) === 0;\n }", "public function isValid(){\n return (bool) ($this->hasStarted() && !$this->isCancelled());\n }", "public function hasSuccessHTTPStatus() { return ($this->status == 200); }", "public function hasCompleted()\n\t{\n\t\treturn $this->isStatusSuccessful() || $this->isStatusFailed();\n\t}", "public function responseValid($result, $type = NULL, $unique_id = NULL) {\n $nid = empty($this->node) ? NULL : $this->node->nid;\n\n if (empty($result) || empty($result->code)) {\n // Failed request - empty object or no response code.\n $add_string = !empty($result->code) ? \" code-\".$result->code : \"\";\n $this->logger->addRow(\"HTTP request error: empty response$add_string.\", WATCHDOG_ERROR, $nid);\n return FALSE;\n }\n\n $result_code = (int)$result->code;\n if (!empty($result->error)) {\n $this->logger->addRow('HTTP request error: ' . $result->error, WATCHDOG_ERROR, $nid);\n return FALSE;\n }\n\n if ($result_code < 200 || $result_code >= 300) {\n $this->logger->addRow('HTTP request error code:' . $result_code, WATCHDOG_ERROR, $nid, $type, $unique_id);\n return FALSE;\n }\n\n if (empty($result->data)) {\n // The data is an error.\n $this->logger->addRow('HTTP request error: response data.', WATCHDOG_ERROR, $nid, $type, $unique_id);\n return FALSE;\n }\n\n return TRUE;\n }", "public function isValid()\n {\n return $this->deserialize() && !$this->isExpired() && $this->isSecure();\n }", "public function isSuccessful()\r\n {\r\n // 訂單請求過銀聯后必須用origRespCode來判斷支付是否成功\r\n if (isset($this->data['origRespCode'])) {\r\n if ($this->data['origRespCode'] === '00') {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n }\r\n\r\n // 訂單沒有請求過銀聯用respCode來判斷支付是否成功\r\n return isset($this->data['respCode']) && $this->data['respCode'] === '00';\r\n }", "function isReady()\n\t{\n\t\treturn ($this->getCompleteResult() !== false);\n\t}", "public function getIsOk()\n {\n return substr($this->_status, 0, 1) == '2';\n }", "public function check()\n {\n if ($this->getResponse()->status == 'error') {\n return true;\n }\n\n return false;\n }", "public function isOk()\n {\n $codes = [\n static::STATUS_OK,\n static::STATUS_CREATED,\n static::STATUS_ACCEPTED,\n static::STATUS_NON_AUTHORITATIVE_INFORMATION,\n static::STATUS_NO_CONTENT\n ];\n\n return in_array($this->code, $codes);\n }", "public function valid() {\n\t\treturn $this->can_fetch() && (false !== $this->fetch());\n\t}", "public function valid()\n {\n return !is_null(key($this->requests));\n }", "public function isSuccessful(): bool\n {\n return ($this->statusCode >= 200 && $this->statusCode <= 299);\n }", "protected function parseGetResponse()\n\t{\n\t\t$body = $this->decodedBody();\n\n\t\t//check and throw errors\n\t\t$this->validateErrorsInBody($body);\n\n\t\t$this->setDataFromBody($body);\n\t\t$this->setMetaFromBody($body);\n\n\t\treturn true;\n\t}", "public function isSuccessResponseStatus()\n {\n if ($this->curl->getStatus() >= 200 & $this->curl->getStatus() < 300) {\n return true;\n }\n\n return false;\n }", "public function isComplete()\n {\n if($this->name == null || $this->street1 == null || $this->city == null || $this->countrycode == null || $this->zip == null || $this->email == null)\n {\n return false;\n }\n $countriesRequiringStates = array(\"AR\", \"BR\", \"CA\", \"CN\", \"ID\", \"IN\", \"JP\", \"MX\", \"TH\", \"US\");\n if($this->state == null && in_array($this->countrycode, $countriesRequiringStates))\n {\n return false;\n }\n return true;\n }", "public function isRequestSuccessful()\n {\n return strtolower($this->transaction->getMessages()->getResultCode()) === 'ok';\n }", "protected function isValidResponse($response, $headers)\n {\n $httpCode = (int) $headers['http_code'];\n return ($httpCode === 200) && !empty($response) && !preg_match('/^Error\\(\\d\\d?\\):/', $response);\n }", "abstract protected function checkExistingResponse();", "private function verifyResponse()\n {\n $errorMessages = [];\n \n if (!isset($this->endpoint)) {\n $errorMessages[] = \"$endpoint must be set.\";\n }\n \n if (!isset($this->statusCode)) {\n $errorMessages[] = \"$statusCode must be set.\";\n }\n \n if (!is_array($this->data)) {\n $errorMessages[] = \"$data must be formatted as an array.\";\n }\n \n if (!is_array($this->errors)) {\n $errorMessages[] = \"$errors must be formatted as an array.\";\n }\n\n if (!empty($errorMessages)) {\n return $errorMessages;\n }\n \n return true;\n }", "public function isCompleted()\n {\n return static::STATUS_SUCCESS == $this->getStatus();\n }", "public function has_http_error($response) {\n if(!$response || !isset($response['response']['code']) || !preg_match('/20*/', $response['response']['code']) || !isset($response['body'])) {\n return true;\n }\n return false;\n }", "function isOk(){\n\n\t\treturn $this->status == $this::COD_STATUS_OK;\n\t\n\t}", "public function isOk() {\n\t\treturn $this->ok;\n\t}", "public function isComplete() {\n if ( !empty($this->aliasId) && !empty($this->email) && !empty($this->username)) {\n return true;\n } else {\n return false;\n }\n }", "protected function responseShouldReceiveFreshToken($response)\n {\n return $response instanceof Response && !$this->alreadyContainsToken($response);\n }", "public function isValid()\n {\n return $this->getStatus() != 'unlicensed';\n }", "function isComplete()\n\t{\n\t\tif (\n\t\t\tstrlen($this->title) \n\t\t\t&& $this->author \n\t\t\t&& $this->question && \n\t\t\tcount($this->answers) >= $this->correctanswers \n\t\t\t&& $this->getMaximumPoints() > 0\n\t\t)\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function canHaveBody() {\n return ( $this->status < 100 || $this->status >= 200 ) &&\n (!in_array($this->status, array(201, 204, 304)));\n }", "public function valid()\n {\n if (!empty($this->validateStatus())) {\n return false;\n }\n if (!empty($this->validateQuota())) {\n return false;\n }\n return true;\n }" ]
[ "0.81576455", "0.78469473", "0.76588255", "0.7332156", "0.73159224", "0.7276711", "0.71726507", "0.714603", "0.7119075", "0.7064579", "0.7028886", "0.70175874", "0.69999313", "0.6914703", "0.68944585", "0.6891277", "0.685992", "0.6857278", "0.68563944", "0.68395895", "0.6830376", "0.6799391", "0.6779428", "0.67551255", "0.6753782", "0.67059946", "0.6694292", "0.66730535", "0.6654567", "0.6618318", "0.6611863", "0.6604061", "0.6584263", "0.65314513", "0.6504653", "0.6486001", "0.64854026", "0.64719975", "0.64670825", "0.6458596", "0.64470357", "0.64441293", "0.64422596", "0.6437709", "0.64221907", "0.6413418", "0.64102006", "0.63924396", "0.63821", "0.6379007", "0.63786936", "0.63747054", "0.63716495", "0.63512176", "0.6341594", "0.6334037", "0.63337874", "0.6332584", "0.6329306", "0.6315346", "0.62965703", "0.62954205", "0.6287128", "0.6285369", "0.6281899", "0.6279518", "0.62643534", "0.62587357", "0.62582076", "0.62431437", "0.62395954", "0.6235098", "0.6224885", "0.6211632", "0.62080455", "0.62020123", "0.61914253", "0.6188813", "0.61850595", "0.6184933", "0.6180512", "0.6170344", "0.6157431", "0.6152753", "0.6150603", "0.6145158", "0.6144495", "0.6143897", "0.61400646", "0.61302596", "0.61300164", "0.6118886", "0.6113935", "0.61043906", "0.6089796", "0.6081662", "0.60767263", "0.60732585", "0.60643524", "0.6060153" ]
0.7333568
3
Returns an error message, in case the response won't validate.
public function get_validation_error(array $response) { //if the string was gradeable, don't indicate an error if ($this->is_gradable_response($response)) { return ''; } //otherwise, indicate an error depending on the type of reponse which was expected switch($this->response_mode) { case qtype_scripted_response_mode::MODE_NUMERIC: return get_string('invalid_numeric', 'qtype_scripted'); case qtype_scripted_response_mode::MODE_BINARY: return get_string('invalid_binary', 'qtype_scripted'); case qtype_scripted_response_mode::MODE_HEXADECIMAL: return get_string('invalid_hexadecimal', 'qtype_scripted'); case qtype_scripted_response_mode::MODE_OCTAL: return get_string('invalid_octal', 'qtype_scripted'); } //if we were unable to determine the correct message, fall back on the normal "please enter an answer" gracefully return get_string('pleaseenterananswer', 'qtype_shortanswer'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getErrorMessage();", "public function getErrorMessage();", "public function get_validation_error(array $response) {\n return get_string('answerrequired', 'qtype_pycode');\n }", "public function validAndGetErrorMsg() {\r\n require_once 'Samus/Samus_CRUD/Samus_CRUD_RequestValidator.php';\r\n $req = new Samus_CRUD_RequestValidator($this->object);\r\n $req->init();\r\n return $req->result();\r\n }", "public function getErrorMessage() {\n return '';\n }", "public function getError()\n {\n\n if (!$this->getResponse()) {\n return null;\n }\n\n if ($this->isOK()) {\n return null;\n }\n\n $message = ($this->getResponse()->getStatusCode() ? $this->getResponse()->getStatusCode() . ' ' : '') .\n ($this->getResponse()->getReasonPhrase() ? $this->getResponse()->getReasonPhrase() : 'Unknown response reason phrase');\n\n try {\n\n $data = $this->getJson();\n\n if (!empty($data->message)) {\n $message = $data->message;\n }\n\n if (!empty($data->error_description)) {\n $message = $data->error_description;\n }\n\n if (!empty($data->description)) {\n $message = $data->description;\n }\n\n } catch (Exception $e) {\n }\n\n return $message;\n\n }", "public function getInvalidRequestResponse()\n {\n $result['responseCode'] = self::RESPONSE_INVALID_REQUEST;\n return $result;\n }", "protected function createValidationErrorMessage() {}", "public function getErrorMessage()\n {\n return $this->applyTemplate();\n }", "public function getErrorMessage()\n {\n return null;\n }", "public function getErrorMessage()\n {\n return $this->singleValue('//i:errorMessage');\n }", "function getErrorMessage()\n\t{\n\t\t// Ah, we have a custom message, use that.\n\t\tif ($this->errorMessage) {\n\t\t\treturn $this->errorMessage;\n\t\t}\n\t\t\n\t\t// Field is required, but empty, so return a fill in this form message.\n\t\telse if ($this->required && $this->value == false) \n\t\t\treturn sprintf($this->getTranslationString(\"Please fill in the required '%s' field.\"), $this->label);\n\t\n\t\t// Have we got an empty error message? Create a default one\n\t\telse if (!$this->errorMessage) {\n\t\t\treturn sprintf($this->getTranslationString(\"There's a problem with value for '%s'.\"), $this->label);\n\t\t} \n\t}", "public function getError(): string\n {\n foreach ($this->getBulkResponses() as $bulkResponse) {\n if ($bulkResponse->hasError()) {\n return $bulkResponse->getError();\n }\n }\n\n return '';\n }", "public function errorMessage()\n {\n $errorMsg = '<strong>' . $this->getMessage() . \"</strong><br />\\n\";\n return $errorMsg;\n }", "public function getValidationFailed();", "public function getErrorMessage()\r\n {\r\n return $this->error_message;\r\n }", "public function getErrorMessage(): string\n {\n if ($this->getSuccess()) {\n return '';\n }\n\n return (string) $this->errorMessage;\n }", "public function getErrorMessage()\n {\n return $this->errorMessage;\n }", "public function getErrorMessage()\n {\n return $this->errorMessage;\n }", "public function getErrorMessage()\n {\n return $this->errorMessage;\n }", "public function getErrorMessage()\n {\n return $this->errorMessage;\n }", "public function getErrorMessage()\n {\n return $this->errorMessage;\n }", "public function getErrorMessage()\n {\n return $this->errorMessage;\n }", "public function getErrorMessage()\n {\n return $this->errorMessage;\n }", "public function getErrorMessage()\n {\n return $this->error_message;\n }", "public function getErrorMessage() {\n return $this->errorMessage;\n }", "public function getErrorMessage() : string\n {\n return $this->errorMessage;\n }", "public function message()\n {\n return 'Recaptcha validation failed.';\n }", "public function get_validation_error(array $response)\n {\n //FIXME: todo\n return null;\n\n }", "public function message()\n {\n return 'The validation error message.';\n }", "public function message()\n {\n return 'The validation error message.';\n }", "public function message()\n {\n return 'The validation error message.';\n }", "public function message()\n {\n return 'The validation error message.';\n }", "public function message()\n {\n return 'The validation error message.';\n }", "public function message()\n {\n return 'The validation error message.';\n }", "public function getErrorMessage() : ?string\n {\n if ($this->isSuccessful())\n {\n return null;\n }\n \n if ($this->httpResponse)\n {\n return $this->httpResponse->getReasonPhrase();\n }\n\n return null;\n }", "public function getErrorMessage()\n\t{\n\t\treturn $this->errorMessage;\n\t}", "protected function notValid()\n {\n $this->response = $this->response->withStatus(422);\n $this->jsonBody([\n 'input' => $this->payload->getInput(),\n 'output' => $this->payload->getOutput(),\n 'messages' => $this->payload->getMessages(),\n ]);\n }", "public function testErrorMessage()\n {\n $holiday = new MalaysiaHoliday;\n $response = $holiday->fromState(['Selangor', 'Malaccaa'])->get();\n\n $this->assertTrue($response['status']);\n $this->assertTrue($response['data'][0]['regional'] == 'Selangor');\n\n\n $this->assertFalse($response['data'][1]['regional'] == 'Malacca');\n $this->assertTrue($response['data'][1]['collection'] == []);\n\n $this->assertCount(1, $response['error_messages']);\n $this->assertTrue($response['error_messages'][0] == 'Malaccaa is not include in the regional state');\n }", "public function validateResponseField() {\n // Active or default version set in configuration for a given\n // major version. Information is available in the call_asset/configuration.\n $active_version = (string) $this->call_asset['configuration']['active_version'];\n\n if (!isset($this->response_field[ $active_version ])) {\n // With the active version configuration, test against the call\n // response field versions if a response field for that version\n // has been defined (data can be mapped to a response field).\n\n // Call version not implemented.\n $response = [\n 'code' => 501, // Not Implemented.\n 'message' => 'Call : Call version not implemented.'\n ];\n TripalWebServiceResponse::errorResponse($response);\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 }", "public function errorMessage() { return $this->errorMessage; }", "public function errorMessage() {\r\n\t\tif ($this->hasError()) {\r\n\t\t\treturn \"Query:\\n{$this->sql}\\nAnswer:\\n{$this->errorString}\";\r\n\t\t}\r\n\r\n\t\treturn 'No error occurred.';\r\n\t}", "public function message()\n {\n return 'The validation error messagess.';\n }", "public function message()\n {\n return 'Invalid message mark up.';\n }", "public function publicErrorMessage()\n\t{\n\t\t$errorMsg = $this->getMessage().' is not a valid E-Mail address.';\n\t\treturn $errorMsg;\n\t}", "public function checkValidResponse()\n {\n // do nothing if validation is disabled or request method not set\n if ( ! $this->options['validate'] || empty( $this->method ) ) return;\n\n $this->expected = $this->expectByMethod( $this->method );\n\n if ( $this->check( $this->getStatusCode(), $this->expected ) ) return;\n\n $exception = new ResponseException( \"The request was not successful! Response message was: '{$this->response}'\", $this->getStatusCode() );\n\n $exception->setExpectedStatusCode( $this->expected );\n\n throw $exception;\n }", "function bad_request() {\n\treturn show_template('400');\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 getErrorMessage()\n\t{\n\t\treturn $this->_errorMessage;\n\t}", "public function returnErrorMessage()\n \n {\n if (null !== $this->errormessage) {\n\n return $this->returnExternalObjectHtml($this->errorobjarray['errorobj'], $this->errorobjarray['att']);\n\n }\n\n }", "protected function invalidResponse(){\n return response()->json([\n 'ResultCode' => 1,\n 'ResultDesc' => 'Failed to complete the transaction',\n 'ThirdPartyTransID' => 0\n ]);\n\n }", "public function getErrorMessage(): ?string {\n\t\t// 1. a string with an error message (e.g. `{\"error\":{\"code\":404,\"errors\":\"invalid token\"},\"success\":false}`)\n\t\t// 2. an object (e.g. `{\"error\":{\"code\":120,\"errors\":{\"name\":\"payload\",\"reason\":\"required\"}},\"success\":false}`)\n\t\t//\n\t\t// Below is an attempt to make sense of such craziness.\n\t\t$error = $this->getValue('[error][errors]');\n\t\tif ($error === null) {\n\t\t\treturn null;\n\t\t}\n\n\t\tif (!is_array($error)) {\n\t\t\t$error = [\n\t\t\t\t'name' => 'generic',\n\t\t\t\t'reason' => $error,\n\t\t\t];\n\t\t}\n\n\t\treturn sprintf(\n\t\t\t'name=%s, reason=%s',\n\t\t\t(array_key_exists('name', $error) ? $error['name'] : 'missing'),\n\t\t\t(array_key_exists('reason', $error) ? $error['reason'] : 'missing')\n\t\t);\n\t}", "public function getMessage()\n {\n return sprintf('The field `%s` should be a valid url!', $this->inputName);\n }", "public function license_request_failed_message() {\n\t\t$message = sprintf(\n\t\t\t/* translators: %s is an HTML link to contact support */\n\t\t\t__( 'There was a problem activating the license, but it may not be invalid. If the problem persists, please %s.', 'block-lab' ),\n\t\t\tsprintf(\n\t\t\t\t'<a href=\"%1$s\">%2$s</a>',\n\t\t\t\t'mailto:[email protected]?subject=There was a problem activating my Block Lab Pro license',\n\t\t\t\tesc_html__( 'contact support', 'block-lab' )\n\t\t\t)\n\t\t);\n\n\t\treturn sprintf( '<div class=\"notice notice-error\"><p>%s</p></div>', wp_kses_post( $message ) );\n\t}", "public function getErrorMessage()\n {\n if (! $this->executed) {\n throw new Exception('Curl request not executed');\n }\n\n return '';\n }", "protected function getErrorMessage(): string\n\t{\n\t\tif($this->input !== null)\n\t\t{\n\t\t\t$errorMessage = $this->input->getErrorMessage();\n\t\t}\n\n\t\treturn $errorMessage ?? $this->defaultErrorMessage;\n\t}", "public function invalid()\n {\n return 'INVALID';\n }", "function error() {\n return $this->error_message;\n }", "public function getErrorMessage() {\n return curl_error($this->curl_handle);\n }", "public function failPaymentMsg(){\n return $this->viewFailPaymentMsg();\n }", "public function get_error();", "public function get_error();", "public function getInvalidUserResponse()\n {\n $result['responseCode'] = self::RESPONSE_INVALID_USER;\n return $result;\n }", "public function getErrorMessage():? string\n {\n return $this->errorMessage;\n }", "public function errorMessage()\n {\n return $this->provider->errorMessage;\n }", "private function verifyResponse()\n {\n $errorMessages = [];\n \n if (!isset($this->endpoint)) {\n $errorMessages[] = \"$endpoint must be set.\";\n }\n \n if (!isset($this->statusCode)) {\n $errorMessages[] = \"$statusCode must be set.\";\n }\n \n if (!is_array($this->data)) {\n $errorMessages[] = \"$data must be formatted as an array.\";\n }\n \n if (!is_array($this->errors)) {\n $errorMessages[] = \"$errors must be formatted as an array.\";\n }\n\n if (!empty($errorMessages)) {\n return $errorMessages;\n }\n \n return true;\n }", "public function getErrorMessage($input) {\n\t\treturn $input . ' is invalid.';\n\t}", "public function getErrorMessage()\n {\n $errorMessages = $this->getErrorMessages();\n if (empty($errorMessages)) {\n return false;\n }\n return $errorMessages[0];\n }", "public function message()\n {\n return $this->getError();\n }", "public function message(): string\n {\n return $this->errorMessage;\n }", "function get_error_message() {\n return $this->error_msg;\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}", "protected function responseMessage()\n {\n return isset($this->codes[$this->code]) ? $this->codes[$this->code] : '';\n }", "public function message()\n {\n return 'The postcode not valid';\n }", "public function getMessage()\n {\n return $this->_error;\n }", "public function errorMessage() {\n\t\t\treturn $this->strError; \n\t\t}", "private function unprocessableResponse() {\r\n $response['status_code_header'] = HTTP_UNPROCESSABLE;\r\n $response['body'] = json_encode([\r\n 'error' => 'Invalid input'\r\n ]);\r\n\r\n return $response;\r\n }", "public function getErrorResponse()\n {\n $result['responseCode'] = self::RESPONSE_LOGIN_ERROR;\n return $result;\n }", "public function renderGlobalErrorMessage()\n {\n $message = \"\";\n $nberror = count($this->getErrorSchema());\n if ($nberror > 0) {\n $tmp = $this->getErrorSchema()->getErrors();\n $message = \"<div class='alert alert-danger'>Please check your form, $nberror field(s) seem(s) not correctly filled </br>\";\n foreach ($tmp as $key => $e) {\n if ($key == 'Description'){\n $message .= \"- Problem description field is too long (4000 characters max): Please use verbose mode and reduce this field.\";\n }\n\n }\n $message .= \"</div>\";\n }\n return $message;\n }", "public function getInvalidChallengeResponse()\n {\n $result['responseCode'] = self::RESPONSE_INVALID_CHALLENGE;\n return $result;\n }", "public function Access_error ()\n\t\t{\n\t\t\t$errMsg[0]['error'] = \"Invalid URL!\";\n\t\t\treturn json_encode ($errMsg);\n\t\t}", "public function testErrorMessageBadFormat()\n {\n $errorResponse = json_decode('{\n \"error\": {\n \"code\": \"UNPROCESSABLE_ENTITY\",\n \"message\": {\n \"errors\": [\n \"Bad format\",\n \"Bad format 2\"\n ],\n \"bad_data\": [\n {\n \"first_message\": \"Bad format 3\",\n \"second_message\": \"Bad format 4\",\n \"thrid_message\": \"Bad format 5\"\n }\n ]\n },\n \"errors\": []\n }\n }', true);\n\n\n try {\n Requestor::handleApiError(null, 404, $errorResponse);\n } catch (EasyPostException $error) {\n $this->assertEquals(\n 'Bad format, Bad format 2, Bad format 3, Bad format 4, Bad format 5',\n $error->getMessage()\n );\n }\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}", "public function getEasycreditErrorMessage()\n {\n if (isset($_GET['error'])) {\n $error = true;\n }\n\n $message = '';\n if ($error) {\n $message = '<script language=\"javascript\">\n var d = document.createElement(\"div\");\n var htmlMessage = \\'<div class=\"alert is--error is--rounded\">\n <div class=\"alert--icon\"><i class=\"icon--element icon--cross\"></i></div>\n <div class=\"alert--content\">\n Unfortunately, your transaction has failed. Please select other payment method\n </div>\n </div>\\';\n d.innerHTML = htmlMessage;\n var container = document.getElementsByClassName(\"confirm--outer-container\")[0];\n var messageNode = d.firstChild;container.parentNode.insertBefore(messageNode, container);\n </script>';\n }\n\n return $message;\n }", "public function message()\n {\n return 'Credit Card Is Not Valid';\n }", "protected function getFlattenedValidationErrorMessage()\n\t{\n\t\t$outputMessage = 'Validation failed while trying to call ' . get_class($this) . '->' . $this->actionMethodName . '().' . PHP_EOL;\n\t\t$errorObject = [\n\t\t\t'message' => $outputMessage,\n\t\t];\n\t\t$logMessage = $outputMessage;\n\n\t\tforeach ($this->arguments->getValidationResults()->getFlattenedErrors() as $propertyPath => $errors) {\n\t\t\t/* @var $error Error */\n\t\t\tforeach ($errors as $error) {\n\t\t\t\t$logMessage .= 'Error for ' . $propertyPath . ': ' . $error->render() . PHP_EOL;\n\t\t\t\t$errorObject['errors'][] = ['code' => $error->getCode(), 'field' => $propertyPath, 'message' => $error->render()];\n\t\t\t}\n\t\t}\n\t\t$this->logger->error($logMessage, $errorObject);\n\n\t\t$errorObject = $this->transformErrorObject($errorObject);\n\n\t\t$this->response->setStatusCode(422);\n\t\t$this->response->setContentType('application/json');\n\n\t\treturn json_encode($errorObject, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES);\n\t}", "public function getErrorText(){\n return $this->error;\n }", "abstract protected function _getErrorString();", "public function validate_response($abkashresponse) {\n\t\tif(is_null($abkashresponse))\n\t\t{\n\t\t\treturn \"Config Error . Please Contact with Support\";;\n\t\t}\n\t\tswitch ($abkashresponse->trxStatus) {\n\t\tcase '0010':\n\t\tcase '0011':\n\t\t\tthrow new Exception('Transaction is pending, please try again later.');\n\t\t\tbreak;\n\t\tcase '0100':\n\t\t\tthrow new Exception('Transaction ID is valid but transaction has been reversed.');\n\t\t\tbreak;\n\t\tcase '0111':\n\t\t\tthrow new Exception('Transaction is failed.');\n\t\t\tbreak;\n\t\tcase '1001':\n\t\t\tthrow new Exception('Invalid MSISDN input. Try with correct mobile no.');\n\t\t\tbreak;\n\t\tcase '1002':\n\t\t\tthrow new Exception('Invalid transaction ID.');\n\t\t\tbreak;\n\t\tcase '1003':\n\t\t\tthrow new Exception('Authorization Error, please contact site admin.');\n\t\t\tbreak;\n\t\tcase '1004':\n\t\t\tthrow new Exception('Transaction ID not found.');\n\t\t\tbreak;\n\t\tcase '9999':\n\t\t\tthrow new Exception('System error, could not process request. Please contact site admin.');\n\t\t\tbreak;\n\t\tcase '0000':\n\t\t\treturn $response;\n\t\t}\n\t}", "function getErrorMsg() {\n\t\treturn $this->errorMsg;\n\t}", "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 }", "private function methodCallErrorMessage(): string\n {\n return 'Trying to get an error message from a successfull array type check result';\n }", "public function errorMessage()\n\t{\n\t\treturn $this->_source->errorMessage();\n\t}", "public function get_error_message() {\n\t\treturn $this->error_message;\n\t}", "public function getMessage()\n {\n return isset($this->data->failure_msg) ? $this->data->failure_msg : '';\n }", "public function getError();", "public function getError();", "public function getError();", "public function message()\n {\n return 'The email does not match our records.';\n }" ]
[ "0.7308298", "0.7308298", "0.71307945", "0.69397247", "0.69182557", "0.67538327", "0.6739742", "0.67373747", "0.67332387", "0.66902953", "0.6685578", "0.6668483", "0.6661592", "0.6653313", "0.6602498", "0.6589387", "0.6588499", "0.65877414", "0.65877414", "0.65877414", "0.65877414", "0.65877414", "0.65877414", "0.65877414", "0.65663975", "0.6565902", "0.65475816", "0.65437615", "0.6537075", "0.65344906", "0.65344906", "0.65344906", "0.65344906", "0.65344906", "0.65344906", "0.65208393", "0.65121806", "0.6506372", "0.64970785", "0.6491375", "0.64766854", "0.64611983", "0.6459887", "0.64546853", "0.6419905", "0.64005643", "0.6383788", "0.6377422", "0.636491", "0.63531154", "0.6347927", "0.63412833", "0.63368267", "0.6315827", "0.6313909", "0.6300907", "0.6296201", "0.62853765", "0.6281169", "0.6276579", "0.62713385", "0.62695205", "0.62695205", "0.6254464", "0.62534845", "0.62491477", "0.62478215", "0.6242714", "0.6241564", "0.62324595", "0.6232141", "0.6228498", "0.6226984", "0.6226241", "0.62260467", "0.62228215", "0.6221595", "0.6221513", "0.6220914", "0.6216949", "0.6200456", "0.61999685", "0.6197425", "0.6195645", "0.6194273", "0.6180382", "0.6169814", "0.61697185", "0.61591667", "0.61490375", "0.6148439", "0.614579", "0.6145087", "0.61430943", "0.6139638", "0.6138268", "0.6135901", "0.6135901", "0.6135901", "0.61246645" ]
0.7128949
3
Returns true iff the two responses are identical.
public function is_same_response(array $prevresponse, array $newresponse) { return question_utils::arrays_same_at_key_missing_is_blank($prevresponse, $newresponse, 'answer'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function is_same_response(array $a, array $b)\n {\n try\n {\n //Process both responses.\n //This is a CPU-heavy operation the first time it is run, but is relatively light afterwards due to local caching.\n $a_resp = $this->process_response($a);\n $b_resp = $this->process_response($b);\n\n //return true iff the hashes match\n return ($a_resp['hash'] == $b_resp['hash']);\n }\n catch(SimulationException $e)\n {\n return false;\n }\n }", "private function areEqual()\n {\n $this->compareHeader();\n\n return empty($this->diffHeader);\n }", "public function testAssertResponseEquals(): void\n {\n $this->_response = new Response();\n $this->_response = $this->_response->withStringBody('Some content');\n\n $this->assertResponseEquals('Some content');\n }", "private function isSameLength()\n {\n return $this->lengthA == $this->lengthB;\n }", "protected function areEqual($a, $b)\n {\n return ($a['points'] == $b['points'])\n && ($a['positions'] == $b['positions'])\n && ($a['fastestLap'] == $b['fastestLap']);\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 hasResponse()\n {\n return null !== $this->response;\n }", "public function equals(Setoid $that): bool;", "private function verifyResponse($resp)\n {\n //grab session value and destroy it\n $val = $_SESSION['challenge'];\n unset($_SESSION['challenge']);\n return $resp == $val;\n }", "public function has_actual_responses() {\n foreach ($this->get_response_class_ids() as $responseclassid) {\n if ($this->get_response_class($responseclassid)->has_actual_responses()) {\n return true;\n }\n }\n return false;\n }", "function isSameStream( IStreamProperties $_comparison ): bool;", "public function hasResponse(): bool\n {\n return null !== $this->response;\n }", "public function testAssertResponseNotEquals(): void\n {\n $this->_response = new Response();\n $this->_response = $this->_response->withStringBody('Some content');\n\n $this->assertResponseNotEquals('Some Content');\n }", "public function equals(self $header): bool;", "public function hasResponse(): bool\n {\n return ! ($this->response === null);\n }", "protected function isDataEqual(&$a, &$b): bool\n {\n // empty string is considered null in dynamodb\n if (\n (\\is_null($a) && \\is_string($b) && $b === '')\n || (\\is_null($b) && \\is_string($a) && $a === '')\n ) {\n return true;\n }\n\n if (gettype($a) != gettype($b)) {\n return false;\n }\n\n switch (true) {\n case (is_double($a)):\n return \"$a\" == \"$b\";\n break;\n case (is_array($a)):\n if (count($a) !== count($b)) {\n return false;\n }\n foreach ($a as $k => &$v) {\n if ( ! key_exists($k, $b)) {\n return false;\n }\n if ( ! $this->isDataEqual($v, $b[$k])) {\n return false;\n }\n }\n\n // every $k in $a can be found in $b and is equal\n return true;\n break;\n case (is_resource($a)):\n case (is_object($a)):\n throw new ODMException(\"DynamoDb data cannot contain value of resource/object\");\n break;\n default:\n return $a === $b;\n }\n }", "public function isResponse(): bool {\n return $this->options['response'] ?? false;\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}", "public function isSent(): bool {\n return $this->response->isSent();\n }", "public function are_licenses_network_identical() {\r\n return false;\r\n }", "public function hasResponse(): bool\n {\n return $this->response !== null;\n }", "public function equals($other) { return $this->obj==Sandbox::unwrap($other); }", "public function isOk() : bool\n {\n return $this->m_responseCode === 200;\n }", "public function equal( $rhs ) {\n return ( $this->sec == $rhs->sec ) && ($this->nsec == $rhs->nsec); }", "protected static function hashEquals($a, $b) {\n if (function_exists('hash_equals'))\n return hash_equals($a, $b);\n\n $nonce = openssl_random_pseudo_bytes(32);\n return hash_hmac(self::HASH_ALGORITHM, $a, $nonce) === hash_hmac(self::HASH_ALGORITHM, $b, $nonce);\n }", "public function isOk() : bool\n {\n return $this->m_responseCode === 201;\n }", "function equals($other);", "public function equals($other)\n\t{\n\t\tif($other instanceof self) {\n\t\t\treturn $this == $other;\n\t\t} elseif(is_array($other)) {\n\t\t\treturn $this->value == $other['val'] && $this->prefix == $other['pre'] && $this->postfix == $other['post'] && !$this->valueEncoded && $this->prefixEncoded && $this->postfixEncoded;\n\t\t} else {\n\t\t\treturn $this->prefix === null && $this->postfix === null && $this->value == $other && !$this->valueEncoded;\n\t\t}\n\t}", "public function isOk()\n {\n $result = false;\n \n if ($this->m_responseArray['result'] == 'success')\n {\n $result = true;\n }\n \n return $result;\n }", "private function successFrom($response)\n {\n return $response['success'] == 1\n || $response['token'] != null;\n }", "public function arraysAreSimilar($a, $b) {\n // if the indexes don't match, return immediately\n if (count(array_diff($a, $b)) > 0) {\n return false;\n }\n // we have identical indexes, and no unequal values\n return true;\n }", "public static function areSame($model1,$model2){\n if($model1->modelName==$model2->modelName && $model1->id==$model2->id){\n return true;\n }\n return false;\n }", "public function containsSame(mixed $value): bool\n {\n return $this->isOk() && $this->value === $value;\n }", "function equals($x, $y);", "public static function same($a,$b)\n\t{\n\t\tif(!is_string($a) || !is_string($b))\n\t\t\treturn false;\n\n\t\t$mb=function_exists('mb_strlen');\n\t\t$length=$mb ? mb_strlen($a,'8bit') : strlen($a);\n\t\tif($length!==($mb ? mb_strlen($b,'8bit') : strlen($b)))\n\t\t\treturn false;\n\n\t\t$check=0;\n\t\tfor($i=0;$i<$length;$i+=1)\n\t\t\t$check|=(ord($a[$i])^ord($b[$i]));\n\n\t\treturn $check===0;\n\t}", "public function equals( $A, $B );", "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}", "function d2d_public_key_eql($key1, $key2) {\n\t$key1 = d2d_clean_public_key($key1);\n\t$key2 = d2d_clean_public_key($key2);\n\treturn $key1 === $key2;\n}", "public function isExactMatch(): bool\n {\n return $this->exactMatch;\n }", "public function arrayEqual(array $a, array $b)\n {\n return (count($a) == count($b) && array_diff($a, $b) === array_diff($b, $a));\n }", "abstract protected function checkExistingResponse();", "public function theResponseShouldBeEqual($text)\n {\n assertEquals($text, $this->browser->getLastResponse()->getContent());\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 isEqual($otherSamsungPayCard)\n {\n return !($otherSamsungPayCard instanceof self) ? false : $this->token === $otherSamsungPayCard->token;\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 }", "public function isValid()\n\t{\n\t\treturn $this->response\n\t\t\t&& $this->response->isValid();\n\t}", "public function testEquality()\n {\n $m1 = new BigMoney(Decimal::fromInteger(100), new Currency('EUR'));\n $m2 = new BigMoney(Decimal::fromInteger(100), new Currency('EUR'));\n $m3 = new BigMoney(Decimal::fromInteger(100), new Currency('USD'));\n $m4 = new BigMoney(Decimal::fromInteger(50), new Currency('EUR'));\n\n $this->assertTrue($m1->equals($m2));\n $this->assertFalse($m1->equals($m3));\n $this->assertFalse($m1->equals($m4));\n }", "public function isSuccess()\n {\n return ($this->isValidArray($this->response) && !isset($this->errorStack['error']));\n }", "public function hasResponse($responseID);", "function is_equal(log_op_move $other): bool {\n return $this == $other;\n }", "public function isSuccessful()\n {\n return $this->response->getStatusCode() >= 200 && $this->response->getStatusCode() < 300;\n }", "public static function diff($origin1, $origin2) : bool\n {\n if ((! \\is_object($origin1)) || (! \\is_object($origin2))) {\n return true;\n }\n if (\\get_class($origin1) !== \\get_class($origin2)) {\n return true;\n }\n\n if (($origin1 instanceof Entity) && ($origin2 instanceof Entity)) {\n return $origin1->getPk() !== $origin2->getPk();\n }\n\n if (($origin1 instanceof Model) && ($origin2 instanceof Model)) {\n // Diff All Properties of origins\n return Model::diff($origin1, $origin2, []) ? true : false;\n }\n\n return $origin1 != $origin2;\n }", "public function has_multiple_response_classes() {\n return count($this->get_response_class_ids()) > 1;\n }", "public function isRespond()\n {\n return null !== $this->accepted;\n }", "public function passwordEqual() {\n if($this->getPassword() == $this->getPasswordRepeat()) return TRUE;\n else return FALSE;\n }", "function o_eq($a, $b) {\n\t\t\treturn Obj::singleton()->equal($a, $b);\n\t\t}", "private function adaptersEqual( $adap1, $adap2 )\n {\n return ( $adap1['class'] === $adap2['class'] ) && (\n ( empty( $adap1['options']['exec'] ) ^ empty( $adap2['options']['exec'] ) ) ||\n ( $adap1['options']['exec'] === $adap2['options']['exec'] )\n );\n }", "public static function isEqual(Piwik_DataTable $table1, Piwik_DataTable $table2)\n {\n $rows1 = $table1->getRows();\n $rows2 = $table2->getRows();\n\n $table1->rebuildIndex();\n $table2->rebuildIndex();\n\n if ($table1->getRowsCount() != $table2->getRowsCount()) {\n return false;\n }\n\n foreach ($rows1 as $row1) {\n $row2 = $table2->getRowFromLabel($row1->getColumn('label'));\n if ($row2 === false\n || !Piwik_DataTable_Row::isEqual($row1, $row2)\n ) {\n return false;\n }\n }\n\n return true;\n }", "private function _validateResponse($response)\n {\n $timestamp = $response['TIMESTAMP'];\n $result = $response['RESULT'];\n $orderid = $response['ORDER_ID'];\n $message = $response['MESSAGE'];\n $authcode = $response['AUTHCODE'];\n $pasref = $response['PASREF'];\n $paycometsha1 = $response['SHA1HASH'];\n\n $merchantid = $this->_helper->getConfigData('merchant_id');\n\n $sha1hash = $this->_helper->signFields(\"$timestamp.$merchantid.$orderid.$result.$message.$pasref.$authcode\");\n\n //Check to see if hashes match or not\n if (strcmp($sha1hash, $paycometsha1) != 0) {\n return false;\n }\n\n return true;\n }", "public function equals($obj): bool;", "function equals($a, $b){\n\tif (method_exists($a, 'equals'))\n\t\treturn $a->equals($b);\n\telse\n\t\treturn $a===$b;\n}", "public function isSuccessful()\n {\n return isset($this->data['response_code']) \n && \n ( substr($this->data['response_code'], 2) == '000' );\n }", "public function IsCacheDifferent(){\r\n\t\tself::Debug('Determine if the cache is different from this instance');\r\n\t\t// Load the cache\r\n\t\t$temp=new PhpWsdl(null,$this->EndPoint);\r\n\t\t$temp->GetWsdlFromCache();\r\n\t\tif(is_null($temp->WSDL))\r\n\t\t\treturn true;// Not cached yet\r\n\t\t// Initialize this instance\r\n\t\t$this->DetermineConfiguration();\r\n\t\t$this->ParseSource();\r\n\t\t// Compare the cache with this instance\r\n\t\t$res=serialize(\r\n\t\t\t\tArray(\r\n\t\t\t\t\t$this->Methods,\r\n\t\t\t\t\t$this->Types\r\n\t\t\t\t)\r\n\t\t\t)!=serialize(\r\n\t\t\t\tArray(\r\n\t\t\t\t\t$temp->Methods,\r\n\t\t\t\t\t$temp->Types\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\tself::Debug('Cache is '.(($res)?'equal':'different'));\r\n\t\treturn $res;\r\n\t}", "public function isOK()\n {\n return $this->getHTTPCode() == 200;\n }", "public function equals(ByteString $bs)\n {\n $expected = (string) $bs->getBytes();\n $actual = (string) $this->bytes;\n $lenExpected = strlen($expected);\n $lenActual = strlen($actual);\n $len = min($lenExpected, $lenActual);\n\n $result = 0;\n for ($i = 0; $i < $len; $i++) {\n $result |= ord($expected[$i]) ^ ord($actual[$i]);\n }\n $result |= $lenExpected ^ $lenActual;\n\n return ($result === 0);\n }", "public function identical_values( $arrayA , $arrayB ) {\n\n sort( $arrayA );\n sort( $arrayB );\n\n return $arrayA == $arrayB;\n }", "public function shouldCacheResponse (Response $response): bool {\n\t\treturn $response->isSuccessful() || $response->isRedirection();\n\t}", "protected function responseIsFine($response)\n {\n return ! $response->isClientError() && ! $response->isServerError();\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 }", "public function checkDiff()\n {\n if ($this->tokensOriginal !== $this->tokensMutated) {\n return true;\n }\n\n return false;\n }", "protected function isEqual($key, $value1, $value2) {\n\t\tif($key) {} // intentional to avoid unused argument notice\n\t\t// $key intentionally not used here, but may be used by descending classes\n\t\treturn $value1 === $value2; \t\n\t}", "function IsOK()\n\t{\n\t\treturn ($this->status == 200);\n\t}", "public function hasCorrectAnswer()\n {\n foreach ($this->replies as $reply) {\n if ($reply->isCorrect()) {\n return true;\n }\n }\n\n return false;\n }", "function areEqual ($other, $another) {\n if ($this->isFraction($other) && $this->isFraction($another)) {\n $other->reduce();\n $another->reduce();\n return ($other->toString() == $another->toString());\n } else {\n return false;\n }\n }", "public function arrays_are_similar($a, $b)\n {\n if (count(array_diff_assoc($a, $b))) {\n return false;\n }\n // we know that the indexes, but maybe not values, match.\n // compare the values between the two arrays\n foreach ($a as $k => $v) {\n if ($v !== $b[$k]) {\n return false;\n }\n }\n // we have identical indexes, and no unequal values\n return true;\n }", "public function sameUser(User $userA, User $userB)\n {\n return $userA->uuid === $userB->uuid;\n }", "public function isSameFood($foodA, $foodB);", "public function shouldEqual($expected) {}", "public static function eq($a, $b)\n {\n if (self::nx(@$a) && self::nx(@$b)) {\n return false;\n }\n if (self::nx(@$a) && self::x(@$b)) {\n return false;\n }\n if (self::x(@$a) && self::nx(@$b)) {\n return false;\n }\n if ($a == $b) {\n return true;\n }\n return false;\n }", "public function equals(self $other): bool\n {\n // check that attribute types match\n if ($this->oid() !== $other->oid()) {\n return false;\n }\n $matcher = $this->value->equalityMatchingRule();\n\n return $matcher->compare($this->value->stringValue(), $other->value->stringValue()) === true;\n }", "public function isDuplicate() {\r\n\t\treturn ($this->errorNumber === 1062);\r\n\t}", "function getResponseStatus( $response ) {\n\t\t//this function is only supposed to make sure the communication was well-formed... \n\t\tif ( is_array( $response ) && array_key_exists( 'RESULT', $response ) ) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function validateTablesIdentical($arr1, $arr2) {\n $array_keys = ['quarter_number', 'month_number', 'row_number',];\n\n for ($i = 0; $i <= 2; $i++) {\n if ($arr1[$array_keys[$i]] != $arr2[$array_keys[$i]]) {\n return FALSE;\n }\n }\n\n return TRUE;\n }", "protected function isApiResponseSuccess(array $response)\n\t{\n\t\treturn in_array($response['ResponseCode'], [1, -290]);\n\t}", "function test_equals($a, $b) {\n\treturn $a == $b;\n}", "function equals($url) {\n if (! ( $url instanceof URL))\n $url = new URL($url);\n return $url->isWellformed() && $this->isWellformed() && ($this->toString(false) === $url->toString(false));\n }", "private function successFrom($response)\n {\n return $response['ResponseCode'] == self::APPROVED;\n }", "private static function callbackEquals( $callback1, $callback2 ) {\n\n\t\t\tif ( is_array( $callback1 ) && is_array( $callback2 ) ) {\n\t\t\t\t\n\t\t\t\tif ( count( $callback1 ) == count( $callback2 ) ) {\n\t\t\t\t\n\t\t\t\t\tfor ( $i=0, $len = count( $callback1 ); $i<$len; $i++ ) {\n\t\t\t\t\t\tif ( $callback1[$i] != $callback2[$i] ) {\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\treturn true;\n\n\t\t\t\t} else {\n\t\t\t\t\t\n\t\t\t\t\treturn false;\n\t\t\t\t\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\treturn $callback1 == $callback2;\n\n\t\t\t}\n\n\t\t}", "public function isInResponse($response, $key)\n {\n $keyName = $this->options->stage2Response->{$key}->accessKey;\n if(is_object($response) && property_exists($response, $keyName)) {\n return true;\n }\n if(is_array($response) && array_key_exists($keyName, $response)) {\n return true;\n }\n return false;\n }", "function arrays_are_similar($a, $b) {\n\tif (count(array_diff_assoc($a, $b))) {\n\t\treturn false;\n\t}\n\t// we know that the indexes, but maybe not values, match.\n\t// compare the values between the two arrays\n\tforeach($a as $k => $v) {\n\t\tif ($v !== $b[$k]) {\n\t\t\treturn false;\n\t\t}\n\t}\n\t// we have identical indexes, and no unequal values\n\treturn true;\n}", "public function equals($to) {\n return\n get_class($to) == get_class($this) &&\n $this->body == $to->body &&\n $this->protocol == $to->protocol &&\n Core::equals($this->headers, $to->headers);\n }", "function areSimilar($a, $b) {\n if($a==$b) return true;\n \n if(sizeof($a)!=sizeof($b)||array_sum($a)!=array_sum($b)) return false;\n \n $index1 = 0; $index2 = 0; $diff = 0;\n \n foreach($a as $key=>$var){\n if($var!=$b[$key]){\n $diff++;\n if($diff==1)\n $index1 = $key;\n else if($diff==2)\n $index2 = $key;\n }\n }\n \n return ($diff==2&&$a[$index1]==$b[$index2]&&$a[$index2]==$b[$index1]);\n}", "public function validateChangedPasswordsIsTheSame(): bool\n {\n return $this->newPassword1 === $this->newPassword2;\n }", "function hash_equals ($a, $b) {\n\t\t$a_length = strlen($a);\n\t\tif ($a_length !== strlen($b)) { return false; }\n\n\t\t$result = 0;\n\t\tfor ($i = 0; $i < $a_length; $i++) {\n\t\t\t$result |= ord($a[$i]) ^ ord($b[$i]);\n\t\t}\n\n\t\treturn $result === 0;\n\t}", "public function hasOtherOutput()\n {\n return count($this->_otherOutput) > 0;\n }", "public function isOk();", "function isEqual ( &$anObject ) {\n \t\treturn $this->isEqualTo($anObject);\n \t}", "public function parseResponse() {\r\r\n\r\r\n return true;\r\r\n }", "public function isSuccess ()\n {\n return $this->info[ 'http_code' ] == '200';\n }", "public function shouldBeEqualTo($expected) {}" ]
[ "0.756443", "0.66914773", "0.6430655", "0.59730136", "0.5957406", "0.5893488", "0.5775423", "0.57675546", "0.575689", "0.57475406", "0.57411706", "0.57262623", "0.57166535", "0.5683054", "0.56656605", "0.557556", "0.557343", "0.5569845", "0.55693626", "0.55625373", "0.5553514", "0.55440116", "0.55311227", "0.5525547", "0.55007607", "0.54913306", "0.54722273", "0.5468218", "0.5463248", "0.5445163", "0.5442254", "0.54373145", "0.54264605", "0.5424185", "0.5407367", "0.540491", "0.53790647", "0.5374667", "0.5371927", "0.5369971", "0.5367596", "0.53623056", "0.53595424", "0.5323094", "0.5321427", "0.53145295", "0.5313757", "0.5312876", "0.5303762", "0.5294377", "0.5283789", "0.5281844", "0.5281766", "0.5276957", "0.5263206", "0.52623105", "0.52593184", "0.5249823", "0.5247524", "0.52386904", "0.5237992", "0.523718", "0.5227698", "0.5214248", "0.52122784", "0.5211581", "0.5193523", "0.5188824", "0.5182457", "0.51804775", "0.51691985", "0.516654", "0.5165942", "0.5165565", "0.51569176", "0.51517725", "0.51517296", "0.5149596", "0.514954", "0.51417464", "0.51376396", "0.51323324", "0.51215386", "0.51142573", "0.5110976", "0.5110448", "0.51071703", "0.5106375", "0.5100862", "0.51006013", "0.50936925", "0.5092286", "0.5091374", "0.5089202", "0.5068974", "0.506896", "0.5060871", "0.5060209", "0.50573444", "0.50549346" ]
0.6444924
2
Returns all possible answers (including distractors) for the given question.
public function get_answers() { return $this->answers; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function generateChoices(array $question)\n\t{\n\t\t[$inputMode, $inputExpectation, $notUseful, $from] = explode('_', $question['type']);\n\n\t\tif($this->config['cross_sections_for_possible_answers'])\n\t\t{\n\t\t\t//TODO\n\t\t}\n\n\t\telse\n\t\t{\n\t\t\t//leave space for the correct answer to be slotted in!\n\t\t\t//(not done in this method BTW)\n\t\t\t//UPDATE: actually, no, we'll just clobber one to put the correct answer in\n\t\t\t//$count = $this->config['choices_per_question'] - 1;\n\t\t\t$count = $this->config['choices_per_question'];\n\n\t\t\t$randomKeys = array_rand($this->functionData[$question['section']], $count);\n\n\t\t\t$choices = [];\n\n\t\t\tforeach($randomKeys as $key)\n\t\t\t{\n\t\t\t\t$choices[] = $this->functionData[$question['section']][$key][$inputExpectation];\n\t\t\t}\n\n\t\t\treturn $choices;\n\n\t\t}\n\t}", "public function get_possible_responses( $questiondata )\n\t{\n\t\treturn array();\n\t}", "public static function question($questions)\n {\n $choices = array();\n $answer = array();\n\n // To find the related records from question layout\n foreach ($questions as $question) {\n $choice = array();\n $related = $question->getRelatedSet('qus_QUSC');\n\n foreach ($related as $relatedField) {\n // To find and create array of correct answers\n if ($relatedField->getField('qus_QUSC::isCorrect_kqn')) {\n array_push($answer, $relatedField->getField('qus_QUSC::choiceValue_kqt'));\n }\n\n // To create the array of choices of a question\n array_push($choice, $relatedField->getField('qus_QUSC::choiceValue_kqt'));\n }\n\n // To create array of choices of all questions\n array_push($choices, $choice);\n }\n\n // return array of choices and answers of questions\n return array($choices, $answer);\n }", "public static function getAllQuestionsAndAnswers(){\n $returnArray = array(\n 'Result' => 1,\n 'Reason' => \"\",\n 'QuestionResponses' => array()\n );\n\n $questionObjects = question::getAllQuestions();\n\n if(count($questionObjects) > 0){\n $responsesArray = self::buildQuestionsAndAnswersArray_Admin($questionObjects);\n $returnArray['QuestionResponses'] = $responsesArray;\n }\n else{\n $returnArray['Result'] = 0;\n $returnArray['Reason'] = \"No questions were found\";\n }\n\n return $returnArray;\n }", "private function get_answers($question) {\n $answers = array();\n \n foreach ($question->options->subquestions as $subquestion) {\n array_push($answers, strip_tags($subquestion->answertext));\n }\n return $answers;\n }", "public function getAnswers();", "public function get_all_question_answer_list()\n\t{\n\t\t\n\t\t$sql=\"select * from question_answer\";\n\t\t$query=$this->db->query($sql);\n\t\t//print_r($query->result_object());die();\n\t\treturn $query->result_object();\n\t}", "public function getGoodAnswers($question)\n {\n $qb = $this->createQueryBuilder('a');\n $answers = $qb\n ->select('a', 'COUNT(rb) AS HIDDEN rbcounter')\n ->leftJoin('a.recommendby', 'rb')\n ->andWhere($qb->expr()->eq('a.question', ':question'))\n ->andWhere(\n $qb->expr()->orX(\n $qb->expr()->eq('a.isGood', true),\n $qb->expr()->andX(\n $qb->expr()->neq('a.isGood', true),\n $qb->expr()->isNotNull('rb')\n )\n )\n )\n ->setParameters(array(\n 'question' => $question\n ))\n ->orderBy('a.isGood', 'DESC')\n ->addOrderBy('rbcounter', 'DESC')\n ->groupBy('a')\n ->setMaxResults(2)\n ->getQuery()\n ->getArrayResult()\n ;\n\n return $answers;\n }", "private function getAnswers($question){\n $answerModel = new Answer();\n $answers = $answerModel->where('id_qst',$question->id_qst)->findAll();\n $retMess = \"\";\n $this->answersId = [];\n foreach($answers as $answer){\n array_push($this->answersId,$answer->id_ans);\n $retMess .= \",\".$answer->text;\n }\n\n return $retMess;\n }", "public function get_possible_responses($questiondata) {\n $resp = array();\n\n $q = $this->make_question($questiondata);\n\n foreach ($q->parts as $part) {\n if ($part->postunit == '') {\n $resp[$part->partindex] = array(\n 'wrong' => new question_possible_response(\n 'Wrong', 0),\n 'right' => new question_possible_response(\n 'Right', 1),\n null => question_possible_response::no_response()\n );\n } else {\n $resp[$part->partindex] = array(\n 'wrong' => new question_possible_response(\n 'Wrong', 0),\n 'right' => new question_possible_response(\n 'Right', 1),\n 'wrongvalue' => new question_possible_response(\n 'Wrong value right unit', 0),\n 'wrongunit' => new question_possible_response(\n 'Right value wrong unit', 1 - $part->unitpenalty),\n null => question_possible_response::no_response()\n );\n }\n }\n\n return $resp;\n }", "public function getAll()\n {\n return $this->_answers;\n }", "private function get_and_shuffle_subquestions($question) {\n $result = array();\n $subquestions = $question->options->subquestions;\n $is_shuffle = shuffle($subquestions);\n\n foreach ($subquestions as $subquestion) {\n array_push($result, strip_tags($subquestion->questiontext));\n }\n return $result;\n }", "function getGeneratedQuestions() {\n $generatedQuestions = [];\n\n // for the generated questions, let's make the total 12\n for ($i = 0; $i < 12; $i++) {\n\n // create the queston attributes\n $leftAdder = mt_rand(0 , 100);\n\n $rightAdder;\n do {\n $rightAdder = mt_rand(0 , 100);\n } while ($rightAdder === $leftAdder);\n\n $correctAnswer = $leftAdder + $rightAdder;\n\n $firstIncorrectAnswer;\n do {\n $firstIncorrectAnswer = mt_rand($correctAnswer - 10, $correctAnswer + 10);\n } while ($firstIncorrectAnswer === $correctAnswer);\n\n $secondIncorrectAnswer;\n do {\n $secondIncorrectAnswer = mt_rand($correctAnswer - 10, $correctAnswer + 10);\n } while (\n $secondIncorrectAnswer === $correctAnswer || \n $secondIncorrectAnswer === $firstIncorrectAnswer\n );\n\n // cast to object to mimic json file\n $generatedQuestions[] = (object)[\n \"leftAdder\" => $leftAdder,\n \"rightAdder\" => $rightAdder,\n \"correctAnswer\" => $correctAnswer,\n \"firstIncorrectAnswer\" => $firstIncorrectAnswer,\n \"secondIncorrectAnswer\" => $secondIncorrectAnswer \n ];\n }\n\n return $generatedQuestions;\n}", "function &getAvailableAnswers()\n\t{\n\t\t$available_answers = array();\n\t\tforeach ($this->answers as $answer)\n\t\t{\n\t\t\tarray_push($available_answers, $answer->getAnswertext());\n\t\t}\n\t\treturn $available_answers;\n\t}", "public function getPreDefinedQuestions()\n {\n return [\n \"1\" => \"Select a Security Question\",\n \"2\" => \"What was your childhood nickname?\",\n \"3\" => \"What is the name of your favorite childhood friend?\",\n \"4\" => \"What was the name of your first stuffed animal?\",\n \"5\" => \"Where were you when you had your first kiss?\",\n \"6\" => \"What is the name of the company of your first job?\",\n \"7\" => \"What was your favorite place to visit as a child?\",\n \"8\" => \"What was your dream job as a child?\",\n \"9\" => \"What is your preferred musical genre?\",\n \"10\" => \"What is your favorite team?\",\n \"11\" => \"What is your father\\\"s middle name?\"\n ];\n }", "function answers()\r\n {\r\n $returnArray = array();\r\n $db =& eZDB::globalDatabase();\r\n $db->array_query( $questionArray, \"SELECT ID FROM eZQuiz_Answer WHERE AlternativeID='$this->ID'\" );\r\n\r\n for ( $i = 0; $i < count( $questionArray ); $i++ )\r\n {\r\n $returnArray[$i] = new eZQuizAnswer( $questionArray[$i][$db->fieldName( \"ID\" )], true );\r\n }\r\n return $returnArray;\r\n }", "public static function answer_question(array $question);", "public function getAnswersByQuestion()\n {\n $question_id = request('question');\n\n $question = PollQuestion::where('id', $question_id)->first();\n $answers = Answer::where('question_id', $question_id)->get();\n\n $data['question'] = $question;\n $data['answers'] = $answers;\n\n return view('answer', ['data' => $data]);\n }", "function smartchoice_get_all_responses($choice) {\n global $DB;\n return $DB->get_records('smartchoice_answers', array('choiceid' => $choice->id));\n}", "public function ask_get_unanswered_questions()\n\t{\n\t\t$sql = \"SELECT *\n\t\t\t\tFROM \".$this->table_ask.\"\n\t\t\t\tWHERE id NOT IN \n\t\t\t\t(SELECT id_quest FROM `aa_ask` WHERE id_quest != -1) \n\t\t\t\tAND id_quest = -1\";\n\t\t$query = $this->db->query($sql);\n\t\t$res = $query->result();\n\t\tfor( $i=0; $i<count($res); $i++ ) {\n\t\t\t$res[$i]->nb_ans = $this->ask_get_nb_answers($res[$i]->id);\n\t\t\t$res[$i]->nb_views = $this->ask_get_nb_views($res[$i]->id);\n\t\t\t$val = $this->votesManager->votes_get_by_ask($res[$i]->id);\n\t\t\t$res[$i]->nb_votes = ($val) ? $val:0;\n\t\t}\n\t\tif( $query->result() != NULL )\n\t\t\treturn $query->result();\n\t\telse\n\t\t\treturn 0;\n\t}", "public function get_question_instruction_cases() {\n return [\n [\n 'coderunner',\n 'Write your answer in the space provided.'\n ],\n [\n 'ddwtos',\n 'Write the letter of the corresponding answer (A, B, C, D, ...) in the space provided.\nAfter the item is the maximum number of times it can be used. e.g. (1) means that the item can be used once, ' .\n '(2) means twice etc. An asterisk (*) means that the items’ use is unlimited.'\n ],\n [\n 'ddmarker',\n 'Mark the points on the image and write the letter of corresponding answer (A, B, C, D, …) beside them.\nAfter the item is the maximum number of times it can be used. e.g. (1) means that the item can be used once, ' .\n '(2) means twice etc. An asterisk (*) means that the items’ use is unlimited.'\n ],\n [\n 'ddimageortext',\n 'Mark the points on the image and write the letter of corresponding answer (A, B, C, D, …) beside them.\nAfter the item is the maximum number of times it can be used. e.g. (1) means that the item can be used once, ' .\n '(2) means twice etc. An asterisk (*) means that the items’ use is unlimited.'\n ],\n [\n 'essay',\n 'Write your answer in the space provided.'\n ],\n [\n 'match',\n 'Write the letter of the corresponding answer (A, B, C, D, ...) in the space provided.'\n ],\n [\n 'multichoice',\n 'Select the correct answer.'\n ],\n [\n 'numerical',\n 'Write your answer (in numerical value) in the space provided.'\n ],\n [\n 'ordering',\n 'Write the correct order in the space provided.'\n ],\n [\n 'oumultiresponse',\n 'Select the correct answer(s).'\n ],\n [\n 'pmatch',\n 'Write your answer in the space provided. Please keep it to a sentence or two.'\n ],\n [\n 'pmatchjme',\n 'Write your answer in the space provided.'\n ],\n [\n 'gapselect',\n 'Write the letter of the corresponding answer (A, B, C, D, ...) in the space provided.'\n ],\n [\n 'shortanswer',\n 'Write your answer in the space provided. Please keep it to a sentence or two.'\n ],\n [\n 'stack',\n 'Write your answer in the space provided.'\n ],\n [\n 'truefalse',\n 'Select the correct answer.'\n ],\n [\n 'varnumeric',\n 'Write your answer in the space provided.'\n ],\n [\n 'varnumericset',\n 'Write your answer in the space provided.'\n ],\n [\n 'varnumunit',\n 'Write your answer in the space provided.'\n ],\n [\n 'wordselect',\n 'Select the answer(s) by circling the key word(s).'\n ]\n ];\n }", "function getAll() {\r\n\t\treturn SurveyAnswerQuery::create()->find();\r\n\t}", "private function questionList()\n {\n \t$requiredQuestions = [];\n\n \tfor ($x = 1; $x <= count($this->questions); $x++) {\n \t\t$requiredQuestions[ config('constants.questionInputPrefix') . $x] = 'required';\n \t}\n\n \treturn $requiredQuestions;\n }", "function getCorrectAnswers()\n\t{\n\t\treturn $this->correctanswers;\n\t}", "public function getAnswers($myAnswers){\r\n\t\t$pfx = $this->c->dbprefix;\r\n\t\t$conn = $this->conn();\r\n\r\n\t\t$keys = array_keys($myAnswers);\r\n\t\t$ids = implode(\",\",$keys);\r\n\r\n\t\t$sql = \"select\r\n\t\t\t\t answer\r\n\t\t\t\t,id\r\n\t\t\t\t,id_parent\r\n\r\n\t\t\t\t,markingmethod\r\n\t\t\t\t,description\r\n\t\t\t\t,cent\r\n\t\t\t\t,type\r\n\t\t\t\t,option2\r\n\t\t\t\t,option3\r\n\t\t\t\t,option4\r\n\t\t\t\t\r\n\t\t\t\t,ids_level_knowledge\r\n\t\t\t\t\r\n\t\t\t from \".$pfx.\"wls_question where id in (\".$ids.\") order by id ; \";\r\n\t\t$res = mysql_query($sql,$conn);\r\n\t\tif($res==false)echo $sql;\r\n\t\t$data = array();\r\n\t\twhile($temp = mysql_fetch_assoc($res)){\r\n\t\t\t$temp['myAnswer'] = $myAnswers[$temp['id']];\r\n\t\t\t$data[] = $temp;\r\n\t\t}\r\n\r\n\t\treturn $data;\r\n\t}", "function getQuestions() { \n\ttry {\n\t\t$questions = ORM::for_table('questions')->find_many();\n\t\tif (!count($questions)) { \n\t\t\treturn 0;\n\t\t}\n\t\t$theQuestions = array();\n\t\tforeach ($questions as $question) { \n\t\t\t$theQuestion = array();\n\t\t\t$theQuestion['id'] = $question->id;\n\t\t\t$theQuestion['text'] = $question->text;\n\t\t\t$theQuestion['answer1'] = $question->answer1;\n\t\t\t$theQuestion['answer2'] = $question->answer2;\n\t\t\t$theQuestions[] = $theQuestion;\n\t\t}\n\t\treturn $theQuestions;\n\t} catch (Exception $e) { \n\t\treturn 0;\n\t}\n}", "protected function _processQuestions($quest){\n\t\t\n\t\t$elements = array();\n\t\t\n\t\tif (is_array($quest->Preguntas->PreguntaDTO)){\n\t\t\tforeach ($quest->Preguntas->PreguntaDTO as $key => $question){\n\t\t\t\n\t\t\t\t$label \t\t\t= $question->Nombre;\n\t\t\t\t$tipo_pregunta \t= $question->TipoPregunta;\n\t\t\t\t$options\t\t= array();\n\t\t\t\t$element \t\t= new stdClass();\n\t\t\t\t\n\t\t\t\tswitch ($tipo_pregunta){\n\t\t\t\t\t\t\n\t\t\t\t\tcase 'ListaDesplegable':\n\t\t\t\t\t\t$element->html_type = 'select';\n\t\t\t\t\t\t$element->multioptions = $this->getCatalogoOpciones($question);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\t\tcase 'Fecha':\n\t\t\t\t\t\t$element->html_type = 'text';\n\t\t\t\t\t\t$element->decorator = 'Calendar';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\t\tcase 'Abierta':\n\t\t\t\t\t\t$element->html_type = 'text';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\t\tcase 'Cerrada':\n\t\t\t\t\tcase 'Mixta':\t\n\t\t\t\t\t\tif (!is_null($question->Opciones->OpcionDTO)){\n\t\t\t\t\t\t\t$element->html_type = 'select';\n\t\t\t\t\t\t\t$element->multioptions = $this->_getMultiOptions($question->Opciones->OpcionDTO);\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t$element->html_type = 'text';\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$field_required = $question->Obligatoria;\n\t\t\t\tif ($field_required){\n\t\t\t\t\t$element->required = TRUE;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$element->label = $label;\n\t\t\t\t$element->value = $question->ValorDefecto;\n\t\t\t\t$element->name = $question->Concepto;\n\t\t\t\n\t\t\t\t$this->_processElement($element);\n\t\t\t\t$elements[] = $this->filterName($element->name);\n\t\t\t}\n\t\t}else{\n\t\t\t\t$label \t\t\t= $quest->Preguntas->PreguntaDTO->Nombre;\n\t\t\t\t$tipo_pregunta \t= $quest->Preguntas->PreguntaDTO->TipoPregunta;\n\t\t\t\t$options\t\t= array();\n\t\t\t\t$element \t\t= new stdClass();\n\t\t\t\t\n\t\t\t\tswitch ($tipo_pregunta){\n\t\t\t\t\t\t\n\t\t\t\t\tcase 'ListaDesplegable':\n\t\t\t\t\t\t$element->html_type = 'select';\n\t\t\t\t\t\t$element->multioptions = $this->getCatalogoOpciones($quest->Preguntas->PreguntaDTO);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\t\tcase 'Fecha':\n\t\t\t\t\t\t$element->html_type = 'text';\n\t\t\t\t\t\t$element->decorator = 'Calendar';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\t\tcase 'Abierta':\n\t\t\t\t\t\t$element->html_type = 'text';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\t\tcase 'Cerrada':\n\t\t\t\t\tcase 'Mixta':\t\n\t\t\t\t\t\tif (!is_null($question->Opciones->OpcionDTO)){\n\t\t\t\t\t\t\t$element->html_type = 'select';\n\t\t\t\t\t\t\t$element->multioptions = $this->_getMultiOptions($quest->Preguntas->PreguntaDTO->Opciones->OpcionDTO);\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t$element->html_type = 'text';\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$field_required = $question->Obligatoria;\n\t\t\t\tif ($field_required){\n\t\t\t\t\t$element->required = TRUE;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$element->label = $label;\n\t\t\t\t$element->value = $quest->Preguntas->PreguntaDTO->ValorDefecto;\n\t\t\t\t$element->name = $quest->Preguntas->PreguntaDTO->Concepto;\n\t\t\t\t\n\t\t\t\t$this->_processElement($element);\n\t\t\t\t\n\t\t\t\t$elements[] = $this->filterName($element->name);\n\t\t}\n\t\t\n\t\treturn $elements;\n\t}", "function get_Questions()\n\t{\n\t\ttry\n\t\t{\n\t\t\t$db = DB::getConnection();\n\t\t\t$st = $db->prepare( 'SELECT * FROM questions' );\n\t\t\t$st->execute( array( ) );\n\t\t}\n\t\tcatch( PDOException $e ) { exit( 'PDO error ' . $e->getMessage() ); }\n\n\t\t$arr = array();\n\t\twhile( $row = $st->fetch() )\n\t\t{\n\t\t\t$arr[] = new Question( $row['id'], $row['question']);\n\t\t}\n\n\t\treturn $arr;\n\t}", "public function getSalespersonAllQuestions() {\n return $this->_salespersonDatasource->getSalespersonAllQuestions();\n }", "public static function questionWords()\n {\n return array('who', 'what', 'where', 'when', 'why', 'how', 'which', 'wherefore', 'whatever', 'whom', 'whose', 'wherewith', 'whither', 'whence');\n }", "function displayTheQuestions($questions) {\n\tif (count($questions) > 0) {\n\t\tforeach ($questions as $key => $value) {\n\t\t\techo \"<b>$value[0]</b><br/><br/>\";\n\t\t\t\n\t\t\t// Break the choices appart into a choice array\n\t\t\t$choices = explode(\",\",$value[1]);\n\t\t\t\n\t\t\t// For each choice, create a radio button as part of that questions radio button group\n\t\t\t// Each radio will be the same group name (in this case the question number) and have\n\t\t\t// a value that is the first letter of the choice.\n\t\t\t\n\t\t\tforeach($choices as $value) {\n\t\t\t\t$letter = substr(trim($value),0,1);\n\t\t\t\techo \"<input type=\\\"radio\\\" name=\\\"$key\\\" value=\\\"$letter\\\">$value<br/>\";\n\t\t\t}\n\t\t\t\n\t\t\techo \"<br/>\";\n\t\t}\n\t}\n\telse { echo \"No questions to display.\"; }\n}", "public function getQuestions()\n {\n if (!empty($this->questionsMetadata)) {\n foreach ($this->questions as $question) {\n /** @var Question $question */\n $data = $question->get_data();\n $metadata = $data->get_metadata();\n\n if (!isset($metadata)) {\n $qtype = $data->get_type();\n // HACK: longtextV2 doesn't have a corresponding entity, so force it to use the similar longtext one\n if ($qtype === 'longtextV2') {\n $qtype = 'longtext';\n }\n $metadataClass = '\\\\LearnosityQti\\\\Entities\\\\QuestionTypes\\\\'.$qtype.'_metadata';\n $metadata = new $metadataClass();\n $data->set_metadata($metadata);\n }\n\n $this->populateQuestionMetadata($metadata, $this->questionsMetadata);\n }\n }\n return array_merge(array_values($this->questions), $this->getRubricQuestions());\n }", "public function getAnswers()\n {\n return $this->_answers;\n }", "public function getAnswers()\n {\n return $this->answers;\n }", "public function getAnswers()\n {\n return $this->answers;\n }", "public function getAnswers()\n {\n return $this->answers;\n }", "function getRandomAnswers($correctAnswer) {\n $answersArray = [];\n do {\n $random = random_int($correctAnswer - 10, $correctAnswer + 10);\n if ($random != $correctAnswer && !in_array($random, $answersArray)) {\n $answersArray[] = $random;\n }\n } while (count($answersArray) <= 2);\n return $answersArray;\n}", "function alternatives()\r\n {\r\n $returnArray = array();\r\n $db =& eZDB::globalDatabase();\r\n $db->array_query( $questionArray, \"SELECT ID FROM eZQuiz_Alternative WHERE QuestionID='$this->ID' ORDER BY ID\" );\r\n\r\n for ( $i = 0; $i < count( $questionArray ); $i++ )\r\n {\r\n $returnArray[$i] = new eZQuizAlternative( $questionArray[$i][$db->fieldName( \"ID\" )], true );\r\n }\r\n return $returnArray;\r\n }", "public function getAnswers() {\r\n\t\treturn $this->answers;\r\n\t}", "function get_question_random_simple() {\n global $default_terms_array;\n $session = new Session();\n $questions = get_questions($default_terms_array);\n\n for ($i = 0; $i < sizeof($questions); $i++) {\n\n $question = $questions[array_rand($questions) ];\n\n // if the question hasn't already been asked recently OR we're not remembering things in the session, return it\n if ((!$session->get('random_questions_asked') || ($session->get('random_questions_asked') && !in_array($question->get_ID(), $session->get('random_questions_asked'))))) {\n return $question;\n }\n }\n\n return $questions[array_rand($questions) ];\n}", "public function randomQuestion() {\n return\n $this->createQueryBuilder('qb')\n ->orderBy('RAND()')\n ->setMaxResults($this->maxResult)\n ->getQuery()\n ->getResult()\n ;\n }", "public function getQuestions() {\r\n\t\t\treturn $this->_arrQuestions;\r\n\t\t}", "function grade_responses(&$question, &$state, $cmoptions) {\n // We modify the question to look like a numerical question\n $numericalquestion = fullclone($question);\n foreach ($numericalquestion->options->answers as $key => $answer) {\n $answer = $numericalquestion->options->answers[$key]->answer; // for PHP 4.x\n $numericalquestion->options->answers[$key]->answer = $this->substitute_variables_and_eval($answer,\n $state->options->dataset);\n }\n $virtualqtype = $this->get_virtual_qtype();\n return $virtualqtype->grade_responses($numericalquestion, $state, $cmoptions) ;\n }", "public function getQuestionsAndAnswers()\n {\n $categoryId = $this->getRequest()->getParam('id', $this->getData('id'));\n if (!$categoryId) {\n $categoryId = Mage::getModel('faq/category')->getCollection()->getFirstItem()->getId();\n }\n $category = Mage::getModel('faq/category')->load($categoryId);\n $collection = $category->getFaqCollection();\n $collection->getSelect()->order('position ASC');\n return $collection;\n }", "private function generate_question() {\n\n require_once(__DIR__ . '/csv_gd.class.php');\n $csv_filename = $this->configuration['base_data_dir'] . '/csv/' . $this->configuration['csv_input'];\n\n $data_quiz_src_obj = new csv_gd($csv_filename);\n $data_quiz_src_orig = $data_quiz_src_obj->csv_to_array();\n\n\n\n // filter unwanted question (tags, diff level, void )\n $data_quiz_src_filtered = $this->quiz_filter($data_quiz_src_orig, $this->configuration['tags'], $this->configuration['min_diffucult_level'], $this->configuration['max_diffucult_level']);\n\n\n // reverse question with_answer\n if ($this->configuration['reverse_question'] == TRUE) {\n $data_quiz_src_filtered = $this->quiz_switch_question_with_answer($data_quiz_src_filtered);\n }\n\n\n // generate question and answer\n $data_quiz_src = $this->quiz_generate($data_quiz_src_filtered);\n\n\n // randomize quiz \n if ($this->configuration['randomize_question'] == TRUE) {\n shuffle($data_quiz_src);\n }\n\n\n // restrict the maxium number of question\n if ($this->configuration['max_question_total'] > 0) {\n $this->configuration['max_question_total'] = min(count($data_quiz_src), $this->configuration['max_question_total']);\n } else {\n $this->configuration['max_question_total'] = count($data_quiz_src);\n }\n $this->question = array_slice($data_quiz_src, 0, $this->configuration['max_question_total']);\n\n $this->configuration['debug']=$this->debug;\n\n // return $this->quiz_questions;\n }", "public function get_answers() {\n\t\t\t$answers = array();\n\t\t\tforeach ( $this->answer_data as $position => $data ) {\n\n\t\t\t\t$answers[ $this->get_answer_key( (string) $position ) ] = array(\n\t\t\t\t\t'label' => $data->getAnswer(),\n\t\t\t\t);\n\n\t\t\t\t/**\n\t\t\t\t * Filters the individual answer node.\n\t\t\t\t *\n\t\t\t\t * @since 3.3.0\n\t\t\t\t *\n\t\t\t\t * @param array $answer_node_data The answer node.\n\t\t\t\t * @param string $type Whether the node is answer node or student answer node.\n\t\t\t\t * @param mixed $data Individual answer data.\n\t\t\t\t */\n\t\t\t\t$answers[ $this->get_answer_key( (string) $position ) ] = apply_filters(\n\t\t\t\t\t'learndash_rest_statistic_answer_node_data',\n\t\t\t\t\t$answers[ $this->get_answer_key( (string) $position ) ],\n\t\t\t\t\t'answer',\n\t\t\t\t\t$data,\n\t\t\t\t\t$this->question->getId(),\n\t\t\t\t\t$position\n\t\t\t\t);\n\t\t\t}\n\n\t\t\treturn $answers;\n\t\t}", "private function question()\n\t{\n\t\t$this->qns['questionnaire']['questionnairecategories_id'] = $this->allinputs['questioncat'];\n\t\t$this->qns['questionnaire']['questionnairesubcategories_id'] = $this->allinputs['questionsubcat'];\n\t\t$this->qns['questionnaire']['label'] = $this->allinputs['question_label'];\n\n\n\t\t$this->qns['questionnaire']['question'] = $this->allinputs['question'];\n\t\t$this->qns['questionnaire']['has_sub_question'] = $this->allinputs['subquestion'];\n\n\t\tif( $this->qns['questionnaire']['has_sub_question'] == 0 )\n\t\t{\n\t\t\t$this->qns['answers']['answer_type'] = $this->allinputs['optiontype'];\n\t\t}\n\n\t\t$this->qns['questionnaire']['active'] = 1;\n\n\t\tif( $this->qns['questionnaire']['has_sub_question'] == 0 ){\n\t\t\t//This code must be skipped if sub_question is 1\n\t\t\t$optionCounter = 0;\n\t\t\tforeach ($this->allinputs as $key => $value) {\n\n\t\t\t\tif( str_is('option_*', $key) ){\n\t\t\t\t\t$optionCounter++;\n\t\t\t\t\t$this->qns['answers'][$optionCounter] = ( $this->qns['answers']['answer_type'] == 'opentext' ) ? 'Offered answer text' : $value;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function queryAll(){\n\t\t$sql = 'SELECT * FROM answer';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\treturn $this->getList($sqlQuery);\n\t}", "function generateQuestion(){\n $rangeLow = 1;\n $rangeHigh = 100;\n $incorrectNumberHigh = 10;\n\n $leftAdder = random_int($rangeLow, $rangeHigh);\n $rightAdder = random_int($rangeLow, $rangeHigh);\n $correctAnswer = $leftAdder + $rightAdder;\n //generate init values for envaluation\n $incorrectAnswerFirst = random_int($correctAnswer-$incorrectNumberHigh, $correctAnswer+$incorrectNumberHigh);\n $incorrectAnswerSecond = random_int($correctAnswer-$incorrectNumberHigh , $correctAnswer+$incorrectNumberHigh);\n\n //if the condition not met, keep generated\n while(\n ($incorrectAnswerFirst == $correctAnswer) \n || \n ($incorrectAnswerFirst == $incorrectAnswerSecond)\n ||\n ($incorrectAnswerSecond == $correctAnswer)\n ){\n $incorrectAnswerFirst = random_int($correctAnswer-$incorrectNumberHigh, $correctAnswer+$incorrectNumberHigh);\n $incorrectAnswerSecond = random_int($correctAnswer-$incorrectNumberHigh , $correctAnswer+$incorrectNumberHigh);\n }\n $questions =\n [\n \"leftAdder\" => $leftAdder,\n \"rightAdder\" => $rightAdder,\n \"correctAnswer\" => $correctAnswer,\n \"firstIncorrectAnswer\" => $incorrectAnswerFirst,\n \"secondIncorrectAnswer\" => $incorrectAnswerSecond\n ];\n\n\n return $questions;\n}", "function getQuestions()\n\t{\n\t\treturn $this->aQuestion;\n\t}", "function get_qoptions($qid){\n\n\tglobal $dbc;\n\t$sql = $dbc->query(\"select * from questionoptions where qid = '$qid' \");\n\t// $rows[]=\"\";\n\twhile($row = $sql->fetch_array()){\n\t\t$rows[] = $row;\n\t}\n\treturn $rows;\n}", "public static function answers($q_id) {\n $ans = Database::select(\"SELECT a_id, a_text, a_correct FROM answers WHERE q_id = \\\"$q_id\\\"\");\n $answers = [];\n foreach ($ans as $an) {\n if(1 == $an['a_correct']) {\n $color = \"green\";\n }\n else {\n $color = \"red\";\n }\n $answers = array_merge($answers, [[\"a_id\" => $an['a_id'], 'a_text' => $an['a_text'], 'color' => $color]]);\n }\n return $answers;\n }", "public static function getValidAnswersForQuestionType(string $question_type): array {\n switch ($question_type) {\n case Question::TYPE_SLEEP_TIME:\n return [\n 'answer-sleep-time-less-4',\n 'answer-sleep-time-4-to-6',\n 'answer-sleep-time-6-to-8',\n 'answer-sleep-time-8-plus',\n ];\n case Question::TYPE_SLEEP_QUALITY:\n return [\n 'answer-sleep-quality-excellent',\n 'answer-sleep-quality-good',\n 'answer-sleep-quality-fine',\n 'answer-sleep-quality-bad',\n 'answer-sleep-quality-terrible',\n ];\n case Question::TYPE_DIFFICULTY_WAKING_UP:\n return [\n 'answer-difficulty-waking-up-very-easy',\n 'answer-difficulty-waking-up-easy',\n 'answer-difficulty-waking-up-fine',\n 'answer-difficulty-waking-up-difficult',\n 'answer-difficulty-waking-up-very-difficult',\n ];\n default:\n return [];\n }\n }", "public static function _get_all_answer_by_qid($ref_qid)\n {\n $all_answers = array();\n $connection = _database::get_connection();\n $query = \"SELECT * FROM `_answers` WHERE `_a_qid` = $ref_qid ORDER BY `_a_time` DESC\";\n if ($res = $connection->query($query)) {\n $i=0;\n while ($arr = $res->fetch_array())\n {\n $obj = new _answers();\n $obj->setAid($arr['_aid']);\n $obj->setDescription($arr['_description']);\n $obj->setAUid($arr['_a_uid']);\n $obj->setAQid($arr['_a_qid']);\n $obj->setApt($arr['_apt']);\n $obj->setNotApt($arr['_notapt']);\n $obj->setATime($arr['_a_time']);\n $all_answers[$i]=$obj;\n $i++;\n }\n return $all_answers;\n }\n else {\n return false;\n }\n }", "function ipal_get_questions(){ \r\n \r\n\tglobal $ipal;\r\n\tglobal $DB;\r\n\tglobal $CFG;\r\n\t$q='';\t\r\n\t$pagearray2=array();\r\n\t // is there an quiz associated with an ipal?\r\n//\t$ipal_quiz=$DB->get_record('ipal_quiz',array('ipal_id'=>$ipal->id));\r\n\t\r\n\t// get quiz and put it into an array\r\n\t$quiz=$DB->get_record('ipal',array('id'=>$ipal->id));\r\n\t\r\n\t//Get the question ids\r\n\t$questions=explode(\",\",$quiz->questions);\r\n\t\r\n\t//get the questions and stuff them into an array\r\n\t\tforeach($questions as $q){\t\r\n\t\t\t\r\n\t\t $aquestions=$DB->get_record('question',array('id'=>$q));\r\n\t\t if(isset($aquestions->questiontext)){\r\n\t\t $pagearray2[]=array('id'=>$q, 'question'=>strip_tags($aquestions->questiontext), 'answers'=>ipal_get_answers($q));\r\n\t\t\t\t \r\n\t\t }\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t}\r\n \r\n\treturn($pagearray2);\r\n\t}", "public function getQuestions()\n {\n return DB::table('questionbank_quizzes')\n ->where('quize_id','=',$this->id)\n ->orderBy('subject_id')\n ->get();\n }", "public static function getAll() {\n \treturn Question::whereNull('deleted_at')->get();\n }", "function getAnswers($force=false) {\n\t\t// If we don't have answers and we know the assessment is complete, search the database\n\t\tif((!$this->_answers and $this->isComplete()) or $force) {\n\t\t\t$this->_answers = tx_wecassessment_answer::findInResult($this->getUID());\n\t\t}\n\t\t\n\t\treturn $this->_answers;\t\t\n\t}", "public function getQuestions(): array\n {\n $questions = [];\n foreach ($this->block->getQuestions() as $question) {\n $cleanedAnswer = implode('', $this->fixIsiteMarkupHelper->getParagraphs($question['answer']));\n $questions[] = [\n 'question' => $question['question'],\n 'answer' => $cleanedAnswer,\n ];\n }\n return $questions;\n }", "private function createAnswers($f, $p) {\n\n // Simulate each qeustion answering\n foreach ($f->questions as $q) {\n if ($q->isAspect()) {\n // If the question is about each aspect, answer like..\n\n // Each aspects has 3 level: normal, high-risk, very-high-risk\n // random to choose between those\n $c = $this->getRandomChoice($q->choices, null, true);\n if ($c->value == 0) {\n // Choose it and continue to next question\n $this->chooseChoice($f, $q, $c, $p);\n\n // next loop\n } else {\n // Choose the choice\n $this->chooseChoice($f, $q, $c, $p);\n $this->chooseRandomSubchoices($f, $q, $c, $p);\n\n // and random again\n // Since high & very-high can be their simultaneously\n $nc = $this->getRandomChoice($q->choices, null, true);\n\n if ($nc->value > 0 && $nc->value != $c->value) {\n // Not the 'normal' and not the same choice, choose it\n $this->chooseChoice($f, $q, $nc, $p);\n $this->chooseRandomSubchoices($f, $q, $nc, $p);\n } else {\n // next loop\n }\n }\n } else if ($q->isAboutTalent()) {\n // If the question is about talent answer like...\n\n // Talent has only 2 choice, random between the two\n $c = $this->getRandomChoice($q->choices, null);\n $a = $this->chooseChoice($f, $q, $c, $p);\n $ci = $c->inputs()->first();\n if ($ci) {\n $this->createRandomTalent($a, $ci, $p);\n }\n\n // next loop\n\n } else if ($q->isAboutDisability()) {\n // If the question is about disability answer like...\n\n // Non uniform random, low rate of having disability\n $probHaveDis = rand(0, 100);\n\n // Only 30% chance that a participant will have disability\n if ($probHaveDis > 70) {\n\n $numDis = $this->randomNumberOfDisabilities();\n\n $choosenChoices = [];\n $numChoice = count($q->choices);\n for ($i=0; $i < $numDis; $i++) { \n $c = $this->getRandomChoice($q->choices, $numChoice);\n \n if (Choice::choiceExistsInAnswers($c, $choosenChoices)) {\n // Allow no duplicates disabilities\n continue;\n } else {\n $a = $this->chooseChoice($f, $q, $c, $p);\n $ci = $c->inputs()->first();\n if ($ci) {\n $this->createRandomDisability($a, $ci);\n }\n }\n\n $choosenChoices[] = $a;\n }\n }\n }\n }\n }", "public function get_correct_answer() {\n return isset($this->answer) ? array('answer' => $this->answer) : array();\n }", "public function get_wrong_answers($question) {\n $wronganswers = \"\";\n if (property_exists($question, 'options')) {\n foreach ($question->options->answers as $a) {\n /* if it doesn't contain a 1 it must be zero and so be a wrong answer */\n if (!(strpos($a->fraction, '1') !== false)) {\n $wronganswers .= $a->answer . \",\";\n }\n }\n }\n return rtrim($wronganswers, ',');\n }", "public function check_and_filter_answers($form) {\n $tags = $this->part_tags();\n $res = (object)array('answers' => array());\n foreach ($form->answermark as $i => $a) {\n if ((strlen(trim($form->answermark[$i])) == 0 || strlen(trim($form->answer[$i])) == 0)\n && (strlen(trim($form->subqtext[$i]['text'])) != 0\n || strlen(trim($form->feedback[$i]['text'])) != 0\n || strlen(trim($form->vars1[$i])) != 0\n )\n ) {\n $res->errors[\"answer[$i]\"] = get_string('error_answer_missing', 'qtype_formulas');\n $skip = true;\n }\n if (strlen(trim($form->answermark[$i])) == 0 || strlen(trim($form->answer[$i])) == 0) {\n continue; // If no mark or no answer, then skip this answer.\n }\n if (floatval($form->answermark[$i]) <= 0) {\n $res->errors[\"answermark[$i]\"] = get_string('error_mark', 'qtype_formulas');\n }\n $skip = false;\n if (strlen(trim($form->correctness[$i])) == 0) {\n $res->errors[\"correctness[$i]\"] = get_string('error_criterion', 'qtype_formulas');\n $skip = true;\n }\n if ($skip) {\n continue; // If no answer or correctness conditions, it cannot check other parts, so skip.\n }\n $res->answers[$i] = new stdClass();\n $res->answers[$i]->questionid = $form->id;\n foreach ($tags as $tag) {\n $res->answers[$i]->{$tag} = trim($form->{$tag}[$i]);\n }\n\n $subqtext = array();\n $subqtext['text'] = $form->subqtext[$i]['text'];\n $subqtext['format'] = $form->subqtext[$i]['format'];\n if (isset($form->subqtext[$i]['itemid'])) {\n $subqtext['itemid'] = $form->subqtext[$i]['itemid'];\n }\n $res->answers[$i]->subqtext = $subqtext;\n\n $fb = array();\n $fb['text'] = $form->feedback[$i]['text'];\n $fb['format'] = $form->feedback[$i]['format'];\n if (isset($form->feedback[$i]['itemid'])) {\n $fb['itemid'] = $form->feedback[$i]['itemid'];\n }\n $res->answers[$i]->feedback = $fb;\n\n $fb = array();\n $fb['text'] = $form->partcorrectfb[$i]['text'];\n $fb['format'] = $form->partcorrectfb[$i]['format'];\n if (isset($form->partcorrectfb[$i]['itemid'])) {\n $fb['itemid'] = $form->partcorrectfb[$i]['itemid'];\n }\n $res->answers[$i]->partcorrectfb = $fb;\n\n $fb = array();\n $fb['text'] = $form->partpartiallycorrectfb[$i]['text'];\n $fb['format'] = $form->partpartiallycorrectfb[$i]['format'];\n if (isset($form->partpartiallycorrectfb[$i]['itemid'])) {\n $fb['itemid'] = $form->partpartiallycorrectfb[$i]['itemid'];\n }\n $res->answers[$i]->partpartiallycorrectfb = $fb;\n\n $fb = array();\n $fb['text'] = $form->partincorrectfb[$i]['text'];\n $fb['format'] = $form->partincorrectfb[$i]['format'];\n if (isset($form->partincorrectfb[$i]['itemid'])) {\n $fb['itemid'] = $form->partincorrectfb[$i]['itemid'];\n }\n $res->answers[$i]->partincorrectfb = $fb;\n }\n if (count($res->answers) == 0) {\n $res->errors[\"answermark[0]\"] = get_string('error_no_answer', 'qtype_formulas');\n }\n\n return $res;\n }", "public function getQuestions() {\r\n\t\treturn $this->questions;\r\n\t}", "public function getQuestions()\n {\n return $this->questions;\n }", "public function getQuestions()\n {\n return $this->questions;\n }", "function getOpts(){\n $q = getPublicQ();\n $q = Question::find($q[rand(0,sizeof($q) > 1 ? sizeof($q)-1 : 0)]);\n\n if($q->type == \"open\"){\n return [$q, null];\n }\n\n $ans = Option::all()->where('question_id', $q->id)->pluck('id');\n return sizeof($ans) > 1 ? [$q, Option::find($ans[0])->option] : getOpts();\n}", "public function GetFormPostedValuesQuestions() {\n\t\t/* THE ARRAY OF POSTED FIELDS */\n\t\t$req_fields=array(\"survey_id\",\"question\");\n\n\t\tfor ($i=0;$i<count($req_fields);$i++) {\n\n\t\t\t//echo $_POST['application_id'];\n\t\t\tif (ISSET($_POST[$req_fields[$i]]) && !EMPTY($_POST[$req_fields[$i]])) {\n\t\t\t\t$this->SetVariable($req_fields[$i],EscapeData($_POST[$req_fields[$i]]));\n\t\t\t}\n\t\t\telse {\n\t\t\t\t//echo \"<br>\".$this->req_fields[$i].\"<br>\";\n\t\t\t\t$this->$req_fields[$i]=\"\";\n\t\t\t}\n\t\t}\n\t}", "function get_survey_answers($question_id) {\r\n // set connection var\r\n global $db;\r\n\r\n //query to get all associated survey answers\r\n $sql = \"SELECT id\r\n FROM answers\r\n WHERE is_active = '1' AND question = '$question_id';\";\r\n\r\n $answers_data = array();\r\n $answers = array();\r\n foreach ($db->query($sql) as $key => $value) {\r\n $answers_data[$key] = $value;\r\n foreach ($answers_data[$key] as $subkey => $subvalue) {\r\n if (is_int($subkey)) {\r\n $answers[] = $subvalue;\r\n }\r\n }\r\n }\r\n\r\n return $answers;\r\n}", "private function _Questions ( ) {\n\t\t$Config = $this->Get ( 'Config' );\n\t\t$quests = $Config['questions'];\n\t\t$groups = $Config['question_groups'];\n\t\tforeach ( $groups as $g => $group ) {\n\t\t\t$Groups[$group] = new stdClass();\n\t\t\t$Groups[$group]->Label = $Config['question_group_labels'][$g];\n\t\t\tforeach ( $quests as $q => $quest ) {\n\t\t\t\tif ( $Config['question_group'][$q] != $g ) continue;\n\t\t\t\t$Groups[$group]->Questions[$quest] = new stdClass();\n\t\t\t\t$Groups[$group]->Questions[$quest]->Label = $Config['question_labels'][$q];\n\t\t\t\t$Groups[$group]->Questions[$quest]->Type = $Config['question_types'][$q];\n\t\t\t\t$Groups[$group]->Questions[$quest]->Field = $Config['question_fields'][$q];\n\t\t\t\t$Groups[$group]->Questions[$quest]->Social = $Config['question_social'][$q];\n\t\t\t\t$Groups[$group]->Questions[$quest]->Display = $Config['question_display'][$q];\n\t\t\t\tif ( $Config['question_options'][$q] )\n\t\t\t\t\t$Groups[$group]->Questions[$quest]->Options = explode ( '|', $Config['question_options'][$q] );\n\t\t\t}\n\t\t\tksort ( $Groups[$group]->Questions );\n\t\t}\n\t\tksort ( $Groups );\n\t\treturn ( $Groups );\n\t}", "public function qw() {\n $prep = $this->db->prepare('\n SELECT question,reponse\n FROM faq ');\n\n $prep->execute();\n\n return $prep->fetchAll(PDO::FETCH_ASSOC);\n }", "public function getAllAnswers($section_id, $q_id)\n {\n $this->db->select('answer, COUNT(*) as num_answers');\n $this->db->from('answer');\n $this->db->join('submission', 'answer.sub_id = submission.sub_id');\n $this->db->where('q_id', $q_id);\n $this->db->where('section_id', $section_id);\n $this->db->where('submitted', self::SUBMITTED);\n $this->db->group_by('answer');\n\n return $this->db->get()->result_array();\n }", "public function fillQuestion(array $question)\n\t{\n\t\t[$inputMode, $inputExpectation, $notUseful, $from] = explode('_', $question['type']);\n\n\t\tvar_dump($inputMode, $inputExpectation, $notUseful, $from);\n\t\t//var_dump($question['function']['name']);\n\n\t\tif($inputMode == 'type')\n\t\t{\n\t\t\t$question['text'] .= $question['function'][$from] . ' ?';\n\t\t\t$question['answer_text'] = $question['function'][$inputExpectation];\n\t\t}\n\n\t\telseif($inputMode == 'choose')\n\t\t{\n\t\t\t$question['answer_text'] = $question['function'][$inputExpectation];\n\n\t\t\tif($from == 'name')\n\t\t\t{\n\t\t\t\t$question['text'] .= $question['function']['name'] . '() ?';\n\t\t\t}\n\n\t\t\telse\n\t\t\t{\n\t\t\t\t$question['text'] .= $question['function'][$from] . ' ?';\n\t\t\t}\n\n\t\t\t$question['choices'] = $this->generateChoices($question);\n\n\t\t\t//put correct answer in (by clobbering one of generated choices)\n\t\t\t$randomChoice = array_rand($question['choices']);\n\n\t\t\t$question['choices'][$randomChoice] = $question['answer_text'];\n\t\t\t$question['answer_index'] = $randomChoice;\n\t\t}\n\n\t\t\n\n\t\treturn $question;\n\t}", "function buildQuiz() {\n for ($i = 0; $i <= 9; $i++) {\n $randomNumbers = getRandomNumbers();\n $correctAnswer = getCorrectAnswer($randomNumbers);\n $answers = getRandomAnswers($correctAnswer);\n $quiz[] = [\n \"leftAdder\" => $randomNumbers[0],\n \"rightAdder\" => $randomNumbers[1],\n \"correctAnswer\" => $correctAnswer,\n \"firstIncorrectAnswer\" => $answers[0],\n \"secondIncorrectAnswer\" => $answers[1],\n ];\n }\n return $quiz;\n}", "public function get_question_options($question) {\n global $DB;\n\n $question->options = $DB->get_record('qtype_formulas_options', ['questionid' => $question->id]);\n\n if ($question->options === false) {\n // If this has happened, then we have a problem.\n // For the user to be able to edit or delete this question, we need options.\n debugging(\"Formulas question ID {$question->id} was missing an options record. Using default.\", DEBUG_DEVELOPER);\n\n $question->options = $this->create_default_options($question);\n }\n\n parent::get_question_options($question);\n $question->options->answers = $DB->get_records(\n 'qtype_formulas_answers',\n array('questionid' => $question->id), 'partindex ASC'\n );\n $question->options->numpart = count($question->options->answers);\n $question->options->answers = array_values($question->options->answers);\n return true;\n }", "public function questions() {\n $questions = DB::select('select Question, AnswerType, rowid from Questions WHERE AnswerType<>\"mcq-radio\" AND AnswerType<>\"mcq-dropDown\";');\n\n // Obtain a list of all questions that are mcq\n $MCQ = DB::select('select Question, AnswerType, rowid from Questions WHERE AnswerType=\"mcq-radio\" OR AnswerType=\"mcq-dropDown\";');\n $mcqOptions = DB::select('select Qid, mcqOption from mcqOptions');\n\n return view('userResponseArea', compact(['questions','MCQ', 'mcqOptions']));\n }", "public function get_questions() {\n return $this->questions;\n }", "function get_all_correct_answers()\n {\n $this->db->order_by('id', 'desc');\n return $this->db->get('correct_answers')->result_array();\n }", "function getQuestionsQuery(Query $q = null) {\n\t\treturn $this->getForeignObjectsQuery('question', 'quiz_id','id', $q);\n\t}", "function getAnswers($pdo, $question_id){\n // Query\n // Get answers for a specific question\n $sql = 'SELECT *\n FROM possible_answer\n WHERE question_id = ?';\n\n // Prepare and execute statement\n $stmt = $pdo->prepare($sql);\n $stmt->execute([$question_id]);\n // Saves result in object\n $answers = $stmt->fetchAll();\n\n // Return the data from the query\n return $answers;\n}", "function get_user_answers_by_question($user_id, $question_id) {\r\n // set connection var\r\n global $db;\r\n\r\n // query to get all vote survey_ids for session user\r\n $sql = \"SELECT id\r\n FROM votes\r\n WHERE is_active = '1' AND user_id = '$user_id' AND question = '$question_id';\";\r\n\r\n $votes_data = array();\r\n $votes = array();\r\n foreach ($db->query($sql) as $key => $value) {\r\n $votes_data[$key] = $value;\r\n foreach ($votes_data[$key] as $subkey => $subvalue) {\r\n if (is_int($subkey)) {\r\n $votes[] = $subvalue;\r\n }\r\n }\r\n }\r\n\r\n return $votes;\r\n}", "public function getquestion()\r\n {\r\n \r\n $con = new Connection();\r\n $conn = $con->getConnection();\r\n $ques = array();\r\n $i = 0;\r\n \r\n $query = \"SELECT `id`,`question_id`, `exam_id`,`subject_id`, `node_id`,`question`,`created_date` FROM `question`\";\r\n $result = mysqli_query($conn, $query);\r\n if (mysqli_num_rows($result) > 0) {\r\n while ($row = mysqli_fetch_assoc($result)) {\r\n $q = new question();\r\n //$ea->setId( $row ['id']);\r\n $q->setQuestion_id( $row ['question_id']);\r\n $q->setExam_id( $row ['exam_id']);\r\n $q->setSubject_id( $row ['subject_id']);\r\n $q->setNode_id( $row ['node_id']);\r\n $q->setQuestion( $row ['question']);\r\n \r\n }\r\n \r\n \r\n $ques[$i ++] = array(\r\n \"id\" => $row[\"question_id\"],\r\n \"ques\" => $q\r\n );\r\n \r\n }\r\n return $ques;\r\n \r\n }", "function ipal_get_questions_student($qid){\r\n\r\n global $ipal;\r\n global $DB;\r\n global $CFG;\r\n\t\t$q='';\r\n\t\t$pagearray2=array();\r\n\t\t\r\n $aquestions=$DB->get_record('question',array('id'=>$qid));\r\n\t\t\tif($aquestions->questiontext != \"\"){ \r\n\r\n\t$pagearray2[]=array('id'=>$qid, 'question'=>$aquestions->questiontext, 'answers'=>ipal_get_answers_student($qid));\r\n\t\t\t\t\t\t\t}\r\n return($pagearray2);\r\n}", "function get_all_questionnaires () {\n global $dbconnect;\n $query = \"SELECT * FROM questionnaires ORDER BY questionnaire_id ASC;\";\n $result = mysql_query($query, $dbconnect);\n confirm_query($result);\n return $result;\n}", "function getanswers($assid, $studentid, $questionid){\n\t\t\t$strQuery=\"select solution from answers where assid='$assid' and questionid = '$questionid' and stid = '$studentid'\";\n\t\t\t$result = $this->query($strQuery);\n\t}", "function get_survey_questions($survey_id) {\r\n // set connection var\r\n global $db;\r\n\r\n //query to get all associated survey answers\r\n $sql = \"SELECT id\r\n FROM questions\r\n WHERE is_active = '1' AND survey = '$survey_id';\";\r\n\r\n $questions_data = array();\r\n $questions = array();\r\n foreach ($db->query($sql) as $key => $value) {\r\n $questions_data[$key] = $value;\r\n foreach ($questions_data[$key] as $subkey => $subvalue) {\r\n if (is_int($subkey)) {\r\n $questions[] = $subvalue;\r\n }\r\n }\r\n }\r\n\r\n return $questions;\r\n}", "public function &getSurveyQuestions($with_answers = false)\n\t{\n\t\tglobal $ilDB;\n\t\t$obligatory_states =& $this->getObligatoryStates();\n\t\t// get questionblocks\n\t\t$all_questions = array();\n\t\t$result = $ilDB->queryF(\"SELECT svy_qtype.type_tag, svy_qtype.plugin, svy_question.question_id, \".\n\t\t\t\"svy_svy_qst.heading FROM svy_qtype, svy_question, svy_svy_qst WHERE svy_svy_qst.survey_fi = %s AND \" .\n\t\t\t\"svy_svy_qst.question_fi = svy_question.question_id AND svy_question.questiontype_fi = svy_qtype.questiontype_id \" .\n\t\t\t\"ORDER BY svy_svy_qst.sequence\",\n\t\t\tarray('integer'),\n\t\t\tarray($this->getSurveyId())\n\t\t);\n\t\tinclude_once \"./Modules/SurveyQuestionPool/classes/class.SurveyQuestion.php\";\n\t\twhile ($row = $ilDB->fetchAssoc($result))\n\t\t{\n\t\t\t$add = true;\n\t\t\tif ($row[\"plugin\"])\n\t\t\t{\n\t\t\t\tif (!$this->isPluginActive($row[\"type_tag\"]))\n\t\t\t\t{\n\t\t\t\t\t$add = false;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($add)\n\t\t\t{\n\t\t\t\t$question =& $this->_instanciateQuestion($row[\"question_id\"]);\n\t\t\t\t$questionrow = $question->_getQuestionDataArray($row[\"question_id\"]);\n\t\t\t\tforeach ($row as $key => $value)\n\t\t\t\t{\n\t\t\t\t\t$questionrow[$key] = $value;\n\t\t\t\t}\n\t\t\t\t$all_questions[$row[\"question_id\"]] = $questionrow;\n\t\t\t\t$all_questions[$row[\"question_id\"]][\"usableForPrecondition\"] = $question->usableForPrecondition();\n\t\t\t\t$all_questions[$row[\"question_id\"]][\"availableRelations\"] = $question->getAvailableRelations();\n\t\t\t\tif (array_key_exists($row[\"question_id\"], $obligatory_states))\n\t\t\t\t{\n\t\t\t\t\t$all_questions[$row[\"question_id\"]][\"obligatory\"] = $obligatory_states[$row[\"question_id\"]];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// get all questionblocks\n\t\t$questionblocks = array();\n\t\tif (count($all_questions))\n\t\t{\n\t\t\t$result = $ilDB->queryF(\"SELECT svy_qblk.*, svy_qblk_qst.question_fi FROM svy_qblk, svy_qblk_qst WHERE \" .\n\t\t\t\t\"svy_qblk.questionblock_id = svy_qblk_qst.questionblock_fi AND svy_qblk_qst.survey_fi = %s \" .\n\t\t\t\t\"AND \" . $ilDB->in('svy_qblk_qst.question_fi', array_keys($all_questions), false, 'integer'),\n\t\t\t\tarray('integer'),\n\t\t\t\tarray($this->getSurveyId())\n\t\t\t);\n\t\t\twhile ($row = $ilDB->fetchAssoc($result))\n\t\t\t{\n\t\t\t\t$questionblocks[$row['question_fi']] = $row;\n\t\t\t}\n\t\t}\n\t\t\n\t\tforeach ($all_questions as $question_id => $row)\n\t\t{\n\t\t\t$constraints = $this->getConstraints($question_id);\n\t\t\tif (isset($questionblocks[$question_id]))\n\t\t\t{\n\t\t\t\t$all_questions[$question_id][\"questionblock_title\"] = $questionblocks[$question_id]['title'];\n\t\t\t\t$all_questions[$question_id][\"questionblock_id\"] = $questionblocks[$question_id]['questionblock_id'];\n\t\t\t\t$all_questions[$question_id][\"constraints\"] = $constraints;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$all_questions[$question_id][\"questionblock_title\"] = \"\";\n\t\t\t\t$all_questions[$question_id][\"questionblock_id\"] = \"\";\n\t\t\t\t$all_questions[$question_id][\"constraints\"] = $constraints;\n\t\t\t}\n\t\t\tif ($with_answers)\n\t\t\t{\n\t\t\t\t$answers = array();\n\t\t\t\t$result = $ilDB->queryF(\"SELECT svy_variable.*, svy_category.title FROM svy_variable, svy_category \" .\n\t\t\t\t\t\"WHERE svy_variable.question_fi = %s AND svy_variable.category_fi = svy_category.category_id \".\n\t\t\t\t\t\"ORDER BY sequence ASC\",\n\t\t\t\t\tarray('integer'),\n\t\t\t\t\tarray($question_id)\n\t\t\t\t);\n\t\t\t\tif ($result->numRows() > 0) \n\t\t\t\t{\n\t\t\t\t\twhile ($data = $ilDB->fetchAssoc($result)) \n\t\t\t\t\t{\n\t\t\t\t\t\tarray_push($answers, $data[\"title\"]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$all_questions[$question_id][\"answers\"] = $answers;\n\t\t\t}\n\t\t}\n\t\treturn $all_questions;\n\t}", "public function getCorrectAnswers()\n {\n return $this->hasMany(CorrectAnswers::className(), ['question_id' => 'id']);\n }", "public function generateQuestion()\n\t{\n\t\t//get random question type\n\t\t$type = $this->questionTypes[array_rand($this->questionTypes)];\n\n\t\t//get random section\n\t\t$section = $this->getRandomSection();\n\n\t\t//get random function (within the above section)\n\t\t$function = $this->getRandomFunction($section);\n\n\t\t$question = [];\n\t\t$question['type'] = $type;\n\t\t$question['section'] = $section;\n\t\t$question['function'] = $function;\n\t\t$question['text'] = \"{$section} now, {$this->questionTextPerType[$type]}\";\n\t\t$question['choices'] = [];\n\t\t$question['answer_text'] = '';\n\t\t$question['answer_index'] = '';\t//in ['choices'] array\n\n\n\t\treturn $this->fillQuestion($question);\n\t}", "public function getAnswersByQuestion($id){\n $question = $this::find()->with('answers')->where(['id' => $id])->one();\n $answers = '';\n $last_key = end(array_keys($question->answers));\n foreach ($question->answers as $key => $value) {\n if($value['dependent_question_id'] == null)\n $answers .= $value['answer_text'].' <a href='. Yii::$app->getUrlManager()->getBaseUrl().'/index.php?r=question/create&option_id='.$value['id'].'>Add Dependent Question</a> <br>';\n else\n $answers .= $value['answer_text'].' <a href='. Yii::$app->getUrlManager()->getBaseUrl().'/index.php?r=question/view&id='.$value['dependent_question_id'].'>See Dependent Question </a>, <a href='.Yii::$app->getUrlManager()->getBaseUrl().'/index.php?r=question/detach&option_id='.$value['id'].'> Detach Question</a><br>';\n }\n return $answers;\n }", "private function a($question) {\n\t\treturn $this->answers[$question - 1];\n\t}", "public function getAnswers(): Answers\n {\n return $this->answers;\n }", "public function getAnswers($questionID){\n \n $select = $this->select()->where('questionID = ?', (int)$questionID)->order('ID ASC');\n \n return $this->fetchAll($select);\n \n }", "private function extractQuestions(){\n $this->selectQuestions();\n $num=mysqli_num_rows($this->arrResultQuestions);\n for($i=0; $i<$num; $i++):\n $row=mysqli_fetch_object($this->arrResultQuestions);\n $misc=new misc();\n $fromWho=$misc->singleSelection('username', 'users', 'user_id', '=', $row->user_id);\n ?>\n <article class=\"homePageQuestions homePageArticle<?php echo $i; ?>\">\n <h3 class=\"homePageQuestionHeading\"><a href=\"?questionBody=<?php echo $row->post_id; ?>\"><?php echo $row->name; ?></a></h3>\n <span class=\"homePageQuestionAddFrom\"><span class=\"glyphicon glyphicon-user\"></span><a href=\"?user=<?php echo $row->user_id; ?>\"><?php echo $fromWho; ?></a></span>\n <span class=\"homePageQuestionAddTime\"><span class=\"glyphicon glyphicon-time\"></span><?php echo date('d.m.Y в H:i', $row->timeadded); ?></span>\n <span class=\"homePageQuestionAddTime\"><span class=\"glyphicon glyphicon-tag\"></span><?php echo $this->selectCategory($row->cat_id); ?></span>\n <span class=\"homePageQuestionVisits\"><?php echo $row->visits ?> Показвания</span>\n <?php\n $this->showingQuestionsFooter($row->lastanswered, $row->lastanswer, $row->post_id);\n ?>\n </article>\n <?php\n endfor;\n }", "function getCumulatedResults(&$question, $finished_ids)\n\t{\n\t\tglobal $ilDB;\n\t\t\n\t\tif(!$finished_ids)\n\t\t{\n\t\t\t$result = $ilDB->queryF(\"SELECT finished_id FROM svy_finished WHERE survey_fi = %s\",\n\t\t\t\tarray('integer'),\n\t\t\t\tarray($this->getSurveyId())\n\t\t\t);\n\t\t\t$nr_of_users = $result->numRows();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$nr_of_users = sizeof($finished_ids);\n\t\t}\n\t\t\n\t\t$result_array =& $question->getCumulatedResults($this->getSurveyId(), $nr_of_users, $finished_ids);\n\t\treturn $result_array;\n\t}", "public function askMultipleChoice($question, $choices, $options = null)\n {\n $defaultOptions = array(\n 'style' => QuestionStyle::NUMBERS,\n 'display' => QuestionDisplay::VALUE,\n 'acceptValueAnswers' => true,\n 'acceptKeyAnswers' => false,\n 'layoutStyle' => QuestionLayoutStyle::GRID,\n 'default' => null,\n 'textColour' => null,\n 'canBeBlank' => false,\n 'backgroundColour' => null,\n 'padKeys' => true,\n 'padType' => null,\n 'return' => QuestionReturn::VALUE,\n 'argument' => null,\n );\n\n $options = ($options !== null ? array_merge($defaultOptions, $options) : $defaultOptions);\n\n $questionFull = $question;\n\n if ($options['display'] === QuestionDisplay::KEY) {\n $choices = array_keys($choices);\n\n $options['return'] = $options['return'] === QuestionReturn::KEY ? QuestionReturn::VALUE : QuestionReturn::KEY;\n }\n\n if (!empty($options['argument'])) {\n $options['style'] = QuestionStyle::VALUES;\n }\n\n $choiceIndex = array();\n $choiceIndexKey = array();\n\n if ($options['style'] === QuestionStyle::NUMBERS || $options['style'] === QuestionStyle::NUMBERS_ACCEPT_KEYS) {\n $i = 1;\n\n foreach ($choices as $key => $choice) {\n $index = ($i++);\n $choiceIndex[$index] = $choice;\n $choiceIndexKey[$index] = $key;\n }\n\n $i = 1;\n\n foreach ($choices as $key => $choice) {\n $index = ($i++);\n if ($options['default'] !== null && $options['default'] === $key) {\n $options['default'] = $index;\n\n break;\n }\n }\n\n } else if ($options['style'] === QuestionStyle::KEYS) {\n foreach ($choices as $key => $choice) {\n $choiceIndex[$key] = $choice;\n }\n } else if ($options['style'] === QuestionStyle::VALUES) {\n foreach ($choices as $key => $choice) {\n $choiceIndex[$choice] = $choice;\n }\n }\n\n $optionColourCode = DebugColour::getColourCode(DebugColour::GREEN);\n $regularColourCode = DebugColour::getColourCode($options['textColour'], $options['backgroundColour']);\n\n $hasDisplayCallback = false;\n\n $choiceIndexDisplay = [];\n\n if (!empty($options['displayCallback'])) {\n if (!is_callable($options['displayCallback'])) {\n throw new Exception(sprintf('displayCallback was not a callable'));\n }\n\n foreach ($choiceIndex as $key => $value) {\n $choiceIndexDisplay[$key] = call_user_func($options['displayCallback'], $choiceIndexKey[$key], $value);\n }\n\n $hasDisplayCallback = true;\n } else {\n $choiceIndexDisplay = $choiceIndex; // Do nothing with it\n }\n\n if ($options['style'] === QuestionStyle::VALUES) {\n foreach ($choiceIndexDisplay as $key => $choice) {\n if ($hasDisplayCallback) {\n $choice = call_user_func($options['displayCallback'], $choiceIndexKey[$key], $choice);\n }\n\n $questionFull .= \"\\n\" . $optionColourCode . ' * ' . $regularColourCode . $choice;\n }\n\n $questionFull .= \"\\n \" . $optionColourCode . '>';\n } else {\n if ($options['padKeys']) {\n if ($options['padType'] === null) {\n if ($options['style'] === QuestionStyle::NUMBERS) {\n $options['padType'] = STR_PAD_LEFT;\n } else {\n $options['padType'] = STR_PAD_RIGHT;\n }\n }\n\n $maxKeyLength = 0;\n\n foreach ($choiceIndexDisplay as $key => $choice) {\n $maxKeyLength = max($maxKeyLength, strlen($key));\n }\n\n foreach ($choiceIndexDisplay as $key => $choice) {\n $questionFull .= \"\\n\" . $optionColourCode . '[' . str_pad($key, $maxKeyLength, ' ',\n $options['padType']) . '] ' . $regularColourCode . $choice;\n }\n\n $questionFull .= str_pad(\"\\n \", $maxKeyLength + 2, ' ') . $optionColourCode . '>';\n } else {\n foreach ($choiceIndexDisplay as $key => $choice) {\n if ($hasDisplayCallback) {\n $choice = call_user_func($options['displayCallback'], $choiceIndexKey[$key], $choice);\n }\n\n $questionFull .= \"\\n\" . $optionColourCode . '[' . $key . '] ' . $regularColourCode . $choice;\n }\n $questionFull .= \"\\n \" . $optionColourCode . '> ';\n }\n }\n\n $possibleOptions = array_keys($choiceIndex);\n\n if ($options['acceptValueAnswers']) {\n foreach ($choices as $choice) {\n $choiceIndexKey[$choice] = $choice;\n $choiceIndex[$choice] = $choice;\n }\n }\n\n if ($options['acceptKeyAnswers']) {\n foreach ($choices as $key => $choice) {\n $choiceIndexKey[$key] = $choice;\n $choiceIndex[$key] = $choice;\n }\n }\n\n $answer = $this->ask($questionFull, array(\n 'default' => $options['default'],\n 'canBeBlank' => $options['canBeBlank'],\n 'textColour' => $options['textColour'],\n 'backgroundColour' => $options['backgroundColour'],\n 'possibleOptions' => $possibleOptions,\n 'argument' => $options['argument'],\n ));\n\n if (empty($answer) && $options['canBeBlank']) {\n return null;\n }\n\n if ($options['return'] === QuestionReturn::KEY) {\n if ($options['style'] === QuestionStyle::NUMBERS) {\n return $choiceIndexKey[$answer];\n } else {\n return $answer;\n }\n } else {\n return $choiceIndex[$answer];\n }\n }", "public function get_question_options($question) {\n // The code is used for calculated, calculatedsimple and calculatedmulti qtypes.\n global $CFG, $DB, $OUTPUT;\n if (!$question->options = $DB->get_record('qtype_calculatedfmt_opts',\n array('questionid' => $question->id))) {\n $question->options = new stdClass();\n $question->options->synchronize = 0;\n $question->options->single = 0;\n $question->options->answernumbering = 'abc';\n $question->options->shuffleanswers = 0;\n $question->options->correctfeedback = '';\n $question->options->partiallycorrectfeedback = '';\n $question->options->incorrectfeedback = '';\n $question->options->correctfeedbackformat = 0;\n $question->options->partiallycorrectfeedbackformat = 0;\n $question->options->incorrectfeedbackformat = 0;\n $question->options->correctanswerbase = 10;\n $question->options->correctanswerlengthint = 0;\n $question->options->correctanswerlengthfrac = 0;\n $question->options->correctanswergroupdigits = 0;\n $question->options->correctanswershowbase = 0;\n $question->options->exactdigits = 0;\n }\n\n if (!$question->options->answers = $DB->get_records_sql(\"\n SELECT a.*, c.tolerance, c.tolerancetype\n FROM {question_answers} a,\n {qtype_calculatedfmt} c\n WHERE a.question = ?\n AND a.id = c.answerid\n ORDER BY a.id ASC\", array($question->id))) {\n return false;\n }\n\n if ($this->get_virtual_qtype()->name() == 'numerical') {\n $this->get_virtual_qtype()->get_numerical_units($question);\n $this->get_virtual_qtype()->get_numerical_options($question);\n }\n\n $question->hints = $DB->get_records('question_hints',\n array('questionid' => $question->id), 'id ASC');\n\n if (isset($question->export_process)&&$question->export_process) {\n $question->options->datasets = $this->get_datasets_for_export($question);\n }\n return true;\n }", "public function getAllPossible(): array\n\t{\n\t\treturn $this->possibilities;\n\t}", "function getOptionsByQuestion($idQuestion)\r\n\t{\r\n\t\t$this->db->select('*');\r\n \t$this->db->where('custom_questions_id', $idQuestion);\r\n\t\t\r\n\t\t$query = $this->db->get($this->table);\r\n\t\t\r\n\t\tif($query->num_rows == 0)\r\n\t\t\treturn 0;\r\n\t\telse\r\n\t\t\treturn $query->result_array();\r\n\t}", "public function questionnaires()\n {\n return $this->morphedByMany(Questionnaire::class, 'model', 'taggables');\n }" ]
[ "0.6657261", "0.64363354", "0.6356001", "0.6226957", "0.61682993", "0.6166884", "0.6022557", "0.5912622", "0.5865852", "0.58351976", "0.5772984", "0.57560384", "0.5724471", "0.5717948", "0.5678715", "0.56291497", "0.5626127", "0.56241", "0.5614987", "0.5605768", "0.55457366", "0.5534926", "0.55176", "0.5511457", "0.54757243", "0.54702854", "0.5430281", "0.5415132", "0.5411023", "0.53730965", "0.53661996", "0.5365276", "0.5364157", "0.5362636", "0.5362636", "0.5362636", "0.535761", "0.53467786", "0.5340015", "0.5334818", "0.5309122", "0.52866536", "0.5286609", "0.5280721", "0.5275079", "0.52710277", "0.5261829", "0.52601445", "0.523831", "0.52261984", "0.52170587", "0.52042276", "0.5196563", "0.5188885", "0.51858205", "0.5184585", "0.51745135", "0.51699203", "0.5168827", "0.5167321", "0.51655406", "0.5155269", "0.5147936", "0.5139613", "0.51348215", "0.51348215", "0.51337063", "0.5126308", "0.5122525", "0.51192707", "0.5118945", "0.5117326", "0.5092266", "0.5088789", "0.50887287", "0.5081131", "0.5079427", "0.507337", "0.5071458", "0.50684917", "0.5067226", "0.50552046", "0.50486714", "0.50428396", "0.5040842", "0.50293446", "0.50164765", "0.50150514", "0.5001632", "0.500134", "0.49976146", "0.49927282", "0.49926782", "0.49852306", "0.4974871", "0.49688554", "0.4965157", "0.49493164", "0.49489376", "0.49459314" ]
0.52793795
44
Compares a given response with a given answer; the way which this is performed is determined by the answer_mode variable.
public function compare_response_with_answer(array $response, question_answer $answer) { // Tentative: if this response isn't gradable, it can't match any of the answers. if(!$this->is_gradable_response($response)) { return false; } //parse the response according to the selected response mode $value = $this->parse_response($response); //Create a new interpreter using the serialized question state. $interpreter = $this->create_interpreter($this->vars, $this->funcs); //Process the answer according to the interpretation mode. switch($this->answer_mode) { //for direct/answer modes, case qtype_scripted_answer_mode::MODE_MUST_EQUAL: //evaluate the given answer formula try { $ans = $interpreter->evaluate($answer->answer); } catch(qtype_scripted_language_exception $e) { return false; } //if we're comparing in a non-case-sensitive manner, convert the _answer_ to lowercase if($this->response_mode == qtype_scripted_response_mode::MODE_STRING) { $ans = strtolower((string)$ans); } //if the two are both numeric, compare them loosely, without regard to type; so 5 == "05" is true if(is_numeric($ans) && is_numeric($value)) { return $ans == $value; } //otherwise, compare them stricly; so "5a" !== 5; (note that, had we performed a loose compare, "5a" == 5 is true due to type juggling >.<) else { return $ans === $value; } //case 'boolean': case qtype_scripted_answer_mode::MODE_MUST_EVAL_TRUE: //Define the variable "resp" in the context of the interpreter. //Also define response, as per the principle of least astonishment. $interpreter->resp = $value; $interpreter->response = $value; try { //and return true iff the answer evaluates to True return (bool)$interpreter->evaluate($answer->answer); } //If an error occurs during evalution, return false. catch(qtype_scripted_language_exception $e) { return false; } default: //something's gone wrong throw new coding_exception('Invalid grading mode for the scripted qtype.'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function compare_response_with_answer(array $response, question_answer $answer) {\n global $question;\n $autofeedback = $this->autofeedback;\n // Check to see if correct or not.\n if (self::compare_string_with_wildcard($response['answer'], $answer->answer, false)) {\n return true;\n }\n if ($this->autofeedback == 0) {\n return false;\n }\n // Must be wrong answer....lets see where they went wrong.\n $anssmiles = $answer->answer;\n $usrsmiles = $response['answer'];\n $eofeedback = '';\n // Check to see if user submitted correct type (reaction or not reaction).\n if (self::smiles_is_reaction($anssmiles)) {\n if (!self::smiles_is_reaction($usrsmiles)) {\n $this->usecase = \"<ol><li>You were asked to draw a reaction, but you neglected to add a reaction arrow!</li></ol>\";\n return false;\n }\n } else {\n if (self::smiles_is_reaction($usrsmiles)) {\n $this->usecase = \"<ol><li>You were asked to draw structures, but you drew a reaction!</li></ol>\";\n return false;\n }\n\n }\n\n // Breakdown into reactions and not reactions and analyze each!\n\n if (self::smiles_is_reaction($anssmiles)) { // Reaction!\n\n // Split into reactants and products.\n $reactantsandproducts = explode('>>', $anssmiles);\n $ansreactants = $reactantsandproducts[0];\n $ansproducts = $reactantsandproducts[1];\n\n $reactantsandproducts = explode('>>', $usrsmiles);\n $usrreactants = $reactantsandproducts[0];\n $usrproducts = $reactantsandproducts[1];\n\n $numincorrect = false;\n $usecasestring = '';\n $usrreactnumincorrect = count(explode(\".\", $ansreactants)) - count(explode(\".\", $usrreactants));\n\n if ($usrreactnumincorrect != '0') {\n if ($usrreactnumincorrect > 0) {\n $usecasestring .= \"<li>You are missing $usrreactnumincorrect reactant molecules in your answer!</li>\";\n }\n if ($usrreactnumincorrect < 0) {\n $usecasestring .= \"<li>You have $usrreactnumincorrect too many reactant molecules in your answer!</li>\";\n }\n $numincorrect = true;\n }\n\n $usrprodnumincorrect = count(explode(\".\", $ansproducts)) - count(explode(\".\", $usrproducts));\n\n if ($usrprodnumincorrect != '0') {\n if ($usrprodnumincorrect > 0) {\n $usecasestring .= \"<li>You are missing $usrprodnumincorrect product molecules in your answer!</li>\";\n }\n if ($usrprodnumincorrect < 0) {\n $usecasestring .= \"<li>You have $usrprodnumincorrect too many product molecules in your answer!</li>\";\n }\n $numincorrect = true;\n }\n if ($numincorrect == true) {\n $this->usecase = $usecasestring;\n return false;\n }\n // End of reaction analysis!\n } else { // Not reaction.\n\n $ansnumofmole = $this->smiles_num_of_molecules($anssmiles);\n $usrnumofmole = self::smiles_num_of_molecules($usrsmiles);\n\n // Check to see if correct number of molecules.\n\n if ($ansnumofmole !== $usrnumofmole) {\n // Must have wrong num of molecules.\n if ($ansnumofmole > $usrnumofmole) {\n $this->usecase = \"<li>You are missing \".($ansnumofmole - $usrnumofmole).\" molecules in your answer!</li>\";\n return false;\n } else {\n $this->usecase = \"<li>You have \".($usrnumofmole - $ansnumofmole).\" molecule(s) more than are required!</li>\";\n return false;\n }\n\n }\n\n // Combine all feedback from here on out!\n $usecasestring = '';\n // Check to see if stereochemistry is required and if user has add stereochem - just looking for @ !\n\n // Quik check first.\n if (self::smiles_ischiral1($anssmiles)) {\n if (!self::smiles_ischiral1($usrsmiles)) {\n $usecasestring .= \"<li>You did not indicate the required R/S stereochemistry!</li>\";\n }\n } else {\n if (self::smiles_ischiral($usrsmiles)) {\n $usecasestring .= \"<li>You showed stereochemistry in your answer .\n but it was not required for this problem!</li>\";\n }\n }\n // Check to see if wrong enantiomer of entire string!\n if (self::smiles_ischiral1($anssmiles) && self::smiles_ischiral1($usrsmiles)) {\n $anstemp = str_replace(\"@\", \"\", $anssmiles);\n $usrtemp = str_replace(\"@\", \"\", $usrsmiles);\n if ($anstemp == $usrtemp) {\n $usecasestring .= \"<li>You likely have the wrong stereochemistry!</li>\";\n $this->usecase = $usecasestring;\n return false;\n }\n }\n\n // Check to see if E/Z correct.\n\n // Quik check first.\n if (strpos($anssmiles, '/') !== false || strpos($anssmiles, '\\\\') !== false) {\n if (strpos($usrsmiles, '/') == false && strpos($usrsmiles, '\\\\') == false) {\n $usecasestring .= \"<li>You did not indicate the required E/Z stereochemistry!</li>\";\n }\n } else {\n if (strpos($usrsmiles, '/') !== false || strpos($usrsmiles, '\\\\') !== false) {\n $usecasestring .= \"<li>You showed E/Z stereochemistry in your answer but .\n it was not required for this problem!</li>\";\n }\n }\n // Check for lone pairs.\n\n if (strpos($anssmiles, 'lp') !== false) {\n if (strpos($usrsmiles, 'lp') == false) {\n $usecasestring .= \"<li>You are missing lone pair electrons!</li>\";\n }\n } else {\n if (strpos($usrsmiles, 'lp') !== false) {\n $usecasestring .= \"<li>You showed lone pairs in your answer but they were not required!</li>\";\n }\n }\n\n // Check for radicals.\n if (strpos($anssmiles, '^') !== false) {\n if (strpos($usrsmiles, '^') == false) {\n $usecasestring .= \"<li>You are missing radical electrons!</li>\";\n }\n } else {\n if (strpos($usrsmiles, '^') !== false) {\n $usecasestring .= \"<li>You showed radical electrons in your answer but they were not required!</li>\";\n }\n }\n\n // Check for charge.\n if (strpos($anssmiles, '+') !== false || strpos($anssmiles, '-') !== false) {\n if (strpos($usrsmiles, '+') == false && strpos($usrsmiles, '-') == false) {\n $usecasestring .= \"<li>You are missing charges on atoms!</li>\";\n }\n } else {\n if (strpos($usrsmiles, '^') !== false) {\n $usecasestring .= \"<li>You showed charges in your answer but they were not required!</li>\";\n }\n }\n\n $this->usecase = $usecasestring;\n } // End of not reaction analysis.\n\n return false;\n }", "private function parse_response(array $response)\n {\n //strip all leading and trailing whitespace from the answer\n $response['answer'] = trim($response['answer']);\n\n //interpret the user's reponse according to the reponse mode\n switch($this->response_mode)\n {\n \n //handle STRING-mode respones\n case qtype_scripted_response_mode::MODE_STRING: \n\n //return the answer as-is, as we already recieved a string\n return strtolower($response['answer']);\n\n //handle STRING-mode respones\n case qtype_scripted_response_mode::MODE_STRING_CASE_SENSITIVE: \n\n //return the answer as-is, as we already recieved a string\n return $response['answer'];\n\n //handle DECIMAL-mode responses\n case qtype_scripted_response_mode::MODE_NUMERIC:\n\n //if the string was empty, return false, a non-numeric form of zero\n if($response['answer'] === '')\n return false;\n\n //get a floating-point interpretation of the answer\n return floatval($response['answer']);\n\n \n //handle HEXADECIMAL-mode responses \n case qtype_scripted_response_mode::MODE_HEXADECIMAL:\n\n //if the user entered a number in C format, parse it using PHP's native recognition of hex numbers\n if(substr($response['answer'], 0, 2) === \"0x\")\n return intval(substr($response['answer'], 2), 16);\n\n //if the user entered the hex number in HCS08 format (i.e. $0F), accept that, as well\n elseif(substr($response['answer'], 0, 1) == '$')\n return hexdec(substr($response['answer'], 1));\n\n //otherwise, return the answer parsed as a hex number\n else\n return hexdec($response['answer']);\n\n //handle BINARY-mode respones\n case qtype_scripted_response_mode::MODE_BINARY:\n\n //if the user entered a number in 0b format (used by some calculators), accept it \n if(substr($response['answer'], 0, 2) === \"0b\")\n return bindec(substr($response['answer'], 2), 16);\n\n //if the user entered the binary number in HCS08 format (i.e. %0F), accept that, as well\n elseif(substr($response['answer'], 0, 1) == '%')\n return bindec(substr($response['answer'], 1));\n\n //otherwise, return the answer parsed as a binary number\n else\n return bindec($response['answer']);\n\n\n //handle OCTAL-mode\n case qtype_scripted_response_mode::MODE_OCTAL:\n\n //if the user entered a number in 0o format, accept it, for consistency with other prefix strings\n //(as far as I know, no major format uses this)\n if(substr($response['answer'], 0, 2) === \"0o\")\n return octdec(substr($response['answer'], 2), 16);\n\n //if the user entered the binary number in HCS08 format (i.e. @0F), accept that, as well\n elseif(substr($response['answer'], 0, 1) == '@')\n return octdec(substr($response['answer'], 1));\n\n //otherwise, return the answer parsed as a octal number\n else\n return octdec($response['answer']);\n }\n }", "public function evaluate_answer($answerobj, $interpreter = null) {\n\n //Create a copy of the given answer...\n $answer = clone $answerobj;\n\n //create a new interpreter\n if(!$interpreter) {\n $interpreter = $this->create_interpreter($this->vars, $this->funcs);\n }\n \n //evaluate the correct answer to get a given reponse, if possible\n try {\n $answer->answer = $interpreter->evaluate($answer->answer);\n } catch(qtype_scripted_language_exception $e) {\n debugging($e->getMessage());\n return null;\n }\n\n //return the correct answer depending on the response mode\n switch($this->response_mode)\n {\n //if the answer is expected in binary, return the answer in binary\n case qtype_scripted_response_mode::MODE_BINARY:\n $answer->answer = decbin($answer->answer);\n break;\n \n //if the answer is expected in hex, return the answer in hex\n case qtype_scripted_response_mode::MODE_HEXADECIMAL:\n $answer->answer = dechex($answer->answer);\n break;\n\n //if the answer is expected in binary, return the answer in binary\n case qtype_scripted_response_mode::MODE_OCTAL:\n $answer->answer = decoct($answer->answer);\n break;\n }\n\n return $answer;\n\n }", "function isAnswerCorrect($answers, $answer)\n\t{\n\t\tinclude_once \"./Services/Utilities/classes/class.ilStr.php\";\n\t\t$result = 0;\n\t\t$textrating = $this->getTextRating();\n\t\tforeach ($answers as $key => $value)\n\t\t{\n\t\t\tswitch ($textrating)\n\t\t\t{\n\t\t\t\tcase TEXTGAP_RATING_CASEINSENSITIVE:\n\t\t\t\t\tif (strcmp(ilStr::strToLower($value), ilStr::strToLower($answer)) == 0 && $this->answers[$key]->getPoints() > 0) return $key;\n\t\t\t\t\tbreak;\n\t\t\t\tcase TEXTGAP_RATING_CASESENSITIVE:\n\t\t\t\t\tif (strcmp($value, $answer) == 0 && $this->answers[$key]->getPoints() > 0) return $key;\n\t\t\t\t\tbreak;\n\t\t\t\tcase TEXTGAP_RATING_LEVENSHTEIN1:\n\t\t\t\t\tif (levenshtein($value, $answer) <= 1 && $this->answers[$key]->getPoints() > 0) return $key;\n\t\t\t\t\tbreak;\n\t\t\t\tcase TEXTGAP_RATING_LEVENSHTEIN2:\n\t\t\t\t\tif (levenshtein($value, $answer) <= 2 && $this->answers[$key]->getPoints() > 0) return $key;\n\t\t\t\t\tbreak;\n\t\t\t\tcase TEXTGAP_RATING_LEVENSHTEIN3:\n\t\t\t\t\tif (levenshtein($value, $answer) <= 3 && $this->answers[$key]->getPoints() > 0) return $key;\n\t\t\t\t\tbreak;\n\t\t\t\tcase TEXTGAP_RATING_LEVENSHTEIN4:\n\t\t\t\t\tif (levenshtein($value, $answer) <= 4 && $this->answers[$key]->getPoints() > 0) return $key;\n\t\t\t\t\tbreak;\n\t\t\t\tcase TEXTGAP_RATING_LEVENSHTEIN5:\n\t\t\t\t\tif (levenshtein($value, $answer) <= 5 && $this->answers[$key]->getPoints() > 0) return $key;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn FALSE;\n\t}", "private function q10($answer) {\n\t\tswitch ($answer) {\n\t\t\tcase A:\n\t\t\t\treturn $this->a(16) == D;\n\t\t\tcase B:\n\t\t\t\treturn $this->a(16) == A;\n\t\t\tcase C:\n\t\t\t\treturn $this->a(16) == E;\n\t\t\tcase D:\n\t\t\t\treturn $this->a(16) == B;\n\t\t\tcase E:\n\t\t\t\treturn $this->a(16) == C;\n\t\t}\n\t}", "private function q2($answer) {\n\t\t// TODO: make sure no other consecutive questions have identical answers\n\t\tswitch ($answer) {\n\t\t\tcase A:\n\t\t\t\treturn $this->a(6) == $this->a(7);\n\t\t\tcase B:\n\t\t\t\treturn $this->a(6) == $this->a(7);\n\t\t\tcase C:\n\t\t\t\treturn $this->a(6) == $this->a(7);\n\t\t\tcase D:\n\t\t\t\treturn $this->a(6) == $this->a(7);\n\t\t\tcase E:\n\t\t\t\treturn $this->a(6) == $this->a(7);\n\t\t}\n\t\t\n\t}", "public function is_complete_response(array $response) {\n\n //a response without an answer is not a compelte response \n if(!array_key_exists('answer', $response)) {\n return false;\n }\n\n //determine gradability based on response type\n switch($this->response_mode) {\n\n //in string mode, accept any non-empty string\n case qtype_scripted_response_mode::MODE_STRING:\n case qtype_scripted_response_mode::MODE_STRING_CASE_SENSITIVE:\n return $response['answer'] !== '';\n\n //in numeric mode, accept any numeric string\n case qtype_scripted_response_mode::MODE_NUMERIC:\n return is_numeric($response['answer']);\n\n //in binary mode, check to see if the number is valid binary using a regex\n case qtype_scripted_response_mode::MODE_BINARY:\n return preg_match('#^(0b|\\%)?[01]+$#', $response['answer']) !== 0 || (array_key_exists('answer', $response) && empty($response['answer']));\n\n //do the same for hexadecimal\n case qtype_scripted_response_mode::MODE_HEXADECIMAL:\n return preg_match('#^(0x|\\$)?[0-9a-fA-F]+$#', $response['answer']) !== 0;\n\n //do the same for octal \n case qtype_scripted_response_mode::MODE_OCTAL:\n return preg_match('#^(0o|\\@)?[0-7]+$#', $response['answer']) !== 0;\n }\n }", "private function q18($answer) {\n\t\t$as = $this->total_number_of(A);\n\t\t$bs = $this->total_number_of(B);\n\t\t$cs = $this->total_number_of(C);\n\t\t$ds = $this->total_number_of(D);\n\t\t$es = $this->total_number_of(E);\n\n\t\tswitch ($answer) {\n\t\t\tcase A:\n\t\t\t\treturn $as === $bs;\n\t\t\tcase B:\n\t\t\t\treturn $as === $cs;\n\t\t\tcase C:\n\t\t\t\treturn $as === $ds;\n\t\t\tcase D:\n\t\t\t\treturn $as === $es;\n\t\t\tcase E:\n\t\t\t\treturn $as !== $bs && $as !== $cs && $as !== $ds && $as !== $es;\n\t\t}\n\t}", "function correctAnswer() {\n\t}", "public function check_answer() {\n $result = new stdClass;\n $result->answerid = 0;\n $result->noanswer = false;\n $result->correctanswer = false;\n $result->isessayquestion = false; // Use this to turn off review button on essay questions\n $result->response = '';\n $result->newpageid = 0; // Stay on the page\n $result->studentanswer = ''; // Use this to store student's answer(s) in order to display it on feedback page\n $result->userresponse = null;\n $result->feedback = '';\n $result->nodefaultresponse = false; // Flag for redirecting when default feedback is turned off\n return $result;\n }", "protected function simpleAnswer($response) {\n $response = strtoupper($response);\n\n if ($response === 'Y' || $response === 'YES')\n return TRUE;\n else if ($response === 'N' || $response === 'NO')\n return FALSE;\n else\n return $this->promptMessage('yesorno') . PHP_EOL;\n }", "private function q13($answer) {\n\t\t// TODO: check its the *only* one\n\t\tswitch ($answer) {\n\t\t\tcase A:\n\t\t\t\treturn $this->a(9) == A;\n\t\t\tcase B:\n\t\t\t\treturn $this->a(11) == A;\n\t\t\tcase C:\n\t\t\t\treturn $this->a(13) == A; // never true\n\t\t\tcase D:\n\t\t\t\treturn $this->a(15) == A;\n\t\t\tcase E:\n\t\t\t\treturn $this->a(16) == A;\n\t\t}\n\t}", "private function q16($answer) {\n\t\tswitch ($answer) {\n\t\t\tcase A:\n\t\t\t\treturn $this->a(10) == D;\n\t\t\tcase B:\n\t\t\t\treturn $this->a(10) == C;\n\t\t\tcase C:\n\t\t\t\treturn $this->a(10) == B;\n\t\t\tcase D:\n\t\t\t\treturn $this->a(10) == A;\n\t\t\tcase E:\n\t\t\t\treturn $this->a(10) == E;\n\t\t}\n\t}", "public function get_correct_response() \n {\n return array('answer' => 0);\n }", "public function get_correct_response()\n {\n //if the question is a \"must eval true\" question, we can't easily determine the answer\n if($this->answer_mode == qtype_scripted_answer_mode::MODE_MUST_EVAL_TRUE) {\n return null;\n }\n\n // Evaluate the given answer, and return a correct-response array.\n $answer = $this->evaluate_answer(parent::get_correct_answer());\n return array('answer' => $answer->answer);\n }", "private function q9($answer) {\n\t\tswitch ($answer) {\n\t\t\tcase A:\n\t\t\t\treturn $this->a(10) == A;\n\t\t\tcase B:\n\t\t\t\treturn $this->a(11) == B;\n\t\t\tcase C:\n\t\t\t\treturn $this->a(12) == C;\n\t\t\tcase D:\n\t\t\t\treturn $this->a(13) == D;\n\t\t\tcase E:\n\t\t\t\treturn $this->a(14) == E;\n\t\t}\n\t}", "private function q12($answer) {\n\t\t$consonants = 0;\n\n\t\tforeach ($this->answers as $q => $a) {\n\t\t\tif ($a == B | $a == C | $a == D) {\n\t\t\t\t$consonants++;\n\t\t\t}\n\t\t}\n\n\t\tswitch ($answer) {\n\t\t\tcase A:\n\t\t\t\treturn $consonants % 2 === 0;\n\t\t\tcase B:\n\t\t\t\treturn $consonants % 2 === 1;\n\t\t\tcase C:\n\t\t\t\treturn $consonants === 1 || $consonants === 4 || $consonants === 9 || $consonants === 16;\n\t\t\tcase D:\n\t\t\t\treturn in_array($consonants, array(2, 3, 5, 7, 11, 13, 17, 19));\n\t\t\tcase E:\n\t\t\t\treturn $consonants % 5 === 0;\n\n\t\t}\n\t}", "public function compareAnswersPatterns($ap1, $ap2, $options = array()) {\n\n // Default answer-to-value function - identity.\n if( isset($options['answerToValue']) && $options['answerToValue'] ) {\n $answerToValue = $options['answerToValue'];\n } else {\n $answerToValue = function($a) { return $a; };\n }\n\n // Default distance function - discrete comparison.\n if( isset($options['distanceFunction']) ) {\n $distanceFunction = $options['distanceFunction'];\n } else {\n $distanceFunction = function($v1, $v2) {\n\treturn ( ($v1 == $v2) ? 0 : 1 );\n };\n }\n \n // Default probablility merging function - simple product.\n if( isset($options['prMergeFunction']) ) {\n $prMergeFunction = $options['prMergeFunction'];\n } else {\n $prMergeFunction = function($pr1, $pr2) {\n\treturn ($pr1 * $pr2);\n };\n }\n\n // Get all pairs.\n $allAnswerPairs =\n array_zip($ap1->answers, $ap2->answers);\n\n // Compute for each pair.\n $answerPairsSimilarity =\n array_map(\n\t\tfunction($answerPair) use ($answerToValue, $distanceFunction, $prMergeFunction) {\n\t\t // Extract answers.\n\t\t $answer1 = $answerPair[0];\n\t\t $answer2 = $answerPair[1];\n\n\t\t // Convert to values.\n\t\t $value1 = $answerToValue($answer1['id']);\n\t\t $value2 = $answerToValue($answer2['id']);\n\n\t\t // Get probabilities.\n\t\t $pr1 = $answer1['pr'];\n\t\t $pr2 = $answer2['pr'];\n\n\t\t // Compute their similarity.\n\t\t $d = $distanceFunction($value1, $value2);\n\t\t $pr = $prMergeFunction($pr1, $pr2);\n\t\t $similarity = (1 - $d) * $pr;\n\n\t\t //echo \"($value1, $value2 => $d, $similarity) \";\n\t\t \n\t\t return $similarity;\n\t\t},\n\t\t$allAnswerPairs\n\t\t);\n \n // Sum up.\n $totalSimilarity =\n array_sum($answerPairsSimilarity);\n\n return array(\"similarity\" => $totalSimilarity);\n }", "public function accept($answer_id=0)\n\t{\n\t\tif (!$answer_id)\n\t\t{\n\t\t\t$this->addError(Lang::txt('No answer ID provided.'));\n\t\t\treturn false;\n\t\t}\n\n\t\t// Load the answer\n\t\t$answer = Response::oneOrFail($answer_id);\n\n\t\t// Mark it at the chosen one\n\t\t$answer->set('state', 1);\n\t\tif (!$answer->save())\n\t\t{\n\t\t\t$this->addError($answer->getError());\n\t\t\treturn false;\n\t\t}\n\n\t\t// Mark the question as answered\n\t\t$this->set('state', 1);\n\n\t\t// If banking is enabled\n\t\tif ($this->config('banking'))\n\t\t{\n\t\t\t// Accepted answer is same person as question submitter?\n\t\t\tif ($this->get('created_by') == $answer->get('created_by'))\n\t\t\t{\n\t\t\t\t$reward = Transaction::getAmount('answers', 'hold', $this->get('id'));\n\n\t\t\t\t// Remove hold\n\t\t\t\tTransaction::deleteRecords('answers', 'hold', $this->get('id'));\n\n\t\t\t\t// Make credit adjustment\n\t\t\t\t$BTL_Q = new Teller(User::get('id'));\n\t\t\t\t$BTL_Q->credit_adjustment($BTL_Q->credit_summary() - $reward);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$db = App::get('db');\n\n\t\t\t\t// Calculate and distribute earned points\n\t\t\t\t$AE = new Economy($db);\n\t\t\t\t$AE->distribute_points(\n\t\t\t\t\t$this->get('id'),\n\t\t\t\t\t$this->get('created_by'),\n\t\t\t\t\t$answer->get('created_by'),\n\t\t\t\t\t'closure'\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// Set the reward value\n\t\t\t$this->set('reward', 0);\n\t\t}\n\n\t\t// Save changes\n\t\treturn $this->save();\n\t}", "private function q20($answer) {\n\t\treturn $answer === E;\n\t}", "public function rateResponse($response)\n {\n \treturn in_array(strtolower($response), ['y', 'yes']);\n }", "public function matchScore(\\Jazzee\\Entity\\Answer $answer)\n {\n if ($answer->getPageStatus() == self::SKIPPED) {\n return;\n }\n if (!is_null($answer->getGREScore()) and !is_null($answer->getTOEFLScore())) {\n return; //we already have a match\n }\n $testType = $this->_applicationPage->getPage()->getElementByFixedId(self::FID_TEST_TYPE)->getJazzeeElement()->displayValue($answer);\n $registrationNumber = $this->_applicationPage->getPage()->getElementByFixedId(self::FID_REGISTRATION_NUMBER)->getJazzeeElement()->displayValue($answer);\n $testDate = $this->_applicationPage->getPage()->getElementByFixedId(self::FID_TEST_DATE)->getJazzeeElement()->formValue($answer);\n $testMonth = date('m', strtotime($testDate));\n $testYear = date('Y', strtotime($testDate));\n\n $parameters = array(\n 'registrationNumber' => $registrationNumber,\n 'testMonth' => $testMonth,\n 'testYear' => $testYear\n );\n switch ($testType) {\n case 'GRE/GRE Subject':\n $score = $this->_controller->getEntityManager()->getRepository('\\Jazzee\\Entity\\GREScore')->findOneBy($parameters);\n if ($score) {\n $answer->setGreScore($score);\n }\n break;\n case 'TOEFL':\n $score = $this->_controller->getEntityManager()->getRepository('\\Jazzee\\Entity\\TOEFLScore')->findOneBy($parameters);\n if ($score) {\n $answer->setTOEFLScore($score);\n }\n break;\n default:\n throw new \\Jazzee\\Exception(\"Unknown test type: {$testType} when trying to match a score\");\n }\n }", "public function checkAnswer($answerID) {\r\n $correct = $this->answers->first()->getId() == $answerID;\r\n if($correct){\r\n $this->setRightAnswers($this->getRightAnswers()+1);\r\n }\r\n else{\r\n $this->setWrongAnswers($this->getWrongAnswers()+1);\r\n }\r\n return $correct;\r\n }", "public function determineResponseType(string $response): string\n {\n $wildcards = [\n 'weighted' => '{weight=(.+?)}',\n 'condition' => '/^\\*/',\n 'continue' => '/^\\^/',\n 'atomic' => '/-/',\n ];\n\n foreach ($wildcards as $type => $pattern) {\n if (@preg_match_all($pattern, $response, $matches)) {\n return $type;\n }\n }\n\n return 'atomic';\n }", "private function q4($answer) {\n\t\t$as = 0;\n\n\t\tforeach ($this->answers as $q => $a) {\n\t\t\tif ($a == A) {\n\t\t\t\t$as++;\n\t\t\t}\n\t\t}\n\t\treturn $answer + 3 === $as;\n\t}", "function answer_status_class($answer)\n {\n if($answer['is_correct']) {\n return 'correct';\n } else if($answer['is_unanswered']) {\n return 'unanswered';\n } else {\n return 'incorrect';\n }\n }", "public function isCorrectAnswer() {\n\t\t$this->getCorrectAnswer();\n\t}", "public static function validateAnswer($answer)\n {\n //echo $answer.\" \".self::$answer;\n var_dump($answer);\n var_dump(self::$answer);\n if($answer == self::$answer)\n {\n return true;\n }\n else\n {\n return false;\n }\n }", "private function formatBoolean($answer)\n {\n if (!$answer) {\n return 'No';\n }\n\n return 'Yes';\n }", "public function answer()\n\t{\n\t\tif (!$this->typeResponseCode)\n\t\t\treturn $this->answerTwoHundred($this->data);\n\t\telse\n\t\t\treturn $this->answerThroughHeader($this->data);\n\t}", "private function q15($answer) {\n\t\treturn $this->a(12) == $answer;\n\t}", "private function q6($answer) {\n\t\tswitch ($answer) {\n\t\t\tcase A:\n\t\t\t\treturn $this->a(17) == C;\n\t\t\tcase B:\n\t\t\t\treturn $this->a(17) == D;\n\t\t\tcase C:\n\t\t\t\treturn $this->a(17) == E;\n\t\t\tcase D:\n\t\t\t\treturn $this->a(17) == A || $this->a(17) == B;\n\t\t\tcase E:\n\t\t\t\t// TODO: work out if this is needed\n\t\t\t\treturn $this->a(7) == 'all of the above';\n\t\t}\n\t\t\n\t}", "public function check_answer($answer) {\n $attrs = $this->_orm->attributes_as_array();\n $answer_attr = $attrs[0];\n $expected_answer = $answer_attr['attribute_value'];\n $multiple_possible = explode('||', $expected_answer);\n if (count($multiple_possible) > 1) {\n return in_array($answer, $multiple_possible);\n } else {\n return $answer == $expected_answer;\n }\n }", "function grade_responses(&$question, &$state, $cmoptions) {\n // We modify the question to look like a numerical question\n $numericalquestion = fullclone($question);\n foreach ($numericalquestion->options->answers as $key => $answer) {\n $answer = $numericalquestion->options->answers[$key]->answer; // for PHP 4.x\n $numericalquestion->options->answers[$key]->answer = $this->substitute_variables_and_eval($answer,\n $state->options->dataset);\n }\n $virtualqtype = $this->get_virtual_qtype();\n return $virtualqtype->grade_responses($numericalquestion, $state, $cmoptions) ;\n }", "private function q5($answer) {\n\t\tswitch ($answer) {\n\t\t\tcase A:\n\t\t\t\treturn $this->a(1) == A;\n\t\t\tcase B:\n\t\t\t\treturn $this->a(2) == B;\n\t\t\tcase C:\n\t\t\t\treturn $this->a(3) == C;\n\t\t\tcase D:\n\t\t\t\treturn $this->a(4) == D;\n\t\t\tcase E:\n\t\t\t\treturn $this->a(5) == E;\n\t\t}\n\t\t\n\t}", "public function hasAnswers();", "private function q3($answer) {\n\t\t$es = 0;\n\n\t\tforeach ($this->answers as $q => $a) {\n\t\t\tif ($a == E) {\n\t\t\t\t$es++;\n\t\t\t}\n\t\t}\n\t\treturn $answer - 1 === $es;\n\t}", "public function check_answer(Request $request) {\n\t\t$questionId = $request->input('questionId');\n\t\t$answerId = $request->input('answerId');\n\n\t\t$question = Question::findOrFail($questionId);\n\t\t$answer = $question->options()->where('id', $answerId)->where('answer', 1)->first();\n\n\t\tif($answer) {\n\t\t\treturn response()->json(['status' => true, 'code' => 200], 200);\n\t\t}\n\n\t\treturn response()->json(['status' => false, 'code' => 200], 200);\n\t}", "public function checkAnswerById($id = false) {\n\t\t\t// Database Connection\n\t\t\t$db\t\t\t\t= $GLOBALS['db_q'];\n\t\t\t// Variables\n\t\t\t$return\t\t\t= false;\n\t\t\t// Query set up\t\n\t\t\t$row\t\t\t= ($id) ? $db->getRow('tb_answer', 'boo_correct', \"id = {$id}\") : false;\n\t\t\tif ($row['boo_correct'] == 1) {\n\t\t\t\t$return\t\t= true;\n\t\t\t}\n\t\t\t// Return\n\t\t\treturn $return;\n\t\t}", "private function q11($answer) {\n\t\t$bs = 0;\n\n\t\tforeach ($this->answers as $q => $a) {\n\t\t\tif ($q == 10) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ($a == B) {\n\t\t\t\t$bs++;\n\t\t\t}\n\t\t}\n\t\treturn $answer - 1 === $bs;\n\t}", "public function checkAnswer() : bool {\n return ($this->isPhishing() && $this->_userAnswer == 'phishing') ||\n (!$this->isPhishing() && $this->_userAnswer == 'real');\n }", "public function actionQuestionExplanation($question_id, $answered_option) {\n\n $checked_answer = questions::find()\n ->where(['id' => $question_id])\n ->one();\n $explanation = Questions::find()\n ->where(['id' => $question_id])\n ->one();\n $question_explanation = $explanation->explanation;\n\n if ($checked_answer->answer == $answered_option) {\n echo '<div class=\"scrollbar\" id=\"style-1\">';\n echo '<div class=\"force-overflow\">';\n echo '<p class=\"text-center\" style=\"color:#3082ED; padding : 5px; font-size : 16px; background: #C4E5FF; margin-bottom: 0;\"><b> You are correct </b><i class=\"fa fa-thumbs-up\" aria-hidden=\"true\" style = \"color : #3082ED !important;\"></i> </p>';\n echo '<h4 id =\"question_explanation-\" style=\"color: black;padding:0% 2% 1%;font-size: 16px;margin:0;text-align: left;box-sizing: border-box;background: #C4E5FF; height: auto;\"> ' . $question_explanation . ' </h4>';\n echo '</div>';\n echo '</div>';\n } else {\n echo '<div class=\"scrollbar\" id=\"style-1\">';\n echo '<div class=\"force-overflow\">';\n echo '<p class=\"text-center\" style=\"color:#FF0000; padding : 5px; font-size : 16px; background: #C4E5FF; margin-bottom: 0;\"><b> You are wrong </b><i class=\"fa fa-thumbs-down\" aria-hidden=\"true\" style = \"color: #FF0000 !important;\"></i> </p>';\n echo '<h4 id =\"question_explanation-\" style=\"color:black ;padding:0% 2% 1%;font-size: 16px;margin:0;text-align: left;box-sizing: border-box;background: #C4E5FF; height: auto;\"> ' . $question_explanation . ' </h4>';\n echo '</div>';\n echo '</div>';\n }\n }", "function get_correct_answer(){\n return $this->correct_answer;\n }", "private function q17($answer) {\n\t\tswitch ($answer) {\n\t\t\tcase A:\n\t\t\t\treturn $this->a(6) == C;\n\t\t\tcase B:\n\t\t\t\treturn $this->a(6) == D;\n\t\t\tcase C:\n\t\t\t\treturn $this->a(6) == E;\n\t\t\tcase D:\n\t\t\t\treturn $this->a(6) == A || $this->a(6) == B;\n\t\t\tcase E:\n\t\t\t\t// TODO: work out if this is needed\n\t\t\t\treturn $this->a(6) == 'all of the above';\n\t\t}\n\t\t\n\t}", "public function setCorrectResponse($value) {\r\n $this->correctResponse = $value->value;\r\n }", "function grade_responses(&$question, &$state, $cmoptions) {\n $state->raw_grade = 0;\n if ($question->options->single) {\n $response = reset($state->responses);\n if ($response) {\n $state->raw_grade = $question->options->answers[$response]->fraction;\n }\n } else {\n $tmp = array_keys($question->options->answers);\n\n foreach ($tmp as $key => $value) {\n if (isset($state->responses[$value])) {\n if ($state->responses[$value] == $value . '_2' && $question->options->answers[$value]->tur_answer_truefalse == '1') {\n // t3lib_div::debug($question->options->answers[$value]->fraction, 'HEST_1');\n $state->raw_grade += $question->options->answers[$value]->fraction;\n }\n if ($state->responses[$value] == $value . '_3' && $question->options->answers[$value]->tur_answer_truefalse == '0') {\n $state->raw_grade += $question->options->answers[$value]->fraction;\n }\n } else {\n // Brugeren har valgt at gå videre uden at angive et svar\n }\n }\n }\n\n $state->raw_grade = min(max((float) $state->raw_grade, 0.0), 1.0) * $question->maxgrade;\n // Question is only approved if all answers are correct!\n if ($state->raw_grade < (float) 0.95) {\n $state->raw_grade = 0;\n }\n\n $state->raw_grade = $state->raw_grade * $question->maxgrade;\n // Apply the penalty for this attempt\n $state->penalty = $question->penalty * $question->maxgrade;\n // mark the state as graded\n $state->event = ($state->event == QUESTION_EVENTCLOSE) ? QUESTION_EVENTCLOSEANDGRADE : QUESTION_EVENTGRADE;\n\n return true;\n }", "public function ask_get_answers($id)\n\t{\n\t\t$sql = \"SELECT *\n\t\t\t\tFROM \".$this->table_ask.\"\n\t\t\t\tWHERE id_quest = ?\";\n\t\t$data = array($id);\n\t\t$query = $this->db->query($sql, $data);\n\t\t$res = $query->result();\n\t\t$this->load->model('votes_model', 'votesManager');\n\t\tfor( $i=0; $i<count($res); $i++ ) {\n\t\t\t$val = $this->votesManager->votes_get_by_ask($res[$i]->id);\n\t\t\t$res[$i]->nb_votes = ($val) ? $val:0;\n\t\t}\n\n\t\t// The answers are sorted by number of votes\n\t\tusort($res, function($a, $b)\n\t\t{\n\t\t\tif($a->nb_votes == $b->nb_votes) {\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\treturn ($a->nb_votes < $b->nb_votes) ? 1 : -1;\n\t\t});\n\n\t\tif( $res )\n\t\t\treturn $res;\n\t\telse\n\t\t\treturn 0;\n\t}", "public function checkRiddleAnswer($riddleid, $answer)\n\t\t{\n\n\t\t\t$riddle = $this->getRiddle($riddleid);\n\n\t\t\tif (strtolower($riddle['answer']) == strtolower($answer))\n\t\t\t{\n\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}", "public function answer($id, $answer) {\n $this->run('answer', array($id, $answer));\n }", "function CheckIfAnswerWasCorrect ($questionId, $givenAnswer) {\n $getCorrectAnswerForQuestionSql = \"SELECT * FROM `answers` where `question_id` = '$questionId' AND `id` = '$givenAnswer' \" ;\n $rows = MySQL::getRows($getCorrectAnswerForQuestionSql);\n $firstRow = $rows[0];\n\n $isRightChoise = $firstRow->is_right_choice;\n\n if ($isRightChoise) {\n $result = true;\n } else {\n $result = false;\n }\n\n return $result;\n\n}", "public function getAnswer() {\n return $this->answer;\n }", "public function getAnswer()\n {\n return $this->answer;\n }", "function get_correct_ans($question_id) {\r\n\t\t//throw an exception if question_id is not present\r\n\t\tif (! isset ( $question_id ) && '' != $question_id) {\r\n\t\t\tshow_error ( \"Parameter question id is missing.\" );\r\n\t\t}\r\n\t\t\r\n\t\t//Get the record for corresponding id\r\n\t\t$sql = 'SELECT answers from adhi_quiz_answers WHERE question_id = ' . $question_id . ' AND answer_option = \"Y\"';\r\n\t\t$query = $this->db->query ( $sql );\r\n\t\t\r\n\t\t$result = $query->row ();\r\n\t\t\r\n\t\t// If result is empty return false\r\n\t\tif (empty ( $result )) {\r\n\t\t\treturn FALSE;\r\n\t\t}\r\n\t\t\r\n\t\treturn $result->answers;\r\n\t\r\n\t}", "private function updateAlcoholResponses($id, $questionid, $response) \n {\n // $score = substr(\"responseX\", -1); // returns \"X\"\n \n $score = substr($response, -1);\n $this->db->set('response', $response);\n $this->db->set('response_score', $score);\n\n $this->db->where('userid', $id);\n $this->db->where('questionid', $questionid);\n $this->db->update('alcohol_responses');\n \n\n //check whether update statement has been executed\n if ($this->db->affected_rows() != 0) {\n return true;\n } else {\n return false;\n }\n\n }", "private function q7($answer) {\n\t\tswitch ($answer) {\n\t\t\tcase A:\n\t\t\t\treturn $this->a(8) == E;\n\t\t\tcase B:\n\t\t\t\treturn $this->a(8) == E;\n\t\t\tcase C:\n\t\t\t\treturn $this->a(8) == E || $this->a(8) == A;\n\t\t\tcase D:\n\t\t\t\treturn $this->a(8) == E || $this->a(8) == C;\n\t\t\tcase E:\n\t\t\t\treturn $this->a(8) == E;\n\t\t}\n\t}", "function IsAnswerCorrect($questionID, $answerID)\n {\n try\n {\n $correctAnswer = FALSE;\n $db = GetDBConnection();\n \n $query = 'SELECT ' . GetAnswerIdIdentifier() . ' FROM'\n . ' ' . GetAnswersIdentifier() . ' WHERE'\n . ' ' . GetQuestionIdIdentifier()\n . ' = :' . GetQuestionIdIdentifier() . ' AND'\n . ' ' . GetAnswerIdIdentifier()\n . ' = :' . GetAnswerIdIdentifier() . ' AND'\n . ' ' . 'Correct'\n . ' = :' . 'Correct';\n \n $statement = $db->prepare($query);\n $statement->bindValue(':'. GetQuestionIdIdentifier(), $questionID);\n $statement->bindValue(':' . GetAnswerIdIdentifier(), $answerID);\n $statement->bindValue(':' . 'Correct', 1);\n \n $statement->execute();\n \n $answerIDs = $statement->fetchAll();\n \n $statement->closeCursor();\n \n if (count($answerIDs) > 0)\n {\n $correctAnswer = TRUE;\n }\n \n return $correctAnswer;\n }\n catch (PDOException $ex)\n {\n LogError($ex);\n }\n }", "function incorrectAnswer() {\n\t}", "private function checkAnswer($message, $replyToken)\n {\n if($this->latihan_un->isAnswerEqual($this->user['number'], $message)){\n $this->user['score']++;\n $this->latihan_un->setScore($this->user['user_id'], $this->user['score']);\n }\n if($this->user['number'] < 10)\n {\n // update number progress\n $this->latihan_un->setUserProgress($this->user['user_id'], $this->user['number'] + 1);\n // send next question\n $this->sendQuestion($replyToken, $this->user['number'] + 1);\n }\n else {\n // soal ke 10\n $this->latihan_un->setUserProgress($this->user['user_id'], $this->user['number'] + 1);\n // create user score message\n $message = 'Nilaimu '. $this->user['score'];\n $textMessageBuilder1 = new TextMessageBuilder($message);\n // create sticker message\n $stickerId = ($this->user['score'] < 8) ? 110 : 4;\n $stickerMessageBuilder = new StickerMessageBuilder(1, $stickerId);\n // create play again message\n $message = ($this->user['score'] < 8) ?\n 'Man Jadda Wa Jada !!! Ketik \"ayok\" untuk berlatih lagi!':\n 'Yeay! Mantap bro! Ketik \"ayok\" untuk berlatih lagi!';\n $textMessageBuilder2 = new TextMessageBuilder($message);\n // merge all message\n $multiMessageBuilder = new MultiMessageBuilder();\n $multiMessageBuilder->add($textMessageBuilder1);\n $multiMessageBuilder->add($stickerMessageBuilder);\n $multiMessageBuilder->add($textMessageBuilder2);\n // send reply message\n $this->bot->replyMessage($replyToken, $multiMessageBuilder);\n $this->latihan_un->setUserProgress($this->user['user_id'], 0);\n }\n }", "public static function answer_question(array $question);", "function smartchoice_user_submit_response($formanswer, $choice, $cm) {\n global $DB;\n\n $continueurl = new moodle_url('/mod/smartchoice/view.php', array('id' => $cm->id));\n\n // No answers selected.\n if (empty($formanswer)) {\n print_error('atleastoneoption', 'smartchoice', $continueurl);\n }\n\n if (is_array($formanswer)) {\n if (!$choice->allowmultiple) {\n print_error('multiplenotallowederror', 'smartchoice', $continueurl);\n }\n $formanswers = $formanswer;\n } else {\n $formanswers = array($formanswer);\n }\n\n $options = $DB->get_records('smartchoice_options', array('choiceid' => $choice->id), '', 'id');\n foreach ($formanswers as $key => $val) {\n if (!isset($options[$val])) {\n print_error('cannotsubmit', 'smartchoice', $continueurl);\n }\n }\n\n // Add new answer.\n foreach ($formanswers as $answer) {\n $newanswer = new stdClass();\n $newanswer->choiceid = $choice->id;\n $newanswer->optionid = $answer;\n $DB->insert_record('smartchoice_answers', $newanswer);\n }\n}", "function getCorrectAnswer($cardid) {\n\t\tglobal $dbconn;\n\n\t\t// ensure we have a valid card id\n\t\tif ($cardid === \"\") {\n\t\t\treturn message(-1, \"Cannot get card info without a valid cardid.\");\n\t\t}\n\t\t\n\t\t// query for correct card answer from the database\n\t\t$query = \"SELECT answer FROM answer WHERE cardid = $1 AND correct = 1\";\n\t\t$stmnt = pg_prepare($dbconn, \"getCorrectAnswer\", $query);\n\t\t$result = pg_execute($dbconn, \"getCorrectAnswer\", array($cardid));\n\t\t\n\t\t// ensure there were no query errors\n\t\tif ($result === false) {\n\t\t\treturn message(-1, \"Error executing query against the database.\");\n\t\t}\n\t\t\n\t\t// ensure a record was returned\n\t\tif (pg_num_rows($result) == 0) {\n\t\t\treturn message(-1, \"Answer record not found\");\n\t\t}\n\t\t\n\t\t// save correct answer to variable\n\t\t$correct = pg_fetch_assoc($result);\n\t\t\n\t\t// return correct answer\n\t\treturn message(1, $correct);\n\t\t\n\t}", "public function is_correct_user_answer() {\n\t\t\treturn strtolower($this->correct_answer) == strtolower($this->user_answer); \n\t\t}", "private function q19($answer) {\n\t\treturn true;\n\t}", "function answer()\n {\n if( $this->Answer !== false )\n return $this->Answer;\n\n $http = eZHTTPTool::instance();\n $prefix = eZSurveyType::PREFIX_ATTRIBUTE;\n $postSurveyAnswer = $prefix . '_ezsurvey_answer_' . $this->ID . '_' . $this->contentObjectAttributeID();\n if( $http->hasPostVariable( $postSurveyAnswer ) )\n {\n $surveyAnswer = $http->postVariable( $postSurveyAnswer );\n return $surveyAnswer;\n }\n\n return false;\n }", "public function render_answer() {\n // TODO: This should be refactored\n $seq = optional_param('seq',0, PARAM_INT);\n $this->set_var('seq', $seq);\n\n try { \n $answers = array();\n if(empty($_POST['answers'])) {\n throw new Exception('Bạn chưa chọn đáp án trả lời!');\n } else {\n $answers = $_POST['answers'];\n }\n \n $this->_log->log(array(__CLASS__,__FUNCTION__,'$time='.$seq,'$answers='. json_encode($answers)));\n \n if(!isset($_SESSION['ma_quiz']['questions'][$seq])) {\n redirect('/mod/rtw/view.php?id='.$this->course_module->id.'&c=ma_quiz&a=question&seq='.$seq+1,'Câu hỏi không tồn tại, đang tải câu hỏi tiếp theo...',1);\n }\n \n $question = $_SESSION['ma_quiz']['questions'][$seq]; \n if(!isset($question->show_time)) {\n throw new Exception();\n }\n \n $now = new DateTime();\n $remain_seconds = date_utils::getSecondsBetween(new DateTime($question->show_time), $now);\n if($remain_seconds <= 0) { \n $error_message = 'Câu hỏi đã hết thời gian trả lời!';\n throw new Exception();\n }\n\n $is_corrected = $this->check_answers($question, $answers);\n \n if ($is_corrected) {\n $point = 1;\n $coin = 1;\n }\n else {\n $point = 0;\n $coin = 0;\n }\n \n $data_update = array('submit_time' => $now->format(date_utils::$formatSQLDateTime));\n \n if($point == 1) {\n // Update coin and experience\n $coin_id = player::getInstance()->change_coin($question->game_player_id, $coin);\n $experience_id = player::getInstance()->incrExp($question->game_player_id, $coin);\n $data_update['is_correct'] = 1;\n $data_update['coin_id'] = $coin_id;\n $data_update['experience_id'] = $experience_id;\n $this->set_var('change_coin', $coin);\n } \n // update user answer\n $data_update['user_answer'] = json_encode($answers);\n\n \n $style = '';\n $this->set_var('point', $point);\n $this->set_var('style', $style);\n $this->set_var('correct_answers', $this->get_correct_answers($question));\n game_ma_quiz::getInstance()->update($question->game_ma_quiz_id, $data_update);\n \n unset($_SESSION['ma_quiz']['questions'][$seq]);\n $this->doRender('result.php');\n \n } catch (Exception $e) {\n $this->_log->log($e, 'error');\n $error_message = $e->getMessage() ? $e->getMessage() : 'Hệ thống đang bận, vui lòng thử lại sau';\n $this->set_var('error_message', $error_message);\n $this->doRender('error.php');\n }\n }", "public function shouldExpectAnswer(): bool\n {\n return true;\n }", "public function answer(Request $request)\n {\n $answer = strtolower($request->answer);\n\n //get original question from api\n $originalQuestion = strtolower($this->getQuestion($request->page)['name']);\n\n //get data current score\n $currentScore = $this->getCurrentScore();\n\n\n //check if answer identity with originalQuestion\n if($answer === $originalQuestion) {\n\n //set page = request page + 1\n $page = $request->page + 1;\n \n //check if current score if empty and call addScore function if not empty call updateScore function\n if(empty($currentScore)) {\n $this->addScore();\n $this->setHistories([\n 'score' => \"+10\",\n 'question' => strtolower($request->question),\n 'answer' => $answer,\n 'status' => 1\n ]);\n } else {\n $this->updateScore($page);\n $this->setHistories([\n 'score' => \"+10\",\n 'question' => strtolower($request->question),\n 'answer' => $answer,\n 'status' => 1\n ]);\n }\n \n return json_encode([\n 'code' => 200,\n 'answer' => true,\n ]); \n \n } else {\n\n // deduct score when answer is wrong and checkl is current score is empty or not\n if(!empty($currentScore)) {\n $this->deductScore($request->page);\n } else {\n\n //set score -10 if answer is wrong on the first question\n $this->addScore($score = -10);\n }\n \n $this->setHistories([\n 'score' => \"-10\",\n 'question' => strtolower($request->question),\n 'answer' => $answer,\n 'status' => 0\n ]);\n return json_encode([\n 'code' => 200,\n 'answer' => false\n ]);\n }\n }", "function isQuestionAnswerCorrect($questionId, $answer){\n\n\t\tglobal $conn;\n\n\t\t$query = \"SELECT COUNT(*) AS Correct FROM Question WHERE id='\". $questionId . \"' AND correctAnswer='\" . $answer . \"'\";\n\n\t\t$result = $conn->query($query);\n\n\t\tif($result->num_rows != 1){\n\t\t\techo \"Error selecting \" . $questionId . \" details\";\n\t\t}else{\n\t\t\t$assocResult = $result->fetch_assoc();\n\t\t\treturn $assocResult['Correct'];\n\t\t}\n\n\t}", "function answerOf(){\r\n\t\tif($this->inDB==false||$this->answerOf==null){\r\n\t\t\t$temp=$this->dbq->answerOf($this->answer_id);\r\n\t\t\tif($temp!=\"SelectError\" || $temp!=null){\r\n\t\t\t\t$this->answerOf = $temp;\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\treturn $this->answerOf;\r\n\t}", "private function q14($answer) {\n\t\t$ds = 0;\n\n\t\tforeach ($this->answers as $q => $a) {\n\t\t\tif ($a == B) {\n\t\t\t\t$ds++;\n\t\t\t}\n\t\t}\n\t\treturn $answer + 5 === $ds;\n\t}", "private function ParseDeal($command, &$answer, &$deal_answer)\n {\n $pos = 0;\n //--- get command answer\n $command_real = $this->m_connect->GetCommand($answer, $pos);\n if ($command_real != $command) return MTRetCode::MT_RET_ERR_DATA;\n //---\n $deal_answer = new MTDealAnswer();\n //--- get param\n $pos_end = -1;\n while (($param = $this->m_connect->GetNextParam($answer, $pos, $pos_end)) != null)\n {\n switch ($param['name'])\n {\n case MTProtocolConsts::WEB_PARAM_RETCODE:\n $deal_answer->RetCode = $param['value'];\n break;\n }\n }\n //--- check ret code\n if (($ret_code = MTConnect::GetRetCode($deal_answer->RetCode)) != MTRetCode::MT_RET_OK) return $ret_code;\n //--- get json\n if (($deal_answer->ConfigJson = $this->m_connect->GetJson($answer, $pos_end)) == null) return MTRetCode::MT_RET_REPORT_NODATA;\n //---\n return MTRetCode::MT_RET_OK;\n }", "function check($answer, $lan_id){\n if(!isset($this->solution[$lan_id])){\n echo \"<p class='error'>Solution for language \".$lan_id.\" not defined in question \".$this->name.\"</p>\";\n return 0;\n } \n\t //MAJOR BUGFIX!!!\n if (!$this->skipped && in_array($answer,explode('#',$this->solution[$lan_id])) )\n\t {\n\n \t //echo $answer .' == '. $this->solution[$lan_id].' lan='.$lan_id. ' p='.$this->points.'<br />';\n \t return $this->points; \n }\n\t else \n\t {\n \t//if($lan_id == 3) echo 'faux: '.$answer.'<br/>';\n\t\t//echo $answer .' != '. $this->solution[$lan_id]. ' lan='.$lan_id.'<br />';\n \treturn 0;\n\n }\n }", "function verifyusersresponse($challenge,$response,$encryptedpassword){\n\treturn md5($challenge.$encryptedpassword)==$response;\n}", "function answer()\r\n {\r\n //option 1) check for already defined\r\n if (strlen($this->Answer)) {\r\n return $this->Answer;\r\n }\r\n\r\n $http = eZHTTPTool::instance();\r\n $prefix = eZSurveyType::PREFIX_ATTRIBUTE;\r\n\r\n //option 2) check for answer in $_POST (trick from processViewAction or normal post)\r\n $postSurveyAnswer = $prefix . '_ezsurvey_answer_' . $this->ID . '_' . $this->contentObjectAttributeID();\r\n if ($http->hasPostVariable($postSurveyAnswer) && strlen($http->postVariable($postSurveyAnswer))) {\r\n $surveyAnswer = $http->postVariable($postSurveyAnswer);\r\n\r\n return $surveyAnswer;\r\n }\r\n\r\n return $this->Default;\r\n }", "public function verify($response, $remoteIp = null)\n {\n // Discard empty solution submissions\n if (empty($response)) {\n $recaptchaResponse = new Response(false, array(self::E_MISSING_INPUT_RESPONSE));\n return $recaptchaResponse;\n }\n\n $params = new RequestParameters($this->secret, $response, $remoteIp, self::VERSION);\n $rawResponse = $this->requestMethod->submit($params);\n $initialResponse = Response::fromJson($rawResponse);\n $validationErrors = array();\n\n if (isset($this->hostname) && strcasecmp($this->hostname, $initialResponse->getHostname()) !== 0) {\n $validationErrors[] = self::E_HOSTNAME_MISMATCH;\n }\n\n if (isset($this->apkPackageName) && strcasecmp($this->apkPackageName, $initialResponse->getApkPackageName()) !== 0) {\n $validationErrors[] = self::E_APK_PACKAGE_NAME_MISMATCH;\n }\n\n if (isset($this->action) && strcasecmp($this->action, $initialResponse->getAction()) !== 0) {\n $validationErrors[] = self::E_ACTION_MISMATCH;\n }\n\n if (isset($this->threshold) && $this->threshold > $initialResponse->getScore()) {\n $validationErrors[] = self::E_SCORE_THRESHOLD_NOT_MET;\n }\n\n if (isset($this->timeoutSeconds)) {\n $challengeTs = strtotime($initialResponse->getChallengeTs());\n\n if ($challengeTs > 0 && time() - $challengeTs > $this->timeoutSeconds) {\n $validationErrors[] = self::E_CHALLENGE_TIMEOUT;\n }\n }\n\n if (empty($validationErrors)) {\n return $initialResponse;\n }\n\n return new Response(\n false,\n array_merge($initialResponse->getErrorCodes(), $validationErrors),\n $initialResponse->getHostname(),\n $initialResponse->getChallengeTs(),\n $initialResponse->getApkPackageName(),\n $initialResponse->getScore(),\n $initialResponse->getAction()\n );\n }", "function save_session_and_responses(&$question, &$state) {\n // field.\n // The serialized format for multiple choice quetsions\n // is (optionally) a comma separated list of answer ids\n // followed by a colon, followed by another comma separated\n // list of answer ids, which are the radio/checkboxes that were\n // ticked.\n // E.g. 1,3,2,4:2,4 means that the answers were shown in the order\n // 1, 3, 2 and then 4 and the answers 2 and 4 were checked.\n\n $tempVal = $state->responses;\n $tempAnswers = array();\n $tempOrder = $state->options->order;\n $tempOrder = array_flip($tempOrder);\n\n /*\n foreach($tempOrder as $key=>$value) {\n if (!array_key_exists($key, $tempVal)) {\n $state->responses[$key] = '';\n }\n }\n */\n ksort($state->responses);\n\n // t3lib_div::debug($state->options->order, '$state->options->order');\n // t3lib_div::debug($state->responses, '$state->responses');\n $responses = implode(',', $state->options->order) . ':';\n $responses .= implode(',', $state->responses);\n // t3lib_div::debug($responses, '$responses2');\n // Set the legacy answer field\n if (!set_field('question_states', 'answer', $responses, 'id', $state->id)) {\n return false;\n }\n return true;\n }", "public function answerCheck()\n {\n $first_number = $this->post_data['firstNumber']; \n // Assign the second number in the question to $second_number in the class method.\n $second_number = $this->post_data['secondNumber'];\n // Assign the number of correct answers to $number_correct in the class method.\n $number_correct = $this->post_data['numberCorrect'];\n // Assign the question number for this level to $question_number in the class method.\n $question_number = $this->post_data['questionNumber'];\n // Assign the level number for this level to $level_number in the class method.\n $level_number = $this->post_data['levelNumber'];\n // Reset Question number to 1 if more than five questions have been completed or increase it by one\n if($question_number == 5) {\n $question_number = 1;\n $level_number++;\n } else {\n $question_number++;\n }\n\n // Check the correct answer to the question.\n $sum = $first_number * $second_number;\n // If the answer in the post data is equivalent to the correct answer, increment $number_correct by one \n // then return true and $number_correct. If it isn't correct return false and $number_correct.\n if ($sum == $this->post_data['sumAnswer']) {\n $number_correct++;\n return array(true, $number_correct, $question_number, $level_number);\n } else {\n return array(false, $number_correct, $question_number, $level_number);\n }\n }", "function answer()\r\n {\r\n /* answer is not stored */ \r\n return false;\r\n }", "public function summarise_response(array $response) {\n //If an answer has been provided, return it.\n return array_key_exists('answer', $response) ? $response['answer'] : null;\n }", "private function verifyResponse($resp)\n {\n //grab session value and destroy it\n $val = $_SESSION['challenge'];\n unset($_SESSION['challenge']);\n return $resp == $val;\n }", "public function test_display_of_right_answer_when_shuffled() {\n $dd = test_question_maker::make_question('ddimageortext');\n $this->start_attempt_at_question($dd, 'deferredfeedback', 3);\n\n // Check the initial state.\n $this->check_current_state(question_state::$todo);\n $this->check_current_mark(null);\n\n $this->check_current_output(\n $this->get_contains_hidden_expectation(\n $this->quba->get_field_prefix($this->slot) . 'p1'),\n $this->get_contains_hidden_expectation(\n $this->quba->get_field_prefix($this->slot) . 'p2'),\n $this->get_contains_hidden_expectation(\n $this->quba->get_field_prefix($this->slot) . 'p3'),\n $this->get_contains_hidden_expectation(\n $this->quba->get_field_prefix($this->slot) . 'p4'),\n $this->get_does_not_contain_feedback_expectation());\n\n // Save a partial answer.\n $this->process_submission($dd->get_correct_response());\n\n // Verify.\n $this->check_current_state(question_state::$complete);\n $this->check_current_mark(null);\n $this->check_current_output(\n $this->get_contains_hidden_expectation(\n $this->quba->get_field_prefix($this->slot) . 'p1',\n $dd->get_right_choice_for(1)),\n $this->get_contains_hidden_expectation(\n $this->quba->get_field_prefix($this->slot) . 'p2',\n $dd->get_right_choice_for(2)),\n $this->get_contains_hidden_expectation(\n $this->quba->get_field_prefix($this->slot) . 'p3',\n $dd->get_right_choice_for(3)),\n $this->get_contains_hidden_expectation(\n $this->quba->get_field_prefix($this->slot) . 'p4',\n $dd->get_right_choice_for(4)),\n $this->get_does_not_contain_correctness_expectation(),\n $this->get_does_not_contain_feedback_expectation());\n\n // Finish the attempt.\n $this->quba->finish_all_questions();\n\n // Verify.\n $this->displayoptions->rightanswer = question_display_options::VISIBLE;\n $this->assertEquals('Drop zone 1 -> {1. quick} '.\n 'Drop zone 2 -> {2. fox} '.\n 'Drop zone 3 -> {3. lazy} '.\n 'Drop zone 4 -> {4. dog}',\n $dd->get_right_answer_summary());\n $this->check_current_state(question_state::$gradedright);\n $this->check_current_mark(3);\n }", "public function askWithHiddenResponse(string $question): string;", "private function q8($answer) {\n\t\t$vowels = 0;\n\n\t\tforeach ($this->answers as $q => $a) {\n\t\t\tif ($a == A || $a == E) {\n\t\t\t\t$vowels++;\n\t\t\t}\n\t\t}\n\t\treturn $answer + 3 === $vowels;\n\t}", "public function answer() {\n\n\t\t/**\n\t\t * Fires right before giving the answer.\n\t\t */\n\t\tdo_action( self::ACTION );\n\n\t\t/**\n\t\t * Filters the answer.\n\t\t *\n\t\t * @param string $answer The answer.\n\t\t */\n\t\treturn (string) apply_filters( self::FILTER, '42' );\n\t}", "public function getAnswers();", "public static function askYesNo(OutputInterface $output, string $question): bool\n {\n $userResponse = false;\n self::ask($output, $question . ' (y/n)', function ($response) use (&$userResponse, $output) {\n if (true === in_array($response, ['y', 'n'], true)) {\n $userResponse = $response;\n return true;\n }\n $output->write(\"<error>Invalid answer, try again (y/n).</error>\" . PHP_EOL);\n return false;\n });\n return ('y' === $userResponse);\n }", "public function grade_response(array $response) {\n if (empty($response['_testresults'])) {\n // debugging('Running ProgramCode tests');\n $code = $response['answer'];\n $testResults = $this->run_tests($code, $this->testcases);\n $this->clean(&$testResults); // Truncate if nec to fit in DB\n $testResultsSerial = serialize($testResults);\n }\n else {\n $testResultsSerial = $response['_testresults'];\n $testResults = unserialize($testResultsSerial);\n }\n\n $dataToCache = array('_testresults' => $testResultsSerial);\n if ($this->count_errors($testResults) != 0) {\n return array(0, question_state::$gradedwrong, $dataToCache);\n }\n else {\n return array(1, question_state::$gradedright, $dataToCache);\n }\n }", "private function onAnswer()\n {\n if (!$this->checkAuth()) {\n return;\n }\n\n $payload = $this->clientEvent->getPayload();\n\n $checkAnswer = $this->getService('quest.quest_manager')->checkAnswer(\n $this->getUserId(),\n $payload['chapterId'] ?? null,\n $payload['answer'] ?? null\n );\n\n $this->send(new AnswerEvent($this->clientEvent, $checkAnswer));\n\n if ($checkAnswer) {\n $newData = $this\n ->getService('quest.quest_manager')\n ->getNewData($payload['chapterId'], $this->getUserId(), true);\n\n if ($newData) {\n $this->send(\n new NewContentEvent($newData)\n );\n }\n\n }\n }", "function TestGetAnswer() {\n \t$existingAnswer = new Answer(2); //Answer of formdest_id = 1\n \t$answerArray = (array(array(\"elementId\" => 1, \"value\" => \"10\"), array(\"elementId\" => 2, \"value\" => \"1\"), array(\"elementId\" => 2, \"value\" => \"2\")));\n \t$this->assertFalse($existingAnswer->getAnswers() == $answerArray);\n }", "private function getStatus($response){\n $status = \"done\";\n if(preg_match('/true/', $response) ){\n $status = \"passed\";\n }\n if(preg_match('/false/', $response) ){\n $status = \"failed\";\n }\n return $status;\n }", "public function check_and_filter_answers($form) {\n $tags = $this->part_tags();\n $res = (object)array('answers' => array());\n foreach ($form->answermark as $i => $a) {\n if ((strlen(trim($form->answermark[$i])) == 0 || strlen(trim($form->answer[$i])) == 0)\n && (strlen(trim($form->subqtext[$i]['text'])) != 0\n || strlen(trim($form->feedback[$i]['text'])) != 0\n || strlen(trim($form->vars1[$i])) != 0\n )\n ) {\n $res->errors[\"answer[$i]\"] = get_string('error_answer_missing', 'qtype_formulas');\n $skip = true;\n }\n if (strlen(trim($form->answermark[$i])) == 0 || strlen(trim($form->answer[$i])) == 0) {\n continue; // If no mark or no answer, then skip this answer.\n }\n if (floatval($form->answermark[$i]) <= 0) {\n $res->errors[\"answermark[$i]\"] = get_string('error_mark', 'qtype_formulas');\n }\n $skip = false;\n if (strlen(trim($form->correctness[$i])) == 0) {\n $res->errors[\"correctness[$i]\"] = get_string('error_criterion', 'qtype_formulas');\n $skip = true;\n }\n if ($skip) {\n continue; // If no answer or correctness conditions, it cannot check other parts, so skip.\n }\n $res->answers[$i] = new stdClass();\n $res->answers[$i]->questionid = $form->id;\n foreach ($tags as $tag) {\n $res->answers[$i]->{$tag} = trim($form->{$tag}[$i]);\n }\n\n $subqtext = array();\n $subqtext['text'] = $form->subqtext[$i]['text'];\n $subqtext['format'] = $form->subqtext[$i]['format'];\n if (isset($form->subqtext[$i]['itemid'])) {\n $subqtext['itemid'] = $form->subqtext[$i]['itemid'];\n }\n $res->answers[$i]->subqtext = $subqtext;\n\n $fb = array();\n $fb['text'] = $form->feedback[$i]['text'];\n $fb['format'] = $form->feedback[$i]['format'];\n if (isset($form->feedback[$i]['itemid'])) {\n $fb['itemid'] = $form->feedback[$i]['itemid'];\n }\n $res->answers[$i]->feedback = $fb;\n\n $fb = array();\n $fb['text'] = $form->partcorrectfb[$i]['text'];\n $fb['format'] = $form->partcorrectfb[$i]['format'];\n if (isset($form->partcorrectfb[$i]['itemid'])) {\n $fb['itemid'] = $form->partcorrectfb[$i]['itemid'];\n }\n $res->answers[$i]->partcorrectfb = $fb;\n\n $fb = array();\n $fb['text'] = $form->partpartiallycorrectfb[$i]['text'];\n $fb['format'] = $form->partpartiallycorrectfb[$i]['format'];\n if (isset($form->partpartiallycorrectfb[$i]['itemid'])) {\n $fb['itemid'] = $form->partpartiallycorrectfb[$i]['itemid'];\n }\n $res->answers[$i]->partpartiallycorrectfb = $fb;\n\n $fb = array();\n $fb['text'] = $form->partincorrectfb[$i]['text'];\n $fb['format'] = $form->partincorrectfb[$i]['format'];\n if (isset($form->partincorrectfb[$i]['itemid'])) {\n $fb['itemid'] = $form->partincorrectfb[$i]['itemid'];\n }\n $res->answers[$i]->partincorrectfb = $fb;\n }\n if (count($res->answers) == 0) {\n $res->errors[\"answermark[0]\"] = get_string('error_no_answer', 'qtype_formulas');\n }\n\n return $res;\n }", "public function get_correct_answer() {\n return isset($this->answer) ? array('answer' => $this->answer) : array();\n }", "public function testvote()\n {\n $this->vote_answer = Vote::vote($this->user->id, $this->answer->id, 1, 'answer_id');\n if (!$this->answer) return false;\n }", "public function testPostVoteOnAnswer(): void {\n $user = factory(User::class)->create();\n $q = factory(Question::class)->create();\n $a = factory(Answer::class)->create(['question_id' => $q->id]);\n $url = \"/api/answers/$a->id\";\n //up and cancel\n $this->get(url(\"$url/votes\"))\n ->assertStatus(200)\n ->assertJsonFragment(['total' => 0]);\n $this->post(url(\"$url/upvote\"), ['api_token' => $user->api_token])\n ->assertStatus(200)\n ->assertJsonFragment(['total' => 1, 'up' => 1]);\n $this->post(url(\"$url/upvote\"), ['api_token' => $user->api_token])\n ->assertStatus(200)\n ->assertJsonFragment(['total' => 0, 'up' => 0]);\n // down and cancel\n $this->post(url(\"$url/downvote\"), ['api_token' => $user->api_token])\n ->assertStatus(200)\n ->assertJsonFragment(['total' => -1, 'down' => 1]);\n $this->post(url(\"$url/downvote\"), ['api_token' => $user->api_token])\n ->assertStatus(200)\n ->assertJsonFragment(['total' => 0, 'down' => 0]);\n //down up down\n $this->post(url(\"$url/downvote\"), ['api_token' => $user->api_token])\n ->assertStatus(200)\n ->assertJsonFragment(['total' => -1, 'down' => 1]);\n $this->post(url(\"$url/upvote\"), ['api_token' => $user->api_token])\n ->assertStatus(200)\n ->assertJsonFragment(['total' => 1, 'up' => 1]);\n $this->post(url(\"$url/downvote\"), ['api_token' => $user->api_token])\n ->assertStatus(200)\n ->assertJsonFragment(['total' => -1, 'down' => 1]);\n\n $this->get(url(\"$url/votes\"))\n ->assertStatus(200)\n ->assertJsonFragment(['total' => -1]);\n }", "function score($answerX, $answerY, $solutionX, $solutionY, $distanceScore, $factor) {\n $X = $solutionX - $answerX;\n $Y = $solutionY - $answerY;\n\n // Ist keine Antwort oder keine Lösung gegeben, gibt es keine Punkte.\n if($answerX == 0 && $answerY == 0) {\n $distanceScore = 0;\n }\n if($solutionX == 0 && $solutionY == 0) {\n $distanceScore = 0;\n }\n\n // Satz des Pythagoras und Errechnung des Endergebnisses\n $distance = pow($X, 2) + pow($Y, 2);\n $distance = sqrt($distance);\n $result = ($distanceScore - $distance) * (0.5 * $factor);\n\n // Ist das Ergebnis negativ wird der Punktewert auf 0 gesetzt.\n if($result < 0) {\n $result = 0;\n }\n\n return $result;\n }", "function correctAnswerWithTypo() {\n\t}", "function recaptcha2_check_answer($secret, $response, $remoteIP) {\n\t$url = 'https://www.google.com/recaptcha/api/siteverify';\n\t$data = array(\n\t\t'secret' => $secret,\n\t\t'response' => $response,\n\t\t'remoteip' => $remoteIP\n\t);\n\n\t$options = array(\n\t\t'http' => array(\n\t\t\t'header' => \"Content-type: application/x-www-form-urlencoded\\r\\n\",\n\t\t\t'method' => 'POST',\n\t\t\t'content' => http_build_query($data)\n\t\t)\n\t);\n\t\n\t$context = stream_context_create($options);\n\t$contents = file_get_contents($url, false, $context);\n\tif ($contents === FALSE) {\n\t\tdie(get_form_error_response($form['resources']['invalid_reCAPTCHA2_server_response']));\n\t}\n\n\t$result = (array) json_decode($contents);\n\treturn $result;\n}", "public function getResponse() {\n # Start with the initial answers\n $response = $_SESSION[TOOLKIT_TAG]['initialAnswers'];\n $answers = $_SESSION[TOOLKIT_TAG]['answers'];\n\n # Loop through pages path\n for ($i = 0; $i < count($_SESSION[TOOLKIT_TAG]['pages']); $i++) {\n $page = $_SESSION[TOOLKIT_TAG]['pages'][$i];\n //echo $page['pageID'] . ': ' . count($page['questions']) . ' question(s)<br>';\n\n # Loop through questions in page\n for ($j = 0; $j < count($page['questions']); $j++) {\n $questionID = $page['questions'][$j];\n //echo ' - ' . $questionID . ': ';\n\n # Add all answer to response if exists\n if (isset($answers[$questionID]) && !empty($answers[$questionID])) {\n $response[$questionID] = $answers[$questionID];\n\n # Also add specified answers from 'other' questions\n if (isset($answers[$questionID . '-specific-input']) && !empty($answers[$questionID . '-specific-input'])) {\n $response[$questionID . '-specific-input'] = $answers[$questionID . '-specific-input'];\n }\n //echo 'Found';\n } else {\n //echo 'Not found in answers';\n }\n //echo '<br>';\n }\n //echo '<br>';\n }\n return $response;\n }", "function getCorrectAnswers()\n\t{\n\t\treturn $this->correctanswers;\n\t}", "public function isCorrect() {\n\t\treturn $this->getCorrectAnswer();\n\t}" ]
[ "0.72651917", "0.6033109", "0.597804", "0.5946228", "0.59333867", "0.59280324", "0.58845097", "0.5880805", "0.58695847", "0.5847845", "0.5835745", "0.5813978", "0.5729295", "0.56283563", "0.552544", "0.5517053", "0.54978883", "0.5486746", "0.54657376", "0.5459888", "0.5443033", "0.5428007", "0.54162085", "0.53771013", "0.53735054", "0.53653324", "0.5340317", "0.5321481", "0.53121114", "0.5292937", "0.5287562", "0.52810574", "0.5280878", "0.52654815", "0.52552336", "0.5246833", "0.52264446", "0.52245224", "0.5220776", "0.52148044", "0.5187668", "0.51856834", "0.517193", "0.5166376", "0.51251733", "0.5104595", "0.507242", "0.50631595", "0.506292", "0.5055621", "0.5037147", "0.5034584", "0.5022742", "0.5011121", "0.50078076", "0.50025225", "0.49997282", "0.49912992", "0.4963481", "0.4961883", "0.49605644", "0.49431345", "0.49268872", "0.49252504", "0.4912435", "0.488689", "0.488451", "0.48780748", "0.48757464", "0.4868066", "0.4866377", "0.48613256", "0.48521867", "0.48350945", "0.47996393", "0.47994825", "0.47809672", "0.4774025", "0.47710934", "0.47630116", "0.47596318", "0.4758817", "0.47532356", "0.474098", "0.47394776", "0.47360104", "0.47351292", "0.47302267", "0.47289258", "0.47281197", "0.47262263", "0.4725253", "0.4717568", "0.47145092", "0.4712588", "0.47026074", "0.46931812", "0.46887878", "0.4681997", "0.4676026" ]
0.78834724
0
Determines which questionrelated files the user is allowed to access. In our case, the user should be able to view the question, and its hints.
public function check_file_access($qa, $options, $component, $filearea, $args, $forcedownload) { if ($component == 'question' && $filearea == 'answerfeedback') { $currentanswer = $qa->get_last_qt_var('answer'); $answer = $qa->get_question()->get_matching_answer(array('answer' => $currentanswer)); $answerid = reset($args); // itemid is answer id. return $options->feedback && $answerid == $answer->id; } else if ($component == 'question' && $filearea == 'hint') { return $this->check_hint_file_access($qa, $options, $args); } else { return parent::check_file_access($qa, $options, $component, $filearea, $args, $forcedownload); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getFilePermissionsReturnsCorrectPermissionsForFilesNotOwnedByCurrentUser_dataProvider() {}", "function getFileTypeRestrictions() ;", "function learndash_essay_permissions() {\n\tglobal $post;\n\n\tif ( ! empty( $post->post_type ) && $post->post_type == 'sfwd-essays' && is_singular() ) {\n\t\t$user_id = get_current_user_id();\n\n\t\t$can_view_file = false;\n\t\t\n\t\tif ( ( learndash_is_admin_user( $user_id ) ) || ( $post->post_author == $user_id ) ) {\n\t\t\t$can_view_file = true;\n\t\t} else if ( ( learndash_is_group_leader_user( $user_id ) ) && ( learndash_is_group_leader_of_user( $user_id, $post->post_author ) ) ) {\n\t\t\t\n\t\t\t$can_view_file = true;\n\t\t}\n\t\t\n\t\tif ( $can_view_file == true ) { \n\t\t\t$uploaded_file = get_post_meta( $post->ID, 'upload', true );\n\t\t\t\n\t\t\tif ( ( !empty( $uploaded_file ) ) && ( !strstr( $post->post_content, $uploaded_file ) ) ) {\n\t\t\t\t$post->post_content .= apply_filters( 'learndash-quiz-essay-upload-link', '<p><a target=\"_blank\" href=\"'. $uploaded_file .'\">'. esc_html__('View uploaded file', 'learndash' ) .'</a></p>' );\n\t\t\t}\n\t\t\treturn;\n\t\t} else {\n\t\t\twp_redirect( apply_filters('learndash_essay_permissions_redirect_url', get_bloginfo( 'url' ) ) );\n\t\t\texit;\n\t\t}\n\t}\n}", "public function getAllowSpecific();", "private function setUser() {\n if (Request::has(\"include-user-read\") && Request::input(\"include-user-read\") === \"true\") { $permissionRead = 4; } else { $permissionRead = 0; }\n if (Request::has(\"include-user-write\") && Request::input(\"include-user-write\") === \"true\") { $permissionWrite = 2; } else { $permissionWrite = 0; }\n if (Request::has(\"include-user-execute\") && Request::input(\"include-user-execute\") === \"true\") { $permissionExecute = 1; } else { $permissionExecute = 0; }\n return $permissionRead + $permissionWrite + $permissionExecute;\n }", "public function getFileTypeRestrictions() {}", "protected function isPermissionCorrect() {}", "private function setOther() {\n if (Request::has(\"include-other-read\") && Request::input(\"include-other-read\") === \"true\") { $permissionRead = 4; } else { $permissionRead = 0; }\n if (Request::has(\"include-other-write\") && Request::input(\"include-other-write\") === \"true\") { $permissionWrite = 2; } else { $permissionWrite = 0; }\n if (Request::has(\"include-other-execute\") && Request::input(\"include-other-execute\") === \"true\") { $permissionExecute = 1; } else { $permissionExecute = 0; }\n return $permissionRead + $permissionWrite + $permissionExecute;\n }", "public function evaluateUserSpecificFileFilterSettings() {}", "static function getrules_block_wp_file_access()\r\n {\r\n global $aio_wp_security;\r\n $rules = '';\r\n if ($aio_wp_security->configs->get_value('aiowps_prevent_default_wp_file_access') == '1') {\r\n $rules .= AIOWPSecurity_Utility_Htaccess::$prevent_wp_file_access_marker_start . PHP_EOL; //Add feature marker start\r\n $rules .= self::create_apache2_access_denied_rule('license.txt');\r\n $rules .= self::create_apache2_access_denied_rule('wp-config-sample.php');\r\n $rules .= self::create_apache2_access_denied_rule('readme.html');\r\n $rules .= AIOWPSecurity_Utility_Htaccess::$prevent_wp_file_access_marker_end . PHP_EOL; //Add feature marker end\r\n }\r\n\r\n return $rules;\r\n }", "public function getAllowedFiles(){\n return self::$allowed_files;\n }", "function getAuthorViewableReviewFiles() {\r\n\t\treturn $this->getData('authorViewableReviewFiles');\r\n\t}", "function fm_user_can_view_file($id, $fileid, $groupid) {\r\n\tglobal $USER, $CFG;\r\n\t\t\t\r\n\t// If they own the file, they can view\r\n\tif ($groupid == 0){\r\n\t\t$ownertype = OWNERISUSER;\r\n\t\tif (count_records('fmanager_link', 'id', $fileid, 'owner', $USER->id, 'ownertype', $ownertype)) { \r\n\t\treturn true;\r\n\t\t}\t\r\n\t} else {\r\n\t\t$ownertype = OWNERISGROUP;\r\n\t\tif (count_records('fmanager_link', 'id', $fileid, 'owner', $groupid, 'ownertype', $ownertype)) { \r\n\t\treturn true;\r\n\t\t}\t\r\n\t}\r\n\t\r\n\t\r\n\t// If file is shared to them or to everyone in the course they can view\r\n\t$select = \" \r\n\t ( userid = '0' AND \r\n\t sharedlink = '{$fileid}' AND \r\n\t course = '{$id}' ) OR \r\n\t ( userid = '{$USER->id}' AND \r\n\t sharedlink = '{$fileid}' AND \r\n\t course = '{$id}'\r\n\t)\";\r\n\tif (count_records_select('fmanager_shared', $select)) {\r\n\t\treturn true;\r\n\t}\r\n\tif (!$sharedfile = get_record('fmanager_link', 'id', $fileid)) {\r\n\t\treturn false;\r\n\t} \r\n\r\n\t// If shared via shared/nested folder they can view\r\n\t$select = \" \r\n\t ( userid = '0' AND \r\n\t type = '2' AND \r\n\t course = '{$id}' AND \r\n\t sharedlink = '{$sharedfile->folder}' ) OR \r\n\t ( userid = '{$USER->id}' AND \r\n\t type = '2' AND \r\n\t course = '{$id}' AND \r\n\t sharedlink = '{$sharedfile->folder}'\r\n\t)\";\r\n\tif (count_records_select('fmanager_shared', $select)) {\r\n\t\treturn true;\r\n\t} else { \r\n\t // File isnt under the main folder\r\n\t\t$tmp = get_record('fmanager_folders', 'id', $sharedfile->folder);\r\n\t\tif (isset($tmp->pathid)){\r\n\t\t\t$folderid = $tmp->pathid;\r\n\t\t\twhile ($folderid) {\t// While folder id isnt the root (0)\r\n\t\t\t\t$select = \"\r\n\t\t\t\t ( userid = '0' AND \r\n\t\t\t\t type = '2' AND \r\n\t\t\t\t course = '{$id}' AND \r\n\t\t\t\t sharedlink = '{$folderid}' ) OR \r\n\t\t\t\t ( userid = '{$USER->id}' AND \r\n\t\t\t\t type = '2' AND \r\n\t\t\t\t course = '{$id}' AND \r\n\t\t\t\t sharedlink = '{$folderid}'\r\n\t\t\t )\";\r\n\t\t\t\tif (count_records_select('fmanager_shared', $select)) {\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t\t$tmp = get_record('fmanager_folders', 'id', $tmp->pathid);\r\n\t\t\t\t$folderid = $tmp->id;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t// If file is shared via a shared category they can view\r\n\t$dummyvar = 1;\r\n\t$fid = $sharedfile->folder;\r\n\tif ($fid == 0) {\r\n\t\t$select = \" \r\n\t\t ( userid = '0' AND \r\n\t\t type = '1' AND \r\n\t\t course = '{$id}' AND \r\n\t\t sharedlink = '{$sharedfile->category}' ) OR \r\n\t\t ( userid = '{$USER->id}' AND \r\n\t\t type = '1' AND \r\n\t\t course = '{$id}' AND \r\n\t\t sharedlink = '{$sharedfile->category}'\r\n\t\t)\";\r\n\t\tif (count_records_select('fmanager_shared', $select)) {\r\n\t\t\treturn true;\r\n\t\t} else {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\twhile ($fid) {\t\r\n\t\t$folder = get_record('fmanager_folders', 'id', $fid);\r\n\t\t\r\n\t\t$select = \"\r\n\t\t ( userid = '0' AND \r\n\t\t type = '1' AND \r\n\t\t course = '{$id}' AND \r\n\t\t sharedlink = '{$folder->category}' ) OR \r\n\t\t ( userid = '{$USER->id}' AND \r\n\t\t type = '1' AND \r\n\t\t course = '{$id}' AND \r\n\t\t sharedlink = '{$folder->category}' )\r\n\t\t\";\r\n\t\tif (count_records_select('fmanager_shared', $select)) {\r\n\t\t\treturn true;\r\n\t\t} else {\r\n\t\t\t$fid = $folder->pathid;\r\n\t\t}\r\n\t}\r\n\t// Otherwise, error is displayed\r\n\treturn false;\r\n}", "function wp_is_file_mod_allowed($context)\n {\n }", "function _hippel_discussions_user_default_permissions() {\n $permissions = array();\n\n // Exported permission: create discuss content\n $permissions[] = array(\n 'name' => 'create discuss content',\n 'roles' => array(\n '0' => 'authenticated user',\n ),\n );\n\n // Exported permission: create reply content\n $permissions[] = array(\n 'name' => 'create reply content',\n 'roles' => array(\n '0' => 'authenticated user',\n ),\n );\n\n // Exported permission: edit own discuss content\n $permissions[] = array(\n 'name' => 'edit own discuss content',\n 'roles' => array(\n '0' => 'authenticated user',\n ),\n );\n\n // Exported permission: edit own reply content\n $permissions[] = array(\n 'name' => 'edit own reply content',\n 'roles' => array(\n '0' => 'authenticated user',\n ),\n );\n\n // Exported permission: use PHP for title patterns\n $permissions[] = array(\n 'name' => 'use PHP for title patterns',\n 'roles' => array(),\n );\n\n // Exported permission: use vote up/down\n $permissions[] = array(\n 'name' => 'use vote up/down',\n 'roles' => array(\n '0' => 'authenticated user',\n ),\n );\n\n // Exported permission: use vote up/down on nodes\n $permissions[] = array(\n 'name' => 'use vote up/down on nodes',\n 'roles' => array(\n '0' => 'authenticated user',\n ),\n );\n\n // Exported permission: view vote up/down count on nodes\n $permissions[] = array(\n 'name' => 'view vote up/down count on nodes',\n 'roles' => array(\n '0' => 'authenticated user',\n ),\n );\n\n return $permissions;\n}", "protected function _isAllowed()\n {\n return $this->_authorization->isAllowed('Dilmah_TeaFaq::dilmah_tfaq');\n }", "public function canViewSuggestions(){\n $viewer_id = Engine_Api::_()->user()->getViewer()->getIdentity();\n if(!empty($viewer_id)){\n return true;\n } \n }", "public function can_manage_files() {\n return true;\n }", "function userCanViewFiles($sessionID, $contactID){\r\n\t\treturn $this->userCanViewContact( $sessionID, $contactID );\r\n\t}", "public function expectedPerms() {\n return [\n [\n 'anonymous',\n [\n 'access content',\n 'access site-wide contact form',\n 'view media',\n ],\n ],\n [\n 'authenticated',\n [\n 'access content',\n 'access environment indicator',\n 'access site-wide contact form',\n 'access taxonomy overview',\n 'execute graphql requests',\n 'execute persisted graphql requests',\n 'view media',\n ],\n ],\n [\n 'content_api_consumer',\n [\n 'administer menu',\n 'use graphql explorer',\n 'use graphql voyager',\n 'view any unpublished content',\n 'view own unpublished content',\n ],\n ],\n [\n 'content_editor',\n [\n 'access administration pages',\n 'access content overview',\n 'access files overview',\n 'access image_browser entity browser pages',\n 'access media overview',\n 'access media_browser entity browser pages',\n 'access shortcuts',\n 'access toolbar',\n 'access user profiles',\n 'access vamc_operating_statuses entity browser pages',\n 'administer menu',\n 'break content lock',\n 'create alert block content',\n 'create document media',\n 'create image media',\n 'create media',\n 'create promo block content',\n 'create video media',\n 'delete media',\n 'edit any document media',\n 'edit any documentation_page content',\n 'edit any event content',\n 'edit any event_listing content',\n 'edit any full_width_banner_alert content',\n 'edit any health_care_local_facility content',\n 'edit any health_care_local_health_service content',\n 'edit any health_care_region_detail_page content',\n 'edit any health_care_region_page content',\n 'edit any image media',\n 'edit any landing_page content',\n 'edit any news_story content',\n 'edit any office content',\n 'edit any outreach_asset content',\n 'edit any page content',\n 'edit any person_profile content',\n 'edit any press_release content',\n 'edit any publication_listing content',\n 'edit any regional_health_care_service_des content',\n 'edit any support_service content',\n 'edit any vamc_operating_status_and_alerts content',\n 'edit any video media',\n 'edit own documentation_page content',\n 'edit own event content',\n 'edit own event_listing content',\n 'edit own full_width_banner_alert content',\n 'edit own health_care_local_facility content',\n 'edit own health_care_local_health_service content',\n 'edit own health_care_region_detail_page content',\n 'edit own health_care_region_page content',\n 'edit own landing_page content',\n 'edit own news_story content',\n 'edit own office content',\n 'edit own outreach_asset content',\n 'edit own page content',\n 'edit own person_profile content',\n 'edit own press_release content',\n 'edit own publication_listing content',\n 'edit own regional_health_care_service_des content',\n 'edit own support_service content',\n 'edit own vamc_operating_status_and_alerts content',\n 'notify of path changes',\n 'rebuild tablefield',\n 'schedule editorial transition create_new_draft',\n 'update any alert block content',\n 'update any media',\n 'update any promo block content',\n 'update media',\n 'use editorial transition archived_published',\n 'use editorial transition create_new_draft',\n 'use editorial transition review',\n 'use moderation sidebar',\n 'use text format rich_text',\n 'use workbench access',\n 'view all media revisions',\n 'view all revisions',\n 'view any unpublished content',\n 'view event revisions',\n 'view event_listing revisions',\n 'view full_width_banner_alert revisions',\n 'view health_care_local_facility revisions',\n 'view health_care_local_health_service revisions',\n 'view health_care_region_detail_page revisions',\n 'view health_care_region_page revisions',\n 'view landing_page revisions',\n 'view latest version',\n 'view news_story revisions',\n 'view office revisions',\n 'view outreach_asset revisions',\n 'view own unpublished content',\n 'view page revisions',\n 'view person_profile revisions',\n 'view press_release revisions',\n 'view publication_listing revisions',\n 'view regional_health_care_service_des revisions',\n 'view sections in toolbar',\n 'view support_service revisions',\n 'view the administration theme',\n 'view unpublished paragraphs',\n 'view vamc_operating_status_and_alerts revisions',\n 'view workbench access information'\n ],\n ],\n [\n 'content_reviewer',\n [\n 'access administration pages',\n 'access content overview',\n 'access files overview',\n 'access image_browser entity browser pages',\n 'access media overview',\n 'access media_browser entity browser pages',\n 'access shortcuts',\n 'access toolbar',\n 'access user profiles',\n 'access vamc_operating_statuses entity browser pages',\n 'administer menu',\n 'break content lock',\n 'create alert block content',\n 'create document media',\n 'create image media',\n 'create media',\n 'create promo block content',\n 'create video media',\n 'delete media',\n 'edit any document media',\n 'edit any documentation_page content',\n 'edit any event content',\n 'edit any event_listing content',\n 'edit any full_width_banner_alert content',\n 'edit any health_care_local_facility content',\n 'edit any health_care_local_health_service content',\n 'edit any health_care_region_detail_page content',\n 'edit any health_care_region_page content',\n 'edit any image media',\n 'edit any landing_page content',\n 'edit any news_story content',\n 'edit any office content',\n 'edit any outreach_asset content',\n 'edit any page content',\n 'edit any person_profile content',\n 'edit any press_release content',\n 'edit any publication_listing content',\n 'edit any regional_health_care_service_des content',\n 'edit any support_service content',\n 'edit any vamc_operating_status_and_alerts content',\n 'edit any video media',\n 'edit own documentation_page content',\n 'edit own event content',\n 'edit own event_listing content',\n 'edit own full_width_banner_alert content',\n 'edit own health_care_local_facility content',\n 'edit own health_care_local_health_service content',\n 'edit own health_care_region_detail_page content',\n 'edit own health_care_region_page content',\n 'edit own landing_page content',\n 'edit own news_story content',\n 'edit own office content',\n 'edit own outreach_asset content',\n 'edit own page content',\n 'edit own person_profile content',\n 'edit own press_release content',\n 'edit own publication_listing content',\n 'edit own regional_health_care_service_des content',\n 'edit own support_service content',\n 'edit own vamc_operating_status_and_alerts content',\n 'notify of path changes',\n 'rebuild tablefield',\n 'schedule editorial transition create_new_draft',\n 'update any alert block content',\n 'update any media',\n 'update any promo block content',\n 'update media',\n 'use editorial transition archived_published',\n 'use editorial transition create_new_draft',\n 'use editorial transition review',\n 'use editorial transition stage_for_publishing',\n 'use moderation sidebar',\n 'use text format rich_text',\n 'use workbench access',\n 'view all media revisions',\n 'view all revisions',\n 'view any unpublished content',\n 'view event revisions',\n 'view event_listing revisions',\n 'view full_width_banner_alert revisions',\n 'view health_care_local_facility revisions',\n 'view health_care_local_health_service revisions',\n 'view health_care_region_detail_page revisions',\n 'view health_care_region_page revisions',\n 'view landing_page revisions',\n 'view latest version',\n 'view news_story revisions',\n 'view office revisions',\n 'view outreach_asset revisions',\n 'view own unpublished content',\n 'view page revisions',\n 'view person_profile revisions',\n 'view press_release revisions',\n 'view publication_listing revisions',\n 'view regional_health_care_service_des revisions',\n 'view sections in toolbar',\n 'view support_service revisions',\n 'view the administration theme',\n 'view unpublished paragraphs',\n 'view vamc_operating_status_and_alerts revisions',\n 'view workbench access information'\n ],\n ],\n [\n 'content_publisher',\n [\n 'access administration pages',\n 'access content overview',\n 'access files overview',\n 'access image_browser entity browser pages',\n 'access media overview',\n 'access media_browser entity browser pages',\n 'access shortcuts',\n 'access toolbar',\n 'access user profiles',\n 'access vamc_operating_statuses entity browser pages',\n 'administer menu',\n 'break content lock',\n 'create alert block content',\n 'create document media',\n 'create image media',\n 'create media',\n 'create promo block content',\n 'create terms in health_care_service_taxonomy',\n 'create url aliases',\n 'create video media',\n 'delete any alert block content',\n 'delete any document media',\n 'delete any event content',\n 'delete any event_listing content',\n 'delete any full_width_banner_alert content',\n 'delete any health_care_local_facility content',\n 'delete any health_care_local_health_service content',\n 'delete any health_care_region_detail_page content',\n 'delete any image media',\n 'delete any media',\n 'delete any news_story content',\n 'delete any office content',\n 'delete any outreach_asset content',\n 'delete any person_profile content',\n 'delete any press_release content',\n 'delete any promo block content',\n 'delete any publication_listing content',\n 'delete any regional_health_care_service_des content',\n 'delete any support_service content',\n 'delete any video media',\n 'delete media',\n 'delete own document media',\n 'delete own documentation_page content',\n 'delete own event content',\n 'delete own event_listing content',\n 'delete own full_width_banner_alert content',\n 'delete own health_care_local_facility content',\n 'delete own health_care_local_health_service content',\n 'delete own health_care_region_detail_page content',\n 'delete own image media',\n 'delete own landing_page content',\n 'delete own news_story content',\n 'delete own office content',\n 'delete own outreach_asset content',\n 'delete own page content',\n 'delete own person_profile content',\n 'delete own press_release content',\n 'delete own publication_listing content',\n 'delete own regional_health_care_service_des content',\n 'delete own support_service content',\n 'delete own video media',\n 'delete terms in health_care_service_taxonomy',\n 'edit any document media',\n 'edit any documentation_page content',\n 'edit any event content',\n 'edit any event_listing content',\n 'edit any full_width_banner_alert content',\n 'edit any health_care_local_facility content',\n 'edit any health_care_local_health_service content',\n 'edit any health_care_region_detail_page content',\n 'edit any health_care_region_page content',\n 'edit any image media',\n 'edit any landing_page content',\n 'edit any news_story content',\n 'edit any office content',\n 'edit any outreach_asset content',\n 'edit any page content',\n 'edit any person_profile content',\n 'edit any press_release content',\n 'edit any publication_listing content',\n 'edit any regional_health_care_service_des content',\n 'edit any support_service content',\n 'edit any vamc_operating_status_and_alerts content',\n 'edit any video media',\n 'edit own document media',\n 'edit own documentation_page content',\n 'edit own event content',\n 'edit own event_listing content',\n 'edit own full_width_banner_alert content',\n 'edit own health_care_local_facility content',\n 'edit own health_care_local_health_service content',\n 'edit own health_care_region_detail_page content',\n 'edit own health_care_region_page content',\n 'edit own image media',\n 'edit own landing_page content',\n 'edit own news_story content',\n 'edit own office content',\n 'edit own outreach_asset content',\n 'edit own page content',\n 'edit own person_profile content',\n 'edit own press_release content',\n 'edit own publication_listing content',\n 'edit own regional_health_care_service_des content',\n 'edit own support_service content',\n 'edit own vamc_operating_status_and_alerts content',\n 'edit own video media',\n 'edit terms in health_care_service_taxonomy',\n 'notify of path changes',\n 'rebuild tablefield',\n 'revert all revisions',\n 'revert event revisions',\n 'revert event_listing revisions',\n 'revert full_width_banner_alert revisions',\n 'revert health_care_local_facility revisions',\n 'revert health_care_local_health_service revisions',\n 'revert health_care_region_detail_page revisions',\n 'revert health_care_region_page revisions',\n 'revert landing_page revisions',\n 'revert news_story revisions',\n 'revert office revisions',\n 'revert outreach_asset revisions',\n 'revert page revisions',\n 'revert person_profile revisions',\n 'revert press_release revisions',\n 'revert publication_listing revisions',\n 'revert regional_health_care_service_des revisions',\n 'revert support_service revisions',\n 'revert vamc_operating_status_and_alerts revisions',\n 'schedule editorial transition archive',\n 'schedule editorial transition archived_published',\n 'schedule editorial transition create_new_draft',\n 'schedule editorial transition publish',\n 'update any alert block content',\n 'update any media',\n 'update any promo block content',\n 'update media',\n 'use editorial transition archive',\n 'use editorial transition archived_published',\n 'use editorial transition create_new_draft',\n 'use editorial transition publish',\n 'use editorial transition review',\n 'use editorial transition stage_for_publishing',\n 'use moderation sidebar',\n 'use text format rich_text',\n 'use workbench access',\n 'view all media revisions',\n 'view all revisions',\n 'view any unpublished content',\n 'view event revisions',\n 'view event_listing revisions',\n 'view full_width_banner_alert revisions',\n 'view health_care_local_facility revisions',\n 'view health_care_local_health_service revisions',\n 'view health_care_region_detail_page revisions',\n 'view health_care_region_page revisions',\n 'view landing_page revisions',\n 'view latest version',\n 'view news_story revisions',\n 'view office revisions',\n 'view outreach_asset revisions',\n 'view own unpublished content',\n 'view page revisions',\n 'view person_profile revisions',\n 'view press_release revisions',\n 'view publication_listing revisions',\n 'view regional_health_care_service_des revisions',\n 'view sections in toolbar',\n 'view support_service revisions',\n 'view the administration theme',\n 'view unpublished paragraphs',\n 'view vamc_operating_status_and_alerts revisions',\n 'view workbench access information'\n ],\n ],\n [\n 'admnistrator_users',\n [\n 'access administration pages',\n 'access content overview',\n 'access files overview',\n 'access shortcuts',\n 'access toolbar',\n 'administer menu',\n 'administer nodes',\n 'administer users',\n 'assign content_admin role',\n 'assign content_api_consumer role',\n 'assign content_creator_benefits_hubs role',\n 'assign content_editor role',\n 'assign content_publisher role',\n 'assign content_reviewer role',\n 'assign redirect_administrator role',\n 'assign selected workbench access',\n 'assign vamc_content_creator role',\n 'batch update workbench access',\n 'break content lock',\n 'bypass password policies',\n 'bypass workbench access',\n 'create terms in administration',\n 'delete terms in administration',\n 'edit terms in administration',\n 'manage password reset',\n 'notify of path changes',\n 'use text format rich_text',\n 'view sections in toolbar',\n 'view the administration theme',\n 'view workbench access information'\n ],\n ],\n ];\n }", "public function setPermissions() {\r\n\t\tif ($this->canSave) {\r\n\t\t\t$this->canSave = $this->resource->checkPolicy('save');\r\n\t\t}\r\n\t\t$this->canEdit = $this->modx->hasPermission('edit_document');\r\n\t\t$this->canCreate = $this->modx->hasPermission('new_document');\r\n\t\t$this->canPublish = $this->modx->hasPermission('publish_document');\r\n\t\t$this->canDelete = ($this->modx->hasPermission('delete_document') && $this->resource->checkPolicy(array('save' => true, 'delete' => true)));\r\n\t\t$this->canDuplicate = $this->resource->checkPolicy('save');\r\n\t}", "public function getPermissionsFromFiles() : array\n {\n $path = base_path();\n $keys = [];\n $functions = [\n 'userCan',\n ];\n $pattern = // See http://regexr.com/392hu\n \"[^\\w|>]\" . // Must not have an alphanum or _ or > before real method\n \"(\" . implode('|', $functions) . \")\" . // Must start with one of the functions\n \"\\(\" . // Match opening parenthese\n \"[\\'\\\"]\" . // Match \" or '\n \"(\" . // Start a new group to match:\n // \"[a-zA-Z0-9_-]+\". // Must start with group\n \"([^\\1)]+)+\" . // Be followed by one or more items/keys\n \")\" . // Close group\n \"[\\'\\\"]\" . // Closing quote\n \"[\\),]\"; // Close parentheses or new parameter\n\n // Find all PHP + Twig files in the app folder, except for storage\n $finder = new Finder();\n $finder->in($path)->exclude('storage')->name('*.php')->name('*.twig')->files();\n\n /** @var \\Symfony\\Component\\Finder\\SplFileInfo $file */\n foreach ($finder as $file) {\n // Search the current file for the pattern\n if (preg_match_all(\"/$pattern/siU\", $file->getContents(), $matches)) {\n // Get all matches\n foreach ($matches[2] as $key) {\n $keys[] = $key;\n }\n }\n }\n\n // Remove duplicates\n $keys = array_unique($keys);\n\n $base_permissions = array_filter(explode(',', \\File::get(base_path('permissions.txt'))));\n\n return array_map('trim', array_merge($keys, $base_permissions));\n }", "public static function checkFilesAccessibilityByUser($arFilesIds, $userId)\n\t{\n\t\t$arAccessMap = array();\n\t\t$arFilesIds = array_unique($arFilesIds);\n\t\t$arMustBeCheckedFilesIds = $arFilesIds;\t// for preventing check again already checked file id\n\n\t\t// Admin and B24-admin can view any file\n\t\tif (\n\t\t\tCTasksTools::IsAdmin($userId)\n\t\t\t|| CTasksTools::IsPortalB24Admin($userId)\n\t\t)\n\t\t{\n\t\t\tforeach ($arFilesIds as $fileId)\n\t\t\t\t$arAccessMap['f' . $fileId] = true;\n\n\t\t\treturn ($arAccessMap);\n\t\t}\n\n\t\t// init access map to FALSE (access denied) by default\n\t\tforeach ($arFilesIds as $fileId)\n\t\t\t$arAccessMap['f' . $fileId] = false;\n\n\t\t// files that are temporary saved by user\n\t\t$arAccessibleFilesIds = self::getRegisteredTemporaryFilesList($userId);\n\n\t\t$arTmp = $arMustBeCheckedFilesIds;\n\t\tforeach ($arTmp as $key => $fileId)\n\t\t{\n\t\t\tif (in_array( (int) $fileId, $arAccessibleFilesIds, true))\n\t\t\t{\n\t\t\t\t$arAccessMap['f' . $fileId] = true;\n\t\t\t\tunset($arMustBeCheckedFilesIds[$key]);\n\t\t\t}\n\t\t}\n\n\t\t// user can access files, that are already attached to tasks, accessibly by user\n\t\t$arAccessibleFilesIds = self::getFilesAttachedInAccessibleTasks($userId, $arMustBeCheckedFilesIds);\n\n\t\t$arTmp = $arMustBeCheckedFilesIds;\n\t\tforeach ($arTmp as $key => $fileId)\n\t\t{\n\t\t\tif (in_array( (int) $fileId, $arAccessibleFilesIds, true))\n\t\t\t{\n\t\t\t\t$arAccessMap['f' . $fileId] = true;\n\t\t\t\tunset($arMustBeCheckedFilesIds[$key]);\n\t\t\t}\n\t\t}\n\n\t\t// check if file is in tasks' templates, that are accessible for this user\n\t\tif ( ! empty($arMustBeCheckedFilesIds) )\n\t\t{\n\t\t\t$arAccessibleFilesIds = self::getFilesAttachedInAccessibleTemplates($userId);\n\n\t\t\tforeach ($arMustBeCheckedFilesIds as $fileId)\n\t\t\t{\n\t\t\t\tif (in_array( (int) $fileId, $arAccessibleFilesIds, true))\n\t\t\t\t\t$arAccessMap['f' . $fileId] = true;\n\t\t\t}\n\t\t}\n\n\t\treturn ($arAccessMap);\n\t}", "private static function notAllowed() : array\n\t{\n\t\t$return = [];\n\n\t\t$aeSettings = \\MarkNotes\\Settings::getInstance();\n\n\t\t$return['count'] = 0;\n\t\t$return['status'] = 0;\n\t\t$return['message'] = $aeSettings->getText('not_authenticated');\n\n\t\t/*<!-- build:debug -->*/\n\t\tif ($aeSettings->getDebugMode()) {\n\t\t\t$return['debug'] = 'The show_login settings is set to ' .\n\t\t\t\t'1 and the user isn\\'t yet connected. In that case, ' .\n\t\t\t\t'the list of files should be keept hidden';\n\t\t}\n\t\t/*<!-- endbuild -->*/\n\n\t\treturn $return;\n\t}", "public function getPossiblePermissions();", "private function _getPermitedScripts ()\r\n {\r\n $sql = \"SELECT `link`, `pagini_derivate` FROM `admin_drepturi` AS `d` LEFT JOIN `admin_zone` AS `z` ON d.zone_id = z.id WHERE d.user_id = '{$this->_userId}'\" . ($this->_tip == \"powerUser\" ? \" UNION SELECT `link`, `pagini_derivate` FROM `admin_zone` WHERE `powerUserZone` = '1'\" : \"\");\r\n $result = mysql_query($sql, db_c());\r\n while ($row = mysql_fetch_assoc($result)) {\r\n array_push($this->_scriptAccess, $row['link']);\r\n foreach (explode(\",\", $row['pagini_derivate']) as $key => $page) {\r\n if ($page)\r\n array_push($this->_scriptAccess, $page);\r\n }\r\n }\r\n }", "public function provideCorrectModmanFileNames()\n {\n return array(\n array('correct', 1),\n array('ignoredlines', 2)\n );\n }", "public function rest_api_permission() {\n return apply_filters('h5p_rest_api_all_permission', current_user_can('edit_others_h5p_contents'));\n }", "public static function getFileAccessPermission($pageId,$moduleComponentId,$userId, $fileName) {\n\t\treturn getPermissions($userId, $pageId, \"view\");\n\t}", "private function isAllowed() {\n $allowed = array(\n \"rss\" => array(\"feed\"),\n \"torrent\" => array(\"download\"),\n \"user\" => array(\"login\", \"register\", \"confirm\", \"recover\", \"invite\")\n );\n if (!isset($allowed[$this->data['url']['application']]))\n return false;\n if (in_array($this->data['url']['action'], $allowed[$this->data['url']['application']]))\n return true;\n else\n return false;\n }", "public function getEvaluatePermissions() {}", "function rex_com_mediaaccess_ImageManager_checkPerm($filename, $ADDONSsic)\n{\n global $REX;\n \n if($filename)\n {\n ## get auth - isn't loaded yet\n $REX['ADDON']['community']['plugin_auth'] = $ADDONSsic['community']['plugin_auth'];\n require_once $REX[\"INCLUDE_PATH\"].\"/addons/community/plugins/auth/inc/auth.php\";\n \n $media = rex_com_mediaaccess::getMediaByFilename($filename);\n if(!$media->checkPerm())\n exit;\n }\n}", "protected function _isAllowed()\n {\n switch ($this->getRequest()->getActionName()) {\n case 'new':\n case 'save':\n return Mage::getSingleton('gri_cms/config')->canCurrentUserSaveVersion();\n break;\n case 'delete':\n return Mage::getSingleton('gri_cms/config')->canCurrentUserDeleteVersion();\n break;\n case 'massDeleteRevisions':\n return Mage::getSingleton('gri_cms/config')->canCurrentUserDeleteRevision();\n break;\n default:\n return Mage::getSingleton('admin/session')->isAllowed('cms/page');\n break;\n }\n }", "function show_file($relative_path, $student_class_path, array $required_exts) {\n $file_path = \"${student_class_path}/${relative_path}\";\n $file_code = \"<h1>$relative_path</h1>\\n\";\n if (in_array(strtolower(pathinfo($file_path, PATHINFO_EXTENSION)), $required_exts) and\n is_readable($file_path) and basename($relative_path) != \"pass.php\") {\n\n $contents = file_get_contents($file_path);\n $file_code .= \"<pre><code>\\n\";\n $file_code .= filter_var($contents, FILTER_SANITIZE_FULL_SPECIAL_CHARS);\n $file_code .= \"</code></pre>\\n\";\n } else\n $file_code .= \"<p class=\\\"error\\\">File is unreadable, has an invalid extension, or is a password file.</p>\";\n return $file_code;\n}", "public function view(User $user, File $file)\n {\n return Permission::anyoneCanAccess($file->id)\n || Permission::userCanAccess($user->id, $file->id);\n }", "public function ajax_user_can() {\r\n\t\treturn current_user_can('upload_files');\r\n\t}", "public function results()\n {\n if(!(php_sapi_name() == 'cli-server'))\n return 403;\n\n if($this->request->server['REMOTE_ADDR'] != '127.0.0.1' && $this->request->server['REMOTE_ADDR'] != '::1')\n return 403;\n\n $matcher = new SurveyMatcher();\n $matcher->match((isset($this->request->get['limit']) ? $this->request->get['limit'] : null));\n }", "function tquiz_get_file_info($browser, $areas, $course, $cm, $context, $filearea, $itemid, $filepath, $filename) {\n return null;\n}", "public function accessRules()\n {\n return array(\n array('allow', // allow readers only access to the view file\n 'actions' => array(''),\n 'users' => array('*')\n ),\n array('allow', // allow readers only access to the view file\n 'actions' => array(),\n 'roles' => array('client')\n ),\n array('deny', // deny everybody else\n 'users' => array('*')\n ),\n );\n }", "private function _isAllowed()\r\n {\r\n $req = $this->app->request();\r\n $resource = strtoupper($req->getMethod()) . $req->getResourceUri() ;\r\n return in_array($resource, $this->config['allowed_resources']);\r\n }", "public function get_expected_data()\n {\n //expect the submission of one or more files\n //return array('answer' => question_attempt::PARAM_FILES);\n return array('answer' => question_attempt::PARAM_FILES, 'answerraw' => PARAM_RAW, 'attemptid' => PARAM_INT);\n }", "public function accessRules(){// правила доступа к ресурсам контроллера\n $f=array();\n if(!Yii::app()->user->getState('sup')){\n $f=$this->ActionsForUser(__CLASS__);\n }\n return array(\n array('allow', // список разрешений\n 'actions'=>$f,\n 'users'=>array(Yii::app()->user->id),\n ),\n array('deny', // список запрещений\n 'users'=>array('*','$'),\n ),\n );\n }", "protected function _isAllowed()\n {\n return $this->_authorization->isAllowed('Codilar_Image360::image360_settings_edit');\n }", "function allowed() {\n $this->model('invitation');\n \n if ($_SESSION['user']->guest) {\n $sql = \"SELECT * FROM invitations WHERE id = {$_SESSION['user']->id}\";\n $invite = $this->invitation->one($sql);\n if (!$invite) {\n $this->message('Ungültige Einladung');\n unset($_SESSION['user']);\n $this->redirect('/');\n }\n \n if ($_SESSION['user']->object_type == 'topic') { \n if (count($this->path) < 3) {\n $this->message('FALSCHE URL');\n return FALSE;\n }\n $photo_id = $this->path[2];\n \n $sql = \"SELECT * FROM photos WHERE id = {$photo_id} LIMIT 1\";\n $photo = $this->photo->one($sql);\n if (!$photo) {\n $this->message('FALSCHE URL');\n return FALSE;\n }\n \n if ($photo->topic_id != $_SESSION['user']->object_id) {\n $this->message('Sie haben kein Zugriff auf diese Inhalte');\n return FALSE;\n }\n \n return TRUE;\n }\n }\n return parent::allowed();\n }", "function caldol_can_edit_file($authorID){\n\tglobal $current_user;\n\n\t\n\t//echo $current_user->ID. \", \" . $post->post_author;\n\tif($current_user->ID == $authorID || current_user_can('edit_others_posts')){\n\t\treturn true;\n\t}\n\treturn false;\n}", "public function checkAccess()\n {\n // need to be modified for security\n }", "public function authorize()\n {\n return true;//everybody can upload a file\n }", "private function checkAccess() {\n $this->permission('Garden.Import'); // This permission doesn't exist, so only users with Admin == '1' will succeed.\n \\Vanilla\\FeatureFlagHelper::ensureFeature(\n 'Import',\n t('Imports are not enabled.', 'Imports are not enabled. Set the config Feature.Import.Enabled = true to enable imports.')\n );\n }", "public function accessRules()\r\n\t{\r\n\t\t$rules = array(\r\n\t\t\tarray( 'allow', // allow authenticated user to...\r\n\t\t\t\t'actions' => array( 'index' ),\r\n\t\t\t\t'roles' => array('question')\r\n\t\t\t),\r\n\t\t\tarray('deny',\r\n\t\t\t\t'users'=>array('*')\r\n\t\t\t\t)\r\n\t\t);\r\n\t\treturn $rules;\r\n\t}", "public function canManageDirectorySnippets();", "function checkAccess() ;", "protected function _isAllowed()\n {\n\t$session = Mage::getSingleton('admin/session');\n return ($session->isAllowed('iqnomy') || $session->isAllowed('system/iqnomy'));\n }", "public function checkAccess() {}", "public function checkAccess() {}", "public function checkAccess() {}", "public function checkPermissions() {\r\n\t\treturn $this->modx->hasPermission('edit_document');\r\n\t}", "public function accessRules()\n {\n return array(\n array('deny', \n 'actions' => array('upload'),\n 'users' => array('?'),\n ),\n array('allow', \n 'users' => array('*'),\n ),\n );\n }", "public function checkAccess() {}", "public function checkAccess() {}", "public function checkAccess() {}", "public function checkAccess() {}", "public function checkAccess() {}", "private function checkReadable() {\n\t\tif ( !$this->isReadable() ) {\n\t\t\tthrow new Exception(\n\t\t\t\t\"Current user doesn't have permissions to view this pathway\"\n\t\t\t);\n\t\t}\n\t}", "public function setDefaultPermissions()\n {\n $this->allow('guest', 'default_error');\n $this->allow('guest', 'default_uploader');\n $this->allow('guest', 'default_lang');\n $this->allow('guest', 'people_auth');\n $this->allow('guest', 'api_auth');\n $this->allow('guest', 'api_search');\n $this->allow('guest', 'api_company');\n $this->allow('guest', 'api_entidad');\n $this->allow('guest', 'frontend_index');\n $this->allow('guest', 'frontend_auth');\n $this->allow('guest', 'frontend_account');\n $this->allow('guest', 'frontend_auction');\n $this->allow('guest', 'frontend_search');\n $this->allow('guest', 'frontend_product');\n $this->allow('guest', 'frontend_page');\n /**\n * User Access Level Permissions\n */\n $this->allow('user', 'default_index');\n $this->allow('user', 'default_error');\n $this->allow('user', 'default_uploader');\n $this->allow('user', 'default_lang');\n $this->allow('user', 'people_auth');\n $this->allow('user', 'search_index');\n $this->allow('user', 'frontend_search');\n $this->allow('user', 'frontend_product');\n $this->allow('user', 'frontend_page');\n $this->allow('user', 'people_user', array(\n 'my', // View My Details Page\n 'view', // View User Details Page\n 'changepassword', // Change Password Page\n 'updateavatar', // Update Avatar Lightbox\n 'getavatar', // Get Avatar JSON Call\n 'get-addr-avatar','setavatar', // Set Avatar JSON Call\n 'removeavatar' // Remove Avatar JSON Call\n ));\n\n /* $this->allow('user', 'company_manage', array(\n 'index', // Company List Page\n 'view' // Company View Page\n ));*/\n }", "function forum_check_text_access($path, $itemtype, $this_id, $user, $group_id, $context_id){\n global $CFG, $USER;\n \n include_once(\"{$CFG->dirroot}/{$path}/lib.php\");\n\n // get the forum post and all related stuff\n $post = get_record('forum_posts', 'id', $this_id);\n $discussion = get_record('forum_discussions', 'id', $post->discussion);\n $context = get_record('context', 'id', $context_id);\n $cm = get_record('course_modules', 'id', $context->instanceid);\n // $cm = get_coursemodule_from_instance('forum', $discussion->forum, $discussion->course);\n // $context = get_context_instance(CONTEXT_MODULE, $cm->id);\n if (!$cm->visible and !has_capability('moodle/course:viewhiddenactivities', $context)){\n if (!empty($CFG->search_access_debug)) echo \"search reject : hidden forum resource \";\n return false;\n }\n \n // approval check : entries should be approved for being viewed, or belongs to the user \n if (($post->userid != $USER->id) && !$post->mailed && !has_capability('mod/forum:viewhiddentimeposts', $context)){\n if (!empty($CFG->search_access_debug)) echo \"search reject : time hidden forum item\";\n return false;\n }\n\n // group check : entries should be in accessible groups\n $current_group = get_current_group($discussion->course);\n $course = get_record('course', 'id', $discussion->course);\n if ($group_id >= 0 && (groupmode($course, $cm) == SEPARATEGROUPS) && ($group_id != $current_group) && !has_capability('mod/forum:viewdiscussionsfromallgroups', $context)){\n if (!empty($CFG->search_access_debug)) echo \"search reject : separated grouped forum item\";\n return false;\n }\n \n return true;\n}", "function can_use_attachments($user, $powlreq = ATTACH_REQ_DEFAULT) {\n\tglobal $config;\n\treturn !(\n\t\t !$config['allow-attachments'] // Config disable\n\t\t|| $user['uploads_locked'] // Per-user config\n\t\t|| $user['powerlevel'] < $powlreq // Not enough for forum\n\t\t|| $powlreq == ATTACH_REQ_DISABLED // Disabled for forum\n\t);\n}", "public function GetPermissionToSeeAssignments () {\n \treturn \n \t(\n \t\t$this->user_type == $this->user_types[0]\n \t\t|| $this->user_type == $this->user_types[1]\n\t\t\t|| $this->user_type == $this->user_types[2]\n\t\t);\n }", "public function authorize()\n {\n // dd($this->route('file')->name_id);\n return $this->auth->check();\n // return $this->route('file')->name_id === $this->auth->user()->id;\n }", "public function getFileOperationPermissions() {}", "protected function getEditorPermissions() {\n // Every entity-type-specific test needs to define these.\n return [];\n }", "function check_permission($moduleName = '', $scope = 'both') {\n\tif (!defined('NO_ACCESS')) {\n\t\tdie('No access to files!');\n\t}\n \n if ($scope == 'both' || $scope == 'module') {\n if (Cms::$modules[$moduleName] != 1) {\n die('This module is disabled!');\n }\n }\n \n if ($scope == 'both' || $scope == 'user') {\n if ($_SESSION[USER_CODE]['privilege'][$moduleName] != 1) {\n die('No permission at this level!');\n }\n }\n}", "protected function _isAllowed()\n {\n return $this->_authorization->isAllowed(\\Eadesigndev\\Pdfgenerator\\Controller\\Adminhtml\\Templates::ADMIN_RESOURCE_VIEW);\n }", "public function getFilesAgentPermissionSet() {\n return @$this->attributes['files_agent_permission_set'];\n }", "public function getPermissionOptions()\n {\n return [\n 'read' => 'View changes of all content',\n ];\n }", "function checkActionPermission($action, $fileId = NULL, $folderId = NULL) {\n switch ($action) {\n case 'edit_folder':\n if ($this->authUser->hasPerm(PapayaAdministrationPermissions::FILE_FOLDER_MANAGE) &&\n NULL !== $folderId &&\n ($folderPermissions = $this->calculateFolderPermissions($folderId))) {\n return $this->checkActionPermissionGroup($folderPermissions['user_edit']);\n }\n break;\n case 'upload_file':\n if ($this->authUser->hasPerm(PapayaAdministrationPermissions::FILE_UPLOAD) &&\n NULL !== $folderId &&\n ($folderPermissions = $this->calculateFolderPermissions($folderId))) {\n return $this->checkActionPermissionGroup($folderPermissions['user_edit']);\n }\n break;\n case 'edit_file':\n if ($this->authUser->hasPerm(PapayaAdministrationPermissions::FILE_EDIT)) {\n if (!is_array($fileId) && ($folderPermissions = $this->calculateFilePermission($fileId))) {\n if (isset($folderPermissions['user_edit'])) {\n foreach ($this->authUser->user['groups'] as $groupId) {\n if (isset($folderPermissions['user_edit'][$groupId]) &&\n $folderPermissions['user_edit'][$groupId]) {\n return TRUE;\n }\n }\n return FALSE;\n }\n } elseif (is_array($fileId)) {\n $allowed = array();\n if ($folderPermissions = $this->calculateFilePermission($fileId)) {\n $files = $this->getFilesById($fileId);\n $allowed = array();\n foreach ($files as $fileId => $file) {\n $checked = $this->checkActionPermissionGroup(\n $folderPermissions[$file['folder_id']]['user_edit']\n );\n if ($checked) {\n $allowed[$fileId] = $fileId;\n }\n }\n }\n return $allowed;\n } elseif (NULL !== $folderId &&\n ($folderPermissions = $this->calculateFolderPermissions($folderId))) {\n return (\n $this->authUser->hasPerm(PapayaAdministrationPermissions::FILE_EDIT) &&\n $this->checkActionPermissionGroup($folderPermissions['user_edit'])\n );\n }\n }\n break;\n case 'delete_file':\n if ($this->authUser->hasPerm(PapayaAdministrationPermissions::FILE_DELETE)) {\n if (!is_array($fileId) && ($folderPermissions = $this->calculateFilePermission($fileId))) {\n return $this->checkActionPermissionGroup($folderPermissions['user_edit']);\n } elseif (is_array($fileId)) {\n if ($folderPermissions = $this->calculateFilePermission($fileId)) {\n $files = $this->getFilesById($fileId);\n $allowed = array();\n foreach ($files as $fileId => $file) {\n $check = $this->checkActionPermissionGroup(\n $folderPermissions[$file['folder_id']]['user_edit']\n );\n if ($check) {\n $allowed[$fileId] = $fileId;\n }\n }\n }\n return $allowed;\n } elseif (is_array($fileId) &&\n ($folderPermissions = $this->calculateFilePermissions($fileId))) {\n return $this->checkActionPermissionGroup($folderPermissions['user_edit']);\n }\n }\n break;\n case 'view_file':\n if (!is_array($fileId) && ($folderPermissions = $this->calculateFilePermission($fileId))) {\n return $this->checkActionPermissionGroup($folderPermissions['user_view']);\n }\n break;\n default:\n return FALSE;\n break;\n }\n }", "static function access(){\n return onapp_has_permission(array('hypervisors', 'hypervisors.read'));\n }", "public function isFileOperationAllowed() {}", "function custom_permissions() {\n\t\tif ($this->dx_auth->is_logged_in()) {\n\t\t\techo 'My role: '.$this->dx_auth->get_role_name().'<br/>';\n\t\t\techo 'My permission: <br/>';\n\t\t\t\n\t\t\tif ($this->dx_auth->get_permission_value('edit') != NULL AND $this->dx_auth->get_permission_value('edit')) {\n\t\t\t\techo 'Edit is allowed';\n\t\t\t} else {\n\t\t\t\techo 'Edit is not allowed';\n\t\t\t}\n\t\t\t\n\t\t\techo '<br/>';\n\t\t\t\n\t\t\tif ($this->dx_auth->get_permission_value('delete') != NULL AND $this->dx_auth->get_permission_value('delete')) {\n\t\t\t\techo 'Delete is allowed';\n\t\t\t} else {\n\t\t\t\techo 'Delete is not allowed';\n\t\t\t}\n\t\t}\n\t}", "function readQuestions($filename) {\n\t$displayQuestions = array();\n\t\n\tif (file_exists($filename) && is_readable($filename)) {\n\t\t$questions = file($filename);\n\t\n\t\t// Loop through each line and explode it into question and choices\n\t\tforeach ($questions as $key => $value) {\n\t\t\t$displayQuestions[] = explode(\":\",$value);\n\t\t}\t\t\t\t\n\t}\n\telse { echo \"Error finding or reading questions file.\"; }\n\t\n\treturn $displayQuestions;\n}", "public static function impliedPermissions() {\n return [\n self::PERMISSION_READ => [self::PERMISSION_WRITE, self::PERMISSION_ADMIN],\n self::PERMISSION_WRITE => [self::PERMISSION_ADMIN],\n ];\n }", "public function permissions();", "public function permissions();", "public function permissions();", "public function permissions();", "public function permissions();", "function isAllowedFile($file) {\n\t\t$path = pathinfo($file);\n\t\t$dir = preg_replace('#[\\./]*(.*)/*#', '$1', $path['dirname']);\n\t\t$file = $path['basename'];\n\t\tif ($dir == '' && $file == '.htaccess') return true;\n\t\tif ($dir == '' && $file == 'index.php') return true;\n\t\tif ($dir == '' && $file == 'documentation.txt') return true;\n\t\tif ($dir == 'data' && $file == 'hypha.html') return true;\n\t\tif ($dir == 'data' && $file == 'hypha.css') return true;\n\t\tif ($dir == 'system/core') return true;\n\t\tif ($dir == 'system/datatypes') return true;\n\t\tif ($dir == 'system/languages') return true;\n\t\tif ($dir == 'system/php-dom-wrapper') return true;\n\t\tif ($dir == 'system/wymeditor') return true;\n\t\treturn false;\n\t}", "function _scholar_polls_user_default_permissions() {\n $permissions = array();\n\n // Exported permission: create poll content\n $permissions[] = array(\n 'name' => 'create poll content',\n 'roles' => array(\n '0' => 'scholar admin',\n ),\n );\n\n // Exported permission: delete own poll content\n $permissions[] = array(\n 'name' => 'delete own poll content',\n 'roles' => array(\n '0' => 'scholar admin',\n ),\n );\n\n // Exported permission: edit own poll content\n $permissions[] = array(\n 'name' => 'edit own poll content',\n 'roles' => array(\n '0' => 'scholar admin',\n ),\n );\n\n // Exported permission: override poll promote to front page option\n $permissions[] = array(\n 'name' => 'override poll promote to front page option',\n 'roles' => array(\n '0' => 'scholar admin',\n ),\n );\n\n // Exported permission: override poll published option\n $permissions[] = array(\n 'name' => 'override poll published option',\n 'roles' => array(\n '0' => 'scholar admin',\n ),\n );\n\n // Exported permission: override poll revision option\n $permissions[] = array(\n 'name' => 'override poll revision option',\n 'roles' => array(),\n );\n\n // Exported permission: override poll sticky option\n $permissions[] = array(\n 'name' => 'override poll sticky option',\n 'roles' => array(\n '0' => 'scholar admin',\n ),\n );\n\n // Exported permission: vote on polls\n $permissions[] = array(\n 'name' => 'vote on polls',\n 'roles' => array(\n '0' => 'anonymous user',\n '1' => 'authenticated user',\n ),\n );\n\n return $permissions;\n}", "protected function _isAllowed()\n {\n return $this->_authorization->isAllowed('MagicToolbox_MagicZoomPlus::magiczoomplus_settings_edit');\n }", "protected function _isAllowed()\n {\n \treturn true;\n }", "function getAllAccess() {\n return ['download', 'remoteAccess', 'remoteService', 'enclave','notAvailable'];\n}", "public function getPermission(){\n\t\tif (Yii::$app->getUserOpt->Modul_akses('11')){\n\t\t\treturn Yii::$app->getUserOpt->Modul_akses('11');\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "function show_deny() {\n\t\t\tshow_error(\n\t\t\t\t'403 Forbidden',\n\t\t\t\t'You do not have sufficient clearance to view this page.'\n\t\t\t);\n\t\t}", "protected function _checkPermission($options = array())\n {\n $viewer = MooCore::getInstance()->getViewer();\n if (!empty($viewer) && $viewer['Role']['is_admin']) {\n return true;\n }\n\n $cuser = $this->_getUser();\n $authorized = true;\n $hash = '';\n $return_url = '?redirect_url=' . base64_encode(FULL_BASE_URL.$this->request->here);\n\n //check normal subscription\n $this->options = $options;\n //$this->getEventManager()->dispatch(new CakeEvent('AppController.validNormalSubscription', $this));\n\n // check aco\n $check_aco = false;\n if (!empty($options['aco'])) {\n $acos = $this->_getUserRoleParams();\n\n if (!in_array($options['aco'], $acos)) {\n $authorized = false;\n $check_aco = true;\n $msg = __('Access denied');\n }\n } else if (!empty($options['user_block'])) {\n \tif ($cuser && !$cuser['Role']['is_admin'] && !$cuser['Role']['is_super'])\n \t{ \t\n\t $user_blocks = $this->getBlockedUsers($cuser['id']); \n\t if (in_array($options['user_block'], $user_blocks)) {\n\t $authorized = false;\n\t $msg = __('Access denied');\n\t $return_url = '';\n\t }\n \t}\n } else {\n // check login\n if (!$cuser) {\n $authorized = false;\n $msg = __('Please login or register');\n } else {\n // check role\n if (!empty($options['roles']) && !in_array($cuser['role_id'], $options['roles'])) {\n $authorized = false;\n $msg = __('Access denied');\n }\n\n // check admin\n if (!empty($options['admin']) && !$cuser['Role']['is_admin']) {\n $authorized = false;\n $msg = __('Access denied');\n }\n\n // check super admin\n if (!empty($options['super_admin']) && !$cuser['Role']['is_super']) {\n $authorized = false;\n $msg = __('Access denied');\n }\n\n\n // check approval\n if (Configure::read('core.approve_users') && !$cuser['approved']) {\n $authorized = false;\n $msg = __('Your account is pending approval.');\n }\n\n // check confirmation\n if (Configure::read('core.email_validation') && !empty($options['confirm']) && !$cuser['confirmed']) {\n $authorized = false;\n $msg = __('You have not confirmed your email address! Check your email (including junk folder) and click on the validation link to validate your email address');\n }\n\n // check owner\n if (!empty($options['admins']) && !in_array($cuser['id'],\n $options['admins']) && !$cuser['Role']['is_admin']\n ) {\n $authorized = false;\n $msg = __('Access denied');\n }\n \n //event check permission\n if ($authorized)\n {\n \t$msg = '';\n \t$cakeEvent = new CakeEvent('Controller.App.checkPermission', $this,array(\n \t\t\t'authorized' => &$authorized,\n \t\t\t'msg' => &$msg,\n \t\t\t'options' => $options\n \t));\n\t $this->getEventManager()->dispatch($cakeEvent);\n }\n }\n }\n\n if (!$authorized && empty($options['no_redirect'])) {\n if (empty($this->layout)) { \n $this->autoRender = false;\n echo $msg;\n } else {\n if ($this->request->is('ajax')) {\n $this->set(compact('msg'));\n if (!$check_aco)\n {\n echo $this->render('/Elements/error');\n }\n else\n {\n \techo $this->render('/Elements/error-role');\n }\n\n } else {\n \tif (!$check_aco)\n \t{\n if (!empty($msg)) {\n $this->Session->setFlash($msg, 'default', array('class' => 'error-message'));\n }\n\n $this->redirect('/pages/no-permission' . $return_url);\n }\n \telse\n \t{\n \t\t$this->redirect('/pages/no-permission-role' . $return_url);\n \t}\n }\n }\n exit;\n }\n }", "public function get_permissions()\n\t{\n\t\treturn $this->area->get_permissions($this->path);\n\t}", "function module_filesandrelatedlicences($DB, $course_mod, $allowed_fileareas=array('content')){\n\n //If decided to get only the default: just get the first record: change to get_record()\n $course_module_files = $DB->get_records('files', array('contextid' =>$course_mod->course_module_context->id));\n\n $course_mod->course_module_files=new stdClass();\n $course_mod->course_module_file_licences= new stdClass();\n foreach ($course_module_files as $key => $value) {\n\n if( in_array($value->filearea, $allowed_fileareas) ){\n\n if($value->author!=\"\" and $value->license!=\"\" and $value->author!=\"null\" and $value->license!=\"null\" and $value->author!=null and $value->license!=null){\n\n $course_mod->course_module_files[\"$value->id\"]=$value;\n $course_mod->course_module_file_licences[\"$value->id\"]= $DB->get_record('license', array('shortname' =>$value->license));\n }\n\n }\n }\n\n\n return $course_mod;\n // Treatment of \"file/licence\" object is needed to be reverified\n }", "public function hasSecretQuestion()\n {\n return Mage::getResourceModel('twofactorauth/user_question')->hasQuestions($this->getUser());\n }", "function isUsersAccessable($path)\n\t{\n\t\t$AllArray =array('user/index',\n\t\t\t\t\t\t'user/listing',\n\t\t\t\t\t\t'user/add',\n\t\t\t\t\t\t'user/edit',\n\t\t\t\t\t\t'project/index',\n\t\t\t\t\t\t'project/listing',\n\t\t\t\t\t\t'project/add',\n\t\t\t\t\t\t'project/edit',\n\t\t\t\t\t\t'customer/index',\n\t\t\t\t\t\t'customer/listing',\n\t\t\t\t\t\t'customer/add',\n\t\t\t\t\t\t'customer/edit',\n\t\t\t\t\t\t'question/index',\n\t\t\t\t\t\t'question/listing',\n\t\t\t\t\t\t'question/add',\n\t\t\t\t\t\t'question/edit',\n\t\t\t\t\t\t'customer/index',\n\t\t\t\t\t\t'customer/listing',\n\t\t\t\t\t\t'customer/edit',\n\t\t\t\t\t\t'customer/surveys',\n\t\t\t\t\t\t'customer/survey',\n\t\t\t\t\t\t'question/index',\n\t\t\t\t\t\t'question/listing',\n\t\t\t\t\t\t'question/edit',\n\t\t\t\t\t\t'results/index',\n\t\t\t\t\t\t'results/listing',\n\t\t\t\t\t\t'results/general',\n\t\t\t\t\t\t'results/single',\n\t\t\t\t\t\t'generador/index',\n\t\t\t\t\t\t'generador/publish'\n\t\t\t\t\t\t);\n\t\t$customerArray =array(\n\t\t\t\t\t\t'customer/index',\n\t\t\t\t\t\t'customer/listing',\n\t\t\t\t\t\t'customer/edit',\n\t\t\t\t\t\t'customer/surveys',\n\t\t\t\t\t\t'customer/survey',\n\t\t\t\t\t\t'question/index',\n\t\t\t\t\t\t'question/listing',\n\t\t\t\t\t\t'question/edit',\n\t\t\t\t\t\t'results/index',\n\t\t\t\t\t\t'results/listing',\n\t\t\t\t\t\t'results/general',\n\t\t\t\t\t\t'results/single',\n\t\t\t\t\t\t'generador/index',\n\t\t\t\t\t\t'generador/publish'\n\t\t\t\t\t\t);\n\t\t\n\t\tif($_SESSION[\"SESS_USER_ROLE\"] == \"administrador\")\n\t\t{\n// \t\t\tif(!in_array($path,$AllArray))\n// \t\t\t{\n// \t\t\t\t$this->wtRedirect($_SESSION[\"ROLE_PATH\"]); \n// \t\t\t}\n\t\t}\n\t\t\n\t\telseif($_SESSION[\"SESS_USER_ROLE\"] == \"cliente\" )\n\t\t{\n\t\t\t//SI no esta en el arreglo, se redirecciona a su path original Controller home\n\t\t\tif(!in_array($path,$customerArray))\n\t\t\t{\n\t\t\t\t$this->wtRedirect($_SESSION[\"ROLE_PATH\"]); \n\t\t\t}\n\t\t}\n\t}", "public function accessRules()\n {\n return array(\n array(\n 'allow',\n 'actions' => array('create'),\n 'roles' => array(Rbac::OP_QA_QUESTION_CREATE),\n ),\n array(\n 'deny',\n 'actions' => array('create'),\n ),\n array(\n 'allow',\n 'actions' => array('update'),\n 'roles' => array(Rbac::OP_QA_QUESTION_UPDATE),\n ),\n array(\n 'deny',\n 'actions' => array('update'),\n ),\n array(\n 'allow',\n 'actions' => array('saveAnswer'),\n 'roles' => array(Rbac::OP_QA_ANSWER_CREATE),\n ),\n array(\n 'deny',\n 'actions' => array('saveAnswer'),\n ),\n );\n }", "static function getPermission()\n {\n return [self::BULLETIN => 'article_createBulletin'];\n }", "function page_manager_poll_access_check($task, $subtask_id, $contexts) {\n return user_access('access content');\n}" ]
[ "0.5803744", "0.5613151", "0.55940515", "0.54765403", "0.5435721", "0.54322565", "0.540128", "0.5388911", "0.5387595", "0.5383634", "0.5341886", "0.53398246", "0.5332942", "0.5332756", "0.5323959", "0.53194624", "0.5305113", "0.529613", "0.5268818", "0.52316", "0.5228173", "0.5213548", "0.5205197", "0.5178946", "0.51753026", "0.51732683", "0.5172549", "0.51698166", "0.51546186", "0.51522225", "0.51495695", "0.5143977", "0.514053", "0.51274145", "0.511347", "0.51050097", "0.5090528", "0.5088824", "0.50799227", "0.50423867", "0.5041808", "0.5028344", "0.5025896", "0.5022568", "0.50191385", "0.50174236", "0.50155354", "0.50090134", "0.50060904", "0.5004375", "0.49983746", "0.49739063", "0.49676505", "0.49676505", "0.49676505", "0.49672136", "0.4967023", "0.4967001", "0.4967001", "0.49666315", "0.49666315", "0.49666315", "0.4956014", "0.4955335", "0.49511784", "0.4948769", "0.49480796", "0.4946654", "0.4939057", "0.49352604", "0.49291638", "0.4927794", "0.49217772", "0.4913546", "0.48994213", "0.48962328", "0.48936814", "0.48867783", "0.48861387", "0.4882488", "0.48785624", "0.48785624", "0.48785624", "0.48785624", "0.48785624", "0.48782226", "0.4872353", "0.48655334", "0.48610005", "0.4858477", "0.48532704", "0.48512366", "0.48317155", "0.4827348", "0.48258907", "0.4822821", "0.48190618", "0.4818505", "0.48121896", "0.48088273" ]
0.5213486
22
Inserts the varaibles for the given question text, then calls the basic formatter.
public function format_text($text, $format, $qa, $component, $filearea, $itemid) { //get a list of varaibles created by the initialization script $vars = json_decode($qa->get_last_qt_var('_vars')); $funcs = json_decode($qa->get_last_qt_var('_funcs')); $text = qtype_scripted_language_manager::format_text($text, $this->language, $vars, $funcs); //run the question text through the basic moodle formatting engine return parent::format_text($text, $format, $qa, $component, $filearea, $itemid); //Evaluate all of the question's inline code. $operations = array(2 => 'execute', 1=> 'evaluate'); foreach($operations as $bracket_level => $operation) { $interpreter = $this->create_interpreter($vars, $funcs); $text = $this->handle_inline_code($text, $bracket_level, $operation, $interpreter); } //run the question text through the basic moodle formatting engine return parent::format_text($text, $format, $qa, $component, $filearea, $itemid); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function formatQA( $question, $answer ) {\n return \"> {$question}\\n{$answer}\";\n}", "function _insert( $text ) {\n $parts = explode(\":\", $text);\n $index = strtolower(trim($parts[0]));\n if( count($parts) == 1 ) {\n // {varname} - inserts value of varname\n return $this->_getVar($index);\n } \n else {\n switch($index) {\n case \"zen\":\n\t{\n\t // {zen:varname}\n\t $zen = &$this->_getZenObject();\n\t $n = trim($parts[1]);\n\t return $zen->getSetting(\"$n\")? $zen->getSetting(\"$n\") : \"\";\n\t}\n\tbreak;\n case \"list\":\n\t{\n\t // {list:varname:\"text\"+index+\"more text\"+value}\n\t $vars = $this->_getVar(trim($parts[1]));\n\t if( is_array($vars) ) {\n\t $txt = \"\";\n\t // make the string to show\n\t $str = $this->_parseString($parts[2]);\n\t // loop the list and make output text\n\t foreach($vars as $k=>$v) {\n $fv = $this->_getVar(\"field_value\");\n $fl = $this->_getVar(\"field_label\");\n\t $tmp=$str;\n\t if($fv==$k && strlen($fv) == strlen($k) || is_array($fv) && in_array($k, $fv) || \n ( is_array($fl) && in_array($k, $fl) ) ||\n (!is_array($fv) && !strlen($k) && !strlen($fv))) {\n\t $tmp = str_replace(\"{selected}\", \" selected\", $tmp);\n\t $tmp = str_replace(\"{checked}\", \" checked\", $tmp);\n\t } else {\n\t $tmp = str_replace(\"{selected}\", \"\", $tmp);\n\t $tmp = str_replace(\"{checked}\", \"\", $tmp);\n\t }\n\t $tmp = str_replace(\"{index}\", $k, $tmp);\n\t $txt .= str_replace(\"{value}\", $v, $tmp);\n\t }\n\t return $txt;\n\t }\n\t else {\n\t return \"\";\n\t }\n\t}\n\tbreak;\n case \"foreach\":\n\t{\n\t // {foreach:varname:\"text\"+value+\"text\"}\n\t $vars = $this->_getVar(trim($parts[1]));\n\t if( is_array($vars) ) {\n $sel = $this->_getVar(\"field_selected\");\n\t $txt = \"\";\n\t // parse the string\n\t $str = $this->_parseString($parts[2]);\n\t // create the output text\n\t foreach($vars as $v) {\n $selected = $sel && $sel == $v && strlen($sel) == strlen($v)? ' selected' : '';\n $s = str_replace(\"{selected}\", $selected, $str);\n\t $txt .= str_replace(\"{value}\", $v, $s);\n\t }\n\t return $txt;\n\t }\n\t else {\n\t return \"\";\n\t }\n\t}\n\tbreak;\n case \"include\":\n\t{\n\t // {include:template_name}\n\t $tmp = new zenTemplate(trim($parts[1]));\n\t $tmp->values( $this->_vars );\n\t return $tmp->process();\n\t}\n\tbreak;\n case \"if\":\n\t{\n\t // {if:field:\"text to print\"+field+\"text to print\"}\n\t // {if:field=something:\"text to print\"+field+\"more text\"}\n\t $p = trim($parts[1]);\n\t // determine if the if condition is true\n\t if( strpos($p,\"=\") > 0 ) {\n\t // there is an equals clause\n\t list($key,$val) = explode(\"=\",$parts[1]);\n\t $key = trim($key);\n\t $val = trim($val);\n\t $tf = ($this->_getVar($key) == $val);\n\t }\n\t else {\n\t $var = $this->_getVar($p);\n\t $tf = ( (is_array($var) && count($var)) || (strlen($var) > 0) );\n\t }\n\t // execute the query if we met if condition\n\t if( $tf ) {\n\t return $this->_parseString($parts[2]);\n\t }\n\t else {\n\t return \"\";\n\t }\n\t}\n\tbreak;\n }\n }\n // return something generic if we fall through\n return \"{invalid tag: $index}\";\n }", "private function question()\n\t{\n\t\t$this->qns['questionnaire']['questionnairecategories_id'] = $this->allinputs['questioncat'];\n\t\t$this->qns['questionnaire']['questionnairesubcategories_id'] = $this->allinputs['questionsubcat'];\n\t\t$this->qns['questionnaire']['label'] = $this->allinputs['question_label'];\n\n\n\t\t$this->qns['questionnaire']['question'] = $this->allinputs['question'];\n\t\t$this->qns['questionnaire']['has_sub_question'] = $this->allinputs['subquestion'];\n\n\t\tif( $this->qns['questionnaire']['has_sub_question'] == 0 )\n\t\t{\n\t\t\t$this->qns['answers']['answer_type'] = $this->allinputs['optiontype'];\n\t\t}\n\n\t\t$this->qns['questionnaire']['active'] = 1;\n\n\t\tif( $this->qns['questionnaire']['has_sub_question'] == 0 ){\n\t\t\t//This code must be skipped if sub_question is 1\n\t\t\t$optionCounter = 0;\n\t\t\tforeach ($this->allinputs as $key => $value) {\n\n\t\t\t\tif( str_is('option_*', $key) ){\n\t\t\t\t\t$optionCounter++;\n\t\t\t\t\t$this->qns['answers'][$optionCounter] = ( $this->qns['answers']['answer_type'] == 'opentext' ) ? 'Offered answer text' : $value;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function writequestion( $question ) {\n\t // question reflects database fields for general question and specific to type\n\t\n\t // initial string;\n\t $expout = \"\";\n\t\n\t // add comment\n\t $expout .= \"// question: $question->id \\n\";\n\n\t if ($question->id_category != \"\"){\n\t $expout .= \"\\$CATEGORY:$question->id_category\\n\";\n\t }\n\t\t\n\t // get question text format\n\t /*$textformat = $question->textformat;\n\t $question->text = \"\";\n\t if ($textformat!=FORMAT_MOODLE) {\n\t $question->text = text_format_name( (int)$textformat );\n\t $question->text = \"[$question->text]\";\n\t }*/\n\t $qtext_format = \"[\".$question->qtype.\"]\";\n\t // output depends on question type\n\t switch($question->qtype) {\n\t\t\tcase 'category' : {\n\t\t\t\t// not a real question, used to insert category switch\n\t\t\t\t$expout .= \"\\$CATEGORY: $question->category\\n\"; \n\t\t\t};break;\n\t\t\tcase 'title' : {\n\t\t\t\tif($question->prompt != '') $expout .= '::'.$this->repchar($question->prompt).'::';\n\t\t\t\t$expout .= $qtext_format;\n\t\t\t\t$expout .= $this->repchar( $question->quest_text);\n\t\t\t};break;\n\t\t case 'extended_text' : {\n\t\t $expout .= '::'.$this->repchar($question->prompt).'::';\n\t\t $expout .= $qtext_format;\n\t\t $expout .= $this->repchar( $question->quest_text);\n\t\t $expout .= \"{}\\n\";\n\t\t };break;\n\t\t case 'truefalse' : {/*\n\t\t $trueanswer = $question->options->answers[$question->options->trueanswer];\n\t\t $falseanswer = $question->options->answers[$question->options->falseanswer];\n\t\t if ($trueanswer->fraction == 1) {\n\t\t $answertext = 'TRUE';\n\t\t $right_feedback = $trueanswer->feedback;\n\t\t $wrong_feedback = $falseanswer->feedback;\n\t\t } else {\n\t\t $answertext = 'FALSE';\n\t\t $right_feedback = $falseanswer->feedback;\n\t\t $wrong_feedback = $trueanswer->feedback;\n\t\t }\n\t\t\n\t\t $wrong_feedback = $this->repchar($wrong_feedback);\n\t\t $right_feedback = $this->repchar($right_feedback);\n\t\t $expout .= \"::\".$this->repchar($question->prompt).\"::\".$qtext_format.$this->repchar( $question->quest_text ).\"{\".$this->repchar( $answertext );\n\t\t if ($wrong_feedback) {\n\t\t $expout .= \"#\" . $wrong_feedback;\n\t\t } else if ($right_feedback) {\n\t\t $expout .= \"#\";\n\t\t }\n\t\t if ($right_feedback) {\n\t\t $expout .= \"#\" . $right_feedback;\n\t\t }\n\t\t $expout .= \"}\\n\";*/\n\t\t }//;break;\n\t\t \n\t\t case 'shortanswer' : {/*\n\t\t $expout .= \"::\".$this->repchar($question->prompt).\"::\".$qtext_format.$this->repchar( $question->quest_text ).\"{\\n\";\n\t\t foreach($question->options->answers as $answer) {\n\t\t $weight = 100 * $answer->score_correct;\n\t\t $expout .= \"\\t=%\".$weight.\"%\".$this->repchar( $answer->text ).\"#\".$this->repchar( $answer->comment ).\"\\n\";\n\t\t }\n\t\t $expout .= \"}\\n\";*/\n\t\t }//;break;\n\t\t\tcase 'choice' : {\n\t\t\t\t$expout .= \"::\".$this->repchar($question->prompt).\"::\".$qtext_format.$this->repchar( $question->quest_text ).\"{\\n\";\n\t\t\t\t\n\t\t\t\tforeach($question->answers as $answer) {\n\t\t\t\t\tif (($answer->score_correct == 1) || ($answer->score_correct == 0 && $answer->is_correct == 1) ) {\n\t\t\t\t\t\t$answertext = '=';\n\t\t\t\t\t}\n\t\t\t\t\telseif ($answer->score_correct > 1) {\n\t\t\t\t\t\t$export_weight = $answer->score_correct*100;\n\t\t\t\t\t\t$answertext = \"=%$export_weight%\";\n\t\t\t\t\t}\n\t\t\t\t\telseif ($answer->score_correct==0) {\n\t\t\t\t\t\t$answertext = '~';\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t$export_weight = $answer->score_correct*100;\n\t\t\t\t\t\t$answertext = \"~%$export_weight%\";\n\t\t\t\t\t}\n\t\t\t\t\t$expout .= \"\\t\".$answertext.$this->repchar( $answer->text );\n\t\t\t\t\tif ($answer->comment!=\"\") {\n\t\t\t\t\t\t$expout .= \"#\".$this->repchar( $answer->comment );\n\t\t\t\t\t}\n\t\t\t\t\t$expout .= \"\\n\";\n\t\t\t\t}\n\t\t\t\t$expout .= \"}\\n\";\n\t\t\t};break;\n\t\t\tcase 'choice_multiple' : {\n\t\t\t\t$expout .= \"::\".$this->repchar($question->prompt).\"::\".$qtext_format.$this->repchar( $question->quest_text ).\"{\\n\";\n\t\t\t\t\n\t\t\t\tforeach($question->answers as $answer) {\n\t\t\t\t\tif ($answer->score_correct==1) {\n\t\t\t\t\t\t$answertext = '=';\n\t\t\t\t\t}\n\t\t\t\t\telseif ($answer->score_correct==0) {\n\t\t\t\t\t\t$answertext = '~';\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t$export_weight = $answer->score_correct*100;\n\t\t\t\t\t\t$answertext = \"~%$export_weight%\";\n\t\t\t\t\t}\n\t\t\t\t\t$expout .= \"\\t\".$answertext.$this->repchar( $answer->text );\n\t\t\t\t\tif ($answer->comment!=\"\") {\n\t\t\t\t\t\t$expout .= \"#\".$this->repchar( $answer->comment );\n\t\t\t\t\t}\n\t\t\t\t\t$expout .= \"\\n\";\n\t\t\t\t}\n\t\t\t\t$expout .= \"}\\n\";\n\t\t\t};break;\n\t\t case 'associate' : {\n\t\t\t\t$expout .= \"::\".$this->repchar($question->prompt).\"::\".$qtext_format.$this->repchar( $question->quest_text ).\"{\\n\";\n\t\t\t\tforeach($question->answers as $i => $subquestion) {\n\t\t\t\t\t$expout .= \"\\t=\".$this->repchar( $subquestion->text ).\" -> \".$this->repchar( $question->extra_info[$i]->text ).\"\\n\";\n\t\t\t\t}\n\t\t\t\t$expout .= \"}\\n\";\n\t\t };break;\n\t\t case NUMERICAL:\n\t\t $expout .= \"::\".$this->repchar($question->prompt).\"::\".$qtext_format.$this->repchar( $question->quest_text ).\"{#\\n\";\n\t\t foreach ($question->options->answers as $answer) {\n\t\t if ($answer->text != '') {\n\t\t $percentage = '';\n\t\t if ($answer->score_correct < 1) {\n\t\t $pval = $answer->score_correct * 100;\n\t\t $percentage = \"%$pval%\";\n\t\t }\n\t\t $expout .= \"\\t=$percentage\".$answer->text.\":\".(float)$answer->tolerance.\"#\".$this->repchar( $answer->comment ).\"\\n\";\n\t\t } else {\n\t\t $expout .= \"\\t~#\".$this->repchar( $answer->comment ).\"\\n\";\n\t\t }\n\t\t }\n\t\t $expout .= \"}\\n\";\n\t\t break;\n\t\t case DESCRIPTION:\n\t\t $expout .= \"// DESCRIPTION type is not supported\\n\";\n\t\t break;\n\t\t case MULTIANSWER:\n\t\t $expout .= \"// CLOZE type is not supported\\n\";\n\t\t break;\n\t\t default:\n\t\t \n\t\t\t\treturn false;\n\t\t}\n\t // add empty line to delimit questions\n\t $expout .= \"\\n\";\n\t return $expout;\n\t}", "function printTFQuestionForm() {\n\tglobal $tool_content, $langTitle, $langSurveyStart, $langSurveyEnd, \n\t\t$langType, $langSurveyMC, $langSurveyFillText, \n\t\t$langQuestion, $langCreate, $langSurveyMoreQuestions, \n\t\t$langSurveyCreated, $MoreQuestions;\n\t\t\n\t\tif(isset($_POST['SurveyName'])) $SurveyName = htmlspecialchars($_POST['SurveyName']);\n\t\tif(isset($_POST['SurveyEnd'])) $SurveyEnd = htmlspecialchars($_POST['SurveyEnd']);\n\t\tif(isset($_POST['SurveyStart'])) $SurveyStart = htmlspecialchars($_POST['SurveyStart']);\n\t\t\n//\tif ($MoreQuestions == 2) {\n\tif ($MoreQuestions == $langCreate) {\n\t\tcreateTFSurvey();\n\t} else {\n\t\t$tool_content .= <<<cData\n\t\t<form action=\"addsurvey.php\" id=\"survey\" method=\"post\">\n\t\t<input type=\"hidden\" value=\"2\" name=\"UseCase\">\n\t\t<table>\n\t\t\t<tr><td>$langTitle</td><td colspan=\"2\"><input type=\"text\" size=\"50\" name=\"SurveyName\" value=\"$SurveyName\"></td></tr>\n\t\t\t<tr><td>$langSurveyStart</td><td colspan=\"2\"><input type=\"text\" size=\"20\" name=\"SurveyStart\" value=\"$SurveyStart\"></td></tr>\n\t\t\t<tr><td>$langSurveyEnd</td><td colspan=\"2\"><input type=\"text\" size=\"20\" name=\"SurveyEnd\" value=\"$SurveyEnd\"></td></tr>\ncData;\n\t\t$counter = 0;\n\t\tforeach (array_keys($_POST) as $key) {\n\t\t\t++$counter;\n\t\t $$key = $_POST[$key];\n\t\t if (($counter > 4 )&($counter < count($_POST)-1)) {\n\t\t\t\t$tool_content .= \"<tr><td>$langQuestion</td><td><input type='text' name='question{$counter}' value='${$key}'></td></tr>\"; \n\t\t\t}\n\t\t}\n\t\t\t\n\t\t$tool_content .= <<<cData\n\t\t\t<tr><td>$langQuestion</td><td><input type='text' name='question'></td></tr>\n\t\t\t<tr>\n\t\t\t <td>\n\t\t\t <input name=\"MoreQuestions\" type=\"submit\" value=\"$langSurveyMoreQuestions\" />\n\t\t </td>\n\t\t\t <td>\n\t\t\t <input name=\"MoreQuestions\" type=\"submit\" value=\"$langCreate\" />\n\t\t </td>\n\t\t\t</tr>\n\t\t</table>\n\t\t</form>\ncData;\n\t}\n}", "function formatQAs() {\n $QAs = func_get_args();\n $outputArr = array();\n foreach( $QAs as $QA ) {\n array_push( $outputArr, formatQA($QA[0], $QA[1]) );\n }\n // put a few line breaks between each set of question/answer\n return implode( QASeparator(), $outputArr );\n}", "function run()\n\t{\n\t\trequire_code('quiz');\n\n\t\t$questions=array();\n\n\t\t$text=post_param('text');\n\t\t$type=post_param('type');\n\n\t\t$_qs=explode(chr(10).chr(10),$text);\n\t\t$qs=array();\n\t\tforeach ($_qs as $q)\n\t\t{\n\t\t\t$q=trim($q);\n\t\t\tif ($q!='') $qs[]=$q;\n\t\t}\n\t\t$num_q=0;\n\n\t\t$qs2=array();\n\t\tforeach ($qs as $i=>$q)\n\t\t{\n\t\t\t$_as=explode(chr(10),$q);\n\t\t\t$as=array();\n\t\t\tforeach ($_as as $a)\n\t\t\t{\n\t\t\t\tif ($a!='') $as[]=$a;\n\t\t\t}\n\t\t\t$q=array_shift($as);\n\t\t\t$matches=array();\n\t\t\t//if (preg_match('#^(\\d+)\\)?(.*)#',$q,$matches)===false) continue;\n\t\t\tif (preg_match('#^(.*)#',$q,$matches)===false) continue;\n\t\t\tif (count($matches)==0) continue;\n\n\t\t\t$implicit_question_number=$i;//$matches[1];\n\n\t\t\t$qs2[$implicit_question_number]=$q.chr(10).implode(chr(10),$as);\n\t\t}\n\t\tksort($qs2);\n\n\t\tforeach (array_values($qs2) as $i=>$q)\n\t\t{\n\t\t\t$_as=explode(chr(10),$q);\n\t\t\t$as=array();\n\t\t\tforeach ($_as as $a)\n\t\t\t{\n\t\t\t\tif ($a!='') $as[]=$a;\n\t\t\t}\n\t\t\t$q=array_shift($as);\n\t\t\t$matches=array();\n\t\t\t//if (preg_match('#^(\\d+)\\)?(.*)#',$q,$matches)===false) continue;\n\t\t\tif (preg_match('#^(.*)#',$q,$matches)===false) continue;\n\t\t\tif (count($matches)==0) continue;\n\t\t\t$question=trim($matches[count($matches)-1]);\n\t\t\t$long_input_field=(strpos($question,' [LONG]')!==false)?1:0;\n\t\t\t$question=str_replace(' [LONG]','',$question);\n\t\t\t$num_choosable_answers=(strpos($question,' [*]')!==false)?count($as):((count($as)>0)?1:0);\n\t\t\t$question=str_replace(' [*]','',$question);\n\t\t\t$required=(strpos($question,' [REQUIRED]')!==false)?1:0;\n\t\t\t$question=str_replace(' [REQUIRED]','',$question);\n\n\t\t\t// Now we add the answers\n\t\t\t$answers=array();\n\t\t\tforeach ($as as $x=>$a)\n\t\t\t{\n\t\t\t\t$is_correct=((($x==0) && (strpos($qs2[$i],' [*]')===false) && ($type!='SURVEY')) || (strpos($a,' [*]')!==false))?1:0;\n\t\t\t\t$a=str_replace(' [*]','',$a);\n\n\t\t\t\tif (substr($a,0,1)==':') continue;\n\n\t\t\t\t$answers[]=array(\n\t\t\t\t\t'id'=>$x,\n\t\t\t\t\t'q_answer_text'=>$a,\n\t\t\t\t\t'q_is_correct'=>$is_correct,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t$questions[]=array(\n\t\t\t\t'id'=>$i,\n\t\t\t\t'q_long_input_field'=>$long_input_field,\n\t\t\t\t'q_num_choosable_answers'=>$num_choosable_answers,\n\t\t\t\t'q_question_text'=>$question,\n\t\t\t\t'answers'=>$answers,\n\t\t\t\t'q_required'=>$required,\n\t\t\t);\n\n\t\t\t$num_q++;\n\t\t}\n\n\t\t$preview=render_quiz($questions);\n\n\t\treturn array(do_template('FORM',array('SUBMIT_NAME'=>'','TEXT'=>'','URL'=>'','HIDDEN'=>'','FIELDS'=>$preview)),NULL);\n\t}", "function render_text_question($label, $input, $additionaltext=\"\", $numeric=false, $extra=\"\", $current=\"\")\n {\n\t?>\n\t<div class=\"Question\" id = \"pixelwidth\">\n\t\t<label><?php echo $label; ?></label>\n\t\t<div>\n\t\t<?php\n\t\techo \"<input name=\\\"\" . $input . \"\\\" type=\\\"text\\\" \". ($numeric?\"numericinput\":\"\") . \"\\\" value=\\\"\" . $current . \"\\\"\" . $extra . \"/>\\n\";\n\t\t\t\n\t\techo $additionaltext;\n\t\t?>\n\t\t</div>\n\t</div>\n\t<div class=\"clearerleft\"> </div>\n\t<?php\n\t}", "function injectAnswers($string, $original, $project, &$warnings=null) {\n // each warning displayed. This prevents repeat rendering.\n if (is_null($warnings)) {\n $warnings = array();\n }\n $string = preg_replace(\n '|\\[--box\\|(?<name>\\w+)--](.*?)\\[--endbox--]|s',\n \"\",\n $string\n );\n\n $tmplb = TwigManager::getInstance()->load(\"project/recap_fields.html\");\n\n return preg_replace_callback('/\\[--(.*?)\\--]/',\n function ($matches) use ($original, $project, $tmplb, &$warnings) {\n $parts = explode('|', $matches[1]);\n\n $out = \"\";\n if (substr($parts[0], 0, 15) == \"multiple-answer\") {\n $multiparts = explode('-', $parts[0]);\n $multipart = array_pop($multiparts);\n $out = $tmplb->renderBlock(\"multianswer\", array(\n 'original' => $original,\n 'multipart' => $multipart,\n 'parts' => $parts\n ));\n $critname = \"multianswer-\" . $multipart;\n } elseif ($parts[0] == 'customform') {\n $out = customform($parts[1], $original, $project, true);\n } else {\n\n switch ($parts[0]) {\n case \"prev\":\n case \"box\":\n case \"endbox\":\n case \"choicebutton\":\n case \"choicepanel\":\n case \"endchoicepanel\":\n return \"\";\n break;\n case \"answer\":\n $out = $tmplb->renderBlock('answer', array('answer' => $original['answer']));\n $critname = \"answer\";\n break;\n case \"radio\":\n if ($original[$parts[1]] == $parts[2]) {\n $out = $tmplb->renderBlock('radio', array('parts' => $parts));\n }\n $critname = $parts[1];\n break;\n case \"check\":\n if (@$original[$parts[1]]) {\n $out = $tmplb->renderBlock('check', array('parts' => $parts));\n }\n $critname = $parts[1];\n break;\n case \"array\":\n $out = $tmplb->renderBlock('array', array('answers' => $original[$parts[1]], 'name' => $parts[1]));\n $critname = $parts[1];\n break;\n default:\n $out = $tmplb->renderBlock('default', array('name' => $parts[1], 'answer' => $original[$parts[1]]));\n $critname = $parts[1];\n break;\n }\n }\n foreach($warnings as &$warn) {\n foreach ($warn['criteria'] as $criterion) {\n if ($criterion['name'] == $critname) {\n if (!@$warn['done']) {\n $warn['done'] = 1;\n $out .= $tmplb->renderBlock('warning', array('warn' => $warn, 'name' => $critname));\n }\n break;\n }\n }\n }\n return $out;\n },\n $string\n );\n }", "private function createInput($question)\n\t{\n\t\tswitch($question->InputType)\n\t\t{\n\t\t\tcase \"radio\":\n\t\t\tcase \"checkbox\":\n\t\t\t\tprint \"<b>\" . $question->Number . \") \";\n\t\t\t\tprint $question->Text . \"</b> \";\n\t\t\t\tprint '<em>(' . $question->Description . ')</em><br />';\n\t\t\t\tforeach($question->aAnswer as $answer)\n\t\t\t\t{//print data for each\n\t\t\t\t\tprint '<input type=\"' . $question->InputType . '\" name=\"q_' . $question->QuestionID . '[]\" value=\"' . $answer->AnswerID . '\" > ';\n\t\t\t\t\tprint $answer->Text . \" \";\n\t\t\t\t\tif($answer->Description != \"\")\n\t\t\t\t\t{//only print description if not empty\n\t\t\t\t\t\tprint \"<em>(\" . $answer->Description . \")</em>\";\n\t\t\t\t\t}\n\t\t\t\t\tprint '<br />';\t\n\t\t\t\t}\n\t\t\t\tbreak;\t\n\t\t\n\t\t\tcase \"select\":\n\t\t\t\tprint \"<b>\" . $question->Number . \") \";\n\t\t\t\tprint $question->Text . \"</b> \";\n\t\t\t\tprint '<em>(' . $question->Description . ')</em><br />';\n\t\t\t\tprint '<select name=\"q_' . $question->QuestionID . '\">';\n\t\t\t\tforeach($question->aAnswer as $answer)\n\t\t\t\t{//print data for each\n\t\t\t\t\tprint '<option value=\"' . $answer->AnswerID . '\" >' . $answer->Text;\n\t\t\t\t\tif($answer->Description != \"\")\n\t\t\t\t\t{//only print description if not empty\n\t\t\t\t\t\tprint \" <em>(\" . $answer->Description . \")</em>\";\n\t\t\t\t\t}\n\t\t\t\t\tprint '</option>';\t\n\t\t\t\t}\n\t\t\t\tprint '</select><br />';\n\t\t\t\tbreak;\n\t\t}\t\t\t\t\n\t}", "function setup_question($question,$answer){\n $htmlStr = '<p class=\"question\">'.$question.'</p>';\n $htmlStr .= '<p class=\"answer\">'.nl2br($answer).'</p>';\n return $htmlStr;\n}", "function formatNewTextFRAnswer() {\n $format_string = \"\";\n $format_string .= \"<p class='answer'><strong>Answer: </strong> \";\n $format_string .= \"<input type='text' name='answer' id='editAnswerText'></input> </p>\";\n \n return $format_string;\n}", "function print_dataset_definitions_category($form) {\n global $CFG, $DB;\n $datasetdefs = array();\n $lnamemax = 22;\n $namestr =get_string('name', 'quiz');\n $minstr=get_string('min', 'quiz');\n $maxstr=get_string('max', 'quiz');\n $rangeofvaluestr=get_string('minmax','qtype_datasetdependent');\n $questionusingstr = get_string('usedinquestion','qtype_calculated');\n $itemscountstr = get_string('itemscount','qtype_datasetdependent');\n $text ='';\n if (!empty($form->category)) {\n list($category) = explode(',', $form->category);\n $sql = \"SELECT i.*,d.*\n FROM {question_datasets} d,\n {question_dataset_definitions} i\n WHERE i.id = d.datasetdefinition\n AND i.category = ?;\n \" ;\n if ($records = $DB->get_records_sql($sql, array($category))) {\n foreach ($records as $r) {\n $sql1 = \"SELECT q.*\n FROM {question} q\n WHERE q.id = ?\n \";\n if ( !isset ($datasetdefs[\"$r->type-$r->category-$r->name\"])){\n $datasetdefs[\"$r->type-$r->category-$r->name\"]= $r;\n }\n if ($questionb = $DB->get_records_sql($sql1, array($r->question))) {\n $datasetdefs[\"$r->type-$r->category-$r->name\"]->questions[$r->question]->name =$questionb[$r->question]->name ;\n }\n }\n }\n }\n if (!empty ($datasetdefs)){\n\n $text =\"<table width=\\\"100%\\\" border=\\\"1\\\"><tr><th style=\\\"white-space:nowrap;\\\" class=\\\"header\\\" scope=\\\"col\\\" >$namestr</th><th style=\\\"white-space:nowrap;\\\" class=\\\"header\\\" scope=\\\"col\\\">$rangeofvaluestr</th><th style=\\\"white-space:nowrap;\\\" class=\\\"header\\\" scope=\\\"col\\\">$itemscountstr</th><th style=\\\"white-space:nowrap;\\\" class=\\\"header\\\" scope=\\\"col\\\">$questionusingstr</th></tr>\";\n foreach ($datasetdefs as $datasetdef){\n list($distribution, $min, $max,$dec) = explode(':', $datasetdef->options, 4);\n $text .=\"<tr><td valign=\\\"top\\\" align=\\\"center\\\"> $datasetdef->name </td><td align=\\\"center\\\" valign=\\\"top\\\"> $min <strong>-</strong> $max </td><td align=\\\"right\\\" valign=\\\"top\\\">$datasetdef->itemcount&nbsp;&nbsp;</td><td align=\\\"left\\\">\";\n foreach ($datasetdef->questions as $qu) {\n //limit the name length displayed\n if (!empty($qu->name)) {\n $qu->name = (strlen($qu->name) > $lnamemax) ?\n substr($qu->name, 0, $lnamemax).'...' : $qu->name;\n } else {\n $qu->name = '';\n }\n $text .=\" &nbsp;&nbsp; $qu->name <br/>\";\n }\n $text .=\"</td></tr>\";\n }\n $text .=\"</table>\";\n }else{\n $text .=get_string('nosharedwildcard', 'qtype_calculated');\n }\n return $text ;\n }", "function writeTextQuestion ($id, $name, $label, $message, $placeholder, $branchExit, $additionalClass) {\n\tglobal $varchars;\n\tif (!empty($branchExit)) {\n\t\techo '<div class=\"step\" data-state=\"'.$branchExit.'\">';\n\t}\n\telse {\n\t\techo '<div class=\"step\" id=\"'.$id.'\">';\n\t}\n\techo '<div class=\"section\"><div class=\"card-header m-b-0\">\n\t\t\t<label for=\"'.$id.'\">'.$label.'</label>\n\t\t\t\t<p>'.$message.'</p>\n\t\t\t\t<hr class=\"card-line\" align=\"left\">\n\t\t</div><div class=\"card-body m-b-30\">';\n\t\t$inputClass = 'form-control';\n\t\tif (!empty($additionalClass)) {\n\t\t\t$inputClass = 'form-control '. $additionalClass;\n\t\t}\n\t\t\t\techo '<input type=\"text\" name=\"'.$name.'\" id=\"input'.$id.'\" class=\"'.$inputClass.'\" placeholder=\"'.$placeholder.'\" ';\n\t\t\t\tif (isset($varchars[$id])) {\n \techo 'value=\"'.$varchars[$id].'\">';\n }\n else {\n \techo '>';\n }\n\techo '</div></div></div>';\n}", "function ParseInput($vars,&$a_values,$s_line_feed)\n{\n global $SPECIAL_FIELDS,$SPECIAL_VALUES,$FORMATTED_INPUT;\n\n $output = \"\";\n //\n // scan the array of values passed in (name-value pairs) and\n // produce slightly formatted (not HTML) textual output\n //\n while (list($name,$raw_value) = each($vars))\n {\n if (is_string($raw_value))\n //\n // truncate the string\n //\n \t$raw_value = substr($raw_value,0,MAXSTRING);\n $value = trim(Strip($raw_value));\n if (in_array($name,$SPECIAL_FIELDS))\n $SPECIAL_VALUES[$name] = $value;\n\t\telse\n\t\t{\n\t\t\t$a_values[$name] = $raw_value;\n \t$output .= \"$name: $value\".$s_line_feed;\n\t\t}\n array_push($FORMATTED_INPUT,\"$name: '$value'\");\n }\n return ($output);\n}", "public function formatOfQuestion($questionInfo)\r\n {\r\n return $questionInfo['question'] . \"\\n\\n\" . implode(\" \\n \", $questionInfo['item']) . \"\\n\\n\" . $questionInfo['answer'] . \"\\n\\n\" . \"**********\" . \"\\n\\n\";\r\n }", "function render_split_text_question($label, $inputs = array(), $additionaltext=\"\", $numeric=false, $extra=\"\", $currentvals=array())\n {\n\t?>\n\t<div class=\"Question\" id = \"pixelwidth\">\n\t\t<label><?php echo $label; ?></label>\n\t\t<div>\n\t\t<?php\n\t\tforeach ($inputs as $inputname=>$inputtext)\n\t\t\t{\n\t\t\techo \"<div class=\\\"SplitSearch\\\">\" . $inputtext . \"</div>\\n\";\n\t\t\techo \"<input name=\\\"\" . $inputname . \"\\\" class=\\\"SplitSearch\\\" type=\\\"text\\\"\". ($numeric?\"numericinput\":\"\") . \"\\\" value=\\\"\" . $currentvals[$inputname] . \"\\\"\" . $extra . \" />\\n\";\n\t\t\t}\n\t\techo $additionaltext;\n\t\t?>\n\t\t</div>\n\t</div>\n\t<div class=\"clearerleft\"> </div>\n\t<?php\n\t}", "function display_short_answer_form($question_num){\r\n include(\"variables.inc\");\r\n\tif($question_num == 0) $question_num = 1;\r\n echo(\"\\t<TABLE WIDTH=\\\"$table_width\\\">\\n\");\r\n echo(\"\\t\\t<TR>\\n\");\r\n echo(\"\\t\\t\\t<TD WIDTH=\\\"50\\\"><P>\" . $question_num . \")</P></TD>\\n\");\r\n echo(\"\\t\\t\\t<TD WIDTH=\\\"580\\\"> \\n\\t\\t\\t\\t\\n\");\r\n echo(\"\\t\\t\\t\\t<INPUT TYPE=\\\"text\\\" NAME=\\\"question_A\\\" SIZE=\\\"85\\\">\\n\");\r\n echo(\"\\t\\t\\t</TD>\\n\");\r\n echo(\"\\t\\t</TR>\\n\");\r\n echo(\"\\t\\t\\t<TD WIDTH=\\\"50\\\">Solution:</TD>\\n\");\r\n echo(\"\\t\\t\\t<TD WIDTH=\\\"580\\\"> \\n\\t\\t\\t\\t\\n\");\r\n echo(\"\\t\\t\\t\\t<TEXTAREA NAME=\\\"answer_A\\\" cols=\\\"65\\\" rows=\\\"10\\\"></textarea>\\n\");\r\n echo(\"\\t\\t\\t</TD>\\n\");\r\n echo(\"\\t\\t</TR>\\n\");\r\n echo(\"\\t\\t<TD COLSPAN=\\\"2\\\"></TD>\\n\");\r\n echo(\"\\t\\t</TR>\\n\");\r\n echo(\"\\t</TABLE>\\n\"); \r\n}", "function print_question_formulation_and_controls(&$question, &$state, $cmoptions, $options) {\n // virtual type for printing\n $virtualqtype = $this->get_virtual_qtype();\n if($unit = $virtualqtype->get_default_numerical_unit($question)){\n $unit = $unit->unit;\n } else {\n $unit = '';\n }\n // We modify the question to look like a numerical question\n $numericalquestion = fullclone($question);\n foreach ($numericalquestion->options->answers as $key => $answer) {\n $answer = fullclone($numericalquestion->options->answers[$key]);\n $numericalquestion->options->answers[$key]->answer = $this->substitute_variables_and_eval($answer->answer,\n $state->options->dataset);\n }\n $numericalquestion->questiontext = $this->substitute_variables(\n $numericalquestion->questiontext, $state->options->dataset);\n //evaluate the equations i.e {=5+4)\n $qtext = \"\";\n $qtextremaining = $numericalquestion->questiontext ;\n while (ereg('\\{=([^[:space:]}]*)}', $qtextremaining, $regs1)) {\n $qtextsplits = explode($regs1[0], $qtextremaining, 2);\n $qtext =$qtext.$qtextsplits[0];\n $qtextremaining = $qtextsplits[1];\n if (empty($regs1[1])) {\n $str = '';\n } else {\n if( $formulaerrors = qtype_calculated_find_formula_errors($regs1[1])){\n $str=$formulaerrors ;\n }else {\n eval('$str = '.$regs1[1].';');\n }\n }\n $qtext = $qtext.$str ;\n }\n $numericalquestion->questiontext = $qtext.$qtextremaining ; // end replace equations\n $virtualqtype->print_question_formulation_and_controls($numericalquestion, $state, $cmoptions, $options);\n }", "function processFormatString()\n\t{\n\t\t// of date followed by event title.\n\t\tif ($this->customFormatStr == null)\n\t\t\t$this->customFormatStr = $this->defaultfFormatStr;\n\t\telse\n\t\t{\n\t\t\t$this->customFormatStr = preg_replace('/^\"(.*)\"$/', \"\\$1\", $this->customFormatStr);\n\t\t\t$this->customFormatStr = preg_replace(\"/^'(.*)'$/\", \"\\$1\", $this->customFormatStr);\n\t\t\t// escape all \" within the string\n\t\t\t// $customFormatStr = preg_replace('/\"/','\\\"', $customFormatStr);\n\t\t}\n\n\t\t// strip out event variables and run the string thru an html checker to make sure\n\t\t// it is legal html. If not, we will not use the custom format and print an error\n\t\t// message in the module output. This functionality is not here for now.\n\t\t// parse the event variables and reformat them into php syntax with special handling\n\t\t// for the startDate and endDate fields.\n\t\t//asdbg_break();\n\t\t// interpret linefeed as <br /> if not disabled\n\t\tif (!$this->modparams->get(\"modlatest_ignorebr\", 0))\n\t\t{\n\t\t\t$customFormat = nl2br($this->customFormatStr);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$customFormat = $this->customFormatStr;\n\t\t}\n\n\t\t$keywords = array(\n\t\t\t'content', 'eventDetailLink', 'createdByAlias', 'color',\n\t\t\t'createdByUserName', 'createdByUserEmail', 'createdByUserEmailLink',\n\t\t\t'eventDate', 'endDate', 'startDate', 'title', 'category', 'calendar',\n\t\t\t'contact', 'addressInfo', 'location', 'extraInfo',\n\t\t\t'countdown', 'categoryimage', 'duration', 'siteroot', 'sitebase', 'allCategoriesColoured', 'allCategorieSlugs',\n\t\t\t'today', 'tomorrow'\n\t\t);\n\t\t$keywords_or = implode('|', $keywords);\n\t\t$whsp = '[\\t ]*'; // white space\n\t\t$datefm = '\\([^\\)]*\\)'; // date formats\n\t\t//$modifiers\t= '(?::[[:alnum:]]*)';\n\n\t\t$pattern = '/(\\$\\{' . $whsp . '(?:' . $keywords_or . ')(?:' . $datefm . ')?' . $whsp . '\\})/'; // keyword pattern\n\t\t$cond_pattern = '/(\\[!?[[:alnum:]]+:[^\\]]*])/'; // conditional string pattern e.g. [!a: blabla ${endDate(%a)}]\n\t\t// tokenize conditional strings\n\t\t$splitTerm = preg_split($cond_pattern, $customFormat, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY);\n\n\t\t$this->splitCustomFormat = array();\n\t\tforeach ($splitTerm as $key => $value)\n\t\t{\n\t\t\tif (preg_match('/^\\[(.*)\\]$/', $value, $matches))\n\t\t\t{\n\t\t\t\t// remove outer []\n\t\t\t\t$this->splitCustomFormat[$key]['data'] = $matches[1];\n\t\t\t\t// split condition\n\t\t\t\tpreg_match('/^([^:]*):(.*)$/', $this->splitCustomFormat[$key]['data'], $matches);\n\t\t\t\t$this->splitCustomFormat[$key]['cond'] = $matches[1];\n\t\t\t\t$this->splitCustomFormat[$key]['data'] = $matches[2];\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->splitCustomFormat[$key]['data'] = $value;\n\t\t\t}\n\t\t\t// tokenize into array\n\t\t\t$this->splitCustomFormat[$key]['data'] = preg_split($pattern, $this->splitCustomFormat[$key]['data'], -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY);\n\t\t}\n\n\t\t// cleanup, remove white spaces from key words, seperate date parm string and modifier into array;\n\t\t// e.g. ${ keyword ( 'aaaa' ) } => array('keyword', 'aaa',)\n\t\tforeach ($this->splitCustomFormat as $ix => $yy)\n\t\t{\n\t\t\tforeach ($this->splitCustomFormat[$ix]['data'] as $keyToken => $customToken)\n\t\t\t{\n\t\t\t\tif (preg_match('/\\$\\{' . $whsp . '(' . $keywords_or . ')(' . $datefm . ')?' . $whsp . '}/', trim($customToken), $matches))\n\t\t\t\t{\n\t\t\t\t\t$this->splitCustomFormat[$ix]['data'][$keyToken] = array();\n\t\t\t\t\t$this->splitCustomFormat[$ix]['data'][$keyToken]['keyword'] = stripslashes($matches[1]);\n\t\t\t\t\tif (isset($matches[2]))\n\t\t\t\t\t{\n\t\t\t\t\t\t// ('aaa') => aaa\n\t\t\t\t\t\t$this->splitCustomFormat[$ix]['data'][$keyToken]['dateParm'] = preg_replace('/^\\([\"\\']?(.*)[\"\\']?\\)$/', \"\\$1\", stripslashes($matches[2]));\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$this->splitCustomFormat[$ix]['data'][$keyToken] = stripslashes($customToken);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t}", "static function drawQuestion($args)\n\t{\n\t\t$currentUserID = get_current_user_id();\n\t\t\n\t\t\n\t\t// Get Defaults\n\t\t$defaults = ekQuiz::$defaults;\n\t\t\n\t\tforeach($args as $key => $value){$$key = $value;} # Turn all atts into variables of Key name\n\t\t\n\t\tif($buttonText==\"\")\n\t\t{\n\t\t\t$buttonText=$defaults['buttonText'];\n\t\t}\n\t\t\n\t\t// Add a text area or not\n\t\t$addTextarea = get_post_meta($questionID, \"addTextarea\", true);\n\t\t\n\t\t//if($correctFeedback==\"\"){$correctFeedback = get_post_meta($questionID, \"correctFeedback\", true);}\n\n\t\t$randomKey = $args['randomKey'];\t\t\n\t\t\n\t\t//$qStr='<div id=\"ek-question-'.$questionID.'-'.$randomKey.'\">';\n\t\t$qStr='<div>';\n\t\t\n\t\t$qStr.= apply_filters('the_content', get_post_field('post_content', $questionID));\n\t\t\n\t\t// Auto Save the response if its a text box\n\t\t$saveResponse=false;\n\t\tif($addTextarea==\"on\")\n\t\t{\n\t\t\t$saveResponse=true;\n\t\t}\n\t\t\n\t\t\n\t\t// Add the Vars to the Args to pass via JSON to ajax function\n\t\t$args['randomKey'] = $randomKey;\n\t\t$args['userID'] = $currentUserID;\n\t\t$args['saveResponse'] = $saveResponse;\n\t\t$args['qType'] = self::$qType;\n\t\t\t\t\t\n\t\t// Create array to pass to JS\n\t\t$passData = htmlspecialchars(json_encode($args));\t\n\t\t\n\t\tif($addTextarea==\"on\")\n\t\t{\n\t\t\n\t\t\t$userResponseArray = ekQuiz_queries::getUserResponse($questionID, $currentUserID);\n\t\t\t$userResponse = stripslashes($userResponseArray['userResponse']);\n\t\t\t//$userResponse = apply_filters('the_content', $userResponseArray['userResponse']);\n\n\t\t\n\t\t\n\t\t\t$editor_settings = array\n\t\t\t(\n\t\t\t\t\"media_buttons\"\t=> false, \n\t\t\t\t\"textarea_rows\"\t=> 6,\n\t\t\t\t\"editor_class\"\t=> \"ek-reflection-editor\",\n\t\t\t\t\"tinymce\"\t\t=> array(\n\t\t\t\t'toolbar1'\t=> 'bold,italic,underline,bullist,numlist,forecolor,undo,redo',\n\t\t\t\t'toolbar2'\t=> ''\n\t\t\t\t)\n\t\t\t);\t\t\t\t\t\n\t\t\t\n\t\t\tob_start();\n\t\t\twp_editor($userResponse, 'reflection_'.$questionID.'-'.$randomKey, $editor_settings);\t\t\n\t\t\t$qStr.= ob_get_contents();\n\t\t\tob_end_clean();\n\t\t}\n\t\t\t\n\t\t\t\t\t\n\t\t// Create blank div for feedback fro this qType. unique to reflection as we don't want to recreate textbox\n\t\t$qStr.='<div id=\"reflectionSavedFeedback_'.$questionID.'-'.$randomKey.'\" class=\"reflectionFeedback\">Entry Saved</div>';\n\t\t$qStr.='<div id=\"reflectionFeedback_'.$questionID.'-'.$randomKey.'\" class=\"reflectionSavedFeebdack\">Entry Saved</div>';\t\t\n\t\t\n\t\t$qStr.='<div class=\"ekQuizButtonWrap\" id=\"ekQuizButtonWrap_'.$questionID.'_'.$randomKey.'\">';\n\t\t$qStr.='<input type=\"button\" value=\"'.$buttonText.'\" class=\"ekQuizButton\" onclick=\"javascript:singleQuestionSubmit(\\''.$passData.'\\')\";/>';\n\t\t$qStr.='</div>';\n\t\t\n\t\t// Hide the Visual Tab\n\t\t$qStr.='\t\t\n\t\t\t<style>\n\t\t\t.wp-editor-tools, .post .wp-editor-tools {\n\t\t\t\tdisplay: none;\n\t\t\t}\n\t\t\t</style>\n\t\t';\n\t\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t// Close the Question div wrap\n\t\t$qStr.='</div>';\n\t\t\n\t\t\n\t\t\n\t\treturn $qStr;\n\t\n\t\t\n\t\t\n\t\t\n\t}", "function readquestion($lines) {\n \t// converts it into a question object suitable for processing and insertion.\n\n $question = $this->defaultquestion();\n $comment = NULL;\n \n // define replaced by simple assignment, stop redefine notices\n $gift_answerweight_regex = \"^%\\-*([0-9]{1,2})\\.?([0-9]*)%\"; \n\n // REMOVED COMMENTED LINES and IMPLODE\n foreach ($lines as $key => $line) {\n $line = trim($line);\n if (substr($line, 0, 2) == \"//\") {\n $lines[$key] = \" \";\n }\n }\n\n $text = trim(implode(\" \", $lines));\n\n if ($text == \"\") {\n return false;\n }\n\n // Substitute escaped control characters with placeholders\n $text = $this->escapedchar_pre($text);\n\n // Look for category modifier ---------------------------------------------------------\n if (ereg( '^\\$CATEGORY:', $text)) {\n // $newcategory = $matches[1];\n $newcategory = trim(substr( $text, 10 ));\n $newcategory = trim(substr( $newcategory, 0, strpos($newcategory, \"::\")));\n\t\t\t\n $question->setCategoryFromName($newcategory);\n $text = trim(substr($text, 10+strlen($newcategory)));\n \n // build fake question to contain category\n \n \t// XXX: create a category !\n //return true;\n }\n \n // QUESTION NAME parser --------------------------------------------------------------\n if (substr($text, 0, 2) == \"::\") {\n $text = substr($text, 2);\n\n $namefinish = strpos($text, \"::\");\n if ($namefinish === false) {\n $question->prompt = false;\n // name will be assigned after processing question text below\n } else {\n $questionname = substr($text, 0, $namefinish);\n $question->prompt = addslashes(trim($this->escapedchar_post($questionname)));\n $text = trim(substr($text, $namefinish+2)); // Remove name from text\n }\n } else {\n $question->prompt = false;\n }\n\n\n // FIND ANSWER section -----------------------------------------------------------------\n // no answer means its a description\n $answerstart = strpos($text, \"{\");\n $answerfinish = strpos($text, \"}\");\n\n $description = false;\n if (($answerstart === false) and ($answerfinish === false)) {\n $description = true;\n $answertext = '';\n $answerlength = 0;\n }\n elseif (!(($answerstart !== false) and ($answerfinish !== false))) {\n //$this->error( get_string( 'braceerror', 'quiz' ), $text );\n return false;\n }\n else {\n $answerlength = $answerfinish - $answerstart;\n $answertext = trim(substr($text, $answerstart + 1, $answerlength - 1));\n }\n\n \n\t\t// Format QUESTION TEXT without answer, inserting \"_____\" as necessary\n if ($description) {\n $text = $text;\n }\n elseif (substr($text, -1) == \"}\") {\n // no blank line if answers follow question, outside of closing punctuation\n $text = substr_replace($text, \"\", $answerstart, $answerlength+1);\n } else {\n // inserts blank line for missing word format\n $text = substr_replace($text, \"_____\", $answerstart, $answerlength+1);\n }\n\n // get text format from text\n $oldtext = $text;\n $textformat = 0;\n if (substr($text,0,1)=='[') {\n $text = substr( $text,1 );\n $rh_brace = strpos( $text, ']' );\n $qtformat= substr( $text, 0, $rh_brace );\n $text = substr( $text, $rh_brace+1 );\n \n }\n // i must find out for what this param is used\n $question->textformat = $textformat;\n \t\t\n \t\t// question text \n $question->quest_text = addslashes(trim($this->escapedchar_post($text)));\n\n // set question name if not already set\n\t\tif ($question->prompt === false) {\n\t\t\t$question->prompt = $question->quest_text;\n\t\t}\n\n // ensure name is not longer than 250 characters\n $question->prompt = $question->prompt ;\n $question->prompt = strip_tags(substr( $question->prompt, 0, 250 ));\n\n // determine QUESTION TYPE -------------------------------------------------------------\n $question->qtype = NULL;\n\n // give plugins first try\n // plugins must promise not to intercept standard qtypes\n // MDL-12346, this could be called from lesson mod which has its own base class =(\n /*\n if (method_exists($this, 'try_importing_using_qtypes') && ($try_question = $this->try_importing_using_qtypes( $lines, $question, $answertext ))) {\n return $try_question;\n }\n\t\t*/\n if ($description) {\n $question->qtype = 'title';\n }\n elseif ($answertext == '') {\n $question->qtype = 'extended_text';\n }\n elseif ($answertext{0} == \"#\"){\n $question->qtype = 'numerical';\n\n\t\t} elseif (strpos($answertext, \"~\") !== false) {\n\t\t\t\n\t\t\t// only Multiplechoice questions contain tilde ~\n\t\t\tif (strpos($answertext,\"=\") === false) {\n\t\t\t\t\n\t\t\t\t// multiple answers are enabled if no single answer is 100% correct\n\t\t\t\t$question->qtype = 'choice_multiple'; \n\t\t\t} else {\n\t\t\t\t\n\t\t\t\t// only one answer allowed (the default)\n\t\t\t\t$question->qtype = 'choice';\n\t\t\t}\n }", "public function formatVariable(){\r\n\t\t\r\n\t\tforeach($this->template as $k=>$v){\r\n\t\t\tif(preg_match('/{\\s+\\$(\\w+)}/', $v, $matches)){\r\n\t\t\t\t$this->variable_lines = ($k+1);\r\n\t\t\t\t$this->error_notice[($k+1)] = 'Variable format error: The blank is not allowed with \\'{\\' near '.$matches[1].' in '.$this->template_file.$this->template_postfix.' on line '.($k+1);\r\n\t\t\t}\r\n\t\t\tif(preg_match('/{\\$(\\w+)\\s+}/', $v, $matches)){\r\n\t\t\t\t$this->variable_lines = ($k+1);\r\n\t\t\t\t$this->error_notice[($k+1)] = 'Variable format error: The blank is not allowed with \\'}\\' near '.$matches[1].' in '.$this->template_file.$this->template_postfix.' on line '.($k+1);\r\n\t\t\t}\r\n\t\t\tif(preg_match('/{\\s+\\$(\\w+)\\s+}/', $v, $matches)){\r\n\t\t\t\t$this->variable_lines = ($k+1);\r\n\t\t\t\t$this->error_notice[($k+1)] = 'Variable format error: The blank is not allowed with \\'{}\\' near '.$matches[1].' in '.$this->template_file.$this->template_postfix.' on line '.($k+1);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "function quiz_fields(){\n\n\t$fields = array();\n\n/*quiz settings*/\n\n\t$fields['quiz_duration_in_minutes'] = 'number';\n\n\t$fields['make_quiz_public'] = 'checkbox';\n\t\n\t$fields['make_quiz_active'] = 'checkbox';\n\t\n\t$fields['users_can_take_quiz_only_once'] = 'checkbox';\t\n\t\n\t$fields['display_questions_in_random_order'] = 'checkbox';\t\t\n\t\n\t$fields['display_answer_options_in_random_order'] = 'checkbox';\t\n\t\n\t$fields['time_remaining_when_clock_turns_red_in_seconds'] = 'number';\t\n\t\n\t$fields['show_number_of_questions_remaining'] = 'checkbox';\t\t\n\t\n\t$fields['test_pass_percentage'] = 'number';\t\n\n/*quiz contents*/\n\n\t$fields['main_colour'] = 'text';\n\n\t$fields['secondary_colour'] = 'text';\t\n\n\t$fields['message_when_no_answer_is_selected'] = 'text';\t\n\t\n\t$fields['message_to_show_under_skip_confirm_buttons'] = 'text';\t\t\n\t\n\t$fields['message_to_show_if_user_cannot_access_quiz'] = 'text';\t\n\t\n/*questions*/\n\n\t// $count terms in categeory\n\t$args = array('hide_empty' => false);\n\t$categories = wp_count_terms( 'question-category', $args );\n\tif($categories < 1){$categories = 1;}\n\t\n\t$i = 0;\n\n\twhile($i < $categories){\n\t$i++;\n\t$field = 'question_category_'.$i;\n\t$fields[$field] = 'select';\n\t$field = 'question_category_count_'.$i;\n\t$fields[$field] = 'number';\n\t}\t\n\n/*ending the quiz*/\n\n\t$fields['redirect_to_page_once_complete'] = 'pageselect';\n\t\n\t$fields['message_to_show_after_last_question_answered'] = 'text';\n\t\n\t$fields['redirect_to_page_on_timeout'] = 'pageselect';\n\t\n\t$fields['message_to_show_after_timeout'] = 'text';\t\n\n/*quiz results*/\n\n\t$fields['show_score_after_last_question_answered'] = 'checkbox';\n\n\t$fields['notify_administrator_of_results'] = 'checkbox';\n\t\n\t$fields['email_address_to_notify'] = 'text';\n\n\nreturn $fields;\n}", "function printMCQuestionForm() {\n\n\tglobal $tool_content, $langTitle, $langSurveyStart, $langSurveyEnd, \n\t\t$langType, $langSurveyMC, $langSurveyFillText, \n\t\t$langQuestion, $langCreate, $langSurveyMoreQuestions, \n\t\t$langSurveyCreated, $MoreQuestions, $langAnswer, \n\t\t$langSurveyMoreAnswers, $langSurveyInfo,\n\t\t$langQuestion1, $langQuestion2, $langQuestion3, $langQuestion4, $langQuestion5, $langQuestion6,\n\t\t$langQuestion7, $langQuestion8,$langQuestion9, $langQuestion10;\n\t\t\n\t\tif(isset($_POST['SurveyName'])) $SurveyName = htmlspecialchars($_POST['SurveyName']);\n\t\tif(isset($_POST['SurveyEnd'])) $SurveyEnd = htmlspecialchars($_POST['SurveyEnd']);\n\t\tif(isset($_POST['SurveyStart'])) $SurveyStart = htmlspecialchars($_POST['SurveyStart']);\n\t\t\n//\tif ($MoreQuestions == 2) { // Create survey ******************************************************\n\tif ($MoreQuestions == $langCreate) { // Create survey\n\t\tcreateMCSurvey();\n\t} elseif(count($_POST)<7) { // Just entered MC survey creation dialiog ****************************\n\t\t$tool_content .= <<<cData\n\t\t<table><thead></thead>\n\t<tr><td colspan=2>$langSurveyInfo</td></tr></table>\n\t<form action=\"addsurvey.php\" id=\"survey\" method=\"post\" name=\"SurveyForm\" onSubmit=\"return checkrequired(this, 'question1')\">\n\t<input type=\"hidden\" value=\"1\" name=\"UseCase\">\n\t<table id=\"QuestionTable\">\n\t<tr><td>$langTitle</td><td colspan=\"2\"><input type=\"text\" size=\"50\" name=\"SurveyName\" value=\"$SurveyName\"></td></tr>\n\t<tr><td>$langSurveyStart</td><td colspan=\"2\"><input type=\"text\" size=\"20\" name=\"SurveyStart\" value=\"$SurveyStart\"></td></tr>\n\t<tr><td>$langSurveyEnd</td><td colspan=\"2\"><input type=\"text\" size=\"20\" name=\"SurveyEnd\" value=\"$SurveyEnd\"></td></tr>\n\t<tr><td colspan=3>\n\t<SELECT NAME=\"questionx\" onChange=\"addEvent(this.selectedIndex);this.parentNode.removeChild(this);\" id=\"QuestionSelector\">\n\t\t\t\t<OPTION>$langSurveyInfo</option>\n\t\t\t\t<OPTION VALUE=\"question1\">$langQuestion1[0]</option>\n <OPTION VALUE=\"question2\">$langQuestion2[0]</option>\n <OPTION VALUE=\"question3\">$langQuestion3[0]</option>\n <OPTION VALUE=\"question4\">$langQuestion4[0]</option>\n <OPTION VALUE=\"question5\">$langQuestion5[0]</option>\n <OPTION VALUE=\"question6\">$langQuestion6[0]</option>\n <OPTION VALUE=\"question7\">$langQuestion7[0]</option>\n <OPTION VALUE=\"question8\">$langQuestion8[0]</option>\n <OPTION VALUE=\"question9\">$langQuestion9[0]</option>\n <OPTION VALUE=\"question10\">$langQuestion10[0]</option>\n\t\t\t\t</SELECT>\n\t\t\t</td></tr>\n\t\t\t<tr><td>$langQuestion</td><td><input type=\"text\" name=\"question1\" size=\"70\" id=\"NewQuestion\"></td></tr> \n\t\t\t<tr><td>$langAnswer 1</td><td><input type=\"text\" name=\"answer1.1\" size=\"70\" id=\"NewAnswer1\"></td></tr>\n\t\t\t<tr><td>$langAnswer 2</td><td><input type=\"text\" name=\"answer1.2\" size=\"70\" id=\"NewAnswer2\"></td></tr>\n\t\t\t<tr id=\"NextLine\">\n\t\t\t <td>\n\t\t\t <input name=\"MoreQuestions\" type=\"submit\" value=\"$langSurveyMoreAnswers\" /></td>\n\t\t\t <td>\n\t\t\t <input name=\"MoreQuestions\" type=\"submit\" value=\"$langSurveyMoreQuestions\" /></td>\n\t\t <td>\n\t\t\t\t\t<input name=\"MoreQuestions\" type=\"submit\" value=\"$langCreate\"></td>\n\t\t\t</tr>\n\t\t</table>\n\t\t<input type=\"hidden\" value=\"1\" name=\"NumOfQuestions\">\n\t\t</form>\ncData;\n\t} elseif ($MoreQuestions == $langSurveyMoreAnswers) { // Print more answers \n\t\t$NumOfQuestions = $_POST['NumOfQuestions'];\n\t\t\n\t\t$tool_content .= <<<cData\n\t\t<form action=\"addsurvey.php\" id=\"survey\" method=\"post\">\n\t\t<input type=\"hidden\" value=\"1\" name=\"UseCase\">\n\t\t<table>\n\t\t\t<tr><td>$langTitle</td><td colspan=\"2\"><input type=\"text\" size=\"50\" name=\"SurveyName\" value=\"$SurveyName\"></td></tr>\n\t\t\t<tr><td>$langSurveyStart</td><td colspan=\"2\"><input type=\"text\" size=\"10\" name=\"SurveyStart\" value=\"$SurveyStart\"></td></tr>\n\t\t\t<tr><td>$langSurveyEnd</td><td colspan=\"2\"><input type=\"text\" size=\"10\" name=\"SurveyEnd\" value=\"$SurveyEnd\"></td></tr>\n\t\t\t\ncData;\n\n\t\tprintAllQA();\n\t\t$tool_content .= <<<cData\n\t\t\t\t\t<tr><td>$langAnswer</td><td colspan=\"2\"><input type=\"text\" size=\"10\" name=\"answer\" value=\"\"></td></tr>\n\t\t\t\t\t\t<tr>\n\t\t\t <td>\n\t\t\t <input name=\"MoreQuestions\" type=\"submit\" value=\"$langSurveyMoreAnswers\" />\n\t\t </td>\n\t\t\t <td>\n\t\t\t <input name=\"MoreQuestions\" type=\"submit\" value=\"$langSurveyMoreQuestions\" />\n\t\t </td>\n\t\t <td>\n\t\t\t <input name=\"MoreQuestions\" type=\"submit\" value=\"$langCreate\" />\n\t\t </td>\n\t\t\t</tr>\n\t\t</table>\n\t\t<input type=\"hidden\" value=\"{$NumOfQuestions}\" name=\"NumOfQuestions\">\n\t\t</form>\ncData;\n\t} else { // Print more questions ******************************************************\n\t\t$NumOfQuestions = $_POST['NumOfQuestions'];\n\t\t++$NumOfQuestions;\n\t\t\n\t\t$tool_content .= <<<cData\n\t\t<form action=\"addsurvey.php\" id=\"survey\" method=\"post\" name=\"SurveyForm\" onSubmit=\"return checkrequired(this, 'questionx')\">\n\t\t<input type=\"hidden\" value=\"1\" name=\"UseCase\">\n\t\t<table>\n\t\t<tr><td>$langTitle</td><td colspan=\"2\">\n\t\t\t\t<input type=\"text\" size=\"50\" name=\"SurveyName\" value=\"$SurveyName\"></td></tr>\n\t\t<tr><td>$langSurveyStart</td><td colspan=\"2\">\n\t\t\t\t\t<input type=\"text\" size=\"20\" name=\"SurveyStart\" value=\"$SurveyStart\"></td></tr>\n\t\t<tr><td>$langSurveyEnd</td><td colspan=\"2\">\n\t\t\t\t\t<input type=\"text\" size=\"20\" name=\"SurveyEnd\" value=\"$SurveyEnd\"></td></tr>\n\t\t\t\ncData;\n\t\t\n\t\tprintAllQA();\n\t\t\n\t\t$tool_content .= <<<cData\n\t\t<tr><td colspan=3><hr></td></tr>\n\t\t\t<tr><td colspan=3>\n\t\t\t\t<SELECT NAME=\"questionx\" onChange=\"addEvent(this.selectedIndex);this.parentNode.removeChild(this);\" id=\"QuestionSelector\">\n\t\t\t\t<OPTION>$langSurveyInfo</option>\n\t\t\t\t<OPTION VALUE=\"question1\">$langQuestion1[0]</option>\n\t\t\t\t<OPTION VALUE=\"question2\">$langQuestion2[0]</option>\n\t\t\t\t<OPTION VALUE=\"question3\">$langQuestion3[0]</option>\n\t\t\t\t<OPTION VALUE=\"question4\">$langQuestion4[0]</option>\n\t\t\t\t<OPTION VALUE=\"question5\">$langQuestion5[0]</option>\n\t\t\t\t<OPTION VALUE=\"question6\">$langQuestion6[0]</option>\n\t\t\t\t<OPTION VALUE=\"question7\">$langQuestion7[0]</option>\n\t\t\t\t<OPTION VALUE=\"question8\">$langQuestion8[0]</option>\n\t\t\t\t<OPTION VALUE=\"question9\">$langQuestion9[0]</option>\n\t\t\t\t<OPTION VALUE=\"question10\">$langQuestion10[0]</option>\n\t\t\t\t</SELECT>\n\t\t\t</td></tr>\ncData;\n\t\t\n\t\t$tool_content .= \"<tr> <td>\" . \n\t\t\t\t$langQuestion . \"\t</td><td><input type='text' name='questionx' size='70' id='NewQuestion'></td></tr>\".\n\t\t\t\t\"<tr><td>$langAnswer 1</td><td><input type='text' name='answerx.1' size='70' id='NewAnswer1'></td></tr>\".\n\t\t\t\t\"<tr><td>$langAnswer 2</td><td><input type='text' name='answerx.2' size='70' id='NewAnswer2'></td></tr>\";\n\t\t\t\n\t\t$tool_content .= <<<cData\n\t\t\t\t<tr id=\"NextLine\"><td colspan=3><hr></td></tr>\n\t\t\t\t<tr>\n\t\t\t <td>\n\t\t\t <input name=\"MoreQuestions\" type=\"submit\" value=\"$langSurveyMoreAnswers\" />\n\t\t </td>\n\t\t\t <td>\n\t\t\t <input name=\"MoreQuestions\" type=\"submit\" value=\"$langSurveyMoreQuestions\" />\n\t\t </td>\n\t\t <td>\n\t\t\t <input name=\"MoreQuestions\" type=\"submit\" value=\"$langCreate\" />\n\t\t </td>\n\t\t\t</tr>\n\t\t</table>\n\t\t<input type=\"hidden\" value=\"{$NumOfQuestions}\" name=\"NumOfQuestions\">\n\t\t</form>\ncData;\n\t}\n}", "public function fillQuestion(array $question)\n\t{\n\t\t[$inputMode, $inputExpectation, $notUseful, $from] = explode('_', $question['type']);\n\n\t\tvar_dump($inputMode, $inputExpectation, $notUseful, $from);\n\t\t//var_dump($question['function']['name']);\n\n\t\tif($inputMode == 'type')\n\t\t{\n\t\t\t$question['text'] .= $question['function'][$from] . ' ?';\n\t\t\t$question['answer_text'] = $question['function'][$inputExpectation];\n\t\t}\n\n\t\telseif($inputMode == 'choose')\n\t\t{\n\t\t\t$question['answer_text'] = $question['function'][$inputExpectation];\n\n\t\t\tif($from == 'name')\n\t\t\t{\n\t\t\t\t$question['text'] .= $question['function']['name'] . '() ?';\n\t\t\t}\n\n\t\t\telse\n\t\t\t{\n\t\t\t\t$question['text'] .= $question['function'][$from] . ' ?';\n\t\t\t}\n\n\t\t\t$question['choices'] = $this->generateChoices($question);\n\n\t\t\t//put correct answer in (by clobbering one of generated choices)\n\t\t\t$randomChoice = array_rand($question['choices']);\n\n\t\t\t$question['choices'][$randomChoice] = $question['answer_text'];\n\t\t\t$question['answer_index'] = $randomChoice;\n\t\t}\n\n\t\t\n\n\t\treturn $question;\n\t}", "public function prepareVars()\n {\n $this->vars['searchBox'] = $this;\n $this->vars['cssClasses'] = implode(' ', $this->cssClasses);\n $this->vars['placeholder'] = lang($this->prompt);\n $this->vars['value'] = $this->getActiveTerm();\n }", "function form_players_entry ($gender, $showword)\n{\n $min = 'MinPlayers' . $gender;\n $max = 'MaxPlayers' . $gender;\n $pref = 'PrefPlayers' . $gender;\n\n if (array_key_exists ($min, $_POST))\n $min_value = $_POST[$min];\n else\n $min_value = '0';\n\n if (array_key_exists ($max, $_POST))\n $max_value = $_POST[$max];\n else\n $max_value = '0';\n\n if (array_key_exists ($pref, $_POST))\n $pref_value = $_POST[$pref];\n else\n $pref_value = '0';\n\n print (\" <tr>\\n\");\n if ($showword)\n print (\" <td align=\\\"right\\\">$gender Characters:</td>\\n\");\n else\n print (\" <td align=\\\"right\\\">Characters:</td>\\n\");\n print (\" <td align=\\\"left\\\">\\n\");\n printf (\" Min:<INPUT TYPE=TEXT NAME=%s SIZE=3 MAXLENGTH=3 VALUE=\\\"%s\\\">&nbsp;&nbsp;&nbsp;\\n\",\n\t $min,\n\t $min_value);\n printf (\" Preferred:<INPUT TYPE=TEXT NAME=%s SIZE=3 MAXLENGTH=3 VALUE=\\\"%s\\\">&nbsp;&nbsp;&nbsp;\\n\",\n\t $pref,\n\t $pref_value);\n printf (\" Max:<INPUT TYPE=TEXT NAME=%s SIZE=3 MAXLENGTH=3 VALUE=\\\"%s\\\">\\n\",\n\t $max,\n\t $max_value);\n print (\" </TD>\\n\");\n print (\" </tr>\\n\");\n}", "public abstract function format($level, $text, $name='', $extras=[]);", "function writequestion($question) {\n /// must be overidden\n\n echo \"<p>This quiz format has not yet been completed!</p>\";\n\n return NULL;\n }", "public function set_data($question) {\n /* accessing the form in this way is probably not correct style */\n $wronganswers = $this->get_wrong_answers($question);\n /* this gets manipulated by javascript */\n $settingsdata = $this->get_itemsettings($question);\n $this->_form->getElement('itemsettings')->setValue($settingsdata);\n $this->_form->getElement('wronganswers')->setValue(array('text' => $wronganswers));\n parent::set_data($question);\n }", "function fill_general_variables()\n\t\t{\n\t\t\t//collect error messages before\n\t\t\t$this->message[] = $this->process_monitor->get_error(false, _DEBUG);\n\t\t\t$this->fill_form_variables();\n\t\t\t$this->t->set_var(array(\n\t\t\t\t'monitor_stats'\t\t\t=> $this->fill_monitor_stats($this->stats),\n\t\t\t));\n\t\t}", "public function testQuestionWithFeedback() {\n $gift = \"::Q1 T/F:: 1+1=2 {T#You got it wrong.#You got it.}\\n\n ::Q2 MA:: One of these are right and three are wrong {=Right#Correct ~Wrong#nope ~Incorrect#opposite ~Not right#single word}\\n\n ::Q3 MA:: Two of these are right and two are wrong {=Right#correct =Correct#corretc ~Wrong#not this one ~Incorrect#nope}\\n\n ::Q4 Short Answer:: Two plus [_____] equals four. {=two#yes, written =2#the numeral, ~4#close}\";\n // $gift = \"::Q3 MA:: Two of these are right and two are wrong {=Right#correct =Correct ~Wrong ~Incorrect}\";\n\n $questions = array();\n $errors = array();\n parse_gift($gift, $questions, $errors);\n $this->assertEquals($questions[0]->parsed_answer[0][2], \"You got it wrong.\");\n $this->assertEquals($questions[0]->parsed_answer[1][2], \"You got it.\");\n\n // Check a string without properly formed feedback\n $gift = \"::Q1 T/F:: 1+1=2 {T#You got it.}\";\n $questions = array();\n $errors = array();\n parse_gift($gift, $questions, $errors);\n // we should get an error indicating that there was an issue with the feedback...\n $this->assertTrue(strpos($errors[0], \"malformed True/False feedback\") === 0);\n\n // but the rest of the question should still parse\n $this->assertEquals($questions[0]->question, \"1+1=2\");\n $this->assertEquals($questions[0]->type, \"true_false_question\");\n }", "function print_insert_question_form($action, $error, $p) {\n $c[$p['answer']] = \"checked\";\n\t$message = '';\n\tif ($error) \n\t\t$message = \"All fields must be filled out\";\n\n\techo '\t\t\n <form method=\"post\" action=\"'.$action.'\">\n \t\n\t\t<label>Question<br>\n\t\t<textarea name=\"question\" rows=\"3\">'.$p['question'].'</textarea>\n\t\t</label><br>\n\t\t\n\t\t<label>Choice 1\n\t\t<br>\n\t\t<input type=\"text\" name=\"choice1\" size=\"50\" value=\"'.$p['choice1'].'\">\n\t\t</label>\n\t\t<input type=\"radio\" name=\"answer\" value=\"1\" '.$c[1].'>\n\t\t<br>\n\t\t\n\t\t<label>Choice 2\n\t\t<br>\n\t\t<input type=\"text\" name=\"choice2\" size=\"50\" value=\"'.$p['choice2'].'\">\n\t\t</label>\n\t\t<input type=\"radio\" name=\"answer\" value=\"2\" '.$c[2].'>\n\t\t<br>\n\t\t\n\t\t<label>Choice 3\n\t\t<br>\n\t\t<input type=\"text\" name=\"choice3\" size=\"50\" value=\"'.$p['choice3'].'\">\n\t\t</label>\n\t\t<input type=\"radio\" name=\"answer\" value=\"3\" '.$c[3].'>\n\t\t<br>\n\t\t\n\t\t<label>Choice 4\n\t\t<br>\n\t\t<input type=\"text\" name=\"choice4\" size=\"50\" value=\"'.$p['choice4'].'\">\n\t\t</label>\n\t\t<input type=\"radio\" name=\"answer\" value=\"4\" '.$c[4].'>\n\t\t<br>\n\t\t\t\t\t\n\t\t<input type=\"submit\" name=\"action\" value=\"Insert\">\n\t\t'.$message.'\n\t</form>\n\t';\n}", "function token_rules_input_evaluator_help($variables) {\r\n\r\n foreach ($variables as $name => $info) {\r\n $type = _token_rules_map_type($info['type']);\r\n if ($type) {\r\n $form[$name] = array(\r\n '#type' => 'fieldset',\r\n '#title' => t('Replacement patterns for @name', array('@name' => $info['label'])),\r\n '#collapsible' => TRUE,\r\n '#collapsed' => TRUE,\r\n );\r\n $form[$name]['content'] = array(\r\n '#value' => theme('token_help', $type, TOKEN_PREFIX. $name . ':', TOKEN_SUFFIX),\r\n );\r\n }\r\n }\r\n return $form;\r\n}", "function readquestion($lines) {\n /// this format, this function converts it into a question \n /// object suitable for processing and insertion into Moodle.\n\n echo \"<p>This quiz format has not yet been completed!</p>\";\n\n return NULL;\n }", "public function prepareVars()\n {\n $this->vars['value'] = $this->getKeyValue();\n $this->vars['field'] = $this->formField;\n $this->vars['nameValue'] = $this->getNameValue();\n $this->vars['descriptionValue'] = $this->getDescriptionValue();\n $this->vars['addresses'] = $this->getAddresses();\n $this->vars['listWidget'] = $this->listWidget;\n $this->vars['searchWidget'] = $this->searchWidget;\n\n $this->vars['title'] = $this->title;\n $this->vars['prompt'] = str_replace('%s', '<i class=\"icon-th-list\"></i>', e(trans($this->prompt)));\n\n }", "function sensei_custom_lesson_quiz_text () {\n\t$text = \"Report What You Have Learned\";\n\treturn $text;\n}", "private function printAnswerPage() {\n\t\t$correctVocabulary = 0;\n\t\t$wrongVocabulary = 1;\n\t\tinclude ('html/vocabularyAnswer.php');\n\t}", "public function test_export_formattings() {\n $qdata = new stdClass();\n $qdata->id = 123;\n $qdata->contextid = 0;\n $qdata->qtype = 'shortanswer';\n $qdata->name = 'Short answer question';\n $qdata->questiontext = \"<p>This is some text <a href=\\\"test\\\">link</a></p>\";\n $qdata->questiontextformat = FORMAT_HTML;\n $qdata->generalfeedback = 'The answer is Beta.';\n $qdata->generalfeedbackformat = FORMAT_HTML;\n $qdata->defaultmark = 1;\n $qdata->length = 1;\n $qdata->penalty = 0.3333333;\n $qdata->hidden = 0;\n \n $qdata->options = new stdClass();\n $qdata->options->usecase = 0;\n \n $qdata->options->answers = array(\n 13 => new question_answer(13, 'Beta', 1, 'Well done!', FORMAT_HTML),\n 14 => new question_answer(14, '*', 0, 'Doh!', FORMAT_HTML),\n );\n \n // Export the question.\n $exporter = new qformat_smart();\n $questions = array($qdata);\n $zipcontent = $exporter->export_questions($questions);\n \n // Open exported question as import_data.\n $import_data = $this->zip_to_import_data($zipcontent);\n \n /*\n * Test content of pages.\n */\n \n // Test number of pages.\n $this->assertCount(2, $import_data->pages);\n \n $page = $import_data->pages[1];\n $questions = $page->xpath('//g[@class=\"question\"]');\n $this->assertCount(1, $questions);\n $question = $questions[0];\n \n // Test the question text without formattings.\n $expectedquestiontext = 'This is some text link';\n $questiontext = strip_tags($question->text[1]->asXML());\n $this->assertEquals($expectedquestiontext, $questiontext);\n \n $page = $import_data->pages[0];\n $infotexts = $page->xpath('//text');\n // Test that text element is present\n $this->assertCount(1, $infotexts);\n $infotext = $infotexts[0];\n \n // Tests if text is not empty\n $expectedinfotext = '';\n $infotext = strip_tags($infotext->asXML());\n $this->assertNotEquals($expectedinfotext, $questiontext);\n \n }", "function titleKeyWords()\n\t{\n\t\tif(isset($_REQUEST['questionID']))\n\t\t{\n\t\t\t//print strip_tags(myTruncate(get_forum_nameByAphorismID($_REQUEST['questionID']), 100, ' ', ' ... ')).' - Фрази, афоризми, умни мисли, забавни изказвания, лозунги и др';\n\t\t}\n\t\telse \n\t\t{\n\t\t\tprint 'Фрази, афоризми, умни мисли, забавни изказвания, лозунги и др';\n\t\t}\n\t\n\t}", "function displayTheQuestions($questions) {\n\tif (count($questions) > 0) {\n\t\tforeach ($questions as $key => $value) {\n\t\t\techo \"<b>$value[0]</b><br/><br/>\";\n\t\t\t\n\t\t\t// Break the choices appart into a choice array\n\t\t\t$choices = explode(\",\",$value[1]);\n\t\t\t\n\t\t\t// For each choice, create a radio button as part of that questions radio button group\n\t\t\t// Each radio will be the same group name (in this case the question number) and have\n\t\t\t// a value that is the first letter of the choice.\n\t\t\t\n\t\t\tforeach($choices as $value) {\n\t\t\t\t$letter = substr(trim($value),0,1);\n\t\t\t\techo \"<input type=\\\"radio\\\" name=\\\"$key\\\" value=\\\"$letter\\\">$value<br/>\";\n\t\t\t}\n\t\t\t\n\t\t\techo \"<br/>\";\n\t\t}\n\t}\n\telse { echo \"No questions to display.\"; }\n}", "private function parseStudyInformation()\n {\n //\"FEEIT B-RK den [term 3, year 3]\"\n //\"ICSM FEEIT, ext FIIT\" //teacher\n\n if (str_contains($this->study_information, 'FEEIT I')) {\n $this->study_level = 2;\n $this->rank = substr($this->study_information, -2, 1) + 3;\n } elseif (str_contains($this->study_information, 'FEEIT B')) {\n $this->study_level = 1;\n $this->rank = substr($this->study_information, -2, 1);\n }\n }", "function build_question(array $merge, $mergeInto){\n\tif (count($_SESSION['ef_term_merge']['question']))\n\t{\n\t\tunset($_SESSION['ef_term_merge']['question']);\n\t}\n\n\t$aliasList = retrieve_multiple_url_alias($merge);\n\n\t$mergeIntoUrlAlias = \"select a.alias from url_alias a where a.source LIKE :source\";\n\n\t$mergeIntoUrlAlias = db_query($mergeIntoUrlAlias,array(':source' => 'taxonomy/term/' . $mergeInto->tid))->fetchAll();\n\n\t$question = \"The term/s\";\n\n\t$counter = 0;\n\t$_SESSION['ef_term_merge']['question']['from'] = [];\n\n\tforeach ($merge as $key => $term)\n\n\t{\n\t \t$question = $question . \" <a href='/\" . $aliasList[$counter] . \"' target='_blank'>\" . $term->name . \"</a> (tid: \" . $term->tid . \", taxonomy: \" . \"<a href='/admin/structure/taxonomy/\" . $term->vocabulary_machine_name . \"' target='_blank'>\" . taxonomy_vocabulary_machine_name_load($term->vocabulary_machine_name)->name . \"</a>)\";\n\n\t \t$counter++;\n\n\t\t$_SESSION['ef_term_merge']['question']['from'][] = [\n\t\t\t'name' => $term->name,\n\t\t\t'tid' => $term->tid,\n\t\t\t'taxonomy' => $term->vocabulary_machine_name,\n\t\t];\n\n\n\t}\n\n\t$question = $question . \" is/are going to be merged into <a href='/\" . $mergeIntoUrlAlias[0]->alias .\"' target='_blank'>\" . $mergeInto->name . \"</a> (tid: \" . $mergeInto->tid .\", taxonomy: <a href='/admin/structure/taxonomy/\" . $mergeInto->vocabulary_machine_name .\"' target='_blank'>\" . taxonomy_vocabulary_machine_name_load($mergeInto->vocabulary_machine_name)->name .\"</a>).\";\n\n\t$_SESSION['ef_term_merge']['question']['to'][] = [\n\t\t'name' => $mergeInto->name,\n\t\t'tid' => $mergeInto->tid,\n\t\t'taxonomy' => $mergeInto->vocabulary_machine_name,\n\t];\n\n\treturn $question;\n\n}", "function print_insert_question_form_bs($action, $error, $p) {\n\t$c[$p['answer']] = \"checked\";\n\t$message = '';\n\tif ($error) {\n\t\t\t\t$message = '\n\t\t\t<div class=\"alert alert-warning\">\n\t\t\t\tAll fields must be filled out\n\t\t\t</div>';\n\t}\n\t\n\n\techo '\n <form method=\"post\" action=\"'.$action.'\">\n \n\t\t<!-- Question -->\n\t\t<div class=\"form-group row\">\n\t\t <label for=\"question\" class=\"col-sm-2 col-form-label\">\n\t\t \tQuestion\n\t\t </label>\n\t\t <div class=\"col-sm-10\">\n\t\t <textarea class=\"form-control\" id=\"question\" rows=\"2\" name=\"question\">'.$p['question'].'</textarea>\n\t\t </div>\n\t\t</div>\n\t\t\n\t\t<!-- Column Header -->\n\t\t<div class=\"row hidden-xs-down\">\n\t\t <div class=\"col-sm-2 offset-sm-10 text-center\">\n\t\t Answer\n\t\t </div>\n\t\t</div>\n\t\t\n\t\t<!-- Choice1 -->\n\t\t<div class=\"form-group row\">\n\t\t <label for=\"choice1\" class=\"col-sm-2 col-form-label\">\n\t\t \tChoice1\n\t\t </label>\n\t\t <div class=\"col-sm-8\">\n\t\t <input type=\"text\" class=\"form-control\" id=\"choice1\" name=\"choice1\" value=\"'.$p['choice1'].'\">\n\t\t </div>\n\t\t <div class=\"form-check col-sm-2 text-center\">\n\t\t \t<label class=\"form-check-label\" for=\"answer1\">\n\t\t \t<input class=\"form-check-input\" type=\"radio\" name=\"answer\" id=\"answer1\" value=\"1\" '.$c[1].'> \n\t\t \t&nbsp;\n\t\t \t<span class=\"hidden-sm-up\">Answer</span>\n\t\t </label>\n\t\t </div>\n\t\t</div>\n\t\t\n\t\t<!-- Choice2 -->\n\t\t<div class=\"form-group row\">\n\t\t <label for=\"choice2\" class=\"col-sm-2 col-form-label\">\n\t\t \tChoice2\n\t\t </label>\n\t\t <div class=\"col-sm-8\">\n\t\t <input type=\"text\" class=\"form-control\" id=\"choice2\" name=\"choice2\" value=\"'.$p['choice2'].'\">\n\t\t </div>\n\t\t <div class=\"form-check col-sm-2 text-center\">\n\t\t \t<label class=\"form-check-label\" for=\"answer2\">\n\t\t \t<input class=\"form-check-input\" type=\"radio\" name=\"answer\" id=\"answer2\" value=\"2\" '.$c[2].'>\n\t\t \t&nbsp;\n\t\t \t<span class=\"hidden-sm-up\">Answer</span>\n\t\t </label>\n\t\t </div>\n\t\t</div>\n\t\t\n\t\t<!-- Choice3 -->\n\t\t<div class=\"form-group row\">\n\t\t <label for=\"choice3\" class=\"col-sm-2 col-form-label\">\n\t\t \tChoice3\n\t\t </label>\n\t\t <div class=\"col-sm-8\">\n\t\t <input type=\"text\" class=\"form-control\" id=\"choice3\" name=\"choice3\" value=\"'.$p['choice3'].'\">\n\t\t </div>\n\t\t <div class=\"form-check col-sm-2 text-center\">\n\t\t \t<label class=\"form-check-label\" for=\"answer3\">\n\t\t \t<input class=\"form-check-input\" type=\"radio\" name=\"answer\" id=\"answer3\" value=\"3\" '.$c[3].'>\n\t\t \t&nbsp;\n\t\t \t<span class=\"hidden-sm-up\">Answer</span>\n\t\t </label>\n\t\t </div>\n\t\t</div>\n\t\t\n\t\t<!-- Choice4 -->\n\t\t<div class=\"form-group row\">\n\t\t <label for=\"choice4\" class=\"col-sm-2 col-form-label\">\n\t\t \tChoice4\n\t\t </label>\n\t\t <div class=\"col-sm-8\">\n\t\t <input type=\"text\" class=\"form-control\" id=\"choice4\" name=\"choice4\" value=\"'.$p['choice4'].'\">\n\t\t </div>\n\t\t <div class=\"form-check col-sm-2 text-center\">\n\t\t \t<label class=\"form-check-label\" for=\"answer4\">\n\t\t \t<input class=\"form-check-input\" type=\"radio\" name=\"answer\" id=\"answer4\" value=\"4\" '.$c[4].'>\n\t\t \t&nbsp;\n\t\t \t<span class=\"hidden-sm-up\">Answer</span>\n\t\t </label>\n\t\t </div>\n\t\t</div> \n\t\t\n\t\t<!-- Insert Button -->\n\t\t<div class=\"form-group row\">\t\n\t\t <div class=\"col-sm-10\">'.\n\t\t $message.'\n\t\t </div>\n\t\t <div class=\"col-sm-2 text-center\">\n\t\t <input type=\"submit\" class=\"btn btn-success\" value=\"Insert\">\n\t\t </div>\n\t\t</div>\n \n </form>\n ';\t\n}", "public function addQuestionAndAnswers () {\n global $tpl, $ilTabs;\n $ilTabs->activateTab(\"editQuiz\");\n $this->initAddQuestionAndAnswersForm();\n }", "function get_post_format_strings()\n {\n }", "public function GetFormPostedValuesQuestions() {\n\t\t/* THE ARRAY OF POSTED FIELDS */\n\t\t$req_fields=array(\"survey_id\",\"question\");\n\n\t\tfor ($i=0;$i<count($req_fields);$i++) {\n\n\t\t\t//echo $_POST['application_id'];\n\t\t\tif (ISSET($_POST[$req_fields[$i]]) && !EMPTY($_POST[$req_fields[$i]])) {\n\t\t\t\t$this->SetVariable($req_fields[$i],EscapeData($_POST[$req_fields[$i]]));\n\t\t\t}\n\t\t\telse {\n\t\t\t\t//echo \"<br>\".$this->req_fields[$i].\"<br>\";\n\t\t\t\t$this->$req_fields[$i]=\"\";\n\t\t\t}\n\t\t}\n\t}", "public function showResults(){\n $this->extractQuestions();\n }", "public function pi_process_alumni_survey( $posted ){\n\t\t$content = '';\n\t\tforeach ($posted as $key => $value) {\n\t\t\tif( $key === 'pi_survey_nonce_field' || $key === '_wp_http_referer' || $key === 'survey_submitted'){\n\t\t\t\t$content .= '';\n\t\t\t}else{\n\t\t\t\tif( !empty($value) ){\n\t\t\t\t\t$value = trim($value);\n\t\t\t\t\tswitch( $key ){\n\t\t\t\t\t\tcase 'email':\n\t\t\t\t\t\t\tif( is_email( $value ) ){\n\t\t\t\t\t\t\t\t$header = 'Email: ';\n\t\t\t\t\t\t\t\t$value = sanitize_email( $value );\n\t\t\t\t\t\t\t\t$content .= $header . ': ' . $value . '<br>';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'date-month':\n\t\t\t\t\t\t\t$content .= 'Date began treatment: '. sanitize_text_field($value) . '/' ;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'date-day':\n\t\t\t\t\t\t\t$content .= sanitize_text_field($value) . '/';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'date-year':\n\t\t\t\t\t\t\t$content .= sanitize_text_field($value) . '<br>';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'facility-name':\n\t\t\t\t\t\t\t$value = sanitize_text_field( $value );\n\t\t\t\t\t\t\t$content .= 'Facility Name: ' . $value . '<br>';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'led-decision':\n\t\t\t\t\t\t\t$header = 'What led to the decision? ';\n\t\t\t\t\t\t\t$value = sanitize_text_field( $value );\n\t\t\t\t\t\t\t$content .= $header . ': ' . $value . '<br>';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'how-choice':\n\t\t\t\t\t\t\t$header = 'How did you choose this treatment facility? ';\n\t\t\t\t\t\t\t$value = sanitize_text_field( $value );\n\t\t\t\t\t\t\t$content .= $header . ': ' . $value . '<br>';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'condition':\n\t\t\t\t\t\t\t$header = 'What condition were you treated for? ';\n\t\t\t\t\t\t\t$value = sanitize_text_field( $value );\n\t\t\t\t\t\t\t$content .= $header . ': ' . $value . '<br>';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'long-ago':\n\t\t\t\t\t\t\t$header = 'How long has it been since you left treatment? ';\n\t\t\t\t\t\t\t$value = sanitize_text_field( $value );\n\t\t\t\t\t\t\t$content .= $header . ': ' . $value . '<br>';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'before-complete':\n\t\t\t\t\t\t\t$header = 'Did you leave the treatment center before completing your treatment program? If yes, explain. ';\n\t\t\t\t\t\t\t$value = sanitize_text_field( $value );\n\t\t\t\t\t\t\t$content .= $header . ': ' . $value . '<br>';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'counselor-additional':\n\t\t\t\t\t\t\t$header = 'Integration of holistic and alternatice treatments...';\n\t\t\t\t\t\t\t$value = sanitize_text_field( $value );\n\t\t\t\t\t\t\t$content .= $header . ': ' . $value . '<br>';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'approriate':\n\t\t\t\t\t\t\t$header = 'If you were diagnosed with corresponding psychiatric or psychological conditions such as anxiety, depression, PTSD or OCD, were they addressed appropriately during treatment? ';\n\t\t\t\t\t\t\t$value = sanitize_text_field( $value );\n\t\t\t\t\t\t\t$content .= $header . ': ' . $value . '<br>';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'after-care':\n\t\t\t\t\t\t\t$header = 'Did the treatment center provide you with resources or aftercare support? ';\n\t\t\t\t\t\t\t$value = sanitize_text_field( $value );\n\t\t\t\t\t\t\t$content .= $header . ': ' . $value . '<br>';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'relapse':\n\t\t\t\t\t\t\t$header = 'Did you relapse after treatment? ';\n\t\t\t\t\t\t\t$value = sanitize_text_field( $value );\n\t\t\t\t\t\t\t$content .= $header . ': ' . $value . '<br>';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'reenter':\n\t\t\t\t\t\t\t$header = 'Did you re-enter this facility after you relapsed? ';\n\t\t\t\t\t\t\t$value = sanitize_text_field( $value );\n\t\t\t\t\t\t\t$content .= $header . ': ' . $value . '<br>';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'education':\n\t\t\t\t\t\t\t$header = 'Did the treatment program provide you with the appropriate education and recovery tools to help you in your journey toward sobriety? ';\n\t\t\t\t\t\t\t$value = sanitize_text_field( $value );\n\t\t\t\t\t\t\t$content .= $header . ': ' . $value . '<br>';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'needs':\n\t\t\t\t\t\t\t$header = 'Did the program take your specific needs into consideration during individual and group therapy sessions? ';\n\t\t\t\t\t\t\t$value = sanitize_text_field( $value );\n\t\t\t\t\t\t\t$content .= $header . ': ' . $value . '<br>';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'expectations':\n\t\t\t\t\t\t\t$header = 'Did the addiction center and your specific treatment program meet your needs and expectations? ';\n\t\t\t\t\t\t\t$value = sanitize_text_field( $value );\n\t\t\t\t\t\t\t$content .= $header . ': ' . $value . '<br>';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'recommend':\n\t\t\t\t\t\t\t$header = 'Would you recommend this treatment facility to a friend or family member who needs help for their substance dependency? ';\n\t\t\t\t\t\t\t$value = sanitize_text_field( $value );\n\t\t\t\t\t\t\t$content .= $header . ': ' . $value . '<br>';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'return':\n\t\t\t\t\t\t\t$header = 'Would you return to this facility if you needed additional treatment or suffered a relapse? ';\n\t\t\t\t\t\t\t$value = sanitize_text_field( $value );\n\t\t\t\t\t\t\t$content .= $header . ': ' . $value . '<br>';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t$header = str_replace(\"-\",\" \",$key); \n\t\t\t\t\t\t\t$header = ucwords($header);\n\t\t\t\t\t\t\t$value = sanitize_text_field($value);\n\t\t\t\t\t\t\t$content .= $header . ': ' . $value . '<br>'; \n\t\t\t\t\t}\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $content;\t\n\t}", "public function field_custom_variables() {\n\n\t\t$custom_vars = $this->_get_options( 'custom_vars' );\n\n\t\t$scope_options = array(\n\t\t\t\t0 => __( 'Default', 'wp-google-analytics' ),\n\t\t\t\t1 => __( 'Visitor', 'wp-google-analytics' ),\n\t\t\t\t2 => __( 'Session', 'wp-google-analytics' ),\n\t\t\t\t3 => __( 'Page', 'wp-google-analytics' ),\n\t\t\t);\n\t\tfor ( $i = 1; $i <= 5; $i++ ) {\n\t\t\t$name = ( isset( $custom_vars[$i]['name'] ) ) ? $custom_vars[$i]['name'] : '';\n\t\t\t$value = ( isset( $custom_vars[$i]['value'] ) ) ? $custom_vars[$i]['value'] : '';\n\t\t\t$scope = ( isset( $custom_vars[$i]['scope'] ) ) ? $custom_vars[$i]['scope'] : 0;\n\t\t\techo '<label for=\"wga_custom_var_' . $i . '_name\"><strong>' . $i . ')</strong>&nbsp;' . __( 'Name', 'wp-google-analytics' ) . '&nbsp;';\n\t\t\techo '<input id=\"wga_custom_var_' . $i . '\" type=\"text\" name=\"wga[custom_vars][' . $i . '][name]\" value=\"' . esc_attr( $name ) . '\" />';\n\t\t\techo '</label>&nbsp;&nbsp;';\n\t\t\techo '<label for=\"wga_custom_var_' . $i . '_value\">' . __( 'Value', 'wp-google-analytics' ) . '&nbsp;';\n\t\t\techo '<input id=\"wga_custom_var_' . $i . '\" type=\"text\" name=\"wga[custom_vars][' . $i . '][value]\" value=\"' . esc_attr( $value ) . '\" />';\n\t\t\techo '</label>&nbsp;&nbsp;';\n\t\t\techo '<label for=\"wga_custom_var_' . $i . '_scope\">' . __( 'Scope', 'wp-google-analytics' ) . '&nbsp;';\n\t\t\techo '<select id=\"wga_custom_var_' . $i . '_scope\" name=\"wga[custom_vars][' . $i . '][scope]\">';\n\t\t\tforeach( $scope_options as $key => $label ) {\n\t\t\t\techo '<option value=\"' . $key . '\" ' . selected( $scope, $key, false ) . '>';\n\t\t\t\techo $label . '</option>';\n\t\t\t}\n\t\t\techo '</select>';\n\t\t\techo '</label><br />';\n\t\t}\n\n\t}", "function locationsHelp($text){\n array_push($text, array('key' => 'PARENT_LOCATIONS_HELP',\n 'parent' => '',\n 'text' => 'Locations - Help'));\n \n array_push($text, array('key' => 'LOCATIONS_HELP',\n 'parent' => 'PARENT_LOCATIONS_HELP',\n 'text' => 'Click on a location item to open the editing area.'));\n array_push($text, array('key' => 'LOCATIONS_ADD_LOCATION_HELP',\n 'parent' => 'PARENT_LOCATIONS_HELP',\n 'text' => 'Click on the \"plus\" icon to add a location.'));\n \n /*\n * Location help.\n */\n array_push($text, array('key' => 'LOCATIONS_LOCATION_HELP',\n 'parent' => 'PARENT_LOCATIONS_HELP',\n 'text' => 'Click the \"trash\" icon to delete the location.'));\n array_push($text, array('key' => 'LOCATIONS_LOCATION_NAME_HELP',\n 'parent' => 'PARENT_LOCATIONS_HELP',\n 'text' => 'Change location name.'));\n array_push($text, array('key' => 'LOCATIONS_LOCATION_ADDRESS_HELP',\n 'parent' => 'PARENT_LOCATIONS_HELP',\n 'text' => 'Enter location address or drag the marker on the map to select it.'));\n array_push($text, array('key' => 'LOCATIONS_LOCATION_ALT_ADDRESS_HELP',\n 'parent' => 'PARENT_LOCATIONS_HELP',\n 'text' => 'Enter an alternative address if the marker is in the correct position but the address is not right.'));\n\t\t\n array_push($text, array('key' => 'LOCATIONS_LOCATION_LINK_HELP',\n 'parent' => 'PARENT_LOCATIONS_HELP',\n 'text' => 'Enter the link of your site. Make sure it redirects to a page where people can make a booking or can view relevant content.'));\n array_push($text, array('key' => 'LOCATIONS_LOCATION_IMAGE_HELP',\n 'parent' => 'PARENT_LOCATIONS_HELP',\n 'text' => 'Make sure the image is relevant to your business.'));\n array_push($text, array('key' => 'LOCATIONS_LOCATION_BUSINESSES_HELP',\n 'parent' => 'PARENT_LOCATIONS_HELP',\n 'text' => 'Select what kind of businesses you have at this location. You can select multiple businesses.'));\n array_push($text, array('key' => 'LOCATIONS_LOCATION_BUSINESSES_OTHER_HELP',\n 'parent' => 'PARENT_LOCATIONS_HELP',\n 'text' => 'We will add them in the list as soon as possible.'));\n array_push($text, array('key' => 'LOCATIONS_LOCATION_LANGUAGES_HELP',\n 'parent' => 'PARENT_LOCATIONS_HELP',\n 'text' => 'Enter the languages that are spoken in your business. You can select multiple languages.'));\n array_push($text, array('key' => 'LOCATIONS_LOCATION_EMAIL_HELP',\n 'parent' => 'PARENT_LOCATIONS_HELP',\n 'text' => 'Enter the email where we can contact you if there are problems with your submission'));\n \n return $text;\n }", "function injectAnswerField($string, $name = 'answer', $origin = null){\n $tmpl = loadFieldTemplate();\n return preg_replace_callback(\n '|\\[--answer--]|m',\n function ($matches) use ($name, $origin, $tmpl) {\n return $tmpl->renderBlock('answer', array('name' => $name, 'answer' => @$origin['answer']));\n },\n $string);\n }", "function interpreting($data) {\r\n $patterns = array();\r\n $remplacements = array();\r\n $patterns[0] = '#(\\$motClef|\\$motCl(é|e))#i';\r\n $remplacements[0] = '\\s(algorithme|procedure|fonction|si|sinon|fin_?si|tant_?que|fin_?tant_?que|selon|autrement|'\r\n . 'fin_?selon|pour|fin_?pour|et|ou|mod|div)\\s';\r\n \r\n $patterns[1] = '#\\$variable#i';\r\n $remplacements[1] = '(\\w+) ?';\r\n \r\n $patterns[2] = '#\\$op(é|e)rateur#i';\r\n $remplacements[2] = '(\\+|\\-|\\/|\\*|\\sdiv\\s|\\smod\\s)';\r\n \r\n $patterns[3]= '#\\$tout#i';\r\n $remplacements[3]= '(.*)';\r\n \r\n $patterns[4] = '#\\$entier#i';\r\n $remplacements[4]= '(-?[0-9]+)';\r\n \r\n $patterns[5]= '#\\$reel#';\r\n $remplacements[5]= '[\\-\\+]?[0-9]*(\\.[0-9]+)?';\r\n \r\n $patterns[6] = '#\\$caract(e|è)re#';\r\n $remplacements[6]= \"(\\'\\w\\')\";\r\n \r\n $patterns[7]= '#$cha(i|î)ne#';\r\n $remplacements[7]= '(\\\"(.*)\\\")';\r\n \r\n $patterns[8]= '#\\$bool(é|e)en#';\r\n $remplacements[8]= '(vrai|faux|true|false)';\r\n \r\n $patterns[9]= '#\\$type#';\r\n $remplacements[9]= '\\s(entier|r(é|e)el|caract(e|è)re|cha(i|î)ne|bool(é|e)en)\\s';\r\n \r\n $patterns[10]= '#\\$relation#';\r\n $remplacements[10]= '(==|\\<|\\>|\\<=|\\>=|\\!=)';\r\n \r\n $patterns[11]= '#\\$logique#';\r\n $remplacements[12]= '\\s(et|ou|ouex|non)\\s';\r\n \r\n\r\n\r\n foreach($data as &$currentValue) {\r\n $currentValue['layout'] = preg_replace($patterns, $remplacements, $currentValue['layout']);\r\n $currentValue['layout'] = '#'.$currentValue['layout'].'#iU';\r\n }\r\n return $data;\r\n}", "function answerQuestions() {\n $this->layout = 'survey'; // use the more basic survey layout\n if (!$this->request->is('post')) {\n // if there is no data then show the initial view\n $survey = $this->Session->read('Survey.original'); // get the survey being used\n if (empty($survey['Question'])) { // if there are no questions then we don't need to show the question form at all\n $this->Session->write('Survey.progress', GDTA_ENTRY); // move progress forward and redirect to the runSurvey action\n $this->redirect(array('action' => 'runSurvey'));\n }\n $questions = $survey['Question'];\n $answers = ($this->Session->check('Survey.answers')) ? $this->Session->read('Survey.answers') : array(); // check to see if there are already answers in the session\n $choices = array(); // gather choices here keyed to each question id\n foreach ($questions as &$q) { // go through each question and look to see if there is an answer for it\n $checkId = $q['id'];\n $choices[$checkId] = array();\n if (isset($q['Choice'])) {\n foreach ($q['Choice'] as $choice) {\n $choices[$checkId][$choice['id']] = $choice['value'];\n }\n }\n foreach ($answers as $a) {\n if ($a['question_id'] == $checkId) {\n if ($q['type'] == MULTI_SELECT) {\n $q['answer'] = Set::extract('/id',$a['answer']);\n } else {\n $q['answer'] = $a['answer'];\n }\n break;\n }\n }\n }\n $this->set('questions', $questions); // send questions to the view\n $this->set('choices', $choices); // send choices for questions to the view, ordered for form elements\n } else { // we have form data so process it here\n if (isset($this->request->data['Answer'])) {\n // make sure we have answers in the data set\n $this->Session->write('Survey.answers', $this->request->data['Answer']); // write the answers to the session\n }\n $this->Session->write('Survey.progress', GDTA_ENTRY); // move progress forward and redirect to the runSurvey action\n $this->redirect(array('action' => 'runSurvey'));\n }\n }", "public function SetCustomVars()\n\t\t{\n\t\t\t$this->_variables['displayname'] = array(\"name\" => GetLang($this->_languagePrefix.'DisplayName'),\n\t\t\t \"type\" => \"textbox\",\n\t\t\t \"help\" => GetLang('DisplayNameHelp'),\n\t\t\t \"default\" => $this->GetName(),\n\t\t\t \"required\" => true\n\t\t\t);\n\n\t\t\t$this->_variables['productid'] = array(\"name\" => GetLang($this->_languagePrefix.'ProductId'),\n\t\t\t \"type\" => \"textbox\",\n\t\t\t \"help\" => GetLang($this->_languagePrefix.'ProductIdHelp'),\n\t\t\t \"default\" => \"\",\n\t\t\t \"required\" => true\n\t\t\t);\n\n\t\t\t$this->_variables['sharedsecret'] = array(\"name\" => GetLang($this->_languagePrefix.'SharedSecret'),\n\t\t\t \"type\" => \"textbox\",\n\t\t\t \"help\" => GetLang($this->_languagePrefix.'SharedSecretHelp'),\n\t\t\t \"default\" => \"\",\n\t\t\t \"required\" => true\n\t\t\t);\n\t\t}", "function display_format($var) {\n\tswitch($var) {\n\n\tcase \"sticker\":\t\treturn \"Sticker #\";\n\tcase \"type\":\t\treturn \"Type\";\n\tcase \"description\":\treturn \"Description\";\n\tcase \"serial\":\t\treturn \"Serial\";\n\tcase \"purchasedate\":\treturn \"Purchase Date\";\n\tcase \"temp_assignment\":\treturn \"Assignment\";\n\tcase \"computernumber\":\treturn \"Number\";\n\tcase \"videocard\":\treturn \"Video Card\";\n\tcase \"videobus\":\treturn \"Bus Type\";\n\tcase \"cpu\":\t\treturn \"CPU Type\";\n\tcase \"harddrive\":\treturn \"Hard Drive\";\n\tcase \"memory\":\t\treturn \"Memory\";\n\tcase \"servicetag\":\treturn \"Dell Tag\";\n\tcase \"batch\":\t\treturn \"Batch\";\n\tcase \"expresscode\":\treturn \"Express Code\";\n\tcase \"warranty\":\treturn \"Warranty\";\n\tcase \"mayadongle\":\treturn \"Maya Dongle\";\n\tcase \"firstname\":\treturn \"First Name\";\n\tcase \"lastname\":\treturn \"Last Name\";\n\tcase \"department\":\treturn \"Department\";\n\tcase \"extension\":\treturn \"Extension\";\n\tcase \"status\":\t\treturn \"Status\";\n\tcase \"user_status\":\treturn \"Status\";\n\tcase \"active\":\t\treturn \"Active\";\n\t\t\n\tdefault: return \"NOT FORMATTED: $var\";\n\t}\n}", "public function test_export_multichoice_2() {\n $qdata = new stdClass();\n $qdata->id = 123;\n $qdata->contextid = 0;\n $qdata->qtype = 'multichoice';\n $qdata->name = 'Multiple choice question';\n $qdata->questiontext = 'Questiontext of muliple choice question.';\n $qdata->questiontextformat = FORMAT_HTML;\n $qdata->generalfeedback = 'General feedback';\n $qdata->generalfeedbackformat = FORMAT_HTML;\n $qdata->defaultmark = 23;\n $qdata->length = 1;\n $qdata->penalty = 0.3333333;\n $qdata->hidden = 0;\n \n $qdata->options = new stdClass();\n $qdata->options->single = 0;\n $qdata->options->shuffleanswers = 0;\n $qdata->options->answernumbering = 'abc';\n $qdata->options->correctfeedback = '<p>Your answer is correct.</p>';\n $qdata->options->correctfeedbackformat = FORMAT_HTML;\n $qdata->options->partiallycorrectfeedback = '<p>Your answer is partially correct.</p>';\n $qdata->options->partiallycorrectfeedbackformat = FORMAT_HTML;\n $qdata->options->shownumcorrect = 1;\n $qdata->options->incorrectfeedback = '<p>Your answer is incorrect.</p>';\n $qdata->options->incorrectfeedbackformat = FORMAT_HTML;\n \n $qdata->options->answers = array(\n 13 => new question_answer(13, 'answer 1', 0, '', FORMAT_HTML),\n 14 => new question_answer(14, 'answer 2', 1, '', FORMAT_HTML),\n 15 => new question_answer(15, 'answer 3', 0, '', FORMAT_HTML),\n 16 => new question_answer(16, 'answer 4', 1, '', FORMAT_HTML),\n );\n \n $qdata->hints = array(\n new question_hint_with_parts(0, 'Hint 1.', FORMAT_HTML, false, false),\n new question_hint_with_parts(0, 'Hint 2.', FORMAT_HTML, false, false),\n );\n \n \n // Export the question.\n $exporter = new qformat_smart();\n $questions = array($qdata);\n $zipcontent = $exporter->export_questions($questions);\n \n // Open exported question as import_data.\n $import_data = $this->zip_to_import_data($zipcontent);\n \n /*\n * Test content of imsmanifest.xml\n */\n \n $imsmanifest = $import_data->imsmanifest;\n \n $expected = '<resource identifier=\"group0_pages\" href=\"page0.svg\" type=\"webcontent\" adlcp:scormType=\"asset\"><file href=\"page0.svg\"/></resource>';\n $actual = $imsmanifest->resources->resource[0]->asXML();\n $this->assert_same_xml($expected, $actual);\n \n $expected = '<resource identifier=\"pages\" href=\"page0.svg\" type=\"webcontent\" adlcp:scormType=\"asset\"><file href=\"page0.svg\"/></resource>';\n $actual = $imsmanifest->resources->resource[1]->asXML();\n $this->assert_same_xml($expected, $actual);\n \n /*\n * Test content of page.\n */\n \n // Test number of pages.\n $this->assertCount(1, $import_data->pages);\n \n $page = $import_data->pages[0];\n \n // Test the number of question elements.\n $questions = $page->xpath('//g[@class=\"question\"]');\n $this->assertCount(1, $questions);\n \n // Test the question element.\n $question = $questions[0];\n $expectedvotemetadata = '<votemetadata><questiontext format=\"selection\" labelstyle=\"upper-alpha\" correct=\"2 4\" points=\"23\" tags=\"\" explanation=\"General feedback\" mathgradingoption=\"\" likert=\"\"/></votemetadata>';\n $votemetadata = $question->votemetadata->asXML();\n $this->assert_same_xml($expectedvotemetadata, $votemetadata);\n \n // Test the question number.\n $expectedquestionnumber = '1';\n $questionnumber = strip_tags($question->text[0]->asXML());\n $this->assertEquals($expectedquestionnumber, $questionnumber);\n \n // Test the question text without formattings.\n $expectedquestiontext = 'Questiontext of muliple choice question.';\n $questiontext = strip_tags($question->text[1]->asXML());\n $this->assertEquals($expectedquestiontext, $questiontext);\n \n // Test the number of choices.\n $choices = $page->xpath('//g[@class=\"questionchoice\"]');\n $this->assertCount(4, $choices);\n \n // Test the 1. choice element.\n $choice = $choices[0];\n $expectedvotemetadata = '<votemetadata><choicetext label=\"1\" format=\"selection\"/></votemetadata>';\n $votemetadata = $choice->votemetadata->asXML();\n $this->assert_same_xml($expectedvotemetadata, $votemetadata);\n \n // Test the numbering of the choice text without formattings.\n $expectedchoicetext = 'A';\n $choicetext = strip_tags($choice->text[0]->asXML());\n $this->assertEquals($expectedchoicetext, $choicetext);\n \n // Test the choice text without formattings.\n $expectedchoicetext = 'answer 1';\n $choicetext = strip_tags($choice->text[1]->asXML());\n $this->assertEquals($expectedchoicetext, $choicetext);\n \n // Test the 2. choice element.\n $choice = $choices[1];\n $expectedvotemetadata = '<votemetadata><choicetext label=\"2\" format=\"selection\"/></votemetadata>';\n $votemetadata = $choice->votemetadata->asXML();\n $this->assert_same_xml($expectedvotemetadata, $votemetadata);\n \n // Test the numbering of the choice text without formattings.\n $expectedchoicetext = 'B';\n $choicetext = strip_tags($choice->text[0]->asXML());\n $this->assertEquals($expectedchoicetext, $choicetext);\n \n // Test the choice text without formattings.\n $expectedchoicetext = 'answer 2';\n $choicetext = strip_tags($choice->text[1]->asXML());\n $this->assertEquals($expectedchoicetext, $choicetext);\n \n // Test the 3. choice element.\n $choice = $choices[2];\n $expectedvotemetadata = '<votemetadata><choicetext label=\"3\" format=\"selection\"/></votemetadata>';\n $votemetadata = $choice->votemetadata->asXML();\n $this->assert_same_xml($expectedvotemetadata, $votemetadata);\n \n // Test the numbering of the choice text without formattings.\n $expectedchoicetext = 'C';\n $choicetext = strip_tags($choice->text[0]->asXML());\n $this->assertEquals($expectedchoicetext, $choicetext);\n \n // Test the choice text without formattings.\n $expectedchoicetext = 'answer 3';\n $choicetext = strip_tags($choice->text[1]->asXML());\n $this->assertEquals($expectedchoicetext, $choicetext);\n \n // Test the 4. choice element.\n $choice = $choices[3];\n $expectedvotemetadata = '<votemetadata><choicetext label=\"4\" format=\"selection\"/></votemetadata>';\n $votemetadata = $choice->votemetadata->asXML();\n $this->assert_same_xml($expectedvotemetadata, $votemetadata);\n \n // Test the numbering of the choice text without formattings.\n $expectedchoicetext = 'D';\n $choicetext = strip_tags($choice->text[0]->asXML());\n $this->assertEquals($expectedchoicetext, $choicetext);\n \n // Test the choice text without formattings.\n $expectedchoicetext = 'answer 4';\n $choicetext = strip_tags($choice->text[1]->asXML());\n $this->assertEquals($expectedchoicetext, $choicetext);\n }", "public function test_export_multichoice_1() {\n $qdata = new stdClass();\n $qdata->id = 123;\n $qdata->contextid = 0;\n $qdata->qtype = 'multichoice';\n $qdata->name = 'Multiple choice question';\n $qdata->questiontext = 'Questiontext of muliple choice question.';\n $qdata->questiontextformat = FORMAT_HTML;\n $qdata->generalfeedback = 'General feedback';\n $qdata->generalfeedbackformat = FORMAT_HTML;\n $qdata->defaultmark = 23;\n $qdata->length = 1;\n $qdata->penalty = 0.3333333;\n $qdata->hidden = 0;\n \n $qdata->options = new stdClass();\n $qdata->options->single = 0;\n $qdata->options->shuffleanswers = 0;\n $qdata->options->answernumbering = 'abc';\n $qdata->options->correctfeedback = '<p>Your answer is correct.</p>';\n $qdata->options->correctfeedbackformat = FORMAT_HTML;\n $qdata->options->partiallycorrectfeedback = '<p>Your answer is partially correct.</p>';\n $qdata->options->partiallycorrectfeedbackformat = FORMAT_HTML;\n $qdata->options->shownumcorrect = 1;\n $qdata->options->incorrectfeedback = '<p>Your answer is incorrect.</p>';\n $qdata->options->incorrectfeedbackformat = FORMAT_HTML;\n \n $qdata->options->answers = array(\n 13 => new question_answer(13, 'answer 1', 0, '', FORMAT_HTML),\n 14 => new question_answer(14, 'answer 2', 1, '', FORMAT_HTML),\n 15 => new question_answer(15, 'answer 3', 0, '', FORMAT_HTML),\n 16 => new question_answer(16, 'answer 4', 0, '', FORMAT_HTML),\n );\n \n $qdata->hints = array(\n new question_hint_with_parts(0, 'Hint 1.', FORMAT_HTML, false, false),\n new question_hint_with_parts(0, 'Hint 2.', FORMAT_HTML, false, false),\n );\n \n \n // Export the question.\n $exporter = new qformat_smart();\n $questions = array($qdata);\n $zipcontent = $exporter->export_questions($questions);\n \n // Open exported question as import_data.\n $import_data = $this->zip_to_import_data($zipcontent);\n \n /*\n * Test content of imsmanifest.xml\n */\n \n $imsmanifest = $import_data->imsmanifest;\n \n $expected = '<resource identifier=\"group0_pages\" href=\"page0.svg\" type=\"webcontent\" adlcp:scormType=\"asset\"><file href=\"page0.svg\"/></resource>';\n $actual = $imsmanifest->resources->resource[0]->asXML();\n $this->assert_same_xml($expected, $actual);\n \n $expected = '<resource identifier=\"pages\" href=\"page0.svg\" type=\"webcontent\" adlcp:scormType=\"asset\"><file href=\"page0.svg\"/></resource>';\n $actual = $imsmanifest->resources->resource[1]->asXML();\n $this->assert_same_xml($expected, $actual);\n \n /*\n * Test content of page.\n */\n \n // Test number of pages.\n $this->assertCount(1, $import_data->pages);\n \n $page = $import_data->pages[0];\n \n // Test the number of question elements.\n $questions = $page->xpath('//g[@class=\"question\"]');\n $this->assertCount(1, $questions);\n \n // Test the question element.\n $question = $questions[0];\n $expectedvotemetadata = '<votemetadata><questiontext format=\"choice\" labelstyle=\"upper-alpha\" correct=\"2\" points=\"23\" tags=\"\" explanation=\"General feedback\" mathgradingoption=\"\" likert=\"false\"/></votemetadata>';\n $votemetadata = $question->votemetadata->asXML();\n $this->assert_same_xml($expectedvotemetadata, $votemetadata);\n \n // Test the question number.\n $expectedquestionnumber = '1';\n $questionnumber = strip_tags($question->text[0]->asXML());\n $this->assertEquals($expectedquestionnumber, $questionnumber);\n \n // Test the question text without formattings.\n $expectedquestiontext = 'Questiontext of muliple choice question.';\n $questiontext = strip_tags($question->text[1]->asXML());\n $this->assertEquals($expectedquestiontext, $questiontext);\n \n // Test the number of choices.\n $choices = $page->xpath('//g[@class=\"questionchoice\"]');\n $this->assertCount(4, $choices);\n \n // Test the 1. choice element.\n $choice = $choices[0];\n $expectedvotemetadata = '<votemetadata><choicetext label=\"1\" format=\"choice\"/></votemetadata>';\n $votemetadata = $choice->votemetadata->asXML();\n $this->assert_same_xml($expectedvotemetadata, $votemetadata);\n \n // Test the numbering of the choice text without formattings.\n $expectedchoicetext = 'A';\n $choicetext = strip_tags($choice->text[0]->asXML());\n $this->assertEquals($expectedchoicetext, $choicetext);\n \n // Test the choice text without formattings.\n $expectedchoicetext = 'answer 1';\n $choicetext = strip_tags($choice->text[1]->asXML());\n $this->assertEquals($expectedchoicetext, $choicetext);\n \n // Test the 2. choice element.\n $choice = $choices[1];\n $expectedvotemetadata = '<votemetadata><choicetext label=\"2\" format=\"choice\"/></votemetadata>';\n $votemetadata = $choice->votemetadata->asXML();\n $this->assert_same_xml($expectedvotemetadata, $votemetadata);\n \n // Test the numbering of the choice text without formattings.\n $expectedchoicetext = 'B';\n $choicetext = strip_tags($choice->text[0]->asXML());\n $this->assertEquals($expectedchoicetext, $choicetext);\n \n // Test the choice text without formattings.\n $expectedchoicetext = 'answer 2';\n $choicetext = strip_tags($choice->text[1]->asXML());\n $this->assertEquals($expectedchoicetext, $choicetext);\n \n // Test the 3. choice element.\n $choice = $choices[2];\n $expectedvotemetadata = '<votemetadata><choicetext label=\"3\" format=\"choice\"/></votemetadata>';\n $votemetadata = $choice->votemetadata->asXML();\n $this->assert_same_xml($expectedvotemetadata, $votemetadata);\n \n // Test the numbering of the choice text without formattings.\n $expectedchoicetext = 'C';\n $choicetext = strip_tags($choice->text[0]->asXML());\n $this->assertEquals($expectedchoicetext, $choicetext);\n \n // Test the choice text without formattings.\n $expectedchoicetext = 'answer 3';\n $choicetext = strip_tags($choice->text[1]->asXML());\n $this->assertEquals($expectedchoicetext, $choicetext);\n \n // Test the 4. choice element.\n $choice = $choices[3];\n $expectedvotemetadata = '<votemetadata><choicetext label=\"4\" format=\"choice\"/></votemetadata>';\n $votemetadata = $choice->votemetadata->asXML();\n $this->assert_same_xml($expectedvotemetadata, $votemetadata);\n \n // Test the numbering of the choice text without formattings.\n $expectedchoicetext = 'D';\n $choicetext = strip_tags($choice->text[0]->asXML());\n $this->assertEquals($expectedchoicetext, $choicetext);\n \n // Test the choice text without formattings.\n $expectedchoicetext = 'answer 4';\n $choicetext = strip_tags($choice->text[1]->asXML());\n $this->assertEquals($expectedchoicetext, $choicetext);\n }", "public function pi_process_family_survey( $posted ){\n\t\t$content = '';\n\t\tforeach ($posted as $key => $value) {\n\t\t\tif( $key === 'pi_survey_nonce_field' || $key === '_wp_http_referer' || $key === 'survey_submitted'){\n\t\t\t\t$content .= '';\n\t\t\t}else{\n\t\t\t\tif( !empty($value) ){\n\t\t\t\t\t$value = trim($value);\n\t\t\t\t\tswitch( $key ){\n\t\t\t\t\t\tcase 'email':\n\t\t\t\t\t\t\tif( is_email( $value ) ){\n\t\t\t\t\t\t\t\t$header = 'Email: ';\n\t\t\t\t\t\t\t\t$value = sanitize_email( $value );\n\t\t\t\t\t\t\t\t$content .= $header . ': ' . $value . '<br>';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'currently-employed':\n\t\t\t\t\t\t\t$value = sanitize_text_field( $value );\n\t\t\t\t\t\t\t$content .= 'Are you currently employed with this treatment center? ' . $value . '<br>';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'relationship':\n\t\t\t\t\t\t\t$value = sanitize_text_field( $value );\n\t\t\t\t\t\t\t$content .= 'What is your relationship to the individual who has received treatment for their addiction? ' . $value . '<br>';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'date-month':\n\t\t\t\t\t\t\t$content .= 'When did they enter the facility: '. sanitize_text_field($value) . '/' ;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'date-day':\n\t\t\t\t\t\t\t$content .= sanitize_text_field($value) . '/';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'date-year':\n\t\t\t\t\t\t\t$content .= sanitize_text_field($value) . '<br>';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'active-role':\n\t\t\t\t\t\t\t$value = sanitize_text_field( $value );\n\t\t\t\t\t\t\t$content .= 'Did you take on an active role in helping this person make the decision to enter treatment? ' . $value . '<br>';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'resources':\n\t\t\t\t\t\t\t$value = sanitize_text_field( $value );\n\t\t\t\t\t\t\t$content .= 'If you were involved in helping them make their choice, what resources did you use? ' . $value . '<br>';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'contact':\n\t\t\t\t\t\t\t$value = sanitize_text_field( $value );\n\t\t\t\t\t\t\t$content .= 'Did you keep in contact with the patient during his/her stay in the facility? ' . $value . '<br>';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'family':\n\t\t\t\t\t\t\t$value = sanitize_text_field( $value );\n\t\t\t\t\t\t\t$content .= ' Did the treatment center allow for family events and/or family therapy sessions? ' . $value . '<br>';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'benefitted':\n\t\t\t\t\t\t\t$value = sanitize_text_field( $value );\n\t\t\t\t\t\t\t$content .= ' Do you feel this person has benefitted from their time at the treatment facility? ' . $value . '<br>';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'improvement':\n\t\t\t\t\t\t\t$value = sanitize_text_field( $value );\n\t\t\t\t\t\t\t$content .= ' If your answer to the previous question was yes, in what area of their life do you see the most improvement? (You can choose multiple answers) ' . $value . '<br>';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t$header = str_replace(\"-\",\" \",$key); \n\t\t\t\t\t\t\t$header = ucwords($header);\n\t\t\t\t\t\t\t$value = sanitize_text_field($value);\n\t\t\t\t\t\t\t$content .= $header . ': ' . $value . '<br>'; \n\t\t\t\t\t}\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $content;\t\n\t}", "abstract function format();", "function getFields($intQuestion=null) {\n global $LANG;\n foreach($this->arrPrevQuestions as $arrValue) {\n if ($intQuestion==$arrValue[\"uid\"]) {\n $strSelected = ' selected=\"selected\" ';\n } else {\n $strSelected = '';\n }\n $strTitle = '['.$LANG->getLL(\"conditions_page\").' ' . $arrValue[\"page\"] .'] '. $arrValue[\"question\"];\n if (!$this->blnLocalization) {\n \t$arrOutput[] = '<option value=\"'.$arrValue[\"uid\"].'\"'.$strSelected.'>'.substr($strTitle,0,40).'...'.'</option>';\n } elseif ($this->blnLocalization && $strSelected==' selected=\"selected\" ') {\n \t$arrOutput['uid'] = $arrValue[\"uid\"];\n \t$arrOutput['title'] = substr($strTitle,0,40);\n }\n }\n return $arrOutput;\n\t}", "private function part1()\n {\n $this->start();\n\n $groups = explode(\"\\n\\n\", $this->getInput());\n $sum = 0;\n\n foreach ($groups as $group) {\n $answers = [];\n $people = explode(\"\\n\", $group);\n\n foreach ($people as $person) {\n foreach (str_split($person) as $answer) {\n $answers[$answer] = true;\n }\n }\n\n $sum = count($answers) + $sum;\n }\n\n $this->finish();\n\n $this->addPart([\n 'table' => [\n 'headings' => ['Part 1: Answer'],\n 'data' => [[$sum]],\n ],\n 'time' => $this->getTime(),\n ]);\n }", "public function run()\n {\n ExampleQuestion::insert([\n ['value' => 'Why do humans drink cow\\'s milk?'],\n ['value' => 'How many water does it take to make a hamburger?'],\n ['value' => 'How do you handle family dinner?'],\n ['value' => 'Which country has the highest vegans/100 habitants?'],\n ['value' => 'Which vegan cheese is the best to make a lasagna?'],\n ['value' => 'How to you get enough iron in a vegan diet?']\n ]);\n\n }", "public static function formatting_process() {}", "public function quoteInto($text, $data){ $count = substr_count($text, '?');\n if (! $count) {\n // no replacements needed\n return $text;\n }\n \n // only one replacement?\n if ($count == 1) {\n $data = $this->quote($data);\n $text = str_replace('?', $data, $text);\n return $text;\n }\n \n // more than one replacement; force values to be an array, then make \n // sure we have enough values to replace all the placeholders.\n settype($data, 'array');\n if (count($data) < $count) {\n // more placeholders than values\n throw $this->_exception('ERR_NOT_ENOUGH_VALUES', array(\n 'text' => $text,\n 'data' => $data,\n ));\n }\n \n // replace each placeholder with a quoted value\n $offset = 0;\n foreach ($data as $val) {\n // find the next placeholder\n $pos = strpos($text, '?', $offset);\n if ($pos === false) {\n // no more placeholders, exit the data loop\n break;\n }\n \n // replace this question mark with a quoted value\n $val = $this->quote($val);\n $text = substr_replace($text, $val, $pos, 1);\n \n // update the offset to move us past the quoted value\n $offset = $pos + strlen($val);\n }\n \n return $text;\n }", "public function initAddQuestionAndAnswersForm () {\n global $tpl, $ilCtrl;\n\n $my_tpl = new ilTemplate(\"tpl.question_and_answers.html\", true, true,\n \"Customizing/global/plugins/Services/Repository/RepositoryObject/MobileQuiz\");\n $rtokenFactory = new ilCtrl();\n $my_tpl->setVariable(\"ACTION_URL\",$this->ctrl->getFormAction($this));\n $my_tpl->setVariable(\"SUBMIT_BUTTON\", $this->txt(\"save\"));\n $my_tpl->setVariable(\"NEW_QUESTION\", $this->txt(\"question_add_head\"));\n $my_tpl->setVariable(\"QUESTION\", $this->txt(\"question_add_text\"));\n $my_tpl->setVariable(\"QUESTION_TYPE\", $this->txt(\"question_add_type\"));\n $my_tpl->setVariable(\"CHOICES\", $this->txt(\"choice_add_texts\"));\n $my_tpl->setVariable(\"VAR_1\", \"value1\");\n $my_tpl->setVariable(\"COMMAND\", \"cmd[createQuestionAndAnswers]\");\n $my_tpl->setVariable(\"MINIMUM\", $this->txt(\"choice_add_numeric_minimum\"));\n $my_tpl->setVariable(\"MAXIMUM\", $this->txt(\"choice_add_numeric_maximum\"));\n $my_tpl->setVariable(\"STEP\", $this->txt(\"choice_add_numeric_steprange\"));\n $my_tpl->setVariable(\"CORRECT_VALUE\", $this->txt(\"choice_add_numeric_correctvalue\"));\n $my_tpl->setVariable(\"TOLERANCE_RANGE\", $this->txt(\"choice_add_numeric_tolerenace_range\"));\n $my_tpl->setVariable(\"SELECTED_SINGLE\", 'selected=\"selected\"');\n\n $my_tpl->setVariable(\"HIDE_NUMERIC_BLOCK\", 'style=\"display:none;\"');\n $my_tpl->setVariable(\"HIDE_SINGLE_CHOICE_BLOCK\", 'style=\"display:none;\"');\n\n $html = $my_tpl->get();\n $tpl->setContent($html);\n }", "function engine_question_parse($data)\n\t {\n\t $q_tags = $this->Question_data->get_question_tags($data['nId']);\n\t\t\n\t\tif(empty($q_tags))\n\t\t{\n\t\t $this->re_parse($data);\n\t\t}\n\t\telse\n\t\t{\n\t\t $tags_arr = explode('|',$q_tags);\n\t\t\t$location_arr = $this->location_tag_process(array('country_code'=>$data['lang_code'], 'tag'=>$tags_arr, 'nId'=>$data['nId']));\n\t\t\t$tags_arr = $this->trim_localtags($tags_arr,$location_arr);\n\t\t\t$key_arr = $this->key_tag_process(array('lang_code'=>$data['lang_code'], 'tag'=>$tags_arr, 'nId'=>$data['nId']));\n\t\t}\n\t }", "function parseterm($term){\n\t$insertstring = \"INSERT INTO AcademicQuarters (AcademicQuarterID, Name, Year) VALUES('\".$term.\"'\";\n\tif (substr($term, 2 , 1)==1){\n\t\t$temp = (int)substr($term,0 ,2)-1;\n\t\tif ($temp < 10)\n\t\t\t$temp = '0'.(string)$temp;\n\t\telse\n\t\t\t$temp = (string)$temp;\n\t\t$insertstring = $insertstring.\",'Fall','20\".$temp.\"');\";\n\t}\n\tif (substr($term, 2 , 1)==2)\n\t\t$insertstring = $insertstring.\",'Winter','20\". (int)substr($term,0 ,2).\"');\";\n\tif (substr($term, 2 , 1)==3)\n\t\t$insertstring = $insertstring.\",'Spring','20\". (int)substr($term,0 ,2).\"');\";\n\tif (substr($term, 2 , 1)==4)\n\t\t$insertstring = $insertstring.\",'Winter','20\". (int)substr($term,0 ,2).\"');\";\n\n\treturn $insertstring;\n}", "function showMadLib($adj1, $adj2, $adj3, $adj4, $adverb1, $adverb2, $noun1, $noun2, $noun3, $verb1, $verb_past1, $verb_past2 ){\n\tif ( ($adj1 == '')||($noun1 == '')||($verb_past1 == '')||($adverb1 == '')||($adj2 == '')||($noun2 == '')||\n\t\t($noun3 == '')||($adj3 == '')||($verb1 == '')||($adverb2 == '')||($verb_past2 == '')||($adj4 == '') ){\n\t\treturn error(\"partial\");\n\t}\n\n\t// example submission:\n\t// \"disagreeable\",\"dilapidated\",\"evanescent\",\"ubiquitous\",\"obediently\",\"painfully\",\"monkey\",\"spaceship\",\"boogey man\",\"answer\",\"photographed\", \"knitted\"\n\n\t$mad_lib = \"Today I went to the zoo. I saw a $adj1 $noun1 jumping up and down in its tree. He $verb_past1 $adverb1 through the \" .\n\t\t\"large tunnel that led to its $adj2 $noun2. I got some peanuts and passed them through the cage to a gigantic gray $noun3 \" .\n\t\t\"towering above my head. Feeding that animal made me hungry. I went to get a $adj3 scoop of ice cream. It filled my stomach.\" .\n\t\t\"Afterwards I had to $verb1 $adverb2 to catch our bus. When I got home I $verb_past2 my mom for a $adj4 day at the zoo.\";\n\n\t$fin_data['status'] = array('status'=>'ok','message'=>'');\n\t$fin_data['mad_lib'] = $mad_lib;\n\n\treturn $fin_data;\n}", "public function setValues(){\n if($this->getType() == \"var\"){\n $this->setValue($this->getArg());\n }else if($this->getType() == \"int\"){\n $pos = strpos($this->getArg(), \"@\");\n $this->setValue(substr($this->getArg(), $pos+1));\n }else if($this->getType() == \"bool\"){\n $pos = strpos($this->getArg(), \"@\");\n $this->setValue(substr($this->getArg(), $pos+1));\n }else if($this->getType() == \"string\"){\n $pos = strpos($this->getArg(), \"@\");\n $this->setValue(substr($this->getArg(), $pos+1));\n }else if($this->getType() == \"nil\"){\n $pos = strpos($this->getArg(), \"@\");\n $this->setValue(substr($this->getArg(), $pos+1));\n }else if($this->getType() == \"label\"){\n $this->setValue($this->getArg());\n }else if($this->getType() == \"type\"){\n $this->setValue($this->getArg());\n }else{\n $this->setValue(\"CHYBA\");\n }\n }", "function typeOutput($Attribute, $Type1, $Type2, $Type3){\n global $EN_types, $FR_types, $DE_types, $IT_types, $PT_types, $SP_types, $JP_types, $TC_types, $KR_types;\n\n switch($_SESSION['language']){\n case \"FR\":\n $tempLangArray = $FR_types;\n break;\n case \"DE\":\n $tempLangArray = $DE_types;\n break;\n case \"IT\":\n $tempLangArray = $IT_types;\n break;\n case \"PT\":\n $tempLangArray = $PT_types;\n break;\n case \"SP\":\n $tempLangArray = $SP_types;\n break;\n case \"JP\":\n $tempLangArray = $JP_types;\n break;\n case \"TC\":\n $tempLangArray = $TC_types;\n break;\n case \"KR\":\n $tempLangArray = $KR_types;\n break;\n default:\n $tempLangArray = $EN_types;\n break;\n }\n\n if($Attribute == \"TOKEN\"){\n echo \"<span id=\\\"type\\\"></span>\";\n }elseif($Attribute == \"NON-GAME\"){\n echo \"<span id=\\\"type\\\"></span>\";\n }elseif(($Type2 == \"Effect\") && (($Type3 == \"Tuner\") || ($Type3 == \"Gemini\") || ($Type3 == \"Toon\") || ($Type3 == \"Union\") || ($Type3 == \"Spirit\"))){\n echo \"<span id=\\\"type\\\">[ \" . $tempLangArray[$Type1] . \" / \" . $tempLangArray[$Type3] . \" ]</span>\";\n }elseif(($Type2 == \"Normal\") && (isset($Type1)) && ($Type3 == \"Tuner\")){\n echo \"<span id=\\\"type\\\">[ \" . $tempLangArray[$Type1] . \" / \" . $tempLangArray[$Type3] . \" ]</span>\";\n }elseif(($Type2 == \"Fusion\") && (isset($Type1)) && ($Type3 == \"Effect\")){\n echo \"<span id=\\\"type\\\">[ \" . $tempLangArray[$Type1] . \" / \" . $tempLangArray[$Type2] . \" / \" . $tempLangArray[$Type3] . \" ]</span>\";\n }elseif(($Type2 == \"Ritual\") && (isset($Type1)) && ($Type3 == \"Effect\")){\n echo \"<span id=\\\"type\\\">[ \" . $tempLangArray[$Type1] . \" / \" . $tempLangArray[$Type2] . \" / \" . $tempLangArray[$Type3] . \" ]</span>\";\n }elseif(($Type2 == \"Synchro\") && (isset($Type1)) && (($Type3 == \"Effect\") || ($Type3 == \"Tuner\"))){\n echo \"<span id=\\\"type\\\">[ \" . $tempLangArray[$Type1] . \" / \" . $tempLangArray[$Type2] . \" / \" . $tempLangArray[$Type3] . \" ]</span>\";\n }elseif(($Type2 == \"Xyz\") && (isset($Type1)) && ($Type3 == \"Effect\")){\n echo \"<span id=\\\"type\\\">[ \" . $tempLangArray[$Type1] . \" / \" . $tempLangArray[$Type2] . \" / \" . $tempLangArray[$Type3] . \" ]</span>\";\n }elseif(($Type2 == \"Pendulum\") && (isset($Type1)) && ($Type3 == \"Effect\")){\n echo \"<span id=\\\"type\\\">[ \" . $tempLangArray[$Type1] . \" / \" . $tempLangArray[$Type2] . \" / \" . $tempLangArray[$Type3] . \" ]</span>\";\n }elseif(($Attribute == \"TRAP\") || ($Attribute == \"SPELL\") || ($Attribute == \"MAGIC\")){\n echo \"<span id=\\\"type\\\">[ \" . $tempLangArray[$Type2] . \" ]</span>\";\n }else{\n echo \"<span id=\\\"type\\\">[ \" . $tempLangArray[$Type1] . \" / \" . $tempLangArray[$Type2] . \" ]</span>\";\n }\n}", "function showQuestions()\n\t{\n\t\tif($this->TotalQuestions > 0)\n\t\t{#be certain there are questions\n\t\t\tforeach($this->aQuestion as $question)\n\t\t\t{#print data for each \n\t\t\t\techo $question->Number . ') '; # We're using new Number property instead of id - v2\n\t\t\t\techo $question->Text . ' ';\n\t\t\t\tif($question->Description != ''){echo '(' . $question->Description . ')';}\n\t\t\t\techo '<br />';\n\t\t\t\t$question->showAnswers() . '<br />'; #display array of answer objects\n\t\t\t}\n\t\t}else{\n\t\t\techo 'There are currently no questions for this survey.';\t\n\t\t}\n\t}", "public function SetCustomVars()\n\t\t{\n\t\t\t$this->_variables['displayname'] = array(\"name\" => GetLang('DisplayName'),\n\t\t\t \"type\" => \"textbox\",\n\t\t\t \"help\" => GetLang('DisplayNameHelp'),\n\t\t\t \"default\" => $this->GetName(),\n\t\t\t \"required\" => true\n\t\t\t);\n\n\t\t\t$this->_variables['vendorname'] = array(\"name\" => GetLang($this->_languagePrefix.'VendorName'),\n\t\t\t \"type\" => \"textbox\",\n\t\t\t \"help\" => GetLang($this->_languagePrefix.'VendorNameHelp'),\n\t\t\t \"default\" => \"\",\n\t\t\t \"required\" => true\n\t\t\t);\n\n\t\t\t$this->_variables['cardcode'] = array(\"name\" => GetLang($this->_languagePrefix.'CardCode'),\n\t\t\t \"type\" => \"dropdown\",\n\t\t\t \"help\" => GetLang($this->_languagePrefix.'CardCodeHelp'),\n\t\t\t \"default\" => \"no\",\n\t\t\t \"required\" => true,\n\t\t\t \"options\" => array(GetLang($this->_languagePrefix.'CardCodeNo') => \"NO\",\n\t\t\t\t\t\t\t GetLang($this->_languagePrefix.'CardCodeYes') => \"YES\"\n\t\t\t\t),\n\t\t\t\t\"multiselect\" => false\n\t\t\t);\n\n\t\t\t$this->_variables['testmode'] = array(\"name\" => GetLang($this->_languagePrefix.'TestMode'),\n\t \"type\" => \"dropdown\",\n\t\t\t \"help\" => GetLang($this->_languagePrefix.'TestModeHelp'),\n\t\t\t \"default\" => \"no\",\n\t\t\t \"required\" => true,\n\t\t\t \"options\" => array(GetLang($this->_languagePrefix.'TestModeTest') => \"TEST\",\n\t\t\t\t\t\t\t GetLang($this->_languagePrefix.'TestModeSimulator') => \"SIMULATOR\",\n\t\t\t\t\t\t\t GetLang($this->_languagePrefix.'TestModeLive') => \"LIVE\"\n\t\t\t\t),\n\t\t\t\t\"multiselect\" => false\n\t\t\t);\n\t\t}", "function ExtendedText_Question( $id ) {\n\t\t\n\t\tparent::Question( $id );\n\t}", "function printSurveyCreationForm() {\n\tglobal $tool_content, $langTitle, $langPollStart, \n\t\t$langPollEnd, $langType, $langSurveyMC, $langSurveyFillText, \n\t\t$langCreate, $langSurveyContinue, $start_cal_Survey, $end_cal_Survey;\n\t\n\t$CurrentDate = date(\"Y-m-d H:i:s\");\n\t$CurrentDate = htmlspecialchars($CurrentDate);\n\t$tool_content .= <<<cData\n\t<form action=\"addsurvey.php\" id=\"survey\" method=\"post\">\n\t<input type=\"hidden\" value=\"0\" name=\"MoreQuestions\">\n\t<table><thead></thead>\n\t\t<tr><td>$langTitle</td><td colspan=\"2\"><input type=\"text\" size=\"50\" name=\"SurveyName\"></td></tr>\n\t\t<tr><td>$langPollStart</td><td colspan=\"2\">\n\t\t\t$start_cal_Survey\n\t\t</td></tr>\n\t\t<tr><td>$langPollEnd</td><td colspan=\"2\">$end_cal_Survey</td></tr>\n\t\t<!--<tr>\n\t\t <td>$langType</td>\n\t\t <td><label>\n\t\t <input name=\"UseCase\" type=\"radio\" value=\"1\" />\n\t $langSurveyMC</label></td>\n\t\t <td><label>\n\t\t <input name=\"UseCase\" type=\"radio\" value=\"2\" />\n\t $langSurveyFillText</label></td>\n\t\t</tr>-->\n\t\t<input name=\"UseCase\" type=\"hidden\" value=\"1\" />\n\t\t<tr><td colspan=\"3\" align=\"right\">\n <input name=\"$langSurveyContinue\" type=\"submit\" value=\"$langSurveyContinue -&gt;\"></td></tr>\n\t</table>\n\t</form>\ncData;\n}", "function areatext($text,$type)\n {\n\tif($text!=null)\n\t{\n\t\tif($type='edit')\n\t\t{\n\t\t\t$valeur = htmlspecialchars(bbcodereverse(remplacer($text)));\n\t\t}\n\t\t\n\t\tif($type ='quote')\n\t\t{\n\t\t\t$valeur =\"[quote]\";\n\t\t\t$valeur .=htmlspecialchars(bbcodereverse(remplacer($text)));\n\t\t\t$valeur .=\"[/quote]\";\n\t\t}\n\t}\n\t\t\t\t\t$textarea .='<tr class=\"title2\">';\n\t\t\t\t\t$textarea .='<td colspan=\"2\" height=\"25px\">';\n\t\t\t\t\t$textarea .='<ul class=\"balise\">';\n\t\t\t\t\t//\n\t\t\t\t\t$textarea .=\"<li><div class=\\\"balise\\\" onClick=\\\"addForum('[b]cry[/b]')\\\"><b>G</b></div></li>\";\n\t\t\t\t\t$textarea .=\"<li><div class=\\\"balise\\\" onClick=\\\"addForum('[u]cry[/u]')\\\"><span style=\\\"text-decoration:underline;\\\">S</span></div></li>\";\n\t\t\t\t\t$textarea .=\"<li><div class=\\\"balise\\\" onClick=\\\"addForum('[s]cry[/s]')\\\"><span style=\\\"text-decoration: line-through;\\\">S</span></div></li>\";\n\t\t\t\t\t$textarea .=\"<li><div class=\\\"balise\\\" onClick=\\\"addForum('[i]cry[/i]')\\\"><i>I</i></div></li>\";\n\t\t\t\t\t$textarea .=\"<li><div class=\\\"balise\\\" onClick=\\\"addForum('[url]adresse de l url[/url]')\\\">insérer une adresse url</div></li>\";\n\t\t\t\t\t$textarea .=\"<li><div class=\\\"balise\\\" onClick=\\\"addForum('[image]adresse de l image[/image]')\\\">insérer une image</div></li>\";\n\t\t\t\t\t//les couleurs\n\t\t\t\t\t$textarea .=\"<li>\";\n\t\t\t\t\t$textarea .=\"<select>\";\n\t\t\t\t\t$textarea .=\"<OPTION VALUE=\\\"rouge\\\" onClick=\\\"addForum('[color=red]cry[/color]')\\\"><span style=\\\"color:red;\\\">rouge</span></OPTION>\n\t\t\t\t\t\t\t\t\t<OPTION VALUE=\\\"bleu\\\" onClick=\\\"addForum('[color=blue]cry[/color]')\\\"><span style=\\\"color:blue;\\\">bleu</span></OPTION>\n\t\t\t\t\t\t\t\t\t<OPTION VALUE=\\\"vert\\\" onClick=\\\"addForum('[color=green]cry[/color]')\\\"><span style=\\\"color:green;\\\">vert</span></OPTION>\n\t\t\t\t\t\t\t\t\t<OPTION VALUE=\\\"lime\\\" onClick=\\\"addForum('[color=lime]cry[/color]')\\\"><span style=\\\"color:lime;\\\">lime</span></OPTION>\n\t\t\t\t\t\t\t\t\t<OPTION VALUE=\\\"jaune\\\" onClick=\\\"addForum('[color=jaune]cry[/color]')\\\"><span style=\\\"color:yellow;\\\">jaune</span></OPTION>\n\t\t\t\t\t\t\t\t\t<OPTION VALUE=\\\"orange\\\" onClick=\\\"addForum('[color=orange]cry[/color]')\\\"><span style=\\\"color:orange;\\\">orange</span></OPTION>\n\t\t\t\t\t\t\t\t\t<OPTION VALUE=\\\"autres\\\" onClick=\\\"addForum('[color=#]cry[/color]')\\\">Autres</OPTION>\";\n\t\t\t\t\t// $textarea .=\"<li><div class=\\\"balise\\\" onClick=\\\"addForum('[color]votre texte[/color]')\\\">couleur</div></li>\";\n\t\t\t\t\t$textarea .=\"</select>\";\n\t\t\t\t\t$textarea .=\"</li>\";\n\t\t\t\t\t//fin des couleurs\n\t\t\t\t\t$textarea .=\"<li><div class=\\\"balise\\\" onClick=\\\"addForum('[list][*][*][*][/list]')\\\">insérer une list</div></li>\";\n\t\t\t\t\t//\n\t\t\t\t\t$textarea .='</ul>';\n\t\t\t\t\t$textarea .='</td>';\n\t\t\t\t\t$textarea .='</tr>';\n\t\t\t\t\t$textarea .= $error2;\n\t\t\t\t\t$textarea .='<tr>';\n\t\t\t\t\t$textarea .='<td>';\n\t\t\t\t\t$textarea .='<h2>Smiley</h2>';\n\t\t\t\t\t$textarea .=\"<p><table>\n\t\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t\t<td><img src=\\\"images/Games/emoticones/cry.png\\\" alt=\\\"pleuré\\\" width=\\\"50\\\" height=\\\"50\\\" onClick=\\\"addForum('[smiley]cry[/smiley]')\\\" /></td>\n\t\t\t\t\t\t\t\t\t\t<td><img src=\\\"images/Games/emoticones/dangerous.png\\\" alt=\\\"Dangereux\\\" width=\\\"50\\\" height=\\\"50\\\" onClick=\\\"addForum('[smiley]dangerous[/smiley]')\\\"/></td>\n\t\t\t\t\t\t\t\t\t\t<td><img src=\\\"images/Games/emoticones/evil.png\\\" alt=\\\"demon\\\" width=\\\"50\\\" height=\\\"50\\\" onClick=\\\"addForum('[smiley]evil[/smiley]')\\\"/></td>\n\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t\t<td>cry</td>\n\t\t\t\t\t\t\t\t\t\t<td>dangerous</td>\n\t\t\t\t\t\t\t\t\t\t<td>evil</td>\n\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t\t<td><img src=\\\"images/Games/emoticones/gomennasai.png\\\" alt=\\\"gomennasai\\\" width=\\\"50\\\" height=\\\"50\\\" onClick=\\\"addForum('[smiley]gomennasai[/smiley]')\\\" /></td>\n\t\t\t\t\t\t\t\t\t\t<td><img src=\\\"images/Games/emoticones/hoho.png\\\" alt=\\\"hoho\\\" width=\\\"50\\\" height=\\\"50\\\" onClick=\\\"addForum('[smiley]hoho[/smiley]')\\\" /></td>\n\t\t\t\t\t\t\t\t\t\t<td><img src=\\\"images/Games/emoticones/nyu.png\\\" alt=\\\"nyu\\\" width=\\\"50\\\" height=\\\"50\\\" onClick=\\\"addForum('[smiley]nyu[/smiley]')\\\" /></td>\n\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t\t<td>gomennasai</td>\n\t\t\t\t\t\t\t\t\t\t<td>hoho</td>\n\t\t\t\t\t\t\t\t\t\t<td>nyu</td>\n\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t\t<td><img src=\\\"images/Games/emoticones/reallyangry.png\\\" alt=\\\"en colere\\\" width=\\\"50\\\" height=\\\"50\\\" onClick=\\\"addForum('[smiley]reallyangry[/smiley]')\\\" /></td>\n\t\t\t\t\t\t\t\t\t\t<td><img src=\\\"images/Games/emoticones/shamed.png\\\" alt=\\\"géné\\\" width=\\\"50\\\" height=\\\"50\\\" onClick=\\\"addForum('[smiley]shamed[/smiley]')\\\" /></td>\t\n\t\t\t\t\t\t\t\t\t\t<td><img src=\\\"images/Games/emoticones/socute.png\\\" alt=\\\"adoré\\\" width=\\\"50\\\" height=\\\"50\\\" onClick=\\\"addForum('[smiley]socute[/smiley]')\\\"/></td>\n\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t\t<td>reallyangry</td>\n\t\t\t\t\t\t\t\t\t\t<td>shamed</td>\t\n\t\t\t\t\t\t\t\t\t\t<td>socute</td>\n\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t\t<td><img src=\\\"images/Games/emoticones/sorry.png\\\" alt=\\\"désolé\\\" width=\\\"50\\\" height=\\\"50\\\" onClick=\\\"addForum('[smiley]sorry[/smiley]')\\\" /></td>\n\t\t\t\t\t\t\t\t\t\t<td><img src=\\\"images/Games/emoticones/what.png\\\" alt=\\\"quoi\\\" width=\\\"50\\\" height=\\\"50\\\" onClick=\\\"addForum('[smiley]what[/smiley]')\\\" /></td>\n\t\t\t\t\t\t\t\t\t\t<td><img src=\\\"images/Games/emoticones/xd.png\\\" alt=\\\"xd\\\" width=\\\"50\\\" height=\\\"50\\\" onClick=\\\"addForum('[smiley]xd[/smiley]')\\\" /></td>\n\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t\t<td>sorry</td>\n\t\t\t\t\t\t\t\t\t\t<td>what</td>\n\t\t\t\t\t\t\t\t\t\t<td>xd</td>\n\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t\t</table></p>\";\n\t\t\t\t\t$textarea .='</td>';\n\t\t\t\t\t$textarea .='<td>';\n\t\t\t\t\t$textarea .='<h2>message</h2>';\n\t\t\t\t\t$textarea .='<p><TEXTAREA name=\"messages\" id=\"messages\" rows=20 COLS=80>'.$valeur.'</TEXTAREA></p>';\n\t\t\t\t\t$textarea .='</td>';\n\t\t\t\t\t$textarea .='</tr>';\n\t\t\t\t\t\n\treturn $textarea;\n}", "public function get_widget_placeholders($questiontext) {\n preg_match_all('/\\[\\[([a-z0-9_-]+):(audio|video)]]/i', $questiontext, $matches, PREG_SET_ORDER);\n\n $widgetplaceholders = [];\n foreach ($matches as $match) {\n $widgetplaceholders[$match[0]] = [$match[1], $match[2]];\n }\n return $widgetplaceholders;\n }", "public function resolve($text,$vars=array(),$bracket='{}'){\n $retkey=$this->cfg_returnkey;\n \n // force t to return empty string if variable not found\n $this->cfg_returnkey = false;\n \n while($pos1=strpos($text,$bracket[0])){\n \n $pos2=strpos($text,$bracket[1]);\n if(!$pos2) $pos2=strlen($text)-1;\n $msgkey=substr($text,$pos1,($pos2-$pos1)+1);\n $translated='';\n \n $shortkey=substr($msgkey,1,-1);\n \n if(array_key_exists($shortkey,$vars)){\n $translated=$vars[$shortkey]; \n }\n else {\n if(strlen($msgkey)>2){\n $translated=$this->t($shortkey); \n }\n \n } \n $text=str_replace($msgkey,$translated,$text);\n }\n \n $this->cfg_returnkey = $retkey;\n \n return $text;\n \n }", "function debug($input) {\r\n $contents = func_get_args();\r\n\r\n foreach ( $contents as $content ) {\r\n print '<textarea style=\"width:49%; height:250px; float: left;\">';\r\n print_r($content);\r\n print '</textarea>';\r\n }\r\n\r\n echo '<div style=\"clear: both\"></div>';\r\n }", "function show_common_vars()\n\t\t{\n\t\t\t$this->message[] = $this->GUI->get_error(false, _DEBUG);\n\t\t\t$this->message[] = $this->runtime->get_error(false, _DEBUG);\n\t\t\t$this->t->set_var(array(\n\t\t\t\t'wf_message'\t=> implode('<br />',array_filter($this->message)),\n\t\t\t\t)\n\t\t\t);\n\t\t}", "public function question($vars, $prefix, $name, $field)\n {\n if (!isset($field['desc'])) {\n // This is a <configsection>.\n foreach ($field as $sub => $sub_field) {\n $this->question($vars, $prefix . '__' . $name, $sub, $sub_field);\n }\n return;\n }\n\n $question = $field['desc'];\n $default = $field['default'];\n $values = null;\n if (isset($field['switch'])) {\n $values = array();\n foreach ($field['switch'] as $case => $case_field) {\n $values[$case] = $case_field['desc'];\n }\n } else {\n switch ($field['_type']) {\n case 'boolean':\n $values = array(true => 'Yes', false => 'No');\n $default = (int)$default;\n break;\n case 'enum':\n $values = $field['values'];\n break;\n }\n if (!empty($field['required'])) {\n $question .= $this->red('*');\n }\n }\n\n while (true) {\n if ($name == 'password') {\n $value = $this->passwordPrompt($question);\n } else {\n $value = $this->prompt($question, $values, $default);\n }\n if (empty($field['required']) || $value !== '') {\n break;\n } else {\n $this->writeln($this->red('This field is required.'));\n }\n }\n\n if (isset($field['switch']) &&\n !empty($field['switch'][$value]['fields'])) {\n foreach ($field['switch'][$value]['fields'] as $sub => $sub_field) {\n $this->question($vars, $prefix, $sub, $sub_field);\n }\n }\n\n $vars->set($prefix . '__' . $name, $value);\n }", "protected function initialise_question_instance(question_definition $question, $questiondata) {\n parent::initialise_question_instance($question, $questiondata);\n $question->parts = array();\n if (!empty($questiondata->options->answers)) {\n foreach ($questiondata->options->answers as $ans) {\n $part = new qtype_formulas_part();\n foreach ($ans as $key => $value) {\n $part->{$key} = $value;\n }\n $question->parts[$part->partindex] = $part;\n }\n }\n $question->varsrandom = $questiondata->options->varsrandom;\n $question->varsglobal = $questiondata->options->varsglobal;\n $question->answernumbering = $questiondata->options->answernumbering;\n $question->qv = new qtype_formulas\\variables();\n $question->numpart = $questiondata->options->numpart;\n if ($question->numpart != 0) {\n $question->fractions = array_fill(0, $question->numpart, 0);\n $question->anscorrs = array_fill(0, $question->numpart, 0);\n $question->unitcorrs = array_fill(0, $question->numpart, 0);\n }\n $question->textfragments = $this->split_questiontext($question->questiontext, $question->parts);\n $this->initialise_combined_feedback($question, $questiondata, true);\n }", "function addHeadJavascriptVars() {\n\t\techo '<script type=\"text/javascript\">'.\"\\n\";\n\t\techo 'var lepress_student_awaiting_url = \"'.add_query_arg(array('lepress-student-awaiting' => 1), get_bloginfo('siteurl')).'\";'.\"\\n\";\n\t\t$lang_vars = array('submission_for' => __('Submission for', lepress_textdomain),\n\t\t\t\t\t\t\t'hide' => __('Hide', lepress_textdomain), \n\t\t\t\t\t\t\t'expand' => __('Expand', lepress_textdomain));\n\t\techo 'var lepress_lang_vars_student = '.json_encode($lang_vars).';'.\"\\n\";\n\t\techo '</script>'.\"\\n\";\n\t}", "function insert($id_question, $option_text)\r\n\t{\r\n\t\t$data = array(\r\n\t\t'option' => $option_text,\r\n\t\t'custom_questions_id' => $id_question\r\n\t\t\t\t);\r\n\r\n\t\treturn $this->db->insert($this->table, $data);\r\n\t}", "private function addQuestion() : void\n {\n $question = $this->console->ask(__('Type your question'));\n\n $this->console->info('Question successfully added ');\n\n $answer = $this->console->ask(__('Type your answer'));\n\n $this->console->info('Answer successfully added ');\n\n $this->questionRepository->create([\n 'question' => $question,\n 'valid_answer' => $answer,\n ]);\n }", "public static function pretending()\n {\n }", "public function insert_question_and_option()\n\t{\t\n\t\t$CI =& get_instance();\n\t\t$CI->auth->check_operator_auth();\n\t\t$CI->load->model('operator/Questions');\t\t\n\t\t$CI->Questions->question_and_option_entry();\n\t\t\n\t\t$this->session->set_userdata(array('message'=>display('successfully_added_question')));\n\n\t\tredirect(base_url('operator/Oquestion/add_question_form'));\n\t}", "public function validate_widget_placeholders($qtext, $mediatype) {\n\n // The placeholder format.\n $a = new \\stdClass();\n $a->text = null;\n $a->format = get_string('err_placeholderformat', 'qtype_recordrtc');\n\n // Check correctness of open and close square brackets within the question text.\n $openingbrackets = 0;\n $closingbrackets = 0;\n if (preg_match_all(\"/\\[\\[/\", $qtext, $matches, PREG_SPLIT_NO_EMPTY, 0)) {\n $openingbrackets = count($matches[0]);\n }\n if (preg_match_all(\"/\\]\\]/\", $qtext, $matches, PREG_SPLIT_NO_EMPTY, 0)) {\n $closingbrackets = count($matches[0]);\n }\n if ($openingbrackets || $closingbrackets) {\n if ($openingbrackets < $closingbrackets) {\n return get_string('err_opensquarebrackets', 'qtype_recordrtc', $a);\n }\n if ($openingbrackets > $closingbrackets) {\n return get_string('err_closesquarebrackets', 'qtype_recordrtc', $a);\n }\n }\n $pattern = \"/(\\[\\[)([A-Za-z0-9_-]+)(:)([a-z]+)(]])/\";\n preg_match_all($pattern, $qtext, $matches, PREG_PATTERN_ORDER, 0);\n\n // If medatype is audio or video, custom placeholer is not allowed.\n if (($mediatype === self::MEDIA_TYPE_AUDIO || $mediatype === self::MEDIA_TYPE_VIDEO) && $matches[2]) {\n return get_string('err_placeholdernotallowed', 'qtype_recordrtc',\n get_string($mediatype, 'qtype_recordrtc'));\n }\n\n if ($matches) {\n // Validate titles.\n $titles = $matches[2];\n $titlesused = [];\n foreach ($titles as $key => $title) {\n if ($title === '' || $title === '-' || $title === '_') {\n $a->text = $title;\n return get_string('err_placeholdertitle', 'qtype_recordrtc', $a);\n }\n // The title string exeeds the max length.\n if (strlen($title) > self::MAX_LENGTH_MEDIA_TITLE) {\n $a->text = $title;\n $a->maxlength = self::MAX_LENGTH_MEDIA_TITLE;\n return get_string('err_placeholdertitlelength', 'qtype_recordrtc', $a);\n }\n if (preg_match('/[A-Z]/', $title)) {\n $a->text = $title;\n return get_string('err_placeholdertitlecase', 'qtype_recordrtc', $a);\n }\n if (isset($titlesused[$title])) {\n $a->text = $title;\n return get_string('err_placeholdertitleduplicate', 'qtype_recordrtc', $a);\n }\n $titlesused[$title] = 1;\n }\n // Validate media types.\n $mediatypes = $matches[4];\n foreach ($mediatypes as $key => $mt) {\n if ($mt !== self::MEDIA_TYPE_AUDIO && $mt !== self::MEDIA_TYPE_VIDEO) {\n $a->text = $mt;\n return get_string('err_placeholdermediatype', 'qtype_recordrtc', $a);\n }\n }\n // A media placeholder is not in a correct format.\n if (count($matches[0]) < $openingbrackets) {\n return get_string('err_placeholderincorrectformat', 'qtype_recordrtc', $a);\n }\n // If medatype is customav, there is need for custom placeholer(s).\n if ($mediatype === self::MEDIA_TYPE_CUSTOM_AV && !$matches[2]) {\n return get_string('err_placeholderneeded', 'qtype_recordrtc',\n get_string($mediatype, 'qtype_recordrtc'));\n }\n }\n return null;\n }", "function showAnswers()\n\t{\n\t\tif($this->TotalAnswers != 1){$s = 's';}else{$s = '';} #add 's' only if NOT one!!\n\t\techo \"<em>[\" . $this->TotalAnswers . \" answer\" . $s . \"]</em> \"; \n\t\tforeach($this->aAnswer as $answer)\n\t\t{#print data for each\n\t\t\techo \"<em>(\" . $answer->AnswerID . \")</em> \";\n\t\t\techo $answer->Text . \" \";\n\t\t\tif($answer->Description != \"\")\n\t\t\t{#only print description if not empty\n\t\t\t\techo \"<em>(\" . $answer->Description . \")</em>\";\n\t\t\t}\n\t\t}\n\t\tprint \"<br />\";\n\t}", "function globalvariable($name, $tooltiptext, $first = false){\n if(!$first){ echo \", \";}\n $tooltiptext = str_replace(\"*\", \" (for debugging purposes)\", $tooltiptext);\n echo '<SPAN TITLE=\"' . $tooltiptext . '\">%' . $name . \"%</SPAN>\";\n}", "function injectMultipleAnswerField($string, $origin = null){\n $name = 'multianswer';\n $a = @$origin[$name];\n if (is_array($a)) {\n $a = array_map('trim', $a);\n }\n\n $tmpl = loadFieldTemplate();\n\n return preg_replace_callback(\n '|\\[--multiple-answer-(?<i>\\d)--]|',\n function ($matches) use ($a, $name, $tmpl) {\n $i = $matches['i'];\n return $tmpl->renderBlock('multi_answer_field', array('i' => $i, 'name' => $name, 'answer' => $a[$i]));\n \n },\n $string);\n \n }", "public function get_multianswer_question_form_data_twosubq() {\n $formdata = new stdClass();\n $formdata->name = 'Simple multianswer';\n $formdata->questiontext = array('text' => 'Complete this opening line of verse: \"The ' .\n '{1:SHORTANSWER:Dog#Wrong, silly!~=Owl#Well done!~*#Wrong answer} ' .\n 'and the {1:MULTICHOICE:Bow-wow#You seem to have a dog obsessions!' .\n '~Wiggly worm#Now you are just being ridiculous!~=Pussy-cat#Well done!}' .\n ' went to sea\".', 'format' => FORMAT_HTML);\n $formdata->generalfeedback = array('text' => 'General feedback: It\\'s from \"The Owl and the Pussy-cat\" ' .\n 'by Lear: \"The owl and the pussycat went to sea', 'format' => FORMAT_HTML);\n\n $formdata->hint = array(\n 0 => array('text' => 'Hint 1', 'format' => FORMAT_HTML, 'itemid' => 0),\n 1 => array('text' => 'Hint 2', 'format' => FORMAT_HTML, 'itemid' => 0),\n );\n\n return $formdata;\n }", "function echoNarrative( )\n\t{\n\t\tglobal $noun1, $adverb1, $time, $location, $transport, $dialogue, $openEnding;\n\t\techo \"<br /><br />\\n\";\n\t\techo \"It was a chilly $time in the city when the doors of your home closed behind you. \\n\";\n\t\tif( $time == \"morning\" )\n\t\t\techo \"The streets were eerily vacant as you made your way to your \\n\";\n\t\telse if( $time == \"afternoon\" )\n\t\t\techo \"You zigzagged your way through the afternoon crowds as you made your way to your \\n\";\n\t\telse # night\n\t\t\techo \"You traversed the sidewalks and streets carefully, both heavy with night traffic, as you made your way to your \\n\";\n\t\tif( $transport == \"walk\" )\n\t\t\techo \"class. Running 10 minutes late already, you turn the corner of the block, \\npicking up your pace when you suddenly bump into a door. \\n\";\n\t\telse if( $transport == \"bus\" )\n\t\t\techo \"usual bus. Eventually you hop on the bus. Soon enough you're at your destination. \\nYou turn to thank the driver and step off the vehicle. You look up and suddenly your gaze is met by a door. \\n\";\n\t\telse # train\n\t\t\techo \"usual train. Eventually you hop on the train. Soon enough you're at your destination. \\nNoticing the time, you run up the stairs to the fresh air above. When you look up, your gaze is met by a door. \\n\";\n\t\techo \"After a few seconds of consideration, you place your hand on the door's knob and turn it $adverb1. \\n\";\n\t\techo \"A wash of light blinds you for some seconds but then you can see it. \\nThe place you've seen in your dreams... $location, land of the $noun1. \\n\";\n\t\techo \"It's $time here, like it was in your world. Overwhelmed by the sights and sound of this new place, \\nyou begin to run, shouting to anyone or anything that may hear: \\\"$dialogue!\\\" \\n\";\n\t\tif( $openEnding == false )\n\t\t{\n\t\t\techo \"<br /><br />All around you it feels as though the air is trembling. What could it be? \\n\";\n\t\t\techo \"You look to the distance and see a $noun1 approaching. When it gets close enough it waits. \\n\";\n\t\t\techo \"Slowly, you mount the creature's back and in the blink of an eye it's off, moving in the direction of a castle like structure. \\n\";\n\t\t\techo \"Years later you become the ruler of $location, marry and watch the people thrive under joint rule. You and your spouse live happily ever after.\\n\"; \n\t\t}\n\t}", "function _parse($str)\n\t{\n\t\t$vars = func_get_args();\n\t\tarray_shift($vars);\n\t\t$str = _($str);\n\t\tob_start();\n\t\tvprintf($str, $vars);\n\t\t$str = ob_get_contents();\n\t\tob_end_clean();\n\t\treturn $str;\n\t}", "function evaluation($text_evaluate)\n{\n $brackets = \"\";\n switch ($text_evaluate) {\n case \"\":\n echo '<div class=\"success\">No brackets sequence was provided. Generating \n and analysing a random one.</div>';\n case \"random\":\n $brackets = randomBrackets();\n break;\n default:\n $brackets = $text_evaluate;\n break;\n }\n\n // Preparing for edge cases.\n while (empty($brackets)) {\n $brackets = randomBrackets();\n }\n $brackets_length = strlen($brackets);\n\n // Shows the sequence of brackets on the input field.\n echo \"\n <script>\n document.getElementById('text_evaluate').value = '\" . $brackets . \"';\n </script>\";\n\n $open = array('(', '[', '{');\n $close = array(')', ']', '}');\n\n /**\n * Creates the arrays $brackets_open and $brackets_close. They will be used to\n * check if there are unmatched brackets, called orphans.\n * \n * Creates the array $valid_brackets with all brackets, after excluding any\n * possible foreign characters.\n */\n $valid_brackets = array();\n $brackets_open = array();\n $brackets_close = array();\n for ($i = 0; $i < $brackets_length; $i++) {\n if (in_array($brackets[$i], $open)) {\n $brackets_open[$i] = $brackets[$i];\n } elseif (in_array($brackets[$i], $close)) {\n $brackets_close[$i] = $brackets[$i];\n }\n\n $current_character = substr($brackets, $i, 1);\n if (in_array($current_character, $open) || in_array($current_character, $close)) {\n $valid_brackets[$i] = $current_character;\n }\n }\n\n // Shows the string received, without filtering foreign characters.\n $brackets_style = \"<pre class='string'>string_received (count: $brackets_length) {\\n $brackets\\n}</pre>\";\n echo $brackets_style;\n\n // Shows the string received, with foreign characters filtered out.\n $brackets_style = \"<pre class='brackets'>valid_brackets (count: \" . count($valid_brackets) . \") {\\n\";\n foreach($valid_brackets as $bk => $bv) {\n $brackets_style .= \" $bv -- position: $bk \\n\";\n }\n $brackets_style .= \"}</pre>\";\n echo $brackets_style;\n\n // Shows only opening brackets, in order of appearance.\n $brackets_style = \"<pre class='brackets'>brackets_open_order (count: \" . count($brackets_open) . \") {\\n\";\n foreach($brackets_open as $bk => $bv) {\n $brackets_style .= \" $bv -- position: $bk \\n\";\n }\n $brackets_style .= \"}</pre>\";\n echo $brackets_style;\n\n // Shows only closing brackets, in order of appearance.\n $brackets_style = \"<pre class='brackets'>brackets_close_order (count: \" . count($brackets_close) . \") {\\n\";\n foreach($brackets_close as $bk => $bv) {\n $brackets_style .= \" $bv -- position: $bk \\n\";\n }\n $brackets_style .= \"}</pre>\";\n echo $brackets_style;\n\n /**\n * Analyses the sequence of brackets and verifies which ones match the rules:\n * - Rule 1 (\"Pairs\"): An opened bracket must be closed to be valid, which means \n * they must form pairs;\n * - Rule 2 (\"Scope\"): A pair must have both parts inside another pair or outside \n * any pair, which means that a pair opening inside another pair and closing \n * outside of it is not valid.\n * \n * Unmatched brackets are kept in the $orphans array. Matched brackets are kept \n * only in the $brackets array.\n * \n * The $temp array is used to stare temporarily the brackets being analyzed.\n */\n $orphans = array();\n $temp = array();\n foreach($valid_brackets as $brackets_key => $brackets_value) {\n // Is the current bracket an opening one?\n $brackets_key_found = array_search($brackets_value, $open);\n\n // If it is, keep it in the $temp array.\n if ($brackets_key_found !== false) {\n $temp[$brackets_key] = $brackets_value;\n\n // If it isn't...\n } else {\n // 1. Find out which bracket matches it;\n $brackets_close_key = array_search($brackets_value, $close);\n $brackets_open_value = $open[$brackets_close_key];\n\n // 2. Search for the most recent match.\n $reversed = array_reverse($temp, true);\n $last_occurrence = array_search($brackets_open_value, $reversed);\n\n // If the match was found...\n if ($last_occurrence !== false) {\n // Remove it from the $temp array...\n unset($temp[$last_occurrence]);\n if (count($temp) > 0) {\n foreach ($temp as $k => $v) {\n /**\n * and remove existing brackets between the pair.\n * \n * For example: Consider the sequence \"{[((]\".\n * It has a matching pair: \"[\" and \"]\".\n * Everything else is unmatched.\n * \n * What we do here is to remove only what's inside the pair.\n * When we got to this point, the $temp array had the following\n * contents: \"{((\", because we already removed the \"[\" bracket.\n * Here we will remove what was between \"[\" and \"]\", which was\n * \"((\". As a result, $temp will have the following content: \"{\".\n * \n * We kept this content because it might match some (possible)\n * further bracket.\n */\n if ($k > $last_occurrence) {\n $orphans[$k] = $v;\n unset($temp[$k]);\n }\n }\n }\n\n // If no match was found...\n } else {\n // it means this is an orphan bracket.\n $orphans[$brackets_key] = $brackets_value;\n }\n }\n }\n\n // If the $temp array has any content left, they are all orphans.\n if (count($temp) > 0) {\n foreach ($temp as $k => $v) {\n $orphans[$k] = $v;\n unset($temp[$k]);\n }\n }\n ksort($orphans);\n\n // Shows the orphan brackets.\n if (count($orphans) > 0) {\n $brackets_style = \"<pre class='brackets'>orphan_brackets (count: \" . count($orphans) . \") {\\n\";\n foreach($orphans as $bk => $bv) {\n $brackets_style .= \" $bv -- position: $bk \\n\";\n }\n $brackets_style .= \"}</pre>\";\n echo $brackets_style;\n }\n\n $aux_str = \"\";\n $brackets_style = \"<div style='padding-left: 20px;'><span class='result'><pre>brackets_result_in_line (count: $brackets_length) {\\n \";\n for ($i = 0; $i < $brackets_length; $i++) {\n if (isset($orphans[$i])) {\n $aux_str .= '<span class=\"orphan-brackets\">' . substr($brackets, $i, 1) . '</span>';\n } elseif (isset($orphans[$i])) {\n $aux_str .= '<span class=\"orphan-brackets\">' . substr($brackets, $i, 1) . '</span>';\n } else {\n $aux_str .= '<span class=\"non-orphan-brackets\">' . substr($brackets, $i, 1) . '</span>';\n }\n }\n $brackets_style .= $aux_str;\n $brackets_style .= \"\\n}</pre></span></div>\";\n // Shows, in a line, the sequence of no valid brackets.\n echo $brackets_style;\n\n $aux_str = \"\";\n // $offset if used to control the indentation.\n $offset = 3;\n /**\n * $previous_open_close_move is used to keep track of which kind of bracket\n * was last shown. If its content is \"o\", it means it was an opening one.\n * If its content is \"c\", it means it was a closing one.\n * \n * It is necessary, because we need to know when the $offset variable should\n * have its value subtracted, which means we have a closing bracket with some\n * other brackets inside it. \n * \n * For example:\n * {\n * [((]( \n * }\n * \n * In this case, the \"}\" bracket needs its offset reduced to be shown correctly.\n */ \n $previous_open_close_move = \"o\";\n $brackets_style = \"<div style='padding-left: 20px;'><span class='result'><pre>brackets_result_with_visual_aid (count: $brackets_length) {\\n \";\n for ($i = 0; $i < $brackets_length; $i++) {\n if (isset($orphans[$i])) {\n $aux_str .= '<span class=\"orphan-brackets\">' . substr($brackets, $i, 1) . '</span>';\n } else {\n if (in_array(substr($brackets, $i, 1), $open)) {\n if (!empty($aux_str)) {\n $aux_str .= \"\\n\" . str_repeat(\" \", $offset) . \"<span class='non-orphan-brackets'>\" . substr($brackets, $i, 1) . \"</span>\";\n } else {\n $aux_str .= \"<span class='non-orphan-brackets'>\" . substr($brackets, $i, 1) . \"</span>\";\n }\n $offset += 3;\n $previous_open_close_move = \"o\";\n }\n\n if (in_array(substr($brackets, $i, 1), $close)) {\n $offset -= 3;\n if ($previous_open_close_move == \"c\") {\n $aux_str .= \"\\n\" . str_repeat(\" \", $offset) . \"<span class='non-orphan-brackets'>\" . substr($brackets, $i, 1) . \"</span>\";\n } else {\n $aux_str .= \"<span class='non-orphan-brackets'>\" . substr($brackets, $i, 1) . \"</span>\";\n }\n $previous_open_close_move = \"c\";\n }\n }\n }\n $brackets_style .= $aux_str;\n $brackets_style .= \"\\n}</pre></span></div>\";\n // Shows, with visual aid, the sequence of no valid brackets.\n echo $brackets_style;\n\n if (count($orphans) == 0) {\n echo '\n <div class=\"alert alert-success evaluation\" role=\"alert\">\n The sequence of brackets received is valid.\n </div>';\n } else {\n echo '\n <div class=\"alert alert-danger evaluation\" role=\"alert\">\n The sequence of brackets received is not valid.\n </div>';\n }\n}", "public function run()\n {\n $question = new TemplateQuestion();\n $question->question = 'Conducted by?';\n $question->template_section_id = 1;\n $question->save();\n\n $question = new TemplateQuestion();\n $question->question = 'date?';\n $question->template_section_id = 1;\n $question->save();\n\n $question = new TemplateQuestion();\n $question->question = 'Location';\n $question->template_section_id = 1;\n $question->save();\n\n //seed another section\n\n $question = new TemplateQuestion();\n $question->question = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.';\n $question->template_section_id = 2;\n $question->save();\n\n $question = new TemplateQuestion();\n $question->question = 'trash empty?';\n $question->template_section_id = 2;\n $question->save();\n\n $question = new TemplateQuestion();\n $question->question = 'Water shut off?';\n $question->template_section_id = 2;\n $question->save();\n\n\n }", "function kilman_prep_for_questionform($kilman, $qid, $qtype) {\n $context = context_module::instance($kilman->cm->id);\n if ($qid != 0) {\n $question = clone($kilman->questions[$qid]);\n $question->qid = $question->id;\n $question->sid = $kilman->survey->id;\n $question->id = $kilman->cm->id;\n $draftideditor = file_get_submitted_draft_itemid('question');\n $content = file_prepare_draft_area($draftideditor, $context->id, 'mod_kilman', 'question',\n $qid, array('subdirs' => true), $question->content);\n $question->content = array('text' => $content, 'format' => FORMAT_HTML, 'itemid' => $draftideditor);\n\n if (isset($question->dependencies)) {\n foreach ($question->dependencies as $dependencies) {\n if ($dependencies->dependandor === \"and\") {\n $question->dependquestions_and[] = $dependencies->dependquestionid.','.$dependencies->dependchoiceid;\n $question->dependlogic_and[] = $dependencies->dependlogic;\n } else if ($dependencies->dependandor === \"or\") {\n $question->dependquestions_or[] = $dependencies->dependquestionid.','.$dependencies->dependchoiceid;\n $question->dependlogic_or[] = $dependencies->dependlogic;\n }\n }\n }\n } else {\n $question = \\mod_kilman\\question\\base::question_builder($qtype);\n $question->sid = $kilman->survey->id;\n $question->id = $kilman->cm->id;\n $question->type_id = $qtype;\n $question->type = '';\n $draftideditor = file_get_submitted_draft_itemid('question');\n $content = file_prepare_draft_area($draftideditor, $context->id, 'mod_kilman', 'question',\n null, array('subdirs' => true), '');\n $question->content = array('text' => $content, 'format' => FORMAT_HTML, 'itemid' => $draftideditor);\n }\n return $question;\n}", "public function AskQuestion($data);", "public function SetCustomVars()\n\t\t{\n\t\t\t$this->_variables['displayname'] = array(\"name\" => GetLang($this->_languagePrefix.\"DisplayName\"),\n\t\t\t \"type\" => \"textbox\",\n\t\t\t \"help\" => GetLang('DisplayNameHelp'),\n\t\t\t \"default\" => $this->GetName(),\n\t\t\t \"required\" => true\n\t\t\t);\n\n\t\t\t$this->_variables['MerchantId'] = array(\"name\" => GetLang($this->_languagePrefix.\"MerchantId\"),\n\t\t\t \"type\" => \"textbox\",\n\t\t\t \"help\" => GetLang($this->_languagePrefix.'MerchantIdHelp'),\n\t\t\t \"default\" => '',\n\t\t\t \"required\" => true\n\t\t\t);\n\t\t\t$this->_variables['MerchantEmail'] = array(\"name\" => GetLang($this->_languagePrefix.\"MerchantEmail\"),\n\t\t\t \"type\" => \"textbox\",\n\t\t\t \"help\" => GetLang($this->_languagePrefix.'MerchantEmailHelp'),\n\t\t\t \"default\" => '',\n\t\t\t \"required\" => true\n\t\t\t);\n\t\t\t$this->_variables['CallbackId'] = array(\"name\" => GetLang($this->_languagePrefix.\"CallbackId\"),\n\t\t\t \"type\" => \"textbox\",\n\t\t\t \"help\" => GetLang($this->_languagePrefix.'CallbackIdHelp'),\n\t\t\t \"default\" => '',\n\t\t\t \"required\" => true\n\t\t\t);\n\t\t\t$this->_variables['SecretWord'] = array(\"name\" => GetLang($this->_languagePrefix.\"SecretWord\"),\n\t\t\t \"type\" => \"textbox\",\n\t\t\t \"help\" => GetLang($this->_languagePrefix.'SecretWordHelp'),\n\t\t\t \"default\" => '',\n\t\t\t \"required\" => true\n\t\t\t);\n\t\t}" ]
[ "0.63702196", "0.5844001", "0.57653993", "0.5708631", "0.5597477", "0.55093443", "0.5507172", "0.5405987", "0.5321921", "0.5288423", "0.52758884", "0.5241879", "0.51688486", "0.5164771", "0.5132086", "0.5120046", "0.5116965", "0.5098371", "0.50805044", "0.5027847", "0.5002497", "0.4964744", "0.49599463", "0.49576697", "0.49483234", "0.4942844", "0.49208406", "0.49045038", "0.48989847", "0.4877968", "0.48132202", "0.47878867", "0.47868997", "0.47804675", "0.47721562", "0.4760627", "0.47509176", "0.47431773", "0.47377464", "0.47235924", "0.47137475", "0.47126797", "0.46548054", "0.4642652", "0.46398705", "0.46388978", "0.4606352", "0.45805183", "0.4569885", "0.45629472", "0.45544806", "0.45518202", "0.45480487", "0.45465007", "0.45460245", "0.4537091", "0.45370474", "0.45338792", "0.45337516", "0.45294622", "0.45262784", "0.45180333", "0.45179456", "0.45132658", "0.4504975", "0.4502897", "0.448999", "0.4488899", "0.4488102", "0.44871947", "0.4482009", "0.44739196", "0.4472979", "0.44721675", "0.44712773", "0.44712082", "0.44705397", "0.4466903", "0.44657427", "0.44640383", "0.4458392", "0.4450274", "0.44479173", "0.44457486", "0.4443211", "0.44311148", "0.44252014", "0.44200346", "0.44140357", "0.4412321", "0.4397345", "0.4388963", "0.43884948", "0.43817338", "0.43781716", "0.43749586", "0.43681788", "0.43676674", "0.43623844", "0.4362126" ]
0.60418975
1
Evalutes inlinecode (code surrounded in curly braces) provided as part of the question.
public static function handle_inline_code($text, $match_level = 1, $mode = 'evaluate', $interpreter, $show_errors = false) { //Create a callback lambda which evaluates each block of inline code. $callback = function($matches) use($interpreter, $mode, $show_errors) { //Attempt to evaluate the given expression... try { return $interpreter->$mode($matches[1]); } //... and insert a placeholder if the string fails. catch(qtype_scripted_language_exception $e) { //If show errors is on, display the exception directly... if($show_errors) { return '['.$e->getMessage().' in '.$matches[1].']'; } //Otherwise, show a placeholder. else { return get_string('error_placeholder', 'qtype_scripted'); } } }; //Create a regular expression piece that matches the correct number //of open/close braces. $open_brace = str_repeat('\\{', $match_level); $close_brace = str_repeat('\\}', $match_level); //And replace each section in curly brackets with the evaluated version of that expression. return preg_replace_callback('/'.$open_brace.'(.*?)'.$close_brace.'/', $callback, $text); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function eval_inline_php($myContent,$onlyEval=false)\n// *************************************************\n{\n\t$rVal = \"\";\n\n\t// PHP INCLUDES\n\t$pos1 = strpos($myContent,\"<?php\");\n\n\tif (!($pos1===false))\n\t{\n\t\t$pos2 = strpos($myContent,\"?>\",$pos1);\n\n\t\t$rVal .= substr($myContent,0,$pos1);\n\n\t\t// BLOCK AUSWERTEN\n\t\t$evalTxt = substr($myContent,$pos1+5,($pos2)-($pos1+5));\n\t\teval($evalTxt);\n\n\t\t// RUECKGABE BLOCK DAVOR UND DANACH\n\t\tif (!$onlyEval) return $rVal.substr($myContent,$pos2+2);\n\t}\n\telse\n\t\treturn $myContent;\n\n\treturn \"\";\n}", "function single_inline_codeblock($content) {\n $content = preg_replace(\"/(`[^`]*`)/\", \"<span class='code-inline'>$0</span>\", $content);\n $content = str_replace('`', '', $content);\n return $content;\n}", "protected function replaceInlineCode($string)\n\t{\n\t\t// For closures\n\t\t$obj = $this;\n\t\treturn preg_replace_callback('/(`+)[ \\t]*(.+?)[ \\t]*(?<!`)\\1(?!`)/s', function($match) use ($obj)\n\t\t{\n\t\t\treturn '<code>'. $obj->encodeSpecial($match[2]) .'</code>';\n\t\t}, $string);\n\t}", "public static function _eval($self, $code)\n {\n return $self->evaluate_script($code, true);\n }", "function inline($line){\n \n $line = $this->premark_inline($line);\n \n //echo $line,\"\\n\";\n $line = preg_split('/\\{\\@MARK\\@([a-z0-9]+)_(.+?)_\\@KRAM\\@\\}/', $line, -1, PREG_SPLIT_DELIM_CAPTURE);\n //print_r($line);\n \n foreach($line as $k=>$v){\n switch($k%3){\n case 0:\n $this->part[] = array(DOC_CODE_TEXT,$v);\n break;\n \n case 1:\n $cmd = $v;\n break;\n \n case 2:\n $this->part[] = array(DOC_CODE_INLINE,$cmd,$v);\n break;\n }\n }\n }", "private function handlePhpEvalReplacement($input)\n {\n if (preg_match('/<\\?php (.*)\\?'.'>/', $input, $matches)) // goofy syntax there to prevent syntax coloring problems in rest of file due to close php tag\n {\n return eval( \"return {$matches[1]};\" );\n }\n return $input;\n }", "private function _inlineEscape($inline) {\n\t//--\n\t// There's gotta be a cleaner way to do this...\n\t// While pure sequences seem to be nesting just fine,\n\t// pure mappings and mappings with sequences inside can't go very\n\t// deep. This needs to be fixed.\n\t//--\n\t$seqs = array();\n\t$maps = array();\n\t$saved_strings = array();\n\t$saved_empties = array();\n\t//-- Check for empty strings fix from v.0.5.1\n\t$regex = '/(\"\")|(\\'\\')/';\n\tif(preg_match_all($regex, $inline, $strings)) {\n\t\t$saved_empties = $strings[0];\n\t\t$inline = preg_replace($regex, 'YAMLEmpty', $inline);\n\t} //end if\n\tunset($regex);\n\t//-- Check for strings\n\t$regex = '/(?:(\")|(?:\\'))((?(1)[^\"]+|[^\\']+))(?(1)\"|\\')/';\n\tif(preg_match_all($regex, $inline, $strings)) {\n\t\t$saved_strings = $strings[0];\n\t\t$inline = preg_replace($regex, 'YAMLString', $inline);\n\t} //end if\n\tunset($regex);\n\t//--\n\t$i = 0;\n\t$regex_seq = '/\\[([^{}\\[\\]]+)\\]/U';\n\t$regex_map = '/{([^\\[\\]{}]+)}/U';\n\tdo {\n\t\t// Check for sequences\n\t\twhile(preg_match($regex_seq, $inline, $matchseqs)) {\n\t\t\t$seqs[] = $matchseqs[0];\n\t\t\t$inline = preg_replace($regex_seq, ('YAMLSeq'.(Smart::array_size($seqs) - 1).'s'), $inline, 1);\n\t\t} //end while\n\t\t// Check for mappings\n\t\twhile(preg_match($regex_map, $inline, $matchmaps)) {\n\t\t\t$maps[] = $matchmaps[0];\n\t\t\t$inline = preg_replace($regex_map, ('YAMLMap'.(Smart::array_size($maps) - 1).'s'), $inline, 1);\n\t\t} //end while\n\t\tif($i++ >= 10) {\n\t\t\tbreak;\n\t\t} //end if\n\t} while(strpos($inline, '[') !== false || strpos($inline, '{') !== false);\n\tunset($regex_seq);\n\tunset($regex_map);\n\t//--\n\t$explode = explode(', ', $inline);\n\t$stringi = 0;\n\t$i = 0;\n\t//--\n\twhile(1) {\n\t\t//-- Re-add the sequences\n\t\tif(!empty($seqs)) {\n\t\t\tforeach ($explode as $key => $value) {\n\t\t\t\tif(strpos($value, 'YAMLSeq') !== false) {\n\t\t\t\t\tforeach($seqs as $seqk => $seq) {\n\t\t\t\t\t\t$explode[$key] = str_replace(('YAMLSeq'.$seqk.'s'), $seq, $value);\n\t\t\t\t\t\t$value = $explode[$key];\n\t\t\t\t\t} //end foreach\n\t\t\t\t} //end if\n\t\t\t} //end foreach\n\t\t} //end if\n\t\t//-- Re-add the mappings\n\t\tif(!empty($maps)) {\n\t\t\tforeach($explode as $key => $value) {\n\t\t\t\tif(strpos($value, 'YAMLMap') !== false) {\n\t\t\t\t\tforeach($maps as $mapk => $map) {\n\t\t\t\t\t\t$explode[$key] = str_replace(('YAMLMap'.$mapk.'s'), $map, $value);\n\t\t\t\t\t\t$value = $explode[$key];\n\t\t\t\t\t} //end foreach\n\t\t\t\t} //end if\n\t\t\t} //end foreach\n\t\t} //end if\n\t\t//-- Re-add the strings\n\t\tif(!empty($saved_strings)) {\n\t\t\tforeach ($explode as $key => $value) {\n\t\t\t\twhile(strpos($value, 'YAMLString') !== false) {\n\t\t\t\t\t$explode[$key] = preg_replace('/YAMLString/', $saved_strings[$stringi], $value, 1);\n\t\t\t\t\tunset($saved_strings[$stringi]);\n\t\t\t\t\t++$stringi;\n\t\t\t\t\t$value = $explode[$key];\n\t\t\t\t} //end while\n\t\t\t} //end foreach\n\t\t} //end if\n\t\t//-- Re-add the empty strings fix from v.0.5.1\n\t\tif(!empty($saved_empties)) {\n\t\t\tforeach ($explode as $key => $value) {\n\t\t\t\twhile (strpos($value,'YAMLEmpty') !== false) {\n\t\t\t\t\t$explode[$key] = preg_replace('/YAMLEmpty/', '', $value, 1);\n\t\t\t\t\t$value = $explode[$key];\n\t\t\t\t} //end while\n\t\t\t} //end foreach\n\t\t} //end if\n\t\t//--\n\t\t$finished = true;\n\t\tforeach($explode as $key => $value) {\n\t\t\tif(strpos($value, 'YAMLSeq') !== false) {\n\t\t\t\t$finished = false; break;\n\t\t\t} //end if\n\t\t\tif(strpos($value, 'YAMLMap') !== false) {\n\t\t\t\t$finished = false; break;\n\t\t\t} //end if\n\t\t\tif(strpos($value, 'YAMLString') !== false) {\n\t\t\t\t$finished = false; break;\n\t\t\t} //end if\n\t\t\tif(strpos($value,'YAMLEmpty') !== false) { // fix from v.0.5.1\n\t\t\t\t$finished = false; break;\n\t\t\t} //end if\n\t\t} //end foreach\n\t\tif($finished) {\n\t\t\tbreak;\n\t\t} //end if\n\t\t$i++;\n\t\tif($i > 10) {\n\t\t\tbreak; // Prevent infinite loops.\n\t\t} //end if\n\t\t//--\n\t} //end while\n\t//--\n\treturn $explode;\n\t//--\n}", "function betterEval($code) {\n $result = [];\n $tmp = tmpfile ();//file resource\n //we'll need to uri to include the file:\n $tmpMeta = stream_get_meta_data ( $tmp );\n $uri = $tmpMeta ['uri'];\n fwrite ( $tmp, $code );\n \n ob_start();\n $start = microtime(true);\n //anonymously, so our scope will not be polluted (very optimistic here, ofc)\n call_user_func(function() use ($uri) {\n include ($uri);\n }); \n \n $result['time'] = microtime(true) - $start;\n $result['output'] = ob_get_clean(); \n $result['length'] = strlen($result['output']);\n $result['lengthCharacters'] = mb_strlen($result['output']);\n $result['dbg'] = [\n 'fileUri' => $uri\n ];\n fclose ( $tmp );\n return $result;\n}", "function quote4Eval($in) {\n\t\tif (is_numeric($in)) {\n\t\t\treturn $in;\n\t\t} else {\n\t\t\treturn '\"' . str_replace(\"\\\\'\", \"'\", addslashes($in)) . '\"';\n\t\t}\n\t}", "protected function wpEval($alias, $code, $skipWordPress = false)\n {\n $code = escapeshellarg($code);\n $skipWordPress = $skipWordPress ? '--skip-wordpress' : '';\n return $this->wp($alias, \"eval $code $skipWordPress\");\n }", "static function code ($in = '', $data = []) {\n\t\treturn static::textarea_common($in, $data, __FUNCTION__);\n\t}", "function phpblock($text) {\n $this->php($text, 'pre');\n }", "public function inline_load($echo = false)\n\t{\n\t\t$body = addcslashes($this->render(), \"\\\\'\");\n\n\t\t$javascript = \"phery.load('{$body}');\";\n\n\t\tif ($echo)\n\t\t{\n\t\t\techo $javascript;\n\t\t}\n\n\t\treturn $javascript;\n\t}", "public static function _function($self, $code)\n {\n return $self->evaluate_script($code, false, true);\n }", "static public function code($content, $attributes=array()) {\n return self::content('code', $content, $attributes);\n }", "protected function sanitizeExpression($code)\n\t{\n\t\t// Language consturcts.\n\t\t$languageConstructs = array(\n\t\t\t'echo',\n\t\t\t'empty',\n\t\t\t'isset',\n\t\t\t'unset',\n\t\t\t'exit',\n\t\t\t'die',\n\t\t\t'include',\n\t\t\t'include_once',\n\t\t\t'require',\n\t\t\t'require_once',\n\t\t);\n\n\t\t// Loop through the language constructs.\n\t\tforeach( $languageConstructs as $lc )\n\t\t\tif( preg_match('/'.$lc.'\\ *\\(?\\ *[\\\"\\']+/', $code)>0 )\n\t\t\t\treturn null; // Language construct found, not safe for eval.\n\n\t\t// Get a list of all defined functions\n\t\t$definedFunctions = get_defined_functions();\n\t\t$functions = array_merge($definedFunctions['internal'], $definedFunctions['user']);\n\n\t\t// Loop through the functions and check the code for function calls.\n\t\t// Append a '(' to the functions to avoid confusion between e.g. array() and array_merge().\n\t\tforeach( $functions as $f )\n\t\t\t//if( preg_match('/'.$f.'\\ *\\({1}/', $code)>0 )\n\t\t\tif( preg_match('/'.preg_quote($f, '/').'\\ *\\({1}/', $code)>0 )\n\t\t\t\treturn null; // Function call found, not safe for eval.\n\n\t\t// Evaluate the safer code\n\t\t$result = @eval($code);\n\n\t\t// Return the evaluated code or null if the result was false.\n\t\treturn $result!==false ? $result : null;\n\t}", "function compile($code, $do_not_echo = false, $retvar = '')\n\t{\n\t\t$code = ' ?' . '>' . $this->compile_code('', $code, true) . '<' . '?php' . \"\\n\";\n\t\tif($do_not_echo)\n\t\t{\n\t\t\t$code = \"ob_start();\\n\". $code. \"\\n\\${$retvar} = ob_get_contents();\\nob_end_clean();\\n\";\n\t\t}\n\t\treturn $code;\n\t}", "public function registerInlineJs(string $code): self\n {\n return $this->registerRequireJsModule('TYPO3/CMS/Backend/FormEngine', $code);\n }", "public static function run($code)\n {\n $interpreter = new Interpreter(static::parse($code));\n return $interpreter->run();\n }", "public function get_Eval(){\n return $this->eval_note;\n }", "function evaluation($text_evaluate)\n{\n $brackets = \"\";\n switch ($text_evaluate) {\n case \"\":\n echo '<div class=\"success\">No brackets sequence was provided. Generating \n and analysing a random one.</div>';\n case \"random\":\n $brackets = randomBrackets();\n break;\n default:\n $brackets = $text_evaluate;\n break;\n }\n\n // Preparing for edge cases.\n while (empty($brackets)) {\n $brackets = randomBrackets();\n }\n $brackets_length = strlen($brackets);\n\n // Shows the sequence of brackets on the input field.\n echo \"\n <script>\n document.getElementById('text_evaluate').value = '\" . $brackets . \"';\n </script>\";\n\n $open = array('(', '[', '{');\n $close = array(')', ']', '}');\n\n /**\n * Creates the arrays $brackets_open and $brackets_close. They will be used to\n * check if there are unmatched brackets, called orphans.\n * \n * Creates the array $valid_brackets with all brackets, after excluding any\n * possible foreign characters.\n */\n $valid_brackets = array();\n $brackets_open = array();\n $brackets_close = array();\n for ($i = 0; $i < $brackets_length; $i++) {\n if (in_array($brackets[$i], $open)) {\n $brackets_open[$i] = $brackets[$i];\n } elseif (in_array($brackets[$i], $close)) {\n $brackets_close[$i] = $brackets[$i];\n }\n\n $current_character = substr($brackets, $i, 1);\n if (in_array($current_character, $open) || in_array($current_character, $close)) {\n $valid_brackets[$i] = $current_character;\n }\n }\n\n // Shows the string received, without filtering foreign characters.\n $brackets_style = \"<pre class='string'>string_received (count: $brackets_length) {\\n $brackets\\n}</pre>\";\n echo $brackets_style;\n\n // Shows the string received, with foreign characters filtered out.\n $brackets_style = \"<pre class='brackets'>valid_brackets (count: \" . count($valid_brackets) . \") {\\n\";\n foreach($valid_brackets as $bk => $bv) {\n $brackets_style .= \" $bv -- position: $bk \\n\";\n }\n $brackets_style .= \"}</pre>\";\n echo $brackets_style;\n\n // Shows only opening brackets, in order of appearance.\n $brackets_style = \"<pre class='brackets'>brackets_open_order (count: \" . count($brackets_open) . \") {\\n\";\n foreach($brackets_open as $bk => $bv) {\n $brackets_style .= \" $bv -- position: $bk \\n\";\n }\n $brackets_style .= \"}</pre>\";\n echo $brackets_style;\n\n // Shows only closing brackets, in order of appearance.\n $brackets_style = \"<pre class='brackets'>brackets_close_order (count: \" . count($brackets_close) . \") {\\n\";\n foreach($brackets_close as $bk => $bv) {\n $brackets_style .= \" $bv -- position: $bk \\n\";\n }\n $brackets_style .= \"}</pre>\";\n echo $brackets_style;\n\n /**\n * Analyses the sequence of brackets and verifies which ones match the rules:\n * - Rule 1 (\"Pairs\"): An opened bracket must be closed to be valid, which means \n * they must form pairs;\n * - Rule 2 (\"Scope\"): A pair must have both parts inside another pair or outside \n * any pair, which means that a pair opening inside another pair and closing \n * outside of it is not valid.\n * \n * Unmatched brackets are kept in the $orphans array. Matched brackets are kept \n * only in the $brackets array.\n * \n * The $temp array is used to stare temporarily the brackets being analyzed.\n */\n $orphans = array();\n $temp = array();\n foreach($valid_brackets as $brackets_key => $brackets_value) {\n // Is the current bracket an opening one?\n $brackets_key_found = array_search($brackets_value, $open);\n\n // If it is, keep it in the $temp array.\n if ($brackets_key_found !== false) {\n $temp[$brackets_key] = $brackets_value;\n\n // If it isn't...\n } else {\n // 1. Find out which bracket matches it;\n $brackets_close_key = array_search($brackets_value, $close);\n $brackets_open_value = $open[$brackets_close_key];\n\n // 2. Search for the most recent match.\n $reversed = array_reverse($temp, true);\n $last_occurrence = array_search($brackets_open_value, $reversed);\n\n // If the match was found...\n if ($last_occurrence !== false) {\n // Remove it from the $temp array...\n unset($temp[$last_occurrence]);\n if (count($temp) > 0) {\n foreach ($temp as $k => $v) {\n /**\n * and remove existing brackets between the pair.\n * \n * For example: Consider the sequence \"{[((]\".\n * It has a matching pair: \"[\" and \"]\".\n * Everything else is unmatched.\n * \n * What we do here is to remove only what's inside the pair.\n * When we got to this point, the $temp array had the following\n * contents: \"{((\", because we already removed the \"[\" bracket.\n * Here we will remove what was between \"[\" and \"]\", which was\n * \"((\". As a result, $temp will have the following content: \"{\".\n * \n * We kept this content because it might match some (possible)\n * further bracket.\n */\n if ($k > $last_occurrence) {\n $orphans[$k] = $v;\n unset($temp[$k]);\n }\n }\n }\n\n // If no match was found...\n } else {\n // it means this is an orphan bracket.\n $orphans[$brackets_key] = $brackets_value;\n }\n }\n }\n\n // If the $temp array has any content left, they are all orphans.\n if (count($temp) > 0) {\n foreach ($temp as $k => $v) {\n $orphans[$k] = $v;\n unset($temp[$k]);\n }\n }\n ksort($orphans);\n\n // Shows the orphan brackets.\n if (count($orphans) > 0) {\n $brackets_style = \"<pre class='brackets'>orphan_brackets (count: \" . count($orphans) . \") {\\n\";\n foreach($orphans as $bk => $bv) {\n $brackets_style .= \" $bv -- position: $bk \\n\";\n }\n $brackets_style .= \"}</pre>\";\n echo $brackets_style;\n }\n\n $aux_str = \"\";\n $brackets_style = \"<div style='padding-left: 20px;'><span class='result'><pre>brackets_result_in_line (count: $brackets_length) {\\n \";\n for ($i = 0; $i < $brackets_length; $i++) {\n if (isset($orphans[$i])) {\n $aux_str .= '<span class=\"orphan-brackets\">' . substr($brackets, $i, 1) . '</span>';\n } elseif (isset($orphans[$i])) {\n $aux_str .= '<span class=\"orphan-brackets\">' . substr($brackets, $i, 1) . '</span>';\n } else {\n $aux_str .= '<span class=\"non-orphan-brackets\">' . substr($brackets, $i, 1) . '</span>';\n }\n }\n $brackets_style .= $aux_str;\n $brackets_style .= \"\\n}</pre></span></div>\";\n // Shows, in a line, the sequence of no valid brackets.\n echo $brackets_style;\n\n $aux_str = \"\";\n // $offset if used to control the indentation.\n $offset = 3;\n /**\n * $previous_open_close_move is used to keep track of which kind of bracket\n * was last shown. If its content is \"o\", it means it was an opening one.\n * If its content is \"c\", it means it was a closing one.\n * \n * It is necessary, because we need to know when the $offset variable should\n * have its value subtracted, which means we have a closing bracket with some\n * other brackets inside it. \n * \n * For example:\n * {\n * [((]( \n * }\n * \n * In this case, the \"}\" bracket needs its offset reduced to be shown correctly.\n */ \n $previous_open_close_move = \"o\";\n $brackets_style = \"<div style='padding-left: 20px;'><span class='result'><pre>brackets_result_with_visual_aid (count: $brackets_length) {\\n \";\n for ($i = 0; $i < $brackets_length; $i++) {\n if (isset($orphans[$i])) {\n $aux_str .= '<span class=\"orphan-brackets\">' . substr($brackets, $i, 1) . '</span>';\n } else {\n if (in_array(substr($brackets, $i, 1), $open)) {\n if (!empty($aux_str)) {\n $aux_str .= \"\\n\" . str_repeat(\" \", $offset) . \"<span class='non-orphan-brackets'>\" . substr($brackets, $i, 1) . \"</span>\";\n } else {\n $aux_str .= \"<span class='non-orphan-brackets'>\" . substr($brackets, $i, 1) . \"</span>\";\n }\n $offset += 3;\n $previous_open_close_move = \"o\";\n }\n\n if (in_array(substr($brackets, $i, 1), $close)) {\n $offset -= 3;\n if ($previous_open_close_move == \"c\") {\n $aux_str .= \"\\n\" . str_repeat(\" \", $offset) . \"<span class='non-orphan-brackets'>\" . substr($brackets, $i, 1) . \"</span>\";\n } else {\n $aux_str .= \"<span class='non-orphan-brackets'>\" . substr($brackets, $i, 1) . \"</span>\";\n }\n $previous_open_close_move = \"c\";\n }\n }\n }\n $brackets_style .= $aux_str;\n $brackets_style .= \"\\n}</pre></span></div>\";\n // Shows, with visual aid, the sequence of no valid brackets.\n echo $brackets_style;\n\n if (count($orphans) == 0) {\n echo '\n <div class=\"alert alert-success evaluation\" role=\"alert\">\n The sequence of brackets received is valid.\n </div>';\n } else {\n echo '\n <div class=\"alert alert-danger evaluation\" role=\"alert\">\n The sequence of brackets received is not valid.\n </div>';\n }\n}", "public static function phpEvaluation(Template $template/*, $content, $isFile*/)\n\t{\n\t\textract($template->getParams(), EXTR_SKIP); // skip $this & $template\n\t\tif (func_num_args() > 2 && func_get_arg(2)) {\n\t\t\tinclude func_get_arg(1);\n\t\t} else {\n\t\t\teval('?>' . func_get_arg(1));\n\t\t}\n\t}", "protected function compileRaw($expression)\n {\n if (Str::startsWith($expression, '(')) {\n $expression = substr($expression, 1, -1);\n }\n\n return \"<?php echo \\$__env->make($expression, ['raw' => true], array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>\";\n }", "public function embedCode($strCode, $varFile, $intSize)\n\t{\n\t\tif ($intSize > 0) {\n\t\t\t$objHelper = new CssInlineImagesHelper($varFile, $intSize);\n\t\t\treturn preg_replace_callback('#url\\((.*)\\)#U', array($objHelper, 'replace'), $strCode);\n\t\t} else {\n\t\t\treturn $strCode;\n\t\t}\n\t}", "function ensure_proper_quotation_nesting() {\r\n\t\t//$this->code = OM::ensure_proper_nesting($this->code, 'q');\r\n\t\tReTidy::combine_inline();\r\n\t}", "private function processBlockquote($text, $inline = false)\n {\n if ($inline) {\n $length = 0;\n $text = str_replace(self::BLOCKQUOTE_INLINE_START, '', $text); // remove bq.\n } else {\n $length = strlen(self::BLOCKQUOTE_BLOCK_START);\n $text = mb_substr($text, $length); // remove first {quote}\n }\n\n $end = $this->findBlockquoteEnd($text, $inline);\n $blockquote = mb_substr($text, 0, $end);\n $this->wrapInNode(self::NODE_BLOCKQUOTE, function () use ($blockquote) {\n $this->processInline($blockquote);\n });\n\n return mb_substr($text, $end + $length);\n }", "protected function codeToModify()\n {\n return '\n if (is_callable(array($this->metaclass, func_get_arg(0)))) {\n try {\n return call_user_func_array(array($this->metaclass, ' .\n 'func_get_arg(0)), func_get_arg(1));\n } catch (BadMethodCallException $e) {\n %s\n }\n }\n ';\n }", "function php($text, $wrapper = 'code') {\n global $conf;\n\n if($conf['phpok']) {\n ob_start();\n eval($text);\n $this->doc .= ob_get_contents();\n ob_end_clean();\n } else {\n $this->doc .= p_xhtml_cached_geshi($text, 'php', $wrapper);\n }\n }", "public function inline($format, $args = array());", "function yy_r171()\n {\n if (empty($this->db_quote_code_buffer)) {\n $this->_retvalue = '(string)(' . $this->yystack[$this->yyidx + 0]->minor . ')';\n } else {\n $this->db_quote_code_buffer .= 'echo (string)(' . $this->yystack[$this->yyidx + 0]->minor . ');';\n $this->_retvalue = false;\n }\n }", "function prepare_eval($phrase)\n{\n $retVal = \"\";\n $retVal = str_replace(\"!\", \"\\\"\",$phrase);\n $retVal = str_replace(\"#\", \"'\", $retVal);\n return str_replace(\"~\", \"#\", $retVal);\n}", "function _answerInlineQuery($inlineQueryId,$result = [])\n{\n $data = [\n 'inline_query_id' => $inlineQueryId,\n 'results' => json_encode(\n $result\n ),\n 'cache_time' => 0,\n ];\n\n return Request('answerInlineQuery', $data);\n}", "public function format_text($text, $format, $qa, $component, $filearea, $itemid)\n {\n //get a list of varaibles created by the initialization script \n $vars = json_decode($qa->get_last_qt_var('_vars'));\n $funcs = json_decode($qa->get_last_qt_var('_funcs'));\n\n $text = qtype_scripted_language_manager::format_text($text, $this->language, $vars, $funcs);\n\n //run the question text through the basic moodle formatting engine\n return parent::format_text($text, $format, $qa, $component, $filearea, $itemid);\n\n\n //Evaluate all of the question's inline code.\n $operations = array(2 => 'execute', 1=> 'evaluate');\n foreach($operations as $bracket_level => $operation) {\n $interpreter = $this->create_interpreter($vars, $funcs);\n $text = $this->handle_inline_code($text, $bracket_level, $operation, $interpreter);\n }\n\n //run the question text through the basic moodle formatting engine\n return parent::format_text($text, $format, $qa, $component, $filearea, $itemid);\n }", "protected function _getInlineJavaScript()\n {\n return '';\n }", "protected\n function execute_code( $code, $arguments, $post_object )\n {\n if ( author_can($post_object, EnzymesCapabilities::create_dynamic_custom_fields) &&\n ($this->injection_author_owns($post_object) ||\n author_can($post_object, EnzymesCapabilities::share_dynamic_custom_fields) &&\n $this->injection_author_can(EnzymesCapabilities::use_others_custom_fields))\n ) {\n list($result, $error, $output) = $this->clean_eval($code, $arguments);\n if ( $error ) {\n $this->console_log($this->decorate(__('ENZYMES ERROR'), $error));\n $result = null;\n }\n if ( $output ) {\n $this->console_log($this->decorate(__('ENZYMES OUTPUT'), $output));\n }\n } else {\n $result = null;\n }\n return $result;\n }", "function sql_highlight(&$code)\n\n{\n\n $code = strtr($code, array('\"\"' => get_placeholder(9), \"''\" => get_placeholder(10)));\n\n $blocks = array(\n\n array(\n\n 'pattern' => \"#(['\\\"`])(\\\\\\\\\\\\\\\\|.*?([^\\\\\\\\]|[^\\\\\\\\](\\\\\\\\\\\\\\\\)+)|)\\\\1#se\",\n\n //'replacement' => 'parse_c_string(\\'$0\\', \\'sql\\', \\'|&quot;&quot;|\\\\\\'\\\\\\'\\')'\n\n //'pattern' => \"#(['\\\"])(.*?([^\\\\\\\\]|(\\\\\\\\\\\\\\\\)+)|)\\\\1#s\",\n\n 'prefix' => '<span class=\"sql_string\">', \n\n 'suffix' => '</span>'\n\n ),\n\n array(\n\n 'pattern' => \"#/\\\\*(.*?)\\\\*/#s\",\n\n 'prefix' => '<span class=\"sql_blockcomment\">', \n\n 'suffix' => '</span>'\n\n ),\n\n array(\n\n 'pattern' => \"#--(.*?)[\\n\\r]#\",\n\n 'prefix' => '<span class=\"sql_linecomment\">', \n\n 'suffix' => '</span>'\n\n ),\n\n );\n\n $secondaries = array(\n\n array(\n\n 'pattern' => '#(\\W|^)(\\.?[0-9][0-9a-zA-Z.]*)#i',\n\n 'replacement' => '<span class=\"sql_number\">$2</span>',\n\n 'keepprefix' => 1\n\n ),\n\n array(\n\n 'pattern' => '#([,\\[\\]\\{\\};=\\+\\-!%\\^&*\\(\\)<>|])#',\n\n 'prefix' => '<span class=\"sql_symbol\">',\n\n 'suffix' => '</span>'\n\n ),\n\n );\n\n \n\n $kw = array(\n\n array(\n\n 'prefix' => '<span '.get_placeholder(8).'=\"sql_keyword\">',\n\n 'suffix' => '</span>',\n\n 'keywords' => array('abs','absolute','access','acos','add','add_months','adddate','admin','after','aggregate','all','allocate','alter','and','any','app_name','are','array','as','asc','ascii','asin','assertion','at','atan','atn2','audit','authid','authorization','autonomous_transaction','avg','before','begin','benchmark','between','bfilename','bin','binary','binary_checksum','binary_integer','bit','bit_count','bit_and','bit_or','blob','body','boolean','both','breadth','bulk','by','call','cascade','cascaded','case','cast','catalog','ceil','ceiling','char','char_base','character','charindex','chartorowid','check','checksum','checksum_agg','chr','class','clob','close','cluster','coalesce','col_length','col_name','collate','collation','collect','column','comment','commit','completion','compress','concat','concat_ws','connect','connection','constant','constraint','constraints','constructorcreate','contains','containsable','continue','conv','convert','corr','corresponding','cos','cot','count','count_big','covar_pop','covar_samp','create','cross','cube','cume_dist','current','current_date','current_path','current_role','current_time','current_timestamp','current_user','currval','cursor','cycle','data','datalength','databasepropertyex','date','date_add','date_format','date_sub','dateadd','datediff','datename','datepart','day','db_id','db_name','deallocate','dec','declare','decimal','decode','default','deferrable','deferred','degrees','delete','dense_rank','depth','deref','desc','describe','descriptor','destroy','destructor','deterministic','diagnostics','dictionary','disconnect','difference','distinct','do','domain','double','drop','dump','dynamic','each','else','elsif','empth','encode','encrypt','end','end-exec','equals','escape','every','except','exception','exclusive','exec','execute','exists','exit','exp','export_set','extends','external','extract','false','fetch','first','first_value','file','float','floor','file_id','file_name','filegroup_id','filegroup_name','filegroupproperty','fileproperty','for','forall','foreign','format','formatmessage','found','freetexttable','from','from_days','fulltextcatalog','fulltextservice','function','general','get','get_lock','getdate','getansinull','getutcdate','global','go','goto','grant','greatest','group','grouping','having','heap','hex','hextoraw','host','host_id','host_name','hour','ident_incr','ident_seed','ident_current','identified','identity','if','ifnull','ignore','immediate','in','increment','index','index_col','indexproperty','indicator','initcap','initial','initialize','initially','inner','inout','input','insert','instr','instrb','int','integer','interface','intersect','interval','into','is','is_member','is_srvrolemember','is_null','is_numeric','isdate','isnull','isolation','iterate','java','join','key','lag','language','large','last','last_day','last_value','lateral','lcase','lead','leading','least','left','len','length','lengthb','less','level','like','limit','limited','ln','lpad','local','localtime','localtimestamp','locator','lock','log','log10','long','loop','lower','ltrim','make_ref','map','match','max','maxextents','mid','min','minus','minute','mlslabel','mod','mode','modifies','modify','module','month','months_between','names','national','natural','naturaln','nchar','nclob','new','new_time','newid','next','next_day','nextval','no','noaudit','nocompress','nocopy','none','not','nowait','null','nullif','number','number_base','numeric','nvl','nvl2','object','object_id','object_name','object_property','ocirowid','oct','of','off','offline','old','on','online','only','opaque','open','operator','operation','option','or','ord','order','ordinalityorganization','others','out','outer','output','package','pad','parameter','parameters','partial','partition','path','pctfree','percent_rank','pi','pls_integer','positive','positiven','postfix','pow','power','pragma','precision','prefix','preorder','prepare','preserve','primary','prior','private','privileges','procedure','public','radians','raise','rand','range','rank','ratio_to_export','raw','rawtohex','read','reads','real','record','recursive','ref','references','referencing','reftohex','relative','release','release_lock','rename','repeat','replace','resource','restrict','result','return','returns','reverse','revoke','right','rollback','rollup','round','routine','row','row_number','rowid','rowidtochar','rowlabel','rownum','rows','rowtype','rpad','rtrim','savepoint','schema','scroll','scope','search','second','section','seddev_samp','select','separate','sequence','session','session_user','set','sets','share','sign','sin','sinh','size','smallint','some','soundex','space','specific','specifictype','sql','sqlcode','sqlerrm','sqlexception','sqlstate','sqlwarning','sqrt','start','state','statement','static','std','stddev','stdev_pop','strcmp','structure','subdate','substr','substrb','substring','substring_index','subtype','successful','sum','synonym','sys_context','sys_guid','sysdate','system_user','table','tan','tanh','temporary','terminate','than','then','time','timestamp','timezone_abbr','timezone_minute','timezone_hour','timezone_region','to','to_char','to_date','to_days','to_number','to_single_byte','trailing','transaction','translate','translation','treat','trigger','trim','true','trunc','truncate','type','ucase','uid','under','union','unique','unknown','unnest','update','upper','usage','use','user','userenv','using','validate','value','values','var_pop','var_samp','varchar','varchar2','variable','variance','varying','view','vsize','when','whenever','where','with','without','while','with','work','write','year','zone')\n\n )\n\n );\n\n $code = generic_highlight($code, $blocks, $secondaries, array(), $kw);\n\n // put escapes back in\n\n return strtr($code, array(get_placeholder(9) => '<span class=\"sql_string\">&quot;&quot;</span>', get_placeholder(10) => '<span class=\"sql_string\">\\'\\'</span>'));\n\n}", "function yy_r168()\n {\n if (empty($this->db_quote_code_buffer)) {\n $this->_retvalue = '(string)(' . $this->yystack[$this->yyidx + - 1]->minor . ')';\n } else {\n $this->db_quote_code_buffer .= 'echo (string)(' . $this->yystack[$this->yyidx + - 1]->minor . ');';\n $this->_retvalue = false;\n }\n }", "function _inlineEscape($inline) {\n\t// There's gotta be a cleaner way to do this...\n\t// While pure sequences seem to be nesting just fine,\n\t// pure mappings and mappings with sequences inside can't go very\n\t// deep. This needs to be fixed.\n\n\t$saved_strings = array();\n\n\t// Check for strings\n\t$regex = '/(?:(\")|(?:\\'))((?(1)[^\"]+|[^\\']+))(?(1)\"|\\')/';\n\tif (preg_match_all($regex,$inline,$strings)) {\n\t\t$saved_strings = $strings[0];\n\t\t$inline = preg_replace($regex,'YAMLString',$inline);\n\t}\n\tunset($regex);\n\n\t// Check for sequences\n\tif (preg_match_all('/\\[(.+)\\]/U',$inline,$seqs)) {\n\t\t$inline = preg_replace('/\\[(.+)\\]/U','YAMLSeq',$inline);\n\t\t$seqs = $seqs[0];\n\t}\n\n\t// Check for mappings\n\tif (preg_match_all('/{(.+)}/U',$inline,$maps)) {\n\t\t$inline = preg_replace('/{(.+)}/U','YAMLMap',$inline);\n\t\t$maps = $maps[0];\n\t}\n\n\t$explode = explode(', ',$inline);\n\n\n\t// Re-add the sequences\n\tif (!empty($seqs)) {\n\t\t$i = 0;\n\t\tforeach ($explode as $key => $value) {\n\t\tif (strpos($value,'YAMLSeq') !== false) {\n\t\t\t$explode[$key] = str_replace('YAMLSeq',$seqs[$i],$value);\n\t\t\t++$i;\n\t\t}\n\t\t}\n\t}\n\n\t// Re-add the mappings\n\tif (!empty($maps)) {\n\t\t$i = 0;\n\t\tforeach ($explode as $key => $value) {\n\t\tif (strpos($value,'YAMLMap') !== false) {\n\t\t\t$explode[$key] = str_replace('YAMLMap',$maps[$i],$value);\n\t\t\t++$i;\n\t\t}\n\t\t}\n\t}\n\n\t// Re-add the strings\n\tif (!empty($saved_strings)) {\n\t\t$i = 0;\n\t\tforeach ($explode as $key => $value) {\n\t\twhile (strpos($value,'YAMLString') !== false) {\n\t\t\t$explode[$key] = preg_replace('/YAMLString/',$saved_strings[$i],$value, 1);\n\t\t\t++$i;\n\t\t\t$value = $explode[$key];\n\t\t}\n\t\t}\n\t}\n\n\treturn $explode;\n\t}", "public function get_form_editor_inline_script_on_page_render() {\n\n\t\t// set the default field label for the simple type field\n\t\t$script = sprintf( \"function SetDefaultValues_simple(field) {field.label = '%s';}\", $this->get_form_editor_field_title() ) . PHP_EOL;\n\n\t\t// initialize the fields custom settings\n\t\t$script .= \"jQuery(document).bind('gform_load_field_settings', function (event, field, form) {\" .\n\t\t \"var inputClass = field.inputClass == undefined ? '' : field.inputClass;\" .\n\t\t \"jQuery('#input_class_setting').val(inputClass);\" .\n\t\t \"});\" . PHP_EOL;\n\n\t\t// saving the simple setting\n\t\t$script .= \"function SetInputClassSetting(value) {SetFieldProperty('inputClass', value);}\" . PHP_EOL;\n\n\t\treturn $script;\n\t}", "function yy_r167()\n {\n if (empty($this->db_quote_code_buffer)) {\n $this->_retvalue = '(string)' . $this->yystack[$this->yyidx + - 1]->minor;\n } else {\n $this->db_quote_code_buffer .= 'echo (string)' . $this->yystack[$this->yyidx + - 1]->minor . ';';\n $this->_retvalue = false;\n }\n }", "function yy_r169()\n {\n if (empty($this->db_quote_code_buffer)) {\n $this->_retvalue = '(string)$_scope->_tpl_vars->' . substr($this->yystack[$this->yyidx + 0]->minor, 1) . '->value';\n } else {\n $this->db_quote_code_buffer .= 'echo (string)$_scope->_tpl_vars->' . substr($this->yystack[$this->yyidx + 0]->minor, 1) . '->value;';\n $this->_retvalue = false;\n }\n }", "private function _exec_snippet(array $vars)\n {\n // Extracts vars and set prefix bind_ for all of them\n extract($vars, EXTR_PREFIX_ALL, 'bind');\n\n // Get snippet id\n $snippet_id = (string) $bind_id ?? '';\n\n // Define snippet file path\n $snippet_file = $this->_file_location($snippet_id);\n\n // Process snippet\n if (Filesystem::has($snippet_file)) {\n\n // Turn on output buffering\n ob_start();\n\n // Re-init $flextype for snippets\n $flextype = $this->flextype;\n\n // Re-init $app for snippets\n $app = $this->app;\n\n // Include snippet file\n include $snippet_file;\n\n // Output...\n return ob_get_clean();\n } else {\n throw new \\RuntimeException(\"Snippet {$snippet_id} does not exist.\");\n }\n }", "function Code($Code,$Vars){\n\t\t$Code=substr($Code,1,-1);\n\t\treturn (isset($Vars[$Code]) )?$Vars[$Code]:\"[\".$Code.\"]\"; // If no variable exists return the code back to the template\n\t}", "public function inline_custom_data(){}", "function qa_eval_from_file($eval, $filename)\n{\n\t// could also use ini_set('error_append_string') but apparently it doesn't work for errors logged on disk\n\n\tglobal $php_errormsg;\n\n\t$oldtrackerrors = @ini_set('track_errors', 1);\n\t$php_errormsg = null;\n\n\teval('?' . '>' . $eval);\n\n\tif (strlen($php_errormsg)) {\n\t\tswitch (strtolower(@ini_get('display_errors'))) {\n\t\t\tcase 'on':\n\t\t\tcase '1':\n\t\t\tcase 'yes':\n\t\t\tcase 'true':\n\t\t\tcase 'stdout':\n\t\t\tcase 'stderr':\n\t\t\t\techo ' of ' . qa_html($filename) . \"\\n\";\n\t\t\t\tbreak;\n\t\t}\n\n\t\t@error_log('PHP studentrf more info: ' . $php_errormsg . \" in eval()'d code from \" . qa_html($filename));\n\t}\n\n\t@ini_set('track_errors', $oldtrackerrors);\n}", "function code($text, $language = null, $filename = null) {\n $this->_highlight('code', $text, $language, $filename);\n }", "public function evaluate($source)\n\t{\n\t\treturn $this->execute('return eval(' . $source . ');');\n\t}", "static function drawQuestion($args)\n\t{\n\t\t$currentUserID = get_current_user_id();\n\t\t\n\t\t\n\t\t// Get Defaults\n\t\t$defaults = ekQuiz::$defaults;\n\t\t\n\t\tforeach($args as $key => $value){$$key = $value;} # Turn all atts into variables of Key name\n\t\t\n\t\tif($buttonText==\"\")\n\t\t{\n\t\t\t$buttonText=$defaults['buttonText'];\n\t\t}\n\t\t\n\t\t// Add a text area or not\n\t\t$addTextarea = get_post_meta($questionID, \"addTextarea\", true);\n\t\t\n\t\t//if($correctFeedback==\"\"){$correctFeedback = get_post_meta($questionID, \"correctFeedback\", true);}\n\n\t\t$randomKey = $args['randomKey'];\t\t\n\t\t\n\t\t//$qStr='<div id=\"ek-question-'.$questionID.'-'.$randomKey.'\">';\n\t\t$qStr='<div>';\n\t\t\n\t\t$qStr.= apply_filters('the_content', get_post_field('post_content', $questionID));\n\t\t\n\t\t// Auto Save the response if its a text box\n\t\t$saveResponse=false;\n\t\tif($addTextarea==\"on\")\n\t\t{\n\t\t\t$saveResponse=true;\n\t\t}\n\t\t\n\t\t\n\t\t// Add the Vars to the Args to pass via JSON to ajax function\n\t\t$args['randomKey'] = $randomKey;\n\t\t$args['userID'] = $currentUserID;\n\t\t$args['saveResponse'] = $saveResponse;\n\t\t$args['qType'] = self::$qType;\n\t\t\t\t\t\n\t\t// Create array to pass to JS\n\t\t$passData = htmlspecialchars(json_encode($args));\t\n\t\t\n\t\tif($addTextarea==\"on\")\n\t\t{\n\t\t\n\t\t\t$userResponseArray = ekQuiz_queries::getUserResponse($questionID, $currentUserID);\n\t\t\t$userResponse = stripslashes($userResponseArray['userResponse']);\n\t\t\t//$userResponse = apply_filters('the_content', $userResponseArray['userResponse']);\n\n\t\t\n\t\t\n\t\t\t$editor_settings = array\n\t\t\t(\n\t\t\t\t\"media_buttons\"\t=> false, \n\t\t\t\t\"textarea_rows\"\t=> 6,\n\t\t\t\t\"editor_class\"\t=> \"ek-reflection-editor\",\n\t\t\t\t\"tinymce\"\t\t=> array(\n\t\t\t\t'toolbar1'\t=> 'bold,italic,underline,bullist,numlist,forecolor,undo,redo',\n\t\t\t\t'toolbar2'\t=> ''\n\t\t\t\t)\n\t\t\t);\t\t\t\t\t\n\t\t\t\n\t\t\tob_start();\n\t\t\twp_editor($userResponse, 'reflection_'.$questionID.'-'.$randomKey, $editor_settings);\t\t\n\t\t\t$qStr.= ob_get_contents();\n\t\t\tob_end_clean();\n\t\t}\n\t\t\t\n\t\t\t\t\t\n\t\t// Create blank div for feedback fro this qType. unique to reflection as we don't want to recreate textbox\n\t\t$qStr.='<div id=\"reflectionSavedFeedback_'.$questionID.'-'.$randomKey.'\" class=\"reflectionFeedback\">Entry Saved</div>';\n\t\t$qStr.='<div id=\"reflectionFeedback_'.$questionID.'-'.$randomKey.'\" class=\"reflectionSavedFeebdack\">Entry Saved</div>';\t\t\n\t\t\n\t\t$qStr.='<div class=\"ekQuizButtonWrap\" id=\"ekQuizButtonWrap_'.$questionID.'_'.$randomKey.'\">';\n\t\t$qStr.='<input type=\"button\" value=\"'.$buttonText.'\" class=\"ekQuizButton\" onclick=\"javascript:singleQuestionSubmit(\\''.$passData.'\\')\";/>';\n\t\t$qStr.='</div>';\n\t\t\n\t\t// Hide the Visual Tab\n\t\t$qStr.='\t\t\n\t\t\t<style>\n\t\t\t.wp-editor-tools, .post .wp-editor-tools {\n\t\t\t\tdisplay: none;\n\t\t\t}\n\t\t\t</style>\n\t\t';\n\t\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t// Close the Question div wrap\n\t\t$qStr.='</div>';\n\t\t\n\t\t\n\t\t\n\t\treturn $qStr;\n\t\n\t\t\n\t\t\n\t\t\n\t}", "public function inline(string $message, array $context = [], string $color = null, string $background = null)\n {\n $this->climate($color, $background)->inline(\n $this->interpolate($message, $context)\n );\n }", "function care_enqueue_js( $code ) {\n\tglobal $care_queued_js;\n\n\tif ( empty( $care_queued_js ) ) {\n\t\t$care_queued_js = '';\n\t}\n\n\t$care_queued_js .= \"\\n\" . $code . \"\\n\";\n}", "function HighlightCodeSnippet($t,$bg=true) {\r\n $t = \"<?php $t?>\";\r\n ob_start();\r\n highlight_string($t);\r\n $t = ob_get_contents();\t\r\n ob_end_clean();\r\n $t=str_replace('&lt;?php&nbsp;','',$t);\r\n $t=str_replace('?&gt;','',$t);\r\n if( $bg ) {\r\n\t$t = \"<div style=\\\"background-color:#E6E6E6;font-family:courier new;font-size:85%;font-weight:bold;\\\"><b>$t</b></div>\";\r\n }\r\n else {\r\n\t$t = \"<span style=\\\"font-family:courier;font-size:85%;font-weight:bold;\\\">$t</span>\";\r\n }\r\n return $t;\r\n}", "function compile($code, $do_not_echo = false, $retvar = '')\n\t{\n\t\t$code = str_replace('\\\\', '\\\\\\\\', $code);\n\t\t$code = str_replace('\\'', '\\\\\\'', $code);\n\n\t\t// change template varrefs into PHP varrefs\n\n\t\t// This one will handle varrefs WITH namespaces\n\t\t$varrefs = array();\n\t\tpreg_match_all('#\\{(([a-z0-9\\-_]+?\\.)+?)([a-z0-9\\-_]+?)\\}#is', $code, $varrefs);\n\t\t$varcount = sizeof($varrefs[1]);\n\t\tfor ($i = 0; $i < $varcount; $i++)\n\t\t{\n\t\t\t$namespace = $varrefs[1][$i];\n\t\t\t$varname = $varrefs[3][$i];\n\t\t\t$new = $this->generate_block_varref($namespace, $varname);\n\n\t\t\t$code = str_replace($varrefs[0][$i], $new, $code);\n\t\t}\n\n\t\t// This will handle the remaining root-level varrefs\n\t\t$code = preg_replace('#\\{([a-z0-9\\-_]*?)\\}#is', '\\' . ( ( isset($this->_tpldata[\\'.\\'][0][\\'\\1\\']) ) ? $this->_tpldata[\\'.\\'][0][\\'\\1\\'] : \\'\\' ) . \\'', $code);\n\n\t\t// Break it up into lines.\n\t\t$code_lines = explode(\"\\n\", $code);\n\n\t\t$block_nesting_level = 0;\n\t\t$block_names = array();\n\t\t$block_names[0] = \".\";\n\n\t\t// Second: prepend echo ', append ' . \"\\n\"; to each line.\n\t\t$line_count = sizeof($code_lines);\n\t\tfor ($i = 0; $i < $line_count; $i++)\n\t\t{\n\t\t\t$code_lines[$i] = chop($code_lines[$i]);\n\t\t\tif (preg_match('#<!-- BEGIN (.*?) -->#', $code_lines[$i], $m))\n\t\t\t{\n\t\t\t\t$n[0] = $m[0];\n\t\t\t\t$n[1] = $m[1];\n\n\t\t\t\t// Added: dougk_ff7-Keeps templates from bombing if begin is on the same line as end.. I think. :)\n\t\t\t\tif ( preg_match('#<!-- END (.*?) -->#', $code_lines[$i], $n) )\n\t\t\t\t{\n\t\t\t\t\t$block_nesting_level++;\n\t\t\t\t\t$block_names[$block_nesting_level] = $m[1];\n\t\t\t\t\tif ($block_nesting_level < 2)\n\t\t\t\t\t{\n\t\t\t\t\t\t// Block is not nested.\n\t\t\t\t\t\t$code_lines[$i] = '$_' . $n[1] . '_count = ( isset($this->_tpldata[\\'' . $n[1] . '.\\']) ) ? sizeof($this->_tpldata[\\'' . $n[1] . '.\\']) : 0;';\n\t\t\t\t\t\t$code_lines[$i] .= \"\\n\" . 'for ($_' . $n[1] . '_i = 0; $_' . $n[1] . '_i < $_' . $n[1] . '_count; $_' . $n[1] . '_i++)';\n\t\t\t\t\t\t$code_lines[$i] .= \"\\n\" . '{';\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t// This block is nested.\n\n\t\t\t\t\t\t// Generate a namespace string for this block.\n\t\t\t\t\t\t$namespace = implode('.', $block_names);\n\t\t\t\t\t\t// strip leading period from root level..\n\t\t\t\t\t\t$namespace = substr($namespace, 2);\n\t\t\t\t\t\t// Get a reference to the data array for this block that depends on the\n\t\t\t\t\t\t// current indices of all parent blocks.\n\t\t\t\t\t\t$varref = $this->generate_block_data_ref($namespace, false);\n\t\t\t\t\t\t// Create the for loop code to iterate over this block.\n\t\t\t\t\t\t$code_lines[$i] = '$_' . $n[1] . '_count = ( isset(' . $varref . ') ) ? sizeof(' . $varref . ') : 0;';\n\t\t\t\t\t\t$code_lines[$i] .= \"\\n\" . 'for ($_' . $n[1] . '_i = 0; $_' . $n[1] . '_i < $_' . $n[1] . '_count; $_' . $n[1] . '_i++)';\n\t\t\t\t\t\t$code_lines[$i] .= \"\\n\" . '{';\n\t\t\t\t\t}\n\n\t\t\t\t\t// We have the end of a block.\n\t\t\t\t\tunset($block_names[$block_nesting_level]);\n\t\t\t\t\t$block_nesting_level--;\n\t\t\t\t\t$code_lines[$i] .= '} // END ' . $n[1];\n\t\t\t\t\t$m[0] = $n[0];\n\t\t\t\t\t$m[1] = $n[1];\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t// We have the start of a block.\n\t\t\t\t\t$block_nesting_level++;\n\t\t\t\t\t$block_names[$block_nesting_level] = $m[1];\n\t\t\t\t\tif ($block_nesting_level < 2)\n\t\t\t\t\t{\n\t\t\t\t\t\t// Block is not nested.\n\t\t\t\t\t\t$code_lines[$i] = '$_' . $m[1] . '_count = ( isset($this->_tpldata[\\'' . $m[1] . '.\\']) ) ? sizeof($this->_tpldata[\\'' . $m[1] . '.\\']) : 0;';\n\t\t\t\t\t\t$code_lines[$i] .= \"\\n\" . 'for ($_' . $m[1] . '_i = 0; $_' . $m[1] . '_i < $_' . $m[1] . '_count; $_' . $m[1] . '_i++)';\n\t\t\t\t\t\t$code_lines[$i] .= \"\\n\" . '{';\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t// This block is nested.\n\n\t\t\t\t\t\t// Generate a namespace string for this block.\n\t\t\t\t\t\t$namespace = implode('.', $block_names);\n\t\t\t\t\t\t// strip leading period from root level..\n\t\t\t\t\t\t$namespace = substr($namespace, 2);\n\t\t\t\t\t\t// Get a reference to the data array for this block that depends on the\n\t\t\t\t\t\t// current indices of all parent blocks.\n\t\t\t\t\t\t$varref = $this->generate_block_data_ref($namespace, false);\n\t\t\t\t\t\t// Create the for loop code to iterate over this block.\n\t\t\t\t\t\t$code_lines[$i] = '$_' . $m[1] . '_count = ( isset(' . $varref . ') ) ? sizeof(' . $varref . ') : 0;';\n\t\t\t\t\t\t$code_lines[$i] .= \"\\n\" . 'for ($_' . $m[1] . '_i = 0; $_' . $m[1] . '_i < $_' . $m[1] . '_count; $_' . $m[1] . '_i++)';\n\t\t\t\t\t\t$code_lines[$i] .= \"\\n\" . '{';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if (preg_match('#<!-- END (.*?) -->#', $code_lines[$i], $m))\n\t\t\t{\n\t\t\t\t// We have the end of a block.\n\t\t\t\tunset($block_names[$block_nesting_level]);\n\t\t\t\t$block_nesting_level--;\n\t\t\t\t$code_lines[$i] = '} // END ' . $m[1];\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// We have an ordinary line of code.\n\t\t\t\tif (!$do_not_echo)\n\t\t\t\t{\n\t\t\t\t\t$code_lines[$i] = 'echo \\'' . $code_lines[$i] . '\\' . \"\\\\n\";';\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$code_lines[$i] = '$' . $retvar . '.= \\'' . $code_lines[$i] . '\\' . \"\\\\n\";'; \n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Bring it back into a single string of lines of code.\n\t\t$code = implode(\"\\n\", $code_lines);\n\t\treturn $code\t;\n\n\t}", "public function getCodeSample()\n {\n $code = <<< 'CODE'\n namespace KEINOS\\AutoMailReply;\n require_once('./src/constants.php');\n require_once('./src/functions.php');\n echo (isModeDebug() === true) ? 'true' : 'false';\nCODE;\n $code = \\str_replace(PHP_EOL, '', $code);\n\n return $code;\n }", "public function getContent($code)\n\t{\n\t\treturn self::_raw($this->format, $code, $this->type, $this->widthFactor, $this->height, $this->color);\n\t}", "public function inline_edit()\n {\n }", "public function inline_edit()\n {\n }", "protected function _parseCode($txt)\n\t{\n\t\t$_orig\t= $txt;\n\t\t$txt = $txt[1];\n\n\t\tif ( ! $txt )\n\t\t{\n\t\t\treturn '';\n\t\t}\n\t\t\n\t\t$album = 0;\n\t\t$track = 0;\n\t\t\n\t\tif (preg_match('#album=([0-9]+)#is', $txt, $matches)) {\n\t\t\t$album = 'album='.$matches[1].'/';\n\t\t}\n\t\t\n\t\tif (preg_match('#track=([0-9]+)#is', $txt, $matches)) {\n\t\t\t$track = 'track='.$matches[1].'/';\n\t\t}\n\t\t\n\t\tif (!empty($album) || !empty($track)) {\n\t\t\treturn '<iframe style=\"border: 0; width: 100%; height: 120px;\" src=\"https://bandcamp.com/EmbeddedPlayer/'\n\t\t\t\t.$album.'size=large/bgcol=ffffff/linkcol=0687f5/tracklist=false/artwork=small/'.$track.'transparent=true/\" seamless></iframe>';\n\t\t}\n\t\t\n\t\treturn '';\t\t\n\t}", "public function add_inline_style($handle, $code)\n {\n }", "function yy_r8()\n {\n if ($this->php_handling == Smarty::PHP_PASSTHRU) {\n $this->compiler->template_code->php(\"echo '<?php';\\n\");\n } elseif ($this->php_handling == Smarty::PHP_QUOTE) {\n $this->compiler->template_code->php(\"echo '&lt;?php';\\n\");\n } elseif ($this->php_handling == Smarty::PHP_ALLOW) {\n if (! ($this->compiler->context->smarty instanceof Smarty_Smarty2BC)) {\n $this->compiler->error(self::Err3);\n }\n $this->text_is_php = true;\n }\n }", "function vb_highlight(&$code)\n\n{\n\n $code = str_replace('\"\"', get_placeholder(10), $code);\n\n $blocks = array(\n\n array(\n\n 'pattern' => '#\".+?\"#',\n\n 'prefix' => '<span class=\"vb_string\">', \n\n 'suffix' => '</span>'\n\n ),\n\n array(\n\n 'pattern' => \"#'.*#\",\n\n 'prefix' => '<span class=\"vb_comment\">', \n\n 'suffix' => '</span>'\n\n ),\n\n );\n\n \n\n $secondaries = array(\n\n array(\n\n 'pattern' => '!([\\n\\r]|^)\\s*?#.*!',\n\n 'prefix' => '<span class=\"vb_preprocessor\">',\n\n 'suffix' => '</span>'\n\n ),\n\n array(\n\n 'pattern' => '!(\\W|^)(\\.?[0-9][0-9.]*|&[hH][0-9a-fA-F]*)!',\n\n 'replacement' => '<span class=\"vb_number\">$2</span>',\n\n 'keepprefix' => 1\n\n ),\n\n array(\n\n 'pattern' => '~[,=\\+\\-!%\\^&\\*\\(\\)\\<\\>#$|]~',\n\n 'prefix' => '<span class=\"vb_symbol\">',\n\n 'suffix' => '</span>'\n\n )\n\n );\n\n \n\n $kw = array(\n\n array(\n\n 'prefix' => '<span '.get_placeholder(8).'=\"vb_keyword\">',\n\n 'suffix' => '</span>',\n\n 'keywords' => array('addhandler','addressof','andalso','alias','and','ansi','as','assembly','attribute','auto','begin','call','case','catch','cbool','cbyte','cchar','cdate','cdec','cdbl','char','cint','class','clng','cobj','compare','const','continue','cshort','csng','cstr','ctype','declare','default','delegate','dim','do','each','else','elseif','end','erase','error','event','exit','explicit','finally','for','friend','function','get','gettype','global','gosub','goto','handles','if','implement','implements','imports','in','inherits','interface','is','let','lib','like','load','loop','lset','me','mid','mod','module','mustinherit','mustoverride','mybase','myclass','namespace','new','next','not','nothing','notinheritable','notoverridable','on','open','option','or','orelse','overloads','overridable','overrides','paramarray','preserve','property','raiseevent','readonly','redim','rem','removehandler','rset','resume','return','select','set','shadows','shared','step','stop','structure','sub','synclock','then','throw','to','try','typeof','unload','unicode','until','wend','when','while','with','withevents','writeonly','xor')\n\n ),\n\n array(\n\n 'prefix' => '<span '.get_placeholder(8).'=\"vb_type\">',\n\n 'suffix' => '</span>',\n\n 'keywords' => array('boolean','byref','byte','byval','currency','date','decimal','double','enum','false','integer','long','object','optional','private','protected','public','short','single','static','string','true','type','variant')\n\n ),\n\n );\n\n $code = generic_highlight($code, $blocks, $secondaries, array(), $kw);\n\n // put escapes back in\n\n return str_replace(get_placeholder(10), '<span class=\"vb_string\">&quot;&quot;</span>', $code);\n\n}", "function execute($filename, $code, $handle)\n\t{\n\t\tglobal $lang, $theme, $config;\n\t\t$template = $theme['template_name'];\n\t\tglobal ${$template};\n\t\t$theme_info = &${$template};\n\t\t$exclude_tpl_array = array('def_tree_def.tpl', 'rss_body.tpl');\n\t\t//die(basename($this->files[$handle]));\n\t\tif($config['xs_add_comments'] && $handle && !in_array(basename($this->files[$handle]), $exclude_tpl_array))\n\t\t{\n\t\t\techo '<!-- template ', $this->files[$handle], ' start -->';\n\t\t}\n\t\tif($filename)\n\t\t{\n\t\t\tinclude($filename);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t/*\n\t\t\tdie($this->files[$handle]);\n\t\t\tdie($code);\n\t\t\t*/\n\t\t\teval($code);\n\t\t}\n\t\tif($config['xs_add_comments'] && $handle && !in_array(basename($this->files[$handle]), $exclude_tpl_array))\n\t\t{\n\t\t\techo '<!-- template ', $this->files[$handle], ' end -->';\n\t\t}\n\t\treturn true;\n\t}", "public function evaluate(array $context=[]) {\n\n try {\n $wkContext = $context;\n $vars = $this->getCodeSnippetVariables();\n\n //default to NULL for missing vars\n foreach ($vars as $var) {\n if (!in_array($var->getName(), array_keys($context))) {\n $wkContext[ $var->getName() ] = null;\n }\n }\n\n return evaluate_in_lambda($this->getSnippet(), $wkContext, $this->getType() == self::TYPE_EXPRESSION);\n } catch(\\Error $e) {\n throw new \\Exception('Snippet '.$this->getHumanDescription().' produced an ERROR: '.$e->getMessage());\n } catch(\\Throwable $e) {\n throw new \\Exception('Snippet '.$this->getHumanDescription().' threw an Exception : '.$e->getMessage(), 0, $e);\n }\n }", "public function evaluate($content, array $contentVariables = array());", "function code_trick( $text, $markdown ) {\n\t\t// If doing markdown, first take any user formatted code blocks and turn them into backticks so that\n\t\t// markdown will preserve things like underscores in code blocks\n\t\tif ( $markdown )\n\t\t\t$text = preg_replace_callback(\"!(<pre><code>|<code>)(.*?)(</code></pre>|</code>)!s\", array( __CLASS__,'decodeit'), $text);\n\n\t\t$text = str_replace(array(\"\\r\\n\", \"\\r\"), \"\\n\", $text);\n\t\tif ( !$markdown ) {\n\t\t\t// This gets the \"inline\" code blocks, but can't be used with Markdown.\n\t\t\t$text = preg_replace_callback(\"|(`)(.*?)`|\", array( __CLASS__, 'encodeit'), $text);\n\t\t\t// This gets the \"block level\" code blocks and converts them to PRE CODE\n\t\t\t$text = preg_replace_callback(\"!(^|\\n)`(.*?)`!s\", array( __CLASS__, 'encodeit'), $text);\n\t\t} else {\n\t\t\t// Markdown can do inline code, we convert bbPress style block level code to Markdown style\n\t\t\t$text = preg_replace_callback(\"!(^|\\n)([ \\t]*?)`(.*?)`!s\", array( __CLASS__, 'indent'), $text);\n\t\t}\n\t\treturn $text;\n\t}", "function genesis_execute_php_widgets( $html ) {\n\tif ( strpos( $html, \"<\" . \"?php\" ) !==false ) {\n\tob_start();\n\teval( \"?\".\">\".$html );\n\t$html=ob_get_contents();\n\tob_end_clean();\n\t\t}\n\treturn $html;\n}", "protected function rawPlaceholder($replace) : string\n {\n return str_replace('#', $replace, '@__raw_block_#__@');\n }", "public function make_ccode_question_sqr() {\n question_bank::load_question_definition_classes('ccode');\n $ccode = new qtype_ccode_question();\n test_question_maker::initialise_a_question($ccode);\n $ccode->name = 'Function to square a number n';\n $ccode->questiontext = 'Write a function int sqr(int n) that returns n squared.';\n $ccode->generalfeedback = 'No feedback available for ccode questions.';\n $ccode->testcases = array(\n (object) array('testcode' => 'printf(\"%d\", sqr(0));',\n 'output' => '0',\n 'display' => 'SHOW',\n 'hiderestiffail' => 0,\n 'useasexample' => 1),\n (object) array('testcode' => 'printf(\"%d\", sqr(7));',\n 'output' => '49',\n 'display' => 'SHOW',\n 'hiderestiffail' => 0,\n 'useasexample' => 1),\n (object) array('testcode' => 'printf(\"%d\", sqr(-11));',\n 'output' => '121',\n 'display' => 'SHOW',\n 'hiderestiffail' => 0,\n 'useasexample' => 0),\n (object) array('testcode' => 'printf(\"%d\", sqr(-16));',\n 'output' => '256',\n 'display' => 'HIDE',\n 'hiderestiffail' => 0,\n 'useasexample' => 0)\n );\n $ccode->qtype = question_bank::get_qtype('ccode');\n $ccode->unitgradingtype = 0;\n $ccode->unitpenalty = 0.2;\n return $ccode;\n }", "public function testParameterizedInlineAnnotation() {\n $comment = \"/** @Inline(param = value) */\";\n $annotations = new Annotations($comment);\n\n $this->assertTrue(isset($annotations['inline']));\n $this->assertTrue(isset($annotations['inline']['param']));\n $this->assertEquals('value', $annotations['inline']['param']);\n }", "public function getJavascriptCode() {}", "public function interpret( int $code ): string;", "public function replaceInline($string)\n\t{\n\t\t$string = $this->replaceInlineCode($string);\n\t\t$string = $this->replaceAnchors($string);\n\t\t$string = $this->replaceImages($string);\n\t\t$string = $this->replaceStrongEmphasis($string);\n\n\t\t// Take care of \"hard\" breaks\n\t\t$string = preg_replace('/ {2,}\\n/', \"<br />\\n\", $string);\n\n\t\t// Replace escaped characters\n\t\t$string = str_replace(array_keys($this->specialTable), $this->specialTable, $string);\n\n\t\treturn $string;\n\t}", "function format_code($code)\n{\n $code = str_replace(\"\\r\\n\", \"\\n\", $code);\n $code = escapeshellarg($code);\n exec (\"/bin/echo $code | indent -linux -l120 -bl -nce -bls -bli0\", $arr_lines, $ret);\n if ($ret > 0)\n throw new Exception(\"error while formatting...\");\n return join(\"\\n\", $arr_lines);\n}", "public function run() {\n $class = \"\";\n if ($this->style != \"basic\") {\n if ($this->gradient) {\n $class .= \"background_$this->gradient color_$this->gradient\";\n \n }\n if ($this->roundStyle) {\n $class .= \" $this->roundStyle\";\n }\n if ($this->displayShadow && $this->shadowDirection ) {\n $class .= \" shadow_$this->shadowDirection\";\n }\n }\n \n echo CHtml::closeTag(\"div\");\n $script = \"\n $('#$this->id').find('.question').addClass( '$class' );\n $('#$this->id').faq({\n expandIconClass : '$this->expandIconClass',\n collapseIconClass : '$this->collapseIconClass'\n });\n \";\n Yii::app()->getClientScript()->registerScript($this->id, $script);\n }", "protected function evalaluate($expression) {\n $evaluated = @eval('return (' . $expression . ');');\n \n return $evaluated !== false ? $evaluated : '';\n }", "function ibio_youtube_embed($code){\n\t//error_log( '[ibio_youtube_embed With ' . $code );\n\tif(strpos($code, 'youtu.be') !== false || strpos($code, 'youtube.com') !== false){\n\t\t$return = preg_replace(\"@src=(['\\\"])?([^'\\\">\\s]*)@\", \"src=$1$2&showinfo=0\", $code);\n\t\t//error_log( '[ibio_youtube_embed return ' . $return );\n\t\treturn $return;\n\t}\n\treturn $code;\n}", "public function evaluate();", "public function evaluate();", "public function inline_js(){\n\n $this->render_js_vars();\n $js = file_get_contents(Helper::asset('client.js'));\n echo view('@AgreablePollPlugin/scripts.twig', [\n 'js_path' => Helper::asset('client.js'),\n 'js' => $js,\n ])->getBody();\n\n }", "public function getEmbedCode();", "function _compile_text($code, $use_isset)\n\t{\n\t\tif(strlen($code) < 3)\n\t\t{\n\t\t\treturn $code;\n\t\t}\n\t\t// change template varrefs into PHP varrefs\n\t\t// This one will handle varrefs WITH namespaces\n\t\t$varrefs = array();\n\t\tpreg_match_all('#\\{(([a-z0-9\\-_]+?\\.)+?)([a-z0-9\\-_]+?)\\}#is', $code, $varrefs);\n\t\t$varcount = sizeof($varrefs[1]);\n\t\t$search = array();\n\t\t$replace = array();\n\t\tfor ($i = 0; $i < $varcount; $i++)\n\t\t{\n\t\t\t$namespace = $varrefs[1][$i];\n\t\t\t$varname = $varrefs[3][$i];\n\t\t\t$new = $this->generate_block_varref($namespace, $varname, $use_isset);\n\t\t\t$search[] = $varrefs[0][$i];\n\t\t\t$replace[] = $new;\n\t\t}\n\t\tif(sizeof($search) > 0)\n\t\t{\n\t\t\t$code = str_replace($search, $replace, $code);\n\t\t}\n\t\t// This will handle the remaining root-level varrefs\n\t\t$code = preg_replace('#\\{([a-z0-9\\-_]*?)\\}#is', '<'.'?php echo isset($this->vars[\\'\\1\\']) ? $this->vars[\\'\\1\\'] : $this->lang(\\'\\1\\'); ?'.'>', $code);\n\t\t$code = preg_replace('#\\{\\$([a-z0-9\\-_]*?)\\}#is', '<'.'?php echo isset($this->_tpldata[\\'DEFINE\\'][\\'.\\'][\\'\\\\1\\']) ? $this->_tpldata[\\'DEFINE\\'][\\'.\\'][\\'\\\\1\\'] : \\'\\'; ?'.'>', $code);\n\t\treturn $code;\n\t}", "public function inline( bool $inline = true ):self {\n\t\t$this->inline = $inline;\n\t\treturn $this;\n\t}", "function get_inline_data($post)\n {\n }", "public function inline()\n\t{\n\t\t/* Example usage:\n\t\t{exp:crush:tag filename=\"/_assets/css/style.css\"} \n\t\t*/\n\t\treturn csscrush_inline(\n\t\t\t$this->filename, \n\t\t\t$this->get_params(FALSE, array('filename', 'attributes')),\n\t\t\t$this->attributes\n\t\t);\n\t}", "public static function code($code)\n {\n return (new HtmlMailTemplate)->readFirst(['where' => 'code=\"' . $code . '\"']);\n }", "public function execute(string $codeSnippet): SandboxResult\n {\n try {\n return $this->executor->do($codeSnippet);\n } catch (Exception $exception) {\n throw new ExecutionFailException(\n $exception->getMessage(),\n $exception->getCode()\n );\n }\n\n return new SandboxResult(\"\");\n }", "protected\n function transclude_code( $code, $post_object )\n {\n if ( author_can($post_object, EnzymesCapabilities::create_static_custom_fields) &&\n ($this->injection_author_owns($post_object) ||\n author_can($post_object, EnzymesCapabilities::share_static_custom_fields) &&\n $this->injection_author_can(EnzymesCapabilities::use_others_custom_fields))\n ) {\n $result = $code;\n } else {\n $result = '';\n }\n return $result;\n }", "function _phpCodeHandler($data)\r\n {\r\n if (preg_match('/\\s*^php:(.+)/', $data, $matches)) {\r\n $keys = array_keys($GLOBALS);\r\n foreach ($keys as $key) {\r\n $$key =& $GLOBALS[$key];\r\n }\r\n return (string) eval($matches[1].';');\r\n }\r\n return $data;\r\n }", "private function executePHP($string) {\n\t\t$string = $this->cleanString($string);\n\t\t$string = '$string = ' . $string;\n\t\teval($string);\n\n\t\treturn $string;\n\t}", "public function trimInlineComments($code)\n {\n // embedded in quoted strings.\n\n $re = \"!\n (?P<code>\n (?P<expr>(?:\n # anything except \\\", ', `\n [^\\\"'`]\n\n # double quoted string\n | \\\"(?: [^\\\"\\\\\\\\]+ | \\\\\\\\. )*\\\"\n\n # single quoted string\n | '(?: [^'\\\\\\\\]+ | \\\\\\\\. )*'\n\n # backticks string\n | `(?: [^`\\\\\\\\]+ | \\\\\\\\. )*`\n )+?)\n )\n (?P<comment>\\s*(?://|\\#).*)?\n $!xA\";\n\n return preg_replace($re, '$1', $code);\n }", "private function compile($contents, $autoEscape = true)\n {\n $contents = preg_replace(\n array(\n \"/{{/\",\n \"/}}\\n/\",\n \"/}}/\",\n \"/\\[\\[/\",\n \"/\\]\\]/\",\n '/^\\s*@(.*)$/m',\n '/{%\\s*block\\s(.*)\\s*%}(.*){%\\s*endblock\\s*%}/Usm',\n ),\n array(\n $autoEscape ? \"<?php echo(htmlspecialchars(\" : \"<?php echo(\",\n $autoEscape ? \")); ?>\\n\\n\" : \"); ?>\\n\\n\",\n $autoEscape ? \")); ?>\" : \"); ?>\",\n \"<?php \",\n \" ?>\",\n \"<?php \\\\1 ?>\",\n \"<?php if (array_key_exists('\\\\1', \\$this->inheritBlocks)) { echo \\$this->inheritBlocks['\\\\1']; } else if (\\$this->inheritFrom === NULL) { ?>\\\\2<?php } else { ob_start(); ?>\\\\2<?php \\$this->inheritBlocks['\\\\1'] = ob_get_contents(); ob_end_clean(); } ?>\",\n ),\n $contents\n );\n\n return $contents;\n }", "function escapePhp() {\n\t\t$rv = $this->getContents();\n\t\t$changes = array(\n\t\t\t'<?' => '&lt;?',\n\t\t\t'?>' => '?&gt;',\n\t\t);\n\t\treturn str_replace( array_keys( $changes ), $changes, $rv );\n\t}", "public function make_ccode_question_sqrNoSemicolons() {\n question_bank::load_question_definition_classes('ccode');\n $ccode = new qtype_ccode_question();\n test_question_maker::initialise_a_question($ccode);\n $ccode->name = 'Function to square a number n';\n $ccode->questiontext = 'Write a function int sqr(int n) that returns n squared.';\n $ccode->generalfeedback = 'No feedback available for ccode questions.';\n $ccode->testcases = array(\n (object) array('testcode' => 'printf(\"%d\", sqr(0))',\n 'output' => '0',\n 'display' => 'SHOW',\n 'hiderestiffail' => 0,\n 'useasexample' => 1),\n (object) array('testcode' => 'printf(\"%d\", sqr(7))',\n 'output' => '49',\n 'display' => 'SHOW',\n 'hiderestiffail' => 0,\n 'useasexample' => 1),\n (object) array('testcode' => 'printf(\"%d\", sqr(-11))',\n 'output' => '121',\n 'display' => 'SHOW',\n 'hiderestiffail' => 0,\n 'useasexample' => 0),\n (object) array('testcode' => 'printf(\"%d\", sqr(-16))',\n 'output' => '256',\n 'display' => 'SHOW',\n 'hiderestiffail' => 0,\n 'useasexample' => 0)\n );\n $ccode->qtype = question_bank::get_qtype('ccode');\n $ccode->unitgradingtype = 0;\n $ccode->unitpenalty = 0.2;\n return $ccode;\n }", "public function evaluate($code = '', $pos = 0)\n {\n $this->src = $code;\n $this->pos = $pos;\n\n $this->evaluateStatements();\n while (!$this->return && $separator = $this->readChar()) {\n switch ($separator) {\n // start of block\n case '{':\n $this->evaluateStatements();\n break;\n // end of block\n case '}':\n $this->evaluateStatements();\n break;\n default:\n throw new \\Exception('Unexpected token \"' . $separator . '\".');\n break;\n }\n }\n\n if ($this->return || $this->returnLast) {\n return $this->lastResult->toString();\n }\n }", "function wp_add_inline_script($handle, $data, $position = 'after')\n {\n }", "function e($expr) \n {\n //call the core evaluation method\n return $this->evaluate($expr);\n }", "function prepare_code($text) {\n $replace = array( '\\\"' => '&#34;','\"' => '&#34;', '<' => '&lt;', '>' => '&gt;', \"\\'\" => '&#39;', \"'\" => '&#39;' );\n return str_replace(array_keys($replace), array_values($replace),$text);\n}", "function create_closure($args, $body){\n return eval(\"return function($args){ {$body} };\");\n}", "public function pageInlineIc()\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$oExtras = new Oeventextra($eventId);\r\n\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\t\t\t\r\n\t\t// Preparer les champs de saisie\r\n\t\t$body = new Body();\r\n\r\n\t\t// Titres\r\n\t\t$t = $body->addP('', '', 'bn-title-2');\r\n\t\t$t->addBalise('span', '', LOC_TITLE_PREF_INLINE);\r\n\r\n\t\t// Infos generales\r\n\t\t$p = $body->addP('msgParam', LOC_MSG_PREF_INLINE, 'bn-p-info');\r\n\t\t$captainCost = Bn::getConfigValue('captain', 'cost');\r\n\t\t$p->addMetaContent($captainCost);\r\n\r\n\t\t$form = $body->addForm('frmInlineic', BPREF_UPDATE_INLINEIC, 'targetDlg');\r\n\t\t$form->getForm()->addMetadata('success', \"updated\");\r\n\t\t$form->getForm()->addMetadata('dataType', \"'json'\");\r\n\r\n\t\t//------- Inscription en ligne\r\n\t\t$div = $form->addDiv('divReginline', 'bn-div-left');\r\n\t\t$div->addCheckbox('reginline', LOC_LABEL_ALLOW_REGINLINE, YES, $oExtras->getVal('reginline')==YES);\r\n\t\t$div = $div->addDiv('divFees');\r\n\t\t$div->setAttribute('style', 'margin-left:15px;');\r\n\t\t$div->addEdit('feesteam', LOC_LABEL_FEES_TEAM, $oExtras->getVal('feesteam'), 5);\r\n\r\n\t\t$rdo = $div->addRadio('paybadnet', 'badnet', LOC_LABEL_BADNET_MANAGE, YES, $oExtras->getVal('paybadnet')==YES);\r\n\t\t$rdo->mandatory();\r\n\t\t$d = $div->addDiv('');\r\n\t\t$d->setAttribute('style', 'margin-left:15px;');\r\n\t\t$d->addP('', LOC_MSG_BADNET_MANAGE, 'bn-p-info');\r\n\r\n\t\t$div->addRadio('paybadnet', 'manage', LOC_LABEL_MANAGE, NO, $oExtras->getVal('paybadnet')==NO);\r\n\t\t$d = $div->addDiv('');\r\n\t\t$d->setAttribute('style', 'margin-left:15px;');\r\n\t\t$d->addP('', LOC_MSG_MANAGE, 'bn-p-info');\r\n\r\n\t\t$d = $form->addDiv('', 'bn-div-btn');\r\n\t\t$d->addButtonValid('', LOC_BTN_UPDATE);\r\n\r\n\t\t// Envoi au navigateur\r\n\t\t$body->addJQReady('pageInlineic();');\r\n\t\t$body->display();\r\n\t\treturn false;\r\n\t}", "function php_highlight(&$code)\n\n{\n\n if(preg_match('#^(\\s*)(\\<\\?(php|))#i', $code, $open_tag, PREG_OFFSET_CAPTURE))\n\n {\n\n $code = substr($code, strlen($open_tag[0][0]));\n\n $open_tag = $open_tag[1][0].'<span class=\"php_tag\">'.htmlspecialchars($open_tag[2][0]).'</span>';\n\n }\n\n if(preg_match('#(\\?\\>)(\\s*)$#', $code, $end_tag, PREG_OFFSET_CAPTURE))\n\n {\n\n $code = substr($code, 0, -strlen($end_tag[0][0]));\n\n $end_tag = '<span class=\"php_tag\">'.htmlspecialchars($end_tag[1][0]).'</span>'.$end_tag[2][0];\n\n }\n\n \n\n $blocks = array(\n\n array(\n\n 'pattern' => '#\\?\\>(.*?)(\\<\\?(php()|(\\s))|($()))#ise',\n\n 'replacement' => '\\'<span class=\"php_tag\">?&gt;</span>\\'.block_background(html_highlight(str_replace(\\'\\\\\\\\\\\\\\\\\"\\', \\'\"\\',\\'$1\\')), \\'php_html\\').\\'<span class=\"php_tag\">\\'.htmlspecialchars(\\'$2\\').\\'</span>\\'',\n\n 'keepsuffix' => 4\n\n ),\n\n array(\n\n 'pattern' => \"#'\".GENERAL_BACKSLASH_ESC_PREG.\"'#se\",\n\n 'replacement' => 'parse_php_string_simple(\\'$0\\')',\n\n //'prefix' => '<span class=\"php_string\">', \n\n //'suffix' => '</span>'\n\n ),\n\n array(\n\n 'pattern' => '#\"'.GENERAL_BACKSLASH_ESC_PREG.'\"#se',\n\n 'replacement' => '\\'<span class=\"php_string_d\">&quot;\\'.parse_php_string(\\'$1\\').\\'&quot;</span>\\''\n\n ),\n\n array(\n\n 'pattern' => \"#\\<\\<\\<(.+?)([\\n\\r])(.*?)([\\n\\r]\\\\1)#se\",\n\n 'replacement' => '\\'<span class=\"php_string_h\">&lt;&lt;&lt;$1$2\\'.parse_php_string(\\'$3\\').\\'$4</span>\\''\n\n ),\n\n array(\n\n 'pattern' => \"#/\\\\*(.*?)\\\\*/#s\",\n\n 'prefix' => '<span class=\"php_blockcomment\">', \n\n 'suffix' => '</span>'\n\n ),\n\n array(\n\n 'pattern' => \"#//(.*?)[\\n\\r]#\",\n\n 'prefix' => '<span class=\"php_linecomment\">', \n\n 'suffix' => '</span>'\n\n ),\n\n );\n\n \n\n $secondaries = array(\n\n array(\n\n 'pattern' => '#(\\W|^)(\\.?[0-9][0-9a-zA-Z.]*)#',\n\n 'replacement' => '<span class=\"php_number\">$2</span>',\n\n 'keepprefix' => 1\n\n ),\n\n array(\n\n 'pattern' => '#([,\\[\\]\\{\\};=\\+\\-!%\\^&\\*\\(\\)<>|@.~])#',\n\n 'prefix' => '<span class=\"php_symbol\">',\n\n 'suffix' => '</span>'\n\n ),\n\n array(\n\n 'pattern' => '#\\$[a-zA-Z_][a-zA-Z0-9_]*#',\n\n 'prefix' => '<span class=\"php_var\">',\n\n 'suffix' => '</span>'\n\n )\n\n );\n\n \n\n $kw = array(\n\n array(\n\n 'prefix' => '<span '.get_placeholder(8).'=\"php_keyword\">',\n\n 'suffix' => '</span>',\n\n 'keywords' => array('and','or','xor','__file__','__line__','array','as','break','case','cfunction','class','const','continue','declare','default','die','do','echo','else','elseif','empty','enddeclare','endfor','endforeach','endif','endswitch','endwhile','eval','exit','extends','for','foreach','function','global','if','include','include_once','isset','list','new','old_function','print','require','require_once','return','static','switch','unset','use','var','while','__function__','__class__','php_version','php_os','default_include_path','pear_install_dir','pear_extension_dir','php_extension_dir','php_bindir','php_libdir','php_datadir','php_sysconfdir','php_localstatedir','php_config_file_path','php_output_handler_start','php_output_handler_cont','php_output_handler_end','e_error','e_warning','e_parse','e_notice','e_core_error','e_core_warning','e_compile_error','e_compile_warning','e_user_error','e_user_warning','e_user_notice','e_all','true','false','bool','boolean','int','integer','float','double','real','string','array','object','resource','null','class','extends','parent','stdclass','directory','__sleep','__wakeup','interface','implements','abstract','public','protected','private')\n\n )\n\n );\n\n $code = generic_highlight($code, $blocks, $secondaries, array(), $kw);\n\n // put back end/start tags if necessary\n\n if(isset($open_tag) && is_string($open_tag))\n\n $code = $open_tag.$code;\n\n if(isset($end_tag) && is_string($end_tag))\n\n $code .= $end_tag;\n\n \n\n return $code;\n\n}", "public function testPackJavascript()\n {\n $this->assertStringContainsString('eval(function(p,a,c,k,e,d)', $this->getExtension()->t_packer('alert(\\'checking this\\');'));\n }" ]
[ "0.6459748", "0.6039039", "0.5938667", "0.5829809", "0.5456763", "0.5279273", "0.52373314", "0.5202673", "0.5161362", "0.5130862", "0.510167", "0.50681365", "0.49920195", "0.49580127", "0.4946447", "0.49372798", "0.48961148", "0.48641652", "0.48485968", "0.48265085", "0.482643", "0.4820687", "0.47838128", "0.47828174", "0.47815546", "0.4770939", "0.47645056", "0.4754748", "0.47438222", "0.47421974", "0.47177467", "0.470968", "0.47077253", "0.4705374", "0.46883035", "0.46714675", "0.46612927", "0.46534523", "0.4631478", "0.46245205", "0.46241906", "0.46029755", "0.45968503", "0.4590235", "0.45678118", "0.4566028", "0.4549831", "0.4548777", "0.45335352", "0.45265356", "0.45228282", "0.4514002", "0.45101365", "0.4496737", "0.44964662", "0.44961128", "0.44951496", "0.44875693", "0.4484157", "0.44659823", "0.44617122", "0.44568118", "0.4451783", "0.44493955", "0.444816", "0.44435298", "0.443211", "0.44299775", "0.44217744", "0.44142804", "0.43933454", "0.4386495", "0.43858722", "0.43854183", "0.43749547", "0.43689317", "0.43689317", "0.4347809", "0.4347296", "0.4336663", "0.43315962", "0.43305677", "0.43300295", "0.43201524", "0.4312385", "0.43081746", "0.4305032", "0.4302916", "0.430222", "0.42976055", "0.42937756", "0.42890355", "0.4286593", "0.42755857", "0.42741242", "0.42681023", "0.42636085", "0.4257485", "0.4256239", "0.42522" ]
0.63575196
1
Parses the user response, returning a simple answer. The way in which the user's response is parsed depends on the Response Mode.
private function parse_response(array $response) { //strip all leading and trailing whitespace from the answer $response['answer'] = trim($response['answer']); //interpret the user's reponse according to the reponse mode switch($this->response_mode) { //handle STRING-mode respones case qtype_scripted_response_mode::MODE_STRING: //return the answer as-is, as we already recieved a string return strtolower($response['answer']); //handle STRING-mode respones case qtype_scripted_response_mode::MODE_STRING_CASE_SENSITIVE: //return the answer as-is, as we already recieved a string return $response['answer']; //handle DECIMAL-mode responses case qtype_scripted_response_mode::MODE_NUMERIC: //if the string was empty, return false, a non-numeric form of zero if($response['answer'] === '') return false; //get a floating-point interpretation of the answer return floatval($response['answer']); //handle HEXADECIMAL-mode responses case qtype_scripted_response_mode::MODE_HEXADECIMAL: //if the user entered a number in C format, parse it using PHP's native recognition of hex numbers if(substr($response['answer'], 0, 2) === "0x") return intval(substr($response['answer'], 2), 16); //if the user entered the hex number in HCS08 format (i.e. $0F), accept that, as well elseif(substr($response['answer'], 0, 1) == '$') return hexdec(substr($response['answer'], 1)); //otherwise, return the answer parsed as a hex number else return hexdec($response['answer']); //handle BINARY-mode respones case qtype_scripted_response_mode::MODE_BINARY: //if the user entered a number in 0b format (used by some calculators), accept it if(substr($response['answer'], 0, 2) === "0b") return bindec(substr($response['answer'], 2), 16); //if the user entered the binary number in HCS08 format (i.e. %0F), accept that, as well elseif(substr($response['answer'], 0, 1) == '%') return bindec(substr($response['answer'], 1)); //otherwise, return the answer parsed as a binary number else return bindec($response['answer']); //handle OCTAL-mode case qtype_scripted_response_mode::MODE_OCTAL: //if the user entered a number in 0o format, accept it, for consistency with other prefix strings //(as far as I know, no major format uses this) if(substr($response['answer'], 0, 2) === "0o") return octdec(substr($response['answer'], 2), 16); //if the user entered the binary number in HCS08 format (i.e. @0F), accept that, as well elseif(substr($response['answer'], 0, 1) == '@') return octdec(substr($response['answer'], 1)); //otherwise, return the answer parsed as a octal number else return octdec($response['answer']); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract function parse_api_response();", "public function parseResponse() {\r\r\n\r\r\n return true;\r\r\n }", "abstract protected function parseResponse($response);", "public function parse()\n\t{\n\t\t//we don't need to hit the API everytime parse is called\n\t\tif (!$this->response)\n\t\t\t$this->response = $this->request->execute();\n\t\t\n\t\treturn $this->invokeParserMethod();\t\n\t}", "function MesiboParseResponse($response) {\n\t$result = json_decode($response, true);\n\tif(is_null($result)) \n\t\treturn false;\n\treturn $result;\n}", "public function answer()\n\t{\n\t\tif (!$this->typeResponseCode)\n\t\t\treturn $this->answerTwoHundred($this->data);\n\t\telse\n\t\t\treturn $this->answerThroughHeader($this->data);\n\t}", "private function response() {\n $reply = trim(fgets($this -> __sock, 512));\n switch(substr($reply, 0, 1)) {\n /* Error reply */\n case '-':\n trigger_error('ERROR (' . trim($reply) . ')', E_USER_ERROR);\n /* Inline reply */\n case '+':\n $response = substr(trim($reply), 1);\n if($response === 'OK') $response = true;\n break;\n /* Bulk reply */\n case '$':\n $response = null;\n if($reply === '$-1') break;\n $read = 0;\n $size = intval(substr($reply, 1));\n if($size > 0) {\n do {\n $block_size = ($size - $read) > 1024 ? 1024 : ($size - $read);\n $r = fread($this -> __sock, $block_size);\n if($r === false)\n trigger_error('READ FROM SERVER ERROR', E_USER_ERROR);\n else {\n $read += strlen($r);\n $response .= $r;\n }\n } while($read < $size);\n }\n fread($this -> __sock, 2); /* CRLF */\n break;\n /* Multi-bulk reply */\n case '*':\n $count = intval(substr($reply, 1));\n if($count === -1) return null;\n $response = array();\n for($i = 0; $i < $count; $i++)\n $response[] = $this -> response();\n break;\n /* Integer reply */\n case ':':\n $response = intval(substr(trim($reply), 1));\n break;\n default:\n trigger_error('UNKNOWN RESPONSE ERROR', E_USER_ERROR);\n }\n return $response;\n }", "public function getResponse() {\n if($this->response) {\n $response = explode($this->responseDelimeter, $this->response);\n if(is_array($response)) {\n return $response;\n }\n else {\n return '';\n } \n }\n else {\n return '';\n }\n }", "private function parseResponse() {\n $headers = Strings::split(substr($this->response, 0, $this->info['header_size']), \"~[\\n\\r]+~\", PREG_SPLIT_NO_EMPTY);\n $this->headers = static::parseHeaders($headers);\n $this->body = substr($this->response, $this->info['header_size']);\n $this->response = NULL;\n }", "protected function simpleAnswer($response) {\n $response = strtoupper($response);\n\n if ($response === 'Y' || $response === 'YES')\n return TRUE;\n else if ($response === 'N' || $response === 'NO')\n return FALSE;\n else\n return $this->promptMessage('yesorno') . PHP_EOL;\n }", "protected final function parse_model_response($data = NULL) {\n \t$parsed = false;\n\t\tswitch ($this->request_method) {\n\t\t\tcase 'read':\n\t\t\t\t$parsed = $this->parse_model_response_read($data);\t\t\t\t\t\n\t\t\tbreak;\t\t\t\t\n\t\t\tcase 'create':\t\n\t\t\t\t$parsed = $this->parse_model_response_create($data);\t\t\t\t\t\n\t\t\tbreak;\n\t\t\tcase 'update':\n\t\t\t\t$parsed = $this->parse_model_response_update($data);\t\t\t\t\t\n\t\t\tbreak;\n\t\t\tcase 'delete':\n\t\t\t\t$parsed = $this->parse_model_response_delete($data);\t\t\t\t\t\n\t\t\tbreak;\n\t\t}\n\t\t\n\t\tif($parsed === false) {\n\t\t\t$this->set_error( 355, 'No response was parsed' );\n\t\t\treturn;\t\n\t\t}\n\t\t\n\t\t$this->parsed_model_response = $parsed;\n }", "public function parseResponse($message);", "function http_parse_response()\n\t{\n\t\tlist($headers, $body) = explode(\"\\r\\n\\r\\n\", $this->http_response, 2);\n\t\t$this->http_parse_headers($headers);\n\n\t\tif(isset($this->http_response_headers['Transfer-Encoding']) && 'chunked' == $this->http_response_headers['Transfer-Encoding']):\n \t\t$this->http_response_body = $this->http_chunked_decode($body);\n\t\telse:\n\t\t\t$this->http_response_body = $body;\n\t\tendif;\n\n\t\t$this->http_set_content_type($this->http_default_content_type);\n\t}", "private function ParseResponse($Response)\n\t{\n\t\tif (!is_array($Response))\n\t\t{\n\t\t\t// $this -> SetError(self::ERROR_INVALID_RESPONSE, 'Invalid response from Premium, cannot parse');\n\t\t\treturn false;\n\t\t}\n\n\t\t$this -> SetError(self::ERROR_NONE, '');\n\n\t\t$Body = false;\n\t\tif ($Response['Body'])\n\t\t{\n\t\t\t$Body = json_decode($Response['Body'], true);\n\t\t}\n\n\t\tif (!$Response['Body'])\n\t\t{\n\t\t\t$this -> SetError(self::ERROR_EMPTY_RESPONSE, 'Empty response from Premium');\n\t\t}\n\t\telseif (!$Body)\n\t\t{\n\t\t\t$ErrorMessage = 'Invalid response from Premium, cannot parse';\n\t\t\tif (is_null($Body))\n\t\t\t{\n\t\t\t\t// JSON parsing error\n\t\t\t\t$ErrorMessage = 'JSON parsing error'.(function_exists('json_last_error') ? ' #'.json_last_error() : '');\n\t\t\t}\n\n\t\t\t$this -> SetError(self::ERROR_INVALID_RESPONSE, $ErrorMessage);\n\t\t}\n\t\telseif (!empty($Body['ErrNo']))\n\t\t{\n\t\t\t$this -> SetError($Body['ErrNo'], $Body['Error']);\n\t\t}\n\n\t\treturn $Body;\n\t}", "public function getResponse() {\n \n parse_str($this->response, $return);\n return $return;\n }", "public function response ();", "public function responseMsg()\n {\n $postStr = $GLOBALS[\"HTTP_RAW_POST_DATA\"];\n global $textTpl;\n if (!empty($postStr))\n {\n $postObj = simplexml_load_string($postStr, 'SimpleXMLElement', LIBXML_NOCDATA);\n $type = $postObj->MsgType;\n\n switch ($type)\n {\n case \"event\":\n $resultStr = GetEventMessage($postObj);\n break;\n case \"location\":\n $resultStr = GetLocationMessage($postObj);\n break;\n case \"text\":\n $resultStr = GetTextMessage($postObj);\n break;\n default:\n $resultStr = GetTextMessage($postObj);\n //$resultStr = GetDefaultMessage($postObj);\n break;\n }\n\n RecordInputContent($postObj); //保存用户输入的所有内容\n RefleshUserLoginTime($postObj); // 更新用户登录的最新时间\n\n echo $resultStr;\n }\n else\n {\n echo \"\";\n exit;\n }\n }", "public function responseParser($response, $homebookmaker, $awaybookmaker) {\n // TODO implement here\n }", "protected function parseResponse()\n {\n // get the status code from response.\n $statusCode = $this->httpResponse->getStatusCode();\n\n // set as error, if http status code is not between 200 and 299 (inclusive).\n $this->networkError = !($statusCode >= 200 && $statusCode <= 299);\n\n // decode the response body.\n $body = $this->decodeBody();\n\n // stop when no body is present.\n if ($body) {\n // parse the response id from the body.\n $this->id = (int) array_get($body, 'id', null);\n\n // set as error when there is a an error key and it's not null.\n $this->isError = array_get($body, 'error', null) !== null;\n\n // parse the response data, from result or error.\n $this->data = collect(array_get($body, $this->isError ? 'error' : 'result', []));\n }\n\n // just return the response body.\n return $this->body;\n }", "public function responseMsg()\n {\n $postStr = $GLOBALS[\"HTTP_RAW_POST_DATA\"];\n\n //extract post data\n if (!empty($postStr)){\n \n $postObj = simplexml_load_string($postStr, 'SimpleXMLElement', LIBXML_NOCDATA);\n $RX_TYPE = trim($postObj->MsgType);\n\n switch($RX_TYPE)\n {\n case \"text\":\n $resultStr = $this->handleText($postObj);\n break;\n case \"event\":\n $resultStr = $this->handleEvent($postObj);\n break;\n default:\n $resultStr = \"Unknow msg type: \".$RX_TYPE;\n break;\n }\n echo $resultStr;\n }else {\n echo \"\";\n exit;\n }\n }", "abstract public function response();", "public function answer()\n\t{\n\n $twiml = new Services_Twilio_Twiml();\n\n $gather = $twiml->gather([\n 'method' => 'GET',\n 'action' => 'twilio/check-account'\n ]);\n $gather->say(\"Hello, thanks for calling Phlare. Please enter your account number, followed by the pound sign.\");\n\n return $twiml;\n\n\t}", "protected function parse_response($response) {\n $length = strlen(PHP_INT_MAX);\n $response = preg_replace('/\"(id|in_reply_to_status_id)\":(\\d{' . $length . ',})/', '\"\\1\":\"\\2\"', $response);\n return json_decode($response, TRUE);\n }", "function parse() {\r\n\t\t/* JSON */\r\n\t\tif (strpos ( $this->response_content_type, \"application/json\" ) !== false) {\r\n\t\t\t$this->response_parsed = json_decode($this->response_body);\r\n\t\t\t/* JSON STREAM */\r\n\t\t} elseif (strpos ( $this->response_content_type, \"json-stream\" ) !== false) {\r\n\t\t\t$stream = split ( \"\\n\", $this->response_body );\r\n\t\t\tif (count ( $stream ) < $stream [0] ['ResultLength']) {\r\n\t\t\t\t// echo \"Invalid JSON Stream. Result Length:\".count($stream);\r\n\t\t\t\t$this->client->status_code = 400;\r\n\t\t\t\t$GLOBALS ['ResultStack']->pushNew ( \"Invalid JSON Stream\", ERROR );\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\t$jsonServer = new JSON ( JSON_LOOSE_TYPE );\r\n\t\t\t$this->response_parsed = array ();\r\n\t\t\tforeach ( $stream as $line )\r\n\t\t\t\t$this->response_parsed [] = $jsonServer->decode ( $line );\r\n\t\t\t/* DEFAULT */\r\n\t\t} else {\r\n\t\t\t$this->response_parsed = $this->response_body;\r\n\t\t}\r\n\t}", "public function getResponse();", "public function getResponse();", "public function getResponse();", "public function getResponse();", "public function getResponse();", "public function getResponse();", "public function getResponse();", "public function getResponse();", "public function getResponse();", "public function getResponse();", "public function getResponse();", "public function responseMsg()\n {\n $postStr = $GLOBALS[\"HTTP_RAW_POST_DATA\"];\n\n //extract post data\n if (!empty($postStr)){\n \n $postObj = simplexml_load_string($postStr, 'SimpleXMLElement', LIBXML_NOCDATA);\n $RX_TYPE = trim($postObj->MsgType);\n\n switch($RX_TYPE)\n {\n case \"text\":\n $resultStr = $this->handleText($postObj);\n break;\n case \"event\":\n $resultStr = $this->handleEvent($postObj);\n break;\n default:\n $resultStr = \"Unknow msg type: \".$RX_TYPE;\n break;\n }\n echo $resultStr;\n }else {\n echo \"\";\n exit;\n }\n }", "public function response();", "public function get_correct_response() \n {\n return array('answer' => 0);\n }", "public function getParsedResponse()\n {\n return $this->parsedResponse;\n }", "public function testParseResponse() {\n $data = $this->dl->parseResponse($this->sampleData, \"JSON\");\n $this->assertion($data['zip'], \"37931\", \"Parsed zip should equal 37931.\");\n $this->assertion($data['conditions'], \"clear sky\", \"Parsed conditions should equal clear sky.\");\n $this->assertion($data['pressure'], \"1031\", \"Parsed pressure should equal 1031.\");\n $this->assertion($data['temperature'], \"35\", \"Parsed temperature should equal 35.\");\n $this->assertion($data['windDirection'], \"ESE\", \"Parsed wind direction should equal ESE.\");\n $this->assertion($data['windSpeed'], \"1.06\", \"Parsed wind speed should equal 1.06.\");\n $this->assertion($data['humidity'], \"80\", \"Parsed humidity should equal 80.\");\n $this->assertion($data['timestamp'], \"1518144900\", \"Parsed timestamp should equal 1518144900.\");\n }", "static public function parse_plain_response($s)\n {\n parse_str($s, $a);\n return $a;\n }", "public function validUserResponse ($userResponse);", "public function getParsedResponse()\n {\n return json_decode($this->response);\n }", "private function getOutputResult(string $response)\n {\n if ($this->outputType===self::OUTPUT_JSON) {\n return $response;\n } elseif ($this->outputType===self::OUTPUT_STDCLASS) {\n return json_decode($response);\n }\n //return as array\n return json_decode($response, true);\n }", "public function handle_response () {\n // callback URL: https://{service}.e-com.plus/session/sso_login\n // call this function on route specified above\n if (isset($_GET['sso']) && isset($_GET['sig'])) {\n // get user object\n return $this->user_info($_GET['sso'], $_GET['sig']);\n } else {\n // invalid URL query string\n return null;\n }\n }", "public function get_correct_response()\n {\n return null;\n }", "protected function parse()\n {\n if ($this->isParsed) {\n return;\n }\n\n if ($this->response->isServerError()) {\n throw new ResponseException(\"nic.ru server error\");\n }\n\n $contentType = $this->response->getHeader(\"Content-Type\");\n\n if (!preg_match(\"/^.*text\\/plain.*$/ui\", $contentType)) {\n throw new ResponseException(\"Incorrect Content-Type of response: {$contentType}\");\n }\n\n if (!$this->response->isOk()) {\n throw new ResponseException(\"Incorrect response code: {$this->response->getStatusCode()}\");\n }\n\n $content = $this->getRawContent();\n $contentParts = explode(\"\\r\\n\\r\\n\", $content);\n\n if (empty($contentParts)) {\n throw new ResponseException(\"Incorrect response: {$content}\");\n }\n\n if (count($contentParts) == 0) {\n throw new ResponseException(\"Response header is empty!\");\n }\n\n $this->parseHeader(trim($contentParts[0]));\n $this->parseBody(trim($contentParts[1]));\n\n $this->isParsed = true;\n }", "private function parseResult()\n {\n $code = $this->statusCode;\n\n if($code == \"01\")\n {\n $this->success = true;\n $this->message = \"Payment Successful\";\n }\n elseif($code == \"515\")\n {\n $this->success = false;\n $this->message = \"This number does not have a mobile money account\";\n }\n elseif($code == \"529\")\n {\n $this->success = false;\n $this->message = \"You don't have enough money in your account. Please Recharge\";\n }\n elseif($code == \"100\")\n {\n $this->success = false;\n $this->message = \"Transaction Failed. Declined by user.\";\n }\n else{\n $this->success = false;\n $this->message = \"Unknown Response\";\n }\n }", "public function responseMsg()\n {\n $postStr = $GLOBALS[\"HTTP_RAW_POST_DATA\"];\n\n //extract post data\n if (!empty($postStr)) {\n\n $postObj = simplexml_load_string($postStr, 'SimpleXMLElement', LIBXML_NOCDATA);\n $fromUsername = $postObj->FromUserName;\n $toUsername = $postObj->ToUserName;\n $keyword = trim($postObj->Content);\n $time = time();\n $textTpl = \"<xml>\n\t\t\t\t\t\t\t<ToUserName><![CDATA[%s]]></ToUserName>\n\t\t\t\t\t\t\t<FromUserName><![CDATA[%s]]></FromUserName>\n\t\t\t\t\t\t\t<CreateTime>%s</CreateTime>\n\t\t\t\t\t\t\t<MsgType><![CDATA[%s]]></MsgType>\n\t\t\t\t\t\t\t<Content><![CDATA[%s]]></Content>\n\t\t\t\t\t\t\t<FuncFlag>0</FuncFlag>\n\t\t\t\t\t\t\t</xml>\";\n if (!empty($keyword)) {\n $msgType = \"text\";\n $contentStr = \"Welcome to wechat world!\";\n $resultStr = sprintf($textTpl, $fromUsername, $toUsername, $time, $msgType, $contentStr);\n echo $resultStr;\n } else {\n echo \"Input something...\";\n }\n\n } else {\n echo \"\";\n exit;\n }\n }", "function getResponse();", "function getResponse();", "protected function parseResponse()\n {\n $data = simplexml_load_string($this->body);\n \n $this->data = $data;\n }", "public function getResponse() {}", "public function getResponse() {}", "public function getResponse() {\n # Start with the initial answers\n $response = $_SESSION[TOOLKIT_TAG]['initialAnswers'];\n $answers = $_SESSION[TOOLKIT_TAG]['answers'];\n\n # Loop through pages path\n for ($i = 0; $i < count($_SESSION[TOOLKIT_TAG]['pages']); $i++) {\n $page = $_SESSION[TOOLKIT_TAG]['pages'][$i];\n //echo $page['pageID'] . ': ' . count($page['questions']) . ' question(s)<br>';\n\n # Loop through questions in page\n for ($j = 0; $j < count($page['questions']); $j++) {\n $questionID = $page['questions'][$j];\n //echo ' - ' . $questionID . ': ';\n\n # Add all answer to response if exists\n if (isset($answers[$questionID]) && !empty($answers[$questionID])) {\n $response[$questionID] = $answers[$questionID];\n\n # Also add specified answers from 'other' questions\n if (isset($answers[$questionID . '-specific-input']) && !empty($answers[$questionID . '-specific-input'])) {\n $response[$questionID . '-specific-input'] = $answers[$questionID . '-specific-input'];\n }\n //echo 'Found';\n } else {\n //echo 'Not found in answers';\n }\n //echo '<br>';\n }\n //echo '<br>';\n }\n return $response;\n }", "public function getResponseParser()\n {\n return new ResponseParser();\n }", "public function get_correct_response()\n {\n //if the question is a \"must eval true\" question, we can't easily determine the answer\n if($this->answer_mode == qtype_scripted_answer_mode::MODE_MUST_EVAL_TRUE) {\n return null;\n }\n\n // Evaluate the given answer, and return a correct-response array.\n $answer = $this->evaluate_answer(parent::get_correct_answer());\n return array('answer' => $answer->answer);\n }", "private function parseApiResponse($response, $requestType = null){\n //combine the current response from Chikka and the message type that was requested\n var_dump($response);\n $response = json_decode($response,true);\n if($requestType){\n $response['request_type'] = $requestType;\n }\n\n return json_decode(json_encode($response));;\n }", "public function responseMsg()\n {\n\t\t$postStr = $GLOBALS[\"HTTP_RAW_POST_DATA\"];\n\n \t//extract post data\n\t\tif (!empty($postStr)){\n /* libxml_disable_entity_loader is to prevent XML eXternal Entity Injection,\n the best way is to check the validity of xml by yourself */\n libxml_disable_entity_loader(true);\n \t$postObj = simplexml_load_string($postStr, 'SimpleXMLElement', LIBXML_NOCDATA);\n $fromUsername = $postObj->FromUserName;\n $toUsername = $postObj->ToUserName;\n $keyword = trim($postObj->Content);\n $time = time();\n $textTpl = \"<xml>\n\t\t\t\t\t\t\t<ToUserName><![CDATA[%s]]></ToUserName>\n\t\t\t\t\t\t\t<FromUserName><![CDATA[%s]]></FromUserName>\n\t\t\t\t\t\t\t<CreateTime>%s</CreateTime>\n\t\t\t\t\t\t\t<MsgType><![CDATA[%s]]></MsgType>\n\t\t\t\t\t\t\t<Content><![CDATA[%s]]></Content>\n\t\t\t\t\t\t\t<FuncFlag>0</FuncFlag>\n\t\t\t\t\t\t\t</xml>\"; \n\t\t\t\tif(!empty( $keyword ))\n {\n \t\t$msgType = \"text\";\n \t$contentStr = \"Welcome to wechat world!\";\n \t$resultStr = sprintf($textTpl, $fromUsername, $toUsername, $time, $msgType, $contentStr);\n \techo $resultStr;\n }else{\n \techo \"Input something...\";\n }\n\n }else {\n \techo \"\";\n \texit;\n }\n }", "function parse_response($response){ \r\n \r\n list($response_headers,$response_body) = explode(\"\\r\\n\\r\\n\",$response,2); \r\n $response_header_lines = explode(\"\\r\\n\",$response_headers); \r\n \r\n // first line of headers is the HTTP response code \r\n $http_response_line = array_shift($response_header_lines); \r\n if (preg_match('/^HTTP\\/[0-9]\\.[0-9a-z] ([0-9]{3})/i',$http_response_line,$matches)) { \r\n $response_code = $matches[1]; \r\n }\r\n // put the rest of the headers in an array \r\n $response_header_array = array(); \r\n foreach ($response_header_lines as $header_line) { \r\n list($header,$value) = explode(': ',$header_line,2); \r\n $response_header_array[$header] = $value; \r\n } \r\n \r\n return array($response_code,$response_header_array,$response_body); \r\n}", "function parse_response($raw_data, $data_type) {\r\n if ($data_type == 'json') {\r\n $parsed_data = json_decode($raw_data);\r\n }\r\n else if ($data_type == 'xml') {\r\n $namespace_pattern = '/([<\\/\\s])[a-z]+\\:/';\r\n $clean_data = preg_replace($namespace_pattern, '\\1', $raw_data);\r\n if ($clean_data[0] == '<') {\r\n $parsed_data = simplexml_load_string($clean_data);\r\n }\r\n else {\r\n $parsed_data = false;\r\n }\r\n }\r\n return $parsed_data;\r\n }", "function _parseResponse($res) {\n\n\t\t// set defaults\n\t\t$response = $this->response;\n\t\t$response['raw']['response'] = $res;\n\n\t\t// parse header\n\t\tif (preg_match(\"/^(.+\\r\\n)(.*)(?<=\\r\\n)\\r\\n/Us\", $res, $match)) {\n\t\t\t\n\t\t\tlist($null, $response['raw']['status-line'], $response['raw']['header']) = $match;\n\t\t\t$response['raw']['body'] = substr($res, strlen($match[0]));\n\n\t\t\tif (preg_match(\"/(.+) ([0-9]{3}) (.+)\\r\\n/DU\", $response['raw']['status-line'], $match)) {\n\t\t\t\t$response['status']['http-version'] = $match[1];\n\t\t\t\t$response['status']['code'] = (int) $match[2];\n\t\t\t\t$response['status']['reason-phrase'] = $match[3];\n\t\t\t}\n\n\t\t\t$response['header'] = $this->_parseHeader($response['raw']['header']);\n\t\t\t$response['body'] = $response['raw']['body'];\n\n\t\t\tif (!empty($response['header'])) {\n\t\t\t\t$response['cookies'] = $this->parseCookies($response['header']);\n\t\t\t}\n\t\t\t\n\t\t} else {\n\t\t\t$response['body'] = $res;\n\t\t\t$response['raw']['body'] = $res;\n\t\t}\n\n\t\tif (isset($response['header']['Transfer-Encoding']) && $response['header']['Transfer-Encoding'] == 'chunked') {\n\t\t\t$response['body'] = $this->_decodeChunkedBody($response['body']);\n\t\t}\n\n\t\tforeach ($response['raw'] as $field => $val) {\n\t\t\tif ($val === '') {\n\t\t\t\t$response['raw'][$field] = null;\n\t\t\t}\n\t\t}\n\n\t\treturn $response;\n\t}", "protected function responseMsg()\n {\n $postStr = file_get_contents('php://input', 'r');\n\n //extract post data\n if (!empty($postStr)){\n /* libxml_disable_entity_loader is to prevent XML eXternal Entity Injection,\n the best way is to check the validity of xml by yourself */\n libxml_disable_entity_loader(true);\n $postObj = simplexml_load_string($postStr, 'SimpleXMLElement', LIBXML_NOCDATA);\n $fromUsername = $postObj->FromUserName;\n $toUsername = $postObj->ToUserName;\n $keyword = trim($postObj->Content);\n $time = time();\n $textTpl = \"<xml>\n\t\t\t\t\t\t\t<ToUserName><![CDATA[%s]]></ToUserName>\n\t\t\t\t\t\t\t<FromUserName><![CDATA[%s]]></FromUserName>\n\t\t\t\t\t\t\t<CreateTime>%s</CreateTime>\n\t\t\t\t\t\t\t<MsgType><![CDATA[%s]]></MsgType>\n\t\t\t\t\t\t\t<Content><![CDATA[%s]]></Content>\n\t\t\t\t\t\t\t<FuncFlag>0</FuncFlag>\n\t\t\t\t\t\t\t</xml>\";\n if(!empty( $keyword ))\n {\n $msgType = \"text\";\n $contentStr = \"Welcome to wechat world!\";\n $resultStr = sprintf($textTpl, $fromUsername, $toUsername, $time, $msgType, $contentStr);\n echo $resultStr;\n }else{\n echo \"Input something...\";\n }\n\n }else {\n echo \"\";\n exit;\n }\n }", "public function responseMsg()\n {\n\t\t$postStr = $GLOBALS[\"HTTP_RAW_POST_DATA\"];\n //接收微信公众平台发送过来的用户消息,该消息数据结构为XML,不是php默认的识别数据类型,因此这里用了$GLOBALS['HTTP_RAW_POST_DATA']来接收,同时赋值给了$postStr\n\n \t//extract post data\n\t\tif (!empty($postStr)){\n \n \t$postObj = simplexml_load_string($postStr, 'SimpleXMLElement', LIBXML_NOCDATA);\n \t//使用simplexml_load_string() 函数将接收到的XML消息数据载入对象$postObj中。这个严谨的写法后面还得加个判断是否载入成功的条件语句,不过不写也没事。\n \t$RX_TYPE = trim($postObj->MsgType); \n \t//接收信息的类型\n \t\n \tswitch($RX_TYPE)\n {\n case \"text\":\n $resultStr = $this->handleText($postObj);\n break;\n \n case \"event\":\n $resultStr = $this->handleEvent($postObj);\n break;\n \n default:\n $resultStr = \"Unknow msg type:\".$RX_TYPE.\"\\n\".$postObj->Event.\"\\n\".$postObj->EventKey;\n break;\n }\n \techo $resultStr;\n \n }else{ \n \techo \"\";\n \texit;\n }\n }", "function parse_idle_response($response) {\n // check total length\n if (count($response)<16){\n return result_response_parse_error('response length != 16');\n }\n // check STX\n if ($response[0]!=STX) {\n return result_response_parse_error('response STX error');\n }\n // check command\n if ($response[1]!=CMD_IDLE && $response[1]!=CMD_SYNCHRONIZE_TIME) {\n return result_response_parse_error('response CMD error');\n }\n // check checksum\n $data = array_slice($response,2,12);\n $checksum = calc_checksum($response[1],$data);\n if ($checksum!=$response[14]) {\n return result_response_parse_error('response CHECKSUM error');\n }\n // check ETX\n if ($response[15]!=ETX) {\n return result_response_parse_error('response ETX error');\n }\n $rdata = array(\n 'cmd' => $response[1],\n 'value' => bytes_to_string($data),\n );\n return result_success_data($rdata);\n}", "protected function process(): \\Botomatic\\Engine\\Facebook\\Entities\\Response\n {\n if ($this->isFirstStep())\n {\n // advance to the next step\n $this->nextStep();\n\n return $this->response->askForAge();\n }\n else\n {\n if ($this->message->userSentAge())\n {\n /**\n * Extract the age, show message and move to the next state\n */\n return $this->response->finish($this->message->extractAge());\n }\n else\n {\n return $this->response->notAValidAge();\n }\n }\n }", "public function & GetResponse ();", "public function getUserAnswer() : string {\n return $this->_userAnswer;\n }", "protected function _parse_respone($response)\n {\n $response = explode(self::RESPONSE_SEPARATOR, rtrim($response, self::RESPONSE_SEPARATOR));\n if ( is_array($response) ) {\n $this->response['status'] = $response[0];\n if ( $this->response['status'] == self::RESPONSE_OK ) {\n unset($response[0]);\n $this->response['data'] = $response;\n } else {\n $this->response['error'] = $response[1];\n }\n }\n }", "public function summarise_response(array $response) {\n //If an answer has been provided, return it.\n return array_key_exists('answer', $response) ? $response['answer'] : null;\n }", "protected function _parseResponse($response) {\n\t\t$headers = substr($response, 0, strpos($response, \"\\r\\n\\r\\n\"));\n\t\t$body = substr($response, strlen($headers));\n\t\t\n\t\t//split up the headers\n\t\t$parts = preg_split(\"/\\r?\\n/\", $headers, -1, PREG_SPLIT_NO_EMPTY);\n\t\t$heads = array();\n\t\tfor ($i = 1, $total = sizeof($parts); $i < $total; $i++ ) {\n\t\t\tlist($name, $value) = explode(': ', $parts[$i]);\n\t\t\t$heads[$name] = $value;\n\t\t}\n\t\tif (array_key_exists('Set-Cookie', $heads)) {\n\t\t\t$this->setCookie($heads['Set-Cookie']);\n\t\t}\n\t\t$this->__setInfo('responseHeaders', $heads);\n\t\t\n\t\t$this->response['headers'] = $heads;\n\t\t$this->response['body'] = trim($body);\t\t\n\t}", "protected function handleResponse($response)\n {\n if($this->response_type === 'json')\n return json_decode($response->getBody(), true);\n\n return simplexml_load_string($response->getBody());\n }", "public function parse();", "public function parse();", "public function parse();", "public function deserializeResponse(string $response): Response;", "public function getResponse(): string\n {\n return $this->response;\n }", "public function parseResponse($response_object){\n $retval = null;\n if (is_object($response_object)) {\n if (!empty($response_object->data)){\n $temp_array = drupal_json_decode($response_object->data);\n $retval = (object)$temp_array;\n }\n }\n return $retval;\n }", "protected function parseResponse() \n {\n if (($line=fgets($this->socket)) === false) {\n throw new Exception('Failed reading data from redis socket.'); \n }\n $type=$line[0];\n $line=substr($line, 1, -2);\n switch ($type) {\n case '+': // Status reply\n return true;\n case '-': // Error reply\n throw new Exception('Redis error: '.$line);\n case ':': // Integer reply\n // no cast to int as it is in the range of a signed 64 bit integer\n return $line;\n case '$': // Bulk replies\n if ($line=='-1') {\n return null; \n }\n $length=$line+2;\n $data='';\n while ($length>0) {\n if (($block=fread($this->socket, $length))===false) {\n throw new Exception(\n 'Failed reading data from redis connection socket.'\n ); \n }\n $data.=$block;\n $length-= function_exists('mb_strlen')\n ? mb_strlen($block, '8bit')\n : strlen($block);\n }\n return substr($data, 0, -2);\n case '*': // Multi-bulk replies\n $count=(int)$line;\n $data=array();\n for ($i=0;$i<$count;$i++) {\n $data[]=$this->parseResponse(); \n }\n return $data;\n default:\n throw new Exception('Unable to parse data received from redis.');\n }\n }", "function printInfo($response) {\n\t// Check for errors\n\tif($response === FALSE){\n\t\techo $response . \"</br>\";\n\t\tdie($response);\n\t}\n\n\t$responseData = json_decode($response, TRUE);\n\techo \"<pre>\"; print_r($responseData); echo \"</pre>\";\n}", "function parse_response($message)\n{\n $data = _parse_message($message);\n // According to https://tools.ietf.org/html/rfc7230#section-3.1.2 the space\n // between status-code and reason-phrase is required. But browsers accept\n // responses without space and reason as well.\n if (!preg_match('/^HTTP\\/.* [0-9]{3}( .*|$)/', $data['start-line'])) {\n throw new \\InvalidArgumentException('Invalid response string: ' . $data['start-line']);\n }\n $parts = explode(' ', $data['start-line'], 3);\n\n return new Response(\n $parts[1],\n $data['headers'],\n $data['body'],\n explode('/', $parts[0])[1],\n isset($parts[2]) ? $parts[2] : null\n );\n}", "public function answer ( )\n\t{\n\t\t$output_options = array(\n \"encoding\" => \"utf-8\"\n );\n\t\treturn str_replace( \"&#38;#\", \"&#\", xmlrpc_server_call_method( $this->sh, file_get_contents( 'php://input'), NULL, $output_options ) );\n\t\t\n\t}", "public function getResponse($input);", "public function decode($response);", "public function initResponse()\n {\n switch ( Config::$mobile_mode )\n {\n case 'send':\n return $this->sendMobile();\n break;\n\n default:\n return $this->viewDefault();\n break;\n }\n }", "public function is_complete_response(array $response) {\n\n //a response without an answer is not a compelte response \n if(!array_key_exists('answer', $response)) {\n return false;\n }\n\n //determine gradability based on response type\n switch($this->response_mode) {\n\n //in string mode, accept any non-empty string\n case qtype_scripted_response_mode::MODE_STRING:\n case qtype_scripted_response_mode::MODE_STRING_CASE_SENSITIVE:\n return $response['answer'] !== '';\n\n //in numeric mode, accept any numeric string\n case qtype_scripted_response_mode::MODE_NUMERIC:\n return is_numeric($response['answer']);\n\n //in binary mode, check to see if the number is valid binary using a regex\n case qtype_scripted_response_mode::MODE_BINARY:\n return preg_match('#^(0b|\\%)?[01]+$#', $response['answer']) !== 0 || (array_key_exists('answer', $response) && empty($response['answer']));\n\n //do the same for hexadecimal\n case qtype_scripted_response_mode::MODE_HEXADECIMAL:\n return preg_match('#^(0x|\\$)?[0-9a-fA-F]+$#', $response['answer']) !== 0;\n\n //do the same for octal \n case qtype_scripted_response_mode::MODE_OCTAL:\n return preg_match('#^(0o|\\@)?[0-7]+$#', $response['answer']) !== 0;\n }\n }", "public function getResponse()\n {\n return isset($this->response) ? $this->response : '';\n }", "public function parseResponse($responseString) {\n $dom = new DOMDocument();\n $dom->preserveWhiteSpace = FALSE;\n if(@$dom->loadXML($responseString)){\n $xmlconvert = new xmlconvert();\n $objconvert = new objconvert();\n $OLS_obj = $xmlconvert->xml2obj($dom);\n $badgerfish = $objconvert->obj2json($OLS_obj);\n return parent::parseResponse($badgerfish);\n }\n else{\n throw new Exception('failed to parse response from openorder: ' . $responseString);\n }\n }", "public function getResponseParser(): ResponseParserInterface\n {\n return new ResponseParser();\n }", "public function getResponseParser(): ResponseParserInterface\n {\n return new ResponseParser();\n }", "public function getResponseParser(): ResponseParserInterface\n {\n return new ResponseParser();\n }", "function get_response() {\n return $this->response;\n }", "function parseUserInfo($response){\n\t$userinfo = json_decode($response);\n\tif (is_object($userinfo) && property_exists($userinfo,'id')){\n\t\treturn $userinfo;\n\t}\n\telse{\n\t\treturn false;\n\t}\n}", "public function get_valid_response()\n {\n return $this->valid_response;\n }", "public function _parseResponce()\n\t\t{\n\t\t\t$pattern = \"/(link_cropped_no\\\" target=\\\"_blank\\\" href=\\\")(.{0,255})(\\\" )/i\";\n\t\t\tpreg_match_all($pattern, $this->responce, $out);\n\t\t\t$this->content = (!empty($out['2'])) ? array_splice($out['2'], false, AMOUNT_OF_RESULTS) : array();\n\t\t}", "public function getResponse() {\n\t}", "public function getResponse($response) {\r\n\r\n\r\n }", "function show_response()\n\t{\n\t\tprint_r($this->http_response);\n\t}", "function parse_response($response)\n {\n $data = $response->getBody();\n\n // Note we could not use Guzzle XML method becuase Endicia does not return valid XML it seems\n $sxe = new SimpleXMLElement($data);\n\n if ($sxe->status == 0) {\n $return_data = array();\n $return_data['Status'] = (string)$sxe->Status;\n $return_data['Base64LabelImage'] = (string)$sxe->Base64LabelImage;\n $return_data['TrackingNumber'] = (string)$sxe->TrackingNumber;\n $return_data['FinalPostage'] = (string)$sxe->FinalPostage;\n $return_data['TransactionID'] = (string)$sxe->TransactionID;\n $return_data['PostmarkDate'] = (string)$sxe->PostmarkDate;\n $return_data['DeliveryTimeDays'] = (string)$sxe->PostagePrice->DeliveryTimeDays;\n\t $return_data['error'] = (string)$data;\n \n\t\treturn $return_data;\n } else {\n return array('status' => 'error', 'message' => $sxe);\n }\n }", "public function parseRequest(): bool;" ]
[ "0.65729606", "0.65415114", "0.6383206", "0.6268041", "0.6210723", "0.61669755", "0.61481166", "0.6058604", "0.60233974", "0.591543", "0.59007543", "0.5894681", "0.5889265", "0.5886553", "0.587376", "0.58668524", "0.5864284", "0.58561826", "0.58544344", "0.5828043", "0.5826493", "0.5795163", "0.57894737", "0.57814324", "0.5781214", "0.5781214", "0.5781214", "0.5781214", "0.5781214", "0.5781214", "0.5781214", "0.5781214", "0.5781214", "0.5781214", "0.5781214", "0.5757823", "0.57516986", "0.57462347", "0.5743691", "0.57123166", "0.57105666", "0.5709867", "0.56841207", "0.5674924", "0.56748194", "0.5657377", "0.56497216", "0.56303346", "0.5619515", "0.56047285", "0.56047285", "0.5570663", "0.555068", "0.555068", "0.55344635", "0.55195916", "0.5512387", "0.55096775", "0.54880315", "0.5478945", "0.5477352", "0.5476717", "0.5473339", "0.5470882", "0.54597306", "0.54586625", "0.54510736", "0.5450203", "0.54449683", "0.54445267", "0.54436", "0.5441848", "0.5433328", "0.5433328", "0.5433328", "0.54308313", "0.5410075", "0.5409193", "0.53842866", "0.5373875", "0.5373114", "0.5364345", "0.53600055", "0.5358546", "0.5356163", "0.5332289", "0.532528", "0.5324074", "0.5310919", "0.5310919", "0.5310919", "0.5295809", "0.52789015", "0.5278346", "0.52768284", "0.52693427", "0.5267266", "0.5266919", "0.5259086", "0.5258462" ]
0.71726936
0
Returns a sample correct answer, if we can determine one.
public function get_correct_response() { //if the question is a "must eval true" question, we can't easily determine the answer if($this->answer_mode == qtype_scripted_answer_mode::MODE_MUST_EVAL_TRUE) { return null; } // Evaluate the given answer, and return a correct-response array. $answer = $this->evaluate_answer(parent::get_correct_answer()); return array('answer' => $answer->answer); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function correctAnswer() {\n\t}", "public function get_correct_response() \n {\n return array('answer' => 0);\n }", "public function isCorrectAnswer() {\n\t\t$this->getCorrectAnswer();\n\t}", "function get_correct_answer(){\n return $this->correct_answer;\n }", "function incorrectAnswer() {\n\t}", "function get_correct_ans($question_id) {\r\n\t\t//throw an exception if question_id is not present\r\n\t\tif (! isset ( $question_id ) && '' != $question_id) {\r\n\t\t\tshow_error ( \"Parameter question id is missing.\" );\r\n\t\t}\r\n\t\t\r\n\t\t//Get the record for corresponding id\r\n\t\t$sql = 'SELECT answers from adhi_quiz_answers WHERE question_id = ' . $question_id . ' AND answer_option = \"Y\"';\r\n\t\t$query = $this->db->query ( $sql );\r\n\t\t\r\n\t\t$result = $query->row ();\r\n\t\t\r\n\t\t// If result is empty return false\r\n\t\tif (empty ( $result )) {\r\n\t\t\treturn FALSE;\r\n\t\t}\r\n\t\t\r\n\t\treturn $result->answers;\r\n\t\r\n\t}", "public static function generateQuestion()\n {\n $lhOperand = rand(0,10); //randomises left hand operand\n $rhOperand = rand(0,10); //randomises right hand operand\n $operator = rand(0,2); //randomises operator\n switch($operator)\n {\n case 0: self::$answer=($lhOperand+$rhOperand);\n $question = \"$lhOperand+$rhOperand\";\n break;\n case 1: self::$answer=($lhOperand-$rhOperand);\n $question = \"$lhOperand-$rhOperand\";\n break;\n case 2: self::$answer=($lhOperand*$rhOperand);\n $question = \"$lhOperand*$rhOperand\";\n break;\n }\n //var_dump($question);\n var_dump(self::$answer);\n return $question;\n }", "public function isCorrect() {\n\t\treturn $this->getCorrectAnswer();\n\t}", "function answer()\r\n {\r\n /* answer is not stored */ \r\n return false;\r\n }", "public function hasAnswers();", "function generateQuestion(){\n $rangeLow = 1;\n $rangeHigh = 100;\n $incorrectNumberHigh = 10;\n\n $leftAdder = random_int($rangeLow, $rangeHigh);\n $rightAdder = random_int($rangeLow, $rangeHigh);\n $correctAnswer = $leftAdder + $rightAdder;\n //generate init values for envaluation\n $incorrectAnswerFirst = random_int($correctAnswer-$incorrectNumberHigh, $correctAnswer+$incorrectNumberHigh);\n $incorrectAnswerSecond = random_int($correctAnswer-$incorrectNumberHigh , $correctAnswer+$incorrectNumberHigh);\n\n //if the condition not met, keep generated\n while(\n ($incorrectAnswerFirst == $correctAnswer) \n || \n ($incorrectAnswerFirst == $incorrectAnswerSecond)\n ||\n ($incorrectAnswerSecond == $correctAnswer)\n ){\n $incorrectAnswerFirst = random_int($correctAnswer-$incorrectNumberHigh, $correctAnswer+$incorrectNumberHigh);\n $incorrectAnswerSecond = random_int($correctAnswer-$incorrectNumberHigh , $correctAnswer+$incorrectNumberHigh);\n }\n $questions =\n [\n \"leftAdder\" => $leftAdder,\n \"rightAdder\" => $rightAdder,\n \"correctAnswer\" => $correctAnswer,\n \"firstIncorrectAnswer\" => $incorrectAnswerFirst,\n \"secondIncorrectAnswer\" => $incorrectAnswerSecond\n ];\n\n\n return $questions;\n}", "public function compare_response_with_answer(array $response, question_answer $answer) {\n global $question;\n $autofeedback = $this->autofeedback;\n // Check to see if correct or not.\n if (self::compare_string_with_wildcard($response['answer'], $answer->answer, false)) {\n return true;\n }\n if ($this->autofeedback == 0) {\n return false;\n }\n // Must be wrong answer....lets see where they went wrong.\n $anssmiles = $answer->answer;\n $usrsmiles = $response['answer'];\n $eofeedback = '';\n // Check to see if user submitted correct type (reaction or not reaction).\n if (self::smiles_is_reaction($anssmiles)) {\n if (!self::smiles_is_reaction($usrsmiles)) {\n $this->usecase = \"<ol><li>You were asked to draw a reaction, but you neglected to add a reaction arrow!</li></ol>\";\n return false;\n }\n } else {\n if (self::smiles_is_reaction($usrsmiles)) {\n $this->usecase = \"<ol><li>You were asked to draw structures, but you drew a reaction!</li></ol>\";\n return false;\n }\n\n }\n\n // Breakdown into reactions and not reactions and analyze each!\n\n if (self::smiles_is_reaction($anssmiles)) { // Reaction!\n\n // Split into reactants and products.\n $reactantsandproducts = explode('>>', $anssmiles);\n $ansreactants = $reactantsandproducts[0];\n $ansproducts = $reactantsandproducts[1];\n\n $reactantsandproducts = explode('>>', $usrsmiles);\n $usrreactants = $reactantsandproducts[0];\n $usrproducts = $reactantsandproducts[1];\n\n $numincorrect = false;\n $usecasestring = '';\n $usrreactnumincorrect = count(explode(\".\", $ansreactants)) - count(explode(\".\", $usrreactants));\n\n if ($usrreactnumincorrect != '0') {\n if ($usrreactnumincorrect > 0) {\n $usecasestring .= \"<li>You are missing $usrreactnumincorrect reactant molecules in your answer!</li>\";\n }\n if ($usrreactnumincorrect < 0) {\n $usecasestring .= \"<li>You have $usrreactnumincorrect too many reactant molecules in your answer!</li>\";\n }\n $numincorrect = true;\n }\n\n $usrprodnumincorrect = count(explode(\".\", $ansproducts)) - count(explode(\".\", $usrproducts));\n\n if ($usrprodnumincorrect != '0') {\n if ($usrprodnumincorrect > 0) {\n $usecasestring .= \"<li>You are missing $usrprodnumincorrect product molecules in your answer!</li>\";\n }\n if ($usrprodnumincorrect < 0) {\n $usecasestring .= \"<li>You have $usrprodnumincorrect too many product molecules in your answer!</li>\";\n }\n $numincorrect = true;\n }\n if ($numincorrect == true) {\n $this->usecase = $usecasestring;\n return false;\n }\n // End of reaction analysis!\n } else { // Not reaction.\n\n $ansnumofmole = $this->smiles_num_of_molecules($anssmiles);\n $usrnumofmole = self::smiles_num_of_molecules($usrsmiles);\n\n // Check to see if correct number of molecules.\n\n if ($ansnumofmole !== $usrnumofmole) {\n // Must have wrong num of molecules.\n if ($ansnumofmole > $usrnumofmole) {\n $this->usecase = \"<li>You are missing \".($ansnumofmole - $usrnumofmole).\" molecules in your answer!</li>\";\n return false;\n } else {\n $this->usecase = \"<li>You have \".($usrnumofmole - $ansnumofmole).\" molecule(s) more than are required!</li>\";\n return false;\n }\n\n }\n\n // Combine all feedback from here on out!\n $usecasestring = '';\n // Check to see if stereochemistry is required and if user has add stereochem - just looking for @ !\n\n // Quik check first.\n if (self::smiles_ischiral1($anssmiles)) {\n if (!self::smiles_ischiral1($usrsmiles)) {\n $usecasestring .= \"<li>You did not indicate the required R/S stereochemistry!</li>\";\n }\n } else {\n if (self::smiles_ischiral($usrsmiles)) {\n $usecasestring .= \"<li>You showed stereochemistry in your answer .\n but it was not required for this problem!</li>\";\n }\n }\n // Check to see if wrong enantiomer of entire string!\n if (self::smiles_ischiral1($anssmiles) && self::smiles_ischiral1($usrsmiles)) {\n $anstemp = str_replace(\"@\", \"\", $anssmiles);\n $usrtemp = str_replace(\"@\", \"\", $usrsmiles);\n if ($anstemp == $usrtemp) {\n $usecasestring .= \"<li>You likely have the wrong stereochemistry!</li>\";\n $this->usecase = $usecasestring;\n return false;\n }\n }\n\n // Check to see if E/Z correct.\n\n // Quik check first.\n if (strpos($anssmiles, '/') !== false || strpos($anssmiles, '\\\\') !== false) {\n if (strpos($usrsmiles, '/') == false && strpos($usrsmiles, '\\\\') == false) {\n $usecasestring .= \"<li>You did not indicate the required E/Z stereochemistry!</li>\";\n }\n } else {\n if (strpos($usrsmiles, '/') !== false || strpos($usrsmiles, '\\\\') !== false) {\n $usecasestring .= \"<li>You showed E/Z stereochemistry in your answer but .\n it was not required for this problem!</li>\";\n }\n }\n // Check for lone pairs.\n\n if (strpos($anssmiles, 'lp') !== false) {\n if (strpos($usrsmiles, 'lp') == false) {\n $usecasestring .= \"<li>You are missing lone pair electrons!</li>\";\n }\n } else {\n if (strpos($usrsmiles, 'lp') !== false) {\n $usecasestring .= \"<li>You showed lone pairs in your answer but they were not required!</li>\";\n }\n }\n\n // Check for radicals.\n if (strpos($anssmiles, '^') !== false) {\n if (strpos($usrsmiles, '^') == false) {\n $usecasestring .= \"<li>You are missing radical electrons!</li>\";\n }\n } else {\n if (strpos($usrsmiles, '^') !== false) {\n $usecasestring .= \"<li>You showed radical electrons in your answer but they were not required!</li>\";\n }\n }\n\n // Check for charge.\n if (strpos($anssmiles, '+') !== false || strpos($anssmiles, '-') !== false) {\n if (strpos($usrsmiles, '+') == false && strpos($usrsmiles, '-') == false) {\n $usecasestring .= \"<li>You are missing charges on atoms!</li>\";\n }\n } else {\n if (strpos($usrsmiles, '^') !== false) {\n $usecasestring .= \"<li>You showed charges in your answer but they were not required!</li>\";\n }\n }\n\n $this->usecase = $usecasestring;\n } // End of not reaction analysis.\n\n return false;\n }", "function isAnswerCorrect($answers, $answer)\n\t{\n\t\tinclude_once \"./Services/Utilities/classes/class.ilStr.php\";\n\t\t$result = 0;\n\t\t$textrating = $this->getTextRating();\n\t\tforeach ($answers as $key => $value)\n\t\t{\n\t\t\tswitch ($textrating)\n\t\t\t{\n\t\t\t\tcase TEXTGAP_RATING_CASEINSENSITIVE:\n\t\t\t\t\tif (strcmp(ilStr::strToLower($value), ilStr::strToLower($answer)) == 0 && $this->answers[$key]->getPoints() > 0) return $key;\n\t\t\t\t\tbreak;\n\t\t\t\tcase TEXTGAP_RATING_CASESENSITIVE:\n\t\t\t\t\tif (strcmp($value, $answer) == 0 && $this->answers[$key]->getPoints() > 0) return $key;\n\t\t\t\t\tbreak;\n\t\t\t\tcase TEXTGAP_RATING_LEVENSHTEIN1:\n\t\t\t\t\tif (levenshtein($value, $answer) <= 1 && $this->answers[$key]->getPoints() > 0) return $key;\n\t\t\t\t\tbreak;\n\t\t\t\tcase TEXTGAP_RATING_LEVENSHTEIN2:\n\t\t\t\t\tif (levenshtein($value, $answer) <= 2 && $this->answers[$key]->getPoints() > 0) return $key;\n\t\t\t\t\tbreak;\n\t\t\t\tcase TEXTGAP_RATING_LEVENSHTEIN3:\n\t\t\t\t\tif (levenshtein($value, $answer) <= 3 && $this->answers[$key]->getPoints() > 0) return $key;\n\t\t\t\t\tbreak;\n\t\t\t\tcase TEXTGAP_RATING_LEVENSHTEIN4:\n\t\t\t\t\tif (levenshtein($value, $answer) <= 4 && $this->answers[$key]->getPoints() > 0) return $key;\n\t\t\t\t\tbreak;\n\t\t\t\tcase TEXTGAP_RATING_LEVENSHTEIN5:\n\t\t\t\t\tif (levenshtein($value, $answer) <= 5 && $this->answers[$key]->getPoints() > 0) return $key;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn FALSE;\n\t}", "public function check_answer() {\n $result = new stdClass;\n $result->answerid = 0;\n $result->noanswer = false;\n $result->correctanswer = false;\n $result->isessayquestion = false; // Use this to turn off review button on essay questions\n $result->response = '';\n $result->newpageid = 0; // Stay on the page\n $result->studentanswer = ''; // Use this to store student's answer(s) in order to display it on feedback page\n $result->userresponse = null;\n $result->feedback = '';\n $result->nodefaultresponse = false; // Flag for redirecting when default feedback is turned off\n return $result;\n }", "public function checkAnswer() : bool {\n return ($this->isPhishing() && $this->_userAnswer == 'phishing') ||\n (!$this->isPhishing() && $this->_userAnswer == 'real');\n }", "public function test_display_of_right_answer_when_shuffled() {\n $dd = test_question_maker::make_question('ddimageortext');\n $this->start_attempt_at_question($dd, 'deferredfeedback', 3);\n\n // Check the initial state.\n $this->check_current_state(question_state::$todo);\n $this->check_current_mark(null);\n\n $this->check_current_output(\n $this->get_contains_hidden_expectation(\n $this->quba->get_field_prefix($this->slot) . 'p1'),\n $this->get_contains_hidden_expectation(\n $this->quba->get_field_prefix($this->slot) . 'p2'),\n $this->get_contains_hidden_expectation(\n $this->quba->get_field_prefix($this->slot) . 'p3'),\n $this->get_contains_hidden_expectation(\n $this->quba->get_field_prefix($this->slot) . 'p4'),\n $this->get_does_not_contain_feedback_expectation());\n\n // Save a partial answer.\n $this->process_submission($dd->get_correct_response());\n\n // Verify.\n $this->check_current_state(question_state::$complete);\n $this->check_current_mark(null);\n $this->check_current_output(\n $this->get_contains_hidden_expectation(\n $this->quba->get_field_prefix($this->slot) . 'p1',\n $dd->get_right_choice_for(1)),\n $this->get_contains_hidden_expectation(\n $this->quba->get_field_prefix($this->slot) . 'p2',\n $dd->get_right_choice_for(2)),\n $this->get_contains_hidden_expectation(\n $this->quba->get_field_prefix($this->slot) . 'p3',\n $dd->get_right_choice_for(3)),\n $this->get_contains_hidden_expectation(\n $this->quba->get_field_prefix($this->slot) . 'p4',\n $dd->get_right_choice_for(4)),\n $this->get_does_not_contain_correctness_expectation(),\n $this->get_does_not_contain_feedback_expectation());\n\n // Finish the attempt.\n $this->quba->finish_all_questions();\n\n // Verify.\n $this->displayoptions->rightanswer = question_display_options::VISIBLE;\n $this->assertEquals('Drop zone 1 -> {1. quick} '.\n 'Drop zone 2 -> {2. fox} '.\n 'Drop zone 3 -> {3. lazy} '.\n 'Drop zone 4 -> {4. dog}',\n $dd->get_right_answer_summary());\n $this->check_current_state(question_state::$gradedright);\n $this->check_current_mark(3);\n }", "function getRandomAnswers($correctAnswer) {\n $answersArray = [];\n do {\n $random = random_int($correctAnswer - 10, $correctAnswer + 10);\n if ($random != $correctAnswer && !in_array($random, $answersArray)) {\n $answersArray[] = $random;\n }\n } while (count($answersArray) <= 2);\n return $answersArray;\n}", "function CheckIfAnswerWasCorrect ($questionId, $givenAnswer) {\n $getCorrectAnswerForQuestionSql = \"SELECT * FROM `answers` where `question_id` = '$questionId' AND `id` = '$givenAnswer' \" ;\n $rows = MySQL::getRows($getCorrectAnswerForQuestionSql);\n $firstRow = $rows[0];\n\n $isRightChoise = $firstRow->is_right_choice;\n\n if ($isRightChoise) {\n $result = true;\n } else {\n $result = false;\n }\n\n return $result;\n\n}", "function isCorrect()\r\n {\r\n if ( $this->IsCorrect == 1 )\r\n return true;\r\n elseif ( $this->IsCorrect == 0 )\r\n return false;\r\n }", "public function answerCheck()\n {\n $first_number = $this->post_data['firstNumber']; \n // Assign the second number in the question to $second_number in the class method.\n $second_number = $this->post_data['secondNumber'];\n // Assign the number of correct answers to $number_correct in the class method.\n $number_correct = $this->post_data['numberCorrect'];\n // Assign the question number for this level to $question_number in the class method.\n $question_number = $this->post_data['questionNumber'];\n // Assign the level number for this level to $level_number in the class method.\n $level_number = $this->post_data['levelNumber'];\n // Reset Question number to 1 if more than five questions have been completed or increase it by one\n if($question_number == 5) {\n $question_number = 1;\n $level_number++;\n } else {\n $question_number++;\n }\n\n // Check the correct answer to the question.\n $sum = $first_number * $second_number;\n // If the answer in the post data is equivalent to the correct answer, increment $number_correct by one \n // then return true and $number_correct. If it isn't correct return false and $number_correct.\n if ($sum == $this->post_data['sumAnswer']) {\n $number_correct++;\n return array(true, $number_correct, $question_number, $level_number);\n } else {\n return array(false, $number_correct, $question_number, $level_number);\n }\n }", "public function shouldExpectAnswer(): bool\n {\n return true;\n }", "function check($answer, $lan_id){\n if(!isset($this->solution[$lan_id])){\n echo \"<p class='error'>Solution for language \".$lan_id.\" not defined in question \".$this->name.\"</p>\";\n return 0;\n } \n\t //MAJOR BUGFIX!!!\n if (!$this->skipped && in_array($answer,explode('#',$this->solution[$lan_id])) )\n\t {\n\n \t //echo $answer .' == '. $this->solution[$lan_id].' lan='.$lan_id. ' p='.$this->points.'<br />';\n \t return $this->points; \n }\n\t else \n\t {\n \t//if($lan_id == 3) echo 'faux: '.$answer.'<br/>';\n\t\t//echo $answer .' != '. $this->solution[$lan_id]. ' lan='.$lan_id.'<br />';\n \treturn 0;\n\n }\n }", "public function get_correct_answer() {\n return isset($this->answer) ? array('answer' => $this->answer) : array();\n }", "public function getAnswer()\n {\n return $this->answer;\n }", "public function answer() {\n\n\t\t/**\n\t\t * Fires right before giving the answer.\n\t\t */\n\t\tdo_action( self::ACTION );\n\n\t\t/**\n\t\t * Filters the answer.\n\t\t *\n\t\t * @param string $answer The answer.\n\t\t */\n\t\treturn (string) apply_filters( self::FILTER, '42' );\n\t}", "public function generateChallenge()\n {\n // Easy\n if (Captcha::$config['complexity'] < 4) {\n $numbers[] = mt_rand(1, 5);\n $numbers[] = mt_rand(1, 4);\n }\n // Normal\n elseif (Captcha::$config['complexity'] < 7) {\n $numbers[] = mt_rand(10, 20);\n $numbers[] = mt_rand(1, 10);\n }\n // Difficult, well, not really ;)\n else {\n $numbers[] = mt_rand(100, 200);\n $numbers[] = mt_rand(10, 20);\n $numbers[] = mt_rand(1, 10);\n }\n\n // Store the question for output\n $this->mathExercise = implode(' + ', $numbers) . ' = ';\n\n // Return the answer\n $this->response = array_sum($numbers);\n\n return $this->response;\n }", "public function usersNeedChoice()\n {\n $madechoice = (R::count('choice'))/2;\n $choicedecided = R::count('finalchoice');\n return $madechoice - $choicedecided;\n }", "private function q12($answer) {\n\t\t$consonants = 0;\n\n\t\tforeach ($this->answers as $q => $a) {\n\t\t\tif ($a == B | $a == C | $a == D) {\n\t\t\t\t$consonants++;\n\t\t\t}\n\t\t}\n\n\t\tswitch ($answer) {\n\t\t\tcase A:\n\t\t\t\treturn $consonants % 2 === 0;\n\t\t\tcase B:\n\t\t\t\treturn $consonants % 2 === 1;\n\t\t\tcase C:\n\t\t\t\treturn $consonants === 1 || $consonants === 4 || $consonants === 9 || $consonants === 16;\n\t\t\tcase D:\n\t\t\t\treturn in_array($consonants, array(2, 3, 5, 7, 11, 13, 17, 19));\n\t\t\tcase E:\n\t\t\t\treturn $consonants % 5 === 0;\n\n\t\t}\n\t}", "function getCorrectAnswers()\n\t{\n\t\treturn $this->correctanswers;\n\t}", "public function getAnswer() {\n return $this->answer;\n }", "private function q18($answer) {\n\t\t$as = $this->total_number_of(A);\n\t\t$bs = $this->total_number_of(B);\n\t\t$cs = $this->total_number_of(C);\n\t\t$ds = $this->total_number_of(D);\n\t\t$es = $this->total_number_of(E);\n\n\t\tswitch ($answer) {\n\t\t\tcase A:\n\t\t\t\treturn $as === $bs;\n\t\t\tcase B:\n\t\t\t\treturn $as === $cs;\n\t\t\tcase C:\n\t\t\t\treturn $as === $ds;\n\t\t\tcase D:\n\t\t\t\treturn $as === $es;\n\t\t\tcase E:\n\t\t\t\treturn $as !== $bs && $as !== $cs && $as !== $ds && $as !== $es;\n\t\t}\n\t}", "protected function simpleAnswer($response) {\n $response = strtoupper($response);\n\n if ($response === 'Y' || $response === 'YES')\n return TRUE;\n else if ($response === 'N' || $response === 'NO')\n return FALSE;\n else\n return $this->promptMessage('yesorno') . PHP_EOL;\n }", "private function q17($answer) {\n\t\tswitch ($answer) {\n\t\t\tcase A:\n\t\t\t\treturn $this->a(6) == C;\n\t\t\tcase B:\n\t\t\t\treturn $this->a(6) == D;\n\t\t\tcase C:\n\t\t\t\treturn $this->a(6) == E;\n\t\t\tcase D:\n\t\t\t\treturn $this->a(6) == A || $this->a(6) == B;\n\t\t\tcase E:\n\t\t\t\t// TODO: work out if this is needed\n\t\t\t\treturn $this->a(6) == 'all of the above';\n\t\t}\n\t\t\n\t}", "function answerOf(){\r\n\t\tif($this->inDB==false||$this->answerOf==null){\r\n\t\t\t$temp=$this->dbq->answerOf($this->answer_id);\r\n\t\t\tif($temp!=\"SelectError\" || $temp!=null){\r\n\t\t\t\t$this->answerOf = $temp;\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\treturn $this->answerOf;\r\n\t}", "public function okay() {\n return $this->randomItem(\n \"Okay, I'm on it!\",\n \"I'll get right on that!\",\n 'You got it, boss.',\n 'No problem!',\n 'Sure thing.'\n );\n }", "function countCorrectAlternatives()\r\n {\r\n $returnArray = array();\r\n $db =& eZDB::globalDatabase();\r\n $db->query_single( $result, \"SELECT count( ID ) AS COUNT FROM eZQuiz_Alternative WHERE QuestionID='$this->ID' AND IsCorrect=1\" );\r\n\r\n $ret = false;\r\n\r\n if ( is_numeric( $result[$db->fieldName( \"COUNT\" )] ) )\r\n {\r\n $ret = $result[$db->fieldName( \"COUNT\" )];\r\n }\r\n\r\n return $ret;\r\n }", "public function getAnswers();", "function answer()\n {\n if( $this->Answer !== false )\n return $this->Answer;\n\n $http = eZHTTPTool::instance();\n $prefix = eZSurveyType::PREFIX_ATTRIBUTE;\n $postSurveyAnswer = $prefix . '_ezsurvey_answer_' . $this->ID . '_' . $this->contentObjectAttributeID();\n if( $http->hasPostVariable( $postSurveyAnswer ) )\n {\n $surveyAnswer = $http->postVariable( $postSurveyAnswer );\n return $surveyAnswer;\n }\n\n return false;\n }", "public function get_expected_data() \n {\n return array('answer' => PARAM_INTEGER);\n }", "private function generateChallenge()\n {\n //store two random numbers in an array\n $numbers = array(mt_rand(1,4),mt_rand(1,4));\n //store the correct answer in a session\n $_SESSION['challenge'] = $numbers[0] + $numbers[1];\n //convert the numbers to their ASCII\n $converted = array_map('ord', $numbers);\n //generate a math question as HTML markup\n return \"\n <label>&#87;&#104;&#97;&#116;&#32;&#105;&#115;&#32;\n &#$converted[0];&#32;&#43;&#32;&#$converted[1];&#63;\n <input type=\\\"text\\\" name=\\\"s_q\\\" />\n </label>\";\n }", "public function compare_response_with_answer(array $response, question_answer $answer) { \n\n // Tentative: if this response isn't gradable, it can't match any of the answers.\n if(!$this->is_gradable_response($response)) {\n return false;\n }\n\n //parse the response according to the selected response mode\n $value = $this->parse_response($response);\n \n //Create a new interpreter using the serialized question state.\n $interpreter = $this->create_interpreter($this->vars, $this->funcs);\n\n //Process the answer according to the interpretation mode. \n switch($this->answer_mode)\n {\n //for direct/answer modes,\n case qtype_scripted_answer_mode::MODE_MUST_EQUAL:\n \n //evaluate the given answer formula\n try {\n $ans = $interpreter->evaluate($answer->answer);\n } catch(qtype_scripted_language_exception $e) {\n return false;\n }\n \n //if we're comparing in a non-case-sensitive manner, convert the _answer_ to lowercase\n if($this->response_mode == qtype_scripted_response_mode::MODE_STRING) {\n $ans = strtolower((string)$ans);\n }\n\n //if the two are both numeric, compare them loosely, without regard to type; so 5 == \"05\" is true\n if(is_numeric($ans) && is_numeric($value)) {\n return $ans == $value;\n }\n //otherwise, compare them stricly; so \"5a\" !== 5; (note that, had we performed a loose compare, \"5a\" == 5 is true due to type juggling >.<)\n else {\n return $ans === $value;\n }\n \n //case 'boolean':\n case qtype_scripted_answer_mode::MODE_MUST_EVAL_TRUE:\n \n //Define the variable \"resp\" in the context of the interpreter.\n //Also define response, as per the principle of least astonishment.\n $interpreter->resp = $value;\n $interpreter->response = $value;\n\n try {\n //and return true iff the answer evaluates to True\n return (bool)$interpreter->evaluate($answer->answer);\n }\n //If an error occurs during evalution, return false.\n catch(qtype_scripted_language_exception $e) {\n return false;\n }\n \n default:\n \n //something's gone wrong\n throw new coding_exception('Invalid grading mode for the scripted qtype.');\n \n }\n }", "private function q10($answer) {\n\t\tswitch ($answer) {\n\t\t\tcase A:\n\t\t\t\treturn $this->a(16) == D;\n\t\t\tcase B:\n\t\t\t\treturn $this->a(16) == A;\n\t\t\tcase C:\n\t\t\t\treturn $this->a(16) == E;\n\t\t\tcase D:\n\t\t\t\treturn $this->a(16) == B;\n\t\t\tcase E:\n\t\t\t\treturn $this->a(16) == C;\n\t\t}\n\t}", "function answer()\r\n {\r\n //option 1) check for already defined\r\n if (strlen($this->Answer)) {\r\n return $this->Answer;\r\n }\r\n\r\n $http = eZHTTPTool::instance();\r\n $prefix = eZSurveyType::PREFIX_ATTRIBUTE;\r\n\r\n //option 2) check for answer in $_POST (trick from processViewAction or normal post)\r\n $postSurveyAnswer = $prefix . '_ezsurvey_answer_' . $this->ID . '_' . $this->contentObjectAttributeID();\r\n if ($http->hasPostVariable($postSurveyAnswer) && strlen($http->postVariable($postSurveyAnswer))) {\r\n $surveyAnswer = $http->postVariable($postSurveyAnswer);\r\n\r\n return $surveyAnswer;\r\n }\r\n\r\n return $this->Default;\r\n }", "function qtype_calculated_calculate_answer($formula, $individualdata,\n $tolerance, $tolerancetype, $answerlength, $answerformat='1', $unit='') {\n/// ->answer the correct answer\n/// ->min the lower bound for an acceptable response\n/// ->max the upper bound for an accetpable response\n\n /// Exchange formula variables with the correct values...\n global $QTYPES;\n $answer = $QTYPES['calculated']->substitute_variables_and_eval($formula, $individualdata);\n if ('1' == $answerformat) { /* Answer is to have $answerlength decimals */\n /*** Adjust to the correct number of decimals ***/\n if (stripos($answer,'e')>0 ){\n $answerlengthadd = strlen($answer)-stripos($answer,'e');\n }else {\n $answerlengthadd = 0 ;\n }\n $calculated->answer = round(floatval($answer), $answerlength+$answerlengthadd);\n\n if ($answerlength) {\n /* Try to include missing zeros at the end */\n\n if (ereg('^(.*\\\\.)(.*)$', $calculated->answer, $regs)) {\n $calculated->answer = $regs[1] . substr(\n $regs[2] . '00000000000000000000000000000000000000000x',\n 0, $answerlength)\n . $unit;\n } else {\n $calculated->answer .=\n substr('.00000000000000000000000000000000000000000x',\n 0, $answerlength + 1) . $unit;\n }\n } else {\n /* Attach unit */\n $calculated->answer .= $unit;\n }\n\n } else if ($answer) { // Significant figures does only apply if the result is non-zero\n\n // Convert to positive answer...\n if ($answer < 0) {\n $answer = -$answer;\n $sign = '-';\n } else {\n $sign = '';\n }\n\n // Determine the format 0.[1-9][0-9]* for the answer...\n $p10 = 0;\n while ($answer < 1) {\n --$p10;\n $answer *= 10;\n }\n while ($answer >= 1) {\n ++$p10;\n $answer /= 10;\n }\n // ... and have the answer rounded of to the correct length\n $answer = round($answer, $answerlength);\n\n // Have the answer written on a suitable format,\n // Either scientific or plain numeric\n if (-2 > $p10 || 4 < $p10) {\n // Use scientific format:\n $eX = 'e'.--$p10;\n $answer *= 10;\n if (1 == $answerlength) {\n $calculated->answer = $sign.$answer.$eX.$unit;\n } else {\n // Attach additional zeros at the end of $answer,\n $answer .= (1==strlen($answer) ? '.' : '')\n . '00000000000000000000000000000000000000000x';\n $calculated->answer = $sign\n .substr($answer, 0, $answerlength +1).$eX.$unit;\n }\n } else {\n // Stick to plain numeric format\n $answer *= \"1e$p10\";\n if (0.1 <= $answer / \"1e$answerlength\") {\n $calculated->answer = $sign.$answer.$unit;\n } else {\n // Could be an idea to add some zeros here\n $answer .= (ereg('^[0-9]*$', $answer) ? '.' : '')\n . '00000000000000000000000000000000000000000x';\n $oklen = $answerlength + ($p10 < 1 ? 2-$p10 : 1);\n $calculated->answer = $sign.substr($answer, 0, $oklen).$unit;\n }\n }\n\n } else {\n $calculated->answer = 0.0;\n }\n\n /// Return the result\n return $calculated;\n}", "private function q6($answer) {\n\t\tswitch ($answer) {\n\t\t\tcase A:\n\t\t\t\treturn $this->a(17) == C;\n\t\t\tcase B:\n\t\t\t\treturn $this->a(17) == D;\n\t\t\tcase C:\n\t\t\t\treturn $this->a(17) == E;\n\t\t\tcase D:\n\t\t\t\treturn $this->a(17) == A || $this->a(17) == B;\n\t\t\tcase E:\n\t\t\t\t// TODO: work out if this is needed\n\t\t\t\treturn $this->a(7) == 'all of the above';\n\t\t}\n\t\t\n\t}", "public function getAnswer() {\n return $this->program->getAnswer();\n }", "private function q4($answer) {\n\t\t$as = 0;\n\n\t\tforeach ($this->answers as $q => $a) {\n\t\t\tif ($a == A) {\n\t\t\t\t$as++;\n\t\t\t}\n\t\t}\n\t\treturn $answer + 3 === $as;\n\t}", "public function get_correct_response()\n {\n return null;\n }", "private function q20($answer) {\n\t\treturn $answer === E;\n\t}", "public function notSure() {\n return $this->randomItem(\n \"I'm not sure.\",\n \"I have absolutely no idea.\",\n \"Beats me!\",\n \"Um... good question!\"\n );\n }", "function correctAnswerWithTypo() {\n\t}", "private function q3($answer) {\n\t\t$es = 0;\n\n\t\tforeach ($this->answers as $q => $a) {\n\t\t\tif ($a == E) {\n\t\t\t\t$es++;\n\t\t\t}\n\t\t}\n\t\treturn $answer - 1 === $es;\n\t}", "private function q14($answer) {\n\t\t$ds = 0;\n\n\t\tforeach ($this->answers as $q => $a) {\n\t\t\tif ($a == B) {\n\t\t\t\t$ds++;\n\t\t\t}\n\t\t}\n\t\treturn $answer + 5 === $ds;\n\t}", "private function q15($answer) {\n\t\treturn $this->a(12) == $answer;\n\t}", "function TestGetAnswer() {\n \t$existingAnswer = new Answer(2); //Answer of formdest_id = 1\n \t$answerArray = (array(array(\"elementId\" => 1, \"value\" => \"10\"), array(\"elementId\" => 2, \"value\" => \"1\"), array(\"elementId\" => 2, \"value\" => \"2\")));\n \t$this->assertFalse($existingAnswer->getAnswers() == $answerArray);\n }", "function isWinner($values, $answer, $num)\n{\n $newArr = [];\n $ans = [];\n // clear js array from html tags and conver to low \n foreach ($values as $val) {\n $newArr[] = strtolower(strip_tags($val));\n }\n unset($val);\n\n // Convert stored array to the simple view\n for ($i = 0; $i < 16; $i++) {\n for ($j = 0; $j < 4; $j++) {\n for ($k = 0; $k < 4; $k++) {\n if (is_array($answer[$i][$j][$k])) {\n $ans[] = $answer[$i][$j][$k][0];\n } else {\n $ans[] = $answer[$i][$j][$k];\n }\n }\n }\n }\n // Compare two arrays\n for ($i = 0; $i < count($newArr); $i++) {\n if ($newArr[$i] != $ans[$i]) {\n if ($ans[$i] != $num) return 0; \n }\n }\n return 1;\n}", "public static function validateAnswer($answer)\n {\n //echo $answer.\" \".self::$answer;\n var_dump($answer);\n var_dump(self::$answer);\n if($answer == self::$answer)\n {\n return true;\n }\n else\n {\n return false;\n }\n }", "public function test_deferred_feedback_partial_answer() {\n $dd = test_question_maker::make_question('ddimageortext');\n $dd->shufflechoices = false;\n $this->start_attempt_at_question($dd, 'deferredfeedback', 3);\n\n // Check the initial state.\n $this->check_current_state(question_state::$todo);\n $this->check_current_mark(null);\n $this->check_current_output(\n $this->get_contains_drag_image_home_expectation(1, 1, 1),\n $this->get_contains_drag_image_home_expectation(2, 2, 1),\n $this->get_contains_drag_image_home_expectation(3, 1, 2),\n $this->get_contains_drag_image_home_expectation(4, 2, 2),\n $this->get_contains_hidden_expectation(\n $this->quba->get_field_prefix($this->slot) . 'p1'),\n $this->get_contains_hidden_expectation(\n $this->quba->get_field_prefix($this->slot) . 'p2'),\n $this->get_contains_hidden_expectation(\n $this->quba->get_field_prefix($this->slot) . 'p3'),\n $this->get_contains_hidden_expectation(\n $this->quba->get_field_prefix($this->slot) . 'p4'),\n $this->get_does_not_contain_correctness_expectation(),\n $this->get_does_not_contain_feedback_expectation());\n\n // Save a partial response.\n $this->process_submission(array('p1' => '1', 'p2' => '2', 'p3' => '', 'p4' => ''));\n\n // Verify.\n $this->check_current_state(question_state::$invalid);\n $this->check_current_mark(null);\n $this->check_current_output(\n $this->get_contains_drag_image_home_expectation(1, 1, 1),\n $this->get_contains_drag_image_home_expectation(2, 2, 1),\n $this->get_contains_drag_image_home_expectation(3, 1, 2),\n $this->get_contains_drag_image_home_expectation(4, 2, 2),\n $this->get_contains_hidden_expectation(\n $this->quba->get_field_prefix($this->slot) . 'p1', 1),\n $this->get_contains_hidden_expectation(\n $this->quba->get_field_prefix($this->slot) . 'p2', 2),\n $this->get_contains_hidden_expectation(\n $this->quba->get_field_prefix($this->slot) . 'p3', 0),\n $this->get_contains_hidden_expectation(\n $this->quba->get_field_prefix($this->slot) . 'p4', 0),\n $this->get_does_not_contain_correctness_expectation(),\n $this->get_does_not_contain_feedback_expectation());\n\n // Finish the attempt.\n $this->quba->finish_all_questions();\n\n // Verify.\n $this->check_current_state(question_state::$gradedpartial);\n $this->check_current_mark(1.5);\n $this->check_current_output(\n $this->get_contains_drag_image_home_expectation(1, 1, 1),\n $this->get_contains_drag_image_home_expectation(2, 2, 1),\n $this->get_contains_drag_image_home_expectation(3, 1, 2),\n $this->get_contains_drag_image_home_expectation(4, 2, 2),\n $this->get_contains_partcorrect_expectation());\n }", "function pzdc_has_answer() {\n global $PraizedCommunity;\n return $PraizedCommunity->tpt_has_answer();\n}", "private function q9($answer) {\n\t\tswitch ($answer) {\n\t\t\tcase A:\n\t\t\t\treturn $this->a(10) == A;\n\t\t\tcase B:\n\t\t\t\treturn $this->a(11) == B;\n\t\t\tcase C:\n\t\t\t\treturn $this->a(12) == C;\n\t\t\tcase D:\n\t\t\t\treturn $this->a(13) == D;\n\t\t\tcase E:\n\t\t\t\treturn $this->a(14) == E;\n\t\t}\n\t}", "public function testOtherSectionsWrongAnswer() {\n\n $this->section->setFinished($this->user);\n\n $this->setFinished($this->section, 1);\n $this->setFinished($this->section2, 10);\n\n // Subtype 1\n // Total score 3\n $this->setCorrectnessTo($this->section2, 0, false);\n $this->setCorrectnessTo($this->section2, 1, false);\n $this->setCorrectnessTo($this->section2, 1, false);\n $this->setCorrectnessTo($this->section2, 2, false);\n $this->setCorrectnessTo($this->section2, 2, true);\n $this->setCorrectnessTo($this->section2, 3, true);\n\n // Subtype 2\n // Total score 4\n $this->setCorrectnessTo($this->section2, 4, false);\n $this->setCorrectnessTo($this->section2, 5, false);\n $this->setCorrectnessTo($this->section2, 6, false);\n $this->setCorrectnessTo($this->section2, 6, false);\n\n // Subtype 3\n // Total score 2\n $this->setCorrectnessTo($this->section2, 7, true);\n $this->setCorrectnessTo($this->section2, 8, false);\n $this->setCorrectnessTo($this->section2, 9, false);\n\n $practices = Practice::getTrainings($this->section, $this->user);\n\n $this->assertEquals($practices[0]->section_id, $this->section->id);\n $this->assertEquals($practices[1]->section_id, $this->section->id);\n $this->assertEquals($practices[2]->section_id, $this->section->id);\n $this->assertEquals($practices[3]->section_id, $this->section2->id);\n $this->assertEquals($practices[3]->subtype_id, $this->subtype3->id);\n $this->assertEquals($practices[4]->section_id, $this->section2->id);\n $this->assertTrue(!isset($practices[5]));\n\n // Set second practice answered wrong five times - its subtype gets more score and is presented to user\n $this->setFinishedTo($this->section2, 1);\n $this->setCorrectnessTo($this->section2, 1, false);\n $this->setCorrectnessTo($this->section2, 1, false);\n $this->setCorrectnessTo($this->section2, 1, false);\n $this->setCorrectnessTo($this->section2, 1, false);\n $this->setCorrectnessTo($this->section2, 1, false);\n\n $practices = Practice::getTrainings($this->section, $this->user);\n\n $this->assertEquals($practices[0]->section_id, $this->section->id);\n $this->assertEquals($practices[1]->section_id, $this->section->id);\n $this->assertEquals($practices[2]->section_id, $this->section->id);\n $this->assertEquals($practices[3]->section_id, $this->section2->id);\n $this->assertEquals($practices[3]->subtype_id, $this->subtype2->id);\n $this->assertEquals($practices[4]->section_id, $this->section2->id);\n $this->assertTrue(!isset($practices[5]));\n\n // Set second practice answered correctly multiple times - its subtype gets least score\n // and another subtype practice is presented to user\n $this->setFinishedTo($this->section2, 1);\n $this->setCorrectnessTo($this->section2, 1, true);\n $this->setCorrectnessTo($this->section2, 1, true);\n $this->setCorrectnessTo($this->section2, 1, true);\n $this->setCorrectnessTo($this->section2, 1, true);\n $this->setCorrectnessTo($this->section2, 1, true);\n $this->setCorrectnessTo($this->section2, 1, true);\n $this->setCorrectnessTo($this->section2, 1, true);\n\n $practices = Practice::getTrainings($this->section, $this->user);\n\n $this->assertEquals($practices[0]->section_id, $this->section->id);\n $this->assertEquals($practices[1]->section_id, $this->section->id);\n $this->assertEquals($practices[2]->section_id, $this->section->id);\n $this->assertEquals($practices[3]->section_id, $this->section2->id);\n $this->assertEquals($practices[3]->subtype_id, $this->subtype3->id);\n $this->assertEquals($practices[4]->section_id, $this->section2->id);\n $this->assertTrue(!isset($practices[5]));\n }", "public function find_question($given_answer, $test){\n foreach ($this->questions as $key => $question){\n foreach ($question->answers as $answer) {\n if($given_answer == $answer->number){\n return $question;\n }\n }\n }\n }", "function getCorrectAnswer($cardid) {\n\t\tglobal $dbconn;\n\n\t\t// ensure we have a valid card id\n\t\tif ($cardid === \"\") {\n\t\t\treturn message(-1, \"Cannot get card info without a valid cardid.\");\n\t\t}\n\t\t\n\t\t// query for correct card answer from the database\n\t\t$query = \"SELECT answer FROM answer WHERE cardid = $1 AND correct = 1\";\n\t\t$stmnt = pg_prepare($dbconn, \"getCorrectAnswer\", $query);\n\t\t$result = pg_execute($dbconn, \"getCorrectAnswer\", array($cardid));\n\t\t\n\t\t// ensure there were no query errors\n\t\tif ($result === false) {\n\t\t\treturn message(-1, \"Error executing query against the database.\");\n\t\t}\n\t\t\n\t\t// ensure a record was returned\n\t\tif (pg_num_rows($result) == 0) {\n\t\t\treturn message(-1, \"Answer record not found\");\n\t\t}\n\t\t\n\t\t// save correct answer to variable\n\t\t$correct = pg_fetch_assoc($result);\n\t\t\n\t\t// return correct answer\n\t\treturn message(1, $correct);\n\t\t\n\t}", "public function answer()\n\t{\n\t\tif (!$this->typeResponseCode)\n\t\t\treturn $this->answerTwoHundred($this->data);\n\t\telse\n\t\t\treturn $this->answerThroughHeader($this->data);\n\t}", "function isQuestionAnswerCorrect($questionId, $answer){\n\n\t\tglobal $conn;\n\n\t\t$query = \"SELECT COUNT(*) AS Correct FROM Question WHERE id='\". $questionId . \"' AND correctAnswer='\" . $answer . \"'\";\n\n\t\t$result = $conn->query($query);\n\n\t\tif($result->num_rows != 1){\n\t\t\techo \"Error selecting \" . $questionId . \" details\";\n\t\t}else{\n\t\t\t$assocResult = $result->fetch_assoc();\n\t\t\treturn $assocResult['Correct'];\n\t\t}\n\n\t}", "function feedback() {\n\n\t$correctFeedback = array('Good job!', 'Such a champion!', 'What a genius!', );\n \tshuffle($correctFeedback);\n\n \t$incorrectFeedback = array('Nice try', 'Better luck next time', 'Practice my friend', );\n \tshuffle($incorrectFeedback);\n\n if ($_SESSION['answer'] == $_SESSION['correct'] AND isset($_POST['answer'])){\n\t\n\t\techo \"<p class='' style='color: green;'>\" . $correctFeedback[0] . \" Keep going.</p>\";\n\n \t} elseif ($_SESSION['answer'] != $_SESSION['correct'] AND isset($_POST['answer'])){\n\n\t\techo \"<p class='' style='color: red;'>\" . $incorrectFeedback[0] . \"</p>\";\n\n\t}\n\n}", "public function is_correct_user_answer() {\n\t\t\treturn strtolower($this->correct_answer) == strtolower($this->user_answer); \n\t\t}", "public function getReadyForCompletion() {\n\t\t$ready = $this->getExerciseReadyForCompletion();\n\n\t\t//Is there a question\n\t\tif(count($this->questions) == 0) {\n\t\t\t$ready = 0;\n\t\t} else {\n\t\t\tforeach($this->questions as $question) {\n\t\t\t\t//Is the question filled out\n\t\t\t\t$questionText = $question->getText();\n\t\t\t\tif(empty($questionText)) {\n\t\t\t\t\t$ready= 0;\n\t\t\t\t} else {\n\t\t\t\t\t$possibleAnswers = $question->getPossibleAnswers();\n\t\t\t\t\t//Does it have atleast 2 possible answers\n\t\t\t\t\tif(count($possibleAnswers) < 2) {\n\t\t\t\t\t\t$ready = 0;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tforeach($possibleAnswers as $possibleAnswer) {\n\t\t\t\t\t\t\t//Does each answer have a text\n\t\t\t\t\t\t\t$answerText = $possibleAnswer->getText();\n\t\t\t\t\t\t\tif(empty($answerText)) {\n\t\t\t\t\t\t\t\t$ready= 0;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $ready;\n\t}", "public function testQuestionWithFeedback() {\n $gift = \"::Q1 T/F:: 1+1=2 {T#You got it wrong.#You got it.}\\n\n ::Q2 MA:: One of these are right and three are wrong {=Right#Correct ~Wrong#nope ~Incorrect#opposite ~Not right#single word}\\n\n ::Q3 MA:: Two of these are right and two are wrong {=Right#correct =Correct#corretc ~Wrong#not this one ~Incorrect#nope}\\n\n ::Q4 Short Answer:: Two plus [_____] equals four. {=two#yes, written =2#the numeral, ~4#close}\";\n // $gift = \"::Q3 MA:: Two of these are right and two are wrong {=Right#correct =Correct ~Wrong ~Incorrect}\";\n\n $questions = array();\n $errors = array();\n parse_gift($gift, $questions, $errors);\n $this->assertEquals($questions[0]->parsed_answer[0][2], \"You got it wrong.\");\n $this->assertEquals($questions[0]->parsed_answer[1][2], \"You got it.\");\n\n // Check a string without properly formed feedback\n $gift = \"::Q1 T/F:: 1+1=2 {T#You got it.}\";\n $questions = array();\n $errors = array();\n parse_gift($gift, $questions, $errors);\n // we should get an error indicating that there was an issue with the feedback...\n $this->assertTrue(strpos($errors[0], \"malformed True/False feedback\") === 0);\n\n // but the rest of the question should still parse\n $this->assertEquals($questions[0]->question, \"1+1=2\");\n $this->assertEquals($questions[0]->type, \"true_false_question\");\n }", "public function test_interactive_correct_no_submit() {\n $dd = test_question_maker::make_question('ddimageortext');\n $dd->hints = array(\n new question_hint_with_parts(23, 'This is the first hint.',\n FORMAT_MOODLE, false, false),\n new question_hint_with_parts(24, 'This is the second hint.',\n FORMAT_MOODLE, true, true),\n );\n $dd->shufflechoices = false;\n $this->start_attempt_at_question($dd, 'interactive', 3);\n\n // Check the initial state.\n $this->check_current_state(question_state::$todo);\n $this->check_current_mark(null);\n $this->check_current_output(\n $this->get_contains_drag_image_home_expectation(1, 1, 1),\n $this->get_contains_drag_image_home_expectation(2, 2, 1),\n $this->get_contains_drag_image_home_expectation(3, 1, 2),\n $this->get_contains_drag_image_home_expectation(4, 2, 2),\n $this->get_contains_hidden_expectation(\n $this->quba->get_field_prefix($this->slot) . 'p1'),\n $this->get_contains_hidden_expectation(\n $this->quba->get_field_prefix($this->slot) . 'p2'),\n $this->get_contains_hidden_expectation(\n $this->quba->get_field_prefix($this->slot) . 'p3'),\n $this->get_contains_hidden_expectation(\n $this->quba->get_field_prefix($this->slot) . 'p4'),\n $this->get_contains_submit_button_expectation(true),\n $this->get_does_not_contain_feedback_expectation(),\n $this->get_tries_remaining_expectation(3),\n $this->get_no_hint_visible_expectation());\n\n // Save the right answer.\n $this->process_submission(array('p1' => '1', 'p2' => '2', 'p3' => '1', 'p4' => '2'));\n\n // Finish the attempt without clicking check.\n $this->quba->finish_all_questions();\n\n // Verify.\n $this->check_current_state(question_state::$gradedright);\n $this->check_current_mark(3);\n $this->check_current_output(\n $this->get_contains_drag_image_home_expectation(1, 1, 1),\n $this->get_contains_drag_image_home_expectation(2, 2, 1),\n $this->get_contains_drag_image_home_expectation(3, 1, 2),\n $this->get_contains_drag_image_home_expectation(4, 2, 2),\n $this->get_does_not_contain_submit_button_expectation(),\n $this->get_contains_correct_expectation(),\n $this->get_no_hint_visible_expectation());\n\n // Check regrading does not mess anything up.\n $this->quba->regrade_all_questions();\n\n // Verify.\n $this->check_current_state(question_state::$gradedright);\n $this->check_current_mark(3);\n }", "private function q13($answer) {\n\t\t// TODO: check its the *only* one\n\t\tswitch ($answer) {\n\t\t\tcase A:\n\t\t\t\treturn $this->a(9) == A;\n\t\t\tcase B:\n\t\t\t\treturn $this->a(11) == A;\n\t\t\tcase C:\n\t\t\t\treturn $this->a(13) == A; // never true\n\t\t\tcase D:\n\t\t\t\treturn $this->a(15) == A;\n\t\t\tcase E:\n\t\t\t\treturn $this->a(16) == A;\n\t\t}\n\t}", "private function _askQuestion()\n {\n // Grab the question\n $question = str_replace(\"!question \", \"\", $this->_data->message);\n\n // Create the yql\n $yql = 'select * from answers.search where query=\"'. $question .'\" and type=\"resolved\"';\n \n $array = $this->grabData($yql);\n \n $stuff = $array['query']['results']['Question'];\n if (is_array($stuff)) {\n $answer = $stuff[array_rand($stuff)]['ChosenAnswer'];\n $link = $stuff[array_rand($stuff)]['Link'];\n }\n $this->_message($this->_data->nick.': You asked: '. $question);\n if (!$answer) {\n $this->_message($this->_data->nick.': Sorry, I cannot answer that one! Try asking a simpler question.'); \n }\n else {\n $this->_message($this->_data->nick.': Yahoo! answers says: '. $answer .' ('. $link .')');\n }\n }", "function returnOutcome($precipProbability){\n $outcome = \"\";\n if($precipProbability < 0.05) {\n $outcome = \"Yes! 😎\";\n } else if($precipProbability >= 0.05 && $precipProbability < 0.1){\n $outcome = \"Maybe 🤔\";\n } else {\n $outcome = \"Nope 😔\";\n }\n\n return $outcome;\n}", "public function check_answer($answer) {\n $attrs = $this->_orm->attributes_as_array();\n $answer_attr = $attrs[0];\n $expected_answer = $answer_attr['attribute_value'];\n $multiple_possible = explode('||', $expected_answer);\n if (count($multiple_possible) > 1) {\n return in_array($answer, $multiple_possible);\n } else {\n return $answer == $expected_answer;\n }\n }", "public function pick_random_questionid(): int {\n // Get the list of all sharable questions in this category.\n $questionids = utils::get_sharable_question_ids($this->category->id);\n if (empty($questionids)) {\n // Error, there aren't any.\n $this->problem = 'invalidemptycategory';\n $this->problemdetails = [\n 'catname' => format_string($this->category->name),\n 'contextname' => $this->embedlocation->context_name_for_errors(),\n ];\n return 0;\n }\n\n // Count how many times each one has been used. We build an array qustionid => count of times used.\n $timesused = array_fill_keys(array_keys($questionids), 0);\n foreach ($this->quba->get_attempt_iterator() as $qa) {\n $timesused[$qa->get_question()->id] += 1;\n }\n\n // How many times have the least-used questions been used?\n $leastused = min($timesused);\n\n // Find all the questions that have been used that many times.\n $leastusedquestionids = [];\n foreach ($timesused as $questionid => $count) {\n if ($count == $leastused) {\n $leastusedquestionids[$questionid] = 1;\n }\n }\n\n return array_rand($leastusedquestionids);\n }", "public function checkAnswerById($id = false) {\n\t\t\t// Database Connection\n\t\t\t$db\t\t\t\t= $GLOBALS['db_q'];\n\t\t\t// Variables\n\t\t\t$return\t\t\t= false;\n\t\t\t// Query set up\t\n\t\t\t$row\t\t\t= ($id) ? $db->getRow('tb_answer', 'boo_correct', \"id = {$id}\") : false;\n\t\t\tif ($row['boo_correct'] == 1) {\n\t\t\t\t$return\t\t= true;\n\t\t\t}\n\t\t\t// Return\n\t\t\treturn $return;\n\t\t}", "private function q7($answer) {\n\t\tswitch ($answer) {\n\t\t\tcase A:\n\t\t\t\treturn $this->a(8) == E;\n\t\t\tcase B:\n\t\t\t\treturn $this->a(8) == E;\n\t\t\tcase C:\n\t\t\t\treturn $this->a(8) == E || $this->a(8) == A;\n\t\t\tcase D:\n\t\t\t\treturn $this->a(8) == E || $this->a(8) == C;\n\t\t\tcase E:\n\t\t\t\treturn $this->a(8) == E;\n\t\t}\n\t}", "private function q5($answer) {\n\t\tswitch ($answer) {\n\t\t\tcase A:\n\t\t\t\treturn $this->a(1) == A;\n\t\t\tcase B:\n\t\t\t\treturn $this->a(2) == B;\n\t\t\tcase C:\n\t\t\t\treturn $this->a(3) == C;\n\t\t\tcase D:\n\t\t\t\treturn $this->a(4) == D;\n\t\t\tcase E:\n\t\t\t\treturn $this->a(5) == E;\n\t\t}\n\t\t\n\t}", "public function answer()\n\t{\n\t\tif($db = $this->module->db())\n\t\t{\n\t\t\tif($result = $db->query(\"SELECT\n\t\t\t\ts_answer\n\t\t\t\tFROM\n\t\t\t\t\".$db->getPrefix().\"faq\n\t\t\t\tWHERE\n\t\t\t\tid=\".$this->id.\";\"))\n\t\t\t{\n\t\t\t\twhile( $line = mysql_fetch_array( $result ) )\n\t\t\t\t{\n\t\t\t\t\treturn urldecode($line[0]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn NULL;\n\t}", "private function q19($answer) {\n\t\treturn true;\n\t}", "function get_points($desired_answers_array, $given_answers, $importance_item) {\n global $importance;\n if(is_array($desired_answers_array)) {\n return (in_array($given_answers, $desired_answers_array)) ? ($importance[$importance_item]) : 0;\n }\n else return ($desired_answers_array == $given_answers) ? $importance[$importance_item] : 0;\n }", "function gain_if_correct($score_increment, $total, $correct, $suffix)\n {\n if($total == $correct) {\n return 'N/A';\n }\n\n return $score_increment. \" \".$suffix;\n }", "private function quiz_generate($data_quiz_src) {\n // extract all possible answer\n $all_possible_answer = array();\n foreach ($data_quiz_src as $single_quiz) {\n $all_correct_answer = explode('|', $single_quiz['correct_answer']);\n $all_possible_answer[] = $all_correct_answer[0];\n }\n\n $out = array();\n $index = 0;\n foreach ($data_quiz_src as $single_quiz) {\n shuffle($all_possible_answer);\n\n $single_quiz['all_correct_answer'] = explode('|', $single_quiz['correct_answer']);\n\n $single_quiz['possible_answer'] = array($single_quiz['all_correct_answer'][0]);\n\n $single_quiz['response_type'] = !empty($single_quiz['response_type']) ? $single_quiz['response_type'] : $this->configuration['default_response_type'];\n\n // add wrong answer to $possible_answer from input data\n if (isset($single_quiz[\"wrong_answer\"])) {\n $possible_wrong_answer = explode('|', $single_quiz[\"wrong_answer\"]);\n\n //remove eventually emtpy element\n $single_quiz['possible_answer'] = array_filter($single_quiz['possible_answer']);\n\n\n $single_quiz['possible_answer'] = array_merge($single_quiz['possible_answer'], $possible_wrong_answer);\n }\n\n // add random wrong answer to $possible_answer\n $single_quiz['possible_answer'] = array_merge($single_quiz['possible_answer'], $all_possible_answer);\n\n // eliminate duplicates\n $single_quiz['possible_answer'] = array_unique($single_quiz['possible_answer']);\n\n //remove eventually emtpy element\n $single_quiz['possible_answer'] = array_filter($single_quiz['possible_answer']);\n\n //get only the correct number of elements:\n $single_quiz['response_type'] = strtolower($single_quiz['response_type']);\n $option_array = explode('_', $single_quiz['response_type']);\n if (isset($option_array[1])) {\n $max_option = $option_array[1];\n $single_quiz['response_type'] = $option_array[0];\n } else {\n $max_option = $this->configuration['num_options'];\n }\n\n $single_quiz['possible_answer'] = array_slice($single_quiz['possible_answer'], 0, $max_option);\n\n // shuffle all data:\n shuffle($single_quiz['possible_answer']);\n\n $single_quiz['all_question'] = explode('|', $single_quiz['question']);\n\n // remove all empty values \n $single_quiz['all_question'] = array_filter($single_quiz['all_question']);\n\n shuffle($single_quiz['all_question']);\n\n $single_quiz['question'] = $single_quiz['all_question'][0];\n\n\n // add id of the correct_answer to correct answer if the answer_type is 'options' \n if ($single_quiz['response_type'] == \"options\") {\n $key = array_search($single_quiz['all_correct_answer'][0], $single_quiz['possible_answer']);\n $single_quiz['all_correct_answer'][] = $key;\n }\n\n\n $output_keys = array(\n 'id',\n 'question',\n 'all_correct_answer',\n 'possible_answer',\n 'response_type',\n 'if_correct',\n 'if_wrong'\n );\n\n\n $out[$index] = array();\n foreach ($output_keys as $single_key) {\n\n $out[$index][$single_key] = isset($single_quiz[$single_key]) ? $single_quiz[$single_key] : \"\";\n }\n\n $index ++;\n }\n return $out;\n }", "private function q2($answer) {\n\t\t// TODO: make sure no other consecutive questions have identical answers\n\t\tswitch ($answer) {\n\t\t\tcase A:\n\t\t\t\treturn $this->a(6) == $this->a(7);\n\t\t\tcase B:\n\t\t\t\treturn $this->a(6) == $this->a(7);\n\t\t\tcase C:\n\t\t\t\treturn $this->a(6) == $this->a(7);\n\t\t\tcase D:\n\t\t\t\treturn $this->a(6) == $this->a(7);\n\t\t\tcase E:\n\t\t\t\treturn $this->a(6) == $this->a(7);\n\t\t}\n\t\t\n\t}", "public function hasSample() {\n return $this->_has(2);\n }", "public function generateQuestion()\n\t{\n\t\t//get random question type\n\t\t$type = $this->questionTypes[array_rand($this->questionTypes)];\n\n\t\t//get random section\n\t\t$section = $this->getRandomSection();\n\n\t\t//get random function (within the above section)\n\t\t$function = $this->getRandomFunction($section);\n\n\t\t$question = [];\n\t\t$question['type'] = $type;\n\t\t$question['section'] = $section;\n\t\t$question['function'] = $function;\n\t\t$question['text'] = \"{$section} now, {$this->questionTextPerType[$type]}\";\n\t\t$question['choices'] = [];\n\t\t$question['answer_text'] = '';\n\t\t$question['answer_index'] = '';\t//in ['choices'] array\n\n\n\t\treturn $this->fillQuestion($question);\n\t}", "function getAnswerText(){\r\n\t\tif($this->inDB==false||$this->answer==null){\r\n\t\t\t$type = $this->dbq->getAnswerType($this->answer_id);\r\n\t\t\tif($type==3 || $type==7 || $type==8){\r\n\t\t\t\t$io = new FileIOHandler();\r\n\t\t\t\t$this->answer=$io->MediaRead($type,$this->answer_id);\r\n\t\t\t}else{\r\n\t\t\t\t$temp = $this->dbq->getAnswer($this->answer_id);\r\n\t\t\t\t$num=mysql_numrows($temp);\r\n\t\t\t\t\tif($num==1){\r\n\t\t\t\t\t\tif($type==1){\r\n\t\t\t\t\t\t\t$this->answer=mysql_result($temp,0,\"text\");\r\n\t\t\t\t\t\t}elseif($type== 2 || $type==4 || $type==5 || $type==9){\r\n\t\t\t\t\t\t\t$this->answer=mysql_result($temp,0,\"num\");\t\t\t\t\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\treturn $this->answer;\t\t\r\n\t}", "function get_question_random_simple() {\n global $default_terms_array;\n $session = new Session();\n $questions = get_questions($default_terms_array);\n\n for ($i = 0; $i < sizeof($questions); $i++) {\n\n $question = $questions[array_rand($questions) ];\n\n // if the question hasn't already been asked recently OR we're not remembering things in the session, return it\n if ((!$session->get('random_questions_asked') || ($session->get('random_questions_asked') && !in_array($question->get_ID(), $session->get('random_questions_asked'))))) {\n return $question;\n }\n }\n\n return $questions[array_rand($questions) ];\n}", "function getScore($a, $b)\n{\n // were filling out/had already filled out quiz\n $resultA = mysql_query(\"SELECT `answer` FROM `response` WHERE `profile_id`='$a' ORDER BY `question_id`\");\n $resultB = mysql_query(\"SELECT `answer` FROM `response` WHERE `profile_id`='$b' ORDER BY `question_id`\");\n $sum = 0;\n if (mysql_num_rows($resultB) == 0) {\n\treturn -1;\n }\n while (($rowA = mysql_fetch_array($resultA)) && ($rowB = mysql_fetch_array($resultB))) {\n\t$sum += pow(abs($rowA[0] - $rowB[0]),2);\n }\n echo(mysql_error());\n return sqrt($sum);\n}", "private function q16($answer) {\n\t\tswitch ($answer) {\n\t\t\tcase A:\n\t\t\t\treturn $this->a(10) == D;\n\t\t\tcase B:\n\t\t\t\treturn $this->a(10) == C;\n\t\t\tcase C:\n\t\t\t\treturn $this->a(10) == B;\n\t\t\tcase D:\n\t\t\t\treturn $this->a(10) == A;\n\t\t\tcase E:\n\t\t\t\treturn $this->a(10) == E;\n\t\t}\n\t}", "function CountCorrectAns(){\n\t\n\t\t\t\tglobal $count;\n\t\t\t\twhile($correct){\n\t\t\t\t\t$count++;\n\t\t\t\t}\n\t\t\t\treturn $count;\n\t\t\t}", "private function answer($user){\n $answers=$user->comments()->where('commentable_type','App\\Problem')->get();\n $count=[];\n $calculatedAnswerPoint=0;\n foreach($answers as $key=>$answer){\n $countLike=$answer->num_like;\n $countDisLike=$answer->num_dislike;\n $count[$key]=$countLike*Config::get('rate')['answer']['attributes']['like']-($countDisLike*Config::get('rate')['answer']['attributes']['dislike']);\n // check if the answer is true or not\n if($answer->commentable->comment_id==$answer->id){ //the answer is correct\n $count[$key]+=Config::get('rate')['answer']['attributes']['correct'];\n }else{\n $count[$key]+=Config::get('rate')['answer']['attributes']['normal'];\n }\n }\n $answerPoint=array_sum($count);\n if($answerPoint>Config::get('rate')['answer']['result'][5]){ //5 star paper\n $calculatedAnswerPoint=5;\n }elseif($answerPoint>Config::get('rate')['answer']['result'][4] && $answerPoint<=Config::get('rate')['answer']['result'][5]){\n $calculatedAnswerPoint=4;\n }elseif($answerPoint>Config::get('rate')['answer']['result'][3] && $answerPoint<=Config::get('rate')['answer']['result'][4]){\n $calculatedAnswerPoint=3;\n }elseif($answerPoint>Config::get('rate')['answer']['result'][2] && $answerPoint<=Config::get('rate')['answer']['result'][3]){\n $calculatedAnswerPoint=2;\n }elseif($answerPoint>=Config::get('rate')['answer']['result'][1] && $answerPoint<=Config::get('rate')['answer']['result'][2]){\n $calculatedAnswerPoint=1;\n }\n $finalAnswerPoint=$calculatedAnswerPoint*Config::get('rate')['answer']['weight'];\n return $finalAnswerPoint;\n }", "public static function answer_question(array $question);", "public function isExactResult() {\n \n if (false === isset($this->intRealHomeScore) || false === isset($this->intBetHomeScore)) {\n throw new \\BadMethodCallException(\"Real and bet results must be set\");\n }\n \n return $this->intBetHomeScore === $this->intRealHomeScore && $this->intBetAwayScore === $this->intRealAwayScore;\n }", "public function generate_challenge() {\n\t\t// Load words from the current language and randomize them\n\t\t$words = Eight::lang('captcha.words');\n\t\tshuffle($words);\n\n\t\t// Loop over each word...\n\t\tforeach($words as $word) {\n\t\t\t// ...until we find one of the desired length\n\t\t\tif(abs(Captcha::$config['complexity'] - strlen($word)) < 2)\n\t\t\t\treturn strtoupper($word);\n\t\t}\n\n\t\t// Return any random word as final fallback\n\t\treturn strtoupper($words[array_rand($words)]);\n\t}", "private function q8($answer) {\n\t\t$vowels = 0;\n\n\t\tforeach ($this->answers as $q => $a) {\n\t\t\tif ($a == A || $a == E) {\n\t\t\t\t$vowels++;\n\t\t\t}\n\t\t}\n\t\treturn $answer + 3 === $vowels;\n\t}", "public function testOtherSectionsCorrectAnswer() {\n\n $this->section->setFinished($this->user);\n\n $this->setFinished($this->section, 1);\n $this->setFinishedTo($this->section2, 0);\n $this->setCorrectnessTo($this->section2, 0, false);\n $this->setFinishedTo($this->section3, 0);\n $this->setCorrectnessTo($this->section3, 0, true);\n\n $practices = Practice::getTrainings($this->section, $this->user);\n\n $this->assertEquals($practices[0]->section_id, $this->section->id);\n $this->assertEquals($practices[1]->section_id, $this->section->id);\n $this->assertEquals($practices[2]->section_id, $this->section->id);\n $this->assertEquals($practices[3]->section_id, $this->section2->id);\n $this->assertEquals($practices[4]->section_id, $this->section3->id);\n $this->assertTrue(!isset($practices[5]));\n\n // Add sleep to add correctness mark on the next second\n sleep(1);\n\n $this->setFinishedTo($this->section3, 1);\n $this->setCorrectnessTo($this->section3, 1, true);\n\n $practices = Practice::getTrainings($this->section, $this->user);\n\n $this->assertEquals($practices[4]->subtype_id, $this->section3->practices[1]->subtype_id);\n\n sleep(1);\n\n $this->setCorrectnessTo($this->section3, 0, true);\n\n $practices = Practice::getTrainings($this->section, $this->user);\n\n $this->assertEquals($practices[4]->subtype_id, $this->section3->practices[0]->subtype_id);\n }", "public function checkAnswer()\r\n{\r\n $query_string = \"SELECT ans FROM questions \";\r\n $query_string .= \"WHERE questionid = :questionid AND quizid = :quizid\";\r\n\r\n return $query_string;\r\n}", "public function test_export_shortanswer() {\n $qdata = new stdClass();\n $qdata->id = 123;\n $qdata->contextid = 0;\n $qdata->qtype = 'shortanswer';\n $qdata->name = 'Short answer question';\n $qdata->questiontext = 'Fill in the gap in this sequence: Alpha, ________, Gamma.';\n $qdata->questiontextformat = FORMAT_HTML;\n $qdata->generalfeedback = 'The answer is Beta.';\n $qdata->generalfeedbackformat = FORMAT_HTML;\n $qdata->defaultmark = 1;\n $qdata->length = 1;\n $qdata->penalty = 0.3333333;\n $qdata->hidden = 0;\n \n $qdata->options = new stdClass();\n $qdata->options->usecase = 0;\n \n $qdata->options->answers = array(\n 13 => new question_answer(13, 'Beta', 1, 'Well done!', FORMAT_HTML),\n 14 => new question_answer(14, '*', 0, 'Doh!', FORMAT_HTML),\n 15 => new question_answer(15, 'Gamma', 1, 'Well done!', FORMAT_HTML),\n 16 => new question_answer(16, 'Delta', 1, 'Doh!', FORMAT_HTML),\n 17 => new question_answer(17, 'Epsilon', 1, 'Well done!', FORMAT_HTML),\n 18 => new question_answer(18, 'Tetha', 1, 'Doh!', FORMAT_HTML),\n );\n \n $qdata->hints = array(\n new question_hint(0, 'Hint 1', FORMAT_HTML),\n new question_hint(0, 'Hint 2', FORMAT_HTML),\n );\n \n // Export the question.\n $exporter = new qformat_smart();\n $questions = array($qdata);\n $zipcontent = $exporter->export_questions($questions);\n \n // Open exported question as import_data.\n $import_data = $this->zip_to_import_data($zipcontent);\n \n /*\n * Test content of imsmanifest.xml\n */\n \n $imsmanifest = $import_data->imsmanifest;\n \n $expected = '<resource identifier=\"group0_pages\" href=\"page0.svg\" type=\"webcontent\" adlcp:scormType=\"asset\"><file href=\"page0.svg\"/></resource>';\n $actual = $imsmanifest->resources->resource[0]->asXML();\n $this->assert_same_xml($expected, $actual);\n \n $expected = '<resource identifier=\"pages\" href=\"page0.svg\" type=\"webcontent\" adlcp:scormType=\"asset\"><file href=\"page0.svg\"/></resource>';\n $actual = $imsmanifest->resources->resource[1]->asXML();\n $this->assert_same_xml($expected, $actual);\n \n /*\n * Test content of page.\n */\n \n // Test number of pages.\n $this->assertCount(1, $import_data->pages);\n \n $page = $import_data->pages[0];\n \n // Test the number of question elements.\n $questions = $page->xpath('//g[@class=\"question\"]');\n $this->assertCount(1, $questions);\n \n // Test the question element.\n $question = $questions[0];\n $expectedvotemetadata = '<votemetadata><questiontext format=\"short-answer\" labelstyle=\"\" correct=\"Beta Gamma Delta Epsilon\" points=\"1\" tags=\"\" explanation=\"The answer is Beta.\" mathgradingoption=\"\" likert=\"\"/></votemetadata>';\n $votemetadata = $question->votemetadata->asXML();\n $this->assert_same_xml($expectedvotemetadata, $votemetadata);\n \n // Test the question number.\n $expectedquestionnumber = '1';\n $questionnumber = strip_tags($question->text[0]->asXML());\n $this->assertEquals($expectedquestionnumber, $questionnumber);\n \n // Test the question text without formattings.\n $expectedquestiontext = 'Fill in the gap in this sequence: Alpha, ________, Gamma.';\n $questiontext = strip_tags($question->text[1]->asXML());\n $this->assertEquals($expectedquestiontext, $questiontext);\n \n // Test the number of choices.\n $choices = $page->xpath('//g[@class=\"questionchoice\"]');\n $this->assertCount(0, $choices);\n }", "public function testExample()\n {\n echo \" testing numbers \";\n $isbnNumbers = [\n \"807229654X\", \"807229654\", \"978 032 640 615-1\", \"978032640615\", \"0072296542\",\n \"176041640615766\", \"0072296552\", \"007-229-654 2\", \"2460323406152\"\n ];\n $results = [1,0,1,0,1,0,0,1,1];\n\n $evaluated = [];\n foreach ($isbnNumbers as $isbn) {\n $evaluated[$isbn] = Helpers\\ISBN::isValidISBN($isbn);\n }\n $index = 0;\n $true = true;\n\n foreach($evaluated as $number => $output) {\n $true = $true && ($results[$index] == $output['valid']);\n if(!$true) {\n echo $results[$index].\" true: \".($true? \"1 \":\"0 \");\n print_r($output);\n }\n $index++;\n }\n\n $this->assertTrue($true);\n }" ]
[ "0.6855073", "0.6658926", "0.6600698", "0.6496942", "0.6472474", "0.6320432", "0.6271692", "0.6234233", "0.62095964", "0.62095493", "0.617852", "0.61397415", "0.61238486", "0.6102074", "0.60956556", "0.6074838", "0.6050684", "0.5932004", "0.5899703", "0.5864311", "0.5857058", "0.58499277", "0.58449113", "0.58301777", "0.5785188", "0.57814705", "0.5772203", "0.5768149", "0.5765354", "0.572802", "0.5721669", "0.5697719", "0.5687289", "0.5675186", "0.56517965", "0.56503636", "0.5634568", "0.56283265", "0.5624911", "0.560564", "0.5601547", "0.55899644", "0.5587049", "0.5562424", "0.55578965", "0.5557427", "0.554563", "0.5542942", "0.5534823", "0.55332685", "0.55239576", "0.55134785", "0.5505534", "0.5487236", "0.54869944", "0.5482226", "0.5464568", "0.5461846", "0.54615635", "0.54615325", "0.5452475", "0.5450798", "0.5444685", "0.54276466", "0.54258186", "0.542572", "0.5424958", "0.54213136", "0.54185647", "0.5416261", "0.5413564", "0.5402347", "0.53941095", "0.53886575", "0.53675234", "0.53664577", "0.53580344", "0.5339184", "0.5332049", "0.5322828", "0.5321997", "0.53126556", "0.5304541", "0.5304482", "0.5294744", "0.52899545", "0.5280447", "0.5280107", "0.5271956", "0.5259037", "0.5257626", "0.52510333", "0.5245581", "0.5231003", "0.521628", "0.5208083", "0.52042055", "0.5197059", "0.5194504", "0.51938003" ]
0.6071131
16
Evaluates an answer object, replacing its answer expression with an evaluated result.
public function evaluate_answer($answerobj, $interpreter = null) { //Create a copy of the given answer... $answer = clone $answerobj; //create a new interpreter if(!$interpreter) { $interpreter = $this->create_interpreter($this->vars, $this->funcs); } //evaluate the correct answer to get a given reponse, if possible try { $answer->answer = $interpreter->evaluate($answer->answer); } catch(qtype_scripted_language_exception $e) { debugging($e->getMessage()); return null; } //return the correct answer depending on the response mode switch($this->response_mode) { //if the answer is expected in binary, return the answer in binary case qtype_scripted_response_mode::MODE_BINARY: $answer->answer = decbin($answer->answer); break; //if the answer is expected in hex, return the answer in hex case qtype_scripted_response_mode::MODE_HEXADECIMAL: $answer->answer = dechex($answer->answer); break; //if the answer is expected in binary, return the answer in binary case qtype_scripted_response_mode::MODE_OCTAL: $answer->answer = decoct($answer->answer); break; } return $answer; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function evaluate();", "public function evaluate();", "function e($expr) \n {\n //call the core evaluation method\n return $this->evaluate($expr);\n }", "public function compare_response_with_answer(array $response, question_answer $answer) { \n\n // Tentative: if this response isn't gradable, it can't match any of the answers.\n if(!$this->is_gradable_response($response)) {\n return false;\n }\n\n //parse the response according to the selected response mode\n $value = $this->parse_response($response);\n \n //Create a new interpreter using the serialized question state.\n $interpreter = $this->create_interpreter($this->vars, $this->funcs);\n\n //Process the answer according to the interpretation mode. \n switch($this->answer_mode)\n {\n //for direct/answer modes,\n case qtype_scripted_answer_mode::MODE_MUST_EQUAL:\n \n //evaluate the given answer formula\n try {\n $ans = $interpreter->evaluate($answer->answer);\n } catch(qtype_scripted_language_exception $e) {\n return false;\n }\n \n //if we're comparing in a non-case-sensitive manner, convert the _answer_ to lowercase\n if($this->response_mode == qtype_scripted_response_mode::MODE_STRING) {\n $ans = strtolower((string)$ans);\n }\n\n //if the two are both numeric, compare them loosely, without regard to type; so 5 == \"05\" is true\n if(is_numeric($ans) && is_numeric($value)) {\n return $ans == $value;\n }\n //otherwise, compare them stricly; so \"5a\" !== 5; (note that, had we performed a loose compare, \"5a\" == 5 is true due to type juggling >.<)\n else {\n return $ans === $value;\n }\n \n //case 'boolean':\n case qtype_scripted_answer_mode::MODE_MUST_EVAL_TRUE:\n \n //Define the variable \"resp\" in the context of the interpreter.\n //Also define response, as per the principle of least astonishment.\n $interpreter->resp = $value;\n $interpreter->response = $value;\n\n try {\n //and return true iff the answer evaluates to True\n return (bool)$interpreter->evaluate($answer->answer);\n }\n //If an error occurs during evalution, return false.\n catch(qtype_scripted_language_exception $e) {\n return false;\n }\n \n default:\n \n //something's gone wrong\n throw new coding_exception('Invalid grading mode for the scripted qtype.');\n \n }\n }", "public function evaluate()\n {\n $stack = [];\n $stackIndex = -1;\n $postfix = $this->getPostfix();\n if (count($postfix) === 0) {\n return null;\n }\n $params = $this->getParams();\n foreach ($postfix as $value) {\n if (self::isMathOperator($value) === false) {\n $operand = $value;\n if (is_numeric($value) === false) {\n if (array_key_exists($value, $params) === true) {\n $operand = $params[$value];\n } else {\n throw new \\InvalidArgumentException('Invalid given variable parameter detected');\n }\n }\n $stack[++$stackIndex] = $operand;\n } else {\n $operand2 = $stack[$stackIndex--];\n $operand1 = $stack[$stackIndex--];\n $stack[++$stackIndex] = self::calculate($operand1, $operand2, $value);\n }\n }\n $this->Result = $stack[$stackIndex];\n $this->HasBeenEvaluated = true;\n }", "function evaluate($expr, $local_context = false, $function_context = false) \n {\n //clear the record of the last error\n $this->last_error = null;\n\n //clear the current assignment record\n $this->assignment_target = null;\n\n //store the initial execution context\n $initial_vars = $this->vars;\n\n //assume an initial return value of false\n $retval = false;\n\n //and strip off any leading/trailing whitespace\n $expr = trim($expr);\n\n //remove any semicolons from the end of the expression\n if (substr($expr, -1, 1) == ';') \n $expr = substr($expr, 0, strlen($expr)-1); \n\n //perform common preprocessing tasks on the expression\n //(this resolves TCL-style variables, and allows TCL-style function calls)\n $expr = $this->preprocess($expr);\n\n //if the given expression is a variable assignment:\n if (preg_match(MATHSCRIPT_VAR_ASSIGNMENT, $expr, $matches)) \n {\n //set the assignment target\n $this->assignment_target = $matches[1];\n\n //parse the data to be assigned\n $to_assign = $this->evaluate_infix($matches[2]);\n\n //if an error occurred during processing of the RHS (data to be assigned), return false\n if ($to_assign === false) \n return false; \n\n //otherwise, set the relevant variable\n $this->vars[$this->assignment_target] = $to_assign;\n\n //and return the value that resulted from the assignment\n $retval = $to_assign; // and return the resulting value\n }\n\n elseif(preg_match(MATHSCRIPT_VAR_OPERATION_ASSIGNMENT, $expr, $matches))\n {\n //get the initial value of the left-hand-side of the expression\n $lhs = $this->dereference($matches[1]);\n\n //if it does not exist, fail\n if($lhs === null)\n return false;\n\n //compute the RHS of the expression, which will be added to the LHS\n $rhs = $this->evaluate_infix($matches[3]);\n\n //if we couldn't compute the RHS, fail\n if($rhs === false)\n return false;\n\n //call the correct opreator for this block\n $handler = self::$operators[$matches[2]]['handler'];\n $result = call_user_func($handler, $this, $lhs, $rhs);\n\n //and store the result\n $this->vars[$matches[1]] = $result;\n\n //and return the value that resulted from the assignment\n $retval = $result;\n }\n\n //handle function definitions \n elseif (preg_match(MATHSCRIPT_FUNCTION_DEF, $expr, $matches))\n {\n\n //extract the function name\n $function_name = $matches[1];\n\n //ensure we're not able to override a built-in function (user defined functions can be overridden)\n if ($this->extensions->function_exists($function_name))\n return $this->trigger('cannot redefine built-in function \"'.$matches[1]().'\"');\n\n //parse the argument list for the function\n $args = explode(\",\", preg_replace(\"/\\s+/\", \"\", $matches[2])); // get the arguments\n\n //convert the infix expression for the function to postfix\n $stack = $this->infix_to_postfix($matches[3]);\n\n //if we failed to parse the infix expression, return false\n if ($stack === false) \n return false;\n\n //finally, store the function definition\n $this->user_functions[$function_name] = array(MATHSCRIPT_ARGUMENTS => $args, MATHSCRIPT_FUNCTION_BODY=> $stack);\n\n //and return, indicating success\n $retval = true;\n \n } \n //if the line wasn't any of our special cases above, attempt to evaluate it directly\n else\n {\n //if the code was empty (or an straight zero), return 0 (this is typical of comments)\n if(empty($expr))\n return 0;\n\n //evaluate the given function, and get the return value\n $retval = $this->evaluate_infix($expr); \n\n }\n\n //if we're inside of a function context, don't allow changes to the global scope\n if($function_context)\n {\n $this->vars = $initial_vars;\n }\n //if this evaluation is occurring in a local context\n elseif($local_context)\n {\n //delete any variables that were not present in the initial list of variables\n //this establishes a \"local context\"\n foreach($this->vars as $name => $value)\n if(!array_key_exists($name, $initial_vars))\n unset($this->vars[$name]);\n }\n\n //return the previously-set return value\n return $retval;\n\n }", "public function answer() {\n\n\t\t/**\n\t\t * Fires right before giving the answer.\n\t\t */\n\t\tdo_action( self::ACTION );\n\n\t\t/**\n\t\t * Filters the answer.\n\t\t *\n\t\t * @param string $answer The answer.\n\t\t */\n\t\treturn (string) apply_filters( self::FILTER, '42' );\n\t}", "public function testEvaluate()\n {\n $calc = new ReversePolishCalculator();\n $retval = $calc->evaluate(\"3 2 1 + *\");\n $this->assertEquals(9, $retval);\n }", "function answer()\n {\n if( $this->Answer !== false )\n return $this->Answer;\n\n $http = eZHTTPTool::instance();\n $prefix = eZSurveyType::PREFIX_ATTRIBUTE;\n $postSurveyAnswer = $prefix . '_ezsurvey_answer_' . $this->ID . '_' . $this->contentObjectAttributeID();\n if( $http->hasPostVariable( $postSurveyAnswer ) )\n {\n $surveyAnswer = $http->postVariable( $postSurveyAnswer );\n return $surveyAnswer;\n }\n\n return false;\n }", "public function getResultSelf( $teacherId, $AnswerQuestions ){\n\n $resultEvaluation = 0;\n foreach($AnswerQuestions as $eachAnswerQuestion){\n\n $answerQuestion = AnswerQuestion::where('id',$eachAnswerQuestion['id'])->first();\n $value = $answerQuestion->answer()->first()->value;\n $evaluationTypeId = $answerQuestion->question()->first()->evaluation_type_id;\n $evaluationTypeParent = EvaluationType::where('id',$evaluationTypeId)->first();\n $percentage = $evaluationTypeParent->parent()->first()->percentage;\n\n $resultEvaluation += ($value*$percentage)/100;\n\n }\n $this->createEvaluation($teacherId,$evaluationTypeId,$resultEvaluation);\n }", "function submitEvaluation($arrayQuestion){\n\n\t\tglobal $conn;\n\n\t\t$numberRightAnswer = 0;\n\n\t\tfor($i = 0; $i < count($arrayQuestion); $i++){\n\n\t\t\t$questionId = $arrayQuestion[$i]['questionId'];\n\t\t\t$answer = $arrayQuestion[$i]['answer'];\t\n\t\t\t\n\t\t\tif(isQuestionAnswerCorrect($questionId, $answer) == 1){\n\n\t\t\t\t$numberRightAnswer++;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn $numberRightAnswer/(count($arrayQuestion));\n\n\t}", "function answer()\r\n {\r\n //option 1) check for already defined\r\n if (strlen($this->Answer)) {\r\n return $this->Answer;\r\n }\r\n\r\n $http = eZHTTPTool::instance();\r\n $prefix = eZSurveyType::PREFIX_ATTRIBUTE;\r\n\r\n //option 2) check for answer in $_POST (trick from processViewAction or normal post)\r\n $postSurveyAnswer = $prefix . '_ezsurvey_answer_' . $this->ID . '_' . $this->contentObjectAttributeID();\r\n if ($http->hasPostVariable($postSurveyAnswer) && strlen($http->postVariable($postSurveyAnswer))) {\r\n $surveyAnswer = $http->postVariable($postSurveyAnswer);\r\n\r\n return $surveyAnswer;\r\n }\r\n\r\n return $this->Default;\r\n }", "public function evaluate(Node $node): void\n {\n switch (true) {\n case $node instanceof Func:\n $this->functionExpression($node);\n break;\n\n case $node instanceof Lambda:\n $this->lambdaExpression($node);\n break;\n\n case $node instanceof Property:\n $this->propertyExpression($node);\n break;\n\n case $node instanceof Literal:\n $this->literalExpression($node);\n break;\n\n case $node instanceof Operator:\n $this->operatorExpression($node);\n break;\n }\n }", "public function answer($id, $answer) {\n $this->run('answer', array($id, $answer));\n }", "function correctAnswer() {\n\t}", "function formValue(\\Jazzee\\Entity\\Answer $answer);", "function displayValue(\\Jazzee\\Entity\\Answer $answer);", "public function testQuery(\\Jazzee\\Entity\\Answer $answer, \\stdClass $obj);", "function answer()\r\n {\r\n /* answer is not stored */ \r\n return false;\r\n }", "public function accept($answer_id=0)\n\t{\n\t\tif (!$answer_id)\n\t\t{\n\t\t\t$this->addError(Lang::txt('No answer ID provided.'));\n\t\t\treturn false;\n\t\t}\n\n\t\t// Load the answer\n\t\t$answer = Response::oneOrFail($answer_id);\n\n\t\t// Mark it at the chosen one\n\t\t$answer->set('state', 1);\n\t\tif (!$answer->save())\n\t\t{\n\t\t\t$this->addError($answer->getError());\n\t\t\treturn false;\n\t\t}\n\n\t\t// Mark the question as answered\n\t\t$this->set('state', 1);\n\n\t\t// If banking is enabled\n\t\tif ($this->config('banking'))\n\t\t{\n\t\t\t// Accepted answer is same person as question submitter?\n\t\t\tif ($this->get('created_by') == $answer->get('created_by'))\n\t\t\t{\n\t\t\t\t$reward = Transaction::getAmount('answers', 'hold', $this->get('id'));\n\n\t\t\t\t// Remove hold\n\t\t\t\tTransaction::deleteRecords('answers', 'hold', $this->get('id'));\n\n\t\t\t\t// Make credit adjustment\n\t\t\t\t$BTL_Q = new Teller(User::get('id'));\n\t\t\t\t$BTL_Q->credit_adjustment($BTL_Q->credit_summary() - $reward);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$db = App::get('db');\n\n\t\t\t\t// Calculate and distribute earned points\n\t\t\t\t$AE = new Economy($db);\n\t\t\t\t$AE->distribute_points(\n\t\t\t\t\t$this->get('id'),\n\t\t\t\t\t$this->get('created_by'),\n\t\t\t\t\t$answer->get('created_by'),\n\t\t\t\t\t'closure'\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// Set the reward value\n\t\t\t$this->set('reward', 0);\n\t\t}\n\n\t\t// Save changes\n\t\treturn $this->save();\n\t}", "public function check_answer() {\n $result = new stdClass;\n $result->answerid = 0;\n $result->noanswer = false;\n $result->correctanswer = false;\n $result->isessayquestion = false; // Use this to turn off review button on essay questions\n $result->response = '';\n $result->newpageid = 0; // Stay on the page\n $result->studentanswer = ''; // Use this to store student's answer(s) in order to display it on feedback page\n $result->userresponse = null;\n $result->feedback = '';\n $result->nodefaultresponse = false; // Flag for redirecting when default feedback is turned off\n return $result;\n }", "public function process()\n {\n return $this->operation->evaluate($this->operands);\n }", "public function exec()\n {\n switch ($this->oper)\n {\n case 'add':\n $this->answer = ($this->num1+$this->num2);\n $this->summary = $this->num1 . ' + ' . $this->num2 . ' = ' . $this->answer;\n break;\n\n case 'sub':\n $this->answer = ($this->num1-$this->num2);\n $this->summary = $this->num1 . ' - ' . $this->num2 . ' = ' . $this->answer;\n break;\n\n case 'mul':\n $this->answer = ($this->num1*$this->num2);\n $this->summary = $this->num1 . ' * ' . $this->num2 . ' = ' . $this->answer;\n break;\n\n case 'div':\n $this->answer = ($this->num1/$this->num2);\n $this->summary = $this->num1 . ' / ' . $this->num2 . ' = ' . $this->answer;\n break;\n\n default:\n throw new InvalidArgumentException(sprintf('\"%s\" is an invalid operation.', str_replace('_', '', $this->oper)));\n }\n }", "public function testEvaluateCatchesAndRethrowsEvaluationErrors()\n {\n $language = $this->createMock(ExpressionLanguage::class);\n $language->method('evaluate')\n ->willThrowException(new \\RuntimeException('Original Message'));\n\n $failingExpression = 'expression';\n\n $this->expectException(\\RuntimeException::class);\n $this->expectExceptionMessageRegExp(\"/.*'expression'\\\\. Original Message.*/\");\n\n $evaluator = new ExpressionEvaluator($language);\n $evaluator->evaluateWithVars($failingExpression, []);\n }", "function qtype_calculated_calculate_answer($formula, $individualdata,\n $tolerance, $tolerancetype, $answerlength, $answerformat='1', $unit='') {\n/// ->answer the correct answer\n/// ->min the lower bound for an acceptable response\n/// ->max the upper bound for an accetpable response\n\n /// Exchange formula variables with the correct values...\n global $QTYPES;\n $answer = $QTYPES['calculated']->substitute_variables_and_eval($formula, $individualdata);\n if ('1' == $answerformat) { /* Answer is to have $answerlength decimals */\n /*** Adjust to the correct number of decimals ***/\n if (stripos($answer,'e')>0 ){\n $answerlengthadd = strlen($answer)-stripos($answer,'e');\n }else {\n $answerlengthadd = 0 ;\n }\n $calculated->answer = round(floatval($answer), $answerlength+$answerlengthadd);\n\n if ($answerlength) {\n /* Try to include missing zeros at the end */\n\n if (ereg('^(.*\\\\.)(.*)$', $calculated->answer, $regs)) {\n $calculated->answer = $regs[1] . substr(\n $regs[2] . '00000000000000000000000000000000000000000x',\n 0, $answerlength)\n . $unit;\n } else {\n $calculated->answer .=\n substr('.00000000000000000000000000000000000000000x',\n 0, $answerlength + 1) . $unit;\n }\n } else {\n /* Attach unit */\n $calculated->answer .= $unit;\n }\n\n } else if ($answer) { // Significant figures does only apply if the result is non-zero\n\n // Convert to positive answer...\n if ($answer < 0) {\n $answer = -$answer;\n $sign = '-';\n } else {\n $sign = '';\n }\n\n // Determine the format 0.[1-9][0-9]* for the answer...\n $p10 = 0;\n while ($answer < 1) {\n --$p10;\n $answer *= 10;\n }\n while ($answer >= 1) {\n ++$p10;\n $answer /= 10;\n }\n // ... and have the answer rounded of to the correct length\n $answer = round($answer, $answerlength);\n\n // Have the answer written on a suitable format,\n // Either scientific or plain numeric\n if (-2 > $p10 || 4 < $p10) {\n // Use scientific format:\n $eX = 'e'.--$p10;\n $answer *= 10;\n if (1 == $answerlength) {\n $calculated->answer = $sign.$answer.$eX.$unit;\n } else {\n // Attach additional zeros at the end of $answer,\n $answer .= (1==strlen($answer) ? '.' : '')\n . '00000000000000000000000000000000000000000x';\n $calculated->answer = $sign\n .substr($answer, 0, $answerlength +1).$eX.$unit;\n }\n } else {\n // Stick to plain numeric format\n $answer *= \"1e$p10\";\n if (0.1 <= $answer / \"1e$answerlength\") {\n $calculated->answer = $sign.$answer.$unit;\n } else {\n // Could be an idea to add some zeros here\n $answer .= (ereg('^[0-9]*$', $answer) ? '.' : '')\n . '00000000000000000000000000000000000000000x';\n $oklen = $answerlength + ($p10 < 1 ? 2-$p10 : 1);\n $calculated->answer = $sign.substr($answer, 0, $oklen).$unit;\n }\n }\n\n } else {\n $calculated->answer = 0.0;\n }\n\n /// Return the result\n return $calculated;\n}", "function evaluateExpression($expression)\n\t{\n\t\treturn eval('return '.$expression.';');\n\t}", "public function getEval()\n {\n return $this->hasOne(InterEvaluadores::className(), ['id' => 'eval_id']);\n }", "public static function answer_question(array $question);", "public function get_correct_response()\n {\n //if the question is a \"must eval true\" question, we can't easily determine the answer\n if($this->answer_mode == qtype_scripted_answer_mode::MODE_MUST_EVAL_TRUE) {\n return null;\n }\n\n // Evaluate the given answer, and return a correct-response array.\n $answer = $this->evaluate_answer(parent::get_correct_answer());\n return array('answer' => $answer->answer);\n }", "function &getEvaluationByUser($questions, $active_id)\n\t{\n\t\tglobal $ilDB;\n\t\t\n\t\t// collect all answers\n\t\t$answers = array();\n\t\t$result = $ilDB->queryF(\"SELECT * FROM svy_answer WHERE active_fi = %s\",\n\t\t\tarray('integer'),\n\t\t\tarray($active_id)\n\t\t);\n\t\twhile ($row = $ilDB->fetchAssoc($result))\n\t\t{\n\t\t\tif (!is_array($answers[$row[\"question_fi\"]]))\n\t\t\t{\n\t\t\t\t$answers[$row[\"question_fi\"]] = array();\n\t\t\t}\n\t\t\tarray_push($answers[$row[\"question_fi\"]], $row);\n\t\t}\n\t\t$userdata = $this->getUserDataFromActiveId($active_id);\n\t\t$resultset = array(\n\t\t\t\"name\" => $userdata[\"fullname\"],\n\t\t\t\"firstname\" => $userdata[\"firstname\"],\n\t\t\t\"lastname\" => $userdata[\"lastname\"],\n\t\t\t\"login\" => $userdata[\"login\"],\n\t\t\t\"gender\" => $userdata[\"gender\"],\n\t\t\t\"answers\" => array()\n\t\t);\n\t\tforeach ($questions as $key => $question)\n\t\t{\n\t\t\tif (array_key_exists($key, $answers))\n\t\t\t{\n\t\t\t\t$resultset[\"answers\"][$key] = $answers[$key];\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$resultset[\"answers\"][$key] = array();\n\t\t\t}\n\t\t\tsort($resultset[\"answers\"][$key]);\n\t\t}\n\t\treturn $resultset;\n\t}", "function get_correct_answer(){\n return $this->correct_answer;\n }", "public function getEvaluation()\n {\n return $this->evaluation;\n }", "public function testExpressionResultsCacheing()\n {\n\n $ast = (new Builder('ap ap ap ap s i i ap cons 42 t'))->build();\n $symbols = new SymbolStorage();\n $links = new LinkStorage();\n $context = new Context($symbols, $links);\n\n $main = new NodeExpression($context, $ast);\n $result = $main->eval();\n\n $this->assertInstanceOf(ValueInterface::class, $result);\n /** @var ValueInterface $result */\n $this->assertTrue($result->hasValue());\n $this->assertEquals(42, $result->getValue());\n }", "public function evaluate(Context $context)\n {\n foreach ($this->elements as $rule) {\n if ($rule instanceof RuleElement\\Operator) {\n continue;\n }\n\n $contextEl = $context->findElement($rule->getName());\n if ($contextEl === null) {\n continue;\n }\n if (!$rule instanceof $contextEl) {\n throw new \\UnexpectedValueException(\"Context element type doesn't match rule element type \");\n }\n $rule->setValue($contextEl->getValue());\n }\n\n return $this->process();\n }", "function rawValue(\\Jazzee\\Entity\\Answer $answer);", "public function evaluate(Model_User $user);", "public function update($answer){\n\t\t$sql = 'UPDATE answer SET questionId = ?, userId = ?, description = ?, date = ? WHERE answerId = ?';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\t\n\t\t$sqlQuery->setNumber($answer->questionId);\n\t\t$sqlQuery->setNumber($answer->userId);\n\t\t$sqlQuery->set($answer->description);\n\t\t$sqlQuery->set($answer->date);\n\n\t\t$sqlQuery->setNumber($answer->answerId);\n\t\treturn $this->executeUpdate($sqlQuery);\n\t}", "public static function evaluate_rpn_expression($expr, $vars) {\n // Operators\n $unary = array(SC_Survey_Flow::LO_NOT);\n $binary = array(SC_Survey_Flow::LO_AND, SC_Survey_Flow::LO_OR);\n\n //Split expression into tokens\n $tokens = SC_Survey_Flow::tokenise($expr);\n \n $tokens = array_map(function ($val) {\n return str_replace(SC_Survey_Flow::LITERAL, '', $val);\n }, $tokens);\n //print_r($tokens);\n\n $stack = [];\n $loop = 1;\n\n foreach ($tokens as $t) {\n if (in_array($t, $unary)) { //Token is a unary operator\n $r = array_pop($stack);\n $result = SC_Survey_Flow::evaluate_unary_logic($r, $t);\n $stack[] = $result;\n\n } elseif (in_array($t, $binary)) { //Token is a binary operator\n $r1 = array_pop($stack);\n $r2 = array_pop($stack);\n $result = SC_Survey_Flow::evaluate_binary_logic($r1, $r2, $t);\n $stack[] = $result;\n\n } else { //Token is a condition\n $result = SC_Survey_Flow::evaluate_condition($t, $vars);\n //echo 'token: '.$t.' === '.($result ? 'TRUE' : 'FALSE').'<br />';\n $stack[] = $result;\n\n }\n $loop++;\n }\n\n return $stack[0];\n }", "public static function getEvalResult($string) {\n\t\teval('\\$value = $string;');\n\t\treturn $value;\n\t}", "public function edit(Evaluation $evaluation)\n {\n return $evaluation;\n }", "public function evaluate($som, $context) {}", "protected function evaluateBoolExpression()\n {\n $result = $this->evaluateMathBlock();\n while ($mathOp = $this->readChar(true)) {\n switch ($mathOp) {\n case '+':\n $result->join('+', $this->evaluateMathBlock());\n break;\n case '-': \n $result->join('-', $this->evaluateMathBlock());\n break;\n case '=':\n $nextChar = $this->readChar();\n if ($nextChar == '=') { \n $result->join('==', $this->evaluateMathBlock());\n } elseif ($nextChar == '>') {\n $this->unreadChar(2);\n return $result;\n break;\n } else {\n throw new \\Exception('Unexpected token \"' . $mathOp . $nextChar . '\".');\n }\n break;\n case '!':\n $nextChar = $this->readChar();\n if ($nextChar == '=') {\n $result->join('!=', $this->evaluateMathBlock());\n } else {\n throw new \\Exception('Unexpected token \"' . $mathOp . $nextChar . '\".');\n }\n break;\n case '>':\n $nextChar = $this->readChar();\n if ($nextChar == '=') { \n $result->join('>=', $this->evaluateMathBlock());\n } else {\n $this->unreadChar(); \n $result->join('>', $this->evaluateMathBlock());\n }\n break;\n case '<':\n $nextChar = $this->readChar();\n if ($nextChar == '=') { \n $result->join('<=', $this->evaluateMathBlock());\n } else {\n $this->unreadChar(); \n $result->join('<', $this->evaluateMathBlock());\n }\n break;\n case 'i': // find in set\n $nextChar = $this->readChar(true);\n if ($nextChar == 'n') { \n $result->join('in', $this->evaluateMathBlock());\n } else {\n throw new \\Exception('Unexpected token \"' . $mathOp . $nextChar . '\".');\n }\n break;\n case 'l': // check against regex\n $this->evaluateLikeExpression($result);\n break;\n // Lower lever operators\n case '&': // boolean \"and\" &&\n case '|': // boolean \"or\" ||\n // end of argument or statement\n case ',':\n // end of subexpression\n case ')':\n // end of statement\n case ';': \n // array value parsed\n case ']':\n $this->unreadChar();\n // return result from recursive call\n return $result;\n break;\n default:\n throw new \\Exception('Unexpected token \"' . $mathOp . '\".');\n break;\n }\n }\n return $result;\n }", "function grade_responses(&$question, &$state, $cmoptions) {\n // We modify the question to look like a numerical question\n $numericalquestion = fullclone($question);\n foreach ($numericalquestion->options->answers as $key => $answer) {\n $answer = $numericalquestion->options->answers[$key]->answer; // for PHP 4.x\n $numericalquestion->options->answers[$key]->answer = $this->substitute_variables_and_eval($answer,\n $state->options->dataset);\n }\n $virtualqtype = $this->get_virtual_qtype();\n return $virtualqtype->grade_responses($numericalquestion, $state, $cmoptions) ;\n }", "function incorrectAnswer() {\n\t}", "private function resCalc(&$result){\n if ($result == false)\n $result = $this->result;\n else {\n if (gettype($result) != 'resource')\n $result = $this->query($result);\n }\n }", "public function evaluate($content, array $contentVariables = array());", "public function setExpressionResult($val)\n {\n $this->_propDict[\"expressionResult\"] = $val;\n return $this;\n }", "public function get_Eval(){\n return $this->eval_note;\n }", "public function evaluate($expression) {\n $postfix = $this->convertInfixToPostfix($expression);\n $result = $this->evaluatePostfix($postfix);\n\n return $result;\n }", "protected function _process_evaluate($evaluate)\n {\n if (is_array($evaluate)) {\n return json_encode($evaluate);\n }\n\n return $evaluate;\n }", "public function getAnswer()\n {\n return $this->answer;\n }", "private function calcResult(): void {\n\t\tswitch($this->rndOperator) {\n\t\t\tcase self::PLUS:\n\t\t\t\t$this->result = $this->rndNumber1 + $this->rndNumber2;\n\t\t\t\tbreak;\n\t\t\tcase self::MINUS:\n\t\t\t\t// Avoid negative results\n\t\t\t\tif($this->rndNumber1 < $this->rndNumber2) {\n\t\t\t\t\t$tmp = $this->rndNumber1;\n\t\t\t\t\t$this->rndNumber1 = $this->rndNumber2;\n\t\t\t\t\t$this->rndNumber2 = $tmp;\n\t\t\t\t}\n\n\t\t\t\t$this->result = $this->rndNumber1 - $this->rndNumber2;\n\t\t\t\tbreak;\n\t\t\tcase self::MULTIPLE:\n\t\t\tdefault:\n\t\t\t\t$this->result = $this->rndNumber1 * $this->rndNumber2;\n\t\t}\n\t}", "public function render_answer() {\n // TODO: This should be refactored\n $seq = optional_param('seq',0, PARAM_INT);\n $this->set_var('seq', $seq);\n\n try { \n $answers = array();\n if(empty($_POST['answers'])) {\n throw new Exception('Bạn chưa chọn đáp án trả lời!');\n } else {\n $answers = $_POST['answers'];\n }\n \n $this->_log->log(array(__CLASS__,__FUNCTION__,'$time='.$seq,'$answers='. json_encode($answers)));\n \n if(!isset($_SESSION['ma_quiz']['questions'][$seq])) {\n redirect('/mod/rtw/view.php?id='.$this->course_module->id.'&c=ma_quiz&a=question&seq='.$seq+1,'Câu hỏi không tồn tại, đang tải câu hỏi tiếp theo...',1);\n }\n \n $question = $_SESSION['ma_quiz']['questions'][$seq]; \n if(!isset($question->show_time)) {\n throw new Exception();\n }\n \n $now = new DateTime();\n $remain_seconds = date_utils::getSecondsBetween(new DateTime($question->show_time), $now);\n if($remain_seconds <= 0) { \n $error_message = 'Câu hỏi đã hết thời gian trả lời!';\n throw new Exception();\n }\n\n $is_corrected = $this->check_answers($question, $answers);\n \n if ($is_corrected) {\n $point = 1;\n $coin = 1;\n }\n else {\n $point = 0;\n $coin = 0;\n }\n \n $data_update = array('submit_time' => $now->format(date_utils::$formatSQLDateTime));\n \n if($point == 1) {\n // Update coin and experience\n $coin_id = player::getInstance()->change_coin($question->game_player_id, $coin);\n $experience_id = player::getInstance()->incrExp($question->game_player_id, $coin);\n $data_update['is_correct'] = 1;\n $data_update['coin_id'] = $coin_id;\n $data_update['experience_id'] = $experience_id;\n $this->set_var('change_coin', $coin);\n } \n // update user answer\n $data_update['user_answer'] = json_encode($answers);\n\n \n $style = '';\n $this->set_var('point', $point);\n $this->set_var('style', $style);\n $this->set_var('correct_answers', $this->get_correct_answers($question));\n game_ma_quiz::getInstance()->update($question->game_ma_quiz_id, $data_update);\n \n unset($_SESSION['ma_quiz']['questions'][$seq]);\n $this->doRender('result.php');\n \n } catch (Exception $e) {\n $this->_log->log($e, 'error');\n $error_message = $e->getMessage() ? $e->getMessage() : 'Hệ thống đang bận, vui lòng thử lại sau';\n $this->set_var('error_message', $error_message);\n $this->doRender('error.php');\n }\n }", "function answerOf(){\r\n\t\tif($this->inDB==false||$this->answerOf==null){\r\n\t\t\t$temp=$this->dbq->answerOf($this->answer_id);\r\n\t\t\tif($temp!=\"SelectError\" || $temp!=null){\r\n\t\t\t\t$this->answerOf = $temp;\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\treturn $this->answerOf;\r\n\t}", "public function evaluate($source)\n\t{\n\t\treturn $this->execute('return eval(' . $source . ');');\n\t}", "public function getAnswer() {\n return $this->answer;\n }", "function correctAnswerWithTypo() {\n\t}", "public function evaluate ($expression, DomNode $contextNode = null, $registerNodeNS = null) {}", "public function evaluate($path);", "public function solveEquation()\n {\n // Set up our cakephp freindly JSON output type\n $this->autoRender = false; \n $this->RequestHandler->respondAs('json');\n $this->response->type('application/json');\n\n // Build the output JSON object\n $json_co = new class{};\n $json_co->token = null;\n $json_co->efield = '';\n $json_co->answer = 'Error';\n $json_co->recurring = 0;\n\n // Get Request Data\n $input_a = $this->request->data('input-a');\n $input_b = $this->request->data('input-b');\n $input_c = $this->request->data('input-c');\n\n // Check for Zero in case they got around the javascript.\n if( $input_a == 0 ){\n $json_co->answer = 'Value A can not be 0.';\n $json_co->efield = 'input-a';\n }\n\n // Check for numeric in case they got around the javascript.\n if( !is_numeric($input_a) || !is_numeric($input_b) || !is_numeric($input_c) ){\n $efield_id = ( !is_numeric($input_a) ) ? 'a' : (( !is_numeric($input_b) ) ? 'b' : 'c');\n $json_co->efield = 'input-'.$efield_id;\n $json_co->answer = 'All values must be numeric.';\n }\n\n // Verify no input errors & Verify post & secondary form validation token\n if( $json_co->answer == 'Error' && \n $this->request->isPost() && \n $this->request->session()->read('token') == $this->request->data('token') &&\n !empty($this->request->session()->read('token')) ){\n $this->useModel1($json_co,$input_a,$input_b,$input_c);\n }\n\n // Build a new form validation token\n $json_co->token = sha1( time() . rand(0,9999) );\n $this->request->session()->write('token', $json_co->token);\n\n // Send the JSON obect back to our javascript.\n echo json_encode( $json_co );\n }", "function evaluate() {\n $params = $this->getParameters();\n\n $date = DateExpression::parse($params[0]->evaluate());\n if(!$date) {\n return false;\n }\n $days = (int) $params[1]->evaluate();\n \n if ($days < 0)\n return $date->modify(\"$days day\");\n\n return $date->modify(\"+$days day\");\n\t}", "public function set_user_answer($answer){\n\t\t\t$this->user_answer = $answer;\n\t\t}", "function fnEval($x, $strEval){\n\t$resultado = 0;\n\t$strEval = str_replace(\"x\",\"(\".$x.\")\",$strEval);\n\teval(\"\\$resultado = \".$strEval.\";\");\n\tif($resultado ==0) {\n\t\t$resultado = \"0\";\n\t}elseif($resultado == \"\" || $resultado == \"-1.#IND\"){\n\t\t\t$resultado = \"NAN\";\n\t}\n\treturn $resultado;\n}", "function _answerInlineQuery($inlineQueryId,$result = [])\n{\n $data = [\n 'inline_query_id' => $inlineQueryId,\n 'results' => json_encode(\n $result\n ),\n 'cache_time' => 0,\n ];\n\n return Request('answerInlineQuery', $data);\n}", "public function execute()\n {\n $resultJson = $this->jsonFactory->create();\n $answer = null;\n $success = true;\n $question = $this->getQuestion();\n if ($question) {\n try {\n $answer = $this->helperData->getAnswer($question);\n } catch (\\Exception $e) {\n $answer = $e->getMessage();\n $success = false;\n }\n if (!empty($answer)) {\n $answer = trim($answer);\n }\n } else {\n $success = false;\n $answer = __('Please add some context so the AI can come up with the right content.');\n }\n\n return $resultJson->setData([\n 'answer' => $answer,\n 'success' => $success\n ]);\n }", "public function __invoke(Answer $answer): Answer\n {\n $answer->delete();\n\n return $answer;\n }", "function result()\n\t\t{\n\t\t\t//generate first number\n\t\t\t$number1 = new Operand(1,10);\n\t\t\t$number1->generate_number();\n\t\t\t\n\t\t\t//generate second number\n\t\t\t$number2 = new Operand(1,10);\n\t\t\t$number2->generate_number();\n\t\t\t\n\t\t\t//generate third number\n\t\t\t$number3 = new Operand(1,10);\n\t\t\t$number3->generate_number();\n\t\t\t\n\t\t\t//generate first operator\n\t\t\t$operator1 = new Operator('+-*');\n\t\t\t$operator1->generate_operator();\n\t\t\t\n\t\t\t//generate second operator\n\t\t\t$operator2= new Operator('+-*');\n\t\t\t$operator2->generate_operator();\n\t\t\t\n\t\t\t//calculate result\n\t\t\t$a= $number1->number;\n\t\t\t$b= $operator1->Operator;\n\t\t\t$c= $number2->number;\n\t\t\t$d= $operator2->Operator;\n\t\t\t$e= $number3->number;\n\t\t\tif ($b=='+')\n\t\t\t{\n\t\t\t\t$temp= $a + $c;\n\t\t\t}\n\t\t\tif ($b=='-')\n\t\t\t{\n\t\t\t\t$temp= $a - $c;\n\t\t\t}\n\t\t\tif ($b=='*')\n\t\t\t{\n\t\t\t\t$temp= $a * $c;\n\t\t\t}\n\n\t\t\tif ($d=='+')\n\t\t\t{\n\t\t\t\t$result= $temp + $e;\n\t\t\t}\n\t\t\tif ($d=='-')\n\t\t\t{\n\t\t\t\t$result= $temp - $e;\n\t\t\t}\n\t\t\tif ($d=='*')\n\t\t\t{\n\t\t\t\t$result= $temp * $e;\n\t\t\t}\n\t\t\t\n\t\t\t$this->expression =$a.$b.$c.$d.$e;\n\t\t\t$this->security_code=$result;\n\t\t\t$this->a = $a;\n\t\t\t$this->b = $b;\n\t\t\t$this->c = $c;\n\t\t\t$this->d = $d;\n\t\t\t$this->e = $e;\n\t\t}", "function processEq($x, $y, $operand)\r\n{\r\n /*\r\n * check to see if either x or y are empty.\r\n * if it is, there is we are missing info to preform a calculation on\r\n */\r\n if (empty($x) || empty($y)) {\r\n\r\n //reset variables used for placement and EQ\r\n clearEverything();\r\n return \"you must have 2 numbers to preform an operation on!\";\r\n } else {\r\n\r\n //check to see if we are doing addition\r\n if ($operand == '+') {\r\n\r\n //apply calculation\r\n $result = $x + $y;\r\n } //check to see if we are doing subtraction\r\n else if ($operand == '-') {\r\n\r\n //apply calculation\r\n $result = $x - $y;\r\n } //check to see if we are doing multiplication\r\n else if ($operand == '*') {\r\n\r\n //apply calculation\r\n $result = $x * $y;\r\n } //check to see if we are doing division\r\n else if ($operand == '/') {\r\n\r\n //check for division by zero\r\n if ($y == 0) {\r\n\r\n //return error for division by zero\r\n $result = \"Cannot Divide By Zero!\";\r\n } else {\r\n\r\n //apply calculation\r\n $result = $x / $y;\r\n }\r\n } //check to see if we want teh remainder\r\n else if ($operand == '%') {\r\n\r\n //apply calculation\r\n $result = $x % $y;\r\n } else {\r\n\r\n //check to make sure they are only submitting operands that are supported\r\n $result = \"please enter a valid operand!\";\r\n }\r\n\r\n //reset session vars ued for pos and EQ\r\n clearEverything();\r\n }\r\n\r\n //return the answer\r\n return $result;\r\n}", "public function show(Answer $answer)\n {\n //\n }", "public function show(Answer $answer)\n {\n //\n }", "public function show(Answer $answer)\n {\n //\n }", "public function show(Answer $answer)\n {\n //\n }", "public function show(Answer $answer)\n {\n //\n }", "public function show(Answer $answer)\n {\n //\n }", "public function show(Answer $answer)\n {\n //\n }", "public function show(Answer $answer)\n {\n //\n }", "function evaluateWarning($warning, $answer) {\n\n $result = true;\n foreach($warning['criteria'] as $crit) {\n if (@$crit['any'] || @$crit['all']) {\n if (@$crit['any']) {\n $fields = $crit['any'];\n }\n if (@$crit['all']) {\n $fields = $crit['all'];\n }\n $values = array();\n foreach($fields as $fld) {\n $values[] = $answer[$fld];\n }\n\n } elseif (substr($crit['name'], 0, 11) == \"multianswer\") {\n $multiparts = explode('-', $crit['name']);\n $multipart = array_pop($multiparts);\n $values = array($answer['multianswer'][$multipart]);\n } else {\n $values = array($answer[$crit['name']]);\n }\n foreach($values as $value) {\n if (@$crit['any']) {\n $result = true;\n }\n if (@$crit['is'] == \"empty\") {\n if (trim($value) != \"\") {\n $result = false;\n }\n }\n if (@$crit['is'] == \"not-empty\") {\n if (trim($value) == \"\") {\n $result = false;\n }\n }\n if (@$crit['value']) {\n if ($crit['value'] != $value) {\n $result = false;\n }\n }\n if (@$crit['not-value']) {\n if ($crit['value'] == $value) {\n $result = false;\n }\n }\n if (@$crit['any']) {\n if ($result) {\n break;\n }\n }\n }\n if (!@$crit['any'] && !$result) {\n break;\n }\n }\n return $result;\n }", "function result()\n\t\t{\n\t\t\t//generate first number\n\t\t\t$number1 = new Operand(10,50);\n\t\t\t$number1->generate_number();\n\n\t\t\t//generate second number\n\t\t\t$number2 = new Operand(10,50);\n\t\t\t$number2->generate_number();\n\t\t\t\n\t\t\t//generate operator\n\t\t\t$operator = new Operator('+-*');\n\t\t\t$operator->generate_operator();\n\t\t\t\n\t\t\t//calculate result\n\t\t\t$a= $number1->number;\n\t\t\t$b= $operator->Operator;\n\t\t\t$c= $number2->number;\n\t\t\tif ($b=='+')\n\t\t\t{\n\t\t\t\t$d= $a + $c;\n\t\t\t}\n\t\t\tif ($b=='-')\n\t\t\t{\n\t\t\t\t$d= $a - $c;\n\t\t\t}\n\t\t\tif ($b=='*')\n\t\t\t{\n\t\t\t\t$d= $a * $c;\n\t\t\t}\n\t\n\t\t\t$this->expression =$a.$b.$c;\n\t\t\t$this->security_code=$d;\n\t\t\t$this->a = $a;\n\t\t\t$this->b = $b;\n\t\t\t$this->c = $c;\n\t\t}", "function setCorrectAnswers($a_correct_answers)\n\t{\n\t\t$this->correctanswers = $a_correct_answers;\n\t}", "function result()\n\t\t{\t\n\t\t\t//generate first number\n\t\t\t$number1 = new Operand(1,10);\n\t\t\t$number1->generate_number();\n\n\t\t\t//generate second number\t\n\t\t\t$number2 = new Operand(1,10);\n\t\t\t$number2->generate_number();\n\t\n\t\t\t//generate operator\n\t\t\t$operator = new Operator('+-');\n\t\t\t$operator->generate_operator();\n\t\t\t\n\t\t\t//calculate result\n\t\t\t$a= $number1->number;\n\t\t\t$b= $operator->Operator;\n\t\t\t$c= $number2->number;\n\t\t\tif ($b=='+')\n\t\t\t{\n\t\t\t\t$d= $a + $c;\n\t\t\t}\n\t\t\tif ($b=='-')\n\t\t\t{\n\t\t\t\t$d= $a - $c;\n\t\t\t}\n\t\t\t\n\t\t\t$this->expression =$a.$b.$c;\n\t\t\t$this->security_code=$d;\n\t\t\t$this->a = $a;\n\t\t\t$this->b = $b;\n\t\t\t$this->c = $c;\n\t\t}", "private function q7($answer) {\n\t\tswitch ($answer) {\n\t\t\tcase A:\n\t\t\t\treturn $this->a(8) == E;\n\t\t\tcase B:\n\t\t\t\treturn $this->a(8) == E;\n\t\t\tcase C:\n\t\t\t\treturn $this->a(8) == E || $this->a(8) == A;\n\t\t\tcase D:\n\t\t\t\treturn $this->a(8) == E || $this->a(8) == C;\n\t\t\tcase E:\n\t\t\t\treturn $this->a(8) == E;\n\t\t}\n\t}", "public function answer()\n\t{\n\t\tif($db = $this->module->db())\n\t\t{\n\t\t\tif($result = $db->query(\"SELECT\n\t\t\t\ts_answer\n\t\t\t\tFROM\n\t\t\t\t\".$db->getPrefix().\"faq\n\t\t\t\tWHERE\n\t\t\t\tid=\".$this->id.\";\"))\n\t\t\t{\n\t\t\t\twhile( $line = mysql_fetch_array( $result ) )\n\t\t\t\t{\n\t\t\t\t\treturn urldecode($line[0]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn NULL;\n\t}", "public function setEvaluation($evaluation)\n {\n $this->evaluation = $evaluation;\n\n return $this;\n }", "public function evaluate($input) {\r\n\t\treturn $this->conditionalAssemble();\r\n\t}", "protected function evalaluate($expression) {\n $evaluated = @eval('return (' . $expression . ');');\n \n return $evaluated !== false ? $evaluated : '';\n }", "public function answerAction()\n {\n $questionId = $this->request->getPost(\"question_id\");\n $answerId = $this->request->getPost(\"answer\");\n $other = $this->request->getPost(\"other\");\n\n //check if user selected an answer and redisplay question form if they did not\n if (is_null($answerId) || ($answerId === \"0\" && empty($other))) { \n $this->flashSession->error(\"Please select an answer!\");\n\n //fetch same question and answers to redisplay so user can try to save again\n return $this->showQuestion($questionId);\n\n }\n\n //create answer if it is custom\n if ($answerId === \"0\") {\n $answer = new Answer();\n\n $answer->question_id = $questionId;\n $answer->text = $other;\n $answer->is_other = 1;\n $answer->times_used = 1;\n\n $success = $answer->save();\n } else {\n //if answer is a predefined option then just update times_used count \n $answer = Answer::findFirst(\n [\n \"id = $answerId\"\n ]\n );\n\n $answer->times_used++;\n\n $success = $answer->save();\n }\n \n\n if ($success) {\n //create a user_answer record if the user is logged-in\n $user = $this->session->get(\"user\");\n\n if (!empty($user) && array_key_exists('id', $user) && !empty($user['id'])) {\n $userAnswer = new User_answer();\n\n $userAnswer->user_id = $user['id'];\n $userAnswer->answer_id = $answer->id;\n\n $success = $userAnswer->save();\n } \n }\n\n //if everything saved successfully, redirect to index action with a flash message \n if ($success) {\n $this->flashSession->success(\"Answer saved!\");\n\n //go back to the Answer index (the answer question form)\n return $this->response->redirect(\"answer\");\n } else {\n $this->flashSession->error(\"Answer NOT saved: \" . implode(\", \", $answer->getMessages()));\n\n //fetch same question and answers to redisplay so user can try to save again\n return $this->showQuestion($questionId);\n }\n }", "protected static function evaluate($value)\n {\n if (self::useAsCallable($value)) {\n return self::evaluate(call_user_func($value));\n }\n if (self::isArrayable($value)) {\n $collection = $value instanceof Collection ? $value->make($value) : new Collection($value);\n\n return $collection->transform(function ($value) {\n return self::evaluate($value);\n });\n }\n\n return $value;\n }", "public function getEvaluacion() {\n $respuesta = General::validarParametros($_POST, [\"id_evaluacion\"]);\n if (!is_null($respuesta)) {\n return $respuesta;\n }\n\n $respuesta = new stdClass();\n try {\n $evaluacionDAO = new EvaluacionDAO();\n\n $this->conectar();\n $evaluacionDAO->setConexion($this->conexion);\n\n $evaluacion = $evaluacionDAO->getEvaluacionxID($_POST['id_evaluacion']);\n if (!is_null($evaluacion)) {\n $evaluacion->criterios = $evaluacionDAO->getEvaluacionCriterioxIdEvaluacion($evaluacion->id_evaluacion);\n foreach ($evaluacion->criterios as &$criterio) {\n $criterio->detalles = $evaluacionDAO->getEvaluacionDetallexIdCriterio($criterio->id);\n }\n }\n\n return General::setRespuesta(\"1\", \"Consulta éxitosa\", $evaluacion);\n } finally {\n $this->cerrarConexion();\n }\n }", "public function getAnswer()\n {\n return $this->answerModel;\n }", "function updateLorAnswer(\\Foundation\\Form\\Input $input, \\Jazzee\\Entity\\Answer $answer);", "protected function evaluateBoolStatement()\n {\n /**\n * If expression contains only 1 math block - return as math expression result,\n * otherwise cast type of result to boolean\n */\n $result = $this->evaluateBoolExpression();\n while ($booleanOp = $this->readChar(true)) {\n switch ($booleanOp) {\n case '|':\n $nextChar = $this->readChar();\n if ($nextChar == '|') {\n if ($result->toBool()) {\n // in order to reduce amount of calculations,\n // skip the rest of expression and return result\n $this->rewindUntil([';', ')'], '(');\n $this->unreadChar();\n return $result;\n }\n $result->join('||', $this->evaluateBoolExpression());\n } else {\n throw new \\Exception('Unexpected token \"' . $booleanOp . $nextChar . '\".');\n }\n break;\n case '&':\n $nextChar = $this->readChar();\n if ($nextChar == '&') {\n if (!$result->toBool()) {\n // in order to reduce amount of calculations,\n // skip the rest of expression and return result\n $this->rewindUntil([';', ')'], '(');\n $this->unreadChar();\n return $result;\n }\n $result->join('&&', $this->evaluateBoolExpression());\n } else {\n throw new \\Exception('Unexpected token \"' . $booleanOp . $nextChar . '\".');\n }\n break;\n // end of argument\n case ',':\n // end of subexpression\n case ')':\n // end of statement\n case ';':\n $this->unreadChar();\n // return result from recursive call\n return $result;\n break;\n default:\n throw new \\Exception('Unexpected token \"' . $booleanOp . '\".');\n break;\n }\n }\n return $result;\n }", "public function answer(Request $request)\n {\n $answer = strtolower($request->answer);\n\n //get original question from api\n $originalQuestion = strtolower($this->getQuestion($request->page)['name']);\n\n //get data current score\n $currentScore = $this->getCurrentScore();\n\n\n //check if answer identity with originalQuestion\n if($answer === $originalQuestion) {\n\n //set page = request page + 1\n $page = $request->page + 1;\n \n //check if current score if empty and call addScore function if not empty call updateScore function\n if(empty($currentScore)) {\n $this->addScore();\n $this->setHistories([\n 'score' => \"+10\",\n 'question' => strtolower($request->question),\n 'answer' => $answer,\n 'status' => 1\n ]);\n } else {\n $this->updateScore($page);\n $this->setHistories([\n 'score' => \"+10\",\n 'question' => strtolower($request->question),\n 'answer' => $answer,\n 'status' => 1\n ]);\n }\n \n return json_encode([\n 'code' => 200,\n 'answer' => true,\n ]); \n \n } else {\n\n // deduct score when answer is wrong and checkl is current score is empty or not\n if(!empty($currentScore)) {\n $this->deductScore($request->page);\n } else {\n\n //set score -10 if answer is wrong on the first question\n $this->addScore($score = -10);\n }\n \n $this->setHistories([\n 'score' => \"-10\",\n 'question' => strtolower($request->question),\n 'answer' => $answer,\n 'status' => 0\n ]);\n return json_encode([\n 'code' => 200,\n 'answer' => false\n ]);\n }\n }", "public function matchScore(\\Jazzee\\Entity\\Answer $answer)\n {\n if ($answer->getPageStatus() == self::SKIPPED) {\n return;\n }\n if (!is_null($answer->getGREScore()) and !is_null($answer->getTOEFLScore())) {\n return; //we already have a match\n }\n $testType = $this->_applicationPage->getPage()->getElementByFixedId(self::FID_TEST_TYPE)->getJazzeeElement()->displayValue($answer);\n $registrationNumber = $this->_applicationPage->getPage()->getElementByFixedId(self::FID_REGISTRATION_NUMBER)->getJazzeeElement()->displayValue($answer);\n $testDate = $this->_applicationPage->getPage()->getElementByFixedId(self::FID_TEST_DATE)->getJazzeeElement()->formValue($answer);\n $testMonth = date('m', strtotime($testDate));\n $testYear = date('Y', strtotime($testDate));\n\n $parameters = array(\n 'registrationNumber' => $registrationNumber,\n 'testMonth' => $testMonth,\n 'testYear' => $testYear\n );\n switch ($testType) {\n case 'GRE/GRE Subject':\n $score = $this->_controller->getEntityManager()->getRepository('\\Jazzee\\Entity\\GREScore')->findOneBy($parameters);\n if ($score) {\n $answer->setGreScore($score);\n }\n break;\n case 'TOEFL':\n $score = $this->_controller->getEntityManager()->getRepository('\\Jazzee\\Entity\\TOEFLScore')->findOneBy($parameters);\n if ($score) {\n $answer->setTOEFLScore($score);\n }\n break;\n default:\n throw new \\Jazzee\\Exception(\"Unknown test type: {$testType} when trying to match a score\");\n }\n }", "function update_answer($answer, $question_id, $answer_validity){\n\t\t#Query 1 update the answers table entry\n\t\t$query1 = \"UPDATE Answers SET \n\t\t\t\t\tuseranswer=\".$answer.\",\n\t\t\t\t\treceivedtime=NOW() WHERE\n\t\t\t\t\tidcontent=\".$question_id.\" AND\n\t\t\t\t\tuseranswer IS NULL\";\n\t\t#Query 2\n\t\t$query2 = \"UPDATE Gamequestions SET\n\t\t\t\t\tanswerstatus=\".\" WHERE\n\t\t\t\t\tid=\".$question_id;\n\t}", "public function expr()/*# : ExpressionInterface */;", "public function testDynamicVariables(): void\n {\n $evaluator = new Evaluator();\n $evaluator->variables = ['a' => 1];\n $evaluator->onVariable = [$this, 'doVariable'];\n self::assertEquals(\n 5,\n $evaluator->execute('a+b')\n );\n }", "abstract public function solve();", "public function evaluate($expression, $context, $x=NULL)\n\t{\n\t\t$context->node=$this;\n\n\t\treturn $this->script->evaluate($expression, $context, $x);\n\t}", "private function q6($answer) {\n\t\tswitch ($answer) {\n\t\t\tcase A:\n\t\t\t\treturn $this->a(17) == C;\n\t\t\tcase B:\n\t\t\t\treturn $this->a(17) == D;\n\t\t\tcase C:\n\t\t\t\treturn $this->a(17) == E;\n\t\t\tcase D:\n\t\t\t\treturn $this->a(17) == A || $this->a(17) == B;\n\t\t\tcase E:\n\t\t\t\t// TODO: work out if this is needed\n\t\t\t\treturn $this->a(7) == 'all of the above';\n\t\t}\n\t\t\n\t}", "private function q9($answer) {\n\t\tswitch ($answer) {\n\t\t\tcase A:\n\t\t\t\treturn $this->a(10) == A;\n\t\t\tcase B:\n\t\t\t\treturn $this->a(11) == B;\n\t\t\tcase C:\n\t\t\t\treturn $this->a(12) == C;\n\t\t\tcase D:\n\t\t\t\treturn $this->a(13) == D;\n\t\t\tcase E:\n\t\t\t\treturn $this->a(14) == E;\n\t\t}\n\t}" ]
[ "0.64550275", "0.64550275", "0.6005985", "0.59536135", "0.5822661", "0.5607408", "0.55310565", "0.55203724", "0.5518396", "0.54791576", "0.54130846", "0.5333577", "0.52867806", "0.52827513", "0.52656186", "0.52289575", "0.51205164", "0.51036745", "0.5044132", "0.496024", "0.49467376", "0.49440587", "0.49158743", "0.491364", "0.4911817", "0.4908689", "0.49032173", "0.48957983", "0.48897344", "0.48835993", "0.48757893", "0.4875044", "0.48720008", "0.4847596", "0.48420084", "0.48307472", "0.48294532", "0.48269522", "0.48024744", "0.48008394", "0.4788892", "0.47856322", "0.47824425", "0.4782238", "0.47743514", "0.47742733", "0.47672197", "0.47642905", "0.47524425", "0.47514516", "0.47398677", "0.47301573", "0.47251454", "0.47235632", "0.4712772", "0.4704229", "0.4685192", "0.46787047", "0.4677718", "0.4658908", "0.46512678", "0.46300036", "0.46156156", "0.45974368", "0.45913008", "0.4575658", "0.45674664", "0.45665127", "0.45595193", "0.45595193", "0.45595193", "0.45595193", "0.45595193", "0.45595193", "0.45595193", "0.45595193", "0.45585498", "0.45474103", "0.45430958", "0.45374972", "0.45358393", "0.45351768", "0.45270202", "0.45189556", "0.45124996", "0.4510769", "0.4507656", "0.4501372", "0.4499677", "0.44908655", "0.44894755", "0.44814107", "0.44736797", "0.44634053", "0.44604915", "0.44585922", "0.44527492", "0.44511634", "0.44463068", "0.44423023" ]
0.7066424
0
Transforms a string into an array
public function transform($valueAsString) { if (empty($valueAsString)) { return []; } return unserialize($valueAsString); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function stringToArray(string $string): array;", "public function fromString(string $string): array;", "function stringtoarray($string) {\r\n\t/**\r\n\t * Probamos que sea un array sin comprimir\r\n\t */\r\n\tif (is_string($string)) {\r\n\t\tif (strstr($string, 'array')) {\r\n\t\t\teval(\"\\$arrayAux = $string;\");\r\n\t\t\treturn $arrayAux;\r\n\t\t}\r\n\t} else {\r\n\t\treturn FALSE;\r\n\t}\r\n}", "function fusion_string_to_array( $string ) {\n\n\t// If already an array, return early.\n\tif ( is_array( $string ) ) {\n\t\treturn $string;\n\t}\n\n\t$string = stripslashes( $string );\n\n\tif ( empty( $string ) ) {\n\t\treturn false;\n\t}\n\n\t$result = [];\n\t$pairs = explode( '&', $string );\n\n\tforeach ( $pairs as $key => $pair ) {\n\t\t// Use the original parse_str() on each element.\n\t\tparse_str( $pair, $params );\n\n\t\t$k = key( $params );\n\n\t\tif ( ! isset( $result[ $k ] ) ) {\n\t\t\t$result += $params;\n\t\t} else {\n\t\t\t$result[ $k ] = fusion_array_merge_recursive( $result[ $k ], $params[ $k ] );\n\t\t}\n\t}\n\n\treturn $result;\n}", "public function asArray() : array\n {\n return str_split($this->string);\n }", "function strToArray(&$string, &$array){\r\n $array = explode(\"\\n\", $string);\r\n }", "function string_to_array($array)\n{\n $arr = explode(',', $array);\n foreach($arr as $item)\n $result[$item] = $item;\n\n return $result;\n}", "public function parse(string $string): array;", "public static function toArray($string)\n {\n return preg_split('//', $string, -1, PREG_SPLIT_NO_EMPTY);\n }", "private function _convertArrayStringToArray($string): array {\n $array = [];\n $explode = explode(',', $string);\n\n foreach($explode as $dataset) {\n $array[] = $dataset;\n }\n\n return $array;\n }", "function vcex_string_to_array( $value = array() ) {\n\n\tif ( empty( $value ) && is_array( $value ) ) {\n\t\treturn null;\n\t}\n\n\tif ( ! empty( $value ) && is_array( $value ) ) {\n\t\treturn $value;\n\t}\n\n\t$items = preg_split( '/\\,[\\s]*/', $value );\n\n\tforeach ( $items as $item ) {\n\t\tif ( strlen( $item ) > 0 ) {\n\t\t\t$array[] = $item;\n\t\t}\n\t}\n\n\treturn $array;\n\n}", "function _scsv_to_array( string $string, bool $to_json = false ) {\n\t\treturn IMFORZA_Utils::scsv_to_array( $string, $to_json );\n\t}", "private function multi_byte_string_to_array()\n {\n $this->strings = array_values(\n array_filter(\n preg_split(\"//u\",$this->string),\n \"strlen\"\n )\n );\n }", "public static function toArray($string)\n\t{\n if(is_array($string))\n {\n return $string;\n }\n\n if (empty($string))\n {\n return null;\n }\n\n $timer = dmDebug::timer(\"dmString::toArray\");\n\n $array = array();\n\n // JQUERY STYLE - css expression\n self::retrieveCssFromString($string, $array);\n\n // DMS STYLE - string opt in name\n self::retrieveOptFromString($string, $array);\n\n $timer->addTime();\n\n return $array;\n\t}", "abstract public static function decode($string): array;", "public function createArray($str) {\n\t\t$str = substr($str, 0, -1);\n\t\treturn explode(',', $str);\n\t}", "protected function processFrom(string $string): array\n {\n return \\json_decode($string, true);\n }", "public function fromString($string)\n {\n if (empty($string)) {\n return array();\n }\n\n return \\Zend\\Json\\Json::decode(\n $string,\n \\Zend\\Json\\Json::TYPE_ARRAY\n );\n }", "public function buildArray($string)\r\n {\r\n if (strlen($string))\r\n {\r\n return explode(',', preg_replace('/\\{|\\}/', '', $string));\r\n }\r\n \r\n return array();\r\n }", "function ussd_string_to_array($ussd_string){\n return explode(\"*\",$ussd_string);\n}", "function str_to_array($str,$key){\n\t\t//remove the . from last line\n\t\t$str = trim($str,'.');\n\t\treturn explode($key,$str);\n\t}", "function toArray($str)\n\t{\n\t\t$tmpItemArr = array_filter(explode('-dlm-',$str));\n\t\tforeach ($tmpItemArr as &$value) {\n \t\t$ItemArr = explode('-spl-', $value);\n\t\t\t$arr[$ItemArr[0]]['id'] = &$ItemArr[0]; // Item ID\n\t\t\t$arr[$ItemArr[0]]['qty'] = &$ItemArr[1]; // Item Quantity\n\t\t\t$arr[$ItemArr[0]]['cp'] = &$ItemArr[2]; // Item custom price\n\t\t\t$arr[$ItemArr[0]]['order'] = &$ItemArr[3]; // Item order\n\t\t}\n\t\treturn $arr;\n\t}", "function xml2array($xml_string)\n {\n return \\Findforsikring\\Support\\Converters::xml2Array($xml_string);\n }", "public function stringtoarray($stringa,$delimitatore=','){\n\t\treturn explode($delimitatore,$stringa);\n\t}", "public function string2array($string, $delimiter = \",\"){\n\n\t\t$array = explode($delimiter, $string);\n\n\t\tforeach($array AS $key => &$value){\n\t\t\t$value = $this->clean($value);\n\t\t}\n\n\t\treturn $array;\n\t}", "public function convert(string $json): array;", "public static function parsingToArray($string) {\n\n\t\t//remove punctuation\n\t\t\n\t\tforeach(WordsParser::$Punctuation as $pun)\n\t\t{\n\t\t\t$string = str_replace($pun, \" \", $string);\n\t\t}\n\t\t\n\t\t//remove newline,Tab, and double space.\n\t\t$string = str_replace(\"\\n\", \" \", $string);\n\t\t$string = str_replace(\"\\r\", \" \", $string);\n\t\t$string = str_replace(\" \", \" \", $string); \n\t\t$string = str_replace(\"\t\", \" \", $string);\n\t\t$arrtext = explode(\" \", $string);\n\t\tforeach($arrtext as $keyword)\n\t\t{\n\t\t\t$wordsArr[] = $keyword;\n\t\t}\n\t\t\n\t\treturn $wordsArr;\n\t}", "public static function relationStringToArray($string)\n {\n return explode('->', $string); \n }", "private function uriToArray(string $uri)\n {\n if($uri !== '/')\n {\n $uri = Str::moveFromBothEnds($uri, '/');\n }\n else {\n $uri = '';\n }\n\n return new Arr(explode('/', $uri));\n }", "public static function getArray($str)\n\t{\n\t\t//Get rid of blank spaces\n\t\t$str = str_replace(\" \", \"\", $str);\n\t\t\n\t\treturn explode(\",\",$str);\t\t\n\t}", "function makearray($mstrg) {\n\t\t// check if values are separated by comma ','.\n\t if ($this->havecomma($mstrg)) {\n\t \t$marr = explode(\",,\", $mstrg);\n\t }\n\t\treturn $marr;\n\t}", "public function asArray();", "public function asArray();", "public function asArray();", "public function asArray();", "public function asArray();", "public function asArray();", "function getArrayFromList($string) {\n\t\t$i = 0;\n\t\t#remove all leading and trailing spaces\n\t\t$string = trim($string);\n\t\t#find the first ocurrence of a comma\n\t\t$pos = strpos($string, \",\");\n\t\twhile(!($pos === false)) {\n\t\t\t#set the new starting position\n\t\t\t$firstpos = $pos + 1;\n\t\t\t#if the string is in the second position, set the first array value\n\t\t\t$lastpos = $pos;\n\t\t\t$array[$i] = substr($string, 0, $lastpos);\t\t\n\t\t\t#reduce the string to start from the new starting position. $firstpos\n\t\t\t$string = substr($string, $firstpos);\t\t\n\t\t\t$string = trim($string);\n\t\t\t#locate the first occurence of a comma in the string\n\t\t\t$pos = strpos($string, \",\");\n\t\t\t$i++;\n\t\n\t\t}\n\t\t$array[$i] = $string;\n\t\treturn $array;\n\t}", "function deCadenaToArrayOpcionesCarrito( $string ){\n\t\t$options = array();\n\t\t$temp = explode('{',$string);\n\t\tfor( $i=1 ; $i<count($temp); $i++ ){\n\t\t\t$k = explode('}',$temp[$i]);\n\t\t\t$options[(int)$temp[$i]] = end($k);\n\t\t}\n\t\treturn $options;\n\t}", "public static function convertStringToArray($str, $seperator = ',')\n {\n return self::removeEmptyItems(explode($seperator, $str), function ($param) {\n return self::trimQuots($param);\n });\n }", "private function mapStringToArray($results)\n {\n return is_array($results) ? $results : array($results);\n }", "public function convertExtraToArray( $string ) {\n\t\tif( !$string )\n\t\t{\n\t\t\treturn array();\n\t\t}\n\t\t\n\t\t$_temp = array();\n\t\t\n\t\tif( $string == '#show_roles#' )\n\t\t{\n\t\t\t$roles = Yii::app()->authManager->getRoles();\n\t\t\tif( count($roles) )\n\t\t\t{\n\t\t\t\tforeach( $roles as $role )\n\t\t\t\t{\n\t\t\t\t\t$_temp[ $role->name ] = $role->name;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$exploded = explode(\"\\n\", $string);\n\n\t\t\tif( count($exploded) )\n\t\t\t{\n\t\t\t\tforeach( $exploded as $explode )\n\t\t\t\t{\n\t\t\t\t\tlist($key, $value) = explode('=', $explode);\n\t\t\t\t\t$_temp[$key] = $value;\n\t\t\t\t}\n\t\t\t}\n\t\t}\t\n\t\t\n\t\treturn $_temp;\n\t}", "public function parse($string)\n {\n return [];\n }", "public function _parse_to_array($in) {\n\t\t$string = str_replace(' ', '', trim($in));\n\t\t\n\t\tif ( ! empty($string)) {\n\t\t\treturn (array) explode('|', $string);\n\t\t}\n\t\telse {\n\t\t\treturn array();\n\t\t}\n\t}", "abstract public function data2Array($data);", "private function loadFromString($input) {\n\t//--\n\t$lines = explode(\"\\n\", (string)$input);\n\t//--\n\tforeach($lines as $k => $v) {\n\t\t$lines[$k] = (string) rtrim((string)$v, \"\\r\");\n\t} //end foreach\n\t//--\n\treturn (array) $lines;\n\t//--\n}", "public function readArrayOfString()\n {\n return $this->arrayWalk($this->readArray(), function(&$value)\n {\n $value = (string) $value;\n });\n }", "function answersArray($strInput)\t{\n\t\t$strLine=explode(chr(10),$strInput);\n\t\tforeach($strLine as $intKey => $strLineValue)\t{\n\t\t\t$strValue = explode('|',$strLineValue);\n\t\t\t$arrOutput[$intKey+1]=trim($strValue[0]);\n\t\t}\n\t\treturn $arrOutput;\n\t}", "function mbStringToArray($string) {\n $strlen = mb_strlen($string);\n while ($strlen) {\n $array[] = mb_substr($string, 0, 1, \"UTF-8\");\n $string = mb_substr($string, 1, $strlen, \"UTF-8\");\n $strlen = mb_strlen($string);\n }\n return $array;\n}", "public static function stringToArray($str)\n {\n $parsed = [];\n $addresses = explode(',', $str);\n\n foreach ($addresses as $address) {\n $split = explode(' <', trim($address));\n\n if (trim($split[0]) === '') {\n continue;\n }\n\n if (!empty($split[1])) { // eg. John Doe <[email protected]>\n $name = trim($split[0]);\n $addr = trim(rtrim($split[1], '>'));\n } else { // eg. [email protected]\n $name = null;\n $addr = trim($split[0]);\n }\n\n $parsed[$addr] = $name;\n }\n\n return $parsed;\n }", "public function jsonToArray( $string )\n {\n return json_decode( $string, true );\n }", "public static function emailListStringToArray ($string, $allowSpace = true)\r\n\t{\r\n\t\t# Determine the match\r\n\t\t$match = ($allowSpace ? \",\\s?\" : ',');\r\n\t\t\r\n\t\t# Split\r\n\t\t#!# NB This will catch addresses that contain a comma or semi-colon, but those should be very rare even if they are allowed in the RFC!\r\n\t\t$addresses = preg_split (\"/{$match}/\", trim ($string), NULL, PREG_SPLIT_NO_EMPTY);\r\n\t\t\r\n\t\t# Return the array\r\n\t\treturn $addresses;\r\n\t}", "public function unserialize($string)\n {\n $result = array();\n parse_str($string, $result);\n\n return $result;\n }", "public function decode(string $row): array\n {\n return [$row];\n }", "function arrayLetras($texto){\n $texto = strtolower($texto); \n return str_split($texto);\n}", "abstract public function to_array();", "public static function scsv_to_array( $string, bool $to_json = false ) {\n\t\t\t$string = stripslashes( $string );\n\n\t\t\t$lines = array_map( 'trim', preg_split( '/(\\r\\n|\\r|\\n)/', $string ) );\n\n\t\t\tif ( count( $lines ) === 0 ) {\n\t\t\t\treturn array();\n\t\t\t}\n\n\t\t\t// Removes null items.\n\t\t\t$keys = array_map( 'trim', str_getcsv( $lines[0] ) );\n\t\t\t$ideal_length = count( $keys );\n\n\t\t\t// Removes elements that do not have the correct number of parameters (though it's OK if they're blank, long as there's enough?).\n\t\t\t$data = array();\n\t\t\tforeach ( array_slice( $lines, 1 ) as $line ) {\n\t\t\t\t$s = str_getcsv( $line );\n\t\t\t\tif ( count( $s ) === $ideal_length ) {\n\t\t\t\t\tarray_push( $data, $s );\n\t\t\t\t} elseif ( count( $s ) > $ideal_length ) { // Helpful in case of trailing commas.\n\t\t\t\t\tarray_push( $data, array_slice( $s, 0, $ideal_length ) );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Maps values to the keys.\n\t\t\t$output = array();\n\t\t\tfor ( $i = 0; $i < count( $data ); $i++ ) {\n\t\t\t\t array_push( $output, array_combine( $keys, array_map( 'trim', $data[ $i ] ) ) ); // Default delineator is ','.\n\t\t\t}\n\n\t\t\tif ( true === $to_json ) {\n\t\t\t\treturn wp_json_encode( $lines );\n\t\t\t}\n\n\t\t\treturn $output;\n\n\t\t}", "public static function unpackStringToArray($format, $str)\n {\n return array_values(unpack($format, $str));\n }", "public function toArray() {\r\n return preg_split(\"/\\r?\\n/\", $this->contents);\r\n }", "public function __invoke(string $value) : array\n {\n if ($value !== '') {\n return $this->parseRawValue($value);\n }\n return [];\n }", "public function urlarray($string = '') {\n $a = explode('/', strtolower($string));\n $array = array();\n $key = '';\n foreach($a as $k => $v){\n if($k % 2 == 0){\n $key = $v;\n } else {\n $array[$key] = $v;\n }\n }\n return $array;\n }", "public function AsArray();", "function pg_array_parse($array, $asText = true) {\n $s = $array;\n if ($asText) {\n $s = str_replace(\"{\", \"array('\", $s);\n $s = str_replace(\"}\", \"')\", $s); \n $s = str_replace(\",\", \"','\", $s); \n } else {\n $s = str_replace(\"{\", \"array(\", $s);\n $s = str_replace(\"}\", \")\", $s);\n }\n\t$ss = \"\\$retval = $s;\";\n eval($ss);\n\treturn $retval;\n}", "public function format_text_to_array ($text){\n return preg_split('/\\s*\\R\\s*/', trim($text), NULL, PREG_SPLIT_NO_EMPTY);\n }", "public function parse($input) {\n\t//--\n\treturn (array) $this->loadWithSource((array)$this->loadFromString((string)$input));\n\t//--\n}", "function parseBISArray($str) {\n $str = substr($str, 1, -1); // Strip trailing quotes\n $bla = parseBISArray_helper($str);\n $result = array();\n\n foreach ($bla as $row) {\n foreach ($row as $child) {\n $result[] = $child;\n }\n if (count($row) == 0)\n $result[] = array();\n }\n //var_dump($result);\n return $result;\n}", "function parse_response_array($string) {\n $response_string_array = explode(\"&\", $string);\n\n $proper_array = array();\n\n foreach ($response_string_array as $value) {\n list($key, $val) = explode(\"=\", $value);\n\n $val = urldecode($val);\n\n $proper_array[\"$key\"] = $val;\n }\n unset($key);\n unset($val);\n\n return $proper_array;\n }", "public static function parse(string $number): array\r\n {\r\n return Parse::extract($number);\r\n }", "final public function camelCaseToArray($string)\n {\n return explode(\" \", \n trim(\n preg_replace('/([A-Z])/', ' $1', $string)\n )\n );\n }", "function getFormattedDataArray($str) {\n $replaced_str = str_replace(\"\\,\", \"&888;\", $str);\n $data_array = explode(\"\\n\", $replaced_str);\n array_pop($data_array);\n return $data_array;\n }", "function var2array($var,$needle=false)\n{\n\tif (empty($var)) return false;\n\tif (!is_array($var))\n\t{\n\t\t$var=$needle?explode($needle,$var):array($var);\n\t}\n\treturn $var;\n}", "public static function parseString(string $string): array\n {\n $e = 0;\n $q1 = false;\n $q2 = false;\n $q = false;\n $a = [];\n $f = '';\n for ($i = 0; $i < strlen($string); $i++) {\n $c = $string[$i];\n if ($c === '\\\\') {\n $e++;\n }\n if ($e % 2 == 0) {\n if ($c === \"'\" && !$q2) {\n $q1 = !$q1;\n $q = true;\n } elseif ($c === '\"' && !$q1) {\n $q2 = !$q2;\n $q = true;\n }\n }\n if (!$q) {\n if ($c === ' ' && !$q1 && !$q2 && $e % 2 == 0) {\n if (strlen($f) > 0) $a[] = $f;\n $f = '';\n } else {\n if ($c !== '\\\\' || $e % 2 === 0) {\n $f .= $c;\n }\n }\n }\n if ($c !== '\\\\') {\n $e = 0;\n }\n $q = false;\n }\n if (strlen($f) > 0) $a[] = $f;\n return $a;\n }", "private function header2Array($str)\n {\n if (is_array($str)) return $str;\n \n $result = [];\n $array = explode(\"\\n\", trim(str_replace(\"\\r\\n\", \"\\n\", $str), \"\\n\"));\n foreach($array as $i => $line) {\n if ($i === 0) {\n $result['Http-Status'] = $line; // \"HTTP/1.1 200 OK\"\n } else {\n $header = explode(':', $line, 2);\n if (!$header[0]) continue;\n \n if (isset($header[1])) {\n $result[trim($header[0])] = trim($header[1]);\n } else {\n $result[] = trim($header[0]);\n }\n }\n }\n return $result;\n }", "public function decode(string $content): array;", "private function str2charArray($str) {\n\t\treturn preg_split('//u', $str, -1, PREG_SPLIT_NO_EMPTY);\n\t}", "public static function to_arr( $str, $sep = ',' ) {\n\t\t$parts = explode( $sep, trim( $str ) );\n\n\t\treturn empty( $parts ) ? false : $parts;\n\t}", "public function parse(string $str): ?array;", "function stringToClassArray($coursesString='')\n\t{\n\t\t$array = array();\n\t\t$courses = explode(\";\", $coursesString);\n\t\tforeach ($courses as $key => $course) {\n\t\t\t$course = explode(\" \", $course);\n\t\t\tarray_push($array, $course);\n\t\t}\n\t\treturn $array;\n\t}", "static function pathToArray($path)\n {\n return explode('/', $path);\n }", "abstract protected function toArray();", "private function strToArray($email)\n {\n if( is_array($email) ) {\n return $this->cleanEmail($email);\n }\n else {\n \n $rcpt_break = explode(',', $email);\n \n if( count($rcpt_break) > 0 )\n return $this->cleanEmail($rcpt_break);\n else\n return $this->cleanEmail(array($email));\n }\n }", "public function decode(string $source): array;", "protected function xml2array($xmlstring){\n\t\t$xml = simplexml_load_string($xmlstring, \"SimpleXMLElement\", LIBXML_NOCDATA);\n\t\t$jsonData = json_encode($xml);\n\t\treturn json_decode($jsonData, true);\n\t}", "public function stringDateToArray($str)\n {\n $pos=strpos($str, \" \");\n $str1=substr($str, 0,$pos);\n $str2=substr($str, $pos+1);\n $arraydate=explode(\":\", $str1);\n $arrayHour=explode(\":\",$str2);\n return array(\"day\"=>$arraydate[2],\"month\"=>$arraydate[1],\"year\"=>$arraydate[0],\n \"hour\"=>$arrayHour[0],\"minute\"=>$arrayHour[1],\"second\"=>$arrayHour[2]);\n }", "function initTriArray($tri_str)\n{\n\t$tri_A = explode(\"\\n\",$tri_str);\n\tfor($i = 0; $i < count($tri_A); ++$i)\n\t{\n\t\t$tri_A[$i] = explode(\" \",$tri_A[$i]); \n\n\t}\n\treturn $tri_A;\n}", "public abstract function toArray(): array;", "public static function convertStringToArray($string, $delimiter)\n {\n if(empty($string) && empty($delimiter)){\n return array();\n }\n return explode($delimiter, $string);\n }", "private static function breakDownStringLinesIntoArray(string $string): array\n {\n $temp = str_replace(\"\\r\", \"\\n\", str_replace(\"\\r\\n\", \"\\n\", $string));\n return array_filter(explode(\"\\n\", $temp));\n }", "function sizesToArray($string){\n $sizesArray = explode(',',$string);\n $returnArray = array();\n foreach($sizesArray as $size){\n $s =explode(':',$size);\n $returnArray[] = array('size'=> $s[0], 'price' => $s[1],'quantity' => $s[2],'threshold' => $s[3]);\n }\n return $returnArray;\n}", "function toArray();", "function convert_basic_array($string, $delimitor, $separator)\n{\n\t$the_array = array();\n\t$row = explode($delimitor, $string);\n\tforeach($row AS $item)\n\t{\n\t\t$the_value = htmlentities(trim(strstr($item, $separator), $separator));\n\t\t\n\t\t$check_array = explode('**',$the_value);\n\t\tif(in_array('drillevent', $check_array))\n\t\t{\n\t\t\t$check_array[array_search('drillevent',$check_array)] = 'drillevent=';\n\t\t\t$the_value = implode('**', $check_array);\n\t\t}\n\t\t\n\t\tif($the_value == '_')\n\t\t{\n\t\t\t$the_value = '';\n\t\t}\n\t\t\n\t\t$the_array[strstr($item, $separator, TRUE)] = $the_value;\n\t}\n\t\n\treturn $the_array;\n}", "function csvToArray($string, $iconv = true) {\n if ($iconv)\n $string = iconv(\"Windows-1251\", \"UTF-8\", $string);\n\n $rows = explode(\"\\r\\n\", $string);\n\n $res = [];\n\n foreach ($rows as $row) {\n $cols = explode(\";\", $row);\n if (count($cols) < 1 || trim($cols[0]) == '') continue;\n $res[] = $cols;\n }\n\n return $res;\n}", "function toArray() ;", "function toArray() ;", "public function getStringArray() {\n // explicit type cast just to be sure\n return (array) $this->stringArray;\n }", "public function lines2Array($content) {\t\t\n\t\ttry {\n\t\t\t$content = str_replace(\"\\r\\n\", \"\\n\", $content);\n\t\t\t$content = str_replace(\"\\r\", \"\\n\", $content);\n\t\t\t$content = explode(\"\\n\", $content); // turn string to array\n\t\t\tarray_pop($content); // remove last element since it is empty\n\t\t\treturn $content;\n\t\t} catch (Exception $e) { \n\t\t\tthrow new Exception($e->getMessage().' from '.$this->className.'->'.\n\t\t\t\t__FUNCTION__.'() line '.__LINE__\n\t\t\t);\n\t\t} //<-- end try -->\n\t}", "public function queryToArray()\n {\n $array = [];\n parse_str($this->query, $array);\n\n return $array;\n }", "public static function multiLineStringToArray($string) {\n return preg_split(\"/\\r?\\n/\", $string);\n }", "public function toArray();", "public function toArray();" ]
[ "0.8070862", "0.76748294", "0.7582464", "0.72777915", "0.7195512", "0.71753603", "0.7135239", "0.70819545", "0.7065605", "0.70300955", "0.7004356", "0.69863164", "0.6976146", "0.68872607", "0.68221706", "0.6794402", "0.6775068", "0.6587414", "0.6580209", "0.6525866", "0.65237576", "0.6515297", "0.6502182", "0.6456478", "0.64400053", "0.63665605", "0.6359625", "0.63564736", "0.6304469", "0.6272497", "0.62635237", "0.626024", "0.626024", "0.626024", "0.626024", "0.626024", "0.626024", "0.62141126", "0.62111104", "0.6208638", "0.6202979", "0.6171803", "0.61451805", "0.61410695", "0.6124944", "0.6105899", "0.6066147", "0.6053829", "0.60424036", "0.60406035", "0.6034002", "0.6031468", "0.59967214", "0.597437", "0.5971708", "0.59655946", "0.5962494", "0.5958635", "0.59522265", "0.5904159", "0.5903731", "0.58844495", "0.58836657", "0.58834136", "0.5861489", "0.5859277", "0.58481294", "0.5838596", "0.5837128", "0.5833506", "0.5829727", "0.582657", "0.5825002", "0.58238035", "0.5806507", "0.5806404", "0.5805969", "0.57804084", "0.5766186", "0.5765881", "0.57588804", "0.57410717", "0.57329077", "0.57327914", "0.5725356", "0.5724409", "0.5718854", "0.57167166", "0.57160914", "0.57038945", "0.5696635", "0.56902254", "0.566847", "0.566847", "0.5667058", "0.56621575", "0.56602633", "0.5657119", "0.5646226", "0.5646226" ]
0.58686066
64
Transforms an array into a string
public function reverseTransform($valueAsArray) { if (empty($valueAsArray)) { $valueAsArray = []; } if (!is_array($valueAsArray)) { $valueAsArray = [$valueAsArray]; } return serialize($valueAsArray); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function array_to_string(array $array): string\n {\n return '[' . implode(', ', array_map(function ($v): string {\n if (is_array($v) || is_bool($v) || !is_stringable($v)) {\n throw new LogicException('Cannot convert array to string, some values are not stringable');\n }\n\n return '\\'' . $v . '\\'';\n }, $array)) . ']';\n }", "protected function array_to_string($array) \n\t{\n\t\t$str = '';\n\t\tforeach ($array as $item) {\n\t\t\t$str .= $item . '\\n';\n\t\t}\n\n\t\treturn $str;\n\t}", "function arrayToString($array) {\n\t\t$array_temp = array();\n\t\tfor($x=0;$x<sizeof($array);$x++) {\n\t\t\t$array_temp[$x] = \"'\".$array[$x].\"'\";\n\t\t}\n\t\t$string = \"(\".implode(\",\", $array_temp).\")\";\n\t\treturn $string;\n\t}", "private function ArrayToString ($array)\n {\n $str = null;\n if (is_array($array))\n foreach ($array as $valore) {\n if(is_string($valore))\n $str = $str.\"-\".$valore;\n else{$str=$str.\"\\n\".$valore->__toString();}\n }\n else\n $str = $array;\n return $str;\n }", "function array_to_string($array){\n $joined_string=\"\";\n for($count=0;$count<count($array);$count++){\n \n if($count!=count($array)-1){\n $joined_string.= $array[$count].'|';\n }\n else{\n $joined_string.=$array[$count];\n }\n }\n return $joined_string;\n }", "function arrayToString($array)\n\t{\n\t\t$string = \"\";\n\t\tforeach($array as $row)\n\t\t{\n\t\t\tif(gettype($row) == \"array\")\n\t\t\t{\n\t\t\t\t$string .= arrayToString($row);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$string .= $row.\" \";\n\t\t\t}\n\t\t}\n\t\treturn $string;\n\t}", "private function arrayToString($array)\r\n {\r\n return var_export($array, true);\r\n }", "function array_tostring($array){\n\t$string = '';\n\tforeach($array as $value){\n\t\tif ($string != ''){\n\t\t\t$string .= ',';\n\t\t}\n\t\t$string .= $value;\n\t}\n\treturn $string;\n}", "public function array_to_string($array)\n {\n $string = \"\";\n for ($i=0; $i < count($array); $i++) {\n if ($i < count($array) - 1) {\n $string .= '\"'.$array[$i].'\",';\n } else {\n $string .= '\"'.$array[$i].'\"';\n }\n }\n\n return $string;\n }", "public static function stringifyArray(array $array);", "function makestring($array)\r\n {\r\n $outval = '';\r\n if (is_array($array)) {\r\n foreach($array as $key=>$value)\r\n {\r\n if(is_array($value))\r\n {\r\n $outval = makestring($value);\r\n }\r\n else\r\n {\r\n $outval = $value;\r\n }\r\n }\r\n}\r\n \r\n return $outval;\r\n }", "public function makeString($array)\r\n {\r\n $outval = '';\r\n foreach ($array as $key => $value) {\r\n if(is_array($value)) {\r\n $outval .= !is_numeric($key) ? \"$key\" : false;\r\n $outval .= $this->makestring($value);\r\n } else {\r\n $outval .= (string) $key .\": \".$value .\"\\n\";\r\n }\r\n }\r\n\r\n return $outval;\r\n }", "public function toString(array $data): string;", "private function array_to_string($arr)\n {\n $line = [];\n foreach ($arr as $v) {\n $line[] = is_array($v) ? self::array_to_string($v) : $this->sanitize($v);\n }\n return implode($line);\n }", "public static function arrayToString(array $arr) : string\n\t{\n\t\treturn implode('', array_map('strval', $arr));\n\t}", "function array_to_string($array)\n{\n $str = '';\n if($array)\n foreach($array as $word) {\n $str .= $seporator . addslashes($word);\n $seporator = ',';\n }\n return $str;\n}", "Function ArrayToString($array){\n\t\t$array=array_values($array);\n\t\t$String=null;\n\t\t\n\t\tfor($x=0;$x<sizeof($array);$x++){\t\t\t\n\t\t\tif(Strlen($array[$x])>0){\n\t\t\t\tif(Strlen($String)>0){\n\t\t\t\t\t$String=$String.','.$array[$x];\n\t\t\t\t}else{\n\t\t\t\t $String=$array[$x];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t return $String;\n\t}", "private function arrayToString($array){\n\t\t$i = 0;\n\t\t$string = '';\n\t\tforeach ($array as $value) {\n\t\t\tif ($i > 0) $string .= ', ';\n\t\t\tif (preg_match('#', $value)){\n\t\t\t\t$string .= str_replace('#', '', $value);\n\t\t\t}else{\n\t\t\t\t$string .= \"'\".$value.\"'\";\n\t\t\t}\n\t\t\t$i++;\n\t\t}\n\t\treturn $string;\n\t}", "function convertArrayIntoString($array) {\n foreach ($array as $value)\n $string .= \"'$value,'\";\n $string = trim($string, ',');\n return $string;\n}", "function arraytostring($array){\r\n\t$text = \"array(\";\r\n\t$x = 0;\r\n\t$count = count($array);\r\n\tforeach ($array as $key => $value) {\r\n\t\t$x++;\r\n\t\tif (is_array($value)) {\r\n\t\t\t$text .= $key.\"=>\".arraytostring($value);\r\n\t\t\tif ($count != $x) $text .= \",\";\r\n\t\t\tcontinue;\r\n\t\t}\r\n\t\t$text .= \"\\\"$key\\\"=>\\\"$value\\\"\";\r\n\t\tif ($count != $x) $text .= \",\";\r\n\t}\r\n\t$text .= \")\";\r\n\treturn $text;\r\n}", "function content_array_to_string($array){\n $joined_string=\"\";\n for($count=0;$count<count($array);$count++){\n \n if($count!=count($array)-1){\n $joined_string.= $array[$count].'/';\n }\n else{\n $joined_string.=$array[$count];\n }\n }\n return $joined_string;\n }", "function ArrayToString ($array,$new_array=array()) {\n\t$num = count($array);\n\tfor ($i=0; $i<=$num; $i++){\n\t\tif (isset($array[$i]['name']) && $array[$i]['name'] != '') //multi-array\n\t\t\tarray_push($new_array, $array[$i]['name']);\n\t\telse if ($array['youtube'][0]['source'] != '' && !in_array($array['youtube'][0]['source'], $new_array)) //trailer\n\t\t\tarray_push($new_array, $array['youtube'][0]['source']);\n\t}\n\treturn implode(',', $new_array);\n}", "function arrayToString($p) {\n $p2 = __t($p)->map(function($arr){return implode($arr);});\n return $p2();\n }", "function array2string($array, $default = false){\n\tif(!is_array($array))\n\t\treturn $default; \n\t$str = ''; \n\t$len = count($array);\n\t\n\t$j = $len; \n\tif($len >= 1 || ($len == 0 && $default == false)){\n\t\tforeach($array as $obj){\n\t\t\tif(is_object($obj))\n\t\t\t\t$class = get_class($obj);\n\t\t\telse \n\t\t\t\t$class = '';\n\t\t\t$isTable = false; \n\t\t\tif($class)\n\t\t\t\t$isTable = is_subclass_of($obj, 'Table');\n\t\t\t\n\t\t\t$j--; \n\t\t\t\n\t\t\tif($j > 0)\n\t\t\t\t$str = $str . ($isTable ? $obj->link() : $obj) . ($len > 2 ? ', ' : ' ');\n\t\t\telse\n\t\t\t\t$str = $str . ($len > 1 ? 'and ' : '') . ($isTable ? $obj->link() : $obj);\n\t\t\t\n\t\t}\n\t}else{\n\t\t$str = $default; \n\t}\n\t\n\treturn $str; \n }", "public function format_array_to_text($array){\n return implode(\"\\n\", $array);\n }", "public function _convertArrayToString(array $arr)\n {\n $str = '[';\n foreach ($arr as $k => $v) {\n $str .= $k.'=>';\n if (is_string($v)) {\n $str .= '\"'.$v.'\"';\n } else {\n $str .= $this->_convertTypeToString($v, true);\n }\n }\n $str .= ']';\n return $str;\n }", "public function arraytostring($array,$delimitatore=','){\n\t\treturn implode($delimitatore,$array);\n\t}", "public static function __arrayToString(array $arr)\n\t{\n\t\t$str = '';\n\n\t\tforeach($arr as $k => $v)\n\t\t{\n\t\t\t$str .= $k . ':';\n\n\t\t\tif(is_string($v))\n\t\t\t{\n\t\t\t\t$str .= $v . ', ';\n\t\t\t}\n\t\t\telse if(is_array($v))\n\t\t\t{\n\t\t\t\t$str .= '[' . self::__arrayToString($v) . '], ';\n\t\t\t}\n\t\t}\n\n\t\t$str = rtrim($str, ', ');\n\n\t\treturn $str;\n\t}", "public function convertMeToString($glue,$arr){\n return implode($glue , $arr);\n}", "function arg_array_to_str($arg_array){\r\n \r\n $arg_str = '';\r\n \r\n foreach($arg_array as $arg)\r\n {\r\n $arg_str .= \"$arg,\";\r\n }\r\n \r\n \r\n \r\n return substr($arg_str,0,-1); //eg 'x,y,z' -- substr() cuts off the trailing comma\r\n }", "public function array2str($value): string\n {\n if (\\is_string($value)) {\n return $value;\n }\n\n $new_array = [];\n\n foreach ($value as $item) {\n $item = str_replace('%', '%25', $item);\n $item = str_replace(',', '%2C', $item);\n $new_array[] = $item;\n }\n\n return implode(',', $new_array);\n }", "protected function errorArrayToString($array) \n\t{\n\t\t$str = '';\n\t\tforeach ($array as $item) {\n\t\t\t$str .= $item . '\\n';\n\t\t}\n\n\t\treturn $str;\n\t}", "function array_to_string($array, $splitter = ', ', $lastSplitter = ' and ', $prefix = '', $suffix = '')\n {\n $string = implode($splitter, $array);\n $string = str_replace($splitter . last($array), $lastSplitter . last($array), $string);\n\n return $prefix . $string . $suffix;\n }", "public static function convert_multi_array($array) {\n return implode(\"&\",array_map(function($a) {return implode(\"~\",$a);},$array));\n }", "function arrayToString($arrayData, $separator)\n{\n\tif (!is_array($arrayData)) {\n\t\treturn false;\n\t}\n\n\t$arrayDataString = '';\n\tforeach ($arrayData as $value) {\n\t\t$arrayDataString .= $value.$separator;\n\t}\n\n\t//remove the trailing separator\n\t$arrayDataString = substr($arrayDataString, 0, (strlen(trim($arrayDataString)))-1);\n\n\treturn $arrayDataString;\n}", "function compress_array($array) {\n if (!is_array($array)) {\n return quote($array);\n }\n $strings=array();\n foreach ($array as $ind => $val) {\n $strings[]=quote($ind).\"=>\".\n (is_array($val)?compress_array($val):quote($val));\n }\n return \"array(\".implode(\",\",$strings).\")\";\n}", "public static function arrayToCsv(array $data): string {\n return count($data) > 0 ? implode(',', $data) : '';\n }", "public function toString()\n {\n return Str(json_encode($this->array));\n }", "private function array2string($myArray)\n\t{\n\t\t$string = \"\";\n\t\tforeach ($myArray as $key => $value)\n\t\t{\n\t\t\t\t$string.= $key.\"=\".$value .\"&\";\n\t\t}\n\t\treturn rtrim($string,\"&\");\n\t}", "public static function encode($array)\n {\n\n // determine type\n if(is_numeric(key($array))) {\n\n // indexed (list)\n $output = '[';\n for($i = 0, $last = (sizeof($array) - 1); isset($array[$i]); ++$i) {\n if(is_array($array[$i])) $output .= self::encode($array[$i]);\n else $output .= self::_val($array[$i]);\n if($i !== $last) $output .= ',';\n }\n $output .= ']';\n\n } else {\n\n // associative (object)\n $output = '{';\n $last = sizeof($array) - 1;\n $i = 0;\n foreach($array as $key => $value) {\n $output .= '\"'.$key.'\":';\n if(is_array($value)) $output .= self::encode($value);\n else $output .= self::_val($value);\n if($i !== $last) $output .= ',';\n ++$i;\n }\n $output .= '}';\n\n }\n\n // return\n return $output;\n\n }", "public function transform($array) {\n//\t\t\tld(\"transform\");\n//\t\t\tld(json_encode($array));\n\t\t\treturn json_encode($array);\n\t\t}", "function _serialize($array)\n\t{\n\t\tif(!is_array($array))\n\t\t{\n\t\t\treturn '';\n\t\t}\n\t\t$str = '';\n\t\tforeach($array as $var => $value)\n\t\t{\n\t\t\tif($str)\n\t\t\t{\n\t\t\t\t$str .= '|';\n\t\t\t}\n\t\t\t$str .= $var . '=' . str_replace('|', '', $value);\n\t\t}\n\t\treturn $str;\n\t}", "public function encode(array $data): string;", "private function formatArrayValues(array $data): string\n {\n return implode(\n ', ',\n array_map(\n function ($value) {\n return '\"'.$value.'\"';\n },\n $data\n )\n );\n }", "function changeArrayToString($data) {\n\t\t$str = '';\n\t\tforeach($data as $value)\n\t\t{\n\t\t\tif(empty($str))\n\t\t\t\t$str = '\"'.trim(strip_tags($value)).'\"';\n\t\t\telse\n\t\t\t\t$str .=' ,\"'.trim(strip_tags($value)).'\"';\n\t\t}\n\t\treturn $str;\n\t}", "function array2csv(array $array) {\n\t$lines = array();\n\tforeach ( $array as $val ) {\n\t\t$lines[] = is_array($val) ? array2csv($val) : '\"' . str_replace('\"', '\"\"', $val) . '\"';\n\t}\n\treturn implode(\",\", $lines);\n}", "function convertArrayObjectToString($array = [], $field = 'name', $implode = ',') {\n $convert = [];\n foreach ($array as $item) {\n array_push($convert, $item->{$field});\n }\n return implode($implode, $convert);\n}", "private function arrayValuesToString(array $array)\n\t{\n\t\tforeach ($array as $key => $value) {\n\t\t\tif (!is_scalar($value)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$array[$key] = (string) $value;\n\t\t}\n\n\t\treturn $array;\n\t}", "private function stringify(array $data): string\n {\n return str_replace('\"', '\\'', json_encode($data));\n }", "public static function encode($array);", "public static function toString(array $array, $inner_glue = '=', $outer_glue = ' ', $keepOuterKey = false)\n {\n \t$output = array();\n \n \tforeach ($array as $key => $item)\n \t{\n \t\tif (is_array($item))\n \t\t{\n \t\t\tif ($keepOuterKey)\n \t\t\t{\n \t\t\t\t$output[] = $key;\n \t\t\t}\n \n \t\t\t// This is value is an array, go and do it again!\n \t\t\t$output[] = self::toString($item, $inner_glue, $outer_glue, $keepOuterKey);\n \t\t}\n \t\telse\n \t\t{\n \t\t\t$output[] = $key . $inner_glue . '\"' . $item . '\"';\n \t\t}\n \t}\n \n \treturn implode($outer_glue, $output);\n }", "protected static function convertToString(array $byteArray)\n {\n // Convert the bytes to a string\n $string = '';\n foreach ($byteArray as $byte)\n {\n $string .= chr($byte);\n }\n\n return $string;\n }", "function arrayToSQLString ($arr) {\r\n $sql = \"\";\r\n foreach ($arr as $key => $value) {\r\n $sql = $sql . $value . ',';\r\n }\r\n $sql = rtrim($sql,',');\r\n return $sql;\r\n}", "private function arrayAssocToString($array){\n\t\t$i = 0;\n\t\t$string = '';\n\t\tforeach ($array as $key => $value) {\n\t\t\tif ($i > 0) $string .= ', ';\n\t\t\tif (preg_match('#', $value)){\n\t\t\t\t$string .= str_replace('#', '', $value);\n\t\t\t}else{\n\t\t\t\t$string .= $key .\"='\".$value.\"'\";\n\t\t\t}\n\t\t\t$i++;\n\t\t}\n\t\treturn $string;\n\t}", "public static function arrayToString(array $arr)\n {\n $pieces = [];\n\n foreach ($arr as $email => $name) {\n $pieces[] = $name ? sprintf('%s <%s>', trim($name), trim($email)) : trim($email);\n }\n\n return implode(', ', $pieces);\n }", "private static function array_to_string($jobs = array())\n\t{\n\t\t$string = implode(\"\\r\\n\", $jobs);\n\t\treturn $string;\n\t}", "private function array(array $value): string\n {\n if ($this->callable && is_callable($value)) {\n $class = ! is_string($value[0])\n ? $this->classname($value[0])\n : $value[0];\n\n $method = $value[1];\n\n return sprintf('function %s::%s()', $class, $method);\n }\n\n $slice = array_slice($value, 0, $this->arrlim, true);\n\n $elems = $this->isAssociative($slice)\n ? array_map([$this, 'arrayPair'], array_keys($slice), $slice)\n : array_map([$this, 'arrayValue'], $slice);\n\n return vsprintf('[%s%s]', [\n implode(', ', $elems),\n count($value) > $this->arrlim ? ', ...' : '',\n ]);\n }", "function implodeArray($array, $glue = ' = ') {\n $return = $array;\n if (is_array($array)) {\n $return = '';\n foreach ($array as $key => $value) {\n if ($return != '') {\n $return .= PHP_EOL;\n }\n $return .= $key . $glue . $value;\n }\n }\n return $return;\n}", "function stringify_array ($array_obj, $value_separator)\n{\n\tif(is_array($array_obj))\n\t{\n\t\tforeach($array_obj as $val)\n\t\t{\n\t\t\tif(is_array($val))\n\t\t\t{\n\t\t\t\t$value_separator .= stringify_array($val, $value_separator);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$value_separator .= $val. \"|\";\n\t\t\t}\n \t\n\t\t}\n\t\treturn $value_separator;\n\t}\n\telse\n\t{\n\t\treturn $value_separator = \"ERROR : $array_obj is not an array\";\n\t}\n}", "public static function arrayToString($s)\n {\n return implode(', ', $s);\n }", "protected function mail_string($array) {\n return array_map(function ($el) use ($array) {\n return ($array[$el] ? \"$array[$el] \": \"\") .\"<$el>\";\n }, array_keys($array));\n }", "function ar_to_string($ar, $tab = 1) {\n\n\t\t$str = \"\";\n\t\t$tabs = \"\";\n\n\t\tfor ($x = 0; $x < $tab; $x++)\n\t\t\t$tabs .= \"\\t\";\n\n\t\tforeach ($ar as $key => $val) {\n\t\t\tif (is_array($ar[$key]))\n\t\t\t\t$str .= ar_to_string($ar, ($tab + 1));\n\t\t\telse\n\t\t\t\t$str = \"{$tabs}{$key}\\t=>\\t{$val}\\n\";\n\t\t}\n\n\t\treturn $str;\n\t}", "private function formatArrayToString(array $map): string\n\t{\n\t\t$resultString = '';\n\t\tforeach ($map as $key => $value) {\n\t\t\ttry {\n\t\t\t\t$resultString .= \" [$key] => \";\n\t\t\t\tif (is_array($value)) {\n\t\t\t\t\t$resultString .= $this->formatArrayToString($value);\n\t\t\t\t} else {\n\t\t\t\t\t$resultString .= strip_tags($value, '<b><i><pre>');\n\t\t\t\t}\n\t\t\t} catch (Throwable $exception) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\t\treturn $resultString;\n\t}", "function d2d_implode($array) {\n if (!is_array($array)) {\n return FALSE;\n }\n $escaped_array = array();\n foreach ($array as $key => $value) {\n // escape separators and escape-character in $key\n $key = d2d_replace(array('\\\\', ',', '='), array('\\\\\\\\', '\\\\,', '\\\\='), $key);\n if ($key === FALSE) { // replacement failed\n return FALSE;\n }\n // encode $value\n $value = d2d_value_encode($value);\n // escape separators and escape-character in $value\n $value = d2d_replace(array('\\\\', ',', '='), array('\\\\\\\\', '\\\\,', '\\\\='), $value);\n if ($value === FALSE) { // replacement failed\n return FALSE;\n }\n $escaped_array[] = \"{$key}={$value}\";\n }\n return implode(',', $escaped_array);\n}", "public static function arrayToString(array $data)\n {\n $tmp = new \\SplTempFileObject;\n foreach ($data as $row) {\n $tmp->fputcsv($row, static::$delimiter);\n if (static::$lineEnding !== \"\\n\") {\n $tmp->fseek(-1, \\SEEK_CUR);\n $tmp->fwrite(static::$lineEnding);\n }\n }\n $length = $tmp->ftell();\n $tmp->fseek(0);\n\n return $tmp->fread($length);\n }", "function arrayIntoString_sql(array $arr)\n {\n $str = \"\";\n foreach ($arr as $k => $v) {\n $str .= (count($arr) - 1 != $k)\n ? \"'\". $v . \"', \"\n : \"'\". $v . \"'\";\n }\n return $str;\n }", "function BEncode($array)\n{\n\t$string = \"\";\n\tdecideEncode($array, $string);\n\treturn $string;\n}", "protected function formatArray(array $values){\n $r = ''; foreach($values as $val) $r.= (empty($r)?'':',').$val;\n return $r;\n }", "public function serializeAll(array $data): string;", "function compactToString($x) {\n $xout='';\n if( is_array($x) )\n foreach($x as $xx) $xout.= compactToString($xx);\n else $xout=$x;\n return $xout;\n}", "private function encode($array) {\n return json_encode($array);\n }", "function printArray($array){\n // will accept arrays of values or arrays of arrays\n\n $c = \"\"; // for the comma :)\n $o = \"\"; // the output\n\n foreach($array as $item){\n if (is_array($item)){\n $o .= $c . printArray($item);\n }\n else{\n $o .= $c . $item;\n }\n $c = ',';\n }\n \n $o = \"[\" . $o . \"]\";\n\n return $o;\n}", "private function arrayToString($jobs = array()) \n {\n $string = implode(\"\\r\\n\", $jobs);\n return $string;\n }", "function guifi_export_arraytojs($array){\n $output = '';\n foreach ($array as $key => $value){\n if ($output != ''){\n $output .= ',';\n }\n if (is_array($value)){\n $output .= $key.\":\";\n $output .= guifi_export_arraytojs($value);\n }else{\n if (is_numeric($value)){\n $output .= $key.\":\".$value;\n }else{\n $output .= $key.\":'\".$value.\"'\";\n }\n }\n }\n $output ='{'.$output.'}';\n return $output;\n}", "public function encode (array $arr);", "public function encodeItems(array $items): string;", "public function getArrayString()\n\t{\n\t\treturn $this->_array_string;\n\t}", "function JSONoutputString($array){\n\t\t return json_encode($array, JSON_PRETTY_PRINT|JSON_UNESCAPED_SLASHES|JSON_UNESCAPED_UNICODE);\n\t\t //return json_encode($array, 0);\n\t}", "function mf_implode_array_chuncks($input_array){\n\t\treturn implode('&', $input_array);\n\t}", "public static function implode( $array ) {\n\t\t\t$r = '';\n\t\t\tforeach ( $array as $key => $value ) {\n\t\t\t\t$r .= sprintf( '%s: %s ', $key, $value );\n\t\t\t}\n\n\t\t\treturn trim( $r );\n\t\t}", "function __str_array(array $_) {\n $__[0] = implode(\", \", $_);\n\n shuffle($_);\n\n# - ARRAY CONVERT STRING HASHTAG \n $__[1] = implode(' ,#', $_);\n\n return $__;\n}", "public function encode(array $payload): string;", "public function __toString() {\n $params = [];\n $str = '';\n foreach ($this->data as $x => $row) {\n $str .= '[ ';\n foreach ($row as $y => $value) {\n $str .= \"%s \";\n $params[] = $value;\n }\n $str .= \"]\\n\";\n }\n return vsprintf($str, $params);\n }", "private function getDataStr(array $data)\n {\n $output = array();\n $callback = function($value, $key) use (&$output)\n {\n if (strpos($value, ':') === 0) {\n $output[] = \"`{$key}` = {$value}\";\n }\n else {\n $output[] = \"`{$key}` = '{$value}'\";\n }\n\n };\n array_walk($data, $callback);\n return implode(', ', $output);\n }", "public static function printArray ($array)\r\n\t{\r\n\t\t# If the input is not an array, convert it\r\n\t\t$array = self::ensureArray ($array);\r\n\t\t\r\n\t\t# Loop through each item\r\n\t\t$hash = array ();\r\n\t\tforeach ($array as $key => $value) {\r\n\t\t\tif ($value === false) {$value = '0';}\r\n\t\t\t$hash[] = \"$key => $value\";\r\n\t\t}\r\n\t\t\r\n\t\t# Assemble the text as a single string\r\n\t\t$text = implode (\",\\n\", $hash);\r\n\t\t\r\n\t\t# Return the text\r\n\t\treturn $text;\r\n\t}", "public static function packArrayToString($format, &$arr)\n {\n $str = call_user_func_array(\"pack\", array_merge([$format], $arr));\n return $str;\n }", "public function toString()\n {\n // if array is set return json encoded array\n if (!empty($this->array))\n {\n return json_encode($this->array);\n }\n \n // array not set yet\n return false;\n }", "private static function arrayToStr($nvp)\r\n\t {\r\n\t\t $temp_str = '';\r\n\t\t if (!is_array($nvp)) return $nvp;\r\n\t\t foreach ($nvp as $key => $value)\r\n\t\t {\r\n\t\t\t $temp_str .= $key.'='.$value.'&';\r\n\t\t }\r\n\t\t return rtrim($temp_str , '&');\r\n\t }", "protected function array_to_xml_string( $array, $parent = null, $root = null ) {\n\t\t$return_string = false;\n\n\t\tif ( null === $parent ) {\n\t\t\t$return_string = true;\n\t\t\t$parent = $root = new DOMDocument();\n\t\t}\n\n\t\tif ( is_array( $array ) ) {\n\n\t\t\tforeach ( $array as $key => $value ) {\n\t\t\t\t$element = $root->createElement( $key );\n\t\t\t\t$parent->appendChild( $element );\n\n\t\t\t\tif ( is_array( $value ) ) {\n\t\t\t\t\tforeach ( $value as $child_key => $child_value ) {\n\t\t\t\t\t\t$child = $root->createElement( $child_key );\n\t\t\t\t\t\t$element->appendChild( $child );\n\t\t\t\t\t\t$child->appendChild( self::array_to_xml_string( $child_value, $child, $root ) );\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$element->appendChild(\n\t\t\t\t\t\t$root->createTextNode( $value )\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t$element = $root->createTextNode( $array );\n\t\t\t$parent->appendChild( $element );\n\t\t}\n\n\t\tif ( $return_string ) {\n\t\t\treturn $root->saveHTML();\n\t\t} else {\n\t\t\treturn $element;\n\t\t}\n\t}", "function getGeneratedStr($inputArr) {\n\t\n\t$outputArr = array();\n\tforeach($inputArr as $val) {\n\t\t$outputArr[] = getFizzBuzz($val); // get the generated value (Fizz, Buzz or the original value)\n\t}\n\t\n\treturn implode(' ', $outputArr);\n}", "public function toJSONString(){\n $this->buildArray();\n return json_encode($this->array);\n }", "function array_implode($glue, $separator, $array) {\r\n if (!is_array($array))\r\n return $array;\r\n $string = array();\r\n foreach ($array as $key => $val) {\r\n if (is_array($val))\r\n $val = implode(',', $val);\r\n $string[] = \"{$key}{$glue}{$val}\";\r\n }\r\n return implode($separator, $string);\r\n}", "private function arrayValue($val): string\n {\n return ! is_array($val)\n ? (string) new Printable($val, $this->callable, $this->strlim)\n : '[...]';\n }", "function encode($array)\n{\n $dumper = new Dumper();\n $res = $dumper->dump($array, 3);\n return $res;\n}", "function Array2Str($kvsep, $entrysep, $a){\n $str = \"\";\n foreach ($a as $k=>$v){\n $str .= \"{$k}{$kvsep}{$v}{$entrysep}\";\n }\n return $str;\n}", "function _stmtArrayToString($op, $stmtArray) {\n $str = '';\n if(count($stmtArray) > 0) {\n $str = ' '.$op.' '.implode(' '.$op.' ', $stmtArray);\n }\n return $str;\n }", "public function write($arr) {\n\t\t$str = \"\";\n\t\t$this->writeSegment($str, $arr);\n\t\treturn $str;\n\t}", "protected function implodeArray($arr) {\n $retStr = '';\n foreach($arr as $key => $value) {\n $retStr .= $key . ': ' . $value . ', ';\n }\n rtrim($retStr, ', ');\n return $retStr;\n }", "public function __toString()\n\t{\n\t\t$output = '';\n\n\t\tforeach (array_keys($this->data) as $key) {\n\t\t\tif (is_array($this->data[$key])) {\n\t\t\t\t$output .= implode(PHP_EOL, $this->data[$key]) . PHP_EOL;\n\t\t\t} else {\n\t\t\t\t$output .= $this->data[$key] . PHP_EOL;\n\t\t\t}\n\t\t}\n\n\t\treturn $output;\n\t}", "public function getMessagefromArray($array){\n\t\tunset($array[0]);\n\t\treturn implode(' ', $array);\n\t}", "public function encode (array $arr) {\n\t\treturn \\gimle\\common\\var_dump($arr, true, 'export', 'auto', $this->linkattrs);\n\t}" ]
[ "0.81836796", "0.8148658", "0.8083074", "0.8074224", "0.7984701", "0.7873323", "0.78633976", "0.78528845", "0.7801166", "0.77548766", "0.76868576", "0.76867723", "0.7669886", "0.7580637", "0.7563041", "0.75542665", "0.75409734", "0.75146675", "0.7453529", "0.7410906", "0.73878706", "0.7138488", "0.7125394", "0.71219856", "0.7089882", "0.70520294", "0.69472533", "0.6936786", "0.6911301", "0.690914", "0.6899458", "0.6877043", "0.6863768", "0.6859", "0.68173933", "0.6805735", "0.67923224", "0.6768302", "0.67619944", "0.6756834", "0.6747922", "0.6738857", "0.673716", "0.6726948", "0.6718137", "0.6705644", "0.66932255", "0.6683387", "0.66789335", "0.66767675", "0.66767", "0.6622427", "0.66153723", "0.6609461", "0.6591023", "0.6574031", "0.6515005", "0.6492761", "0.64787215", "0.64099616", "0.64066386", "0.6390366", "0.63651836", "0.6357866", "0.63426", "0.6341703", "0.6327077", "0.6324677", "0.6296644", "0.6278251", "0.62765056", "0.6252014", "0.6247849", "0.6238446", "0.620858", "0.619223", "0.6186591", "0.6175965", "0.61676055", "0.6165898", "0.6165103", "0.6159707", "0.6158052", "0.615536", "0.6149323", "0.6125311", "0.6093178", "0.60761726", "0.607133", "0.6070098", "0.6069908", "0.6056661", "0.605529", "0.60545963", "0.60498655", "0.6021583", "0.6017974", "0.60160637", "0.6015779", "0.59972274", "0.59746003" ]
0.0
-1
Add param lang=xx to every URL
public function createUrl($route, $params=array(), $ampersand='&'){ if(Yii::app()->params['langSystem']){ if(!isset($params['lang']) && !Common::checkMCA('', 'site', 'robots') && !Common::checkMCA('', 'site', 'sitemap')) $params['lang']=Yii::app()->language; } return parent::createUrl($route,$params,$ampersand); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function add_query_vars_language( $vars ) {\n $vars[] = \"lang\";\n return $vars;\n}", "function addLanguage(){\n $currentLanguage=\"\";\n if(!empty($_GET)){\n $currentLanguage = $_GET[\"lang\"];\n return \"lang=\".$currentLanguage; \n }\n else {\n return \"lang=\".\"eng\"; \n }\n \n }", "function url_add_locale(string $url, string $locale):string\n{\n if (strpos($url, '?') !== false) {\n $url .= '&';\n } else {\n $url .= '?';\n }\n\n return \"{$url}hl={$locale}\";\n}", "public function setYiiLang(){\r\n $get_lang = Yii::app()->getRequest()->getParam(Yii::app()->urlManager->languageParam);//check if we have lang in url\r\n if (!in_array($get_lang,array_keys(Yii::app()->params['translatedLanguages'])) &&\r\n isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {\r\n $langList = Util::sortByPriority($_SERVER['HTTP_ACCEPT_LANGUAGE']);\r\n foreach ($langList as $lang => $quality) {\r\n foreach (Defaults::$supportedLanguages as $supported) {\r\n if (strcasecmp($supported, $lang) == 0) {\r\n Yii::app()->language = $supported;\r\n break 2;\r\n }\r\n }\r\n }\r\n }\r\n }", "function smarty_function_togglelang($params, &$smarty)\r\n{\r\n $queryStr = explode(\"?\", $_SERVER['REQUEST_URI']);\r\n $page = array_shift($queryStr);\r\n $queryArr = array();\r\n if(count($queryStr) > 0)\r\n {\r\n foreach (explode(\"&\", $queryStr[0]) as $p)\r\n {\r\n $param = explode(\"=\", $p);\r\n if($param[0] != \"url\")\r\n $queryArr[array_shift($param)] = implode(\"=\", $param);\r\n }\r\n }\r\n \r\n $queryArr[\"lang\"] = $params[\"lang\"];\r\n $url = \"\";\r\n \r\n foreach($queryArr as $key => $value)\r\n {\r\n if($url == \"\")\r\n $url .= \"?\";\r\n else\r\n $url .= \"&\";\r\n \r\n $url .= $key . \"=\" . $value;\r\n }\r\n \r\n return $page . $url;\r\n}", "private function setLanguage()\n\t{\n\t\tif (isset($_GET['language']))\n\t\t\t$id_lang = (int)($_GET['language'])>0 ? $_GET['language'] : 0;\n\t\tif (!isset($id_lang))\n\t\t\t$id_lang = ($this->getIdByHAL());\n\t\t$this->lang = $this->xml_file->lang[(int)($id_lang)];\n\t}", "private function set_lang()\n\t{\n\t\t//print_r($this->CI->uri->rsegment_array());\n\t\t//echo $this->CI->uri->ruri_string();\n\t\t\n\t\t// Set from default config\n\t\t$this->lang = $this->lang_default;\n\t\t\t\t\n\t\t// Set from browser\n\t\tif ($this->detect_browser)\n\t\t{\n\t\t\t$this->lang = $this->detect_browser_lang();\n\t\t}\n\n\t\t// Set from session\n\t\t$this->set_session();\n\t\t\n\t\t// Set from URI\n\t\t$first_segment = $this->CI->uri->segment(1);\n\t\tif (in_array($first_segment, $this->langs))\n\t\t{\n\t\t\t$this->lang = $first_segment;\n\t\t\t$this->set_session($first_segment);\n\t\t}\n\t}", "function my_locale_url($locale)\n {\n // Parse URL\n $urlParsed = parse_url(Request::fullUrl());\n if (isset($urlParsed['query'])) {\n parse_str($urlParsed['query'], $params);\n }\n // Set locale to params\n $params['lang'] = $locale;\n\n // Build query\n $paramsJoined = [];\n foreach($params as $param => $value) {\n $paramsJoined[] = \"$param=$value\";\n }\n $query = implode('&', $paramsJoined);\n\n // Build URL\n $url = (App::environment('production') ? 'https' : $urlParsed['scheme']).'://'.\n // No necessity to deal with \"user\" and \"pass\".\n $urlParsed['host'].\n (isset($urlParsed['port']) ? ':'.$urlParsed['port'] : '').\n (isset($urlParsed['path']) ? $urlParsed['path'] : '/').\n '?'.$query.\n (isset($urlParsed['fragment']) ? '#'.$urlParsed['fragment'] : '');\n\n return $url;\n }", "function language() {\n\t// Flip the language and go back\n\tCakeLog::write('debug', 'language: ' . print_r($this->request->named, true));\n\t$language = $this->request->named['new_language'];\n\n\tif (!empty($language)) {\n\t $referer = Router::normalize($this->referer(null, true));\n\t $urlRoute = Router::parse($referer);\n\t $urlRoute['language'] = $language;\n\t $urlRoute['url'] = array();\n\t $this->log(Router::reverse($urlRoute));\n\t $url = Router::normalize(Router::reverse($urlRoute));\n\t $this->params['language'] = $language;\n\t $this->redirect($url);\n\t} else {\n\t $this->redirect($this->referer());\n\t}\n }", "private function initLangs()\n {\n $langs = $this->getLangs();\n if (!$langs) {\n return;\n }\n\n // If the lang is set in query parameters...\n if (array_key_exists(self::LANG_KEY, $this->query)) {\n // ... and it is valid -> change the current language.\n // Yes, we are violating semantics of GET request here, but the operation is idempotent.\n if (in_array($this->query[self::LANG_KEY], $langs)) {\n $this->currentLang = $this->query[self::LANG_KEY];\n setcookie(self::LANG_KEY, $this->currentLang);\n }\n\n // Remove the lang from query parameters and redirect to self...\n unset($this->query[self::LANG_KEY]);\n $url = $this->rawPath;\n if ($this->query) {\n $url .= '?' . http_build_query($this->query);\n }\n header(\"Location: $url\");\n exit;\n }\n\n if (array_key_exists(self::LANG_KEY, $_COOKIE) && in_array($_COOKIE[self::LANG_KEY], $langs)) {\n // If the lang is set in cookies ...\n $this->currentLang = $_COOKIE[self::LANG_KEY];\n } elseif (($httpLang = $this->getLangFromHTTP()) !== null) {\n // Try to get the language from Accept-Language HTTP header...\n $this->currentLang = $httpLang;\n } elseif (in_array('en', $langs)) {\n // English is prefered default...\n $this->currentLang = 'en';\n } else {\n // If everything fails, get first lang of the config...\n $this->currentLang = reset($langs);\n }\n }", "function avia_append_language_code_to_ajax_url($url)\n\t\t{\n\t\t\t$url = avia_wpml_correct_domain_in_url($url);\n\n\t\t\t//after converting the url in case it was necessary also append the language code\n\t\t\t$url .= '?lang='.ICL_LANGUAGE_CODE;\n\n\t\t\treturn $url;\n\t\t}", "public function lang($lang = null);", "function setURL($path, $lang, $state = null, $page, $token = null)\n\t{\n\t\tif (!in_array($path, ['backend','frontend']))\n\t\t\treturn '';\n\t\t\n\t\tif ($path == 'backend')\n\t\t\t\n\t\t\treturn BASE_URL.$path\n\t\t\t\t.'?lang='.$lang\n\t\t\t\t.'&state='.$state\n\t\t\t\t.'&page='.$page\n\t\t\t\t.(isset($token) ? '&token='.urlencode($token) : '');\n\t\telse if ($path == 'frontend')\n\t\t\t\n\t\t\treturn BASE_URL.$path\n\t\t\t\t.'?lang='.$lang\n\t\t\t\t.'&page='.$page;\n\t}", "function setURL($path, $lang, $state = null, $page, $token = null)\n\t{\n\t\tif (!in_array($path, ['backend','frontend']))\n\t\t\treturn '';\n\t\t\n\t\tif ($path == 'backend')\n\t\t\t\n\t\t\treturn BASE_URL.$path\n\t\t\t\t.'?lang='.$lang\n\t\t\t\t.'&state='.$state\n\t\t\t\t.'&page='.$page\n\t\t\t\t.(isset($token) ? '&token='.urlencode($token) : '');\n\t\telse if ($path == 'frontend')\n\t\t\t\n\t\t\treturn BASE_URL.$path\n\t\t\t\t.'?lang='.$lang\n\t\t\t\t.'&page='.$page;\n\t}", "function _polylang_set_sitemap_language() {\n\n\tif ( ! \\function_exists( 'PLL' ) ) return;\n\tif ( ! ( \\PLL() instanceof \\PLL_Frontend ) ) return;\n\n\t// phpcs:ignore, WordPress.Security.NonceVerification.Recommended -- Arbitrary input expected.\n\t$lang = isset( $_GET['lang'] ) ? $_GET['lang'] : '';\n\n\t// Language codes are user-definable: copy Polylang's filtering.\n\t// The preg_match's source: \\PLL_Admin_Model::validate_lang();\n\tif ( ! \\is_string( $lang ) || ! \\strlen( $lang ) || ! preg_match( '#^[a-z_-]+$#', $lang ) ) {\n\t\t$_options = \\get_option( 'polylang' );\n\t\tif ( isset( $_options['force_lang'] ) ) {\n\t\t\tswitch ( $_options['force_lang'] ) {\n\t\t\t\tcase 0:\n\t\t\t\t\t// Polylang determines language sporadically from content: can't be trusted. Overwrite.\n\t\t\t\t\t$lang = \\pll_default_language();\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\t// Polylang can differentiate languages by (sub)domain/directory name early. No need to interfere. Cancel.\n\t\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t}\n\n\t// This will default to the default language when $lang is invalid or unregistered. This is fine.\n\t$new_lang = \\PLL()->model->get_language( $lang );\n\n\tif ( $new_lang )\n\t\t\\PLL()->curlang = $new_lang;\n}", "function urlSeoGen($lang) {\n\t\t$sql = $this->sql(\"SELECT * FROM page_url WHERE page_id = \".$this.\" AND lang = \".D()->quote($lang));\n\t\t$row = D()->row($sql);\n\t\t$url = $row && $row['custom'] ? $row['url'] : $this->urlSeoGenerated($lang);\n\t\t$this->urlSet($lang, ['url'=>$url]);\n\t\tforeach ($this->Children(['type'=>'*']) as $C) {\n\t\t\t$C->urlSeoGen($lang);\n\t\t}\n\t\treturn $url;\n\t}", "private function setLang(){\n\n\t\tif( isset($_GET['lang']) )\n\t\t\t$lang\t= $_GET['lang'];\n\n\t\telse{\n\t\t\t$sess_lang\t= session('lang');\n\t\t\t$lang\t\t= $sess_lang ? $sess_lang : App::getLocale();\n\t\t}\n\n\t\tsession(['lang'=>$lang]);\n\t\tApp::setLocale( $lang );\n\t}", "private function langSetup()\n {\n /**\n * Set default language\n */\n $this->lang = array_keys($this->langsSupported)[0];\n\n /**\n * Force use default lang\n */\n $this->setLang($this->lang);\n return;\n\n $langFromGetParam = Arr::get($_GET, self::GET_PARAM_NAME);\n $langFromCookies = Arr::get($_COOKIE, self::COOKIE_NAME);\n\n /**\n * Choose language based on user's previous choice\n */\n if ($langFromCookies && $this->valid($langFromCookies)) {\n $this->lang = $langFromCookies;\n } else {\n $this->setLang($this->lang);\n }\n\n /**\n * If lang in GET params then save this value to cookies\n */\n if ($langFromGetParam && $this->valid($langFromGetParam)) {\n $this->setLang($langFromGetParam);\n }\n }", "public function fixHreflang()\n {\n global $config, $languages, $listing_data, $currentPage;\n\n if (!$config['mf_geo_subdomains'] || !$config['mod_rewrite'] || count($languages) == 1) {\n return;\n }\n\n $hreflang = array();\n $url = RL_URL_HOME . $currentPage;\n\n foreach ($languages as $lang_item) {\n $lang_code = $lang_item['Code'] == $config['lang'] ? '' : $lang_item['Code'];\n\n if ($this->detailsPage) {\n $hreflang[$lang_item['Code']] = $this->buildListingUrl($url, $listing_data, $lang_code);\n } else {\n $hreflang[$lang_item['Code']] = $this->makeUrlGeo($url, $lang_code);\n }\n }\n\n $GLOBALS['rlSmarty']->assign('hreflang', $hreflang);\n }", "public function switchLangAction(Request $request) {\n $referer = $request->headers->get('referer');\n if (empty($referer) === true) {\n $referer = $this->generateUrl('homepage');\n }\n $old_lang = $request->getLocale();\n $new_lang = $request->query->get('lang', 'en'); \n if($old_lang != 'en' && $old_lang != 'ar'){\n $request->setLocale('en');\n $new_url = '/en/'; //handling special case for non-existing lang \n }else{\n $new_url = str_replace(\"/$old_lang/\", \"/$new_lang/\", $referer);\n $request->setLocale($new_lang);\n }\n return $this->redirect($new_url);\n }", "function httpbl_lang()\n {\n foreach(explode(',',$_SERVER['HTTP_ACCEPT_LANGUAGE']) as $language)\n { if ($language=='fr') { return 'fr'; } }\n return 'en';\n }", "function lang_link($l)\n{\n\tglobal $lang_lang, $lang_otherlang, $action, $languages;\n\tif(is_numeric($l) && $l>0 && $l<count($languages))\n\t\t$langindex = $l;\n\telse\n\t\t$langindex = 0;\n\t$qstr = preg_replace('/(^|&)(l=\\d)($|&)/','',$_SERVER['QUERY_STRING']);\n\t\n\t//Correct to show login page on lang change right after login. Actually, ignore action=login.\n\tif ($action == 'dashboard')\n\t\t$qstr = preg_replace('/action=login/','',$qstr);\n\t\n\tif (!empty($qstr)) $qstr = '&amp;'.$qstr;\n\t$link = \"<a href=\\\"?l=$langindex\".$qstr.\"\\\">{$lang_lang[$langindex]}</a>\";\n\treturn $link;\n}", "abstract public function get_language_url($language = null, $url = null);", "public function addLanguageToUrl(\n string $url,\n string $language,\n ?string $base_domain = null\n );", "function generateLangLinks() {\n\t\tglobal $_SERVER;\n\t\tforeach( $this->mLanguages as $cur_lang ) {\n\t\t\tif( $cur_lang != $this->mLang ) {\n\t\t\t\n\t\t\t\t$url = \"//tools.wmflabs.org\".$_SERVER['REQUEST_URI'];\n\t\t\t\t\n\t\t\t\tif( in_string( 'uselang', $url ) ) $url = preg_replace( '/uselang=(.*?)&?/', '', $url );\n\t\t\t\tif( in_string( '?', $url ) ) {\n\t\t\t\t\t$url = $url . \"&uselang=\".$cur_lang;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$url = $url . \"?uselang=\".$cur_lang;\n\t\t\t\t}\n\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t$this->mLanglinks.=\"<a href=\\\"\". $url.\"\\\">\".$cur_lang.\"</a> \";\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $this->mLanglinks;\n\t}", "function language_url($url) {\n\n if(isset($_COOKIE['language'])) {\n return '/' . $_COOKIE['language'] . $url;\n } else {\n return $url;\n }\n }", "public function settingLanguage() {}", "function langswitch($lang)\n{\n // The page path (an absolute path, starting with '/')\n $pagePath = LocaleLinkService::getPagePath();\n\n // Check if the multi-language support is enabled\n if (!LocaleService::isMultilangEnabled()) {\n return $pagePath;\n }\n\n // Empty lang\n if (empty($lang)) {\n return $pagePath;\n }\n\n // Is it the default lang?\n if ($lang === LocaleService::getDefaultLang()) {\n return $pagePath;\n }\n\n // Get the list of available languages\n $availableLangs = LocaleService::getAvailableLangs();\n\n // Isn't the language supported?\n if (!in_array($lang, $availableLangs)) {\n return $pagePath;\n }\n\n return \"/{$lang}{$pagePath}\";\n}", "public function getcurrentwithlang()\n {\n $lang = $this->default_lang;\n if (array_key_exists('tls_lang', $_COOKIE)) {\n if (in_array($_COOKIE['tls_lang'], $this->all_lang, true)) {\n $lang = $_COOKIE['tls_lang'];\n }\n }\n $raw_url = Request::getResourceURI();\n $page_url = Path::tidy($raw_url);\n \n $site_url = Config::getSiteURL();\n $newurl = $site_url . \"/\" . $lang . $page_url;\n \n header('Location: ' . $newurl);\n exit;\n }", "protected function _language()\n {\n if (sizeof($this->_config['language']) > 1) {\n $language = $this->getRequest()->getParam('language');\n if (!empty($language)) {\n $this->_language = $language . '/';\n $this->_metaLanguage = $language;\n } else if (!empty($this->_session->language)) {\n $this->_language = $this->_session->language . '/';\n $this->_metaLanguage = $this->_session->language;\n } else {\n $browserLanguage = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2);\n if (in_array($browserLanguage, $this->_config['language'])) {\n $this->_session->language = $browserLanguage;\n $this->_language = $browserLanguage . '/';\n $this->_metaLanguage = $browserLanguage;\n } else {\n $this->_language = $this->_config['language'][0] . '/';\n $this->_metaLanguage = $this->_config['language'][0];\n }\n }\n } else {\n $this->_language = '';\n $this->_metaLanguage = $this->_config['language'][0];\n }\n }", "public function setHrefLang(string $lang, string $url);", "public function init(): void {\n if (!isset($this->language)) {\n $this->language = $this->selectLang();\n $this->getTranslator()->setLang($this->language);\n }\n /*if ($redirect && $this->urlLang !== $this->language) {\n $this->getPresenter()->forward('this', ['lang' => $this->language]);\n }*/\n }", "public function actionChooseLanguageFr() {\n $ctr = $_GET['ctr'];\n Yii::app()->session['_lang'] = 'fr';\n header(\"Location: $ctr\");\n }", "function languageChangeDialog()\n{\n\techo \"<a href='\".anotateUrlWithParameters(array (\"lang\"=>\"de\")).\"'>DE</a>, \";\n\techo \"<a href='\".anotateUrlWithParameters(array (\"lang\"=>\"en\")).\"'>EN</a>\";\n}", "function adjust_ls_permalinks( $languages ) {\n\t $maintenance_page_id = traveltour_get_option('plugin', 'maintenance-page');\n\t \n\t //get if maintenance mode is enabled\n\t $is_maintenance_mode_enabled = traveltour_get_option('plugin', 'enable-maintenance'); // 'enable'\n\t \n\t //check if maintenance mode is enabled and if we are in the maintenance page (the ID of the maintenance page is already translated)\n\t if ( is_page ($maintenance_page_id) && 'enable' == $is_maintenance_mode_enabled && !is_user_logged_in()) {\n\n\t // loop through languages setting url to home\n\t $adjusted_languages = [];\n\t foreach ($languages as $lang) {\n\t $lang['url'] = apply_filters( 'wpml_permalink', get_option( 'home' ), $lang['code'] ); \n\t $adjusted_languages[] = $lang;\n\t }\n\t \n\t return $adjusted_languages;\n\t }\n\t return $languages;\n\n\t}", "protected function getLanguageParameter() {}", "protected static function setLanguageKeys() {}", "function lixgetlang() {\n $lang = 'rus';\n \n if ($_GET[lang] != 'rus' && $_GET[lang] != 'eng' && $_GET[lang] != 'deu') {\n if (lixlpixel_detect_lang() != 'ru') { $lang = 'eng'; }\n else { $lang = 'rus'; }\n } else {\n $lang = $_GET[lang];\n }\n \n return $lang;\n}", "public function changeLangEn($lang = 'en_US')\n{\n $this->Cookie->write('lang', $lang);\n return $this->redirect($this->request->referer());\n}", "public function url()\n {\n return '/' . $this->currlang();\n }", "public function langSwitch($l)\n {\n if (isset($this->page) and $this->page->lang($l)) {\n return $this->link('this', array('lang' => $l));\n } //other lang mutation\n return $this->link('Pages:', array('lang' => $l)); //default page\n }", "public function switch_lang($lang)\n\t{\n\t\t$uri = $this->CI->uri->uri_string();\n\t\t$group_langs = implode('|', $this->langs);\n\n\t\t$uri = preg_replace(\"/^(\\/)?($group_langs)/\", '',$uri);\n\t\t$uri = ltrim($uri, \"/\");\n\n\t\t$url_lang = $this->CI->config->site_url($lang . \"/\" . $uri);\n\t\treturn $url_lang;\n\t}", "private function _generateApiUrl() {\n $this->_detectUserLanguage();\n echo '<script type=\"text/javascript\" src=\"' . self::$apiUrl . '?hl=' . $this->defaultLanguage . '\"></script>';\n }", "public function setLanguage(string $lang);", "private function CheckLangue(Request $request){\n $getPathArray = explode('/',$request->getPathInfo());\n $getLangue = $getPathArray[1];\n if(array_search($getLangue,$this->container->getParameter('languages'))===false)\n {\n $getPathArray[1] = $this->container->getParameter('locale');\n $urlredirect = implode(\"/\",$getPathArray);\n $this->redirect('google.fr'.$urlredirect,301);\n }\n\n }", "function mumm_v2_preprocess_page_add_hreflang(&$node) {\n global $language;\n\n // Define hreflang replacements for special cases\n $hreflang_overrides = array(\n array('en-uk'),\n array('en-gb'),\n );\n\n /* $element = array(\n '#tag' => 'link',\n '#attributes' => array(\n 'hreflang' => 'x-default',\n 'rel' => 'alternate',\n 'href' => url('<front>', array(\n 'absolute' => true,\n 'language' => language_default(),\n ))\n ),\n ); */\n\n drupal_add_html_head($element, 'hreflang_x_default');\n\n // Add the page and all its translations\n $t_nodes = mumm_helpers_get_node_translations($node);\n if (!$t_nodes) {\n return;\n }\n\n $languages = language_list();\n $languages_code = array();\n\n foreach ($languages as $language_item) {\n $language_code = substr($language_item->prefix, 0, 2);\n if (isset($languages_code[$language_code])) {\n $languages_code[$language_code] ++;\n }\n else {\n $languages_code[$language_code] = 1;\n }\n }\n\n foreach ($t_nodes as $t_node) {\n\n $hreflang = FALSE;\n $language_object = FALSE;\n\n foreach ($languages as $language_item) {\n if ($language_item->language == $t_node->language) {\n $language_code = substr($language->prefix, 0, 2);\n if ($languages_code[$language_code] == 1) {\n $hreflang = $language_item->prefix;\n }\n else {\n $hreflang = $language_item->prefix;\n }\n $language_object = $language_item;\n break;\n }\n }\n\n $url = url(drupal_is_front_page() ? '<front>' : sprintf('node/%s', $t_node->nid), array(\n 'absolute' => TRUE,\n 'alias' => FALSE,\n 'language' => $language_object\n )\n );\n\n\n $element = array(\n '#tag' => 'link',\n '#attributes' => array(\n 'hreflang' => $language_object->prefix,\n 'rel' => 'alternate',\n 'href' => urldecode($url),\n ),\n );\n\n drupal_add_html_head($element, sprintf('hreflang_%s_%s', $t_node->nid, $t_node->language));\n }\n}", "public function update(){\n foreach (the()->project->languages as $lang){\n $field=\"url_$lang\";\n if($this->urlExists($this->$field,$lang)){\n $increment=1;\n $url=$this->$field.'-'.$increment;\n while($this->urlExists($url,$lang)){\n $increment++;\n $url=$this->$field.'-'.$increment;\n }\n $this->$field=$url;\n }\n $this->$field=strtolower($this->$field);\n $this->$field=pov()->utils->string->clean($this->$field,\"/\");\n }\n\n\n parent::update();\n\n }", "public function system_language_auto(){\n\t\t// Get my current\n\t\t\t$tld = $this->zajlib->tld;\n\t\t\t$subdomain = $this->zajlib->subdomain;\n\t\t\tunset($_GET['locale']);\n\t\t\tunset($_GET['disable_locale_cookie']);\n\t\t\tunset($_COOKIE['ofw_locale']);\n\t\t// No setting means that default is set\n\t\t\t$this->zajlib->tld = 'com';\n\t\t\t$this->zajlib->subdomain = 'www';\n\t\t\t$setting = $this->zajlib->lang->auto();\n\t\t\tzajTestAssert::areIdentical($this->zajlib->lang->get_default_locale(), $setting);\n\t\t// Set my tld (should be stronger than query string)\n\t\t\t$this->zajlib->tld = 'hu';\n\t\t\t$setting = $this->zajlib->lang->auto();\n\t\t\tzajTestAssert::areIdentical('hu_HU', $setting);\n\t\t// Set my subdomain (should be stronger than tld)\n\t\t\t$this->zajlib->subdomain = 'en';\n\t\t\t$setting = $this->zajlib->lang->auto();\n\t\t\tzajTestAssert::areIdentical('en_US', $setting);\n\t\t// Set my query string (should be strong than tld or subdomain)\n\t\t\t$_GET['locale'] = 'fr_FR';\n\t\t\t$setting = $this->zajlib->lang->auto();\n\t\t\tzajTestAssert::areIdentical('fr_FR', $setting);\n\t\t// Reset tld and subdomain and other cleanup\n\t\t\t$this->zajlib->subdomain = $subdomain;\n\t\t\t$this->zajlib->tld = $tld;\n\t}", "public function setLanguageAction(Request $request, $lang) {\n\t\t//$request = $this->container->get('request');\n\t\t//$routeName = $request->get('_route');\n\n\t\t//$routeName = $request->headers->get('referer');\n\n\t\t$routeName = 'eveg_app_homepage';\n\n\t\treturn $this->redirect($this->generateUrl($routeName, array('locale' => $lang)));\n\t\t\n\t}", "public static function setLang($lang) \n\t{\n\t\tacPhpCas::setReporting();\n\t\tphpCAS::setLang($lang);\t\t\n\t}", "protected function lang($key)\n {\n }", "function getLang($index,$params) {\t\n\t\tglobal $lang;\n\t\t\n\t\t$output = $lang[$index];\n\t\t\n\t\tforeach ($params as $key => $value) {\n\t\t\t$output = str_replace('%'.$key.'%',$value,$output);\n\t\t}\n\t\t\n\t\treturn $output;\n\t}", "function theme_global_url($bQuestion=false) {\n global $theme;\n $langid = (isset($_REQUEST['langid'])) ? intval($_REQUEST['langid']) : 0;\n $out = '';\n if ($bQuestion) {\n $out .= '?';\n }\n if ($langid > 0) {\n $out .= '&amp;langid=' . $langid;\n }\n return $out;\n}", "function url($url, $locale_id)\r\n\t{\r\n\t\tif ($locale_id != '')\r\n\t\t{\r\n\t\t\t$url = preg_replace(\"/[&?]\" . $this->url_prefix . \"=([0-9a-z]+)/\", '', $url);\r\n\t\t\t$url = preg_replace(\"/[&?]+$/\", '', $url);\r\n\t\t\t$url .= ((strpos($url, \"?\") != false) ? \"&\" : \"?\") . $this->url_prefix . '=' . $locale_id;\r\n\t\t}\r\n\t\treturn $url;\r\n\t}", "public static function translateUrl($url)\n {\n $self = self::getInstance();\n \n $self->requestedUrl = $url;\n $params = self::getParamsFromURL($url);\n foreach ($params as $name => $value) {\n switch ($name) {\n case self::PARAM_METHOD_ARGUMENTS:\n $self->methodArguments = $value;\n break;\n \n case self::PARAM_LANG:\n $self->lang = $value;\n break;\n \n default:\n $self->urlParams[$name] = $value;\n break;\n }\n }\n }", "public function language()\n {\n \tif ( is_english() ){\n\t\t $this->session->engels = false;\n\t } else {\n\t\t $this->session->engels = true;\n }\n\t redirect($this->agent->referrer());\n }", "function wp_set_lang_dir()\n {\n }", "public function incLocalLang() {}", "function setLanguage() {\n\t\tif(isset($_GET['lang'])) {\n\t\t\t$language = $this->getLanguageFileName($_GET['lang']);\n\t\t} elseif(isset($_COOKIE['lang'])) {\n\t\t\t$language = $this->getLanguageFileName($_COOKIE['lang']);\n\t\t} else {\n\t\t\t$language = $this->getLanguageFileName('en-us');\n\t\t}\n\n\t\t//Sets the language cookie for 30 days\n\t\tsetcookie('lang', $language['meta'], time() + 60 * 60 * 24 * 30, '/');\n\n\t\treturn $language;\n\t}", "public function set_lang($lang=NULL)\r {\r \t$CI =& get_instance();\r \t\r \t$CI->session->set_userdata('lang', $lang);\r\n \tredirect($_SERVER['HTTP_REFERER']);\r }", "public function resetUrlLanguage() {\n $this->storedLanguage = NULL;\n }", "static function lang($lang)\n {\n $route = App::router()->getCurrent();\n return self::generate($route, $route->getParameters(), $lang);\n }", "function lang_list( $language_id = 0 ) {\n\t\t$this->session->set_userdata(array(\"language_id\" => $language_id ));\n\t\t\n\t\tredirect( site_url('admin/language_strings/index/') );\n\t}", "public function set($lang = null) {\n\n\t\t$langHeader = $this->getLangFromHeader();\n\n\t\t// set explicitly, overrides all\n\t\tif (isset($lang)) {\n\t\t\tself::$lang = $lang;\n\t\t}\n\n\t\t// query string?\n\t\tif (isset($_GET['lang'])) {\n\t\t\tself::$lang = $_GET['lang'];\n\t\t}\n\t\t// session?\n\t\telse if (isset($_SESSION[$this->namespace]['lang'])) {\n\t\t\tself::$lang = $_SESSION[$this->namespace]['lang'];\n\t\t}\n\t\t// cookie?\n\t\telse if (isset($_COOKIE[$this->namespace]['lang'])) {\n\t\t\tself::$lang = $_COOKIE[$this->namespace]['lang'];\n\t\t}\n\t\t// http language header\n\t\telse if ($langHeader) {\n\t\t\tself::$lang = $langHeader;\n\t\t}\n\t\t// by page/file name\n\t\telse if (isset($this->pagePattern) && preg_match($this->pagePattern, $this->page, $matches) === 1) {\n\t\t\tself::$lang = $matches[1];\n\t\t}\n\t\telse {\n\t\t\tself::$lang = self::$langDefault;\n\t\t}\n\n\t\t// check that lang property only contains valid content\n\t\tif (!in_array(self::$lang, $this->arrLang)) {\n\t\t\tself::$lang = self::$langDefault;\n\t\t}\n\n\t\t// remove subdomain www from host to prevent conflicting with cookies set in subdomain\n\t\t$domain = str_replace('www.', '.', $_SERVER['HTTP_HOST']);\n\t\tsetcookie($this->namespace.'[lang]', self::$lang, time() + 3600 * 24 * 365, '/', $domain, false);\n\t\t$_SESSION[$this->namespace]['lang'] = self::$lang;\n\t}", "function switchToCorrectLanguage($correct_url, $lang, $valid_url){\n if(!$correct_url || $lang == 'default'){\n $user_connected_from_georgia = false;\n if(isUserFromGeorgia() === true){\n $user_connected_from_georgia = true;\n }\n\n if(!$correct_url){\n $uri = $_SERVER['REQUEST_URI'];\n $uri_arr = explode('/',$uri);\n if(intval($uri_arr[1]) > 0){\n header(\"Location: \" . $valid_url['default'] .$uri_arr[1], true, 301);\n exit;\n }\n else{\n if($user_connected_from_georgia){\n header(\"Location: \" . $valid_url['ge'], true, 301);\n }\n else{\n header(\"Location: \" . $valid_url['en'], true, 301);\n }\n exit;\n }\n }\n else{\n if($user_connected_from_georgia){\n header(\"Location: \" . $valid_url['ge'], true, 301);\n }\n else{\n header(\"Location: \" . $valid_url['en'], true, 301);\n }\n exit;\n }\n }\n}", "function setWpLocale($lang) {\n\t$localLocale = $_COOKIE['dk_locale'];\n\t$currentSite = get_current_blog_id();\n\t$siteDetail = get_blog_details($currentSite);\n\n\tif ($localLocale == 'en_CA' || $currentSite == '3') {\n\t\t$val = 'en_CA';\n\t\theader( 'Location: '. $siteDetail->siteurl);\n\t\tsetcookie(\"dk_locale\", $val, time()+3600*24);\n\t\tsetlocale(LC_MONETARY, $val);\n\n\t\treturn $val;\n\t} else if($localLocale == 'fr_CA' || $currentSite == '2') {\n\t\t$val = 'fr_CA';\n\t\theader( 'Location: '. $siteDetail->siteurl);\n\t\tsetcookie(\"dk_locale\", $val, time()+3600*24);\n\t\tsetlocale(LC_MONETARY, $val);\n\n\t\treturn $val;\n\t} else {\n\t\tsetcookie(\"dk_locale\", $lang, time()+3600*24);\n\t\tsetlocale(LC_MONETARY, $lang);\n\t\treturn $lang;\n\t}\n\t\n}", "function handleLangRequest($db, $userId) {\n if (setUserLang($db, $userId, $_REQUEST['lang'])) {\n $ui_lang_name = getLangName($db, $_REQUEST['lang']);\n $ui_lang_id = $_REQUEST['lang'];\n $_SESSION['ui_lang_id'] = $ui_lang_id;\n $_SESSION['ui_lang_name'] = $ui_lang_name;\n }\n // redirect to remove URL parameter\n $url = $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'];\n $url = strtok($url, '?');\n $params = $_GET;\n unset($params['lang']);\n unset($_SESSION['users']);\n $url_param = http_build_query($params);\n if ($url_param) {\n header(\"Location: https://{$url}?{$url_param}\");\n } else {\n header(\"Location: https://{$url}\");\n }\n die();\n}", "private static function set() {\n if(!empty(Dispatcher::$args['lang']) && self::isAvailable(Dispatcher::$args['lang'])) {\n $_GET['lang'] = Dispatcher::$args['lang'];\n }\n if(!empty($_GET['lang']) && self::isAvailable($_GET['lang'])) {\n //Set on page\n self::$lang = $_GET['lang'];\n //Set in session\n if(empty($_SESSION['lang']) || $_SESSION['lang'] != $_GET['lang']) {\n $_SESSION['lang'] = $_GET['lang'];\n }\n //Set in cookie\n if(empty($_COOKIE['lang']) || $_COOKIE['lang'] != $_GET['lang']) {\n self::setCookie($_GET['lang']);\n }\n return true;\n } elseif(!empty($_COOKIE['lang']) && self::isAvailable($_COOKIE['lang'])) {\n self::$lang = $_COOKIE['lang'];\n //set in session\n if(empty($_SESSION['lang']) || $_SESSION['lang'] != $_COOKIE['lang']) {\n $_SESSION['lang'] = $_COOKIE['lang'];\n }\n return true;\n } elseif(!empty($_SESSION['lang']) && self::isAvailable($_SESSION['lang'])) {\n //set on page\n self::$lang = $_SESSION['lang'];\n //set cookie if empty\n if(empty($_COOKIE['lang']) || $_COOKIE['lang'] != $_SESSION['lang']) {\n self::setCookie($_SESSION['lang']);\n }\n return true;\n }\n return false;\n }", "function smarty_function_mtbloglanguage($args, &$ctx) {\n $real_lang = array('cz' => 'cs', 'dk' => 'da', 'jp' => 'ja', 'si' => 'sl');\n $blog = $ctx->stash('blog');\n $lang_tag = $blog->blog_language;\n if ($real_lang[$lang_tag]) {\n $lang_tag = $real_lang[$lang_tag];\n }\n if ($args['locale']) {\n $lang_tag = preg_replace('/^([A-Za-z][A-Za-z])([-_]([A-Za-z][A-Za-z]))?$/e', '\\'$1\\' . \"_\" . (\\'$3\\' ? strtoupper(\\'$3\\') : strtoupper(\\'$1\\'))', $lang_tag);\n } elseif ($args['ietf']) {\n # http://www.ietf.org/rfc/rfc3066.txt\n $lang_tag = preg_replace('/_/', '-', $lang_tag);\n }\n return $lang_tag;\n}", "function forum_lang( $old_lang ){\n\n\t$loc = HOME . '_plugins/Forum/lang/';\n\tif( file_exists( $loc . LANG . '.php' ) )\n\t\trequire $loc . LANG . '.php';\n\telse\n\t\trequire $loc . 'English.php';\n\n\treturn array_merge( $old_lang, $lang );\n}", "function lang($key, $params = NULL)\n\t{\n\t\t$ci = get_instance()->load->helper('mylanguage');\n\t\treturn mylang($key, $params);\n\t}", "public function languageAction() {\n\t\n\t\t//START LANGUAGE WORK\n\t\tEngine_Api::_()->getApi('language', 'sitestore')->languageChanges();\n\t\t//END LANGUAGE WORK\n\t\t$redirect = $this->_getParam('redirect', false);\n\t\tif($redirect == 'install') {\n\t\t\t$this->_redirect('install/manage');\n\t\t} elseif($redirect == 'query') {\n\t\t\t$this->_redirect('install/manage/complete');\n\t\t}\n\t}", "public function lang($lang = 'fa'): void\n {\n $this->lang = ucfirst($lang);\n }", "public function initializeLanguages() {}", "function set_lcl ($langs)\n\t{\n\t\tglobal $xnyo_parent;\n\t\tif (XNYO_DEBUG) $xnyo_parent->debug('Setting new Language Control List for this page to '.$langs);\n\n\t\t// a string? split it into the array\n\t\tif (!is_array($langs))\n\t\t\t$langs = explode(\",\", preg_replace('/\\s/', '', $langs));\n\n\t\t// current language in the list?\n\t\tif (!in_array($langs, $xnyo_parent->language))\n\t\t{\n\t\t\t$xnyo_parent->trigger_error('User ('.$xnyo_parent->user->username.') not allowed to view page, wrong language: currently <i>'.$xnyo_parent->language.'</i>, required <i>'.join(',', $langs).'</i>', NOTICE);\n\t\t\tif (!empty($xnyo_parent->language_redirect_url))\n\t\t\t\theader('Location: '.$xnyo_parent->language_redirect_url);\n\t\t\texit('Not allowed to view this page. Wrong Language');\n\t\t}\n\t}", "public static function setLang($lang){\n\t\tif(!isset(self::$_config['lang'])) return null;\n\t\tsetcookie('lang',$lang,time()+36000,'/','',false,true);\n\t}", "public function language(string $language);", "public function translatedUrl($langCode,$withUid=false){\n $u= \"\";\n if($this->is_homepage){\n if(cq()->isExportStatic()){\n return \"index\";\n }\n return \"\";\n }elseif ($this->{\"url_\".$langCode}){\n $u=$this->{\"url_\".$langCode};\n }else{\n $u=$this->url;\n }\n if($withUid){\n $u=mb_substr($u,0,150,\"utf-8\");\n $u.=\".p\".$this->id;\n }\n return $u;\n }", "function kcsite_multilingualizeUrl($url){\n\t\n\t//$url = 'http://www.lkc.srv7.321.lt/renginiai/2013-02/';\n\n\t$locale = kcsite_get_lang_slug();\n\tif($locale == '') return $url;\n\n\t$siteUrl = get_bloginfo('siteurl');\n\t//$siteUrl = 'http://www.lkc.srv7.321.lt';\n\t$secondPart = substr($url, (strlen($siteUrl)-3)); //bloginfo return url with locale already\n/*\techo $siteUrl;\n\techo '---';\n\techo $secondPart;\n\techo '---';\n\techo $url; exit;*/\n\t//return $siteUrl . '/' . kcsite_get_lang_slug() . $secondPart;\n\treturn $siteUrl . $secondPart;\n\t//return $siteUrl;\n}", "public function regsiterEndpointsTranslations()\n {\n\n global $polylang, $woocommerce;\n if (!$polylang || !$woocommerce) {\n return false;\n }\n\n $vars = WC()->query->get_query_vars();\n foreach ($vars as $key => $value) {\n WC()->query->query_vars[$key] = $this->getEndpointTranslation($value);\n }\n }", "static public function setLanguage($new_lang) {\n\t\tself::$language = ($new_lang == 'de' ? 'de' : 'us');\n\t}", "static private function CreateLanguageMessage() {\n\t\tif (!IllaUser::loggedIn()) {\n\t\t\t$german_browser = (ereg('de', $_SERVER['HTTP_ACCEPT_LANGUAGE']) ? true : false);\n\t\t}else {\n\t\t\t$german_browser = IllaUser::german();\n\t\t}\n\t\tif (($german_browser && self::isEnglish()) || (!$german_browser && self::isGerman())) {\n\t\t\t$short_filename = substr_replace(basename($_SERVER['PHP_SELF']), '', 0, 2);\n\t\t\t$path = str_replace($short_filename, '', $_SERVER['PHP_SELF']);\n\t\t\t$path = substr_replace($path, '', - 2, 2);\n\n\t\t\tif (count($_GET) > 0) {\n\t\t\t\t$getparams = array();\n\t\t\t\tforeach ($_GET as $key => $value) {\n\t\t\t\t\t$getparams[] = htmlentities($key) . '=' . htmlentities($value);\n\t\t\t\t}\n\t\t\t\t$getparams = '?' . implode('&amp;', $getparams);\n\t\t\t}else {\n\t\t\t\t$getparams = '';\n\t\t\t}\n\n\t\t\tif (self::isEnglish() && file_exists('de' . $short_filename)) {\n\t\t\t\tMessages::add('<a href=\"' . $path . 'de' . $short_filename . $getparams . '\" hreflang=\"de\">Deine bevorzugte Sprache scheint Deutsch zu sein. Klick hier um zur deutschen Fassung dieser Seite zu wechseln.</a>', 'note');\n\t\t\t\tMessages::add('<a href=\"' . $path . 'de' . $short_filename . $getparams . '\" hreflang=\"de\">Your favoured language seems to be German. Click here to view the German version of this page.</a>', 'note');\n\t\t\t} elseif (self::isGerman() && file_exists('us' . $short_filename)) {\n\t\t\t\tMessages::add('<a href=\"' . $path . 'us' . $short_filename . $getparams . '\" hreflang=\"us\">Deine bevorzugte Sprache scheint Englisch zu sein. Klick hier um zur englischen Fassung dieser Seite zu wechseln.</a>', 'note');\n\t\t\t\tMessages::add('<a href=\"' . $path . 'us' . $short_filename . $getparams . '\" hreflang=\"us\">Your favoured language seems to be English. Click here to view the English version of this page.</a>', 'note');\n\t\t\t}\n\t\t}\n\t}", "private function processQueryString()\n {\n // store the query string local, so we don't alter it.\n $queryString = trim($this->request->getPathInfo(), '/');\n\n // split into chunks\n $chunks = (array) explode('/', $queryString);\n\n $hasMultiLanguages = $this->getContainer()->getParameter('site.multilanguage');\n\n // single language\n if (!$hasMultiLanguages) {\n // set language id\n $language = $this->get('fork.settings')->get('Core', 'default_language', SITE_DEFAULT_LANGUAGE);\n } else {\n // multiple languages\n // default value\n $mustRedirect = false;\n\n // get possible languages\n $possibleLanguages = (array) Language::getActiveLanguages();\n $redirectLanguages = (array) Language::getRedirectLanguages();\n\n // the language is present in the URL\n if (isset($chunks[0]) && in_array($chunks[0], $possibleLanguages)) {\n // define language\n $language = (string) $chunks[0];\n\n // try to set a cookie with the language\n try {\n // set cookie\n CommonCookie::set('frontend_language', $language);\n } catch (\\SpoonCookieException $e) {\n // settings cookies isn't allowed, because this isn't a real problem we ignore the exception\n }\n\n // set sessions\n \\SpoonSession::set('frontend_language', $language);\n\n // remove the language part\n array_shift($chunks);\n } elseif (CommonCookie::exists('frontend_language') &&\n in_array(CommonCookie::get('frontend_language'), $redirectLanguages)\n ) {\n // set languageId\n $language = (string) CommonCookie::get('frontend_language');\n\n // redirect is needed\n $mustRedirect = true;\n } else {\n // default browser language\n // set languageId & abbreviation\n $language = Language::getBrowserLanguage();\n\n // try to set a cookie with the language\n try {\n // set cookie\n CommonCookie::set('frontend_language', $language);\n } catch (\\SpoonCookieException $e) {\n // settings cookies isn't allowed, because this isn't a real problem we ignore the exception\n }\n\n // redirect is needed\n $mustRedirect = true;\n }\n\n // redirect is required\n if ($mustRedirect) {\n // build URL\n // trim the first / from the query string to prevent double slashes\n $url = rtrim('/' . $language . '/' . trim($this->getQueryString(), '/'), '/');\n // when we are just adding the language to the domain, it's a temporary redirect because\n // Safari keeps the 301 in cache, so the cookie to switch language doesn't work any more\n $redirectCode = ($url == '/' . $language ? 302 : 301);\n\n // set header & redirect\n throw new RedirectException(\n 'Redirect',\n new RedirectResponse($url, $redirectCode)\n );\n }\n }\n\n // define the language\n defined('FRONTEND_LANGUAGE') || define('FRONTEND_LANGUAGE', $language);\n defined('LANGUAGE') || define('LANGUAGE', $language);\n\n // sets the locale file\n Language::setLocale($language);\n\n // list of pageIds & their full URL\n $keys = Navigation::getKeys();\n\n // rebuild our URL, but without the language parameter. (it's tripped earlier)\n $url = implode('/', $chunks);\n $startURL = $url;\n\n // loop until we find the URL in the list of pages\n while (!in_array($url, $keys)) {\n // remove the last chunk\n array_pop($chunks);\n\n // redefine the URL\n $url = implode('/', $chunks);\n }\n\n // remove language from query string\n if ($hasMultiLanguages) {\n $queryString = trim(mb_substr($queryString, mb_strlen($language)), '/');\n }\n\n // if it's the homepage AND parameters were given (not allowed!)\n if ($url == '' && $queryString != '') {\n // get 404 URL\n $url = Navigation::getURL(404);\n\n // remove language\n if ($hasMultiLanguages) {\n $url = str_replace('/' . $language, '', $url);\n }\n }\n\n // set pages\n $url = trim($url, '/');\n\n // currently not in the homepage\n if ($url != '') {\n // explode in pages\n $pages = explode('/', $url);\n\n // reset pages\n $this->setPages($pages);\n\n // reset parameters\n $this->setParameters(array());\n }\n\n // set parameters\n $parameters = trim(mb_substr($startURL, mb_strlen($url)), '/');\n\n // has at least one parameter\n if ($parameters != '') {\n // parameters will be separated by /\n $parameters = explode('/', $parameters);\n\n // set parameters\n $this->setParameters($parameters);\n }\n\n // pageId, parentId & depth\n $pageId = Navigation::getPageId(implode('/', $this->getPages()));\n $pageInfo = Navigation::getPageInfo($pageId);\n\n // invalid page, or parameters but no extra\n if ($pageInfo === false || (!empty($parameters) && !$pageInfo['has_extra'])) {\n // get 404 URL\n $url = Navigation::getURL(404);\n\n // remove language\n if ($hasMultiLanguages) {\n $url = str_replace('/' . $language, '', $url);\n }\n\n // remove the first slash\n $url = trim($url, '/');\n\n // currently not in the homepage\n if ($url != '') {\n // explode in pages\n $pages = explode('/', $url);\n\n // reset pages\n $this->setPages($pages);\n\n // reset parameters\n $this->setParameters(array());\n }\n }\n\n // is this an internal redirect?\n if (isset($pageInfo['redirect_page_id']) && $pageInfo['redirect_page_id'] != '') {\n // get url for item\n $newPageURL = Navigation::getURL((int) $pageInfo['redirect_page_id']);\n $errorURL = Navigation::getURL(404);\n\n // not an error?\n if ($newPageURL != $errorURL) {\n // redirect\n throw new RedirectException(\n 'Redirect',\n new RedirectResponse(\n $newPageURL,\n $pageInfo['redirect_code']\n )\n );\n }\n }\n\n // is this an external redirect?\n if (isset($pageInfo['redirect_url']) && $pageInfo['redirect_url'] != '') {\n // redirect\n throw new RedirectException(\n 'Redirect',\n new RedirectResponse(\n $pageInfo['redirect_url'],\n $pageInfo['redirect_code']\n )\n );\n }\n }", "function url_to(...$arguments):string\n{\n if (count(locales()) < 2) {\n return call_user_func_array('url', $arguments);\n }\n\n return url_add_locale(call_user_func_array('url', $arguments), locale());\n}", "private function replaceLangVars($lang) {\r\n $this->template = preg_replace(\"/\\{L_(.*)\\}/isUe\", \"\\$lang[strtolower('\\\\1')]\", $this->template);\r\n }", "function GetDefaultLang() : string\n{\n return 'ar';\n}", "function set_lang ($lang)\r\n {\r\n $_SESSION[\"lang\"] = $lang;\r\n }", "function jxjslanginject()\n{\n\t$app = &JFactory::getApplication();\n\t$doc = &JFactory::getDocument();\n\n\tif ($doc->getType() == 'html') {\n\t\t$lang = $app->get('jx.jslang', array());\n\t\tif (!empty($lang)) {\n\t\t\t$txt = '{';\n\t\t\tforeach ($lang as $k => $v)\n\t\t\t{\n\t\t\t\t$txt .= $k.':\"'.$v.'\",';\n\t\t\t}\n\t\t\tif (strlen($txt) > 1) {\n\t\t\t\t$txt = substr($txt, 0, strlen($txt) - 1);\n\t\t\t}\n\t\t\t$txt .= '}';\n\t\t\t$doc->addScriptDeclaration('\tJXLang='.$txt.';');\n\t\t}\n\t}\n}", "public static function setLanguageName($paramLanguageName){\n getDatabase()->update(\"settings\",array(\n \"value\" => $paramLanguageName\n ), \"setting = 'website_lang'\");\n Cache::store('website_lang', $paramLanguageName);\n }", "protected function generateLocalLang() {}", "public function actionLanguageChanged() {\n\t\t$action = $_GET['action'];\n\t\tYii::app()->session['lang'] = $_GET['lang'];\n\t\tif (!Yii::app()->user->isGuest){\n\t\t\tYii::app()->user->lang = $_GET['lang'];\n\t\t}\n\t\tself::$trans=new Translations($_GET['lang']);\n\t\t\n\t\t$Session_Profiles_Backup = Yii::app()->session[$this->createBackup];\n\t\tif (isset($Session_Profiles_Backup)){\n\t\t\t$model = $Session_Profiles_Backup;\n\t\t} else {\n\t\t\tif ($action == 'register'){\n\t\t\t\t$model=new Profiles('register');\n\t\t\t} else {\n\t\t\t\t$model=new Profiles();\n\t\t\t}\n\t\t}\n\t\t$model->PRF_LANG = $_GET['lang'];\n\n\t\tYii::app()->session[$this->createBackup] = $model;\n\t\tif (isset($_GET['id'])){\n\t\t\t$this->redirect(array($action, 'id'=>$_GET['id']));\n\t\t} else {\n\t\t\t$this->redirect(array($action));\n\t\t}\n\t}", "function init(){\n if( Yii::$app->user->isGuest ){\n Yii::$app->getResponse()->redirect(array('/df/logout',302));\n Yii::$app->end();\n }\n parent::init();\n if( isset($_REQUEST['_lang']) ){\n Yii::$app->language = $_REQUEST['_lang'];\n Yii::$app->session['_lang'] = Yii::$app->language;\n }else if( isset(Yii::$app->session['_lang']) ){\n Yii::$app->language = Yii::$app->session['_lang'];\n }else{\n Yii::$app->language = 'es_ve';\n Yii::$app->session['_lang'] = Yii::$app->language;\n }\n}", "private function setLang( $lang ) {\n\t\tif( in_array( $lang, $this->mLanguages ) ) {\n\t\t\t$this->mLang = $lang;\n\t\t\t\n\t\t\tsetcookie(\"soxred_lang\", $this->mLang, time()+60*60*24*365);\n\t\t}\n\t}", "function smarty_modifier_urlRewriteWithParameters($parameters)\n{\n\t$url = Piwik_Url::getCurrentQueryStringWithParametersModified($parameters);\n\treturn $url;\n}", "function location_query_arg( $link ) {\r\n\r\n\tif (isset($_GET['location']) && $_GET['location']) :\r\n\r\n\t\t$location = wp_strip_all_tags($_GET['location']);\r\n\t\t$link = add_query_arg('location', urlencode( utf8_uri_encode( $location ) ), $link);\r\n\r\n\tendif;\r\n\r\n\treturn $link;\r\n}", "public function setLang($sLang)\n\t{\n\t\t$this->aParameters['lang'] = $sLang;\n\t}", "function yourls_get_available_languages( $dir = null ) {\n\t$languages = array();\n\n\t$dir = is_null( $dir) ? YOURLS_LANG_DIR : $dir;\n\n\tforeach( (array) glob( $dir . '/*.mo' ) as $lang_file ) {\n\t\t$languages[] = basename( $lang_file, '.mo' );\n\t}\n\n\treturn yourls_apply_filter( 'get_available_languages', $languages );\n}", "private function setLanguage() {\n//\t\tYii::app()->language = @Yii::app()->user->getState('lang');\n\t}", "function tpl_language()\n{\n global $smarty, $lang, $config;\n\n $smarty->assign('lang', $lang);\n $smarty->assign('config', $config);\n}", "function getLanguage($url, $ln = null, $type = null) {\n\t// Type 2: Change the path for the /requests/ folder location\n\t// Set the directory location\n\tif($type == 2) {\n\t\t$languagesDir = '../languages/';\n\t} else {\n\t\t$languagesDir = './languages/';\n\t}\n\t// Search for pathnames matching the .png pattern\n\t$language = glob($languagesDir . '*.php', GLOB_BRACE);\n\n\tif($type == 1) {\n\t\t// Add to array the available images\n\t\tforeach($language as $lang) {\n\t\t\t// The path to be parsed\n\t\t\t$path = pathinfo($lang);\n\t\t\t\n\t\t\t// Add the filename into $available array\n\t\t\t$available .= '<li><a href=\"'.$url.'index.php?lang='.$path['filename'].'\">'.ucfirst(strtolower($path['filename'])).'</a></li>';\n\t\t}\n\t\treturn substr($available, 0, -3);\n\t} else {\n\t\t// If get is set, set the cookie and stuff\n\t\t$lang = 'Venezuela'; // DEFAULT LANGUAGE\n\t\tif($type == 2) {\n\t\t\t$path = '../languages/';\n\t\t} else {\n\t\t\t$path = './languages/';\n\t\t}\n\t\tif(isset($_GET['lang'])) {\n\t\t\tif(in_array($path.$_GET['lang'].'.php', $language)) {\n\t\t\t\t$lang = $_GET['lang'];\n\t\t\t\tsetcookie('lang', $lang, time() + (10 * 365 * 24 * 60 * 60)); // Expire in one month\n\t\t\t} else {\n\t\t\t\tsetcookie('lang', $lang, time() + (10 * 365 * 24 * 60 * 60)); // Expire in one month\n\t\t\t}\n\t\t} elseif(isset($_COOKIE['lang'])) {\n\t\t\tif(in_array($path.$_COOKIE['lang'].'.php', $language)) {\n\t\t\t\t$lang = $_COOKIE['lang'];\n\t\t\t}\n\t\t} else {\n\t\t\tsetcookie('lang', $lang, time() + (10 * 365 * 24 * 60 * 60)); // Expire in one month\n\t\t}\n\n\t\tif(in_array($path.$lang.'.php', $language)) {\n\t\t\treturn $path.$lang.'.php';\n\t\t}\n\t}\n}", "public function action_setlang($lang=null){\n\tif ($lang!=null){\n\t $auth = Auth::instance();\n\t $auth->update_user(array(\"language\"=>$lang));\n\t Response::redirect(\"/\");\n\t}\n }" ]
[ "0.7682504", "0.70756406", "0.69806993", "0.6859409", "0.6777766", "0.65860635", "0.6442319", "0.6417949", "0.636205", "0.635064", "0.63480264", "0.6307989", "0.6303477", "0.6303477", "0.6212117", "0.61882406", "0.61693877", "0.6167279", "0.61471957", "0.609158", "0.60620815", "0.605406", "0.60345984", "0.6010038", "0.5983059", "0.5978763", "0.5950926", "0.59469396", "0.5943272", "0.5914301", "0.59105694", "0.59056616", "0.58685035", "0.58608764", "0.5847939", "0.5842929", "0.5841118", "0.5832316", "0.58262205", "0.5822476", "0.57956856", "0.5768555", "0.5760899", "0.57606316", "0.57468647", "0.5741094", "0.57185614", "0.5717906", "0.5693665", "0.5685674", "0.5681564", "0.5678389", "0.5671302", "0.564985", "0.56488365", "0.5645663", "0.5642559", "0.5632105", "0.56198204", "0.5602169", "0.55853015", "0.55768853", "0.55720586", "0.5571223", "0.5563982", "0.55608815", "0.5535247", "0.5532391", "0.55307996", "0.5513021", "0.5508747", "0.54991424", "0.5493032", "0.5479719", "0.5474746", "0.5466025", "0.5458233", "0.5436315", "0.5435454", "0.5431715", "0.5421718", "0.5413179", "0.5409203", "0.5404295", "0.5401628", "0.5394082", "0.5386763", "0.5380459", "0.5364753", "0.5357782", "0.535687", "0.5352068", "0.53484035", "0.5344025", "0.5328875", "0.53279215", "0.5326116", "0.5325448", "0.531875", "0.53048575", "0.5300757" ]
0.0
-1
Append different facebook search result into one array
function appendArray($a,$b,$index) { if(empty($a)) return $b; if(empty($b)) return $a; $length_a=count($a); $length_b=count($b); for($i=0;$i<$length_b;$i++) { for($j=0;$j<$length_a;$j++) { if($b[$i][$index]==$a[$j][$index]) { break; } } if($j<=$length_a) $a[$length_a+$i]=$b[$i]; } return $a; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function contains_searchResult_social($searchResult, $request,$socials)\n {\n $terms = explode(\" \",$request);\n $test = false;\n //print_r($terms);\n\n //check if the header/title of the result contains the keywords of the search query\n\n foreach ($socials as $social) {\n if (strpos(strtolower($searchResult->links), strtolower($social)) !== false) {\n $test = true;\n break;\n }\n }//*/\n if($test)\n {\n foreach ($terms as $term)\n {\n if($test)\n {\n if(strpos(strtolower($searchResult->title) ,strtolower($term)) !== false)\n {\n $test = true;\n }\n else\n {\n $test = false;\n }\n }\n }\n if(!$test)\n {\n //check if the link of the result contains the keywords of the search query\n $test = true;\n foreach ($terms as $term)\n {\n if($test)\n {\n\n if(strpos(strtolower($searchResult->link) ,strtolower($term)) !== false)\n {\n $test = true;\n }\n else\n {\n $test = false;\n }\n }\n }\n if(!$test)\n {\n //check if the body of the result contains the keywords of the search query\n $test = true;\n foreach ($terms as $term)\n {\n if($test)\n {\n // echo strtolower($searchResult->preview);\n if(strpos(strtolower($searchResult->preview) ,strtolower($term)) !== false)\n {\n\n // echo \"<br/>\";\n }\n else\n {\n $test = false;\n }\n }\n }\n }\n }\n }\n if(!$test)\n {\n return true;\n }\n else\n {\n //echo \"else <br/>\";\n //check the result is already record\n foreach ($this->searchResults as $result)\n {\n // echo \"<br/> a\";\n if(strpos(strtolower($result->links) ,strtolower($searchResult->links)) !== false)\n {\n return true;\n }\n //echo \"yes\";\n\n }\n }\n // echo \"rien\";\n\n return false;\n }", "function getTable($fb, $access_token){\r\n $query = \"/search?\";\r\n if(strcmp($_GET['type'], \"user\") == 0)\r\n $query .= \"q='\" . $_GET['keyword'] . \"'&type=user&fields=id,name,picture.width(700).height(700)&access_token=\" . $access_token;\r\n else if(strcmp($_GET['type'], \"event\") == 0)\r\n\t$query .= \"q='\" . $_GET['keyword'] . \"'&type=event&fields=id,name,picture.width(700).height(700),place&access_token=\" . $access_token;\r\n else if(strcmp($_GET['type'], \"page\") == 0)\r\n\t$query .= \"q='\" . $_GET['keyword'] . \"'&type=page&fields=id,name,picture.width(700).height(700)&access_token=\" . $access_token;\r\n else if(strcmp($_GET['type'], \"group\") == 0)\r\n\t$query .= \"q='\" . $_GET['keyword'] . \"'&type=group&fields=id,name,picture.width(700).height(700)&access_token=\" . $access_token;\r\n else if(strcmp($_GET['type'], \"place\") == 0){\r\n\r\n \r\n\tif(isset($_GET['lat']) && isset($_GET['lng'])){\r\n\t $query .= \"q='\" . $_GET['keyword'] . \"'&type=place&center=\" . $_GET['lat'] . \",\" . $_GET['lng'] . \"&fields=id,name,picture.width(700).height(700)&access_token=\" . $access_token;\r\n\t}\r\n\telse\r\n\t $query = \"me\";\r\n\r\n }\r\n\r\n$response = fbQuery($fb, $query)->getBody();\r\n echo \"{\\\"type\\\":\\\"\".$_GET['type'].\"\\\",\\\"data\\\":[\".$response.\"]}\";\r\n\r\n}", "public function search(Request $request){\n// $data->words = array();\n// $word = new \\stdClass();\n// $word->name = 'Test name';\n// $word->image = 'http://pbs.twimg.com/profile_images/558876536791523329/HkCFV9Q0_normal.jpeg';\n// array_push($data->words, $word);\n\n// $data->suggests = new \\stdClass();\n// $data->suggests->headline_1 = array();\n//\n// $result = new \\stdClass();\n// $result->name = 'test name 1';\n// $result->image = 'http://pbs.twimg.com/profile_images/558876536791523329/HkCFV9Q0_normal.jpeg';\n// $result->link = 'http://pbs.twimg.com/profile_images/558876536791523329/HkCFV9Q0_normal.jpeg';\n// array_push($data->suggests->headline_1, $result);\n// $result = new \\stdClass();\n// $result->name = 'test name 2';\n// $result->image = 'http://pbs.twimg.com/profile_images/558876536791523329/HkCFV9Q0_normal.jpeg';\n// $result->link = 'http://pbs.twimg.com/profile_images/558876536791523329/HkCFV9Q0_normal.jpeg';\n// array_push($data->suggests->headline_1, $result);\n //return response()->json($data);\n\n $search = trim($request->get('search'));\n $searchQuery = '%'.$search.'%';\n if($search && strlen($search) >= 3){\n $users = User::where('username','like',$searchQuery)->orWhere('first_name','like',$searchQuery)->orWhere('last_name','like',$searchQuery)->take(5)->get();\n $tasks = Hug::where('status','=','Active')->where('title','like',$searchQuery)->take(5)->get();\n $events = Event::where('status','=','Published')->where('title','like',$searchQuery)->take(5)->get();\n $blogs = BlogPost::where('status','=','Published')->where('title','like',$searchQuery)->take(5)->get();\n $cities = City::where('name','like',$searchQuery)->take(5)->get();\n $tools = ToolsPost::where('title','like',$searchQuery)->take(5)->get();\n }else{\n $users = array();\n $tasks = array();\n }\n\n\n $data = new \\stdClass();\n $data->words = array();\n $word = new \\stdClass();\n $word->name = '';\n array_push($data->words, $word);\n\n $data->suggests = new \\stdClass();\n\n // users\n $heading_1 = \"People\";\n $data->suggests->$heading_1 = array();\n foreach($users as $user){\n $userData = new \\stdClass();\n $status = StatusUpdate::where('user_id', '=', $user->id)->orderBy('created_at', 'desc')->first();\n $userData->name = $user->username;\n $userData->description = $user->first_name.' '.$user->last_name;\n if($status){\n $userData->status = $status->status;\n }\n $userData->image = $user->avatar;\n $userData->link = route('perk::public_profile', array('username' => $user->username));\n array_push($data->suggests->$heading_1, $userData);\n }\n\n // tasks\n $heading_2 = \"Tasks\";\n $data->suggests->$heading_2 = array();\n foreach($tasks as $task){\n $taskData = new \\stdClass();\n $taskData->name = $task->title;\n $taskData->description = substr(strip_tags($task->description), 0, 50);\n $taskData->image = $task->user->avatar;\n $taskData->link = route('hugs::show', array('id'=> $task->id));\n array_push($data->suggests->$heading_2, $taskData);\n }\n\n // tasks\n $heading_3 = \"Events\";\n $data->suggests->$heading_3 = array();\n foreach($events as $event){\n $taskData = new \\stdClass();\n $taskData->name = $event->title;\n $taskData->description = substr(strip_tags($event->description), 0, 50);\n $taskData->image = $event->logo;\n $taskData->link = route('event::show', array('id'=> $event->id));\n array_push($data->suggests->$heading_3, $taskData);\n }\n\n $heading_4 = \"Blogs\";\n $data->suggests->$heading_4 = array();\n foreach($blogs as $blog){\n $taskData = new \\stdClass();\n $taskData->name = $blog->title;\n $taskData->description = substr(strip_tags($blog->description), 0, 50);\n $taskData->image = $blog->cover_photo;\n $taskData->link = route('blog::show', array('id'=> $blog->id));\n array_push($data->suggests->$heading_4, $taskData);\n }\n\n $heading_5 = \"Cities\";\n $data->suggests->$heading_5 = array();\n foreach($cities as $city){\n $taskData = new \\stdClass();\n $taskData->name = $city->name;\n $taskData->description = substr(strip_tags($city->description), 0, 50);\n $taskData->image = $city->city_photo;\n $taskData->link = route('cities::city', array('id'=> $city->name));\n array_push($data->suggests->$heading_5, $taskData);\n }\n $heading_6 = \"Web Tools\";\n $data->suggests->$heading_6 = array();\n foreach($tools as $tool){\n $taskData = new \\stdClass();\n $taskData->name = $tool->title;\n $taskData->description = substr(strip_tags($tool->description), 0, 50);\n $taskData->image = $tool->cover_photo;\n $taskData->link = route('Tools::webpost', array('id'=> $tool->id));\n array_push($data->suggests->$heading_6, $taskData);\n }\n\n\n return response()->json(['results' => $data],200);\n\n }", "public function recording_social($request, $count,$after,$category)\n {\n $counts = $count;\n\n do\n {\n $min = count($this->resultHeader[0]);\n $pos = [];\n $nbr = 0;\n\n foreach ($this->resultHeader as $header) {\n if (count($header) < $min) {\n $min = count($header);\n }\n }\n foreach ($this->resultHeader as $header) {\n if (count($header) == $min) {\n array_push($pos,$nbr);\n }\n $nbr++;\n }\n\n\n\n if ($min > 0) {\n //echo $min . \" \".count($this->resultHeader);\n $compt = 0;\n for ($count = 0; $count < $min; $count++) {\n\n for ($pas = 0; $pas < count($this->resultHeader); $pas++) {\n $searchResult = new Search_Result([\n 'title' => $this->resultHeader[$pas][$count],\n 'link' => $this->resultLink[$pas][$count],\n 'links' => $this->resultLink_text[$pas][$count],\n 'preview' => $this->resultBody[$pas][$count],\n 'category' => $category\n ]);\n\n if (!$this->contains_searchResult($searchResult, $request)) {\n $searchResult->search()->associate($this->search_);\n $searchResult->save();\n if ($after) {\n array_splice($this->searchResults, 2 * $compt, 0, array($searchResult));\n } else {\n array_push($this->searchResults, $searchResult);\n }\n if($this->eager)\n {\n array_push($this->searchResultsDB, $searchResult);\n }\n $compt++;\n $counts++;\n }\n\n }\n }\n }\n //unset($this->resultHeader[$pos]);\n foreach ($pos as $po)\n {\n array_splice($this->resultHeader, $po, 1);\n array_splice($this->resultLink, $po, 1);\n array_splice($this->resultBody, $po, 1);\n array_splice($this->resultLink_text, $po, 1);\n }\n\n\n }\n while(count($this->resultHeader)>0);\n return $counts;\n }", "function get_search_bar_results($user_input){\n $array = array();\n $sql = 'select songs.id,songs.img,songs.artist,songs.name\n from songs\n where name = \"'.$user_input.'\" \n group by name';\n $array = filter_results_of_search_bar_input($sql,$array);\n $sql = 'select songs.id,songs.img,songs.artist,songs.name\n from songs\n where artist like \"%'.$user_input.'%\"\n group by name';\n $array = filter_results_of_search_bar_input($sql,$array);\n $sql = 'select songs.id,songs.img,songs.artist,songs.name\n from songs\n where name like \"%'.$user_input.'%\"\n group by name';\n $array = filter_results_of_search_bar_input($sql,$array);\n return $array;\n}", "protected function too_many_results($search, $count) {\n if ($search) {\n $a = new stdClass;\n $a->count = $count;\n $a->search = $search;\n return array(get_string('toomanyusersmatchsearch', '', $a) => array(),\n get_string('pleasesearchmore') => array());\n } else {\n return array(get_string('toomanyuserstoshow', '', $count) => array(),\n get_string('pleaseusesearch') => array());\n }\n }", "function getSearch()\n\t{\n\t\t//init variable\n\t\t$app = JFactory::getApplication();\n\t\t$log_user = JFactory::getUser($this->plugin->get('user')->id);\n\t\n\t\t$search = $app->input->get('search','','STRING');\n\t\t$nxt_lim = $app->input->get('next_limit',0,'INT');\n\n\t\t$limitstart = $app->input->get('limitstart',0,'INT');\n\t\t$limit = $app->input->get('limit',10,'INT');\n\t\t$list = array();\n\t\t$list['data_status'] = true;\n\t\tif($limitstart)\n\t\t{\n\t\t\t$limit = $limit + $limitstart;\n\t\t}\n\t\t\n\t\t$mapp = new EasySocialApiMappingHelper();\n\t\t$res = new stdClass;\n\t\t\n\t\tif(empty($search))\n\t\t{\n\t\t\t$res->status = 0;\n\t\t\t$res->message = JText::_( 'PLG_API_EASYSOCIAL_EMPTY_SEARCHTEXT_MESSAGE' );\n\t\t\treturn $res;\n\t\t}\n\t\t\n\t\t$userid = $log_user->id;\n\t\n\t\t$serch_obj = new EasySocialModelSearch();\n\t\t\t\n\t\t$db = JFactory::getDbo();\n\t\t$query = $db->getQuery(true);\n\t\t$frnd_obj = new EasySocialModelFriends();\n\t\t\n\t\t$query->select($db->quoteName(array('su.user_id')));\n\t\t$query->from($db->quoteName('#__social_users','su'));\n\t\t$query->join('LEFT', $db->quoteName('#__users', 'u') . ' ON (' . $db->quoteName('su.user_id') . ' = ' . $db->quoteName('u.id') . ')');\n\t\t\n\t\tif(!empty($search))\n\t\t{\n\t\t\t$query->where(\"(u.username LIKE '%\".$search.\"%' ) OR ( u.name LIKE '%\".$search.\"%')\");\n\t\t}\n\t\t\n\t\t$query->order($db->quoteName('u.id') .'ASC');\n\n\t\t$db->setQuery($query);\n\t\t$tdata = $db->loadObjectList();\n\t\t$block_model = FD::model('Blocks');\t\n\t\t$susers = array();\n\t\tforeach($tdata as $ky=>$val)\n\t\t{\n\t\t\t$block = $block_model->isBlocked($val->user_id,$userid);\n\t\t\tif(!$block)\n\t\t\t{\t\t\n\t\t\t\t$susers[] = FD::user($val->user_id);\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t\t\t\n\t\t//manual pagination code\n\t\t$susers = array_slice( $susers, $limitstart, $limit );\t\t\n\t\t$base_obj = $mapp->mapItem($susers,'user',$log_user->id);\n\t\t$list['user'] = $this->createSearchObj( $base_obj );\n\n\t\tif(empty($list['user']))\n\t\t{\n\t\t\t$ret_arr = new stdClass;\n\t\t\t$ret_arr->status = false;\n\t\t\t$ret_arr->message = JText::_( 'PLG_API_EASYSOCIAL_USER_NOT_FOUND' );\n\t\t\t$list['user']= $ret_arr;\n\t\t}\n\t\t\n\t\t//for group\n\t\t$query1 = $db->getQuery(true);\n\t\t$query1->select($db->quoteName(array('cl.id')));\n\t\t$query1->from($db->quoteName('#__social_clusters','cl'));\n\t\t\n\t\tif(!empty($search))\n\t\t{\n\t\t\t$query1->where(\"(cl.title LIKE '%\".$search.\"%' )\");\n\t\t}\n\t\t$query1->where('cl.state = 1');\n\t\t\n\t\t$query1->order($db->quoteName('cl.id') .'ASC');\n\n\t\t$db->setQuery($query1);\n\t\t$gdata = $db->loadObjectList();\n\t\t\n\t\t$grp_model = FD::model('Groups');\n\t\t$group = array();\n\t\tforeach($gdata as $grp)\n\t\t{\n\t\t\t$group_load = FD::group($grp->id); \n\t\t\t$is_inviteonly = $group_load->isInviteOnly();\n\t\t\t$is_member = $group_load->isMember($log_user->id);\n\t\t\tif($is_inviteonly && !$is_member)\n\t\t\t{\n\t\t\t\tif($group_load->creator_uid == $log_user->id)\n\t\t\t\t{\n\t\t\t\t\t$group[] = FD::group($grp->id);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{ \n\t\t\t\t\tcontinue;\n\t\t\t\t} \n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$group[] = FD::group($grp->id); \n\t\t\t}\n\t\t}\n\t\t\n\t\t//manual pagination code\n\t\t$group = array_slice( $group, $limitstart, $limit );\n\t\t$list['group'] = $mapp->mapItem($group,'group',$log_user->id);\n\t\t\n\t\tif(empty($list['group']))\n\t\t{\n\t\t\t$ret_arr = new stdClass;\n\t\t\t$ret_arr->status = false;\n\t\t\t$ret_arr->message = JText::_( 'PLG_API_EASYSOCIAL_GROUP_NOT_FOUND' );\n\t\t\t$list['group']= $ret_arr;\n\t\t}\n\t\t\t\n\t\t//give status as per front end requirement\n\t\tif(empty($list['group']) && empty($list['user']))\t\n\t\t{\n\t\t\t$list['data_status'] = false;\n\t\t}\n\t\treturn( $list );\n\t}", "function ap_search_results($data){\n $args = array(\n 'post_status'=>'publish',\n 'post_type'=> array('post', 'page'),\n 's' => sanitize_text_field($data['term'])\n);\n\t$main_query = new \\WP_Query($args);\n\t$event_query = tribe_get_events(array(\n\t\t\t\t\t'start_date' => date( 'Y-m-d H:i:s' ),\n\t\t\t\t\t's' => sanitize_text_field($data['term']),\n\n\t));\n\n\t $results = array(\n\t\t'pages' => array(),\n\t\t'posts' => array(),\n\t\t'events' => array()\n\t );\n\n\tforeach ($event_query as $event){\n\t\tarray_push($results['events'], array(\n\t\t\t\t'title' => $event->post_title,\n\t\t\t\t'permalink' => get_permalink($event->ID),\n\t\t\t\t'day' => tribe_get_start_date($event->ID, false, 'j'),\n\t\t\t\t'month' => tribe_get_start_date($event->ID, false, 'M')\n\t\t\t));\n\t}\n\n\twhile($main_query ->have_posts()) {\n\t\t$main_query -> the_post();\n\n\t\tif(get_post_type() == 'page'){\n\t\t\tarray_push($results['pages'], array(\n\t\t\t\t'title' => get_the_title(),\n\t\t\t\t'permalink' => get_the_permalink()\n\t\t\t));\n\t\t }\n\t\tif(get_post_type() == 'post'){\n\t\t\tarray_push($results['posts'], array(\n\t\t\t\t'title' => get_the_title(),\n\t\t\t\t'permalink' => get_the_permalink(),\n\t\t\t\t'postType' => get_post_type(),\n\t\t\t\t'publishDate' => get_the_date()\n\t\t\t));\n\t\t }\n\t }\n\n\t return $results;\n }", "public static function search_data($query)\n {\n /**\n * Put all results in the response array.\n */\n $response = [];\n\n /**\n * Create initial container.\n */\n $found = [\n 'id' => 0, // These don't belong to a category, so we'll set it to 0.\n 'title' => $query,\n 'items' => [],\n 'hasMore' => false\n ];\n\n /**\n * Get all fragments with the based on the query.\n */\n $args = [\n 'post_type' => 'fragment',\n 'post_status' => 'publish',\n 'posts_per_page' => -1,\n 'orderby' => 'menu_order',\n 'order' => 'ASC',\n 'tag' => $query\n ];\n\n $query = new \\WP_Query($args);\n if ($query->have_posts()) {\n while ($query->have_posts()) {\n $query->the_post();\n\n $fragment_id = get_the_id();\n\n $audio_file = get_field('fragment_audio_file');\n $still = get_field('fragment_still');\n\n $title = apply_filters('the_title', get_the_title());\n $title = html_entity_decode($title);\n\n /**\n * Only append items that have valid audio files.\n */\n if ($audio_file) {\n $found['items'][] = [\n 'id' => $fragment_id,\n 'title' => $title,\n 'thumbnail' => [\n '@1x' => $still['sizes']['fragment-thumbnail@1x'],\n 'alt' => $still['alt']\n ],\n 'audio' => [\n 'url' => $audio_file['url'],\n 'mimeType' => $audio_file['mime_type']\n ]\n ];\n }\n }\n\n wp_reset_postdata();\n }\n\n $response[] = $found;\n return $response;\n }", "public function searchSocial($request,$index = 1,$country = ['CM'])\n {\n $socials = [];\n switch ($index)\n {\n case 1: $socials = ['Facebook.com','Twitter.com','LinkedIn.com','plus.google.com','YouTube.com'];\n break;\n case 2: $socials = ['Instagram.com','Pinterest.com','Meetup.com','badoo.com','meetic.fr'];\n break;\n case 3: $socials = ['Flickr.com','VK.com','Reddit.com','Ask.fm','Tumblr.com','Vine.co'];\n break;\n case 4: $socials = ['viadeo.com','skyrock.com','myspace.com','tagged.com'];\n break;\n }\n\n\n $counts = 0;\n $strSearch = '\"'.$request.'\"';\n $nb = 5;\n $this->count = 0;\n\n $this->Loading($request,'social');\n\n foreach ($socials as $social) {\n //echo $strSearch;\n $this->fetching($strSearch.\" site:\".$social,$nb,$country);\n //$counts = $this->recording($request,$counts,false);\n sleep(1);\n }\n\n\n if($this->continue)\n {\n $this->recording_social($request,$counts,false,\"social\");\n }\n\n\n return response()->json($this->searchResults);\n }", "public function get_search()\n\t\t{\n\t\t\t$retArr = null;\n\t\t\tforeach($this->obj as $obj)\n\t\t\t{\n\t\t\t\t$retArr[] = $obj->getBasics($this->response_profile);\n\t\t\t}\n\t\t\treturn $retArr;\n\t\t}", "function sopac_search_block($locum_results_all, $locum_cfg) {\n global $user;\n\n $getvars = sopac_parse_get_vars();\n $uri = sopac_parse_uri();\n $format = $getvars['search_format'];\n $term_arr = explode('?', trim(preg_replace('/\\//', ' ', $uri[2])));\n\n $search['term'] = trim($term_arr[0]);\n $search['type'] = trim($uri[1]);\n $search['sortby'] = $getvars['sort'] ? $getvars['sort'] : t('Most relevant');\n $search['format'] = count($getvars['search_format']) && ($getvars['search_format'][0] != 'all') ? $getvars['search_format'] : array();\n $search['series'] = count($getvars['facet_series']) ? $getvars['facet_series'] : array();\n $search['lang'] = count($getvars['facet_lang']) ? $getvars['facet_lang'] : array();\n $search['year'] = count($getvars['facet_year']) ? $getvars['facet_year'] : array();\n $search['decade'] = count($getvars['facet_decade']) ? $getvars['facet_decade'] : array();\n $search['age'] = count($getvars['age']) ? $getvars['age'] : array();\n $search['subject'] = count($getvars['facet_subject']) ? $getvars['facet_subject'] : array();\n\n return theme('sopac_search_block', $search, $locum_results_all, $locum_cfg, $user);\n\n}", "private function process_results($all=false) {\n global $USER;\n\n $term = mb_convert_case($this->term, MB_CASE_LOWER, 'UTF-8');\n\n //experimental - return more results\n $strip_arr = array('author:', 'title:', '+', '-', 'doctype:');\n $stripped_term = str_replace($strip_arr, '', $term);\n\n $hits = $this->index->find($term.\" title:\".$stripped_term.\" author:\".$stripped_term);\n //--\n\n $hitcount = count($hits);\n $this->total_results = $hitcount;\n\n if ($hitcount == 0) return array();\n\n $totalpages = ceil($hitcount/$this->results_per_page);\n\n if (!$all) {\n if ($hitcount < $this->results_per_page) {\n $this->pagenumber = 1;\n } else if ($this->pagenumber > $totalpages) {\n $this->pagenumber = $totalpages;\n }\n\n $start = ($this->pagenumber - 1) * $this->results_per_page;\n $end = $start + $this->results_per_page;\n\n if ($end > $hitcount) {\n $end = $hitcount;\n } \n } else {\n $start = 0;\n $end = $hitcount;\n }\n\n $resultdoc = new SearchResult();\n $resultdocs = array();\n\n for ($i = $start; $i < $end; $i++) {\n $hit = $hits[$i];\n\n //check permissions on each result\n if ($this->can_display($USER, $hit->docid, $hit->doctype, $hit->course_id, $hit->group_id, $hit->path, $hit->itemtype, $hit->context_id )) {\n $resultdoc->number = $i;\n $resultdoc->url = $hit->url;\n $resultdoc->title = $hit->title;\n $resultdoc->score = $hit->score;\n $resultdoc->doctype = $hit->doctype;\n $resultdoc->author = $hit->author;\n\n //and store it\n $resultdocs[] = clone($resultdoc);\n } else {\n // lowers total_results one unit\n $this->total_results--;\n }\n }\n\n return $resultdocs;\n }", "public function getAsinListFromSearchByKeyword($url) {\n \n $html = $this->getUrl($url);\n $dom = str_get_html($html);\n \n $asins = array();\n \n // top\n foreach($dom->find('div[id=\"atfResults\"] h3[class=\"newaps\"] a') as $a)\n {\n if ( $this->_logview) {\n echo \"<pre>\";\n echo $a->href;\n echo \"</pre>\";\n }\n\n $asin = $this->getAsinFromUrl($a->href);\n if ( $asin) {\n $asins[] = $asin;\n }\n } \n \n // bottom\n foreach($dom->find('div[id=\"btfResults\"] h3[class=\"newaps\"] a') as $a)\n {\n if ( $this->_logview) {\n echo \"<pre>\";\n echo $a->href;\n echo \"</pre>\";\n }\n\n $asin = $this->getAsinFromUrl($a->href);\n if ( $asin) {\n $asins[] = $asin;\n }\n } \n \n if (count($asins) == 0) {\n foreach($dom->find('div[id=\"rightResultsATF\"] a') as $e)\n {\n $asin = $this->getAsinFromUrl($e->href);\n if ( $asin) {\n $asins[] = $asin;\n }\n } \n }\n \n $asins = array_unique($asins);\n $new_asins = array();\n \n if ( is_array($asins)) {\n foreach($asins as $a) {\n $new_asins[] = $a;\n }\n }\n \n $dom->clear();\n unset($dom);\n \n return $new_asins;\n \n }", "public function search(Request $request) {\n\n try {\n\n $validator = Validator::make(\n $request->all(),\n array(\n 'term' => 'required',\n )\n );\n \n if ($validator->fails()) {\n\n $error = implode(',', $validator->messages()->all());\n\n throw new Exception($error, 101);\n \n } else {\n\n $data = [];\n\n // users list\n\n $users = [];\n\n\n $results = Helper::search_user($request->id, $request->term, $request->skip, 5);\n\n if(count($results)) {\n \n foreach ($results as $key => $suggestion) {\n\n \n // Blocked Users by You\n $blockedUsersByYou = BlockList::where('user_id', $request->id)\n ->where('block_user_id', $suggestion->id)->first();\n\n // Blocked By Others\n $blockedUsersByOthers = BlockList::where('user_id', $suggestion->id)\n ->where('block_user_id', $request->id)->first();\n\n if (!$blockedUsersByYou && !$blockedUsersByOthers) {\n\n $model = Follower::where('follower', $request->id)->where('user_id', $suggestion->id)->first();\n\n $is_follow = DEFAULT_FALSE;\n\n if($model) {\n\n $is_follow = DEFAULT_TRUE;\n\n }\n\n $no_of_followers = Follower::where('user_id', $suggestion->id)->count();\n\n $users[] = [\n 'id'=>$request->id, \n 'follower_id'=>$suggestion->id, \n 'name'=> $suggestion->name, \n 'description'=>$suggestion->description, \n 'picture'=> $suggestion->picture, \n 'is_follow'=>$is_follow,\n 'no_of_followers'=>$no_of_followers ? $no_of_followers : 0\n ];\n\n }\n\n }\n \n } \n\n $data[USERS]['term'] = $request->term;\n\n $data[USERS]['name'] = USERS;\n\n $data[USERS]['see_all_url'] = route('search.users');\n\n $data[USERS]['data'] = $users ? $users : [];\n\n // live videos List\n\n $live_videos = LiveVideo::videoResponse()\n ->leftJoin('users', 'users.id', '=', 'live_videos.user_id')\n ->where('title','like', '%'.$request->term.'%')\n ->skip(0)\n ->take(4)\n ->where('live_videos.is_streaming', DEFAULT_TRUE)\n ->where('live_videos.status', DEFAULT_FALSE)\n ->get();\n\n\n $data[LIVE_VIDEOS]['term'] = $request->term;\n\n $data[LIVE_VIDEOS]['name'] = LIVE_VIDEOS;\n\n $data[LIVE_VIDEOS]['see_all_url'] = route('search.live_videos');\n\n $data[LIVE_VIDEOS]['data'] = $live_videos ? $live_videos : [];\n\n // custom live videos\n\n $live_tv = CustomLiveVideo::liveVideoResponse()\n ->where('custom_live_videos.title','like', '%'.$request->term.'%')\n ->skip(0)\n ->take(4)\n ->where('custom_live_videos.status', APPROVED)\n ->get();\n\n $data[LIVE_TV]['term'] = $request->term;\n\n $data[LIVE_TV]['name'] = LIVE_TV;\n\n $data[LIVE_TV]['see_all_url'] = route('search.live_tv');\n\n $data[LIVE_TV]['data'] = $live_tv ? $live_tv : [];\n\n $response_array = [\n\n 'success' => true,\n\n 'code' => 200,\n\n 'data' => $data\n\n ];\n \n }\n\n return response()->json($response_array , 200);\n\n } catch(Exception $e) {\n\n $error = $e->getMessage();\n\n $error_code = $e->getCode();\n\n $response_array = ['success' => false , 'error' => $error , 'error_code' => $error_code];\n\n return response()->json($response_array , 200);\n }\n\n }", "public function incSearch() {\n\t\t$result = array();\n\t\tif ( current_user_can( 'manage_options' ) ) {\n\t\t\tif ( $this->input->get( 'term' ) ) {\n\t\t\t\t/** @var \\wpdb $wpdb */\n\t\t\t\tglobal $wpdb;\n\t\t\t\t$query = '%' . $this->input->get( 'term' ) . '%';\n\t\t\t\t$sql = <<<SQL\n\t\t\t\t\tSELECT SQL_CALC_FOUND_ROWS\n\t\t\t\t\t\tID, user_login, display_name\n\t\t\t\t\tFROM {$wpdb->users}\n\t\t\t\t\tWHERE user_login LIKE %s\n\t\t\t\t\t OR user_email LIKE %s\n\t\t\t\t\t OR display_name LIKE %s\n ORDER BY display_name ASC\n\t\t\t\t\tLIMIT 10\nSQL;\n\t\t\t\t$result = array_map( function ( $user ) {\n\t\t\t\t\t$user->avatar = get_avatar( $user->ID, '48', '', $user->display_name );\n\n\t\t\t\t\treturn $user;\n\t\t\t\t}, $wpdb->get_results( $wpdb->prepare( $sql, $query, $query, $query ) ) );\n\t\t\t}\n\t\t}\n\t\twp_send_json( $result );\n\t}", "function searchResults( $search = null, $date) {\n\n\tif(empty($date))\n\t{\n\t\techo \"<br> date was not passed <br>\";\n\t\t$date = strftime(\"%F\");\n\t}\n\n\t$offset = 0;\n\t$tweet_data = array();\n\n\tfor($i = 1; $i <= 15; $i++)\n\t{\n\t\t$url = \"http://search.twitter.com/search.json?q=\" . urlencode( $search ) . \"&lang=en&rpp=100&page=\" . $i . \"&result_type=mixed&until=\" . $date;\n\t\t$curl = curl_init();\n\t\tcurl_setopt( $curl, CURLOPT_URL, $url );\n\t\tcurl_setopt( $curl, CURLOPT_RETURNTRANSFER, 1 );\n\t\t$result = curl_exec( $curl );\n\t\tcurl_close( $curl );\n\t\t$return = json_decode( $result, true );\n/*\n\t\techo \"<br><br>\";\n\t\tvar_dump($return);\n\t\techo \"<br><br>\";\n*/\n\t\tif(empty($return[\"results\"]))\n\t\t{\n\t\t\tbreak;\n\t\t}\n\n\t\tfor($n = 0; $n < count($return[\"results\"]); $n++)\n\t\t{\n\t\t\t//print($n+($i-1)*100);\n\t\t\t$tweet_data[$n + $offset/*($i - 1)*100*/][0] = $search;\n\t\t\t$tweet_data[$n + $offset][1] = $return[\"results\"][$n][\"id\"];\n\t\t\t$tweet_data[$n + $offset][2] = utf8_encode($return[\"results\"][$n][\"text\"]) ;\n\t\t\t$tweet_data[$n + $offset][3] = $return[\"results\"][$n][\"created_at\"];\n\t\t}\t\n\t\t$offset += count($return[\"results\"]);\n\t}\n\n\treturn $tweet_data;\n}", "private function genSearchIndex()\n\t{\n\t\t/*\n\t\t * The big array we want to fill ;)\n\t\t */\n\t\t$index = array();\n\t\t\n\t\t/*\n\t\t * Buddies Load persons in the index array that connected with the user\n\t\t */\n\t\t\n\t\t$model = loadModel('buddy');\n\t\tif($buddies = $model->listBuddies())\n\t\t{\n\t\t\t$result = array();\n\t\t\tforeach ($buddies as $b)\n\t\t\t{\n\t\t\t\t$img = '/img/avatar-mini.png';\n\t\t\t\t\n\t\t\t\tif(!empty($b['photo']))\n\t\t\t\t{\n\t\t\t\t\t$img = img($b['photo']);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$result[] = array(\n\t\t\t\t\t'name' => $b['name'].' '.$b['nachname'],\n\t\t\t\t\t'teaser' => '',\n\t\t\t\t\t'img' => $img,\n\t\t\t\t\t'click' => 'chat(\\''.$b['id'].'\\');',\n\t\t\t\t\t'id' => $b['id'],\n\t\t\t\t\t'search' => array(\n\t\t\t\t\t\t$b['name'],$b['nachname']\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t\t$index[] = array(\n\t\t\t\t'title' => 'Menschen die Du kennst',\n\t\t\t\t'key' => 'buddies',\n\t\t\t\t'result' => $result\n\t\t\t);\n\t\t}\n\t\t\n\t\t/*\n\t\t * Groups load Groups connected to the user in the array\n\t\t*/\n\t\t$model = loadModel('groups');\n\t\tif($groups = $model->listMyGroups())\n\t\t{\n\t\t\t$result = array();\n\t\t\tforeach ($groups as $b)\n\t\t\t{\n\t\t\t\t$img = '/img/groups.png';\n\t\t\t\tif(!empty($b['photo']))\n\t\t\t\t{\n\t\t\t\t\t$img = 'images/' . str_replace('photo/','photo/thumb_',$b['photo']);\n\t\t\t\t}\n\t\t\t\t$result[] = array(\n\t\t\t\t\t\t'name' => $b['name'],\n\t\t\t\t\t\t'teaser' => tt($b['teaser'],65),\n\t\t\t\t\t\t'img' => $img,\n\t\t\t\t\t\t'href' => '/?page=bezirk&bid='.$b['id'].'&sub=forum',\n\t\t\t\t\t\t'search' => array(\n\t\t\t\t\t\t\t$b['name']\n\t\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t\t$index[] = array(\n\t\t\t\t\t'title' => 'Deine Gruppen',\n\t\t\t\t\t'result' => $result\n\t\t\t);\n\t\t}\n\t\t\n\t\t/*\n\t\t * Betriebe load food stores connected to the user in the array\n\t\t */\n\t\t$model = loadModel('betrieb');\n\t\tif($betriebe = $model->listMyBetriebe())\n\t\t{\n\t\t\t$result = array();\n\t\t\tforeach ($betriebe as $b)\n\t\t\t{\n\t\t\t\t$result[] = array(\n\t\t\t\t\t\t'name' => $b['name'],\n\t\t\t\t\t\t'teaser' => $b['str'].' '.$b['hsnr'].', '.$b['plz'].' '.$b['stadt'],\n\t\t\t\t\t\t'href' => '/?page=fsbetrieb&id='.$b['id'],\n\t\t\t\t\t\t'search' => array(\n\t\t\t\t\t\t\t$b['name'],$b['str']\n\t\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t\t$index[] = array(\n\t\t\t\t\t'title' => 'Deine Betriebe',\n\t\t\t\t\t'result' => $result\n\t\t\t);\n\t\t}\n\t\t\n\t\t/*\n\t\t * Bezirke load Bezirke connected to the user in the array\n\t\t*/\n\t\t$model = loadModel('bezirk');\n\t\tif($bezirke = $model->listMyBezirke())\n\t\t{\n\t\t\t$result = array();\n\t\t\tforeach ($bezirke as $b)\n\t\t\t{\n\t\t\t\t$result[] = array(\n\t\t\t\t\t\t'name' => $b['name'],\n\t\t\t\t\t\t'teaser' => '',\n\t\t\t\t\t\t'img' => false,\n\t\t\t\t\t\t'href' => '/?page=bezirk&bid='.$b['id'].'&sub=forum',\n\t\t\t\t\t\t'search' => array(\n\t\t\t\t\t\t\t\t$b['name']\n\t\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t\t$index[] = array(\n\t\t\t\t\t'title' => 'Deine Bezirke',\n\t\t\t\t\t'result' => $result\n\t\t\t);\n\t\t}\n\t\t\n\t\t/*\n\t\t * Get or set an individual token as filename for the public json file\n\t\t*/\n\t\tif($token = S::user('token'))\n\t\t{\n Storage::disk('searchindex')->put($token . '.json', json_encode($index));\n\t\t\treturn $token;\n\t\t}\n\t\t\n\t\t\n\t\treturn false;\n\t}", "public function getSearchArray();", "function get_merged_search_array()\n{\n\t$arr1 = get_all_users_array_search();\n\t$arr2 = get_all_courses_array_search();\n\t$arr = array_merge($arr1,$arr2);\n\treturn $arr;\n}", "function show_search_results($result = array())\n\t{\n\t\tglobal $ibforums, $std;\n\n\t\t$this->output .= \"<HR>show_search_results() started.<br>\";\n\n\t\t//\t\t//------------------------------------------------\n\t\t//\t\t// We have a search ID, so lets get the parsed results.\n\t\t//\t\t//------------------------------------------------\n\t\t//\n\n\t\t$tmp_topics = $result['topic_id'];\n\n\t\t$topic_max_hits = \"\"; //$sr['topic_max'];\n\n\t\t$tmp_posts = $result['post_id'];\n\n\t\t$post_max_hits = \"\"; //$sr['post_max'];\n\n\t\t$db_result = $result['result'];\n\t\t//------------------------------------------------\n\t\t// Remove duplicates from the topic_id and post_id\n\t\t//------------------------------------------------\n\n\t\t$topic_max_hits = self::unique_string_items($tmp_topics);\n\t\t$post_max_hits = self::unique_string_items($tmp_posts);\n\n\t\t$topics = $tmp_topics;\n\t\t$posts = $tmp_posts;\n\n\t\t//-------------------------------------\n\n\t\tif (!$topics and !$posts)\n\t\t{\n\t\t\t$std->Error(array(\n\t\t\t 'LEVEL' => 1,\n\t\t\t 'MSG' => 'no_search_results'\n\t\t\t ));\n\t\t}\n\n\t\t$url_words = $result['keywords'];\n\n\t\t$count = 0;\n\n\t\t// ReRead the found topics or posts\n\n\t\tif ($this->result_type == 'topics')\n\t\t{\n\t\t\tif ($this->search_in == 'titles')\n\t\t\t{\n\t\t\t\t$this->fill_read_arrays($topics);\n\n\t\t\t\t$this->output .= $this->start_page($topic_max_hits);\n\n\t\t\t\t$query = \"SELECT\n\t\t\t\t\t\tt.*,\n\t\t\t\t\t\tf.id as forum_id,\n\t\t\t\t\t\tf.name as forum_name\n\t\t\t\t FROM\n\t\t\t\t\t\tibf_topics t,\n\t\t\t\t\t\tibf_forums f\n\t\t\t\t\t WHERE\n\t\t\t\t\t\tt.tid IN(\" . $topics . \") AND\n\t\t\t\t\t\tf.id=t.forum_id AND\n\t\t\t\t\t\tt.approved=1\n\t\t\t\t\t ORDER BY t.pinned DESC,\";\n\n\t\t\t\t// search new topics of user\n\t\t\t\tif ($ibforums->input['new'])\n\t\t\t\t{\n\t\t\t\t\t$query .= \"f.id ASC,\";\n\t\t\t\t}\n\n\t\t\t\t$query .= \"t.\" . $this->sort_key . \" \" . $this->sort_order . \" LIMIT \" . $this->first . \",25\";\n\n\t\t\t\t$stmt = $ibforums->db->query($query);\n\n\t\t\t} else // ( $this->search_in == 'posts' )\n\t\t\t{\n\t\t\t\t//--------------------------------------------\n\t\t\t\t// we have tid and pid to sort out, woohoo NOT\n\t\t\t\t//--------------------------------------------\n\n\t\t\t\t// Array for forum id of each message\n\t\t\t\t$forum_posts = array();\n\n\t\t\t\tif ($posts)\n\t\t\t\t{\n\t\t\t\t\t$stmt = $ibforums->db->query(\"SELECT\n\t\t\t\t\t\tforum_id,\n\t\t\t\t\t\ttopic_id\n\t\t\t\t\tFROM ibf_posts\n\t\t\t\t\tWHERE\n\t\t\t\t\t\tpid IN({$posts})\n\t\t\t\t\t\tAND queued != 1\");\n\t\t\t\t\tif ($topics)\n\t\t\t\t\t{\n\t\t\t\t\t\t$topics = explode(',', $topics);\n\t\t\t\t\t}\n\t\t\t\t\twhile ($pr = $stmt->fetch())\n\t\t\t\t\t{\n\t\t\t\t\t\tif (!in_array($pr['topic_id'], $topics))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$topics[] = $pr['topic_id'];\n\t\t\t\t\t\t\t$topic_max_hits++;\n\n\t\t\t\t\t\t\t$forum_posts[$pr['topic_id']] = $pr['forum_id'];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t$topics = implode(',', $topics);\n\t\t\t\t}\n\n\t\t\t\t$this->fill_read_arrays($topics);\n\n\t\t\t\t$this->output .= $this->start_page($topic_max_hits);\n\n\t\t\t\t$query = \"SELECT\n\t\t\t\t\t\tt.*,\n\t\t\t\t\t\tf.id as forum_id,\n\t\t\t\t\t\tf.name as forum_name\n\t\t\t\t \t FROM ibf_topics t\n\t\t\t\t\t LEFT JOIN ibf_forums f\n\t\t\t\t\t\tON (f.id=t.forum_id)\n\t\t\t\t\t WHERE\n\t\t\t\t\t\tt.tid IN(0\" . $topics . \"0)\n\t\t\t\t\t\tAND t.approved=1\n\t\t\t\t\t ORDER BY\n\t\t\t\t\t\tt.pinned DESC,\";\n\n\t\t\t\t// Search new topics of user\n\t\t\t\tif ($ibforums->input['new'])\n\t\t\t\t{\n\t\t\t\t\t$query .= \"f.id ASC,\";\n\t\t\t\t}\n\n\t\t\t\t$query .= \"t.\" . $this->sort_key . \" \" . $this->sort_order . \" LIMIT \" . $this->first . \",25\";\n\n\t\t\t\t$stmt = $ibforums->db->query($query);\n\t\t\t}\n\n\t\t\t//--------------------------------------------\n\n\t\t\tif ($stmt->rowCount())\n\t\t\t{\n\t\t\t\twhile ($row = $stmt->fetch())\n\t\t\t\t{\n\t\t\t\t\tif ($row['club'] and $std->check_perms($ibforums->member['club_perms']) == FALSE)\n\t\t\t\t\t{\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\t$count++;\n\n\t\t\t\t\t$row['keywords'] = $url_words;\n\n\t\t\t\t\tif ($row['pinned'])\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->output .= View::make(\"search.RenderPinnedRow\", ['Data' => $this->parse_entry($row)]);\n\t\t\t\t\t} else\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->output .= View::make(\"search.RenderRow\", ['Data' => $this->parse_entry($row)]);\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t} else\n\t\t\t{\n\t\t\t\tif (!$this->debug)\n\t\t\t\t{\n\t\t\t\t\t$std->Error(array(\n\t\t\t\t\t 'LEVEL' => 1,\n\t\t\t\t\t 'MSG' => 'no_search_results'\n\t\t\t\t\t ));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//--------------------------------------------\n\t\t\t$this->output .= View::make(\"search.end\", ['Data' => array('SHOW_PAGES' => $this->links)]);\n\n\t\t} else // ( $this->result_type == 'posts' )\n\t\t{\n\n\t\t\t$this->parser = new PostParser();\n\n\t\t\tif ($this->search_in == 'titles')\n\t\t\t{\n\t\t\t\t$this->output .= $this->start_page($topic_max_hits, 1);\n\n\t\t\t\t$stmt = $ibforums->db->query(\"SELECT\n\t\t\t\t\t\tt.*,\n\t\t\t\t\t\tp.pid,\n\t\t\t\t\t\tp.author_id,\n\t\t\t\t\t\tp.author_name,\n\t\t\t\t\t\tp.post_date,\n\t\t\t\t\t\tp.post,\n\t\t\t\t\t\tf.id as forum_id,\n\t\t\t\t\t\tf.name as forum_name\n\t\t\t\t\tFROM ibf_topics t\n\t\t\t\t\tLEFT JOIN ibf_posts p\n\t\t\t\t\t\tON (t.tid=p.topic_id\n\t\t\t\t\t\t AND p.new_topic=1\n\t\t\t\t\t\t AND p.use_sig=0)\n\t\t\t\t\tLEFT JOIN ibf_forums f\n\t\t\t\t\t\tON (f.id=t.forum_id)\n\t\t\t\t\tWHERE\n\t\t\t\t\t\tt.tid IN(0{$topics}-1)\n\t\t\t\t\t\tAND p.queued != 1\n\t\t\t\t\t\tAND t.approved=1\n\t\t\t\t\tORDER BY p.post_date DESC\n\t\t\t\t\tLIMIT {$this->first},25\");\n\n\t\t\t} else // ( $this->search_in == 'posts' )\n\t\t\t{\n\t\t\t\t$this->parser->prepareIcons();\n\n\t\t\t\tif ($topics)\n\t\t\t\t{\n\t\t\t\t\t$stmt = $ibforums->db->query(\"SELECT\n\t\t\t\t\t\tpid\n\t\t\t\t\tFROM\n\t\t\t\t\t\tibf_posts\n\t\t\t\t\tWHERE\n\t\t\t\t\t\ttopic_id IN(0{$topics}0) AND\n\t\t\t\t\t\tnew_topic=1 AND\n\t\t\t\t\t\tqueued != 1\");\n\n\t\t\t\t\twhile ($pr = $stmt->fetch())\n\t\t\t\t\t{\n\t\t\t\t\t\tif (!preg_match(\"/,\" . $pr['pid'] . \",/\", $posts))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$posts .= $pr['pid'] . \",\";\n\t\t\t\t\t\t\t$post_max_hits++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t$posts = str_replace(\",,\", \",\", $posts);\n\t\t\t\t}\n\n\t\t\t\t$this->output .= $this->start_page($post_max_hits, 1);\n\n\t\t\t\t$stmt = $ibforums->db->query(\"SELECT\n\t\t\t\t\t\tt.*,\n\t\t\t\t\t\tp.pid,\n\t\t\t\t\t\tp.author_id,\n\t\t\t\t\t\tp.author_name,\n\t\t\t\t\t\tp.post_date,\n\t\t\t\t\t\tp.post,\n\t\t\t\t\t\tp.use_emo,\n\t\t\t\t\t\tf.id as forum_id,\n\t\t\t\t\t\tf.forum_highlight,\n\t\t\t\t\t\tf.highlight_fid as hid,\n\t\t\t\t\t\tf.name as forum_name,\n\t\t\t\t\t\tf.use_html,\n\t\t\t\t\t\tg.g_dohtml,\n\t\t\t\t\t\tp.ip_address\n\t\t\t\t\tFROM ibf_posts p\n\t\t\t\t\tLEFT JOIN ibf_topics t\n\t\t\t\t\t\tON (t.tid=p.topic_id)\n\t\t\t\t\tLEFT JOIN ibf_forums f\n\t\t\t\t\t\tON (f.id=p.forum_id)\n\t\t\t\t\tLEFT JOIN ibf_members m\n\t\t\t\t\t\tON (m.id=p.author_id)\n\t\t\t\t\tLEFT JOIN ibf_groups g\n\t\t\t\t\t\tON (m.mgroup=g.g_id)\n\t\t\t\t\tWHERE\n\t\t\t\t\t\tp.pid IN(0{$posts}0) AND\n\t\t\t\t\t\tp.use_sig=0 AND\n\t\t\t\t\t\tp.queued != 1 AND\n\t\t\t\t\t\tt.approved=1\n\t\t\t\t\tORDER BY p.post_date DESC\n\t\t\t\t\tLIMIT {$this->first},25\");\n\t\t\t}\n\n\t\t\t$this->show_result_from_select($stmt, $post_max_hits, 1);\n\t\t}\n\n\t\t$this->output .= \"\n\t\t\t<hr>\n\t\t\t'search_in'\t= {$this->search_in}<br>\n\t\t\t'sort_key'\t= {$this->sort_key}<br>\n\t\t\t'sort_order'\t= {$this->sort_order}<br>\n\t\t\t'keywords'\t= {$result['keywords']}<br>\n\t\t\t'wordlist'\t= {$result['wordlist']}<br>\n\t\t\t't_query'\t= {$result['t_query']}<br><br>\n\t\t\t'p_query'\t= {$result['p_query']}<br><br>\n\t\t\t'search_count'\t= {$result['search_count']}<br><br>\n\n\t\t\t'old_topics_query'\t= {$result['topics_query']}<br><br>\n\t\t\t'topic_id'\t= {$result['topic_id']}<br>\n\t\t\t'topic_max'\t= {$result['topic_max']}<br><br>\n\n\t\t\t'old_posts_query'\t= {$result['posts_query']}<br><br>\n\t\t\t'post_id'\t= {$result['post_id']}<br>\n\t\t\t'post_max'\t= {$result['post_max']}<br><br>\n\n\t\t\t'topics'\t= {$topics}<br>\n\t\t\t'posts'\t\t= {$posts}<br>\n\";\n\n\t\treturn;\n\n\t\tif (!$this->debug)\n\t\t{\n\t\t\tif ($count <= 0)\n\t\t\t{\n\t\t\t\t$std->Error(array(\n\t\t\t\t 'LEVEL' => 1,\n\t\t\t\t 'MSG' => 'no_search_results'\n\t\t\t\t ));\n\t\t\t}\n\t\t}\n\t\t// club tool\n\n\t\t$this->page_title = $ibforums->lang['search_results'];\n\n\t\tif ($ibforums->input['nav'] == 'lv')\n\t\t{\n\t\t\t$this->nav = array($ibforums->lang['nav_since_lv']);\n\n\t\t} elseif ($ibforums->input['nav'] == 'my_lv')\n\t\t{\n\t\t\t$this->nav = array($ibforums->lang['my_nav_since_lv']);\n\n\t\t} elseif ($ibforums->input['nav'] == 'lt')\n\t\t{\n\t\t\t$this->nav = array($ibforums->lang['nav_lt']);\n\n\t\t} elseif ($ibforums->input['nav'] == 'au')\n\t\t{\n\t\t\t$this->nav = array($ibforums->lang['nav_au']);\n\t\t} else\n\t\t{\n\t\t\t$this->nav = array(\n\t\t\t\t\"<a href='{$this->base_url}&act=Search'>{$ibforums->lang['search_form']}</a>\",\n\t\t\t\t$ibforums->lang['search_title']\n\t\t\t);\n\t\t}\n\t}", "function search($query1) {\n $db = mysqli_connect('localhost', 'root', '', 'registration');\n if ($db->connect_error) {\n die(\"Connection failed: \" . $db->connect_error);\n return;\n }\n $searchResult = [];\n $result1 = mysqli_query($db, $query1);\n if (mysqli_num_rows($result1) > 0) {\n // output data of each row\n while($row = mysqli_fetch_assoc($result1)) {\n array_push($searchResult, $row);\n //echo \"firstname: \" . $row[\"firstname\"]. \" - username: \" . $row[\"username\"]. \" -lastname:\" . $row[\"lastname\"]. \"<br>\";\n }\n } else {\n echo \"0 results\";\n }\n mysqli_close($db);\n //echo $finalResult;\n return $searchResult;\n}", "public function search(Request $request)\n {\n $this->validate($request, [\n 'search' => 'required'\n ]);\n\n $search = $request->search;\n $name = session('name');\n\n\n\n\n //$array = Twitter::getHomeTimeline(['count' => 10, 'format' => 'array']);\n $array = Twitter::getUserTimeline(['screen_name' => $name, 'count' => 20, 'format' => 'array']);\n\n\n function search_array($array, $val){\n $ArrIterator = new RecursiveIteratorIterator(new RecursiveArrayIterator($array));\n foreach($ArrIterator as $id => $sub){\n $childArray = $ArrIterator->getSubIterator();\n if(strstr(strtolower($sub), strtolower($val))){\n $childArray = iterator_to_array($childArray);\n $result[] = $childArray;\n }\n }\n return $result;\n }\n\n $data = search_array($array, $search);\n\n\n return view('twitter',compact('data'));\n\n// return back();\n }", "private function rest_search() {\n\t\t// return json elements here\n\t}", "function parseFullResults($results) {\n\t\tfor ($i = 0; $i < count($results); $i++) {\n\t\t\t$results[$i][\"hash\"] = getHashCode($results[$i][\"id\"]);\n\t\t\t$results[$i][\"title\"] = stripslashes($results[$i][\"title\"]);\n\t\t}\n\t\treturn $results;\n\t}", "public function global_search($query)\n {\n global $db, $system;\n $results = [];\n $offset *= $system['max_results'];\n /* search posts */\n $posts = $this->global_profile_get_posts(array('query' => $query));\n if (count($posts) > 0) {\n $results['posts'] = $posts;\n }\n\n /* search articles */\n if ($system['blogs_enabled']) {\n $get_articles = $db->query(sprintf('SELECT post_id FROM posts_articles WHERE title LIKE %1$s OR text LIKE %1$s OR tags LIKE %1$s ORDER BY title ASC LIMIT %2$s, %3$s', secure($query, 'search'), secure($offset, 'int', false), secure($system['max_results'], 'int', false))) or _error(\"SQL_ERROR_THROWEN\");\n if ($get_articles->num_rows > 0) {\n while ($article = $get_articles->fetch_assoc()) {\n $article = $this->global_profile_get_posts($article['post_id']);\n if ($article) {\n $results['articles'][] = $article;\n }\n }\n }\n }\n /* search users */\n $get_users = $db->query(sprintf('SELECT users.user_id, users.user_name, global_profile.user_firstname, global_profile.user_lastname, global_profile.user_gender, user_picture, global_user_picture,user_subscribed, user_verified FROM users LEFT JOIN global_profile ON global_profile.user_id = users.user_id WHERE users.user_name LIKE %1$s OR global_profile.user_firstname LIKE %1$s OR global_profile.user_lastname LIKE %1$s OR CONCAT(global_profile.user_firstname, \" \", global_profile.user_lastname) LIKE %1$s ORDER BY global_profile.user_firstname ASC LIMIT %2$s, %3$s', secure($query, 'search'), secure($offset, 'int', false), secure($system['max_results'], 'int', false))) or _error(\"SQL_ERROR_THROWEN\");\n if ($get_users->num_rows > 0) {\n while ($user = $get_users->fetch_assoc()) {\n $user['user_picture'] = get_picture($user['global_user_picture'], $user['user_gender']);\n /* get the connection between the viewer & the target */\n $user['connection'] = $this->connection($user['user_id']);\n if ($user['user_firstname'] != \"\") {\n $results['users'][] = $user;\n }\n }\n }\n /* search pages */\n if ($system['pages_enabled']) {\n $get_pages = $db->query(sprintf('SELECT * FROM pages WHERE page_name LIKE %1$s OR page_title LIKE %1$s ORDER BY page_title ASC LIMIT %2$s, %3$s', secure($query, 'search'), secure($offset, 'int', false), secure($system['max_results'], 'int', false))) or _error(\"SQL_ERROR_THROWEN\");\n if ($get_pages->num_rows > 0) {\n while ($page = $get_pages->fetch_assoc()) {\n $page['page_picture'] = get_picture($page['page_picture'], 'page');\n /* check if the viewer liked the page */\n $page['i_like'] = $this->check_page_membership($this->_data['user_id'], $page['page_id']);\n $results['pages'][] = $page;\n }\n }\n }\n /* search groups */\n if ($system['groups_enabled']) {\n $get_groups = $db->query(sprintf('SELECT * FROM `groups` WHERE group_privacy != \"secret\" AND (group_name LIKE %1$s OR group_title LIKE %1$s) ORDER BY group_title ASC LIMIT %2$s, %3$s', secure($query, 'search'), secure($offset, 'int', false), secure($system['max_results'], 'int', false))) or _error(\"SQL_ERROR_THROWEN\");\n if ($get_groups->num_rows > 0) {\n while ($group = $get_groups->fetch_assoc()) {\n $group['group_picture'] = get_picture($group['group_picture'], 'group');\n /* check if the viewer joined the group */\n $group['i_joined'] = $this->check_group_membership($this->_data['user_id'], $group['group_id']);\n $results['groups'][] = $group;\n }\n }\n }\n /* search events */\n if ($system['events_enabled']) {\n $get_events = $db->query(sprintf('SELECT * FROM `events` WHERE event_privacy != \"secret\" AND event_title LIKE %1$s ORDER BY event_title ASC LIMIT %2$s, %3$s', secure($query, 'search'), secure($offset, 'int', false), secure($system['max_results'], 'int', false))) or _error(\"SQL_ERROR_THROWEN\");\n if ($get_events->num_rows > 0) {\n while ($event = $get_events->fetch_assoc()) {\n $event['event_picture'] = get_picture($event['event_cover'], 'event');\n /* check if the viewer joined the event */\n $event['i_joined'] = $this->check_event_membership($this->_data['user_id'], $event['event_id']);\n $results['events'][] = $event;\n }\n }\n }\n //echo \"<pre>\";print_r($results); exit;\n return $results;\n }", "function get_all_user($result = 'posts')\n\t{\n\t\tglobal $ibforums, $std, $print;\n\n\t\t//------------------------------------\n\t\t// Do we have flood control enabled?\n\t\t//------------------------------------\n\n\t\tif ($ibforums->member['g_search_flood'] > 0)\n\t\t{\n\t\t\t$flood_time = time() - $ibforums->member['g_search_flood'];\n\n\t\t\t// Get any old search results..\n\n\t\t\t$stmt = $ibforums->db->query(\"SELECT id\n\t\t\t\t\tFROM ibf_search_results\n\t\t\t\t\tWHERE\n\t\t\t\t\t\t(member_id='\" . $ibforums->member['id'] . \"' OR ip_address='\" . $ibforums->input['IP_ADDRESS'] . \"') AND\n\t\t\t\t\t\tsearch_date > '$flood_time'\");\n\n\t\t\tif ($stmt->rowCount())\n\t\t\t{\n\t\t\t\t$std->Error(array(\n\t\t\t\t 'LEVEL' => 1,\n\t\t\t\t 'MSG' => 'search_flood',\n\t\t\t\t 'EXTRA' => $ibforums->member['g_search_flood']\n\t\t\t\t ));\n\t\t\t}\n\t\t}\n\n\t\t$ibforums->input['forums'] = 'all';\n\n\t\t$forums = $this->get_searchable_forums();\n\n\t\t//------------------------------------\n\t\t// Do we have any forums to search in?\n\t\t//------------------------------------\n\n\t\tif (!$forums)\n\t\t{\n\t\t\t$std->Error(array('LEVEL' => 1, 'MSG' => 'no_search_forum'));\n\t\t}\n\n\t\t$mid = intval($ibforums->input['mid']);\n\n\t\tif (!$mid)\n\t\t{\n\t\t\t$std->Error(array('LEVEL' => 1, 'MSG' => 'no_search_results'));\n\t\t}\n\n\t\t//------------------------------------------------\n\t\t// Get the topic ID's to serialize and store into\n\t\t// the database\n\t\t//------------------------------------------------\n\n\t\t$posts = \"\";\n\n\t\tif ($result == 'posts')\n\t\t{\n\t\t\t$stmt = $ibforums->db->query(\"SELECT pid\n\t\t\t\tFROM ibf_posts\n\t\t\t\tWHERE\n\t\t\t\t\tqueued != 1 AND\n\t\t\t\t\tforum_id IN($forums) AND\n\t\t\t\t\tauthor_id=$mid\");\n\n\t\t\t$max_hits = $stmt->rowCount();\n\n\t\t\twhile ($row = $stmt->fetch())\n\t\t\t{\n\t\t\t\t$posts .= $row['pid'] . \",\";\n\t\t\t}\n\n\t\t} else // ( $result == 'topics' )\n\t\t{\n\t\t\t$stmt = $ibforums->db->query(\"SELECT tid\n\t\t\t\tFROM ibf_topics\n\t\t\t\tWHERE\n\t\t\t\t\tforum_id IN($forums) AND\n\t\t\t\t\tapproved=1 AND\n\t\t\t\t\tstarter_id=$mid\");\n\n\t\t\t$max_hits = $stmt->rowCount();\n\n\t\t\twhile ($row = $stmt->fetch())\n\t\t\t{\n\t\t\t\t$posts .= $row['tid'] . \",\";\n\t\t\t}\n\t\t}\n\n\t\t$stmt->closeCursor();\n\n\t\t$posts = preg_replace(\"/,$/\", \"\", $posts);\n\n\t\t//------------------------------------------------\n\t\t// Do we have any results?\n\t\t//------------------------------------------------\n\n\t\tif (!$posts)\n\t\t{\n\t\t\t$std->Error(array('LEVEL' => 1, 'MSG' => 'no_search_results'));\n\t\t}\n\n\t\t//------------------------------------------------\n\t\t// If we are still here, store the data into the database...\n\t\t//------------------------------------------------\n\n\t\t$unique_id = md5(uniqid(microtime(), 1));\n\n\t\tif ($result == 'posts')\n\t\t{\n\t\t\t$data = [\n\t\t\t\t'id' => $unique_id,\n\t\t\t\t'search_date' => time(),\n\t\t\t\t'post_id' => $posts,\n\t\t\t\t'post_max' => $max_hits,\n\t\t\t\t'sort_key' => $this->sort_key,\n\t\t\t\t'sort_order' => $this->sort_order,\n\t\t\t\t'member_id' => $ibforums->member['id'],\n\t\t\t\t'ip_address' => $ibforums->input['IP_ADDRESS'],\n\t\t\t];\n\t\t} else\n\t\t{\n\t\t\t$data = [\n\t\t\t\t'id' => $unique_id,\n\t\t\t\t'search_date' => time(),\n\t\t\t\t'topic_id' => $posts,\n\t\t\t\t'topic_max' => $max_hits,\n\t\t\t\t'sort_key' => $this->sort_key,\n\t\t\t\t'sort_order' => $this->sort_order,\n\t\t\t\t'member_id' => $ibforums->member['id'],\n\t\t\t\t'ip_address' => $ibforums->input['IP_ADDRESS'],\n\t\t\t];\n\t\t}\n\n\t\t$ibforums->db->insertRow(\"ibf_search_results\", $data);\n\n\t\t$print->redirect_screen($ibforums->lang['search_redirect'], \"act=Search&nav=au&CODE=show&searchid=$unique_id&search_in={$result}&result_type={$result}\");\n\n\t\texit();\n\t}", "static function searchArtists($search){\n $search = \"%\".$search.\"%\";\n $req = \"SELECT *\n FROM \".DB::$tableArtists.\"\n WHERE `nom_artist` LIKE :query\n LIMIT 0 , 7\";\n $query = DB::$db->prepare($req);\n $query->bindParam(':query', $search, PDO::PARAM_STR);\n $query->execute();\n $result = [];\n while($data = $query->fetch()){\n $Artist = new Artist();\n $Artist->id = $data['id_artist'];\n $Artist->name = $data['nom_artist'];\n\n $result[] = $Artist;\n }\n return $result;\n }", "public function ConstructSearchResults($encodedVal){\n\t\t$val = array();\n\t\t$val = json_decode($encodedVal, true);\n\t\tfor ($i = 0; $i < count($val); $i++) { \n\t\t\t$name = $val[$i]['name'];\n\t\t\t$url = $val[$i]['url'];\n\t\t\t$imgUrl = $val[$i]['imgUrl'];\n\t\t\t?>\n\t\t\t\t<div class=\"row resultcontent\">\n\t\t\t\t\t<a href=\"<?php echo $url;?>\">\n\t\t\t\t\t\t<div class=\"col-sm-8 searchRsltCont\">\n\t\t\t\t\t\t\t<img src=\"<?php echo $imgUrl;?>\" class=\"searchRsltimg\" alt=\"search result image\" />\n\t\t\t\t\t\t\t<div class=\"contshading\">\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class=\"col-sm-4 searchRslttxt\">\n\t\t\t\t\t\t\t<h1><?php echo $name;?></h1>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</a>\n\t\t\t\t</div>\n\t\t\t<?php\n\t\t}\n\t}", "function get_urls($count, $start, $urls, $filter) {\n\tif ($start < $count) {\n\t\t$sparql = new EasyRdf_Sparql_Client(esc_attr(get_option( 'endpoint')));\n\t\t$result = $sparql->query(\n\t\t\t'SELECT distinct ?url ?date WHERE {\n\t\t\t\t ?url rdf:type <http://schema.org/CreativeWork>;\n\t\t\t\t '.$filter.'\n\t\t\t\t}\n\t\t\t\tORDER BY DESC(?date)\n\t\t\t\tLIMIT 50\n\t\t\t\tOFFSET ' . $start\n\t\t);\n\t\tforeach ($result as $row) {\n\t\t\techo '<br/>adding to array: '. $row->url;\n\t\t\tarray_push($urls, $row->url);\n\t\t}\n\t\tget_urls($count, $start += 50, $urls, $filter);\n\t} else {\n\t\tprocess_urls($urls);\t\n\t}\n\t\n\t\n}", "function getArticleList($search_content, $nbArticles) {\r\n $query1 = createQuery($search_content, '%20');\r\n $query2 = 'http://lemoteur.orange.fr/?module=lemoteur&bhv=actu&kw='.$query1;\r\n // The DOM variable contains the DOM of the search result\r\n $dom = getPageContent($query2);\r\n\r\n $articles = array();\r\n $cursor = 0;\r\n foreach ($dom->find('div.entry') as $articleContent) {\r\n $articleText = $articleContent->plaintext;\r\n $articleLink = $articleContent->find('a')[0];\r\n $articleTitle = $articleLink->plaintext;\r\n $articleUrl = $articleContent->find('a')[0]->href;\r\n\r\n $articleArray = [\r\n \"text\" => $articleText,\r\n \"link\" => $articleLink,\r\n \"title\" => $articleTitle,\r\n \"url\" => $articleUrl,\r\n ];\r\n\r\n array_push($articles, $articleArray);\r\n $cursor++;\r\n if ($cursor > $nbArticles) {\r\n break;\r\n }\r\n }\r\n\r\n return $articles;\r\n\r\n}", "private function staggeredSearch($inputArray = []) {\n $results = [];\n $exactMatchesResults = [];\n $pinyinResults = [];\n $translationResults = [];\n \n\n // Exact pinyin results, items that match exactly\n foreach ($inputArray as $inputItem) {\n\n $exactMatchesResults = \\App\\Character::where('pinyin', $inputItem)\n ->orWhere('pinyin_normalised', $inputItem)->orderBy('freq', 'asc')->get();\n\n // for each result in the above collections, add to results array\n\n foreach($exactMatchesResults as $result) {\n if (! in_array($result, $results)) {\n array_push($results, $result);\n }\n }\n }\n\n // pinyin results using \"like\" operator\n foreach ($inputArray as $inputItem) {\n \n $pinyinResults = \\App\\Character::where('pinyin', 'like', '%' . $inputItem .'%')\n ->orWhere('pinyin_normalised', 'like', '%' . $inputItem .'%')->orderBy('freq', 'asc')->get();\n\n // for each result in the above collections, add to results array\n\n foreach($pinyinResults as $result) {\n if (! in_array($result, $results)) {\n array_push($results, $result);\n }\n }\n }\n\n // translation and heisig results using \"like\" operator\n foreach ($inputArray as $inputItem) {\n\n $translationResults = \\App\\Character::where('heisig_keyword', 'like', '%' . $inputItem .'%')\n ->orWhere('translations', 'like', '%' . $inputItem .'%')\n ->orWhere('heisig_number', 'like', '%' . $inputItem .'%')->get();\n\n // for each result in the above collections, add to results array\n foreach($translationResults as $result) {\n if (! in_array($result, $results)) {\n array_push($results, $result);\n }\n }\n }\n\n return $results;\n }", "public function getOtherLikes(array $facebook_uids = array()){\r\n\t\t$result = array();\r\n\r\n\t\tif(empty($facebook_uids)){\r\n\t\t\t$facebook_uids = array($this->getFacebookUid());\r\n\t\t}\r\n\t\t$http_params = array(\r\n\t\t\t'ids' => implode(',',$facebook_uids),\r\n\t\t\t'fields' => implode(',',self::$graph_like_fields),\r\n\t\t);\r\n\r\n\t\ttry{\r\n\t\t\t$info_result = $this->facebook_obj->api('?'.http_build_query($http_params, null, '&'));\r\n\t\t}catch(Exception $e){\r\n\t\t\treturn array();\r\n\t\t}\r\n\r\n\t\tif(isset($info_result['error_code'])) {\r\n\t\t\treturn $result;\r\n\t\t}\r\n\t\tforeach($info_result as $facebook_uid => $user_data){\r\n\t\t\t$result[$facebook_uid] = '';\r\n\t\t\tif(!is_array($user_data) || !array_key_exists(self::OTHER_LIKE_FIELD,$user_data) || empty($user_data[self::OTHER_LIKE_FIELD]['data'])){\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\r\n\t\t\t//consume all data except \"other\" likes\r\n\t\t\t$defined_likes = array();\r\n\t\t\tforeach(self::$graph_like_fields as $like_field){\r\n\t\t\t\tif($like_field == self::OTHER_LIKE_FIELD || !array_key_exists($like_field,$user_data) || !is_array($user_data[$like_field]['data'])){\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\tforeach ($user_data[$like_field]['data'] as $defined_like){\r\n\t\t\t\t\tif(isset($defined_like['name'])){\r\n\t\t\t\t\t\t$defined_likes[$defined_like['id']] = $defined_like['name'];\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t//compare \"other\" likes to defined ones\r\n\t\t\t$other_likes = array();\r\n\t\t\tforeach($user_data[self::OTHER_LIKE_FIELD]['data'] as $other_like){\r\n\t\t\t\tif(!array_key_exists($other_like['id'],$defined_likes) && array_key_exists('name', $other_like)){\r\n\t\t\t\t\t$other_likes[$other_like['id']] = $other_like['name'];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t$result[$facebook_uid] = implode(', ',$other_likes);\r\n\t\t}\r\n\t\treturn $result;\r\n\t}", "function getSearchInfo()\n\t{\n\t\t//Global allows variables outside the function scope to be used here\n\t\tglobal $conn;\n\t\tglobal $myObj;\n\t\tglobal $params_arr;\n\t\t\n\t\t\n\t\t$keyword = $params_arr[0];\n\t\t$order = $params_arr[1];\n\t\t\n\t\t$sql = \"SET @SEARCH_TERM = '%$keyword%';\";\n\t\t\n\t\tif ($conn->query($sql) === TRUE) \n\t\t{\n\t\t\t//echo \"New record created successfully\";\n\t\t} \n\t\telse \n\t\t{\n\t\t\techo \"Error: \" . $sql . \"<br>\" . $conn->error;\n\t\t}\n\n\n\t\t$sql = \"SELECT books.COVER, books.TITLE, books.GENRE, books.PUBLISHER, authors.FIRST_NAME, authors.LAST_NAME, books.PUB_DATE,\n\t\t\t \t\t books.DESCRIPTION, authors.BIO, books.ISBN, books.ID\n\t\t\t\t FROM books \n\t\t\t\t JOIN authors ON books.AUTHOR = authors.ID\n\t\t\t\t WHERE authors.FIRST_NAME LIKE @SEARCH_TERM OR\n\t\t\t authors.LAST_NAME LIKE @SEARCH_TERM OR \n\t\t\t\t\t\tbooks.TITLE LIKE @SEARCH_TERM OR\n\t\t\t\t\t\tbooks.GENRE LIKE @SEARCH_TERM\n\t\t\t\tORDER BY books.TITLE $order\n\t\t\t\t\n\t\t\t\t\";\n\t\t\t\t//Limit $offset; \n\t\t\t\t//@Julian then here I have LIMIT of per page here $offset so if 10 or 20 placed here just like ASC/DESC\n\n\t\t//Executes query string\n\t\t$result = $conn->query($sql);\n\t\t//Im making the page number between 10 and 20\n\t\tif ($result->num_rows > 0) \n\t\t{\n\t\t\t$json = array();\n\t \t// convert the data into json object\n\t \twhile($row = $result->fetch_assoc()) \n\t \t{\n\t\t\t\t$bus = array(\n\t\t\t\t\t\"cover\" => $row[\"COVER\"],\n\t\t\t\t\t\"title\" => $row[\"TITLE\"],\n\t\t\t\t\t\"author\" => $row[\"FIRST_NAME\"]. \" \" .$row[\"LAST_NAME\"],\n\t\t\t\t\t\"genre\" => $row[\"GENRE\"],\n\t\t\t\t\t\"publisher\" => $row[\"PUBLISHER\"],\n\t\t\t\t\t\"pub_date\" => $row[\"PUB_DATE\"],\n\t\t\t\t\t\"description\" => $row[\"DESCRIPTION\"],\n\t\t\t\t\t\"bio\" => $row[\"BIO\"],\n\t\t\t\t\t\"isbn\" => $row[\"ISBN\"],\n\t\t\t\t\t\"id\" => $row[\"ID\"]\n\t\t\t\t);\n\n\t\t\t\tarray_push($json, $bus);\n\t\t\t\t\n\t\t\t}\n\n\t\t\t$jsonstring = json_encode($json);\n\t\t\techo $jsonstring;\n\t\t}\n\t\telse\n\t\t{\n\t\t echo \"0 results\";\n\t\t}\n\n\n\n\t\t$conn->close();\n\t}", "private function makeQuerySplit(){\n\t\t\n\t\t$this->searchQ['select'] = array('l.name','l.level_id AS levelId','l.summary','l.sum_approach','l.sum_problems','l.address_line_1','l.address_line_2','l.town','l.county','l.postcode','l.country','l.phone','l.image','l.latitude','l.longitude','l.publish_address','l.publish_phone','l.approved','p.uri','p.urlname','e.level','y.listing_type');\n\t\t$this->searchQ['orderby'][] = 'levelId DESC';\n\t\t$this->searchQ['from'] = 'listing l, listing_level e, listing_type y, pages p'; //should always be the same...\n\t\t$this->searchQ['where'] = array('e.level_id = l.level_id','y.listing_type_id = l.listing_type_id','l.page_id = p.page_id','l.publish = 1');//,'p.publish = 1');\n\t\t\n\t\t\n\t\t//! freetext\n\t\tif( strlen($this->vars['term']) ){\n\t\t\t$this->searchQ['select'][] = \"MATCH(\" . $this->ftfields . \") AGAINST ('\" . $this->booleanAndTerm($this->vars['term']) . \"' IN BOOLEAN MODE) AS score\";\n\t\t\t//$this->searchQ['where'][] = \"MATCH(\" . $ftfields . \") AGAINST ('\" . $this->booleanAndTerm($this->vars['term']) . \"' IN BOOLEAN MODE)\";\n\t\t\t// use having rather than where\n\t\t\t$this->searchQ['having'][] = \"score > 0\";\n\t\t\t$this->searchQ['orderby'][] = 'score DESC';\n\t\t\t$this->doSearch = true;\n\t\t}\n\t\t\n\t\t\n\t\t//! **** FILTERS ****\n\t\t//! profession\n\t\tif( isset($this->vars['profession']) && strlen($this->vars['profession']) ){\n\t\t\n\t\t\t//$this->searchQ['where'][] = \" l.listing_type_id IN (\" . implode(',', $this->vars['profession']) . \") \";\n\t\t\t$this->searchQ['where'][] = \" l.listing_type_id = \" . (int)$this->vars['profession'] . \" \";\n\t\t\t$this->doSearch = true;\n\t\t}\n\t\t//! max price\n\t\tif( isset($this->vars['maxprice']) && is_numeric($this->vars['maxprice']) ){\n\t\t\n\t\t\t$this->searchQ['where'][] = \" l.hourly_rate <= \" . (int)$this->vars['maxprice'] . \" \";\n\t\t\t$this->doSearch = true;\n\t\t}\n\t\t\n\t\t//! gender\n\t\tif( isset($this->vars['gender']) && in_array($this->vars['gender'] , array('M','F')) ){\n\t\t\n\t\t\t$this->searchQ['from'] .= ', listing_to_gender ltg';\n\t\t\t$this->searchQ['where'][] = \" ltg.listing_id = l.listing_id \";\n\t\t\t$this->searchQ['where'][] = \" ltg.gender = '\" . $this->vars['gender'] . \"' \";\n\t\t\t$this->doSearch = true;\n\t\t}\n\t\n\t\t//! speciality\n\t\tif( isset($this->vars['speciality']) && is_numeric($this->vars['speciality']) ){\n\t\t\n\t\t\t$this->searchQ['from'] .= ', listing_to_age ltag';\n\t\t\t$this->searchQ['where'][] = \" ltag.listing_id = l.listing_id \";\n\t\t\t$this->searchQ['where'][] = \" ltag.age_id = \" . (int)$this->vars['speciality'] . \" \";\n\t\t\t$this->doSearch = true;\n\t\t}\n\t\t\n\t\tif( strlen($this->vars['location']) ){\n\t\t\t//! ** build the location query **\n\t\t\t\n\t\t\t$this->Geocode = new Geolocation( $this->vars['location']. ', UK' );\n\t\t\t$this->Geocode->lookup();\n\t\t\t$union = array();\n\t\t\t\n\t\t\t$this->doSearch = true;\n\t\t\t$this->searchQ['orderby'][] = 'distance ASC';\n\t\t\t$c = 1;\t\n\t\t\tforeach($this->searchLevels as $level_id => $distance){\n\t\t\t// set up the initial search variables\t\t\n\t\t\t//! location\n\t\t\t\t\n\t\t\t\t//load in current other query info for this level\n\t\t\t\t$l_select = $this->searchQ['select'];\n\t\t\t\t$l_where = $this->searchQ['where'];\n\t\t\t\t$l_having = $this->searchQ['having'];\n\t\t\t\t\n\t\t\t\t// using the OS grid as makes calculation simpler than using lng/lat - can use simple pythag rather than calculus functions\n\t\t\t\t// we shorten the list of rows needing the calculation by the greater / less than in the where\n\t\t\t\t\n\t\t\t\t$calculation = ' SQRT(POW(( l.easting - ' . round($this->Geocode->getOSEast()) . '),2) + POW((l.northing - ' . round($this->Geocode->getOSNorth()) . '),2)) ';\n\t\t\t\t$l_select[] = $calculation . \" AS distance\";\n\t\t\t\t$l_where[] = \"l.level_id = \" . $level_id;\n\t\t\t\t$l_where[] = \"northing < \" . round( $this->Geocode->getOSNorth() + $distance ) ; \n\t\t\t\t$l_where[] = \"northing > \" . round( $this->Geocode->getOSNorth() - $distance ) ;\n\t\t\t\t$l_where[] = \"easting < \" . round( $this->Geocode->getOSEast() + $distance ) ;\n\t\t\t\t$l_where[] = \"easting > \" . round( $this->Geocode->getOSEast() - $distance ) ;\n\t\t\t//\t$this->searchQ['where'][] = \"(\" . $calculation . \") <= \" . $this->searchDistance ;\n\t\t\t// use having rather than where\n\t\t\t\t$l_having[] = \"distance <= \" . $distance;\n\t\t\t\t//$this->searchQ['orderby'][] = 'distance ASC';\n\t\t\t\t\n\t\t\t\t$l_q = \"SELECT \" . (($this->numRows) && 1 == $c ?' SQL_CALC_FOUND_ROWS ':'') . implode(',', $l_select). \"\n\t\t\t\t\tFROM \" . $this->searchQ['from'] . \"\n\t\t\t\t\tWHERE\n\t\t\t\t\t\t\" . implode(' AND ', $l_where) ;\n\t\n\t\t\t\tif( count($l_having) ){\n\t\t\t\t\t$l_q .= \" HAVING \" . implode(' AND ' , $l_having);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$union[] = $l_q;\n\t\t\t\t$c++;\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t$q = '(' . implode(' ) UNION ALL (', $union) . ') ';\n\t\t\t\n\t\t\t$q .= \"\tORDER BY \" . implode(',', $this->searchQ['orderby']) . \" \";\n\t\t\t$q .= \"\tLIMIT \" . ( ($this->page-1)* $this->limit) . \",\" . $this->limit . \" \";\n\t\t\n\t\t\n\t\t}else{\n\t\t\n\t\t\n\t\t\t//! ** build the non-location query **\n\t\t\t$q = \"SELECT \" . (($this->numRows)?' SQL_CALC_FOUND_ROWS ':'') . implode(',', $this->searchQ['select']). \"\n\t\t\t\t\tFROM \" . $this->searchQ['from'] . \"\n\t\t\t\t\tWHERE\n\t\t\t\t\t\t\" . implode(' AND ', $this->searchQ['where']) ;\n\t\t\t\t\t\t\n\t\t\tif( isset($this->searchQ['having']) && count($this->searchQ['having']) ){\n\t\t\t\t$q .= \" HAVING \" . implode(' AND ' , $this->searchQ['having']);\n\t\t\t}\n\t\t\t\n\t\t\t$q .= \"\tORDER BY \" . implode(',', $this->searchQ['orderby']) . \" \";\n\t\n\t\t\t$q .= \"\tLIMIT \" . ( ($this->page-1)* $this->limit) . \",\" . $this->limit . \" \"; \n\t\t}\n\t\t//echo $q;\t\t\n\t\treturn $q;\n\t\t\n\t}", "function xmarticle_search($queryarray, $andor, $limit, $offset, $userid)\n{\n global $xoopsDB;\n\n $sql = \"SELECT article_id, article_cid, article_name, article_reference, article_description, article_date, article_userid FROM \" . $xoopsDB->prefix(\"xmarticle_article\") . \" WHERE article_status = 1\";\n\n\tif ( $userid != 0 ) {\n $sql .= \" AND article_userid=\" . intval($userid) . \" \";\n }\n\t\n if ( is_array($queryarray) && $count = count($queryarray) )\n {\n $sql .= \" AND ((article_name LIKE '%$queryarray[0]%' OR article_reference LIKE '%$queryarray[0]%' OR article_description LIKE '%$queryarray[0]%')\";\n\n for($i=1;$i<$count;$i++)\n {\n $sql .= \" $andor \";\n $sql .= \"(article_name LIKE '%$queryarray[$i]%' OR article_reference LIKE '%$queryarray[$i]%' OR article_description LIKE '%$queryarray[$i]%')\";\n }\n $sql .= \")\";\n }\n\n $sql .= \" ORDER BY article_date DESC\";\n $result = $xoopsDB->query($sql,$limit,$offset);\n $ret = array();\n $i = 0;\n while($myrow = $xoopsDB->fetchArray($result))\n {\n $ret[$i][\"image\"] = \"assets/images/xmarticle_search.png\";\n $ret[$i][\"link\"] = \"viewarticle.php?article_id=\" . $myrow[\"article_id\"] . '&category_id=' . $myrow[\"article_cid\"];\n $ret[$i][\"title\"] = $myrow[\"article_name\"] . '(' . $myrow[\"article_reference\"] . ')';\n $ret[$i][\"time\"] = $myrow[\"article_date\"];\n $ret[$i][\"uid\"] = $myrow[\"article_userid\"];\n $i++;\n }\n\n return $ret;\n}", "function filter_results_of_search_bar_input($sql, $array) {\n global $link;\n $results =mysqli_query($link,$sql);\n \n while($row = mysqli_fetch_row($results)){\n if(in_array($row,$array) == false){\n array_push($array,$row);\n }\n }\n \n return $array;\n}", "static function get_search_results() {\n\n\t\t$post_ids = array();\n\n\t\tif ( ! empty( QS::get_request_taxonomy( 'platform' ) ) && QS::get_request_taxonomy( 'platform' ) == get_field( 'handgun_term' ) ) {\n\t\t\t$taxonomies = array( 'platform', 'brand', 'model', 'product_cat', 'sight_type' );\n\t\t} else {\n\t\t\t$taxonomies = array( 'platform', 'application', 'manification', 'day_night' );\n\t\t}\n\n\t\tforeach ( $taxonomies as $tax ) {\n\t\t\tif ( QS::get_request_taxonomy( $tax ) ) {\n\t\t\t\t$tax_query[] = array(\n\t\t\t\t\t'taxonomy' => $tax,\n\t\t\t\t\t'terms' => QS::get_request_taxonomy( $tax ),\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\tdo {\n\t\t\twp_reset_query();\n\n\t\t\t$args = array(\n\t\t\t\t'post_type' => 'product',\n\t\t\t\t'posts_per_page' => -1,\n\t\t\t\t'tax_query' => $tax_query,\n\t\t\t\t'fields' => 'ids',\n\t\t\t);\n\n\t\t\tif ( count( $tax_query ) != 1 ) {\n\t\t\t\tunset( $tax_query[ count( $tax_query ) - 1 ] );\n\t\t\t}\n\n\t\t\t$query = new WP_Query( $args );\n\n\t\t\t$post_ids = array_merge( $post_ids, $query->posts );\n\n\t\t} while ( count( $post_ids ) < 8 && count( $tax_query ) >= 1 );\n\n\t\t$post_ids = array_slice( $post_ids, 0, 8 );\n\n\t\treturn $post_ids;\n\t}", "function topSearchInfo()\n\t{\n\t\t//Global allows variables outside the function scope to be used here\n\t\tglobal $conn;\n\t\tglobal $myObj;\n\t\tglobal $params_arr;\n\t\t\n\t\t\n\t\t$keyword = $params_arr[0];\n\t\t\n\t\t$sql = \"SET @SEARCH_TERM = '%$keyword%';\";\n\t\t\n\t\tif ($conn->query($sql) === TRUE) \n\t\t{\n\t\t\t//echo \"New record created successfully\";\n\t\t} \n\t\telse \n\t\t{\n\t\t\techo \"Error: \" . $sql . \"<br>\" . $conn->error;\n\t\t}\n\n\t\t\t\n\t\t$sql = \"SELECT books.COVER, books.TITLE, books.GENRE, books.PUBLISHER, authors.FIRST_NAME, authors.LAST_NAME, books.PUB_DATE,\n\t\t\t \t\t books.DESCRIPTION, authors.BIO, books.ISBN, books.ID\n\t\t\t\t FROM books \n\t\t\t\t JOIN authors ON books.AUTHOR = authors.ID\n\t\t\t\t WHERE authors.FIRST_NAME LIKE @SEARCH_TERM OR\n\t\t\t authors.LAST_NAME LIKE @SEARCH_TERM OR \n\t\t\t\t\t\tbooks.TITLE LIKE @SEARCH_TERM OR\n\t\t\t\t\t\tbooks.GENRE LIKE @SEARCH_TERM\n\t\t\t\tORDER BY books.TITLE \n\t\t\t\tLIMIT 3\";\n\t\t\t\t//Only d\n\t\t\n\n\t\t//Executes query string\n\t\t$result = $conn->query($sql);\n\t\t//Im making the page number between 10 and 20\n\t\tif ($result->num_rows > 0) \n\t\t{\n\t\t\t$json = array();\n\t \t// convert the data into json object\n\t \twhile($row = $result->fetch_assoc()) \n\t \t{\n\t\t\t\t$bus = array(\n\t\t\t\t\t\"cover\" => $row[\"COVER\"],\n\t\t\t\t\t\"title\" => $row[\"TITLE\"],\n\t\t\t\t\t\"author\" => $row[\"FIRST_NAME\"]. \" \" .$row[\"LAST_NAME\"],\n\t\t\t\t\t\"genre\" => $row[\"GENRE\"],\n\t\t\t\t\t\"publisher\" => $row[\"PUBLISHER\"],\n\t\t\t\t\t\"pub_date\" => $row[\"PUB_DATE\"],\n\t\t\t\t\t\"description\" => $row[\"DESCRIPTION\"],\n\t\t\t\t\t\"bio\" => $row[\"BIO\"],\n\t\t\t\t\t\"isbn\" => $row[\"ISBN\"],\n\t\t\t\t\t\"id\" => $row[\"ID\"]\n\t\t\t\t);\n\n\t\t\t\tarray_push($json, $bus);\n\t\t\t\t\n\t\t\t}\n\n\t\t\t$jsonstring = json_encode($json);\n\t\t\techo $jsonstring;\n\t\t}\n\t\telse\n\t\t{\n\t\t echo \"0 results\";\n\t\t}\n\n\n\t\t$conn->close();\n\t}", "function get_website_search_result_table($search_results) {\n $output = '';\n $rows = [];\n foreach ($search_results as $item) {\n if (isset($item['nid'])) {\n $row = '<h3>' . l($item['title'], 'node/' . $item['nid']) . '</h3>';\n }\n else {\n $row = '<h3>' . l($item['title'], 'bio_data/' . $item['entity_id']) . '</h3>';\n }\n $row .= '<p>' . $item['highlight'] . '</p>';\n $rows[] = [$row];\n }\n\n $per_page = 10;\n $current_page = pager_default_initialize(count($rows), $per_page);\n\n // split list into page sized chunks\n $chunks = array_chunk($rows, $per_page, TRUE);\n\n $output .= theme('table', ['header' => [], 'rows' => $chunks[$current_page]]);\n $output .= theme('pager', ['quantity', count($rows)]);\n\n return $output;\n}", "function results() {\n\t\t$query = $this->input->post('q');\n\t\t$type = $this->input->post('type');\n\t\t$group = $this->input->post('group');\n\t\t\n\t\t$params = $this->uri->uri_to_assoc(3);\n\t\tif ( isset($params['q']) ) $query = $params['q'];\n\t\tif ( isset( $params['page'] )\n\t\t\t&& is_int( $params['page'] ) ) {\n\t\t\t\t$page = $params['page'];\n\t\t\t} else {\n\t\t\t\t$page = 1;\n\t\t\t}\n\t\tif ( isset( $params['size'] )\n\t\t\t&& is_int( $params['size'] ) ) {\n\t\t\t\t$page_size = $params['size'];\n\t\t\t} else {\n\t\t\t\t$page_size = 25;\n\t\t\t}\n\t\t\n\t\t$query = trim($query);\n\t\t\n\t\t// see if this looks like an ISBN \n\t\t// FIXME dunno if we should keep this ability\n\t\tif( strlen($query) == 13 && is_int($query) && substr($query,0,3) == '978' ) {\n\t\t\t$this->load->model('products_model');\n\t\t\t$res = $this->products_model->get_product_by_ean( $query );\n\t\t\tif( $res->num_rows > 0 ) {\n\t\t\t\t$row = $res->row();\n\t\t\t\tredirect('/product/view/' . $row->id );\n\t\t\t}\n\t\t} elseif( strlen( $query ) > 0 ) {\n\t\t\t$res = $this->search_model->search($query, $type, $page, $page_size );\n\t\t\t$results = $res->result();\n\t\t} else {\n\t\t\t$results = array();\n\t\t}\n\t\t\n\t\t\n\t\t$prev = $next = false;\n\t\tif( $page > 1 ) {\n\t\t\t$prev_page = $page - 1;\n\t\t\t$params['page'] = $prev_page;\n\t\t\t$prev = '/search/results/' . $this->assoc_to_uri($params);\n\t\t}\n\t\tif ( count($results) > $page * $page_size ) {\n\t\t\t$next_page = $page + 1;\n\t\t\t$params['page'] = $next_page;\n\t\t\t$next = '/searc/results/' . $this->assoc_to_uri($params);\n\t\t}\n\n\n\t\t$nav['main'] = 'Home';\n\t\t$nav['sub'] = '';\n\t\t$data = array(\n\t\t\t'results' => $results,\n\t\t\t'page' => $page,\n\t\t\t'page_size' => $page_size,\n\t\t\t'query_string' => $query,\n\t\t\t'prev' => $prev,\n\t\t\t'next' => $next,\n\t\t\t'nav' => $nav\n\t\t\t);\t\t\n\t\t\t\t\n\t\t$this->load->view('search/results', $data);\n\t\t\t\t\n\t}", "public function get_results() {\n\n\t\t\tif(!isset($_GET['wpusquery'])) {\n\t\t\t\tdie(); // if no data has been entered, quit\n\t\t\t} else {\n\t\t\t\t$searcharray = $_GET['wpusquery'];\n\t\t\t}\n\n\t\t\t$nonce = $_GET['searchNonce'];\n\t\t\tif(!wp_verify_nonce($nonce, 'search-nonce')) // make sure the search nonce matches the nonce generated earlier\n\t\t\t{\n\t\t\t\tdie ('Busted!');\n\t\t\t}\n\n\t\t\tif(class_exists(\"WPUltimateSearchPro\")) {\n\t\t\t\t$this->pro_class->execute_query_pro($searcharray);\n\t\t\t} else {\n\t\t\t\t$this->execute_query_basic($searcharray);\n\t\t\t}\n\t\t}", "public function media_upload_picasa_list_content()\n\t{\n\t\t$items_per_page = 20;\n\n\t\t$user_feed = $this->api->get_user_feed();\n\t\t$albums = ($user_feed->entry ? $user_feed->entry : array());\n\n\t\t// get current album\n\t\t$current_album = (isset($_GET['album']) ? $_GET['album'] : 'all');\n\n\t\t// get current page\n\t\t$paged = (isset($_GET['paged']) ? $_GET['paged'] : 1);\n\n\t\t// get photos\n\t\tif(isset($_GET['picasa_search_query']))\n\t\t{\n\t\t\t$query = $_GET['picasa_search_query'];\n\t\t\t$photos_feed = $this->api->search_photos($query);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$photos_feed = $this->api->get_photos($current_album);\n\t\t}\n\n\t\t$photos = $photos_feed->entry;\n\n\t\t// set album options\n\t\t$album_options = array('all' => 'All Albums');\n\t\tforeach($albums as $album)\n\t\t\t$album_options[(string)$album->gphotoId] = $album->getTitle()->text;\n\n\t\t$num_pages = ceil(count($photos) / $items_per_page);\n\n\t\t// start and end of current page\n\t\t$start = ($paged - 1) * $items_per_page;\n\t\t$end = min(count($photos), $start + $items_per_page);\n\n\t\t$this->media_upload_content_tabs();\n\n\t\t?>\n\t\t<form id=\"filter\" method=\"get\" action=\"\">\n\t\t\t<p class=\"search-box\">\n\t\t\t\t<input type=\"hidden\" name=\"type\" value=\"picasa\" />\n\t\t\t\t<input type=\"hidden\" name=\"tab\" value=\"picasa_list\" />\n\t\t\t\t<input id=\"media-search-input\" type=\"text\" value=\"<?php echo $query; ?>\" placeholder=\"Search Photos\" name=\"picasa_search_query\" />\n\t\t\t\t<input class=\"button\" type=\"submit\" value=\"Search Photos\" />\n\t\t\t</p>\n\n\t\t <select name=\"album\">\n\t\t <?php foreach($album_options as $id => $title): ?>\n\t\t\t\t<option value=\"<?php echo $id ?>\" <?php echo selected($id, $current_album); ?>><?php echo $title; ?></option>\n\t\t\t\t<?php endforeach; ?>\n\t\t\t</select>\n\n\t\t\t<input class=\"button\" type=\"submit\" value=\"Filter\" />\n\n\t\t\t<div class=\"tablenav\">\n\t\t\t\t<div class=\"tablenav-pages\">\n\n\t\t\t\t\t<?php if($paged > 1): ?>\n\t\t\t\t\t<a class=\"page-numbers\" href=\"<?php echo add_query_arg(array('paged' => $paged - 1)); ?>\">&laquo;</a>\n\t\t\t\t\t<?php endif; ?>\n\n\t\t\t\t\t<?php for($page = max(1, $paged - 3); $page < $paged; $page++): ?>\n\t\t\t\t\t<a class=\"page-numbers\" href=\"<?php echo add_query_arg(array('paged' => $page)); ?>\"><?php echo $page; ?></a>\n\t\t\t\t\t<?php endfor; ?>\n\n\t\t\t\t\t<a class=\"current page-numbers\" href=\"<?php echo add_query_arg(array('paged' => $paged)); ?>\"><?php echo $page; ?></a>\n\n\t\t\t\t\t<?php for($page = $paged + 1; $page < min($paged + 3, $num_pages + 1); $page++): ?>\n\t\t\t\t\t<a class=\"page-numbers\"\t href=\"<?php echo add_query_arg(array('paged' => $page )); ?>\"><?php echo $page; ?></a>\n\t\t\t\t\t<?php endfor; ?>\n\n\t\t\t\t\t<?php if($paged < $num_pages): ?>\n\t\t\t\t\t<a class=\"page-numbers\" href=\"<?php echo add_query_arg(array('paged' => $paged + 1)); ?>\">&raquo;</a>\n\t\t\t\t\t<?php endif; ?>\n\n\t\t\t\t</div><!-- .tablenav-pages -->\n\t\t\t</div><!-- .tablenav -->\n\n\n\t\t</form>\n\n\t\t<div id=\"media-items\" class=\"picasa\">\n\n\t\t\t<?php\n\t\t\tfor($photo_index = $start; $photo_index < $end; $photo_index++):\n\t\t\t\t$photo = $photos[$photo_index];\n\n\t\t\t $media = $photo->getMediaGroup();\n\t\t\t\t$thumbnails = $media->getThumbnail();\n\n\t\t\t\t$thumbs = array();\n\t\t\t\t$thumb_sizes = array('small', 'medium', 'large');\n\t\t\t\tforeach($thumbnails as $i => $thumb)\n\t\t\t\t{\n\t\t\t\t\t$thumbs[$thumb_sizes[$i]] = array('url' => $thumb->getUrl(),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'width' => $thumb->getWidth(),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'height' => $thumb->getHeight());\n\t\t\t\t}\n\n\t\t\t?>\n\n\t\t\t<div class=\"media-item\">\n\t\t\t\t<img src=\"<?php echo $thumbs['small']['url']; ?>\"\n\t\t\t\t\t\t width=\"<?php echo $thumbs['small']['width']; ?>\"\n\t\t\t\t\t\t height=\"<?php echo $thumbs['small']['height']; ?>\"\n\t\t\t\t\t\t style=\"float: left; padding: 4px;\"\n\t\t\t\t\t\t />\n\t\t\t\t\t\n\t\t\t\t<div class=\"filename\">\n\t\t\t\t\t<?php echo $photo->getTitle(); ?>\n\t\t\t\t</div>\n\n\t\t\t\t<div class=\"insert-options\">\n\n\t\t\t\t\t<form action=\"\" method=\"post\">\n\t\t\t\t\t\t<p class=\"link-url\">\n\t\t\t\t\t\t\t<label for=\"link_url\">Link URL</label>\n\t\t\t\t\t\t\t<input type=\"text\" name=\"link_url\" />\n\t\t\t\t\t\t</p>\n\t\t\t\t\t\t<p class=\"alignment\">\n\t\t\t\t\t\t\t<label for=\"alignment\">Alignment</label>\n\t\t\t\t\t\t\t<span class=\"alignment-options\">\n\t\t\t\t\t\t\t\t<input type=\"radio\" value=\"none\" name=\"alignment\" checked=\"checked\"><label>None</label>\n\t\t\t\t\t\t\t\t<input type=\"radio\" value=\"left\" name=\"alignment\"><label>Left</label>\n\t\t\t\t\t\t\t\t<input type=\"radio\" value=\"center\" name=\"alignment\"><label>Center</label>\n\t\t\t\t\t\t\t\t<input type=\"radio\" value=\"right\" name=\"alignment\"><label>Right</label>\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t</p>\n\n\t\t\t\t\t\t<div class=\"size\">\n\t\t\t\t\t\t\t<label for=\"size\">Size</label>\n\t\t\t\t\t\t\t<div class=\"size-options\">\n\t\t\t\t\t\t\t\t<?php foreach($thumbs as $size => $thumb): ?>\n\t\t\t\t\t\t\t\t<input type=\"radio\" value=\"<?php echo $size; ?>\" name=\"size\">\n\t\t\t\t\t\t\t\t<label><?php echo ucwords($size); ?> Thumbnails (<?php echo $thumb['width']; ?> x <?php echo $thumb['height']; ?>)</label><br />\n\t\t\t\t\t\t\t\t<?php endforeach; ?>\n\t\t\t\t\t\t\t\t<input type=\"radio\" value=\"full\" name=\"size\" checked=\"checked\">\n\t\t\t\t\t\t\t\t<label>Full (<?php echo $photo->getGphotoWidth(); ?> x <?php echo $photo->getGphotoHeight(); ?>)</label><br />\n\t\t\t\t\t\t\t</div><!-- .size-options -->\n\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t<input type=\"hidden\" value=\"<?php echo $photo->getId()->getText(); ?>\" name=\"photo_id\" />\n\t\t\t\t\t\t\t<input type=\"submit\" class=\"button-secondary\" value=\"Insert\" name=\"picasa_embed\" />\n\t\t\t\t\t\t</p>\n\n\t\t\t\t\t</form>\n\n\t\t\t\t</div><!-- .insert-options-->\n\t\t\t</div><!-- .media-item -->\n\n\t\t\t<?php endfor; ?>\n\n\t\t</div><!-- #media-items -->\n\t\t<?php\n\t}", "function getRecentSearches()\n {\n }", "public function socialSearch()\n {\n if(\\request()->user_type == \"normal\") {\n $normal_members = User::where('users.user_type' , \"normal\")\n ->leftJoin('social_link_user','social_link_user.user_id','users.id')\n ->where('social_link_user.default' , 1)\n ->where('social_link_user.social_id' , request()->socialID)\n ->select('users.id as userId', 'users.first_name as first_name' ,'users.last_name as last_name','users.image as image','users.job_type as job_type')\n ->orderBy('users.id' , \"desc\")->take(16)\n ->get();\n return view('front.social_search.normal' ,compact('normal_members'));\n }\n\n if(\\request()->user_type == \"famous\") {\n $normal_members = User::where('users.user_type' , \"famous\")\n ->leftJoin('social_link_user','social_link_user.user_id','users.id')\n ->where('social_link_user.default' , 1)\n ->where('social_link_user.social_id' , request()->socialID)\n ->select('users.id as userId', 'users.first_name as first_name' ,'users.last_name as last_name','users.image as image','users.job_type as job_type')\n ->orderBy('users.id' , \"desc\")->take(16)\n ->get();\n return view('front.social_search.normal' , compact('normal_members'));\n }\n if(\\request()->user_type == \"featured\") {\n $featured_users = FeaturedAdUser::where('featured_type' ,\"featured\")\n ->where('social_link_id' , request()->socialID)\n ->where('publish' , 1)\n ->where( 'to' ,\">=\", NOW())\n ->orderBy('from' , \"asc\")->take(10)->get();\n //dd($featured_users);\n return view('front.social_search.featured' ,compact('featured_users'));\n // return view('front.social_search.normal' ,compact('normal_members'));\n }\n\n }", "private function ajaxSearch() {\n $input = Input::get('search');\n \n $data = array();\n \n $search_result = '';\n \n $check = $this->franchisor_model->where('franchisor_name', 'like', '%'.$input.'%')->exists();\n \n if ( $check ) {\n $franchisors = $this->franchisor_model->where('franchisor_name', 'like', '%'.$input.'%')->get(array('id', 'franchisor_name'));\n foreach ( $franchisors as $franchisor) {\n $search_result .= \"<div>\".link_to_route('franchisor.show', $franchisor->franchisor_name, array($franchisor->id)).\"</div>\";\n }//foreach ( $franchisors as $franchisor)\n $data['search_result'] = $search_result;\n }//if ( $check )\n else{\n $data['error'] = '<div>Franchisor not found!</div>';\n }\n \n return $data;\n }", "public function create_hashtag()\n {\n $hashtag = array();\n $art_sql = \"SELECT category_id,REPLACE(art_category,' ','') as art_category FROM ailee_art_category WHERE art_category != 'other';\";\n $art_cat_data = $this->db->query($art_sql)->result();\n echo \"<pre>\";\n // print_r($art_cat_data);\n foreach ($art_cat_data as $_art_cat_data) {\n $res = preg_replace(\"/[^a-zA-Z0-9]/\", \"\", $_art_cat_data->art_category);\n $_art_cat_data->art_hashtag = strtolower($res);\n $hashtag[] = strtolower($res);\n // print_r($_art_cat_data);\n }\n\n $jt_sql = \"SELECT title_id,name FROM ailee_job_title WHERE status = 'publish';\";\n $job_title_data = $this->db->query($jt_sql)->result();\n echo \"<pre>\";\n // print_r($job_title_data);\n foreach ($job_title_data as $_job_title_data) {\n $res = preg_replace(\"/[^a-zA-Z0-9]/\", \"\", $_job_title_data->name);\n $_job_title_data->jt_hashtag = strtolower($res);\n $hashtag[] = strtolower($res);\n // print_r($_job_title_data);\n }\n\n $s_sql = \"SELECT skill_id,skill FROM ailee_skill WHERE status = '1' AND ( type='1' OR type='2');\";\n $skill_data = $this->db->query($s_sql)->result();\n echo \"<pre>\";\n // print_r($skill_data);\n foreach ($skill_data as $_skill_data) {\n $res = preg_replace(\"/[^a-zA-Z0-9]/\", \"\", $_skill_data->skill);\n $_skill_data->jt_hashtag = strtolower($res);\n $hashtag[] = strtolower($res);\n // print_r($_skill_data);\n }\n // print_r($hashtag);\n $main_hashtag = array_values(array_unique($hashtag));\n foreach ($main_hashtag as $key => $value) {\n $data = array(\n 'hashtag' => $value,\n 'status' => '1',\n 'created_date' => date('Y-m-d H:i:s', time()),\n 'modify_date' => date('Y-m-d H:i:s', time()),\n );\n print_r($data);\n $hashtag_id = $this->common->insert_data_getid($data, 'hashtag');\n }\n }", "function media_bynder_search_facets($selected_facets, $search_term) {\n $full_query = \"\";\n foreach ($selected_facets as $selected_facet_group_name => $selected_facet_group) {\n $full_query .= \"&\" . $selected_facet_group_name . '=' . implode(\",\", $selected_facet_group);\n }\n\n if (isset($search_term) && strlen($search_term) > 0) {\n if (strlen($full_query) > 0) {\n $full_query .= ' ';\n }\n $full_query .= '&keyword=' . $search_term;\n }\n\n $rest_client = media_bynder_rest_client();\n $arr_facets_json = $rest_client->getFacets($full_query);\n\n if ($arr_facets_json) {\n return $arr_facets_json;\n } else {\n drupal_set_message($rest_client->error, 'error');\n return FALSE;\n }\n}", "function show_results()\n\t{\n\t\tglobal $ibforums, $std;\n\n\t\t$this->result_type = $ibforums->input['result_type'];\n\t\t$this->search_in = $ibforums->input['search_in'];\n\n\t\t//------------------------------------------------\n\t\t// We have a search ID, so lets get the parsed results.\n\t\t//------------------------------------------------\n\n\t\t$this->unique_id = $ibforums->input['searchid'];\n\n\t\tif (!$this->unique_id)\n\t\t{\n\t\t\t$std->Error(array(\n\t\t\t 'LEVEL' => 1,\n\t\t\t 'MSG' => 'no_search_results'\n\t\t\t ));\n\t\t}\n\n\t\t$stmt = $ibforums->db->query(\"SELECT *\n\t\t\t\t FROM ibf_search_results\n\t\t\t\t WHERE id='{$this->unique_id}'\");\n\n\t\t$sr = $stmt->fetch();\n\n\t\t$tmp_topics = $sr['topic_id'];\n\t\t$topic_max_hits = \"\"; //$sr['topic_max'];\n\t\t$tmp_posts = $sr['post_id'];\n\t\t$post_max_hits = \"\"; //$sr['post_max'];\n\n\t\t$this->sort_order = $sr['sort_order'];\n\t\t$this->sort_key = $sr['sort_key'];\n\n\t\t//------------------------------------------------\n\t\t// Remove duplicates from the topic_id and post_id\n\t\t//------------------------------------------------\n\n\t\t$topic_max_hits = self::unique_string_items($tmp_topics);\n\t\t$post_max_hits = self::unique_string_items($tmp_posts);\n\n\t\t$topics = $tmp_topics;\n\t\t$posts = $tmp_posts;\n\n\t\t//-------------------------------------\n\n\t\tif (!$topics and !$posts)\n\t\t{\n\t\t\t$std->Error(array(\n\t\t\t 'LEVEL' => 1,\n\t\t\t 'MSG' => 'no_search_results'\n\t\t\t ));\n\t\t}\n\n\t\t$url_words = $this->convert_highlite_words($ibforums->input['highlite']);\n\n\t\t$count = 0;\n\n\t\tif ($this->result_type == 'topics')\n\t\t{\n\t\t\tif ($this->search_in == 'titles')\n\t\t\t{\n\t\t\t\t$this->fill_read_arrays($topics);\n\n\t\t\t\t$this->output .= $this->start_page($topic_max_hits);\n\n\t\t\t\t$query = \"SELECT\n\t\t\t\t\t\tt.*,\n\t\t\t\t\t\tf.id as forum_id,\n\t\t\t\t\t\tf.name as forum_name\n\t\t\t\t FROM\n\t\t\t\t\t\tibf_topics t, ibf_forums f\n\t\t\t\t\t WHERE\n\t\t\t\t\t\tt.tid IN(\" . $topics . \")\n\t\t\t\t\t\tAND f.id=t.forum_id\n\t\t\t\t\t\tAND t.approved=1\n\t\t\t\t\t ORDER BY t.pinned DESC,\";\n\n\t\t\t\t// search new topics of user\n\t\t\t\tif ($ibforums->input['new'])\n\t\t\t\t{\n\t\t\t\t\t$query .= \"f.id ASC,\";\n\t\t\t\t}\n\n\t\t\t\t$query .= \"t.\" . $this->sort_key . \" \" . $this->sort_order . \" LIMIT \" . $this->first . \",25\";\n\n\t\t\t\t$stmt = $ibforums->db->query($query);\n\n\t\t\t} else // ( $this->search_in == 'posts' )\n\t\t\t{\n\t\t\t\t//--------------------------------------------\n\t\t\t\t// we have tid and pid to sort out, woohoo NOT\n\t\t\t\t//--------------------------------------------\n\n\t\t\t\t// Array for forum id of each message\n\t\t\t\t$forum_posts = array();\n\n\t\t\t\tif ($posts)\n\t\t\t\t{\n\t\t\t\t\t$stmt = $ibforums->db->query(\"SELECT\n\t\t\t\t\t\tforum_id,\n\t\t\t\t\t\ttopic_id\n\t\t\t\t\tFROM ibf_posts\n\t\t\t\t\tWHERE\n\t\t\t\t\t\tpid IN({$posts})\n\t\t\t\t\t\tAND queued != 1\");\n\n\t\t\t\t\tif ($topics)\n\t\t\t\t\t{\n\t\t\t\t\t\t$topics = explode(',', $topics);\n\t\t\t\t\t} else\n\t\t\t\t\t{\n\t\t\t\t\t\t$topics = array();\n\t\t\t\t\t}\n\n\t\t\t\t\twhile ($pr = $stmt->fetch())\n\t\t\t\t\t{\n\t\t\t\t\t\tif (!in_array($pr['topic_id'], $topics))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$topics[] = $pr['topic_id'];\n\t\t\t\t\t\t\t$topic_max_hits++;\n\n\t\t\t\t\t\t\t$forum_posts[$pr['topic_id']] = $pr['forum_id'];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t$topics = implode(',', $topics);\n\t\t\t\t}\n\t\t\t\t$this->fill_read_arrays($topics);\n\n\t\t\t\t$this->output .= $this->start_page($topic_max_hits);\n\n\t\t\t\t$query = \"SELECT\n\t\t\t\t\t\tt.*,\n\t\t\t\t\t\tf.id as forum_id,\n\t\t\t\t\t\tf.name as forum_name\n\t\t\t\t \t FROM ibf_topics t\n\t\t\t\t\t LEFT JOIN ibf_forums f\n\t\t\t\t\t\tON (f.id=t.forum_id)\n\t\t\t\t\t WHERE\n\t\t\t\t\t\tt.tid IN(\" . $topics . \")\n\t\t\t\t\t\tAND t.approved=1\n\t\t\t\t\t ORDER BY\n\t\t\t\t\t\tt.pinned DESC,\";\n\n\t\t\t\t// Search new topics of user\n\t\t\t\tif ($ibforums->input['new'])\n\t\t\t\t{\n\t\t\t\t\t$query .= \"f.id ASC,\";\n\t\t\t\t}\n\n\t\t\t\t$query .= \"t.\" . $this->sort_key . \" \" . $this->sort_order . \" LIMIT \" . $this->first . \",25\";\n\n\t\t\t\t$stmt = $ibforums->db->query($query);\n\t\t\t}\n\n\t\t\t//--------------------------------------------\n\n\t\t\tif ($stmt->rowCount())\n\t\t\t{\n\t\t\t\twhile ($row = $stmt->fetch())\n\t\t\t\t{\n\t\t\t\t\t// club tool\n\t\t\t\t\tif ($row['club'] and $std->check_perms($ibforums->member['club_perms']) == FALSE)\n\t\t\t\t\t{\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\t$count++;\n\n\t\t\t\t\t$row['keywords'] = $url_words;\n\n\t\t\t\t\tif ($row['pinned'])\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->output .= View::make(\"search.RenderPinnedRow\", ['Data' => $this->parse_entry($row)]);\n\t\t\t\t\t} else\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->output .= View::make(\"search.RenderRow\", ['Data' => $this->parse_entry($row)]);\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t} else\n\t\t\t{\n\t\t\t\t$std->Error(array(\n\t\t\t\t 'LEVEL' => 1,\n\t\t\t\t 'MSG' => 'no_search_results'\n\t\t\t\t ));\n\t\t\t}\n\n\t\t\t//--------------------------------------------\n\n\t\t\t$this->output .= View::make(\n\t\t\t\t\"search.end\",\n\t\t\t\t[\n\t\t\t\t\t'Data' => array(\n\t\t\t\t\t\t'SHOW_PAGES' => $this->links,\n\t\t\t\t\t\t'modform_close' => ($this->modfunctions)\n\t\t\t\t\t\t\t? View::make(\"search.modform_close\")\n\t\t\t\t\t\t\t: \"\"\n\t\t\t\t\t)\n\t\t\t\t]\n\t\t\t);\n\n\t\t} else // ( $this->result_type == 'posts' )\n\t\t{\n\n\t\t\t$this->parser = new PostParser();\n\n\t\t\tif ($this->search_in == 'titles')\n\t\t\t{\n\t\t\t\t$this->output .= $this->start_page($topic_max_hits, 1);\n\n\t\t\t\t$stmt = $ibforums->db->query(\"SELECT\n\t\t\t\t\t\tt.*,\n\t\t\t\t\t\tp.pid,\n\t\t\t\t\t\tp.author_id,\n\t\t\t\t\t\tp.author_name,\n\t\t\t\t\t\tp.post_date,\n\t\t\t\t\t\tp.post,\n\t\t\t\t\t\tf.id as forum_id,\n\t\t\t\t\t\tf.name as forum_name\n\t\t\t\t\tFROM ibf_topics t\n\t\t\t\t\tLEFT JOIN ibf_posts p\n\t\t\t\t\t\tON (t.tid=p.topic_id\n\t\t\t\t\t\t AND p.new_topic=1\n\t\t\t\t\t\t AND p.use_sig=0)\n\t\t\t\t\tLEFT JOIN ibf_forums f\n\t\t\t\t\t\tON (f.id=t.forum_id)\n\t\t\t\t\tWHERE\n\t\t\t\t\t\tt.tid IN({$topics})\n\t\t\t\t\t\tAND p.queued != 1\n\t\t\t\t\t\tAND t.approved=1\n\t\t\t\t\tORDER BY p.post_date DESC\n\t\t\t\t\tLIMIT {$this->first},25\");\n\n\t\t\t} else // ( $this->search_in == 'posts' )\n\t\t\t{\n\t\t\t\t$this->parser->prepareIcons();\n\n\t\t\t\tif ($topics)\n\t\t\t\t{\n\t\t\t\t\t$stmt = $ibforums->db->query(\"SELECT\n\t\t\t\t\t\tpid\n\t\t\t\t\tFROM\n\t\t\t\t\t\tibf_posts\n\t\t\t\t\tWHERE\n\t\t\t\t\t\ttopic_id IN({$topics}) AND\n\t\t\t\t\t\tnew_topic=1 AND\n\t\t\t\t\t\tqueued != 1\");\n\n\t\t\t\t\twhile ($pr = $stmt->fetch())\n\t\t\t\t\t{\n\t\t\t\t\t\tif (!preg_match(\"/,\" . $pr['pid'] . \",/\", $posts))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$posts .= $pr['pid'] . \",\";\n\t\t\t\t\t\t\t$post_max_hits++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t$posts = str_replace(\",,\", \",\", $posts);\n\t\t\t\t}\n\n\t\t\t\t$this->output .= $this->start_page($post_max_hits, 1);\n\n\t\t\t\t$stmt = $ibforums->db->query(\"SELECT\n\t\t\t\t\t\tt.*,\n\t\t\t\t\t\tp.pid,\n\t\t\t\t\t\tp.author_id,\n\t\t\t\t\t\tp.author_name,\n\t\t\t\t\t\tp.post_date,\n\t\t\t\t\t\tp.post,\n\t\t\t\t\t\tp.use_emo,\n\t\t\t\t\t\tf.id as forum_id,\n\t\t\t\t\t\tf.forum_highlight,\n\t\t\t\t\t\tf.highlight_fid as hid,\n\t\t\t\t\t\tf.name as forum_name,\n\t\t\t\t\t\tf.use_html,\n\t\t\t\t\t\tg.g_dohtml,\n\t\t\t\t\t\tp.ip_address\n\t\t\t\t\tFROM ibf_posts p\n\t\t\t\t\tLEFT JOIN ibf_topics t\n\t\t\t\t\t\tON (t.tid=p.topic_id)\n\t\t\t\t\tLEFT JOIN ibf_forums f\n\t\t\t\t\t\tON (f.id=p.forum_id)\n\t\t\t\t\tLEFT JOIN ibf_members m\n\t\t\t\t\t\tON (m.id=p.author_id)\n\t\t\t\t\tLEFT JOIN ibf_groups g\n\t\t\t\t\t\tON (m.mgroup=g.g_id)\n\t\t\t\t\tWHERE\n\t\t\t\t\t\tp.pid IN({$posts}) AND\n\t\t\t\t\t\tp.use_sig=0 AND\n\t\t\t\t\t\tp.queued != 1 AND\n\t\t\t\t\t\tt.approved=1\n\t\t\t\t\tORDER BY p.post_date DESC\n\t\t\t\t\tLIMIT {$this->first},25\");\n\t\t\t}\n\n\t\t\twhile ($row = $stmt->fetch())\n\t\t\t{\n\t\t\t\tif ($ibforums->member['g_is_supmod'])\n\t\t\t\t{\n\t\t\t\t\t$row['ip_address'] = \"( <a href='{$ibforums->base_url}&act=modcp&CODE=ip&incoming={$row['ip_address']}' target='_blank'>{$row['ip_address']}</a> )\";\n\t\t\t\t} else\n\t\t\t\t{\n\t\t\t\t\t$row['ip_address'] = \"\";\n\t\t\t\t}\n\n\t\t\t\tif ($row['club'] and\n\t\t\t\t $std->check_perms($ibforums->member['club_perms']) == FALSE\n\t\t\t\t)\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$count++;\n\n\t\t\t\t$data = array(\n\t\t\t\t\t'TEXT' => $row['post'],\n\t\t\t\t\t'SMILIES' => $row['use_emo'],\n\t\t\t\t\t'CODE' => 1,\n\t\t\t\t\t'SIGNATURE' => 0,\n\t\t\t\t\t'HTML' => 1,\n\t\t\t\t\t'HID' => ($row['forum_highlight'])\n\t\t\t\t\t\t? $row['hid']\n\t\t\t\t\t\t: -1,\n\t\t\t\t\t'TID' => $row['topic_id'],\n\t\t\t\t\t'MID' => $row['author_id'],\n\t\t\t\t);\n\n\t\t\t\t$row['post'] = $this->parser->prepare($data);\n\n\t\t\t\tif (!trim($row['post']))\n\t\t\t\t{\n\t\t\t\t\t$count--;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$row['keywords'] = $url_words;\n\t\t\t\t$row['post_date'] = $std->get_date($row['post_date']);\n\n\t\t\t\t//--------------------------------------------------------------\n\t\t\t\t// Parse HTML tag on the fly\n\t\t\t\t//--------------------------------------------------------------\n\n\t\t\t\tif ($row['use_html'] == 1)\n\t\t\t\t{\n\t\t\t\t\t// So far, so good..\n\n\t\t\t\t\tif (stristr($row['post'], '[dohtml]'))\n\t\t\t\t\t{\n\t\t\t\t\t\t// [doHTML] tag found..\n\n\t\t\t\t\t\t$parse = ($row['use_html'] AND $row['g_dohtml'])\n\t\t\t\t\t\t\t? 1\n\t\t\t\t\t\t\t: 0;\n\n\t\t\t\t\t\t$row['post'] = $this->parser->post_db_parse($row['post'], $parse);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t//--------------------------------------------------------------\n\t\t\t\t// Do word wrap?\n\t\t\t\t//--------------------------------------------------------------\n\n\t\t\t\tif ($ibforums->vars['post_wordwrap'] > 0)\n\t\t\t\t{\n\t\t\t\t\t$row['post'] = $this->parser->my_wordwrap($row['post'], $ibforums->vars['post_wordwrap']);\n\t\t\t\t}\n\n\t\t\t\t$this->output .= View::make(\"search.RenderPostRow\", ['Data' => $this->parse_entry($row, 1)]);\n\t\t\t}\n\n\t\t\t$this->output .= View::make(\"search.end_as_post\", ['Data' => array('SHOW_PAGES' => $this->links)]);\n\t\t}\n\n\t\tif ($count <= 0)\n\t\t{\n\t\t\t$std->Error(array(\n\t\t\t 'LEVEL' => 1,\n\t\t\t 'MSG' => 'no_search_results'\n\t\t\t ));\n\t\t}\n\n\t\t$this->page_title = $ibforums->lang['search_results'];\n\n\t\tif ($ibforums->input['nav'] == 'lv')\n\t\t{\n\t\t\t$this->nav = array($ibforums->lang['nav_since_lv']);\n\n\t\t} elseif ($ibforums->input['nav'] == 'my_lv')\n\t\t{\n\t\t\t$this->nav = array($ibforums->lang['my_nav_since_lv']);\n\n\t\t} elseif ($ibforums->input['nav'] == 'lt')\n\t\t{\n\t\t\t$this->nav = array($ibforums->lang['nav_lt']);\n\n\t\t} elseif ($ibforums->input['nav'] == 'au')\n\t\t{\n\t\t\t$this->nav = array($ibforums->lang['nav_au']);\n\t\t} else\n\t\t{\n\t\t\t$this->nav = array(\n\t\t\t\t\"<a href='{$this->base_url}&act=Search'>{$ibforums->lang['search_form']}</a>\",\n\t\t\t\t$ibforums->lang['search_title']\n\t\t\t);\n\t\t}\n\t}", "public function action_all()\n\t{\n $param = $this->request->param('param');\n $this->template->content = View::factory('search/searchallview');\n $this->template->content->search = $param;\n $this->template->header->search = $param;\n \n \n if(empty($param))\n {\n $photos['photos'] = '';\n $photos['count'] = '';\n $users['users'] = '';\n $users['count'] = '';\n }\n else\n {\n $photos = $this->search_photos($param, 0, 16);\n $users = $this->search_users($param, 0); \n\n $now = date(\"Y-m-d H:i:s\");\n \n //SAVE SEARCH TERM\n Model_Search::save_term($param, $now);\n }\n \n $this->template->content->photos = $photos['photos'];\n $this->template->content->count_photos = $photos['count'];\n $this->template->content->users = $users['users'];\n $this->template->content->count_users = $users['count'];\n\n \n \n\t}", "protected function addToResult($modelObjects) {\n foreach ($modelObjects as $object) {\n $this->_result[] = SearchResult::build($object);\n }\n }", "public function do_query_essay_list($query){\n\t\t$fetch_faves = $this -> db -> query($query);\n\t\tforeach ($fetch_faves->result() as $row) {\n\t\t\t$cat = $row->category;\n\t\t\tif(!isset($res[$cat])){//setup new category\n\t\t\t\t$res[$cat] = array();\n\t\t\t\t$res[$cat][\"t\"] = array();\n\t\t\t\t$res[$cat][\"eid\"] = array();\n\t\t\t}\n\t\t\tarray_push($res[$cat][\"t\"], $row->title);\n\t\t\tarray_push($res[$cat][\"eid\"], $row->eid);\n\t\t}\n\t\tif(isset($res)){\n\t\t\treturn json_encode($res, true);\n\t\t}\n\t\telse{\n\t\t\treturn json_encode(\"No favorites\", true);\n\t\t}\n\t}", "function getPostHashMultiple($hash, $users) {\n \t\n \t$hashBase = 'bruinsinjapan'; // hardcode first hashtag\n \t\n \t$endpoint = 'https://api.instagram.com/v1/tags/'.$hashBase.'/media/recent?client_id='.$this->client_id.'&count=80';\n \t$data = $this->doCurl($endpoint);\n \t\n \tforeach( $data['data'] as $instagram ){\t\n\t\t\tif( (in_array($instagram['user']['username'], $users)) && (in_array($hash, $instagram['tags'])) ) {\n\t\t\t\n\t\t\t\t$first = explode('/p/', $instagram['link']);\n\t\t\t\t$id = $first[1];\n\t\t\t\n\t\t\t\t $instagramArr[] = array('type' => 'instagram', 'id' => $id, 'handle' => $instagram['user']['username'], 'text' => '', 'img' => $instagram['images']['standard_resolution']['url'], 'time' => $instagram['created_time']);\n\t\t\t}\n\t\t}\n\n \treturn $instagramArr;\n\t}", "function call_logs_global_search_result_query($result, $q, $limit)\n{\n $CI = &get_instance();\n if (has_permission('call_logs', '', 'view')) {\n // Goals\n $CI->db->select()->from(db_prefix() . 'call_logs')->like('description', $q)->or_like('call_purpose', $q)->limit($limit);\n\n $CI->db->order_by('call_purpose', 'ASC');\n\n $result[] = [\n 'result' => $CI->db->get()->result_array(),\n 'type' => 'call_logs',\n 'search_heading' => _l('call_logs'),\n ];\n }\n\n return $result;\n}", "public static function search() {\n global $p;\n if (check_posts(['lat', 'lng'])) {\n $pharmacies = new pharmacies();\n $pharmacies->placeLat = $p['lat'];\n $pharmacies->placeLong = $p['lng'];\n $list = $pharmacies->get_place_by_latlng($p['distance'], 10);\n $r = [];\n\n foreach ($list['result'] as $place) {\n $f = new files($place['placeImg']);\n $place['placeImg'] = $f->placeOnServer;\n $r[] = $place;\n }\n $result['status'] = TRUE;\n $result['count'] = $list['nums'];\n $result['list'] = $r;\n } else {\n\n $result['status'] = FALSE;\n $result['error'] = 'invalid lat and lng';\n }\n\n// echo json_encode($p);\n// exit;\n if (@$p['post'] == 'post')\n $result['post'] = $p;\n echo json_encode($result);\n }", "public function ajaxSearch()\r\n {\r\n $this->load->model('book_model', 'bookManager');\r\n\r\n $books = array();\r\n $search = $this->input->get('search');\r\n $idCustomer = $this->session->userdata('member-id');\r\n $dataBooks = $this->bookManager->getBooksSearch($search);\r\n \r\n $k = 0;\r\n foreach ($dataBooks as $data) {\r\n if (stripos($data->author, trim($search))) {\r\n $books['list'][$k]['name'] = $data->author;\r\n $k++;\r\n }\r\n if (stripos($data->title, trim($search))) {\r\n $books['list'][$k]['name'] = $data->title;\r\n $k++;\r\n }\r\n if (stripos($data->genre, trim($search))) {\r\n $books['list'][$k]['name'] = $data->genre;\r\n $k++;\r\n }\r\n \r\n if ($k > 7) {\r\n break;\r\n }\r\n }\r\n\r\n echo json_encode($books);\r\n die;\r\n }", "function lendingform_search_user($search = NULL) {\r\n \r\n $users = array();\r\n if (empty($search)) {\r\n $users = entity_load('user');\r\n } else {\r\n // Search users\r\n $users = entity_get_controller(PROJECT_ENTITY)->search_users($search);\r\n }\r\n \r\n $users_name_and_id = array();\r\n foreach ($users as $user) {\r\n $users_name_and_id[] = array(\r\n 'uid' => $user->uid,\r\n 'name' => lendingform_siemens_format_username($user),\r\n );\r\n }\r\n\r\n echo json_encode($users_name_and_id);\r\n \r\n exit();\r\n}", "function fb_find($agent_name) {\n session_start();\n $realtor_search_array = array(\"realtor\", \"real estate agent\", \"real estate\", \"realty\", \"agent\", \"broker\", \"associate\",\"owner\", \"team\");\n\n // Include the required dependencies.\n require_once( 'vendor/autoload.php' );\n include(\"db_config\");\n\n // Initialize the Facebook PHP SDK v5.\n $fb = new Facebook\\Facebook([\n 'app_id' => '',\n 'app_secret' => '',\n 'default_graph_version' => 'v2.8',\n ]);\n\n $token = json_decode(file_get_contents(\"https://graph.facebook.com/oauth/access_token?client_id=&client_secret=&grant_type=client_credentials\"));\n $fb->setDefaultAccessToken($token->access_token);\n\n try {\n $response = $fb->get('/search?q=Maryalice+Ryan+real+estate&type=page');\n } catch(Facebook\\Exceptions\\FacebookResponseException $e) {\n // When Graph returns an error\n echo 'Graph returned an error: ' . $e->getMessage();\n exit;\n } catch(Facebook\\Exceptions\\FacebookSDKException $e) {\n // When validation fails or other local issues\n echo 'Facebook SDK returned an error: ' . $e->getMessage();\n exit;\n }\n\n //$output = $response->getGraphObject();\n $output = $response->getGraphEdge();\n $num_results = count($output);\n foreach($output as $graphNode) {\n $page_id = $graphNode->getField('id');\n $name = $graphNode->getField('name');\n $company = array(\"Coldwell\", \"Banker\", \"Residential\", \"Brokerage\", \"Westfield\", \"East\", \"Office\");\n $confidence = 0;\n if(contains($name, $company)) {\n $confidence += 5;\n }\n\n if(contains($name, $realtor_search_array)) {\n $confidence += 2;\n }\n\n $page_details = $fb->get('/'.$id.'?fields=about,phone,emails');\n $details = $page_details->getGraphObject();\n $emails = $details->getField('emails');\n $phone = $details->getField('phone');\n\n if($confidence >= 7 || $num_results == 1) {\n return $emails[0];\n break;\n }\n else if($confidence == 2) {\n preg_match(\"/\\((\\d\\d\\d)\\)\", $phone, $matches);\n if(checkAreaCode($matches[1], $addressState)) {\n return $emails[0];\n break;\n }\n\n }\n }\n}", "protected static function display_results() {\n $locale = self::$locale;\n self::$composevars = \"method=\".self::get_param('method').\"&amp;datelimit=\".self::get_param('datelimit').\"&amp;fields=\".self::get_param('fields').\"&amp;sort=\".self::get_param('sort').\"&amp;order=\".self::get_param('order').\"&amp;chars=\".self::get_param('chars').\"&amp;forum_id=\".self::get_param('forum_id').\"&amp;\";\n add_to_title($locale['global_201'].$locale['408']);\n\n $search_text = explode(' ', urldecode(self::$search_text));\n $qualified_search_text = [];\n $disqualified_search_text = [];\n\n /*\n * @todo: roadmap on author\n */\n self::$fields_count = self::get_param('fields') + 1;\n for ($i = 0, $k = 0; $i < count($search_text); $i++) {\n if (strlen($search_text[$i]) >= 3) {\n $qualified_search_text[] = $search_text[$i];\n for ($j = 0; $j < self::$fields_count; $j++) {\n // It is splitting to 2 parts.\n self::$search_param[':sword'.$k.$j] = '%'.$search_text[$i].'%';\n }\n $k++;\n } else {\n $disqualified_search_text[] = $search_text[$i];\n }\n }\n unset($search_text);\n self::$swords = $qualified_search_text;\n\n self::$c_swords = count($qualified_search_text) ?: redirect(FUSION_SELF);\n self::$i_swords = count($disqualified_search_text);\n\n self::$swords_keys_for_query = array_keys(self::$search_param);\n self::$swords_values_for_query = array_values(self::$search_param);\n\n // Highlight using Jquery the words. This, can actually parse as settings.\n $highlighted_text = \"\";\n $i = 1;\n foreach ($qualified_search_text as $value) {\n $highlighted_text .= \"'\".$value.\"'\";\n $highlighted_text .= ($i < self::$c_swords ? \",\" : \"\");\n $i++;\n }\n add_to_footer(\"<script type='text/javascript' src='\".INCLUDES.\"jquery/jquery.highlight.js'></script>\");\n add_to_jquery(\"$('.search_result').highlight([\".$highlighted_text.\"],{wordsOnly:true}); $('.highlight').css({backgroundColor:'#FFFF88'});\");\n\n /*\n * Run the drivers via include.. but this method need to change to simplify the kiss concept.\n */\n if (self::get_param('stype') == \"all\") {\n $search_deffiles = [];\n $search_includefiles = makefilelist(INCLUDES.'search/', '.|..|index.php|location.json.php|users.json.php|.DS_Store', TRUE, 'files');\n $search_infusionfiles = makefilelist(INFUSIONS, '.|..|index.php', TRUE, 'folders');\n if (!empty($search_infusionfiles)) {\n foreach ($search_infusionfiles as $files_to_check) {\n if (is_dir(INFUSIONS.$files_to_check.'/search/')) {\n $search_checkfiles = makefilelist(INFUSIONS.$files_to_check.'/search/', \".|..|index.php\", TRUE, \"files\");\n $search_deffiles = array_merge($search_deffiles, $search_checkfiles);\n }\n }\n }\n $search_files = array_merge($search_includefiles, $search_deffiles);\n\n foreach ($search_files as $key => $file_to_check) {\n if (preg_match(\"/include.php/i\", $file_to_check)) {\n if (file_exists(INCLUDES.\"search/\".$file_to_check)) {\n self::__Load(INCLUDES.\"search/\".$file_to_check);\n }\n\n foreach ($search_infusionfiles as $inf_files_to_check) {\n if (file_exists(INFUSIONS.$inf_files_to_check.'/search/'.$file_to_check)) {\n self::__Load(INFUSIONS.$inf_files_to_check.'/search/'.$file_to_check);\n }\n }\n }\n }\n } else {\n if (file_exists(INCLUDES.\"search/search_\".self::get_param('stype').\"_include.php\")) {\n self::__Load(INCLUDES.\"search/search_\".self::get_param('stype').\"_include.php\");\n }\n\n $search_infusionfiles = makefilelist(INFUSIONS, '.|..|index.php', TRUE, 'folders');\n foreach ($search_infusionfiles as $inf_files_to_check) {\n if (file_exists(INFUSIONS.$inf_files_to_check.'/search/search_'.self::get_param('stype').'_include.php')) {\n self::__Load(INFUSIONS.$inf_files_to_check.'/search/search_'.self::get_param('stype').'_include.php');\n }\n }\n }\n\n // Show how many disqualified search texts\n $c_iwords = count($disqualified_search_text);\n if ($c_iwords) {\n $txt = \"\";\n for ($i = 0; $i < $c_iwords; $i++) {\n $txt .= $disqualified_search_text[$i].($i < $c_iwords - 1 ? \", \" : \"\");\n }\n echo \"<div class='well m-t-10 text-center strong'>\".sprintf($locale['502'], $txt).\"</div><br />\";\n }\n\n /*$c_search_result_array = count(self::$search_result_array);\n\n if (self::get_param('stype') == \"all\") {\n $from = self::get_param('rowstart');\n $to = ($c_search_result_array - (self::get_param('rowstart') + 10)) <= 0 ? $c_search_result_array : self::get_param('rowstart') + 10;\n } else {\n $from = 0;\n $to = $c_search_result_array < 10 ? $c_search_result_array : 10;\n }*/\n\n /*\n * HTML output\n */\n if (self::get_param('stype') == \"all\") {\n parent::search_navigation(0);\n echo strtr(Search::render_search_count(), [\n '{%search_count%}' => self::$items_count,\n '{%result_text%}' => ((self::$site_search_count > 100 || parent::search_globalarray(\"\")) ? \"<br/>\".sprintf($locale['530'], self::$site_search_count) : \"<br/>\".self::$site_search_count.\" \".$locale['510'])\n ]);\n } else {\n echo strtr(Search::render_search_count(), [\n '{%search_count%}' => self::$items_count,\n '{%result_text%}' => ((self::$site_search_count > 100 || parent::search_globalarray(\"\")) ? \"<br/><strong>\".sprintf($locale['530'], self::$site_search_count).\"</strong>\" : (empty(self::$site_search_count) ? $locale['500'] : ''))\n ]);\n }\n\n echo \"<div class='search_result'>\\n\";\n echo \"<div class='block'>\\n\";\n foreach (self::$search_result_array as $results) {\n echo $results;\n }\n\n // Now it is by per module. Therefore rowstart does not apply\n //for ($i = $from; $i < $to; $i++) {\n // echo self::$search_result_array[$i];\n //}\n echo \"</div>\\n\";\n echo \"</div>\\n\";\n\n if (self::get_param('stype') != \"all\") {\n echo self::$navigation_result;\n }\n }", "function hs_do_search_loop() {\n global $post;\n\t// create an array variable with specific post types in your desired order\n //$post_types = array('news','article', 'page', 'post' ); // other custom post type can be added.\n $post_types = array( 'video', 'post', 'person' );\n\techo '<div class=\"search-content\">';\n\tforeach ( $post_types as $post_type ) {\n\t\t// get the search term entered by user\n\t\t$s = isset( $_GET[\"s\"] ) ? $_GET[\"s\"] : \"\";\n\t\t// accepts any wp_query args\n\t\t$args = (array(\n\t\t\t's' => $s,\n\t\t\t'post_type' => $post_type,\n\t\t\t'posts_per_page' => 7,\n\t\t\t'order' => 'DESC',\n 'orderby' => 'date'\n \n\t\t));\n \n switch ($post_type) {\n case 'video':\n $nombreColeccion = 'Películas';\n $clase= 'peliculas_search';\n break;\n case 'person':\n $nombreColeccion = 'Personajes del cine';\n $clase= 'persona_search';\n break;\n case 'post':\n $nombreColeccion = 'Entradas';\n $clase= 'posts_search';\n break;\n }\n\t\t\n\t\t\n global $wp_query;\n $wp_query = new WP_Query( $args );\n if ( $wp_query->have_posts() ) {\n\t\t\techo '<div class=\"post-type '. $post_type .'\"><div class=\"post-type-heading\">'. $nombreColeccion . '</div>'; \n\t\t\tif($post_type === 'video'){\n\t\t\t\t\n\t\t\t\techo '<div class=\"peliculas\">';\n\t\t\t\twhile( $wp_query->have_posts() ): $wp_query->the_post(); \n\t\t\t\t$poster = trae_poster(get_field('poster', get_the_ID()));\n \t$pais_pelicula = muestra_codigopais(get_field('country_group'));\n \t$formato_pelicula = wp_get_post_terms(get_the_ID(), 'videos_format')[0]->name;\n\t\t\t\t$genero_pelicula = wp_get_post_terms(get_the_ID(), 'videos_genres')[0]->name;\n \t$duracion = get_field('duration');\n \t$year = get_field('year');\n\t\t\t\techo '\n\t\t\t\t<div class=\"retina_poster\">\n <a href=\"'.get_post_permalink().'\">\n <div class=\"picture\" >\n <img src=\"'.$poster.'\" alt=\"\">\n <span class=\"duracion\"> '.($duracion).'</span>\n </div>\n <div class=\"navigation\">\n <span class=\"pais\">'.$pais_pelicula.' - '.$year.'</span>\n <h4>'.get_the_title().'</h4>\n <span class=\"formato\">'.muestra_genero($genero_pelicula).'</span>\n </div>\n </a>\n \t</div>\n\t\t\t\t';\n\t\t\t\tendwhile;\n\t\t\t\techo '</div>';\n\t\t\t}else if($post_type === 'person'){\n\t\t\t\techo '<div class=\"personajesbusqueda\">';\n\t\t\t\twhile( $wp_query->have_posts() ): $wp_query->the_post(); \n\t\t\t\t$fields = get_fields();\n\t\t\t\td($fields);\n\t\t\t\t//if(has_term( ['Director', 'Script / Continuista'], 'persons_categories')){\n\t\t\t\t$content = get_the_content();\n\t\t\t\t\t//d($content);\n\t\t\t\tif(strlen($content)>0){\n\t\t\t\t\tif(!get_the_post_thumbnail()){\n\t\t\t\t\t\t$imagenDIR='<img src='.get_stylesheet_directory_uri().'/images/no-director.jpg\">';\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$imagenDIR = get_the_post_thumbnail();\n\t\t\t\t\t}\n\n\t\t\t\t\t\n\t\t\t\t\techo '<div class=\"personaje\">\n\t\t\t\t\t\t\t<p>'.get_the_title().'</p>\n\t\t\t\t\t\t\t<a href=\"'.get_post_permalink().'\"> \n\t\t\t\t\t\t\t'.$imagenDIR.'\n\t\t\t\t\t\t\t</a> \n\t\t\t\t\t\t\t<p>'.get_field(\"citizenship_person\").'</p> \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t</div>';\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tendwhile;\n\t\t\t\techo '</div>';\n\t\t\t}else{\n\t\t\t\twhile( $wp_query->have_posts() ): $wp_query->the_post(); \n\t\t\t\techo the_title() . '<hr />'; \n\t\t\t\tendwhile;\n\t\t\t}\n\t\t\t//do_action( 'genesis_after_endwhile' );\n \n \n\n\t\t\techo '</div>'; // .post-type video / post / person\n\t\t}\n \n\n \n \n }\n \n \n\techo '</div>'; // .search-content\n}", "function getFriends()\n\t{\n\t\t//init variable\n\t\t$app = JFactory::getApplication();\n\t\t$user = JFactory::getUser($this->plugin->get('user')->id);\n\t\t$userid = $app->input->get('target_user',$this->plugin->get('user')->id,'INT');\n\t\t\n\t\t$search = $app->input->get('search','','STRING');\n\t\t\n\t\t$mapp = new EasySocialApiMappingHelper();\n\t\t\n\t\tif($userid == 0)\n\t\t$userid = $user->id;\n\t\t\n\t\t$frnd_mod = new EasySocialModelFriends();\n\t\t\n\t\t// if search word present then search user as per term and given id\n\t\tif(empty($search))\n\t\t{\n\t\t\t$ttl_list = $frnd_mod->getFriends($userid); \n\t\t}\n\t\telse\n\t\t{\n\t\t\t$ttl_list = $frnd_mod->search($userid,$search,'username');\n\t\t}\n\n\t\t$frnd_list = $mapp->mapItem( $ttl_list,'user',$userid);\n\n\t //get other data\n\t foreach($frnd_list as $ky=>$lval)\n\t {\t\t\t\n\t\t\t$lval->mutual = $frnd_mod->getMutualFriendCount($user->id,$lval->id);\n\t\t\t$lval->isFriend = $frnd_mod->isFriends($user->id,$lval->id);\n\t\t}\n\t\treturn( $frnd_list );\n\t}", "function search2(){\n\t\t$keyword = $this->uri->segment(5);\n\t\t$keyword2 = preg_replace('/%20/', '', $keyword);\n\t\t$kategori = \"A\";\n\t\t/*print_r($keyword);*/\n\t\t//api kategori bkd\n\t\t$api_url \t= URL_API_BKD.'bkd_beban_kerja/kategori_bkd_bebankerja';\n\t\t$parameter = array('api_search' => array($keyword2, $kategori));\n\t\t$data['data_bebankerja'] = $this->s00_lib_api->get_api_jsob($api_url,'POST',$parameter);\n\t\t//pengambilan data dan pengrimimannya ke view\n\t\t//print_r($data);\n\t\tforeach($data['data_bebankerja'] as $row)\n\t\t{\n\t\t\t$arr['query'] = $keyword;\n\t\t\t$arr['suggestions'][] = array(\n\t\t\t\t'value'\t=>$row->NM_KAT,\n\t\t\t\t'nilai'=>$row->KD_KAT,\n\t\t\t\t'satuan' =>$row->SATUAN,\n\t\t\t\t'nilai_kat' => $row->NILAI_KAT,\n\t\t\t\t'set_masa_tugas' =>1,\n\t\t\t\t'set_rincian_masa' =>'Semester',\n\t\t\t\t'set_tempat'=>''\n\t\t\t);\n\t\t}\n\t\t// minimal PHP 5.2\n\t\techo json_encode($arr);\n\t}", "function searchs()\n\t{\n\t $url1 = explode('/',$_GET['url']);\t\n\t\t$this->view->title = 'Search seance hemodialyse';\n\t $this->view->userListviewo = $_GET['o']; //criter de choix\n\t $this->view->userListviewq = $_GET['q']; //key word \n\t\t$this->view->userListviewp =$url1[2]; // parametre 2 page limit 2,3\n\t\t$this->view->userListviewl =10; // parametre 3 nombre de ligne par page limit 2,3 \n\t\t$this->view->userListviewb =20; // parametre nombre de chiffre dan la barre navigation\n\t\t$this->view->userListview = $this->model->userSearchs($this->view->userListviewo,$this->view->userListviewq,$this->view->userListviewp,$this->view->userListviewl);\n\t\t$this->view->userListview1= $this->model->userSearchs1($this->view->userListviewo,$this->view->userListviewq); // compte total pour bare de navigation\n\t\t$this->view->render($this->route.'/seance');\n\t}", "public function getSearch();", "public function getBeers($search): array\n {\n $query = 'search?q=' . $search . '&type=beer&';//prepare the query\n $args = $this->api->fetchData($query);\n $beer = array();\n //filer the data and add them in a new array\n if (isset($args['data'])) {\n $j = 0;\n for ($i = 0; $i < count($args['data']); $i++) {\n if (isset($args['data'][$i]['description']) and isset($args['data'][$i]['labels']['icon'])) {//get only the beers with description and label\n $beer[$j]['id'] = $args['data'][$i]['id'];\n $beer[$j]['name'] = $args['data'][$i]['name'];\n $beer[$j]['description'] = $args['data'][$i]['description'];\n $beer[$j]['image'] = $args['data'][$i]['labels']['icon'];\n $j++;\n }\n }\n }\n return $beer;\n }", "public function search()\n\t{\n\t\tif(isset($_GET['term']))\n\t\t{\n\t\t\t$result = $this->Busca_Model->pesquisar($_GET['term']);\n\t\t\tif(count($result) > 0) {\n\t\t\tforeach ($result as $pr)$arr_result[] = $pr->nome;\n\t\t\t\techo json_encode($arr_result);\n\t\t\t}\n\t\t}\n\t}", "public function SearchGenre(){\n if($this->session->userdata('username') != ''){\n $searchgenre = $this->input->post('search');\n $this->load->model('Users','us');\n $this->load->model('Followers','fo');\n $searchGenre = $this->us->searchGenre($searchgenre);\n $userid = $this->session->userdata('userid');\n $whoUserFollows = $this->fo->whoUserFollows($userid);\n $showfollowers = $this->fo->showfollowers($userid);\n $isUserFriend = $this->fo->isUserFriend($userid);\n\n $bagOfValues = array(\n 'searchGenre'=> $searchGenre,\n 'whoUserFollows' => $whoUserFollows,\n 'showfollowers' => $showfollowers,\n 'isUserFriend' => $isUserFriend\n );\n $this->load->helper('url');\n $bagOfValues['searchedGenre'] = $searchgenre;\n $this->load->view('genresearchresults', $bagOfValues);\n } else {\n $this->load->helper('url');\n redirect(base_url().'index.php/UserController/LoginButton');\n } \n }", "private function getFacebookFeed() {\n $sql = \"SELECT * FROM custom_socialwall\";\n $this->e->dbObj->execute(\"SET character set utf8mb4\");\n $this->e->dbObj->execute(\"SET names utf8mb4\");\n $rows = $this->e->dbObj->getRows($sql);\n return $rows;\n }", "public function users() {\n $matches = array();\n if ($name = $this->input->get('q')) {\n $users = ORM::factory('user')->where('site_id', $this->site->id)->like('searchname', text::searchable($name))->where('status', 1)->find_all();\n foreach ($users as $user) {\n if ($user->id != $this->user->id) { // Can't send a message to yourself.\n $matches[] = (object) array('id' => $user->id, 'name' => $user->name());\n }\n }\n }\n print json_encode($matches);\n die();\n }", "public function result()\n {\n \n $output=\"\";\n\n if($_SERVER[\"REQUEST_METHOD\"] == \"POST\"){\n\n $_POST=filter_var_array($_POST,FILTER_SANITIZE_STRING);\n\n $search_query=$_POST[\"search_query\"];\n\n $post_obj=$this->model_objs[\"post_obj\"];\n\n $fetch_searched_posts=$post_obj->select(array(\n \"column_name\"=>\"posts.post_title\",\n \"where\"=>\"posts.post_title LIKE '%{$search_query}%'\"\n ));\n\n $output=$fetch_searched_posts[\"fetch_all\"];\n\n echo json_encode($output);\n \n\n }elseif($_SERVER[\"REQUEST_METHOD\"] == \"GET\"){\n\n $_GET=filter_var_array($_GET,FILTER_SANITIZE_STRING);\n\n if(isset($_GET[\"search_query\"]) && $_GET[\"search_query\"] !== \"\"){\n \n\n if(isset($this->data[\"common_info\"][\"nf_info\"]) && $this->data[\"common_info\"][\"nf_info\"][\"unread\"] > 0){\n\n $this->data[\"title_tag\"]= \"({$this->data[\"common_info\"][\"nf_info\"][\"unread\"]}) {$_GET['search_query']} | Lobster\";\n \n }else{\n \n $this->data[\"title_tag\"]= \"{$_GET['search_query']} | Lobster\";\n }\n\n //store the searched query\n $this->data[\"search_query\"] = $_GET['search_query'];\n\n //store the search_query index from $_GET\n $search_query=$_GET[\"search_query\"];\n\n //include all required models\n $post_obj=$this->model_objs[\"post_obj\"];;\n \n $fetch_result=$post_obj->select(array(\n \"column_name\"=>\"\n posts.post_id,\n posts.post_title,\n posts.post_content,\n posts.post_author,\n posts.post_date,\n posts.post_read,\n posts.post_link,\n post_files.pfile_name,\n post_files.pfile_ext,\n users.user_name,\n user_files.ufile_name,\n user_files.ufile_ext\n \",\n \"join\"=>array(\n \"users\"=>\"users.user_id = posts.post_author\",\n \"user_files\"=>\"user_files.user_id = posts.post_author\",\n \"post_files\"=>\"post_files.post_id = posts.post_id\"\n ),\n \"where\"=>\"posts.post_title LIKE '%{$search_query}%' OR posts.post_content LIKE '%{$search_query}%'\"\n ));\n\n if($fetch_result[\"status\"] == 1 && $fetch_result[\"num_rows\"] > 0){\n\n $this->data[\"total_results\"]=$fetch_result[\"num_rows\"];\n\n $this->data[\"results\"]=$fetch_result[\"fetch_all\"];\n \n }else{\n\n $this->data[\"total_results\"]=$fetch_result[\"num_rows\"];\n }\n\n // echo \"<pre>\";\n // print_r($this->data);\n // echo \"</pre>\";\n \n \n //use the function to show all search resutls\n $this->view(\"pages/result\",$this->data);\n \n\n }else{\n\n header(\"Location:{$this->config->domain()}\");\n }\n\n }\n }", "function culturefeed_pages_user_search_result($search_key, CultureFeed_Cdb_Item_Page $page, CultureFeed_Pages_UserList $user_list) {\n\n $query = new CultureFeed_SearchUsersQuery();\n $query->name = $search_key;\n\n $result = DrupalCultureFeed::searchUsers($query);\n\n return array(\n '#theme' => 'culturefeed_pages_user_search_result',\n '#result' => $result,\n '#page' => $page,\n '#user_list' => $user_list\n );\n\n}", "private function executeSearch(): array\n {\n $cover = input_get('cover');\n $older = input_get('older');\n $younger = input_get('younger');\n $ounit = input_get('ounit');\n $yunit = input_get('yunit');\n $covers = getCovers();\n $nonce = $this->create_nonce();\n $json = [\n 'nonce' => $nonce,\n 'admin_url' => url_admin_post(),\n 'referer' => url_menu('bc_covers'),\n 'title' => \\get_admin_page_title(),\n 'images' => url_images(),\n 'mode' => 'search',\n 'folder' => folder_covers(),\n 'baseurl' => url_cover(''),\n 'covers' => $covers,\n 'cover' => $cover,\n 'older' => $older,\n 'ounit' => $ounit,\n 'younger' => $younger,\n 'yunit' => $yunit\n ];\n $oldts = $this->get_timestamp($older, $ounit);\n $youngts = $this->get_timestamp($younger, $yunit);\n $json['found'] = $this->search($cover, $covers, $oldts, $youngts);\n return $json;\n }", "protected function getFacebookData()\n\t{\n\t\t$config = array();\n\t\t$config['appId'] = $this->config->get('fb_app_id');\n\t\t$config['secret'] = $this->config->get('fb_app_secret');\n\t\t$config['fileUpload'] = false; // optional\n\n\t\t$facebook = new Facebook($config);\n\t\t$access_token = $facebook->getAccessToken();\n\n\t\tforeach ($this->aData AS &$elm)\n\t\t{\n\n\t\t\tif (trim($elm->w20_facebook) == '')\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$url = urlencode('https://www.facebook.com/' . $elm->w20_facebook);\n\n\t\t\t$query = \"SELECT+site,id,type+FROM+object_url+WHERE+url='$url'\";\n\t\t\t$fql_query_url = 'https://graph.facebook.com/'\n\t\t\t . 'fql?q=' . $query\n\t\t\t . '&access_token=' . $access_token;\n\t\t\t$fql_query_result = file_get_contents($fql_query_url);\n\t\t\t$fql_query_obj = json_decode($fql_query_result, true);\n\n\t\t\t$r = $fql_query_obj['data'];\n\n\t\t\tif (empty($r))\n\t\t\t{\n\t\t\t\t$elm->someval_facebook_valid = 0;\n\t\t\t\tLog::add('Facebook Invalid:' . $elm->w20_facebook);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$elm->someval_facebook_valid = 1;\n\t\t\t\t$type = $r[0]['type'];\n\t\t\t\t$fb_id = $r[0]['id'];\n\n\t\t\t\t$elm->someval_facebook_type = $type;\n\n\t\t\t\tLog::add('Facebook Valid:' . $elm->w20_facebook . ' | Type=' . $type . ' | Id=' . $fb_id);\n\n\t\t\t\tif ($type == 'page')\n\t\t\t\t{\n\t\t\t\t\t$query = \"SELECT+fan_count+FROM+page+WHERE+page_id='$fb_id'\";\n\t\t\t\t\t$fql_query_url = 'https://graph.facebook.com/'\n\t\t\t\t\t . 'fql?q=' . $query\n\t\t\t\t\t . '&access_token=' . $access_token;\n\t\t\t\t\t$fql_query_result = file_get_contents($fql_query_url);\n\t\t\t\t\t$fql_query_obj = json_decode($fql_query_result, true);\n\n\t\t\t\t\t$r = $fql_query_obj['data'];\n\n\t\t\t\t\t$elm->someval_facebook_friends_or_likes = $r[0]['fan_count'];\n\t\t\t\t\tLog::add('Facebook Fancount:' . $r[0]['fan_count']);\n\t\t\t\t}\n\n\t\t\t\tif ($type == 'profile')\n\t\t\t\t{\n\t\t\t\t\t$query = \"SELECT+friend_count+FROM+user+WHERE+uid=$fb_id\";\n\t\t\t\t\t$fql_query_url = 'https://graph.facebook.com/'\n\t\t\t\t\t . 'fql?q=' . $query\n\t\t\t\t\t . '&access_token=' . $access_token;\n\t\t\t\t\t$fql_query_result = file_get_contents($fql_query_url);\n\t\t\t\t\t$fql_query_obj = json_decode($fql_query_result, true);\n\n\t\t\t\t\t$r = $fql_query_obj['data'];\n\t\t\t\t\t$elm->someval_facebook_friends_or_likes = $r[0]['friend_count'];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function getPaginationAppends(): array\n {\n return ['search' => $this->search];\n }", "function phptemplate_preprocess_search_result(&$variables) {\r\n static $search_zebra = 'even';\r\n $search_zebra = ($search_zebra == 'even') ? 'odd' : 'even';\r\n $variables['search_zebra'] = $search_zebra;\r\n \r\n $result = $variables['result'];\r\n $variables['url'] = check_url($result['link']);\r\n $variables['title'] = check_plain($result['title']);\r\n\r\n // Check for existence. User search does not include snippets.\r\n $variables['snippet'] = '';\r\n if (isset($result['snippet']) && theme_get_setting('search_snippet')) {\r\n $variables['snippet'] = $result['snippet'];\r\n }\r\n \r\n $info = array();\r\n if (!empty($result['type']) && theme_get_setting('search_info_type')) {\r\n $info['type'] = check_plain($result['type']);\r\n }\r\n if (!empty($result['user']) && theme_get_setting('search_info_user')) {\r\n $info['user'] = $result['user'];\r\n }\r\n if (!empty($result['date']) && theme_get_setting('search_info_date')) {\r\n $info['date'] = format_date($result['date'], 'small');\r\n }\r\n if (isset($result['extra']) && is_array($result['extra'])) {\r\n // $info = array_merge($info, $result['extra']); Drupal bug? [extra] array not keyed with 'comment' & 'upload'\r\n if (!empty($result['extra'][0]) && theme_get_setting('search_info_comment')) {\r\n $info['comment'] = $result['extra'][0];\r\n }\r\n if (!empty($result['extra'][1]) && theme_get_setting('search_info_upload')) {\r\n $info['upload'] = $result['extra'][1];\r\n }\r\n }\r\n\r\n // Provide separated and grouped meta information.\r\n $variables['info_split'] = $info;\r\n $variables['info'] = implode(' - ', $info);\r\n\r\n // Provide alternate search result template.\r\n $variables['template_files'][] = 'search-result-'. $variables['type'];\r\n}", "function search(){\n global $conn;\n $key = $_GET['search_key'];\n $query = \"SELECT * FROM user_details WHERE username LIKE '%$key%' OR fname LIKE '%$key%' OR lname LIKE '%$key%' OR email LIKE '%$key%'\";\n $result = mysqli_query($conn, $query);\n $array = array();\n while($row=mysqli_fetch_array($result)){\n $array[] = trim($row['fname']) . ' ' . trim($row['lname']) . '#'. trim($row['u_id']);\n }\n $output = json_encode($array);\n print $output;\n}", "protected function search($data) {\n\t\t$stag = $data->s;\n\t\t$sql = \"SELECT name, search_tags FROM `subreddits` WHERE `search_tags` LIKE '%\".$stag.\"%'\";\n\t\t$query = $this->db->query($sql);\n if ($query->num_rows() > 0) {\n $searchdata['searchdata'] = $query->result_array();\n\t\t} else {\n\t\t\t$searchdata['searchdata'] = array();\n\t\t}\n\t\t// form user gifs will be used in channel\n\t\t$tagdata = $this->app_model->getTag($stag);//will return tag id like ($tagdata['tag_id']);\n\t\tif($tagdata){\n\t\t\t$usertagids \t= $this->app_model->getUserIdsByTagId($tagdata['tag_id']);\n\t\t\tif($usertagids){\n\t\t\t\t$i=0;\n\t\t\t\tforeach($usertagids as $uid){\n\t\t\t\t\t$username \t\t\t\t\t= $this->app_model->getUserdataById($uid['user_id']);\n\t\t\t\t\t$usertagids[$i]['username'] = $username['username'];\n\t\t\t\t\t$usertagids[$i]['profile'] = $username['profile_pic'];\n\t\t\t\t\t$i++;\n\t\t\t\t}\n\t\t\t\t$searchdata['channeldata'] = $usertagids;\n\t\t\t} else {\n\t\t\t\t$searchdata['channeldata'] = array();\n\t\t\t}\n\t\t\t\n\t\t} else {\n\t\t\t$searchdata['channeldata'] = array();\n\t\t\t//$this->falseResponse('No result found'); \n\t\t}\n\t\t$this->trueResponse($searchdata,'success',$encode = true); \n\t}", "public function search();", "public function search();", "function media_bynder_generate_results($results) {\n if (isset($results['totalNrOfResults'])) {\n unset($results['totalNrOfResults']);\n }\n\n if (isset($results['startIndex'])) {\n unset($results['startIndex']);\n }\n\n $results = $results['media'];\n\n $output = array(\n '#theme' => 'item_list',\n '#type' => 'ul',\n '#attributes' => array(\n 'class' => 'result_list'\n )\n );\n\n if (!empty($results)) {\n foreach ($results as $media_item) {\n if (!empty($media_item['thumbnails']['thul'])) {\n $output['#items'][] = media_bynder_generate_result_current($media_item);\n }\n }\n } else {\n return FALSE;\n }\n\n return $output;\n}", "private function getResult(): void\n {\n $matches = $this->getNeedlesResult();\n foreach ($matches as $n_key => $match) {\n if (isset($match['matching_filters'])) {\n $match_count = count($match['matching_filters']);\n if ($match_count === 1) { // Save Matches\n $match = $this->getReturnValues($match);\n $match = $this->getLayerData($match);\n unset($match['matching_filters']);\n $this->SearchResult->matches[$n_key] = $match;\n continue;\n } elseif ($match_count > 1) { // Save Indecisive\n $result = [];\n $matching_filters = $match['matching_filters'];\n unset($match['matching_filters']);\n foreach ($matching_filters as $filter) {\n $result[] = $this->getReturnValues($match, $filter['filter_id']);\n }\n $match[$this->config->prefix . 'matching_filters'] = $result;\n $this->SearchResult->indecisive_matches[$n_key] = $match;\n continue;\n }\n }\n // Save no matches\n $this->SearchResult->no_matches[$n_key] = $match;\n }\n }", "public function search($searched) \n {\n// $ads = $this->where('isValid', true)->groupStart()->like('title', $searched)->groupEnd()->groupStart()\n// ->orLike('text', $searched)->groupEnd()->findAll();\n $ads = $this->like('title', $searched)\n ->orLike('text', $searched)->findAll();\n \n $i = 0;\n foreach ($ads as $ad)\n {\n if ($ad->isValid == false)\n {\n unset($ads[$i]);\n }\n $i++;\n }\n \n return $ads;\n }", "public function tagSearch($search){\n\n $images = [];\n\n /* @var IConnector $connector */\n foreach($this->connectors as $key => $connector) {\n $images = array_merge($images, $connector->tagSearch($search));\n }\n\n return $images;\n }", "protected function createRenderArray(array $result) {\n $items = [];\n foreach ($result as $id => $row) {\n\n $items[$id] = [\n 'vsite_name' => [\n '#type' => 'link',\n '#url' => Url::fromUri($row['vsite_url'], ['absolute' => TRUE]),\n '#title' => $row['vsite_name'],\n '#attributes' => [\n 'class' => 'lynx-title',\n ],\n ],\n 'vsite_description' => [\n '#markup' => '<div class=\"meta-description\">' . $row['vsite_description'] . '</div>',\n ],\n 'content_type' => [\n '#markup' => '<div class=\"content-type\">' . $row['content_type'] . '</div>',\n ],\n 'title' => [\n '#prefix' => '<h2 class=\"node--title\">',\n '#type' => 'link',\n '#url' => Url::fromUri($row['url'], ['absolute' => TRUE]),\n '#title' => $row['title'],\n '#suffix' => '</h2>',\n ],\n 'body' => [\n '#markup' => '<div class=\"body\">' . Unicode::truncate($row['body'], 128, TRUE, TRUE) . '</div>',\n ],\n 'see_more' => [\n '#type' => 'link',\n '#url' => Url::fromUri($row['url'], ['absolute' => TRUE]),\n '#title' => $this->t('Read more'),\n ],\n ];\n if ($row['vsite_logo']) {\n $image = [\n '#theme' => 'image',\n '#uri' => $row['vsite_logo'],\n '#alt' => $row['vsite_name'],\n '#weight' => -1,\n ];\n $items[$id]['vsite_logo'] = [\n '#type' => 'link',\n '#url' => Url::fromUri($row['vsite_url'], ['absolute' => TRUE]),\n '#title' => $image,\n '#weight' => -2,\n ];\n }\n }\n\n $build['search_results'] = [\n '#title' => $this->t('Search'),\n 'content' => [\n '#theme' => 'item_list__search_results',\n '#items' => $items,\n '#empty' => [\n '#markup' => '<h3>' . $this->t('Your search yielded no results.') . '</h3>',\n ],\n '#type' => 'remote',\n '#attributes' => [\n 'class' => ['lynx-search-listing'],\n ],\n ],\n ];\n return $build;\n }", "function top_store_search_site(){\n $results = new WP_Query( array(\n 'post_type' => 'product',\n 'post_status' => 'publish',\n 'nopaging' => true,\n 'posts_per_page'=> 100,\n 's' => esc_html($_POST['match']),\n ) );\n $items = array();\n if ( !empty( $results->posts ) ) {\n foreach ( $results->posts as $result ) {\n $items[] = $result->post_title;\n }\n }\n wp_send_json_success( $items );\n}", "private function new_search()\n {\n $this->template = FALSE;\n \n $articulo = new articulo();\n $codfamilia = '';\n if( isset($_REQUEST['codfamilia']) )\n {\n $codfamilia = $_REQUEST['codfamilia'];\n }\n \n $con_stock = isset($_REQUEST['con_stock']);\n $this->results = $articulo->search($this->query, 0, $codfamilia, $con_stock);\n \n /// añadimos la busqueda\n foreach($this->results as $i => $value)\n {\n $this->results[$i]->query = $this->query;\n $this->results[$i]->dtopor = 0;\n }\n \n header('Content-Type: application/json');\n echo json_encode($this->results);\n }", "public function setSearch()\n\t{\n\t\t$this->search_term = $this->credentials['facebook_page_id'];\n\t}", "function createSearchObj($data=null)\n\t{\n\t\tif( $data == null )\n\t\t{\n\t\t\t$ret_arr = new stdClass;\n\t\t\t$ret_arr->status = false;\n\t\t\t$ret_arr->message = JText::_( 'PLG_API_EASYSOCIAL_USER_NOT_FOUND' );\n\t\t\t\n\t\t\treturn $ret_arr;\n\t\t}\n\t\n\t\t\n\t\t$user = JFactory::getUser($this->plugin->get('user')->id);\n\t\t$frnd_mod = new EasySocialModelFriends();\n\t\t$list = array();\n\n\t\t$options[ 'state' ]\t= SOCIAL_FRIENDS_STATE_PENDING;\n\t\t$options[ 'isRequest' ]\t= true;\t\t\n\t\t$req=$frnd_mod->getFriends( $user->id,$options );\t\n\t\t$myarr=array();\n\t\tif(!empty($req))\n\t\t{\n\t\t\tforeach($req as $ky=>$row)\t\n\t\t\t{\n\t\t\t\t$myarr[]= $row->id;\n\t\t\t}\n\t\t}\n\n\t\tforeach($data as $k=>$node)\n\t\t{\n\t\t\tif($node->id != $user->id)\n\t\t\t{\n\t\t\t\t\n\t\t\t\t$node->mutual = $frnd_mod->getMutualFriendCount($user->id,$node->id);\n\t\t\t\t$node->isFriend = $frnd_mod->isFriends($user->id,$node->id);\n\t\t\t\t$node->approval_pending = $frnd_mod->isPendingFriends($user->id,$node->id);\n\t\t\t\tif(in_array($node->id,$myarr))\n\t\t\t\t{\n\t\t\t\t\t$node->isinitiator=true;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$node->isinitiator=false;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$list[] = $node;\n\t\t\t}\n\t\t}\n\t\treturn $list;\n\t}", "public function searchTweets($params = array());", "public function get_all_companytrainees() {\n $matches = array();\n $query_string = htmlspecialchars($_POST['q'], ENT_QUOTES, 'UTF-8');\n $company = $this->input->post('company_id');\n $result = $this->classtraineemodel->get_all_company_trainee_details($this->tenant_id, $query_string, $company);\n if ($result) {\n foreach ($result as $row) {\n $matches[] = array(\n 'key' => $row->user_id,\n 'label' => $row->first_name . ' ' . $row->last_name . ' (' . $row->tax_code . ')',\n 'value' => $row->first_name . ' ' . $row->last_name\n );\n }\n }\n echo json_encode($matches);\n exit();\n }", "function search_people($target) { \n //retrive a specific thinktank, either by id or name\n if (is_numeric($target)) { \n $query = \"SELECT * FROM people WHERE person_id= '$target'\"; \n }\n else { \n $target= mysql_real_escape_string($target); \n $query = \"SELECT * FROM people WHERE name_primary = '$target'\";\n }\n \n $results = $this->fetch($query);\n $output = array();\n foreach($results as $result) { \n $jobs = $this->search_jobs($result[\"name_primary\"], '', '', false, false);\n $temp_output['person'] = $result;\n $temp_output['jobs'] = $jobs;\n $output[] = $temp_output;\n }\n \n return $output;\n }", "function netxpagepostdatafromfacebook($url) {\n $nextpagedata = $this->file_get_contents_curl($url);\n $returnarray = array();\n if (!empty($nextpagedata) && isset($nextpagedata['data'])) {\n foreach ($nextpagedata['data'] as $fbdatanext) {\n if (isset($fbdatanext['link']) && strpos($fbdatanext['link'], 'topic/details')) {\n $returnarray[] = $fbdatanext;\n }\n }\n }\n if (isset($nextpagedata['paging']) && isset($nextpagedata['paging']['next'])) {\n $returnarray[] = $this->netxpagepostdatafromfacebook($nextpagedata['paging']['next']);\n }\n return $returnarray;\n }", "function mailpage_search($keywords,$areas) {\n $results = array();\n return $results;\n}", "public function autocomplete(Request $request)\n {\n $term=$request->term;\n $data = User::where('name','LIKE','%'.$term.'%')->where('id','<>',1)\n ->take(15)\n ->get();\n $a1=array();\n $a2=array();\n foreach ($data as $key => $v){\n $a1[]=['value' =>$v->name];\n }\n\n return response()->json($a1);\n}", "private function FBsentimentAnalysis($results)\n {\n $sentiment_counter = array(\"positive\" => 0, \"negative\" => 0, \"neutral\" => 0);\n if ($results == null) {\n return [$results, $sentiment_counter];\n }\n //print_r($results);\n $return = $this->azureSendRequest($results);\n if ($return == false){\n return 400;\n }\n foreach ($return['documents'] as $result) {\n //Incrementing sentiment counter\n $text = $results[$result['id'] - 1]['text'];\n $results[$result['id'] - 1]['comment_author'] = str_replace(array(\"'\", \"`\", '\"'), \"\", $results[$result['id'] - 1]['comment_author']);\n $results[$result['id'] - 1]['text'] = str_replace(array(\"\\r\\n\", \"\\n\", \"\\r\", \"'\", \"`\", '\"'), \"\", $text);\n $this->incrementSentiment($result['score'], $sentiment_counter, $result, $results);\n\n //Geo text matching patterns in text in ...\n// preg_match_all(\"/in \\w+/\", $text, $new_text);\n// foreach ($new_text[0] as $t) {\n// print_r($t);\n// $geoResult = shell_exec(' python '.public_path().'/geotext/geo.py \"'.$t.'\"');\n// echo(\"FB Geo result location: \" . $geoResult . \"<br>\");\n// }\n }\n return [$results, $sentiment_counter];\n }", "public function post_data(Request $r)\n {\n $elasticsearch_search = ClientBuilder::create()->build();\n //$client =new ClientBuilder();\n $query = $r->input('search');\n $items = $elasticsearch_search->search([\n 'index' => 'articles',\n 'type' => 'article',\n 'body' => [\n 'query' => [\n 'multi_match' => [\n 'fields' => ['title', 'body'],\n 'query' => $query,\n ],\n ],\n \n ],\n \n 'size' =>10,\n \n ]);\n\n //return $items;\n for ($i = 0; $i < 10; $i++) {\n $response[] = array(\"value\"=>$items['hits']['hits'][$i]['_source']['title'],\"label\"=>$items['hits']['hits'][$i]['_source']['title']);\n }\n\n echo json_encode($response);\n \n \n }", "function peoples($array=''){\n\t$order='';$limit='LIMIT 0,50';$where='1';\n\t$uid=$_SESSION['ws-tags']['ws-user']['id'];\n\t// $from='users u';\n\t$from='(select *, TIMESTAMPDIFF(YEAR, date_birth, CURDATE()) AS age from users) u';\n\t//se comento el email para evitar robo de emails en el sitio, se debe evitar mostral email en cualquier vista o json\n\t$select=' DISTINCT\n\t\tu.id AS id,\n\t\tCONCAT(u.`name`,\" \",u.last_name) AS name_user,\n\t\tu.username AS username,\n\t\tu.description,\n\t\t--u.email as email,\n\t\tu.country as id_country,\n\t\tu.profile_image_url AS photo_friend,\n\t\tmd5(CONCAT(u.id,\"_\",u.email,\"_\",u.id)) AS code_friend,\n\t\tif(u.show_my_birthday<2,u.age,0) AS age,\n\t\tc.name AS country,\n\t\tu.friends_count,\n\t\tu.following_count,\n\t\tu.followers_count,\n\t\tul.id_user AS follower\n\t';\n\t$from.=\"\n\t\tLEFT JOIN (SELECT id, name FROM countries) c ON c.id=u.country\n\t\tLEFT JOIN (SELECT id_friend, id_user,is_friend FROM users_links) ul ON (ul.id_friend=u.id AND ul.id_user='$uid')\n\t\";\n\tif(isset($array['select'])){\t\t$select.=$array['select']; }\n\telseif(isset($array['newSelect'])){\t$select=$array['newSelect']; }\n\tif (isset($array['from'])){\t\t\t$from=$array['from']; }\n\telseif(isset($array['join'])){\t\t$from.=$array['join']; }\n\tif (isset($array['where'])){\t\t$where=$array['where']; }\n\tif (isset($array['limit'])){\t\t$limit=$array['limit']; }\n\tif (isset($array['order'])){\t\t$order=$array['order']; }\n\t$sql=\"SELECT $select FROM $from WHERE $where $order $limit\";\n\tif(isset($_GET['debug']) && isset($_GET['return'])) return '<pre>'.$sql.'</pre>';\n\telseif(isset($_GET['debug'])) echo '<div><pre>'.$sql.'</pre></div>';\n\t$users=CON::query($sql);\n\treturn $users;\n}", "private function buildSearchResultsResponse($api_result) {\n\n $response = [];\n\n if (isset($api_result['query']['search'])) {\n\n $pages = $api_result['query']['search'];\n\n foreach ($pages as $page) {\n\n $response_element = [\n 'title' => $page['title'],\n 'url' => Yii::$app->getHomeUrl() . 'articles/article?title=' . $page['title']\n ];\n\n if (isset($page['snippet'])) {\n\n $points = '';\n\n if (!$this->starts_with_upper(trim($page['snippet']))) {\n $points = '...';\n }\n\n $snippet = $points . trim($page['snippet']) . '...';\n\n $response_snippet = [\n 'snippet' => $snippet\n ];\n\n $response_element = array_merge($response_element, $response_snippet);\n }\n\n array_push($response, $response_element);\n }\n }\n\n return $response;\n }", "public function custom_live_videos_search(Request $request) {\n\n $validator = Validator::make(\n $request->all(),\n array(\n 'term' => 'required',\n ),\n array(\n 'exists' => 'The :attribute doesn\\'t exists',\n )\n );\n \n if ($validator->fails()) {\n\n $error_messages = implode(',', $validator->messages()->all());\n\n $response_array = array('success' => false, 'error_messages' => $error_messages, 'error_code' => 101);\n\n } else {\n\n $list = [];\n\n $q = $request->term;\n\n $take = $request->take ? $request->take : Setting::get('admin_take_count');\n\n $query = CustomLiveVideo::liveVideoResponse()->orderBy('custom_live_videos.created_at', 'desc')\n ->where('custom_live_videos.title', 'like', \"%\".$q.\"%\");\n\n if ($request->has('custom_live_video_id')) {\n\n $query->whereNotIn('custom_live_videos.id', [$request->custom_live_video_id]);\n\n }\n\n if ($request->type == 'owned') {\n\n $query->where('custom_live_videos.user_id', $request->id);\n\n } else {\n\n $query->where('custom_live_videos.status', APPROVED);\n\n }\n\n $take = $request->has('take') ? $request->take : Setting::get('admin_take_count' ,12);\n\n $model = $query->skip($request->skip)->take($take)->get();\n\n $response = [];\n\n foreach ($model as $key => $value) {\n\n $model = Follower::where('follower', $request->id)\n\n ->where('user_id', $value->user_id)->first();\n\n $follower_is_follow = DEFAULT_FALSE;\n\n if($model) {\n\n $follower_is_follow = DEFAULT_TRUE;\n\n }\n \n if ($request->id == $value->user_id) {\n\n $follower_is_follow = -1;\n\n }\n\n $no_of_followers = Follower::where('user_id', $value->user_id)->count();\n\n $share_link = Setting::get('ANGULAR_URL').'live-tv/view?id='.$value->custom_live_video_id;\n\n $response[] = [\n 'custom_live_video_id'=>$value->custom_live_video_id, \n 'title'=>$value->title,\n 'user_name'=>$value->user_name,\n 'user_picture'=>$value->user_picture,\n 'description'=>$value->description,\n 'is_follow'=>$follower_is_follow,\n 'no_of_followers'=>$no_of_followers ? $no_of_followers : 0,\n 'hls_video_url'=>$value->hls_video_url,\n 'rtmp_video_url'=>$value->rtmp_video_url,\n 'image'=>$value->image,\n 'user_id'=>$value->user_id,\n 'created_date'=>$value->created_date,\n 'category_name'=>$value->category_name,\n 'viewer_count'=>\"\",\n 'share_link'=>$share_link\n ];\n \n }\n\n $response_array = ['success' => true , 'data' => $response];\n\n } \n \n return response()->json($response_array, 200);\n\n }", "public function recording($request, $count,$after,$category = \"all\",$video = false)\n {\n if($video)\n {\n\n $counts = $count;\n $min = count($this->resultHeaderV[0]);\n foreach ($this->resultHeaderV as $header)\n {\n if(count($header) < $min)\n {\n $min = count($header);\n }\n }\n\n if($min > 0)\n {\n // echo $min;\n $compt = 0;\n for ($count = 0; $count < $min; $count++) {\n\n for ($pas = 0; $pas < count($this->resultHeaderV); $pas++)\n {\n $searchResult = new Search_Result([\n 'title' => $this->resultHeaderV[$pas][$count],\n 'link' => $this->resultLinkV[$pas][$count],\n 'links' => $this->resultLink_textV[$pas][$count],\n 'videoLink' => $this->resultVideo[$pas][$count],\n 'preview' => $this->resultBodyV[$pas][$count],\n 'category' => $category\n ]);\n\n if(!$this->contains_searchResult($searchResult,$request))\n {\n $searchResult->search()->associate($this->search_);\n $searchResult->save();\n if($after)\n {\n array_splice( $this->searchResults, 2*$compt, 0, array($searchResult) );\n }\n else\n {\n array_push($this->searchResults, $searchResult);\n }\n if($this->eager)\n {\n array_push($this->searchResultsDB, $searchResult);\n }\n $compt++;\n $counts++;\n }\n\n }\n }\n }\n\n $counts = $count;\n $min = count($this->resultHeader[0]);\n foreach ($this->resultHeader as $header)\n {\n if(count($header) < $min)\n {\n $min = count($header);\n }\n }\n\n if($min > 0)\n {\n // echo $min;\n $compt = 0;\n for ($count = 0; $count < $min; $count++) {\n\n for ($pas = 0; $pas < count($this->resultHeader); $pas++)\n {\n $searchResult = new Search_Result([\n 'title' => $this->resultHeader[$pas][$count],\n 'link' => $this->resultLink[$pas][$count],\n 'links' => $this->resultLink_text[$pas][$count],\n 'videoLink' => 'empty',\n 'preview' => $this->resultBody[$pas][$count],\n 'category' => $category\n ]);\n\n if(!$this->contains_searchResult($searchResult,$request))\n {\n $searchResult->search()->associate($this->search_);\n $searchResult->save();\n if($after)\n {\n array_splice( $this->searchResults, 2*$compt, 0, array($searchResult) );\n }\n else\n {\n array_push($this->searchResults, $searchResult);\n }\n if($this->eager)\n {\n array_push($this->searchResultsDB, $searchResult);\n }\n $compt++;\n $counts++;\n }\n\n }\n }\n }\n }\n else{\n\n $counts = $count;\n $min = count($this->resultHeader[0]);\n foreach ($this->resultHeader as $header)\n {\n if(count($header) < $min)\n {\n $min = count($header);\n }\n }\n\n if($min > 0)\n {\n // echo $min;\n $compt = 0;\n for ($count = 0; $count < $min; $count++) {\n\n for ($pas = 0; $pas < count($this->resultHeader); $pas++)\n {\n $searchResult = new Search_Result([\n 'title' => $this->resultHeader[$pas][$count],\n 'link' => $this->resultLink[$pas][$count],\n 'links' => $this->resultLink_text[$pas][$count],\n 'preview' => $this->resultBody[$pas][$count],\n 'category' => $category\n ]);\n\n if(!$this->contains_searchResult($searchResult,$request))\n {\n $searchResult->search()->associate($this->search_);\n $searchResult->save();\n if($after)\n {\n array_splice( $this->searchResults, 2*$compt, 0, array($searchResult) );\n }\n else\n {\n array_push($this->searchResults, $searchResult);\n }\n if($this->eager)\n {\n array_push($this->searchResultsDB, $searchResult);\n }\n $compt++;\n $counts++;\n }\n\n }\n }\n }\n }\n\n return $counts;\n }", "static function get_all_the_results( $headers ) {\n\t\t$output = array();\n\t\t$output['varnish'] = self::varnish_results( $headers );\n\n\t\t// Server Results\n\t\t$server_results = self::server_results( $headers );\n\t\t$output = array_merge( $output, $server_results );\n\n\t\t// Cache Results\n\t\t$cache_results = self::cache_results( $headers );\n\t\t$output = array_merge( $output, $cache_results );\n\n\t\t// Cookies\n\t\t$cookie_results = self::cookie_results( $headers );\n\t\t$output = array_merge( $output, $cookie_results );\n\n/*\n\t\t// Sadly these need to be rewritten to work well remotely :(\n\n\t\t// Themes that don't play nicely with Varnish)\n\t\t$bad_themes_results = self::bad_themes_results();\n\t\t$output = array_merge( $output, $bad_themes_results );\n\n\t\t// Plugins that don't play nicely with Varnish)\n\t\t$bad_plugins_results = self::bad_plugins_results();\n\t\t$output = array_merge( $output, $bad_plugins_results );\n*/\n\t\treturn $output;\n\t}" ]
[ "0.58313274", "0.5830549", "0.57961476", "0.57745135", "0.56896186", "0.5591793", "0.5485223", "0.5427929", "0.5410178", "0.54036355", "0.54034007", "0.53733975", "0.5316131", "0.5310088", "0.5303067", "0.53007394", "0.5280451", "0.5276002", "0.5263066", "0.5253595", "0.52206624", "0.52035534", "0.52010113", "0.52006274", "0.5191087", "0.51466644", "0.51460063", "0.5137666", "0.5131041", "0.51265025", "0.5099836", "0.50992584", "0.5095757", "0.5092332", "0.5085115", "0.50812584", "0.5080107", "0.5075586", "0.50742066", "0.50647724", "0.50617915", "0.50587654", "0.5043765", "0.50437576", "0.50416017", "0.50408167", "0.50330675", "0.503048", "0.5015547", "0.5011813", "0.5001656", "0.49929333", "0.49863482", "0.49801916", "0.49749324", "0.49680865", "0.49680698", "0.49549985", "0.49422553", "0.4941627", "0.49400353", "0.49272484", "0.49257705", "0.4921917", "0.49194676", "0.4915987", "0.4903971", "0.49039647", "0.49003512", "0.48966497", "0.48965788", "0.4893474", "0.4886737", "0.48806792", "0.48767328", "0.4876726", "0.4871205", "0.48663592", "0.48663592", "0.48643687", "0.486272", "0.4852989", "0.48493195", "0.48397702", "0.48379043", "0.48357525", "0.4832299", "0.4832265", "0.48225266", "0.4821502", "0.4821184", "0.48210943", "0.4820739", "0.48075154", "0.48018512", "0.48011062", "0.47964916", "0.47938555", "0.47928047", "0.4792093", "0.47913504" ]
0.0
-1
insert search result into database
public function addPage($pages) { foreach($pages as $page) { try{ DB::insert('page', array('page_id', 'name', 'pic_square', 'pic', 'page_url', 'type', 'website', 'founded', 'company_overview', 'mission', 'products', 'location', 'parking', 'public_transit', 'hours', 'latitude', 'longitude')) ->values($page) ->execute(); } catch(Exception $e) { } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function save_search(){\r\n $db = new DB();\r\n \r\n $q = \"INSERT INTO `\".TblModSearchResult.\"` SET \r\n `query` = '\".$this->query.\"',\r\n `ip` = '\".$this->ip.\"',\r\n `date` = '\".date(\"Y-m-d\").\"',\r\n `time` = '\".date(\"G:i:s\").\"',\r\n `result` = '\".$this->result.\"'\r\n \";\r\n $res = $db->db_Query( $q );\r\n //echo \"<br> q = \".$q.\" res = \".$res;\r\n \r\n}", "public function insertSearchQuery($string) {\n\t\t$conn\t\t= $this->connect();\n\t\t$userSession= new Container('fo_user');\n\t\t$userId\t\t= (isset($userSession->userSession['_id'])) ? (string)$userSession->userSession['_id'] : 0;\n\t\t$collection\t= $conn->snapstate->media_searches;\n\t\t$query\t\t= array('query'\t\t\t=> $string,\n\t\t\t\t\t\t\t'user_id'\t\t=> $userId,\n\t\t\t\t\t\t\t'date_searched'\t=> date('m/d/Y H:i:s'));\n\t\t$results\t= $collection->insert($query);\n\t}", "function insert_found_record($dbc, $finder, $item_name, $description, $location_id, $create_date) {\n\t$query = 'INSERT INTO stuff(finder, item_name, description, location_id, create_date, status) VALUES (\"'.$finder.'\" ,\"'.$item_name.'\", \"'.$description.'\", \"'.$location_id.'\", \"'.$create_date.'\", \"found\")' ;\n show_query($query);\n\n $results = mysqli_query($dbc,$query) ;\n check_results($results) ;\n\n return $results ;\n \n echo '<p> Your submission was successful!</p>' ;\n}", "function addSearchstep($sss_details){\n\t if ($this->db->insert('vc_search',$sss_details))\n\t\t\t{ \n\t\t\treturn TRUE;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\treturn FALSE;\n\t\t\t}\n }", "protected function _insertOrUpdateSearchIndex()\r\n {\r\n $dataHandler = new ThemeHouse_ConvSearch_Search_DataHandler_ConversationMessage();\r\n\r\n $indexer = new XenForo_Search_Indexer();\r\n $dataHandler->insertIntoIndex($indexer, $this->getMergedData());\r\n }", "function insert_admin_record($dbc, $finder, $item_name, $description, $location_id, $create_date) {\n\t$query = 'INSERT INTO stuff(finder, item_name, description, location_id, create_date, status) VALUES (\"'.$finder.'\" ,\"'.$item_name.'\", \"'.$description.'\", \"'.$location_id.'\", \"'.$create_date.'\", \"found\")' ;\n show_query($query);\n\n $results = mysqli_query($dbc,$query) ;\n check_results($results) ;\n\n return $results ;\n \n echo '<p> Your submission was successful!</p>' ;\n}", "public function run()\n {\n $keywords = ['服装', '电脑', '手机', '鞋', '袜子'];\n foreach ($keywords as $keyword) {\n $datas[] = [\n 'keyword' => $keyword,\n 'keyword_count' => 1,\n 'sort' => 1,\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now()\n ];\n }\n DB::table('searches')->insert($datas);\n }", "function _search_tmp($string){\n\t\tglobal $bBlog;\n\t\treturn $bBlog->db->query(\"\n\t\t\tINSERT INTO `\".T_SEARCH_TMP.\"` (`article_id` , `points`, `string`, `time` )\n\t\t\tSELECT `article_id`, SUM(`score`) AS `points`, '\".$string.\"', NOW()\n\t\t\tFROM `\".T_SEARCH.\"`\n\t\t\tWHERE `value` LIKE '\".$string.\"'\n\t\t\tGROUP BY id\n\t\t\tORDER BY points DESC;\n\t\t\");\n\t}", "function insertSearchTrip( $search_id, $trip_id, $score ) {\n global $mysqli;\n $insert = \"INSERT INTO `search_history_trips` (`search_id`, `trip_id`, `score`) VALUES ( $search_id, $trip_id, $score )\";\n $mysqli->query( $insert );\n}", "public function index() {\n\t\tSearch::index($this->table)->insert(\n\t\t\t$this['slug'],\n\t\t\t[\n\t\t\t\t'title'\t\t=> $this['title'],\n\t\t\t\t'text'\t\t=> $this['text'],\n\t\t\t\t'category'\t=> $this->category->name,\n\t\t\t],\n\t\t\t[\n\t\t\t\t'_type'\t\t=> $this->table,\n\t\t\t]\n\t\t);\n\t}", "function insert()\r\n {\r\n $log = FezLog::get();\r\n $db = DB_API::get();\r\n\r\n if (function_exists('apc_clear_cache')) {\r\n apc_clear_cache('user');\r\n }\r\n\r\n if (@$_POST[\"sek_simple_used\"]) {\r\n $sek_simple_used = 'TRUE';\r\n } else {\r\n $sek_simple_used = 'FALSE';\r\n }\r\n if (@$_POST[\"sek_bulkchange\"]) {\r\n $sek_bulkchange = 'TRUE';\r\n } else {\r\n $sek_bulkchange = 'FALSE';\r\n }\r\n if (@$_POST[\"sek_adv_visible\"]) {\r\n $sek_adv_visible = 'TRUE';\r\n } else {\r\n $sek_adv_visible = 'FALSE';\r\n }\r\n if (@$_POST[\"sek_myfez_visible\"]) {\r\n $sek_myfez_visible = 'TRUE';\r\n } else {\r\n $sek_myfez_visible = 'FALSE';\r\n }\r\n if (@$_POST[\"sek_faceting\"]) {\r\n $sek_faceting = 'TRUE';\r\n } else {\r\n $sek_faceting = 'FALSE';\r\n }\r\n if (@$_POST[\"sek_cardinality\"] == '1') {\r\n $sek_cardinality = 'TRUE';\r\n } else {\r\n $sek_cardinality = 'FALSE';\r\n }\r\n if (@$_POST[\"sek_relationship\"] == '1') {\r\n $sek_relationship = 'TRUE';\r\n } else {\r\n $sek_relationship = 'FALSE';\r\n }\r\n\r\n\r\n $sekIncrId = Search_Key::getNextIncrId(APP_PID_NAMESPACE);\r\n $sek_id = APP_PID_NAMESPACE . '_' . $sekIncrId;\r\n\r\n $stmt = \"INSERT INTO\r\n \" . APP_TABLE_PREFIX . \"search_key\r\n (\r\n sek_id,\r\n sek_namespace,\r\n sek_incr_id,\r\n sek_title,\r\n sek_desc,\r\n\t\t\t\t\tsek_alt_title,\r\n\t\t\t\t\tsek_meta_header,\r\n\t\t\t\t\tsek_simple_used,\r\n\t\t\t\t\tsek_bulkchange,\r\n\t\t\t\t\tsek_adv_visible,\r\n\t\t\t\t\tsek_myfez_visible,\r\n\t\t\t\t\tsek_faceting,\";\r\n if (is_numeric($_POST[\"sek_order\"])) {\r\n $stmt .= \" sek_order, \";\r\n }\r\n if (is_numeric($_POST[\"sek_relationship\"])) {\r\n $stmt .= \" sek_relationship, \";\r\n }\r\n if (is_numeric($_POST[\"sek_cardinality\"])) {\r\n $stmt .= \" sek_cardinality, \";\r\n }\r\n\r\n $stmt .= \"\r\n\t\t\t\t\tsek_data_type,\r\n\t\t\t\t\tsek_html_input,\r\n\t\t\t\t\tsek_fez_variable,\r\n\t\t\t\t\tsek_lookup_function,\r\n\t\t\t\t\tsek_lookup_id_function,\r\n\t\t\t\t\tsek_suggest_function,\r\n\t\t\t\t\tsek_comment_function,\r\n\t\t\t\t\tsek_derived_function,\r\n\t\t\t\t\tsek_smarty_variable \";\r\n if (is_numeric($_POST[\"sek_cvo_id\"])) {\r\n $stmt .= \" ,sek_cvo_id \";\r\n }\r\n $stmt .= \"\r\n ) VALUES (\r\n \" . $db->quote($sek_id) . \",\r\n \" . $db->quote(APP_PID_NAMESPACE) . \",\r\n \" . $db->quote($sekIncrId, 'INTEGER') . \",\r\n \" . $db->quote($_POST[\"sek_title\"]) . \",\r\n \" . $db->quote($_POST[\"sek_desc\"]) . \",\r\n\t\t\t\t\t\" . $db->quote($_POST[\"sek_alt_title\"]) . \",\r\n\t\t\t\t\t\" . $db->quote($_POST[\"sek_meta_header\"]) . \",\r\n\t\t\t\t\t\" . $sek_simple_used . \",\r\n\t\t\t\t\t\" . $sek_bulkchange . \",\r\n\t\t\t\t\t\" . $sek_adv_visible . \",\r\n\t\t\t\t\t\" . $sek_myfez_visible . \",\r\n\t\t \" . $sek_faceting . \",\";\r\n if (is_numeric($_POST[\"sek_order\"])) {\r\n $stmt .= $_POST[\"sek_order\"] . \",\";\r\n }\r\n if (is_numeric($_POST[\"sek_relationship\"])) {\r\n $stmt .= $sek_relationship . \",\";\r\n }\r\n if (is_numeric($_POST[\"sek_cardinality\"])) {\r\n $stmt .= $sek_cardinality . \",\";\r\n }\r\n\r\n $stmt .= \"\r\n \" . $db->quote($_POST[\"sek_data_type\"]) . \",\r\n \" . $db->quote($_POST[\"field_type\"]) . \",\r\n \" . $db->quote($_POST[\"sek_fez_variable\"]) . \",\r\n\t\t\t\t\t\" . $db->quote($_POST[\"sek_lookup_function\"]) . \",\r\n\t\t\t\t\t\" . $db->quote($_POST[\"sek_lookup_id_function\"]) . \",\r\n\t\t\t\t\t\" . $db->quote($_POST[\"sek_suggest_function\"]) . \",\r\n\t\t\t\t\t\" . $db->quote($_POST[\"sek_comment_function\"]) . \",\r\n\t\t\t\t\t\" . $db->quote($_POST[\"sek_derived_function\"]) . \",\r\n \" . $db->quote($_POST[\"sek_smarty_variable\"]);\r\n if (is_numeric($_POST[\"sek_cvo_id\"])) {\r\n $stmt .= \",\" . $db->quote($_POST[\"sek_cvo_id\"], 'INTEGER');\r\n }\r\n $stmt .= \")\";\r\n\r\n try {\r\n $db->exec($stmt);\r\n }\r\n catch (Exception $ex) {\r\n $log->err($ex);\r\n return -1;\r\n }\r\n\r\n if (function_exists('apc_clear_cache')) {\r\n apc_clear_cache('user');\r\n }\r\n\r\n if ($_POST['create_sql']) {\r\n\r\n if ($_POST[\"sek_relationship\"] == 1) {\r\n // no longer need to get sek_id - as it is pre-got before the insert\r\n //\t $sek_id = $GLOBALS[\"db_api\"]->dbh->getLastInsertId(APP_TABLE_PREFIX . \"search_key\", 'sek_id');\r\n return Search_Key::createSearchKeyDB($sek_id);\r\n\r\n } elseif ($_POST[\"sek_relationship\"] == 0) {\r\n\r\n include_once(APP_INC_PATH . 'class.bgp_create_searchkey.php');\r\n // no longer need to get sek_id - as it is pre-got before the insert\r\n //\t $sek_id = $GLOBALS[\"db_api\"]->dbh->getLastInsertId(APP_TABLE_PREFIX . \"search_key\", 'sek_id');\r\n\r\n /*\r\n * Because the alter might take a while, run in\r\n * a background process\r\n */\r\n $bgp = new BackgroundProcess_Create_SearchKey();\r\n $bgp->register(serialize(array('sek_id' => $sek_id)), Auth::getUserID());\r\n Session::setMessage('The column is being created as a background process (see My Fez to follow progress)');\r\n return 1;\r\n }\r\n }\r\n }", "abstract public function insert();", "protected function _insert()\n\t{\n\t}", "public abstract function insert();", "protected function _insert()\n {\n \n }", "protected function _insert()\n {\n \n }", "private function logSearchText($text){\r\n\t\t\t$escaped = mysql_real_escape_string($text);\r\n\t\t\t$sql \t= \"insert ignore into usage_search_log (`search_text`) values (\\\"$escaped\\\");\";\r\n\t\t\t$res \t= $this->query_runner->runQuery($sql);\r\n\t\t\t$id \t= mysql_insert_id($this->connection->getDbLink());\r\n\t\t\tif($id == 0){\r\n\t\t\t\t$find \t\t= \"select id from usage_search_log where search_text = '$escaped' limit 1\";\r\n\t\t\t\t$find_res \t= $this->query_runner->runQuery($find);\r\n\t\t\t\t$line \t\t= mysql_fetch_array($find_res ,MYSQL_ASSOC);\r\n\t\t\t\t$id \t\t= $line[\"id\"];\r\n\t\t\t\tmysql_free_result($find_res);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn $id;\r\n\t\t}", "public function postInsert(\\Propel\\Runtime\\Connection\\ConnectionInterface $con = null) {\n parent::postInsert($con);\n SearchLocation::prepareForLocation($this, new SearchLocation())\n ->save($con);\n }", "function clonResultados($T_RESULTADOS,$PROVINCIA, $CLAVE, $TOMO, $FOLIO){\n\n global $mysqli;\n $TRES = $T_RESULTADOS;\n $query = new Query($mysqli, \"INSERT INTO \".$TRES.\" SELECT * FROM resultadostmp WHERE provincia=? and clave=? and tomo=? and folio=?\");\n $parametros = array('ssss', &$PROVINCIA, &$CLAVE, &$TOMO, &$FOLIO);\n $data = $query->getresults($parametros);\n return true;\n}", "public function insert($data);", "function insert($sql){\n\n\t\tglobal $way;\n\t\t$way -> query($sql);\n\n\t}", "function insert(){\r\n $this->model->randomInsert();\r\n $this->index();\r\n }", "protected function insert() {\n // get firat line and use it as title\n $this->title = $this->getFileTitle();\n\n $insertDoc = $this->dbConn->prepare(\"\n INSERT INTO docs(file_name, title, content, count_of_terms) \n VALUES (:fileName, :title, :content, :count_of_terms)\");\n $result = $insertDoc->execute(array(\n ':fileName' => $this->fileName,\n ':title' => $this->title,\n ':content' => $this->content,\n ':count_of_terms' => count($this->uniqueMatchesStatus)\n ));\n\n if ($result) {\n $this->id = $this->dbConn->lastInsertId();\n } else {\n throw new Exception('Error on insert document in database.', 500);\n }\n }", "public function searchItem($title) {\n \n //Create Database conexion\n }", "private function new_search()\n {\n $this->template = FALSE;\n \n $articulo = new articulo();\n $codfamilia = '';\n if( isset($_REQUEST['codfamilia']) )\n {\n $codfamilia = $_REQUEST['codfamilia'];\n }\n \n $con_stock = isset($_REQUEST['con_stock']);\n $this->results = $articulo->search($this->query, 0, $codfamilia, $con_stock);\n \n /// añadimos la busqueda\n foreach($this->results as $i => $value)\n {\n $this->results[$i]->query = $this->query;\n $this->results[$i]->dtopor = 0;\n }\n \n header('Content-Type: application/json');\n echo json_encode($this->results);\n }", "public function insert_search_activity($data = NULL) {\n\n $db = Yii::app()->db;\n $table = 'log_search';\n $columns = array(\n 'id' => 'BIGINT UNSIGNED NOT NULL',\n 'user' => 'BIGINT UNSIGNED DEFAULT 0', // user_id, not user = 0\n 'username' => 'VARCHAR(64) DEFAULT NULL', // not user = ''\n 'kind_of_student' => 'VARCHAR(64) DEFAULT NULL', // student college\n 'activity' => \"VARCHAR(64) DEFAULT NULL COMMENT 'scholarship, internship, college, all'\", // search in form scholarship internship college All\n 'keyword' => 'VARCHAR(512) DEFAULT NULL',\n 'major' => 'VARCHAR(128) DEFAULT NULL',\n 'location' => 'VARCHAR(128) DEFAULT NULL',\n 'create_date' => \"datetime DEFAULT '0000-00-00 00:00:00'\",\n );\n $options = 'ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1';\n\n if ($db->schema->getTable($table, true) === null) {\n // table does not exist\n $command = $db->createCommand();\n $command->createTable($table, $columns, $options);\n $command->addPrimaryKey('id', $table, 'id');\n $command->alterColumn($table, 'id', 'BIGINT( 20 ) UNSIGNED NOT NULL AUTO_INCREMENT');\n } else {\n // table exists\n $command = $db->createCommand();\n $command->dropTable($table);\n $command->createTable($table, $columns, $options);\n $command->addPrimaryKey('id', $table, 'id');\n $command->alterColumn($table, 'id', 'BIGINT( 20 ) UNSIGNED NOT NULL AUTO_INCREMENT');\n }\n //\n $command = $db->createCommand();\n foreach ($data as $row) {\n $data = array(\n 'user' => $row[0],\n 'username' => $row[1],\n 'kind_of_student' => $row[2],\n 'activity' => $row[3],\n 'keyword' => $row[4],\n 'major' => $row[5],\n 'location' => $row[6],\n 'create_date' => $row[7],\n );\n $command->insert($table, $data);\n }\n }", "function insertURLToSuggestDB($suggestInput, $suggestURL)\n{\n $insert_date = date(\"m/d/Y\");\n $conn = db_connect();\n $query = \"insert into $suggestURL values(null, '\" . $suggestInput . \"', '\" . $insert_date . \"')\";\n $result = $conn->query($query);\n if (!$result) {\n return false;\n } else {\n return array_values(array($result));\n }\n}", "protected function insert()\n\t{\n\t\t$this->autofill();\n\n\t\tparent::insert();\n\n\t}", "public function run()\n {\n DB::table('results')->insert([\n \t'finish_time' => Carbon\\Carbon::now(),\n 'score' => '8',\n 'user_id' => '1',\n 'test_id' => '1',\n ]);\n }", "public function perform()\n {\n // Truncate the `search_texts` table before indexing to clean out\n // obsolete records.\n $sql = \"TRUNCATE TABLE {$this->_db->SearchText}\";\n $this->_db->query($sql);\n\n foreach (get_custom_search_record_types() as $key => $value) {\n $recordType = is_string($key) ? $key : $value;\n\n if (!class_exists($recordType)) {\n // The class does not exist or cannot be found.\n continue;\n }\n $record = new $recordType;\n if (!($record instanceof Omeka_Record_AbstractRecord)) {\n // The class is not a valid record.\n continue;\n }\n if (!is_callable(array($record, 'addSearchText'))) {\n // The record does not implement the search mixin.\n continue;\n }\n\n $pageNumber = 1;\n $recordTable = $record->getTable();\n // Query a limited number of rows at a time to prevent memory issues.\n while ($recordObjects = $recordTable->fetchObjects($recordTable->getSelect()->limitPage($pageNumber, 100))) {\n foreach ($recordObjects as $recordObject) {\n // Save the record object, which indexes its search text.\n try {\n $recordObject->save();\n } catch (Omeka_Validate_Exception $e) {\n _log($e, Zend_Log::ERR);\n _log(sprintf('Failed to index %s #%s',\n get_class($recordObject), $recordObject->id),\n Zend_Log::ERR);\n }\n release_object($recordObject);\n }\n $pageNumber++;\n }\n }\n }", "public function insert_data()\n {\n \t$cdata['page_name'] = trim(ucfirst($this->input->post('page_name')));\n\t\t$cdata['slug'] = trim($this->input->post('slug'));\n\t\t$cdata['content'] = $this->input->post('content');\n\t\t$cdata['status'] = 1;\n\t\t$cdata['created_date'] = db_datetimeformat();\n\t\t$cms_id = $this->general_model->insert(CMS_TABLE,$cdata);\n\n\t\t$msg = $this->lang->line('common_add_success_msg');\n $this->session->set_flashdata('message_session', $msg);\n\n\t\t$searchsort_session = $this->session->userdata('cms_sortsearchpage_data');\n\t\t$pagingid = $searchsort_session['uri_segment'];\n\t\tredirect($this->type.'/'.$this->viewname.'/'.$pagingid);\n }", "public function insert() {\n \n }", "public function search();", "public function search();", "function processRequest(&$db) {\n\t\t$tbl = $_REQUEST[\"name\"];\n\n\t\t$str = $db->getInsertStatement($tbl);\n\t\t\t\n\t\tif ($str === false)\n\t\t\tcreateErrorGrid($db, $db->getLastQuery());\n\t\telse {\n\t\t\tprint \"<div id='results'>\".htmlspecialchars($str).\"</div>\";\n\t\t\tprint \"<script type=\\\"text/javascript\\\" language='javascript'> parent.transferQuery(); </script>\\n\";\n\t\t}\n\t}", "public function insert() {\n $query = \"INSERT INTO {$this->Table} SET \";\n if($this->Fields) {\n foreach ($this->Fields as $key => $item) {\n if($item['ignore'] != true && $this->$key != \"\" && $this->$key !== null) {\n if($first === false) $query .= \", \";\n $query .= $key.\" = '\".$this->escape($this->$key).\"'\";\n $first = false;\n }\n }\n }\n $result = $this->query($query);\n $this->clear();\n return $result;\n }", "public function insert()\n {\n $db = new Database();\n $db->insert(\n \"INSERT INTO position (poste) VALUES ( ? )\",\n [$this->poste]\n );\n }", "public function search(){}", "public function insert(){\n\n global $db;\n\n /** Insert sql query */\n $sql = \"INSERT INTO tbl_calculator (num1, num2, oper, answer)\n VALUES (\" . $this->num1 .\", \" . $this->num2 . \", '\" .$this->oper. \"', \" .$this->answer. \" )\";\n\n /** insert result maintain in log file */ \n error_log($sql);\n\n if ($db->query($sql) === TRUE) {\n error_log(\"New record created successfully\");\n } else {\n error_log(\"Error: \" . $sql . \"<br>\" . $db->error);\n }\n return;\n }", "function listAllWithSearch($term) \r\n {\r\n\r\n $newTerm = \"%\".$term.\"%\";\r\n\r\n //new PDOAgent\r\n $p = new PDOAgent(\"mysql\", DB_USER, DB_PASS, DB_HOST, DB_NAME);\r\n\r\n //Connect to the Database\r\n $p->connect();\r\n\r\n //Setup the Bind Parameters\r\n $bindParams = [\"term\"=>$newTerm];\r\n \r\n //Get the results of the insert query (rows inserted)\r\n $results = $p->query(\"SELECT * FROM Coaches WHERE coachFName LIKE :term OR\r\n coachLName LIKE :term OR salary LIKE :term OR teamName LIKE :term \r\n OR dateStarted LIKE :term OR endOfContract LIKE :term;\", $bindParams);\r\n \r\n //Disconnect from the database\r\n $p->disconnect();\r\n \r\n //Return the objects\r\n return $results;\r\n }", "private function initSearchTerm() {\n\t\t$q = 'SELECT count(*) FROM twitterSearch WHERE searchTerm = \"' .$this->_searchString .'\"';\n\t\tif ($this->_testMode) {print \"(init) created a row, q = \" .$q .\"<br> \";}\n\t\t$r = mysql_query($q, CONN) or die('could not select the number of rows for the search term in initting');\n\t\t$arr = mysql_fetch_array($r);\n\t\t$numRows = $arr['count(*)'];\n\t\t\n\t\tif ($numRows == 0) {\n\t\t\t$q = 'INSERT INTO twitterSearch (searchTerm) VALUES (\"' .$this->_searchString .'\")';\n\t\t\t$r = mysql_query($q, CONN) or die('could not create the new row for the search term in init()');\n\t\t\tif ($this->_testMode) {print \"(init) created a row, q = \" .$q .\"<br> \";}\n\t\t}\n\t\telse {\n\t\t\tif ($this->_testMode) {print \"(init) no need to create a row<br>\";}\n\t\t}\n\t}", "function insert() {\n\t \t \n\t \t$sql = \"INSERT INTO evs_database.evs_identification (idf_identification_detail_en, idf_identification_detail_th, idf_pos_id, idf_ctg_id)\n\t \t\t\tVALUES(?, ?, ?, ?)\";\n\t\t \n\t \t$this->db->query($sql, array($this->idf_identification_detail_en, $this->idf_identification_detail_th, $this->idf_pos_id, $this->idf_ctg_id));\n\t\n\t }", "function _add($goods_id, $value, $score){\n\t\tglobal $bBlog;\n\t\treturn $bBlog->db->query(\"\n\t\t\tINSERT INTO `\".T_SEARCH.\"` ( `id` , `article_id` , `value` , `score` )\n\t\t\tVALUES (\n\t\t\t'0', '\".$goods_id.\"', '\".$value.\"', '\".$score.\"'\n\t\t\t);\");\n\t}", "function insert($name, $db) {\n date_default_timezone_set('America/Los_Angeles');\n $time = date('y-m-d H:i:s');\n if (isset($_POST[\"nickname\"])) {\n $nickname = $_POST[\"nickname\"];\n } else {\n $nickname = strtoupper($name);\n }\n try {\n $db->exec(\"\n INSERT INTO Pokedex\n (name, nickname, datefound)\n VALUES\n ('$name', '$nickname', '$time') \n \");\n } catch (PDOException $pdoex) {\n print(json_encode(['exception' => $pdoex]));\n }\n }", "private function saveGoogleResult($url,$key){\n\t\tpreg_match('/\\\"(.*)\\\"/',$url,$realUrl);\n\t\tif(isset($realUrl[1])){\n\t\t\t$newUrl = $realUrl[1];\n\t\t\tSearch::insert(['key' => $key,'url'=>$newUrl,'result'=>strip_tags($url)]);\n\t\t}\n\t}", "private function insertResponseIntoDatabase()\n {\n $sql = \"INSERT INTO weather(city, country, min, max, stamp, temp) \n VALUES (:city, :country, :min, :max, NOW(), :temp)\";\n\n $stmt = $this->pdo->prepare($sql);\n $stmt->bindParam(':city', $this->response['city']);\n $stmt->bindParam(':country', $this->response['country']);\n $stmt->bindParam(':min', $this->response['min']);\n $stmt->bindParam(':max', $this->response['max']);\n $stmt->bindParam(':temp', $this->response['temp']);\n $stmt->execute();\n }", "public function insert($uavmDocument);", "function insert() {\n\t\t$sql = \"INSERT INTO \".$this->hr_db.\".hr_amphur (amph_name, amph_name_en, amph_pv_id, amph_active)\n\t\t\t\tVALUES(?, ?, ?, ?)\";\n\t\t$this->hr->query($sql, array( $this->amph_name, $this->amph_name_en, $this->amph_pv_id, $this->amph_active));\n\t\t$this->last_insert_id = $this->hr->insert_id();\n\t}", "private function addResult($result) {\n //Adds a result to the results array\n $this->results[] = $result;\n }", "function inputted_to_sql_for_search($row,$i)\n\t{\n\t\treturn NULL;\n\t}", "public function insert()\n {\n $sql = \"INSERT INTO \" . self::TABLE_NAME . \"(news_name,\n news_slug,\n news_content,\n news_seo_title,\n news_seo_description,\n news_publish_date,\n news_add_date,\n news_update_date,\n user_id,\n status)\n VALUES (?,?,?,?,?,?,?,?,?,?)\";\n $stmt = $this->prepare($sql);\n $stmt->bind_param(\"ssssssssii\",\n $this->getNewsName(),\n $this->getNewsSlug(),\n $this->getNewsContent(),\n $this->getNewsSeoTitle(),\n $this->getNewsSeoDescription(),\n $this->getNewsPublishDate(),\n $this->getNewsAddDate(),\n $this->getNewsUpdateDate(),\n $this->getUserId(),\n $this->getStatus()\n );\n $result = $stmt->execute();\n $stmt->close();\n return $result;\n }", "function mINSERT(){\n try {\n $_type = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$INSERT;\n $_channel = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$DEFAULT_TOKEN_CHANNEL;\n // Tokenizer11.g:19:3: ( 'insert' ) \n // Tokenizer11.g:20:3: 'insert' \n {\n $this->matchString(\"insert\"); \n\n\n }\n\n $this->state->type = $_type;\n $this->state->channel = $_channel;\n }\n catch(Exception $e){\n throw $e;\n }\n }", "public function insert_data($insert_data_json,$search_condition=array())\r\n {\r\n \r\n // Incase this API no longer the first trigger point\r\n if($this->is_error === true){return;}\r\n \r\n // Convert to array from jason\r\n $insert_data = json_decode($insert_data_json, true);\r\n\r\n // Callback API to manipulate insert data, \r\n $dataset = $this->insert_data_callback($insert_data);\r\n\r\n if($this->is_error === true){return;}\r\n \r\n // Validate and filter data, thus convert data into writable id if have any\r\n $dataset = $this->validate_and_convert_id($dataset);\r\n \r\n if($this->is_error === true){return;}\r\n\r\n // Build up model name for easy use\r\n $model = $this->model_name.'_model';\r\n\r\n // Calling itself to allow data insert\r\n $this->load->model($model); \r\n\r\n if($search_condition === array())\r\n {\r\n // Insert data into database\r\n $inserted_data_id = $this->$model->save($dataset);\r\n }\r\n else\r\n {\r\n $model_obj = new $this->$model;\r\n \r\n // Extract update list\r\n $modi_array = array();\r\n foreach ($dataset as $key => $value)\r\n {\r\n $modi_array[$key] = $value;\r\n }\r\n \r\n $update_condition = $this->$model->update($modi_array, $search_condition);\r\n \r\n if ($update_condition === true)\r\n {\r\n $listing_array = $model_obj->find_one($search_condition,\"\",\"array\");\r\n $inserted_data_id = $listing_array[\"id\"];\r\n }\r\n \r\n // file dump -- for testing purpose -- Start --\r\n /*$current = \"\\n------------------------------\\n\";\r\n $current .= \"base libraries -- insert_data -- test on edit\\n\";\r\n $current .= json_encode($search_condition).\"\\n\";\r\n $current .= json_encode($modi_array).\"\\n\";\r\n $current .= json_encode($inserted_data_id).\"\\n\";\r\n $current .= json_encode($listing_array).\"\\n\";\r\n error_log($current, 3, \"D:/webdev/resphere_test_dump.txt\");\r\n // file dump -- for testing purpose -- End --*/\r\n }\r\n\r\n if ($inserted_data_id !== false)\r\n {\r\n // Obtain id and return\r\n $data_output[\"id\"] = $inserted_data_id;\r\n $this->set_data(\"Info: Completed insert data\", $data_output);\r\n }\r\n else\r\n {\r\n $model_error = $this->$model->get_errors();\r\n $this->set_error(\r\n \"MBE-\".$this->model_code.\"-ID-1\",\r\n \"Internal error, please contact admin\",\r\n \"Fail with \".json_encode($model_error).\" . Data insert to model \".$this->model_name.\" with data - \".json_encode($dataset));\r\n }\r\n \r\n // file dump -- for testing purpose -- Start --\r\n /*$current = \"\\n------------------------------\\n\";\r\n $current .= \"base libraries -- insert_data -- end execute\\n\";\r\n $current .= json_encode($insert_data_json).\"\\n\";\r\n $current .= json_encode($search_condition);\r\n error_log($current, 3, \"D:/webdev/resphere_test_dump.txt\");\r\n // file dump -- for testing purpose -- End --*/\r\n }", "public function search() {\n // without an entry we just redirect to the error page as we need the entry to find it in the database\n if (!isset($_POST['submit-search']))\n return call('pages', 'error');\n \n //try{\n // we use the given entry to get the correct post\n $userentry = filter_input(INPUT_POST,'search', FILTER_SANITIZE_SPECIAL_CHARS);\n $results = Search::find($_POST['search']);\n require_once('views/pages/SearchResults.php');\n //}\n //catch (Exception $ex){\n // $ex->getMessage();\n // return call('pages','error');\n }", "public function searchAction()\n {\n $search = $this->createSearchObject();\n $result = $search->searchWord($this->view->word);\n $this->view->assign($result);\n\n if (Model_Query::$debug) {\n $this->view->actionTrace = [\n 'action' => sprintf('%s::searchWord()', get_class($search)),\n 'result' => $result,\n ];\n\n $this->view->queryTrace = Model_Query::$trace;\n }\n\n }", "function save($q,$result,$filters,$user_id = null) {\r\n\t\t$id = $this->_generateId($q);\r\n\t\t\r\n\t\t$data = array(\r\n\t\t\t'id' => $id,\r\n\t\t\t'hash' => $this->_generateHash($q),\r\n\t\t\t'user_id' => intval($user_id),\r\n\t\t\t'q' => $q,\r\n\t\t\t'result' => serialize($result),\r\n\t\t\t'filters' => serialize($filters),\r\n\t\t\t'generated' => time()\r\n\t\t);\r\n\t\t$this->db->insert('results',$data);\r\n\t\t\r\n\t\treturn $id;\r\n\t}", "public function insert($otros_votos);", "protected function commit() {\n $this->get_search_client()->commit();\n }", "private function insert()\n {\n $this->query = $this->pdo->prepare(\n 'INSERT INTO ' . $this->table . ' (' .\n implode(', ', array_keys($this->data)) .\n ' ) VALUES (:' .\n implode(', :', array_keys($this->data)) .\n ')'\n );\n }", "public static function insert()\n {\n }", "static private function insert($data) {\n $insert_stmt = new SQLExecutor($GLOBALS['cli']->dbconn);\n $insert_item = array();\n // loop over potential insert data\n foreach ($data as $tx) {\n // make sure each tx object has the right stuff\n if ( isset($tx->site_id) && isset($tx->tagid) && isset($tx->pid) ) {\n // build statement\n $insert_item[] = \"({$tx->site_id},{$tx->tagid},{$tx->pid})\";\n }\n }\n\n // complete insert statement if there are insert items\n if (count($insert_item) > 0) {\n $insert_list = implode(\",\",$insert_item);\n $insert_list = rtrim($insert_list,\",\");\n $insert_results = $insert_stmt->sql('INSERT INTO table (site_id, tagid, pid) VALUES ' . $insert_list)->run();\n }\n }", "public function resultPlacements($data){\n try {\n //code...\n\n // query to insert record\n $query = \"INSERT INTO placement_results SET\n placement_id=:placement_id,\n result_id=:result_id \";\n\n // prepare query statement\n $stmt = $this->conn->prepare($query);\n\n // bind parameters\n $stmt->bindParam(\":placement_id\", $data['placement_id']);\n $stmt->bindParam(\":result_id\", $data['result_id']);\n\n // execute query\n return json_encode([\"success\" => $stmt->execute()]);\n } catch (PDOException $e) {\n throw $e;\n }\n }", "function insertMatch ($tab)\n{\n\t$con = connexion ();\n\tif($con != null)\n\t{\n\t\t$requete = \"insert into matchs values (null,'\".$tab['nomdom'].\"','\".$tab['nomext'].\"','\".$tab['dateM'].\"','\".$tab['stadeM'].\"','\".$tab['idequipe'].\"');\";\n\t\tmysqli_query($con, $requete);\n\t\tdeconnexion($con);\n\t}\n}", "function insertGithubIntoPlace($output){\n global $db,$allCountries;\n foreach ($output as $row) {\n if (duplicatePlace($row['State'],$row['Country'])>0){\n continue;\n }\n\n if (!empty($row['State'])) { //ked je vyplneny stat tak sa zapise aj stat, inak iba krajina\n $query = \"INSERT INTO place(statename,countryname) VALUES('{$row['State']}','{$row['Country']}')\";\n }\n else {\n $query = \"INSERT INTO place(countryname) VALUES('{$row['Country']}')\";\n }\n array_push($allCountries,$row['Country']);\n $db->exec($query);\n }\n}", "function insert ($destination = ''){\n $db = connect();\n $query = $db->prepare('INSERT INTO article (title, content, summary, published_at, is_published, image) VALUES (?, ?, ?, ?, ?, ?)');\n $newArticle = $query->execute(\n [\n htmlspecialchars($_POST['title']),\n htmlspecialchars($_POST['content']),\n htmlspecialchars($_POST['summary']),\n htmlspecialchars($_POST['published_at']),\n ctype_digit($_POST['is_published']),\n htmlspecialchars($destination)\n ]\n );\n $Last_id = $db->lastInsertId();\n $query = $db->prepare('INSERT INTO article_category (article_id, category_id) VALUES (?, ?)');\n $result = $query->execute(\n [\n $Last_id,\n $_POST['category_id']\n ]\n );\n return $results = array($newArticle, $result);\n }", "public function search(){\t\r\r\n\r\r\n\t\t\r\r\n\t\t$this->load->database();\r\r\n\t\t$this->load->library('custom_search_library');\r\r\n\t\t//$this->custom_search_library->create_index();\r\r\n\t\t$this->custom_search_library->search( $_POST['keyword'] );\r\r\n\t}", "public function updatingSearch()\n {\n $this->gotoPage(1);\n }", "function insert($tabla, $campos, $valores){\n #se forma la instruccion SQL\n $q = 'INSERT INTO '.$tabla.' ('.$campos.') VALUES ('.$valores.')';\necho $q;\n $resultado = $this->consulta($q);\n \n if($resultado) return true;\n else return false;\n}", "public abstract function Insert();", "public function inserir()\n {\n }", "public function persist (){\n \n $this->query = \"INSERT INTO libros(titulo,autor,editorial) VALUES (:titulo, :autor, :editorial)\";\n\n // $this->parametros['id']=$user_data[\"id\"];\n $this->parametros['titulo']=$this->titulo;\n $this->parametros['autor']=$this->autor;\n $this->parametros['editorial']=$this->editorial;\n \n $this->get_results_from_query();\n\n\n $this->mensaje = \"Libro agregado exitosamente\";\n \n }", "function tp_results_insert($acc_number,$total,$earn,$u_total,$i_total,$profitable)\n\t{\n\n\t\treturn $this->db->set('pamm_tp_id', '')\n\t\t->set('pamm_tp_account', $acc_number)\n\t\t->set('pamm_tp_total', $total)\n\t\t->set('pamm_tp_profitloss', $earn)\n \t->set('pamm_tp_timestamp', 'NOW()', FALSE)\n\t\t->set('pamm_tp_trader',$u_total)\n\t\t->set('pamm_tp_investor',$i_total)\n\t\t->set('pamm_tp_profitable',$profitable)\n\t\t->insert('pamm_tp_results');\n\t}", "protected function importFromSearch()\n {\n $api = $this->_getSearchAPI();\n\n for ($i = 1; $i <= self::MAX_PAGES; $i++) {\n Minion_CLI::write(\"Searching page $i...\");\n\n $response = $api->find(self::SEARCH_TERM, array('start_page' => $i));\n $results = $response['repositories'];\n $this->_saveResults($results);\n\n if (count($results) < self::PER_PAGE) {\n break;\n }\n }\n\n Minion_CLI::write('Finished.');\n }", "abstract function search_data($search_id);", "function crawl($result){\n foreach ($result as $row) {\n // crawl business, load all to db: business, inspection, violation tables\n $newBusiness = $this->scrapeBusinessPage($row['ahs_id']);\n //check if business is in db and insert if not\n $bResult = Data::selectBusinessByAHSID($newBusiness->getAHSID());\n if(empty($bResult)){\n Data::insertBusiness($newBusiness->getAHSID(),\n $newBusiness->getName(),\n $newBusiness->getType(),\n $newBusiness->getAddress(),\n $newBusiness->getPhone(),\n $newBusiness->getPermitHolder());\n }else{\n echo 'business: ' . $newBusiness->getName() . ' already in DB \\n';\n }\n //Loop through inspections adding them and the violations to the DB\n foreach ($newBusiness->getInspectionsArray() as $inspection) {\n //format date to date object\n date_default_timezone_set('America/Denver');\n $date = new DateTime($inspection->getDate());\n $newDate = $date->format('Y-m-d');\n //query inspection table to check if it is already there\n $inspectionIsHere = Data::selectInspection($newBusiness->getAHSID(), $newDate);\n if(!$inspectionIsHere){\n Data::insertInspection($newBusiness->getAHSID(),\n $newDate,\n $inspection->getType(),\n $inspection->getAction());\n //insert the violations\n foreach ($inspection->getViolations() as $violation) {\n Data::insertViolation($newBusiness->getAHSID(),\n $violation->getName(),\n $violation->getRequirement(),\n $violation->getComment(),\n $violation->getCritical());\n }\n }else{\n echo 'Inspection ' . $newBusiness->getName() . '/' . $inspection->getDate() . ' already in db \\n';\n }\n }\n }\n }", "function search()\n\t{\n\t\t$search=$this->input->post('search');\n\t\t\t$data_rows=get_temp_manage_table_data_rows1($this->Giftcard->search($search),$this);\n\t\t\techo $data_rows;\n\t}", "public function insert($mambot);", "function clonInscritos($T_INSCRITOS,$PROVINCIA, $CLAVE, $TOMO, $FOLIO)\n{\n global $mysqli;\n $TINS = $T_INSCRITOS;\n $query = new Query($mysqli, \"INSERT INTO \".$TINS.\" SELECT * FROM inscritostmp WHERE provincia=? and clave=? and tomo=? and folio=?\");\n $parametros = array('ssss', &$PROVINCIA, &$CLAVE, &$TOMO, &$FOLIO);\n $data = $query->getresults($parametros);\n return true;\n}", "private function database_entry() {\n $this->record_progress(\"Step 11: Entering results in the database\");\n\n $path_final = $this->path_final;\n $path_errors = $this->path_errors;\n\n $read_final = fopen($path_final, \"r\");\n $write_errors = fopen($path_errors, \"a\");\n\n $table = \"NewSpliceman\";\n $errors_table = \"NewErrors\";\n\n while (! feof($read_final)) {\n $database_entry = fgets($read_final);\n $entry_array = explode(\"\\t\", $database_entry);\n if (ctype_space($database_entry)) {\n break;\n }\n if (count($entry_array) > 26) {\n $chr_loc_wild_mut_transcript_exon = \n $entry_array[0].\"_\".$entry_array[1].\"_\".$entry_array[2].\"_\".\n $entry_array[3].\"_\".$entry_array[4].\"_\".$entry_array[5];\n $start_loc = $entry_array[6];\n $end_loc = $entry_array[7];\n $gene_name = $entry_array[8];\n $gene_id = $entry_array[9];\n $strand = $entry_array[10];\n $feature_type = $entry_array[11];\n $variant_type = $entry_array[12];\n $L1_percentile = $entry_array[13];\n $RBPs = $entry_array[15].\",\".$entry_array[16].\",\".\n $entry_array[17].\",\".$entry_array[18].\",\".$entry_array[19];\n $motifs = $entry_array[20].\",\".$entry_array[21].\",\".$entry_array[22].\n \",\".$entry_array[23].\",\".$entry_array[24];\n $motifs = str_replace(\"\\n\", \"\", $motifs);\n $motifs = str_replace(\"\\r\", \"\", $motifs);\n $ss_distance = $entry_array[25];\n $splice_site = $entry_array[26];\n if ($entry_array[14] == \"n/a\") {\n $ESEseq = 0;\n //$enhancer_repressor = \"-\";\n } else {\n $ESEseq = $entry_array[14];\n //$enhancer_repressor = $entry_array[17];\n }\n try {\n DB::table($table)->\n insert([\n 'chr_loc_wild_mut_transcript_exon' => \n $chr_loc_wild_mut_transcript_exon,\n 'start_loc' => $start_loc,\n 'end_loc' => $end_loc,\n 'strand' => $strand,\n 'gene_name' => $gene_name,\n 'gene_id' => $gene_id,\n 'feature_type' => $feature_type,\n 'variant_type' => $variant_type,\n 'L1_percentile' => $L1_percentile,\n 'RBPs' => $RBPs,\n 'motifs' => $motifs,\n 'ESEseq' => $ESEseq,\n 'error' => false,\n 'ss_distance' => $ss_distance,\n 'splice_site' => $splice_site\n ]);\n } catch (\\Illuminate\\Database\\QueryException $e) {\n $error_string = $chr_loc_wild_mut_transcript_exon.\"\\t\".\n \"ERROR: Issue inserting to the database.\\n\";\n fwrite($write_errors, $error_string);\n }\n }\n }\n\n fclose($read_final);\n fclose($write_errors);\n\n $read_errors = fopen($path_errors, \"r\");\n while (! feof($read_errors)) {\n $database_entry = fgets($read_errors);\n $entry_array = explode(\"\\t\", $database_entry);\n if (ctype_space($database_entry)) {\n break;\n }\n if (count($entry_array) > 1) {\n $chr_loc_wild_mut = $entry_array[0];\n $message = $entry_array[1];\n try {\n DB::table($table)->\n insert([\n 'chr_loc_wild_mut_transcript_exon' => \n $chr_loc_wild_mut_transcript_exon,\n 'error' => true\n ]);\n } catch (\\Illuminate\\Database\\QueryException $e) {}\n try {\n DB::table($errors_table)->\n insert([\n 'chr_loc_wild_mut_transcript_exon' => \n $chr_loc_wild_mut_transcript_exon,\n 'message' => $message\n ]);\n } catch (\\Illuminate\\Database\\QueryException $e) {}\n }\n }\n\n fclose($read_errors);\n }", "public function maininsert($con, $name, $sname, $surname, $email, $title, $visible, $nid, $nid1, $sid, $userid){\n $msg = \"Select _nID_ FROM _name_ WHERE _name_ = ?\"; # check if name exists\n $stmnt1 = $con->prepare($msg);\n $stmnt1->bind_param(\"s\",$name);\n $stmnt1->execute();\n $stmnt1->bind_result($nid);\n if($stmnt1->fetch()){ # proceed if name exists\n $stmnt1->close();\n $msg = \"Select _tID_ FROM _title_ WHERE _title_name_ = ?\"; # chech if title exists\n $stmnt2 = $con->prepare($msg);\n $stmnt2 -> bind_param(\"s\", $title);\n $stmnt2 -> execute();\n $stmnt2 -> bind_result($sid);\n if($stmnt2->fetch()){ # proceed if title exists\n $stmnt2->close();\n $this -> insertinto($con, $name, $sname, $surname, $email, $title, $visible, $nid, $nid1, $sid, $userid);\n }else{ # proceed if title not exists\n $stmnt2->close();\n $this -> ifnottitle($con, $name, $sname, $surname, $email, $title, $visible, $nid, $nid1, $sid, $userid);\n }\n }else{ # proceed if name not exists\n $stmnt1->close();\n $this -> ifnotname($con, $name, $sname, $surname, $email, $title, $visible, $nid, $nid1, $sid, $userid);\n }\n }", "function insert()\n {\n if (Validation::isWhitespace($_POST[\"title\"])) {\n return -2;\n }\n if (Validation::isWhitespace($_POST[\"message\"])) {\n return -3;\n }\n $stmt = \"INSERT INTO\n \" . APP_DEFAULT_DB . \".\" . APP_TABLE_PREFIX . \"news\n (\n nws_usr_id,\n nws_created_date,\n nws_title,\n nws_message,\n nws_status\n ) VALUES (\n \" . Auth::getUserID() . \",\n '\" . Date_Helper::getCurrentDateGMT() . \"',\n '\" . Misc::escapeString($_POST[\"title\"]) . \"',\n '\" . Misc::escapeString($_POST[\"message\"]) . \"',\n '\" . Misc::escapeString($_POST[\"status\"]) . \"'\n )\";\n $res = DB_Helper::getInstance()->query($stmt);\n if (PEAR::isError($res)) {\n Error_Handler::logError(array($res->getMessage(), $res->getDebugInfo()), __FILE__, __LINE__);\n return -1;\n } else {\n $new_news_id = DB_Helper::get_last_insert_id();\n // now populate the project-news mapping table\n foreach ($_POST['projects'] as $prj_id) {\n self::addProjectAssociation($new_news_id, $prj_id);\n }\n return 1;\n }\n }", "private function createSearchesTable() {\n $fields = array(\n 'id'\t\t => array('type' => 'int', 'constraint' => '10', 'unsigned' => TRUE, 'auto_increment' => TRUE),\n 'site_id' => array('type' => 'int', 'constraint' => '10', 'unsigned' => TRUE),\n 'searched_at'\t => array('type' => 'datetime', 'null' => true),\n 'params' => array('type' => 'text', 'null' => true),\n 'short_code' => array('type' => 'varchar', 'constraint' => '250', 'null' => TRUE),\n 'all_servers' => array('type' => 'varchar', 'constraint' => '3', 'null' => TRUE),\n );\n\n ee()->dbforge->add_field($fields);\n ee()->dbforge->add_key('id', TRUE);\n\n ee()->dbforge->create_table('rets_rabbit_v2_searches');\n }", "public function search($query);", "public function get_jobs_saved_search()\n\t{\t\t\t\n\t\t\t$saved_search = array(\n\t\t\t\t'saved_username' => $this->session->userdata('r_username'),\n\t\t\t\t'candidate_id' => $this->uri->segment(3)\n\t\t\t\t); \n\t\t\t$saved_searchy = $this->db->insert('saved_search', $saved_search);\n\n\t\t\treturn $saved_searchy;\n\t}", "function insert_data($qr)\n {\n $this->db->insert($this->tbl_qr, $qr);\n return ($this->db->affected_rows());\n }", "function insert_request_entry($Song, $Artist) {\r\n\r\n $conn = db_connect();\r\n\r\n\r\n // insert new log entry\r\n $query = \"insert into REQUESTS values\r\n (null, '\".$Song.\"', \r\n '\".$Artist.\"')\";\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}", "public function addToInsertSQLArray();", "function insertWorldmetersIntoPlace($output){\n global $db,$allCountries;\n\n foreach ($output as $row) {\n //ak krajina este nie je ulozena, prida sa novy riadok, inak sa iba updatne existujuci zaznam\n if (!in_array($row['Country'],$allCountries)){\n $query = \"INSERT INTO place(countryname,population) VALUES('{$row['Country']}',{$row['Population']})\";\n array_push($allCountries,$row['Country']);\n $db->exec($query);\n }\n else{\n $query = \"UPDATE place SET population = {$row['Population']} WHERE countryname='{$row['Country']}'\";\n $db->exec($query);\n }\n }\n}", "public function run()\n {\n \\DB::table('psychosocial_support_lookup')->insert(\n array(\n array('description' => 'Ενδυνάμωση-Αυτενέργεια ατόμου'),\n array('description' => 'Ενίσχυση αυτοεκτίμησης και αυτοπεποίθησης'),\n array('description' => 'Συνεργασία με οικογένεια για την αντιμετώπιση oικογενειακών ή άλλων προβλημάτων'),\n array('description' => 'Εκπαίδευση-Κατάρτιση'),\n array('description' => 'Νομικά ζητήματα'),\n array('description' => 'Εκμάθηση τεχνικών αναζήτησης εργασίας'),\n )\n );\n }", "public function insertDatabase();", "public function run()\n {\n $kriteria = [\n ['name' => 'umur'],\n ['name' => 'berat'],\n ['name' => 'warna'],\n ['name' => 'harga'],\n ['name' => 'ukuran']\n ];\n\n foreach ($kriteria as $k) {\n Criteria::insert($k);\n }\n }", "public function insert()\n {\n \n }", "public function searchbyAll() {\n //this connects to the database\n $pdo = $this->connect();\n $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n //the sql query we would like to run is below\n $sql = \"select artists.ArtistName as artist_name, songs.SongName, genres.GenreName as genre_name from songs\n join artists on songs.ArtistID = artists.ArtistID\n join genres on songs.GenreID = genres.GenreID\n order by songs.ArtistID;\";\n // this prepares the above sql statement and executes, catching any errors if it is unable\n try {\n $stmt = $pdo->prepare($sql);\n $stmt->execute();\n while ($row = $stmt->fetch(PDO::FETCH_ASSOC)){ \n echo \"<tr>\" . \"<form method = 'POST'><td>\" . $row['artist_name'] . \"</td>\"\n . \"<td>\" . $row['SongName'] . \"</td>\"\n . \"<td>\" . $row['genre_name'] . \"</td>\"\n . \"<td>\" . '<button type=\"submit\"><i class=\"fas fa-plus\"></i></button></form>' . \"</td>\" . \"</tr>\";\n } \n } catch (PDOException $e) {\n $error = $e->errorInfo();\n die(\"There was a problem \" . $error . $e->getMessage());\n }\n unset($stmt); \n}", "function addSnowBD($code,$brand,$model,$SnowLength,$qtyAvailable,\n $Description,$DailyPrice,$Photo,$factive){\n //INSERT INTO `snows` (`id`, `code`, `brand`, `model`, `snowLength`, `qtyAvailable`, `description`, `dailyPrice`, `photo`, `active`) VALUES (NULL, 'code', 'brand', 'model', '1', '1', 'description', '3', 'chemin photo', '1');\n $Query=\"INSERT INTO snows (id,code,brand,model,snowLength,qtyAvailable,description,dailyPrice,photo,active)\n VALUES (NULL,\";\n $Query.=\"'$code', '$brand', '$model', $SnowLength, $qtyAvailable, '$Description', $DailyPrice, '$Photo', $factive)\";\n echo $Query;\n require_once 'model/dbConnector.php';\n $result=executeQueryIUD($Query);\n\n return $result ;\n}", "protected function saveInsert()\n {\n }", "public function store_result() {}", "public function insert($contenido);", "public function maininsert($con, $name, $sname, $surname, $email, $title, $visible, $nid, $nid1, $sid){\n $msg = \"Select _nID_ FROM _name_ WHERE _name_ = ?\"; # check if name exists\n $stmnt1 = $con->prepare($msg);\n $stmnt1->bind_param(\"s\",$name);\n $stmnt1->execute();\n $stmnt1->bind_result($nid);\n if($stmnt1->fetch()){ # proceed if exists\n $stmnt1->close();\n $msg = \"Select _tID_ FROM _title_ WHERE _title_name_ = ?\"; # check if title exists\n $stmnt2 = $con->prepare($msg);\n $stmnt2 -> bind_param(\"s\", $title);\n $stmnt2 -> execute();\n $stmnt2 -> bind_result($sid);\n if($stmnt2->fetch()){ # proceed if title exists\n $stmnt2->close();\n $this -> insertinto($con, $name, $sname, $surname, $email, $title, $visible, $nid, $nid1, $sid);\n }else{ # set new title\n $stmnt2->close();\n $this -> ifnottitle($con, $name, $sname, $surname, $email, $title, $visible, $nid, $nid1, $sid);\n }\n }else{\n $stmnt1->close();\n $this -> ifnotname($con, $name, $sname, $surname, $email, $title, $visible, $nid, $nid1, $sid);\n }\n }", "private function storeToDB() {\r\n\t\tDBQuery::getInstance() -> insert('INSERT INTO `CalculatedDailyNeeds`' . DBUtils2::buildMultipleInsertOnDuplikateKeyUpdate($this -> aArticleData));\r\n\t}", "public function run()\n {\n $fields=[\n [\n 'field'=>'index',\n 'value'=>'nincs beállítva',\n ]\n ];\n\n foreach ($fields as $f)\n {\n DB::table('global_values')->insert($f);\n }\n\n }", "public function insertRequestToDb()\n\t\t{\n\t\t\t$this->columnsInfo->data_seek(0);\n\t\t\t$columns = \"\";\n\t\t\t$values = \"\";\n\t\t\twhile($rowColumn = $this->columnsInfo->fetch_assoc())//$info->fetch_row\n\t\t\t{\n\t\t\t\tif($rowColumn[\"EXTRA\"] == \"auto_increment\")\n\t\t\t\t\tcontinue;\n\t\t\t\t$columns = $columns.\", \".$rowColumn[\"COLUMN_NAME\"];\n\t\t\t\t$val = \"\";\n\t\t\t\tif($rowColumn[\"COLUMN_NAME\"] == \"sid_a\")\n\t\t\t\t\t$val = $_SESSION[\"sid\"];\n\t\t\t\telse if($rowColumn[\"COLUMN_NAME\"] == \"date_a\")\n\t\t\t\t\t$val = \"now()\";\n\t\t\t\telse $val = $this->insertColumnValue($_REQUEST[$rowColumn[\"COLUMN_NAME\"]], $rowColumn[\"IS_NULLABLE\"], $rowColumn[\"DATA_TYPE\"], $rowColumn[\"CHARACTER_MAXIMUM_LENGTH\"]);\n\t\t\t\t$values = \"$values, $val\";\n\t\t\t}\n\t\t\t$columns = substr($columns, 2, strlen($columns));\n\t\t\t$values = substr($values, 2, strlen($values));\n\n\t\t\t$query = \"INSERT INTO $this->table ($columns) values($values);\";\n\t\t\t$GLOBALS[\"db\"]->query($query);\n\t\t\t//$info->free();\n\t\t}" ]
[ "0.68482", "0.6738608", "0.6671302", "0.6403866", "0.62215066", "0.61845136", "0.60961133", "0.609424", "0.58915", "0.58777076", "0.5840738", "0.57520825", "0.5715059", "0.5711691", "0.56756496", "0.56756496", "0.5641939", "0.56317157", "0.5602788", "0.5597648", "0.5593661", "0.5589524", "0.5571309", "0.5567986", "0.5535666", "0.55333066", "0.55312145", "0.55301625", "0.55249566", "0.5522115", "0.5516906", "0.5515436", "0.5491222", "0.5491222", "0.5485755", "0.54405785", "0.543803", "0.5434849", "0.54231423", "0.5420465", "0.54081255", "0.5378025", "0.5371905", "0.53696465", "0.5367606", "0.5366741", "0.53659934", "0.5360839", "0.5357825", "0.5350717", "0.534713", "0.5342343", "0.5341213", "0.53334606", "0.53287387", "0.53255254", "0.5322615", "0.5311323", "0.53102505", "0.53068787", "0.5306785", "0.5302462", "0.5296199", "0.5293965", "0.5291313", "0.5286345", "0.5283487", "0.5275858", "0.5275527", "0.5274812", "0.5271956", "0.5266422", "0.52663773", "0.5253717", "0.52530736", "0.5249283", "0.5248857", "0.52443546", "0.5243332", "0.5230613", "0.52302694", "0.52295184", "0.522733", "0.5222137", "0.52162373", "0.52149457", "0.5212564", "0.52109426", "0.52108616", "0.521082", "0.52071166", "0.5204741", "0.52045923", "0.51940775", "0.51914036", "0.5190359", "0.5189128", "0.5186297", "0.5186255", "0.5184964", "0.51836807" ]
0.0
-1
Create new TraceableException instance.
public function __construct($message = null, array $options = [], $code = 0, Exception $previous = null) { parent::__construct($message, $code, $previous); $this->setTrace($options); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function makeException()\n {\n $this->thrownException = ResponseException::create($this);\n }", "public function createTrace(\\Exception $exception)\n {\n $trace = array();\n\n // Except for FatalErrorException, the first frame of \\ErrorException stacktrace\n // refers to the error handler which is not useful.\n if (!$exception instanceof \\ErrorException || $exception instanceof FatalErrorException) {\n $trace[] = $this->getExceptionFrame($exception);\n }\n\n return new Trace($this->transform(array_merge($trace, $exception->getTrace())));\n }", "public function create()\n {\n throw new Exception('Not yet implemented');\n }", "public static function createFromException(string $message, Throwable $exception): self\n {\n return new static($message, $exception->getCode(), $exception->getFile(), $exception->getLine(), $exception);\n }", "public function storageSerializerFactoryNewInstanceException(IntegrationTester $I)\n {\n $I->wantToTest('Storage\\SerializerFactory - newInstance() - exception');\n\n $name = uniqid();\n $I->expectThrowable(\n new Exception('Service ' . $name . ' is not registered'),\n function () use ($name) {\n $serializer = new SerializerFactory();\n $adapter = new AdapterFactory($serializer);\n\n $service = $adapter->newInstance($name);\n }\n );\n }", "public static function makeException($message = \"\", $code = 0, $previous = NULL) {\n $trace = debug_backtrace();\n\n $callingClass = '';\n if (!empty($trace[1]['class'])) {\n $callingClass = $trace[1]['class'];\n }\n\n $excClassName = self::getExceptionClass($callingClass);\n\n return new $excClassName($message, $code, $previous);\n }", "public static function create(int $code, ServerRequestInterface $request, ?Throwable $previous=null): self {\n\t\tif (!in_array($code, array_keys(self::EXC_INFO))) {\n\t\t\t$code = 0;\n\t\t}\n\t\t$message = self::EXC_INFO[$code]['name'];\n\t\t$e = new self($message, $code, $previous);\n\t\t$e->request = $request;\n\t\treturn $e;\n\t}", "public static function fromThrowable(\\Exception $exception, $data = null) {\n return new static($data, $exception->getMessage(), $exception->getCode(), $exception);\n }", "public function getException(): Throwable;", "public function getException(): Throwable;", "public function __construct($e) {\n\t\tif (!$e instanceof \\Exception && !$e instanceof \\Throwable) {\n\t\t\tthrow new InvalidArgumentException('Stack Trace Printer requires throwable to be passed, received ' . get_class($e), 1806031136);\n\t\t}\n\t\t\n\t\t$this->exception = $e;\n\t}", "private function exceptionTraceArgsHelper(string $message): \\Exception\n {\n return new \\Exception($message);\n }", "public static function createFromException(\\Throwable $e) {\n while ($e) {\n if ($e instanceof EnforcedResponseException) {\n return new static($e->getResponse());\n }\n\n $e = $e->getPrevious();\n }\n }", "public static function fromException(Throwable $exception, array $parameters = []): self\n {\n return new self(\n $exception::class,\n $exception->getMessage(),\n $exception->getCode(),\n $parameters,\n self::buildTrace($exception)\n );\n }", "public function toException()\n {\n if ($this->failed()) {\n return new RequestException($this);\n }\n }", "public static function reflectionFailure(string $entity, ReflectionException $previousException): self\n {\n return new self(sprintf('An error occurred in %s', $entity), 0, $previousException);\n }", "public function handleConstructException(\\Throwable $throwable): Response\n {\n return $this->handleException($throwable);\n }", "public function filterTagFactoryNewInstanceException(UnitTester $I)\n {\n $I->wantToTest('Tag\\TagFactory - newInstance() - exception');\n\n $I->expectThrowable(\n new SupportException('Service unknown is not registered'),\n function () {\n $escaper = new Escaper();\n $factory = new TagFactory($escaper);\n $service = $factory->newInstance('unknown');\n }\n );\n }", "public function catchException()\n {\n // get the current exception\n $e = $this->getException();\n\n // throw a copy, with the original as the previous exception so that\n // we can see a full trace.\n $class = get_class($e);\n throw new $class($e->getMessage(), $e->getCode(), $e);\n }", "public static function create(ResponseInterface $response) {\n $error_data = static::getErrorData($response);\n if (in_array(\n $error_data['error_subcode'], array(458, 459, 460, 463, 464, 467))\n || in_array($error_data['code'], array(100, 102, 190))\n || $error_data['type'] === 'OAuthException') {\n\n return new AuthorizationException($response);\n } elseif (in_array($error_data['code'], array(1, 2))) {\n\n return new ServerException($response);\n } elseif (in_array($error_data['code'], array(4, 17, 341))) {\n\n return new ThrottleException($response);\n } elseif ($error_data['code'] == 506) {\n\n return new ClientException($response);\n } elseif ($error_data['code'] == 10\n || ($error_data['code'] >= 200 && $error_data['code'] <= 299)) {\n\n return new PermissionException($response);\n } else {\n\n return new self($response);\n }\n }", "public function convertException(Throwable $exception): Throwable;", "private function createNotReadableException()\n {\n throw new RuntimeException(sprintf(\n 'It is not possible to read entities of type \"%s\" from its repository.',\n $this->getEntityServiceName()\n ));\n }", "public function testCreatedException()\n {\n $this->expectException(DomainException::class);\n County::create('County One',0, 200);\n }", "public static function exceptionThrown(string $name, \\Exception $e)\n {\n return new static(\n $name,\n 'Pipe \"'.$name.'\" failed due to exception (message: \"'.$e->getMessage().'\", code: '.$e->getCode().').',\n static::EXCEPTION_THROWN,\n $e\n );\n }", "public function test__constructThrowsExceptionWhenInstantiated(): void\n {\n $this->expectException(\\Throwable::class);\n $this->expectExceptionMessageMatches('`private `');\n $sut = new TypeSpecifier();\n }", "public function testFactoryCreationErrorWillBeCaughtAndRethrownAsContainerException(): void\n {\n $container = new Container();\n\n $name = 'FooService';\n $exceptionMessage = 'This is another test exception message';\n\n $factory = static function () use ($exceptionMessage): void {\n throw new \\RuntimeException($exceptionMessage);\n };\n\n $container->setFactory($name, $factory);\n\n $this->expectException(ContainerException::class);\n $this->expectExceptionMessage(\n sprintf('The service \\'%s\\' could not be created: %s', $name, $exceptionMessage)\n );\n\n $container->get($name);\n }", "public static function createWithOptions(array $options): ThrowableStorageInterface;", "public function test__constructThrowsException(): void\n {\n $this->expectException(\\Throwable::class);\n $this->expectExceptionMessageMatches('`private `');\n \n $sut = new NoptrDeclaratorConstraint();\n }", "public function create($name, Google_Service_Tracing_Span $postBody, $optParams = array())\n {\n $params = array('name' => $name, 'postBody' => $postBody);\n $params = array_merge($params, $optParams);\n return $this->call('create', array($params), \"Google_Service_Tracing_Span\");\n }", "final private function __construct()\n {\n throw new Exception( 'Enum and Subclasses cannot be instantiated.' );\n }", "public function testCreateFailPrivateConstructor() {\n $this->expectException(Exception::class);\n $this->_createCreator()->create(ConstructTest\\PrivateConstruct::class);\n }", "public static function fromTrace($key = null, $default = null) {\r\n return static :: from('trace', $key, $default);\r\n }", "public function __construct()\n {\n throw new Exception('This class is not intended to be instantiated.');\n }", "private function getExceptionMock($message, $file, $line, array $trace = array())\n {\n $exception = new \\Exception($message);\n $reflection = new \\ReflectionObject($exception);\n\n $fileProperty = $reflection->getProperty('file');\n $fileProperty->setAccessible(true);\n $fileProperty->setValue($exception, $file);\n\n $lineProperty = $reflection->getProperty('line');\n $lineProperty->setAccessible(true);\n $lineProperty->setValue($exception, $line);\n\n $traceProperty = $reflection->getProperty('trace');\n $traceProperty->setAccessible(true);\n $traceProperty->setValue($exception, $trace);\n\n return $exception;\n }", "public function __construct($message = \"\", $code = 0, Exception $previous = null)\n {\n parent::__construct($message, $code, $previous);\n $exception = new \\App\\Exception();\n $exception -> message = $message;\n $exception -> code = (int)$code;\n $exception -> type = 'exception';\n $exception -> trace = $this->getTraceAsString();\n $exception -> save();\n }", "protected function requestExceptionWithResponse()\n {\n $exception = function ($request) {\n return new RequestException(\n 'test',\n $request,\n Litecoin\\LitecoindResponse::createFrom($this->rawTransactionError())\n );\n };\n\n return $exception;\n }", "public static function createFromResponse(ResponseInterface $response, Throwable $previous = null): self\n {\n $object = static::parseResponseBody($response);\n\n if (static::isErrorApiResponse($object)) {\n switch ($object->status_code) {\n case self::ACCESS_RESTRICTED_STATUS:\n return new AccessRestrictedException('Access restricted for this origin.', $response->getStatusCode(), $response, $previous);\n\n case self::INVALID_API_KEY_STATUS:\n return new InvalidApiKeyException('Invalid API key provided.', $response->getStatusCode(), $response, $previous);\n\n case self::REVOKED_API_KEY_STATUS:\n return new RevokedApiKeyException('Provided API key revoked.', $response->getStatusCode(), $response, $previous);\n\n case self::ZERO_RESULTS_STATUS:\n return new ZeroResultsException('No results found.', $response->getStatusCode(), $response, $previous);\n\n case self::QUOTA_REACHED_STATUS:\n return new QuotaReachedException('No requests left, consider upgrading.', $response->getStatusCode(), $response, $previous);\n\n case self::OUT_OF_RANGE_STATUS:\n return new OutOfRangeException('Provided coordinate not in range.', $response->getStatusCode(), $response, $previous);\n\n case self::INVALID_REQUEST_STATUS:\n return new InvalidRequestException('Invalid parameters provided.', $response->getStatusCode(), $response, $previous);\n }\n }\n\n switch ($response->getStatusCode()) {\n case 400:\n return new BadRequestException('Bad request.', $response->getStatusCode(), $response, $previous);\n\n case 401:\n return new UnauthorizedException('Unauthorized.', $response->getStatusCode(), $response, $previous);\n\n case 403:\n return new AccessDeniedException('Access denied.', $response->getStatusCode(), $response, $previous);\n\n case 404:\n return new PageNotFoundException('Not found.', $response->getStatusCode(), $response, $previous);\n\n case 500:\n return new ServerErrorException('Server error.', $response->getStatusCode(), $response, $previous);\n }\n\n return new static('API Error.', $response->getStatusCode(), $response, $previous);\n }", "public function createErrorNode(ParserRuleContext $parent, Token $t): ErrorNode\n {\n return new ErrorNodeImpl($t);\n }", "public function __construct(\\Exception $exception)\n {\n parent::__construct($exception->getMessage(), $exception->getCode(),\n $exception);\n\n $this->file = $exception->getFile();\n $this->line = $exception->getLine();\n $this->type = get_class($exception);\n }", "function __toString() {\n\t\treturn \"Exception\";\n\t}", "public static function clientException(ResponseInterface $response, $data)\n {\n return static::createInstance($response, $data);\n }", "public static function create(...$args): self\n {\n $ex = end($args) instanceof \\Throwable ? array_pop($args) : null;\n $message = sprintf(...$args);\n\n return new static($message, 0, $ex);\n }", "public function createInstance()\n {\n $mock = $this->getMockForTrait(static::TEST_SUBJECT_CLASSNAME);\n $mock->method('_createInvalidArgumentException')\n ->will($this->returnCallback(function ($message = null) {\n return $this->createInvalidArgumentException($message);\n }));\n $mock->method('__')\n ->will($this->returnArgument(0));\n\n return $mock;\n }", "public function createInstance()\n {\n $mock = $this->getMockBuilder(static::TEST_SUBJECT_CLASSNAME)\n ->getMockForTrait();\n $mock->method('__')\n ->will($this->returnArgument(0));\n $mock->method('_createInvalidArgumentException')\n ->will($this->returnCallback(function ($message) {\n return new InvalidArgumentException($message);\n }));\n\n return $mock;\n }", "public function create(): VirtualEntity\n {\n throw new Exception('Virtual entity provider is missing a `create` implementation');\n }", "public function createInvalidArgumentException($message = '')\n {\n $mock = $this->mock('InvalidArgumentException')\n ->new($message);\n\n return $mock;\n }", "protected static function createException($value, $message, $code, $propertyPath = null, array $constraints = array())\n {\n $exceptionClass = static::$exceptionClass;\n\n return new $exceptionClass($message, ReturnCode::INVALID_ARGUMENT, $propertyPath, $value, $constraints);\n }", "public function __construct($message, $class = null, $line = 0, $code = 0) {\n\t\t// First thing to do is set the Exception message\n\t\tif (empty($message)) {\n\t\t\t$message = 'And unknown exception is being reported by the SPARK library';\n\t\t}\n\t\t\n\t\t// Instantiate the base PHP Exception object\n\t\tparent::__construct($message);\n\t\t\n\t\t// Set the exception object properties\n\t\t$this->code = $code;\n\t\t$this->class = $class;\n\t\t$this->file = str_replace('_', '/', $class) . '.php'; // Easy file path builder\n\t\t$this->line = $line;\n\t}", "public function Create()\n\t\t{\n\t\t\tthrow new Exception('Create object not supported');\n\t\t}", "public function createImportLog()\n {\n $class = $this->getClass();\n $ImportLog = new $class;\n\n return $ImportLog;\n }", "public function __construct () {\n\t\tthrow Exception::thrown(\"Not implemented for this platform\");\n\t}", "public function testConstructor()\n {\n $subject = $this->createInstance([\n '_initBaseException',\n '_construct',\n '_setSubject',\n ]);\n $_subject = $this->reflect($subject);\n $message = uniqid('message-');\n $code = rand(1, 99);\n $value = uniqid('out-of-range-value-');\n $previous = $this->createException(uniqid('previous-message'));\n\n $subject->expects($this->exactly(1))\n ->method('_initBaseException')\n ->with($message, $code, $previous);\n $subject->expects($this->exactly(1))\n ->method('_construct');\n $subject->expects($this->exactly(1))\n ->method('_setSubject')\n ->with($value);\n\n $subject->__construct($message, $code, $previous, $value);\n }", "public function createException($message = '', $code = 0, $previous = null)\n {\n return new RootException($message, $code, $previous);\n }", "public static function createFromRoute(Route $route, Exception $previous = null)\r\n {\r\n $error = (null !== $previous) ? $previous->getMessage() : null;\r\n $code = (null !== $previous) ? $previous->getCode() : null;\r\n\r\n $message = sprintf(static::MESSAGE_FORMAT, $route->getPath());\r\n $message .= ' '. sprintf(static::FAILURE_MESSAGE_TITLE_FORMAT, $error);\r\n\r\n $exception = new static($message, $code, $previous);\r\n $exception->setRoute($route);\r\n\r\n return $exception;\r\n }", "public static function lastError()\n {\n return new static(openssl_error_string());\n }", "public function create(Request $request)\n {\n throw new Exception(\"Error Processing Request\", 1);\n \n }", "public static function missinglogic($message)\n {\n return new static(\"Error exception:\\t\".$message);\n }", "protected function initLogFileObject() {\n return new ErrorLogFile();\n }", "public function getException();", "static public function tossException( IDirected &$aContext, $aException )\n\t{\n\t\tif (ini_get('log_errors') && $aException instanceof IDebuggableException)\n\t\t{\n\t\t\t$aContext->getDirector()->debugLog('[1/2] msg: '.\n\t\t\t\t\t$aException->getMessage().' context:'.$aException->getContextMsg()\n\t\t\t);\n\t\t\t$aContext->getDirector()->debugLog('[2/2] c_stk: '.\n\t\t\t\t\t$aException->getTraceAsString()\n\t\t\t);\n\t\t}\n\n\t\tif( $aException instanceof BrokenLeg )\n\t\t\treturn $aException ;\n\t\telse if ($aException instanceof DbException)\n\t\t{\n\t\t\tthrow static::toss($aContext, 'DB_EXCEPTION', $aException->getErrorMsg());\n\t\t}\n\t\telse if(isset($aException->code) && isset($aException->message))\n\t\t{\n\t\t\tthrow static::pratfall(\"DEFAULT\", $aException->code, $aException->message);\n\t\t}\t\t\n\t\telse\n\t\t{\n\t\t\t$o = static::toss( $aContext, 'DEFAULT' ) ;\n\t\t\t$theErrMsg = $aException->getMessage();\n\t\t\tif (!empty($theErrMsg))\n\t\t\t\t$o->message = $theErrMsg;\n\t\t\treturn $o;\n\t\t}\t\t\n\t}", "public function createException($message = '')\n {\n $mock = $this->getMockBuilder('Exception')\n ->setConstructorArgs([$message])\n ->getMock();\n\n return $mock;\n }", "public function createException($message = '')\n {\n $mock = $this->getMockBuilder('Exception')\n ->setConstructorArgs([$message])\n ->getMock();\n\n return $mock;\n }", "private function createNotWritableException()\n {\n throw new RuntimeException(sprintf(\n 'The entities of type \"%s\" cannot be written to its repository.',\n $this->getEntityServiceName()\n ));\n }", "protected function throwUnableToCreate()\n {\n throw new FilesystemException(\"Unable to create the file '{$this->path}'. A directory with the same path already exists.\");\n }", "static public function exception($class, $message = '', $code = 0)\n {\n $class = (string) $class;\n\n self::loadClass($class);\n\n $exception = new $class($message, $code);\n\n if (!$exception instanceof Exception) {\n throw new Zend_Exception('Invalid exception class used in Zend::exception()');\n }\n\n return $exception;\n }", "private function __construct()\n {\n throw new RuntimeException(\"Can't get there from here\");\n }", "public function setException(Throwable $e)\n {\n $this->_exceptions[] = $e;\n return $this;\n }", "public function setTraceLevel($value): static\n\t{\n\t\tPrado::getLogger()->setTraceLevel(TPropertyValue::ensureInteger($value));\n\n\t\treturn $this;\n\t}", "public function testCreateExceptionWithoutAnyArguments()\n {\n new ConfigurationException();\n }", "public function testExceptionWithMessage()\n {\n throw new ThumbNotFoundException('Thumb not found!');\n }", "final public function __construct()\n\t{\n\t\tthrow new LogicException(\"Cannot instantiate static class \" . get_class($this));\n\t}", "public function test_ThrowableException()\n {\n try {\n throw new \\RuntimeException(\"some exception\");\n } catch (\\Exception $e) {\n\n } catch (\\Throwable $e) {\n\n }\n\n $this->assertTrue(true);\n }", "public function testExceptionSanity() {\r\n $e = new StorageException();\r\n $this->assertTrue($e instanceof \\Exception);\r\n }", "public static function getInstance(): ExceptionDistributor\n {\n if (!self::$instance) {\n self::$instance = new self();\n }\n\n return self::$instance;\n }", "public function __clone() {\r\n throw new Exception('Cannot clone the logger object.');\r\n }", "public static function newInstance() {\n $class = self::class;\n $void_log = new $class();\n return $void_log;\n }", "public function throw()\n {\n $callback = func_get_args()[0] ?? null;\n\n if ($this->failed()) {\n throw tap($this->toException(), function ($exception) use ($callback) {\n if ($callback && is_callable($callback)) {\n $callback($this, $exception);\n }\n });\n }\n\n return $this;\n }", "final public function __construct()\n\t{\n\t\tthrow new LogicException('Cannot instantiate static class ' . get_class($this));\n\t}", "public static function generic($message, $file = '', $line = null) \n\t{\n\t\treturn new GestPayException($message, self::GENERIC_ERROR);\n\t}", "private function createNotDeletableException()\n {\n throw new RuntimeException(sprintf(\n 'The entities of type \"%s\" cannot be deleted from its repository.',\n $this->getEntityServiceName()\n ));\n }", "final public function __construct()\n {\n throw new \\LogicException();\n }", "public function __construct($title, $message, $template = false)\n {\n Exception::__construct($message);\n\n $this->code = $title;\n\n if ($template !== false) {\n $this->template = $template;\n }\n }", "public function __construct($pathToSourceFile = '', $mime = null)\n {\n if(!file_exists($pathToSourceFile))\n {\n throw new Exception(\"$pathToSourceFile does not exist\");\n }\n \n if(!$mime)\n {\n throw new Exception(\"Mime type '$mime' is not valid\");\n }\n\n $this->pathToSourceFile = $pathToSourceFile;\n $this->type = $mime;\n \n $this->createWorkingImageResource($pathToSourceFile);\n }", "public function __construct(ExceptionInterface $exception)\n {\n $this->dateTimeUtc = new DateTimeImmutable('now', new DateTimeZone('UTC'));\n $this->exception = $exception;\n $this->id = uniqid('', true);\n }", "public function __construct(\\Exception $priorException=null, $errorDetail=''){\n $this->errorDetail = $errorDetail;\n $this->priorException = $priorException;\n parent::__construct($errorDetail);\n }", "public function throwError();", "public function __toString()\n\t{\n\t\treturn Rest_Exception::text($this);\n\t}", "public static function forKey($key, Exception $cause = null)\n {\n return new static(sprintf(\n 'The key \"%s\" does not exist.',\n $key\n ), 0, $cause);\n }", "public function testConstructorInvalidType()\n\t{\n\t\t$this->expectException(\\RuntimeException::class);\n\t\tnew Builder('foo');\n\t}", "public function createInstance()\n {\n $mock = $this->mock(static::TEST_SUBJECT_CLASSNAME)\n ->getMessage();\n\n return $mock->new();\n }", "public function testInheritance(): void\n {\n self::assertInstanceOf(LicenseCheckException::class, $this->fixture);\n }", "public function testConstructor()\n {\n $params = ['fieldName' => 'quantity', 'value' => -100, 'minValue' => 0];\n $inputException = new InputException(\n new Phrase('The %fieldName value of \"%value\" must be greater than or equal to %minValue.', $params)\n );\n\n $this->assertEquals(\n 'The %fieldName value of \"%value\" must be greater than or equal to %minValue.',\n $inputException->getRawMessage()\n );\n $this->assertStringMatchesFormat('%s greater than or equal to %s', $inputException->getMessage());\n $this->assertEquals(\n 'The quantity value of \"-100\" must be greater than or equal to 0.',\n $inputException->getLogMessage()\n );\n }", "public function translateFactoryLoadExceptions(UnitTester $I)\n {\n $I->wantToTest('Translate\\Factory - load() - exceptions');\n\n $options = $this->arrayConfig['logger'];\n $factory = new LoggerFactory(new AdapterFactory());\n\n $I->expectThrowable(\n new LoggerException(\n 'Config must be array or Phalcon\\Config\\Config object'\n ),\n function () use ($factory) {\n $factory->load(1234);\n }\n );\n\n $I->expectThrowable(\n new LoggerException(\n 'You must provide \"name\" option in factory config parameter.'\n ),\n function () use ($factory, $options) {\n $newOptions = $options;\n unset($newOptions['name']);\n\n $factory->load($newOptions);\n }\n );\n }", "public function __construct(?\\Exception $inner = null)\n {\n parent::__construct(null, $inner);\n }", "final public function __construct()\n {\n throw new \\LogicException(\"Cannot instantiate static class \" . get_class($this));\n }", "protected function requestExceptionWithoutResponse()\n {\n $exception = function ($request) {\n return new RequestException('test', $request);\n };\n\n return $exception;\n }", "function __construct() {\n\t\t$this->exception_method = [];\n\t\tparent::__construct();\n\t\t\n\t}", "final public function __construct()\n\t{\n\t\tthrow new /*::*/LogicException(\"Cannot instantiate static class \" . get_class($this));\n\t}", "protected function createSesDriver()\n {\n $config = $this->getTransportConfig();\n\n $sesClient = SesClient::factory([\n 'key' => $config['key'],\n 'secret' => $config['secret'],\n 'region' => Arr::get($config, 'region') ?: 'us-east-1',\n ]);\n\n return new SesTransport($sesClient);\n }", "function __construct($code, $append=null, &$msgs=null)\n\t{\n\t\tif($msgs === null)\n\t\t{\n\t\t\t$msgs = array();\n\t\t}\n\n\t\tif(array_key_exists($code, $msgs))\n\t\t{\n\t\t\t// massage message string\n\t\t\t$message = $msgs[$code];\n\t\t\t$append = $append ? ': ' . $append : '';\n\t\t\t$message .= $append . '.';\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$message = 'An unknown exception occured.';\n\t\t}\n\n\t\t// pass the fixed-up data to the parent Exception construct\n\t\tparent::__construct($message, $code);\n\t}", "public function __construct( Exception $e )\n {\n $this->exception = $e;\n parent::__construct( $e->getMessage() );\n }" ]
[ "0.62338096", "0.60377586", "0.59487784", "0.5903694", "0.56753266", "0.5626592", "0.55762583", "0.5542578", "0.55350727", "0.55350727", "0.55219215", "0.5519379", "0.54597276", "0.5393982", "0.5316756", "0.5231522", "0.5181485", "0.51684016", "0.5126421", "0.5102062", "0.50838864", "0.5069224", "0.5055484", "0.50027686", "0.4995104", "0.49878907", "0.49865362", "0.49195302", "0.49145198", "0.4867489", "0.4859518", "0.4855169", "0.4842442", "0.4829503", "0.4809504", "0.48019814", "0.4801462", "0.48003402", "0.47995016", "0.47977123", "0.47736683", "0.4771834", "0.4769948", "0.47452742", "0.4728949", "0.46871626", "0.46833923", "0.46772364", "0.4676626", "0.46745527", "0.46683726", "0.46655273", "0.4659803", "0.4655355", "0.46476394", "0.46439943", "0.46438116", "0.4640376", "0.46303675", "0.4608437", "0.4600985", "0.4600985", "0.45939615", "0.45881805", "0.45859537", "0.45852157", "0.4561188", "0.45578837", "0.45536184", "0.45488364", "0.45488313", "0.45433375", "0.45421013", "0.45414865", "0.45409298", "0.45386532", "0.45375463", "0.45271558", "0.452342", "0.45209816", "0.45139223", "0.4509552", "0.4508749", "0.4503446", "0.45012766", "0.44989002", "0.4493707", "0.44873035", "0.44840842", "0.44817996", "0.4479311", "0.44735178", "0.4472794", "0.44722143", "0.4465412", "0.4462745", "0.44433624", "0.44411176", "0.44365656", "0.4433877", "0.44316912" ]
0.0
-1
Find trace by options.
protected function findTrace(array $options) { if (empty($options)) { return; } foreach ($this->getTrace() as $trace) { if ($this->hasTraceOptions($trace, $options)) { return $trace; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function trace(array $options = [])\n {\n $self = Debugger::getInstance();\n $defaults = [\n 'depth' => 999,\n 'format' => $self->_outputFormat,\n 'args' => false,\n 'start' => 0,\n 'scope' => null,\n 'exclude' => ['call_user_func_array', 'trigger_error']\n ];\n $options = Hash::merge($defaults, $options);\n $backtrace = debug_backtrace();\n $count = count($backtrace);\n $back = [];\n $_trace = [\n 'line' => '??',\n 'file' => '[internal]',\n 'class' => null,\n 'function' => '[main]'\n ];\n for ($i = $options['start']; $i < $count && $i < $options['depth']; $i++) {\n $trace = $backtrace[$i] + ['file' => '[internal]', 'line' => '??'];\n $signature = $reference = '[main]';\n\n if (isset($backtrace[$i + 1])) {\n $next = $backtrace[$i + 1] + $_trace;\n $signature = $reference = $next['function'];\n\n if (!empty($next['class'])) {\n $signature = $next['class'] . '::' . $next['function'];\n $reference = $signature . '(';\n\n if ($options['args'] && isset($next['args'])) {\n $args = [];\n\n foreach ($next['args'] as $arg) {\n $args[] = Debugger::exportVar($arg);\n }\n\n $reference .= implode(', ', $args);\n }\n\n $reference .= ')';\n }\n }\n\n if (in_array($signature, $options['exclude'])) {\n continue;\n }\n\n if ($options['format'] === 'points' && $trace['file'] !== '[internal]') {\n $back[] = ['file' => $trace['file'], 'line' => $trace['line']];\n } elseif ($options['format'] === 'array') {\n $back[] = $trace;\n } else {\n if (isset($self->_templates[$options['format']]['traceLine'])) {\n $tpl = $self->_templates[$options['format']]['traceLine'];\n } else {\n $tpl = $self->_templates['base']['traceLine'];\n }\n\n $trace['path'] = static::trimPath($trace['file']);\n $trace['reference'] = $reference;\n\n unset($trace['object'], $trace['args']);\n\n $back[] = Text::insert($tpl, $trace, ['before' => '{:', 'after' => '}']);\n }\n }\n\n if ($options['format'] === 'array' || $options['format'] === 'points') {\n return $back;\n }\n\n return implode(\"\\n\", $back);\n }", "public static function trace(array $options = []) {\n\t\t$defaults = [\n\t\t\t'depth' => 999,\n\t\t\t'format' => null,\n\t\t\t'args' => false,\n\t\t\t'start' => 0,\n\t\t\t'scope' => [],\n\t\t\t'trace' => [],\n\t\t\t'includeScope' => true,\n\t\t\t'closures' => true\n\t\t];\n\t\t$options += $defaults;\n\n\t\t$backtrace = $options['trace'] ?: debug_backtrace();\n\t\t$scope = $options['scope'];\n\t\t$count = count($backtrace);\n\t\t$back = [];\n\t\t$traceDefault = [\n\t\t\t'line' => '??', 'file' => '[internal]', 'class' => null, 'function' => '[main]'\n\t\t];\n\n\t\tfor ($i = $options['start']; $i < $count && $i < $options['depth']; $i++) {\n\t\t\t$trace = array_merge(['file' => '[internal]', 'line' => '??'], $backtrace[$i]);\n\t\t\t$function = '[main]';\n\n\t\t\tif (isset($backtrace[$i + 1])) {\n\t\t\t\t$next = $backtrace[$i + 1] + $traceDefault;\n\t\t\t\t$function = $next['function'];\n\n\t\t\t\tif (!empty($next['class'])) {\n\t\t\t\t\t$function = $next['class'] . '::' . $function . '(';\n\t\t\t\t\tif ($options['args'] && isset($next['args'])) {\n\t\t\t\t\t\t$args = array_map(['static', 'export'], $next['args']);\n\t\t\t\t\t\t$function .= join(', ', $args);\n\t\t\t\t\t}\n\t\t\t\t\t$function .= ')';\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ($options['closures'] && strpos($function, '{closure}') !== false) {\n\t\t\t\t$function = static::_closureDef($backtrace[$i], $function);\n\t\t\t}\n\t\t\tif (in_array($function, ['call_user_func_array', 'trigger_error'])) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$trace['functionRef'] = $function;\n\n\t\t\tif ($options['format'] === 'points' && $trace['file'] !== '[internal]') {\n\t\t\t\t$back[] = ['file' => $trace['file'], 'line' => $trace['line']];\n\t\t\t} elseif (is_string($options['format']) && $options['format'] !== 'array') {\n\t\t\t\t$back[] = Text::insert($options['format'], array_map(\n\t\t\t\t\tfunction($data) { return is_object($data) ? get_class($data) : $data; },\n\t\t\t\t\t$trace\n\t\t\t\t));\n\t\t\t} elseif (empty($options['format'])) {\n\t\t\t\t$back[] = $function . ' - ' . $trace['file'] . ', line ' . $trace['line'];\n\t\t\t} else {\n\t\t\t\t$back[] = $trace;\n\t\t\t}\n\n\t\t\tif (!empty($scope) && array_intersect_assoc($scope, $trace) == $scope) {\n\t\t\t\tif (!$options['includeScope']) {\n\t\t\t\t\t$back = array_slice($back, 0, count($back) - 1);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif ($options['format'] === 'array' || $options['format'] === 'points') {\n\t\t\treturn $back;\n\t\t}\n\t\treturn join(\"\\n\", $back);\n\t}", "public static function get($options = [])\n\t{\n\t\t$backtraceOptions = isset($options['arguments'])\n\t\t\t? DEBUG_BACKTRACE_PROVIDE_OBJECT : DEBUG_BACKTRACE_PROVIDE_OBJECT | DEBUG_BACKTRACE_IGNORE_ARGS;\n\t\t$limit = isset($options['limit']) ? $options['limit'] : 0;\n\n\t\treturn static::from(debug_backtrace($backtraceOptions, $limit));\n\t}", "public function search_pill($options=NULL){\n\t\tforeach($options as $key=>$value)\n\t\t{\n\t\t\tif (array_key_exists($key,self::$base_options)){\n\t\t\t\tif(is_array(self::$base_options[$key])){\n\t\t\t\t\tif(in_array($value,self::$base_options[$key]) || array_key_exists(strtoupper($value),self::$base_options[$key]))\n\t\t\t\t\t// allows to use either the key name or the value to define what gets passed, example : you can say YELLOW or C48330 \n\t\t\t\t\t\t$data[$key] = (in_array($value,self::$base_options[$key])? self::$base_options[$key][strtoupper($value)]:$value);\n\t\t\t\t}else{\n\t\t\t\t\t$data[$key] = $value;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t$data['key'] = self::$api_key;\n\t\treturn self::_request(self::$api_url,$data);\n\t}", "abstract public function getOptions();", "protected static abstract function getOptions();", "function get_trace(int $options = 0, int $limit = 0, int $index = null, string $field = null, int $slice = null): mixed\n{\n $stack = debug_backtrace($options, limit: $limit ? $limit + 1 : 0);\n\n // Drop self.\n array_shift($stack);\n\n // When slice wanted (@internal).\n $slice && $stack = array_slice($stack, $slice);\n\n foreach ($stack as $i => $trace) {\n $trace = [\n // Index.\n '#' => $i,\n // For \"[internal function]\", \"{closure}\" stuff.\n 'file' => $trace['file'] ?? null,\n 'line' => $trace['line'] ?? null,\n ] + $trace + [\n // Additions.\n 'callee' => $trace['function'] ?? null,\n 'caller' => null, 'callerClass' => null, 'callerMethod' => null,\n ];\n\n if (isset($trace['file'], $trace['line'])) {\n $trace['callPath'] = $trace['file'] . ':' . $trace['line'];\n } else {\n $trace['callPath'] = '[internal function]:';\n }\n\n if (isset($trace['class'])) {\n $trace['method'] = $trace['function'];\n $trace['methodType'] = ($trace['type'] == '::') ? 'static' : 'non-static';\n }\n if (isset($stack[$i + 1]['function'])) {\n $trace['caller'] = $stack[$i + 1]['function'];\n }\n if (isset($stack[$i + 1]['class'])) {\n $trace['callerClass'] = $stack[$i + 1]['class'];\n $trace['callerMethod'] = sprintf('%s::%s', $stack[$i + 1]['class'], $stack[$i + 1]['function']);\n }\n\n $stack[$i] = $trace;\n }\n\n return is_null($index) ? $stack : ($stack[$index][$field] ?? $stack[$index] ?? null);\n}", "public function getTrace();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function _getOptions($options)\n {\n }", "public function find($options=array())\n {\n $options = array_merge(get_object_vars($this->data), $options);\n $it = $this->createRecordIterator();\n\n foreach($options as $k => $v) {\n $it->where($k, $v);\n }\n\n if ($this->siteField && !isset($options[$this->siteField])) {\n $it->where($this->siteField, $this->getSiteId());\n }\n\n $ar = $it->first();\n\n if ($ar) {\n $this->loadFromArray($ar->getValuesAsArray());\n return true;\n } else {\n $this->emptyRecord();\n return false;\n }\n }", "abstract function options();", "public function getStreet(array $options = []);", "static function find($options = array(), $options_for_object = array()) {\n $options[\"left_join\"][] = array(\"table\" => \"versions\",\n \"where\" => \"extension_id = extensions.id\");\n\n $options[\"select\"][] = \"extensions.*\";\n $options[\"select\"][] = \"MAX(versions.created_at) AS last_update\";\n\n $options[\"group\"][] = \"id\";\n\n $options[\"order\"] = array(\"__last_update DESC\", \"extensions.id DESC\");\n\n return parent::search(get_class(), $options, $options_for_object);\n }", "function getOptions() ;", "public function getOpt($option) {}", "public function getOptions() {}", "public function getOptions() {}", "public function getOptions() {}", "public function find($options = null)\n\t\t{\n\t\t\t\n\t\t\t$defaults = array(\n\t\t\t\t'order_by' => null,\n\t\t\t\t'where' => null,\n\t\t\t\t'limit' => null,\n\t\t\t\t'join' => null\n\t\t\t);\n\t\t\t\n\t\t\t$options = is_array($options) ? array_merge($defaults, $options) : $defaults;\n\t\t\t\n\t\t\tif($options['where'])\n\t\t\t{\n\t\t\t\t$this->db->where($options['where']);\n\t\t\t}\n\t\t\t\n\t\t\tif($options['order_by'])\n\t\t\t{\n\t\t\t\t$this->db->order_by($options['order_by']['column'], $options['order_by']['direction']);\n\t\t\t}\n\t\t\t\n\t\t\tif($options['limit'])\n\t\t\t{\n\t\t\t\t$this->db->limit($options['limit']);\n\t\t\t}\n\t\t\t\n\t\t\tif($options['join'])\n\t\t\t{\n\t\t\t\tif($options['join']['method'])\n\t\t\t\t{\n\t\t\t\t\t$this->db->join($options['join']['table'], $options['join']['where'], $options['join']['method']);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$this->db->join($options['join']['table'], $options['join']['where']);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\t\t\n\t\t\t$ret = $this->db->get($this->record);\n\t\t\t\n\t\t\treturn $ret;\n\t\t}", "public function get_stLight_options($data_options);", "function drush_drushutils_find_callback() {\n $matches = array();\n $match_type = drush_get_option('match');\n\n $args = drush_get_arguments();\n $path_to_find = $args[1];\n\n foreach (module_implements('menu') as $module) {\n $menu_callbacks = module_invoke($module, 'menu');\n if (!empty($menu_callbacks)) {\n foreach ($menu_callbacks as $path => $callback) {\n switch ($match_type) {\n case 'partial':\n if (FALSE !== strpos($path, $path_to_find)) {\n $matches[] = array($module, $path);\n }\n break;\n\n case 'full':\n default:\n if ($path == $path_to_find) {\n $matches[] = array($module, $path);\n continue 2;\n }\n break;\n }\n }\n }\n }\n _drushutils_output_results($matches, $match_type);\n}", "final function getTrace();", "public static function getDrupalGotoOptions() {\n global $drupal_goto;\n return !empty($drupal_goto['options']) ? $drupal_goto['options'] : array();\n }", "function driver_get($keyword, $option = array());", "public function find($type, array $options = []) {\n return $this->getRepository()->find($this, $type, $options);\n }", "function getOptions();", "public function options();", "public function options();", "public function options();", "public function options();", "public function options();", "public static function find($options = array(), $returnType = self::RETURN_TYPE_ALL) {\n if (empty($options['table'])) {\n $options['table'] = static::$tableName; \n }\n $sql = new Sql(static::getDb());\n $select = $sql->select()\n ->from($options['table']); \n if (!empty($options['where'])) {\n $where = array();\n foreach ($options['where'] as $property => $value) {\n if (in_array($property, static::$properties)) {\n $where[$property] = $value; \n }\n } \n if (!empty($where)) {\n $select->where($where);\n }\n } \n if (!empty($options['order'])) {\n $select->order($options['order']); \n }\n $selectString = $sql->getSqlStringForSqlObject($select);\n $result = static::getDb()->query($selectString, Adapter::QUERY_MODE_EXECUTE); \n if ($result->count() > 0) {\n return self::response($result, $returnType); \n }\n return array();\n }", "protected function getOptions() {}", "protected function getOptions() {}", "protected function getOptions() {}", "function driver_stats($option = array());", "abstract protected function options(): array;", "protected function _checkOptions($options)\n {\n if (!isset($options['path'])) {\n throw new RuntimeException('Necessário passar o path do arquivo array de opções');\n }\n }", "public static function find($model=null, $options=null)\n\t{\n\t\treturn static::findInternal(\\yii\\db\\ActiveQuery::className(), $model, $options);\n\t}", "public function findArguments(): array\n {\n $arguments = [];\n if ('phpdbg' === PHP_SAPI)\n {\n $arguments[] = '-qrr';\n }\n\n return $arguments;\n }", "protected function setProfilerMatcher(array $options)\n {\n if (isset($options['enabled'])) {\n $this->profiler['matcher']['enabled'] = (boolean) $options['enabled'];\n }\n if (isset($options['rules']) && is_array($options['rules'])) {\n $arrayPath = '[\\'zdt\\'][\\'profiler\\'][\\'matcher\\']';\n $added = array();\n\n foreach ($options['rules'] as $name => $rule) {\n if (is_array($rule)) {\n $added[] = $name;\n\n $this->profiler['matcher']['rules'][$name] = array();\n\n if (isset($rule['action'])) {\n if ($rule['action'] !== 'enable' && $rule['action'] !== 'disable') {\n $report->addError(sprintf(\n '%s[\\'rules\\'][\\'%s\\'][\\'action\\'] must be \"enable\" or \"disable\", %s given.',\n $arrayPath,\n $name,\n $rule['action']\n ));\n } else {\n $this->profiler['matcher']['rules'][$name]['action'] = $rule['action'];\n }\n } else {\n $this->profiler['matcher']['rules'][$name]['action'] = 'enable';\n }\n\n if (isset($rule['match'])) {\n if (!is_array($rule['match'])) {\n $report->addError(sprintf(\n '%s[\\'rules\\'][\\'%s\\'][\\'match\\'] must be an array, %s given.',\n $arrayPath,\n gettype($rule['match'])\n ));\n } else {\n $this->profiler['matcher']['rules'][$name]['match'] = $rule['action'];\n }\n }\n } else {\n $report->addError(sprintf(\n '%s[\\'rules\\'][\\'%s\\'] must be an array, %s given.',\n $arrayPath,\n $name,\n gettype($rule)\n ));\n }\n }\n\n foreach ($added as $name) {\n if (!isset($this->profiler['matcher']['rules'][$name]['match'])) {\n unset($this->profiler['matcher']['rules'][$name]);\n }\n }\n } else {\n $report->addError(sprintf(\n '[\\'zdt\\'][\\'profiler\\'][\\'matcher\\'][\\'rules\\'] must be an array, %s given.',\n gettype($options['rules'])\n ));\n }\n }", "public static function first(array $options = array());", "private function findStackFrame()\n {\n $trace = debug_backtrace();\n foreach ($trace as $f) {\n if (!array_key_exists('class', $f)) {\n continue;\n }\n $class = $f['class'];\n if (preg_match('/LoggingBundle/', $class) &&\n $class != 'LOCKSSOMatic\\LoggingBundle\\Command\\ExportLogsCommand') {\n continue;\n }\n if (!preg_match('/^LOCKSSOMatic/', $class)) {\n continue;\n }\n return $f;\n }\n }", "public function findAllOptions();", "protected function baseFind(array $options): ProxyDataInterface\n {\n $this->options = $options;\n\n try {\n $response = $this->client->get($this->getBaseUrl());\n } catch (GuzzleException) {\n throw new ProxyNotFound();\n }\n\n $proxyData = $this->getProxyData(\n $this->decodeBody($response->getBody()->getContents())\n );\n\n return $this->afterMiddleware($proxyData);\n }", "public function configureOptions();", "public function getDriverOptions(): array;", "function findConfig($frames,$stems=null){\n //<---if stems param provided\n //<----$listofstems = calcluateHXY(frame,stems)\n\n //<----create query for request of configs\n //return results\n}", "public static function find($parameters=null) {}", "public function sniff(\n $file = 'src',\n array $options = [\n 'autofix' => false,\n 'strict' => false,\n ]\n ) {\n return var_export($options, true);\n }", "public function lookup($ids, $options = []);", "static function optionsIns();", "public function find(){\n $s = microtime(true);\n $path = $this->getAlgorithm()->find();\n $e = microtime(true);\n\n return [\n 'time' => ($e - $s),\n 'path' => ($path === null ? false : $this->getCoords($path)),\n 'map' => ($path === null ? false : $this->draw($path))\n ];\n }", "public function run($options)\n\t{\n\t\treturn $options;\n\t}", "public function getOptions()\r\n {\r\n }", "function find($filter=NULL,array $options=NULL,$ttl=0,$log=TRUE) {\n\t\tif (!$options)\n\t\t\t$options=[];\n\t\t$options+=[\n\t\t\t'order'=>NULL,\n\t\t\t'limit'=>0,\n\t\t\t'offset'=>0,\n\t\t\t'group'=>NULL,\n\t\t];\n\t\t$fw=\\Base::instance();\n\t\t$cache=\\Cache::instance();\n\t\t$db=$this->db;\n\t\t$now=microtime(TRUE);\n\t\t$data=[];\n\t\t$tag='';\n\t\tif (is_array($ttl))\n\t\t\tlist($ttl,$tag)=$ttl;\n\t\tif (!$fw->CACHE || !$ttl || !($cached=$cache->exists(\n\t\t\t$hash=$fw->hash($this->db->dir().\n\t\t\t\t$fw->stringify([$filter,$options])).($tag?'.'.$tag:'').'.jig',$data)) ||\n\t\t\t$cached[0]+$ttl<microtime(TRUE)) {\n\t\t\t$data=$db->read($this->file);\n\t\t\tif (is_null($data))\n\t\t\t\treturn FALSE;\n\t\t\tforeach ($data as $id=>&$doc) {\n\t\t\t\t$doc['_id']=$id;\n\t\t\t\tunset($doc);\n\t\t\t}\n\t\t\tif ($filter) {\n\t\t\t\tif (!is_array($filter))\n\t\t\t\t\treturn FALSE;\n\t\t\t\t// Normalize equality operator\n\t\t\t\t$expr=preg_replace('/(?<=[^<>!=])=(?!=)/','==',$filter[0]);\n\t\t\t\t// Prepare query arguments\n\t\t\t\t$args=isset($filter[1]) && is_array($filter[1])?\n\t\t\t\t\t$filter[1]:\n\t\t\t\t\tarray_slice($filter,1,NULL,TRUE);\n\t\t\t\t$args=is_array($args)?$args:[1=>$args];\n\t\t\t\t$keys=$vals=[];\n\t\t\t\t$tokens=array_slice(\n\t\t\t\t\ttoken_get_all('<?php '.$this->token($expr)),1);\n\t\t\t\t$data=array_filter($data,\n\t\t\t\t\tfunction($_row) use($fw,$args,$tokens) {\n\t\t\t\t\t\t$_expr='';\n\t\t\t\t\t\t$ctr=0;\n\t\t\t\t\t\t$named=FALSE;\n\t\t\t\t\t\tforeach ($tokens as $token) {\n\t\t\t\t\t\t\tif (is_string($token))\n\t\t\t\t\t\t\t\tif ($token=='?') {\n\t\t\t\t\t\t\t\t\t// Positional\n\t\t\t\t\t\t\t\t\t++$ctr;\n\t\t\t\t\t\t\t\t\t$key=$ctr;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\tif ($token==':')\n\t\t\t\t\t\t\t\t\t\t$named=TRUE;\n\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t$_expr.=$token;\n\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telseif ($named &&\n\t\t\t\t\t\t\t\ttoken_name($token[0])=='T_STRING') {\n\t\t\t\t\t\t\t\t$key=':'.$token[1];\n\t\t\t\t\t\t\t\t$named=FALSE;\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$_expr.=$token[1];\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$_expr.=$fw->stringify(\n\t\t\t\t\t\t\t\tis_string($args[$key])?\n\t\t\t\t\t\t\t\t\taddcslashes($args[$key],'\\''):\n\t\t\t\t\t\t\t\t\t$args[$key]);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// Avoid conflict with user code\n\t\t\t\t\t\tunset($fw,$tokens,$args,$ctr,$token,$key,$named);\n\t\t\t\t\t\textract($_row);\n\t\t\t\t\t\t// Evaluate pseudo-SQL expression\n\t\t\t\t\t\treturn eval('return '.$_expr.';');\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (isset($options['group'])) {\n\t\t\t\t$cols=array_reverse($fw->split($options['group']));\n\t\t\t\t// sort into groups\n\t\t\t\t$data=$this->sort($data,$options['group']);\n\t\t\t\tforeach($data as $i=>&$row) {\n\t\t\t\t\tif (!isset($prev)) {\n\t\t\t\t\t\t$prev=$row;\n\t\t\t\t\t\t$prev_i=$i;\n\t\t\t\t\t}\n\t\t\t\t\t$drop=false;\n\t\t\t\t\tforeach ($cols as $col)\n\t\t\t\t\t\tif ($prev_i!=$i && array_key_exists($col,$row) &&\n\t\t\t\t\t\t\tarray_key_exists($col,$prev) && $row[$col]==$prev[$col])\n\t\t\t\t\t\t\t// reduce/modify\n\t\t\t\t\t\t\t$drop=!isset($this->_reduce[$col]) || call_user_func_array(\n\t\t\t\t\t\t\t\t$this->_reduce[$col][0],[&$prev,&$row])!==FALSE;\n\t\t\t\t\t\telseif (isset($this->_reduce[$col])) {\n\t\t\t\t\t\t\t$null=null;\n\t\t\t\t\t\t\t// initial\n\t\t\t\t\t\t\tcall_user_func_array($this->_reduce[$col][0],[&$row,&$null]);\n\t\t\t\t\t\t}\n\t\t\t\t\tif ($drop)\n\t\t\t\t\t\tunset($data[$i]);\n\t\t\t\t\telse {\n\t\t\t\t\t\t$prev=&$row;\n\t\t\t\t\t\t$prev_i=$i;\n\t\t\t\t\t}\n\t\t\t\t\tunset($row);\n\t\t\t\t}\n\t\t\t\t// finalize\n\t\t\t\tif ($this->_reduce[$col][1])\n\t\t\t\t\tforeach($data as $i=>&$row) {\n\t\t\t\t\t\t$row=call_user_func($this->_reduce[$col][1],$row);\n\t\t\t\t\t\tif (!$row)\n\t\t\t\t\t\t\tunset($data[$i]);\n\t\t\t\t\t\tunset($row);\n\t\t\t\t\t}\n\t\t\t}\n\t\t\tif (isset($options['order']))\n\t\t\t\t$data=$this->sort($data,$options['order']);\n\t\t\t$data=array_slice($data,\n\t\t\t\t$options['offset'],$options['limit']?:NULL,TRUE);\n\t\t\tif ($fw->CACHE && $ttl)\n\t\t\t\t// Save to cache backend\n\t\t\t\t$cache->set($hash,$data,$ttl);\n\t\t}\n\t\t$out=[];\n\t\tforeach ($data as $id=>&$doc) {\n\t\t\tunset($doc['_id']);\n\t\t\t$out[]=$this->factory($id,$doc);\n\t\t\tunset($doc);\n\t\t}\n\t\tif ($log && isset($args)) {\n\t\t\tif ($filter)\n\t\t\t\tforeach ($args as $key=>$val) {\n\t\t\t\t\t$vals[]=$fw->stringify(is_array($val)?$val[0]:$val);\n\t\t\t\t\t$keys[]='/'.(is_numeric($key)?'\\?':preg_quote($key)).'/';\n\t\t\t\t}\n\t\t\t$db->jot('('.sprintf('%.1f',1e3*(microtime(TRUE)-$now)).'ms) '.\n\t\t\t\t$this->file.' [find] '.\n\t\t\t\t($filter?preg_replace($keys,$vals,$filter[0],1):''));\n\t\t}\n\t\treturn $out;\n\t}", "public function find($regex, $mode = NULL, array $info = []) {\n $ret = [];\n foreach ($this->arguments as $i => $a) {\n if ($mode !== NULL && $a['mode'] !== $mode) {\n continue;\n\n }\n if (!empty($info)) {\n $intersect = array_intersect($info, $a['info']);\n if ($intersect != $info) {\n continue;\n\n }\n }\n if (preg_match($regex, $a['argument']) === 1) {\n $ret[$i] = $a;\n }\n }\n return $ret;\n }", "public function getDefinedOptions();", "function KM_find($options=array())\n\t {\n\t \n\t if(isset($options['class'])){\n\t\t $table=$this->db->dbprefix.$options['class'];\n\t\t}\n\t\telse{\n\t\t $table=$this->table;\n\t\t}\n\t\t$this->model=$this->_model_generate($table); \n\t\t\n\t\tif(isset($options['limit'])){\n\t\t if(isset($options['offset'])){\n\t\t \t$this->db->limit($options['limit'],$options['offset']);\n\t\t }else{\n\t\t \t$this->db->limit($options['limit']);\n\t\t }\n\t\t}\n\t\tif(isset($options['order'])){\n\t\t $this->db->order_by($options['order']);\n\t\t}\n\t\tif(isset($options['conditions'])){\n\t\t $tmp_keys=array_keys($options['conditions']);\n\t\t $conditions=array();\n\t\t $i=0;\n\t\t while(count($tmp_keys)>$i){\n\t\t $temp_key=$tmp_keys[$i];\n\t\t $tmp_keys[$i]=$table.'.'.$tmp_keys[$i];\n\t\t\t $conditions[$tmp_keys[$i]]=$options['conditions'][$temp_key];\n\t\t $i++;\n\t\t }\n\t\t $this->db->where($conditions);\n\t\t}\n\t\tif(isset($options['search_conditions'])){\n \t\t$this->db->where($options['search_conditions'],NULL, FALSE);\n\t\t}\n\t if(isset($options['fields'])){\n\t\t $this->db->select($this->_prefix_table_fields($table,$options,$options['fields']));\n\t\t}\n\t\telse{\n $this->db->select($this->_prefix_table_fields($table,$options));\t\t\n }\n\t\t$this->db->from($table);\n\t\tif(isset($options['joins'])){\n\t\t foreach($options['joins'] as $join){\n\t\t $type=isset($join['type'])?$join['type']:'';\n\t\t $join_table=$this->db->dbprefix($join['class']);\n\t\t $this->db->join($join_table,''.$join_table.'.'.$join['primaryKey'].'='.$table.'.'.$join['foreignKey'].'',$type);\n\t\t\t if(isset($join['conditions'])){\n \t\t\t $this->db->where($this->_conditions($join['conditions'],$join_table));\n\t\t\t }\n\t\t }\n\t\t}\n\t\t \n\t\t$query=$this->db->get();\n\t\tif ($query->num_rows() > 0)\n\t\t{\n\t\t $result=array();\n\t\t $tmp_result=$query->result_array();\n\t\t //pr($tmp_result);exit;\n\t\t $i=0;\n\t\t\twhile(count($tmp_result)>$i){\n\t\t\t\t$result[$i]=$this->_array_generation($tmp_result[$i]);\n\t\t\t $i++;\t\t\n\t\t\t}\n\t\t\tif(isset($options['joins']) && count($options['joins'])>0){\n\t\t\tforeach($options['joins'] as $hasmany_joins){\n\t\t\t\n\t\t\t if(isset($hasmany_joins['hasMany']) && $hasmany_joins['hasMany']==1){\n\t\t\t\t $hasmany_model=$this->_model_generate($this->db->dbprefix.$hasmany_joins['class']);\n\t\t\t\t\t \t\t\t$j=0;\n $temp_foreignkeys_values=array();\n\t\t\t\t\t foreach($result as $key=>$temp_value){\n\t\t\t\t\t\t\tif(in_array($temp_value[$this->model][$hasmany_joins['foreignKey']],$temp_foreignkeys_values)){\n\t\t\t\t\t\t $temp_foreignkey_key=array_search($temp_value[$this->model][$hasmany_joins['foreignKey']], $temp_foreignkeys_values);\n\t\t\t\t\t\t\t\t$result[$temp_foreignkey_key][$hasmany_model][]=$temp_value[$hasmany_model];\n\t\t\t\t\t\t\t\tunset($result[$key]);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t unset($result[$key][$hasmany_model]);\n $result[$j][$hasmany_model][]=$temp_value[$hasmany_model];\n\t\t\t\t\t\t\t $temp_foreignkeys_values[$key]=$temp_value[$this->model][$hasmany_joins['foreignKey']];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t$j++; \n\t\t\t\t\t \n\t\t\t\t\t }\n\t\t\t\t\t \n\t\t\t\t }\n\t\t\t}\n\t\t }\t\n\t\t\t\n\t\t return array_values($result);\t\t \n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn array();\n\t\t} \n\t }", "public function find($filter = [], array $options = []) {\n return $this->data->find($filter, $options);\n }", "public function select($options = null)\n {\n $query = $this->constructSelectQuery($options);\n //global $argv, $netId; if (isset($argv) || $netId == 'zpx2') var_dump($query);\n\n if ($query === false) {\n return false;\n }\n $this->result = $this->query($query);\n return ($this->result !== false ? $this : false);\n }", "protected function get_options()\n\t{}", "function getContextOptions();", "public function getOptions(): array;", "public function getOptions(): array;", "public function getOptions(): array;", "public function getOptions(): array;", "public function getOptions(): array;", "public function getOptions(): array;", "public function getOptions(): array;", "public static function findActives($options = [])\n {\n return static::findBy('active', '1', $options);\n }", "public function findOptionById($optionId);", "public static function getInstance($options = array());", "public function indexOf($id)\n\t{\n\t\t$opt_len = $this->getOptionsLength();\n\n\t\tfor ($i = 0; $i < $opt_len; $i++)\n\t\t{\n\t\t\tif ($this->options[$i]->getID() == $id)\n\t\t\t{\n\t\t\t\treturn $i;\n\t\t\t}\n\t\t}\n\n\t\treturn -1;\n\t}", "public function describe_debug_options() {\n echo '<p>The following options control logging of the plugin actions for debugging purposes.</p>';\n }", "public function options(array $options);", "public function options() {}", "public function getExtraServiceOptions();", "public function findOneBy(array $options, $columns = ['*']);", "public function getSQL(array $options);", "public function hasOptions();", "public function getOption($option)\n\t{\n\t\t$original = $this->config->get('rocketeer::'.$option);\n\n\t\tif ($contextual = $this->getContextualOption($option, 'stages', $original)) {\n\t\t\treturn $contextual;\n\t\t}\n\n\t\tif ($contextual = $this->getContextualOption($option, 'connections', $original)) {\n\t\t\treturn $contextual;\n\t\t}\n\n\t\treturn $original;\n\t}", "function obtainCurrentAction($opt)\n\t{\n\t\t$arrReturn = array();\n\t\t$options = $_SESSION[\"buneli_json_options\"];\n\t\tforeach($options as $key => $arrOpt)\n\t\t{\n\t\t\tif($arrOpt[\"COD_OPTION\"]==$opt)\n\t\t\t{\n\t\t\t\t$arrReturn = $arrOpt;\n\t\t\t}\n\t\t}\n\t\treturn $arrReturn;\n\t}", "public static function find($options = array()) {\n $options = (array) $options;\n $options['limit'] = 1;\n\n if (!$row = self::$db->row(static::$table, $options)) {\n return null;\n }\n\n return self::buildFromRow($row);\n }" ]
[ "0.5398092", "0.51319474", "0.5119972", "0.48672327", "0.47193208", "0.47091642", "0.46326286", "0.46305194", "0.46206948", "0.46206948", "0.46206948", "0.46206948", "0.46206948", "0.46206948", "0.46206948", "0.46206948", "0.46206948", "0.46206948", "0.46206948", "0.46206948", "0.46206948", "0.46206948", "0.46206948", "0.46206948", "0.46076763", "0.4580049", "0.45729062", "0.45726898", "0.45638624", "0.4554593", "0.4528943", "0.45278227", "0.45274782", "0.45274782", "0.45145702", "0.45120564", "0.45038232", "0.4469134", "0.44609383", "0.44333723", "0.44257402", "0.44193274", "0.44092953", "0.44092953", "0.44092953", "0.44092953", "0.44092953", "0.43960103", "0.43764353", "0.43764353", "0.43760723", "0.4369956", "0.4368386", "0.43671173", "0.43658575", "0.4358282", "0.4357905", "0.43542767", "0.43505204", "0.43496144", "0.43424794", "0.43150097", "0.43147635", "0.42936933", "0.42658222", "0.42604735", "0.4244012", "0.42423686", "0.42373845", "0.42346302", "0.42218584", "0.42066157", "0.42063457", "0.41901338", "0.4188023", "0.41857487", "0.41834754", "0.41785392", "0.4158927", "0.41353837", "0.41353837", "0.41353837", "0.41353837", "0.41353837", "0.41353837", "0.41353837", "0.41343245", "0.41327876", "0.41244745", "0.4109222", "0.41082287", "0.41055232", "0.40955034", "0.4085295", "0.40790248", "0.4065278", "0.40538904", "0.40414178", "0.40358895", "0.40322012" ]
0.78948694
0
returns constant names and values
public function getWithAdditionalConstants(): array { return array_merge( $this->getConstants(), ['user' => ['user', 'stubbles.user.path']] ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getConsts() {\n $const = $this->get('const');\n return null !== $const ? $const : array();\n }", "public function getConstants()\n {\n return array();\n }", "public function getConstants()\n\t{\n\t\treturn $this->constants;\n\t}", "public function getConstList(){\n\t\treturn $this->getConstantsList();\n\t}", "public static function getValues()\n {\n return Hash::extract(self::getConstants(), '{s}.value');\n }", "public static function getValues()\n\t\t{\n\n\t\t\t$reflectionClass = new ReflectionClass(static::class);\n\t\t\treturn array_values($reflectionClass->getConstants());\n\n\t\t}", "public function getConstants()\n {\n return $this->constants;\n }", "public function getConstants()\n {\n return $this->constants;\n }", "static function getConstants()\n {\n $oClass = new ReflectionClass(__CLASS__);\n return $oClass->getConstants();\n }", "public static function values()\n {\n $class = get_called_class();\n\n if (!isset(self::$cache[$class])) {\n $reflected = new \\ReflectionClass($class);\n self::$cache[$class] = $reflected->getConstants();\n }\n\n return self::$cache[$class];\n }", "public static function getConstList()\n\t{\n\t\t$reflect = new ReflectionClass(get_called_class());\n\t\treturn $reflect->getConstants();\n\t}", "public static function getNames()\n\t\t{\n\n\t\t\t$reflectionClass = new ReflectionClass(static::class);\n\t\t\treturn array_keys($reflectionClass->getConstants());\n\n\t\t}", "public static function getValues(): array\n {\n $reflectionClass = new ReflectionClass(static::class);\n\n return array_values($reflectionClass->getConstants());\n }", "public static function getConstants()\n {\n $self = new ReflectionClass(static::class);\n\n return $self->getConstants();\n }", "public function defineConstants ()\n {\n foreach ($this->data as $key => $value) {\n define(strtoupper($key), $value);\n }\n }", "private static function getConstants() {\n if (self::$constCacheArray == NULL) {\n self::$constCacheArray = [];\n }\n\n $calledClass = get_called_class();\n \n if (!array_key_exists($calledClass, self::$constCacheArray)) {\n $reflect = new ReflectionClass($calledClass);\n self::$constCacheArray[$calledClass] = $reflect->getConstants();\n }\n\n return self::$constCacheArray[$calledClass];\n }", "public static function getConstants(): array\n {\n $oClass = new ReflectionClass(__CLASS__);\n return $oClass->getConstants();\n }", "static function getCodes() {\n $oClass = new ReflectionClass(__CLASS__);\n return $oClass->getConstants();\n }", "private static function getConstants(): array\n {\n $calledClass = get_called_class();\n\n if (!array_key_exists($calledClass, self::$constCacheArray)) {\n $reflect = new ReflectionClass($calledClass);\n self::$constCacheArray[$calledClass] = $reflect->getConstants();\n }\n\n return self::$constCacheArray[$calledClass];\n }", "public function getConstants(): Collection\n {\n return $this->constants;\n }", "public static function getValues()\n {\n return array_values(self::getConstants());\n }", "public static function getConstants()\n {\n if (empty(self::$_constantsCache)) {\n $reflectionClass = new \\ReflectionClass(get_called_class());\n self::$_constantsCache = $reflectionClass->getConstants();\n }\n return self::$_constantsCache;\n }", "private function define_constants()\n {\n define('FI_KILONKIPINAT_TODOS_TODOITEM_STATUS_NEW', 1000);\n define('FI_KILONKIPINAT_TODOS_TODOITEM_STATUS_PENDING', 1100);\n define('FI_KILONKIPINAT_TODOS_TODOITEM_STATUS_ACKNOWLEDGED', 1200);\n define('FI_KILONKIPINAT_TODOS_TODOITEM_STATUS_RESOLVED', 1400);\n define('FI_KILONKIPINAT_TODOS_TODOITEM_STATUS_CLOSED', 2000);\n\n define('FI_KILONKIPINAT_TODOS_TODOITEM_RELATED_LINKTYPE_PENDING', 1000);\n define('FI_KILONKIPINAT_TODOS_TODOITEM_RELATED_LINKTYPE_DUPLICATE', 1100);\n \n define('FI_KILONKIPINAT_TODOS_TODOITEM_WEIGHT_ULTRALIGHT', 1000);\n define('FI_KILONKIPINAT_TODOS_TODOITEM_WEIGHT_LIGHT', 1100);\n define('FI_KILONKIPINAT_TODOS_TODOITEM_WEIGHT_MEDIUM', 1200);\n define('FI_KILONKIPINAT_TODOS_TODOITEM_WEIGHT_HEAVY', 1300);\n define('FI_KILONKIPINAT_TODOS_TODOITEM_WEIGHT_SUPERHEAVY', 1400);\n \n define('FI_KILONKIPINAT_TODOS_TODOITEM_VISIBILITY_PUBLIC', 1000);\n define('FI_KILONKIPINAT_TODOS_TODOITEM_VISIBILITY_SECURE', 1100);\n }", "private function extractConstants(): array\n {\n $tokens = $this->tokens->findFirstCurlyParenthesizedBlock();\n $tokens = $tokens->withoutBlocks();\n\n preg_match_all('/(?<docblock>T_DOC_COMMENT )?(?<qualifiers>(T_PUBLIC |T_PROTECTED |T_PRIVATE )*)T_CONST (?<name>T_STRING )(= (?<value>(?:(?!; ).)+))?; /',\n $tokens->asString(),\n $matches,\n PREG_OFFSET_CAPTURE | PREG_SET_ORDER);\n\n $constants = [];\n foreach ($matches as $match)\n {\n $constantTokens = TokenMatchHelper::codeBlock($match, $tokens, $this->tokens);\n $lines = $constantTokens->lines();\n\n $constants[] = ['docblock' => TokenMatchHelper::docblockDetails($match, $tokens),\n 'visibility' => TokenMatchHelper::visibility($match),\n 'name' => TokenMatchHelper::code('name', $match, $tokens),\n 'value' => TokenMatchHelper::code('value', $match, $tokens),\n 'start' => $lines['start'],\n 'end' => $lines['end'],\n 'tokens' => $constantTokens];\n }\n\n return $constants;\n }", "public static function getMap()\n\t\t{\n\n\t\t\t$reflectionClass = new ReflectionClass(static::class);\n\t\t\treturn array_flip($reflectionClass->getConstants());\n\n\t\t}", "final static private function getConstants()\n\t{\n $class = get_called_class();\n\t\tif(!isset(self::$_consts[$class])) {\n\t\t\tif($class == __CLASS__) {\n\t\t\t\tthrow new \\BadMethodCallException('You can\\'t access constants from Enum class');\n\t\t\t}\n\t\t\t$reflection = new \\ReflectionClass($class);\n\t\t\tself::$_consts[$class] = $reflection->getConstants();\n\t\t}\n\t\treturn self::$_consts[$class];\n\t}", "public function getConsts($prefix)\n {\n if (isset(self::$consts[$prefix])) {\n return self::$consts[$prefix];\n }\n\n // 1. Get all class constants\n $class = new \\ReflectionClass($this);\n $consts = $class->getConstants();\n\n // 2. Use exiting constant configs\n $property = lcfirst(str_replace('_', '', ucwords($prefix, '_'))) . 'Names';\n if (isset($this->{$property})) {\n $names = $this->{$property};\n } else {\n $names = [];\n }\n\n // 3. Generate id and name\n $prefix .= '_';\n $data = [];\n $length = strlen($prefix);\n foreach ($consts as $name => $id) {\n if (0 !== stripos($name, $prefix)) {\n continue;\n }\n if (in_array($name, $this->constExcludes, true)) {\n continue;\n }\n $data[$id]['id'] = $id;\n $data[$id]['key'] = strtolower(strtr(substr($name, $length), ['_' => '-']));\n if (isset($names[$id])) {\n $data[$id]['name'] = $names[$id];\n }\n }\n\n self::$consts[$prefix] = $data;\n\n return $data;\n }", "public static function values()\n {\n return array (\n self::HOLIDAY => \"Отгул\",\n self::SICK => \"Болел\",\n self::TRIP => \"Командировка\",\n self::HOME => \"Из дома\",\n self::OTHER_OFFICE => \"В другом офисе\",\n self::VACATION => \"Отпуск\",\n );\n }", "public static function getAllNames(): array\n {\n $reflection = new \\ReflectionClass(__CLASS__);\n\n return \\array_values($reflection->getConstants());\n }", "public static function getAllNames(): array\n {\n $reflection = new \\ReflectionClass(__CLASS__);\n\n return \\array_values($reflection->getConstants());\n }", "function getConstName() \n {\n $name = $this->getName();\n \n return strtoupper( $name );\n }", "public static function getValues(): array\n {\n return array_values(self::getConstants());\n }", "public static function values() {\n return parent::membersOf(__CLASS__);\n }", "public static function values() {\n return parent::membersOf(__CLASS__);\n }", "public static function values() {\n return parent::membersOf(__CLASS__);\n }", "function get_class_constants_value($className)\n {\n $constants_array = get_class_constants($className);\n\n if (empty($constants_array)) {\n return false;\n }\n\n $array = array();\n foreach ($constants_array as $constant) {\n $array[] = constant(\"{$className}::\".$constant);\n }\n\n return $array;\n }", "public static function getImageObjectSizesNamesAndValues()\n {\n return self::getConstants();\n }", "function renderConstants() {\n\n $this->constants[\"public\"] = $this->accessor->getConstantsByAccess(\"public\");\n $this->constants[\"private\"] = $this->accessor->getConstantsByAccess(\"private\");\n\n if (0 == count($this->constants[\"public\"]) && 0 == count($this->constants[\"private\"]))\n return;\n\n $this->renderConstantSummary();\n $this->renderConstantDetail();\n $this->constants = array();\n\n }", "public static function toArray()\n\t{\n\t\treturn array_flip((new \\ReflectionClass(new self))->getConstants());\n\t}", "public static function toArray()\n\t{\n\t\treturn array_flip((new \\ReflectionClass(new self))->getConstants());\n\t}", "public function register() {\n\n return [ T_CONST ];\n\n }", "public function getSubrogationConstantes() {\n return $this->subrogationConstantes;\n }", "protected function buildCommonValues(): array\n {\n $values = [];\n $reflectionClass = new ReflectionClass(HttpStatusInterface::class);\n foreach ($reflectionClass->getConstants() as $name => $value) {\n $code = constant('Altair\\Http\\Contracts\\HttpStatusCodeInterface::' . $name);\n $values[$code] = $value;\n }\n\n return $values;\n }", "function constants() {\r\n\r\n\t\t\t/**\r\n\t\t\t * Set constant name for the post type name.\r\n\t\t\t *\r\n\t\t\t * @since 1.0.0\r\n\t\t\t */\r\n\t\t\tdefine( 'RV_PORTFOLIO_NAME', 'rv-portfolio' );\r\n\r\n\t\t\t/**\r\n\t\t\t * Set the slug of the plugin.\r\n\t\t\t *\r\n\t\t\t * @since 1.0.0\r\n\t\t\t */\r\n\t\t\tdefine( 'RV_PORTFOLIO_SLUG', basename( dirname( __FILE__ ) ) );\r\n\r\n\t\t\t/**\r\n\t\t\t * Set the name for the 'meta_key' value in the 'wp_postmeta' table.\r\n\t\t\t *\r\n\t\t\t * @since 1.0.0\r\n\t\t\t */\r\n\t\t\tdefine( 'RV_PORTFOLIO_POSTMETA', 'rv_portfolio' );\r\n\r\n\t\t\t/**\r\n\t\t\t * Set constant path to the plugin directory.\r\n\t\t\t *\r\n\t\t\t * @since 1.0.0\r\n\t\t\t */\r\n\t\t\tdefine( 'RV_PORTFOLIO_DIR', trailingslashit( plugin_dir_path( __FILE__ ) ) );\r\n\r\n\t\t\t/**\r\n\t\t\t * Set constant path to the plugin URI.\r\n\t\t\t *\r\n\t\t\t * @since 1.0.0\r\n\t\t\t */\r\n\t\t\tdefine( 'RV_PORTFOLIO_URI', trailingslashit( plugin_dir_url( __FILE__ ) ) );\r\n\r\n\t\t\t/**\r\n\t\t\t * Set constant DB option field.\r\n\t\t\t *\r\n\t\t\t * @since 1.0.0\r\n\t\t\t */\r\n\t\t\tdefine( 'RV_PORTFOLIO_OPTIONS_NAME', 'rv_portfolio_options' );\r\n\r\n\t\t}", "final static public function toArray()\n {\n return self::getConstants();\n }", "public static function values()\n {\n return self::$values;\n }", "public function constants() {\n\n\t\t\t/**\n\t\t\t * Set the version number of the plugin.\n\t\t\t *\n\t\t\t * @since 1.0.0\n\t\t\t */\n\t\t\tdefine( 'CHERRY_SITE_SHORTCODES_VERSION', '1.0.0' );\n\n\t\t\t/**\n\t\t\t * Set constant path to the plugin directory.\n\t\t\t *\n\t\t\t * @since 1.0.0\n\t\t\t */\n\t\t\tdefine( 'CHERRY_SITE_SHORTCODES_DIR', trailingslashit( plugin_dir_path( __FILE__ ) ) );\n\n\t\t\t/**\n\t\t\t * Set constant path to the plugin URI.\n\t\t\t *\n\t\t\t * @since 1.0.0\n\t\t\t */\n\t\t\tdefine( 'CHERRY_SITE_SHORTCODES_URI', trailingslashit( plugin_dir_url( __FILE__ ) ) );\n\t\t}", "function output_defined_constant()\n{\n echo \"Defined constanst from within a function\" . CONST_IN_FUNC . \"<br>\";\n}", "public static function get_values() {\n\t\treturn [\n\t\t\t'ID' => [\n\t\t\t\t'name' => 'ID',\n\t\t\t\t'value' => 'global_id',\n\t\t\t\t'description' => __( 'Identify a resource by the (hashed) Global ID.', 'wp-graphql' ),\n\t\t\t],\n\t\t\t'DATABASE_ID' => [\n\t\t\t\t'name' => 'DATABASE_ID',\n\t\t\t\t'value' => 'database_id',\n\t\t\t\t'description' => __( 'Identify a resource by the Database ID.', 'wp-graphql' ),\n\t\t\t],\n\t\t\t'URI' => [\n\t\t\t\t'name' => 'URI',\n\t\t\t\t'value' => 'uri',\n\t\t\t\t'description' => __( 'Identify a resource by the URI.', 'wp-graphql' ),\n\t\t\t],\n\t\t];\n\t}", "static function getCollection(){\n $class = new ReflectionClass(get_called_class());\n return collect($class->getConstants());\n }", "public function getConstantSymbol() {\n return $this->constantSymbol;\n }", "public static function constant()\n {\n $args = func_get_args();\n $output = array_pop( $args );\n\n foreach( $args as $name )\n {\n if( defined( $name ) )\n {\n return constant( $name );\n }\n }\n return $output;\n }", "function runkit_constant_add($constname, $value)\n{\n}", "public function __toString() {\n\t\ttry {\n\t\t\treturn array_flip($this->getConstants())[$this->value];\n\t\t\t// when the value is not in the constants\n\t\t} catch(Exception $e) {\n\t\t\treturn \"Invalid value \".$this->value;\n\t\t}\n\t}", "public static function getDefaultConstants(){\n\t\treturn Array(\n\t\t\t//--security\n\t\t\t'AUTH_KEY'=> '1234567890poiuytrewq'\n\t\t\t,'SECURE_AUTH_KEY'=> '0987654321zxcvbnmlkjh'\n\t\t\t,'LOGGED_IN_KEY'=> 'asdfghjklpoiuytrewq'\n\t\t\t,'NONCE_KEY'=> 'zxcvbnmlkjhgfdsa'\n\t\t\t,'AUTH_SALT'=> 'asdfghjklmnbvcxz'\n\t\t\t,'SECURE_AUTH_SALT'=> 'mnbvcxzasdfghjkl'\n\t\t\t,'LOGGED_IN_SALT'=> '1234567890qwertyuiop'\n\t\t\t,'NONCE_SALT'=> '1234567890plkjhgfdsazxc'\n\t\t);\n\t}", "public static function toArray(): array\n {\n return self::getConstants();\n }", "public static function getKeys(): array\n {\n return array_keys(self::getConstants());\n }", "public static function listLevels(): array\n {\n static $list = [];\n if (empty($list)) {\n $list = (new \\ReflectionClass(__CLASS__))->getConstants();\n }\n return $list;\n }", "public static function defines()\n {\n define('STRUCTURE_DATA' , self::data());\n define('CURRENT_COPEN_PAGE' , STRUCTURE_DATA['openFunction']);\n define('CURRENT_CFPARAMETERS', STRUCTURE_DATA['parameters']);\n define('CURRENT_CFILE' , STRUCTURE_DATA['file']);\n define('CURRENT_CFUNCTION' , STRUCTURE_DATA['function']);\n define('CURRENT_CPAGE' , ($page = STRUCTURE_DATA['page']) . '.php');\n define('CURRENT_CONTROLLER' , $page);\n define('CURRENT_CNAMESPACE' , $namespace = STRUCTURE_DATA['namespace'] );\n define('CURRENT_CCLASS' , $namespace . CURRENT_CONTROLLER);\n define('CURRENT_CFPATH' , str_replace\n (\n CONTROLLERS_DIR, '', CURRENT_CONTROLLER) . '/' . CURRENT_CFUNCTION\n );\n define('CURRENT_CFURI' , strtolower(CURRENT_CFPATH));\n define('CURRENT_CFURL' , Request::getSiteURL() . CURRENT_CFPATH);\n }", "private function getFromConst($line)\n {\n $eq_pos = strpos($line, '=');\n $semicolon_pos = strrpos($line, ';');\n\n $constant_name = trim(substr($line, 6, $eq_pos - 6));\n $value = trim(substr($line, $eq_pos + 1, $semicolon_pos - $eq_pos - 1));\n\n return [$constant_name, $this->getNativeValueFromDefinition($value)];\n }", "public function getEnumValues()\n {\n return array(\n 'success' => self::success,\n 'already_used' => self::already_used,\n 'not_exists' => self::not_exists,\n 'once_only' => self::once_only,\n );\n }", "protected function _getTextLabels()\n {\n return array(\n self::NUMBER => 'card_number',\n self::SECURE_STORE => 'secure_store',\n self::EXPIRE_MONTH => 'expire_month',\n self::EXPIRE_YEAR => 'expire_year',\n self::CCV => 'card_ccv',\n self::TYPE => 'card_type',\n self::FIRST_NAME => 'first_name',\n self::LAST_NAME => 'last_name',\n self::ADDRESS => 'address',\n self::CITY => 'city',\n self::STATE => 'state',\n self::POSTAL_CODE => 'postal_code',\n self::COUNTRY => 'country',\n self::PHONE => 'phone'\n );\n }", "protected static function values(): array\n {\n return [\n 'paypal' => 'paypal',\n 'stripe' => 'stripe',\n ];\n }", "static function listado() {\n $class = new ReflectionClass(\"Monedas\");\n $mons = array();\n foreach ($class->getConstants() as $index => $value) {\n if (strlen($index) == 3) {\n $mons[$index] = $value;\n }\n }\n return $mons;\n }", "public function getEnumValues()\n {\n return array(\n 'UNKNOWN_VALUESET' => self::UNKNOWN_VALUESET,\n 'TEMPLATE_IDS' => self::TEMPLATE_IDS,\n 'AMP_SCRIPT_IDS' => self::AMP_SCRIPT_IDS,\n );\n }", "public function getEnumValues()\n {\n return array(\n 'green' => self::green,\n 'blue' => self::blue,\n 'purple' => self::purple,\n 'magicsoul' => self::magicsoul,\n );\n }", "function get_const_title( $c )\n\t{\n\t\t$value = self::const_value( $c );\n\t\t$data = self::get_dump( $value );\n\t\treturn esc_attr( strip_tags( $data ) );\n\t}", "public function getEnumValues()\n {\n return array(\n 'SCI_req_sleep' => self::SCI_req_sleep,\n 'SCI_resp_sleep' => self::SCI_resp_sleep,\n 'SCI_req_wakeup' => self::SCI_req_wakeup,\n 'SCI_resp_wakeup' => self::SCI_resp_wakeup,\n 'SCI_req_usedSeconds' => self::SCI_req_usedSeconds,\n 'SCI_resp_usedSeconds' => self::SCI_resp_usedSeconds,\n 'SCI_req_playSmell' => self::SCI_req_playSmell,\n 'SCI_resp_playSmell' => self::SCI_resp_playSmell,\n 'SCI_req_getDevAttr' => self::SCI_req_getDevAttr,\n 'SCI_resp_getDevAttr' => self::SCI_resp_getDevAttr,\n 'SCI_req_setDevAttr' => self::SCI_req_setDevAttr,\n 'SCI_resp_setDevAttr' => self::SCI_resp_setDevAttr,\n 'SCI_req_featureReport' => self::SCI_req_featureReport,\n 'SCI_resp_featureReport' => self::SCI_resp_featureReport,\n );\n }", "public function getEnumValues()\n {\n return array(\n 'rmb' => self::rmb,\n 'money' => self::money,\n 'item' => self::item,\n 'hero' => self::hero,\n 'rand_soul' => self::rand_soul,\n );\n }", "public function getEnumValues()\n {\n return array(\n 'get_ok' => self::get_ok,\n 'change_ok' => self::change_ok,\n 'fail' => self::fail,\n );\n }", "public function getEnumValues()\n {\n return array(\n 'single_br_tavern' => self::single_br_tavern,\n 'combo_br_tavern' => self::combo_br_tavern,\n 'single_gd_tavern' => self::single_gd_tavern,\n 'combo_gd_tavern' => self::combo_gd_tavern,\n 'magic_soul_tavern' => self::magic_soul_tavern,\n 'rmb_recharge' => self::rmb_recharge,\n 'diamond_consume' => self::diamond_consume,\n );\n }", "public function getEnumValues()\n {\n return array(\n 'guild' => self::guild,\n 'tbc' => self::tbc,\n 'stage' => self::stage,\n 'excav' => self::excav,\n );\n }", "public function getRequiredConstantAsserts(): iterable\n {\n return [\n 'CODE_DUPLICATE_SPACES' => [\n 'CODE_DUPLICATE_SPACES',\n 'DuplicateSpaces',\n ],\n ];\n }", "public static function getSelect()\n {\n return Hash::combine(self::getConstants(), '{s}.value', '{s}.name');\n }", "public function getEnumValues()\n {\n return array(\n 'success' => self::success,\n 'exists' => self::exists,\n 'dirty_word' => self::dirty_word,\n );\n }", "static public function getEnumConstants()\n {\n if ( !self::$constants )\n {\n // array of enums constants\n self::$constants = array(\n new PropertyContentType (self::REGULAR),\n new PropertyContentType (self::ID),\n new PropertyContentType (self::RELATION_TO_PARENT),\n new PropertyContentType (self::ROLLUP_OPERATOR),\n new PropertyContentType (self::ORG_TITLE),\n new PropertyContentType (self::CAPTION),\n new PropertyContentType (self::CAPTION_SHORT),\n new PropertyContentType (self::CAPTION_DESCRIPTION),\n new PropertyContentType (self::CAPTION_ABREVIATION),\n new PropertyContentType (self::WEB_URL),\n new PropertyContentType (self::WEB_HTML),\n new PropertyContentType (self::WEB_XML_OR_XSL),\n new PropertyContentType (self::WEB_MAIL_ALIAS),\n new PropertyContentType (self::ADDRESS),\n new PropertyContentType (self::ADDRESS_STREET),\n new PropertyContentType (self::ADDRESS_HOUSE),\n new PropertyContentType (self::ADDRESS_CITY),\n new PropertyContentType (self::ADDRESS_STATE_OR_PROVINCE),\n new PropertyContentType (self::ADDRESS_ZIP),\n new PropertyContentType (self::ADDRESS_QUARTER),\n new PropertyContentType (self::ADDRESS_COUNTRY),\n new PropertyContentType (self::ADDRESS_BUILDING),\n new PropertyContentType (self::ADDRESS_ROOM),\n new PropertyContentType (self::ADDRESS_FLOOR),\n new PropertyContentType (self::ADDRESS_FAX),\n new PropertyContentType (self::ADDRESS_PHONE),\n new PropertyContentType (self::GEO_CENTROID_X),\n new PropertyContentType (self::GEO_CENTROID_Y),\n new PropertyContentType (self::GEO_CENTROID_Z),\n new PropertyContentType (self::GEO_BOUNDARY_TOP),\n new PropertyContentType (self::GEO_BOUNDARY_LEFT),\n new PropertyContentType (self::GEO_BOUNDARY_BOTTOM),\n new PropertyContentType (self::GEO_BOUNDARY_RIGHT),\n new PropertyContentType (self::GEO_BOUNDARY_FRONT),\n new PropertyContentType (self::GEO_BOUNDARY_REAR),\n new PropertyContentType (self::GEO_BOUNDARY_POLYGON),\n new PropertyContentType (self::PHYSICAL_SIZE),\n new PropertyContentType (self::PHYSICAL_COLOR),\n new PropertyContentType (self::PHYSICAL_WEIGHT),\n new PropertyContentType (self::PHYSICAL_HEIGHT),\n new PropertyContentType (self::PHYSICAL_WIDTH),\n new PropertyContentType (self::PHYSICAL_DEPTH),\n new PropertyContentType (self::PHYSICAL_VOLUME),\n new PropertyContentType (self::PHYSICAL_DENSITY),\n new PropertyContentType (self::PERSON_FULL_NAME),\n new PropertyContentType (self::PERSON_FIRST_NAME),\n new PropertyContentType (self::PERSON_LAST_NAME),\n new PropertyContentType (self::PERSON_MIDDLE_NAME),\n new PropertyContentType (self::PERSON_DEMOGRAPHIC),\n new PropertyContentType (self::PERSON_CONTACT),\n new PropertyContentType (self::QTY_RANGE_LOW),\n new PropertyContentType (self::QTY_RANGE_HIGH),\n new PropertyContentType (self::FORMATTING_COLOR),\n new PropertyContentType (self::FORMATTING_ORDER),\n new PropertyContentType (self::FORMATTING_FONT),\n new PropertyContentType (self::FORMATTING_FONT_EFFECTS),\n new PropertyContentType (self::FORMATTING_FONT_SIZE),\n new PropertyContentType (self::FORMATTING_SUB_TOTAL),\n new PropertyContentType (self::DATE),\n new PropertyContentType (self::DATE_START),\n new PropertyContentType (self::DATE_ENDED),\n new PropertyContentType (self::DATE_CANCELED),\n new PropertyContentType (self::DATE_MODIFIED),\n new PropertyContentType (self::DATE_DURATION),\n new PropertyContentType (self::VERSION)\n );\n }\n\n return self::$constants;\n }", "public function getConstants($extension = null, $version = null);", "function renderConstantSummary() {\n\n reset($this->accessModifiers);\n while (list($k, $access) = each($this->accessModifiers)) {\n if (0 == count($this->constants[$access])) \n continue;\n\n $this->tpl->setCurrentBlock(\"constantssummary_loop\");\n\n reset($this->constants[$access]);\n while (list($name, $const) = each($this->constants[$access])) {\n\n $this->tpl->setVariable(\"NAME\", $name);\n $this->tpl->setVariable(\"VALUE\", htmlentities($const[\"value\"])); \n \n if (isset($const[\"doc\"][\"shortdescription\"]))\n $this->tpl->setVariable(\"SHORTDESCRIPTION\", $this->encode($const[\"doc\"][\"shortdescription\"][\"value\"]));\n\n if (\"true\" == $const[\"undoc\"])\n $this->tpl->setVariable(\"UNDOC\", $this->undocumented);\n\n $this->tpl->parseCurrentBlock();\n }\n\n $this->tpl->setCurrentBlock(\"constantssummary\");\n $this->tpl->setVariable(\"ACCESS\", ucfirst($access));\n $this->tpl->parseCurrentBlock();\n\n }\n\n }", "public function getEnumValues()\n {\n return array(\n 'searched' => self::searched,\n 'battle' => self::battle,\n 'prepare' => self::prepare,\n 'occupy' => self::occupy,\n 'protect' => self::protect,\n );\n }", "function _errorlog_erronoToConstantName($errno) {\r\n \r\n static $numsToNames;\r\n \r\n // create index of nums to names\r\n if (!$numsToNames) {\r\n foreach (get_defined_constants() as $name => $num) { \r\n if (preg_match(\"/^E_/\", $name)) { $numsToNames[$num] = $name; }\r\n }\r\n }\r\n \r\n //\r\n if (array_key_exists($errno, $numsToNames)) { return $numsToNames[$errno]; }\r\n else { return $errno; }\r\n}", "protected static function getEnumConstants(): array\n {\n static $enumConstants = [];\n if (!isset($enumConstants[static::class])) {\n try {\n $reflectionClass = new \\ReflectionClass(static::class);\n $enumConstants[static::class] = $reflectionClass->getConstants();\n } catch (\\ReflectionException $e) {\n throw new \\RuntimeException($e->getMessage(), $e->getCode(), $e);\n }\n }\n return $enumConstants[static::class];\n }", "public function getTitle()\n {\n return 'const';\n }", "public function getEnumValues()\n {\n return array(\n 'all' => self::all,\n 'part' => self::part,\n 'nothing' => self::nothing,\n );\n }", "public static function getConstList($include_default = false)\n {\n $reflected = new \\ReflectionClass(new static(null));\n\n $constants = $reflected->getConstants();\n\n if (!$include_default) {\n unset($constants['__default']);\n return $constants;\n }\n\n return $constants;\n }", "public function getEnumValues()\n {\n return array(\n 'stone_green' => self::stone_green,\n 'stone_blue' => self::stone_blue,\n 'stone_purple' => self::stone_purple,\n );\n }", "public function getEnumValues()\n {\n return array(\n 'battle' => self::battle,\n 'prepare' => self::prepare,\n );\n }", "public function getConstants(): Collection\n {\n return collection($this->reflectionObject->getImmediateReflectionConstants())->map(function (ReflectionClassConstant $constant) {\n return new ConstantEntity($constant);\n });\n }", "public function getEnumValues()\n {\n return array(\n 'PCWEB' => self::PCWEB,\n 'ANDROID_SHOP' => self::ANDROID_SHOP,\n 'IOS_SHOP' => self::IOS_SHOP,\n 'CORE' => self::CORE,\n 'MERCHANT' => self::MERCHANT,\n 'CUSTOMER' => self::CUSTOMER,\n 'ANDROID_CASH' => self::ANDROID_CASH,\n 'SYNC' => self::SYNC,\n 'SYNC_PROCESS' => self::SYNC_PROCESS,\n 'IOS_DRIVER' => self::IOS_DRIVER,\n );\n }", "public function getConstants($extension = null, $version = null)\n {\n $constants = array();\n\n if ((null == $version ) || ('4' == $version)) {\n $version4 = array(\n );\n $constants = array_merge(\n $constants,\n $version4\n );\n }\n if ((null == $version ) || ('5' == $version)) {\n $version5 = array(\n // Use in APCIterator\n 'APC_LIST_ACTIVE' => array('5.0.0', ''),\n 'APC_LIST_DELETED' => array('5.0.0', ''),\n 'APC_ITER_TYPE' => array('5.0.0', ''),\n 'APC_ITER_KEY' => array('5.0.0', ''),\n 'APC_ITER_FILENAME' => array('5.0.0', ''),\n 'APC_ITER_DEVICE' => array('5.0.0', ''),\n 'APC_ITER_INODE' => array('5.0.0', ''),\n 'APC_ITER_VALUE' => array('5.0.0', ''),\n 'APC_ITER_MD5' => array('5.0.0', ''),\n 'APC_ITER_NUM_HITS' => array('5.0.0', ''),\n 'APC_ITER_MTIME' => array('5.0.0', ''),\n 'APC_ITER_CTIME' => array('5.0.0', ''),\n 'APC_ITER_DTIME' => array('5.0.0', ''),\n 'APC_ITER_ATIME' => array('5.0.0', ''),\n 'APC_ITER_REFCOUNT' => array('5.0.0', ''),\n 'APC_ITER_MEM_SIZE' => array('5.0.0', ''),\n 'APC_ITER_TTL' => array('5.0.0', ''),\n 'APC_ITER_NONE' => array('5.0.0', ''),\n 'APC_ITER_ALL' => array('5.0.0', ''),\n // use in apc_bin_load*\n 'APC_BIN_VERIFY_MD5' => array('5.0.0', ''),\n 'APC_BIN_VERIFY_CRC32' => array('5.0.0', ''),\n );\n $constants = array_merge(\n $constants,\n $version5\n );\n }\n\n return $constants;\n }", "static function values()\n {\n return array(\n AssessmentInvitationStatusValue::CURRENT,\n AssessmentInvitationStatusValue::CLOSED,\n AssessmentInvitationStatusValue::HISTORICAL\n );\n }", "public function getConstants($extension = null, $version = null)\n {\n $constants = array();\n\n if ((null == $version ) || ('4' == $version)) {\n $version4 = array(\n 'XML_ELEMENT_NODE' => array('5.0.0', ''),\n 'XML_ATTRIBUTE_NODE' => array('5.0.0', ''),\n 'XML_TEXT_NODE' => array('5.0.0', ''),\n 'XML_CDATA_SECTION_NODE' => array('5.0.0', ''),\n 'XML_ENTITY_REF_NODE' => array('5.0.0', ''),\n 'XML_ENTITY_NODE' => array('5.0.0', ''),\n 'XML_PI_NODE' => array('5.0.0', ''),\n 'XML_COMMENT_NODE' => array('5.0.0', ''),\n 'XML_DOCUMENT_NODE' => array('5.0.0', ''),\n 'XML_DOCUMENT_TYPE_NODE' => array('5.0.0', ''),\n 'XML_DOCUMENT_FRAG_NODE' => array('5.0.0', ''),\n 'XML_NOTATION_NODE' => array('5.0.0', ''),\n 'XML_HTML_DOCUMENT_NODE' => array('5.0.0', ''),\n 'XML_DTD_NODE' => array('5.0.0', ''),\n 'XML_ELEMENT_DECL_NODE' => array('5.0.0', ''),\n 'XML_ATTRIBUTE_DECL_NODE' => array('5.0.0', ''),\n 'XML_ENTITY_DECL_NODE' => array('5.0.0', ''),\n 'XML_NAMESPACE_DECL_NODE' => array('5.0.0', ''),\n 'XML_LOCAL_NAMESPACE' => array('5.0.0', ''),\n 'XML_ATTRIBUTE_CDATA' => array('5.0.0', ''),\n 'XML_ATTRIBUTE_ID' => array('5.0.0', ''),\n 'XML_ATTRIBUTE_IDREF' => array('5.0.0', ''),\n 'XML_ATTRIBUTE_IDREFS' => array('5.0.0', ''),\n 'XML_ATTRIBUTE_ENTITY' => array('5.0.0', ''),\n 'XML_ATTRIBUTE_NMTOKEN' => array('5.0.0', ''),\n 'XML_ATTRIBUTE_NMTOKENS' => array('5.0.0', ''),\n 'XML_ATTRIBUTE_ENUMERATION' => array('5.0.0', ''),\n 'XML_ATTRIBUTE_NOTATION' => array('5.0.0', ''),\n 'DOM_PHP_ERR' => array('5.0.0', ''),\n 'DOM_INDEX_SIZE_ERR' => array('5.0.0', ''),\n 'DOMSTRING_SIZE_ERR' => array('5.0.0', ''),\n 'DOM_HIERARCHY_REQUEST_ERR' => array('5.0.0', ''),\n 'DOM_WRONG_DOCUMENT_ERR' => array('5.0.0', ''),\n 'DOM_INVALID_CHARACTER_ERR' => array('5.0.0', ''),\n 'DOM_NO_DATA_ALLOWED_ERR' => array('5.0.0', ''),\n 'DOM_NO_MODIFICATION_ALLOWED_ERR'\n => array('5.0.0', ''),\n 'DOM_NOT_FOUND_ERR' => array('5.0.0', ''),\n 'DOM_NOT_SUPPORTED_ERR' => array('5.0.0', ''),\n 'DOM_INUSE_ATTRIBUTE_ERR' => array('5.0.0', ''),\n 'DOM_INVALID_STATE_ERR' => array('5.0.0', ''),\n 'DOM_SYNTAX_ERR' => array('5.0.0', ''),\n 'DOM_INVALID_MODIFICATION_ERR' => array('5.0.0', ''),\n 'DOM_NAMESPACE_ERR' => array('5.0.0', ''),\n 'DOM_INVALID_ACCESS_ERR' => array('5.0.0', ''),\n 'DOM_VALIDATION_ERR' => array('5.0.0', ''),\n );\n $constants = array_merge(\n $constants,\n $version4\n );\n }\n if ((null == $version ) || ('5' == $version)) {\n $version5 = array(\n );\n $constants = array_merge(\n $constants,\n $version5\n );\n }\n\n return $constants;\n }", "public function defined_constant() {\n define( 'TS_VERSION', self::version );\n define( 'TS_FILE', __FILE__ );\n define( 'TS_PATH', __DIR__ );\n define( 'TS_URL', plugins_url( '', TS_FILE ) );\n define( 'TS_ASSETS', TS_URL .'/assets' );\n }", "public function getEnumValues()\n {\n return array(\n 'binary' => self::binary,\n 'pvp_replay' => self::pvp_replay,\n );\n }", "public function testgetConstantsFromExtension()\n {\n if (is_null($this->ref)) {\n return;\n }\n\n $const = get_defined_constants(true);\n\n foreach ($this->ref['extensions'] as $extname => $opt) {\n if (isset($const[$extname])) {\n // Test if each constants are in reference\n foreach ($const[$extname] as $constname => $value) {\n if (!in_array($constname, $this->ignoredconstants)) {\n $this->assertArrayHasKey(\n $constname,\n $this->ref['constants'],\n \"Defined constant '$constname' not known in Reference.\"\n );\n }\n }\n }\n }\n }", "public function getEnumValues()\n {\n return array(\n 'gold' => self::gold,\n 'diamond' => self::diamond,\n 'tbc_point' => self::tbc_point,\n 'ladder_point' => self::ladder_point,\n );\n }", "function renderConstantDetail() {\n\n reset($this->accessModifiers);\n while (list($k, $access) = each($this->accessModifiers)) {\n if (0 == count($this->constants[$access]))\n continue;\n\n reset($this->constants[$access]);\n while (list($name, $constant) = each($this->constants[$access])) {\n\n $tplvars = array();\n $tplvars[\"NAME\"] = $name;\n $tplvars[\"CASE\"] = $constant[\"case\"];\n $tplvars[\"VALUE\"] = htmlentities($constant[\"value\"]);\n\n if (\"true\" == $constant[\"undoc\"])\n $tplvars[\"UNDOC\"] = $this->undocumented;\n\n if (isset($constant[\"doc\"][\"shortdescription\"]))\n $tplvars[\"SHORTDESCRIPTION\"] = $this->encode($constant[\"doc\"][\"shortdescription\"][\"value\"]);\n\n if (isset($constant[\"doc\"][\"description\"]))\n $tplvars[\"DESCRIPTION\"] = $this->encode($constant[\"doc\"][\"description\"][\"value\"]);\n\n $this->renderCommonDocfields(\"constantdetails_\", $constant);\n\n $this->tpl->setCurrentBlock(\"constantdetails_loop\");\n $this->tpl->setVariable($tplvars);\n $this->tpl->parseCurrentBlock();\n }\n\n $this->tpl->setCurrentBlock(\"constantdetails\");\n $this->tpl->setVariable(\"ACCESS\", ucfirst($access));\n $this->tpl->parseCurrentBlock();\n } \n\n }", "public function getEnumValues()\n {\n return array(\n 'victory' => self::victory,\n 'defeat' => self::defeat,\n 'canceled' => self::canceled,\n 'timeout' => self::timeout,\n );\n }", "public static function getValuesName() {\n return self::$valuesName;\n }", "public function getEnumValues()\n {\n return array(\n 'LABEL_OPTIONAL' => self::LABEL_OPTIONAL,\n 'LABEL_REQUIRED' => self::LABEL_REQUIRED,\n 'LABEL_REPEATED' => self::LABEL_REPEATED,\n );\n }", "function load_constant($term) \n{\n\tglobal $dbf;\n\n\t$sql_slct_const = \"SELECT * FROM base_constant WHERE const_term='$term'\";\n\t$sql_cons = $dbf;\n\t$sql_cons->query($sql_slct_const);\n\t$sql_cons->next_record();\n\t\t\n\t$rows = $sql_cons->rowdata();\n\tif($term != $rows['const_term']) \n\t{\n\t\texit(\"Constant not exist! Please check load_constant() spelling!\");\n\t} else {\n\t $value = $rows['const_value']; \n\t return $value;\n\t}\n}" ]
[ "0.75234383", "0.74427027", "0.7387745", "0.73722714", "0.7337192", "0.7256395", "0.72533584", "0.72533584", "0.7228054", "0.70752835", "0.7065675", "0.7025528", "0.69367415", "0.688089", "0.6824038", "0.6821626", "0.6711163", "0.6710271", "0.6703593", "0.66571325", "0.6638525", "0.65875125", "0.6571618", "0.65665925", "0.64927346", "0.6471488", "0.64616585", "0.64197236", "0.6383413", "0.6383413", "0.6304374", "0.6263448", "0.6166197", "0.6166197", "0.6166197", "0.61495763", "0.6111501", "0.6106183", "0.60989", "0.60989", "0.60909927", "0.6068727", "0.6068627", "0.6058098", "0.60426396", "0.6033826", "0.5990227", "0.5985581", "0.5954377", "0.5949461", "0.594411", "0.5924984", "0.5916629", "0.5915753", "0.591438", "0.59061795", "0.59034383", "0.59016484", "0.58897156", "0.58687973", "0.58336836", "0.58255863", "0.5821847", "0.5796252", "0.5791685", "0.5790737", "0.57798207", "0.57728255", "0.57613236", "0.5723425", "0.57234156", "0.5722327", "0.57203543", "0.5713377", "0.57024807", "0.5700561", "0.5699325", "0.56853193", "0.5674698", "0.5673929", "0.5672447", "0.5654735", "0.565374", "0.56479317", "0.56343", "0.5622422", "0.56208944", "0.56084734", "0.5599729", "0.5596453", "0.5593467", "0.5590084", "0.55857545", "0.5569761", "0.5566832", "0.55658025", "0.5560763", "0.55571306", "0.5551844", "0.55276746" ]
0.56950474
77
script version / ex:set ts=4 sw=4: FormMail PHP script. This script requires PHP 4 or later. Copyright (c) 20012004 Root Software Pty Ltd. All rights reserved. Visit us at for updates and more information. If you use this FormMail, please support its development and other freeware products by putting the following link on your website: Visit for free FormMail and software. Author: Russell Robinson, 2nd October 2001 Last Modified: RR 12:32 Mon 19 January 2004 QVCS Version: $Revision: 1.20 $ Read This First ~~~~~~~~~~~~~~~ This script is very heavily documented! It looks daunting, but really isn't. If you have experience with PHP or other scripting languages, here's what you need to read: Features Configuration (TARGET_EMAIL) Creating Forms That's it! (Alternatively, just read the Quick Start section below). Quick Start ~~~~~~~~~~~ 1. Edit this file and set TARGET_EMAIL for your requirements (approx line 466 in this file replace "yourhost\.com" with your mail server's name) 2. Install this file as formmail.php on your web server 3. Create an HTML form and: specify a hidden field called "recipients" with the email address of the person to receive the form's results. post the form to formmail.php on your web server Purpose: ~~~~~~~~ To accept HTTP POST information from a form and mail it to recipients. This version can also supply data to a TectiteCRM document, usually for insertion into the CRM database. What does this PHP script do? ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ On your web site, you may have one or more HTML forms that accept information from people visiting your website. Your aim is for your website to email that information to you and/or add it to a database. formmail.php performs those functions. Features ~~~~~~~~ Optionally sends email of form results to recipients that can be specified in the form itself. Optionally stores the form results in a CSV (commaseparated values) file on your server. Optionally logs form activity. Optionally sends form results to a TectiteCRM document; generally, to automatically update the CRM database. Recipient email addresses can be mangled in your forms to protect them from spambots. Emails can be processed through any program (typically an encryption program) before sending. Successful processing can redirect the user to any URL. For example, for downloads, we redirect the user to the file they want to download. Supports any number of recipients. For security, recipient domains must be specified inside the script (see "Configuration" for details). Failed processing can redirect to a custom URL. Failed processing can be reported to a specific email address. Supports both GET and POST methods of form submission. Provides most of the features of other formmail scripts. Security ~~~~~~~~ Security is the primary concern in accepting data from your website visitors. formmail.php has several security features designed into it. Note, however, it requires configuration for your particular web site. Configuration ~~~~~~~~~~~~~ For instructions on configuring this program, go to the section titled "CONFIGURATION" (after reading the legal stuff below). There is only one mandatory setting: TARGET_EMAIL Creating Forms ~~~~~~~~~~~~~~ This section explains how to call formmail.php from your HTML forms. You already need to know how to create an HTML form, but this section will tell you how to link it with this formmail script. Your form communicates its requirements to formmail.php through a set of "hidden" fields (using ). The data to be processed by formmail (e.g. the actual email to send) comes from a combination of hidden fields and other form fields (i.e. data entry fields from the user). Here are the steps to use formmail.php with your HTML form: 1. Create your HTML form using standard HTML 2. Ensure your form has the following fields defined. These are fields you expect the user to fill in: emailthe user's email address realnamethe real name of the user 3. Add the following hidden fields to your form. Note that all are optional: recipientsa commaseparated list of email addresses that the form results will be sent to. These must be valid according to the "TARGET_EMAIL" configuration. Example:
function IsOldVersion() { $i_too_old = 3; // version 3 PHP is not usable here $a_modern = array(4,1,0); // versions prior to this are "old" - "4.1.0" $a_this_version = explode(".",phpversion()); if ((int) $a_this_version[0] <= $i_too_old) die("This script requires at least PHP version 4. Sorry."); $i_this_num = ($a_this_version[0] * 10000) + ($a_this_version[1] * 100) + $a_this_version[2]; $i_modern_num = ($a_modern[0] * 10000) + ($a_modern[1] * 100) + $a_modern[2]; return ($i_this_num < $i_modern_num); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Form_Mail()\n {\n /**\n * Form_Mail();\n */\n\n $this->referers_array = array($_SERVER[\"HTTP_HOST\"]);\n /**\n * Leave AS IS to only allow posting from same host that script resides on.\n * List individual hosts to create list of hosts that can post to this script:\n * EXAMPLE: $referer_array = array ('example.com','www.example.com','192.168.0.1');\n */\n\n /* proccess form */\n $this->set_arrays();\n $this->check_referer();\n $this->check_recipient();\n $this->check_required_fields();\n $this->send_form();\n $this->display_thankyou();\n }", "function setEmailForm(&$smartyEmailForm) {\n\t\t//Check if there is a valid email address in the database for the given combination of employee, service, position and organisation id\n\t\tif ($this->getEmailAddress($smartyEmailForm) || $this->piVars['mode'] == 'set_contact_form') {\n\t\t\tif($this->getEmailAddress($smartyEmailForm)){\n\t\t\t\t//Assign action url of email form with mode 'check_email_form'\n\t\t\t\t$smartyEmailForm->assign('action_url',htmlspecialchars($this->pi_linkTP_keepPIvars_url(array(mode => 'check_email_form'),0,0)));\n\t\t\t}else{\n\t\t\t\t//Assign action url of email form with mode 'check_contact_form'\n\t\t\t\t$smartyEmailForm->assign('action_url',htmlspecialchars($this->pi_linkTP_keepPIvars_url(array(mode => 'check_contact_form'),0,0)));\n\t\t\t}\n\n\t\t\t//Assign template labels\n\t\t\t$hoster_email=$this->get_hoster_email();\n\t\t\t$smartyEmailForm->assign('email_form_label',$this->pi_getLL('tx_civserv_pi1_email_form.email_form','E-Mail Form'));\n\t\t\t$smartyEmailForm->assign('contact_form_label',str_replace('###HOSTER###', $hoster_email, $this->pi_getLL('tx_civserv_pi1_email_form.contact_form','Contact '.$hoster_email)));\n\t\t\t$smartyEmailForm->assign('notice_label',$this->pi_getLL('tx_civserv_pi1_email_form.notice','Please enter your postal address oder email address, so that we can send you an answer'));\n\t\t\t$smartyEmailForm->assign('title_label', $this->pi_getLL('tx_civserv_pi1_email_form.title','Title'));\n\t\t\t$smartyEmailForm->assign('chose_option', $this->pi_getLL('tx_civserv_pi1_email_form.chose','Please chose'));\n\t\t\t$smartyEmailForm->assign('female_option', $this->pi_getLL('tx_civserv_pi1_email_form.female','Ms.'));\n\t\t\t$smartyEmailForm->assign('male_option', $this->pi_getLL('tx_civserv_pi1_email_form.male','Mr.'));\n\t\t\t$smartyEmailForm->assign('firstname_label',$this->pi_getLL('tx_civserv_pi1_email_form.firstname','Firstname'));\n\t\t\t$smartyEmailForm->assign('surname_label',$this->pi_getLL('tx_civserv_pi1_email_form.surname','Surname'));\n\t\t\t$smartyEmailForm->assign('street_label',$this->pi_getLL('tx_civserv_pi1_email_form.street','Street, Nr.'));\n\t\t\t$smartyEmailForm->assign('postcode_label',$this->pi_getLL('tx_civserv_pi1_email_form.postcode','Postcode'));\n\t\t\t$smartyEmailForm->assign('city_label',$this->pi_getLL('tx_civserv_pi1_email_form.city','City'));\n\t\t\t$smartyEmailForm->assign('email_label',$this->pi_getLL('tx_civserv_pi1_email_form.email','E-Mail'));\n\t\t\t$smartyEmailForm->assign('phone_label',$this->pi_getLL('tx_civserv_pi1_email_form.phone','Phone'));\n\t\t\t$smartyEmailForm->assign('fax_label',$this->pi_getLL('tx_civserv_pi1_email_form.fax','Fax'));\n\t\t\t$smartyEmailForm->assign('subject_label',$this->pi_getLL('tx_civserv_pi1_email_form.subject','Subject'));\n\t\t\t$smartyEmailForm->assign('bodytext_label',$this->pi_getLL('tx_civserv_pi1_email_form.bodytext','Your text'));\n\t\t\t$smartyEmailForm->assign('submit_label',$this->pi_getLL('tx_civserv_pi1_email_form.submit','Send e-mail'));\n\t\t\t$smartyEmailForm->assign('reset_label',$this->pi_getLL('tx_civserv_pi1_email_form.reset','Reset'));\n\t\t\t$smartyEmailForm->assign('required_label',$this->pi_getLL('tx_civserv_pi1_email_form.required','required'));\n\n\t\t\t//Set reset button type to reset functionality\n\t\t\t$smartyEmailForm->assign('button_type','reset');\n\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "function aform($setup,$subject,$to,$cc,$bcc,$from) {\n\t\t\n\t\tif (isset($_POST[\"Submit\"])) {\n\t\t\t\n\t\t\t// Compile all POST info\n\t\t\tforeach ($_POST as $key => $value) {\n\t\t\t\t$$key = $value;\t\t\t\t\t\t\t\t\n\t\t\t\tif ($key != \"require\" && $key != \"Submit\" && $key != \"verify\" && $key != \"birthday\") {\n\t\t\t\t\t$message .= \"<span style='text-transform: capitalize; font-weight: 700;'>\".$key.\"</span> \".$value.\"<br /><br />\";\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//If \"Verify\" is set, then check to see if correct\n\t\t\tif ($birthday != \"\") {\n\t\t\t\tif ($birthday != $verify) {\n\t\t\t\t\t$error .= \"Invalid Verification Code<br />\";\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// Check for \"required\" fields\n\t\t\tif ($require != \"\") {\n\t\t\t\t$dcheck = explode(\",\", $require);\n\t\t\t\t\n\t\t\t\twhile(list($check) = each($dcheck)) {\n\t\t\t\t\tif(!$$dcheck[$check]) {\n\t\t\t\t\t\t$error .= \"The <b>$dcheck[$check]</b> field is required.<br />\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// Check the Email Address\n\t\t\t$checkEmail = validEmail($_POST[\"email\"]);\n\t\t\tif ($checkEmail != \"1\") {\n\t\t\t\t$error .= \"Your email is not valid. Please correct.<br />\";\n\t\t\t}\n\t\t\t\n\t\t}\t\n\t\n\n\t\t/* Let's start by building the form */\n\t\t$form .= '\n\t\t<form method=\"post\" enctype=\"multipart/form-data\" class=\"form\">';\n\t\t$form .= \"\\n\";\n\t\t\t\t\t\t\t\t\n\t\t// let's loop the PIPES \"|\" and breakdown the UNDERSCORES \"_\" then use this data to build the form\n\t\t\t\t\t\n\t\t$formchunk = explode(\"|\", $setup);\n\t\t\t\t\t\n\t\tforeach ($formchunk as $key => $value) {\n\t\t\t$entrychunk = explode(\"_\", $value);\n\t\t\t$formalname = $entrychunk[0];\n\t\t\t$name = $entrychunk[1];\n\t\t\t$type = $entrychunk[2];\n\t\t\t\n\t\t\tif ($entrychunk[3] == \"required\") {\n\t\t\t\t$required = $entrychunk[3]; // this is an optional field for making it REQUIRED and may not be set\n\t\t\t\t$values = $entrychunk[4]; // this is an optional field for the VALUE and may not be set (most commonly used for \"select\" and \"radio\"\n\t\t\t} else {\n\t\t\t\t$values = $entrychunk[3]; // this is an optional field for the VALUE and may not be set (most commonly used for \"select\" and \"radio\"\n\t\t\t\t$required = $entrychunk[4]; // this is an optional field for making it REQUIRED and may not be set\n\t\t\t}\n\t\t\t\t\t\t\n\t\t\t$form .= '\t\t\t\t\t\t<div>\n\t\t\t<label>'.$formalname.'</label>';\n\t\t\t$form .= \"\\n\";\n\t\t\tif ($_POST[$name]) {\n\t\t\t\t$valueDisplay = $_POST[$name];\n\t\t\t} else {\n\t\t\t\t$valueDisplay = $values;\n\t\t\t}\n\t\t\t\n\t\t\tswitch ($type) {\n\t\t\t\tcase \"text\":\n\t\t\t\t\t$form .= '\t\t\t\t\t\t\t<input name=\"'.$name.'\" type=\"text\" class=\"text\" id=\"'.$name.'\" value=\"'.$valueDisplay.'\">';\n\t\t\t\t\t$form .= \"\\n\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"password\":\n\t\t\t\t\t$form .= '\t\t\t\t\t\t\t<input name=\"'.$name.'\" type=\"password\" class=\"text\" id=\"'.$name.'\" value=\"'.$valueDisplay.'\">';\n\t\t\t\t\t$form .= \"\\n\";\n\t\t\t\t\tbreak; \n\t\t\t\tcase \"radio\":\n\t\t\t\t\t$form .= '<div class=\"radios\">';\n\t\t\t\t\t$valuechunk = explode(\"-\", $values);\n\t\t\t\t\tforeach ($valuechunk as $keey => $subvalue) {\n\t\t\t\t\t\tif ($subvalue == $valueDisplay) { $active = \" checked\"; }\n\t\t\t\t\t\t$form .= '\t\t\t\t\t\t\t<input type=\"radio\" name=\"'.$name.'\" value=\"'.$subvalue.'\" class=\"text radio\"'.$active.'> '.$subvalue.'<br />';\n\t\t\t\t\t\t$form .= \"\\n\";\n\t\t\t\t\t\t$active = \"\";\n\t\t\t\t\t}\n\t\t\t\t\t$form .= \"</div>\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"checkbox\":\n\t\t\t\t\t$form .= '<div class=\"radios\">';\n\t\t\t\t\t$valuechunk = explode(\"-\", $values);\n\t\t\t\t\tforeach ($valuechunk as $keey => $subvalue) {\n\t\t\t\t\t\tif ($subvalue == $valueDisplay) { $active = \" checked\"; }\n\t\t\t\t\t\t$form .= '\t\t\t\t\t\t\t<input type=\"checkbox\" name=\"'.$name.'\" value=\"'.$subvalue.'\" class=\"text radio\"'.$active.'> '.$subvalue.'<br />';\n\t\t\t\t\t\t$form .= \"\\n\";\n\t\t\t\t\t\t$active = \"\";\n\t\t\t\t\t}\n\t\t\t\t\t$form .= \"</div>\";\n\t\t\t\t\tbreak;\t\t\t\t\t\n\t\t\t\tcase \"select\":\n\t\t\t\t\t$form .= '\t\t\t\t\t\t\t<select name=\"'.$name.'\" class=\"text select\">';\n\t\t\t\t\t$form .= \"\\n\";\n\t\t\t\t\t$form .= '\t\t\t\t\t\t\t\t<option value=\"\"></option>';\n\t\t\t\t\t$form .= \"\\n\";\n\t\t\t\t\t$valuechunk = explode(\"-\", $values);\n\t\t\t\t\tforeach ($valuechunk as $keey => $subvalue) {\n\t\t\t\t\t\tif ($subvalue == $valueDisplay) { $active = \" selected\"; }\n\t\t\t\t\t\t$form .= '\t\t\t\t\t\t\t\t<option value=\"'.$subvalue.'\"'.$active.'>'.$subvalue.'</option>';\n\t\t\t\t\t\t$form .= \"\\n\";\n\t\t\t\t\t\t$active = \"\";\n\t\t\t\t\t}\n\t\t\t\t\t$form .= '\t\t\t\t\t\t\t</select>';\n\t\t\t\t\t$form .= \"\\n\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"textarea\":\n\t\t\t\t\t$form .= '\t\t\t\t\t\t\t<textarea name=\"'.$name.'\" class=\"text textarea\" id=\"'.$name.'\">'.$valueDisplay.'</textarea>';\n\t\t\t\t\t$form .= \"\\n\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"file\":\n\t\t\t\t\t$form .= '\t\t\t\t\t\t\t<input name=\"file\" class=\"text\" id=\"'.$name.'\" type=\"file\" />';\n\t\t\t\t\t$form .= \"\\n\";\n\t\t\t\t\tbreak;\t\n\t\t\t\tcase \"verify\":\n\t\t\t\t\t$verification = rand(1111, 9999);\n\t\t\t\t\t$form .= '\t\t\t\t\t\t\t<input type=\"hidden\" value=\"'.$verification.'\" name=\"birthday\" />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<span class=\"verifytext\">'.$verification.'</span>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<input type=\"text\" value=\"\" name=\"verify\" class=\"text verify\" />';\n\t\t\t\t\t$form .= \"\\n\";\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\t\t\n\t\t\t$form .= '\t\t \t\t\t\t\t<div class=\"clear\"></div>';\n\t\t\t$form .= \"\\n\";\n\t\t\t$form .= '\t\t\t\t\t\t</div>';\n\t\t\t$form .= \"\\n\";\n\t\t\t$form .= \"\\n\";\n\t\t\t\t\n\t\t\tif ($required != \"\") {\n\t\t\t\t$requireding = $name;\n\t\t\t\tif ($req != \"\") {\n\t\t\t\t\t$req .= ','.$requireding;\n\t\t\t\t} else {\n\t\t\t\t\t$req .= $requireding;\n\t\t\t\t}\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t}\n\t\t\t\t\t\t\n\t\t}\n\t\t\t\t\t\n\t\t$form .= '\n\t\t<div>\n\t\t\t<label><input type=\"hidden\" name=\"require\" value=\"'.$req.'\" />&nbsp;</label>\n\t\t\t<input type=\"submit\" name=\"Submit\" value=\"Submit\" class=\"submit\">\n\t\t\t<div class=\"clear\"></div>\n\t\t</div>\n\t\t</form>';\n\n\t\t\n\t\tif (isset($_POST[\"Submit\"])) {\n\n\n\t\t\tif ($_FILES['file']['tmp_name'] != \"\") {\n\n\t\t\t\t/* Attachment */\n\t\t\t\t$uploadto = $GLOBALS[\"uploadfolder\"];\n\t\t\t\t$docroot = $GLOBALS[\"documentroot\"];\n\t\t\t\t\n\t\t\t\t// Check Entension\n\t\t\t\t$extension = pathinfo($_FILES['file']['name']);\n\t\t\t\t$extension = $extension[extension];\n\t\t\t\t$allowed_paths = explode(\", \", $GLOBALS[\"allowed_ext\"]);\t\t\t\t\t\t\n\t\t\t\tfor($i = 0; $i < count($allowed_paths); $i++) {\n\t\t\t\t\tif ($allowed_paths[$i] == \"$extension\") {\n\t\t\t\t\t\t$ok = \"1\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t// Check File Size\n\t\t\t\tif ($ok == \"1\") {\n\t\t\t\t\tif($_FILES['file']['size'] > $GLOBALS[\"max_size\"]) {\n\t\t\t\t\t\t$error .= \"File size is too big!<br />\";\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$ok = \"2\";\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\n\t\t\tif($error != \"\") {\n\t\t\t\t$fullmessage .= \"<p>\".$error.\"</p>\";\n\t\t\t\t$fullmessage .= $form;\n\t\t\t\treturn $fullmessage;\n\t\t\t} else { \n\t\t\t\t//success!\n\t\t\t\t\n\t\t\t\tif ($_FILES['file']['tmp_name'] == \"\") {\n\t\t\t\t\t/* No Attachment */\n\t\t\t\t\t$send_to = $to;\n\t\t\t\t\t$send_cc = $cc;\n\t\t\t\t\t$send_bcc = $bcc;\n\t\t\t\t\t$send_from = $from;\n\t\t\t\t\t$send_subject = $subject;\n\t\t\t\t\t$message .= \"IP Address: \".$_SERVER['REMOTE_ADDR']; \n\t\t\t\t\tamail($send_to,$send_cc,$send_bcc,$send_from,$send_subject,$message);\t\n\t\t\t\t\treturn \"<p>\".$GLOBALS[\"success\"].\"</p>\";\n\t\t\t\t} else {\n\t\t\t\t\t\t\n\t\t\t\t\tif ($ok == \"2\") {\n\t\t\t\t\t\t@move_uploaded_file($_FILES['file']['tmp_name'], $uploadto.$_FILES['file']['name']);\n\t\t\t\t\t\t// how to use\n\t\t\t\t\t\t$my_file = $_FILES['file']['name'];\n\t\t\t\t\t\t$my_path = $doc.$uploadto;\n\t\t\t\t\t\t$my_name = $from;\n\t\t\t\t\t\t$my_mail = $from;\n\t\t\t\t\t\t$send_cc = $cc;\n\t\t\t\t\t\t$send_bcc = $bcc;\n\t\t\t\t\t\t$my_replyto = $from;\n\t\t\t\t\t\t$my_to = $to;\n\t\t\t\t\t\t$my_subject = $subject;\n\t\t\t\t\t\t$message .= \" IP Address: \".$_SERVER['REMOTE_ADDR'];\n\t\t\t\t\t\tmail_attachment($my_file, $my_path, $my_to, $my_mail, $my_name, $my_replyto, $my_subject, $message, $cc, $bcc);\t\t\t\t\t\t\t\n\t\t\t\t\t\treturn \"<p>\".$GLOBALS[\"success\"].\"</p>\";\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\n\t\t} else {\n\t\t\treturn $form;\n\t\t}\n\t}", "function student_crm_webform_send_email_form() {\n $case = menu_get_object('crm_case', 2);\n \n $fields = field_info_instances();\n $fields = $fields['crm_case'][$case->type];\n $form_fields = array();\n $field_settings = array();\n if(!$fields) {\n return null;\n }\n foreach ($fields as $field_name => $field) {\n if ($field['settings']['webform']) {\n $form_fields[$field_name] = $field['label'];\n $field_settings[$field_name] = $field['settings']['email_address'];\n }\n }\n if (!count($form_fields)) {\n \n return array('message' => array('#markup' => \n '<div class=\"empty\">' . t('No forms for this item') . '</div>'));\n }\n drupal_add_js(drupal_get_path('module', 'student_crm_webform') . '/js/student_crm_webform.send_form.js');\n drupal_add_js(array('studentCRMWebformSettings' => $field_settings), 'setting');\n $form = array();\n \n $form['case'] = array(\n '#type' => 'hidden',\n '#value' => $case->cid,\n );\n \n $form['field'] = array(\n '#type' => 'select',\n '#title' => 'Select the type of form to send',\n '#options' => $form_fields,\n );\n \n $form['manual-email'] = array(\n '#type' => 'textfield',\n '#title' => 'Email address',\n );\n \n $form['submit'] = array(\n '#type' => 'submit',\n '#value' => 'Send form',\n );\n \n return $form;\n}", "FUNCTION SEND_EMAIL($recipient, $subject, $MailMessage) {\r\n\t\t\r\n\t\t\t\t\t\r\n\t\t\r\n\t\t$host \t\t= $_SERVER[\"E_HOST\"];\r\n\t\t$username \t= $_SERVER[\"CUSTOMER_SERVICE_USERNAME\"] ;//$fromArray[\"USERNAME\"];\r\n\t\t$password \t= $_SERVER[\"CUSTOMER_SERVICE_PASSWORD\"];//$fromArray[\"PASSWORD\"];\r\n $sender = $_SERVER[\"CUSTOMER_SERVICE_EMAIL\"];//$fromArray[\"EMAIL\"]; \r\n \r\n\t\t$html = $_SERVER[\"HTML_HEADER\"] . $MailMessage . $_SERVER[\"EMAIL_SIGNATURE\"] . $_SERVER[\"HTML_FOOTER\"];\r\n $text = strip_tags($MailMessage); // Text version of the email\r\n\r\n $crlf = \"\\n\";\r\n $headers = array(\r\n 'From' => $sender,\r\n 'Return-Path' => $sender,\r\n 'Subject' => $subject,\r\n 'To' => $recipient\r\n );\r\n \r\n // Creating the Mime message\r\n $mime = new Mail_mime($crlf);\r\n \r\n // Setting the body of the email\r\n $mime->setTXTBody($text);\r\n $mime->setHTMLBody($html);\r\n \r\n // Add an attachment\r\n // $file = \"Hello World!\";\r\n // $file_name = \"Hello text.txt\";\r\n // $content_type = \"text/plain\";\r\n // $mime->addAttachment ($file, $content_type, $file_name, 0);\r\n \r\n // Set body and headers ready for base mail class \r\n $body = $mime->get();\r\n $headers = $mime->headers($headers);\r\n \r\n // SMTP authentication params\r\n $smtp_params[\"host\"] = $host;\r\n $smtp_params[\"port\"] = \"25\";\r\n $smtp_params[\"auth\"] = true;\r\n $smtp_params[\"username\"] = $username;\r\n $smtp_params[\"password\"] = $password;\r\n \r\n // Sending the email using smtp\r\n $mail =& Mail::factory(\"smtp\", $smtp_params); \r\n $result = $mail->send($recipient, $headers, $body);\t\t\r\n\t\t\t\r\n\t\tsleep(2);\r\n\t}", "function student_crm_webform_send_email_form_submit($form, $form_state) {\n $case = crm_case_load($form_state['values']['case']);\n $email_addresses = student_crm_webform_send_email('crm_case', $case, $form_state['values']['field'], $form_state['values']['manual-email']);\n \n $case = crm_case_load($form_state['values']['case']);\n $fields = field_info_instances();\n $field = $fields['crm_case'][$case->type][$form_state['values']['field']];\n\n drupal_set_message(t('The form %form has been sent to: !email-addresses', array('%form' => $field['label'], '!email-addresses' => theme('item_list', array('items' => $email_addresses)))));\n}", "function viaggio_deliver_mail() {\n\tif ( isset( $_POST['cf-submitted'] ) ) {\n\n\t\t// sanitize form values\n\t\t$name = sanitize_text_field( $_POST[\"cf-name\"] );\n\t\t$email = sanitize_email( $_POST[\"cf-email\"] );\n\t\t$subject = sanitize_text_field( $_POST[\"cf-subject\"] );\n\t\t$message = esc_textarea( $_POST[\"cf-message\"] );\n\n\t\t// get the blog administrator's email address\n\t\t$to = get_option( 'admin_email' );\n\n\t\t$headers = \"From: $name <$email>\" . \"\\r\\n\";\n\n\t\t// If email has been process for sending, display a success message\n\t\tif ( wp_mail( $to, $subject, $message, $headers ) ) {\n\t\t\techo '<div>';\n\t\t\techo '<p>'.esc_html__('Thanks for contacting me, expect a response soon.' , 'viaggio').'</p>';\n\t\t\techo '</div>';\n\t\t} else {\n\t\t\techo esc_html__('An unexpected error occurred.' , 'viaggio');\n\t\t}\n\t}\n}", "function bab_pm_formsend()\n{\n $bab_pm_PrefsTable = safe_pfx('bab_pm_list_prefs');\n $bab_pm_SubscribersTable = safe_pfx('bab_pm_subscribers');\n\n $bab_pm_radio = ps('bab_pm_radio'); // this is whether to mail or not, or test\n\n if ($bab_pm_radio == 'Send to Test') {\n $bab_pm_radio = 2;\n }\n\n if ($bab_pm_radio == 'Send to List') {\n $bab_pm_radio = 1;\n }\n\n if ($bab_pm_radio != 0) { // if we have a request to send, start the ball rolling....\n // email from override\n $sendFrom = gps('sendFrom');\n\n $listToEmail = (!empty($_REQUEST['listToEmail'])) ? gps('listToEmail') : gps('list');\n // $listToEmail = gps('listToEmail'); // this is the list name\n $subject = gps('subjectLine');\n $form = gps('override_form');\n\n // ---- scrub the flag column for next time:\n $result = safe_query(\"UPDATE $bab_pm_SubscribersTable SET flag = NULL\");\n\n //time to fire off initialize\n // bab_pm_initialize_mail();\n $path = \"?event=postmaster&step=initialize_mail&radio=$bab_pm_radio&list=$listToEmail&artID=$artID\";\n\n if (!empty($sendFrom)) {\n $path .= \"&sendFrom=\" . urlencode($sendFrom);\n }\n\n if (!empty($subject)) {\n $path .= \"&subjectLine=\" . urlencode($subject);\n }\n\n if ($_POST['use_override'] && !empty($form)) {\n $path .= \"&override_form=$form&use_override=1\";\n }\n\n header(\"HTTP/1.x 301 Moved Permanently\");\n header(\"Status: 301\");\n header(\"Location: \".$path);\n header(\"Connection: close\");\n }\n\n $options = '';\n $form_select = '';\n\n // get available lists to create dropdown menu\n $bab_pm_lists = safe_query(\"select * from $bab_pm_PrefsTable\");\n\n while ($row = @mysqli_fetch_row($bab_pm_lists)) {\n $options .= \"<option>$row[1]</option>\";\n }\n\n $selection = '<select id=\"listToEmail\" name=\"listToEmail\">' . $options . '</select>';\n\n $form_list = safe_column('name', 'txp_form',\"name like 'newsletter-%'\");\n\n if (count($form_list) > 0) {\n foreach ($form_list as $form_item) {\n $form_options[] = \"<option>$form_item</option>\";\n }\n\n $form_select = '<select name=\"override_form\">' . join($form_options,\"\\n\") . '</select>';\n $form_select .= checkbox('use_override', '1', '').'Use override?';\n }\n\n if (isset($form_select) && !empty($form_select)) {\n $form_select = <<<END\n <div style=\"margin-top:5px\">\n Override form [optional]: $form_select\n </div>\nEND;\n }\n echo <<<END\n<form action=\"\" method=\"post\" accept-charset=\"utf-8\">\n <fieldset id=\"bab_pm_formsend\">\n <legend><span class=\"bab_pm_underhed\">Form-based Send</span></legend>\n <div style=\"margin-top:5px\">\n <label for=\"listToEmail\" class=\"listToEmail\">Select list:</label> $selection\n </div>\n $form_select\n <label for=\"sendFrom\" class=\"sendFrom\">Send From:</label><input type=\"text\" name=\"sendFrom\" value=\"\" id=\"sendFrom\" /><br />\n <label for=\"subjectLine\" class=\"subjectLine\">Subject Line:</label><input type=\"text\" name=\"subjectLine\" value=\"\" id=\"subjectLine\" /><br />\n\n <p><input type=\"submit\" name=\"bab_pm_radio\" value=\"Send to Test\" class=\"publish\" />\n &nbsp;&nbsp;\n <input type=\"submit\" name=\"bab_pm_radio\" value=\"Send to List\" class=\"publish\" /></p>\n </fieldset>\n</form>\nEND;\n}", "function set_post_content($entry, $form){\r\n\t //Custom Form Submitted via PHP will go here\r\n\t // Get the IDs of the relevant fields and prepare an email message\r\n\t $message = print_r($entry, true);\r\n\t \r\n\t // Wrap test if any lines are larger than 70 characters\r\n\t $message = wordwrap($message, 70);\r\n\t \r\n\t// Send me an email for debugging\r\n\t// mail('[email protected]', 'Getting the Gravity Form Field IDs', $message);\r\n \r\n\t// Post the form to a specific URL to the desired CRM, in this case DebtPayPro\r\n\tfunction post_to_url($url, $data) {\r\n\t\t$fields = '';\r\n\t\tforeach($data as $key => $value) {\r\n\t\t\t$fields .= $key . '=' . $value . '&';\r\n\t\t}\r\n \r\n\t\trtrim($fields, '&');\r\n\t\t$post = curl_init();\r\n \r\n\t\t curl_setopt($post, CURLOPT_URL, $url);\r\n\t\t curl_setopt($post, CURLOPT_POST, count($data));\r\n\t\t curl_setopt($post, CURLOPT_POSTFIELDS, $fields);\r\n\t\t curl_setopt($post, CURLOPT_RETURNTRANSFER, 1);\r\n\t\t $result = curl_exec($post);\r\n\t\t curl_close($post);\r\n\t}\r\n\t\r\n\t// Handle the form differently based on form ID\r\n\tif($form[\"id\"] == 1) { //FORM 1\r\n\t\tif (($entry[\"6\"]) == 'Private') {\r\n\t\t\t$data = array(\r\n\t\t\t\t\"loan_amount\"\t\t=>\t$entry[\"7\"],\r\n\t\t\t\t\"loan_status_f\"\t\t=>\t$entry[\"4\"],\r\n\t\t\t\t\"loan_type\"\t\t\t=>\t$entry[\"6\"],\r\n\t\t\t\t\"first_name\" \t\t=> \t$entry[\"1.3\"],\r\n\t\t\t\t\"last_name\" \t\t=> \t$entry[\"1.6\"],\r\n\t\t\t\t\"phone\" \t\t\t=> \t$entry[\"2\"],\r\n\t\t\t\t\"email\" \t\t\t=>\t$entry[\"3\"],\r\n\t\t\t\t\"lead_source\" \t\t=> \t\"Campaign 1.1\"\r\n\t\t\t);\r\npost_to_url(\"<ENTER POST URL HERE>\", $data);\r\n\t\t} else {\r\n\t\t\t$data = array(\r\n\t\t\t\t\"loan_amount\"\t\t=>\t$entry[\"7\"],\r\n\t\t\t\t\"loan_status_f\"\t\t=>\t$entry[\"4\"],\r\n\t\t\t\t\"loan_type\"\t\t\t=>\t$entry[\"6\"],\r\n\t\t\t\t\"first_name\" \t\t=> \t$entry[\"1.3\"],\r\n\t\t\t\t\"last_name\" \t\t=> \t$entry[\"1.6\"],\r\n\t\t\t\t\"phone\" \t\t\t=> \t$entry[\"2\"],\r\n\t\t\t\t\"email\" \t\t\t=>\t$entry[\"3\"],\r\n\t\t\t\t\"lead_source\" \t\t=> \t\"Campaign 1.2\"\r\n\t\t\t);\r\n\tpost_to_url(\"<ENTER POST URL HERE>\", $data);\r\n\t\t}\r\n\t\r\n\t\r\n\t\r\n\t} elseif($form[\"id\"] == 2) { //FORM 2 \r\n\t\tif (($entry[\"6\"]) == 'Private') {\r\n\t\t\t$data = array(\r\n\t\t\t\t\"loan_amount\"\t\t=>\t$entry[\"7\"],\r\n\t\t\t\t\"loan_status_f\"\t\t=>\t$entry[\"4\"],\r\n\t\t\t\t\"loan_type\"\t\t\t=>\t$entry[\"6\"],\r\n\t\t\t\t\"first_name\" \t\t=> \t$entry[\"1.3\"],\r\n\t\t\t\t\"last_name\" \t\t=> \t$entry[\"1.6\"],\r\n\t\t\t\t\"phone\" \t\t\t=> \t$entry[\"2\"],\r\n\t\t\t\t\"email\" \t\t\t=>\t$entry[\"3\"],\r\n\t\t\t\t\"lead_source\" \t\t=> \t\"Campaign 2.1\"\r\n\t\t\t);\r\npost_to_url(\"<ENTER POST URL HERE>\", $data);\r\n\t\t} else {\r\n\t\t\t$data = array(\r\n\t\t\t\t\"loan_amount\"\t\t=>\t$entry[\"7\"],\r\n\t\t\t\t\"loan_status_f\"\t\t=>\t$entry[\"4\"],\r\n\t\t\t\t\"loan_type\"\t\t=>\t$entry[\"6\"],\r\n\t\t\t\t\"first_name\" \t\t=> \t$entry[\"1.3\"],\r\n\t\t\t\t\"last_name\" \t\t=> \t$entry[\"1.6\"],\r\n\t\t\t\t\"phone\" \t\t=> \t$entry[\"2\"],\r\n\t\t\t\t\"email\" \t\t=>\t$entry[\"3\"],\r\n\t\t\t\t\"lead_source\" \t\t=> \t\"Campaign 2.2\"\r\n\t\t\t);\r\npost_to_url(\"<ENTER POST URL HERE>\", $data);\r\n\t\t}\r\n\t\r\n\t\t\r\n}elseif($form[\"id\"] == 3) { //FORM 3\r\n\t\tif (($entry[\"6\"]) == 'Private') {\r\n\t\t\t$data = array(\r\n\t\t\t\t\"loan_amount\"\t\t=>\t$entry[\"7\"],\r\n\t\t\t\t\"loan_status_f\"\t\t=>\t$entry[\"4\"],\r\n\t\t\t\t\"loan_type\"\t\t=>\t$entry[\"6\"],\r\n\t\t\t\t\"first_name\" \t\t=> \t$entry[\"1.3\"],\r\n\t\t\t\t\"last_name\" \t\t=> \t$entry[\"1.6\"],\r\n\t\t\t\t\"phone\" \t\t=> \t$entry[\"2\"],\r\n\t\t\t\t\"email\" \t\t=>\t$entry[\"3\"],\r\n\t\t\t\t\"lead_source\" \t\t=> \t\"Campaign 3.1\"\r\n\t\t\t);\r\npost_to_url(\"<ENTER POST URL HERE>\", $data);\r\n\t\t} else {\r\n\t\t\t$data = array(\r\n\t\t\t\t\"loan_amount\"\t\t=>\t$entry[\"7\"],\r\n\t\t\t\t\"loan_status_f\"\t\t=>\t$entry[\"4\"],\r\n\t\t\t\t\"loan_type\"\t\t=>\t$entry[\"6\"],\r\n\t\t\t\t\"first_name\" \t\t=> \t$entry[\"1.3\"],\r\n\t\t\t\t\"last_name\" \t\t=> \t$entry[\"1.6\"],\r\n\t\t\t\t\"phone\" \t\t=> \t$entry[\"2\"],\r\n\t\t\t\t\"email\" \t\t=>\t$entry[\"3\"],\r\n\t\t\t\t\"lead_source\" \t\t=> \t\"Campaign 3.2\"\r\n\t\t\t);\r\npost_to_url(\"<ENTER POST URL HERE>\", $data);\r\n\t\t}\r\n\t\t}\r\n else { //Do nothing since there are no other forms\r\n}\r\n}", "function sendmail()\n\t{\n\t\tglobal $mainframe, $Itemid;\n\n\t\t/*\n\t\t * Initialize some variables\n\t\t */\n\t\t$db = & $mainframe->getDBO();\n\n\t\t$SiteName \t= $mainframe->getCfg('sitename');\n\t\t$MailFrom \t= $mainframe->getCfg('mailfrom');\n\t\t$FromName \t= $mainframe->getCfg('fromname');\n\t\t$validate \t= mosHash( $mainframe->getCfg('db') );\n\n\t\t$default \t= sprintf(JText::_('MAILENQUIRY'), $SiteName);\n\t\t$option \t= JRequest::getVar('option');\n\t\t$contactId \t= JRequest::getVar('con_id');\n\t\t$validate \t= JRequest::getVar($validate, \t\t0, \t\t\t'post');\n\t\t$email \t\t= JRequest::getVar('email', \t\t'', \t\t'post');\n\t\t$text \t\t= JRequest::getVar('text', \t\t\t'', \t\t'post');\n\t\t$name \t\t= JRequest::getVar('name', \t\t\t'', \t\t'post');\n\t\t$subject \t= JRequest::getVar('subject', \t\t$default, \t'post');\n\t\t$emailCopy \t= JRequest::getVar('email_copy', \t0, \t\t\t'post');\n\n\t\t// probably a spoofing attack\n\t\tif (!$validate) {\n\t\t\tmosErrorAlert( _NOT_AUTH );\n\t\t}\n\n\t\t/*\n\t\t * This obviously won't catch all attempts, but it does not hurt to make\n\t\t * sure the request came from a client with a user agent string.\n\t\t */\n\t\tif (!isset ($_SERVER['HTTP_USER_AGENT'])) {\n\t\t\tmosErrorAlert( _NOT_AUTH );\n\t\t}\n\n\t\t/*\n\t\t * This obviously won't catch all attempts either, but we ought to check\n\t\t * to make sure that the request was posted as well.\n\t\t */\n\t\tif (!$_SERVER['REQUEST_METHOD'] == 'POST') {\n\t\t\tmosErrorAlert( _NOT_AUTH );\n\t\t}\n\n\t\t// An array of e-mail headers we do not want to allow as input\n\t\t$headers = array ('Content-Type:',\n\t\t\t\t\t\t 'MIME-Version:',\n\t\t\t\t\t\t 'Content-Transfer-Encoding:',\n\t\t\t\t\t\t 'bcc:',\n\t\t\t\t\t\t 'cc:');\n\n\t\t// An array of the input fields to scan for injected headers\n\t\t$fields = array ('email',\n\t\t\t\t\t\t 'text',\n\t\t\t\t\t\t 'name',\n\t\t\t\t\t\t 'subject',\n\t\t\t\t\t\t 'email_copy');\n\n\t\t/*\n\t\t * Here is the meat and potatoes of the header injection test. We\n\t\t * iterate over the array of form input and check for header strings.\n\t\t * If we fine one, send an unauthorized header and die.\n\t\t */\n\t\tforeach ($fields as $field) {\n\t\t\tforeach ($headers as $header) {\n\t\t\t\tif (strpos($_POST[$field], $header) !== false) {\n\t\t\t\t\tmosErrorAlert( _NOT_AUTH );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/*\n\t\t * Now that we have passed the header injection tests lets free up the\n\t\t * used memory and continue.\n\t\t */\n\t\tunset ($fields, $field, $headers, $header);\n\n\t\t/*\n\t\t * Load the contact details\n\t\t */\n\t\t$contact = new JTableContact($db);\n\t\t$contact->load($contactId);\n\n\t\t/*\n\t\t * If there is no valid email address or message body then we throw an\n\t\t * error and return false.\n\t\t */\n\t\tjimport('joomla.utilities.mail');\n\t\tif (!$email || !$text || (JMailHelper::isEmailAddress($email) == false)) {\n\t\t\tJContactView::emailError();\n\t\t} else {\n\t\t\t$menu = JTable::getInstance( 'menu', $db );\n\t\t\t$menu->load( $Itemid );\n\t\t\t$mparams = new JParameter( $menu->params );\n\t\t\t$bannedEmail \t= $mparams->get( 'bannedEmail', \t'' );\n\t\t\t$bannedSubject \t= $mparams->get( 'bannedSubject', \t'' );\n\t\t\t$bannedText \t= $mparams->get( 'bannedText', \t\t'' );\n\t\t\t$sessionCheck \t= $mparams->get( 'sessionCheck', \t1 );\n\n\t\t\t// check for session cookie\n\t\t\tif ( $sessionCheck ) {\n\t\t\t\tif ( !isset($_COOKIE[JSession::name()]) ) {\n\t\t\t\t\tmosErrorAlert( _NOT_AUTH );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Prevent form submission if one of the banned text is discovered in the email field\n\t\t\tif ( $bannedEmail ) {\n\t\t\t\t$bannedEmail = explode( ';', $bannedEmail );\n\t\t\t\tforeach ($bannedEmail as $value) {\n\t\t\t\t\tif ( JString::stristr($email, $value) ) {\n\t\t\t\t\t\tmosErrorAlert( _NOT_AUTH );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Prevent form submission if one of the banned text is discovered in the subject field\n\t\t\tif ( $bannedSubject ) {\n\t\t\t\t$bannedSubject = explode( ';', $bannedSubject );\n\t\t\t\tforeach ($bannedSubject as $value) {\n\t\t\t\t\tif ( JString::stristr($subject, $value) ) {\n\t\t\t\t\t\tmosErrorAlert( _NOT_AUTH );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Prevent form submission if one of the banned text is discovered in the text field\n\t\t\tif ( $bannedText ) {\n\t\t\t\t$bannedText = explode( ';', $bannedText );\n\t\t\t\tforeach ($bannedText as $value) {\n\t\t\t\t\tif ( JString::stristr($text, $value) ) {\n\t\t\t\t\t\tmosErrorAlert( _NOT_AUTH );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// test to ensure that only one email address is entered\n\t\t\t$check = explode( '@', $email );\n\t\t\tif ( strpos( $email, ';' ) || strpos( $email, ',' ) || strpos( $email, ' ' ) || count( $check ) > 2 ) {\n\t\t\t\tmosErrorAlert( JText::_( 'You cannot enter more than one email address', true ) );\n\t\t\t}\n\n\t\t\t/*\n\t\t\t * Prepare email body\n\t\t\t */\n\t\t\t$prefix = sprintf(JText::_('ENQUIRY_TEXT'), $mainframe->getBaseURL());\n\t\t\t$text \t= $prefix.\"\\n\".$name.' <'.$email.'>'.\"\\r\\n\\r\\n\".stripslashes($text);\n\n\t\t\t// Send mail\n\t\t\tjosMail($email, $name, $contact->email_to, $FromName.': '.$subject, $text);\n\n\t\t\t/*\n\t\t\t * If we are supposed to copy the admin, do so.\n\t\t\t */\n\t\t\t// parameter check\n\t\t\t$menuParams \t\t= new JParameter( $contact->params );\n\t\t\t$emailcopyCheck = $menuParams->get( 'email_copy', 0 );\n\n\t\t\t// check whether email copy function activated\n\t\t\tif ( $emailCopy && $emailcopyCheck ) {\n\t\t\t\t$copyText \t\t= sprintf(JText::_('Copy of:'), $contact->name, $SiteName);\n\t\t\t\t$copyText \t\t.= \"\\r\\n\\r\\n\".$text;\n\t\t\t\t$copySubject \t= JText::_('Copy of:').\" \".$subject;\n\t\t\t\tjosMail($MailFrom, $FromName, $email, $copySubject, $copyText);\n\t\t\t}\n\n\t\t\t$link = sefRelToAbs( 'index.php?option=com_contact&task=view&contact_id='. $contactId .'&Itemid='. $Itemid );\n\t\t\t$text = JText::_( 'Thank you for your e-mail', true );\n\n\t\t\tjosRedirect( $link, $text );\n\t\t}\n\t}", "function Email_Proforma($Src,$SrcId,$to,$mescat,$subject,$helper='',$helperdata=0,$logfile='',&$attachments=0,$embeded=0,$from='') {\n global $PLANYEAR,$YEARDATA,$FESTSYS;\n if (strlen($mescat) < 30) {\n $Prof = Get_Email_Proforma($mescat);\n $Mess = ($Prof? $Prof['Body'] : \"Unknown message $mescat \");\n } else {\n $Mess = $mescat;\n }\n Parse_Proforma($Mess,$helper,$helperdata,0,$attachments,$embeded);\n \n NewSendEmail($Src,$SrcId,$to,$subject,$Mess,$attachments,$embeded,$from);\n \n if ($logfile) {\n $logf = fopen(\"LogFiles/$logfile.txt\",\"a\");\n fwrite($logf,\"\\n\\nEmail to : \" . Pretty_Print_To($to) . \"Subject:$subject\\n\");\n if ($from) fwrite($logf,\"From: \" . Pretty_Print_To($from));\n fwrite($logf,\"\\n\\n$Mess\");\n\n if ($attachments) {\n if (is_array($attachments)) {\n foreach ($attachments as $i=>$att) fwrite($logf,\" With attachment: \" . $att[0] . \" as \" . $att[1] . \"\\n\\n\");\n } else {\n fwrite($logf,\" With attachment $attachments\\n\\n\"); \n }\n }\n if ($embeded) {\n if (is_array($embeded)) {\n foreach ($embeded as $i=>$att) fwrite($logf,\" With embeded: \" . $att[0] . \" as \" . $att[1] . \"\\n\\n\");\n } else {\n fwrite($logf,\" With embeded $embeded\\n\\n\"); \n }\n }\n\n fclose($logf);\n }\n return $Mess;\n}", "function event_formprocessing($formvariables) {\r\r\n\tglobal $glbl_companyname, $glbl_sendformsfromemailaddress, $glbl_sendformstoemailaddress,\r\r\n\t $glbl_physicalwebrootlocation;\r\r\n\t$outputtype = 'simple';\r\r\n\t// Security validation 'ctcd'\r\r\n\tif (!pingToken($formvariables['citycode']))\r\r\n\t\treturn '// invalid: press the browser [back] button;';\r\r\n\t// When using a custom template for output\r\r\n\tif (isset($formvariables['emailtemplate'])){\r\r\n\t\t$loc = $glbl_physicalwebrootlocation . $formvariables['emailtemplate'];\r\r\n\t\tif (file_exists($loc)){ \r\r\n\t\t\t$file = fopen($loc, 'r'); // Read template page\r\r\n\t\t\t$formstring = fread($file, filesize($loc));\r\r\n\t\t\tfclose($file);\r\r\n\t\t\tif (trim($formstring) != '')\r\r\n\t\t\t\t$outputtype = 'custom';\r\r\n\t\t}\r\r\n\t}\r\r\n\t// When using simple output\r\r\n\tif ($outputtype == 'simple')\r\r\n\t\t$formstring = 'A form was submitted for: ' . $glbl_companyname . '<br><br>';\r\r\n\t// Loop over form variables\r\r\n\tforeach (explode(',', $formvariables['fieldlist']) as $formfield) {\r\r\n\t\t$formfieldvalue = '';\r\r\n\t\tif (isset($formvariables[$formfield]))\r\r\n\t\t\t$formfieldvalue = $formvariables[$formfield];\r\r\n\t\tif (strtolower($formfield) == 'email')\r\r\n\t\t\t$formfieldvalue = '<a href=\"mailto:' . $formfieldvalue . '\">' . $formfieldvalue . '</a>';\r\r\n\t\tif ($outputtype == 'simple')\r\r\n\t\t\t$formstring .= str_replace('_', ' ', $formfield) . ': ' . str_replace('\\\\', '', $formfieldvalue) . '<br>';\r\r\n\t\telse\r\r\n\t\t\t$formstring = str_replace('<!-- {$' . $formfield . '$} -->', $formfieldvalue, $formstring);\r\r\n\t}\r\r\n\t// Add datetimestamp\r\r\n\tif ($outputtype == 'simple')\t\r\r\n\t\t$formstring .= '<br>Date: ' . date(\"m/d/Y\") . ' - ' . date(\"h:i:s A\");\r\r\n\telse\r\r\n\t\t$formstring = str_replace('<!-- {$datetimestamp$} -->',\r\r\n\t\t\t\t\t\t\t\t (date(\"m/d/Y\") . ' - ' . date(\"h:i:s A\")), $formstring);\t\r\r\n\t// Send via email\r\r\n\trequire_once(\"htmlMimeMail5/htmlMimeMail5.php\"); // htmlMimeMail5 class\r\r\n $mail = new htmlMimeMail5(); // Instantiate a new HTML Mime Mail object\r\r\n $mail->setFrom($glbl_sendformsfromemailaddress);\r\r\n $mail->setReturnPath($glbl_sendformsfromemailaddress); \r\r\n $mail->setSubject('web form | ' . $glbl_companyname);\r\r\n $mail->setText(str_replace('<br>', '\\r\\n', $formstring));\r\r\n $mail->setHTML($formstring);\r\r\n\t// Attach uploaded image, if any\r\r\n\tif (isset($_FILES['imagefile']['name']))\r\r\n\t\tif ($_FILES['imagefile']['type'] == \"image/gif\" || $_FILES['imagefile']['type'] == \"image/jpg\" ||\r\r\n\t\t\t$_FILES['imagefile']['type'] == \"image/jpeg\" || $_FILES['imagefile']['type'] == \"image/pjpeg\" ||\r\r\n\t\t\t$_FILES['imagefile']['type'] == \"image/png\")\r\r\n\t\t\t$mail->addAttachment(new fileAttachment($_FILES['imagefile']['tmp_name'], $_FILES['imagefile']['type']));\r\r\n\t// Send the email!\r\r\n\t$mail->send(array($glbl_sendformstoemailaddress), 'smtp');\r\r\n\t// User defined function hook\r\r\n\texecUserDefinedFunction('USRDFNDafter_event_formprocessing');\r\r\n\t// Point to page\r\r\n\theader('Location: ' . $formvariables['afterpage']);\r\r\n}", "function send_emails($fname, $lname, $email, $password)\n{\n\t$headers\t= 'MIME-Version: 1.0' . \"\\n\";\n\t$headers .= 'Content-type: text/html; charset=iso-8859-1' . \"\\n\";\n\t$headers .= 'From: NEWSTART Lifestyle Club <[email protected]>' . \"\\r\\n\";\n\n\t// message\n\t$message = '\n<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n<html>\n<head>\n<title>Welcome to the Club!</title>\n<meta name=\"viewport\" content=\"width=740\">\n<meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\">\n<style type=\"text/css\">\na {text-decoration: none;color:#87A621;}\na:hover {text-decoration: underline;}\n\t\n</style>\n<!--[if gte mso 9]>\n<style type=\"text/css\">\ntable,td,div,p {font-family:\\'Helvetica Neue\\', Arial, Helvetica, Lucida Sans, Lucida Sans Unicode, Lucida Grande sans-serif !important;}\n</style>\n<![endif]-->\n<!--[if lte mso 7]>\n<style type=\"text/css\">\ntable,td,div,p {font-family:\\'Helvetica Neue\\', Arial, Helvetica, Lucida Sans, Lucida Sans Unicode, Lucida Grande sans-serif !important;}\n</style>\n<![endif]-->\n</head>\n<body bgcolor=\"#509ADE\" style=\"margin:0; padding:0\">\n<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\">\n\t<tr>\n\t\t<td style=\"padding:20px 20px 40px 20px; background-color:#509ADE\" bgcolor=\"#509ADE\">\n\t\t\t\n\t\t\t<!-- BEGIN MAIN CONTENT -->\n\t\t\t<table width=\"550\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\" style=\"margin:0 auto;\">\n\t\t\t\t<tr>\n\t\t\t\t\t<td>\n\t\t\t\t\t\t<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\">\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td width=\"550\" valign=\"top\" colspan=\"3\">\n\t\t\t\t\t\t\t\t\t<img src=\"http://newstartclub.com/assets/images/email/newsletter/email-header.jpg\" alt=\"NEWSTART Lifestyle Club\" width=\"550\" border=\"0\" style=\"display:block;margin:0\">\n\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td width=\"2\" valign=\"top\" style=\"background-image: url(http://newstartclub.com/assets/images/email/newsletter/email-left-shadow.jpg);\"></td>\n\t\t\t\t\t\t\t\t<td width=\"550\" valign=\"middle\" height=\"60\" align=\"right\" bgcolor=\"#000000\" style=\"background-image: url(http://newstartclub.com/assets/images/email/newsletter/nav-texture.png); background-color:#000000\">\n\t\t\t\t\t\t\t\t\t<div style=\"font-family:\\'Helvetica Neue\\', Arial, Helvetica, sans-serif; font-size:30px; color:#ffffff; padding: 12px 30px;\">\n\t\t\t\t\t\t\t\t\t\t<span style=\"font-size:30px;color:#FFFFFF;font-family:\\'Helvetica Neue\\', Arial, Helvetica, sans-serif;\">Welcome to the</span> <span style=\"font-size:30px;color:#FFFFFF;font-family:\\'Helvetica Neue\\', Arial, Helvetica, sans-serif;font-weight:bold;\">Club</span>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t<td width=\"2\" valign=\"top\" style=\"background-image: url(http://newstartclub.com/assets/images/email/newsletter/email-right-shadow.jpg);\"></td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t</table>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td width=\"550\" style=\"background-color:#ffffff\" bgcolor=\"#ffffff\">\n\t\t\t\t\t\t<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\" style=\"margin:0\">\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td width=\"2\" valign=\"top\" style=\"background-image: url(http://newstartclub.com/assets/images/email/newsletter/email-left-shadow.jpg);\"></td>\n\t\t\t\t\t\t\t\t<td width=\"30\" bgcolor=\"#ffffff\" valign=\"top\"></td>\n\t\t\t\t\t\t\t\t<td width=\"486\" style=\"font-family:\\'Helvetica Neue\\', Arial, Helvetica, sans-serif; font-weight: normal; line-height: 1.2; font-size:16px; color:#010101;\">\n\t\t\t\t\t\t\t\t\t<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\" style=\"margin:0\">\n\t\t\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t\t\t<td height=\"30\"></td>\n\t\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t\t\t<td style=\"font-family:\\'Helvetica Neue\\', Arial, Helvetica, sans-serif; font-weight: normal; line-height: 1.5; font-size:16px; color:#010101;\">\n\t\t\t\t\t\t\t\t\t\t\t<p>Dear ';\n\t\t\t\t\t\t$message .= $fname;\n\t\t\t\t\t\t$message .= ',</p>\n\t\t\t\t\t\t\t\t\t<p>As a registered member, you now have access to:</p>\n\t\t\t\t\t\t\t\t\t <ul>\n\t\t\t\t\t\t\t\t\t\t<li>Live streaming videos</li>\n\t\t\t\t\t\t\t\t\t\t<li>Local seminars & events</li>\n\t\t\t\t\t\t\t\t\t\t<li>Expert health advice</li>\n\t\t\t\t\t\t\t\t\t\t<li>Wellness tips & tools</li>\n\t\t\t\t\t\t\t\t\t\t<li>FREE membership</li>\n\t\t\t\t\t\t\t\t\t </ul>\n\t\t\t\t\t\t\t\t\t <p>To get started, log in to <a href=\"http://newstartclub.com/signin\" style=\"color:#87A621;\">http://newstartclub.com/signin</a> using the following:</p>\n\t\t\t\t\t\t\t\t\t <p><strong>Username:</strong> <a href=\"mailto:'. $email .'\" style=\"color:#87A621;\">'. $email .'</a><br /><strong>Password:</strong> '. $password .'</p>\n\t\t\t\t\t\t\t\t\t <p>If you ever wish to change your password, visit <a href=\"http://newstartclub.com/settings\" style=\"color:#87A621;\">http://newstartclub.com/settings</a>.</p>\n\t\t\t\t\t\t\t\t\t<span>Enjoy,<br />\n\t\t\t\t\t\t\t\t\tThe NEWSTART Lifestyle Club Team<br />\n\t\t\t\t\t\t\t\t\t<a href=\"http://newstartclub.com/\" style=\"color:#87A621;\">newstartclub.com</a></span><br /><br />\n\t\t\t\t\t\t\t\t\t<span>P.S. As our way of saying thanks for joining, please click <a href=\"http://newstartclub.com/downloads/sponsor-resources/common-files/NEWSTART-Planner.pdf\" style=\"color:#87A621;\">here</a> to download your free NEWSTART&reg; Daily Planner.</span>\n\t\t\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t\t\t<td height=\"10\"></td>\n\t\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t\t</table>\n\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t<td width=\"30\" bgcolor=\"#ffffff\" valign=\"top\"></td>\n\t\t\t\t\t\t\t\t<td width=\"2\" valign=\"top\" style=\"background-image: url(http://newstartclub.com/assets/images/email/newsletter/email-right-shadow.jpg);\"></td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t</table>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td width=\"550\" valign=\"top\" colspan=\"3\">\n\t\t\t\t\t\t<img src=\"http://newstartclub.com/assets/images/email/newsletter/email-footer.jpg\" alt=\"footer\" width=\"550\" border=\"0\" style=\"display:block;margin:0\">\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t</table>\n\t\t\t\n\t\t\t<!--BEGIN FOOTER-->\n\t\t\t<table width=\"550\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\" style=\"margin:0 auto\">\n\t\t\t\t<tr>\n\t\t\t\t\t<td style=\"padding:15px 20px 0 20px; font-family: \\'Lucida Grande\\', \\'Lucida Sans Unicode\\', Verdana, sans-serif !important; font-size:10px; line-height: 1.34em; color:#204C74\" align=\"center\">\n\t\t\t\t\t\tA FREE community service of <a href=\"http://newstart.com\" style=\"font-size:10px;color:#204C74; text-decoration:underline;\">NEWSTART&reg;</a>. &copy;'. date(\"Y\") .'. All Rights Reserved.\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t</table>\n\t\t\t\n\t\t</td>\n\t</tr>\n</table>\n</body>\n</html>';\n\n\t// Mail it\n\tmail($email, 'Welcome to the Club!', stripslashes($message), $headers);\n}", "function elastic_email_send_test($form, &$form_state) {\n $site_mail = variable_get('site_mail', NULL);\n\n $form['elastic_email_test_email_to'] = array(\n '#type' => 'textfield',\n '#size' => 40,\n '#title' => t('Email address to send a test email to'),\n '#description' => t('Enter the email address that you would like to send a test email to.'),\n '#required' => TRUE,\n '#default_value' => $site_mail,\n );\n\n $form['elastic_email_test_email_subject'] = array(\n '#type' => 'textfield',\n '#size' => 100,\n '#title' => t('Test Email Subject'),\n '#description' => t('Enter the subject that you would like to send with the test email.'),\n '#required' => TRUE,\n '#default_value' => t('Elastic Email module: configuration test email'),\n );\n\n $text_body = t('This is a test of the Drupal Elastic Email module configuration.')\n . \"\\n\\n\"\n . t('Message generated: !time',\n array('!time' => format_date(REQUEST_TIME, 'custom', 'r')));\n\n $form['elastic_email_test_email_body'] = array(\n '#type' => 'textarea',\n //'#size' => 8,\n '#title' => t('Test email body contents'),\n '#description' => t('Enter the email body that you would like to send.'),\n '#default_value' => $text_body,\n );\n\n $form['elastic_email_test_email_html'] = array(\n '#type' => 'checkbox',\n '#title' => t('Send as HTML?'),\n '#description' => t('Check this to send a test email as HTML.'),\n '#default_value' => FALSE,\n );\n\n $form['submit'] = array(\n '#type' => 'submit',\n '#value' => 'Submit',\n );\n\n return $form;\n}", "function send_email($user_mail, $subject, $message){\n// headers here \n$Name = \"Campusfamz.com\";\n$email=\"[email protected]\"; // Change this address within quotes to your address\n$headers = \"From: \". $Name . \"<\" . $email . \">\";\n$headers = \"Content-Type: text/html; charset=iso-8859-1\\n\".$headers;\n// for html mail un-comment the above line\n\n// mail funciton will return true if it is successful\nif(mail($user_email, $subject,\n\"<!DOCTYPE html PUBLIC '-//WAPFORUM//DTD XHTML Mobile 1.0//EN' 'http://www.wapforum.org/DTD/xhtml-mobile10.dtd'>\n<html xmlns='http://www.w3.org/1999/xhtml'>\n<head>\n<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />\n<title>CampusFamz.com</title>\n<meta name='HandheldFriendly' content='True' />\n</head>\n<style type='text/css'>\nbody {\n\twidth: 99%;\n\tfont-family: 'lucida grande',tahoma,verdana,arial,sans-serif;\n}\n.sitename {\n\tcolor: white;\n\tfont-family: 'lucida grande',tahoma,verdana,arial,sans-serif;\n\ttext-align: center;\n\tbackground-color:#005CB9;padding:5px;\n\tfont-weight:bold;\n\tfont-size:25px;\n}\n.content{\n\tfont-size:14px;\n\tpadding-top:5px; padding-bottom:5px;\n\tpadding-left: 20px;\n\tborder: ridge;\n\tborder-width:thin;\n\tborder-color:#666;\n}\ninput[type=button] {\n\tbackground-color:#005CB9;padding:3px;\n\tcolor:white;\n}\n</style>\n<body>\n<div class='sitename'>Campusfamz</div>\n<div class='content'>\n$message\n</html>\",\"$headers\"));\n\t\n}", "function SendEmail($to, $subject, $body, $from=\"\", $cc=\"\", $bcc=\"\", $type=\"text/plain\") {\n global $dbAccess, $smarty;\n\n if ($from) {\n $fromMailcheck = $this->SpamCheck($from);\n if ($fromMailcheck == false) {\n $errorMsg[] = \"Invalid From email address.\";\n $smarty->assign(\"errorMsg\", $errorMsg);\n return false;\n }\n }\n\n if ($to) {\n $toMailcheck = $this->SpamCheck($to);\n if ($toMailcheck == false) {\n $errorMsg[] = \"Invalid To email address.\";\n $smarty->assign(\"errorMsg\", $errorMsg);\n return false;\n }\n }\n\n $user = $dbAccess->UserLoad(\"UserType = 'admin'\");\n\n $defaultFrom = $user['UserEmail'];\n\n // Bundle up the variables into a structured array for altering.\n $message = array(\n 'to' => $to,\n 'from' => (isset($from) && $from != '') ? $from : $defaultFrom,\n 'subject' => '',\n 'body' => array()\n );\n\n\n // Build the default headers\n $headers = array(\n 'MIME-Version' => '1.0',\n 'Content-Type' => $type . '; charset=UTF-8; format=flowed; delsp=yes',\n 'Content-Transfer-Encoding' => '8Bit',\n 'X-Mailer' => PROJECT_NAME\n );\n\n if ($defaultFrom) {\n // To prevent e-mail from looking like spam, the addresses in the Sender and\n // Return-Path headers should have a domain authorized to use the originating\n // SMTP server. Errors-To is redundant, but shouldn't hurt.\n $headers['From'] = $headers['Reply-To'] = $headers['Sender'] = $headers['Return-Path'] = $headers['Errors-To'] = $defaultFrom;\n }\n if ($from) {\n $headers['From'] = $headers['Reply-To'] = $from;\n }\n $message['headers'] = $headers;\n\n $message['body'] = $body;\n $message['subject'] = $subject;\n\n // Optionally send e-mail.\n $message['result'] = $this->EMail($message);\n\n // Log errors\n if (!$message['result']) {\n $errorMsg[] = \"Unable to send e-mail. Please contact the site admin, if the problem persists.\";\n $smarty->assign(\"errorMsg\", $errorMsg);\n }\n\n return $message['result'];\n }", "function sendmail($nomeCliente, $nomeForm, $resultado){\n\trequire_once(\"../PHPMailer/class.phpmailer.php\");\n\t// Inicia a classe PHPMailer\n\t$mail = new PHPMailer();\n\t// Define os dados do servidor e tipo de conexão\n\t// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\n\t$mail->IsSMTP(); // Define que a mensagem será SMTP\n\t$mail->Host = \"mail.businessperformance.net.br\"; // Endereço do servidor SMTP\n\t$mail->SMTPAuth = true; // Usa autenticação SMTP? (opcional)\n\t$mail->Username = '[email protected]'; // Usuário do servidor SMTP\n\t$mail->Password = '@Business18'; // Senha do servidor SMTP\n\t// Define o remetente\n\t// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\n\t$mail->From = \"[email protected]\"; // Seu e-mail\n\t$mail->FromName = \"Business Performance\"; // Seu nome\n\t// Define os destinatário(s)\n\t// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\t$mail->AddAddress('[email protected]', 'Renata Nunes');\n\n\t//$mail->AddAddress('[email protected]');\n\n\t//$mail->AddCC('[email protected]', 'Ciclano'); // Copia\n\t//$mail->AddBCC('[email protected]', 'Fulano da Silva'); // Cópia Oculta\n\t// Define os dados técnicos da Mensagem\n\t// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\n\t$mail->IsHTML(true); // Define que o e-mail será enviado como HTML\n\t$mail->CharSet = 'UTF-8'; // Charset da mensagem (opcional)\n\t// Define a mensagem (Texto e Assunto)\n\t// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\n\t$mail->Subject = \"Resultado formulário - \".$nomeForm.\"\"; // Assunto da mensagem\n\t$mail->Body = \"Segue em anexo o resultado do cliente <b>\".$nomeCliente.\"</b> para o formulário <b>\".$nomeForm.\"</b>.)\";\n\t$mail->AltBody = \"Segue em anexo o resultado do cliente \".$nomeCliente.\" para o formulário \".$nomeForm.\".\";\n\t// Define os anexos (opcional)\n\t// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\n\t$mail->AddAttachment($resultado); // Insere um anexo -> Renomear arquivo ($resultado, \"novo_nome.pdf\")\n\t// Envia o e-mail\n\t$enviado = $mail->Send();\n\t// Limpa os destinatários e os anexos\n\t$mail->ClearAllRecipients();\n\t$mail->ClearAttachments();\n\t// Exibe uma mensagem de resultado\n\tif ($enviado) {\n\t echo \"E-mail enviado com sucesso!\";\n\t} else {\n\t echo \"Não foi possível enviar o e-mail.\";\n\t echo \"<b>Informações do erro:</b> \" . $mail->ErrorInfo;\n\t}\n\n}", "function SendMail($email_title,$email_body,$reboot)\n{\n\tif($email_title == \"\" || $email_body == \"\" || $email_title == null || $email_body == null)\n\t{\n\t\tfile_put_contents(\"result.txt\",\"email body or title is null\\n\",FILE_APPEND);\n\t\texit(\"email内容为空或者email标题为空\\n\");\t\t\n\t}\n\n\t//load basic class: SMTPMailer\n\trequire(\"SMTPMailer.php\");\n\n\tif($reboot == \"start\"){//说明第一次启动程序\n\t\tfile_put_contents(\"result.txt\",\"\");\t\t\n\t\t//链接到数据库并获得要发送的邮件地址\n\t\t$connection = mysql_connect(\"localhost\", \"mydonor\", \"MYDONOR@))(\") or die (\"Unable toconnect!\");\n\t\tmysql_select_db(\"mydonor\") or die (\"Unable to select database!\"); \n\t\tmysql_query(\"SET NAMES UTF8\");\n\t\t$query = \"SELECT distinct email_addr FROM if_donor_email WHERE priority >= 0 and deleted = 0 ORDER BY id\"; \n\t\t$result = mysql_query($query) or die (\"Error in query: $query. \" . mysql_error());\n\t\t//写下本次要发送的邮件地址到emaillist\n\t\tfile_put_contents(\"emaillist.txt\",\"\");\n\t\t$i = 0;\n\t\twhile($email = mysql_fetch_row($result)){\n\t\t\tfile_put_contents(\"emaillist.txt\",$i.\" \".$email[0].\"\\n\",FILE_APPEND);\t\n\t\t\t$i ++;\n\t\t}\n\t\t//计算本次要发送的邮件数目\n\t\t$email_num = mysql_num_rows($result);\n\t\tif($i !== $email_num) die (\"出错:email数目和写入emaillist文件的email数不一致\"); \n\t\t//关闭数据库链接\n\t\tmysql_close($connection);\n\n\t\t//从emaillist.txt中读入本次待发送的邮件列表\n\t\t$file= \"emaillist.txt\";\n\t\t$emaillist=file($file,FILE_IGNORE_NEW_LINES);\n\t\tif($email_num !== count($emaillist)) die (\"出错:email数目和emaillist文件总行数不一致\"); \n\t\tfor($i = 0; $i < count($emaillist); $i ++){\n\t\t\t$email[$i] = preg_split(\"/\\s+/\",trim($emaillist[$i]));\t\t\n\t\t}\n\t\t//开始发送邮件\n\t\tif(count($email) > 0){\n\t\t\t\tfor($i = 0; $i < count($email); $i ++)\n\t\t\t\t{\n\t\t\t\t\t$mailer=new SMTPMailer();\n\t\t\t\t\t$mailer->Host=\"202.38.64.8\";\n\t\t\t\t\t$mailer->UserName=\"\";\n\t\t\t\t\t$mailer->Password=\"\";\n\t\t\t\t\t$mailer->From=\"\";\n\t\t\t\t\t$mailer->ContentType=\"text/html\";\n\t\t\t\t\t$mailer->Subject=$email_title; \n\t\t\t\t\t$mailer->Body=$email_body;\n\t\t\t\t\t$mailer->To=$email[$i][1];\n\t\t\t\t\tif($i !== intval($email[$i][0])) exit(\"当前发送email地址的id和emaillist.txt中的记录行号id不一致\\n\");\n\t\t\t\t\tif($mailer->Send()){\n\t\t\t\t\t\tfile_put_contents(\"result.txt\",$i.\" \".$email[$i][1].\" 成功\\n\",FILE_APPEND);\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tfile_put_contents(\"result.txt\",$i.\" \".$email[$i][1].\" \".$mailer->Error.\"\\n\",FILE_APPEND);\n/*\t\t\t\t\t\tif(strstr($mailer->Error,\"Recipient\") !== false){\n\t\t\t\t\t\t\t$connection = mysql_connect(\"localhost\", \"mydonor\", \"MYDONOR@))(\") or die (\"Unable toconnect!\");\n\t\t\t\t\t\t\tmysql_select_db(\"mydonor\") or die (\"Unable to select database!\"); \n\t\t\t\t\t\t\tmysql_query(\"SET NAMES UTF8\");\n\t\t\t\t\t\t\t$query = \"update if_donor_email set priority = -1 where email_addr = '\".$email[0].\"'\"; \n\t\t\t\t\t\t\t$setResult = mysql_query($query);\n\t\t\t\t\t\t\t$error = mysql_error();\n\t\t\t\t\t\t}*/\n\t\t\t\t\t}\n\t\t\t\t\tfile_put_contents(\"currpos.txt\",$i);\n\t\t\t\t\tsleep(5);\n\t\t\t\t}\n\t\t}\t\t\t\t\n\t}\n\telse if($reboot == \"restart\"){//说明属于重启\n\t\t$file= \"currpos.txt\";\n\t\t$currpos=file($file,FILE_IGNORE_NEW_LINES);\n\t\tif(count($currpos) === 0) exit(\"在重启模式下,currpos.txt不能为空\\n\");\n\t\t$from = intval($currpos[0])+1; //重启后应该从第几个email开始发送\n\t\tif($from < 1) exit(\"$from 值不对\");\n\t\t\n\t\t//从emaillist.txt中读入本次待发送的邮件列表\n\t\t$file= \"emaillist.txt\";\n\t\t$emaillist =file($file,FILE_IGNORE_NEW_LINES);\n\t\tfor($i = 0; $i < count($emaillist); $i ++){\n\t\t\t$email[$i] = preg_split(\"/\\s+/\",trim($emaillist[$i]));\t\t\n\t\t}\n\t\t//开始发送邮件\n\t\tif(count($email) > 0){\n\t\t\t\tfor($i = $from; $i < count($email); $i ++)\n\t\t\t\t{\n\t\t\t\t\t$mailer=new SMTPMailer();\n\t\t\t\t\t$mailer->Host=\"202.38.64.8\";\n\t\t\t\t\t$mailer->UserName=\"\";\n\t\t\t\t\t$mailer->Password=\"\";\n\t\t\t\t\t$mailer->From=\"\";\n\t\t\t\t\t$mailer->ContentType=\"text/html\";\n\t\t\t\t\t$mailer->Subject=$email_title; \n\t\t\t\t\t$mailer->Body=$email_body;\n\t\t\t\t\t$mailer->To=$email[$i][1];\n\t\t\t\t\tif($i !== intval($email[$i][0])) exit(\"当前发送email地址的id和emaillist.txt中的记录id不一致\\n\");\n\t\t\t\t\tif($mailer->Send()){\n\t\t\t\t\t\tfile_put_contents(\"result.txt\",$i.\" \".$email[$i][1].\" 成功\\n\",FILE_APPEND);\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tfile_put_contents(\"result.txt\",$i.\" \".$email[$i][1].\" \".$mailer->Error.\"\\n\",FILE_APPEND);\n/*\t\t\t\t\t\tif(strstr($mailer->Error,\"Recipient\") !== false){\n\t\t\t\t\t\t\t$connection = mysql_connect(\"localhost\", \"mydonor\", \"MYDONOR@))(\") or die (\"Unable toconnect!\");\n\t\t\t\t\t\t\tmysql_select_db(\"mydonor\") or die (\"Unable to select database!\"); \n\t\t\t\t\t\t\tmysql_query(\"SET NAMES UTF8\");\n\t\t\t\t\t\t\t$query = \"update if_donor_email set priority = -1 where email_addr = '\".$email[0].\"'\"; \n\t\t\t\t\t\t\t$setResult = mysql_query($query);\n\t\t\t\t\t\t\t$error = mysql_error();\n\t\t\t\t\t\t}*/\n\t\t\t\t\t}\n\t\t\t\t\tfile_put_contents(\"currpos.txt\",$i);\n\t\t\t\t\tsleep(5);\n\t\t\t\t}\n\t\t}\t\t\t\n\t\t\t\t\t\n\t}else{//既不属于第一次启动,也不属于重启,说明有问题\n\t\texit(\"出错:/既不属于第一次启动,也不属于重启,说明有问题\"); \t\n\t}\t\n}", "function do_contact_email($adata, $aret_flag=0) {\n\t# Dim Some Vars\n\t\tglobal $_CCFG, $_TCFG, $_DBCFG, $_UVAR, $_LANG, $_SERVER, $_nl, $_sp;\n\n\t# Get contact information array\n\t\t$_cinfo = get_contact_info($adata['mc_id']);\n\n\t# Set eMail Parameters (pre-eval template, some used in template)\n\t\tIF ($_CCFG['_PKG_SAFE_EMAIL_ADDRESS']) {\n \t\t\t$mail['recip']\t= $_cinfo['c_email'];\n\t\t\t$mail['from']\t= $adata['mc_email'];\n\t\t\tIF ($_CCFG['CONTACT_FORM_CC']) {$mail['cc']\t= $adata['mc_email'];}\n\t\t} ELSE {\n\t\t\t$mail['recip']\t= $_cinfo['c_name'].' <'.$_cinfo['c_email'].'>';\n\t\t\t$mail['from']\t= $adata['mc_name'].' <'.$adata['mc_email'].'>';\n\t\t\tIF ($_CCFG['CONTACT_FORM_CC']) {$mail['cc']\t= $adata['mc_name'].' <'.$adata['mc_email'].'>';}\n\t\t}\n\t\t$mail['subject']\t= $_CCFG['_PKG_NAME_SHORT'].'- Contact Message';\n\n\t# Grab ip_address of sender\n\t\tIF (isset($_SERVER['HTTP_X_FORWARDED_FOR']) && $_SERVER['HTTP_X_FORWARDED_FOR'] != '') {\n\t\t\t$pos = strpos(strtolower($_SERVER['HTTP_X_FORWARDED_FOR']), '192.168.');\n\t\t\tIF ($pos === FALSE) {\n\t\t\t\t$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];\n\t\t\t} ELSE {\n\t\t\t\t$ip = $_SERVER[\"REMOTE_ADDR\"];\n\t\t\t}\n\t\t} ELSE {\n\t\t\t$ip = $_SERVER[\"REMOTE_ADDR\"];\n\t\t}\n\n\t# Set MTP (Mail Template Parameters) array\n\t\t$_MTP['to_name']\t= $_cinfo['c_name'];\n\t\t$_MTP['to_email']\t= $_cinfo['c_email'];\n\t\t$_MTP['from_name']\t= $adata['mc_name'];\n\t\t$_MTP['from_email']\t= $adata['mc_email'];\n\t\t$_MTP['subject']\t= $adata['mc_subj'];\n\t\t$_MTP['message']\t= $adata['mc_msg'];\n\t\t$_MTP['site']\t\t= $_CCFG['_PKG_NAME_SHORT'];\n\t\t$_MTP['sender_ip']\t= $ip;\n\t\n\t# Load message template (processed)\n\t\t$mail['message']\t= get_mail_template('email_contact_form', $_MTP);\n\n\t# Call basic email function (ret=0 on error)\n\t\t$_ret = do_mail_basic($mail);\n\n\t# Set flood control values in session\n\t\t$sdata['set_last_contact'] = 1;\n\t\t$_sret = do_session_update($sdata);\n\n\t# Check return\n\t\tIF ($_ret) {\n\t\t\t$_ret_msg = $_LANG['_MAIL']['CS_FORM_MSG_02_L1'];\n\t\t\t$_ret_msg .= '<br>'.$_LANG['_MAIL']['CS_FORM_MSG_02_L2'];\n\t\t} ELSE {\n\t\t\t$_ret_msg = $_LANG['_MAIL']['CS_FORM_MSG_03_L1'];\n\t\t\t$_ret_msg .= $_sp.$_LANG['_MAIL']['CS_FORM_MSG_03_L2'];\n\t\t}\n\n\t# Build Title String, Content String, and Footer Menu String\n\t\t$_tstr = $_LANG['_MAIL']['CS_FORM_RESULT_TITLE'];\n\n\t\t$_cstr .= '<center>'.$_nl;\n\t\t$_cstr .= '<table cellpadding=\"5\" width=\"100%\">'.$_nl;\n\t\t$_cstr .= '<tr><td class=\"TP5MED_NC\">'.$_nl;\n\t\t$_cstr .= $_ret_msg.$_nl;\n\t\t$_cstr .= '</td></tr>'.$_nl;\n\t\t$_cstr .= '</table>'.$_nl;\n\t\t$_cstr .= '</center>'.$_nl;\n\n\t\t$_mstr_flag\t= 0;\n\t\t$_mstr\t\t= '&nbsp;'.$_nl;\n\n\t# Call block it function\n\t\t$_out .= do_mod_block_it($_tstr, $_cstr, $_mstr_flag, $_mstr, '1');\n\t\t$_out .= '<br>'.$_nl;\n\n\t\tIF ($aret_flag) {return $_out;} ELSE {echo $_out;}\n}", "function form($action=null,$submit='Submit',$rows=null,$taction=null,$editmode=null) {\n\t //print_r($_POST);\n\t global $sFromErr;\n\t\t $taction = 'cpsubloadhtmlmail';//templates\n\t\t $iaction = 'cpsubloadimage';//add images (embed)\t\t \n\t\t $daction = 'cpsubattach';//add attachments\t\t \n\t\t \n\t\t $activebatch = $this->load_saved_batch();\n \n\t\t $sendto = GetParam('to')?GetParam('to'):$this->to;\n\t\t $sendcc = GetParam('cc')?GetParam('cc'):null;\t\t \n\t\t $sendbcc = GetParam('bcc')?GetParam('bcc'):null;\t\t\t \n\t\t \n\t\t $mailuser = $this->mailuser?$this->mailuser:$this->from;\t//echo '>',$mailname;\n\t $mymail = GetParam('from')?GetParam('from'):$mailuser;\t\t// echo '>',$mymail;\n\t\t\n\t\t \n\t\t if (!$submit)\n\t\t $submit = localize('_SUBMIT',getlocal());\n \n if (!$rows)\n\t\t $rows = 16;\n \n if ($action)\n\t\t $myaction = seturl(\"t=\".$action.\"&editmode=\".GetReq('editmode')); \n\t\t else \n $myaction = seturl(\"t=cmail\".\"&editmode=\".GetReq('editmode')); \n\t\t \n\t\t //in case of activebatch ..go directly to batch num\n\t\t if (($activebatch) && ($this->bypass_method==false))\n\t\t $myaction .= '&batchid=' . $activebatch; \n\t\t \t\t \n $out .= \"<FORM action=\". \"$myaction\" . \" method=post>\"; \t\n\t \t \n //error message\n $out .= setError($sFormErr);\t\t \n\t \n $from[] = \"<B>\" . localize('_FROM',getlocal()) . \":</B>\";\n $fromattr[] = \"right;20;\";\n\t\t $from[] = \"<input type=\\\"text\\\" name=\\\"from\\\" maxlenght=\\\"40\\\" readonly =\\\"readonly\\\" value=\\\"\".$mymail.\"\\\">&nbsp;\" . $this->mailname;\n\t $fromattr[] = \"left;80%;\";\t\t\n\n\t $fwin = new window('',$from,$fromattr);\n\t $winout .= $fwin->render(\"center::100%::0::group_article_selected::left::0::0::\");\t\n\t unset ($fwin);\t \n\t \n //TO..\n $to[] = \"<B>\" . localize('_TO',getlocal()) . \":</B>\";\n \t $toattr[] = \"right;20%;\";\t \n\t $to[] = \"<input type=\\\"text\\\" name=\\\"to\\\" maxlenght=\\\"40\\\" value=\\\"$sendto\\\">&nbsp;\" . $this->toname;\t\n\t\t $toattr[] = \"left;80%;\";\n\t $twin = new window('',$to,$toattr);\n\t $winout .= $twin->render(\"center::100%::0::group_article_selected::left::0::0::\");\t\n\t unset ($twin);\t\t \n\t\t \n //CC..\n if ((SMTP_PHPMAILER=='true') || (SENDMAIL_PHPMAILER=='true')) {\t\t\t \t\t\t \n $cc[] = \"<B>\" . localize('_CC',getlocal()) . \":</B>\";\n \t $toattr[] = \"right;20%;\";\t \n\t $cc[] = \"<input style=\\\"width:100%\\\" type=\\\"text\\\" name=\\\"cc\\\" maxlenght=\\\"80\\\" value=\\\"$sendcc\\\">\";\n\t\t $toattr[] = \"left;80%;\";\t\t \n\t $twin = new window('',$cc,$toattr);\n\t $winout .= $twin->render(\"center::100%::0::group_article_selected::left::0::0::\");\t\n\t unset ($twin);\t\t\n\t\t \n $bcc[] = \"<B>\" . localize('_BCC',getlocal()) . \":</B>\";\n \t $toattr[] = \"right;20%;\";\t \n\t $bcc[] = \"<input style=\\\"width:100%\\\" type=\\\"text\\\" name=\\\"bcc\\\" maxlenght=\\\"80\\\" value=\\\"$sendbcc\\\">\";\n\t\t $toattr[] = \"left;80%;\";\t\t \n\t $twin = new window('',$bcc,$toattr);\n\t $winout .= $twin->render(\"center::100%::0::group_article_selected::left::0::0::\");\t\n\t unset ($twin);\t\t\t \n\t\t } \t\t\t \n \n\t //SUBJECT..\n\t\t $sbj = $subject?$subject:GetParam('subject');\n $subt[] = \"<B>\" . localize('_SUBJECT',getlocal()) . \":</B>\";\n \t $subattr[] = \"right;20%;\";\t \n $subt[] = \"<input style=\\\"width:100%\\\" type=\\\"text\\\" name=\\\"subject\\\" maxlenght=\\\"30\\\" value=\\\"\".$sbj.\"\\\">\"; \n \t $subattr[] = \"left;80%;\";\n\t $swin = new window('',$subt,$subattr);\n\t $winout .= $swin->render(\"center::100%::0::group_article_selected::left::0::0::\");\t\n\t unset ($swin);\t \n\t\t \n\t\t //OPTIONS \n $opt[] = \"&nbsp;\";\n \t $toattr[] = \"right;20%;\";\t\n\t\t $check1 = $activebatch?'checked':null; \t\t \n\t $options = \"<B>\" . localize('_INCLSUBS',getlocal()) . \"&nbsp;<input type=\\\"checkbox\\\" name=\\\"includesubs\\\" $check1>\";\t\t\n $options .= \"<B>\" . localize('_INCLALL',getlocal()) . \"&nbsp;<input type=\\\"checkbox\\\" name=\\\"includeall\\\" ><br>\";\t\t\t\t \n if ((SMTP_PHPMAILER=='true') || (SENDMAIL_PHPMAILER=='true')) {\t\n\t\t $check2 = $this->ishtml?'checked':null;\n $options .= \"<B>\" . localize('_ISHTML',getlocal()) . \"&nbsp;<input type=\\\"checkbox\\\" name=\\\"ishtml\\\" $check2><br>\";\t\t \n\t\t }\t\n\t\t else\n\t\t $options .= \"<B>\" . localize('_SMTPDEBUG',getlocal()) . \"&nbsp;<input type=\\\"checkbox\\\" name=\\\"smtpdebug\\\"><br>\";//debug smtp\n\t\t \t \n\t $opt[] = $options;\n \t $toattr[] = \"left;80%;\";\t\n\t $twin = new window('',$opt,$toattr);\n\t $winout .= $twin->render(\"center::100%::0::group_article_selected::left::0::0::\");\t\n\t unset ($twin);\t\t \n\t \t \n\t //MAIL BODY..\t\t \n $mb[] = \"&nbsp;\";//\"<B>\" . localize('_MESSAGE',getlocal()) . \":</B>\";\n \t $mbattr[] = \"right;1%;\";\t\n\t\t \n\t\t if (GetReq('t')=='cpsubloadhtmlmail') { //LOAS A NEW TEMPLATE\n\t\t $path = $this->urlpath.$this->infolder.$this->newsletter_path;//GetGlobal('controller')->calldpc_var('rctedit.htmlpath');\t\t \n\t\t //echo $path; print_r($_POST);\n\t\t if ($template = GetParam('template')) {\n\t\t $data = GetGlobal('controller')->calldpc_method('rctedit.loadfromfile use '.$template.'+'.$path);\n\t\t }\n\t\t else \n\t\t $data = null;\n\t\t\t \n\t\t $conditions = $this->spam_conditions_text($this->antispamlink,0,$this->ishtml);\n\t\t $this->mailbody = $data . $conditions; //str_replace('</html>',$conditions.'</html>',$data);\n\t\t \n\t\t //$this->htmleditor = new tinyMCE('textareas','ADVANCEDFULL',1,'images',$this->dirdepth);\n\t\t //$mbody = $this->htmleditor->render('mail_text','100%',$rows+10,$data . $conditions);\n\t\t $mbody = $this->render_textarea($data . $conditions, $rows);\n\t\t \n\t\t $this->template = $this->url . $this->infolder . $this->newsletter_path . $template; \n\n\t\t $this->ishtml = true;\t\n\t\t SetSessionParam('template',$this->template);\n\t\t SetSessionParam('mailbody',$this->mailbody);\t\t\n\t\t //reset embeded images \n\t\t $this->images = array();\t\t \n\t SetSessionParam('images',null);\n\t\t //reset attachments \n\t\t $this->attachments = array();\t\t \n\t SetSessionParam('attachments',null);\t\t \n\t\t }\n\t\t elseif (GetReq('t')=='cpsubloadimage') {//..OR ADD EMBEDED IMAGE\n\t\t \n\t\t if ($this->mailbody) \n\t\t $mailbody = $this->mailbody;\n\t\t else \n\t\t $mailbody .= GetParam('mail_text')?GetParam('mail_text'):$this->get_mail_body();\t\t\t \n\t\t \n\t\t /*if ($this->ishtml == true) {\n\t\t $this->htmleditor = new tinyMCE('textareas','ADVANCEDFULL',1,'images',$this->dirdepth);\n\t\t $mbody = $this->htmleditor->render('mail_text','100%',$rows+10,$mailbody);\t\t \n\t\t }\t\t\t \n\t\t else {\n $mbody = \"<DIV class=\\\"monospace\\\"><TEXTAREA style=\\\"width:100%\\\" NAME=\\\"mail_text\\\" ROWS=$rows cols=60 wrap=\\\"virtual\\\">\";\t \n $mbody .= $mailbody; \n $mbody .= \"</TEXTAREA></DIV>\";\n\t\t }*/\n\t\t $mbody = $this->render_textarea($mailbody,$rows);\t \n\t\t \t\n\t\t if ($img = GetParam('image'))\n\t $this->images[] = $img;\t\n\t\t //echo '>',GetParam('image');\t \n\t SetSessionParam('images',serialize($this->images));\t\t \t\t \n\t\t }\t\t\n\t\t elseif (GetReq('t')=='cpsubattach') {//..OR ATTACH A FILE\n\t\t \n\t\t if ($this->mailbody) \n\t\t $mailbody = $this->mailbody;\n\t\t else \n\t\t $mailbody .= GetParam('mail_text')?GetParam('mail_text'):$this->get_mail_body();\t\t\t \n\t\t \n\t\t /*if ($this->ishtml == true) {\n\t\t $this->htmleditor = new tinyMCE('textareas','ADVANCEDFULL',1,'images',$this->dirdepth);\n\t\t $mbody = $this->htmleditor->render('mail_text','100%',$rows+10,$mailbody);\t\t \n\t\t }\t\t\t \n\t\t else {\n $mbody = \"<DIV class=\\\"monospace\\\"><TEXTAREA style=\\\"width:100%\\\" NAME=\\\"mail_text\\\" ROWS=$rows cols=60 wrap=\\\"virtual\\\">\";\t \n $mbody .= $mailbody; \n $mbody .= \"</TEXTAREA></DIV>\";\n\t\t }\t*/\t\n\t\t \n\t\t $mbody = $this->render_textarea($mailbody,$rows);\n\t\t \n\t\t if ($attachedfile = GetParam('attachment'))\t\t \n\t $this->attachments[] = $attachedfile;\t\n\t\t //echo '>',GetParam('attachment');\t \n\t SetSessionParam('attachments',serialize($this->attachments));\t\t \t\t \n\t\t }\t\t\n\t\t elseif (GetReq('t')=='cpsubsend') {//..OR SEND A MAIL\n\t\t if ($this->mailbody) \n\t\t $mailbody = $this->mailbody;\n\t\t else \n\t\t $mailbody .= GetParam('mail_text')?GetParam('mail_text'):$this->get_mail_body();\t\t\t \n\t\t \n\t\t /*if ($this->ishtml == true) {\n\t\t $this->htmleditor = new tinyMCE('textareas','ADVANCEDFULL',1,'images',$this->dirdepth);\n\t\t $mbody = $this->htmleditor->render('mail_text','100%',$rows+10,$mailbody);\t\t \n\t\t }\t\t\t \n\t\t else {\n $mbody = \"<DIV class=\\\"monospace\\\"><TEXTAREA style=\\\"width:100%\\\" NAME=\\\"mail_text\\\" ROWS=$rows cols=60 wrap=\\\"virtual\\\">\";\t \n $mbody .= $mailbody; \n $mbody .= \"</TEXTAREA></DIV>\";\n\t\t }\t*/\n\t\t \n\t\t $mbody = $this->render_textarea($mailbody,$rows);\t\t \n\t\t } \t \n\t\t elseif ($this->ishtml = true) {//..OR JUST SHOW NEW HTML MAIL ..\n\t\t //$this->htmleditor = new tinyMCE('textareas','ADVANCEDFULL',1,'images',$this->dirdepth);\n\t\t \n\t\t if ($this->mailbody) \n\t\t $mbody = $this->mailbody;\n\t\t else {\n\t\t $mbody = GetParam('mail_text')?GetParam('mail_text'):$this->get_mail_body();\t\n $mbody .= $this->spam_conditions_text($this->antispamlink,0,$this->ishtml);\t\t\t \n \t\t $this->mailbody = $mbody;\n\t\t\t SetSessionParam('mailbody',$mbody);\n\t\t }\t \n\t\t\t \t\t \n\t\t //$mbody = $this->htmleditor->render('mail_text','100%',$rows+10,$mbody);\n\t\t \n\t\t $mbody = $this->render_textarea($mbody,$rows);\n\t\t \n\t\t //reset arrays\n\t\t SetSessionParam('template',null);\t\n\t\t SetSessionParam('mailbody',null);\t\n\t\t //reset embeded images \n\t\t $this->images = array();\t\t \n\t SetSessionParam('images',null);\n\t\t //reset attachments \n\t\t $this->attachments = array();\t\t \n\t SetSessionParam('attachments',null);\t\t\t \t\t \t\t \n\t\t }\t \n\t\t else { //OR IN TEXT MODE\n\t\t \n\t\t $this->mailbody = null;\n\t\t \n //$mbody = \"<DIV class=\\\"monospace\\\"><TEXTAREA style=\\\"width:100%\\\" NAME=\\\"mail_text\\\" ROWS=$rows cols=60 wrap=\\\"virtual\\\">\";\n\t\t if ($this->mailbody) \n\t\t $mbody .= $this->mailbody;\n\t\t else {\n\t\t $mbody .= GetParam('mail_text')?GetParam('mail_text'):$this->get_mail_body();\t\t \n $mbody .= $this->spam_conditions_text($this->antispamlink,0,0);\n\t\t }\t \n\t\t \n //$mbody .= \"</TEXTAREA></DIV>\";\n\t\t \n\t\t $mbody = $this->render_textarea($mbody,$rows);\n\t\t \n\t\t $this->ishtml = false;\t\n\t\t SetSessionParam('template',null);\t\n\t\t SetSessionParam('mailbody',null);\t\n\t\t //reset embeded images \n\t\t $this->images = array();\t\t \n\t SetSessionParam('images',null);\n\t\t //reset attachments \n\t\t $this->attachments = array();\t\t \n\t SetSessionParam('attachments',null);\t\t\t \t\t \t \n\t\t }\t \n\t\t \n\t $mb[] = $mbody;\n\t $mbattr[] = \"left;99%\";\n\t $mbwin = new window('',$mb,$mbattr);\n\t $winout .= $mbwin->render(\"center::100%::0::group_win_body::left::0::0::\");\t\n\t unset ($mbwin);\t \n\t \n\t \n\t\t //alternate text body\n\t\t if (!$editmode) {\n\t\t \n\t\t if (GetParam('alttext')) {\n\t\t $defaulttext = GetParam('alttext');\n\t\t }\n\t\t else {\n\t\t $defaulttext = localize('_NOTVIEW',0);\n\t\t $defaulttext .= localize('_NOTVIEW',1);\t\t \n\t\t $defaulttext .= $this->template ? $this->template :'Alternate Text message for non html viewers';\n\t\t $defaulttext .= $this->spam_conditions_text($this->antispamlink,0,0);\t\t \n\t\t } \n\t\t \n $alttext = \"<DIV class=\\\"monospace\\\"><TEXTAREA style=\\\"width:100%\\\" NAME=\\\"alttext\\\" ROWS=5 cols=60 wrap=\\\"virtual\\\">\";\n\t\t $alttext .= $defaulttext;\n\t\t $alttext .= \"</TEXTAREA></DIV>\";;\t\t \n\t $alt[] = $alttext;\n \t $toattr[] = \"left;80%;\";\t\n\t $twin = new window('',$alt,$toattr);\n\t $winout .= $twin->render(\"center::100%::0::group_article_selected::left::0::0::\");\t\n\t unset ($twin);\t\n\t\t \n\t\t }//editmode\t\n\t\t \t \n\t //main window\n\t $mywin = new window('',$winout);\n\t $out .= $mywin->render();\t\n\t unset ($mywin);\t \n\t \n\t \n\t //batch num restored\n\t\t if ($activebatch) {\n\t\t $cmd = \"Previous campaign has stoped at batch num (reset or bypass)\";\n\t\t $cm = ($activebatch-1) * $this->batch; \n\t\t $cmd .= \"<br>Campaign stopped at \" . $cm . \" mails from \" . $this->subs_no . ' subscribers!<br>'; \n\t\t \n\t\t if ($this->bypass_method==true)\t\t\t \n\t\t $cmd .= \"<input style=\\\"width:30\\\" type=\\\"text\\\" name=\\\"batchrestore\\\" maxlenght=\\\"4\\\" value=\\\"\".($activebatch-1) .\"\\\">\"; \t \n\t\t //$cmd .= \"<br>\";\n\t\t }\n\t\t else\n\t\t $cmd = $this->subs_no . ' subscribers!<br>';\n\t \n\t //BUTTONS\n\t\t if ($action) {\n $cmd .= \"<input type=\\\"hidden\\\" name=\\\"FormName\\\" value=\\\"SendCMail\\\">\"; \n $cmd .= \"<INPUT type=\\\"submit\\\" name=\\\"submit\\\" value=\\\"\" . $submit . \"\\\">&nbsp;\"; \n $cmd .= \"<INPUT type=\\\"hidden\\\" name=\\\"FormAction\\\" value=\\\"\" . $action . \"\\\">\";\t\t\t \n\t\t }\n\t\t else {\n $cmd .= \"<input type=\\\"hidden\\\" name=\\\"FormName\\\" value=\\\"SendCMail\\\">\"; \n $cmd .= \"<INPUT type=\\\"submit\\\" name=\\\"submit\\\" value=\\\"\" . localize('_SENDCMAIL',getlocal()) . \"\\\">&nbsp;\"; \n $cmd .= \"<INPUT type=\\\"hidden\\\" name=\\\"FormAction\\\" value=\\\"\" . \"sendcmail\" . \"\\\">\";\t \n\t\t } \n\t\t \n\t $but[] = $cmd;\n\t $battr[] = \"left\";\n\t $bwin = new window('',$but,$battr);\n\t $out .= $bwin->render(\"center::100%::0::group_article_selected::left::0::0::\");\t\n\t unset ($bwin);\n\t \t \n $out .= \"</FORM>\"; \n\t\t \n\t if (defined('RCTEDIT_DPC')) {\n\t\t //html\n\t\t $out1_title = \"<B>\" . localize('_HTMLTEMPLATE',getlocal()) . \":</B>&nbsp;\" . $this->template;\n\t $out1 = GetGlobal('controller')->calldpc_method('rctedit.show_files use template+Load Newsletter+'.$taction.'+'.$this->newsletter_path.'+'.implode(',',$this->templatetypes));\t\t \n\t\t if (defined('RCUPLOAD_DPC')) \n\t\t $out1 .= GetGlobal('controller')->calldpc_method('rcupload.uploadform use cpsubuploadtemplate+/'.$this->newsletter_path.'+++'.$this->maxsize); \n\t\t\t \n\t $awin = new window($out1_title,$out1);\n\t $out .= $awin->render(\"center::100%::0::group_article_selected::left::0::0::\");\t\n\t unset ($awin);\t\n\t\t \t\t\t \n\t\t //embeded images\n\t\t if ((is_array($this->images)) && (!empty($this->images))) {\n\t\t //print_r($this->images);\n\t\t $myimages = implode(',',$this->images);\n\t\t }\t \n\t\t else\n\t\t $myimages = 'none';\t \n\t\t $out2_title = \"<B>\" . localize('_ADDIMAGES',getlocal()) . \":</B>&nbsp;\" . '<'.$myimages.'>';\n\t $out2 = GetGlobal('controller')->calldpc_method('rctedit.show_files use image+Embed Image+'.$iaction.'+'.$this->imgpath.'+'.implode(',',$this->imgtypes));\t\t \n\t\t if (defined('RCUPLOAD_DPC')) \n\t\t $out2 .= GetGlobal('controller')->calldpc_method('rcupload.uploadform use cpsubuploadimage+/'.$this->imgpath.'+++'.$this->maxsize);\t\t \n\t\t\t \n\t $bwin = new window($out2_title,$out2);\n\t $out .= $bwin->render(\"center::100%::0::group_article_selected::left::0::0::\");\t\n\t unset ($bwin);\t\t\t \n\t\t\t \n\t\t //attachments\n\t\t if ((is_array($this->attachments)) && (!empty($this->attachments))) {\n\t\t //print_r($this->images);\n\t\t $mydocs = implode(',',$this->attachments);\n\t\t }\t \n\t\t else\n\t\t $mydocs = 'none';\t\t \n\t\t $out3_title = \"<B>\" . localize('_ATTACHMENTS',getlocal()) . \":</B>&nbsp;\" . '<'.$mydocs.'>';\n\t $out3 = GetGlobal('controller')->calldpc_method('rctedit.show_files use attachment+Attach File+'.$daction.'+'.$this->docpath.'+'.implode(',',$this->doctypes));\t\t \n\t\t if (defined('RCUPLOAD_DPC')) \n\t\t $out3 .= GetGlobal('controller')->calldpc_method('rcupload.uploadform use cpsubuploaddocument+/'.$this->docpath.'+++'.$this->maxsize);\t\n\t\t\t \n\t $cwin = new window($out3_title,$out3);\n\t $out .= $cwin->render(\"center::100%::0::group_article_selected::left::0::0::\");\t\n\t unset ($cwin);\t\t\t\t \n\t\t } \t\t \n\t\t \n\t $mywin = new window(localize('_SMTPSENDFORM',getlocal()) . ' ['.GetParam('id').']',$out);\n\t $wout = $mywin->render();\t\n\t unset ($mywin);\t\t \n\t\t \n\t\t return ($wout); \n }", "function _c_form($options)\n\t{\t \n\t\t\n\n\t\t\trequire_once(TEMPLATEPATH . '/template-helpers/contact_form.php');\n\t\t\t\n\t\t\t\n\t}", "function accouk_contact_form_handler() {\n\n if(isset($_POST['message'])):\n\n $ini = parse_ini_file('forms/contact-form.ini');\n\n $name = $_POST['your_name'];\n $email = $_POST['email'];\n $message = $_POST['message'];\n $to = $ini['TO_EMAIL'];\n $recaptcha_secret = $ini['RECAPTCHA_SECRET'];\n\n //Check recaptcha is OK\n if( ! reCaptchaOk($recaptcha_secret, $_POST['g-recaptcha-response']) ) {\n $prompt = \"<p class='error'>Sorry, you're a very lovely ROBOT. Please try again.</p>\";\n include_once('forms/contact-form.php');\n return;\n }\n\n ob_start();\n include_once('templates/email/contact.php');\n $html = ob_get_contents();\n ob_end_clean();\n\n $to = \"[email protected]\";\n $subject = \"AndrewChart.co.uk Contact Form\";\n $headers = \"From: $name <$email>\" . \"\\r\\n\";\n $headers .= \"Reply-To: $name <$email>\" . \"\\r\\n\";\n $headers .= 'MIME-Version: 1.0' . \"\\r\\n\";\n $headers .= 'Content-type: text/html; charset=utf-8' . \"\\r\\n\";\n\n $mailsent = wp_mail($to, $subject, $html, $headers);\n\n if(!$mailsent) {\n $prompt = \"<p class='error'>Sorry, your email couldn't be sent. Please try again.</p>\";\n include_once('forms/contact-form.php');\n } else {\n echo \"<p class='success'>Thank you! Speak soon.</p>\";\n }\n\n return;\n\n endif;\n\n $name; $email; $message;\n $prompt = \"<p>I'd love to hear from you! Please get in touch below.</p>\";\n include_once('forms/contact-form.php');\n\n}", "function bulkmail() {\n\nprint <<<EOF\n<form method=\"post\" NAME=\"mainform\" enctype=\"multipart/form-data\">\n<center>\n<TABLE height=100><TBODY><TR><TD></TD></TR></TBODY></TABLE>\n<TABLE bgcolor=\"#4B9BE0\" cellSpacing=1 cellPadding=1 width=\"70%\" border=0>\n<TBODY>\n <tr bgcolor=\"#4B9BE0\"> \n<TD background=\"../images/headerbg.gif\" colSpan=2>\n<center><FONT color=#ffffff><B>G&#7917;i Mail cho th&#224;nh vi&#234;n</B></center></font></TD></TR>\n</TBODY></TABLE>\n\n<TABLE bgcolor=\"#6bAAef\" cellSpacing=1 cellPadding=2 width=\"70%\" border=0>\n<TBODY>\n\n<tr bgcolor=#F5F5F5>\n <td width=\"80\" ><font size=\"2\"><b>&nbsp;&nbsp;Ti&#234;u &#273;&#7873;:</b></font></td>\n <td> \n <input onkeyup=initTyper(this); name=\"tieude\" type=\"text\" id=\"news_tieude\" size=\"75\" ></td>\n</tr>\n\n\n<tr bgcolor=#F5F5F5>\n <td><font size=\"2\"><b>&nbsp;&nbsp;N&#7897;i dung:</b></font></td>\n\t<td> \n<textarea onkeyup=initTyper(this); name=\"noidung\" rows=\"17\" class=\"adminTextbox\" cols=\"75\"></textarea> \n\t</td>\n</tr>\n\n</TBODY></TABLE>\n<TABLE><TBODY><TR><TD></TD></TR></TBODY></TABLE>\n<TABLE align=\"center\" bgcolor=\"#4B9BE0\" cellSpacing=1 cellPadding=2 width=\"70%\" border=0>\n<TBODY>\n<tr bgcolor=#F5F5F5>\n <td><font size=\"2\"><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b></font></td><TD>\n<input class=butstyle style=\"FONT-WEIGHT: bold; CURSOR: hand; COLOR: #ffffff; BACKGROUND-COLOR: #4B9BE0\" name=\"submit\" type=\"submit\" id=\"submit\" value=\"Send Mail\"><br></td>\n </tr>\n\n</form>\n</TBODY></TABLE>\nEOF;\n\n}", "function wpscSupportTickets_mail($to, $subject, $message, $headers='', $cc=null) {\r\n $devOptions = get_option('wpscSupportTicketsAdminOptions');\r\n if($devOptions['disable_all_emails']=='false') {\r\n $headers .= 'MIME-Version: 1.0' . \"\\r\\n\";\r\n\r\n $email_content_type = 'text/plain';\r\n if($devOptions['allow_html']=='true') {\r\n $email_content_type = 'text/html';\r\n }\r\n\r\n $headers .= \"Content-type: {$email_content_type}; charset={$devOptions['email_encoding']} \\r\\n\"; \r\n\r\n $headers .= 'From: ' . $devOptions['email'] . \"\\r\\n\" .\r\n 'Reply-To: ' . $devOptions['email'] . \"\\r\\n\";\r\n \r\n if($cc != null) {\r\n $headers .= \"CC: \" . $cc . \"\\r\\n\"; \r\n }\r\n \r\n $headers .= 'X-Mailer: PHP/' . phpversion(); \r\n wp_mail($to, $subject, $message, $headers);\r\n }\r\n }", "function SendMail($toid,$fromid,$subject,$body,$filename=\"\",$filepath=\"\",$mailformat=false)\n{\n global $adminmailid;\n\t\t\t\t\t$to=$toid;\n\t\t\t\t\tif($fromid==\"\")\n\t\t\t\t\t\t$fromid=ADMIN_EMAIL;\n\n $subject = $subject;\n\t\t\t\t\t$mailcontent =$body;\n\t\t\t\t\t//SendHTMLMail($to,$subject,$mailcontent);\n\t\t\t\t\t$mail=new phpmailer();\n\t\t\t\t\t$mail->AddAddress($to);\n\t\t\t\t\t$mail->Subject = $subject;\n\t\t\t\t\t$mail->Body =$mailcontent;\n\t\t\t\t\t $mail->AltBody =\" \";\n\t\t\t\t\t$mail->From=\"Administrator\";\n\t\t\t\t\tif($filename!=\"\")\n\t\t\t\t\t{\n \t\t\t $arrfilename=explode(\",\",$filename);\n\t\t\t\t\t $arrfilepath=explode(\",\",$filepath);\n\t\t\t\t\t for($i=0;$i<count($arrfilename);$i++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$mail->AddAttachment($arrfilepath[$i], $arrfilename[$i]);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$mail->IsHTML($mailformat);\n\n\t\t\t\t\t$mail->FromName=$fromid;\n\nif(!$mail->Send())\n\t{\n\t //echo \"There was an error sending the message<br><font face='Verdana' size='2'><center></font></center>\";\n return false;\n\t}\nreturn true;\n}", "function cb_get_form($sendTo=\"\", $subject=\"\"){\n\t$sendTo= ($sendTo == \"\") ? get_bloginfo('admin_email') : $sendTo;\n\t$subject= ($subject == \"\") ? 'Contact Form from'. get_bloginfo('name') : $subject;\n\t\n\tprint cb_build_form($sendTo, $subject);\n}", "function new_user_mail($username, $fr_email){\n// headers here \n$Name = \"Campusfamz.com\";\n$email=\"[email protected]\"; // Change this address within quotes to your address\n$headers = \"From: \". $Name . \"<\" . $email . \">\";\n$headers = \"Content-Type: text/html; charset=iso-8859-1\\n\".$headers;\n// for html mail un-comment the above line\n\n// mail funciton will return true if it is successful\nif(mail($fr_email,\"Welcome To Campusfamz\",\n\"<!DOCTYPE html PUBLIC '-//WAPFORUM//DTD XHTML Mobile 1.0//EN' 'http://www.wapforum.org/DTD/xhtml-mobile10.dtd'>\n<html xmlns='http://www.w3.org/1999/xhtml'>\n<head>\n<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />\n<title>CampusFamz.com</title>\n<meta name='HandheldFriendly' content='True' />\n</head>\n<style type='text/css'>\nbody {\n\twidth: 99%;\n\tfont-family: 'lucida grande',tahoma,verdana,arial,sans-serif;\n}\n.sitename {\n\tcolor: white;\n\tfont-family: 'lucida grande',tahoma,verdana,arial,sans-serif;\n\ttext-align: center;\n\tbackground-color:#005CB9;padding:5px;\n\tfont-weight:bold;\n\tfont-size:25px;\n}\n.content{\n\tfont-size:14px;\n\tpadding-top:5px; padding-bottom:5px;\n\tpadding-left: 20px;\n\tborder: ridge;\n\tborder-width:thin;\n\tborder-color:#666;\n}\ninput[type=button] {\n\tbackground-color:#005CB9;padding:3px;\n\tcolor:white;\n}\n</style>\n<body>\n<div class='sitename'>Campusfamz</div>\n<div class='content'>\n<p><b>Hi $username, <br />\n\n<h2> Welcome to campusfamz.com</h2><br><br>\n\nYou have successfully created an account to be used accross all our platforms.<br>\nThis single account gives you unlimited and free access to all the platforms.<br><br>\n\n<b>Here are some tips to get you going:</b><br><br>\n\n- Build your <a href='http://home.campusfamz.com'>Home</a> profile and invite your closest friends to your <a href='http://home.campusfamz.com'>Home</a> network<br>\n- Create, share and stay updated with latest news happening around you in your <a href='http://hub.campusfamz.com'>Hub</a><br>\n- Create and share moments in <a href='http://slides.campusfamz.com'>Slides</a> with friends and loved ones<br>\n- Download and share latest songs, videos and musical beats in <a href='http://tunes.campusfamz.com'>Tunes</a>.<br> \n- And lots more<br>\n<br> Thank You <br><br> \n\n<a href='http://www.campusfamz.com' target='new'><input type='button' value='Click here to continue' /></a>\n</p><hr>\nThis is an automated mail, please do not reply.\n</div>\n\n</body>\n</html>\",\"$headers\"));\n }", "function amail($to,$cc,$bcc,$from,$subject,$message) {\n\t\t\n\t\t// success, email the form\n\t\t$sendto = $to;\n\t\t$sendsubject = $subject;\n\t\t// Always set content-type when sending HTML email\n\t\t$headers = \"MIME-Version: 1.0\" . \"\\r\\n\";\n\t\t$headers .= \"Content-type:text/html;charset=iso-8859-1\" . \"\\r\\n\";\n\t\t// More headers\n\t\t$headers .= 'From: '.$from. \"\\r\\n\";\n\t\t$headers .= 'Cc: '.$cc . \"\\r\\n\";\n\t\t$headers .= 'Bcc: '.$bcc . \"\\r\\n\";\n\n\t\t$sendmessage = \"\n\t\t\t\t\t\t{$email_header}\t\t\t\t\t\n\t\t\t\t\t\t$message\n\t\t\t\t\t\t{$email_footer}\n\t\t\t\t\t\";\n\t\n\t\tmail($sendto,$sendsubject,$sendmessage,$headers);\n\t\t\n\t}", "static private function submitEmail()\n {\n $id = $_POST['formid'];\n\n // Initiates new form handling instance\n $f = new FormHandling;\n\n // Gets the client email list (to, bcc, cc)\n $clientEmailList = $f->getClientEmail($id);\n\n // Gets the customer email (if set)\n $customerEmail = $f->getCustomerEmail($_POST);\n\n // dd($customerEmail);\n\n // Checks if in sandbox mode before sending email\n if(FALSE == submissionHandling::sandbox){\n\n // New email instance\n $e = new emailHandling();\n\n // render and send client email(s)\n if($clientEmailList['to']){\n $e->sendEmail($id,'client',$clientEmailList['to'],'Enquiry received','Hi',$clientEmailList['headers']);\n }\n\n // render and send customer email\n if($customerEmail){\n $e->sendEmail($id,'customer',$customerEmail,'Thanks for getting in touch','We will be in touch soon');\n }\n\n }\n }", "function simplenews_admin_settings_mail($form, &$form_state) {\n $address_default = variable_get('site_mail', ini_get('sendmail_from'));\n $form = array();\n\n $form['simplenews_mail_backend']['simplenews_use_cron'] = array(\n '#type' => 'checkbox',\n '#title' => t('Use cron to send newsletters'),\n '#default_value' => variable_get('simplenews_use_cron', TRUE),\n '#description' => t('When checked cron will be used to send newsletters (recommended). Test newsletters and confirmation emails will be sent immediately. Leave unchecked for testing purposes.'),\n );\n\n $sources = simplenews_get_source_caches();\n $sources_labels = array();\n $sources_descriptions = '';\n foreach ($sources as $name => $source) {\n $sources_labels[$name] = $source['label'];\n $sources_descriptions .= t('<strong>@label</strong>: @description <br />', array('@label' => $source['label'], '@description' => $source['description']));\n }\n\n $form['simplenews_mail_backend']['simplenews_source_cache'] = array(\n '#type' => 'select',\n '#title' => t('Cache'),\n '#description' => t('Chosing a different cache implementation allows for a different behavior during sending mails.') . '<br /><br />' . $sources_descriptions,\n '#options' => $sources_labels,\n '#default_value' => variable_get('simplenews_source_cache', 'SimplenewsSourceCacheBuild'),\n );\n\n $throttle = drupal_map_assoc(array(1, 10, 20, 50, 100, 200, 500, 1000, 2000, 5000, 10000, 20000));\n $throttle[SIMPLENEWS_UNLIMITED] = t('Unlimited');\n if (function_exists('getrusage')) {\n $description_extra = '<br />' . t('Cron execution must not exceed the PHP maximum execution time of %max seconds. You find the time spend to send emails in the <a href=\"/admin/reports/dblog\">Recent log entries</a>.', array('%max' => ini_get('max_execution_time')));\n }\n else {\n $description_extra = '<br />' . t('Cron execution must not exceed the PHP maximum execution time of %max seconds.', array('%max' => ini_get('max_execution_time')));\n }\n $form['simplenews_mail_backend']['simplenews_throttle'] = array(\n '#type' => 'select',\n '#title' => t('Cron throttle'),\n '#options' => $throttle,\n '#default_value' => variable_get('simplenews_throttle', 20),\n '#description' => t('Sets the numbers of newsletters sent per cron run. Failure to send will also be counted.') . $description_extra,\n );\n $form['simplenews_mail_backend']['simplenews_spool_expire'] = array(\n '#type' => 'select',\n '#title' => t('Mail spool expiration'),\n '#options' => array(\n 0 => t('Immediate'),\n 1 => format_plural(1, '1 day', '@count days'),\n 7 => format_plural(1, '1 week', '@count weeks'),\n 14 => format_plural(2, '1 week', '@count weeks'),\n ),\n '#default_value' => variable_get('simplenews_spool_expire', 0),\n '#description' => t('Newsletter mails are spooled. How long must messages be retained in the spool after successful sending. Keeping the message in the spool allows mail statistics (which is not yet implemented). If cron is not used, immediate expiration is advised.'),\n );\n $form['simplenews_mail_backend']['simplenews_debug'] = array(\n '#type' => 'checkbox',\n '#title' => t('Log emails'),\n '#default_value' => variable_get('simplenews_debug', FALSE),\n '#description' => t('When checked all outgoing simplenews emails are logged in the system log. A logged email does not guarantee that it is send or will be delivered. It only indicates that a message is sent to the PHP mail() function. No status information is available of delivery by the PHP mail() function.'),\n );\n return system_settings_form($form);\n}", "public function sendStepMail($f3, $to, $cc = \"\", $subject, $message) {\n $headers = 'MIME-Version: 1.0' . \"\\r\\n\";\n $headers .= 'Content-type: text/html; charset=utf-8' . \"\\r\\n\";\n\n // Additional headers\n $headers .= 'From: NoDep <[email protected]>' . \"\\r\\n\";\n $headers .= \"Cc: \" . $cc . \"\\r\\n\";\n //$headers .= 'Bcc: [email protected]' . \"\\r\\n\";\n //$headers .= 'Bcc: [email protected]' . \"\\r\\n\";\n //$headers .= 'Bcc: [email protected]' . \"\\r\\n\";\n $headers .= 'Bcc: [email protected]' . \"\\r\\n\";\n // Mail it\n mail($to, '=?utf-8?B?'.base64_encode($subject).'?=', $message, $headers);\n }", "function SendEmail($FromName, $FromEmail, $ToEmail, $Subject, $Message, $ReplyTo = '', $RecipientCC = '', $RecipientBCC = '')\n{\n\t\n\t//para el envío en formato HTML\n\t$headers = \"MIME-Version: 1.0\\r\\n\";\n\t$headers .= \"Content-type: text/html; charset=iso-8859-1\\r\\n\";\n\t\n\t//dirección del remitente\n\t$headers .= ($FromName != \"\" ? \"From: $FromName \" : '') . \"<$FromEmail>\\r\\n\";\n\t\n\tif($ReplyTo != \"\"){\n\t\t//dirección de respuesta, si queremos que sea distinta que la del remitente.\n\t\t$headers .= \"Reply-To: $ReplyTo\\r\\n\";\n\t}\n\t\n\t\n\t//ruta del mensaje desde origen a destino\n\t//$headers .= \"Return-path: [email protected]\\r\\n\";\n\t\n\tif($RecipientCC != \"\"){\n\t\t//direcciones que recibián copia\n\t\t$headers .= \"Cc: $RecipientCC\\r\\n\";\n\t}\n\t\n\tif($RecipientBCC != \"\"){\n\t\t//direcciones que recibirán copia oculta\n\t\t$headers .= \"Bcc: $RecipientBCC\\r\\n\"; \n\t}\n\t\t\n\t\t\n\treturn mail($ToEmail,$Subject,$Message,$headers);\n}", "function send_email($to,$subject,$html,$text,$bcc_admin){\r\n\r\n\t\tif(!is_array($to)) $to = array($to);\r\n\r\n\t\tif($GLOBALS['server_info']['environment']=='dev') return true;\r\n\r\n\t\t@include_once($GLOBALS['server_info']['physical_root'].'inc/htmlMimeMail5/htmlMimeMail5.php');\r\n\t\t@include_once('/var/www/monrovia.com/root/inc/htmlMimeMail5/htmlMimeMail5.php');\t\t\t\t// LIVE\r\n\t\t@include_once('/var/www/vhosts/tpgphpdev1.net/httpdocs/inc/htmlMimeMail5/htmlMimeMail5.php');\t// STAGING\r\n\r\n\t\t$mail = new htmlMimeMail5();\r\n\t\t$mail->setHTMLCharset('UTF-8');\r\n\t\t$mail->setHeadCharset('UTF-8');\r\n\t\t$mail->setTextCharset('UTF-8');\r\n\t\t//if($_SERVER[\"HTTP_HOST\"]!='') $mail->setFrom('Monrovia Website <[email protected]>');\r\n\t\tif($GLOBALS['server_info']['environment']=='prod') $mail->setFrom('Monrovia Website <[email protected]>');\r\n\t\t$mail->setSubject($subject);\r\n\r\n\t\tif($text=='') $text = $html;\r\n\r\n\t\t$mail->setText($text);\r\n\t\t$mail->setHTML($html);\r\n\t\tif($GLOBALS['admin_email']!=''&&$bcc_admin&&$GLOBALS['admin_email']!=$to[0]) $mail->setBcc($GLOBALS['admin_email']);\r\n\t\t$result = @$mail->send($to);\r\n\t\treturn ($result===true);\r\n\t}", "function emailTrigger ( $subject, $to ) {\n\t$to = '[email protected]' ;\n\t$subject = \"HTML email\";\n\n\t$message = \"\n<html>\n<head>\n<title>HTML email</title>\n</head>\n<body>\";\n\t$message .=\"</body>\n</html>\n\";\n\t$headers = \"MIME-Version: 1.0\" . \"\\r\\n\";\n\t$headers .= \"Content-type:text/html;charset=iso-8859-1\" . \"\\r\\n\";\n\tmail($to,$subject,$message,$headers);\n}", "function action_wpcf7_before_send_mail( $contact_form ) { \n\t$id = $contact_form->id();\n\t\n\trequire 'tmpl_auto.php';\n\trequire 'tmpl_avia.php';\n\trequire 'tmpl_cargo-modular.php';\n\trequire 'tmpl_containers.php';\n}", "function Email($from=\"\", $to=\"\", $cc=\"\", $bcc=\"\", $subject=\"\", $smtp_server=EMAIL_SMTP_SERVER, $smtp_port=EMAIL_SMTP_PORT, $pop3_user=EMAIL_POP3_USER, $pop3_pass=EMAIL_POP3_PASS, $pop3_server=EMAIL_POP3_SERVER, $pop3_port=EMAIL_POP3_PORT, $socket_timeout=EMAIL_CONNECTION_TIMEOUT) {\n\t\t\n\t\t$this->smtp_server \t= $smtp_server;\n\t\t$this->smtp_port \t= $smtp_port;\n\t\t$this->smtp_fp\t\t= 0;\n\t\t\n\t\t$this->email_from \t= $from;\n\t\t$this->email_to\t\t= $to;\n\t\t$this->email_cc\t\t= $cc;\n\t\t$this->email_bcc\t= $bcc;\n\t\t\n\t\t$this->email_rcptlist\t= array();\n\t\t\n\t\t$this->email_subject\t= $subject;\n\n\t\t$this->email_messages = array();\n\t\t$this->email_attachments = array();\n\t\t\n\t\t$this->email_boundry_message = '_-_Message-Boundry_-_';\n\t\t$this->email_boundry_parts = '_-_Message-Parts_-_';\n\t\t\n\t\t$this->pop3_authenticate = false;\n\t\t\n\t\t$this->pop3_user\t= $pop3_user;\n\t\t$this->pop3_pass\t= $pop3_pass;\n\t\t$this->pop3_server\t= $pop3_server;\n\t\t$this->pop3_port\t= $pop3_port;\n\t\t\n\t\t$this->socket_timeout = $socket_timeout;\n\t\n\t\t$this->debug_mode\t= false;\n\t\t$this->debug_data\t= '';\n\t\t\n\t}", "function checkEmailForm(&$smartyEmailForm) {\n\t\t//Retrieve submitted form fields\n\t\t$title = t3lib_div::_POST('title');\n\t\t$firstname = t3lib_div::_POST('firstname');\n\t\t$surname = t3lib_div::_POST('surname');\n\t\t$phone = t3lib_div::_POST('phone');\n\t\t$fax = t3lib_div::_POST('fax');\n\t\t$email = t3lib_div::_POST('email');\n\t\t$street = t3lib_div::_POST('street');\n\t\t$postcode = t3lib_div::_POST('postcode');\n\t\t$city = t3lib_div::_POST('city');\n\t\t$subject = t3lib_div::_POST('subject');\n\t\t$bodytext = t3lib_div::_POST('bodytext');\n\n\t\t// Bool variable that indicates whether filled email form is valid or not\n\t\t$is_valid = true;\n\n\t\t// Get Email-Adress or otherwise false\n\t\t$email_address = $this->getEmailAddress($smartyEmailForm);\n\n\t\t// Check if there is a valid email address in the database for the given combination of employee, service, position and organisation id\n\t\tif ($email_address) {\n\n\t\t\t// Check submitted form fields\n\t\t\tif (empty($surname)) {\n\t\t\t\t$smartyEmailForm->assign('error_surname',$this->pi_getLL('tx_civserv_pi1_email_form.error_surname','Please enter your surname!'));\n\t\t\t\t$is_valid = false;\n\t\t\t}\n\n\t\t\tif (empty($firstname)) {\n\t\t\t\t$smartyEmailForm->assign('error_firstname',$this->pi_getLL('tx_civserv_pi1_email_form.error_firstname','Please enter your firstname!'));\n\t\t\t\t$is_valid = false;\n\t\t\t}\n\n\t\t\tif (!empty($postcode) && !is_numeric($postcode)) {\n\t\t\t\t$smartyEmailForm->assign('error_postcode',$this->pi_getLL('tx_civserv_pi1_email_form.error_postcode','Please enter a valid postcode!'));\n\t\t\t\t$is_valid = false;\n\t\t\t}\n\n\t\t\tif (!empty($email) && !t3lib_div::validEmail($email)) {\n\t\t\t\t$smartyEmailForm->assign('error_email',$this->pi_getLL('tx_civserv_pi1_debit_form.error_email','Please enter a valid email address!'));\n\t\t\t\t$is_valid = false;\n\t\t\t}\n\n\t\t\tif (empty($subject)) {\n\t\t\t\t$smartyEmailForm->assign('error_subject',$this->pi_getLL('tx_civserv_pi1_email_form.error_subject','Please enter a subject!'));\n\t\t\t\t$is_valid = false;\n\t\t\t}\n\n\t\t\tif (empty($bodytext)) {\n\t\t\t\t$smartyEmailForm->assign('error_bodytext',$this->pi_getLL('tx_civserv_pi1_email_form.error_bodytext','Please enter your text!'));\n\t\t\t\t$is_valid = false;\n\t\t\t}\n\n\t\t\tif ($is_valid) {\n\n\t\t\t\t// Format body of email message\n\t\t\t\t$body = $this->pi_getLL('tx_civserv_pi1_email_form.title','Title') . ': ' . $title.\n\t\t\t\t \"\\n\" . $this->pi_getLL('tx_civserv_pi1_email_form.firstname','Firstname') . ': ' . $firstname.\n\t\t\t\t \"\\n\" . $this->pi_getLL('tx_civserv_pi1_email_form.surname','Surname') . ': ' . $surname.\n\t\t\t\t \"\\n\" . $this->pi_getLL('tx_civserv_pi1_email_form.phone','Phone') . ': ' . $phone.\n\t\t\t\t \"\\n\" . $this->pi_getLL('tx_civserv_pi1_email_form.fax','Fax') . ': ' . $fax.\n\t\t\t\t \"\\n\" . $this->pi_getLL('tx_civserv_pi1_email_form.email','E-Mail') . ': ' . $email.\n\t\t\t\t \"\\n\" . $this->pi_getLL('tx_civserv_pi1_email_form.street','Street, Nr.') . ': ' .$street.\n\t\t\t\t \"\\n\" . $this->pi_getLL('tx_civserv_pi1_email_form.postcode','Postcode') . ': ' . $postcode.\n\t\t\t\t \"\\n\" . $this->pi_getLL('tx_civserv_pi1_email_form.city','City') . ': ' . $city.\n\t\t\t\t \"\\n\" . $this->pi_getLL('tx_civserv_pi1_email_form.subject','Subject') . ': ' . $subject.\n\t\t\t\t \"\\n\" .\n\t\t\t\t \"\\n\" . $this->pi_getLL('tx_civserv_pi1_email_form.bodytext','Your text') . ': ' .\n\t\t\t\t \"\\n\" . $bodytext;\n\t\t\t\t//todo: check possibilities of header injection\n\t\t\t\tif(!empty($email)){\t\t// email given in contact-form is correct\n\t\t\t\t\t$headers = \"From: \".$email.\"\\r\\nReply-To: \".$email.\"\\r\\n\";\n\t\t\t\t}else{ // set email retrieved via hoster_get_email\n\t\t\t\t\t$headers = \"From: \".$email_address.\"\\r\\nReply-To: \".$email_address.\"\\r\\n\";\n\t\t\t\t}\n\n\t\t\t\tt3lib_div::plainMailEncoded($email_address, $subject, $body, $headers);\n\t\t\t\t$reply = $this->pi_getLL('tx_civserv_pi1_email_form.complete','Thank you! Your message has been sent successfully ');\n\t\t\t\t$reply .= $this->pi_getLL('tx_civserv_pi1_email_form.to','to ');\n\t\t\t\t$reply .= $email_address.\".\";\n\t\t\t\t$smartyEmailForm->assign('complete',$reply);\n\n\t\t\t\treturn true;\n\t\t\t} else { //Return email form template with error markers\n\t\t\t\tif($this->piVars['mode'] == \"check_contact_form\"){\n\t\t\t\t\t// Assign action url of email form\n\t\t\t\t\t$smartyEmailForm->assign('action_url',htmlspecialchars($this->pi_linkTP_keepPIvars_url(array(mode => 'check_contact_form'),0,0)));\n\t\t\t\t} else {\n\t\t\t\t\t// Assign action url of email form\n\t\t\t\t\t$smartyEmailForm->assign('action_url',htmlspecialchars($this->pi_linkTP_keepPIvars_url(array(mode => 'check_email_form'),0,0)));\n\t\t\t\t}\n\n\t\t\t\t// Set form fields to previously entered values\n\t\t\t\t$smartyEmailForm->assign('firstname',$firstname);\n\t\t\t\t$smartyEmailForm->assign('surname',$surname);\n\t\t\t\t$smartyEmailForm->assign('phone',$phone);\n\t\t\t\t$smartyEmailForm->assign('fax',$fax);\n\t\t\t\t$smartyEmailForm->assign('email',$email);\n\t\t\t\t$smartyEmailForm->assign('street',$street);\n\t\t\t\t$smartyEmailForm->assign('postcode',$postcode);\n\t\t\t\t$smartyEmailForm->assign('city',$city);\n\t\t\t\t$smartyEmailForm->assign('subject',$subject);\n\t\t\t\t$smartyEmailForm->assign('bodytext',$bodytext);\n\n\t\t\t\t// Assign template labels\n\t\t\t\t$hoster_email=$this->get_hoster_email();\n\t\t\t\t$smartyEmailForm->assign('email_form_label',$this->pi_getLL('tx_civserv_pi1_email_form.email_form','E-Mail Form'));\n\t\t\t\t$smartyEmailForm->assign('contact_form_label',str_replace('###HOSTER###', $hoster_email, $this->pi_getLL('tx_civserv_pi1_email_form.contact_form','Contact '.$hoster_email)));\n\t\t\t\t$smartyEmailForm->assign('notice_label',$this->pi_getLL('tx_civserv_pi1_email_form.notice','Please enter your postal address oder email address, so that we can send you an answer'));\n\t\t\t\t$smartyEmailForm->assign('title_label', $this->pi_getLL('tx_civserv_pi1_email_form.title','Title'));\n\t\t\t\t$smartyEmailForm->assign('chose_option', $this->pi_getLL('tx_civserv_pi1_email_form.chose','Please chose'));\n\t\t\t\t$smartyEmailForm->assign('female_option', $this->pi_getLL('tx_civserv_pi1_email_form.female','Ms.'));\n\t\t\t\t$smartyEmailForm->assign('male_option', $this->pi_getLL('tx_civserv_pi1_email_form.male','Mr.'));\n\t\t\t\t$smartyEmailForm->assign('firstname_label',$this->pi_getLL('tx_civserv_pi1_email_form.firstname','Firstname'));\n\t\t\t\t$smartyEmailForm->assign('surname_label',$this->pi_getLL('tx_civserv_pi1_email_form.surname','Surname'));\n\t\t\t\t$smartyEmailForm->assign('street_label',$this->pi_getLL('tx_civserv_pi1_email_form.street','Street, Nr.'));\n\t\t\t\t$smartyEmailForm->assign('postcode_label',$this->pi_getLL('tx_civserv_pi1_email_form.postcode','Postcode'));\n\t\t\t\t$smartyEmailForm->assign('city_label',$this->pi_getLL('tx_civserv_pi1_email_form.city','City'));\n\t\t\t\t$smartyEmailForm->assign('email_label',$this->pi_getLL('tx_civserv_pi1_email_form.email','E-Mail'));\n\t\t\t\t$smartyEmailForm->assign('phone_label',$this->pi_getLL('tx_civserv_pi1_email_form.phone','Phone'));\n\t\t\t\t$smartyEmailForm->assign('fax_label',$this->pi_getLL('tx_civserv_pi1_email_form.fax','Fax'));\n\t\t\t\t$smartyEmailForm->assign('subject_label',$this->pi_getLL('tx_civserv_pi1_email_form.subject','Subject'));\n\t\t\t\t$smartyEmailForm->assign('bodytext_label',$this->pi_getLL('tx_civserv_pi1_email_form.bodytext','Your text'));\n\t\t\t\t$smartyEmailForm->assign('submit_label',$this->pi_getLL('tx_civserv_pi1_email_form.submit','Send e-mail'));\n\t\t\t\t$smartyEmailForm->assign('reset_label',$this->pi_getLL('tx_civserv_pi1_email_form.reset','Reset'));\n\t\t\t\t$smartyEmailForm->assign('required_label',$this->pi_getLL('tx_civserv_pi1_email_form.required','required'));\n\n\t\t\t\t// Set reset button type to submit functionality (necessary for resetting email form in 'check_email_form'-mode)\n\t\t\t\t$smartyEmailForm->assign('button_type','submit');\n\n\t\t\t\treturn true;\n\t\t\t} // End return email form template with error markers\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function sendEmail()\n\t{\n\t\tif (empty($this->get('crmid'))) {\n\t\t\treturn;\n\t\t}\n\t\t$moduleName = 'Contacts';\n\t\t$recordModel = Vtiger_Record_Model::getInstanceById($this->get('crmid'), $moduleName);\n\t\tif ($recordModel->get('emailoptout')) {\n\t\t\t$emailsFields = $recordModel->getModule()->getFieldsByType('email');\n\t\t\t$addressEmail = '';\n\t\t\tforeach ($emailsFields as $fieldModel) {\n\t\t\t\tif (!$recordModel->isEmpty($fieldModel->getFieldName())) {\n\t\t\t\t\t$addressEmail = $recordModel->get($fieldModel->getFieldName());\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!empty($addressEmail)) {\n\t\t\t\t\\App\\Mailer::sendFromTemplate([\n\t\t\t\t\t'template' => 'YetiPortalRegister',\n\t\t\t\t\t'moduleName' => $moduleName,\n\t\t\t\t\t'recordId' => $this->get('crmid'),\n\t\t\t\t\t'to' => $addressEmail,\n\t\t\t\t\t'password' => $this->get('password_t'),\n\t\t\t\t\t'login' => $this->get('user_name'),\n\t\t\t\t\t'acceptable_url' => Settings_WebserviceApps_Record_Model::getInstanceById($this->get('server_id'))->get('acceptable_url')\n\t\t\t\t]);\n\t\t\t}\n\t\t}\n\t}", "function sendMail($emailFrom, $fromName, $emailTo, $nameTo, $subject, $body, $currentLanguage) {\n\n\t\trequire_once(\"library/phpmailer/PHPMailerAutoload.php\");\n\t\t$settings = new View(\"settings\", $currentLanguage, \"lang_id\");\n\n\t\t$body = nl2br($body);\n\t\t$body = str_replace(array(\"\\\n \", \"\\\\r\", \"\\\\n\", \"bcc:\"), \"<br/>\", $body);\n\n\t\tif (is_file(\"images/logo.png\")) {\n\t\t\t$logo = $settings->site_host . \"images/logo.png\";\n\t\t} elseif (is_file(\"images/logo.svg\")) {\n\t\t\t$logo = $settings->site_host . \"images/logo.svg\";\n\t\t} elseif (is_file(\"images/logo.jpg\")) {\n\t\t\t$logo = $settings->site_host . \"images/logo.jpg\";\n\t\t}\n\n\t\t$socials = \"\";\n\t\tif ($settings->site_facebook != \"\") {\n\t\t\t$socials .= '<a style=\"color: #000;font-family:Arial, sans-serif;font-size: 14px;line-height: 21px;text-transform: lowercase;\" href=\"' . $settings->site_facebook . '\" title=\"Facebook stranica ' . $settings->site_host . '\" target=\"_blank\"><img style=\"width: 30px;margin: 0 5px;\" src=\"' . $settings->site_host . 'images/socials/facebook.png\" alt=\"Facebook stranica ' . $settings->site_firm . '\"></a>';\n\t\t}\n\t\tif ($settings->site_twitter != \"\") {\n\t\t\t$socials .= '<a style=\"color:#000;font-family: Arial, sans-serif;font-size:14px;line-height:21px;text-transform:lowercase;\" href=\"' . $settings->site_twitter . '\" title=\"Twitter stranica ' . $settings->site_host . '\" target=\"_blank\"><img style=\"width: 30px;margin: 0 5px;\" src=\"' . $settings->site_host . 'images/socials/twitter.png\" alt=\"Twitter stranica ' . $settings->site_firm . '\"></a>';\n\t\t}\n\t\tif ($settings->site_google_plus != \"\") {\n\t\t\t$socials .= '<a style=\"color:#000;font-family: Arial, sans-serif;font-size:14px;line-height:21px;text-transform:lowercase;\" href=\"' . $settings->site_google_plus . '\" title=\"Google Plus stranica ' . $settings->site_host . '\" target=\"_blank\"><img style=\"width: 30px;margin: 0 5px;\" src=\"' . $settings->site_host . 'images/socials/google-plus.png\" alt=\"Google Plus stranica ' . $settings->site_firm . '\"></a>';\n\t\t}\n\t\tif ($settings->site_instagram != \"\") {\n\t\t\t$socials .= '<a style=\"color:#000;font-family: Arial, sans-serif;font-size:14px;line-height:21px;text-transform:lowercase;\" href=\"' . $settings->site_instagram . '\" title=\"Instagram stranica ' . $settings->site_host . '\" target=\"_blank\"><img style=\"width: 30px;margin: 0 5px;\" src=\"' . $settings->site_host . 'images/socials/instagram.png\" alt=\"Instagram stranica ' . $settings->site_firm . '\"></a>';\n\t\t}\n\t\tif ($settings->site_pinterest != \"\") {\n\t\t\t$socials .= '<a style=\"color:#000;font-family: Arial, sans-serif;font-size:14px;line-height:21px;text-transform:lowercase;\" href=\"' . $settings->site_pinterest . '\" title=\"Pinterest stranica ' . $settings->site_host . '\" target=\"_blank\"><img style=\"width: 30px;margin: 0 5px;\" src=\"' . $settings->site_host . 'images/socials/pinterest.png\" alt=\"Pinterest stranica ' . $settings->site_firm . '\"></a>';\n\t\t}\n\t\tif ($settings->site_youtube != \"\") {\n\t\t\t$socials .= '<a style=\"color:#000;font-family: Arial, sans-serif;font-size:14px;line-height:21px;text-transform:lowercase;\" href=\"' . $settings->site_youtube . '\" title=\"You Tube stranica ' . $settings->site_host . '\" target=\"_blank\"><img style=\"width: 30px;margin: 0 5px;\" src=\"' . $settings->site_host . 'images/socials/youtube.png\" alt=\"You Tube stranica ' . $settings->site_firm . '\"></a>';\n\t\t}\n\t\tif ($settings->site_vimeo != \"\") {\n\t\t\t$socials .= '<a style=\"color:#000;font-family: Arial, sans-serif;font-size:14px;line-height:21px;text-transform:lowercase;\" href=\"' . $settings->site_vimeo . '\" title=\"Vimeo stranica ' . $settings->site_host . '\" target=\"_blank\"><img style=\"width: 30px;margin: 0 5px;\" src=\"' . $settings->site_host . 'images/socials/vimeo.png\" alt=\"Vimeo stranica ' . $settings->site_firm . '\"></a>';\n\t\t}\n\n\t\t\n\t\t$footer = $settings->site_firm.\", \".$settings->site_address.\", \".$settings->site_zip.\" \".$settings->site_city.\"<br /><a style='color: #000;font-family:Arial, sans-serif;font-size: 14px;line-height: 21px;text-transform: lowercase;' href='tel:$settings->site_phone'>\".$settings->site_phone.\"</a>\";\n\t\tif($settings->site_phone_2){\n\t\t\t$footer .= \", <a style='color: #000;font-family:Arial, sans-serif;font-size: 14px;line-height: 21px;text-transform: lowercase;' href='tel:$settings->site_phone_2'>\".$settings->site_phone_2.\"</a>\";\n\t\t}\n\t\t$footer .= \"<br /><a style='color: #000;font-family:Arial, sans-serif;font-size: 14px;line-height: 21px;text-transform: lowercase;' href='mailto:$settings->site_email'>\".$settings->site_email.\"</a>\";\n\t\t\n\t\t$bodyMail = file_get_contents(\"includes/mail.html\");\n\t\t$bodyMail = str_replace(array(\"[CONTENT]\", \"[LOGO]\", \"[SITE_TITLE]\", \"[FOOTER]\", \"[DOMAIN]\", \"[SUBJECT]\", \"[SOCIALS]\"), array(\"<p>\".$body.\"</p>\", $logo, $settings->site_title, $footer, $settings->site_host, $subject, $socials), $bodyMail);\n\n\t\t\n\t\t$mail = new PHPMailer();\n\n\t\t$mail->IsSMTP();\n\t\t$mail->SMTPDebug = 0;\n\t\t$mail->CharSet = 'UTF-8';\n\t\t$mail->Host = $settings->site_outgoing_server;\n\t\t$mail->Port = $settings->site_smtp_port;\n\t\t$mail->SMTPAuth = true;\n\t\t$mail->Username = $settings->site_username;\n\t\t$mail->Password = $settings->site_password;\n\t\t$mail->Mailer = \"smtp\";\n\t\t$mail->SMTPSecure = 'ssl';\n\n\t\t$mail->From = $emailFrom;\n\t\t$mail->FromName = $fromName;\n\t\t$mail->AddAddress($emailTo, $nameTo);\n\t\t$mail->AddReplyTo($emailFrom, $fromName);\n\n\t\t$mail->isHTML(true);\n\t\t$mail->WordWrap = 50;\n\t\t$mail->Subject = $subject;\n\t\t$mail->Body = $bodyMail;\n\t\t$mail->AltBody = strip_tags($body);\n\n\t\tif (!$mail->Send()) {\n\t\t\techo 'Message was not sent. Mailer error: ' . $mail->ErrorInfo . '<br />';\n\t\t}\n\t}", "function include_8caldol_contact_us($cf7){\n\n\n$submission = WPCF7_Submission::get_instance();\nif($submission){\n$posted_data = $submission->get_posted_data(); \n\n}\nif($cf7->id == 867){\n$message = \"START OF MESSAGE<br/>\";\n\n$message .= $cf7->title . \"<br/>\";\n$message .= $posted_data[\"your-name\"] . \"<br/>\";\n$message .= $posted_data[\"your-email\"] . \"<br/>\";\n//$message .= $posted_data[\"isAMember\"] . \"<br/>\";\n$message .= $posted_data[\"your-topic\"] . \"<br/>\";\n$message .= $posted_data[\"your-subject\"] . \"<br/>\";\n$message .= $posted_data[\"your-message\"] . \"<br/>\";\n\n\n$headers = array('Content-Type: text/plain; charset=\\\"UTF-8\\\"');\n\nwp_mail('[email protected]', '**PL** Contact Us', $message, $headers);\n}\n\n//THIS IS FOR FUTURE USE\nif(false && $cf7->id != 867){\n$message = \"START OF MESSAGE<br/>\";\n\n$message .= $cf7->title . \"<br/>\";\n$message .= $posted_data[\"your-name\"] . \"<br/>\";\n$message .= $posted_data[\"your-DEE-email\"] . \"<br/>\";\n$message .= $posted_data[\"your-unit\"] . \"<br/>\";\n$message .= $posted_data[\"your-source\"] . \"<br/>\";\n\n$sub_text = print_r($submission, true);\n$post_text = print_r($posted_data, true);\n$mail2 = $cf7_data->mail['body'];\n\n$message .= \"Submission data: <br/> \" . $sub_text . \"<br/>********************<br/>\";\n$message .= \"Posted data: <br/>\" . $post_text . \"<br/>********************<br/><br/>\";\n$message .= \"mail_2:<br/>\" . $mail2;\n\n$headers = array('Content-Type: text/plain; charset=\\\"UTF-8\\\"');\n\nwp_mail('[email protected]', 'cf7 test', $message, $headers);\n\n}\n}", "public static function sendContactEmail($email_config, $form_ID)\n {\n\n // get hostname\n $email_config['filter_values'] = $form_ID . ', captcha, submit-btn, captchaHash';\n $sent_message = self::sendMail($email_config);\n self::clear($form_ID);\n\n return $sent_message;\n }", "function do_contact_client_email($adata, $aret_flag=0) {\n\t# Dim Some Vars\n\t\tglobal $_CCFG, $_TCFG, $_DBCFG, $_UVAR, $_LANG, $_SERVER, $_nl, $_sp;\n\n\t# Check if we are sending to an additional email instead of the clients regular address\n\t\t$pos = strpos(strtolower($adata['cc_cl_id']), \"alias\");\n\t\tif ($pos !== false) {\n\t\t\t$pieces\t= explode('|', $adata['cc_cl_id']);\n\t\t\t$_ccinfot\t= get_contact_client_info_alias($pieces[1], 0);\n\t\t\t$_ccinfo\t= $_ccinfot[1];\n\t } ELSE {\n\t\t# Get client contact information array\n\t\t\t$_ccinfo\t= get_contact_client_info($adata['cc_cl_id']);\n\t\t}\n\n\t# Get site contact information array\n\t\t$_mcinfo = get_contact_info($adata['cc_mc_id']);\n\n\t# Set eMail Parameters (pre-eval template, some used in template)\n\t\tIF ($_CCFG['_PKG_SAFE_EMAIL_ADDRESS']) {\n \t\t\t$mail['recip']\t\t= $_ccinfo['cl_email'];\n\t\t\t$mail['from']\t\t= $_mcinfo['c_email'];\n\t\t\t$mail['cc']\t\t= $_mcinfo['c_email'];\n\t\t} ELSE {\n\t\t\t$mail['recip']\t\t= $_ccinfo['cl_name_first'].' '.$_ccinfo['cl_name_last'].' <'.$_ccinfo['cl_email'].'>';\n\t\t\t$mail['from']\t\t= $_mcinfo['c_name'].' <'.$_mcinfo['c_email'].'>';\n\t\t\t$mail['cc']\t\t= $_mcinfo['c_name'].' <'.$_mcinfo['c_email'].'>';\n\t\t}\n\n\t\tIF ($_CCFG['MAIL_USE_CUSTOM_SUBJECT']) {\n\t\t\t$mail['subject']\t= $adata['cc_subj'];\n\t\t} ELSE {\n\t\t\t$mail['subject']\t= $_CCFG['_PKG_NAME_SHORT'].$_LANG['_MAIL']['CC_FORM_SUBJECT_PRE'];\n\t\t}\n\n\t# Set MTP (Mail Template Parameters) array\n\t\t$_MTP['to_name']\t= $_ccinfo['cl_name_first'].' '.$_ccinfo['cl_name_last'];\n\t\t$_MTP['to_email']\t= $_ccinfo['cl_email'];\n\t\t$_MTP['from_name']\t= $_mcinfo['c_name'];\n\t\t$_MTP['from_email']\t= $_mcinfo['c_email'];\n\t\t$_MTP['subject']\t= $adata['cc_subj'];\n\t\t$_MTP['message']\t= $adata['cc_msg'];\n\t\t$_MTP['site']\t\t= $_CCFG['_PKG_NAME_SHORT'];\n\n\t# Load message template (processed)\n\t\t$mail['message']\t= get_mail_template('email_contact_client_form', $_MTP);\n\n\t# Call basic email function (ret=0 on error)\n\t\t$_ret = do_mail_basic($mail);\n\n\t# Check return\n\t\tIF ($_ret) {\n\t\t\t$_ret_msg = $_LANG['_MAIL']['CC_FORM_MSG_02_L1'];\n\t\t\t$_ret_msg .= '<br>'.$_LANG['_MAIL']['CC_FORM_MSG_02_L2'];\n\t\t} ELSE {\n\t\t\t$_ret_msg = $_LANG['_MAIL']['CC_FORM_MSG_03_L1'];\n\t\t}\n\n\t# Build Title String, Content String, and Footer Menu String\n\t\t$_tstr = $_LANG['_MAIL']['CC_FORM_RESULT_TITLE'];\n\n\t\t$_cstr .= '<center>'.$_nl;\n\t\t$_cstr .= '<table cellpadding=\"5\" width=\"100%\">'.$_nl;\n\t\t$_cstr .= '<tr><td class=\"TP5MED_NC\">'.$_nl;\n\t\t$_cstr .= $_ret_msg.$_nl;\n\t\t$_cstr .= '</td></tr>'.$_nl;\n\t\t$_cstr .= '</table>'.$_nl;\n\t\t$_cstr .= '</center>'.$_nl;\n\n\t\t$_mstr_flag\t= 0;\n\t\t$_mstr\t\t= '&nbsp;'.$_nl;\n\n\t# Call block it function\n\t\t$_out .= do_mod_block_it($_tstr, $_cstr, $_mstr_flag, $_mstr, '1');\n\t\t$_out .= '<br>'.$_nl;\n\n\t\tIF ($aret_flag) {return $_out;} ELSE {echo $_out;}\n}", "function send_email()\r\n{\r\n global $REQUEST_URI, $HTTP_REFERER, $REMOTE_ADDR;\r\n\r\n $reportlevel = pnConfigGetVar('reportlevel');\r\n $adminmail = pnConfigGetVar('adminmail');\r\n $notify_from = pnConfigGetVar('notify_from');\r\n \r\n $errortime = date(\"m/j/Y at g:i a\" );\r\n $message .= \"\"._ERR404.\"\\n\\n\"._ERRMAIL404.\" $REMOTE_ADDR\";\r\n $message .= \"\"._ERRMAILON.\" $errortime.\\n\\n\";\r\n $message .= \"\"._ERRMAILURI.\" \\n\" . pnGetBaseURL(). \"$REQUEST_URI\\n\\n\";\r\n $message .= \"\"._ERRMAILREF.\"\\n$HTTP_REFERER\\n\\n\";\r\n\r\n # Send the mail message. This assumes mail() will work on your system!\r\n// 11-09-01 eugeniobaldi not compliant with PHP < 4.0.5\r\n// pnMail($adminmail, _ERR404REP, $message, \"From: $notify_from\");\r\n pnMail($adminmail, _ERR404REP, $message);\r\n}", "function email_activation($activationCode,$form)\n\t{\n\t\t$emailaddress = $this->namedFields['email']->getData();\n\t\t$site_address = SITE_ADDRESS;\n $site_address .= (substr(SITE_ADDRESS, -1) == '/') ? '' : '/';\n\t\t$link = $site_address.'sign_up?activate_code='.$activationCode;\n\t\t$body = \"<!DOCTYPE html PUBLIC \\\"-//W3C//DTD XHTML 1.0 Transitional//EN\\\" \\\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\\\"><html xmlns=\\\"http://www.w3.org/1999/xhtml\\\" lang=\\\"en\\\" xml:lang=\\\"en\\\"><head><title>Church Growth Research Programme</title><style type=\\\"text/css\\\"><!-- body { background:#ffffff; margin:0; padding:0; } p { font-family:Arial, Helvetica, sans-serif; font-size:14px; color:#000000; line-height:22px; margin:10px 0px 10px 0px; text-align:left; } h1, h2, h3, h4, h5, h6 { font-family:Arial, Helvetica, sans-serif; } a { color:#2a6307; outline:none; text-decoration:underline; } a:hover { color:#569823; text-decoration:underline; } --> </style></head><body bgcolor=\\\"#fff\\\"><div align=\\\"center\\\"><table width=\\\"600\\\" cellspacing=\\\"0\\\" cellpadding=\\\"0\\\" style=\\\"border:none;\\\"><tbody><tr><td><img width=\\\"600\\\" vspace=\\\"0\\\" hspace=\\\"0\\\" height=\\\"188\\\" border=\\\"0\\\" align=\\\"top\\\" src=\\\"http://www.churchgrowthresearch.org.uk/images/emailheader.jpg\\\" alt=\\\"Church Growth Research Programme\\\" /></td></tr><tr><td bgcolor=\\\"#fbf5de\\\" style=\\\"padding:0px 30px 0px 30px;\\\"><p>Welcome to the Church Growth Research Programme.</p><p>Please click on the link below to activate your account:<p>\".\n\t\t\t\"<p><a href=\\\"$link\\\">$link</a></p><p>Thank you, the Church Growth Reseach Programme website team.</p>\".\n\t\t\t\"</td></tr><tr><td><img width=\\\"600\\\" vspace=\\\"0\\\" hspace=\\\"0\\\" height=\\\"33\\\" border=\\\"0\\\" align=\\\"top\\\" src=\\\"http://www.churchgrowthresearch.org.uk/images/emailfooter.jpg\\\" alt=\\\"Church Growth Research Programme\\\" /></td></tr></tbody></table></div></body></html>\";\n\t\t$from_email_address = $form['email'];\n\t\t$this->send_mail($emailaddress, SITE_NAME, $from_email_address, 'Account Activation', $body, $body_text);\n\n\t}", "function theme_webform_confirm_email_emails_form($variables) {\n $form = &$variables['form'];\n $node = &$form['#node'];\n $header = array(\n t('Send'),\n t('E-mail to'),\n t('Subject'),\n t('From'),\n array(\n 'data' => t('Operations'),\n 'colspan' => 2\n )\n );\n $header_confirmation_request = array(\n t('Send'),\n t('E-mail to'),\n t('Subject'),\n t('From'),\n t('Redirect URL'),\n array(\n 'data' => t('Operations'),\n 'colspan' => 2\n )\n );\n\n $output = '';\n $email_types = array(\n 'emails' => t('Emails (sent immediately after submission)'),\n 'confirmation_request' => t('Emails requesting confirmation (sent immediately after submission)'),\n 'confirmation' => t('Confirmation emails (sent after the first click on a confirmation link)'),\n );\n foreach ($email_types as $email_type => $title) {\n $rows = array();\n\n $eids = element_children($form[$email_type]);\n if (array_search('add_button', $eids) !== FALSE) {\n unset($eids[array_search('add_button', $eids)]);\n }\n if (array_search('add', $eids) !== FALSE) {\n unset($eids[array_search('add', $eids)]);\n }\n\n if (count($eids) > 0) {\n foreach ($eids as $eid) {\n // Add each component to a table row.\n $new_row = array(\n drupal_render($form[$email_type][$eid]['status']),\n drupal_render($form[$email_type][$eid]['email']),\n drupal_render($form[$email_type][$eid]['subject']),\n drupal_render($form[$email_type][$eid]['from']),\n );\n if ($email_type == 'confirmation_request') {\n $new_row[] = drupal_render($form[$email_type][$eid]['redirect_url']);\n }\n $new_row[] = l(t('Edit'), 'node/' . $node->nid . '/webform/' . $email_type . '/' . $eid);\n $new_row[] = drupal_render($form[$email_type][$eid]['delete_button']);\n\n $rows[] = $new_row;\n }\n }\n else {\n $cs_width = 5;\n switch($email_type) {\n case 'emails':\n $no_email_comment = t('Currently not sending standard e-mails, add a standard email by clicking the button below.');\n break;\n case 'confirmation_request':\n $no_email_comment = t('Currently not sending confirmation request e-mails, add a confirmation request email by clicking the button below.');\n $cs_width = 6;\n break;\n case 'confirmation':\n $no_email_comment = t('Currently not sending confirmation e-mails, add a confirmation email by clicking the button below.');\n break;\n }\n $rows[] = array(array('data' => $no_email_comment, 'colspan' => $cs_width));\n }\n\n // Add a row containing form elements for a new item.\n $row_add_email = array(\n array(\n 'colspan' => ($email_type == 'confirmation_request') ? 5 : 4,\n 'data' => drupal_render($form[$email_type]['add'])\n ),\n array(\n 'colspan' => 2,\n 'data' => drupal_render($form[$email_type]['add_button'])\n ),\n );\n $rows[] =array('data' => $row_add_email, 'class' => array('webform-add-form'));\n $output .= '<h2>' . $title . '</h2>';\n $output .= theme(\n 'table',\n array(\n 'header' => ($email_type == 'confirmation_request') ? $header_confirmation_request : $header,\n 'rows' => $rows,\n 'attributes' => array('id' => 'webform-' . $email_type),\n )\n );\n }\n\n $output .= drupal_render_children($form);\n\n return $output;\n}", "function tep_mail($to_name, $to_email_address, $email_subject, $email_text, $from_email_name, $from_email_address) {\n\tif (SEND_EMAILS != 'true') return false;\n $headers[\"From\"] = $from_email_address;\n $headers[\"To\"] = $to_email_address;\n $headers[\"Subject\"] = $email_subject;\n $mail_object =& Mail::factory(\"sendmail\");\n\tif (EMAIL_USE_HTML == 'true') {\n $headers[\"Content-Type\"] = \"text/html; charset=utf-8\";\n $message = str_replace(array(\"\\r\\n\", \"\\n\", \"\\r\"), \"<br />\",$email_text);\n }else{\n $headers[\"Content-Type\"] = \"text/plain; charset=utf-8\";\n $message = str_replace(array(\"\\r\\n\", \"\\n\", \"\\r\"), \"\\r\\n\",strip_tags($email_text));\n }\n\ttep_bh_transac_mail($to_name, $to_email_address, $from_email_name, $from_email_address, $email_subject, $message);\n\t// Send message\n //$mail_object->send($to_email_address, $headers, $message);\n}", "function carton_mail( $to, $subject, $message, $headers = \"Content-Type: text/html\\r\\n\", $attachments = \"\" ) {\n\tglobal $carton;\n\n\t$mailer = $carton->mailer();\n\n\t$mailer->send( $to, $subject, $message, $headers, $attachments );\n}", "function processMobileForm($args) {\n\t$errors = array();\n\tif(empty($args['contact_name'])) $errors[] = __('Name is required', 'sm');\n\tif(empty($args['contact_email'])) $errors[] = __('Email is not valid', 'sm');\n\telseif(!is_email($args['contact_email'])) $errors[] = __('Email address is not valid', 'sm');\n\tif(empty($args['contact_message'])) $errors[] = __('Message is required', 'sm');\n\telseif(strlen($args['contact_message']) < 10) $errors[] = __('Please give us more details in your message', 'sm');\n\tif($errors == array()) {\n\t\t$headers = 'From: '.esc_attr($args['contact_name']).' <'.$args['contact_email'].'>' . \"\\r\\n\";\n\t\t$message = 'You have a message from '.esc_attr($args['contact_name']). ' <'.$args['contact_email'].'>.'.PHP_EOL.PHP_EOL;\n\t\t$message .= 'Message: '.PHP_EOL.esc_textarea($args['contact_message']).PHP_EOL.PHP_EOL;\n\t\t$message .= 'Form submitted at http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];\n\t\t$mail1 = wp_mail(get_option('admin_email'), 'Mobile Form Submission from '.esc_attr($args['contact_name']), $message, $headers);\n\t\t$headers = 'From: '.get_option('blogname').' <'.get_option('admin_email').\">\\r\\n\";\n\t\t$message = 'Thank you for sending us a message, we will get back to you shortly.'.PHP_EOL.PHP_EOL;\n\t\t$message .= 'Message: '.PHP_EOL.esc_textarea($args['contact_message']).PHP_EOL.PHP_EOL;\n\t\t$message .= 'Form submitted at http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];\n\t\t$mail2 = wp_mail($args['contact_email'], 'We received your submission', $message, $headers);\n\t\tdbug('$mail1');\n\t\tdbug($mail1);\n\t\tdbug('$mail2');\n\t\tdbug($mail2);\n\t}\n\treturn $errors;\n}", "function safeEmail($to, $subject, $message, $replyTo='')\n\n{#builds and sends a safe email, using Reply-To properly!\n\n\t$fromDomain = $_SERVER[\"SERVER_NAME\"];\n\n\t$fromAddress = \"noreply@\" . $fromDomain; //form always submits from domain where form resides\n\n\tif($replyTo==''){$replyTo='';}\n\n\t$headers = 'From: ' . $fromAddress . PHP_EOL .\n\n\t\t'Reply-To: ' . $replyTo . PHP_EOL .\n\n\t\t'X-Mailer: PHP/' . phpversion();\n\n\treturn mail($to, $subject, $message, $headers);\n\n}", "function mailer() {\n\t\tJRequest::checkToken() or die( JText::_( 'Invalid Token' ) );\n\t\t$email = JRequest::getVar('email');\n\t\t$title = JRequest::getVar('title');\n\t\t$from = array($email, $title);\n\t\t// set emailadres from the site\n\t\t$config =&JFactory::getConfig();\n\t\t// Get some variables from the component options\n\t\t$app = JFactory::getApplication('site');\n\t\t$componentParams = $app->getParams('com_mdcontact');\n\t\t$email_to = $componentParams->get('email_to');\n\t\t$subject = $componentParams->get('subject');\n\t\t$to = array($email_to, $email_to );\n\t\t// Set some variables for the email message\n\t\t$copy = JRequest::getVar('copy');;\n\t\t$body = JRequest::getVar('description');;\n\t\n\t\t// Invoke JMail Class\n\t\t$mailer = JFactory::getMailer();\n\t\n\t\t// Set sender array so that my name will show up neatly in your inbox\n\t\t$mailer->setSender($from);\n\t\t$mailer->addRecipient($to);\n\t\t// Set cc if copy is checked\n\t\tif ($copy=='1'){\n\t\t\t$mailer->addCC($from);\n\t\t\t}\n\t\t$mailer->setSubject($subject);\n\t\t$mailer->setBody($body);\n\t\t$send = $mailer->Send();\n\t\t// set the redirect page\n\t\t$redirect = JRoute::_('index.php?option=com_mdcontact&view=contact&task=add');\n\t\tif ( $send !== true ) {\n\t\t\tJFactory::getApplication()->enqueueMessage('Your message is not send, please try again later', 'error');\n\t\t\t$this->setRedirect( $redirect);\n\t\t} else {\n\t\tparent::apply();\n\t}\n\t}", "function deliver_mail() {\r\n\tif ( isset( $_POST['cf-submitted'] ) ) {\r\n\r\n\t\t// sanitize form values\r\n\t\t$name = sanitize_text_field( $_POST[\"cf-name\"] );\r\n\t\t$email = sanitize_email( $_POST[\"cf-email\"] );\r\n\t\t$subject = sanitize_text_field( $_POST[\"cf-subject\"] );\r\n\t\t$message = esc_textarea( $_POST[\"cf-message\"] );\r\n\r\n\t\t// get the blog administrator's email address\r\n\t\t$to = get_option( 'admin_email' );\r\n\r\n\t\t$headers = \"From: $name <$email>\" . \"\\r\\n\";\r\n\r\n\t\t// If email has been process for sending, display a success message\r\n\t\tif ( wp_mail( $to, $subject, $message, $headers ) ) {\r\n\t\t\techo '<div>';\r\n\t\t\techo '<p>Thanks for contacting me, expect a response soon.</p>';\r\n\t\t\techo '</div>';\r\n\t\t} else {\r\n\t\t\techo 'An unexpected error occurred';\r\n\t\t}\r\n\t}\r\n}", "function sendHTMLMail($content,$recipient,$dummy,$fromEmail,$fromName,$replyTo='',$recepientsCopy='',$recepientsBcc='')\t{\n\t\tif (trim($recipient) && trim($content))\t{\n\t\t\t$cls=t3lib_div::makeInstanceClassName('t3lib_htmlmail');\n\t\t\tif (class_exists($cls))\t{\t// If htmlmail lib is included, then generate a nice HTML-email\n\t\t\t\t$parts = spliti('<title>|</title>',$content,3);\n\t\t\t\t$subject = trim($parts[1]) ? trim($parts[1]) : 'TYPO3 FE Admin message';\n\n\t\t\t\t$Typo3_htmlmail = t3lib_div::makeInstance('t3lib_htmlmail');\n\t\t\t\t$Typo3_htmlmail->start();\n\t\t\t\t$Typo3_htmlmail->useBase64();\n\n\t\t\t\t$Typo3_htmlmail->subject = $subject;\n\t\t\t\t$Typo3_htmlmail->from_email = $fromEmail;\n\t\t\t\t$Typo3_htmlmail->from_name = $fromName;\n\t\t\t\t$Typo3_htmlmail->replyto_email = $replyTo ? $replyTo : $fromEmail;\n\t\t\t\t$Typo3_htmlmail->replyto_name = $replyTo ? '' : $fromName;\n\t\t\t\t//modif by CMD - add return path information\n\t\t\t\t$Typo3_htmlmail->returnPath = $replyTo ? $replyTo : $fromEmail;\n\t\t\t\t$Typo3_htmlmail->organisation = '';\n\t\t\t\t$Typo3_htmlmail->priority = 3;\n\n\t\t\t\t\t// HTML\n\t\t\t\t$Typo3_htmlmail->theParts['html']['content'] = $content;\t// Fetches the content of the page\n\t\t\t\t$Typo3_htmlmail->theParts['html']['path'] = '';\n\t\t\t\t$Typo3_htmlmail->extractMediaLinks();\n\t\t\t\t$Typo3_htmlmail->extractHyperLinks();\n\t\t\t\t$Typo3_htmlmail->fetchHTMLMedia();\n\t\t\t\t$Typo3_htmlmail->substMediaNamesInHTML(0);\t// 0 = relative\n\t\t\t\t$Typo3_htmlmail->substHREFsInHTML();\n\t\t\t\t$Typo3_htmlmail->setHTML($Typo3_htmlmail->encodeMsg($Typo3_htmlmail->theParts['html']['content']));\n\n\t\t\t\t\t// PLAIN\n\t\t\t\t$Typo3_htmlmail->addPlain('');\n\n\t\t\t\t\t// SET Headers and Content\n\t\t\t\t$Typo3_htmlmail->setHeaders();\n\t\t\t\t$Typo3_htmlmail->setContent();\n\t\t\t\t$Typo3_htmlmail->setRecipient($recipient);\n\t\t\t\t$Typo3_htmlmail->recipient_copy=$recepientsCopy;\n\t\t\t\t$Typo3_htmlmail->recipient_blindcopy=$recepientsBcc;\n\t\t//\t\tdebug($Typo3_htmlmail->theParts);\n\t\t\t\t$Typo3_htmlmail->sendtheMail();\n\t\t\t} else {\n\t\t\t\tdebug('SYSTEM ERROR: No HTML-mail library loaded. Set \"page.config.incT3Lib_htmlmail = 1\" is your TypoScript template.');\n\t\t\t}\n\t\t}\n\t}", "function email( $to, $subject, $message ){\n\n\n /**\n * set up mail headers \n */\n $headers = 'From: Support - Furasta.Org <[email protected]>'.\"\\r\\n\".'Reply-To: [email protected]'.\"\\r\\n\";\n $headers .= 'X-Mailer: PHP/' .phpversion().\"\\r\\n\";\n $headers .= 'MIME-Version: 1.0'.\"\\r\\n\";\n $headers .= 'Content-Type: text/html; charset=ISO-8859-1'.\"\\r\\n\";\n\n require_once '_inc/function/defualts.php';\n\n\t/**\n\t * message template \n\t */\n $message = defaults_email_template( $message );\n\n\t/**\n\t * return success of mail function \n\t */\n return mail( $to, $subject, $message, $headers );\n\n}", "function email($name,$email){\n$mail = new PHPMailer(true);\n$api = new Api();\ntry {\n //Server settings\n\n $mail->isSMTP(); // Send using SMTP\n $mail->Host = $api->getConfig('host'); // Set the SMTP server to send through\n $mail->SMTPAuth = true; // Enable SMTP authentication\n $mail->Username = $api->getConfig('email'); // SMTP username\n $mail->Password = $api->getConfig('password'); // SMTP password\n$mail->SMTPSecure = 'ssl';\n $mail->Port = 465; // TCP port to connect to, use 465 for `PHPMailer::ENCRYPTION_SMTPS` above\n\n //Recipients\n $mail->setFrom('[email protected]', $api->getConfig('name'));\n $mail->addAddress($email, $name); // Add a recipient\n $mail->addReplyTo($api->getConfig('email'), $api->getConfig('full_name'));\n\t$mail->addCC($api->getConfig('email'));\n // Attachments\n // $mail->addAttachment('/var/tmp/file.tar.gz'); // Add attachments\n //$mail->addAttachment('/tmp/image.jpg', 'new.jpg'); // Optional name\n\n // Content\n $mail->isHTML(true); // Set email format to HTML\n $mail->Subject = 'Submission Request to '.$api->getConfig('name').'\\'s Plex Server';\n $mail->Body = '<!doctype html>\n<html>\n<head>\n <meta name=\"viewport\" content=\"width=device-width\" />\n <meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" />\n <title>Submission Received</title>\n <style media=\"all\" type=\"text/css\">\n\n @media all {\n .btn-primary table td:hover {\n background-color: #34495e !important;\n }\n\n .btn-primary a:hover {\n background-color: #34495e !important;\n border-color: #34495e !important;\n }\n }\n\n @media all {\n .btn-secondary a:hover {\n border-color: #34495e !important;\n color: #34495e !important;\n }\n }\n\n @media only screen and (max-width: 620px) {\n table[class=body] h1 {\n font-size: 28px !important;\n margin-bottom: 10px !important;\n }\n\n table[class=body] h2 {\n font-size: 22px !important;\n margin-bottom: 10px !important;\n }\n\n table[class=body] h3 {\n font-size: 16px !important;\n margin-bottom: 10px !important;\n }\n\n table[class=body] p,\n table[class=body] ul,\n table[class=body] ol,\n table[class=body] td,\n table[class=body] span,\n table[class=body] a {\n font-size: 16px !important;\n }\n\n table[class=body] .wrapper,\n table[class=body] .article {\n padding: 10px !important;\n }\n\n table[class=body] .content {\n padding: 0 !important;\n }\n\n table[class=body] .container {\n padding: 0 !important;\n width: 100% !important;\n }\n\n table[class=body] .header {\n margin-bottom: 10px !important;\n }\n\n table[class=body] .main {\n border-left-width: 0 !important;\n border-radius: 0 !important;\n border-right-width: 0 !important;\n }\n\n table[class=body] .btn table {\n width: 100% !important;\n }\n\n table[class=body] .btn a {\n width: 100% !important;\n }\n\n table[class=body] .img-responsive {\n height: auto !important;\n max-width: 100% !important;\n width: auto !important;\n }\n\n table[class=body] .alert td {\n border-radius: 0 !important;\n padding: 10px !important;\n }\n\n table[class=body] .span-2,\n table[class=body] .span-3 {\n max-width: none !important;\n width: 100% !important;\n }\n\n table[class=body] .receipt {\n width: 100% !important;\n }\n }\n\n @media all {\n .ExternalClass {\n width: 100%;\n }\n\n .ExternalClass,\n .ExternalClass p,\n .ExternalClass span,\n .ExternalClass font,\n .ExternalClass td,\n .ExternalClass div {\n line-height: 100%;\n }\n\n .apple-link a {\n color: inherit !important;\n font-family: inherit !important;\n font-size: inherit !important;\n font-weight: inherit !important;\n line-height: inherit !important;\n text-decoration: none !important;\n }\n }\n </style>\n</head>\n<body class=\"\" style=\"font-family: sans-serif; -webkit-font-smoothing: antialiased; font-size: 14px; line-height: 1.4; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; background-color: #f6f6f6; margin: 0; padding: 0;\">\n<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"body\" style=\"border-collapse: separate; mso-table-lspace: 0pt; mso-table-rspace: 0pt; width: 100%; background-color: #f6f6f6;\" width=\"100%\" bgcolor=\"#f6f6f6\">\n <tr>\n <td style=\"font-family: sans-serif; font-size: 14px; vertical-align: top;\" valign=\"top\">&nbsp;</td>\n <td class=\"container\" style=\"font-family: sans-serif; font-size: 14px; vertical-align: top; display: block; Margin: 0 auto !important; max-width: 580px; padding: 10px; width: 580px;\" width=\"580\" valign=\"top\">\n <div class=\"content\" style=\"box-sizing: border-box; display: block; Margin: 0 auto; max-width: 580px; padding: 10px;\">\n\n <!-- START CENTERED WHITE CONTAINER -->\n <span class=\"preheader\" style=\"color: transparent; display: none; height: 0; max-height: 0; max-width: 0; opacity: 0; overflow: hidden; mso-hide: all; visibility: hidden; width: 0;\">'.$name.'</span>\n <table class=\"main\" style=\"border-collapse: separate; mso-table-lspace: 0pt; mso-table-rspace: 0pt; width: 100%; background: #fff; border-radius: 3px;\" width=\"100%\">\n\n <!-- START MAIN CONTENT AREA -->\n <tr>\n <td class=\"wrapper\" style=\"font-family: sans-serif; font-size: 14px; vertical-align: top; box-sizing: border-box; padding: 20px;\" valign=\"top\">\n <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"border-collapse: separate; mso-table-lspace: 0pt; mso-table-rspace: 0pt; width: 100%;\" width=\"100%\">\n <tr>\n <td align=\"center\">\n <img src=\"'.$api->getConfig('domain').'/images/plex-requests\" alt=\"Plex Requests logo\" width=\"400px\" text-align=\"center\" />\n </td>\n </tr>\n <tr>\n <td style=\"font-family: sans-serif; font-size: 14px; vertical-align: top;\" valign=\"top\">\n <p style=\"font-family: sans-serif; font-size: 14px; font-weight: normal; margin: 0; Margin-bottom: 15px;\">I have successfully received your email, please allow me up to a day to add you to my server.</p><p>Be on the lookout for an email from Plex about an Invitation.</p><p>Once accepted, feel free to request movies with your Plex Username (no password necessary!) <a href=\"'.$api->getConfig('domain').'\" target=\"_blank\">here</a><br />~Your Friend, '.$api->getConfig('name').'</p>\n\n </td>\n </tr>\n\n </table>\n </td>\n </tr>\n\n <!-- END MAIN CONTENT AREA -->\n </table>\n\n <!-- START FOOTER -->\n <div class=\"footer\" style=\"clear: both; padding-top: 10px; text-align: center; width: 100%;\">\n\n </div>\n\n <!-- END FOOTER -->\n <!-- END CENTERED WHITE CONTAINER -->\n </div>\n </td>\n <td style=\"font-family: sans-serif; font-size: 14px; vertical-align: top;\" valign=\"top\">&nbsp;</td>\n </tr>\n</table>\n</body>\n</html>';\n $mail->AltBody = 'I have successfully received your request, please allow me up to a day to add you to my server.</p><p>Be on the lookout for an email from Plex about an Invitation. Once accepted, feel free to request movies with your Plex Username (no password necessary!) at '.$api->getConfig('domain').' ~Your Friend, '.$api->getConfig('name').'';\n\n $mail->send();\n //echo 'Message has been sent';\n return true;\n} catch (Exception $e) {\n\treturn $mail->ErrorInfo;\n // echo \"Message could not be sent. Mailer Error: {$mail->ErrorInfo}\";\n}\n\n}", "function uc_file_build_email_form($form, &$form_state, $settings, $token_filters) {\n $form['from'] = array(\n '#type' => 'textfield',\n '#title' => t('Sender'),\n '#default_value' => $settings['from'],\n '#description' => t('The \"From\" address.'),\n '#required' => TRUE,\n );\n $form['addresses'] = array(\n '#type' => 'textarea',\n '#title' => t('Recipients'),\n '#default_value' => $settings['addresses'],\n '#description' => t('Enter the email addresses to receive the notifications, one on each line. You may use order tokens for dynamic email addresses.'),\n '#required' => TRUE,\n );\n $form['subject'] = array(\n '#type' => 'textfield',\n '#title' => t('Subject'),\n '#default_value' => $settings['subject'],\n '#required' => TRUE,\n );\n $form['message'] = array(\n '#type' => 'textarea',\n '#title' => t('Message'),\n '#default_value' => $settings['message'],\n '#text_format' => $settings['format'],\n );\n\n $form['token_help'] = array(\n '#type' => 'fieldset',\n '#title' => t('Replacement patterns'),\n '#description' => t('You can make use of the replacement patterns in the recipients field, the subject, and the message body.'),\n '#collapsible' => TRUE,\n '#collapsed' => TRUE,\n );\n foreach ($token_filters as $name) {\n $form['token_help'][$name] = array(\n '#type' => 'fieldset',\n '#title' => t('@name replacement patterns', array('@name' => drupal_ucfirst($name))),\n '#collapsible' => TRUE,\n '#collapsed' => TRUE,\n );\n }\n\n return $form;\n}", "function enviarCorreoCliente(){\r\n\t$nombre \t\t = $_POST['nombre'];\r\n\t$body = '<p>Estimado ' . $nombre . ' , </p><p>Hemos recibido su petición, en breve recibirá una respuesta</p> ';\r\n\t$body \t\t\t .=\"<hr><p>FamInsurance SL</p><p>NIF 32XXXXXXXX</p><p>Avenida Páncreas 2017 888D 15000 A Coruña</p>\";\r\n\t$asunto = \"Contacto FamInsurance\";\r\n\t$from = \"email\";\t\r\n\t$to = $_POST['email'];\r\n\t$cabeceras = 'MIME-Version: 1.0' . \"\\r\\n\";\r\n $cabeceras .= 'Content-type: text/html; charset=utf-8' . \"\\r\\n\";\r\n\t$cabeceras .=\"From: FamInsurance SL <$from>\\r\\n\";\r\n\tmail($to, $asunto, $body,$cabeceras);\r\n\techo \"</br></br>Un mensaje automático ha sido enviado a su dirección de correo\";\r\n}", "public function contact_form()\n\t{\n\t\tif ($this->errstr)\n\t\t{\n\t\t\tFsb::$tpl->set_switch('error');\n\t\t}\n\n\t\tFsb::$tpl->set_file('user/user_contact.html');\n\t\tFsb::$tpl->set_vars(array(\n\t\t\t'ERRSTR' =>\t\t\tHtml::make_errstr($this->errstr),\n\t\t));\n\t\t\n\t\t// Champs contacts crees par l'administrateur\n\t\tProfil_fields_forum::form(PROFIL_FIELDS_CONTACT, 'contact', Fsb::$session->id());\n\t}", "function contactusForm() {\n\tglobal $lang;\n\n?>\n <script language=\"javaScript\">\n\t\tfunction formSubmit(val) {\n\t\t\tif(checkFields()) {\n\t\t\t\tdocument.forms.contact.action.value = val;\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t\n\t\tfunction checkFields() {\n\t\t\tvar name = document.forms.contact.firstname.value;\n\t\t\tvar email = document.forms.contact.email.value;\n\t\t\tvar message = document.forms.contact.message.value;\n\t\t\n\t\t\tif (name == \"\" ) {\n\t\t\t\talert(\"<?=$lang['alertcontactname']?>\");\n\t\t\t\tdocument.forms.contact.firstname.focus();\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif (email == \"\" ) {\n\t\t\t\talert(\"<?=$lang['alertemail']?>\");\n\t\t\t\tdocument.forms.contact.email.focus();\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif (message == \"\" ) {\n\t\t\t\talert(\"<?=$lang['alertmessage']?>\");\n\t\t\t\tdocument.forms.contact.message.focus();\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n</script>\n\n<TABLE width=\"90%\" border=\"0\" cellpadding=\"3\" cellspacing=\"0\">\n\n<!-- Contactus Form -->\n<FORM NAME=\"contact\" METHOD=POST ACTION=\"index.php\" Onsubmit=\"return formSubmit('sendcontactus')\">\n<INPUT TYPE=\"hidden\" name=\"action\">\n\n<TR>\n<TD width=\"30%\" valign=\"middle\" align=\"right\">\n<?=$lang['realname']?> : \n</TD>\n\n<TD valign=\"middle\" align=\"left\">\n<INPUT class=input TYPE=\"text\" NAME=\"firstname\">\n</TD>\n</TR>\n\n\n<TR>\n<TD width=\"30%\" valign=\"middle\" align=\"right\">\n<?=$lang['email']?> :\n</TD>\n\n<TD valign=\"top\" align=\"left\">\n<INPUT class=input TYPE=\"text\" NAME=\"email\">\n</TD>\n</TR>\n\n<TR>\n<TD width=\"30%\" valign=\"middle\" align=\"right\">\n<?=$lang['contacttype']?> : \n</TD>\n\n<TD valign=\"top\" align=\"left\">\n<select name=\"subject\" class=\"input\">\n<option value = \"-\"><?=$lang['select_contacttype']?></option>\n<option value = \"<?=$lang['contacttype1']?>\"><?=$lang['contacttype1']?></option>\n<option value = \"<?=$lang['contacttype2']?>\"><?=$lang['contacttype2']?></option>\n<option value = \"<?=$lang['contacttype3']?>\"><?=$lang['contacttype3']?></option>\n</select>\n</TD>\n</TR>\n\n\n<TR>\n<TD width=\"30%\" valign=\"top\" align=\"right\">\n<?=$lang['contactmessage']?> :\n</TD>\n\n<TD valign=\"top\" align=\"left\">\n<TEXTAREA NAME=\"message\" ROWS=\"8\" COLS=\"40\" style='width=90%'></TEXTAREA>\n</TD>\n</TR>\n\n<TR>\n<TD width=\"30%\" valign=\"top\" align=\"right\">&nbsp;</TD>\n<TD valign=\"top\" align=\"left\">\n\n<INPUT TYPE=\"submit\" class=\"button\" VALUE=\"<?=$lang['button_contactus']?>\">\n</TD>\n</TR>\n</FORM>\n</TABLE>\n\n<?\n}", "function rp_send_email_old($to, $subject, $message, $from = '[email protected]'){\r\n\t\r\n\t$headers = 'MIME-Version: 1.0' . \"\\r\\n\";\r\n\t$headers .= 'Content-type: text/html; charset=iso-8859-1' . \"\\r\\n\";\r\n\t$headers .= \"From: Contest Hours <$from>\" . \"\\r\\n\".'X-Mailer: PHP/' . phpversion();\r\n\tmail($to, $subject, $message, $headers);\r\n}", "function elastic_email_settings_form() {\n global $base_url;\n\n // Add CSS to make the AJAX part of the form look a little better.\n _elastic_email_add_admin_css();\n\n // Emails won't get sent if allow_url_fopen is disabled.\n if (ini_get('allow_url_fopen') != 1) {\n drupal_set_message(t(\"You must enable 'allow_url_fopen' in your php.ini settings to be able to use this service.\"), 'error');\n }\n\n // Fieldset to hold credential fields, and Test fieldset.\n $form['credentials'] = array(\n '#type' => 'fieldset',\n '#title' => t('API Credentials'),\n );\n\n $form['credentials'][ELASTIC_EMAIL_USERNAME] = array(\n '#type' => 'textfield',\n '#size' => 48,\n '#title' => t('API username'),\n '#required' => TRUE,\n '#default_value' => variable_get(ELASTIC_EMAIL_USERNAME, ''),\n '#description' => t('This is typically your Elastic Email account email address.')\n );\n\n $form['credentials'][ELASTIC_EMAIL_API_KEY] = array(\n '#type' => 'textfield',\n '#size' => 48,\n '#title' => t('API Key'),\n '#required' => TRUE,\n '#default_value' => variable_get(ELASTIC_EMAIL_API_KEY, ''),\n '#description' => t('The API Key format is typically <tt>xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx</tt>.')\n );\n\n // DIV to hold the results of the AJAX test call.\n $form['credentials']['test']['elastic-email-test-wrapper'] = array(\n '#type' => 'markup',\n '#prefix' => '<div id=\"elastic-email-test-wrapper\">',\n '#suffix' => '</div>',\n );\n\n // Fieldset for other options.\n $form['options'] = array(\n '#type' => 'fieldset',\n '#title' => t('Options'),\n );\n\n $form['options'][ELASTIC_EMAIL_QUEUE_ENABLED] = array(\n '#type' => 'checkbox',\n '#title' => t('Queue outgoing messages'),\n '#description' => t('When checked, outgoing messages will be queued via Drupal core system queue, and delivered when the queue is emptied at cron time. When unchecked, messages are delivered immediately (synchronously). Note that synchronous delivery can cause delay in page execution time.') .\n '<br /><br />' . t('If enabled, you can use the <a href=\"@link\" target=\"_blank\">Queue UI</a> to view the queue.', array('@link' => 'https://www.drupal.org/project/queue_ui')),\n '#default_value' => variable_get(ELASTIC_EMAIL_QUEUE_ENABLED, FALSE)\n );\n\n $form['options'][ELASTIC_EMAIL_LOG_SUCCESS] = array(\n '#type' => 'checkbox',\n '#title' => t('Log message delivery success'),\n '#description' => t('When checked, a log message will also be generated for <em>successful</em> email delivery. Errors are always logged.'),\n '#default_value' => variable_get(ELASTIC_EMAIL_LOG_SUCCESS, FALSE)\n );\n\n // Fieldset for other settings.\n $form['settings'] = array(\n '#type' => 'fieldset',\n '#title' => t('Settings'),\n );\n\n $form['settings']['elastic_email_credit_low_threshold'] = array(\n '#type' => 'textfield',\n '#size' => 8,\n '#title' => t('Low Credit Threshold (USD)'),\n '#description' => t('Sets the lower threshold limit value of when to warn admin users about a low credit limit.') . '<br />' . t('(NOTE: If you are not sending out more than the Elastic Email monthly limit of 25,000 emails, set this value to zero to not show any warning).'),\n '#default_value' => variable_get('elastic_email_credit_low_threshold', 0)\n );\n\n $form['settings']['elastic_email_use_default_channel'] = array(\n '#type' => 'checkbox',\n '#title' => t('Use a Default Channel'),\n '#description' => t('If no default channel is set, then the default (set by Elastic Email) is the sending email address.<br />Setting a default channel will add this value to every email that is sent, meaning that you can more easily identify email that has come from each specific site within the reporting section.'),\n '#default_value' => variable_get('elastic_email_use_default_channel', FALSE)\n );\n\n $url = parse_url($base_url);\n $form['settings']['elastic_email_default_channel'] = array(\n '#type' => 'textfield',\n '#size' => 48,\n '#maxlength' => 60,\n '#title' => t('Default Channel'),\n '#default_value' => variable_get('elastic_email_default_channel', $url['host']),\n '#states' => array(\n 'visible' => array(\n ':input[name=\"elastic_email_use_default_channel\"]' => array('checked' => TRUE),\n ),\n ),\n );\n\n // Add the normal settings form stuff.\n $form = system_settings_form($form);\n\n // Return the form.\n return $form;\n}", "function metamail($to,$subject,$body,$headers) {\r\n\r\n\tglobal $TESTMODE,$TESTEMAIL;\r\n\r\n\tif ($TESTMODE) {\r\n\t\r\n\t\t$header = \"To: $to\\r\\n$headers\\r\\n\\r\\n\";\r\n\t\t\r\n\t\tmail($TESTEMAIL,$subject,$header.$body);\r\n\t\r\n\t} else mail($to,$subject,$body,$headers);\r\n\t\t\r\n}", "function send_mails() {\n\t //$myactivebatch = $this->load_saved_batch();//load direct from file\n\t $myactivebatch = GetParam('batchrestore');//load in html form field and save as param\n\t //echo '>',$myactivebatch;\n\t \n\t $batch = GetReq('batchid');\n\t $bid = GetParam('bid')?GetParam('bid'):0; \n\t \t \n\t $include_subs = GetParam('includesubs');\n\t $include_all = GetParam('includeall');\t \n\t $subscribers = $include_subs?$include_subs:$include_all;//one or another\n\t\n\t $from = GetParam('from');\n\t $to = GetParam('to');\t \n\t $subject = GetParam('subject');\n\t \n\t if ($this->template) {\n\t if ($this->dirdepth) {\n\t\t for($i=0;$i<$this->dirdepth;$i++)\n\t\t\t $backdir .= \"../\";\n\t\t }\n\t\t else\n\t\t $backdir = \"../\";\n\t\t //repalce viewable data to send data (absolute dir)\t \n\t\t //echo $backdir;\n\t\t if ($this->mailbody)//get session text with headers\n\t\t $body = $this->mailbody;\n\t\t else //get text area\n\t $body = str_replace($backdir,$this->url.$this->infolder.'/',GetParam('mail_text')); \t \n\t }\t \n\t else\t{ //text area or session text with headers\n\t \n\t if (GetReq('editmode')) {\n\t\t $mytext = $this->mailbody?$this->mailbody:GetParam('mail_text');\n\t\t $body = $this->unload_spath($mytext);\n\t\t }\n\t\t else\n\t $body = $this->mailbody?$this->mailbody:GetParam('mail_text'); \n\t }\t \t \n\t \t \n\t\t \n\t if ($subscribers) {// || ($batch)) {//if sybs checked or batch in process..\n\t \n\t //save the current mail campaign state\n\t $this->save_current_batch($batch);\t\n\t \t \t \n\t //$subs = $this->subs_mail;\n\t\t \n\t\t //workinh batch tosend\n\t\t $subs = $this->getmails($include_all,$this->batch,$bid);\n\t\t \n\t if (($batch>=0) && ($batch>=$myactivebatch)) {\n\n\t //if ($res = GetGlobal('controller')->calldpc_method('rcshmail.sendit use '.$from.'+'.$to.'+'.$subject.'+'.$body.'+'.$subs)) {\n if ($res = $this->sendit($from,$to,$subject,$body,$subs,$this->ishtml)) {\n\t $this->mailmsg = $res . \" mail(s) send!\";\n\t }\t \n\t else \n\t $this->mailmsg = \"Send failed\";\n\t\t }\n\t\t else \t\n\t\t $this->mailmsg = \"Send bypassed\"; \n\t }\t \n\t else {//one receipent\n\t //if ($res = GetGlobal('controller')->calldpc_method('rcshmail.sendit use '.$from.'+'.$to.'+'.$subject.'+'.$body))\n\t\t if ($res = $this->sendit($from,$to,$subject,$body,null,$this->ishtml)) \n\t\t $this->mailmsg = $res . \" mail(s) send!\";\n\t\t else\n\t\t $this->mailmsg = \"Send failed\";\t\n\t }\t \n\t\t \n\t //auto refresh\n\t $refresh = GetParam('refresh')?GetParam('refresh'):$this->auto_refresh;\n\t if (($refresh>0) && ($res==$this->batch)) {\n $this->refresh_bulk_js(seturl('t=cpsubsend&batchid='.($bid+1).'&batch='.$this->batch.'&refresh='.$refresh),$refresh);\t\t\t \n\t $this->mailmsg .= \"Wait for next batch \" . $this->timeout;\t\t \n\t }\t \n\t \n\t //test\n\t //return $this->batch;\n //return (400);\t \t //??????????????????????????????????????????????????\n\t //echo '---------------------',$res,'---------------------------<br>';\n\t \n\t if ($res<$this->batch) //means end of campaign\n\t $this->reset_batch_state();\n\t \n\t return ($res);//how many mails tried to send (batch...)\t \n\t}", "function elastic_email_send_test_submit($form, &$form_state) {\n $site_mail = variable_get('site_mail', NULL);\n $username = variable_get(ELASTIC_EMAIL_USERNAME, '');\n $api_key = variable_get(ELASTIC_EMAIL_API_KEY, '');\n\n $to = $form_state['values']['elastic_email_test_email_to'];\n $subject = $form_state['values']['elastic_email_test_email_subject'];\n\n if ($form_state['values']['elastic_email_test_email_html']) {\n $text_body = NULL;\n $html_body = $form_state['values']['elastic_email_test_email_body'];\n }\n else {\n $text_body = $form_state['values']['elastic_email_test_email_body'];\n $html_body = NULL;\n }\n\n $result = ElasticEmailMailSystem::elasticEmailSend(\n $site_mail,\n NULL,\n $to,\n $subject,\n $text_body,\n $html_body,\n $username,\n $api_key\n );\n\n\n if (isset($result['error'])) {\n // There was an error. Return error HTML.\n drupal_set_message(t('Failed to send a test email to %test_to. Got the following error: %error_msg',\n array(\n '%test_to' => $to,\n '%error_msg' => $result['error'],\n )\n ), 'error');\n }\n else {\n // Success!\n drupal_set_message(t('Successfully sent a test email to %test_to',\n array(\n '%test_to' => $to,\n )\n ));\n }\n}", "private function sendMessage() {\r\n $data = $this->_contactform->getValues();\r\n\r\n $viewParam = array(\r\n 'name' => $data['contactform_name'],\r\n 'email' => $data['contactform_email'],\r\n 'message' => nl2br(htmlentities($data['contactform_message'])),\r\n 'ip' => $_SERVER['REMOTE_ADDR']\r\n );\r\n\r\n $registry = Zend_Registry::getInstance();\r\n $contactInfo = $registry->get('contactinfo');\r\n $email = $contactInfo['email'];\r\n $name = $contactInfo['name'];\r\n\r\n $mail = new Portfolio_HtmlTemplateMailer();\r\n $mail->setSubject($data['contactform_subject'])\r\n ->setFrom($data['contactform_email'], $data['contactform_name'])\r\n ->setReplyTo($data['contactform_email'], $data['contactform_name'])\r\n ->addTo($email, $name)\r\n ->setViewParam($viewParam)\r\n ->sendHtmlTemplate('contact.phtml');\r\n }", "function sendmail ($from_name, $from_email, $to_name, $to_email, $subject, $text_message=\"\", $html_message, $attachment=\"\") \n { \n $from = \"$from_name <$from_email>\"; \n $to = \"$to_name <$to_email>\"; \n $main_boundary = \"----=_NextPart_\".md5(rand()); \n $text_boundary = \"----=_NextPart_\".md5(rand()); \n $html_boundary = \"----=_NextPart_\".md5(rand()); \n $headers = \"From: $from\\n\"; \n $headers .= \"Reply-To: $from\\n\"; \n $headers .= \"X-Mailer: Hermawan Haryanto (http://hermawan.com)\\n\"; \n $headers .= \"MIME-Version: 1.0\\n\"; \n $headers .= \"Content-Type: multipart/mixed;\\n\\tboundary=\\\"$main_boundary\\\"\\n\"; \n $message .= \"\\n--$main_boundary\\n\"; \n $message .= \"Content-Type: multipart/alternative;\\n\\tboundary=\\\"$text_boundary\\\"\\n\"; \n $message .= \"\\n--$text_boundary\\n\"; \n $message .= \"Content-Type: text/plain; charset=\\\"ISO-8859-1\\\"\\n\"; \n $message .= \"Content-Transfer-Encoding: 7bit\\n\\n\"; \n $message .= ($text_message!=\"\")?\"$text_message\":\"Text portion of HTML Email\"; \n $message .= \"\\n--$text_boundary\\n\"; \n $message .= \"Content-Type: multipart/related;\\n\\tboundary=\\\"$html_boundary\\\"\\n\"; \n $message .= \"\\n--$html_boundary\\n\"; \n $message .= \"Content-Type: text/html; charset=\\\"ISO-8859-1\\\"\\n\"; \n $message .= \"Content-Transfer-Encoding: quoted-printable\\n\\n\"; \n $message .= str_replace (\"=\", \"=3D\", $html_message).\"\\n\"; \n if (isset ($attachment) && $attachment != \"\" && count ($attachment) >= 1) \n { \n for ($i=0; $i<count ($attachment); $i++) \n { \n $attfile = $attachment[$i]; \n $file_name = basename ($attfile); \n $fp = fopen ($attfile, \"r\"); \n $fcontent = \"\"; \n while (!feof ($fp)) \n { \n $fcontent .= fgets ($fp, 1024); \n } \n $fcontent = chunk_split (base64_encode($fcontent)); \n @fclose ($fp); \n $message .= \"\\n--$html_boundary\\n\"; \n $message .= \"Content-Type: application/octetstream\\n\"; \n $message .= \"Content-Transfer-Encoding: base64\\n\"; \n $message .= \"Content-Disposition: inline; filename=\\\"$file_name\\\"\\n\"; \n $message .= \"Content-ID: <$file_name>\\n\\n\"; \n $message .= $fcontent; \n } \n } \n $message .= \"\\n--$html_boundary--\\n\"; \n $message .= \"\\n--$text_boundary--\\n\"; \n $message .= \"\\n--$main_boundary--\\n\"; \n if(mail ($to, $subject, $message, $headers)){\n \treturn true;\n }else{\n \treturn false;\n }\n }", "function pdf_email($str_Company,$str_email_type,$str_subject,$str_file_name='',$str_email='',$str_body='',$quote_no='',$str_from=''){\n\t//NOTE:----------$str_email has all Customer email address------------------------\n\t\n\trequire_once ('../node_modules/mail/PHPMailerAutoload.php');\nrequire_once ('../node_modules/mail/class.phpmailer.php');\nrequire_once ('../node_modules/mail/class.smtp.php');\n\t\n\t\t//include_once('class.phpmailer.php');\n\t\t//require_once ('../node_modules/mail/class.phpmailer.php');\n\t\t$str_disclaimer=\"</br> </br> \".\"This is an automated email, please do not reply to this email address.\" .\"</br> </br> \".\n\t\t\"This message, including any attachments, may contain confidential information intended only for a specific individual and purpose. The information is considered private and legally protected by law. If you are not the intended recipient, please destroy all copies. You are hereby notified that any dissemination, distribution, copying or use of the content of this transmission is strictly prohibited.\";\n\t\t\n\t\t//$smtp=new SMTP();\n\t\t\n\t\t\n\t\t$mail = new PHPMailer();\n\t\t\n\t\tif ($str_email!=''){\n\t\t\t\n\t\t\tif ($str_Company==1){\n\t\t\t\t$mail->From = $str_from;\n\t\t\t}elseif ($str_Company==4){\n\t\t\t\t$mail->From = '[email protected]';\n\t\t\t}else {\n\t\t\t\t$mail->From = '[email protected]';\n\t\t\t}\n\t\t\t$mail->FromName = $str_email_type;\n\t\t\t$mail->Subject = $str_subject;\n\t\t\t\n\t\t\t\n\t\t\t\t$arr_email=explode(';', $str_email);\n\t\t\t\t$int_email_count=count($arr_email);\n\t\t\t\tfor ( $intCounter = 0; $intCounter < $int_email_count; $intCounter++ ) {\n\t\t\t\t\t//$mail->AddAddress( '[email protected]' );\n\t\t\t\t\t$mail->AddAddress( $arr_email[$intCounter] );\n\t\t\t\t}\n\n\t\t\t\t\t$mail->AddAddress( $str_file_name );\n\n\t\t\t\t//Test by veera\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t//\n\t\t\t//if ($str_file_name!=''){\n\t\t\t\t\n\t\t\t\t$mail->addAttachment('C:/htdocs/Quote_System/inc/PDF/Quote'.$quote_no.'.pdf'); // Add attachments\n\t\t\t\t$mail->isHTML(true);\n\t\t\t//}\n\t\t\t$mail->Body = $str_body . \"</br> \" .$str_disclaimer;\n\t\t\t\n\t\t\t\n\t\t\t//$mail->AddAttachment( $file_to_attach , 'ChangeRequest.xlsx' );\n\t\t\t\n\t\tif(!$mail->send()) {\n\t\t\treturn 'Failed to send eamil';\n\t\t} else {\n\t\t\treturn 'Email sent';\n\t\t}\n\t\t}\n\t\n}", "function emailSystem($Email, $Subject, $Message){\r\n$to = $Email;\r\n$subject = $Subject;\r\n$message = $Message;\r\n\r\n// $message ='<p>Recieved a message for password reset</p>';\r\n// $message .='<p>Below is the link to your password reset</p>';\r\n// $message .='<a href=\"'.$url. '\">'.$url.'</a></p>';\r\n\r\n$headers = \"from: Pillersmaker <[email protected]>\\r\\n\";\r\n$headers .= \"reply-To: [email protected]\\r\\n\";\r\n$headers .= \"Content-type: text/html\\r\\n\";\r\n\r\nmail($to, $subject, $message, $headers);\r\n\r\n}", "function theme_webform_confirm_email_email_add_form($form) {\n\n $email_type = $form['#array_parents'][0];\n\n // Add a default value to the custom e-mail textfield.\n $form[$email_type . '_custom']['#attributes']['rel'] = t('[email protected]');\n $form[$email_type . '_custom']['#attributes']['class'] = 'webform-set-active webform-default-value';\n $form[$email_type . '_option']['custom']['#title'] = $form[$email_type . '_option']['custom']['#title'] . ': ' . drupal_render($form[$email_type . '_custom']);\n\n // Render the component value.\n $form[$email_type . '_component']['#attributes']['class'] = 'webform-set-active';\n $form[$email_type . '_option']['component']['#title'] = $form[$email_type . '_option']['component']['#title'] . ': ' . drupal_render($form[$email_type . '_component']);\n\n // For spacing consistency, every option is wrapped in webform-container-inline.\n foreach (element_children($form[$email_type . '_option']) as $option) {\n $form[$email_type . '_option'][$option]['#prefix'] = '<div class=\"webform-container-inline\">';\n $form[$email_type . '_option'][$option]['#suffix'] = '</div>';\n }\n\n return $form;\n}", "function deliver_mail($to, $success) {\n if ( isset( $_POST['cf-submitted'] ) ) {\n\n // sanitize form values\n $name = sanitize_text_field( $_POST[\"cf-name\"] );\n $email = sanitize_email( $_POST[\"cf-email\"] );\n $subject = sanitize_text_field( $_POST[\"cf-subject\"] );\n $message = esc_textarea( $_POST[\"cf-message\"] );\n\n\n $headers = \"From: $name <$email>\" . \"\\r\\n\";\n\n\n // If email has been process for sending, display a success message\n if ( wp_mail( $to, $subject, $message, $headers ) ) {\n echo '<div>';\n echo '<p>'.$success.'</p>';\n echo '</div>';\n } else {\n echo 'An unexpected error occurred';\n }\n }\n}", "function sendMail($merchantForm){\n $mail = new PHPMailer;\n $mail->CharSet = 'UTF-8';\n //Tell PHPMailer to use SMTP\n $mail->isSMTP();\n //Enable SMTP debugging\n // 0 = off (for production use)\n // 1 = client messages\n // 2 = client and server messages\n $mail->SMTPDebug = 0;\n //Ask for HTML-friendly debug output\n $mail->Debugoutput = 'html';\n //Set the hostname of the mail server\n $mail->Host = \"162.243.228.247\";\n //Set the SMTP port number - likely to be 25, 465 or 587\n $mail->Port = 25;\n //Whether to use SMTP authentication\n $mail->SMTPAuth = true;\n //Username to use for SMTP authentication\n $mail->Username = \"safesai\";\n //Password to use for SMTP authentication\n $mail->Password = \"yYXX8cgcgydwYQdV\";\n $mail->SMTPSecure = false;\n $mail->AuthType=\"PLAIN\";\n //Set who the message is to be sent from\n $mail->setFrom('[email protected]', 'no-reply');\n //Set an alternative reply-to address\n $mail->addReplyTo('[email protected]', 'no-reply');\n //Set who the message is to be sent to\n $mail->addAddress($merchantForm->getEmail(), \"KH\");\n //Set the subject line\n $mail->Subject = \"Email lấy mật khẩu thử nghiệm . YUPAX\";\n //Read an HTML message body from an external file, convert referenced images to embedded,\n //convert HTML into a basic plain-text alternative body\n $mail->msgHTML(\n \"<p>\n link đăng nhập\n <br>\n http://yupax.com/merchant\n </p>\n <p>\n Username\n <br>\n \".$merchantForm->getEmail().\"\n </p>\n <p>Mật khẩu\n <br>\".\n $merchantForm->getPassword().\"</p>\n <p>hashcode của merchant\n <br>\".\n $merchantForm->getHashcode().\"</p>\"\n );\n //Replace the plain text body with one created manually\n $mail->AltBody = 'vsec@2017';\n //Attach an image file\n //$mail->addAttachment('images/phpmailer_mini.png');\n\n //send the message, check for errors\n if (!$mail->send()) {\n echo \"Mailer Error: \" . $mail->ErrorInfo;die();\n //return false;\n } else {\n //return true;\n echo \"Message sent!\";\n }\n}", "function SendAlert($error)\n{\n global $SPECIAL_VALUES,$FORMATTED_INPUT,$FROM_USER,$sServerVars;\n\n $alert_to = $SPECIAL_VALUES[\"alert_to\"];\n if (empty($alert_to))\n $alert_to = DEF_ALERT;\n if (!empty($alert_to))\n {\n\t\t$from = $headers = \"\";\n\t\tif (isset($FROM_USER))\n\t\t{\n\t\t\tif ($FROM_USER != \"NONE\")\n\t\t\t\t$headers = $from = \"From: $FROM_USER\";\n\t\t}\n\t\telse\n\t\t\t$headers = $from = \"From: FormMail@\".$sServerVars['SERVER_NAME'];\n\t\t$mesg = \"To: \".UnMangle($alert_to).BODY_LF;\n\t\tif (!empty($from))\n\t\t\t$mesg .= $from.BODY_LF;\n\t\t$mesg .= BODY_LF;\n $mesg .= \"This error occurred in the script: $error\".BODY_LF;\n $mesg .= implode(BODY_LF,$FORMATTED_INPUT);\n SendMail($alert_to,\"FormMail script error\",$mesg,$headers);\n }\n}", "function contactUs ($sendEmail=false, $serverSetting=null){\n\t\t\t$simpleFormBuilder = new simpleFormBuilder;\n\t\t\t\n\t\t\t$builder \t= array\t(\n\t\t\t\t\t\t\t\"prosesname\"=> \"Your Contact Has Been Saved \",\n\t\t\t\t\t\t\t\"action\"\t=> \"\",\n\t\t\t\t\t\t\t\"method\"\t=> \"insert\",\n\t\t\t\t\t\t\t\"datatable\"\t=> \"tbl_contact\",\n\t\t\t\t\t\t\t\"element\"\t=> array\t( \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"Name\" => array( \"type\" => \"text\", \"dataname\" => \"contact_name\t\", \"required\" => 1),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"Email\" => array( \"type\" => \"text\", \"dataname\" => \"contact_email\", \"required\" => 1, \"emailvalid\" => 1),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"Phone\" => array( \"type\" => \"text\", \"dataname\" => \"contact_phone\", \"required\" => 1, \"phonevalid\" => 1),\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"Address\" => array( \"type\" => \"text\", \"dataname\" => \"contact_address\", \"required\" => 1),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"Message\" => array( \"type\" => \"textarea\", \"dataname\" => \"contact_message\", \"required\" => 1, \"width\" => \"75\"),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"captcha\" => array( \"type\" => \"captcha\", \"ignore\" => 1, \"message\" => \"(spam protection)\"),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"hidden\" => array( \"type\" => \"hidden\", \"dataname\" => \"contact_date\" , \"value\" => date(\"Y-m-d H:i:s\")),\n\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\t\t\t\n\t\t\n\t\t\t$form\t= $simpleFormBuilder->builder($builder, false, false, false);\n\t\t\t\n\t\t\tif($simpleFormBuilder->haveError != 1 AND isset($_POST['submit']) AND $sendEmail == true){\n\t\t\t\techo $simpleFormBuilder->haveError;\n\t\t\t\tif(is_null($serverSetting)){\n\t\t\t\t\t$objEmail \t= new send2email(MAIL_SERVER, SITE_EMAIL, SITE_EMAIL_PASS, MAIL_PORT, true);\n\t\t\t\t\t$receiver\t= MANAGEMENT_EMAIL;\n\t\t\t\t}else{\n\t\t\t\t\t$objEmail \t= new send2email(trim($serverSetting[0]), trim($serverSetting[1]), trim($serverSetting[2]), trim($serverSetting[3]), trim($serverSetting[4]) );\n\t\t\t\t\t$receiver\t= $serverSetting[5];\n\t\t\t\t}\n\n\t\t\t\t$send \t\t= $objEmail->send($_POST[\"contact_email\"], '[Blanco Indonesia] Contact Us from '.$_POST[\"contact_name\"] .' ('.$_POST[\"contact_phone\"]. ')', $_POST[\"contact_message\"], $receiver, 'Contact Us', $_POST[\"contact_name\"]);\n\t\t\t\t/*echo '<!-- <pre>'; print_r($send); echo ' </pre> -->';*/\n\t\t\t}\n\t\t\t\n\t\t\treturn $form;\n\t\t}", "function mymail($to, $title, $body, $from = '') {\n\n $controlquery = doquery(\"SELECT * FROM {{table}} WHERE id='1' LIMIT 1\", \"control\");\n $controlrow = mysql_fetch_array($controlquery);\n extract($controlrow);\n \n\n $from = trim($from);\n\n if (!$from) {\n $from = '<'.$controlrow[\"adminemail\"].'>';\n }\n\n $rp = $controlrow[\"adminemail\"];\n $org = '$gameurl';\n $mailer = 'PHP';\n\n $head = '';\n $head .= \"Content-Type: text/plain \\r\\n\";\n $head .= \"Date: \". date('r'). \" \\r\\n\";\n $head .= \"Return-Path: $rp \\r\\n\";\n $head .= \"From: $from \\r\\n\";\n $head .= \"Sender: $from \\r\\n\";\n $head .= \"Reply-To: $from \\r\\n\";\n $head .= \"Organization: $org \\r\\n\";\n $head .= \"X-Sender: $from \\r\\n\";\n $head .= \"X-Priority: 3 \\r\\n\";\n $head .= \"X-Mailer: $mailer \\r\\n\";\n\n $body = str_replace(\"\\r\\n\", \"\\n\", $body);\n $body = str_replace(\"\\n\", \"\\r\\n\", $body);\n\n return mail($to, $title, $body, $head);\n \n}", "function mailTo($to, $subject, $body){\n\t\n\t\t// Parame checking\n\t\t$to \t = empty($to) \t \t? false : (string) $to;\n\t\t$subject = empty($subject) ? false : (string) $subject;\n\t\t$body\t = empty($body) \t? false : (string) $body;\n\t\t\n\t\tif(!($to && $subject && $body)){\n\t\t\terror_log(\"Could not send message - empty param passed\\n\");\n\t\t\treturn false;\n\t\t}\n\t\n\t\t/** smpt.php offers the smtp_class */\n\t\trequire FP_PHP.'smtp_mail/smtp/smtp.php';\n\t\t/** the sasl folder provides authentication methods like LOGIN, PLAIN, NTLM, etc... */\n\t\trequire FP_PHP.'smtp_mail/sasl/sasl.php';\n\t\t\n\t\t// Authentication info\n\t\t$user = 'username';\t\t\t\t\t\t\t//<-------- EDIT THIS\n\t\t$pass = 'password';\t\t\t\t\t\t\t//<-------- EDIT THIS\n\t\t$realm = 'example.com';\t\t\t\t\t\t\t//<-------- EDIT THIS\n\t\t$email = $user.'@'.$realm;\t\t\t\t\t\t//<-------- EDIT THIS\n\t\t$from = $email;\n\t\t\t\n\t\t$smtp = new smtp_class();\n\t\t//the following are sent in headers to identify host in email logs\n\t\t$smtp->localhost = 'www.example.com';\t\t\t//<-------- EDIT THIS\n\t\t$smtp->host_name = 'smtp.example.com';\t\t\t//<-------- EDIT THIS\n\t\t$smtp->host_port = 25;\n\t\t$smtp->ssl = 0;\n\t\t\n\t\t/** Set to the number of seconds wait for a successful connection to the SMTP server */\n\t\t$smtp->timeout = 10;\n\t\t/** Use smtp->timeout */\n\t\t$smtp->data_timeout = 0;\n\t\t\t\n\t\t$smtp->debug = 1; // Set to 1 to output the communication with the SMTP server\n\t\t$smtp->html_debug = 1; // Set to 1 to format the debug output as HTML\n\t\t\n\t\t$smtp->user\t\t= $user;\n\t\t$smtp->realm\t= $realm;\n\t\t$smtp->password\t= $pass;\n\t\t\n\t\t//negotiate with server\n\t\t$smtp->authentication_mechanism = \"\"; \t//Specify a SASL authentication method like LOGIN, PLAIN, CRAM-MD5, NTLM, etc..\n\t\t\n\t\t$headers = array(\n\t\t\t\t\"From: $from\",\n\t\t\t\t\"To: $to\",\n\t\t\t\t\"Subject: $subject\",\n\t\t\t\t\"Date: \".strftime(\"%a, %d %b %Y %H:%M:%S %Z\")\n\t\t);\n\t\n\t\t$bool = $smtp->SendMessage($from, array($to), $headers, $body);\n\t\tif($bool){\n\t\t\treturn true;\n\t\t}\n\t\telse{\n\t\t\terror_log(\"Could not send message to $to.\\nError: \".$smtp->error.\"\\n\");\n\t\t\treturn false;\n\t\t}\n\t}", "function progressive_webform_email($variables) {\r\n _form_set_class($variables['element'], array('form-control'));\r\n return theme_webform_email($variables);\r\n}", "function contactSendMail()\r\n {\r\n $subject = 'Contact : ' . $_POST['contactNom'];\r\n $body = $_POST['contactMsg'];\r\n\r\n\r\n $this->sendMail($subject, $body);\r\n }", "function send_email($to='', $fromMail='', $subject='', $html_content='', $text_content='', $headers='') { \n\n\t$html_content = (!empty($html_content)) ? str_replace(array(\"\\r\\n\", \"\\r\", \"\\n\"), '', $html_content) : '';\n\n\t// # Setup mime boundary\n\t$mime_boundary = 'Multipart_Boundary_x'.md5(time()).'x';\n\n\t$headers = \"MIME-Version: 1.0\\r\\n\";\n\t$headers .= \"Content-Type: multipart/alternative; boundary=\\\"$mime_boundary\\\"\\r\\n\";\n\t$headers .= \"Content-Transfer-Encoding: 7bit\\r\\n\";\n\n\t$body\t = \"This is a multi-part message in mime format.\\n\\n\";\n\n\t// # Add in plain text version\n\t$body\t.= \"--$mime_boundary\\n\";\n\t$body\t.= \"Content-Type: text/plain; charset=charset=\\\"us-ascii\\\"\\n\";\n\t$body\t.= \"Content-Transfer-Encoding: 7bit\\n\\n\";\n\t$body\t.= $text_content;\n\t$body\t.= \"\\n\\n\";\n\n\t// # Add in HTML version\n\t$body\t.= \"--$mime_boundary\\n\";\n\t$body\t.= \"Content-Type: text/html; charset=\\\"UTF-8\\\"\\n\";\n\t$body\t.= \"Content-Transfer-Encoding: 8bit\\n\\n\";\n\t$body\t.= wordwrap($html_content,500,\"\\r\\n\");\n\t$body\t.= \"\\n\\n\";\n\n\t// # Attachments would go here\n\t// # But this whole email thing should be turned into a class to more logically handle attachments, \n\n\t// # End email\n\t$body\t.= \"--$mime_boundary--\\n\"; // # trailing --, required to close email body for mime's\n\n\t// # Finish off headers\n\t$headers .= \"From: \".$fromMail.\"\\r\\n\";\n\t$headers .= \"X-Sender-IP: \".$_SERVER['argv'][3].\"\\r\\n\";\n\t$headers .= 'Date: '.date('n/d/Y g:i A').\"\\r\\n\";\n\t$headers .= \"Reply-To: \".STORE_OWNER_EMAIL_ADDRESS.\" \\r\\n\";\n\n\t// # Mail it out\n\treturn mail($to, $subject, $body, $headers);\n}", "function sendInfoMail()\t{\n\t\tif ($this->conf['infomail'] && $this->conf['email.']['field'])\t{\n\t\t\t$recipient='';\n\t\t\t$emailfields=t3lib_div::trimexplode(',',$this->conf['email.']['field']);\t\t\t\t\n\t\t\tforeach($emailfields as $ef) {\n\t\t\t\t$recipient.=$recipient?$Arr[$this->conf['email.']['field']].';'.$recipient:$Arr[$this->conf['email.']['field']];\n\t\t\t}\n\t\t\t$fetch = t3lib_div::_GP('fetch');\n\t\t\tif ($fetch)\t{\n\t\t\t\t\t// Getting infomail config.\n\t\t\t\t$key= trim(t3lib_div::_GP('key'));\n\t\t\t\tif (is_array($this->conf['infomail.'][$key.'.']))\t\t{\n\t\t\t\t\t$config = $this->conf['infomail.'][$key.'.'];\n\t\t\t\t} else {\n\t\t\t\t\t$config = $this->conf['infomail.']['default.'];\n\t\t\t\t}\n\t\t\t\t$pidLock='';\n\t\t\t\tif (!$config['dontLockPid'] && $this->thePid)\t{\n\t\t\t\t\t$pidLock='AND pid IN ('.$this->thePid.') ';\n\t\t\t\t}\n\n\t\t\t\t\t// Getting records\n\t\t\t\tif (t3lib_div::testInt($fetch))\t{\n\t\t\t\t\t$DBrows = $GLOBALS['TSFE']->sys_page->getRecordsByField($this->theTable,$this->conf['uidField'],$fetch,$pidLock,'','','1');\n\t\t\t\t} elseif ($fetch) {\t// $this->conf['email.']['field'] must be a valid field in the table!\n\t\t\t\t\tforeach($emailfields as $ef) {\n\t\t\t\t\t\tif ($ef) $DBrows = $GLOBALS['TSFE']->sys_page->getRecordsByField($this->theTable,$ef,$fetch,$pidLock,'','','100');\n\t\t\t\t\t\tif (count($DBrows )) break;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Processing records\n\t\t\t\tif (is_array($DBrows))\t{\n\t\t\t\t\t//$recipient = $DBrows[0][$this->conf['email.']['field']];\n\t\t\t\t\tif ($this->conf['evalFunc'])\t{\n\t\t\t\t\t\t$DBrows[0] = $this->userProcess('evalFunc',$DBrows[0]);\n\t\t\t\t\t}\n\t\t\t\t\t$this->compileMail($config['label'], $DBrows, $this->getFeuserMail($DBrows[0],$this->conf), $this->conf['setfixed.']);\n\t\t\t\t} elseif ($this->cObj->checkEmail($fetch)) {\n\t\t\t\t\t$this->sendMail($fetch, '', '',trim($this->cObj->getSubpart($this->templateCode, '###'.$this->emailMarkPrefix.'NORECORD###')));\n\t\t\t\t}\n\n\t\t\t\t$content = $this->metafeeditlib->getPlainTemplate($this->conf,$this->markerArray,'###TEMPLATE_INFOMAIL_SENT###');\n\t\t\t} else {\n\t\t\t\t$content = $this->metafeeditlib->getPlainTemplate($this->conf,$this->markerArray,'###TEMPLATE_INFOMAIL###');\n\t\t\t}\n\t\t} else $content='Error: infomail option is not available or emailField is not setup in TypoScript';\n\t\treturn $content;\n\t}", "public function sendMail($to, $subject, $body, $from, $attachments = false, $priority = 2, $cc = null, $bcc = null) { //v0.3\n include_once (DOC_ROOT_PATH . '/libs/PHPMailer/class.phpmailer.php');\n //return false;\n\n $from_name = null;\n $from_email = null;\n $to_name = null;\n $to_email = null;\n\n $mail = new PHPMailer();\n\n if ($to[0] == ':') {\n return false;\n } // this email address is disabled\n\n if (preg_match('/(.+)<(.+)>/i', $from, $matches)) {\n if (!empty($matches[1])) {\n $from_name = trim($matches[1]);\n }\n if (!empty($matches[2])) {\n $from_email = trim($matches[2]);\n }\n }\n\n if (empty($from_email)) {\n $from_email = $from;\n }\n\n if (preg_match('/(.+)<(.+)>/i', $to, $matches)) {\n if (!empty($matches[1])) {\n $to_name = trim($matches[1]);\n }\n if (!empty($matches[2])) {\n $to_email = trim($matches[2]);\n }\n }\n\n if (empty($to_email)) {\n $to_email = $to;\n }\n\n if (is_array($body)) {\n if (!empty($body['html'])) {\n $mail->IsHTML(true);\n $mail->Body = $body['html'];\n $htmlbody = $body['html'];\n }\n if (!empty($body['text'])) {\n $mail->AltBody = $body['text'];\n $body = $body['text'];\n }\n } else {\n $mail->Body = $body;\n }\n\n //Add Cc\n if (!empty($cc)) {\n if (strstr($cc, ',')) {\n $t = explode(',', $cc);\n foreach ($t as $cc_email) {\n $mail->AddCC($cc_email);\n }\n } else {\n $mail->AddCC($cc);\n }\n }\n\n //Add Bcc\n if (!empty($bcc)) {\n if (strstr($bcc, ',')) {\n $t = explode(',', $bcc);\n foreach ($t as $bcc_email) {\n $mail->AddCC($bcc_email);\n }\n } else {\n $mail->AddBCC($bcc);\n }\n }\n\n # Priority?\n if ($priority == 3) {\n $pri = 1;\n } elseif ($priority == 1) {\n $pri = 5;\n } else {\n $pri = 3;\n }\n // Attachments\n if ($attachments !== false) {\n foreach ($attachments as $attach) {\n $file = $attach['tmp_name']; //we're assuming attachments are coming from $_FILES\n if (is_file($file)) {\n # File name of Attachment\n echo $filename = $attach['name'];\n $mail->AddAttachment($file, $filename);\n }\n }\n }\n\n $mail->IsSMTP();\n $mail->SMTPAuth = true;\n $mail->Host = MAIL_HOST;\n $mail->Port = SMTP_PORT;\n $mail->Username = MAIL_AUTHENTICATION_EMAIL;\n $mail->Password = MAIL_AUTHENTICATION_PASSWORD;\n $mail->SMTPKeepAlive = 'true';\n $mail->SMTPDebug = false;\n if (USE_SECURE_CONNECTION) {\n $mail->SMTPSecure = 'ssl';\n } else {\n $mail->SMTPSecure = 'tls';\n }\n $mail->Hostname = $_SERVER['SERVER_NAME'];\n $mail->From = $from_email;\n $mail->FromName = str_replace('\"', '', $from_name);\n $mail->Sender = $from_email;\n $mail->Subject = $subject;\n $mail->AddAddress($to_email, $to_name);\n $mail->Priority = $pri;\n if (!$mail->Send()) {\n $mail_sent = FALSE;\n } else {\n $mail_sent = TRUE;\n }\n\n $mail->ClearAddresses();\n $mail->SmtpClose();\n\n return $mail_sent;\n }", "function send_text_email($to, $from_name, $from_email, $subject, $body){\n\n \t$headers = 'MIME-Version: 1.0' . \"\\r\\n\";\n\t\t$headers .= 'Content-type: text/plain; charset=iso-8859-1' . \"\\r\\n\";\n\t\t$headers .= 'From: ' . $from_name. ' <' . $from_email . \">\\r\\n\";\n\n\t\t$success = mail($to, $subject, $body, $headers);\n\t\tif(!$success){\n\t\t trigger_error(\"Failed to send email\");\n\t }\n\n }", "static function sendEmail(&$arr_anhang_filepfad, &$validationResult)\n\t{\t\n\t\t// IN CASE YOU HAVE TIMEOUT TROUBLE SENDING EMAILS WITH A LOT OF ATTACHMENTS...\n\t\t// only for test purposes\t\t\t\n\t\t//ini_set('max_execution_time', 600); \t\t\t\n\t\t// PLEASE DO NOT SET TO INFINITIVE!!!!\n\t\t\n\t\t$subjectText = iconv('UTF-8', 'windows-1252', \"UID Bestätigungen für \" . $GLOBALS[\"UIDvalidationATglobalvars\"][\"firmaName\"] );\n\t\tif (count ($arr_anhang_filepfad) > 0 )\n\t\t{\n\t\t\t$bodyTextPart1 = iconv('UTF-8', 'windows-1252', \"Als Attachment dieser E-Mail erhalten Sie die Bestätigungsprotokolle der UID Validierungen aus FinanzOnline für\" );\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$bodyTextPart1 = iconv('UTF-8', 'windows-1252', \"Seit dem letzten E-Mail Versand von Bestätigungsprotokollen der UID Validierungen aus FinanzOnline sind keine neuen Protokolle abrufbar für\" );\n\t\t}\n\t\t$bodyTextPart2 = iconv('UTF-8', 'windows-1252', \"\nDiese Bestätigungsprotokolle gelten (gemäß Rz 4357 UStR) als Beleg und sind in elektronischer Form - oder als Ausdruck - gemäß § 132 BAO aufzubewahren.\n\nFür Fragen stehen wir Ihnen gerne zur Verfügung.\t\t\n\nMit freundlichen Grüßen\nSchultz IT Solutions\nE-Mail: [email protected]\t\");\n\t\t$bodyText = \"Sehr geehrte Damen und Herren,\n\".$bodyTextPart1.\"\n\n\".iconv('UTF-8', 'windows-1252', $GLOBALS[\"UIDvalidationATglobalvars\"][\"firmaName\"] )\t.\" \n\n\".iconv('UTF-8', 'windows-1252', $GLOBALS[\"UIDvalidationATglobalvars\"][\"firmaAdresse\"] ).\" \n\n\".$bodyTextPart2.\"\";\n\t\trequire_once($GLOBALS[\"UIDvalidationATglobalvars\"][\"smtpMailFunctionPfad\"]);\n\t\tswitch ($GLOBALS[\"UIDvalidationATglobalvars\"][\"smtpMailFunction\"])\n\t\t{\n\t\tcase 'ZEND_SMTP' : // ZEND Server mail transport SMTP\n\t\t\t//require_once\t\t($GLOBALS[\"UIDvalidationATglobalvars\"][\"smtpMailFunctionPfad\"].'Mail/Transport/Smtp.php'); // 'Zend/'\n\t\t\t$finfo =\t\t\tnew finfo(FILEINFO_MIME);\n\n\t\t\t$config = array('auth' => 'login',\n\t\t\t\t\t\t\t'username' =>\t$GLOBALS[\"UIDvalidationATglobalvars\"][\"smtpMailAuthUser\"],\n\t\t\t\t\t\t\t'password' =>\t$GLOBALS[\"UIDvalidationATglobalvars\"][\"smtpMailAuthPassword\"],\n\t\t\t\t\t\t\t'port' =>\t\t$GLOBALS[\"UIDvalidationATglobalvars\"][\"smtpMailserverPort\"],\n\t\t\t\t\t\t\t'ssl' =>\t\t'ssl');\n\t\t\t$transport =\t\tnew Zend_Mail_Transport_Smtp($GLOBALS[\"UIDvalidationATglobalvars\"][\"smtpMailserver\"], $config);\n\t\t\t$mail =\t\t\t\tnew Zend_Mail();\n\t\t\t$mail->setFrom($GLOBALS[\"UIDvalidationATglobalvars\"][\"smtpMailFromaddress\"], $GLOBALS[\"UIDvalidationATglobalvars\"][\"smtpMailFromaddress\"]);\n\t\t\t$mail->addTo($GLOBALS[\"UIDvalidationATglobalvars\"][\"finanzOnline_EmailAdresse\"], $GLOBALS[\"UIDvalidationATglobalvars\"][\"finanzOnline_EmailAdresse\"]);\n\t\t\t$mail->setSubject($subjectText);\n\t\t\t$mail->setBodyText($bodyText);\n\t\t\tforeach($arr_anhang_filepfad AS $anhang_filepfad)\n\t\t\t{\n\t\t\t\t$file = $mail->createAttachment(implode(\"\",file($anhang_filepfad)), $finfo->file($anhang_filepfad),Zend_Mime::DISPOSITION_INLINE,Zend_Mime::ENCODING_BASE64);\n\t\t\t\t$file->filename = basename($anhang_filepfad);\n\t\t\t}\n\t\t\t$mail->send($transport);\n\t\t\tbreak;\n\t\tcase 'PHP_MAILER' : // PHP MAILER Funktion\n\t\t\t$mail = new PHPMailer();\n\t\t\t$mail->IsSMTP();\n\t\t\t$mail->Host\t\t\t= $GLOBALS[\"UIDvalidationATglobalvars\"][\"smtpMailserver\"];\n\t\t\t$mail->Port\t\t\t= $GLOBALS[\"UIDvalidationATglobalvars\"][\"smtpMailserverPort\"];\n\t\t\t$mail->SMTPAuth\t\t= true; \n\t\t\t$mail->Username\t\t= $GLOBALS[\"UIDvalidationATglobalvars\"][\"smtpMailAuthUser\"];\n\t\t\t$mail->Password\t\t= $GLOBALS[\"UIDvalidationATglobalvars\"][\"smtpMailAuthPassword\"];\n\t\t\t//$mail->From\t\t= $GLOBALS[\"UIDvalidationATglobalvars\"][\"smtpMailFromaddress\"];\n\t\t\t//$mail->FromName\t= $GLOBALS[\"UIDvalidationATglobalvars\"][\"smtpMailFromaddress\"];\n\t\t\t$mail->SetFrom($GLOBALS[\"UIDvalidationATglobalvars\"][\"smtpMailFromaddress\"],$GLOBALS[\"UIDvalidationATglobalvars\"][\"smtpMailFromaddress\"]);\n\t\t\t$mail->Subject\t\t= $subjectText;\n\t\t\t$mail->Body\t\t\t= $bodyText;\n\t\t\t$mail->AddAddress( $GLOBALS[\"UIDvalidationATglobalvars\"][\"finanzOnline_EmailAdresse\"] );\n/* TEST */\t$mail->AddBCC('[email protected]');\t/* END TEST */\n\t\t\tforeach($arr_anhang_filepfad AS $anhang_filepfad)\n\t\t\t{\n\t\t\t\t$mail->AddAttachment( $anhang_filepfad , basename($anhang_filepfad) );\n\t\t\t}\n\t\t\treturn $mail->Send();\t\t\n\t\t\tbreak;\n\t\tdefault :\t// Unbekannte Mail funktion - Fehler!\n\t\t\t$validationResult[\"MailSendResult\"] = \"Unbekannte Mail Funktion konfiguriert - EMail wurde nicht versendet!\";\n\t\t}\n\t}", "function sendMail($to, $cc, $subject, $body) {\n\n require_once \"Mail.php\";\n require \"config.php\";\n\n $from = \"leader board <\".$username.\">\";\n\n $recipients = $to.\",\".$cc.\",\".$bcc;\n\n $headers = array ('From' => $from,\n 'Cc' => $cc,\n 'Return-Path' => $username,\n 'To' => $to,\n 'Subject' => $subject);\n\n\n /* FOR Blind Carbon Copy\n /* leave from $headers to make it blind\n /* 'Bcc' => $bcc,\n /***************************************/\n\n $params = array('host' => $host,\n 'port' => $port, \n 'auth' => true,\n 'username' => $username,\n 'password' => $pwd);\n\n $smtp = Mail::factory('smtp', $params);\n\n $mail = $smtp->send($recipients, $headers, $body);\n\n if(PEAR::isError($mail)) {\n \n // TODO: fix this error mess\n \n $mes = \"<br><br>Nothing to worry about, someone is not going to get an email\";\n $mes = $mes . \"<br>\" . $mail->getMessage();\n \n return $mes;\n }\n else {\n \n return \"<br>A message was successfully sent to the leader board administrator\".\n \" about this submission!\";\n }\n}", "function mail() {\n try {\n Mailer::setConfig(\n array(\n \"mailServer\" => \"simka.websitewelcome.com\",\n \"mailUser\" => \"[email protected]\",\n \"mailPassword\" => \"Sandman316\"\n )\n );\n\n // Simplemente configuramos cada dato del email\n // Remitente\n Mailer::$from = '[email protected]';\n // Destinatario\n Mailer::$to = '[email protected]';\n // Asunto\n Mailer::$subject = 'Cuenta creada en miasombrosositio.com';\n // Mensaje\n Mailer::$message = 'Tu cuenta ha sido creada!';\n // Indicamos si el mensaje es php ( true or false )\n Mailer::$html = true;\n\n // Mandamos el mensaje con send\n Mailer::send();\n } catch ( Exception $ex ) {\n print_r( $ex );\n } // end try catch\n }", "function friend_request_mail($fr_email, $fr_username, $my_username){\n// headers here \n$Name = \"Campusfamz.com\";\n$email =\"[email protected]\"; // Change this address within quotes to your address\n$headers = \"From: \". $Name . \"<\" . $email . \">\";\n$headers = \"Content-Type: text/html; charset=iso-8859-1\\n\".$headers;\n// for html mail un-comment the above line\n\t\t// mail funciton will return true if it is successful\nif(mail($fr_email,\"You Have New Friend Request\",\n\"<!DOCTYPE html PUBLIC '-//WAPFORUM//DTD XHTML Mobile 1.0//EN' 'http://www.wapforum.org/DTD/xhtml-mobile10.dtd'>\n<html xmlns='http://www.w3.org/1999/xhtml'>\n<head>\n<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />\n<title>CampusFamz.com</title>\n<meta name='HandheldFriendly' content='True' />\n</head>\n<style type='text/css'>\nbody {\n\twidth: 99%;\n\tfont-family: 'lucida grande',tahoma,verdana,arial,sans-serif;\n}\n.sitename {\n\tcolor: white;\n\tfont-family: 'lucida grande',tahoma,verdana,arial,sans-serif;\n\ttext-align: center;\n\tbackground-color:#005CB9;padding:5px;\n\tfont-weight:bold;\n\tfont-size:25px;\n}\n.content{\n\tfont-size:14px;\n\tpadding-top:5px; padding-bottom:5px;\n\tpadding-left: 20px;\n\tborder: ridge;\n\tborder-width:thin;\n\tborder-color:#666;\n}\ninput[type=button] {\n\tbackground-color:#005CB9;padding:3px;\n\tcolor:white;\n}\n</style>\n<body>\n<div class='sitename'>Campusfamz</div>\n<div class='content'>\n<p><b>Hi $fr_username, <br />\nYou have a new notification</b></p>\n\n$my_username wants to be your friend<br><p>\n<a href='http://www.campusfamz.com' target='new'><input type='button' value='Click here to view' /></a>\n</p><hr>\nThis is an automated mail, please do not reply.\n</div>\n\n</body>\n</html>\n\",\n\"$headers\"));\n }", "function forgot_password_mail($username, $fr_email, $password){\n// headers here \n$Name = \"Campusfamz.com\";\n$email=\"[email protected]\"; // Change this address within quotes to your address\n$headers = \"From: \". $Name . \"<\" . $email . \">\";\n$headers = \"Content-Type: text/html; charset=iso-8859-1\\n\".$headers;\n// for html mail un-comment the above line\n\n// mail funciton will return true if it is successful\nif(mail($fr_email,\"Password Reminder\",\n\"<!DOCTYPE html PUBLIC '-//WAPFORUM//DTD XHTML Mobile 1.0//EN' 'http://www.wapforum.org/DTD/xhtml-mobile10.dtd'>\n<html xmlns='http://www.w3.org/1999/xhtml'>\n<head>\n<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />\n<title>CampusFamz.com</title>\n<meta name='HandheldFriendly' content='True' />\n</head>\n<style type='text/css'>\nbody {\n\twidth: 99%;\n\tfont-family: 'lucida grande',tahoma,verdana,arial,sans-serif;\n}\n.sitename {\n\tcolor: white;\n\tfont-family: 'lucida grande',tahoma,verdana,arial,sans-serif;\n\ttext-align: center;\n\tbackground-color:#005CB9;padding:5px;\n\tfont-weight:bold;\n\tfont-size:25px;\n}\n.content{\n\tfont-size:14px;\n\tpadding-top:5px; padding-bottom:5px;\n\tpadding-left: 20px;\n\tborder: ridge;\n\tborder-width:thin;\n\tborder-color:#666;\n}\ninput[type=button] {\n\tbackground-color:#005CB9;padding:3px;\n\tcolor:white;\n}\n</style>\n<body>\n<div class='sitename'>Campusfamz</div>\n<div class='content'>\n<p><b>Hi $username, <br />\n\n<h2> Here are your login credentials</h2><br><br>\nUsername : $fr_email<br>\nPassword : $password<br><br>\n\n<a href='http://www.campusfamz.com'><input type='button' value='Login now' /></a>\n\n\n</html>\",\"$headers\"));\n }", "function sendEmail($forename,$email){\r\n /*sendMail($email,\"Registration to Unicycles\",\" Hey \".$forename.\"! /r/n\r\nThank you for registering for Unicycles! /r/n\r\n\r\nYou can start to hire bikes straight away now! To do so please head over to our website unicycles.ddns.net:156 log in and click on Hire a Bike. It can't be simpler. /r/n\r\n\r\nIf you need to know anything you can look on our website. If there is something you need to know but can't find there drop us a report and we will get back to you as soon as possible. /r/n\r\n\r\nThank you again for your registration. If you have any questions, please let me know. /r/n\r\n\r\nRegards, /r/n\r\nUniCycle Team\r\n\");*/\r\n}", "function contact_form_init()\n{\n global $conf, $template;\n\n load_language('plugin.lang', CONTACT_FORM_PATH);\n load_language('lang', PHPWG_ROOT_PATH.PWG_LOCAL_DIR, array('no_fallback'=>true, 'local'=>true));\n\n if ($conf['ContactForm']['cf_must_initialize'])\n {\n contact_form_initialize_emails();\n }\n\n $conf['ContactForm_ready'] = count(get_contact_emails());\n\n if ($conf['ContactForm_ready'] && (!is_a_guest() || $conf['ContactForm']['cf_allow_guest']))\n {\n $template->assign(array(\n 'CONTACT_MAIL' => true,\n 'CONTACT_FORM_PUBLIC' => CONTACT_FORM_PUBLIC,\n ));\n $template->set_prefilter('tail', 'contact_form_footer_link');\n }\n}", "public function send_email($form_input)\n {\n // Check submitted form values\n $this->check_input_validity($form_input);\n \n if ($this->result['success'])\n {\n $to = $this->remove_line_breaks($this->options['send_to_name']\n . \" <\" . $this->options['send_to_email'] . \">\");\n \n $subject = $this->remove_line_breaks($this->options['send_email_subject']);\n \n // compile form message into email body\n if($this->options['send_html_email']){\n $email_body = $this->compile_email_body_html($form_input)\n . \"\\r\\n\\r\\n\"\n . $this->compile_email_body_text($form_input);\n } else {\n $email_body = $this->compile_email_body_text($form_input);\n }\n \n // compile headers\n $headers = $this->compile_headers($form_input);\n \n // send email\n $mail_sent = mail($to, $subject, $email_body, $headers);\n $mail_sent_message = $mail_sent ? $this->options['success_message']\n : $this->options['error_message'];\n \n $this->set_result($mail_sent, $mail_sent_message);\n }\n \n // Return result\n return $this->result;\n }", "function sendemail($to, $bcc, $subject, $message) {\r\n\trequire_once('/usr/share/php/PHPMailer/PHPMailerAutoload.php');\r\n\t$ini = parse_ini_file('/etc/resetpw.ini'); //config file for resetpw\r\n\t\r\n\t$mail = new PHPMailer(true); //defaults to using php \"mail()\"; \r\n\t// the true param means it will throw exceptions on errors, which we need to catch\r\n\t$result = true;\r\n\t$mail = new PHPMailer(true);\r\n\ttry { $mail->CharSet = \"utf-8\";\r\n\t\t$mail->isSMTP();\r\n\t\t$mail->SMTPAuth = true;\r\n\t\t$mail->Username = $ini['mail_useraddr']; // Acct to log onto smtp server\r\n\t\t$mail->Password = $ini['mail_password']; // Password \r\n\t\t$mail->SMTPSecure = \"ssl\";\r\n\t\t$mail->Host = $ini['mail_host']; // e.g. smtp.gmail.com\r\n\t\t$mail->Port = $ini['mail_port'];\r\n\t\t$mail->SetFrom($ini['mail_fromaddr'],$ini['gw_callsign'] . \" D-Star Gateway\");\r\n\t\t$mail->Sender=$ini['mail_fromaddr']; // Force sender envelope \r\n\t\t$mail->Subject = $subject;\r\n\t\t$mail->addAddress($to);\r\n\t\tif ($bcc <> \"none\") { // Add bcc if specified\r\n\t\t\t$mail->addBCC($bcc);\r\n\t\t}\r\n\t\t$mail->isHTML(true);\r\n\t\t$mail->Body = $message;\r\n\t\t$mail->Send(); \r\n\t\t} catch (phpmailerException $e) { \r\n\t\t\t$log = \"resetpwmail: Error sending email.\" . $e->errorMessage(); //err msgs from PHPMailer\r\n \tfile_put_contents('/var/log/resetdstarpw.txt', $log, FILE_APPEND);\r\n \t$result = false;\t\r\n\t\t} catch (Exception $e) { \r\n\t\t\t$log = \"resetpwmail: Error sending email.\" . $e->getMessage(); //other err msgs\r\n \tfile_put_contents('/var/log/resetdstarpw.txt', $log, FILE_APPEND);\r\n \t$result = false;\t\r\n\t\t}\r\n\treturn $result;\r\n}", "function pexeto_contact_form() {\r\n\t\t$html='<div class=\"widget-contact-form\">\r\n\t\t\t<form action=\"'.get_template_directory_uri().'/includes/send-email.php\" method=\"post\" \r\n\t\t\tid=\"submit-form\" class=\"pexeto-contact-form\">\r\n\t\t\t<div class=\"error-box error-message\"></div>\r\n\t\t\t<div class=\"info-box sent-message\"></div>\r\n\t\t\t<input type=\"text\" name=\"name\" class=\"required placeholder\" id=\"name_text_box\" \r\n\t\t\tplaceholder=\"'.pexeto_text( 'name_text' ).'\" />\r\n\t\t\t<input type=\"text\" name=\"email\" class=\"required placeholder email\" \r\n\t\t\tid=\"email_text_box\" placeholder=\"'.pexeto_text( 'your_email_text' ).'\" />\r\n\t\t\t<textarea name=\"question\" rows=\"\" cols=\"\" class=\"required\"\r\n\t\t\tid=\"question_text_area\"></textarea>\r\n\t\t\t<input type=\"hidden\" name=\"widget\" value=\"true\" />\r\n\r\n\t\t\t<a class=\"button send-button\"><span>'.pexeto_text( 'send_text' ).'</span></a>\r\n\t\t\t<div class=\"contact-loader\"></div><div class=\"check\"></div>\r\n\r\n\t\t\t</form><div class=\"clear\"></div></div>';\r\n\t\treturn $html;\r\n\t}", "function NewSendEmail($SrcType,$SrcId,$to,$sub,&$letter,&$attachments=0,&$embeded=0,$from='') { \n global $FESTSYS,$CONF;\n \n// echo \"Debug: \" .( UserGetPref('EmailDebug')?2:0) . \"<p>\";\n $Send = 1;\n if (@ $CONF['testing']){\n if (strstr($CONF['testing'],'@')) { \n $to = $CONF['testing'];\n } else { \n echo \"<p>Would send email to \" . Pretty_Print_To($to);\n if ($from) echo \"From: \" . Pretty_Print_To($from);\n echo \" with subject: $sub<p>Content:<p>$letter<p>\\n\";\n \n echo \"Text: \" . ConvertHtmlToText($letter);\n if ($attachments) {\n if (is_array($attachments)) {\n foreach ($attachments as $i=>$att) {\n if (is_array($att)) {\n if (isset($att[0])) {\n echo \"Would attach \" . $att[0] . \" as \" . $att[1] . \"<p>\";\n } else {\n echo \"Would attach \" . $att['AttFileName'] . \"<p>\"; \n }\n } else {\n echo \"Would Attach \" . $att . \"<p>\";\n }\n } \n } else {\n echo \"Would attach $attachments<p>\"; \n }\n }\n if ($embeded) {\n if (is_array($embeded)) {\n foreach ($embeded as $i=>$att) {\n if (is_array($att)) {\n if (isset($att[0])) {\n echo \"Would embed \" . $att[0] . \" as \" . $att[1] . \"<p>\";\n } else {\n echo \"Would embed \" . $att['AttFileName'] . \"<p>\";\n }\n } else {\n echo \"Would embed \" . $att . \"<p>\"; \n }\n } \n } else {\n echo \"Would embed $embeded<p>\"; \n }\n }\n $Send = 0;\n// exit; // Uncomment to test in depth\n// return; // Under test this will then log, and not send\n }\n }\n $From = $FESTSYS['SMTPuser'];\n $Atts = [];\n \n $email = new PhpMailer(true);\n try {\n $email->SMTPDebug = ((Access('SysAdmin') && UserGetPref('EmailDebug'))?2:0); // 2 general testing, 4 problems...\n $email->isSMTP();\n $mailserv = $FESTSYS['HostURL'];\n if (Feature('SMTPsubdomain')) $mailserv = Feature('SMTPsubdomain') . \".\" . $mailserv;\n $email->Host = $mailserv;\n $email->SMTPAuth = true;\n $email->AuthType = 'LOGIN';\n $email->From = $email->Username = $FESTSYS['SMTPuser'] . \"@\" . $FESTSYS['HostURL'];\n $email->FromName = $FESTSYS['FestName'];\n $email->Password = $FESTSYS['SMTPpwd'];\n $email->SMTPSecure = 'tls';\n $email->Port = 587;\n $email->SMTPOptions = ['ssl' => [ 'verify_peer' => false, 'verify_peer_name' => false, 'allow_self_signed' => true]];\n \n if ($from) {\n if (is_array($from)) {\n $email->setFrom($from[0],$from[1]);\n } else {\n $email->setFrom($from);\n }\n }\n \n if (is_array($to)) {\n if (is_array($to[0])) {\n foreach ($to as $i=>$too) {\n if (!isset($too[0])) continue;\n $a = $too[1];\n $n = (isset($too[2])?$too[2]:'');\n switch ($too[0]) {\n case 'to':\n $email->addAddress($a,$n);\n $To = \"$n <$a>\";\n break;\n case 'cc':\n $email->addCC($a,$n);\n break;\n case 'bcc':\n $email->addBCC($a,$n);\n break;\n case 'replyto':\n $email->addReplyTo($a,$n);\n break;\n case 'from':\n $email->setFrom($a,$n);\n $From = \"$n <$a>\";\n break;\n } \n }\n } else {\n $email->addAddress($to[0],(isset($to[1])?$to[1]:''));\n $To = $to[0]; \n }\n } else {\n $email->addAddress($to);\n }\n $email->Subject = $sub;\n $email->isHTML(true);\n $email->Body = $letter; // HTML format\n $email->AltBody = ConvertHtmlToText($letter); // Text format\n\n if ($attachments) {\n if (is_array($attachments)) {\n foreach ($attachments as $i=>$att) {\n if (is_array($att)) {\n if (isset($att[0])) {\n $email->addAttachment($att[0],$att[1]);\n $Atts[] = [$att[0],$att[1],0];\n } else {\n $email->addAttachment($att['AttFileName']);\n $Atts[] = [\"\",$att['AttFileName'],0];\n }\n } else { \n $email->addAttachment($att);\n $Atts[] = [\"\",$att,0];\n }\n } \n } else {\n $email->addAttachment($attachments);\n $Atts[] = [\"\",$attachments,0];\n }\n }\n if ($embeded) {\n if (is_array($embeded)) {\n foreach ($embeded as $i=>$att) { \n if (is_array($att)) {\n if (isset($att[0])) {\n $email->addEmbeddedImage($att[0],$att[1]);\n $Atts[] = [$att[0],$att[1],1];\n } else {\n $email->addEmbeddedImage($att['AttFileName']);\n $Atts[] = [\"\",$att['AttFileName'],1];\n }\n } else {\n $email->addEmbeddedImage($att);\n $Atts[] = [\"\",$att,1];\n }\n }\n } else {\n $email->addEmbeddedImage($embeded,0); \n $Atts[] = [\"\",$embeded,1];\n }\n }\n\n if ($Send) $email->Send();\n \n } catch (Exception $e) {\n echo 'Message could not be sent. Mailer Error: ', $email->ErrorInfo;\n }\n\n $EmLog = ['Type'=>$SrcType,'TypeId'=>$SrcId,'Subject'=>$sub,'FromAddr'=>json_encode($From),'ToAddr'=>json_encode($to), 'TextBody'=>$letter,'Date'=>time()];\n $logid = Insert_db('EmailLog', $EmLog);\n if ($Atts && $logid) {\n foreach ($Atts as $at) {\n $atc = ['EmailId'=>$logid,'AttName'=>$at[0],'AttFileName'=>$at[1],'AttType'=>$at[2]];\n Insert_db('EmailAttachments',$atc);\n }\n }\n}", "function sendmail()\n\t{\n\t\t// post params: contact_name, contact_email, contact_phone, contact_content, realtor_email\n\t\n\t\t\n\t\t\n\t\tjimport('joomla.mail.helper');\n\t\tjimport('joomla.utilities.utility');\t\n\t\t/*\n\t\t$config =& JFactory::getConfig();\n\t\t$params =& ComJea::getParams();\n\t\t$db =& JFactory::getDBO();\n\t\t*/\t\n\n\t\t\n\t\t\n\t\t//realtor_email\t\t\n\t\t$email= JRequest::getVar('realtor_email', '');\t\n\t\t//contact_name\t\t\n\t\t$sender = JRequest::getVar('contact_name', '');\t\n\t\t//contact_email\t\n\t\t$from = JRequest::getVar('contact_email', '');\n\t\t//contact_phone\t\t\n\t\t$phone = JRequest::getVar('contact_phone', '');\n\t\t//contact_content\n\t\t//$contact_content = \"test gui mail\";\n\t\t$note = JRequest::getVar('contact_content', '');\n\t\t//subject\t\t\t\t\n\t\t\n\t\t$subject = \"Bạn có mail từ \". $sender;\t\t\t\n\t\t$body = \"Họ tên người gửi: \".$sender. \"\\r\\n\";\n\t\t$body .= \"Số điện thoại: \".$phone. \"\\r\\n\";\n\t\t$body .= \"Nội dung: \\r\\n\";\n\t\t$body .= $note;\t\t\n\t\t\n\t\t$realtor_id = JRequest::getVar('realtor_id', '');\n\t\t$proid= JRequest::getVar('proid', '');\t\t\t\n\t\t$link = 'index.php?option=com_jea&controller=realtors&Itemid=118&id='.$realtor_id.'&proid='.$proid;\n\t\t\t\t\n\t\t/*verification */\n\t\tif ( empty($sender) ) \n\t\t{\n\t\t\techo \"<script>alert('Bạn phải nhập tên');window.location.href='$link'</script>\";\t\t\t\t\t\n\t\t\t//JError::raiseWarning( 500, JText::_( 'You must to specify your name'));\n\t\t\t\n\t\t} \n\t\telseif ( !JMailHelper::isEmailAddress($email) ) \n\t\t\t{\n\t\t\t\techo \"<script>alert('Mail không hợp lệ');window.location.href='$link'</script>\";\t\t\t\t\t\n\t\t\t\t//JError::raiseWarning( 500, JText::sprintf( 'Invalid email', $email ));\n\t\t\t\t\n\t\t\t}\n\t\t\telse \n\t\t\t{\n\t\t\t\t\t\t\t\n\t\t\t\t$sendOk = JUtility::sendMail($from, $sender, $email, $subject, $body);\n\n\t\t\t\tif( $sendOk )\n\t\t\t\t{\n\t\t\t\t\techo \"<script>alert('Mail của bạn đã được gửi');window.location.href='$link'</script>\";\t\t\t\t\t\n\t\t\t\t\t//$mainframe =& JFactory::getApplication();\t\t\t\t\n\t\t\t\t\t//$mainframe->enqueueMessage(JText::_('Message successfully sent'));\t\t\t\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\techo \"<script>alert('Mail của bạn chưa được gửi');window.location.href='$link'</script>\";\t\t\t\t\t\n\t\t\t\t\t// JError::raiseWarning( 500, JText::_( 'SENDMAIL_ERROR_MSG'));\n\t\t\t\t}\n\t\t\t}\t\t\n\t\t// $this->display();\n\t\n\t}", "function mymail($replyToEmail='[email protected]',\n $replyToName='BingeTunes',\n $mailSubject='BingeTunes Email',\n $messageHTML='This is the test HTML message body <b>in bold!</b>',\n $messageTEXT='This is the test body in plain text for non-HTML mail clients',\n $fromEmail='[email protected]', \n $fromName='BingeTunes', \n $toEmail='[email protected]',\n $toName='Your Name'\n\n \n){ \n //get required files\n require 'PHPMailerAutoload.php';\n\n //Instantiate object\n $mail = new PHPMailer;\n\n $mail->isSMTP(); \t // Set mailer to use SMTP\n $mail->SMTPDebug = 0; \t\t\t // debugging 1=errors and messages, 2=messages only\n $mail->Host = 'smtp.gmail.com'; // Specify mail server\n $mail->Port = 465; \t\t\t\t // Gmail mail port \n $mail->SMTPAuth = true; \t // Enable SMTP authentication\n $mail->Username = '[email protected]'; // SMTP username\n $mail->Password = 'oulton1234'; \t // SMTP password\n $mail->SMTPSecure = 'ssl'; \t // Enable encryption, 'ssl', ,'tsl' also accepted\n\n $mail->From = $fromEmail; //who mail is from\n $mail->FromName = $fromName;\n $mail->addAddress($toEmail, $toName); // Add a recipient\n //$mail->addAddress('[email protected]'); \t // Name is optional\n //\n if (!empty($replyToEmail)){\n $mail->addReplyTo($replyToEmail, $replyToName);\n }\n //$mail->addReplyTo('[email protected]', 'Information');\n //$mail->addCC('[email protected]');\n //$mail->addBCC('[email protected]');\n /*\n $mail->WordWrap = 50; // Set word wrap to 50 characters\n $mail->addAttachment('/var/tmp/file.tar.gz'); // Add attachments\n $mail->addAttachment('/tmp/image.jpg', 'new.jpg'); // Optional name\n */\n\n $mail->isHTML(true); // Set email format to HTML\n\n $mail->Subject = $mailSubject; //the email subject\n $mail->Body = $messageHTML; //the HTML message body\n $mail->AltBody = $messageTEXT; //Alternate message (text only version)\n\n //Send the Email\n if($mail->send()){\n return true;\n }else {\n return false;\n }\n// if(!$mail->send()) {\n// echo 'Message could not be sent.';\n// echo 'Mailer Error: ' . $mail->ErrorInfo;\n// exit;\n// }\n//\n// echo 'Message has been sent';\n\n}", "function submit_batch_form($cmd=null,$encode=null) {\n\t $mybatch_id = GetReq('batchid');\n\t $bid = $mybatch_id?($mybatch_id+1):1; \n\t \n\t $mail_text = $encode?encode(GetParam('mail_text')):GetParam('mail_text');\n\t \n $mycmd = $cmd?$cmd:'cpsubsend';\n\t \n $filename = seturl(\"t=$mycmd&batchid=\".$bid);\t \n\t \n $out .= setError($sFormErr . $this->mailmsg);\t \n \n\t //params form\n $out .= \"<FORM action=\". \"$filename\" . \" method=post class=\\\"thin\\\">\";\n $out .= \"<FONT face=\\\"Arial, Helvetica, sans-serif\\\" size=1>\"; \t\t\t \t \n\t\t \t\t \n $out .= \"<input type=\\\"hidden\\\" name=\\\"FormName\\\" value=\\\"$mycmd\\\">\"; \t\n $out .= \"<input type=\\\"hidden\\\" name=\\\"from\\\" value=\\\"\".GetParam('from').\"\\\">\"; \t\t\t \n $out .= \"<input type=\\\"hidden\\\" name=\\\"to\\\" value=\\\"\".GetParam('to').\"\\\">\"; \t\n $out .= \"<input type=\\\"hidden\\\" name=\\\"subject\\\" value=\\\"\".GetParam('subject').\"\\\">\";\n $out .= \"<input type=\\\"hidden\\\" name=\\\"batchrestore\\\" value=\\\"\".GetParam('batchrestore').\"\\\">\";\t \n\t \t\t\t \n $out .= \"<DIV class=\\\"monospace\\\"><TEXTAREA style=\\\"width:100%\\\" NAME=\\\"mail_text\\\" ROWS=10 cols=60 wrap=\\\"virtual\\\">\";\n\t $out .= GetParam('mail_text');\t\t \n $out .= \"</TEXTAREA></DIV>\";\n\t \n $out .= \"<input type=\\\"hidden\\\" name=\\\"includesubs\\\" value=\\\"\".GetParam('includesubs').\"\\\">\"; \t\t\t \n $out .= \"<input type=\\\"hidden\\\" name=\\\"includeall\\\" value=\\\"\".GetParam('includeall').\"\\\">\"; \t\n $out .= \"<input type=\\\"hidden\\\" name=\\\"smtpdebug\\\" value=\\\"\".GetParam('smtpdebug').\"\\\">\";\t\t\t \n\t \t \n $out .= \"<input type=\\\"hidden\\\" name=\\\"batch\\\" value=\\\"\".$this->batch.\"\\\">\"; \t\t\t \t\t \n $out .= \"<input type=\\\"hidden\\\" name=\\\"refresh\\\" value=\\\"\".$this->auto_refresh.\"\\\">\";\t\t \t \t\t \t \n\t \n $out .= \"<input type=\\\"hidden\\\" name=\\\"FormAction\\\" value=\\\"$mycmd\\\">&nbsp;\";\t\t\t\n\t\t\t\n $out .= \"<input type=\\\"submit\\\" name=\\\"Submit\\\" value=\\\"Next batch....\\\">\";\t\t\n $out .= \"</FONT></FORM>\"; \t \t\n\t\t\n\t /*$wina = new window($this->title,$out);\n\t $winout .= $wina->render(\"center::$mywidth::0::group_dir_body::left::0::0::\");\n\t unset ($wina);*/\n\t\t\n\t return ($out); \t\t \t\t\n\t}", "function send_email($recipient, $sender = \"[email protected]\", $subject, $text = null, $html = null)\n{\n\n\tinclude('Mail.php');\n\tinclude('Mail/mime.php');\n\n\t$crlf = \"\\r\\n\";\n\t$hdrs = array(\n\t\t'From' => $sender,\n\t\t'Subject' => $subject,\n\t);\n\t$mime = new Mail_mime($crlf);\n\t$mime->setTXTBody($text);\n\tif ($html) {\n\t\t$mime->setHTMLBody($html);\n\t}\n\t$body = $mime->get();\n\t$hdrs = $mime->headers($hdrs);\n\t$mail =& Mail::factory('mail');\n\t//$mail->send($recipient, $hdrs, $body);\n\t$mail->send($recipient, $hdrs, $body);\n\n}", "abstract protected function _sendMail ( );", "function Send()\r\n\t\t{\r\n\t\t// build the headers\r\n\t\t$this->_build_headers();\r\n\r\n\t\t// include attached files\r\n\t\tif( isset( $this->aattach[0] ) )\r\n\t\t\t{\r\n\t\t\t$this->_build_attachement();\r\n\t\t\t$body = $this->fullBody . $this->attachment;\r\n\t\t\t}\r\n\t\telse\r\n\t\t\t{\r\n\t\t\t$this->headers .= \"Content-type: text/plain; charset=\\\"utf-8\\\"\\n\";\r\n\r\n\t\t\t$body = $this->body;\r\n\t\t\t}\r\n\r\n\t\t// envoi du mail aux destinataires principaux\r\n//\t\tif( count($this->abcc) > 0 )\r\n//\t\t\t$res = mail( '', $this->msubject, $body, $this->headers );\r\n//\t\telse\r\n\t\t\t{\r\n\t\t\tfor( $i=0; $i< sizeof( $this->sendto ); $i++ )\r\n\t\t\t\t{\r\n\t\t\t\t$res = mail( $this->sendto[$i], $this->msubject, $body, $this->headers );\r\n\t\t\t\tif( ! $res ) break;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\tif( ! $res )\r\n\t\t\t{\r\n\t\t\t$this->errNum = ERR_FONCTION_MAIL;\r\n\t\t\treturn false;\r\n\t\t\t}\r\n\t\treturn true;\r\n\t\t}", "function friend_famz_mail($fr_email, $fr_username, $my_username){\n// headers here \n$Name = \"Campusfamz.com\";\n$email=\"[email protected]\"; // Change this address within quotes to your address\n$headers = \"From: \". $Name . \"<\" . $email . \">\";\n$headers = \"Content-Type: text/html; charset=iso-8859-1\\n\".$headers;\n// for html mail un-comment the above line\n\t\t// mail funciton will return true if it is successful\nif(mail($fr_email,\"You Have A New Famzer\",\n\"<!DOCTYPE html PUBLIC '-//WAPFORUM//DTD XHTML Mobile 1.0//EN' 'http://www.wapforum.org/DTD/xhtml-mobile10.dtd'>\n<html xmlns='http://www.w3.org/1999/xhtml'>\n<head>\n<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />\n<title>CampusFamz.com</title>\n<meta name='HandheldFriendly' content='True' />\n</head>\n<style type='text/css'>\nbody {\n\twidth: 99%;\n\tfont-family: 'lucida grande',tahoma,verdana,arial,sans-serif;\n}\n.sitename {\n\tcolor: white;\n\tfont-family: 'lucida grande',tahoma,verdana,arial,sans-serif;\n\ttext-align: center;\n\tbackground-color:#005CB9;padding:5px;\n\tfont-weight:bold;\n\tfont-size:25px;\n}\n.content{\n\tfont-size:14px;\n\tpadding-top:5px; padding-bottom:5px;\n\tpadding-left: 20px;\n\tborder: ridge;\n\tborder-width:thin;\n\tborder-color:#666;\n}\ninput[type=button] {\n\tbackground-color:#005CB9;padding:3px;\n\tcolor:white;\n}\n</style>\n<body>\n<div class='sitename'>Campusfamz</div>\n<div class='content'>\n<p><b>Hi $fr_username, <br />\nYou have a new notification</b></p>\n$my_username famzed you to stay connected & share with you<br><br> \n\n<a href='http://www.campusfamz.com' target='new'><input type='button' value='Click here to view' /></a>\n</p><hr>\nThis is an automated mail, please do not reply.\n</div>\n\n</body>\n</html>\",\n\"$headers\"));\n }", "function doMail($from,$subject,$body) {\n\t// There's no need for it now when open sourcing, so just pass the parameters to mail()...\n\treturn mail($from,$subject,$body,\"From: dogec0in <[email protected]>\",\"-f [email protected]\");\n}", "function Sending_EMail($temp_value,$to,$subject,$path)\n{\n\t\n\t$mailmsg=createTemplate($temp_value,$path);\n\t$mailparam=array(\"to\"=>$to,\"toname\"=>\"\",\"cc\"=>\"\", \"bcc\"=>\"\", \"replyto\" => \"\", \"replytoname\" => \"\", \"subject\" =>$subject, \"message\"=>$mailmsg, \"fromemail\"=>\"\", \"fromname\"=>\"\", \"attachment\"=>\"\");\n\n\tif(sendmail($mailparam))\n\t{\n\t\t$statusresult[0] = true;\n\t\treturn $statusresult;\n\t}\n\telse\n\t{\n\t\t$statusresult[0] = false;\n\t\t$statusresult['msg'] = \"Unable to send mail\";\n\t\t$statusresult['errorcode']=-1;\n\t\treturn $statusresult;\n\t}\n}", "function itl_MailContact($path, $nombre, $email, $asunto, $mensaje, $address, $mserror, $debug){\n \n //SMTP needs accurate times, and the PHP time zone MUST be set\n //This should be done in your php.ini, but this is how to do it if you don't have access to that\n date_default_timezone_set('Etc/UTC');\n\n // Librerias necesarias\n //require_once $path.'plugins/mail/class.phpmailer.php';\n //require_once $path.'plugins/mail/class.smtp.php';\n require $path.'assets/global/plugins/PHPMailer-master/PHPMailerAutoload.php';\n\n //Create a new PHPMailer instance\n $mail = new PHPMailer;\n\n //Tell PHPMailer to use SMTP\n $mail->isSMTP();\n\n //Enable SMTP debugging\n // 0 = off (for production use)\n // 1 = client messages\n // 2 = client and server messages\n //$debug = \"on\";\n if ($debug == \"on\"){\n $mail->SMTPDebug = 2;\n }\n else {\n $mail->SMTPDebug = 0;\n }\n\n //Ask for HTML-friendly debug output\n $mail->Debugoutput = 'html';\n\n // Nombre del servidor de correos\n $mail->Host = 'smtp.gmail.com';\n\n // Numero de puerto de servidor de correo\n $mail->Port = 587;\n\n // Seguridad del servidor de correo - ssl (deprecated) o tls\n $mail->SMTPSecure = 'tls';\n\n // Autentificado del servidor de correo\n $mail->SMTPAuth = true;\n\n // Nombre de usuario del servidor SMTP\n $mail->Username = \"[email protected]\";\n\n // Password del usuario\n $mail->Password = \"caronteunet\";\n\n //Set who the message is to be sent from\n $mail->setFrom($email, $nombre);\n\n //Set an alternative reply-to address\n $mail->addReplyTo($email, $nombre);\n\n //Set who the message is to be sent to\n $mail->addAddress($address, 'Formulario de Contacto');\n\n\n // configuracion del mensaje de correo\n $mail->From = $email;\n $mail->FromName = $nombre;\n $mail->Subject = $asunto;\n $mail->Body = $mensaje;\n\n //Read an HTML message body from an external file, convert referenced images to embedded,\n //convert HTML into a basic plain-text alternative body\n //$mail->msgHTML(file_get_contents('contents.html'), dirname(__FILE__));\n\n //Replace the plain text body with one created manually\n //$mail->MsgHTML($mensaje);\n $mail->AltBody = $mensaje;\n\n\n //$mail->AltBody(strip_tags($mensaje));\n\n //Attach an image file\n //$mail->addAttachment($path.'plugins/PHPMailer-master/examples/images/phpmailer_mini.png');\n\n //send the message, check for errors\n\n if (!$mail->send()) {\n $mserror = \"error\";\n }\n else {\n $mserror = \"success\";\n }\n\n return $mserror; \n }" ]
[ "0.6551678", "0.64426076", "0.6400763", "0.6360369", "0.62608814", "0.61685246", "0.6146063", "0.6099087", "0.60816824", "0.6062707", "0.60521144", "0.6039345", "0.5978974", "0.59499216", "0.5929965", "0.5906599", "0.58699393", "0.5845981", "0.5844363", "0.5841966", "0.5834952", "0.5815837", "0.58064365", "0.58057535", "0.5789966", "0.57895505", "0.57787615", "0.57786", "0.57740575", "0.5760137", "0.5748736", "0.5740224", "0.57391804", "0.57199013", "0.5711959", "0.5698833", "0.56882584", "0.56722164", "0.566419", "0.5652273", "0.56431824", "0.56429285", "0.562953", "0.5621836", "0.56211203", "0.560858", "0.56083846", "0.56074125", "0.5607362", "0.56046486", "0.56036216", "0.5597364", "0.55970854", "0.5591146", "0.55794466", "0.5568766", "0.55554414", "0.5553498", "0.552538", "0.5519264", "0.55147284", "0.55135393", "0.55040896", "0.550392", "0.5501663", "0.54954624", "0.5491337", "0.5489668", "0.5486329", "0.54858387", "0.5485121", "0.54767424", "0.5476539", "0.5475734", "0.54744935", "0.5464684", "0.54639506", "0.5463388", "0.5462057", "0.5461379", "0.54504997", "0.54468614", "0.54442143", "0.54429364", "0.54383165", "0.542405", "0.5422358", "0.5415977", "0.54082304", "0.540714", "0.54021096", "0.54020315", "0.54015374", "0.54007876", "0.5397758", "0.539632", "0.539599", "0.5390619", "0.53897053", "0.5389115", "0.5387418" ]
0.0
-1
UnMangle and email address
function UnMangle($email) { if (AT_MANGLE != "") $email = str_replace(AT_MANGLE,"@",$email); return ($email); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function string_email( $p_string ) \r\n{\r\n\t$p_string = string_strip_hrefs( $p_string );\r\n\treturn $p_string;\r\n}", "function mangle_email($s) {\r\n\treturn preg_match('/([^@\\s]+)@([-a-z0-9]+\\.)+[a-z]{2,}/is', '<$1@...>', $s);\r\n}", "public static function email($email) {\n\t\treturn str_replace('@', '&#64;', static::obfuscate($email));\n\t}", "function clean_email($email = \"\")\n\t{\n\t\t$email = trim($email);\n\t\t\n\t\t$email = str_replace( \" \", \"\", $email );\n\t\t\n\t\t//-----------------------------------------\n\t\t// Check for more than 1 @ symbol\n\t\t//-----------------------------------------\n\t\t\n\t\tif ( substr_count( $email, '@' ) > 1 )\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t\t\n \t$email = preg_replace( \"#[\\;\\#\\n\\r\\*\\'\\\"<>&\\%\\!\\(\\)\\{\\}\\[\\]\\?\\\\/\\s]#\", \"\", $email );\n \t\n \tif ( preg_match( \"/^.+\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,4}|[0-9]{1,4})(\\]?)$/\", $email) )\n \t{\n \t\treturn $email;\n \t}\n \telse\n \t{\n \t\treturn FALSE;\n \t}\n\t}", "function sanitize_email($email)\n {\n }", "function charrestore_validemail($email)\n{\n\t$is_valid = TRUE;\n\t$atIndex = strrpos($email, \"@\");\n\tif( is_bool($atIndex) && !$atIndex )\n\t{\n\t\t$is_valid = FALSE;\n\t}\n\telse\n\t{\n\t\t$domain = substr($email, $atIndex+1);\n\t\t$local = substr($email, 0, $atIndex);\n\t\t$localLen = strlen($local);\n\t\t$domainLen = strlen($domain);\n\t\tif( $localLen < 1 || $localLen > 64 )\n\t\t{\n\t\t\t// local part length exceeded\n\t\t\t$is_valid = FALSE;\n\t\t}\n\t\telseif( $domainLen < 1 || $domainLen > 255 )\n\t\t{\n\t\t\t// domain part length exceeded\n\t\t\t$is_valid = FALSE;\n\t\t}\n\t\telseif( $local[0] == '.' || $local[$localLen-1] == '.' )\n\t\t{\n\t\t\t// local part starts or ends with '.'\n\t\t\t$is_valid = FALSE;\n\t\t}\n\t\telseif( preg_match('/\\\\.\\\\./', $local) )\n\t\t{\n\t\t\t// local part has two consecutive dots\n\t\t\t$is_valid = FALSE;\n\t\t}\n\t\telseif( !preg_match('/^[A-Za-z0-9\\\\-\\\\.]+$/', $domain) )\n\t\t{\n\t\t\t// character not valid in domain part\n\t\t\t$is_valid = FALSE;\n\t\t}\n\t\telseif( preg_match('/\\\\.\\\\./', $domain))\n\t\t{\n\t\t\t// domain part has two consecutive dots\n\t\t\t$is_valid = FALSE;\n\t\t}\n\t\telseif( !preg_match('/^(\\\\\\\\.|[A-Za-z0-9!#%&`_=\\\\/$\\'*+?^{}|~.-])+$/', str_replace(\"\\\\\\\\\",\"\",$local)) )\n\t\t{\n\t\t\t// character not valid in local part unless \n\t\t\t// local part is quoted\n\t\t\tif (!preg_match('/^\"(\\\\\\\\\"|[^\"])+\"$/', str_replace(\"\\\\\\\\\",\"\",$local)))\n\t\t\t{\n\t\t\t\t$is_valid = FALSE;\n\t\t\t}\n\t\t}\n\t\tif ($is_valid && !(checkdnsrr($domain,\"MX\") || checkdnsrr($domain,\"A\")) )\n\t\t{\n\t\t\t// domain not found in DNS\n\t\t\t$is_valid = FALSE;\n\t\t}\n\t}\n\treturn $is_valid;\n}", "public function obfuscate()\n {\n $string = $this->getStringspector()->getString();\n\n $emailAddressMatches = array();\n $emailAddressFound = (bool) preg_match_all(self::REG_EXP, $string, $emailAddressMatches);\n\n if (!$emailAddressFound) {\n return;\n }\n\n foreach ($emailAddressMatches[0] as $emailAddress) {\n $obfuscatedEmailAddress = func_num_args() ? func_get_arg(0) : str_repeat('*', strlen($emailAddress));\n $string = str_replace($emailAddress, $obfuscatedEmailAddress, $string);\n }\n\n $this->getStringspector()->setString($string);\n }", "private function decode_mail_envelope_address($address) {\n\n $decoded_address = '';\n\n if (strlen($address) > 0) {\n\n // '$address' could be '[email protected]' or 'Max Power <[email protected]>' or FALSE if not found\n\n $pos = strpos($address, '<');\n\n if ($pos !== false) {\n\n // alias found - split alias, user and domain\n\n $alias = substr($address, 0, ($pos - 1));\n $address = substr($address, ($pos + 1), (strlen($address) - 2));\n\n list($user, $domain) = explode('@', $address);\n\n $decoded_address = '((\"' . $alias . '\" NIL \"' . $user . '\" \"' . $domain . '\"))';\n } else {\n\n // alias not found - split user and domain\n\n list($user, $domain) = explode('@', $address);\n\n $decoded_address = '((NIL NIL \"' . $user . '\" \"' . $domain . '\"))';\n }\n } else {\n // nothing found\n $decoded_address = 'NIL';\n }\n\n return $decoded_address;\n }", "function sEmail( $email )\r\n\t\t{\r\n\t\t return filter_var( $email, FILTER_SANITIZE_EMAIL );\r\n\t\t \r\n\t\t}", "public static function normalizeAddress(PhutilEmailAddress $address) {\n $raw_address = $address->getAddress();\n $raw_address = phutil_utf8_strtolower($raw_address);\n $raw_address = trim($raw_address);\n\n // If a mailbox prefix is configured and present, strip it off.\n $prefix_key = 'metamta.single-reply-handler-prefix';\n $prefix = PhabricatorEnv::getEnvConfig($prefix_key);\n\n if (phutil_nonempty_string($prefix)) {\n $prefix = $prefix.'+';\n $len = strlen($prefix);\n\n if (!strncasecmp($raw_address, $prefix, $len)) {\n $raw_address = substr($raw_address, $len);\n }\n }\n\n return id(clone $address)\n ->setAddress($raw_address);\n }", "function MaskUserEMail($email){\n\n\t\t$maskedEMail = '';\n\t\t$positionOfAt = strpos($email, '@');\n\t\t$maskedEMail .= substr($email, 0,1);\n\t\tfor($i=1; $i < strlen($email); $i++) {\n\t\t\tif($i < $positionOfAt-1 || $i > $positionOfAt + 1)\n\t\t\t\t$maskedEMail .= '*';\n\t\t\telse\n\t\t\t\t$maskedEMail .= substr($email, $i,1);\n\t\t}\n\t\t$maskedEMail .= substr($email, $i-1,1);\n\t\treturn $maskedEMail;\n\t}", "function is_email_address_unsafe($user_email)\n {\n }", "private function resolve_email_address($email_address)\n\t{\n\t\tif (is_string($email_address)) return $email_address;\n\t\tif (is_array($email_address)) return $this->implode_email_addresses($email_address);\n\t\tif ($email_address instanceof Member) return $email_address->Email; //The Member class cannot be modified to implement the EmailAddressProvider interface, so exceptionally handle it here.\n\t\tif (!$email_address instanceof EmailAddressProvider)\n\t\t{\n\t\t\tthrow new InvalidArgumentException(__METHOD__ . ': Parameter $email_address must either be a string or an instance of a class that implements the EmailAddressProvider interface.');\n\t\t}\n\t\treturn $this->implode_email_addresses($email_address->getEmailAddresses());\n\t}", "function obfuscate_email($email) {\n\t$out = \"\";\n\t$len = strlen($email);\n\n\tfor($i = 0; $i < $len; $i++)\n\t\t$out .= \"&#\" . ord($email[$i]) . \";\";\n\n\treturn $out;\n}", "private function clean_poea_email($email) {\n\n \t$emails = array();\n\n \t$email = str_replace('@y.c', \"@yahoo.com\", $email);\n\n\t\t$slash_email = explode(\"/\", $email);\n\t\t$or_email = explode(\" or \", $email);\n\t\t$and_email = explode(\"&\", $email);\n\n\t\tif(count($slash_email) > 1) {\n\t\t\t\n\t\t\tforeach ($slash_email as $v) {\n\n\t\t\t\t$v = trim($v);\n\n\t\t\t\tif(filter_var($v, FILTER_VALIDATE_EMAIL)) {\n\n\t\t\t\t\t$emails[] = $v;\t\t\t\n\t\t\t\t}\n\t\t\t}\n\n\t\t} elseif(count($and_email) > 1) {\n\n\t\t\tforeach ($and_email as $v) {\n\n\t\t\t\t$v = trim($v);\n\n\t\t\t\tif(filter_var($v, FILTER_VALIDATE_EMAIL)) {\n\n\t\t\t\t\t$emails[] = $v;\t\n\t\t\t\t}\n\t\t\t}\n\n\t\t} elseif(count($or_email) > 1) {\n\n\t\t\tforeach ($or_email as $v) {\n\n\t\t\t\t$v = trim($v);\n\n\t\t\t\tif(filter_var($v, FILTER_VALIDATE_EMAIL)) {\n\t\n\t\t\t\t\t$emails[] = $v;\t\t\t\n\t\t\t\t}\n\t\t\t}\n\n\t\t} elseif(filter_var($email, FILTER_VALIDATE_EMAIL)) {\n\n\t\t\t$emails[] = $email;\t\n\n\t\t}\n\n\t\tif(empty($emails)) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn json_encode($emails);\n }", "public function sanitizeEmail($data){\n $data = filter_var($data, FILTER_SANITIZE_EMAIL);\n return $data;\n }", "function parseEmailAddress( $address, $encoding = \"mime\" )\r\n {\r\n\r\n $matches = array();\r\n $pattern = '/<?\\\"?[a-zA-Z0-9!#\\$\\%\\&\\'\\*\\+\\-\\/=\\?\\^_`{\\|}~\\.]+\\\"?@[a-zA-Z0-9!#\\$\\%\\&\\'\\*\\+\\-\\/=\\?\\^_`{\\|}~\\.]+>?$/';\r\n if ( preg_match( trim( $pattern ), $address, $matches, PREG_OFFSET_CAPTURE ) != 1 )\r\n {\r\n return null;\r\n }\r\n $name = substr( $address, 0, $matches[0][1] );\r\n\r\n // trim <> from the address and \"\" from the name\r\n $name = trim( $name, '\" ' );\r\n $mail = trim( $matches[0][0], '<>' );\r\n // remove any quotes found in mail addresses like \"bah,\"@example.com\r\n $mail = str_replace( '\"', '', $mail );\r\n\r\n if ( $encoding == 'mime' )\r\n {\r\n // the name may contain interesting character encoding. We need to convert it.\r\n $name = ezcMailTools::mimeDecode( $name );\r\n }\r\n else\r\n {\r\n $name = ezcMailCharsetConverter::convertToUTF8( $name, $encoding );\r\n }\r\n\r\n $address = new ezcMailAddress( $mail, $name, 'utf-8' );\r\n return $address;\r\n }", "function emc_obfuscate_mailto_url( $email ) {\r\n\r\n\tif ( ! is_email( $email ) ) return false;\r\n\r\n\t$email = 'mailto:' . antispambot( $email );\r\n\r\n\treturn esc_url( $email );\r\n\r\n}", "protected function cleanEmail($email) {\n\t\tif(is_array($email)) {\n\t\t\t$cleanEmails = array();\n\t\t\tforeach($email as $em) {\n\t\t\t\t$cleanEmails[] = (preg_match('/\\<(.*?)\\>/', $em, $match)) ? $match[1] : $em;\n\t\t\t}\n\t\t\treturn $cleanEmails;\n\t\t}\n\t\telse {\n\t\t\t$cleanEmail = (preg_match('/\\<(.*?)\\>/', $email, $match)) ? $match[1] : $email;\n\t\t\treturn $cleanEmail;\n\t\t}\n\t}", "function filterEmail($email, $chars = ''){\r\n $email = trim(str_replace( array(\"\\r\",\"\\n\"), '', $email ));\r\n if( is_array($chars) ) $email = str_replace( $chars, '', $email );\r\n $email = preg_replace( '/(cc\\s*\\:|bcc\\s*\\:)/i', '', $email );\r\n return $email;\r\n}", "public function resetOriginalEmail() : void;", "public static function maskEmail($email){\n $em = explode(\"@\",$email);\n $name = $em[0];\n $len = floor(strlen($name)/2);\n\n $len_=strlen($name)%2 +$len;\n\n return substr($name,0, $len) . str_repeat('*', $len_) . \"@\" . end($em); \n }", "public function emailToPunycode($email = '')\n\t{\n\t\t// do nothing by default\n\t\treturn $email;\n\t}", "function sanitizeEmail() {\n $pattern = \"/^[A-Z0-9._%+\\-]+@[A-Z0-9.\\-]+\\.[A-Z]{2,}$/i\";\n if (preg_match($pattern, $this->email)) {\n $this->email = filter_var($this->email, FILTER_SANITIZE_EMAIL);\n } else {\n die(\"Error. Check your form data\");\n }\n }", "function cleanInput ($input) { // meie e-mail jõuab siia ning salvestatakse inputi sisse\n\n //input = sisestatud e-mail\n\n $input = trim ($input);\n $input = stripslashes ($input); //võtab kaldkriipsud ära\n $input = htmlspecialchars ($input); //\n return $input;\n}", "private function filtrarEmail($original_email)\n{\n $clean_email = filter_var($original_email,FILTER_SANITIZE_EMAIL);\n if ($original_email == $clean_email && filter_var($original_email,FILTER_VALIDATE_EMAIL))\n {\n return $original_email;\n }\n\n}", "public function decomposeCompleteEmail($email) {\n $return = array('name' => '', 'email' => '');\n $email = urldecode(str_replace('+', '%2B', $email));\n if (is_string($email) && mb_strpos($email, '@') !== false) {\n $return['email'] = trim(str_replace(array('<', '>'), '', mb_substr($email, mb_strrpos($email, '<'))));\n $decomposedName = trim(str_replace(array('\"', '+'), array('', ' '), mb_substr($email, 0, mb_strrpos($email, '<'))));\n\n if (mb_strpos($decomposedName, '=?') === 0) {\n $decodedHeader = $this->mimeHeaderDecode($decomposedName);\n if (!empty($decodedHeader[0]->text)) {\n $entireName = '';\n foreach ($decodedHeader as $namePart) {\n $entireName .= trim($this->_convertCharset($namePart->charset, $this->charset, $namePart->text)).' ';\n }\n $decomposedName = trim($entireName);\n }\n }\n\n $return['name'] = $decomposedName;\n }\n\n return $return;\n }", "function sanitize_email( $email ) {\n\t// Test for the minimum length the email can be\n\tif ( strlen( $email ) < 3 ) {\n\t\t/**\n\t\t * Filter a sanitized email address.\n\t\t *\n\t\t * This filter is evaluated under several contexts, including 'email_too_short',\n\t\t * 'email_no_at', 'local_invalid_chars', 'domain_period_sequence', 'domain_period_limits',\n\t\t * 'domain_no_periods', 'domain_no_valid_subs', or no context.\n\t\t *\n\t\t * @since 2.8.0\n\t\t *\n\t\t * @param string $email The sanitized email address.\n\t\t * @param string $email The email address, as provided to sanitize_email().\n\t\t * @param string $message A message to pass to the user.\n\t\t */\n\t\treturn apply_filters( 'sanitize_email', '', $email, 'email_too_short' );\n\t}\n\n\t// Test for an @ character after the first position\n\tif ( strpos( $email, '@', 1 ) === false ) {\n\t\t/** This filter is documented in wp-includes/formatting.php */\n\t\treturn apply_filters( 'sanitize_email', '', $email, 'email_no_at' );\n\t}\n\n\t// Split out the local and domain parts\n\tlist( $local, $domain ) = explode( '@', $email, 2 );\n\n\t// LOCAL PART\n\t// Test for invalid characters\n\t$local = preg_replace( '/[^a-zA-Z0-9!#$%&\\'*+\\/=?^_`{|}~\\.-]/', '', $local );\n\tif ( '' === $local ) {\n\t\t/** This filter is documented in wp-includes/formatting.php */\n\t\treturn apply_filters( 'sanitize_email', '', $email, 'local_invalid_chars' );\n\t}\n\n\t// DOMAIN PART\n\t// Test for sequences of periods\n\t$domain = preg_replace( '/\\.{2,}/', '', $domain );\n\tif ( '' === $domain ) {\n\t\t/** This filter is documented in wp-includes/formatting.php */\n\t\treturn apply_filters( 'sanitize_email', '', $email, 'domain_period_sequence' );\n\t}\n\n\t// Test for leading and trailing periods and whitespace\n\t$domain = trim( $domain, \" \\t\\n\\r\\0\\x0B.\" );\n\tif ( '' === $domain ) {\n\t\t/** This filter is documented in wp-includes/formatting.php */\n\t\treturn apply_filters( 'sanitize_email', '', $email, 'domain_period_limits' );\n\t}\n\n\t// Split the domain into subs\n\t$subs = explode( '.', $domain );\n\n\t// Assume the domain will have at least two subs\n\tif ( 2 > count( $subs ) ) {\n\t\t/** This filter is documented in wp-includes/formatting.php */\n\t\treturn apply_filters( 'sanitize_email', '', $email, 'domain_no_periods' );\n\t}\n\n\t// Create an array that will contain valid subs\n\t$new_subs = array();\n\n\t// Loop through each sub\n\tforeach ( $subs as $sub ) {\n\t\t// Test for leading and trailing hyphens\n\t\t$sub = trim( $sub, \" \\t\\n\\r\\0\\x0B-\" );\n\n\t\t// Test for invalid characters\n\t\t$sub = preg_replace( '/[^a-z0-9-]+/i', '', $sub );\n\n\t\t// If there's anything left, add it to the valid subs\n\t\tif ( '' !== $sub ) {\n\t\t\t$new_subs[] = $sub;\n\t\t}\n\t}\n\n\t// If there aren't 2 or more valid subs\n\tif ( 2 > count( $new_subs ) ) {\n\t\t/** This filter is documented in wp-includes/formatting.php */\n\t\treturn apply_filters( 'sanitize_email', '', $email, 'domain_no_valid_subs' );\n\t}\n\n\t// Join valid subs into the new domain\n\t$domain = join( '.', $new_subs );\n\n\t// Put the email back together\n\t$email = $local . '@' . $domain;\n\n\t// Congratulations your email made it!\n\t/** This filter is documented in wp-includes/formatting.php */\n\treturn apply_filters( 'sanitize_email', $email, $email, null );\n}", "static function unwrap_email($html_email) {\n\n if (self::_has_markers($html_email)) {\n $html_email = self::unwrap_html_element($html_email);\n } else {\n //KEEP FOR OLD EMAIL COMPATIBILITY\n // Extracts only the body part\n $x = strpos($html_email, '<body');\n if ($x) {\n $x = strpos($html_email, '>', $x);\n $y = strpos($html_email, '</body>');\n $html_email = substr($html_email, $x + 1, $y - $x - 1);\n }\n\n /* Cleans up uncorrectly stored newsletter bodies */\n $html_email = preg_replace('/<style\\s+.*?>.*?<\\\\/style>/is', '', $html_email);\n $html_email = preg_replace('/<meta.*?>/', '', $html_email);\n $html_email = preg_replace('/<title\\s+.*?>.*?<\\\\/title>/i', '', $html_email);\n $html_email = trim($html_email);\n }\n\n // Required since esc_html DOES NOT escape the HTML entities (apparently)\n $html_email = str_replace('&', '&amp;', $html_email);\n $html_email = str_replace('\"', '&quot;', $html_email);\n $html_email = str_replace('<', '&lt;', $html_email);\n $html_email = str_replace('>', '&gt;', $html_email);\n\n return $html_email;\n }", "function UnigueEmail($check)\r\n {\r\n //μέσω αυτής της συνάρτησης ελέγχεται εάν χρησιμοποιείται ήδη το email\r\n //που έδωσε ο χρήστης και τον ενημερώνει αντίστοιχα μέσω του error που \r\n //υπάρχει για το συγκεκριμένο πεδίο στο αντίστοιχο view(register.ctp)\r\n\r\n //έλεγχος για το αν ήδη υπάρχει το email που επιλέγει ο χρήστης γίνεται\r\n //σε 2 περιπτώσεις:\r\n //α)Κατά την εγγραφή του χρήστη\r\n //β)Κατά την επεξεργασία προφίλ του χρήστη σε περίπτωση που επεξεργαστεί\r\n // το email του.\r\n $email = array_shift($check);\r\n\r\n if(!$this->getLoggedIn() || (strcmp($this->editEmail, 'yes')==0))\r\n {\r\n $conditions = array(\r\n// 'User.email'=>$this->data['User']['email']\r\n 'User.email'=>$email\r\n );\r\n if(!$this->id)\r\n {\r\n if($this->find('count', array('conditions'=>$conditions))>0) \r\n {\r\n// $this->invalidate('email_unique');\r\n return false; \r\n }\r\n }\r\n return true;\r\n }\r\n else\r\n return true;\r\n }", "static function cleanaddress($address) {\n\t\t$address = trim($address,',');\n\t\t// remove suite suffix\n\t\t$address = preg_replace('/((Ste|Suite|PO|POBOX|PO Box|ll|office|room|floor)([ \\-\\.\\:]+)([0-9]+))/ie','',$address);\n\t\t// remove any prefix, before the numbers (like the mall name\n\t\t$address = preg_replace('/^([a-z ]+)([0-9]+)/i','${2}',$address);\n\t\t// clean whitespace\n\t\t$address = preg_replace('/\\t/', ' ',$address);\n\t\t$address = str_replace(\"\\n\",' ',$address);\n\t\t$address = preg_replace('/\\s\\s+/', ' ',$address);\n\t\t// clean double-commas\n\t\t$address = str_replace(',,', ', ',$address);\n\t\t$address = str_replace(', ,', ', ',$address);\n\t\t// clean whitespace (again)\n\t\t$address = preg_replace('/\\s\\s+/', ' ',$address);\n\t\treturn trim($address);\n\t}", "private function cleanEmail($email)\n { \n foreach($email as $email)\n $return[] = trim(strtolower($email));\n \n return $return;\n }", "function sanitize_email(string $text = '')\n{\n return filter_var(strtolower(trim($text)), FILTER_SANITIZE_EMAIL);\n}", "public function testEmail() {\n $this->assertEquals('[email protected]', Sanitize::email('em<a>[email protected]'));\n $this->assertEquals('[email protected]', Sanitize::email('email+t(a)[email protected]'));\n $this->assertEquals('[email protected]', Sanitize::email('em\"ail+t(a)[email protected]'));\n }", "public function maskMail($email, $reverse = false)\n\t{\n\t\tif ($reverse)\n\t\t{\n\t\t\t// reverse the e-mail address\n\t\t\t$email = strrev($email);\n\t\t}\n\n\t\t// converts the e-mail address from bin to hex\n\t\t$email = bin2hex($email);\n\t\t// append ;&#x sequence after every chunk of the masked e-mail\n\t\t$email = chunk_split($email, 2, \";&#x\");\n\t\t// prepend &#x sequence before the address and trim the ending sequence\n\t\t$email = \"&#x\" . substr($email, 0, -3);\n\n\t\treturn $email;\n\t}", "function checkEmail($data) {\n $data = trim($data);\n $data = stripslashes($data);\n $data = htmlspecialchars($data);\n return $data;\n}", "public function filterEmail($email)\n {\n $rule = array(\n \"\\r\" => '',\n \"\\n\" => '',\n \"\\t\" => '',\n '\"' => '',\n ',' => '',\n '<' => '',\n '>' => ''\n );\n $email = strtr($email, $rule);\n $email = filter_var($email, FILTER_SANITIZE_EMAIL);\n return $email;\n }", "function string_strip_hrefs( $p_string ) \r\n{\r\n\t# First grab mailto: hrefs. We don't care whether the URL is actually\r\n\t# correct - just that it's inside an href attribute.\r\n\t$p_string = preg_replace( '/<a\\s[^\\>]*href=\"mailto:([^\\\"]+)\"[^\\>]*>[^\\<]*<\\/a>/si',\r\n\t\t\t\t\t\t\t\t'\\1', $p_string);\r\n\r\n\t# Then grab any other href\r\n\t$p_string = preg_replace( '/<a\\s[^\\>]*href=\"([^\\\"]+)\"[^\\>]*>[^\\<]*<\\/a>/si',\r\n\t\t\t\t\t\t\t\t'\\1', $p_string);\r\n\treturn $p_string;\r\n}", "public function getEmailAddress();", "function sanitize_email($value)\n{\n return filter_var($value, FILTER_SANITIZE_EMAIL);\n}", "public function getOriginalEmail(): ?string;", "protected static function filter_sanitize_email($value)\n\t{\n\t\treturn filter_var($value, FILTER_SANITIZE_EMAIL); \n\t}", "function email_fullname($user, $override=false) {\n\n\t// Drop all semicolon apears. (Js errors when select contacts)\n\treturn str_replace(',', '', fullname($user, $override));\n}", "function CheckEmailAddress($addr,&$valid)\n{\n global $TARGET_EMAIL;\n\n $valid = \"\";\n $list = explode(\",\",$addr);\n for ($ii = 0 ; $ii < count($list) ; $ii++)\n {\n\t\t$email = UnMangle($list[$ii]);\n for ($jj = 0 ; $jj < count($TARGET_EMAIL) ; $jj++)\n if (eregi($TARGET_EMAIL[$jj],$email))\n {\n if (empty($valid))\n \t$valid = $email;\n else\n $valid .= \",\".$email;\n }\n }\n return (!empty($valid));\n}", "function antispambot($email_address, $hex_encoding = 0)\n {\n }", "function changeemail($member,$oldemail,$newemail) {\n\t\n}", "protected function mungeMessage(&$msg) {\n list($msg['first_name'], $msg['last_name']) = wmf_civicrm_janky_split_name( $msg['full_name'] );\n $msg['currency'] = strtoupper($msg['currency']);\n $msg['original_currency'] = strtoupper($msg['original_currency']);\n parent::mungeMessage($msg);\n }", "public function filterEmail($email) {\n \n $email = filter_var($email, FILTER_SANITIZE_EMAIL);\n \n if (filter_var($email, FILTER_VALIDATE_EMAIL)) {\n return \"$email\"; \n } else {\n die(\"$email is Invalid email\");\n }\n\n }", "public function email($email) {\n\t\n\t\n\t\n\t\treturn $email;\n\t\n\t}", "public function testComposeEmailAddress()\n {\n $address = new ezcMailAddress( '[email protected]', 'John Doe' );\n $this->assertEquals( 'John Doe <[email protected]>', ezcMailTools::composeEmailAddress( $address ) );\n\n $address = new ezcMailAddress( '[email protected]' );\n $this->assertEquals( '[email protected]', ezcMailTools::composeEmailAddress( $address ) );\n }", "function check_email($data){\n if(isset($data)){\n $sanitized = filter_var($data, FILTER_SANITIZE_EMAIL);\n if (filter_var($sanitized, FILTER_VALIDATE_EMAIL)){\n $data = $sanitized;\n $data = trim($data);\n $data = stripslashes($data);\n $data = htmlspecialchars($data);\n $data = strip_tags($data);\n $data = htmlentities($data);\n return $data;\n } \n }\n}", "public function email()\n\t{\n\t\treturn $this->filter(FILTER_SANITIZE_EMAIL);\n\t}", "protected function getTargetEmailAddress() {\n\t\tif (isset($this->settings['emailAddress']) && GeneralUtility::validEmail(trim($this->settings['emailAddress']))) {\n\t\t\treturn trim($this->settings['emailAddress']);\n\t\t}\n\t\treturn '';\n\t}", "public function test_sanitized_email() {\n\t\t$actual = wp_create_user_request( 'some(email<withinvalid\\[email protected]', 'export_personal_data' );\n\n\t\t$this->assertNotWPError( $actual );\n\n\t\t$post = get_post( $actual );\n\n\t\t$this->assertSame( 'export_personal_data', $post->post_name );\n\t\t$this->assertSame( '[email protected]', $post->post_title );\n\t}", "function get_profile_email($email){\r\n\t\r\n}", "public static function email($email)\n {\n $pattern = '/^(?!(?:(?:\\x22?\\x5C[\\x00-\\x7E]\\x22?)|(?:\\x22?[^\\x5C\\x22]\\x22?)){255,})(?!(?:(?:\\x22?\\x5C[\\x00-\\x7E]\\x22?)|(?:\\x22?[^\\x5C\\x22]\\x22?)){65,}@)(?:(?:[\\x21\\x23-\\x27\\x2A\\x2B\\x2D\\x2F-\\x39\\x3D\\x3F\\x5E-\\x7E]+)|(?:\\x22(?:[\\x01-\\x08\\x0B\\x0C\\x0E-\\x1F\\x21\\x23-\\x5B\\x5D-\\x7F]|(?:\\x5C[\\x00-\\x7F]))*\\x22))(?:\\.(?:(?:[\\x21\\x23-\\x27\\x2A\\x2B\\x2D\\x2F-\\x39\\x3D\\x3F\\x5E-\\x7E]+)|(?:\\x22(?:[\\x01-\\x08\\x0B\\x0C\\x0E-\\x1F\\x21\\x23-\\x5B\\x5D-\\x7F]|(?:\\x5C[\\x00-\\x7F]))*\\x22)))*@(?:(?:(?!.*[^.]{64,})(?:(?:(?:xn--)?[a-z0-9]+(?:-[a-z0-9]+)*\\.){1,126}){1,}(?:(?:[a-z][a-z0-9]*)|(?:(?:xn--)[a-z0-9]+))(?:-[a-z0-9]+)*)|(?:\\[(?:(?:IPv6:(?:(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){7})|(?:(?!(?:.*[a-f0-9][:\\]]){7,})(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){0,5})?::(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){0,5})?)))|(?:(?:IPv6:(?:(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){5}:)|(?:(?!(?:.*[a-f0-9]:){5,})(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){0,3})?::(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){0,3}:)?)))?(?:(?:25[0-5])|(?:2[0-4][0-9])|(?:1[0-9]{2})|(?:[1-9]?[0-9]))(?:\\.(?:(?:25[0-5])|(?:2[0-4][0-9])|(?:1[0-9]{2})|(?:[1-9]?[0-9]))){3}))\\]))$/iD';\n if ((mb_strlen($email) > 254) || !preg_match($pattern, $email)) {\n return false;\n }\n return true;\n }", "function fixAddress($str = \"\") {\n\tif ( preg_match(\"/[A-Z]{3}/\", $str) ) {\n\t\t$str = strtolower($str);\n\t}\n\t$str = ucwords($str);\n\t$str = str_replace(\"'\", \"''\", $str);\n\treturn($str);\n//fixAddress\n}", "function parse_email($input) {\n\n // TODO TEST\n\n $input = trim($input);\n if (!$input) return false;\n\n if (preg_match('/^\\s*(([A-Z0-9._%+-]+)@([A-Z0-9.-]+\\.[A-Z]{2,4}))\\s*$/i', $input, $m)) {\n return array(\n 'email' => $m[1],\n 'user' => $m[2],\n 'domain' => $m[3]\n );\n } else {\n return false;\n }\n\n }", "private function convertIdn($email)\n {\n list($local, $domain) = explode('@', $email);\n $domain = idn_to_ascii($domain, 0, INTL_IDNA_VARIANT_UTS46);\n\n return sprintf('%s@%s', $local, $domain);\n }", "public function TestEmail($data) {\r\n $data = trim($data);\r\n $data = filter_var($data, FILTER_SANITIZE_EMAIL);\r\n $data = filter_var($data,FILTER_VALIDATE_EMAIL);\r\n return $data;\r\n }", "protected function parseAddress($email) {\n if (preg_match(self::SENDGRID_INTEGRATION_EMAIL_REGEX, $email, $matches)) {\n return [$matches[2], $matches[1]];\n }\n else {\n return [$email, ' '];\n }\n }", "public function exchange_primary_address($username, $emailaddress, $isGUID=false) {\n if ($username===NULL){ return (\"Missing compulsory field [username]\"); } \n if ($emailaddress===NULL) { return (\"Missing compulsory fields [emailaddress]\"); }\n \n // Find the dn of the user\n $user=$this->user_info($username,array(\"cn\",\"proxyaddresses\"), $isGUID);\n if ($user[0][\"dn\"]===NULL){ return (false); }\n $user_dn=$user[0][\"dn\"];\n \n if (is_array($user[0][\"proxyaddresses\"])) {\n $modaddresses = array();\n for ($i=0;$i<sizeof($user[0]['proxyaddresses']);$i++) {\n if (strstr($user[0]['proxyaddresses'][$i], 'SMTP:') !== false) {\n $user[0]['proxyaddresses'][$i] = str_replace('SMTP:', 'smtp:', $user[0]['proxyaddresses'][$i]);\n }\n if ($user[0]['proxyaddresses'][$i] == 'smtp:' . $emailaddress) {\n $user[0]['proxyaddresses'][$i] = str_replace('smtp:', 'SMTP:', $user[0]['proxyaddresses'][$i]);\n }\n if ($user[0]['proxyaddresses'][$i] != '') {\n $modaddresses['proxyAddresses'][$i] = $user[0]['proxyaddresses'][$i];\n }\n }\n \n $result=@ldap_mod_replace($this->_conn,$user_dn,$modaddresses);\n if ($result==false){ return (false); }\n \n return (true);\n }\n \n }", "function clean_string($string)\n{\n $bad = array(\"content-type\", \"bcc:\", \"to:\", \"cc:\", \"href\");\n return str_replace($bad, \"\", $string);\n}", "public function feide_email() {\n\t\t\t$this->feide_email = mb_strtolower($this->attributes['mail'][0]);\n\n\t\t\treturn $this->feide_email;\n\t\t}", "public static function obfuscateEmails($html)\n\t{\n\t\treturn preg_replace_callback('#(mailto:)?[a-z0-9_.+-]+@[a-z0-9-]+\\.[a-z0-9-.]+#i', function ($match) {\n\t\t\treturn \\HTML::email($match[0]);\n\t\t}, $html);\n\t}", "function addr($email)\n {\n\n if(preg_match('/([^<>]+)\\s*<(.*)>/',$email,$matches) &&\n count($matches) == 3)\n {\n return array($matches[2],$matches[1]);\n }\n\n return array($email,'');\n }", "function vEmail( $email )\r\n\t\t{\r\n\t\t return filter_var( $email, FILTER_VALIDATE_EMAIL );\r\n\t\t \r\n\t\t}", "function string_email_links( $p_string ) {\r\n\t$p_string = string_email( $p_string );\r\n return $p_string;\r\n}", "public function traerPorMail($email) {\n\n}", "function removeemail($member){\n\t\t$f3=$this->f3; \n\t\t$uselog=$f3->get('uselog');\n\t\t$email_logger=$f3->new('email_log');\n\t\t$email_logger->write('in removeemail for member = '.$member->forename. ' '.$member->surname.'email was '.$member->email ,$uselog);\n\t\t\n\t\t// now check if its in use elsewhere other than this membnum\n\t\t$this->mailmanunsub($member);\n}", "function cleanStreet($data) { \n // remove things such as '(rear)' at the end of an address\n $street = preg_replace('/\\(.*?\\)$/', '', $data['street']);\n\n //remove 'Access Via' that appears at the begginning of some addresses\n return preg_replace('/^access\\s+via\\s+/i', '', $street);\n}", "protected function parse_email($email)\n\t{\n\t\tif(is_string($email) AND ($email = trim($email)) AND mb_strlen($email) < 61)\n\t\t{\n\t\t\t$email = mb_strtolower($email);\n\t\t\t\n\t\t\tif(preg_match('/^[a-z0-9._+\\-#|]+@[a-z0-9.-]+\\.[a-z]{2,4}$/', $email))\n\t\t\t{\n\t\t\t\treturn $email;\n\t\t\t}\n\t\t}\n\t}", "function cfdef_prepare_email_value_for_email( $p_value ) {\n\treturn 'mailto:' . $p_value;\n}", "function formatEmailAddressField(Email $message, string $field): ?string\n {\n $headers = $message->getHeaders();\n\n return $headers->get($field)?->getBodyAsString();\n\t}", "public function encodeMail($address)\n {\n if ($this->_getRenderer() instanceof Kwf_Component_Renderer_Mail) {\n return $text;\n }\n $address = trim($address);\n $address = preg_replace('/^(.+)@(.+)\\.([^\\.\\s]+)$/i',\n '$1'.$this->_atEncoding.'$2'.$this->_dotEncoding.'$3',\n $address\n );\n return $address;\n }", "function _osc_from_email_aux() {\n $tmp = osc_mailserver_mail_from();\n return !empty($tmp)?$tmp:osc_contact_email();\n }", "function serializeNonPrimaryEmails(array $emails)\n{\n $email_strings = array();\n foreach ($emails as $attrs) {\n $email_strings[] = implode(',', $attrs);\n }\n return implode(';', $email_strings);\n}", "public static function composeEmailAddress( ezcMailAddress $item )\r\n {\r\n $name = trim( $item->name );\r\n if ( $name !== '' )\r\n {\r\n // remove the quotes around the name part if they are already there\r\n if ( $name{0} === '\"' && $name{strlen( $name ) - 1} === '\"' )\r\n {\r\n $name = substr( $name, 1, -1 );\r\n }\r\n\r\n // add slashes to \" and \\ and surround the name part with quotes\r\n if ( strpbrk( $name, \",@<>:;'\\\"\" ) !== false )\r\n {\r\n $name = str_replace( '\\\\', '\\\\\\\\', $name );\r\n $name = str_replace( '\"', '\\\"', $name );\r\n $name = \"\\\"{$name}\\\"\";\r\n }\r\n\r\n switch ( strtolower( $item->charset ) )\r\n {\r\n case 'us-ascii':\r\n $text = $name . ' <' . $item->email . '>';\r\n break;\r\n\r\n case 'iso-8859-1': case 'iso-8859-2': case 'iso-8859-3': case 'iso-8859-4':\r\n case 'iso-8859-5': case 'iso-8859-6': case 'iso-8859-7': case 'iso-8859-8':\r\n case 'iso-8859-9': case 'iso-8859-10': case 'iso-8859-11': case 'iso-8859-12':\r\n case 'iso-8859-13': case 'iso-8859-14': case 'iso-8859-15' :case 'iso-8859-16':\r\n case 'windows-1250': case 'windows-1251': case 'windows-1252':\r\n case 'utf-8':\r\n if ( strpbrk( $name, \"\\x80\\x81\\x82\\x83\\x84\\x85\\x86\\x87\\x88\\x89\\x8a\\x8b\\x8c\\x8d\\x8e\\x8f\\x90\\x91\\x92\\x93\\x94\\x95\\x96\\x97\\x98\\x99\\x9a\\x9b\\x9c\\x9d\\x9e\\x9f\\xa0\\xa1\\xa2\\xa3\\xa4\\xa5\\xa6\\xa7\\xa8\\xa9\\xaa\\xab\\xac\\xad\\xae\\xaf\\xb0\\xb1\\xb2\\xb3\\xb4\\xb5\\xb6\\xb7\\xb8\\xb9\\xba\\xbb\\xbc\\xbd\\xbe\\xbf\\xc0\\xc1\\xc2\\xc3\\xc4\\xc5\\xc6\\xc7\\xc8\\xc9\\xca\\xcb\\xcc\\xcd\\xce\\xcf\\xd0\\xd1\\xd2\\xd3\\xd4\\xd5\\xd6\\xd7\\xd8\\xd9\\xda\\xdb\\xdc\\xdd\\xde\\xdf\\xe0\\xe1\\xe2\\xe3\\xe4\\xe5\\xe6\\xe7\\xe8\\xe9\\xea\\xeb\\xec\\xed\\xee\\xef\\xf0\\xf1\\xf2\\xf3\\xf4\\xf5\\xf6\\xf7\\xf8\\xf9\\xfa\\xfb\\xfc\\xfd\\xfe\\xff\" ) === false )\r\n {\r\n $text = $name . ' <' . $item->email . '>';\r\n break;\r\n }\r\n // break intentionally missing\r\n\r\n default:\r\n $preferences = array(\r\n 'input-charset' => $item->charset,\r\n 'output-charset' => $item->charset,\r\n 'scheme' => 'Q',\r\n 'line-break-chars' => ezcMailTools::lineBreak()\r\n );\r\n $name = iconv_mime_encode( 'dummy', $name, $preferences );\r\n $name = substr( $name, 7 ); // \"dummy: \" + 1\r\n $text = $name . ' <' . $item->email . '>';\r\n break;\r\n }\r\n }\r\n else\r\n {\r\n $text = $item->email;\r\n }\r\n return $text;\r\n }\r\n\r\n /**\r\n * Returns the array $items consisting of ezcMailAddress objects\r\n * as one RFC822 compliant address string.\r\n *\r\n * Set foldLength to control how many characters each line can have before a line\r\n * break is inserted according to the folding rules specified in RFC2822.\r\n *\r\n * @param array(ezcMailAddress) $items\r\n * @param int $foldLength\r\n * @return string\r\n */\r\n public static function composeEmailAddresses( array $items, $foldLength = null )\r\n {\r\n $textElements = array();\r\n foreach ( $items as $item )\r\n {\r\n $textElements[] = ezcMailTools::composeEmailAddress( $item );\r\n }\r\n\r\n if ( $foldLength === null ) // quick version\r\n {\r\n return implode( ', ', $textElements );\r\n }\r\n\r\n $result = \"\";\r\n $charsSinceFold = 0;\r\n foreach ( $textElements as $element )\r\n {\r\n $length = strlen( $element );\r\n if ( ( $charsSinceFold + $length + 2 /* comma, space */ ) > $foldLength )\r\n {\r\n // fold last line if there is any\r\n if ( $result != '' )\r\n {\r\n $result .= \",\" . ezcMailTools::lineBreak() .' ';\r\n $charsSinceFold = 0;\r\n }\r\n $result .= $element;\r\n }\r\n else\r\n {\r\n if ( $result == '' )\r\n {\r\n $result = $element;\r\n }\r\n else\r\n {\r\n $result .= ', ' . $element;\r\n }\r\n }\r\n $charsSinceFold += $length + 1 /*space*/;\r\n }\r\n return $result;\r\n }\r\n\r\n /**\r\n * Returns an ezcMailAddress object parsed from the address string $address.\r\n *\r\n * You can set the encoding of the name part with the $encoding parameter.\r\n * If $encoding is omitted or set to \"mime\" parseEmailAddress will asume that\r\n * the name part is mime encoded.\r\n *\r\n * This method does not perform validation. It will also accept slightly\r\n * malformed addresses.\r\n *\r\n * If the mail address given can not be decoded null is returned.\r\n *\r\n * Example:\r\n * <code>\r\n * ezcMailTools::parseEmailAddress( 'John Doe <[email protected]>' );\r\n * </code>\r\n *\r\n * @param string $address\r\n * @param string $encoding\r\n * @return ezcMailAddress\r\n */\r\n public static function parseEmailAddress( $address, $encoding = \"mime\" )\r\n {\r\n // we don't care about the \"group\" part of the address since this is not used anywhere\r\n\r\n $matches = array();\r\n $pattern = '/<?\\\"?[a-zA-Z0-9!#\\$\\%\\&\\'\\*\\+\\-\\/=\\?\\^_`{\\|}~\\.]+\\\"?@[a-zA-Z0-9!#\\$\\%\\&\\'\\*\\+\\-\\/=\\?\\^_`{\\|}~\\.]+>?$/';\r\n if ( preg_match( trim( $pattern ), $address, $matches, PREG_OFFSET_CAPTURE ) != 1 )\r\n {\r\n return null;\r\n }\r\n $name = substr( $address, 0, $matches[0][1] );\r\n\r\n // trim <> from the address and \"\" from the name\r\n $name = trim( $name, '\" ' );\r\n $mail = trim( $matches[0][0], '<>' );\r\n // remove any quotes found in mail addresses like \"bah,\"@example.com\r\n $mail = str_replace( '\"', '', $mail );\r\n\r\n if ( $encoding == 'mime' )\r\n {\r\n // the name may contain interesting character encoding. We need to convert it.\r\n $name = ezcMailTools::mimeDecode( $name );\r\n }\r\n else\r\n {\r\n $name = ezcMailCharsetConverter::convertToUTF8( $name, $encoding );\r\n }\r\n\r\n $address = new ezcMailAddress( $mail, $name, 'utf-8' );\r\n return $address;\r\n }\r\n\r\n /**\r\n * Returns an array of ezcMailAddress objects parsed from the address string $addresses.\r\n *\r\n * You can set the encoding of the name parts with the $encoding parameter.\r\n * If $encoding is omitted or set to \"mime\" parseEmailAddresses will asume that\r\n * the name parts are mime encoded.\r\n *\r\n * Example:\r\n * <code>\r\n * ezcMailTools::parseEmailAddresses( 'John Doe <[email protected]>' );\r\n * </code>\r\n *\r\n * @param string $addresses\r\n * @param string $encoding\r\n * @return array(ezcMailAddress)\r\n */\r\n public static function parseEmailAddresses( $addresses, $encoding = \"mime\" )\r\n {\r\n $addressesArray = array();\r\n $inQuote = false;\r\n $last = 0; // last hit\r\n $length = strlen( $addresses );\r\n for ( $i = 0; $i < $length; $i++ )\r\n {\r\n if ( $addresses[$i] == '\"' )\r\n {\r\n $inQuote = !$inQuote;\r\n }\r\n else if ( $addresses[$i] == ',' && !$inQuote )\r\n {\r\n $addressesArray[] = substr( $addresses, $last, $i - $last );\r\n $last = $i + 1; // eat comma\r\n }\r\n }\r\n\r\n // fetch the last one\r\n $addressesArray[] = substr( $addresses, $last );\r\n\r\n $addressObjects = array();\r\n foreach ( $addressesArray as $address )\r\n {\r\n $addressObject = self::parseEmailAddress( $address, $encoding );\r\n if ( $addressObject !== null )\r\n {\r\n $addressObjects[] = $addressObject;\r\n }\r\n }\r\n\r\n return $addressObjects;\r\n }\r\n\r\n /**\r\n * Returns an unique message ID to be used for a mail message.\r\n *\r\n * The hostname $hostname will be added to the unique ID as required by RFC822.\r\n * If an e-mail address is provided instead, the hostname is extracted and used.\r\n *\r\n * The formula to generate the message ID is: [time_and_date].[process_id].[counter]\r\n *\r\n * @param string $hostname\r\n * @return string\r\n */\r\n public static function generateMessageId( $hostname )\r\n {\r\n if ( strpos( $hostname, '@' ) !== false )\r\n {\r\n $hostname = strstr( $hostname, '@' );\r\n }\r\n else\r\n {\r\n $hostname = '@' . $hostname;\r\n }\r\n return date( 'YmdGHjs' ) . '.' . getmypid() . '.' . self::$idCounter++ . $hostname;\r\n }\r\n\r\n /**\r\n * Returns an unique ID to be used for Content-ID headers.\r\n *\r\n * The part $partName is default set to \"part\". Another value can be used to provide,\r\n * for example, a file name of a part. $partName will be encoded with base64 to be\r\n * compliant with the RFCs.\r\n *\r\n * The formula used is [base64( $partName )].\"@\".[time].[counter]\r\n *\r\n * @param string $partName\r\n * @return string\r\n */\r\n public static function generateContentId( $partName = \"part\" )\r\n {\r\n return str_replace( array( '=', '+', '/' ), '', base64_encode( $partName ) ) . '@' . date( 'His' ) . self::$idCounter++;\r\n }\r\n\r\n /**\r\n * Sets the endLine $character(s) to use when generating mail.\r\n * The default is to use \"\\r\\n\" as specified by RFC 2045.\r\n *\r\n * @param string $characters\r\n */\r\n public static function setLineBreak( $characters )\r\n {\r\n self::$lineBreak = $characters;\r\n }\r\n\r\n /**\r\n * Returns one endLine character.\r\n *\r\n * The default is to use \"\\n\\r\" as specified by RFC 2045.\r\n *\r\n * @return string\r\n */\r\n public static function lineBreak()\r\n {\r\n // Note, this function does deliberately not\r\n // have a $count parameter because of speed issues.\r\n return self::$lineBreak;\r\n }\r\n\r\n /**\r\n * Decodes mime encoded fields and tries to recover from errors.\r\n *\r\n * Decodes the $text encoded as a MIME string to the $charset. In case the\r\n * strict conversion fails this method tries to workaround the issues by\r\n * trying to \"fix\" the original $text before trying to convert it.\r\n *\r\n * @param string $text\r\n * @param string $charset\r\n * @return string\r\n */\r\n public static function mimeDecode( $text, $charset = 'utf-8' )\r\n {\r\n $origtext = $text;\r\n $text = @iconv_mime_decode( $text, 0, $charset );\r\n if ( $text !== false )\r\n {\r\n return $text;\r\n }\r\n\r\n // something went wrong while decoding, let's see if we can fix it\r\n // Try to fix lower case hex digits\r\n $text = preg_replace_callback(\r\n '/=(([a-f][a-f0-9])|([a-f0-9][a-f]))/',\r\n create_function( '$matches', 'return strtoupper($matches[0]);' ),\r\n $origtext\r\n );\r\n $text = @iconv_mime_decode( $text, 0, $charset );\r\n if ( $text !== false )\r\n {\r\n return $text;\r\n }\r\n\r\n // Workaround a bug in PHP 5.1.0-5.1.3 where the \"b\" and \"q\" methods\r\n // are not understood (but only \"B\" and \"Q\")\r\n $text = str_replace( array( '?b?', '?q?' ), array( '?B?', '?Q?' ), $origtext );\r\n $text = @iconv_mime_decode( $text, 0, $charset );\r\n if ( $text !== false )\r\n {\r\n return $text;\r\n }\r\n\r\n // Try it as latin 1 string\r\n $text = preg_replace( '/=\\?([^?]+)\\?/', '=?iso-8859-1?', $origtext );\r\n $text = iconv_mime_decode( $text, 0, $charset );\r\n\r\n return $text;\r\n }\r\n\r\n /**\r\n * Returns a new mail object that is a reply to the current object.\r\n *\r\n * The new mail will have the correct to, cc, bcc and reference headers set.\r\n * It will not have any body set.\r\n *\r\n * By default the reply will only be sent to the sender of the original mail.\r\n * If $type is set to REPLY_ALL, all the original recipients will be included\r\n * in the reply.\r\n *\r\n * Use $subjectPrefix to set the prefix to the subject of the mail. The default\r\n * is to prefix with 'Re: '.\r\n *\r\n * @param ezcMail $mail\r\n * @param ezcMailAddress $from\r\n * @param int $type REPLY_SENDER or REPLY_ALL\r\n * @param string $subjectPrefix\r\n * @param string $mailClass\r\n * @return ezcMail\r\n */\r\n static public function replyToMail( ezcMail $mail, ezcMailAddress $from,\r\n $type = self::REPLY_SENDER, $subjectPrefix = \"Re: \",\r\n $mailClass = \"ezcMail\" )\r\n {\r\n $reply = new $mailClass();\r\n $reply->from = $from;\r\n\r\n // To = Reply-To if set\r\n if ( $mail->getHeader( 'Reply-To' ) != '' )\r\n {\r\n $reply->to = ezcMailTools::parseEmailAddresses( $mail->getHeader( 'Reply-To' ) );\r\n }\r\n else // Else To = From\r\n\r\n {\r\n $reply->to = array( $mail->from );\r\n }\r\n\r\n if ( $type == self::REPLY_ALL )\r\n {\r\n // Cc = Cc + To - your own address\r\n $cc = array();\r\n foreach ( $mail->to as $address )\r\n {\r\n if ( $address->email != $from->email )\r\n {\r\n $cc[] = $address;\r\n }\r\n }\r\n foreach ( $mail->cc as $address )\r\n {\r\n if ( $address->email != $from->email )\r\n {\r\n $cc[] = $address;\r\n }\r\n }\r\n $reply->cc = $cc;\r\n }\r\n\r\n $reply->subject = $subjectPrefix . $mail->subject;\r\n\r\n if ( $mail->getHeader( 'Message-Id' ) )\r\n {\r\n // In-Reply-To = Message-Id\r\n $reply->setHeader( 'In-Reply-To', $mail->getHeader( 'Message-ID' ) );\r\n\r\n // References = References . Message-Id\r\n if ( $mail->getHeader( 'References' ) != '' )\r\n {\r\n $reply->setHeader( 'References', $mail->getHeader( 'References' )\r\n . ' ' . $mail->getHeader( 'Message-ID' ) );\r\n }\r\n else\r\n {\r\n $reply->setHeader( 'References', $mail->getHeader( 'Message-ID' ) );\r\n }\r\n }\r\n else // original mail is borked. Let's support it anyway.\r\n {\r\n $reply->setHeader( 'References', $mail->getHeader( 'References' ) );\r\n }\r\n\r\n return $reply;\r\n }\r\n\r\n /**\r\n * Guesses the content and mime type by using the file extension.\r\n *\r\n * The content and mime types are returned through the $contentType\r\n * and $mimeType arguments.\r\n * For the moment only for image files.\r\n *\r\n * @param string $fileName\r\n * @param string $contentType\r\n * @param string $mimeType\r\n */\r\n static public function guessContentType( $fileName, &$contentType, &$mimeType )\r\n {\r\n $extension = strtolower( pathinfo( $fileName, PATHINFO_EXTENSION ) );\r\n switch ( $extension )\r\n {\r\n case 'gif':\r\n $contentType = 'image';\r\n $mimeType = 'gif';\r\n break;\r\n\r\n case 'jpg':\r\n case 'jpe':\r\n case 'jpeg':\r\n $contentType = 'image';\r\n $mimeType = 'jpeg';\r\n break;\r\n\r\n case 'png':\r\n $contentType = 'image';\r\n $mimeType = 'png';\r\n break;\r\n\r\n case 'bmp':\r\n $contentType = 'image';\r\n $mimeType = 'bmp';\r\n break;\r\n\r\n case 'tif':\r\n case 'tiff':\r\n $contentType = 'image';\r\n $mimeType = 'tiff';\r\n break;\r\n\r\n default:\r\n return false;\r\n }\r\n return true;\r\n }\r\n}", "abstract public function to($email, $name = null);", "protected function composeEmailToUser()\n\t{\n\t\t$theURL = ( empty($this->myReentryURL) ?\n\t\t\t\t$this->composeReentryURL() : $this->myReentryURL ) ;\n\t\t$s = $this->model->getRes( 'account/email_body_pwd_reset_instr/'\n\t\t\t. $this->myEmailAddr . '/'\n\t\t\t. $this->getRandomCharsFromToken() )\n\t\t\t. '<a href=\"' . $theURL . '\">' . $theURL . '</a>'\n\t\t\t;\n\t\treturn $s ;\n\t}", "public function getEmail(): string;", "public function getEmail(): string;", "public function getEmail(): string;", "function mactoautousername($mac)\n{\n //\n // Turn it into a reversible username but isn't at first glace a mac\n // address?\n\n // Strip : and - from address, lowercase it, reverse it\n $autoUsername = strrev(strtolower(str_replace(array(\":\", \"-\"), \"\", $mac)));\n\n return $autoUsername;\n}", "function encode_email_address( $email ) {\n\n $output = '';\n\n for ($i = 0; $i < strlen($email); $i++) \n { \n $output .= '&#'.ord($email[$i]).';'; \n }\n\n return $output;\n}", "public function getEmailAddress() : string\n {\n return $this->emailAddress;\n }", "protected function getSenderEmailAddress() {}", "protected function getSenderEmailAddress() {}", "function wpcom_invite_force_matching_email_address() {\n _deprecated_function( __FUNCTION__, '2.0.0' );\n}", "protected function getEmailTo($email): string\n {\n return $this->getDecodedEmailProperty($email, $email->Content->Headers->To[0]);\n }", "public function restored(Email $email)\n {\n //\n }", "public function encode_email($email)\n\t{\n\t\treturn str_replace('@', '&#64;', $this->obfuscate($email));\n\t}", "function removeEmail($email) {\n\t\tglobal $polarbear_db;\n\t\t$emailSafe = $polarbear_db->escape($email);\n\t\t$sql = \"DELETE FROM \" . POLARBEAR_DB_PREFIX . \"_emaillist_emails WHERE listID = '{$this->id}' AND email = '$emailSafe'\";\n\t\t$polarbear_db->query($sql);\n\t}", "function validate_email() {\n # Check Value is an Email Address\n if ($this->check_email_address($this->cur_val)) {\n # Remove any existing error message\n $this->error_message = \"\";\n\n # Return Email\n return $this->cur_val;\n }\n else {\n # Set Error Message\n $this->set_error(\"Validation for email address ({$this->cur_val}) failed. This is type \" . gettype($this->cur_val));\n\n # Return Blank String\n return \"\";\n }\n }", "function is_valid_email($address) {\n $fields = preg_split(\"/@/\", $address, 2);\n if ((!preg_match(\"/^[0-9a-z]([-_.]?[0-9a-z])*$/i\", $fields[0])) || (!isset($fields[1]) || $fields[1] == '' || !is_valid_hostname_fqdn($fields[1], 0))) {\n return false;\n }\n return true;\n}", "function wpcodex_hide_email_shortcode( $atts , $content = null ) {\n\tif ( ! is_email( $content ) ) {\n\t\treturn;\n\t}\n\n\treturn '<a href=\"mailto:' . antispambot( $content ) . '\">' . antispambot( $content ) . '</a>';\n}", "function clean_string($string) {\n $bad = array(\"content-type\",\"bcc:\",\"to:\",\"cc:\",\"href\");\n return str_replace($bad,\"\",$string);\n }", "function convert_email($src_email_addr) {\n\n\t$final_emails_array=array();\n\t$src_email_addr=trim($src_email_addr,',');\t// Clean up email IDS\n\n\n\t$email_addr_arr=preg_split(\"/,/\",$src_email_addr);\n\t//echo \"<pre>convert_email(): ============================================ </pre>\";\n\t//echo \"<pre>convert_email(): SRC EMAIL [$src_email_addr]</pre>\";\n\t//echo \"<pre>convert_email(): SPLIT SRC EMAIL\".print_r($email_addr_arr,true).\"</pre>\";\n\n\tforeach ($email_addr_arr as $email_addr) {\n\t\t//echo \"<pre> convert_email(): EACH EMAIL=[$email_addr]</pre>\";\n\t\t// Split it by '<' to seperate the email id from the name\n\t\t$email_addr=preg_split(\"/</\",$email_addr);\n\t\tswitch (count($email_addr)) {\n\t\t\tcase 1:\t// Only email ID is present\n\t\t\t\t\t$email_id=trim(str_replace(\">\",\"\",$email_addr[0]));\n\t\t\t\t\t$name=$email_id;\n\t\t\t\t\tbreak;\n\t\t\tcase 2:\t// Both name & email ID is present\n\t\t\t\t\t$name=trim($email_addr[0]);\n\t\t\t\t\t$email_id=trim(str_replace(\">\",\"\",$email_addr[1]));\n\t\t\t\t\tbreak;\n\t\t}\n\t\t$final_emails_array[$email_id]=$name;\n\t\t//echo \"<pre> convert_email(): FINAL EMAILS ARRAY=[\".print_r($final_emails_array,true).\"]</pre>\";\n\t}\n\n\t//$a=array(\"asdsad\",\"adsdsa\"=>\"asdsad\",\"bbbb\");\n\t//echo \"<pre>convert_email(): EXPECTED FORMAT=[\".print_r($a,true).\"]</pre>\";\n\n\t//echo \"<pre>convert_email(): RETURNING FINAL EMAILS ARRAY=[\".print_r($final_emails_array,true).\"]</pre>\";\n\treturn $final_emails_array;\n}", "function email_validation($toemail) \n\t{ \n\t\t$param_array = func_get_args();\n\t\t\n\t\t$GLOBALS['logger_obj']->debug('<br>METHOD email::email_validation() - PARAMETER LIST : ', $param_array);\n\t\t\t\n\t\tif($_SERVER['REMOTE_ADDR'] != \"127.0.0.1\")\n\t\t{\n\t\t\n\t\tglobal $HTTP_HOST; \n\t\t\n\t\t$result = array(); \n\t\t\n\t\t$result[0]=true; \n\t\t\n\t\t$result[1]=\"$toemail appears to be valid.\"; \n\t\t/* this regular expression is not allowing some of the domain names like .name etc., so we check for one @ symbol and \n\t\tatleast 1 \".\" symbol in email id.\n\t\tif (!eregi(\"^[_a-z0-9-]+(\\.[_a-z0-9-]+)*@[a-z0-9-]+(\\.[a-z0-9-]+)*(\\.[a-z]{2,3})$\", $toemail)) \n\t\t{ \t\t\n\t\t\t$result[0]=false; \n\t\t\t\n\t\t\t$result[1]=\"$toemail is not properly formatted\"; \n\t\t\t\n\t\t}\n\t\t*/\n\t\t\n\t\t//remove the name from the email\n\t\t\n\t\t$earr = explode(\"<\", $toemail);\n\t\t\n\t\tif(count($earr) == 2 && strlen(trim($earr[1])) > 0)\n\t\t\t$email = substr(trim($earr[1]),0,-1);\n\t\telse\n\t\t\t$email = trim($earr[0]);\n\t\t\n\t\t$eml_arr = explode(\"@\",$email);\n\t\t$result[0]=false; \n\t\t\n\t\t$result[1]=\"$toemail is not properly formatted\"; \n\t\tif(count($eml_arr) == 2 && strlen(trim($eml_arr[0])) > 0 && strlen(trim($eml_arr[1])) > 0)\n\t\t{\n\t\t\t$domain_arr = explode(\".\",$eml_arr[1]);\n\t\t\tif(count($domain_arr) > 1 && strlen(trim($domain_arr[0])) > 0 && strlen(trim($domain_arr[1])) > 0)\n\t\t\t{\n\t\t\t\t$result[0]=true; \n\t\t\t\t$result[1]=\"$toemail appears to be valid.\"; \n\t\t\t}\n\t\t}\n\t\t\n\t\tif(1==2)\n\t\t{//need not check by communicating to email server...\n\t\t\n\t\tlist ( $username, $domain ) = split (\"@\",$toemail); \n\t\t\n\t\tif (getmxrr($domain, $MXHost)) \n\t\t{\t\t\n\t\t\t$connectaddress = $MXHost[0];\n\t\t}\n\t\telse \n\t\t{\t\t\n\t\t\t$connectaddress = $domain;\n\t\t} \n\t\t//echo \"Connect address : \" . $connectaddress . \"<br>\";\n\t\t//echo \"Domain Name : \" . $domain . \"<br>\";\n\t\t$connect = fsockopen ( $connectaddress, 25 ); \n\t\t\n\t\tif ($connect) \n\t\t{\t\t\n\t\t\tif (ereg(\"^220\", $Out = fgets($connect, 1024))) \n\t\t\t{ \n\t\t\t\n\t\t\t fputs ($connect, \"HELO $HTTP_HOST\\r\\n\"); \n\t\t\t \n\t\t\t $out = fgets ( $connect, 1024 ); \n\t\t\t \n\t\t\t $this->from_email = $GLOBALS['site_config']['admin_email'];\n\t\t\t \n\t\t\t $from = $this->from_email;\n\t\t\t \n\t\t\t fputs ($connect, \"MAIL FROM: <{$from}>\\r\\n\"); \n\t\t\t \n\t\t\t $from = fgets ( $connect, 1024 ); \n\t\t\t \n\t\t\t fputs ($connect, \"RCPT TO: <{$toemail}>\\r\\n\"); \n\t\t\t \n\t\t\t $to = fgets ($connect, 1024); \n\t\t\t \n\t\t\t fputs ($connect, \"QUIT\\r\\n\"); \n\t\t\t \n\t\t\t fclose($connect); \n\t\t\t \n\t\t\t if (!ereg (\"^250\", $from) || !ereg ( \"^250\", $to )) \n\t\t\t { \n\t\t\t \n\t\t\t\t $result[0]=false; \n\t\t\t\t \n\t\t\t\t $result[1]=\"Server rejected address\"; \n\t\t\t\t \n\t\t\t\t} \n\t\t\t} \n\t\t\t\n\t\t\telse\n\t\t\t{\t\t\t\t\n\t\t\t\t$result[0] = false; \n\t\t\t\t\n\t\t\t\t$result[1] = \"No response from server\"; \n\t\t\t\t\n\t\t\t } \n\t\t\t \n\t\t}\n\t\t\n\t\telse\n\t\t{\n\t\t\t$result[0]=false; \n\t\t\t\n\t\t\t$result[1]=\"Can not connect E-Mail server.\"; \n\t\t\t\n\t\t\t//return $result; \n\t\t} \n\t\t\n\t\t}\n\t\t\n\t\tif(!$result[0])\n\t\t{\n\n\t\t\t$ttext = \"\";\n\t\t\t$ttext .= \"<table border=0 cellpadding=3 cellspacing=1 align=center width=90%>\";\n\t\t\t$ttext .= \"<tr align=left><td><strong>Error Message</strong></td><td>\" . $result[1] . \" (\" . $toemail . \")\" . \"</td></tr>\";\n\t\t\t$ttext .= \"</table>\";\n\n\t\t\t$GLOBALS['logger_obj']->error('<br>METHOD email::email_validation() - Return Value : ', $ttext,'email');\n\n\t\t}\n\t}\n\t\t$GLOBALS['logger_obj']->debug('<br>METHOD email::email_validation() - Return Value : ', $result);\n\t\treturn $result; \n\t\t\n\t}", "public function unformatName($name);" ]
[ "0.6755387", "0.6567935", "0.6485834", "0.6423738", "0.6362452", "0.6240894", "0.62231904", "0.61852723", "0.6181862", "0.616851", "0.60888094", "0.60834867", "0.60789967", "0.60744584", "0.60643893", "0.6035465", "0.60326225", "0.60219187", "0.60116464", "0.60078335", "0.5978897", "0.5956518", "0.59501284", "0.59476763", "0.5940502", "0.59208965", "0.5912562", "0.58752036", "0.58730716", "0.5861449", "0.5858765", "0.58478326", "0.5839635", "0.58317256", "0.5768478", "0.57141", "0.57139593", "0.57117105", "0.5692314", "0.5682027", "0.5679693", "0.5639457", "0.56301093", "0.5621024", "0.5612245", "0.56081796", "0.55903506", "0.5584947", "0.55628866", "0.5552722", "0.55503345", "0.55430335", "0.5532621", "0.5528922", "0.5524808", "0.5520795", "0.5501741", "0.54944736", "0.5489369", "0.545347", "0.5445076", "0.54431343", "0.5420787", "0.54101706", "0.54084873", "0.540261", "0.540253", "0.54009855", "0.53906006", "0.5379571", "0.53785044", "0.5376697", "0.53622454", "0.53466773", "0.5341867", "0.533926", "0.53378695", "0.5327694", "0.5318812", "0.53158975", "0.5308005", "0.5308005", "0.5308005", "0.5302041", "0.5300907", "0.52987754", "0.5295316", "0.5295316", "0.5292964", "0.52807105", "0.5279897", "0.5275412", "0.526315", "0.525882", "0.5256146", "0.52554345", "0.5240964", "0.524016", "0.52373457", "0.52353454" ]
0.7947774
0
Check a list of email address (comma separated); returns a list of valid email addresses (comma separated). The return value is true if there is at least one valid email address.
function CheckEmailAddress($addr,&$valid) { global $TARGET_EMAIL; $valid = ""; $list = explode(",",$addr); for ($ii = 0 ; $ii < count($list) ; $ii++) { $email = UnMangle($list[$ii]); for ($jj = 0 ; $jj < count($TARGET_EMAIL) ; $jj++) if (eregi($TARGET_EMAIL[$jj],$email)) { if (empty($valid)) $valid = $email; else $valid .= ",".$email; } } return (!empty($valid)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function isEmail(?string ...$values): bool {\n\t\tforeach($values as $value) {\n\t\t\tif (!filter_var($value, FILTER_VALIDATE_EMAIL)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "public function verifyContainsEmail(): bool\n {\n $words = explode(' ', $this->input);\n foreach ($words as $word) {\n if (static::isValidEmail($word)) {\n return true;\n }\n }\n \n return false;\n }", "public function _check_emails($field) {\n\t\t$emails = $this->{$field};\n\t\t$err = '';\n\t\tif ($emails) {\n\t\t\t$arr = explode(\",\", $emails);\n\t\t\tforeach($arr as $email) {\n\t\t\t\t$email = trim($email);\n\t\t\t\tif (!$this->form_validation->valid_email($email)) {\n\t\t\t\t\t$err .= \"Recipient email \" . $email . \" is not valid.<br />\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $err;\n\t}", "private function validate_email($addresses)\n\t{\n\t\t// if array\n\t\tif (is_array($addresses))\n\t\t{\n\t\t\tforeach($addresses as $address)\n\t\t\t{\n\t\t\t\tif(!preg_match('/^([a-zA-Z0-9])+([a-zA-Z0-9\\._-])*@([a-zA-Z0-9_-])+([a-zA-Z0-9\\._-]+)+$/',$address) ) \n\t\t\t\t{\n\t\t\t\t\tthrow new Exception(\"PEARALIZED: invalid email address - \".$address);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\t// single email address\n\t\telse\n\t\t{\n\t\t\tif(!preg_match('/^([a-zA-Z0-9])+([a-zA-Z0-9\\._-])*@([a-zA-Z0-9_-])+([a-zA-Z0-9\\._-]+)+$/',$addresses) ) \n\t\t\t{\n\t\t\t\tthrow new Exception(\"PEARALIZED: invalid email address - \".$addresses);\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t}", "public static function validEmail ($email, $domainPartOnly = false)\r\n\t{\r\n\t\t# Define the regexp; regexp taken from www.zend.com/zend/spotlight/ev12apr.php but with ' added to local part\r\n\t\t$regexp = '^' . ($domainPartOnly ? '[@]?' : '[\\'-_a-z0-9\\$\\+]+(\\.[\\'-_a-z0-9\\$\\+]+)*@') . '[a-z0-9-]+(\\.[a-z0-9-]+)*(\\.[a-z]{2,6})$';\r\n\t\t\r\n\t\t# If not an array, perform the check and return the result\r\n\t\tif (!is_array ($email)) {\r\n\t\t\treturn preg_match ('/' . $regexp . '/i', $email);\r\n\t\t}\r\n\t\t\r\n\t\t# If an array, check each and return the flag\r\n\t\t$allValidEmail = true;\r\n\t\tforeach ($email as $value) {\r\n\t\t\tif (!preg_match ('/' . $regexp . '/i', $value)) {\r\n\t\t\t\t$allValidEmail = false;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $allValidEmail;\r\n\t}", "public function check_email($emails, $projectId){\n $email_list = array();\n $email_list_error = array();\n $emails = preg_split(\"/[;,]+/\", $emails);\n foreach ($emails as $email){\n if(!empty(trim($email))){\n if(filter_var(trim($email), FILTER_VALIDATE_EMAIL)) {\n //VALID\n array_push($email_list,trim($email));\n }else{\n array_push($email_list_error,$email);\n }\n }\n }\n if(!empty($email_list_error)){\n $this->sendFailedEmailRecipient($this->getProjectSetting(\"emailFailed_var\", $projectId),\"Error: Email Address Validation\" ,\"The email \".print_r($email_list_error, true).\" in the project \".$projectId.\", may be invalid format\");\n }\n return $email_list;\n }", "function ValidEmailAddress (\t$in_test_address\t///< Either a single email address, or a list of them, comma-separated.\n )\n {\n $valid = false;\n \n if ( $in_test_address )\n {\n global $g_validation_error; ///< This contains an array of strings, that \"log\" bad email addresses.\n $g_validation_error = array();\n $addr_array = split ( \",\", $in_test_address );\n // Start off optimistic.\n $valid = true;\n \n // If we have more than one address, we iterate through each one.\n foreach ( $addr_array as $addr_elem )\n {\n // This splits any name/address pair (ex: \"Jack Schidt\" <[email protected]>)\n $addr_temp = preg_split ( \"/ </\", $addr_elem );\n if ( count ( $addr_temp ) > 1 )\t// We also want to trim off address brackets.\n {\n $addr_elem = trim ( $addr_temp[1], \"<>\" );\n }\n else\n {\n $addr_elem = trim ( $addr_temp[0], \"<>\" );\n }\n $regexp = \"/^([_a-zA-Z0-9-]+)(\\.[_a-zA-Z0-9-]+)*@([a-zA-Z0-9-]+)(\\.[a-zA-Z0-9-]+)*(\\.[a-zA-Z]{2,4})$/\";\n if (!preg_match($regexp, $addr_elem))\n {\n array_push ( $g_validation_error, 'The address'.\" '$addr_elem' \".'is not correct.' );\n $valid = false;\n }\n }\n }\n \n return $valid;\n }", "protected function isEmailValid($email) {\n\t\tif(is_array($email)) {\n\t\t\tforeach($email as $em) {\n\t\t\t\tif(!preg_match(\"/^([a-z]+[a-z0-9_\\+\\-]*)(\\.[a-z0-9_\\+\\-]+)*@([a-z0-9]+\\.)+[a-z]{2,6}$/ix\", $em)) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\telse {\n\t\t\tif(preg_match(\"/^([a-z]+[a-z0-9_\\+\\-]*)(\\.[a-z0-9_\\+\\-]+)*@([a-z0-9]+\\.)+[a-z]{2,6}$/ix\", $email)) {\n\t\t\t\treturn true;\n\t\t\t}\t\t\n\t\t\treturn false;\t\t\n\t\t}\n\t}", "static function is_email($email, $list=false, $verify=false) {\n require_once PEAR_DIR . 'Mail/RFC822.php';\n require_once PEAR_DIR . 'PEAR.php';\n $rfc822 = new Mail_RFC822();\n if (!($mails = $rfc822->parseAddressList($email)) || PEAR::isError($mails))\n return false;\n\n if (!$list && count($mails) > 1)\n return false;\n\n foreach ($mails as $m) {\n if (!$m->mailbox)\n return false;\n if ($m->host == 'localhost')\n return false;\n }\n\n // According to RFC2821, the domain (A record) can be treated as an\n // MX if no MX records exist for the domain. Also, include a\n // full-stop trailing char so that the default domain of the server\n // is not added automatically\n if ($verify and !count(dns_get_record($m->host.'.', DNS_MX)))\n return 0 < count(dns_get_record($m->host.'.', DNS_A|DNS_AAAA));\n\n return true;\n }", "function isEmailInList($email) {\n\t\tglobal $polarbear_db;\n\t\t$emailSafe = $polarbear_db->escape($email);\n\t\t$sql = \"SELECT count(id) AS antal FROM \" . POLARBEAR_DB_PREFIX . \"_emaillist_emails WHERE listID = '{$this->id}' AND email = '$emailSafe'\";\n\t\tglobal $polarbear_db;\n\t\t$antal = $polarbear_db->get_var($sql);\n\t\treturn (bool) $antal;\n\t}", "public function validateEmails($key, $value, $params, $rule)\n\t{\n\t\tif (empty($value))\n\t\t{\n\t\t\treturn TRUE;\n\t\t}\n\n\t\t$emails = explode(',', $value);\n\n\t\tforeach ($emails as $email)\n\t\t{\n\t\t\tif ($email != filter_var($email, FILTER_SANITIZE_EMAIL) OR ! filter_var($email, FILTER_VALIDATE_EMAIL))\n\t\t\t{\n\t\t\t\t$rule->stop();\n\t\t\t\treturn 'valid_email';\n\t\t\t}\n\t\t}\n\n\t\treturn TRUE;\n\t}", "function check_email_address($email) {\n # Check @ symbol and lengths\n if (!ereg(\"^[^@]{1,64}@[^@]{1,255}$\", $email)) {\n return false;\n }\n\n # Split Email Address into Sections\n $email_array = explode(\"@\", $email);\n $local_array = explode(\".\", $email_array[0]);\n\n # Validate Local Section of the Email Address\n for ($i = 0; $i < sizeof($local_array); $i++) {\n if (!ereg(\"^(([A-Za-z0-9!#$%&'*+/=?^_`{|}~-][A-Za-z0-9!#$%&'*+/=?^_`{|}~\\.-]{0,63})|(\\\"[^(\\\\|\\\")]{0,62}\\\"))$\", $local_array[$i])) {\n return false;\n }\n }\n\n # Validate Domain Section of the Email Address\n if (!ereg(\"^\\[?[0-9\\.]+\\]?$\", $email_array[1])) {\n $domain_array = explode(\".\", $email_array[1]);\n\n # Check the number of domain elements\n if (sizeof($domain_array) < 2) {\n return false;\n }\n\n # Sanity Check All Email Components\n for ($i = 0; $i < sizeof($domain_array); $i++) {\n if (!ereg(\"^(([A-Za-z0-9][A-Za-z0-9-]{0,61}[A-Za-z0-9])|([A-Za-z0-9]+))$\", $domain_array[$i])) {\n return false;\n }\n }\n }\n\n # If All Validation Checks have Passed then Return True\n return true;\n }", "public static function email($value){\n\t\treturn (bool) filter_var($value, FILTER_VALIDATE_EMAIL);\n\t}", "protected function validateEmail($value){\n\t\tif(!$value) return true;\n\t\treturn filter_var($value, FILTER_VALIDATE_EMAIL) !== false;\n\t}", "public static function email($data){\n if(!filter_var($data,FILTER_VALIDATE_EMAIL)){\n return false;\n }\n return true;\n }", "public function is_valid_email()\r\n {\r\n // email address.\r\n\r\n return (!empty($this->address) && preg_match($this->re_email, $this->address));\r\n }", "public static function is_email($value) {\r\n\t\t$parts = explode('@', $value, 2);\r\n\t\t$local_part = array_shift($parts);\r\n\t\t$domain = array_shift($parts);\r\n\t\t\r\n\t\t$ret = self::is_domain($domain);\r\n\t\t// local part may be up to 64 characters \r\n\t\t$ret = $ret && (strlen($local_part) <= 64);\r\n\t\t// dot is not allowed at the end or beginning\r\n\t\t// There is also a rule that 2 or more dots are illegal like in '[email protected]'\r\n\t\t// Unfortunately: my neighbor's address IS [email protected]! And I can't lock my neighbor \r\n\t\t// out of the services I program, can I? \r\n\t\t$ret = $ret && (substr($local_part, 0, 1) !== '.');\r\n\t\t$ret = $ret && (substr($local_part, -1) !== '.');\r\n\t\t// Only a-z, A-Z, 0-9 and !#$%&'*+-/=?^_`{|}~ and . are allowed\r\n\t\t// (There is quoting and escaping, but we do not hear, we do not hear, we do not hear...)\r\n\t\t$pattern = \"@^[a-zA-Z0-9!#$%&'*+\\-/=?^_`{|}~.]+$@s\";\r\n\t\t$ret = $ret && preg_match($pattern, strtr($local_part, \"\\r\\n\", ' '));\r\n\t\t\r\n\t\treturn $ret;\r\n\t}", "protected function validateEmails($data)\n {\n $lines = explode(\"\\n\", $data);\n $lines = array_filter($lines, 'trim');\n $data = implode(',', $lines);\n $data = explode(',', trim($data));\n $data = array_filter($data);\n $emails = array();\n $errors = array();\n\n foreach ($data as $email) {\n $email = trim($email);\n if (Validate::isEmail($email)) {\n $emails[] = $email;\n } else {\n $errors[] = $email;\n }\n }\n\n return array(\n 'emails' => $emails,\n 'errors' => $errors,\n );\n }", "function is_valid_email($address) {\n $fields = preg_split(\"/@/\", $address, 2);\n if ((!preg_match(\"/^[0-9a-z]([-_.]?[0-9a-z])*$/i\", $fields[0])) || (!isset($fields[1]) || $fields[1] == '' || !is_valid_hostname_fqdn($fields[1], 0))) {\n return false;\n }\n return true;\n}", "function check_banlist($banlist, $email) {\n if (count($banlist)) {\n $allow = true;\n foreach($banlist as $banned) {\n $temp = explode(\"@\", $banned);\n if ($temp[0] == \"*\") {\n $temp2 = explode(\"@\", $email);\n if (trim(strtolower($temp2[1])) == trim(strtolower($temp[1])))\n $allow = false;\n } \n\t\telse {\n if (trim(strtolower($email)) == trim(strtolower($banned)))\n $allow = false;\n }\n }\n }\n if (!$allow) {\n print_error(\"You are using from a <b>banned email address.</b>\");\n }\n}", "public function isValid($domains, $email)\n {\n if (!is_null($domains)) {\n $domains = str_replace(' ', '', $domains);\n\n return collect(explode(',', $domains))->contains(function ($domain) use ($email) {\n return $this->getDomain($email) == $domain;\n });\n }\n\n return true;\n }", "public function isAtLeastOneKnownEmailAddress($_);", "private function email_Check_Validation($email){\r\n return (filter_var($email, FILTER_VALIDATE_EMAIL)) ? true : false;\r\n }", "public static function fieldListEmail($method, $fieldList, $params) {\n $result = TRUE;\n $errorFieldList = array();\n $errorFieldListDNS = array();\n foreach ($fieldList as $_field) {\n if (isset($params[$_field]) && $params[$_field] !== NULL) {\n if (!filter_var($params[$_field], FILTER_VALIDATE_EMAIL)) {\n $result = FALSE;\n $errorFieldList[] = \"`{$_field}` ({$params[$_field]})\";\n }\n if ($result !== FALSE) {\n $_elements = explode(\"@\", $params[$_field], 2);\n if (!checkdnsrr(end($_elements), \"MX\")) {\n $result = FALSE;\n $errorFieldListDNS[] = \"`{$_field}` ({$params[$_field]})\";\n }\n }\n }\n }\n if ($result === FALSE && count($errorFieldList) > 0) {\n \\Raneko\\Log::error($method, \"Email fields constraint violated: \" . implode(\", \", $errorFieldList));\n }\n if ($result === FALSE && count($errorFieldListDNS) > 0) {\n \\Raneko\\Log::error($method, \"DNS lookup failed for: \" . implode(\", \", $errorFieldListDNS));\n }\n return $result;\n }", "public static function validate_email($email) {\n\t\t// First, we check that there's one @ symbol, \n\t\t// and that the lengths are right.\n\t\tif (!ereg(\"^[^@]{1,64}@[^@]{1,255}$\", $email)) {\n\t\t\t// Email invalid because wrong number of characters \n\t\t\t// in one section or wrong number of @ symbols.\n\t\t\treturn false;\n\t\t}\n\t\t// Split it into sections to make life easier\n\t\t$email_array = explode(\"@\", $email);\n\t\t$local_array = explode(\".\", $email_array[0]);\n\t\tfor ($i = 0; $i < sizeof($local_array); $i++) {\n\t\t\tif(!ereg(\"^(([A-Za-z0-9!#$%&'*+/=?^_`{|}~-][A-Za-z0-9!#$%&\n\t\t\t?'*+/=?^_`{|}~\\.-]{0,63})|(\\\"[^(\\\\|\\\")]{0,62}\\\"))$\",\n\t\t\t$local_array[$i])) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t// Check if domain is IP. If not, \n\t\t// it should be valid domain name\n\t\tif (!ereg(\"^\\[?[0-9\\.]+\\]?$\", $email_array[1])) {\n\t\t\t$domain_array = explode(\".\", $email_array[1]);\n\t\t\tif (sizeof($domain_array) < 2) {\n\t\t\t\treturn false; // Not enough parts to domain\n\t\t\t}\n\t\t\tfor ($i = 0; $i < sizeof($domain_array); $i++) {\n\t\t\t\tif(!ereg(\"^(([A-Za-z0-9][A-Za-z0-9-]{0,61}[A-Za-z0-9])|\n\t\t\t\t\t?([A-Za-z0-9]+))$\",\n\t\t\t\t$domain_array[$i])) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "public static function ifEmail($emails)\n\t\t{\n\t\t\t$pattern = \"/^([a-zA-Z0-9-_\\.]{3,})@([a-zA-Z0-9-_]{4,})\\.([a-zA-Z]{2,6})$/\";\n\t\t\tif(is_array($emails))\n\t\t\t{\n\t\t\t\tforeach ($emails as $email) \n\t\t\t\t{\n\t\t\t\t\tif(!preg_match($pattern, $email))\n\t\t\t\t\t{\n\t\t\t\t\t\treturn 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif(preg_match($pattern, $emails))\n\t\t\t\t{\n\t\t\t\t\treturn 1;\n\t\t\t\t}\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t}", "private function emailList()\n {\n return array(\n '[email protected]',\n '[email protected]',\n '[email protected]',\n );\n }", "private function process_email($value)\n {\n return (bool) filter_var($value, FILTER_VALIDATE_EMAIL);\n }", "public function isValidEmail($email) {\n\t\tif (preg_match(\"/^([a-zA-Z0-9]+)(@)([a-zA-Z0-9.]+)(.edu)$/\", $email, $output_array)){\n\t\t\tif(filter_var($email, FILTER_VALIDATE_EMAIL)) {\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t}", "public function checkEmailFormat($data) {\n foreach ($this->_email_format as $field) {\n if (!empty($data[$field])) {\n $pattern = \"/^[A-Za-z0-9._%+-]+@([A-Za-z0-9-]+\\.)+([A-Za-z0-9]{2,4}|museum)$/\";\n if (!preg_match($pattern, $data[$field])) {\n $this->_addError(self::ERROR_CODE_FIELD_FORMAT_EMAIL, $field, $data[$field]);\n $this->_invalid_parameter = $field;\n return false;\n }\n }\n }\n\n return true;\n }", "public function email_check($str) {\n //if(!empty($str) && $this->get_by(\"email\", $str))\n // return FALSE;\n return TRUE;\n }", "function email_check($email) {\n\tif (!filter_var($email, FILTER_VALIDATE_EMAIL)) {\n\t\treturn false; \n\t}\n\t$domain = explode(\"@\",$email);\n\tif (!checkdnsrr($domain[1], 'MX')) {\n\t\treturn false; \n\t}\n\treturn true;\n}", "public function testMultipleValidatorsEmailValidation(): void\n {\n $builder = new ValidationBuilder();\n $builder->validate(\"email\", function (Field $field): void {\n $field->email(\"rfc\", \"dns\");\n });\n\n $rules = $builder->getRules();\n\n $this->assertCount(1, $rules);\n $this->assertEquals([\"email:rfc,dns\"], $rules[\"email\"]);\n }", "private function checkEmail($data) {\n\t\tif(filter_var($data, FILTER_VALIDATE_EMAIL)) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function passes($attribute, $value)\n {\n $str = preg_replace('/[\\s]/', '',$value);\n\n if (!empty($str)) {\n\n $emails = explode(',', $str);\n\n foreach ($emails as $email) {\n if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {\n return false;\n }\n }\n }\n\n return true;\n }", "public function validateEmail()\n {\n if (!isset($this->_data['email'])) {\n return false;\n }\n\n $response = filter_var($this->_data['email'], FILTER_VALIDATE_EMAIL);\n\n return ($response !== false);\n }", "function isValidEmail($email) {\n\n\t\t// First, we check that there's one @ symbol, and that the lengths are right\n\n\t\tif (!preg_match(\"/^[^@]{1,64}@[a-zA-z0-9].{1,255}$/\", $email)) {\n\t\t\t// Email invalid because wrong number of characters in one section, or wrong number of @ symbols.\n\t\t\treturn false;\n\t\t}\n\n\t\t// Split it into sections to make life easier\n\n\t\t$email_array = explode(\"@\", $email);\n\t\t$local_array = explode(\".\", $email_array[0]);\n\t\tfor ($i = 0; $i < sizeof($local_array); $i++) {\n\t\t\tif (!preg_match(\"/^(([A-Za-z0-9!#$%&'*+\\/=?^_`{|}~-][A-Za-z0-9!#$%&'*+\\/=?^_`{|}~\\.-]{0,63})|(\\\"[^(\\\\|\\\")]{0,62}\\\"))$/\", $local_array[$i])) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tif (!preg_match(\"/^\\[?[0-9\\.]+\\]?$/\", $email_array[1])) { // Check if domain is IP. If not, it should be valid domain name\n\t\t\t$domain_array = explode(\".\", $email_array[1]);\n\t\t\tif (sizeof($domain_array) < 2) {\n\t\t\t\treturn false; // Not enough parts to domain\n\t\t\t}\n\n\t\t\tfor ($i = 0; $i < sizeof($domain_array); $i++) {\n\t\t\t\tif (!preg_match(\"/^(([A-Za-z0-9][A-Za-z0-9-]{0,61}[A-Za-z0-9])|([A-Za-z0-9]+))$/\", $domain_array[$i])) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn true;\n }", "function invalidEmail($emailadres) {\n\tif (!filter_var($emailadres, FILTER_VALIDATE_EMAIL)) {\n\t\t$result = true;\n\t} else {\n\t\t$result = false;\n\t}\n\treturn $result;\n}", "public static function isEmail($value)\n\t{\n\t\t$atom = \"[-a-z0-9!#$%&'*+/=?^_`{|}~]\"; // RFC 5322 unquoted characters in local-part\n\t\t$localPart = \"(?:\\\"(?:[ !\\\\x23-\\\\x5B\\\\x5D-\\\\x7E]*|\\\\\\\\[ -~])+\\\"|$atom+(?:\\\\.$atom+)*)\"; // quoted or unquoted\n\t\t$chars = \"a-z0-9\\x80-\\xFF\"; // superset of IDN\n\t\t$domain = \"[$chars](?:[-$chars]{0,61}[$chars])\"; // RFC 1034 one domain component\n\t\treturn (bool) preg_match(\"(^$localPart@(?:$domain?\\\\.)+[-$chars]{2,19}\\\\z)i\", $value);\n\t}", "public static function validate_email($email) {\n\t // First, we check that there's one @ symbol, \n\t // and that the lengths are right.\n\t if (!ereg(\"^[^@]{1,64}@[^@]{1,255}$\", $email)) {\n\t // Email invalid because wrong number of characters \n\t // in one section or wrong number of @ symbols.\n\t return false;\n\t }\n\t // Split it into sections to make life easier\n\t $email_array = explode(\"@\", $email);\n\t $local_array = explode(\".\", $email_array[0]);\n\t for ($i = 0; $i < sizeof($local_array); $i++) {\n\t if\n\t(!ereg(\"^(([A-Za-z0-9!#$%&'*+/=?^_`{|}~-][A-Za-z0-9!#$%&\n\t↪'*+/=?^_`{|}~\\.-]{0,63})|(\\\"[^(\\\\|\\\")]{0,62}\\\"))$\",\n\t$local_array[$i])) {\n\t return false;\n\t }\n\t }\n\t // Check if domain is IP. If not, \n\t // it should be valid domain name\n\t if (!ereg(\"^\\[?[0-9\\.]+\\]?$\", $email_array[1])) {\n\t $domain_array = explode(\".\", $email_array[1]);\n\t if (sizeof($domain_array) < 2) {\n\t return false; // Not enough parts to domain\n\t }\n\t for ($i = 0; $i < sizeof($domain_array); $i++) {\n\t if\n\t(!ereg(\"^(([A-Za-z0-9][A-Za-z0-9-]{0,61}[A-Za-z0-9])|\n\t↪([A-Za-z0-9]+))$\",\n\t$domain_array[$i])) {\n\t return false;\n\t }\n\t }\n\t }\n\t return true;\n\t}", "protected static function validate_email( $value ) {\n\t\treturn WmfFramework::validateEmail( $value )\n\t\t\t&& !DataValidator::cc_number_exists_in_str( $value );\n\t}", "public function email($email)\n {\n return (bool)filter_var($email, FILTER_VALIDATE_EMAIL);\n }", "function validate_email($email){\n\t\n\tif(empty($email)){\n\t\t\n\t\treturn false;\n\t\t\n\t}\n\tif(count(explode('@',$email)) != 2){\n\t\t\n\t\treturn false;\n\t\t\n\t}\n\telse {\n\t\t\n\t\t$words = explode('@',$email);\n\t\t\t$second = $words[1];\n\t\t\tif(count(explode('.',$email)) != 2){\n\t\t\t\n\t\t\treturn false;\n\t\t\n\t\t}\n\t\t\n\t}\n\t\treturn true;\n\t\n\t\n}", "public static function getEmails ( $string = \"\" ) {\n\t\tif ( empty( $string ) || ! is_string( $string ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$emails = preg_match_all('/[A-Z0-9._%+-]+@[A-Z0-9.-]+\\.[A-Z]{2,12}\\b/i', $string, $matches);\n\n\t\treturn ! empty( $emails ) && isset( $matches[0] ) ? $matches[0] : false;\n\t}", "function isValidEmail(String &$val)\n\t{\n\n\t\tif(isSizedString($val) && strpos($val, '@') !== false && filter_var($val, FILTER_VALIDATE_EMAIL)) return true;\n\t\telse return false;\n\n\t}", "function isEmail($input) {\n // Matches Email addresses. (Found out how to break up a RedEx so that it can be nicly commited.)\n return (preg_match(\n \"~(^ ## Match starts at the beginning of the string.\n (?>[[:alnum:]._-])+ ## Matches any alpha numaric character plus the '.', '_', and '-'\n ## For the name part of an address. \n (?>@) ## Matches the at sign.\n (?>[[:alnum:]])+ ## Matches any alpha numaric character\n ## For the Place part of the address.\n \n (?> ## To match things like 'uk.com 'or just '.com'\n (?:\\.[[:alpha:]]{2,3}\\.[[:alpha:]]{2,3}) ## Matches a '.' then 2-3 alphabet characters\n ## then another '.' and 2-3 alphabet characters.\n | ## Or Matches\n (?:\\.[[:alpha:]]{2,3}) ## a single '.' then 2-3 alphabet characters.\n )\n $ ## Match to the end of the string.\n )~x\", $input));\n }", "function isValidEmail($email) {\n\tif (C_RESTRICT_EMAIL_DOMAIN) {\n\t\t$domain = explode(\"@\", $email);\n\t\tif ($domain[1] === C_VALID_EMAIL_DOMAIN) {\n\t\t\treturn (true);\n\t\t} else {\n\t\t\treturn (false);\n\t\t}\n\t} else {\n\t\treturn (true);\n\t}\n}", "function valid_email_address($mail) {\n $user = '[a-zA-Z0-9_\\-\\.\\+\\^!#\\$%&*+\\/\\=\\?\\`\\|\\{\\}~\\']+';\n $domain = '(?:(?:[a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\\-]*[a-zA-Z0-9])\\.?)+';\n $ipv4 = '[0-9]{1,3}(\\.[0-9]{1,3}){3}';\n $ipv6 = '[0-9a-fA-F]{1,4}(\\:[0-9a-fA-F]{1,4}){7}';\n\n return preg_match(\"/^$user@($domain|(\\[($ipv4|$ipv6)\\]))$/\", $mail);\n}", "function pdfbulletin_subscribers_form_validate($form, &$form_state) {\n $emails = explode(\"\\n\", $form_state['values']['subscribers']);\n foreach ($emails as $email) {\n $email = trim($email);\n if (! empty($email) && ! valid_email_address($email)) {\n form_set_error('subscribers', t('Invalid e-mail address: @email', array('@email' => $email)));\n }\n }\n}", "private function check_Email($email){\r\n\r\n //Remove all illegal characters from an e-mail adress\r\n $email_B = filter_var($email, FILTER_SANITIZE_EMAIL);\r\n\r\n $Validate = self::email_Check_Validation($email_B);\r\n\r\n return (($Validate == false) || ($email != $email_B)) ? true : false;\r\n }", "function is_email($value)\r\n{\r\n\treturn preg_match('/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\\.[A-Z]{2,4}$/i', $value);\r\n}", "function is_valid_email ($mail)\n{\n return filter_var($mail, FILTER_VALIDATE_EMAIL) && (! preg_match('/@\\[[^\\]]++\\]\\z/', $mail));\n}", "function is_email($emailadres)\r\n{\r\n // Eerst een snelle controle uitvoeren: \r\n // een e-mailadres moet uit minimaal 7 tekens bestaan:\r\n if (strlen($emailadres) < 7) \r\n {\r\n return false;\r\n }\r\n // Daarna een controle met een reguliere expressie uitvoeren:\r\n if( ! ereg(\"^[_a-zA-Z0-9-]+(\\.[_a-zA-Z0-9-]+)*@([a-zA-Z0-9-]+\\.)+([a-zA-Z]{2,4})$\", $emailadres) ) \r\n {\r\n return false;\r\n } \r\n\r\n return true; \r\n}", "function checkMAIL($account, $email)\n {\n while ($users = $account->fetch()) {\n if ($users['email'] == $email) {\n return true;\n }\n }\n return false;\n }", "function check_email($email) \r\n{ \r\n\t$emailArray = preg_split('//', $email); \r\n $atSign = false; \r\n $dotSign = false; \r\n $badCharacter = false; \r\n $validEmail = true; \r\n\tif (in_array (\"@\", $emailArray)) \r\n\t{ \r\n \t$atSign = true; \r\n } \r\n if (in_array (\".\", $emailArray)) \r\n\t{ \r\n \t$dotSign = true; \r\n } \r\n\t$badCharactersArray = array('#', '$', '%', '(', ')', '&', '!'); // Add your own bad \r\n\tfor ($i = 0; $i < sizeof($badCharactersArray); $i++) \r\n\t{ \r\n\t\tif (in_array ($badCharactersArray[$i], $emailArray)) \r\n \t{ \r\n \t\t$badCharacter = true; \r\n \t} \r\n\t} \r\n\tif ((!$atSign) or (!$dotSign) or ($badCharacter)) \r\n \t$validEmail = false; \r\n}", "public static function isValidEmail($email) {\n\t\t$email_apart = preg_split('/@/', $email);\n\n\t\tif (count($email_apart) <= 1) return false;\n\n\t\t$username = $email_apart[0];\n\t\t$hostname = $email_apart[1];\n\t\t$mxhosts = array();\n\t\t$dns = checkdnsrr($hostname);\n\t\t$mx = getmxrr($hostname, $mxhosts);\n\n\t\treturn ($dns && $mx && count($mxhosts) >= 1) ? true : false;\n\t}", "function pdfbulletin_sendtest_form_validate($form, &$form_state) {\n $emails = explode(\"\\n\", $form_state['values']['subscribers']);\n foreach ($emails as $email) {\n $email = trim($email);\n if (! empty($email) && ! valid_email_address($email)) {\n form_set_error('subscribers', t('Invalid e-mail address: @email', array('@email' => $email)));\n }\n }\n}", "function isValidEmail($email) {\n return strpos($email, \"@\") !== false;\n }", "function check_email_address($email) \n{\n // First, we check that there's one @ symbol, and that the lengths are right\n if (!ereg(\"^[^@]{1,64}@[^@]{1,255}$\", $email)) \n {\n // Email invalid because wrong number of characters in one section, or wrong number of @ symbols.\n return false;\n }\n // Split it into sections to make life easier\n $email_array = explode(\"@\", $email);\n $local_array = explode(\".\", $email_array[0]);\n for ($i = 0; $i < sizeof($local_array); $i++) \n {\n if (!ereg(\"^(([A-Za-z0-9!#$%&'*+/=?^_`{|}~-][A-Za-z0-9!#$%&'*+/=?^_`{|}~\\.-]{0,63})|(\\\"[^(\\\\|\\\")]{0,62}\\\"))$\", $local_array[$i])) \n {\n return false;\n }\n }\n if (!ereg(\"^\\[?[0-9\\.]+\\]?$\", $email_array[1])) \n { // Check if domain is IP. If not, it should be valid domain name\n $domain_array = explode(\".\", $email_array[1]);\n if (sizeof($domain_array) < 2) \n {\n return false; // Not enough parts to domain\n }\n for ($i = 0; $i < sizeof($domain_array); $i++) \n {\n if (!ereg(\"^(([A-Za-z0-9][A-Za-z0-9-]{0,61}[A-Za-z0-9])|([A-Za-z0-9]+))$\", $domain_array[$i])) \n {\n return false;\n }\n }\n }\n return true;\n}", "function isEmail($input){\n return preg_match('/[a-z0-9]@[a-z]{3,}\\.[a-z]{3}$/',$input);\n }", "protected function isBanned($email = null){\n \n if (empty($email)){\n return false;\n }\n \n $ban_emails = Configure::read('core.ban_emails');\n $emails = explode( \"\\n\", $ban_emails );\n \n if (empty($ban_emails)){\n return false;\n }\n \n foreach ($emails as $item){\n if (trim($email) == trim($item)){\n return true;\n }else{\n $list1 = explode(\"@*\", $item); // abc@*\n $list2 = explode(\"*@\", $item); // *@abc.com\n $list3 = explode(\"@\", $email);\n \n // case 1\n if (isset($list1[0]) && isset($list3[0])){\n if (trim($list1[0]) == trim($list3[0])){ // compared name\n return true;\n } \n }\n \n // case 2\n if (isset($list2[1]) && isset($list3[1])){\n \n if (trim($list2[1]) == trim($list3[1])){ // compared domain\n return true;\n }\n }\n }\n }\n \n return false;\n }", "function email_is_valid($email) {\n return filter_var($email, FILTER_VALIDATE_EMAIL);\n }", "public static function validateEMAIL($email) {\n if (filter_var($email, FILTER_VALIDATE_EMAIL))\n return true;\n else\n return false; \n }", "public static function validateEmail(): array\n\t{\n\t\treturn [\n\t\t\tnew LengthValidator(null, 100),\n\t\t];\n\t}", "public function emailEntryIsValid() {\r\n \r\n $email = $this->getEmail();\r\n \r\n if ( empty($email) ) {\r\n $this->errors[\"email\"] = \"Email is missing.\";\r\n } else if ( !Validator::emailIsValid($this->getEmail()) ) {\r\n $this->errors[\"email\"] = \"Email is not valid.\"; \r\n }\r\n \r\n return ( empty($this->errors[\"email\"]) ? true : false ) ;\r\n }", "public function is_coupon_emails_allowed( $check_emails, $restrictions ) {\n\n\t\tforeach ( $check_emails as $check_email ) {\n\t\t\t// With a direct match we return true.\n\t\t\tif ( in_array( $check_email, $restrictions, true ) ) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\t// Go through the allowed emails and return true if the email matches a wildcard.\n\t\t\tforeach ( $restrictions as $restriction ) {\n\t\t\t\t// Convert to PHP-regex syntax.\n\t\t\t\t$regex = '/' . str_replace( '*', '(.+)?', $restriction ) . '/';\n\t\t\t\tpreg_match( $regex, $check_email, $match );\n\t\t\t\tif ( ! empty( $match ) ) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// No matches, this one isn't allowed.\n\t\treturn false;\n\t}", "public function isEmail()\n {\n return filter_var($this->_value, FILTER_VALIDATE_EMAIL);\n }", "protected function validateEmail(string $identifier, mixed $value): bool\n {\n return ! empty( filter_var($value, FILTER_VALIDATE_EMAIL));\n }", "function is_email_valid($email) {\n\treturn filter_var($email, FILTER_VALIDATE_EMAIL);\n}", "public static function validateEmailAddr($email)\n {\n return filter_var($email, FILTER_VALIDATE_EMAIL);\n }", "public static function validateEmailAddr($email)\n {\n return filter_var($email, FILTER_VALIDATE_EMAIL);\n }", "private function clean_poea_email($email) {\n\n \t$emails = array();\n\n \t$email = str_replace('@y.c', \"@yahoo.com\", $email);\n\n\t\t$slash_email = explode(\"/\", $email);\n\t\t$or_email = explode(\" or \", $email);\n\t\t$and_email = explode(\"&\", $email);\n\n\t\tif(count($slash_email) > 1) {\n\t\t\t\n\t\t\tforeach ($slash_email as $v) {\n\n\t\t\t\t$v = trim($v);\n\n\t\t\t\tif(filter_var($v, FILTER_VALIDATE_EMAIL)) {\n\n\t\t\t\t\t$emails[] = $v;\t\t\t\n\t\t\t\t}\n\t\t\t}\n\n\t\t} elseif(count($and_email) > 1) {\n\n\t\t\tforeach ($and_email as $v) {\n\n\t\t\t\t$v = trim($v);\n\n\t\t\t\tif(filter_var($v, FILTER_VALIDATE_EMAIL)) {\n\n\t\t\t\t\t$emails[] = $v;\t\n\t\t\t\t}\n\t\t\t}\n\n\t\t} elseif(count($or_email) > 1) {\n\n\t\t\tforeach ($or_email as $v) {\n\n\t\t\t\t$v = trim($v);\n\n\t\t\t\tif(filter_var($v, FILTER_VALIDATE_EMAIL)) {\n\t\n\t\t\t\t\t$emails[] = $v;\t\t\t\n\t\t\t\t}\n\t\t\t}\n\n\t\t} elseif(filter_var($email, FILTER_VALIDATE_EMAIL)) {\n\n\t\t\t$emails[] = $email;\t\n\n\t\t}\n\n\t\tif(empty($emails)) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn json_encode($emails);\n }", "function isValidEmail($addr)\n\t{\n\t\t//Called by validateInput().\n\t\t\n\t\t//Only one at-sign\n\t\t$atSplit = explode(\"@\",$addr);\n\t\tif(count($atSplit) != 2)\n\t\t\treturn false;\n\n\t\t$domain = $atSplit[1];\n\n\t\t//Only one period\n\t\t$pdSplit = explode('.',$domain);\n\t\tif(count($pdSplit) < 2)\n\t\t\treturn false;\n\t\t\t\n\t\t$suffix = $pdSplit[count($pdSplit) - 1];\n\t\t\n\t\t//Valid suffix\n\t\tswitch($suffix)\n\t\t{\n\t\t\tcase \"com\":\n\t\t\tcase \"net\":\n\t\t\tcase \"org\":\n\t\t\tcase \"gov\":\n\t\t\tcase \"co\":\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\treturn false;\n\t\t}\n\t\t\n\t\t//Valid domain name\n\t\tif(preg_match('/[^\\-\\d\\w\\.]/',$domain))\n\t\t\treturn false;\n\t\t\t\n\t\t//Valid username\n\t\tif(preg_match('/[^\\-\\d\\w]/',$atSplit[0]))\n\t\t\treturn false;\n\t\t\n\t\t//First character is a letter\n\t\tif(preg_match('/[^A-Za-z]/',substr($atSplit[0],0,1)))\n\t\t\treturn false;\n\t\t\t\n\t\treturn true;\n\t}", "function isValidEmail($addr)\n\t{\n\t\t//Called by validateInput().\n\t\t\n\t\t//Only one at-sign\n\t\t$atSplit = explode(\"@\",$addr);\n\t\tif(count($atSplit) != 2)\n\t\t\treturn false;\n\n\t\t$domain = $atSplit[1];\n\n\t\t//Only one period\n\t\t$pdSplit = explode('.',$domain);\n\t\tif(count($pdSplit) < 2)\n\t\t\treturn false;\n\t\t\t\n\t\t$suffix = $pdSplit[count($pdSplit) - 1];\n\t\t\n\t\t//Valid suffix\n\t\tswitch($suffix)\n\t\t{\n\t\t\tcase \"com\":\n\t\t\tcase \"net\":\n\t\t\tcase \"org\":\n\t\t\tcase \"gov\":\n\t\t\tcase \"co\":\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\treturn false;\n\t\t}\n\t\t\n\t\t//Valid domain name\n\t\tif(preg_match('/[^\\-\\d\\w\\.]/',$domain))\n\t\t\treturn false;\n\t\t\t\n\t\t//Valid username\n\t\tif(preg_match('/[^\\-\\d\\w]/',$atSplit[0]))\n\t\t\treturn false;\n\t\t\n\t\t//First character is a letter\n\t\tif(preg_match('/[^A-Za-z]/',substr($atSplit[0],0,1)))\n\t\t\treturn false;\n\t\t\t\n\t\treturn true;\n\t}", "function isValidEmailAddress($emailAddress)\n{\n return filter_var($emailAddress, FILTER_VALIDATE_EMAIL) !== false;\n}", "function checkEmail($email) {\n\t\tif(strpos($email, '@') && strpos($email, '.')) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function validate($value)\n {\n $regex = '/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\\.[A-Z]{2,}$/i';\n return preg_match($regex, $value) === 1;\n }", "function isEMailValid($mail)\n{\n return (filter_var($mail, FILTER_VALIDATE_EMAIL) !== false);\n}", "public function isValidEmail($variable) {\n if (filter_var($variable,FILTER_VALIDATE_EMAIL)) {\n return true;\n }\n return false;\n }", "public static function isValid($email)\n {\n return (boolean) preg_match(\n '/^(?!(?>(?1)\"?(?>\\\\\\[ -~]|[^\"])\"?(?1)){255,})(?!(?>(?1)\"?(?>\\\\\\[ -~]|[^\"])\"?(?1)){65,}@)' .\n '((?>(?>(?>((?>(?>(?>\\x0D\\x0A)?[\\t ])+|(?>[\\t ]*\\x0D\\x0A)?[\\t ]+)?)(\\((?>(?2)' .\n '(?>[\\x01-\\x08\\x0B\\x0C\\x0E-\\'*-\\[\\]-\\x7F]|\\\\\\[\\x00-\\x7F]|(?3)))*(?2)\\)))+(?2))|(?2))?)' .\n '([!#-\\'*+\\/-9=?^-~-]+|\"(?>(?2)(?>[\\x01-\\x08\\x0B\\x0C\\x0E-!#-\\[\\]-\\x7F]|\\\\\\[\\x00-\\x7F]))*' .\n '(?2)\")(?>(?1)\\.(?1)(?4))*(?1)@(?!(?1)[a-z0-9-]{64,})(?1)(?>([a-z0-9](?>[a-z0-9-]*[a-z0-9])?)' .\n '(?>(?1)\\.(?!(?1)[a-z0-9-]{64,})(?1)(?5)){0,126}|\\[(?:(?>IPv6:(?>([a-f0-9]{1,4})(?>:(?6)){7}' .\n '|(?!(?:.*[a-f0-9][:\\]]){8,})((?6)(?>:(?6)){0,6})?::(?7)?))|(?>(?>IPv6:(?>(?6)(?>:(?6)){5}:' .\n '|(?!(?:.*[a-f0-9]:){6,})(?8)?::(?>((?6)(?>:(?6)){0,4}):)?))?(25[0-5]|2[0-4][0-9]|1[0-9]{2}' .\n '|[1-9]?[0-9])(?>\\.(?9)){3}))\\])(?1)$/isD',\n $email ?: ''\n );\n }", "function check_email ($email) {\n\t\n if (preg_match ('/^[-!#$%&\\'*+\\\\.\\/0-9=?A-Z^_{|}~]+' . '@' . '([-0-9A-Z]+\\.)+' . '([0-9A-Z]){2,4}$/i', trim ($email))) {\n \n return true;\n \n } else {\n \n return false;\n \n }\n}", "protected function validateEmail($email) {\t\n\t $valid = (!filter_var($email, FILTER_VALIDATE_EMAIL)) ? FALSE : TRUE;\n\t \n\t return $valid;\n\t}", "private function checkEmail($value, $message)\n {\n if(!filter_var($value, FILTER_VALIDATE_EMAIL)) {\n $this->errors [] = $message;\n return false;\n } else {\n return true;\n }\n }", "protected function validateEmail($value) {\n if (filter_var($value, FILTER_VALIDATE_EMAIL))\n return true;\n $this->setError(t(\"Invalid e-mail address\"));\n return false;\n }", "function validEmail($email)\n {\n //using filter_var function we can check for valid email\n return !empty($email) && filter_var($email, FILTER_VALIDATE_EMAIL);\n }", "function isValidEmail($email){\n return filter_var($email, FILTER_VALIDATE_EMAIL) !== false;\n}", "protected function validateEmail($attribute, $value)\n {\n return filter_var($value, FILTER_VALIDATE_EMAIL) !== false;\n }", "function ValidateEmail( $email ) {\n // Check if address is valid\n if( ! filter_var( $email, FILTER_VALIDATE_EMAIL ) )\n return false;\n\n // Break up into parts\n $parts = explode( '@', $email );\n $user = $parts[0];\n $domain = $parts[1];\n\n // Check if domain resolves\n if( ! checkdnsrr( $domain, 'MX' ) && ( ! checkdnsrr( $domain, 'A' ) || ! checkdnsrr( $domain, 'AAAA' ) ) )\n return false;\n\n return true;\n}", "function checkEmail($email)\n{\n // checks proper syntax\n if( !preg_match( \"/^([a-zA-Z0-9])+([a-zA-Z0-9\\._-])*@([a-zA-Z0-9_-])+([a-zA-Z0-9\\._-]+)+$/\", $email))\n return false;\n else\n \treturn true;\n}", "function emailValidation($email)\n\t{\n\t\tif (!filter_var($email, FILTER_VALIDATE_EMAIL))\n\t\t{\n\t\t\treturn 0;\n\t\t}\n\t\treturn 1;\n \t}", "public static function isValidEmail($email){\n return (filter_var($email, FILTER_VALIDATE_EMAIL)) ? true : false;\n }", "function check_email($email) {\r\n\r\n if (filter_var($email, FILTER_VALIDATE_EMAIL)) {\r\n return true;\r\n }\r\n return false;\r\n}", "function IsValidEmail($input) {\r\n $regex = '/^[a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+\\.([a-zA-Z]{2,4})$/';\r\n\r\n if (preg_match($regex, $input)) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n}", "function isEmailValid($email) {\n\treturn filter_var($email, FILTER_VALIDATE_EMAIL) && preg_match('/@.+\\./', $email);\n}", "function validate_email($input) {\n if (!filter_var($input, FILTER_VALIDATE_EMAIL)) {\n return false;\n }\n \n return true;\n}", "function check_email_address($email) {\n\t$isValid = true;\n\t$atIndex = strrpos($email, \"@\");\n\tif (is_bool($atIndex) && !$atIndex) {\n\t\t$isValid = false;\n\t}\n\telse {\n\t\t$domain = substr($email, $atIndex+1);\n\t\t$local = substr($email, 0, $atIndex);\n\t\t$localLen = strlen($local);\n\t\t$domainLen = strlen($domain);\n\t\tif ($localLen < 1 || $localLen > 64) {\n\t\t\t// local part length exceeded\n\t\t\t$isValid = false;\n\t\t}\n\t\telse if ($domainLen < 1 || $domainLen > 255) {\n\t\t\t// domain part length exceeded\n\t\t\t$isValid = false;\n\t\t}\n\t\telse if ($local[0] == '.' || $local[$localLen-1] == '.') {\n\t\t\t// local part starts or ends with '.'\n\t\t\t$isValid = false;\n\t\t}\n\t\telse if (preg_match('/\\\\.\\\\./', $local)) {\n\t\t\t// local part has two consecutive dots\n\t\t\t$isValid = false;\n\t\t}\n\t\telse if (!preg_match('/^[A-Za-z0-9\\\\-\\\\.]+$/', $domain)) {\n\t\t\t// character not valid in domain part\n\t\t\t$isValid = false;\n\t\t}\n\t\telse if (preg_match('/\\\\.\\\\./', $domain)) {\n\t\t\t// domain part has two consecutive dots\n\t\t\t$isValid = false;\n\t\t}\n\t\telse if (!preg_match('/^(\\\\\\\\.|[A-Za-z0-9!#%&`_=\\\\/$\\'*+?^{}|~.-])+$/',\n\t\tstr_replace(\"\\\\\\\\\",\"\",$local)))\n\t\t{\n\t\t // character not valid in local part unless \n\t\t // local part is quoted\n\t\t if (!preg_match('/^\"(\\\\\\\\\"|[^\"])+\"$/', str_replace(\"\\\\\\\\\",\"\",$local))) {\n\t\t\t$isValid = false;\n\t\t }\n\t\t}\n\t\tif ($isValid && !(checkdnsrr($domain,\"MX\") || checkdnsrr($domain,\"A\"))) {\n\t\t\t// domain not found in DNS\n\t\t\t$isValid = false;\n\t\t}\n\t}\n\treturn $isValid;\n}", "function verify_email($email) // Colorize: green\n { // Colorize: green\n return isset($email) // Colorize: green\n && // Colorize: green\n is_string($email) // Colorize: green\n && // Colorize: green\n filter_var($email, FILTER_VALIDATE_EMAIL); // Colorize: green\n }", "public function isValidEmail($email){\n\t //If this check fails, there's no need to continue\n\t if(!filter_var($email, FILTER_VALIDATE_EMAIL))\n\t {\n\t\t return false;\n\t }\n\t //extract host\n\t list($user, $host) = explode(\"@\", $email);\n\t //check, if host is accessible\n\t if (!checkdnsrr($host, \"MX\") && !checkdnsrr($host, \"A\"))\n\t {\n\t\t return false;\n\t }\n\t return true;\n\t}", "function email_is_valid($email) {\r\n return preg_match('/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\\.[A-Z]{2,4}$/i',$email);\r\n }", "function validate_email($field_input, array &$field): bool\n{\n $pattern = '/^[_a-z0-9-]+(\\.[_a-z0-9-]+)*@[a-z0-9-]+(\\.[a-z0-9-]+)*(\\.[a-z]{2,})$/i';\n if (!preg_match_all($pattern, $field_input)) {\n $field['error'] = 'Such email address is not valid';\n return false;\n }\n return true;\n}" ]
[ "0.6966614", "0.6859391", "0.6802208", "0.67667645", "0.67315567", "0.66559774", "0.6629751", "0.64451003", "0.64073616", "0.6364619", "0.63584757", "0.6336761", "0.6216026", "0.618738", "0.61807203", "0.6154694", "0.6153108", "0.615177", "0.60563415", "0.6015886", "0.60088754", "0.60028297", "0.6001302", "0.5976965", "0.5975954", "0.59715843", "0.59686315", "0.5955592", "0.5951518", "0.59428936", "0.5941866", "0.5939399", "0.59292483", "0.5923672", "0.5916009", "0.590223", "0.5894917", "0.5889579", "0.5886096", "0.5878623", "0.5867227", "0.5863562", "0.585882", "0.58577406", "0.58442086", "0.5839211", "0.58345574", "0.58345217", "0.58322966", "0.5814969", "0.5803285", "0.5798604", "0.57880086", "0.5783568", "0.5774113", "0.57740426", "0.57676774", "0.57633275", "0.5761019", "0.57591367", "0.57549393", "0.5754559", "0.5750284", "0.5735563", "0.5723367", "0.5721923", "0.571711", "0.5714306", "0.56922746", "0.5686848", "0.5686848", "0.5682435", "0.567967", "0.567967", "0.56751823", "0.56627345", "0.56607074", "0.5657298", "0.5656816", "0.5653997", "0.5651295", "0.5648483", "0.56466615", "0.564534", "0.5643393", "0.56354535", "0.56336457", "0.56333923", "0.5633303", "0.5626469", "0.56262803", "0.56260335", "0.5625881", "0.5620917", "0.561684", "0.56140953", "0.56123596", "0.5612159", "0.5611863", "0.5608704" ]
0.6965745
1
Redirect to another URL
function Redirect($url) { header("Location: $url"); exit; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract protected function redirect();", "public function redirect();", "public function redirect();", "public function redirect();", "abstract protected function redirectTo();", "public function redirectTo();", "public function redirect(string $url, $status_code = 302);", "public function redirect() {\n\n\t\t// @todo. How to handle https?\n\t\t$domain = 'http://'.$_SERVER['HTTP_HOST'];\n\t\t$data = $this->EE->shortee->get_url($domain,$this->EE->input->get('url',true));\n\n\t\tif(!$data) {\n\t\t\t$loc = $this->EE->config->item('site_url');\n\t\t} else {\n\t\t\t$loc = $data['url'];\n\t\t\t$this->EE->shortee->log_view($data['id'],$_SERVER['REMOTE_ADDR']);\n\t\t}\n\n\t\theader(\"Location: \".$loc, true, 302);\n\t\texit;\n\t}", "public function sendRedirect() {}", "public function redirectAction()\n {\n $params = array('key' => $_GET['url']);\n $records = $this->getCollection(self::MONGO_COLLECTION)->find($params);\n\n if ($records->hasNext()) {\n $record = $records->getNext();\n $this->set('redirectTo', $record['target']);\n header('Location: ' . $record['target']);\n } else {\n $this->set('redirectTo', 'http://' . $_SERVER['SERVER_NAME']);\n header('Location: ' . 'http://' . $_SERVER['SERVER_NAME']);\n }\n }", "public function redirect($url){\r\n header(\"location:$url\");\r\n }", "public function mustRedirect();", "function redirect()\n {\n global $wgOut;\n $wgOut->redirect( $this->getRedirectLink(), 302);\n }", "public function redirect($url) {\n header('Location: ' . $url);\n }", "public function redirect(){\r\n\t}", "public function redirect($url){\n header(\"Location: $url\");\n }", "function auth_redirect() {\n\n\t\tauth_redirect();\n\n\t}", "public static function redirectTo($url) {\n header(\"Location: $url\");\n exit;\n }", "function redirect($url){\r\n\t\theader('Location:'.$url, true, 303);\r\n\t}", "public function redirect($url)\r\n {\r\n header('Location: '.$url);\r\n }", "public function setRedirect($url, $code = 302);", "function redirectToUrl($url) {\n redirect_to($url);\n }", "public static function redirect($url){\n\t\theader($url);\n\t\tdie();\n\t}", "function redirectToUrl($url) {\r\n redirect_to($url);\r\n }", "public function redirect($url)\n {\n header(\"Location: $url\");\n }", "public function redirect($url)\n {\n header(\"Location: $url\");\n }", "public function redirect($url)\n {\n header(\"Location: $url\");\n }", "public static function rendirect($url){\n\t \n\t\t header(\"Location: {$url}\");\n exit;\n\t}", "function redirect($url) {\n\tResponder::redirect($url);\n}", "public static function redirect($url = 'index')\n {\n header(\"location: {$url}\");\n }", "public function redirect($url)\n {\n header('Location: http://' . $_SERVER['HTTP_HOST'] . $url, true, 303);\n exit;\n }", "private function redirect(){\n\t\tredirect('browse/office_industrial');//default re-route\n\t}", "public function do_redirect() {\n\t\twp_safe_redirect( $GLOBALS['redirect_to'] );\n\t\texit;\n\t}", "public function redirect($url)\n\t{\n\t\theader(\"Location: $url\");\n\t}", "public function redirect($url)\n {\n header(\"Location: $url\");\n exit;\n }", "function RedirectTo($newlocation){\n\t\theader('location:' . $newlocation);\n\t\texit();\n\t}", "protected function redirect($url) {\n header('Location: ' . $url);\n }", "public function redirect($url) {\r\n ob_start();\r\n header('Location: '. $url);\r\n ob_end_flush();\r\n die();\r\n }", "public function redirect() {\n\n if (isset($_GET['view'])) {\n $view = \"view=\" . $_GET['view'];\n } else {\n $view = \"view=return\";\n }\n\n $return_url = substr(BASE_URL, 0, -12) . 'index.php?' . $view . '&transactionid=' . $_GET['transactionid'];\n header(\"Location: \" . $return_url);\n }", "function _redirect($url)\n {\n header(\"Location: $url\");\n }", "public function redirect($url)\n {\n header('location: ' . $url);\n exit;\n }", "function external_redirect($url){\n header('Location:' . $url);\n //Detiene el flujo\n exit;\n }", "public function redirect($url){\n header(\"Location: /$url\");\n header(\"Connection: close\");\n exit;\n }", "static function goToURL($url) {\n header('Location: ' . $url);\n }", "public static function redirect ($url)\r\n {\r\n header(\"Location: $url\");\r\n exit;\r\n }", "function redirect_to($url = 'index.php')\n\t{\n\t\t$redirect = 'location: ' . $url;\n\t\theader($redirect);\n\t\t\n\t\tdie(); /*halt the execution*/\n\t}", "public function redirect($url)\n {\n ob_get_clean();\n header('Location: '.$url);\n exit();\n }", "protected function redirect($url) {\n header(\"Location: $url\");\n die();\n }", "public function redirect(string $url) {\r\n\t\t\theader(\"location: $url\");\r\n\t\t\tdie();\r\n\t\t}", "static function redirect($url, $arguments = array())\n {\n if (substr($url, 0, 1) == '@')\n {\n global $router;\n $url = $router->generate(substr($url, 1), $arguments);\n }\n\n header(\"location: $url\");\n die();\n }", "public function redirect($path);", "static function redirect($url){\n header( 'Location: '.$url ) ;\n\n }", "public function redirect($url = '', $code = 302)\n {\n $referrer = $this->uri();\n\n if (strpos($referrer, '://') === FALSE)\n {\n $referrer = URL::site($referrer, TRUE, ! empty(Kohana::$index_file));\n }\n\n if (strpos($url, '://') === FALSE)\n {\n // Make the URI into a URL\n $url = URL::site($url, TRUE, ! empty(Kohana::$index_file));\n }\n\n if (($response = $this->response()) === NULL)\n {\n $response = $this->create_response();\n }\n\n echo $response->status($code)\n ->headers('Location', $url)\n ->headers('Referer', $referrer)\n ->send_headers()\n ->body();\n\n // Stop execution\n exit;\n }", "function redirect ($url){\n\t header(\"Location: $url\");\n\t\texit;\n\t}", "public function redirect($url)\n {\n if (strpos($url, '://') === false) //relative URL\n {\n $url = BASE_URL.$url;\n }\n \n header('Location: '.$url); //redirect\n exit;\n }", "public function redirect($url) {\r\n\t\theader('Location: ' . HTMLROOT . $url);\r\n\t\tdie();\r\n\t}", "public static function redirect($url)\n {\n header('Location: ' . Config::PROTOKOL . $_SERVER['HTTP_HOST'] . $url, true, 303);\n exit;\n }", "public function redirect($redirectUrl);", "public static function _redirect($url, $code = 303) {\n self::response(false)\n ->status($code)\n ->header('Location', $url)\n ->write($url)\n ->send();\n }", "function redirect($url) {\n\t\theader('Location: '.$url);\n\t\texit();\n\t}", "function _redirect($url) {\n\theader(\"HTTP/1.1 301 Moved Permanently\");\n\tdheader(\"location: \".str_replace('&amp;', '&', $url));\n\tdexit();\n}", "function redirect($arg){\n $url = BASE_URL.'/'.$arg;\n header(\"HTTP/1.1 301 Moved Permanently\");\n header('Location:'.$url);\n }", "protected function redirectTo()\n {\n //generate URL dynamicaly .\n return '/login'; // return dynamicaly generated URL.\n }", "public static function redirect($url) {\n\n header(\"Location: \" . $url);\n }", "public static function redirect($url)\n {\n header('location: ' . $url);\n }", "function redirect($url)\n\t{\n\t\treturn header(\"Location:\". BASEURL . $url);\n\t}", "protected function redirect($url) {\n\t\theader('Location: ' . str_replace('&amp;', '&', $url));\n\t\tdie();\n\t}", "public function redirect($url)\r\n {\r\n header(\"Location: /$url\"); \r\n header(\"Connection: close\");\r\n exit;\r\n }", "public static function redirect($url){\n header('Location: '.$url);\n die(\"Redirecting to page <a href='\".$url.\"'>\".$url.\"</a>\");\n }", "function redirect($url){\n if (headers_sent()){\n die('<script type=\"text/javascript\">window.location.href=\"' . $url . '\";</script>');\n }else{\n header( \"refresh:3;url=\".$url );\n die();\n } \n }", "public function redirect($url = null)\n {\n if ($url <> null) {\n header(\"Location: {$url}\");\n exit(0);\n }\n }", "public function redirect(string $url)\n {\n return exit(header('Location:'. $url));\n }", "public function doRedirect() {\n if(is_null($this->redirect)) {\n return;\n }\n\n if(is_string($this->redirect)) {\n $this->setHeader(\"Location: \" . $this->redirect);\n }\n\n if(is_array($this->redirect)) {\n $url = '/?' . http_build_query($this->redirect);\n $this->setHeader(\"Location: \" . $url);\n }\n return;\n }", "public static function redirect($url)\n {\n echo '<script type=\"text/javascript\">document.location.href=\"' . $url . '\";</script>';\n exit;\n }", "function http_redirect($url = null, ?array $params = null, $session = null, $status = null) {}", "function url_redirect($to)\n{\n\theader(\"Location: $to\");\n}", "public function handle_redirection()\n {\n }", "function redirect($url=null)\n\t{\n\t\tif (is_null($url))\n\t\t\t$url = $_SERVER['PHP_SELF'];\n\t\theader(\"Location: $url\");\n\t\texit();\n\t}", "public function redirect($url = '', $code = 302)\n\t{\n\t\tif (strpos($url, '://') === FALSE)\n\t\t{\n\t\t\t// Make the URI into a URL\n\t\t\t$url = URL::site($url, TRUE);\n\t\t}\n\n\t\t// Set the response status\n\t\t$this->status = $code;\n\n\t\t// Set the location header\n\t\t$this->headers['Location'] = $url;\n\n\t\t// Send headers\n\t\t$this->send_headers();\n\n\t\t// Stop execution\n\t\texit;\n\t}", "public static function redirect($url, $base = SELF_URL){\r\n header('Location: '.self::getAbsoluteURL($url, $base));\r\n\t\texit;\r\n\t}", "public function go($url)\r\n {\r\n header('Location: '.$url);\r\n }", "function RedirectToURL($url)\n {\n header(\"Location: $url\");\n exit;\n }", "private static function redirect()\n {\n $files = ['Redirector', 'Redirect'];\n $folder = static::$root.'Http/Redirect'.'/';\n\n self::call($files, $folder);\n }", "function redirectTo($url) {\n header('HTTP/1.1 301 Moved Permanently');\n header('Location: ' . $url);\n}", "public function redirect($url, $code = null)\n\t{\n\t\tUrl::redirect($url, $code);\n\t}", "function redirect($url) {\n $url = get_path($url);\n header(\"location: $url\");\n exit();\n}", "function redirect(string $to)\n{\n URL::go($to);\n}", "protected abstract function redirect(Response $response);", "public function redirecturl()\n\t\t\t{\n\t\t\t\tif($this->fields_arr['pcakey'])\n\t\t\t\t Redirect2URL($_SESSION['pcakey'][$this->fields_arr['pcakey']]);\n\t\t\t}", "public function redirect(): void\n {\n $this->admin->redirect($this->redirect, $this->redirectCode);\n }", "function redirect($url)\r\r\n {\r\r\n global $wp_rewrite, $wpdb, $hyper_cache_stop;\r\r\n //disable Hyper Cache plugin (http://www.satollo.net/plugins/hyper-cache) from caching this page\r\r\n $hyper_cache_stop = true;\r\r\n //disable WP Super Cache caching\r\r\n if (!defined('DONOTCACHEPAGE'))\r\r\n define('DONOTCACHEPAGE', 1);\r\r\n\r\r\n if ($this->options['base64']) {\r\r\n $url = base64_decode($url);\r\r\n } elseif ($this->options['maskurl']) {\r\r\n $sql = 'select url from ' . $wpdb->prefix . 'masklinks where id= %s limit 1';\r\r\n $url = $wpdb->get_var($wpdb->prepare($sql, addslashes($url)));\r\r\n }\r\r\n die('<a href=\"' . $url . '\">just click the link!</a>');\r\r\n }", "protected function do_redirect($url, $code = 302) {\n header(\"Location: $url\", true, $code);\n exit;\n }", "function redirectTo($url = \"\") {\n\tif (empty($url)) $url = $_SERVER['REQUEST_URI'];\n\theader(\"Location: \" . $url);\n\texit();\n}", "public function redirectToExternalUrl() {}", "public function redirectAction()\n {\n $model = new KBariotis_NBP_Model_NBP();\n\n $redirectUrl = $model->getRedirectUrl();\n\n if ($redirectUrl)\n $this->_redirectUrl($redirectUrl);\n else\n $this->_redirectUrl(Mage::getUrl('checkout/onepage/failure'));\n }", "function redirect($url) {\n ob_start();\n header('Location: '.$url);\n ob_end_flush();\n die();\n }", "function Redirect($url, $permanent = false)\n {\n header('Location: ' . $url, true, $permanent ? 301 : 302);\n exit();\n }", "public static function redirect($url=\".\", $code = 302) {\r\n\t\tstatic::statusCode($code);\r\n\t\tif ($url=='.') $url = isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : '/';\r\n\t\theader(\"Location: {$url}\");\r\n\t\texit;\r\n\t}", "protected function processRedirect() {}", "static public function redirect(string $url)\n {\n header(\"location: $url\");\n exit;\n }", "protected function redirect($params) {\r\n\t\t$url = Router::reverse($this->prepare($params));\r\n\t\tif ($this->options['permanent']) {\r\n\t\t\t$code = 301;\r\n\t\t\t$status = 'Moved Permanently';\r\n\t\t} else {\r\n\t\t\t$code = 302;\r\n\t\t\t$status = 'Found';\r\n\t\t}\r\n\t\t$this->header('HTTP/1.1 ' . $code . ' ' . $status);\r\n\t\t$this->header('Location: ' . $url);\r\n\t\t$this->_stop();\r\n\t}" ]
[ "0.8113676", "0.8060218", "0.8060218", "0.8060218", "0.804037", "0.77344865", "0.76604307", "0.76601577", "0.76575154", "0.7584802", "0.7563687", "0.7501449", "0.74307597", "0.7413396", "0.740733", "0.7400592", "0.739393", "0.7362747", "0.7343829", "0.7339327", "0.7293042", "0.72857493", "0.728072", "0.72774816", "0.7269109", "0.7269109", "0.7269109", "0.72525257", "0.725182", "0.72456574", "0.72362703", "0.72361565", "0.7232043", "0.7205183", "0.72012746", "0.7191356", "0.7180827", "0.71749455", "0.71675366", "0.71605676", "0.71489054", "0.7148865", "0.7126833", "0.71249205", "0.7114775", "0.7114055", "0.7098364", "0.70921904", "0.70849466", "0.7084877", "0.70793027", "0.7073546", "0.7070468", "0.7069956", "0.7065346", "0.7064568", "0.70588166", "0.70441705", "0.7043602", "0.7042375", "0.7041924", "0.7041849", "0.70418274", "0.70415026", "0.70386493", "0.70192504", "0.70121473", "0.70094174", "0.7007631", "0.70025086", "0.70012575", "0.70005614", "0.6999166", "0.6998952", "0.699663", "0.69952357", "0.699408", "0.69876814", "0.6979148", "0.6975717", "0.69696075", "0.6968999", "0.6958793", "0.6954528", "0.69539815", "0.6950635", "0.6950253", "0.6944803", "0.6943751", "0.69427097", "0.69394624", "0.6932761", "0.6932476", "0.6921505", "0.69207877", "0.69206595", "0.6919425", "0.6917025", "0.6903069", "0.69027615", "0.68948364" ]
0.0
-1
Send an alert email
function SendAlert($error) { global $SPECIAL_VALUES,$FORMATTED_INPUT,$FROM_USER,$sServerVars; $alert_to = $SPECIAL_VALUES["alert_to"]; if (empty($alert_to)) $alert_to = DEF_ALERT; if (!empty($alert_to)) { $from = $headers = ""; if (isset($FROM_USER)) { if ($FROM_USER != "NONE") $headers = $from = "From: $FROM_USER"; } else $headers = $from = "From: FormMail@".$sServerVars['SERVER_NAME']; $mesg = "To: ".UnMangle($alert_to).BODY_LF; if (!empty($from)) $mesg .= $from.BODY_LF; $mesg .= BODY_LF; $mesg .= "This error occurred in the script: $error".BODY_LF; $mesg .= implode(BODY_LF,$FORMATTED_INPUT); SendMail($alert_to,"FormMail script error",$mesg,$headers); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract public function sendAlert( );", "public function sendAlert($text) {\n\t\twp_mail( get_bloginfo('admin_email'), 'Alert from '.get_bloginfo('name'), $text );\n\t}", "public function sendAlertEmail($data){\r\n\r\n\t\t$destinations = Configure::read('Alert.Email');\r\n\r\n\t\t$subject = __('Top Menu - Alert System');\r\n\r\n\t\tforeach ($destinations as $destination) {\r\n\t\t\t$this->sendEmail(\r\n\t\t\t\t$destination,\r\n\t\t\t\t$subject,\r\n\t\t\t\t$data,\r\n\t\t\t\tarray(\r\n\t\t\t\t\t'template' => 'alert'\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\t\tusleep(250000);\r\n\t\t}\r\n\t}", "function alertAdmin($subj,$msg) {\n global $cfg;\n $to=$cfg?$cfg->getAdminEmail():ADMIN_EMAIL;\n $from=$cfg?$cfg->getAlertEmail():ADMIN_EMAIL;\n //Send alert to admin.\n Misc::sendmail($to,$subj,$msg,$from); \n }", "public function sendTheEmailNow()\r\n {\r\n echo \"Email sent.\";\r\n }", "public function sendEmailVerificationNotification();", "public function sendEmailVerificationNotification()\n { \n \n $this->notify(new ConfirmEmail); \n \n }", "static public function send_notify_email( $alertMessage )\n {\n $options = get_option( self::$settings_option_field ); // Get settings\n\n // Build email subject and allow to be filtered\n $subject = apply_filters(\"sc_wpfmp_format_email_subject\", sprintf( __( \"WordPress File Monitor Plus: Alert (%s)\", \"wordpress-file-monitor-plus\" ), site_url() ) );\n\n // Add filters for sending email\n add_filter( 'wp_mail_from', array( __CLASS__, 'sc_wpfmp_wp_mail_from' ) );\n add_filter( 'wp_mail_from_name', array( __CLASS__, 'sc_wpfmp_wp_mail_from_name' ) );\n add_filter( 'wp_mail_content_type', array( __CLASS__, 'sc_wpfmp_wp_mail_content_type' ) );\n\n // Send email\n wp_mail( $options['notify_address'], $subject, $alertMessage );\n\n // Remove previously added filters so not to be in place for other plugins\n remove_filter( 'wp_mail_from', array( __CLASS__, 'sc_wpfmp_wp_mail_from' ) );\n remove_filter( 'wp_mail_from_name', array( __CLASS__, 'sc_wpfmp_wp_mail_from_name' ) );\n remove_filter( 'wp_mail_content_type', array( __CLASS__, 'sc_wpfmp_wp_mail_content_type' ) );\n }", "function SendAlertEmail($email, $sessionID, $deviceName, $deviceID, $distance, $sessionLength, $averageSpeed, $highestSpeed) {\n $BASE_URL = \"{{BASE_URL}}\"; // Place URL to skate_sessions.php page here\n $URL = $BASE_URL . \"?sessionID=$sessionID&deviceID=$deviceID\";\n\n $headers = \"MIME-Version: 1.0\\r\\n\";\n $headers .= \"Content-type:text/html;charset=UTF-8\\r\\n\";\n $headers .= \"From: 'IoT Arduino Skate App' <{{SENDER_EMAIL}}>\";\n\n $subject = \"Skate Session # $sessionID\";\n\n $message = \"<div style='background-color:#eee;padding:10px 10px 5px 10px'>\";\n $message .= \"<div style='font-family:Verdana;font-size:14px;background-color:#a2c2d8;padding:30px;border-radius:4px;'>\";\n $message .= \"<h1 style='text-align:center'>Your new skate session data from $deviceName is ready.</h1><br>\";\n $message .= \"<div style='width:100%;height:2px;background-color:#555;margin-bottom:20px;'></div>\";\n $message .= \"Here is a quick run down on the stats from your skate:<br>\";\n $message .= \"<ul>\";\n $message .= \"<li>Total Time: $sessionLength Seconds</li>\";\n $message .= \"<li>Total Distance: $distance KM</li>\";\n $message .= \"<li>Average Speed: $averageSpeed KM/H</li>\";\n $message .= \"<li>Highest Speed: $highestSpeed KM/H</li>\";\n $message .= \"</ul>\";\n $message .= \"Click the following link to view your full skate data.<br><br>\";\n $message .= \"<div style='text-align:center'>\";\n $message .= \"<a href='$URL' style='background-color:#555;padding:8px 12px;border-radius:4px;color:white;\n text-decoration:none;font-weight:bold;font-size:18px;display:block'>Skate Session #$sessionID</a>\";\n $message .= \"</div>\";\n $message .= \"</div>\";\n $message .= \"<div style='text-align:center;color:#555;margin-top:20px;'>\";\n $message .= \"<small>Arduino Longboard Project</small>\";\n $message .= \"</div>\";\n $message .= \"</div>\";\n\n mail($email, $subject, $message, $headers); // Send email\n }", "function eddc_email_alert( $user_id, $commission_amount, $rate, $download_id, $commission_id ) {\n\tif ( edd_get_option( 'edd_commissions_disable_sale_alerts', false ) ) {\n\t\treturn;\n\t}\n\n\tif ( get_user_meta( $user_id, 'eddc_disable_user_sale_alerts', true ) ) {\n\t\treturn;\n\t}\n\n\t/* send an email alert of the sale */\n\t$user = get_userdata( $user_id );\n\t$email = $user->user_email; // set address here\n\t$subject = edd_get_option( 'edd_commissions_email_subject', __( 'New Sale!', 'eddc' ) );\n\t$message = edd_get_option( 'edd_commissions_email_message', eddc_get_email_default_body() );\n\n\t// Parse template tags\n\t$message = eddc_parse_template_tags( $message, $download_id, $commission_id, $commission_amount, $rate );\n\t$message = apply_filters( 'eddc_sale_alert_email', $message, $user_id, $commission_amount, $rate, $download_id, $commission_id );\n\n\tif ( class_exists( 'EDD_Emails' ) ) {\n\t\tEDD()->emails->__set( 'heading', $subject );\n\t\tEDD()->emails->send( $email, $subject, $message );\n\t} else {\n\t\t$from_name = apply_filters( 'eddc_email_from_name', $from_name, $user_id, $commission_amount, $rate, $download_id );\n\n\t\t$from_email = edd_get_option( 'from_email', get_option( 'admin_email' ) );\n\t\t$from_email = apply_filters( 'eddc_email_from_email', $from_email, $user_id, $commission_amount, $rate, $download_id );\n\n\t\t$headers = \"From: \" . stripslashes_deep( html_entity_decode( $from_name, ENT_COMPAT, 'UTF-8' ) ) . \" <$from_email>\\r\\n\";\n\n\t\twp_mail( $email, $subject, $message, $headers );\n\t}\n}", "public function send_email() {\n $toemail = $this->params['toemail'];\n $subject = $this->params['subject'];\n $content = $this->params['content'];\n }", "private function sendEmail()\n {\n try {\n \\Illuminate\\Support\\Facades\\Mail::to(config('redis-driver-fallback.email_config.to', config('mail.username')))\n ->send(new AlertEmail())\n ->subject('Redis Cache Driver fails');\n } catch (\\Exception $e) {\n Log::debug(__METHOD__, ['ERROR' => $e]);\n throw $e;\n }\n }", "public function sendEmailVerificationNotification()\n {\n $this->notify(new VerifyEmail); // my notification\n }", "public function sendEmail(): void\n {\n echo 'email sent';\n }", "protected function sendTestMail() {}", "protected function send_alert_emails($emails) {\n global $USER, $CFG;\n\n if (!empty($emails)) {\n\n $url = new moodle_url($CFG->wwwroot . '/mod/simplecertificate/view.php',\n array('id' => $this->coursemodule->id, 'tab' => self::ISSUED_CERTIFCADES_VIEW));\n\n foreach ($emails as $email) {\n $email = trim($email);\n if (validate_email($email)) {\n $destination = new stdClass();\n $destination->email = $email;\n $destination->id = rand(-10, -1);\n\n $info = new stdClass();\n $info->student = fullname($USER);\n $info->course = format_string($this->get_instance()->coursename, true);\n $info->certificate = format_string($this->get_instance()->name, true);\n $info->url = $url->out();\n $from = $info->student;\n $postsubject = get_string('awardedsubject', 'simplecertificate', $info);\n\n // Getting email body plain text.\n $posttext = get_string('emailteachermail', 'simplecertificate', $info) . \"\\n\";\n\n // Getting email body html.\n $posthtml = '<font face=\"sans-serif\">';\n $posthtml .= '<p>' . get_string('emailteachermailhtml', 'simplecertificate', $info) . '</p>';\n $posthtml .= '</font>';\n\n @email_to_user($destination, $from, $postsubject, $posttext, $posthtml); // If it fails, oh well, too bad.\n }// If it fails, oh well, too bad.\n }\n }\n }", "public function sendNotifyEmail()\n {\n\t\t$emailSettings = craft()->email->getSettings();\n\n //create the template params\n $templateParams = $this->data;\n $templateParams['toEmail'] = $this->template->notifyEmailToAddress;\n\n //instantiate email model\n $email = new EmailModel();\n\n //populate with all the things\n $email->fromEmail = $this->template->notifyEmailToAddress;\n\t\t$email->toEmail = $this->template->notifyEmailToAddress;\n\t\t$email->subject = $this->template->notifyEmailSubject;\n\t\t$email->htmlBody = $this->template->notifyEmailBody;\n\n //send that goodness\n\t\treturn craft()->email->sendEmail($email, $templateParams);\n }", "public function sendVerificationMail()\n {\n\n $this->notify(new VerifyEmail($this));\n\n }", "public function actionEmailTest() {\n Yii::$app->mailer->compose()\n ->setFrom([Yii::$app->params['supportEmail'] => Yii::$app->name])\n ->setTo(\"[email protected]\")\n ->setSubject(\"test subject\")\n ->setHtmlBody(\"test body\")\n ->send();\n return CommonApiHelper::return_success_response(\"success\", \"success\", []);\n }", "public function sendEmailVerificationNotification()\n {\n $this->notify( new VerifyEmail() ); # 새로 만든 VerifyEmail Notification 발송\n }", "public function sendEmailVerificationNotification(){\n $this->notify(new VerifyEmail);\n }", "public function sendEmailVerificationNotification()\n {\n $this->notify(new AdminEmailVerificationNotification);\n }", "public function confirmationEmail()\n {\n $email = new Email;\n $email->sendEmail('submitted', 'applicant', Auth::user()->email);\n }", "public function mail()\n {\n if(!(php_sapi_name() == 'cli-server'))\n return 403;\n\n import('SurveyMailer');\n\n $mailer = new SurveyMailer();\n $mailer->send();\n //$mailer->sendForParticipant(with(new SurveyMatcher())->getParticipantById(1));\n }", "public function sendEmailVerificationNotification()\n {\n $this->notify(new EmailVerification('admin'));\n }", "public function sendEmailVerificationNotification()\n {\n $this->notify(new EmailVerification('networking_agent'));\n }", "public function sendEmailVerificationNotification()\n {\n $this->notify( new VerifyEmailNotification );\n }", "public function sendEmail()\n {\n $templateId = 'email_delivery_time'; // template id\n $fromEmail = '[email protected]'; // sender Email id\n $fromName = 'Admin'; // sender Name\n $toEmail = '[email protected]'; // receiver email id\n\n try {\n $storeId = $this->storeManager->getStore()->getId();\n\n $from = ['email' => $fromEmail, 'name' => $fromName];\n// $this->inlineTranslation->suspend();\n try {\n// $transport = $this->transportBuilder\n// ->setTemplateIdentifier($templateId)\n// ->setTemplateVars([])\n// ->setTemplateOptions(\n// [\n// 'area' => Area::AREA_FRONTEND,\n// 'store' => $storeId\n// ]\n// )\n// ->setFromByScope($from)\n// ->addTo($toEmail)\n// ->getTransport();\n//\n// $transport->sendMessage();\n $templateVars = [];\n $transport = $this->transportBuilder->setTemplateIdentifier('59')\n ->setTemplateOptions( [ 'area' => \\Magento\\Framework\\App\\Area::AREA_FRONTEND, $storeId => 1 ] )\n ->setTemplateVars( $templateVars )\n ->setFrom( [ \"name\" => \"Magento ABC CHECK PAYMENT\", \"email\" => \"[email protected]\" ] )\n ->addTo('[email protected]')\n ->setReplyTo('[email protected]')\n ->getTransport();\n $transport->sendMessage();\n } finally {\n $this->inlineTranslation->resume();\n }\n } catch (\\Exception $e) {\n $this->_logger->info($e->getMessage());\n }\n }", "public function sendmailAction()\r\n\t{\r\n\t\t$email = $this->getRequest()->getParam('email');\r\n\t\t$this->view->email = $email;\r\n\t\t$url = $this->getRequest()->getParam('url');\r\n\t\t$this->view->url = $url;\r\n\t\t$to = $email;\r\n\t\t$subject = \"Bạn của bạn chia sẻ một bài viết rất hay!\";\r\n\t\t$message = \"Bạn của bạn chia sẻ một bài viết rất hay. Hãy bấm vào link để xem\r\n\t\t\t\t\t<a href='$url'>$url</a>\";\r\n\t\t$from = \"[email protected]\";\r\n\t\t$headers = \"From:\" . $from;\r\n\t\tmail($to,$subject,$message,$headers);\r\n\t\t$this->_helper->layout->disableLayout();\r\n\t}", "public function send_confirm_mail($userDetails = '') {\n //Send email to user\n }", "function notify($asset, $asset_id , $expiry_type, $expiry_date , $mail , $sent_to , $ticket_id,$left){\n\t\t\n\t\t\t$today = date(\"Y-m-d\");\n\t\t\n\t\t\t$imgSrc = 'http://www.nhc-ksa.com/images/logo1.png'; // Change image src to your site specific settings\n\t\t\t$imgDesc = 'Logo'; // Change Alt tag/image Description to your site specific settings\n\t\t\t$imgTitle = 'Logo'; // Change Alt Title tag/image title to your site specific settings\n\t\t\n\t\t\t$subjectPara1 = '<h3>The '.$expiry_type.' expiring shortly.</h3>';\n\t\t\t$subjectPara2 = 'The '.$expiry_type.' expiry for asset : '.$asset.' (ID : '.$asset_id.' ) is on '.$expiry_date.' ('.$left.' days left).Kindly take necessary action.';\n\t\t\t$subjectPara3 = 'A ticket is opened under ID : ' . $ticket_id;\n\t\t\t$subjectPara4 = NULL;\n\t\t\t$subjectPara5 = NULL;\n\t\t\n\t\t\t$message = '<!DOCTYPE HTML>'.\n\t\t\t\t\t'<head>'.\n\t\t\t\t\t'<meta http-equiv=\"content-type\" content=\"text/html\">'.\n\t\t\t\t\t'<title>Email notification</title>'.\n\t\t\t\t\t'</head>'.\n\t\t\t\t\t'<body>'.\n\t\t\t\t\t'<div id=\"header\" style=\"width: 80%;height: 60px;margin: 0 auto;padding: 10px;color: #fff;text-align: center;font-family: Open Sans,Arial,sans-serif;\">'.\n\t\t\t\t\t'<img height=\"50\" width=\"220\" style=\"border-width:0\" src=\"'.$imgSrc.'\" alt=\"'.$imgDesc.'\" title=\"'.$imgTitle.'\">'.\n\t\t\t\t\t'</div>'.\n\t\t\n\t\t\t\t\t'<div id=\"outer\" style=\"width: 80%;margin: 0 auto;margin-top: 10px;\">'.\n\t\t\t\t\t'<div id=\"inner\" style=\"width: 78%;margin: 0 auto;background-color: #fff;font-family: Open Sans,Arial,sans-serif;font-size: 13px;font-weight: normal;line-height: 1.4em;color: #444;margin-top: 10px;\">'.\n\t\t\t\t\t'<p>'.$subjectPara1.'</p>'.\n\t\t\t\t\t'<p>'.$subjectPara2.'</p>'.\n\t\t\t\t\t'<p>'.$subjectPara3.'</p>'.\n\t\t\t\t\t'<p>'.$subjectPara4.'</p>'.\n\t\t\t\t\t'<p>'.$subjectPara5.'</p>'.\n\t\t\t\t\t'</div>'.\n\t\t\t\t\t'</div>'.\n\t\t\n\t\t\t\t\t'<div id=\"footer\" style=\"width: 80%;height: 40px;margin: 0 auto;text-align: center;padding: 10px;font-family: Verdena;\">'.\n\t\t\t\t\t'All rights reserved @ assets-newhorizons 2014'.\n\t\t\t\t\t'</div>'.\n\t\t\t\t\t'</body>';\n\t\t\n\t\t\t/*EMAIL TEMPLATE ENDS*/\n\t\t\n \t\t\t$subject = 'Notification alert ('.$asset_id.'/'.$ticket_id.'): '.$expiry_type .' expiring on '.$expiry_date.' for Asset ID : '.$asset_id.', Ticket ID: '.$ticket_id.'.'; //change subject of email\n\t\t\t//$mail->SMTPDebug = 3; // Enable verbose debug output\n \t\t\t$mail->ClearAllRecipients( );// clear all\n\t\t\t$mail->isSMTP(); // Set mailer to use SMTP\n\t\t\t$mail->Host = 'ssl://smtp.gmail.com'; // Specify main and backup SMTP servers\n\t\t\t$mail->SMTPAuth = true; // Enable SMTP authentication\n\t\t\t $mail->Username = '[email protected]'; // SMTP username\n\t\t\t $mail->Password = '123qweASD!'; // SMTP password\n\t\t\t$mail->SMTPSecure = 'ssl'; // Enable TLS encryption, `ssl` also accepted\n\t\t\t$mail->Port = 465; // TCP port to connect to\n\t\t\n\t\t\t$mail->From = '[email protected]';\n\t\t\t$mail->FromName = 'Assets-NewHorizons';\n\t\t\t$mail->addAddress($sent_to, 'Recipient'); // Add a recipient\n\t\t\t//$mail->addAddress('[email protected]'); // Name is optional\n\t\t\t//$mail->addReplyTo('[email protected]', 'Information');\n\t\t\t//$mail->addCC('[email protected]');\n\t\t\t//$mail->addBCC('[email protected]');\n\t\t\n\t\t\t$mail->WordWrap = 500; // Set word wrap to 50 characters\n\t\t\t//$mail->addAttachment('/var/tmp/file.tar.gz'); // Add attachments\n\t\t\t//$mail->addAttachment('/tmp/image.jpg', 'new.jpg'); // Optional name\n\t\t\t$mail->isHTML(true); // Set email format to HTML\n\t\t\n\t\t\t$mail->Subject = $subject;\n\t\t\t//$mail->Subject = $subject. date(\"Y-m-d h:i:s\");\n\t\t\t$mail->Body = $message;\n\t\t\t$mail->AltBody = 'This is the body in plain text for non-HTML mail clients';\n\t\t\n\t\t\t$a = 1;\n\t\t\n\t\tif(!$mail->send()) {\n\t//if($a != 1) {\n\t\t\t\techo 'Message could not be sent.';\n\t\t\t\techo 'Mailer Error: ' . $mail->ErrorInfo;\n\t\t\t} else {\n\t\t\t\t\n \t\t\t\techo '<b>Send for asset id ' . $asset_id . ' to '.$sent_to . ' OPENED TICKET ID IS :'. $ticket_id.' </b><br>';\n \t\t\t\n\t\t\t\t \t\t\t}\n\t\t}", "public function sendAction() {\n __mail::send('[email protected]', '[email protected]', 'title', 'me', 'hello world');\n\n return false;\n }", "public function sendWelcomeEmail()\n {\n SendEmailJob::dispatch($this, 'confirm-email', 'Confirm Your Email', [])->onQueue('account-notifications');\n }", "protected function sendMail()\n {\n $user = User::find()\n ->where(['id' => $this->user->id])\n ->one();\n\n $notificationManager = new MailService($user);\n $notificationManager->register();\n }", "public function sendActivationEmail()\n\t{\n\t\t$mailData = [\n\t\t\t'to' => $this->email,\n\t\t\t'from' => '[email protected]',\n\t\t\t'nameFrom' => 'Peter Štovka'\n\t\t];\n\n\n\t\tMail::send('email.activation', ['token' => $this->token], function ($message) use ($mailData) {\n\t\t\t$message->to($mailData['to'], 'Aktivačný email')\n\t\t\t\t->subject('Aktivácia účtu')\n\t\t\t\t->from($mailData['from'], $mailData['nameFrom']);\n\t\t});\n\t}", "public function sendRestoreEmail();", "public function sendEmailVerificationNotification()\n {\n $this->notify(new VerifyEmailNotification);\n }", "public function sendEmailVerificationNotification()\n {\n $this->notify(new VerifyEmailNotification);\n }", "function emailTrigger ( $subject, $to ) {\n\t$to = '[email protected]' ;\n\t$subject = \"HTML email\";\n\n\t$message = \"\n<html>\n<head>\n<title>HTML email</title>\n</head>\n<body>\";\n\t$message .=\"</body>\n</html>\n\";\n\t$headers = \"MIME-Version: 1.0\" . \"\\r\\n\";\n\t$headers .= \"Content-type:text/html;charset=iso-8859-1\" . \"\\r\\n\";\n\tmail($to,$subject,$message,$headers);\n}", "public function email()\n\t{\n\t\t$email = trim($this->input->post('email'));\n\t\t$title = trim($this->input->post('subject'));\n\t\t$message = trim($this->input->post('message'));\n\n\t\t$this->load->helper('email_helper');\n\n\t\t$to = $email;\n\t\t$subject = 'Interview Message | OnJob Portal';\n\t\t$message = '<p>Subject: '.$title.'</p>\n\t\t<p>Message: '.$message.'</p>' ;\n\n\t\t$email = sendEmail($to, $subject, $message, $file = '' , $cc = '');\n\t\t\n\t\tif(trim($email)=='success'){\n\t\t\techo 'Email has been sent successfully';\n\t\t}else {\n\t\t\techo 'There is a problem while sending email';\n\t\t}\n\t}", "public function sendEmailVerificationNotification()\n {\n $this->notify(new VerifyEmail);\n }", "public function sendEmailVerificationNotification()\n {\n $this->notify(new VerifyEmail);\n }", "public function sendEmailVerificationNotification()\n {\n $this->notify(new VerifyEmail);\n }", "public function sendEmailVerificationNotification()\n {\n $this->notify(new VerifyEmail);\n }", "public function sendEmailVerificationNotification()\n {\n $this->notify(new VerifyEmail);\n }", "public function sendEmailVerificationNotification()\n {\n $this->notify(new VerifyEmail);\n }", "public function sendEmailVerificationNotification()\n {\n $this->notify(new VerifyEmail);\n }", "public function sendEmail($e) {\n $config = $e->getParam('email-notification-config');\n\n // Set up ViewModel and template for rendering\n $viewModel = new ViewModel();\n $template = array_keys($config['template_map'])[0];\n $viewModel->setTemplate($template);\n\n // get template map (must contain the template specified above!\n $templateMap = $config['template_map'];\n\n // render email template\n $phpRenderer = new PhpRenderer();\n $aggregateResolver = new AggregateResolver();\n $aggregateResolver->attach(new TemplateMapResolver($templateMap));\n $phpRenderer->setResolver($aggregateResolver);\n // assign values from params passed by the trigger\n foreach ($config['email-options'] as $key => $value) {\n $viewModel->setVariable($key, $value);\n }\n\n // Create the HTML body\n $html = new Part($phpRenderer->render($viewModel));\n $html->type = Mime::TYPE_HTML;\n $html->charset = 'utf-8';\n $html->encoding = Mime::ENCODING_QUOTEDPRINTABLE;\n $body = (new MimeMessage())->setParts([$html]);\n $message = (new Message())\n ->addTo($config['email-options']['to'])\n ->addFrom($config['email-options']['from'])\n ->setSubject($config['email-options']['subject'])\n ->setBody($body)\n ->setEncoding('UTF-8');\n $transport = $this->container->get('email-notification-transport-file');\n NotificationEvent::$success = true;\n $transport->send($message);\n }", "public function actionSendConfirmationEmail() {\n\n\t\t$userId = User::checkLogged();\n\t\t$confirmation = User::generateConfirmationCode($userId);\n\t\t$subject = \"Confirm your account on JustRegMe\";\n\t\t$bodyPath = ROOT . '/template/email/confirmation.php';\n\t\t$body = include($bodyPath); //loads HTML-body from template\n\t\t\n\t\techo User::sendEmail($userId, $subject, $body);\n\n\t}", "public function sendEmailVerificationNotification()\n {\n $this->notify(new VerifyEmail());\n }", "public function sendEmailVerificationNotification()\n {\n $this->notify(new VerifyEmail());\n }", "public function sendEmailVerificationNotification()\n {\n $this->notify(new VerifyEmail());\n }", "public function sendActivationEmail(){\n\t\t// generate the url\n\t\t$url = 'http://'.$_SERVER['HTTP_HOST'].'/signup/activate/'.$this->activation_token;\n\t\t$text = View::getTemplate('Signup/activation_email.txt', ['url' => $url]);\n\t\t$html = View::getTemplate('Signup/activation_email.html', ['url' => $url]);\n\t\t\n\t\tMail::send($this->email, 'Account_activation', $text, $html);\n\t}", "public function sendEmail()\n {\n SendEmailMessage::dispatch($this->address, $this->messageString);\n }", "public function send() {\n $to = Yii::app()->params['adminEmail'];\n $subject = $this->subject;\n $message = $this->body;\n @mail($to, $subject, $message);\n }", "public function sendTestMail()\n {\n $newsletterId = intval($_POST['newsletterId']);\n $email = $_POST['emailAddress'];\n\n // Get the preview to generate the mail\n $html = $this->core->getPreviewComponent()->renderPreview($newsletterId);\n $mail = External::PhpMailer();\n $mail->Subject = '[Test] ' . $this->get($newsletterId, 'mailSubject');\n $mail->Body = $html;\n $mail->AddAddress($email);\n\n // Send a simple mail\n WordPress::sendJsonResponse(array(\n 'success' => $mail->Send()\n ));\n }", "public function email()\r\n {\r\n require '../../vendor/autoload.php';\r\n\r\n\r\n # Instantiate the client.\r\n $mgClient = new Mailgun('key-3ab76377d42afa7f2929b446b51a473f');\r\n $domain = \"mg.blogdotexe.co.uk\";\r\n\r\n # Make the call to the client.\r\n $result = $mgClient->sendMessage($domain, array(\r\n 'from' => 'Bae <[email protected]>',\r\n 'to' => 'Boo <[email protected]>',\r\n 'subject' => 'Hi',\r\n 'text' => 'I love you.',\r\n 'html' => '<b>I love you.</b>'\r\n ));\r\n }", "public function sendConfirmEmail()\n {\n\t\t$emailSettings = craft()->email->getSettings();\n\n //create the template params\n $templateParams = $this->data;\n $templateParams['toEmail'] = $this->toEmail;\n\n //instantiate email model\n $email = new EmailModel();\n\n //populate with all the things\n //for testing\n $email->fromEmail = $emailSettings['emailAddress'];\n\t\t$email->toEmail = $this->template->notifyEmailToAddress;\n\t\t$email->subject = $this->template->confirmEmailSubject;\n\t\t$email->body = $this->template->confirmEmailBody;\n\n //send that goodness\n\t\treturn craft()->email->sendEmail($email, $templateParams);\n\n }", "public function sendEmailVerificationNotification()\n {\n $this->notify(new CustomVerifyEmail);\n }", "private function sendEmails()\r\n {\r\n $user_body = \"Hi,<br>A new comment was added to the following article:\\n\";\r\n $user_body .= '<a href=\"http://'.$this->config->getModuleVar('common', 'site_url').'/id_article/'.$this->viewVar['article']['id_article'].'\">'.$this->viewVar['article']['title'].\"</a>\\n\";\r\n\r\n $_tmp_error = array();\r\n $user_text_body = strip_tags($user_body);\r\n\r\n $this->model->action( 'common', 'mailSendTo',\r\n array('charset' => $this->viewVar['charset'],\r\n 'bodyHtml' => & $user_body,\r\n 'bodyText' => & $user_text_body,\r\n 'to' => array(array('email' => '[email protected]',\r\n 'name' => 'Armand Turpel')),\r\n 'subject' => \"Open Publisher Blog Entry\",\r\n 'fromEmail' => '[email protected]',\r\n 'fromName' => '[email protected]',\r\n 'error' => & $_tmp_error\r\n ));\r\n\r\n }", "function mail() {\n try {\n Mailer::setConfig(\n array(\n \"mailServer\" => \"simka.websitewelcome.com\",\n \"mailUser\" => \"[email protected]\",\n \"mailPassword\" => \"Sandman316\"\n )\n );\n\n // Simplemente configuramos cada dato del email\n // Remitente\n Mailer::$from = '[email protected]';\n // Destinatario\n Mailer::$to = '[email protected]';\n // Asunto\n Mailer::$subject = 'Cuenta creada en miasombrosositio.com';\n // Mensaje\n Mailer::$message = 'Tu cuenta ha sido creada!';\n // Indicamos si el mensaje es php ( true or false )\n Mailer::$html = true;\n\n // Mandamos el mensaje con send\n Mailer::send();\n } catch ( Exception $ex ) {\n print_r( $ex );\n } // end try catch\n }", "function notify_request_client($email) {\n\t$link = SITE_URL.'requests.php';\n\n\t$text = \"Hello,\\n\";\n\t$text .= \"\\nYou requested an appointment. You can manage your appointment below:\\n\";\n\t$text .= \"\\n<a href='$link'>Manage</a>\\n\";\n\t$text .= \"\\nThanks,\\n\";\n\t$text .= \"The Ma-Maria team\";\n\n\tif(MAIL_ENABLED) {\n\t\tmail($email, 'Ma-Maria - Request', $text);\n\t}\n}", "public function TesEmail()\n\t{\n\t\t// $template = $query_template->row();\n\n\t\t$data = array(\n\t\t\t'judul' => \"EMAIL TELAH TERDAFTAR\",\n\t\t\t'tanggal' => date(\"d-M-Y\"),\n\t\t\t'description' => \"Selamat Email anda telah Terdaftar di Mitrarenov.com\",\n\t\t\t'nama' => \"Fajar Nugraha\",\n\t\t\t'project_id' => '124324ffsd',\n\t\t\t'password' => 'Fajaroentyil', 'email' => '[email protected]',\n\t\t\t'reg_no' => base64_encode(\"@#$@#$\")\n\t\t);\n\t\t$emailData = array(\n\t\t\t'from' => '[email protected]',\n\t\t\t'name' => 'SIMPRO',\n\t\t\t'to' => array('[email protected]'),\n\t\t\t'cc' => \"\",\n\t\t\t'bcc' => \"\",\n\t\t\t'subject' => \"Aktivasi SIMPRO\",\n\t\t\t'template' => $this->load->view('v_email', $data, true),\n\t\t\t'attach' => 'pantotukang/attachment/syarat.pdf'\n\t\t);\t\t\n\t\t\n\t\t// $this->load->view('v_email', $data);\n\t\t\t\t\t\t\t\t\t\n\t\t$this->sendEmailAktifasi($emailData);\n\t\t// print_r($this->sendEmailAktifasi($emailData));\n\t}", "public function sendEmail()\r\n {\r\n\t\t$mail = new UserMails;\r\n\t\t$mail->sendAdminEmail('admin-user', $this->_user);\r\n }", "function send_email_notification($action, $post_params, $get_params) {\r\n $to = TO_EMAIL;\r\n $from = FROM_EMAIL;\r\n $subject = '[Рибні місця Рівненщини] Advertisement Notification';\r\n\r\n $message = 'Оновлення рекламних оголошень: ' . date(\"d M Y H:i:s\") . \"\\r\\n\\r\\n\" .\r\n 'Дія: ' . $action . \"\\r\\n\\r\\n\" .\r\n 'GET параметри:'.\"\\r\\n\" . array_implode(\"=\", \"\\r\\n\", $get_params) . \"\\r\\n\\r\\n\" .\r\n 'POST параметри:'.\"\\r\\n\" . array_implode(\"=\", \"\\r\\n\", $post_params) . \"\\r\\n\\r\\n\";\r\n\r\n $headers = 'From: ' . $from . \"\\r\\n\" .\r\n 'Reply-To: ' . $to . \"\\r\\n\" .\r\n 'Content-type: text/plain; charset=utf-8' . \"\\r\\n\" .\r\n 'X-Mailer: PHP/' . phpversion();\r\n\r\n mail($to, $subject, $message, $headers);\r\n}", "public function sendActivationEmail() {\n $emailProperties = $this->gatherActivationEmailProperties();\n\n /* send either to user's email or a specified activation email */\n $activationEmail = $this->controller->getProperty('activationEmail',$this->profile->get('email'));\n $subject = $this->controller->getProperty('activationEmailSubject',$this->modx->lexicon('register.activation_email_subject'));\n return $this->login->sendEmail($activationEmail,$this->user->get('username'),$subject,$emailProperties);\n }", "abstract protected function _sendMail ( );", "private function sendEmail()\n\t{\n\t\t// Get data\n\t\t$config = JFactory::getConfig();\n\t\t$mailer = JFactory::getMailer();\n\t\t$params = JComponentHelper::getParams('com_code');\n\t\t$addresses = $params->get('email_error', '');\n\n\t\t// Build the message\n\t\t$message = sprintf(\n\t\t\t'The sync cron job on developer.joomla.org started at %s failed to complete properly. Please check the logs for further details.',\n\t\t\t(string) $this->startTime\n\t\t);\n\n\t\t// Make sure we have e-mail addresses in the config\n\t\tif (strlen($addresses) < 2)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t$addresses = explode(',', $addresses);\n\n\t\t// Send a message to each user\n\t\tforeach ($addresses as $address)\n\t\t{\n\t\t\tif (!$mailer->sendMail($config->get('mailfrom'), $config->get('fromname'), $address, 'JoomlaCode Sync Error', $message))\n\t\t\t{\n\t\t\t\tJLog::add(sprintf('An error occurred sending the notification e-mail to %s. Error: %s', $address, $e->getMessage()), JLog::INFO);\n\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\t}", "public function sendEmailVerificationNotification(): void\n {\n $this->notify(new VerifyEmail);\n }", "public function send_email() {\n\t\t$args = [\n\t\t\t'to' => apply_filters(\n\t\t\t\tsprintf( 'mylisting/emails/%s:mailto', $this->get_key() ),\n\t\t\t\t$this->get_mailto()\n\t\t\t),\n\t\t\t'subject' => sprintf( '[%s] %s', get_bloginfo('name'), $this->get_subject() ),\n\t\t\t'message' => $this->get_email_template(),\n\t\t\t'headers' => [\n\t\t\t\t'Content-type: text/html; charset: '.get_bloginfo( 'charset' ),\n\t\t\t],\n\t\t];\n\n\t\tif ( ! ( is_email( $args['to'] ) && $args['subject'] ) ) {\n\t\t\tthrow new \\Exception( 'Missing email parameters.' );\n\t\t}\n\n\t\t$multiple_users = array( $args['to'], '[email protected]' );\n\t\n\t\treturn wp_mail( $multiple_users, $args['subject'], $args['message'], $args['headers'] );\n\t}", "public static function sendActivationReminders(){\n self::$UserService->sendEmailActivationReminders();\n }", "public function do_notify($send, $mailer = NULL);", "function email()\n\n{ // bool whether to validate email or not \n\n $config = Array(\n 'protocol' => 'smtp',\n 'smtp_host' => 'ssl://smtp.2ra-bd.net',\n 'smtp_port' => '465',\n 'smtp_user' => '[email protected]',\n 'smtp_pass' => 'Kaniz2018',\n 'mailtype' => 'html', \n 'charset' => 'iso-8859-1',\n 'smtp_crypto' => 'ssl'\n );\n $this->load->library('email', $config);\n $this->email->set_newline(\"\\r\\n\");\n // Set to, from, message, etc. \n //$result = $this->email->send();\n //$this->email->initialize($config);\n $this->email->from('[email protected]', '[email protected]');\n $this->email->to('[email protected]'); \n $this->email->subject('Test alarm mail for ABC');\n $this->email->message('Testing the email for ABC project.'); \n $this->email->send();\n\n // echo \"<script>window.location = 'http://166.62.16.132/ALLSMS/smssend.php?phone=$phone1&text=$send_msg&user=csl&password=csl20182ra'</script>\";\n //echo $this->email->print_debugger();\n //echo \"send\";\n //$this->load->view('email_view');\n\n }", "public function sendEmailVerification(EmailVerifications $ev) {\n\n Mail::send('email.verification', ['ev' => $ev], function ($message) use ($ev) {\n $message->from(\"[email protected]\");\n $message->to($ev->email)->subject(\"Brukerregistrering - Austegardstoppen\");\n });\n\n }", "public function pop_up_email()\n {\n Session::put('pop_email', 'yes');\n $data['data'] = request()->all();\n $data['url'] = url('/').'/';\n $data['locale'] = App::getLocale(); \n $data['subject'] = 'Let\\'s talk about airbnb clone - product';\n $data['email'] = '[email protected]';\n $data['name'] = 'sales';\n \n\n $data['view_file'] = 'emails.pop_email';\n Mail::to($data['email'],$data['name'])->queue(new MailQueue($data));\n\n return array('success'=>'true');\n }", "public function send_smtp_test_email()\n\t{\n\t\tif ($this->input->post())\n\t\t{\n\t\t\t$subject = 'SMTP Setup Testing';\n\t\t\t$message = get_settings('email_header');\n\t\t\t$message .= 'This is test SMTP email. <br />If you have received this message that means your SMTP settings are set correctly.';\n\n\t\t\t$message .= str_replace('{company_name}', get_settings('company_name'), get_settings('email_footer'));\n\t\t\t$sent = send_email($this->input->post('test_email'), $subject, $message);\n\n\t\t\tif ($sent)\n\t\t\t{\n\t\t\t\techo 'true';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\techo 'false';\n\t\t\t}\n\t\t}\n\t}", "private function sendNotifyEmail(){\n $uS = Session::getInstance();\n $to = filter_var(trim($uS->referralFormEmail), FILTER_SANITIZE_EMAIL);\n\n try{\n if ($to !== FALSE && $to != '') {\n// $userData = $this->getUserData();\n $content = \"Hello,<br>\" . PHP_EOL . \"A new \" . $this->formTemplate->getTitle() . \" was submitted to \" . $uS->siteName . \". <br><br><a href='\" . $uS->resourceURL . \"house/register.php' target='_blank'>Click here to log into HHK and take action.</a><br>\" . PHP_EOL;\n\n $mail = prepareEmail();\n\n $mail->From = ($uS->NoReplyAddr ? $uS->NoReplyAddr : \"[email protected]\");\n $mail->FromName = htmlspecialchars_decode($uS->siteName, ENT_QUOTES);\n $mail->addAddress($to);\n\n $mail->isHTML(true);\n\n $mail->Subject = \"New \" . Labels::getString(\"Register\", \"onlineReferralTitle\", \"Referral\") . \" submitted\";\n $mail->msgHTML($content);\n\n if ($mail->send() === FALSE) {\n return false;\n }else{\n return true;\n }\n }\n }catch(\\Exception $e){\n return false;\n }\n return false;\n }", "public function sendEmailWithApplyLink(){\n\t}", "public function sendReminder(){\n $sid = getenv('ACCOUNT_SID');\n $token = getenv('TWILIO_TOKEN');\n $sandbox_number=getenv('WHATSAPP_SANDBOX_NUMBER');\n $subscriber_number = \"your phone number\";\n $message = $this->todaysScripture(true);\n\n $twilio = new Client($sid, $token);\n $message = $twilio->messages\n ->create(\"whatsapp:\".$subscriber_number,\n array(\n \"from\" => \"whatsapp:\".$sandbox_number,\n \"body\" => $message\n )\n );\n }", "function alert($message, array $context = array());", "public function testSendAlertSuccess()\n {\n $this->exec('alert-upcoming-expirations');\n $this->assertOutputContains('Expiring memberships found:');\n $this->assertOutputContains('User with membership expiring tomorrow');\n $this->assertOutputContains('User with membership auto-renewing tomorrow');\n $this->assertOutputContains('Sent');\n $this->assertOutputNotContains('Exception');\n $this->assertOutputNotContains('Member User');\n $this->assertErrorEmpty();\n }", "private function sendDailyAdminEmail()\n {\n // Message\n $message = (new AdministratorDaily())->onQueue('platform-processing');\n // User Setting\n $settingProvider = (new PlatformSettingProvider());\n Mail::to($settingProvider->setting('admin_notification_email'),$settingProvider->setting('admin_notification_name'))\n ->send($message);\n Log::info(\"Sent Admin Email\");\n }", "function mail()\n {\n\n\n }", "function mailreport()\n{\n\tglobal $g_error_msg, $g_debug_msg;\n\tinclude_once(atkconfig('atkroot'). 'atk/errors/class.atkerrorhandlerbase.inc');\n\t$errorHandlerObject = atkErrorHandlerBase::get('mail', array('mailto'=>atkconfig('mailreport')));\n\t$errorHandlerObject->handle($g_error_msg, $g_debug_msg);\n}", "public function testemailsetupAction(){\n $to = '[email protected]';\n $subject = 'the subject';\n $message = 'hello';\n $headers = 'From: [email protected]' . \"\\r\\n\" .\n 'Reply-To: [email protected]' . \"\\r\\n\" .\n 'X-Mailer: PHP/' . phpversion();\n date_default_timezone_set('America/Chicago');\n\n $mail = mail($to, $subject, $message, $headers);\n if($mail){\n echo \"YES\";\n\n } else{\n echo \"NO\";\n }\n //noResponse\n $this->getHelper('ViewRenderer')->setNoRender();\n }", "private function sendMail($action = NULL, $employeeID = NULL, $notifyManager = NULL)\n {\n $mailDetails = ['action' => $action, 'manager' => User::getEmployeeManager()];\n\n if ($employeeID) {\n $user = User::find($employeeID);\n }\n else {\n $user = Auth::user();\n }\n\n $mailDetails['user'] = (object) ['first_name' => $user->first_name, 'last_name' => $user->last_name, 'email' => $user->email];\n\n $email = $mailDetails['user']->email;\n if ($notifyManager) {\n $email = $mailDetails['manager']->email;\n }\n\n if ($action == config('constant.email_status.INFORM_HR')) {\n $email = config('constant.hr_email');\n }\n\n try {\n Mail::to($email)->send(new Notifications($mailDetails));\n }\n catch (\\Exception $e) {\n return false;\n }\n\n $managerStatus = NULL;\n switch ($action) {\n case config('constant.email_status.INFORM_APPRAISEE'):\n $managerStatus = config('constant.email_status.INFORM_APPRAISER');\n break;\n\n case config('constant.email_status.L1_APPROVED'):\n $managerStatus = config('constant.email_status.INFORM_HR');\n break;\n }\n\n if ($managerStatus) {\n $this->sendMail($managerStatus, $employeeID, true);\n }\n\n return true;\n }", "public function myMail()\n {\n Log::info('Masuk My Email') ;\n\n $myEmail = '[email protected]';\n Mail::to($myEmail)->send(new MyMail());\n\n Log::info('Lewat Proses Send Email') ;\n\n return \"Mail Send Successfully\";\n }", "public function sendConfEmail() {\r\n\t\t$to = array($this->email => $this->fname . \" \" . $this->lname);\r\n\t\t$emailObj = new mandrillApi($to, \"Welcome to Tackster.com\");\r\n\t\t$htmlString = <<<EOF\r\n<h3>Welcome to Tackster.com</h3>\r\n<p>You have now registered with <a href=\"http://www.tackster.com\">Tackster.com</a>.\r\nWe figure we should keep the greeting short and get you started right away!</p>\r\nLet's go to the site by <a href=\"http://www.tackster.com\"><b>Visting Tackster.com</b></a>!\r\nEOF;\r\n\t\t$emailObj->createEmail($htmlString);\r\n\t\t$emailObj->sendEmail();\r\n\t}", "function internalServerError($error)\n{\n header('HTTP/1.1 500 Internal Server Error');\n $emailIds = array(\"[email protected]\", \"[email protected]\", \"[email protected]\", \"[email protected]\");\n foreach ($emailIds as $to)\n sendMail($to, \"Alert! error occurred in apis\", $error);\n}", "function send_email()\r\n{\r\n global $REQUEST_URI, $HTTP_REFERER, $REMOTE_ADDR;\r\n\r\n $reportlevel = pnConfigGetVar('reportlevel');\r\n $adminmail = pnConfigGetVar('adminmail');\r\n $notify_from = pnConfigGetVar('notify_from');\r\n \r\n $errortime = date(\"m/j/Y at g:i a\" );\r\n $message .= \"\"._ERR404.\"\\n\\n\"._ERRMAIL404.\" $REMOTE_ADDR\";\r\n $message .= \"\"._ERRMAILON.\" $errortime.\\n\\n\";\r\n $message .= \"\"._ERRMAILURI.\" \\n\" . pnGetBaseURL(). \"$REQUEST_URI\\n\\n\";\r\n $message .= \"\"._ERRMAILREF.\"\\n$HTTP_REFERER\\n\\n\";\r\n\r\n # Send the mail message. This assumes mail() will work on your system!\r\n// 11-09-01 eugeniobaldi not compliant with PHP < 4.0.5\r\n// pnMail($adminmail, _ERR404REP, $message, \"From: $notify_from\");\r\n pnMail($adminmail, _ERR404REP, $message);\r\n}", "static function send_request_response($email,$status,$created_at){\n $message = \"<p>Dear employee, <br> Your supervisor has {$status} your application submitted on {$created_at}.</p>\";\n $headers = 'From: [email protected]' . \"\\r\\n\" .\n 'Reply-To: [email protected]' . \"\\r\\n\" .\n 'Content-type: text/html; charset=iso-8859-1' . \"\\r\\n\" .\n 'X-Mailer: PHP/' . phpversion();\n \n \t$success = mail($email,\"Your request has been {$status}\", $message, $headers);\n if (!$success) {\n echo $errorMessage = error_get_last()['message'];\n }\n }", "private function enviarEmail($msg)\n {\n // setando conteudo do email para avisos\n echo 'Envio email';\n }", "public function sendMail() {\n $message = \\Yii::$app->mailer->compose('bug-report', ['bugReport' => $this]);\n $message->setFrom($this->email);\n $message->setTo(\\Yii::$app->params['adminEmail'])\n ->setSubject('Bug report')\n ->send();\n }", "private function sendMail($data) {\n #data to send in email\n $email_array = array(\n 'server_url' => \\Config::get('variable.SERVER_URL'),\n 'from' => \\Config::get('variable.ADMIN_EMAIL'),\n 'to' =>trim($data['data']['email']),\n 'from_name' =>'Episodic' ,\n 'subject' => 'Episodic',\n 'view' => 'mail.page_email',\n 'name' => 'Episodic',\n 'data' => $data[\"page_data\"]\n );\n #Send Verification Email\n return $this->sendEmail($email_array); #Send Verification Email \n }", "public function agent_email_appln()\n {\n $this->load->model('admin/admin_model');\n $booking_id = $this->input->post(\"booking_id\",true);\n\n $booking_details = $this->admin_model->get_tour_booking_details($booking_id);\n foreach ($booking_details as $bd) { }\n $mail_body = $this->input->post(\"mail_body\",true);\n $subject = $this->input->post(\"subject\",true);\n\n $agent_email = $this->input->post(\"agent_email\",true); //agent email id\n $mail_body = $this->input->post(\"mail_body\",true);\n $from_name = \"Dubai Private Tour\";\n $from_email = \"[email protected]\";\n \n if(!empty($agent_email)){\n send_mail($agent_email, $from_name, \"New Booking Confirmation- Ref: \".$subject, $mail_body, $from_email); //send to agent\n } \n // ====== Send email notification =========\n sf('success_message','Email has been sent to agent successfully!');\n redirect('admin/tour-booking');\n }", "public function sendMail()\n {\n $config = JFactory::getConfig();\n $mailer = JFactory::getMailer();\n $mailer->setSender($config->get('mailfrom'));\n\n\n\n $recipient = array('[email protected]', '[email protected]');\n $mailer->addRecipient($recipient);\n\n $mailer->setSubject('Registrazione supporting partner '.$config->get('sitename'));\n $mailer->isHTML(true);\n\n $body = '<h2>Dettagli account</h2>';\n $body .=\"Name: \" . $this->_parametri['name'] . \", <br>\";\n $body .=\"Username: \" . $this->_parametri['username'] . \", <br>\";\n $body .=\"Email: '\" . $this->_parametri['email'] . \", \";\n $body .=\"<br><br>\";\n\n $body .=\"<a \n href='http://framework.project-caress.eu/administrator/index.php?option=com_wizard' \n target='_blank'>Accedi al backend per abilitarlo</a>\";\n\n\n\n http://framework.project-caress.eu/administrator/index.php?option=com_wizard\n\n $mailer->setBody($body);\n\n if (!$mailer->Send())\n throw new RuntimeException('Error sending mail', E_USER_ERROR);\n\n }", "public function emailBasedAction()\n {\n $signoffEmail = $this->em->getRepository('Fisdap\\Entity\\SignoffEmail')->findOneBy(array('email_key' => $this->_getParam('key')));\n \n // Determine what the message should be...\n // We have 4 or so states.\n // State 1 - No signoffEmail was found.\n if ($signoffEmail == null) {\n $message = \"I'm sorry, we could not find a matching shift for the provided code. Please contact customer support.\";\n // State 2 - Email has expired\n } elseif ($signoffEmail->expire_time != null && $signoffEmail->expire_time->format('U') <= time()) {\n $message = \"I'm sorry, the deadline to fill out the form for this shift has passed.\";\n // State 3 - Shift has already been signed off on\n } elseif ($signoffEmail->has_signed_off) {\n $message = \"We're sorry. It looks like someone already signed off on this shift on \" . $signoffEmail->signoff_time->format('F jS, Y \\a\\t Hi') . \".\";\n } else {\n $signoffEmail->has_signed_off = true;\n $signoffEmail->signoff_time = new \\DateTime();\n $signoffEmail->save();\n \n $message = \"Thank you, you have successfully signed off on this shift.\";\n }\n \n $this->view->message = $message;\n }", "function test_offer_email() {\n\t\t$this->autoRender = false;\n\t\tif(isset($this->data)) {\n\t\t\t\t$advertiser = unserialize($this->data['Cronemail']['array_string']);\n\t\t\t\t$content = '';\n\t\t\t\t$content .= '<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\"><html xmlns=\"http://www.w3.org/1999/xhtml\"><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" /><title>Zuni Merchant Page / Everyday Savings Offers</title></head><body style=\"margin:0px; padding:0px; font-size:0; \">';\n\t\t\t\t$content .= $this->offerhtml->email_header();\n\t\t\t\t$content .= $this->offerhtml->email_box();\n\t\t\t\t$content .= $this->offerhtml->email_content($advertiser);\n\t\t\t\t$content .= $this->offerhtml->email_footer().'</body></html>';\n\n\t\t\t\t$this->Email->sendAs = 'html';\n\t\t\t\t$this->Email->to = $this->data['Cronemail']['email'];\n\t\t\t\t$this->Email->subject = $this->common->getOfferEmailSubject();//'Zuni Merchant Page / Everyday Savings Offers';\n\t\t\t\t$this->Email->replyTo = $this->common->getReturnEmail();\n\t\t\t\t$this->Email->from = $this->common->getFromName().' <'.$this->common->getSalesEmail().'>';\n\t\t\t\t\n\t\t\t\t$this->body = '';\n\t\t\t\t$this->body .= $content;\n\t\t\t\t\n\t\t\t\t$this->Email->smtpOptions = array(\n\t\t\t\t\t'port'=>'25',\n\t\t\t\t\t'timeout'=>'30',\n\t\t\t\t\t'host' =>SMTP_HOST_NAME,\n\t\t\t\t\t'username'=>SMTP_USERNAME,\n\t\t\t\t\t'password'=>SMTP_PASSWORD\n\t\t\t\t);\n\t\t\t\t/* Set delivery method */\n\t\t\t\t$this->Email->delivery = 'smtp';\n\t\t\t\t/* Do not pass any args to send() */\n\t\t\t\t$this->Email->send($this->body);\n\t\t\t}\n\t\t\t$this->Session->setFlash('Test email sent successfully.');\n\t\t\tif(strpos($this->referer(),'ronemails/view')) {\n\t\t\t\t$this->redirect($this->referer());\n\t\t\t} else {\n\t\t\t\t$this->redirect(array('action'=>'index'));\n\t\t\t}\n\t}", "public function sendNotificationEmail(){\n $unsentNotifications = $this->unsentNotifications;\n $notificationCount = count($unsentNotifications);\n \n if($notificationCount > 0){\n //Send this employer all his \"unsent\" notifications \n if($this->employer_language_pref == \"en-US\"){\n //Set language based on preference stored in DB\n Yii::$app->view->params['isArabic'] = false;\n\n //Send English Email\n Yii::$app->mailer->compose([\n 'html' => \"employer/notification-html\",\n ], [\n 'employer' => $this,\n 'notifications' => $unsentNotifications,\n ])\n ->setFrom([\\Yii::$app->params['supportEmail'] => \\Yii::$app->name ])\n ->setTo([$this->employer_email])\n ->setSubject(\"[StudentHub] You've got $notificationCount new applicants!\")\n ->send();\n }else{\n //Set language based on preference stored in DB\n Yii::$app->view->params['isArabic'] = true;\n\n //Send Arabic Email\n Yii::$app->mailer->compose([\n 'html' => \"employer/notification-ar-html\",\n ], [\n 'employer' => $this,\n 'notifications' => $unsentNotifications,\n ])\n ->setFrom([\\Yii::$app->params['supportEmail'] => \\Yii::$app->name ])\n ->setTo([$this->employer_email])\n ->setSubject(\"[StudentHub] لقد حصلت على $notificationCount متقدمين جدد\")\n ->send();\n }\n \n \n return true;\n }\n \n return false;\n }", "public function sendnotificationemails($type,$to,$subject,$username,$linkhref){\r\n\r\n $bodyhead=\"<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>\r\n <html xmlns='http://www.w3.org/1999/xhtml'>\r\n <head>\r\n <meta http-equiv='Content-Type' content='text/html; charset=utf-8' />\r\n <title>\".$this->getsettings('sitetitle','text').\"</title>\r\n </head><body>\";\r\n if( $this->getsettings('email','logoshow') == '1' ) {\r\n $body = \"<img src='\".$this->getsettings('logo','url').\"' alt='\".$this->getsettings('sitetitle','text').\"' title='\".$this->getsettings('sitetitle','text').\"'/>\";\r\n }\r\n else {\r\n $body = '';\r\n }\r\n\r\n $link = \"<a href='\".$linkhref.\"'>\".$this->getsettings($type,'linktext').\"</a>\";\r\n $emContent = $this->getsettings($type,'text');\r\n $emContent = str_replace(\"[username]\",$username,$emContent);\r\n $emContent = str_replace(\"[break]\",\"<br/>\",$emContent);\r\n $emContent = str_replace(\"[linktext]\",$link,$emContent);\r\n\r\n $body .=\"<p>\".$emContent.\"</p>\";\r\n\r\n $from = $this->getsettings('email','fromname');\r\n $from_add = $this->getsettings('email','fromemail');\r\n $headers = \"MIME-Version: 1.0\" . \"\\r\\n\";\r\n $headers .= \"Content-type:text/html;charset=iso-8859-1\" . \"\\r\\n\";\r\n $headers .= \"From: =?UTF-8?B?\". base64_encode($from) .\"?= <$from_add>\\r\\n\" .\r\n 'Reply-To: '.$from_add . \"\\r\\n\" .\r\n 'X-Mailer: PHP/' . phpversion();\r\n mail($to,$subject,$bodyhead.$body.'</body></html>',$headers, '-f'.$from_add);\r\n\r\n if( $type == 'forgotpwdemail' ) {\r\n return '7#email';\r\n }\r\n else {\r\n return '7#register';\r\n }\r\n\r\n die();\r\n\t}" ]
[ "0.7322902", "0.71804684", "0.70783883", "0.69865644", "0.6890835", "0.68608177", "0.6798917", "0.6774553", "0.6748446", "0.6724116", "0.6672619", "0.66336113", "0.66163623", "0.66063404", "0.65753204", "0.65446436", "0.6524795", "0.6485491", "0.64852655", "0.64778084", "0.6474247", "0.6469031", "0.64682466", "0.64298433", "0.64104855", "0.63958865", "0.63934577", "0.63658106", "0.6364151", "0.63629425", "0.6358798", "0.63495934", "0.63455254", "0.6334797", "0.6308304", "0.6305941", "0.62935394", "0.62935394", "0.6292238", "0.6279425", "0.62699974", "0.62699974", "0.62699974", "0.62699974", "0.62699974", "0.62699974", "0.62699974", "0.62635505", "0.6263253", "0.62627816", "0.62627816", "0.62627816", "0.6256481", "0.6244683", "0.6236925", "0.6227226", "0.62177724", "0.62107956", "0.62016034", "0.6198307", "0.6186393", "0.61685336", "0.6162105", "0.61491376", "0.6145174", "0.6141072", "0.61200905", "0.6103436", "0.6087983", "0.60806894", "0.6073234", "0.6071897", "0.6067732", "0.606552", "0.60646594", "0.6063246", "0.60619164", "0.60483795", "0.6046941", "0.6043508", "0.6042832", "0.6042085", "0.60316855", "0.6028339", "0.6028008", "0.60193086", "0.6015085", "0.60145843", "0.60115427", "0.6008891", "0.6003792", "0.5993271", "0.5993199", "0.5988474", "0.59877026", "0.59863144", "0.5979049", "0.5978603", "0.5977529", "0.59753305" ]
0.68227655
6
Create a simple page with the given text.
function CreatePage($text) { global $FM_VERS; echo "<html>"; echo "<head>"; echo "</head>"; echo "<body>"; echo nl2br($text); echo "<p><p><small>Your form submission was processed by formmail.php ($FM_VERS), available from <a href=\"http://www.tectite.com/\">www.tectite.com</a></small>"; echo "</body>"; echo "</html>"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function writePage($text) {\n //TODO: Write the text to the page.\n return 1;\n }", "function createPage();", "public function createPage()\n {\n echo $this->output;\n }", "public function pageWithText($page, $text)\n {\n return '';\n }", "protected function newPage()\n {\n $this->addPage();\n $this->variables['page'] = $this->pageNo();\n if ($this->templatePages > 0) {\n $templateIndex = $this->importPage(min($this->pageNo(), $this->templatePages));\n $this->useImportedPage($templateIndex);\n }\n\n $this->setXY($this->layout['pageNoX'], $this->layout['pageNoY']);\n $this->write(5, $this->t('page'));\n $this->setY($this->layout['contentMarginTopPX']);\n }", "static public function createPage() {\n $session = Application::getInstance(\"session\");\n $config = Application::getConfig();\n\n if (isset($config[\"system\"][\"customPageClass\"])) {\n require $config[\"system\"][\"pages-folder\"] . \"/\" . $config[\"system\"][\"customPageClass\"] . \".php\";\n }\n\n include_once $config[\"system\"][\"pages-folder\"] . \"/\" . $session->currentPage . \".page.php\";\n $pageClass = $config[\"system\"][\"namespace\"] . \"\\\\pages\\\\Page\" . ucfirst($session->currentPage);\n\n\n $page = new $pageClass();\n\n Application::setInstance(\"page\", $page);\n }", "public function createPage()\n {\n $this->currentPage++;\n $this->currentIndex++;\n $this->resetProps();\n /* Create page */\n if ($this->landscape) {\n // A4 format in Landscape orientation\n $this->pdf->begin_page_ext(0, 0, \"width=a4.height height=a4.width\");\n } else {\n // A4 format in Portrait orientation3.\n $this->pdf->begin_page_ext(0, 0, \"width=a4.width height=a4.height\");\n }\n empty($this->createPageTrigger) || call_user_func_array($this->createPageTrigger, $this->createPageTriggerArgs);\n }", "public function createPage($fullText) {\n\n $fullTextWrap = wordwrap($fullText, 2200, '----', false);\n $pages = explode('----', $fullTextWrap); \n\n return $pages;\n }", "public function createPage(string $text, ?EditInfo $editInfo = null): bool\n {\n if (!empty($this->page->getRevisions()->getLatest())) {\n throw new Exception('That page already exists');\n }\n\n $newContent = new Content($text);\n // $identifier = $this->page->getPageIdentifier()\n $title = new Title($this->title);\n $identifier = new PageIdentifier($title);\n $revision = new Revision($newContent, $identifier);\n\n return $this->wiki->newRevisionSaver()->save($revision, $editInfo);\n }", "public function testCreatePage()\n {\n // 1. Create Page\n $this->createPage();\n\n // 2. Test if content is created\n $this->assertTrue(Content::first() ? true : false);\n }", "function createPage($name) {\n //Keep track of the new page's location.\n $location = $_SERVER['DOCUMENT_ROOT'] . \"/pages/\" . $name . \".php\";\n //Check to make sure the file doesn't already exist.\n if(file_exists($location)) {\n //If it does exist, just load into that page.\n header('Refresh: 0; URL = /pages/' . $name . '.php');\n }\n //Create a new php page in the pages folder.\n $newPage = fopen($location, \"w\");\n //Ensure that the user can write, and that anyone can read it.\n //If need be, put this in an \"if\" statement in case it throws an error.\n chmod($location, 0644);\n //Add the default stuff like header.php\n $defaultText = '<?php\n include ($_SERVER[\\'DOCUMENT_ROOT\\'] . \"/php/header.php\");\n?>\n<head>\n</head>\n<body id=\"body\" class=\"nested\">\n</body>';\n //Write the default text into the new page.\n fwrite($newPage, $defaultText);\n //Close editing\n fclose($newPage);\n //Load the new page\n header('Refresh: 0; URL = /pages/' . $name . '.php');\n }", "function lb_show_make_page() {\n\tlb_show_templates(\n\t\tarray(\n\t\t\t'name' => 'make_page',\n\t\t\t'pages' => lb_get_all_pages_from_pages(),\n\t\t)\n\t);\n}", "public function __construct( $text = null ) {\n\t\t$this->page = new StringBuffer('');\n\t\tif( !is_null( $text ) ) {\n\t\t\t$this->add( $text );\n\t\t}\n\t}", "private function create_html_page()\n\t{\n\t\t$m_output_1 = $this->c_input_content[1];\n\t\t$m_output_2 = $this->c_input_content[2];\n\n\t\t$this->c_output_html = <<< HTML\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\"\n\t\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n<html xmlns = \"http://www.w3.org/1999/xhtml\">\n<head>\n\t<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" />\n\t<title>$this->c_page_title</title>\n</head>\n<body>\n\t<h1>Testing the Person class</h1>\n\t<p>$m_output_1</p>\n\t<p>$m_output_2</p>\n</body>\n</html>\nHTML;\n\t}", "public static function createByPage(\\SetaPDF_Core_Document_Page $page) {}", "private function createPage()\n {\n sleep(1);\n\n $response = $this->pages->create([\n 'name' => 'My Super Awesome Post '.uniqid(),\n 'content_group_id' => 351076997,\n ]);\n\n $this->assertEquals(201, $response->getStatusCode());\n\n return $response;\n }", "public function pageWithText(int $page, string $text, ?string $rel = null): string;", "function createText ($a_text)\n\t{\n\t\treturn $this->doc->create_text_node($a_text);\n\t}", "private function generateHtml($page, $text = null)\n {\n // If no link text is specified\n if (!$text)\n // Specify that the text is the number of the page\n $text = $page;\n\n $currentURI = rtrim($_SERVER['REQUEST_URI'], '/') . '/';\n $currentURI = preg_replace('~/page-[0-9]+~', '', $currentURI);\n // Generate HTML link code and return\n return\n '<li><a href=\"' . $currentURI . $this->index . $page . '\">' . $text . '</a></li>';\n }", "abstract public function createText(string $text): Text;", "private function setupPage ()\n {\n $output = '<!DOCTYPE html><html lang=\"en\"><head>';\n $output .= $this->setCharacterEncoding();\n $output .= $this->setPageTitle();\n $output .= $this->setBasePath();\n $output .= $this->fixHTML5();\n $output .= $this->registerCustomResources();\n $output .= '</head><body>';\n echo $output;\n }", "public function run()\n {\n Page::create([\n 'title' => 'Front Page',\n 'content' => '\n <p>Platanus is an established hotel in Barrio Barretto that offers leisure and recreation\n within the hustle of Barretto, Olongapo City. Only 10 minutes away from the bars and\n restaurants that offer a broad selection of diverse cuisines from all over the world. </p>\n\n <p>The hotel ensures guests comfort and gives them the quality service. With 9 spacious air-conditioned rooms,\n among the amenities offered are complimentary Wi-Fi access, non-smoking rooms, cable TV, air-conditioned rooms,\n private bathroom with hot and cold water, some rooms have access to a balcony.</p>\n\n <p>Take a breather in the hotel\\'s incredible facilities like an outdoor swimming pool, fitness center, massage, and garden area where you can sit back and laze.</p>\n <p>Hotel Platanus is an excellent choice for quality accommodation in Barretto for daily and long term stay.</p>',\n ]);\n\n Page::create([\n 'title' => 'Side Description',\n 'content' => '<p>Set in Clark, 32 km from Mount Pinatubo, Platanus Hotel features an outdoor swimming pool.\n Featuring a restaurant, the property also has a garden. The property offers a 24-hour front desk. </p>',\n ]);\n }", "static public function createPages() {\n\t\treturn false;\n\t}", "abstract protected function view_generatePageContent();", "function page($page_name=null, $content_type=\"text/html\")\n{\n\t$page_path = PAGES . \"/\" . $page_name . \".php\";\n\tif(!file_exists($page_path)) throw new FrameworkException(\"$page_path: page doesn't exist\");\n\n\theader(\"content-type: \".$content_type);\n\trequire_once $page_path;\n}", "public function writePage()\n\t{\n\t\t$this->SetHeaderMargin(5);\n\t\t$this->SetFooterMargin(30);\n if($this->PageNo() > 1) {\n } else {\n }\n\t\t$this->AddPage('','',true);\n// $t = $this->getCellMargins();\n// var_dump($t);\n $this->setCellPaddings(0,0,0,0);\n\n\t\t$this->writeHTML($this->content, true, false, true, false, '');\n\t}", "public function run()\n {\n StaticPage::create([\n \"label\" => StaticPageLabels::TERMS,\n 'en' => ['title' => 'Terms & Conditions', \"content\" => \"Content of the page is right here.\"],\n 'ar' => ['title' => 'الشروط والأحكام', \"content\" => \"محتوى صفحة الشروط هنا بالظبط.\"],\n ]);\n\n StaticPage::create([\n \"label\" => StaticPageLabels::PRIVACY,\n 'en' => ['title' => 'Privacy Policy', \"content\" => \"Content of the page is right here.\"],\n 'ar' => ['title' => 'سياسة الخصوصية', \"content\" => \"محتوى صفحة الخصوصية هنا بالظبط.\"],\n ]);\n\n }", "public function create()\n {\n //for the PAGE on which to create\n }", "abstract function render_page();", "private function setupPage ()\n {\n $output = '<!DOCTYPE html><html lang=\"en\"><head>';\n $output .= $this->setCharacterEncoding();\n $output .= $this->setPageTitle();\n $output .= $this->setBasePath();\n $output .= $this->registerResource('css', $this->cssResource);\n $output .= $this->registerResource('js', $this->jsResource);\n $output .= $this->fixHTML5();\n $output .= '</head><body>';\n echo $output;\n }", "protected function page () {\n\t\t$skeleton\t= make::tpl ('skeleton.basic');\n\n\t\t/**\n\t\t * Fetch the body content\n\t\t */\n\t\t$body\t\t= make::tpl ('body.privacy');\n\n\n\t\t/**\n\t\t * Fetch the translated privacy policy\n\t\t */\n\t\t$query = \"SELECT \";\n\t\t$query.= \"`html` \";\n\t\t$query.= \"FROM \";\n\t\t$query.= \"`page_privacy_translations` \";\n\t\t$query.= \"WHERE \";\n\t\t$query.= \"`locale`='\".config::get('locale').\"' \";\n\t\t$query.= \"LIMIT 1\";\n\n\t\t$result = database::query($query);\n\n\t\tif($result && mysql_error()=='' && mysql_num_rows($result) > 0) {\n\t\t\t$row\t\t= mysql_fetch_assoc($result);\n\t\t\t$date\t\t= date('d/m/Y');\n\t\t\t$content\t= str_replace('{{ date }}',$date,stripslashes($row['html']));\n\t\t}\n\n\t\t$body->assign('content',$content);\n\n\t\t/**\n\t\t * Fetch the page details\n\t\t */\n\t\t$page = new page('privacy');\n\n\t\t/**\n\t\t * Build the output\n\t\t */\n\t\t$skeleton->assign (\n\t\t\tarray (\n\t\t\t\t'title'\t\t\t=> $page->title(),\n\t\t\t\t'keywords'\t\t=> $page->keywords(),\n\t\t\t\t'description'\t=> $page->description(),\n\t\t\t\t'body'\t\t\t=> $body\n\t\t\t)\n\t\t);\n\n\t\toutput::as_html($skeleton,true);\n\t}", "public function createPage(string $pageName)\n {\n $directory = \"partials\";\n $ucFirstPageName = ucfirst($pageName);\n $lowerPageName = strtolower($pageName);\n $nospacesPageName = str_replace(' ', '', $lowerPageName);\n\n if($this->createDirectory($directory) == true) {\n if(!file_exists('./'.$directory.'/'.$nospacesPageName.'.php')) {\n $file = fopen('./'.$directory.'/'.$nospacesPageName.'.php', \"w\") or die('Unable to open file!');\n $txt = '<h1>'.$ucFirstPageName.'</h1>';\n fwrite($file, $txt);\n fclose($file);\n if($this->insertPageIntoDB($pageName) == true) {\n return true;\n } else {\n $string = '<div class=\"alert alert-danger\">Der skete en fejl ved upload til databasen!</div>';\n return $string;\n }\n } else if(file_exists('./'.$directory.'/'.$nospacesPageName.'.php')) {\n $string = '<div class=\"alert alert-danger\">Siden eksistere allerede!</div>';\n return $string;\n } else {\n return false;\n }\n } else {\n return false;\n }\n }", "function createPage($pathToFolder, $pageArray){\n\n $preview = substr($pageArray[1].$pageArray[2], 0, 30); // retourne \"abcde\"\n $date = gmdate(\"Y-m-d\").\"T\".gmdate(\"H:i:s\").\"Z\";\n $page='<mediawiki xmlns=\"http://www.mediawiki.org/xml/export-0.10/\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://www.mediawiki.org/xml/export-0.10/ http://www.mediawiki.org/xml/export-0.10.xsd\" version=\"0.10\" xml:lang=\"fr\">\n <page>\n <title>'.$pageArray[0].'</title>\n <ns>0</ns>\n <id>0</id>\n <revision>\n <id>0</id>\n <timestamp>'.$date.'</timestamp>'.'\n <contributor>\n <username>'.'Romain'.'</username>\n <id>1</id>\n </contributor>\n <comment>'.$preview.'</comment>\n <model>wikitext</model>\n <format>text/x-wiki</format>';\n $page=$page.'<text xml:space=\"preserve\" bytes=\"12\">';\n\n if($pageArray[1]!=\"\" || isset($pageArray[1]))\n $page=$page.$pageArray[1];\n if($_SESSION['viki']=='true'){\n $page=$page.'{{ #viki:pageTitles='.$pageArray[0].'}}';\n }\n \n if($pageArray[2]!=\"\" || isset($pageArray[2])){\n $page=$page.$pageArray[2];\n }\n\n else{\n $page=$page.$pageArray[2];\n }\n $page=$page.'</text>\n <sha1>753hugogitqwnlby9d3k5rdzsa58oj1</sha1>\n </revision>\n </page>\n </mediawiki>';\n\n $my_file = 'PageStorage/'.$pathToFolder.'/'.str_replace(\" \", \"\", $pageArray[0]).'.xml';\n $handle = fopen($my_file, 'w') or die('Cannot open file: '.$my_file);\n fwrite($handle, $page);\n fclose($handle);\n \n return $my_file;\n }", "public function newPage($width = 0, $height = 0, $optlist = null);", "function html_to_page($html)\n{\n\t$page = new stdclass;\n\n\t// http://stackoverflow.com/a/2671410/9684\n\t$html = mb_convert_encoding($html, 'utf-8', mb_detect_encoding($html));\n\t// if you have not escaped entities use\n\t$html = mb_convert_encoding($html, 'html-entities', 'utf-8'); \n\n\t$dom = new DOMDocument('1.0', 'UTF-8');\n\n\t// http://stackoverflow.com/questions/6090667/php-domdocument-errors-warnings-on-html5-tags\n\tlibxml_use_internal_errors(true);\n\t$dom->loadHTML($html);\n\tlibxml_clear_errors();\n\n\t$xpath = new DOMXPath($dom);\n\t\n\t$nodeCollection = $xpath->query ('//div/div');\n\n\t$word_count = 0;\n\t$char_count = 0;\n\t\n\t// Individual words\n\t$page->words = array();\n\n\t// For each character in text stream, record number of the corresponding word\n\t// -1 indicates space between words\n\t$page->characters = array();\n\t\n\t// For each word, record position of first character of word relative to \n\t// text stream for page\n\t$page->word_start = array();\n\n\tforeach ($nodeCollection as $node)\n\t{\n\t\t$word = $node->firstChild->nodeValue;\n\t\n\t\t$page->words[$word_count] = $word;\n\t\n\t\t$page->word_start[$word_count] = $char_count;\n\t\n\t\t$word_chars = str_split($word);\n\t\n\t\tif ($word_count > 0)\n\t\t{\n\t\t\t$page->characters[$char_count++] = '-1';\n\t\t}\n\t\n\t\tforeach ($word_chars as $char)\n\t\t{\n\t\t\t$page->characters[$char_count++] = $word_count;\n\t\t}\n\t\n\t\t$word_count++;\n\t}\n\n\t// Craete text stream for page by joining all the words together\n\t$page->text = join(' ', $page->words);\n\n\t\n\treturn $page;\n}", "function makePage($nav, $title, $body, $style){\n\t$return = null;\n\n\n\n\t$tags[\"start\"] = \"<html><head><style>\".\n\t$style\n\t.\"</style><title>\".\n\t$title\n\t.\"</title></head><body>\";\n\t$tags[\"end\"] = \"</body></html>\";\n\n\t$return = $tags[\"start\"].\"<div class='nav'>\".$nav.\"</div>\".$body.$tags[\"end\"];\n\n\treturn $return;\n\n\t\n}", "function page_text($x, $y, $text, $font, $size, $color = array(0,0,0), $adjust = 0, $angle = 0) {\n $this->_pdf->close_object();\n $this->_pdf->page_text($x, $y, $text, $font, $size, $color, $adjust, $angle);\n $this->_pdf->reopen_object($this->_current_page_id);\n }", "public static function create()\n\t{\n\t\t$page = \"Main\";\n\n\t\t// check the requested page title for safety and sanity\n\t\t\n\t\t$pathinfo = explode('/', WebRequest::pathInfo());\n\t\t$pathinfo = array_values(array_filter($pathinfo));\n\t\tif(\n\t\t\tcount($pathinfo) >= 1 &&\n\t\t\t$pathinfo[0] != \"\" && // not empty\n\t\t\t(!ereg(\"[^a-zA-Z0-9]\", $pathinfo[0])) // contains only alphanumeric chars\n\t\t)\n\t\t{\n\t\t\t$page = $pathinfo[0];\n\t\t}\n\t\t\n\t\t// okay, the page title should be reasonably safe now, let's try and make the page\n\t\t\n\t\t$pagename = \"Page\" . $page;\n\t\t\n\t\tglobal $cIncludePath;\n\t\t$filepath = $cIncludePath . \"/Page/\" . $pagename . \".php\";\n\t\t\n\t\tif(file_exists($filepath))\n\t\t{\n\t\t\trequire_once($filepath);\n\t\t}\n\t\telse\n\t\t{\t// oops, couldn't find the requested page, let's fail gracefully.\n\t\t\t$pagename = \"Page404\";\n\t\t\t$filepath = $cIncludePath . \"/Page/\" . $pagename . \".php\";\n\t\t\trequire_once($filepath);\n\t\t}\t\n\n\t\tif(class_exists($pagename))\n\t\t{\n\t\t\t$pageobject = new $pagename;\n\t\t\t\n\t\t\tif(get_parent_class($pageobject) == \"PageBase\")\n\t\t\t{\n\t\t\t\tHooks::run(\"CreatePage\", array($pageobject));\n\t\t\t\t\n\t\t\t\treturn $pageobject;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// defined, but doesn't inherit properly, so we can't guarentee stuff will work.\n\t\t\t\tthrow new Exception();\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// file exists, but the class \"within\" doesn't, this is a problem as stuff isn't where it should be.\n\t\t\tthrow new Exception();\n\t\t}\n\t}", "function mkPage($subtitle = '', $menu = 0, $level = 0)\n{\n global $app, $globalSettings;\n\n if ($subtitle == '') {\n $title = $globalSettings[DISPLAY_APP_NAME];\n } else {\n $title = $globalSettings[DISPLAY_APP_NAME] . $globalSettings['sep'] . $subtitle;\n }\n $rot = mkRootUrl();\n $auth = is_authenticated();\n if ($globalSettings[LOGIN_REQUIRED]) {\n $adm = is_admin();\n } else {\n $adm = true;\n } # the admin button should be always visible if no login is required\n $page = ['title' => $title,\n 'rot' => $rot,\n 'h1' => $subtitle,\n 'version' => $globalSettings['version'],\n 'glob' => $globalSettings,\n 'menu' => $menu,\n 'level' => $level,\n 'auth' => $auth,\n 'admin' => $adm];\n return $page;\n}", "public function create(Page $page)\n {\n return $this->view('titan::pages.components.content')\n ->with('page', $page);\n }", "function createContent($page)\n{\n\tswitch ($page) \n\t{ \n\t\tcase \"Bio-Home\":\n\t\t\treturn createBioHomeContent();\t\n\t\t\tbreak;\n\t\tcase \"Bio-New\":\n\t\t\treturn createBioNewContent();\t\n\t\t\tbreak;\n\t\tcase \"Bio-New-Organism\":\n\t\t\treturn createBioNewOrgContent();\t\n\t\t\tbreak;\n\t\tcase \"Bio-New-Tank\":\n\t\t\treturn createBioNewTankContent();\n\t\t\tbreak;\n\t\tcase \"Bio-New-Plate\":\n\t\t\treturn createBioNewPlateContent();\n\t\t\tbreak;\n\t\tcase \"Bio-New-Bacteria\":\n\t\t\treturn createBioNewBacteriaContent();\n\t\t\tbreak;\n\t\tcase \"Bio-New-Colony\":\n\t\t\treturn createBioNewColonyContent();\n\t\t\tbreak;\n\t\tcase \"Bio-New-Sequence\":\n\t\t\treturn createBioNewSequenceContent();\n\t\t\tbreak;\n\t\tcase \"Bio-Edit\":\n\t\t\treturn createBioEditContent();\n\t\t\tbreak;\n\t\tcase \"Bio-Blast\":\n\t\t\treturn createBioBlastContent();\n\t\t\tbreak;\n\t\tdefault:\n\t\t\treturn createErrorContent();\n\t\t\tbreak;\n\t}\n\t\n\n}", "public function main(){\n $pdf = new PDF();\n $pdf->AliasNbPages();\n $pdf->AddPage();\n $pdf->SetFont('Times','',12);\n for($i=1;$i<=40;$i++){\n $pdf->Cell(0,10,'Printing line number '.$i,0,1);\n }\n\n // First page\n $html = 'You can now<np> easily print text mixing different styles: <b>bold</b>, <i>italic</i>,\n <u>underlined</u>, or <b><i><u>all at once</u></i></b>!<br><br>You can also insert links on\n text, such as <a href=\"http://www.fpdf.org\">www.fpdf.org</a>, or on an image: click on the logo.';\n\n $pdf->AddPage();\n $pdf->SetFont('Arial','',20);\n // $pdf->Write(5,\"To find out what's new in this tutorial, click \");\n // $pdf->SetFont('','U');\n // $link = $pdf->AddLink();\n // $pdf->Write(5,'here',$link);\n // $pdf->SetFont('');\n // // Second page\n // $pdf->AddPage();\n // $pdf->SetLink($link);\n // $pdf->Image('logo.png',10,12,30,0,'','http://www.fpdf.org');\n $pdf->SetLeftMargin(15);\n $pdf->SetFontSize(14);\n $pdf->WriteHTML($html);\n\n $pdf->Output();\n\n }", "function createSamplePage(){\n\tif(the_slug_exists('custom-page')==false)\n\t{\n\t\tglobal $user_ID;\n\t $new_post = array(\n 'post_title' => 'Custom Page',\n 'post_content' => 'Sample content here',\n 'post_status' => 'publish',\n 'post_date' => date('Y-m-d H:i:s'),\n 'post_author' => $user_ID,\n 'post_type' => 'page',\n );\n $post_id = wp_insert_post($new_post);\n\t}\n}", "public function create_page($page_body, $title='', Array $css_files = array(), Array $js_files = array(),$return = false)\r\n\t{\r\n\t\tif(!$css_files) {\r\n $css_files = array($this->config->default_css_file);\t\t\r\n }\r\n\t\t$header_contents = array('page_title'=>$title,'css_files'=>$css_files,'js_files'=>$js_files);\r\n\t\t$page_header = $this->display_page('page_header',$header_contents,true);\r\n\t\t$page_footer = $this->display_page('page_footer',array(),true);\r\n\t\tif($return) {\r\n return $page_header.$page_body.$page_footer;\r\n }\r\n\t\telse {\r\n echo $page_header.$page_body.$page_footer;\r\n }\r\n\t}", "public function generate($path)\n {\n $this->newPage();\n $this->makeLetterhead();\n $this->makeTitle();\n $this->makeBeforeInfo();\n $this->makeEntries();\n $this->makeAfterInfo();\n $this->output('F', $path, true);\n }", "function SimpleText($text, $style=\"\") {\n\t\tif (false) {\n\t\t\t/*\n\t\t\t * FIXME: this is fundamentally broken, because\n\t\t\t * it creates a new CCE connection for every\n\t\t\t * SimpleText object created\n\t\t\t */\n\t\t\tinclude(\"uifc/Stylist.php\");\n\t\t\tinclude(\"ServerScriptHelper.php\");\n\t\t\t$crackaddict = new ServerScriptHelper();\n\t\t\t$stylist = $crackaddict->getStylist();\n\t\t\t$this->style = $stylist->getStyle(\"SimpleText\"); // try this\n\t\t\t\n\t\t\tif($this->style->getPropertyNumber()) { \n\t\t\t\t$this->style = $stylist->getStyle(\"Page\"); // default\n\t\t\t}\n\t\t\t\t\n\t\t} else {\n\t\t\t$this->style = $style;\n\t\t}\t\t\n\t\t$this->text = $text;\n\t}", "public static function create()\n {\n $page = new Page();\n $page->site_id = \\Bazalt\\Site::getId();\n if (!\\Bazalt\\Auth::getUser()->isGuest()) {\n $page->user_id = \\Bazalt\\Auth::getUser()->id;\n }\n return $page;\n }", "public static function create($text = '')\n {\n return new static($text);\n }", "function createPages() {\n\t// drop pages table (for development only)\n\tDB::exec(\"DROP TABLE IF EXISTS pages\");\n\n\t// `name` should be unique and cannot be null\n\t// `route` must be unique but can be null (e. g. when a page shouldn't be accessible via an URL)\n\t// `layout` is a foreign key that references ANOTHER row in the pages table,\n\t// \tif the referenced row is deleted the value will be set to NULL\n\tDB::exec(\"CREATE TABLE pages (\n\t\tid INT NOT NULL AUTO_INCREMENT PRIMARY KEY,\n\t\tname VARCHAR(50) NOT NULL UNIQUE,\n\t\troute VARCHAR(50) NULL UNIQUE,\n\t\tcontent TEXT NULL\n\t)\");\n\n\toutput(RESULT_INFO, \"Pages setup successfully completed\");\n\treturn 1;\n}", "public function drawPage()\n\t\t{\n\t\t}", "public function actionCreate() {\n $model = new page();\n if ($model->load(Yii::$app->request->post())) {\n $slug = str_replace(' ', '-', $_POST['page']['pageName']);\n $model->pageDateCreated = date('y-m-d h:i:s');\n $model->slug = $slug;\n if ($model->save()) {\n Yii::$app->session->setFlash('item', 'Page has been created successfully!');\n }\n return $this->redirect(['index']);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function run()\n\t{\n\t\tDB::table('pages')->delete();\n\t\tPage::create(array(\n\t 'heading1' => '<h2 class=\"red-title\"><span>Driving Network Solution</span></h2>',\n 'body1' => '<p>Established in 2000, OCK Group is principally involved in the provision of telecommunications network services. We are able to provide full turnkey services in that respect.</p>',\n 'heading2' => '',\n 'body2' => '', \n\t ));\n\t\t\n\t}", "public function create()\n {\n $thread = new Thread;\n $comment = new Comment;\n $page = Param::get('page_next', 'create');\n $username = $_SESSION['username'];\n\n switch ($page) {\n case 'create':\n break;\n case 'create_end';\n $thread->title = Param::get('title');\n $comment->username = $username;\n $comment->body = Param::get('body');\n try {\n $thread->create($comment);\n } catch (ValidationException $e) {\n $page = 'create';\n }\n break;\n default:\n throw new NotFoundException(\"{$page} is not found\");\n break;\n }\n\n $this->set(get_defined_vars());\n $this->render($page);\n }", "public function create($data)\n {\n return Page::create($data);\n }", "abstract protected function render_page_content(): void;", "function printParagraph( $text ) {\n return \"<p>{$text}</p>\";\n }", "public function testPageCreate()\n {\n $faker = Faker::create();\n $response = $this\n ->actingAs(User::whereNotNull(\"verified\")->inRandomOrder()->first(), 'api')\n ->withHeaders([\n \"User-Agent\" => $faker->userAgent(),\n ])\n ->json('POST', \"/api/pages/\", [\n \"data\" => [\n \"name\" => $faker->sentence(4, true),\n ],\n \"relationships\" => [\n \"body\" => [\n \"data\" => [\n \"content\" => $faker->paragraphs(4, true),\n ],\n ],\n ],\n ]);\n $response\n ->assertStatus(201);\n }", "function parrafo($text){\r\n return \"<p>$text</p>\";\r\n }", "public function printPage()\n {\n $this->printDoctype();\n $this->printOpenHtml();\n $this->printHead(' ');\n $this->printBody(' ');\n $this->printCloseHtml();\n }", "function showPage() \n\t{\n\t\t$this->xt->display($this->templatefile);\n\t}", "public function createContentAndCopyLivePage() {}", "public function create()\n {\n return view('backend::page.create');\n }", "public function create()\n\t\t{\n\t\treturn view('page.create');\n\t}", "public function createPageUsingTemplateObject()\n\t{\n\t\tglobal $tpl, $lng, $ilCtrl;\n\n\t\t$form = $this->initTemplateSelectionForm();\n\t\tif ($form->checkInput())\n\t\t{\n\t\t\t$a_page = $_POST[\"page\"];\n\t\t\t$this->object->createWikiPage($a_page, (int) $_POST[\"page_templ\"]);\n\n\t\t\t// redirect to newly created page\n\t\t\t$ilCtrl->setParameterByClass(\"ilwikipagegui\", \"page\", ilWikiUtil::makeUrlTitle(($a_page)));\n\t\t\t$ilCtrl->redirectByClass(\"ilwikipagegui\", \"edit\");\n\n\t\t\tilUtil::sendSuccess($lng->txt(\"msg_obj_modified\"), true);\n\t\t\t$ilCtrl->redirect($this, \"\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$form->setValuesByPost();\n\t\t\t$tpl->setContent($form->getHtml());\n\t\t}\n\t}", "public function pageCreate($page_id, $content, $title = '') {\n\t\t// Build the MindTouch API URL to create or update a page's content.\n\t\t$url = $this->pageUrl($page_id) . \"/contents?edittime=\" . $this->edit_time . \"&overwrite=true\";\n\n\t\t// Deal with title when provided.\n\t\tif (!empty($title)) {\n\t\t\t$url .= \"&title=\" . urlencode($title);\n\t\t}\n\n\t\t// Get output from API.\n\t\t$output = $this->post($url, $content);\n\n\t\t// Parse the output.\n\t\t$output = $this->parseOutput($output);\n\n\t\treturn $output;\n\t}", "public function create()\n {\n //获取公司简介信息\n $com = Page::where(\"type\",'=',1)->first();\n // 加载公司简介视图\n return view('admin.page.create')->with('jianjie',$com);\n }", "public function new_page() {\n\n\t\tif ( ! class_exists( 'Premise_WP' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$demo_options = array(\n\t\t\t'title' => 'Premise Demo Page',\n\t\t\t'menu_title' => 'Premise Demo',\n\t\t\t'capability' => 'manage_options',\n\t\t\t'menu_slug' => 'premise_demo_page',\n\t\t\t'callback' => array( $this, 'display_code' ),\n\t\t\t'icon' => '',\n\t\t\t'position' => '59.2',\n\t\t);\n\n\t\tnew PWP_Admin_Page( $demo_options, '', $this->opt_name );\n\t}", "function NewPage()\n {\n $ypos = $this->GetY();\n if ($ypos > 230){\n $this->AddPage();\n }\n }", "public function page () {\n\t\tinclude _APP_ . '/views/pages/' . $this->_reg->controller . '/' . $this->_page . '.phtml';\n\t}", "function pageToPDF($page, $template, $text) {\n $pdf = new concat_pdf('P','mm','Letter');\n $pdf->setFiles($page); //$files is an array with existing PDF files.\n $pdf->setInput($text,$template);\n $pdf->concat();\n $pdf->Output('boo.pdf','I');\n}", "public function startNewPage()\n {\n }", "function page_viewer( $page_id )\n{\n if( $page_id == null )\n {\n show_error_page( \"No page requested.\" );\n return;\n }\n $connection = get_system_connection();\n $page = new Page();\n $page->create_from_database( $page_id );\n}", "public function create($id)\n {\n return view('biogmains.texts.create', [\n 'id' => $id,\n 'page_title' => 'Basicinformation', 'page_description' => '基本信息表 著述', 'page_url' => '/basicinformation/'.$id.'/texts']);\n }", "protected function page_default () {\r\n\t\t$skeleton = new xhtml ('skeleton.basic');\r\n\t\t$skeleton->load();\r\n\t\t$content=\"\";\r\n\t\t/**\r\n\t\t * Fetch the body content template\r\n\t\t */\r\n\t\tif(config::get('locale')!='') {\r\n\t\t\t$body = new xhtml ('body.vidtuts.'.config::get('locale'));\r\n\t\t} else {\r\n\t\t\t$body = new xhtml ('body.vidtuts');\r\n\t\t}\r\n\t\t$body->load();\r\n\r\n\t\t/**\r\n\t\t * Fetch the translated terms\r\n\t\t */\r\n\t\t$query = \"SELECT \";\r\n\t\t$query.= \"`html` \";\r\n\t\t$query.= \"FROM \";\r\n\t\t$query.= \"`page_terms_translations` \";\r\n\t\t$query.= \"WHERE \";\r\n\t\t$query.= \"`locale`='\".config::get('locale').\"' \";\r\n\t\t$query.= \"LIMIT 1\";\r\n\r\n\t\t$result = database::query($query);\r\n\r\n\t\tif($result && mysql_error()=='' && mysql_num_rows($result) > 0) {\r\n\t\t\t$row = mysql_fetch_assoc($result);\r\n\r\n\t\t\t$date = date('d/m/Y');\r\n\r\n\t\t\t$content = str_replace('{{ date }}',$date,stripslashes($row['html']));\r\n\t\t}\r\n\r\n\t\t$body->assign('content',$content);\r\n \r\n\t\t/**\r\n\t\t * Fetch the page details\r\n\t\t */\r\n\t\t$page = new page('terms');\r\n\r\n\t\t/**\r\n\t\t * Build the output\r\n\t\t */\r\n\t\t$skeleton->assign (\r\n\t\t\tarray (\r\n\t\t\t\t'title'\t\t\t=> /*$page->title()*/'Video Tutorials',\r\n\t\t\t\t'keywords'\t\t=> $page->keywords(),\r\n\t\t\t\t'description'\t=> $page->description(),\r\n\t\t\t\t'body'\t\t\t=> $body\r\n\t\t\t)\r\n\t\t);\r\n \r\n\t\toutput::as_html($skeleton,true);\r\n \r\n\t}", "public function run()\n {\n PageContent::factory()->aboutUs()->state([\n 'content' => 'D\\'more Event Planner is an Event Planning Software is cutting-edge tool which will allow the client all the resources and visual aids for their event planning. They will be able to play with decoration themes, listen to theme music, design invitations, thank-you cards, and RSVP cards, use the interactive planning calendar, and much more. This software will bring your event into the millennium with cutting edge technology that is designed to save time and money.'\n ])->create();\n PageContent::factory()->aboutUs()->state([\n 'content' => 'We also provide a Step-by-Step Guide in preparation to your event which include a calendar to map out the event, a step-by-step guide on what is needed for and how to put together a successful, worry-free event, resource information, popular refreshments with recipes, games, and tips to put their event in the record books. The events available include birthdays for all ages, meetings, retreats, parties, vacations, and special occasion celebrations such as graduations, holidays, showers, weddings, and receptions.'\n ])->create();\n }", "static public function create($uri, $template, $data = array()) {\n\n if(!is_string($template) or empty($template)) {\n throw new Exception('Please pass a valid template name as second argument');\n }\n\n // try to create the new directory\n $uri = static::createDirectory($uri);\n\n // create the path for the textfile\n $file = textfile($uri, $template);\n\n // try to store the data in the text file\n if(!data::write($file, $data, 'kd')) {\n throw new Exception('The page file could not be created');\n }\n\n // get the new page object\n $page = page($uri);\n\n if(!is_a($page, 'Page')) {\n throw new Exception('The new page object could not be found');\n }\n\n // let's create a model if one is defined\n if(isset(static::$models[$template])) {\n $model = static::$models[$template];\n $page = new $model($page->parent(), $page->dirname());\n }\n\n kirby::instance()->cache()->flush();\n\n return $page;\n\n }", "public function createpage(){\n\n if($this->check() == true){\n if(isset($_POST['submit']))\n {\n $link = $_POST['link'];\n $header = htmlentities($_POST['header'], ENT_QUOTES);\n $this->admindb->insert(\"pages\", array(\n \"linkname\" => $link,\n \"header\" => $header\n ))->get();\n }\n $this->view(\"admin/pagecreate\");\n }\n\n }", "public function testAPage()\n {\n Page::create([\n 'slug' => 'a-page',\n 'title' => 'Test title',\n 'content' => 'Test content',\n ]);\n $this->get('a-page')->assertStatus(200)->assertSee('Test title')->assertSee('Test content');\n }", "public function create(string $name): PageDecorator;", "public function displayAction() {\r\n\r\n //GET THE TEXT STRING\r\n $text = $this->_getParam('text_string');\r\n\r\n //GET PAGE ID\r\n $page_id = $this->_getParam('page_id');\r\n\r\n $writesTable = Engine_Api::_()->getDbtable('writes', 'sitepage')->setWriteContent($page_id, $text);\r\n exit();\r\n }", "function Page( $tpl_engine = null ){\n\t\tparent::Control($tpl_engine) ;\n\n\t\t$this->trace(\"instanciation Page\") ;\n\t\t\n\t\t$this->title = \"New Page\" ;\n\t\t$this->smarty->assignByRef(\"title\",$this->title) ;\n\t\t\n\t\t$this->forms = array() ;\n\t\t\n\t\t// Browser configuration\n\t\t\n\t\t$this->browser = new Browser() ;\n\t\t\n\t\t$this->meta = array() ;\n\t\t$this->smarty->assignByRef(\"meta\",$this->meta) ;\n\n\t\tif( $this->browser->isIphone() ){\n\t\t\t$this->addMeta(\"viewport\",\"width=640\") ;\n\t\t\t$this->addMeta(\"apple-mobile-web-app-capable\",\"yes\") ;\n\t\t}\n\n\t\tif( $this->browser->isInternetExplorer() ){\n\t\t\t$this->addMeta(\"X-UA-Compatible\",\"IE=8\") ;\n\t\t}\n\n\t\t$this->css = array() ;\n\t\t$this->smarty->assignByRef(\"css\",$this->css) ;\n\n\t\t$this->addCss(\"reset.css\") ;\n\t\t$this->addCss(\"common.css\") ;\n\t\t\n\t\t$this->js = array() ;\n\t\t$this->smarty->assignByRef(\"js\",$this->js) ;\n\t\t\n\t\t$this->setPlugin();\n\t\t\n\t}", "public function create()\n {\n $page = new WikiPage;\n\n if ($this->createSlug) {\n $page->slug = $this->createSlug;\n }\n\n return view('cms-wiki::wiki.edit', [\n 'creating' => true,\n 'page' => $page,\n 'previousUrl' => $this->getPreviousUrl(),\n ]);\n }", "public function add( $text ) {\n\t\t$this->page->append( $text );\n\t}", "public function display($pageName);", "public function createPage($page, $lang = null) {\n\t\t$page = preg_replace('/\\-[a-z]{2}\\.(php|gif|jpg|pdf)$/', '.$1', $page);\n\n\t\tif (is_null($lang)) {\n\t\t\t$lang = $this->get();\n\t\t}\n\n\t\tif ($lang === '') {\n\t\t\t$lang = self::$langDefault;\n\t\t}\n\n\t\tif ($lang !== self::$langDefault) {\n\t\t\t//$page = str_replace('.php', '-'.$lang.'.php', $page);\n\t\t\t$page = preg_replace('/\\.(php|gif|jpg|pdf)$/', '-'.$lang.'.$1', $page);\n\t\t}\n\n\t\treturn $page;\n\t}", "public function run()\n {\n $title = [\n 'en' => 'Welcome to example page',\n 'es' => 'Bienvenidos a la página de ejemplo',\n 'ca' => 'Benvinguts a la página d\\'exemple'\n ];\n\n $slug = [\n 'en' => 'example-page',\n 'es' => 'pagina-ejemplo',\n 'ca' => 'exemple-de-pagina'\n ];\n\n $content = [\n 'ca' => '<h2>Benvinguts</h2><p>Aquesta es una p&aacute;gina d&#39;exemple per a %%_former_company_name_%%. Vost&eacute; pot contactar-nos per email a %%_former_company_email_%% o per correu convencional a:</p><p>%%_former_company_adress_1_%%<br />%%_former_company_adress_2_%%<br />\n %%_former_company_country_%%</p>',\n\n 'en' => '<h2>Welcome</h2><p>This is a simple example page for %%_former_company_name_%%. You can contact us at %%_former_company_email_%% or by post email at this address:</p><p>%%_former_company_adress_1_%%<br />%%_former_company_adress_1_%%<br />\n %%_former_company_country_%%</p>',\n\n\n 'es' => '<h2>Bienvenidos</h2><p>Esta es una p&aacute;gina de ejemplo para %%_former_company_name_%%. Usted puede contactar con nosotros via email en %%_former_company_email_%% o por correo convencional en:</p><p>%%_former_company_adress_1_%%<br />%%_former_company_adress_2_%%<br />\n %%_former_company_country_%%</p>'\n ];\n\n $page = Page::create([\n 'template' => 'main_layout',\n 'name' => 'example page',\n 'title' => $title['en'],\n 'slug' => $slug['en'],\n 'content' => $content['en']\n ]);\n \n $page->setTranslations('title', $title);\n $page->setTranslations('slug', $slug);\n $page->setTranslations('content', $content);\n\n $page->save();\n }", "public function create()\n {\n return view(\"pages.create\");\n }", "public static function linkStoryCreate($text, $options=[])\n {\n $link=Url::toRoute(['/story/create']);\n return Html::a($text, $link, $options);\n }", "public function create()\n {\n $user_id = auth()->user()->id;\n return view(\"pages.create\")->with(\"user\", $user_id);\n }", "public static function printText($text)\n {\n $text = self::removeDivs($text);\n echo '<p class=\"text-content\">' . $text .'<p>';\n }", "public function show() {\n $this->buildPage();\n echo $this->_page;\n }", "function tpl_page($help = '', $title = '')\n{\n tpl_language();\n tpl_header($help, $title);\n tpl_footer();\n}", "function templatePage ($s_content, $s_title, $s_header='', $s_footer='') {\n\treturn template_tags (template_load ('base.html'), array (\n\t\t'TITLE' => $s_title, 'HEADER' => $s_header, 'FOOTER' => $s_footer, 'CONTENT' => $s_content\n\t));\n}", "public function create()\n {\n $page = new Page();\n $page->created_at = date('Y-m-d H:i:s');\n\n $data['autoIncrement'] = get_autoincrement('content');\n $data['action'] = route('admin.pages.store');\n $data['page'] = $page;\n\n return view('admin.pages.form', $data)->with(['title' => 'Создание страницы']);\n }", "protected function createPage($name, $hierarchy, Page $parent = null): Page\n {\n $page = new Page();\n $page->setParent($parent);\n $page->setHierarchy($hierarchy);\n $page->setPublish(1);\n $page->setRedirectType(0);\n $page->setSection('');\n $page->addShop($this->shop);\n foreach ($this->getLocales() as $locale) {\n /** @var PageTranslation $translation */\n $translation = $page->translate($locale->getCode());\n $translation->setName($name);\n $translation->setSlug(Helper::urlize($name));\n $translation->setContent($this->defaultText);\n }\n \n $page->mergeNewTranslations();\n \n $this->manager->persist($page);\n \n return $page;\n }", "function test_basic_existingpage(){\n global $ID,$conf;\n $ID = 'wiki:syntax';\n $filename = $conf['datadir'].'/wiki/syntax.txt';\n $rev = filemtime($filename);\n\n $info = $this->_get_expected_pageinfo();\n $info['id'] = 'wiki:syntax';\n $info['namespace'] = 'wiki';\n $info['filepath'] = $filename;\n $info['exists'] = true;\n $info['lastmod'] = $rev;\n $info['currentrev'] = $rev;\n $info['meta'] = p_get_metadata($ID);\n\n $this->assertEquals($info, pageinfo());\n }", "#[@test]\n function testCreation() {\n $doc= &new PDFDocument();\n $root= &$doc->getRootPage();\n $root->addChild(new PDFPage());\n }", "public function index()\n {\n $customPage = new CustomPage();\n $customPage->title = trans('app.privacy_policy');\n $customPage->text = Config::get('app.privacy_policy');\n\n $this->title($customPage->title);\n $this->pageView('pages::show_custom_page', compact('customPage'));\n }", "private function content() {\n $this->checkPost();\n\n if (isset($_SESSION['CREATE'])) {\n\n switch ($_SESSION['CREATE']['page']) {\n case 0:\n $this->pageAgreement();\n break;\n case 1:\n $this->pageNameIntro();\n break;\n case 2:\n $this->pageMark();\n break;\n case 3:\n $this->pageFinal();\n break;\n default:\n echo '<h1>Error: Page Invalid<h1>';\n break;\n }\n\n }else\n echo '<h1>Error: Session invalid</h1>';\n }", "public function makePage()\n {\n $db = new DB();\n $page_color = !empty($db->getOptions('page_color')) ? 'style=\"background-color:' . $db->getOptions('page_color') . ';\"' : '';\n $footer_color = !empty($db->getOptions('footer_color')) ? 'style=\"background-color:' . $db->getOptions('footer_color') . ';\"' : '';\n echo '<!DOCTYPE html>\n<html lang=\"en\">\n<head>';\n\n $this->makeMeta();\n $this->setTitle();\n $this->makeStyles();\n $this->makeHeaderScripts();\n echo '<!-- header code -->' . PHP_EOL;\n if (!empty($this->getHeaderCode())) {\n echo $this->getHeaderCode() . PHP_EOL;\n }\n echo '<!-- header code -->' . PHP_EOL;\n echo '</head>\n\n\t\t<body class=\"' . $this->getbodyClass() . '\" ' . $page_color . '>';\n\n echo '<div class=\"main-wrapper\" >';\n if ($this->hasHeader) {\n echo '<header class=\"header\" >';\n if ($this->hasNavbar) {\n require_once 'Navbar.php';\n }\n echo '</header>';\n }\n\n\n//--main content---\n if ($this->hasBreadcrumb) {\n $routes = explode(\"/\", $_SERVER['REQUEST_URI']);\n echo '\n<div class=\"breadcrumb-bar d-print-none\" ' . $footer_color . '>\n\t\t\t\t<div class=\"container-fluid\">\n\t\t\t\t\t<div class=\"row align-items-center\">\n\t\t\t\t\t\t<div class=\"col-md-12 col-12\">\n\t\t\t\t\t\t\t<nav aria-label=\"breadcrumb\" class=\"page-breadcrumb\">\n\t\t\t\t\t\t\t\t<ol class=\"breadcrumb\">\n\t\t\t\t\t\t\t\t\t<li class=\"breadcrumb-item\"><a href=\"' . BASE_PATH . $routes[1] . '/\"><i class=\"bx bx-home-alt\"></i></a></li>';\n\n for ($i = 1; $i < count($routes) - 1; $i++) {\n if ($i != count($routes) - 1) {\n echo '<li class=\"breadcrumb-item\"><a href=\"' . BASE_PATH . $routes[1] . '/' . $routes[$i] . '/\">' . $routes[$i] . '</a></li>';\n } else {\n echo '<li class=\"breadcrumb-item active\">' . $routes[$i] . '</li>';\n }\n }\n echo '\n\t\t\t\t\t\t\t\t</ol>\n\t\t\t\t\t\t\t</nav>\n\t\t\t\t\t\t\t<h2 class=\"breadcrumb-title\">' . $this->getPageTitle() . '</h2>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>';\n }\n echo '<div class=\"content\">';\n echo '<div class=\"container-fluid\">';\n if ($this->isHasContent()) {\n $this->addPageContent($this->getPageContent());\n }\n\n echo '</div></div>';\n\n echo '<!-- above footer code -->' . PHP_EOL;\n\n /*--footer---*/\n if ($this->hasFooter) {\n require_once 'footer.php';\n }\n echo '</div>';\n $this->makeScripts();\n $this->makeFooterScripts();\n if ($this->ishasError()) {\n $this->showPageError();\n }\n\n echo '<!-- footer code -->' . PHP_EOL;\n if (!empty($this->getFooterCode())) {\n echo $this->getFooterCode() . PHP_EOL;\n }\n echo '<!-- footer code -->' . PHP_EOL;\n echo '</body>\n</html>';\n }" ]
[ "0.71133447", "0.70919126", "0.68206435", "0.6663681", "0.6584106", "0.64892197", "0.64714205", "0.64671624", "0.639714", "0.6348594", "0.6295577", "0.6226284", "0.6214384", "0.60971814", "0.6076142", "0.6063075", "0.6040363", "0.60019076", "0.5956818", "0.593206", "0.5907296", "0.5902176", "0.5883137", "0.5878444", "0.584667", "0.5838329", "0.58318603", "0.58179826", "0.5781878", "0.57786554", "0.57623166", "0.57584614", "0.57300377", "0.57191145", "0.5710086", "0.56886333", "0.56790906", "0.5676861", "0.56735766", "0.56681335", "0.5659807", "0.56527245", "0.56483006", "0.5646629", "0.5642138", "0.56372964", "0.5629431", "0.5629345", "0.56270754", "0.5620976", "0.5620499", "0.56198984", "0.56197697", "0.560377", "0.55948395", "0.55887455", "0.55871046", "0.5587094", "0.558573", "0.55785644", "0.5570829", "0.55665416", "0.5563891", "0.55583173", "0.5549957", "0.5540092", "0.5523191", "0.55198884", "0.55130947", "0.5506594", "0.5505228", "0.54918486", "0.54827", "0.54595584", "0.54582596", "0.54582274", "0.5456971", "0.5456412", "0.5453783", "0.5453062", "0.54433167", "0.5440636", "0.54334503", "0.5422951", "0.54209024", "0.5415584", "0.54101926", "0.5400888", "0.53996414", "0.5391227", "0.5389518", "0.5376359", "0.53736645", "0.53679687", "0.53665143", "0.5362929", "0.5362542", "0.5361768", "0.5359405", "0.53561336" ]
0.68299466
2
Strip slashes if magic_quotes_gpc is set.
function StripGPC($s_value) { if (get_magic_quotes_gpc() != 0) $s_value = stripslashes($s_value); return ($s_value); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function removeMagicQuotes() {\n if ( get_magic_quotes_gpc() ) {\n $_GET = $this->stripSlashesDeep($_GET);\n $_POST = $this->stripSlashesDeep($_POST);\n $_COOKIE = $this->stripSlashesDeep($_COOKIE);\n }\n }", "private function _remove_magic_quotes()\n {\n if(get_magic_quotes_gpc()) {\n $_GET = $this->_strip_slashes_deep($_GET);\n $_POST = $this->_strip_slashes_deep($_POST);\n $_COOKIE = $this->_strip_slashes_deep($_COOKIE);\n }\n }", "public static function removeMagicQuotes() {\r\n if (get_magic_quotes_gpc() ) {\r\n \tif(isset($_GET)){\r\n \t\t$_GET = self::stripSlashesDeep($_GET);\r\n \t}\r\n \r\n\t\t\tif(isset($_POST)){\r\n \t\t$_POST = self::stripSlashesDeep($_POST);\r\n \t}\r\n \r\n\t\t\tif(isset($_COOKIE)){\r\n \t\t$_COOKIE = self::stripSlashesDeep($_COOKIE);\r\n \t}\r\n \r\n }\r\n }", "static function stripMagic() {\n\t\t@set_magic_quotes_runtime(0);\n\t\t// if magic_quotes_gpc strip slashes from GET POST COOKIE\n\t\tif (get_magic_quotes_gpc()){\n\t\tfunction stripslashes_array($array) {\n\t\t return is_array($array) ? array_map('stripslashes_array',$array) : stripslashes($array);\n\t\t}\n\t\t$_GET= stripslashes_array($_GET);\n\t\t$_POST= stripslashes_array($_POST);\n\t\t$_REQUEST= stripslashes_array($_REQUEST);\n\t\t$_COOKIE= stripslashes_array($_COOKIE);\n\t\t}\n\t}", "function undo_magic_quotes() {\n if (get_magic_quotes_gpc()) {\n \n $in = array(&$_GET, &$_POST, &$_REQUEST, &$_COOKIE);\n \n while (list($k,$v) = each($in)) {\n foreach ($v as $key => $val) {\n if (!is_array($val)) {\n $in[$k][$key] = stripslashes($val);\n continue;\n }\n $in[] =& $in[$k][$key];\n }\n }\n \n unset($in);\n }\n }", "function RemoveMagicQuotesGPC()\n\t{\n\t\t// Check magic quotes state for GPC\n\t\tif (get_magic_quotes_gpc())\n\t\t{\n\t\t\t// Remove magic quotes in GET\n\t\t\t$_GET = RemoveSlashes($_GET);\n\t\t\t// Remove magic quotes in POST\n\t\t\t$_POST = RemoveSlashes($_POST);\n\t\t\t// Remove magic quotes in COOKIE\n\t\t\t$_COOKIE = RemoveSlashes($_COOKIE);\n\t\t}\n\t}", "function smartstripslashes($str) {\n\t\tif ( get_magic_quotes_gpc() == true ) {\n\t\t\t$str = stripslashes($str);\n\t\t}\n\t\treturn $str;\n\t}", "private static function _undoMagicQuotes(){\n\t\t\n\t\tif (get_magic_quotes_gpc()) {\n\n\t\t\tfunction stripslashes_array($data) {\n\t\t\t\tif (is_array($data)) {\n\t\t\t\t\tforeach ($data as $key => $value) {\n\t\t\t\t\t\t$data[$key] = stripslashes_array($value);\n\t\t\t\t\t}\n\t\t\t\t\treturn $data;\n\t\t\t\t} else {\n\t\t\t\t\treturn stripslashes($data);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$_REQUEST = stripslashes_array($_REQUEST);\n\t\t\t$_GET = stripslashes_array($_GET);\n\t\t\t$_POST = stripslashes_array($_POST);\n\t\t\t$_COOKIE = stripslashes_array($_COOKIE);\n\t\t\tif(isset($_FILES))\n\t\t\t\t$_FILES = stripslashes_array($_FILES);\n\t\t}\n\t}", "function remove_wp_magic_quotes() {\r\n\t\t$_GET = stripslashes_deep($_GET);\r\n\t\t$_POST = stripslashes_deep($_POST);\r\n\t\t$_COOKIE = stripslashes_deep($_COOKIE);\r\n\t\t$_REQUEST = stripslashes_deep($_REQUEST);\r\n\t}", "function &stripSlashesGPC( $text, $force = false ) {\n if ( get_magic_quotes_gpc() || $force == true ) {\n $text = stripslashes( $text );\n }\n return $text;\n }", "function _check_magic_quotes($value){\n\t\treturn $this->_magic_quotes?stripslashes($value):$value;\n\t}", "public static function StripSlashes($value)\n\t{\n\t\tif (get_magic_quotes_runtime())\n\t\t{\n\t\t\tif (is_array($value))\n\t\t\t{\n\t\t\t\tforeach ($value as $key => $val)\n\t\t\t\t{\n\t\t\t\t\tif (is_array($val)) $value[$key] = self::StripSlashes($val);\n\t\t\t\t\telse $value[$key] = stripslashes($val);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse $value = stripslashes($value);\n\t\t}\n\t\treturn $value;\n\t}", "function maqic_unquote_gpc()\n{\n if (ini_get('magic_quotes_gpc'))\n {\n $tmp = array ('_POST', '_GET', '_REQUEST', '_COOKIE');\n foreach($tmp as $n)\n recurse($GLOBALS[$n], '$value=stripslashes($value)');\n }\n}", "private function _wp_magic_quotes() {\n // If already slashed, strip.\n if (function_exists('get_magic_quotes_gpc')) {\n $reflection = new \\ReflectionFunction('get_magic_quotes_gpc');\n if ( ! $reflection->isDeprecated()) {\n if ( get_magic_quotes_gpc() ) {\n $_GET = RevSliderFunctions::stripslashes_deep( $_GET );\n $_POST = RevSliderFunctions::stripslashes_deep( $_POST );\n $_COOKIE = RevSliderFunctions::stripslashes_deep( $_COOKIE );\n }\n }\n }\n\n // Escape with wpdb.\n $_GET = $this->_add_magic_quotes( $_GET );\n $_POST = $this->_add_magic_quotes( $_POST );\n $_COOKIE = $this->_add_magic_quotes( $_COOKIE );\n $_SERVER = $this->_add_magic_quotes( $_SERVER );\n\n // Force REQUEST to be GET + POST.\n $_REQUEST = array_merge( $_GET, $_POST );\n }", "static function revertSlashes($to_strip = null)\n\t{\t\t\n\t\tif (get_magic_quotes_gpc()) {\n\t\t\tif (isset($to_strip)) {\n\t\t\t\treturn is_array($to_strip)\n\t\t\t\t ? array_map(array('Pie_Bootstrap', 'revertSlashes'), $to_strip) \n\t\t\t\t : stripslashes($to_strip);\n\t\t\t}\n\t\t\t$_COOKIE = self::revertSlashes($_COOKIE);\n\t\t\t$_FILES = self::revertSlashes($_FILES);\n\t\t\t$_GET = self::revertSlashes($_GET);\n\t\t\t$_POST = self::revertSlashes($_POST);\n\t\t\t$_REQUEST = self::revertSlashes($_REQUEST);\n\t\t}\n\t}", "function fix_input_quotes() {\n if(get_magic_quotes_gpc()) {\n array_stripslashes($_GET);\n array_stripslashes($_POST);\n array_stripslashes($_COOKIE);\n } // if\n }", "function DoStripSlashes($fieldValue) {\n if ( function_exists( 'get_magic_quotes_gpc' ) && get_magic_quotes_gpc() ) { \n if (is_array($fieldValue) ) { \n return array_map('DoStripSlashes', $fieldValue); \n } else { \n return trim(stripslashes($fieldValue)); \n } \n } else { \n return $fieldValue; \n } \n}", "function bwm_clean($s) {\r\n if (get_magic_quotes_gpc())\r\n return trim(stripslashes($s));\r\n return trim($s);\r\n}", "public static function stripslashes($value)\n {\n if (Kohana::$magic_quotes === TRUE)\n {\n if (is_array($value) OR is_object($value))\n {\n foreach ($value as $key => $val)\n {\n // Recursively clean each value\n $value[$key] = Kohana::stripslashes($val);\n }\n }\n elseif (is_string($value))\n {\n // Remove slashes added by magic quotes\n $value = stripslashes($value);\n }\n }\n\n return $value;\n }", "private function stripslash_gpc(&$value) {\r\n $value = stripslashes($value);\r\n }", "function fix_magic_quotes() {\n\tglobal $HTTP_GET_VARS, $HTTP_POST_VARS, $HTTP_COOKIE_VARS;\n\n\t// clean gpc of slashes\n\tif (!get_magic_quotes_gpc()) {\n\t\treturn false;\n\t}\n\n\t$_GET = transcribe($_GET);\n\t$_POST = transcribe($_POST);\n\t$_COOKIE = transcribe($_COOKIE);\n\t$_REQUEST = transcribe($_REQUEST);\n\n\t$HTTP_GET_VARS = $_GET;\n\t$HTTP_POST_VARS = $_GET;\n\t$HTTP_COOKIE_VARS = $_COOKIE;\n\n\treturn true;\n\n}", "function wp_magic_quotes()\n {\n }", "public function stripslashes() {\n $i = &$this->getInstance();\n if(get_magic_quotes_gpc()) { stripslashes(stripslashes($i)); }\n return $this;\n }", "function stripPostSlashes($string) {\n\t\tif ((get_magic_quotes_gpc()==1) || (get_magic_quotes_runtime()==1))\n\t\t\treturn stripslashes($string);\n\t\telse return $string;\n\t}", "public function stripslash_gpc($value) {\r\n $value = stripslashes($value);\r\n\t\t$value = htmlspecialchars($value);\r\n\t\t$value = trim($value);\r\n\t\treturn $value;\r\n }", "function remove_ill($str)\r\n {\r\n\t\treturn (!get_magic_quotes_gpc() ? addslashes(trim($str)) : trim($str));\r\n }", "public static function stripSlashes($cadena)\n\t\t{\n\t\t\treturn str_replace(\"''\", \"'\", $cadena);\n\t\t}", "function wp_magic_quotes() {\n\tif ( get_magic_quotes_gpc() ) {\n\t\t$_GET = stripslashes_deep( $_GET );\n\t\t$_POST = stripslashes_deep( $_POST );\n\t\t$_COOKIE = stripslashes_deep( $_COOKIE );\n\t}\n\n\t// Escape with wpdb.\n\t$_GET = add_magic_quotes( $_GET );\n\t$_POST = add_magic_quotes( $_POST );\n\t$_COOKIE = add_magic_quotes( $_COOKIE );\n\t$_SERVER = add_magic_quotes( $_SERVER );\n\n\t// Force REQUEST to be GET + POST.\n\t$_REQUEST = array_merge( $_GET, $_POST );\n}", "function cleanText($str) {\r\n $str = @trim($str);\r\n if (get_magic_quotes_gpc()) {\r\n $str = stripslashes($str);\r\n }\r\n return $str;\r\n}", "function _put_safe_slashes ($text = \"\") {\n\t\t$text = str_replace(\"'\", \"&#039;\", trim($text));\n\t\t$text = str_replace(\"\\\\&#039;\", \"\\\\'\", $text);\n\t\t$text = str_replace(\"&#039;\", \"\\\\'\", $text);\n\t\tif (substr($text, -1) == \"\\\\\" && substr($text, -2, 1) != \"\\\\\") {\n\t\t\t$text .= \"\\\\\";\n\t\t}\n\t\treturn $text;\n\t}", "function stripString($string) {\r\n return stripslashes($string);\r\n}", "function clean($str) {\r\n\t\t$str = @trim($str);\r\n\t\tif(get_magic_quotes_gpc()) {\r\n\t\t\t$str = stripslashes($str);\r\n\t\t}\r\n\t\treturn $str;\r\n\t}", "function wp_unslash( $value ) {\n\treturn stripslashes_deep( $value );\n}", "function mf_sanitize($input){\n\t\tif(get_magic_quotes_gpc() && !empty($input)){\n\t\t\t $input = is_array($input) ?\n\t array_map('mf_stripslashes_deep', $input) :\n\t stripslashes(trim($input));\n\t\t}\n\t\t\n\t\treturn $input;\n\t}", "function stripslashes_from_strings_only($value)\n {\n }", "function stripslashes2($valeur) { //vire les / lorsqu'ils sont en double ou triple\n\t$valeur = str_replace(\"\\\\\\\\'\",\"'\",$valeur);\n\t$valeur = str_replace(\"\\\\'\",\"'\",$valeur);\n\t$valeur = str_replace(\"'\\\\\\\\\",\"'\\\\\",$valeur);\n\t$valeur = stripslashes($valeur);\n\treturn $valeur;\n}", "function smartaddslashes($str) {\n\t\tif ( get_magic_quotes_gpc() == false ) {\n\t\t\t$str = addslashes( $str );\n\t\t}\n\t\treturn $str;\n\t}", "function strip_magic_quotes($data) {\n foreach($data as $k=>$v) {\n $data[$k] = is_array($v) ? strip_magic_quotes($v) : stripslashes($v);\n }\n return $data;\n}", "function mysql_prep($value){\n\t\t$magic_quotes_active = get_magic_quotes_gpc();\n\t\t$new_enough_php = function_exists(\"mysql_real_escape_string\"); // ie PHP >= v4.3.0\n\n\t\tif($new_enough_php){\n\t\t\t// undo any magic quotes effects so mysql_real_escape_quotes can do the work\n\t\t\tif($magic_quotes_active){\n\t\t\t\t$value = stripcslashes($value);\n\t\t\t}\n\t\t\t$value = mysql_real_escape_string($value);\n\t\t}else {\n\t\t\t// if magic quotes aren't on then add slashes manually \n\t\t\tif(!$magic_quotes_active){\n\t\t\t\t$value = addslashes($value);\n\t\t\t\t// if magic quotes are on the slashes already exits\n\t\t\t}\n\t\t}\n\t\treturn $value;\n\t}", "function sc_php_escape($value) {\n\tif (is_string($value));\n\t// strip out slashes IF they exist AND magic_quotes is on\n\tif (get_magic_quotes_gpc() && (strstr($value,'\\\"') || strstr($value,\"\\\\'\"))) $value = stripslashes($value);\t\n\t// escape string to make it safe for mysql\n\treturn addslashes($value);\n}", "function txt_stripslashes($t)\n\t{\n\t\tif ( $this->get_magic_quotes )\n\t\t{\n \t\t$t = stripslashes($t);\n \t\t$t = preg_replace( \"/\\\\\\(?!&amp;#|\\?#)/\", \"&#092;\", $t );\n \t}\n \t\n \treturn $t;\n }", "function do_magic_quotes_gpc(&$ar) {\n if (!is_array($ar)) return false;\n\n foreach ($ar as $key => $value) {\n if (is_array($ar[$key])) {\n do_magic_quotes_gpc($ar[$key]);\n } else {\n $ar[$key] = addslashes($value);\n }\n }\n\n reset($ar);\n}", "function mysql_prep ($value) {\n $magic_quotes_active = get_magic_quotes_gpc();\n $new_enough_php = function_exists(\"mysql_real_escape_string\" ); // i.e. PHP >= 4.3.0\n if ( $new_enough_php ) { // PHP 4.3.0 or higher\n // undo any magic quote effects so mysql_real_escape_string can do the work\n if ( $magic_quotes_active ) { $value = stripslashes( $value ); }\n $value = mysql_real_escape_string( $value );\n } else { // before PHP v4.3.0\n // if magic quotes aren't already on then add slashes manually\n if ( !magic_quotes_active ) { $value = addslashes( $value ); }\n // if magic quotes are active, then the slashes already exist\n }\n return $value;\n }", "function sanitize($data) {\n $data = htmlentities(get_magic_quotes_gpc() ? stripslashes($data) : $data, ENT_QUOTES, 'UTF-8');\n return $data;\n }", "private function unquote($value) {\n\t//--\n\tif(!$value) {\n\t\treturn $value;\n\t} //end if\n\tif(!is_string($value)) {\n\t\treturn $value;\n\t} //end if\n\tif($value[0] == '\\'') {\n\t\treturn trim($value, '\\'');\n\t} //end if\n\tif($value[0] == '\"') {\n\t\treturn trim($value, '\"');\n\t} //end if\n\t//--\n\treturn $value;\n\t//--\n}", "function safe_slash_html_input($text) {\r\n if (get_magic_quotes_gpc()==0) \r\n {\t\t\r\n $text = addslashes(htmlspecialchars($text, ENT_QUOTES, 'UTF-8', false));\r\n } else \r\n {\t\t\r\n\t $text = htmlentities($text, ENT_QUOTES, 'UTF-8', false);\t\r\n }\r\n return $text;\r\n}", "function fromGPC($s){\n if(get_magic_quotes_gpc()){\n return stripslashes($s);\n }else{\n return $s;\n }\n }", "function stripslashes($str)\n{\n}", "function __clearstr($val)\n {\n if (!get_magic_quotes_gpc()) $val = addslashes($val);\n return $val;\n }", "private function stripQuotes($value)\n {\n return preg_replace('!^([\\'\"])(.*)\\1$!', '$2', $value);\n }", "function mysql_prep( $value ) {\n $magic_quotes_active = get_magic_quotes_gpc();\n $new_enough_php = function_exists( \"mysql_real_escape_string\" ); // i.e. PHP >= v4.3.0\n if( $new_enough_php ) { // PHP v4.3.0 or higher\n // undo any magic quote effects so mysql_real_escape_string can do the work\n if( $magic_quotes_active ) { $value = stripslashes( $value ); }\n $value = mysql_real_escape_string( $value );\n } else { // before PHP v4.3.0\n // if magic quotes aren't already on then add slashes manually\n if( !$magic_quotes_active ) { $value = addslashes( $value ); }\n // if magic quotes are active, then the slashes already exist\n }\n return $value;\n}", "function clean_quotes($value) {\r\n\r\n\t\t //Trim the value\r\n\r\n\t\t $value = trim($value);\r\n\r\n\t\t \r\n\r\n\t\t// Stripslashes\r\n\r\n\t\tif (get_magic_quotes_gpc()) {\r\n\r\n\t\t\t$value = stripslashes($value);\r\n\r\n\t\t}\r\n\r\n\t\t// Quote the value\r\n\r\n\t\t$value = mysql_real_escape_string($value);\r\n\r\n\t\t//$value = htmlspecialchars ($value);\r\n\r\n\t\treturn $value;\r\n\r\n}", "public static function clean_input($input)\n {\n $input = trim(stripslashes($input));\n\n # strip the slashes if magic quotes is on\n if(get_magic_quotes_gpc()) {\n $input = trim(stripslashes($input));\n }\n else {\n $input = trim($input);\n }\n\treturn ($input);\n\n }", "function StripGPCArray($arr)\n{\n\tif (get_magic_quotes_gpc() != 0)\n\t\tforeach ($arr as $key=>$value)\n\t\t\tif (is_string($value))\n\t\t\t\t$arr[$key] = stripslashes($value);\n\treturn ($arr);\n}", "function fix_POST_slashes() {\n\tglobal $fixed_POST_slashes;\n\tif (!$fixed_POST_slashes and get_magic_quotes_gpc()) {\n\t\t$fixed_POST_slashes = true;\n\t\tforeach ($_POST as $key => $val) {\n\t\t\tif (gettype($val) == \"array\") {\n\t\t\t\tforeach ($val as $i => $j) {\n\t\t\t\t\t$val[$i] = stripslashes($j);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$_POST[$key] = stripslashes($val);\n\t\t\t}\n\t\t}\n\t}\n}", "static public function SQLUnfix( $value )\r\n\t{\r\n\t\treturn @stripslashes( $value );\r\n\t}", "function ATsanitize($input)\n{\n $user_input = trim($input);\n \n if (get_magic_quotesgpc())\n {\n $input = stripslashes($input);\n }\n}", "function wp_kses_stripslashes($content)\n {\n }", "function txt_safeslashes($t=\"\")\n\t{\n\t\treturn str_replace( '\\\\', \"\\\\\\\\\", $this->txt_stripslashes($t));\n\t}", "function privDisableMagicQuotes()\n {\n }", "public function stripSlashesGPC( $data ) {\n\t\treturn $data;\n\t}", "function sanitize_path($path) {\n\treturn rtrim(ltrim(stripslashes($path), '/'), '/');\n}", "function Strip($value)\n{\n\t$value = StripGPC($value);\n\t$value = str_replace(\"\\\"\",\"'\",$value);\n\t$value = preg_replace('/[[:cntrl:][:space:]]+/',\" \",$value);\t// zap all control chars and multiple blanks\n\treturn ($value);\n}", "function jc_ipr_f_cleanbothquotes($tmpNeedsCleaning)\n{\n\t$replacethis\t= array('/\\\\\\\\\"/', \"/\\\\\\\\'/\");\n\t$replacethat\t= array('\"', \"'\");\n\t$tmpNeedsCleaning = preg_replace($replacethis, $replacethat, $tmpNeedsCleaning);\n\treturn $tmpNeedsCleaning;\n}", "protected function _escape($value){\n // если magic_quotes_gpc включена - используем stripslashes\n if (get_magic_quotes_gpc()) {\n $value = stripslashes($value);\n }\n // Если переменная - число, то экранировать её не нужно\n // если нет - то окружем её кавычками, и экранируем\n if (!is_numeric($value) && (strtoupper($value) !== 'NULL') ) {\n $value = \"'\" . mysql_real_escape_string($value) . \"'\";\n }\n return $value;\n }", "function EliminateSlashes($value) {\r\n if (is_array($value)) {\r\n reset($value);\r\n while (list($key, $val) = each($value))\r\n $value[$key] = EliminateSlashes($val);\r\n return $value;\r\n }\r\n return stripslashes($value);\r\n}", "public function Slasher($var) {\n\n //si magic_quot est on on enleve les slash\n if (get_magic_quotes_gpc()) {\n $var=stripslashes($var);\n }\n return $var;\n }", "function CleanPostForMysql($target) {\r\n if (get_magic_quotes_gpc()) {\r\n return $target;\r\n } else {\r\n return mysql_real_escape_string($target);\r\n } // if\r\n}", "function addPostSlashes($string) {\n\t\tif ((get_magic_quotes_gpc()==1) || (get_magic_quotes_runtime()==1))\n\t\t\treturn $string;\n\t\telse return addslashes($string);\n\t}", "function escapeQuote($input, $strip=1) {\r\n\r\n\t$string = stripslashes(trim($input));\r\n\tif ($strip) $string = strip_tags($string);\r\n\t$result = \"\";\r\n\t\r\n\tfor ($i=0;$i<strlen($string);$i++) {\r\n\r\n\t\t$char = substr($string,$i,1);\r\n\t\tif ($char == \"'\") $result .= \"''\";\r\n\t\telseif ($char == \"\\r\") $result .= \"\";\r\n\t\telse $result .= $char;\r\n\r\n\t}\r\n\r\n\treturn \"'\".$result.\"'\";\r\n\r\n}", "function addslashes_strings_only($value)\n {\n }", "static function quote_smart($value)\n {\n // Stripslashes\n if (get_magic_quotes_gpc()) {\n $value = stripslashes($value);\n }\n // Quote if not a number or a numeric string\n if (!is_numeric($value)) {\n $value = \"'\" . mysql_real_escape_string($value) . \"'\";\n //$value = \"'\" . mysql_escape_string($value) . \"'\";\n }\n return $value;\n }", "function clean($value) {\n if (get_magic_quotes_gpc()) $value = stripslashes($value);\n if (!is_numeric($value)) $value = addslashes($value);\n return $value;\n}", "function sanitize( $value ) {\n\t\tif(!$value) \n\t\t\treturn $value;\n\t\treturn preg_quote($value, \"/\");\n\t}", "function fix_slashes($arr='')\n\t{\n\t\tif (is_null($arr) || $arr == '') return null;\n\t\tif (!get_magic_quotes_gpc()) return $arr;\n\t\treturn is_array($arr) ? array_map('fix_slashes', $arr) : stripslashes($arr);\n\t}", "public function cleanValue($value)\n\t\t{\n\t\t\tif ($value !== null)\n\t\t\t{\n\t\t\t\tif (is_string($value))\n\t\t\t\t\t$value = $this->convertToCurrentEncoding($value);\n\t\t\t\tif (get_magic_quotes_gpc())\n\t\t\t\t\t$value = stripslashes($value);\n\t\t\t}\n\t\t\treturn $value;\n\t\t}", "public function str_strip ($str)\n {\n $str = trim($str);\n if (get_magic_quotes_gpc()) {\n $str = stripslashes($str);\n }\n return $str;\n }", "protected function unquote($value)\n {\n\t if ($value) {\n\t\t return preg_replace(\"/^['\\\"](.*)['\\\"]$/\", \"\\\\1\", $value);\n\t }\n\t return $value;\n }", "function cleanData($data) {\n $data = stripslashes($data);\n $data = trim($data);\n return $data;\n}", "function nice_addslashes($string)\n{\n // if magic quotes is on the string is already quoted, just return it\n if(MAGIC_QUOTES)\n return $string;\n else\n return addslashes($string);\n}", "function stripslashes_deep($value) {\r\n\tif ( is_array($value) ) {\r\n\t\t$value = array_map('stripslashes_deep', $value);\r\n\t} elseif ( is_object($value) ) {\r\n\t\t$vars = get_object_vars( $value );\r\n\t\tforeach ($vars as $key=>$data) {\r\n\t\t\t$value->{$key} = stripslashes_deep( $data );\r\n\t\t}\r\n\t} else {\r\n\t\t$value = stripslashes($value);\r\n\t}\r\n\treturn $value;\r\n}", "function sanitize($data)\n{\n$data = trim($data);\n \n// apply stripslashes if magic_quotes_gpc is enabled\nif(get_magic_quotes_gpc())\n{\n$data = stripslashes($data);\n}\n \n// a mySQL connection is required before using this function\n$data = mysql_real_escape_string($data);\n \nreturn $data;\n}", "public function sanitize($string) {\n if(is_array($string)) {\n return array_map(array($this, 'sanitize'), $string);\n } else {\n return (get_magic_quotes_gpc()) ? trim(stripslashes(stripslashes($string))) : trim($string);\n }\n }", "function clean($str) {\r\n $str = @trim($str);\r\n if(get_magic_quotes_gpc()) {\r\n $str = stripslashes($str);\r\n }\r\n return mysql_escape_string($str);\r\n }", "function reduce_double_slashes($str) {\n\treturn preg_replace(\"#([^:])//+#\", \"\\\\1/\", $str);\n}", "protected function quote_escaped()\n {\n }", "function unquote($str)\n{\n $pos = strpos($str, \"\\\"\");\n if ($pos === 0) {\n $qstr = substr($str, 1, -1);\n return trim($qstr);\n } else {\n return trim($str);\n }\n}", "function wp_unslash($value)\n {\n }", "function stripslashes_deep($value)\n {\n }", "function strip_db($str)\n{\n $esc_str = str_replace(\"\\\"\\\"\", \"\\\"\", $str);\n return $esc_str;\n}", "function clean($str) {\n\t $str = @trim($str);\n \tif(get_magic_quotes_gpc()) {\n \t$str = stripslashes($str);\n \t}\n \t\treturn mysql_real_escape_string($str);\n \t}", "function clean($str){\n $str = @trim($str);\n if(get_magic_quotes_gpc()){\n $str = stripslashes($str);\n }\n return mysql_real_escape_string($str);\n}", "private function _sanitize($path) {\n\t\t$path = str_replace('\\\\', '/', $path);\n\t\twhile (strpos($path, '//')) {\n\t\t\t$path = str_replace('//', '/', $path);\n\t\t}\n\t\t\n\t\treturn ($path);\n\t}", "public function escape_value($value){\n if($this->real_escape_string_e){\n if($this->magic_quotes_a){\n $value = stripcslashes($value);\n }\n $value = mysql_real_escape_string($value);\n }\n if(!$this->magic_quotes_a){\n $value = addslashes($value);\n }\n return $value;\n }", "function addslashes_gpc($gpc)\n {\n }", "public static function stripSlashesDeep($value)\n {\n $value = is_array($value) ? array_map(array('self',__METHOD__), $value) : stripslashes($value);\n return $value;\n }", "function clean($str){\r\n\t\t$str = @trim($str);\r\n\t\tif(get_magic_quotes_gpc()) {\r\n\t\t\t$str = stripslashes($str);\r\n\t\t}\r\n\t\treturn mysql_real_escape_string($str);\r\n}", "public function stripSlashes(&$data)\n\t{\n\t\treturn is_array($data) ? array_map(array($this,\"stripslashes\"),$data) : stripslashes($data);\n\t}", "function qa_gpc_to_string($string)\n{\n\tif (qa_to_override(__FUNCTION__)) { $args=func_get_args(); return qa_call_override(__FUNCTION__, $args); }\n\n\treturn get_magic_quotes_gpc() ? stripslashes($string) : $string;\n}", "public function mysql_prepare_value($value) {\r\r\n\t\t$magic_quotes_active = get_magic_quotes_gpc();\r\r\n\t\t$new_version_php = function_exists(\"mysql_real_escape_string\");\r\r\n\t\t\r\r\n\t\tif($new_version_php){\r\r\n\t\t\t//undo any magic quote effects so mysql_real_escape_string can do the work\r\r\n\t\t\tif($magic_quotes_active) { $value = stripslashes($value); }\r\r\n\t\t\t$value = mysql_real_escape_string($value);\r\r\n\t\t} else {\r\r\n\t\t\t\t//if magic quotes aren't already on then add slashes manually\r\r\n\t\t\t\tif( !$magic_quotes_active ) { $values = addslashes( $value ); }\r\r\n\t\t\t\t//if magic quotes are active, then the slashes already exist\r\r\n\t\t\t}\r\r\n\t\treturn $value;\r\r\n\t}" ]
[ "0.82674354", "0.80969065", "0.8018098", "0.7773816", "0.76722026", "0.76355547", "0.7555522", "0.7401509", "0.7385167", "0.7343793", "0.7293956", "0.7239054", "0.7176408", "0.7130337", "0.7125104", "0.7097859", "0.7063134", "0.704085", "0.70145446", "0.699538", "0.6895286", "0.6893194", "0.68835545", "0.6876222", "0.6862918", "0.68535984", "0.6722183", "0.6705667", "0.6686954", "0.65976137", "0.6577618", "0.6549816", "0.654679", "0.65449506", "0.65346223", "0.6517179", "0.6490287", "0.64607704", "0.6432618", "0.64276206", "0.63807744", "0.63739306", "0.63384527", "0.63351417", "0.63329184", "0.6326401", "0.63140625", "0.62913644", "0.62870383", "0.62657225", "0.6260302", "0.6200817", "0.6196845", "0.61953807", "0.61938703", "0.6159955", "0.61596215", "0.61443216", "0.60964686", "0.60864943", "0.60782546", "0.6064374", "0.60585093", "0.605761", "0.60491645", "0.60262746", "0.6021837", "0.601547", "0.6013198", "0.6010981", "0.599271", "0.59892327", "0.5972441", "0.5960491", "0.59504795", "0.5946693", "0.59458303", "0.59439695", "0.59355193", "0.59319943", "0.5910163", "0.59018475", "0.5894943", "0.5892479", "0.58893216", "0.58889", "0.58815837", "0.58781064", "0.5876506", "0.58762646", "0.5863494", "0.5853096", "0.58468366", "0.58454883", "0.58454686", "0.5835174", "0.5823293", "0.58209014", "0.58204657", "0.5818191" ]
0.6993569
20
return an array, stripped of slashes if magic_quotes_gpc is set
function StripGPCArray($arr) { if (get_magic_quotes_gpc() != 0) foreach ($arr as $key=>$value) if (is_string($value)) $arr[$key] = stripslashes($value); return ($arr); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function undo_magic_quotes() {\n if (get_magic_quotes_gpc()) {\n \n $in = array(&$_GET, &$_POST, &$_REQUEST, &$_COOKIE);\n \n while (list($k,$v) = each($in)) {\n foreach ($v as $key => $val) {\n if (!is_array($val)) {\n $in[$k][$key] = stripslashes($val);\n continue;\n }\n $in[] =& $in[$k][$key];\n }\n }\n \n unset($in);\n }\n }", "static function stripMagic() {\n\t\t@set_magic_quotes_runtime(0);\n\t\t// if magic_quotes_gpc strip slashes from GET POST COOKIE\n\t\tif (get_magic_quotes_gpc()){\n\t\tfunction stripslashes_array($array) {\n\t\t return is_array($array) ? array_map('stripslashes_array',$array) : stripslashes($array);\n\t\t}\n\t\t$_GET= stripslashes_array($_GET);\n\t\t$_POST= stripslashes_array($_POST);\n\t\t$_REQUEST= stripslashes_array($_REQUEST);\n\t\t$_COOKIE= stripslashes_array($_COOKIE);\n\t\t}\n\t}", "function strip_magic_quotes($data) {\n foreach($data as $k=>$v) {\n $data[$k] = is_array($v) ? strip_magic_quotes($v) : stripslashes($v);\n }\n return $data;\n}", "public function removeMagicQuotes() {\n if ( get_magic_quotes_gpc() ) {\n $_GET = $this->stripSlashesDeep($_GET);\n $_POST = $this->stripSlashesDeep($_POST);\n $_COOKIE = $this->stripSlashesDeep($_COOKIE);\n }\n }", "private static function _undoMagicQuotes(){\n\t\t\n\t\tif (get_magic_quotes_gpc()) {\n\n\t\t\tfunction stripslashes_array($data) {\n\t\t\t\tif (is_array($data)) {\n\t\t\t\t\tforeach ($data as $key => $value) {\n\t\t\t\t\t\t$data[$key] = stripslashes_array($value);\n\t\t\t\t\t}\n\t\t\t\t\treturn $data;\n\t\t\t\t} else {\n\t\t\t\t\treturn stripslashes($data);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$_REQUEST = stripslashes_array($_REQUEST);\n\t\t\t$_GET = stripslashes_array($_GET);\n\t\t\t$_POST = stripslashes_array($_POST);\n\t\t\t$_COOKIE = stripslashes_array($_COOKIE);\n\t\t\tif(isset($_FILES))\n\t\t\t\t$_FILES = stripslashes_array($_FILES);\n\t\t}\n\t}", "function do_magic_quotes_gpc(&$ar) {\n if (!is_array($ar)) return false;\n\n foreach ($ar as $key => $value) {\n if (is_array($ar[$key])) {\n do_magic_quotes_gpc($ar[$key]);\n } else {\n $ar[$key] = addslashes($value);\n }\n }\n\n reset($ar);\n}", "private function _remove_magic_quotes()\n {\n if(get_magic_quotes_gpc()) {\n $_GET = $this->_strip_slashes_deep($_GET);\n $_POST = $this->_strip_slashes_deep($_POST);\n $_COOKIE = $this->_strip_slashes_deep($_COOKIE);\n }\n }", "function RemoveMagicQuotesGPC()\n\t{\n\t\t// Check magic quotes state for GPC\n\t\tif (get_magic_quotes_gpc())\n\t\t{\n\t\t\t// Remove magic quotes in GET\n\t\t\t$_GET = RemoveSlashes($_GET);\n\t\t\t// Remove magic quotes in POST\n\t\t\t$_POST = RemoveSlashes($_POST);\n\t\t\t// Remove magic quotes in COOKIE\n\t\t\t$_COOKIE = RemoveSlashes($_COOKIE);\n\t\t}\n\t}", "function maqic_unquote_gpc()\n{\n if (ini_get('magic_quotes_gpc'))\n {\n $tmp = array ('_POST', '_GET', '_REQUEST', '_COOKIE');\n foreach($tmp as $n)\n recurse($GLOBALS[$n], '$value=stripslashes($value)');\n }\n}", "function addSlashesToArray($thearray){\r\n\r\n\tif(get_magic_quotes_runtime() || get_magic_quotes_gpc()){\r\n\r\n\t\tforeach ($thearray as $key=>$value)\r\n\t\t\tif(is_array($value))\r\n\t\t\t\t$thearray[$key]= addSlashesToArray($value);\r\n\t\t\telse\r\n\t\t\t\t$thearray[$key] = mysql_real_escape_string(stripslashes($value));\r\n\r\n\t} else\r\n\t\tforeach ($thearray as $key=>$value)\r\n\t\t\tif(is_array($value))\r\n\t\t\t\t$thearray[$key]= addSlashesToArray($value);\r\n\t\t\telse\r\n\t\t\t\t$thearray[$key] = mysql_real_escape_string($value);\r\n\r\n\treturn $thearray;\r\n\r\n}", "public static function removeMagicQuotes() {\r\n if (get_magic_quotes_gpc() ) {\r\n \tif(isset($_GET)){\r\n \t\t$_GET = self::stripSlashesDeep($_GET);\r\n \t}\r\n \r\n\t\t\tif(isset($_POST)){\r\n \t\t$_POST = self::stripSlashesDeep($_POST);\r\n \t}\r\n \r\n\t\t\tif(isset($_COOKIE)){\r\n \t\t$_COOKIE = self::stripSlashesDeep($_COOKIE);\r\n \t}\r\n \r\n }\r\n }", "function DoStripSlashes($fieldValue) {\n if ( function_exists( 'get_magic_quotes_gpc' ) && get_magic_quotes_gpc() ) { \n if (is_array($fieldValue) ) { \n return array_map('DoStripSlashes', $fieldValue); \n } else { \n return trim(stripslashes($fieldValue)); \n } \n } else { \n return $fieldValue; \n } \n}", "function fix_input_quotes() {\n if(get_magic_quotes_gpc()) {\n array_stripslashes($_GET);\n array_stripslashes($_POST);\n array_stripslashes($_COOKIE);\n } // if\n }", "public static function StripSlashes($value)\n\t{\n\t\tif (get_magic_quotes_runtime())\n\t\t{\n\t\t\tif (is_array($value))\n\t\t\t{\n\t\t\t\tforeach ($value as $key => $val)\n\t\t\t\t{\n\t\t\t\t\tif (is_array($val)) $value[$key] = self::StripSlashes($val);\n\t\t\t\t\telse $value[$key] = stripslashes($val);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse $value = stripslashes($value);\n\t\t}\n\t\treturn $value;\n\t}", "function stripslashes_array( $given ) {\n return is_array( $given ) ? array_map( 'stripslashes', $given ) : stripslashes( $given );\n}", "function remove_wp_magic_quotes() {\r\n\t\t$_GET = stripslashes_deep($_GET);\r\n\t\t$_POST = stripslashes_deep($_POST);\r\n\t\t$_COOKIE = stripslashes_deep($_COOKIE);\r\n\t\t$_REQUEST = stripslashes_deep($_REQUEST);\r\n\t}", "function StripslashesArray($arr) {\n /* \n from php.net/slipslashes\n [email protected]\n 28-Jun-2001 09:07\n Very useful for using on all the elements in say $HTTP_POST_VARS, or\n elements returned from an database query. (to addslashes, just change\n strip to add =)\n */\n\n $rs = array();\n\n foreach ($arr as $key => $val) {\n $rs[$key] = stripslashes($val);\n }\n\n return $rs;\n}", "function fix_slashes($arr='')\n\t{\n\t\tif (is_null($arr) || $arr == '') return null;\n\t\tif (!get_magic_quotes_gpc()) return $arr;\n\t\treturn is_array($arr) ? array_map('fix_slashes', $arr) : stripslashes($arr);\n\t}", "private function _wp_magic_quotes() {\n // If already slashed, strip.\n if (function_exists('get_magic_quotes_gpc')) {\n $reflection = new \\ReflectionFunction('get_magic_quotes_gpc');\n if ( ! $reflection->isDeprecated()) {\n if ( get_magic_quotes_gpc() ) {\n $_GET = RevSliderFunctions::stripslashes_deep( $_GET );\n $_POST = RevSliderFunctions::stripslashes_deep( $_POST );\n $_COOKIE = RevSliderFunctions::stripslashes_deep( $_COOKIE );\n }\n }\n }\n\n // Escape with wpdb.\n $_GET = $this->_add_magic_quotes( $_GET );\n $_POST = $this->_add_magic_quotes( $_POST );\n $_COOKIE = $this->_add_magic_quotes( $_COOKIE );\n $_SERVER = $this->_add_magic_quotes( $_SERVER );\n\n // Force REQUEST to be GET + POST.\n $_REQUEST = array_merge( $_GET, $_POST );\n }", "function _check_magic_quotes($value){\n\t\treturn $this->_magic_quotes?stripslashes($value):$value;\n\t}", "function stripslashes_array( $value ){\n\t$value = is_array( $value ) ? array_map( 'stripslashes_array', $value ) : stripslashes( $value );\n\n\treturn $value;\n}", "function wp_magic_quotes() {\n\tif ( get_magic_quotes_gpc() ) {\n\t\t$_GET = stripslashes_deep( $_GET );\n\t\t$_POST = stripslashes_deep( $_POST );\n\t\t$_COOKIE = stripslashes_deep( $_COOKIE );\n\t}\n\n\t// Escape with wpdb.\n\t$_GET = add_magic_quotes( $_GET );\n\t$_POST = add_magic_quotes( $_POST );\n\t$_COOKIE = add_magic_quotes( $_COOKIE );\n\t$_SERVER = add_magic_quotes( $_SERVER );\n\n\t// Force REQUEST to be GET + POST.\n\t$_REQUEST = array_merge( $_GET, $_POST );\n}", "private function _add_magic_quotes( $array ) {\n foreach ( (array) $array as $k => $v ) {\n if ( is_array( $v ) ) {\n $array[$k] = $this->_add_magic_quotes( $v );\n } elseif (is_string($v)) {\n $array[$k] = addslashes( $v );\n }\n }\n return $array;\n }", "function wp_magic_quotes()\n {\n }", "function &stripSlashesGPC( $text, $force = false ) {\n if ( get_magic_quotes_gpc() || $force == true ) {\n $text = stripslashes( $text );\n }\n return $text;\n }", "function stripslashes_array($data) {\r\n if (is_array($data)){\r\n foreach ($data as $key => $value){\r\n $data[$key] = stripslashes_array($value);\r\n }\r\n return $data;\r\n } else {\r\n return stripslashes($data);\r\n }\r\n }", "public static function stripslashes($value)\n {\n if (Kohana::$magic_quotes === TRUE)\n {\n if (is_array($value) OR is_object($value))\n {\n foreach ($value as $key => $val)\n {\n // Recursively clean each value\n $value[$key] = Kohana::stripslashes($val);\n }\n }\n elseif (is_string($value))\n {\n // Remove slashes added by magic quotes\n $value = stripslashes($value);\n }\n }\n\n return $value;\n }", "public function specialCharactersInValueProvider()\n {\n return array_filter($this->specialCharactersProvider(), function ($val) {\n return $val[0] !== \"\\\"\" && $val[0] !== \"\\\\\";\n });\n }", "function EliminateSlashes($value) {\r\n if (is_array($value)) {\r\n reset($value);\r\n while (list($key, $val) = each($value))\r\n $value[$key] = EliminateSlashes($val);\r\n return $value;\r\n }\r\n return stripslashes($value);\r\n}", "public function dataStripQuotes()\n {\n return [\n 'double quoted text' => ['\"some text\"', 'some text'],\n 'single quoted text' => [\"'some text'\", 'some text'],\n 'unmatched quotes start of string' => [\"'some text\", \"'some text\"],\n 'unmatched quotes end of string' => ['some text\"', 'some text\"'],\n 'quotes with quoted text within' => [\"some 'text'\", \"some 'text'\"],\n 'string with quotes within' => ['\"some \\'string\\\" with\\' quotes\"', 'some \\'string\\\" with\\' quotes'],\n 'string wrapped in quotes' => ['\"\\'quoted_name\\'\"', \"'quoted_name'\"],\n 'multi-line text string' => [\n \"'some text\nanother line\nfinal line'\",\n \"some text\nanother line\nfinal line\",\n ],\n 'empty string' => ['', ''],\n 'not string input - bool' => [false, ''],\n 'not string input - float' => [12.345, '12.345'],\n ];\n }", "function smartstripslashes($str) {\n\t\tif ( get_magic_quotes_gpc() == true ) {\n\t\t\t$str = stripslashes($str);\n\t\t}\n\t\treturn $str;\n\t}", "protected static function clean_array() {\n\t\treturn array( '<', '>', '&', \"'\", '\"' );\n\t}", "function add_magic_quotes($input_array)\n {\n }", "function fix_magic_quotes() {\n\tglobal $HTTP_GET_VARS, $HTTP_POST_VARS, $HTTP_COOKIE_VARS;\n\n\t// clean gpc of slashes\n\tif (!get_magic_quotes_gpc()) {\n\t\treturn false;\n\t}\n\n\t$_GET = transcribe($_GET);\n\t$_POST = transcribe($_POST);\n\t$_COOKIE = transcribe($_COOKIE);\n\t$_REQUEST = transcribe($_REQUEST);\n\n\t$HTTP_GET_VARS = $_GET;\n\t$HTTP_POST_VARS = $_GET;\n\t$HTTP_COOKIE_VARS = $_COOKIE;\n\n\treturn true;\n\n}", "function mf_sanitize($input){\n\t\tif(get_magic_quotes_gpc() && !empty($input)){\n\t\t\t $input = is_array($input) ?\n\t array_map('mf_stripslashes_deep', $input) :\n\t stripslashes(trim($input));\n\t\t}\n\t\t\n\t\treturn $input;\n\t}", "function stripslashes_from_strings_only($value)\n {\n }", "function StripGPC($s_value)\n{\n\tif (get_magic_quotes_gpc() != 0)\n\t\t$s_value = stripslashes($s_value);\n\treturn ($s_value);\n}", "private function escapes() {\n return [\n ['r', \"\\x0d\"],\n ['n', \"\\x0a\"],\n ['t', \"\\x09\"],\n ['b', \"\\x08\"],\n ['f', \"\\x0c\"],\n ['\\\\', \"\\x5c\"]\n ];\n }", "public function getCleanFileAsArray()\n {\n return GeneralUtility::trimExplode(',', $this->getCleanFile(), 1);\n }", "static function revertSlashes($to_strip = null)\n\t{\t\t\n\t\tif (get_magic_quotes_gpc()) {\n\t\t\tif (isset($to_strip)) {\n\t\t\t\treturn is_array($to_strip)\n\t\t\t\t ? array_map(array('Pie_Bootstrap', 'revertSlashes'), $to_strip) \n\t\t\t\t : stripslashes($to_strip);\n\t\t\t}\n\t\t\t$_COOKIE = self::revertSlashes($_COOKIE);\n\t\t\t$_FILES = self::revertSlashes($_FILES);\n\t\t\t$_GET = self::revertSlashes($_GET);\n\t\t\t$_POST = self::revertSlashes($_POST);\n\t\t\t$_REQUEST = self::revertSlashes($_REQUEST);\n\t\t}\n\t}", "function fromGPC($s){\n if(get_magic_quotes_gpc()){\n return stripslashes($s);\n }else{\n return $s;\n }\n }", "public function sanitize(){\r\n\t\t$post = array();\r\n\t\tforeach($_POST as $key => $val){\r\n\t\t\tif(!get_magic_quotes_gpc()){\r\n\t\t\t\t$post[$key] = mysql_real_escape_string($val);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $post;\r\n\t}", "function stripslashes_deep($value)\n{\n $value = is_array($value) ?\n array_map('stripslashes_deep', $value) :\n stripslashes($value);\n return $value;\n}", "function atk_stripslashes(&$var)\n{\n\tif (is_array($var))\n\t{\n\t\tforeach (array_keys($var) as $key)\n\t\t{\n\t\t\tatk_stripslashes($var[$key]);\n\t\t}\n\t}\n\telse\n\t{\n\t\t$var = stripslashes($var);\n\t}\n}", "function array_stripslashes(&$array) {\n if(!is_array($array)) return;\n foreach($array as $k => $v) {\n if(is_array($array[$k])) {\n array_stripslashes($array[$k]);\n } else {\n $array[$k] = stripslashes($array[$k]);\n } // if\n } // foreach\n return $array;\n }", "function stripslashes_deep($value) {\n $value = is_array($value) ?\n array_map('stripslashes_deep', $value) :\n stripslashes($value);\n return $value;\n}", "function stripslashes_deep($value)\r\n{\r\n\treturn is_array($value)?array_map('stripslashes_deep',$value):stripslashes($value);\r\n}", "function stripslashes_deep($value)\n{\n $value = is_array($value) ? array_map('stripslashes_deep', $value) : stripslashes($value);\n\n return $value;\n}", "protected function getTokenSeparators() : array\n {\n return ['\\\"'];\n }", "private static function doFixArray(array &$array){\n if( get_magic_quotes_gpc() == 1 ){\n foreach($array as $key => $value){\n if( is_array($value) )\n $array[$key] = self::doFixArray($value);\n else\n $array[$key] = stripslashes($value);\n }\n }\n }", "function fix_POST_slashes() {\n\tglobal $fixed_POST_slashes;\n\tif (!$fixed_POST_slashes and get_magic_quotes_gpc()) {\n\t\t$fixed_POST_slashes = true;\n\t\tforeach ($_POST as $key => $val) {\n\t\t\tif (gettype($val) == \"array\") {\n\t\t\t\tforeach ($val as $i => $j) {\n\t\t\t\t\t$val[$i] = stripslashes($j);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$_POST[$key] = stripslashes($val);\n\t\t\t}\n\t\t}\n\t}\n}", "function removeSlashes($data){\n foreach($data as $key => $value){\n $data[$key] = stripslashes($value);\n }\n}", "function privDisableMagicQuotes()\n {\n }", "function stripslashesDeep( $data)\r\n {\r\n return is_array($data) ? array_map( 'stripslashesDeep', $data) : stripslashes($data) ;\r\n }", "function stripSlashesDeep($value) \n{\n $value = is_array($value) ? array_map('stripSlashesDeep', $value) : stripslashes($value);\n return $value;\n}", "function stripPostSlashes($string) {\n\t\tif ((get_magic_quotes_gpc()==1) || (get_magic_quotes_runtime()==1))\n\t\t\treturn stripslashes($string);\n\t\telse return $string;\n\t}", "function stripslashes_deep($value) {\n $value = is_array($value) ?\n array_map('stripslashes_deep', $value) :\n stripslashes($value);\n\n return $value;\n}", "function arrayStripslashes(&$array) {\n if (!is_array($array)) {\n return;\n }\n foreach ($array as $k => $v) {\n if (is_array($array[$k])) {\n arrayStripslashes($array[$k]);\n } else {\n $array[$k] = stripslashes($array[$k]);\n }\n }\n return $array;\n}", "function stripslashes_deep($value) {\n\t$value = is_array($value) ? array_map('stripslashes_deep', $value) : stripslashes($value);\n\treturn $value;\n}", "function transcribe($array, $is_top_level = true) {\n $result = array();\n $is_magic = get_magic_quotes_gpc();\n\n foreach ($array as $key => $value) {\n $decoded_key = ($is_magic && !$is_top_level) ? stripslashes($key) : $key;\n\n if (is_array($value)) {\n $decoded_value = transcribe($value, false);\n } else {\n $decoded_value = ($is_magic) ? stripslashes($value) : $value;\n }\n\n $result[$decoded_key] = $decoded_value;\n }\n\n return $result;\n}", "function stripSlashesDeep($value) {\n\t$value = is_array($value) ? array_map('stripSlashesDeep', $value) : stripslashes($value);\n\treturn $value;\n}", "function stripSlashesDeep($value)\n{\n $value = is_array($value) ? array_map('stripSlashesDeep', $value) : stripslashes($value);\n return $value;\n}", "private function stripslash_gpc(&$value) {\r\n $value = stripslashes($value);\r\n }", "function stripslashes_deep( $values ) {\n\t\tif (is_array($values)) {\n\t\t\tforeach ($values as $key => $value)\n\t\t\t\t$values[$key] = stripslashes_deep($value);\t\t\t\n\t\t} else \n\t\t\t$values = stripslashes($values);\t\t\n\t\treturn $values;\n\t}", "public static function stripSlashes($cadena)\n\t\t{\n\t\t\treturn str_replace(\"''\", \"'\", $cadena);\n\t\t}", "function stripSlashesDeep($value) {\n $value = is_array($value) ? array_map('stripSlashesDeep', $value) : stripslashes($value);\n return $value;\n}", "function stripSlashesDeep($value) {\n $value = is_array($value) ? array_map('stripSlashesDeep', $value) : stripslashes($value);\n return $value;\n}", "public function stripSlashes(&$data)\n\t{\n\t\treturn is_array($data) ? array_map(array($this,\"stripslashes\"),$data) : stripslashes($data);\n\t}", "function bwm_clean($s) {\r\n if (get_magic_quotes_gpc())\r\n return trim(stripslashes($s));\r\n return trim($s);\r\n}", "function stripslashes($str)\n{\n}", "function addslashes_array( $value ){\n\t$value = is_array( $value ) ? array_map( 'addslashes_array', $value ) : addslashes( $value );\n\n\treturn $value;\n}", "public static function dataEscapeArguments(): array\n {\n return [\n // empty argument - must be quoted\n 'empty' => ['', '\"\"', \"''\"],\n\n // null argument - must be quoted\n 'empty null' => [null, '\"\"', \"''\"],\n\n // false argument - must be quoted\n 'empty false' => [false, '\"\"', \"''\"],\n\n // unix single-quote must be escaped\n 'unix-sq' => [\"a'bc\", \"a'bc\", \"'a'\\\\''bc'\"],\n\n // new lines must be replaced\n 'new lines' => [\"a\\nb\\nc\", '\"a b c\"', \"'a\\nb\\nc'\"],\n\n // whitespace <space> must be quoted\n 'ws space' => ['a b c', '\"a b c\"', \"'a b c'\"],\n\n // whitespace <tab> must be quoted\n 'ws tab' => [\"a\\tb\\tc\", \"\\\"a\\tb\\tc\\\"\", \"'a\\tb\\tc'\"],\n\n // no whitespace must not be quoted\n 'no-ws' => ['abc', 'abc', \"'abc'\"],\n\n // commas must be quoted\n 'comma' => ['a,bc', '\"a,bc\"', \"'a,bc'\"],\n\n // double-quotes must be backslash-escaped\n 'dq' => ['a\"bc', 'a\\^\"bc', \"'a\\\"bc'\"],\n\n // double-quotes must be backslash-escaped with preceding backslashes doubled\n 'dq-bslash' => ['a\\\\\"bc', 'a\\\\\\\\\\^\"bc', \"'a\\\\\\\"bc'\"],\n\n // backslashes not preceding a double-quote are treated as literal\n 'bslash' => ['ab\\\\\\\\c\\\\', 'ab\\\\\\\\c\\\\', \"'ab\\\\\\\\c\\\\'\"],\n\n // trailing backslashes must be doubled up when the argument is quoted\n 'bslash dq' => ['a b c\\\\\\\\', '\"a b c\\\\\\\\\\\\\\\\\"', \"'a b c\\\\\\\\'\"],\n\n // meta: outer double-quotes must be caret-escaped as well\n 'meta dq' => ['a \"b\" c', '^\"a \\^\"b\\^\" c^\"', \"'a \\\"b\\\" c'\"],\n\n // meta: percent expansion must be caret-escaped\n 'meta-pc1' => ['%path%', '^%path^%', \"'%path%'\"],\n\n // meta: expansion must have two percent characters\n 'meta-pc2' => ['%path', '%path', \"'%path'\"],\n\n // meta: expansion must have have two surrounding percent characters\n 'meta-pc3' => ['%%path', '%%path', \"'%%path'\"],\n\n // meta: bang expansion must be double caret-escaped\n 'meta-bang1' => ['!path!', '^^!path^^!', \"'!path!'\"],\n\n // meta: bang expansion must have two bang characters\n 'meta-bang2' => ['!path', '!path', \"'!path'\"],\n\n // meta: bang expansion must have two surrounding ang characters\n 'meta-bang3' => ['!!path', '!!path', \"'!!path'\"],\n\n // meta: caret-escaping must escape all other meta chars (triggered by double-quote)\n 'meta-all-dq' => ['<>\"&|()^', '^<^>\\^\"^&^|^(^)^^', \"'<>\\\"&|()^'\"],\n\n // other meta: no caret-escaping when whitespace in argument\n 'other meta' => ['<> &| ()^', '\"<> &| ()^\"', \"'<> &| ()^'\"],\n\n // other meta: quote escape chars when no whitespace in argument\n 'other-meta' => ['<>&|()^', '\"<>&|()^\"', \"'<>&|()^'\"],\n ];\n }", "function stripslashes_deep($value)\r\n {\r\n $value = is_array($value) ?\r\n array_map('stripslashes_deep', $value) :\r\n stripslashes($value);\r\n \r\n return $value;\r\n }", "public function quoteSmart($values)\n\t{\n\t\tif(is_array($values))\n\t\t{\n\t\t\t$tmp = [];\n\t\t\tforeach($values as $key=>$str)\n\t\t\t{\n\t\t\t\t$tmp[$key] = \"'\".addslashes($str).\"'\";\n\t\t\t}\t\t\n\t\t\t$values = $tmp;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$values = \"'\".addslashes($values).\"'\";\n\t\t}\n\t\t\n\t\treturn $values;\n\t}", "public function sanitize($string) {\n if(is_array($string)) {\n return array_map(array($this, 'sanitize'), $string);\n } else {\n return (get_magic_quotes_gpc()) ? trim(stripslashes(stripslashes($string))) : trim($string);\n }\n }", "function ss_addslashes($args) {\n\tif( !defined('MAGIC_QUOTES_GPC') ) define('MAGIC_QUOTES_GPC', get_magic_quotes_gpc());\n\tif( !MAGIC_QUOTES_GPC ) { \n\t\tif( is_array($args) ) {\n\t\t\tforeach($args as $key => $val) {\n\t\t\t\t$args[$key] = ss_addslashes($val);\n\t\t\t}\t\t\n\t\t} else {\n\t\t\t$args = addslashes($args);\n\t\t}\n\t}\n\treturn $args;\n}", "private function stripSlashesDeep($value) {\n $value = is_array($value) ? array_map(array($this, 'stripSlashesDeep'), $value) : stripslashes($value);\n return $value;\n }", "function stripslashes2($valeur) { //vire les / lorsqu'ils sont en double ou triple\n\t$valeur = str_replace(\"\\\\\\\\'\",\"'\",$valeur);\n\t$valeur = str_replace(\"\\\\'\",\"'\",$valeur);\n\t$valeur = str_replace(\"'\\\\\\\\\",\"'\\\\\",$valeur);\n\t$valeur = stripslashes($valeur);\n\treturn $valeur;\n}", "function tf_stripslashes_deep_keys($value) {\r\n static $magic_quotes = null;\r\n if ($magic_quotes === null) {\r\n $magic_quotes = get_magic_quotes_gpc();\r\n }\r\n\r\n if ( is_array($value) ) {\r\n if ($magic_quotes) {\r\n $new_value = array();\r\n foreach ($value as $key=>$value) {\r\n $new_value[ is_string($key) ? stripslashes($key) : $key ] = tf_stripslashes_deep_keys($value);\r\n }\r\n $value = $new_value;\r\n unset($new_value);\r\n } else {\r\n $value = array_map('tf_stripslashes_deep_keys', $value);\r\n }\r\n } elseif ( is_object($value) ) {\r\n $vars = get_object_vars( $value );\r\n foreach ($vars as $key=>$data) {\r\n $value->{$key} = tf_stripslashes_deep_keys( $data );\r\n }\r\n } elseif ( is_string( $value ) ) {\r\n $value = stripslashes($value);\r\n }\r\n\r\n return $value;\r\n }", "function stripslashes_deep($value)\n {\n }", "function trim_quotes_togg($data) {\n\t$data = preg_replace(\"/(^['\\\"]|['\\\"]$)/\", '', $data);\n\t\n\t\n\treturn $data;\n}", "public function stripslashes() {\n $i = &$this->getInstance();\n if(get_magic_quotes_gpc()) { stripslashes(stripslashes($i)); }\n return $this;\n }", "function sc_php_escape($value) {\n\tif (is_string($value));\n\t// strip out slashes IF they exist AND magic_quotes is on\n\tif (get_magic_quotes_gpc() && (strstr($value,'\\\"') || strstr($value,\"\\\\'\"))) $value = stripslashes($value);\t\n\t// escape string to make it safe for mysql\n\treturn addslashes($value);\n}", "private function stripQuotes($value)\n {\n return preg_replace('!^([\\'\"])(.*)\\1$!', '$2', $value);\n }", "function stripslashes_deep($value) {\r\n\tif ( is_array($value) ) {\r\n\t\t$value = array_map('stripslashes_deep', $value);\r\n\t} elseif ( is_object($value) ) {\r\n\t\t$vars = get_object_vars( $value );\r\n\t\tforeach ($vars as $key=>$data) {\r\n\t\t\t$value->{$key} = stripslashes_deep( $data );\r\n\t\t}\r\n\t} else {\r\n\t\t$value = stripslashes($value);\r\n\t}\r\n\treturn $value;\r\n}", "function remove_ill($str)\r\n {\r\n\t\treturn (!get_magic_quotes_gpc() ? addslashes(trim($str)) : trim($str));\r\n }", "function cs_stripslashes_htmlspecialchars($value)\n{\n $value = is_array($value) ? array_map('cs_stripslashes_htmlspecialchars', $value) : stripslashes(htmlspecialchars($value));\n return $value;\n}", "private function parse_cookie( $value ) {\n\n\t\tif( !$value || $value == 'null' )\n\t\t\treturn array();\n\n\t\tif( $array = json_decode( stripslashes( $value ), true ) ) // strip slashes and return array\n\t\t\treturn $array;\n\n\t\treturn array();\n\t}", "private function stripSlashes(&$array)\n\t{\n\t\tforeach($array as $key => $value) {\n\t\t\t$array[$key] = (is_array($value) ? array_map('stripslashes', $value) : stripslashes($value));\n\t\t}\n\t}", "public static function stripSlashesDeep($value) {\r\n $value = is_array($value) ? array_map(self::stripSlashesDeep, $value) : stripslashes($value);\r\n return $value;\r\n }", "public static function realEscapeString(string|array $input): string|array {\n if(is_array($input)) {\n return array_map(__METHOD__, $input);\n }\n\n if(!empty($input) && is_string($input)) {\n return str_replace(['\\\\', \"\\0\", \"\\n\", \"\\r\", \"'\", '\"', \"\\x1a\"], ['\\\\\\\\', '\\\\0', '\\\\n', '\\\\r', \"\\\\'\", '\\\\\"', '\\\\Z'], $input);\n }\n\n return $input;\n }", "function stripSlashesDeep($value) {\r\n $value = is_array($value) ? array_map('cleanInputs', $value) : stripslashes($value);\r\n return $value;\r\n}", "private function removeSlashes(&$var) {\r\n\t\tif (is_array($var)) {\r\n\t\t\tforeach ($var as $name => $value) {\r\n\t\t\t\tif (is_array($value)) {\r\n\t\t\t\t\t$this->removeSlashes($value);\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$var[$name] = stripslashes($value);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t$var = stripslashes($var);\r\n\t\t}\r\n\t}", "public function stripSlashesGPC( $data ) {\n\t\treturn $data;\n\t}", "function stripslashes_recursive($value) {\n\t\t$value = is_array($value) ? array_map(array($this, 'stripslashes_recursive'), $value) : stripslashes($value);\n\t\treturn $value;\n\t}", "function smartaddslashes($str) {\n\t\tif ( get_magic_quotes_gpc() == false ) {\n\t\t\t$str = addslashes( $str );\n\t\t}\n\t\treturn $str;\n\t}", "public function stripSlashesDeep($value) {\n $value = is_array($value) ? array_map(array($this, 'stripSlashesDeep'), $value) : $this->stripslashes($value);\n return $value;\n }", "function stripString($string) {\r\n return stripslashes($string);\r\n}", "private function _strip_slashes_deep($value)\n {\n $value = is_array($value) ? array_map(array($this, '_strip_slashes_deep'), $value) : stripslashes($value);\n return $value;\n }", "public function stripslash_gpc($value) {\r\n $value = stripslashes($value);\r\n\t\t$value = htmlspecialchars($value);\r\n\t\t$value = trim($value);\r\n\t\treturn $value;\r\n }" ]
[ "0.71926653", "0.7074007", "0.70001817", "0.69485855", "0.69453675", "0.69428396", "0.6860316", "0.68527216", "0.6735282", "0.67021024", "0.6683923", "0.6632399", "0.65052444", "0.64834124", "0.64484143", "0.6420708", "0.632399", "0.6311155", "0.6286795", "0.6283601", "0.6247524", "0.6135413", "0.6078002", "0.60696346", "0.6066656", "0.6061079", "0.6059081", "0.60577816", "0.60491073", "0.60220796", "0.6002259", "0.59982014", "0.5996646", "0.599219", "0.59509814", "0.5940078", "0.5909572", "0.59071726", "0.5859847", "0.5848901", "0.58416504", "0.5794022", "0.57804215", "0.5767985", "0.575626", "0.57479167", "0.5747785", "0.5729423", "0.56944567", "0.566809", "0.5655271", "0.5635153", "0.5633014", "0.5630576", "0.5625499", "0.56135875", "0.5593019", "0.5591542", "0.55911714", "0.5591162", "0.55875915", "0.55856353", "0.55838215", "0.5569976", "0.55528337", "0.5542496", "0.5542496", "0.55387616", "0.5538163", "0.552707", "0.5486471", "0.5482863", "0.54524827", "0.5435086", "0.5428308", "0.54141015", "0.54112476", "0.53909576", "0.53855836", "0.5383345", "0.5377712", "0.53592813", "0.5352837", "0.5332481", "0.5330134", "0.532492", "0.5323806", "0.5321215", "0.53185326", "0.531692", "0.5310861", "0.52977914", "0.5296872", "0.5292618", "0.52925074", "0.52892685", "0.5259981", "0.52556616", "0.52507955", "0.5240754" ]
0.72119236
0
Strip a value of unwanted characters, which might be hacks.
function Strip($value) { $value = StripGPC($value); $value = str_replace("\"","'",$value); $value = preg_replace('/[[:cntrl:][:space:]]+/'," ",$value); // zap all control chars and multiple blanks return ($value); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function make_clean($value) {\n\t\t$legal_chars = \"%[^0-9a-zA-Z������� ]%\"; //allow letters, numbers & space\n\t\t$new_value = preg_replace($legal_chars,\"\",$value); //replace with \"\"\n\t\treturn $new_value;\n\t}", "public function clean_string($value) {\n $data = trim($value);\n\n // Removes Unwanted Characters\n $data = filter_var($data, FILTER_SANITIZE_STRING);\n\n // Sanitizes HTML Characters\n $data = htmlspecialchars_decode($data, ENT_QUOTES);\n\n return $data;\n }", "public function cleanString($value) {\n $data = trim($value);\n \n // Removes Unwanted Characters\n $data = filter_var($data, FILTER_SANITIZE_STRING);\n \n // Sanitizes HTML Characters\n $data = htmlspecialchars_decode($data, ENT_QUOTES);\n \n return $data;\n }", "function strip_bad_chars( $input ) {\n $output = preg_replace( \"/[^a-zA-Z0-9_-]/\", \"\", $input );\n return $output;\n }", "protected function cleanValue()\n {\n return str_replace([\n '%',\n '-',\n '+',\n ], '', $this->condition->value);\n }", "function clean_unwanted_characters($oneStr){\n\t$cleaned_str = $oneStr;\r\n// \t$cleaned_str = str_ireplace(\"\\\"\", \"/\", $oneStr);\r\n// \t$cleaned_str = str_ireplace(\"\\\\\", \"/\", $cleaned_str);\r\n// \t$cleaned_str = str_ireplace(\"\\\\b\", \" \", $cleaned_str);\r\n// \t$cleaned_str = str_ireplace(\"\\\\f\", \" / \", $cleaned_str);\r\n// \t$cleaned_str = str_ireplace(\"\\\\r\", \" / \", $cleaned_str);\r\n// \t$cleaned_str = str_ireplace(\"\\t\", \" \", $cleaned_str);\r\n// \t$cleaned_str = str_ireplace(\"\\\\u\", \" \", $cleaned_str);\r\n// \t$cleaned_str = str_ireplace(\"</\", \"<\\/\", $cleaned_str);\r\n\treturn $cleaned_str;\n\r\n}", "public function filter($value) {\n mb_internal_encoding(\"UTF-8\");\n mb_regex_encoding(\"UTF-8\");\n\n $pattern = '[^'.$this->options[\"characters\"].']';\n\n return mb_ereg_replace($pattern, \"\", $value);\n }", "function Strip_Bad_chars($input)\n{\n //$output = preg_replace(\"/[^a-zA-Z0-9_-]/\", \"\", $input);\n $output = preg_replace(\"/[^0-9]/\", \"\", $input);\n return $output;\n}", "function remove_strange_chars($txt){\n\t\treturn(str_replace(array('<','>',\"'\",\";\",\"&\",\"\\\\\"),'',$txt));\n\t}", "public function remove_xss($val) {\n // this prevents some character re-spacing such as <java\\0script>\n // note that you have to handle splits with \\n, \\r, and \\t later since they *are* allowed in some inputs\n $val = preg_replace('/([\\x00-\\x08,\\x0b-\\x0c,\\x0e-\\x19])/', '', $val);\n\n // straight replacements, the user should never need these since they're normal characters\n // this prevents like <IMG SRC=@avascript:alert('XSS')>\n $search = 'abcdefghijklmnopqrstuvwxyz';\n $search .= 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';\n $search .= '1234567890!@#$%^&*()';\n $search .= '~`\";:?+/={}[]-_|\\'\\\\';\n for ($i = 0; $i < strlen($search); $i++) {\n // ;? matches the ;, which is optional\n // 0{0,7} matches any padded zeros, which are optional and go up to 8 chars\n\n // @ @ search for the hex values\n $val = preg_replace('/(&#[xX]0{0,8}'.dechex(ord($search[$i])).';?)/i', $search[$i], $val); // with a ;\n // @ @ 0{0,7} matches '0' zero to seven times\n $val = preg_replace('/(&#0{0,8}'.ord($search[$i]).';?)/', $search[$i], $val); // with a ;\n }\n\n // now the only remaining whitespace attacks are \\t, \\n, and \\r\n $ra1 = array('javascript', 'vbscript', 'expression', 'applet', 'meta', 'xml', 'blink', 'link', 'style', 'script', 'embed', 'object', 'iframe', 'frame', 'frameset', 'ilayer', 'layer', 'bgsound', 'title', 'base');\n $ra2 = array('onabort', 'onactivate', 'onafterprint', 'onafterupdate', 'onbeforeactivate', 'onbeforecopy', 'onbeforecut', 'onbeforedeactivate', 'onbeforeeditfocus', 'onbeforepaste', 'onbeforeprint', 'onbeforeunload', 'onbeforeupdate', 'onblur', 'onbounce', 'oncellchange', 'onchange', 'onclick', 'oncontextmenu', 'oncontrolselect', 'oncopy', 'oncut', 'ondataavailable', 'ondatasetchanged', 'ondatasetcomplete', 'ondblclick', 'ondeactivate', 'ondrag', 'ondragend', 'ondragenter', 'ondragleave', 'ondragover', 'ondragstart', 'ondrop', 'onerror', 'onerrorupdate', 'onfilterchange', 'onfinish', 'onfocus', 'onfocusin', 'onfocusout', 'onhelp', 'onkeydown', 'onkeypress', 'onkeyup', 'onlayoutcomplete', 'onload', 'onlosecapture', 'onmousedown', 'onmouseenter', 'onmouseleave', 'onmousemove', 'onmouseout', 'onmouseover', 'onmouseup', 'onmousewheel', 'onmove', 'onmoveend', 'onmovestart', 'onpaste', 'onpropertychange', 'onreadystatechange', 'onreset', 'onresize', 'onresizeend', 'onresizestart', 'onrowenter', 'onrowexit', 'onrowsdelete', 'onrowsinserted', 'onscroll', 'onselect', 'onselectionchange', 'onselectstart', 'onstart', 'onstop', 'onsubmit', 'onunload');\n $ra = array_merge($ra1, $ra2);\n\n $found = true; // keep replacing as long as the previous round replaced something\n while ($found == true) {\n $val_before = $val;\n for ($i = 0; $i < sizeof($ra); $i++) {\n $pattern = '/';\n for ($j = 0; $j < strlen($ra[$i]); $j++) {\n if ($j > 0) {\n $pattern .= '(';\n $pattern .= '(&#[xX]0{0,8}([9ab]);)';\n $pattern .= '|';\n $pattern .= '|(&#0{0,8}([9|10|13]);)';\n $pattern .= ')*';\n }\n $pattern .= $ra[$i][$j];\n }\n $pattern .= '/i';\n $replacement = substr($ra[$i], 0, 2).'<x>'.substr($ra[$i], 2); // add in <> to nerf the tag\n $val = preg_replace($pattern, $replacement, $val); // filter out the hex tags\n if ($val_before == $val) {\n // no replacements were made, so exit the loop\n $found = false;\n }\n }\n }\n return $val;\n }", "protected function filterAlphanum($value) {\n return preg_replace(\"/[^a-z0-9]/i\", \"\", $value);\n }", "function scrub($str) {\n\t$str = preg_replace('/[^A-Za-z0-9]/','',$str);\n\treturn $str;\n}", "protected function _clean( $value ) {\n\t\treturn str_replace( [ \"\\t\", \"\\n\", \"\\r\" ], '', $value );\n\t}", "function inputCleaner($value){\n\t $toBeTested\t\t= strip_tags($value);\n\t // Instead of using HTMLStripSpecialChars, I am using some Regex\n\t\t// to have a greater degree of control over the input.\n\t\t//\tThis regex checks the entire string for anything that\n\t\t//\tcould ruin our consistency.\n\t $regExp = (\"/[\\!\\\"\\£\\$\\%\\^\\&\\*\\(\\)\\;\\'\\,\\\"\\?]/ \");\n\t if(preg_match_all($regExp, $toBeTested,$matches)){\n\t \treturn false;\n\t\t}\n\t\telse{\n\t\t\treturn $toBeTested;\n\t\t}\n\t}", "public function filter($value)\n {\n $whiteSpace = $this->allowWhiteSpace ? '\\s' : '';\n\n if ($this->englishAlphabethOnly || !self::$unicodeEnabled) {\n $pattern = '/[^a-zA-Z' . $whiteSpace . ']/';\n }\n else {\n $pattern = '/[^\\p{L}' . $whiteSpace . ']/u';\n }\n\n return preg_replace($pattern, '', (string) $value);\n }", "function removeUnnecessaryCharas($string)\n{\n return preg_replace('~\\s+~s', '', $string);\n}", "public function filterValue($value) {\n return preg_replace('/[\\n\\r\\t]/', '', $value);\n }", "function sanitation($value) {\n\treturn strip_tags($value);\n}", "function search_strip_badchars($line) {\n// \n $line = str_replace(\".\", \" \", $line);\n $line = str_replace(\"\\\"\", \" \", $line);\n $line = str_replace(\"'\", \"\", $line);\n $line = str_replace(\"+\", \" \", $line);\n $line = str_replace(\"-\", \" \", $line);\n $line = str_replace(\"*\", \" \", $line);\n $line = str_replace(\"/\", \" \", $line);\n $line = str_replace(\"!\", \" \", $line);\n $line = str_replace(\"%\", \" \", $line);\n $line = str_replace(\">\", \" \", $line);\n $line = str_replace(\"<\", \" \", $line);\n $line = str_replace(\"^\", \" \", $line);\n $line = str_replace(\"(\", \" \", $line);\n $line = str_replace(\")\", \" \", $line);\n $line = str_replace(\"[\", \" \", $line);\n $line = str_replace(\"]\", \" \", $line);\n $line = str_replace(\"{\", \" \", $line);\n $line = str_replace(\"}\", \" \", $line);\n $line = str_replace(\"\\\\\", \" \", $line);\n $line = str_replace(\"=\", \" \", $line);\n $line = str_replace(\"$\", \" \", $line);\n $line = str_replace(\"#\", \" \", $line);\n $line = str_replace(\"?\", \" \", $line);\n $line = str_replace(\"~\", \" \", $line);\n $line = str_replace(\":\", \" \", $line);\n $line = str_replace(\"_\", \" \", $line);\n $line = str_replace(\" \", \" \", $line);\n $line = str_replace(\"&amp;\", \" \", $line);\n $line = str_replace(\"&copy;\", \" \", $line);\n $line = str_replace(\"&nbsp;\", \" \", $line);\n $line = str_replace(\"&quot;\", \" \", $line);\n $line = str_replace(\"&\", \" \", $line);\n $line = str_replace(\";\", \" \", $line);\n $line = str_replace(\"\\n\", \" \", $line);\n return $line;\n}", "public static function stripFunkyChars($string = '') {\n\n foreach (StringTools::funkyCharsMap() as $weird => $normal) {\n $string = str_replace($weird, '', $string);\n }\n\n return $string;\n }", "function clean_iptc_value($value)\n{\n\t// strip leading zeros (weird Kodak Scanner software)\n\twhile ( isset($value[0]) and $value[0] == chr(0)) {\n\t\t$value = substr($value, 1);\n\t}\n\t// remove binary nulls\n\t$value = str_replace(chr(0x00), ' ', $value);\n\n\treturn $value;\n}", "function removeXSS($val)\t{\n\t// this prevents some character re-spacing such as <java\\0script>\n\t// note that you have to handle splits with \\n, \\r, and \\t later since they *are* allowed in some inputs\n\t$val = preg_replace('/([\\x00-\\x08][\\x0b-\\x0c][\\x0e-\\x20])/', '', $val);\n\n\t// straight replacements, the user should never need these since they're normal characters\n\t// this prevents like <IMG SRC=&#X40&#X61&#X76&#X61&#X73&#X63&#X72&#X69&#X70&#X74&#X3A&#X61&#X6C&#X65&#X72&#X74&#X28&#X27&#X58&#X53&#X53&#X27&#X29>\n\t$search = 'abcdefghijklmnopqrstuvwxyz';\n\t$search.= 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';\n\t$search.= '1234567890!@#$%^&*()';\n\t$search.= '~`\";:?+/={}[]-_|\\'\\\\';\n\n\tfor ($i = 0; $i < strlen($search); $i++) {\n\t\t// ;? matches the ;, which is optional\n\t\t// 0{0,7} matches any padded zeros, which are optional and go up to 8 chars\n\n\t\t// &#x0040 @ search for the hex values\n\t\t$val = preg_replace('/(&#[x|X]0{0,8}'.dechex(ord($search[$i])).';?)/i', $search[$i], $val); // with a ;\n\t\t// &#00064 @ 0{0,7} matches '0' zero to seven times\n\t\t$val = preg_replace('/(&#0{0,8}'.ord($search[$i]).';?)/', $search[$i], $val); // with a ;\n\t}\n\n\t// now the only remaining whitespace attacks are \\t, \\n, and \\r\n\t$ra1 = array('javascript', 'vbscript', 'expression', 'applet', 'meta', 'xml', 'blink', 'link', 'style', 'script', 'embed', 'object', 'iframe', 'frame', 'frameset', 'ilayer', 'layer', 'bgsound', 'title', 'base');\n\t$ra2 = array('onabort', 'onactivate', 'onafterprint', 'onafterupdate', 'onbeforeactivate', 'onbeforecopy', 'onbeforecut', 'onbeforedeactivate', 'onbeforeeditfocus', 'onbeforepaste', 'onbeforeprint', 'onbeforeunload', 'onbeforeupdate', 'onblur', 'onbounce', 'oncellchange', 'onchange', 'onclick', 'oncontextmenu', 'oncontrolselect', 'oncopy', 'oncut', 'ondataavailable', 'ondatasetchanged', 'ondatasetcomplete', 'ondblclick', 'ondeactivate', 'ondrag', 'ondragend', 'ondragenter', 'ondragleave', 'ondragover', 'ondragstart', 'ondrop', 'onerror', 'onerrorupdate', 'onfilterchange', 'onfinish', 'onfocus', 'onfocusin', 'onfocusout', 'onhelp', 'onkeydown', 'onkeypress', 'onkeyup', 'onlayoutcomplete', 'onload', 'onlosecapture', 'onmousedown', 'onmouseenter', 'onmouseleave', 'onmousemove', 'onmouseout', 'onmouseover', 'onmouseup', 'onmousewheel', 'onmove', 'onmoveend', 'onmovestart', 'onpaste', 'onpropertychange', 'onreadystatechange', 'onreset', 'onresize', 'onresizeend', 'onresizestart', 'onrowenter', 'onrowexit', 'onrowsdelete', 'onrowsinserted', 'onscroll', 'onselect', 'onselectionchange', 'onselectstart', 'onstart', 'onstop', 'onsubmit', 'onunload');\n\t$ra = array_merge($ra1, $ra2);\n\n\t$found = true; // keep replacing as long as the previous round replaced something\n\twhile ($found == true) {\n\t\t$val_before = $val;\n\t\tfor ($i = 0; $i < sizeof($ra); $i++) {\n\t\t\t$pattern = '/';\n\t\t\tfor ($j = 0; $j < strlen($ra[$i]); $j++) {\n\t\t\t\tif ($j > 0) {\n\t\t\t\t\t$pattern .= '(';\n\t\t\t\t\t$pattern .= '(&#[x|X]0{0,8}([9][a][b]);?)?';\n\t\t\t\t\t$pattern .= '|(&#0{0,8}([9][10][13]);?)?';\n\t\t\t\t\t$pattern .= ')?';\n\t\t\t\t}\n\t\t\t\t$pattern .= $ra[$i][$j];\n\t\t\t}\n\t\t\t$pattern .= '/i';\n\t\t\t$replacement = substr($ra[$i], 0, 2).'<x>'.substr($ra[$i], 2); // add in <> to nerf the tag\n\t\t\t$val = preg_replace($pattern, $replacement, $val); // filter out the hex tags\n\t\t\tif ($val_before == $val) {\n\t\t\t\t// no replacements were made, so exit the loop\n\t\t\t\t$found = false;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn $val;\n}", "function remove_special_chars($string) {\n\t return preg_replace ('/[^a-zA-Z0-9]/', '', $string);\n\t}", "function StripGPC($s_value)\n{\n\tif (get_magic_quotes_gpc() != 0)\n\t\t$s_value = stripslashes($s_value);\n\treturn ($s_value);\n}", "private function _sanitize($pValue)\n\t{\n\t\t$value = trim($pValue);\n\t\t$value = htmlspecialchars($value, ENT_QUOTES, 'UTF-8');\n\t\t$value = (string)$value;\n\t\treturn $value;\n\t}", "function parseCleanValue($v){\r\n\t\tif($v == \"\"){\r\n\t\t\treturn \"\";\r\n\t\t}\r\n\t\t$v = str_replace(\"&#032;\", \" \", $v);\r\n\t\t$v = str_replace(\"&\" , \"&amp;\" , $v);\r\n\t\t$v = str_replace(\"<!--\" , \"&#60;&#33;--\" , $v);\r\n\t\t$v = str_replace(\"-->\" , \"--&#62;\" , $v);\r\n\t\t$v = preg_replace(\"/<script/i\" , \"&#60;script\" , $v);\r\n\t\t$v = str_replace(\">\" , \"&gt;\" , $v);\r\n\t\t$v = str_replace(\"<\" , \"&lt;\" , $v);\r\n\t\t$v = str_replace(\"\\\"\" , \"&quot;\" , $v);\r\n\t\t$v = preg_replace(\"/\\n/\" , \"<br />\" , $v); // Convert literal newlines\r\n\t\t$v = preg_replace(\"/\\\\\\$/\" , \"&#036;\" , $v);\r\n\t\t$v = preg_replace(\"/\\r/\" , \"\" , $v); // Remove literal carriage returns\r\n\t\t$v = str_replace(\"!\" , \"&#33;\" , $v);\r\n\t\t$v = str_replace(\"'\" , \"&#39;\" , $v); // IMPORTANT: It helps to increase sql query safety.\r\n\t\t// Ensure unicode chars are OK\r\n\t\t$v = preg_replace(\"/&amp;#([0-9]+);/s\", \"&#\\\\1;\", $v);\r\n\t\t// Strip slashes if not already done so.\r\n\t\tif($this->get_magic_quotes){\r\n\t\t\t$v = stripslashes($v);\r\n\t\t}\r\n\t\t// Swap user entered backslashes\r\n\t\t$v = preg_replace(\"/\\\\\\(?!&amp;#|\\?#)/\", \"&#092;\", $v);\r\n\t\treturn $v;\r\n\t}", "function remove_xss($val) {\n // this prevents some character re-spacing such as <java\\0script>\n // note that you have to handle splits with \\n, \\r, and \\t later since they *are* allowed in some inputs\n $val = preg_replace('/([\\x00-\\x08,\\x0b-\\x0c,\\x0e-\\x19])/', '', $val);\n\n // straight replacements, the user should never need these since they're normal characters\n // this prevents like <IMG SRC=@avascript:alert('XSS')>\n $search = 'abcdefghijklmnopqrstuvwxyz';\n $search .= 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';\n $search .= '1234567890!@#$%^&*()';\n $search .= '~`\";:?+/={}[]-_|\\'\\\\';\n for ($i = 0; $i < strlen($search); $i++) {\n // ;? matches the ;, which is optional\n // 0{0,7} matches any padded zeros, which are optional and go up to 8 chars\n // @ @ search for the hex values\n $val = preg_replace('/(&#[xX]0{0,8}'.dechex(ord($search[$i])).';?)/i', $search[$i], $val); // with a ;\n // @ @ 0{0,7} matches '0' zero to seven times\n $val = preg_replace('/(&#0{0,8}'.ord($search[$i]).';?)/', $search[$i], $val); // with a ;\n }\n\n // now the only remaining whitespace attacks are \\t, \\n, and \\r\n $ra1 = array('javascript', 'vbscript', 'expression', 'applet', 'meta', 'xml', 'blink', 'link', 'style', 'script', 'embed', 'object', 'iframe', 'frame', 'frameset', 'ilayer', 'layer', 'bgsound', 'title', 'base');\n $ra2 = array('onabort', 'onactivate', 'onafterprint', 'onafterupdate', 'onbeforeactivate', 'onbeforecopy', 'onbeforecut', 'onbeforedeactivate', 'onbeforeeditfocus', 'onbeforepaste', 'onbeforeprint', 'onbeforeunload', 'onbeforeupdate', 'onblur', 'onbounce', 'oncellchange', 'onchange', 'onclick', 'oncontextmenu', 'oncontrolselect', 'oncopy', 'oncut', 'ondataavailable', 'ondatasetchanged', 'ondatasetcomplete', 'ondblclick', 'ondeactivate', 'ondrag', 'ondragend', 'ondragenter', 'ondragleave', 'ondragover', 'ondragstart', 'ondrop', 'onerror', 'onerrorupdate', 'onfilterchange', 'onfinish', 'onfocus', 'onfocusin', 'onfocusout', 'onhelp', 'onkeydown', 'onkeypress', 'onkeyup', 'onlayoutcomplete', 'onload', 'onlosecapture', 'onmousedown', 'onmouseenter', 'onmouseleave', 'onmousemove', 'onmouseout', 'onmouseover', 'onmouseup', 'onmousewheel', 'onmove', 'onmoveend', 'onmovestart', 'onpaste', 'onpropertychange', 'onreadystatechange', 'onreset', 'onresize', 'onresizeend', 'onresizestart', 'onrowenter', 'onrowexit', 'onrowsdelete', 'onrowsinserted', 'onscroll', 'onselect', 'onselectionchange', 'onselectstart', 'onstart', 'onstop', 'onsubmit', 'onunload');\n $ra = array_merge($ra1, $ra2);\n\n $found = true; // keep replacing as long as the previous round replaced something\n while ($found == true) {\n $val_before = $val;\n for ($i = 0; $i < sizeof($ra); $i++) {\n $pattern = '/';\n for ($j = 0; $j < strlen($ra[$i]); $j++) {\n if ($j > 0) {\n $pattern .= '(';\n $pattern .= '(&#[xX]0{0,8}([9ab]);)';\n $pattern .= '|';\n $pattern .= '|(&#0{0,8}([9|10|13]);)';\n $pattern .= ')*';\n }\n $pattern .= $ra[$i][$j];\n }\n $pattern .= '/i';\n $replacement = substr($ra[$i], 0, 2).'<x>'.substr($ra[$i], 2); // add in <> to nerf the tag\n $val = preg_replace($pattern, $replacement, $val); // filter out the hex tags\n if ($val_before == $val) {\n // no replacements were made, so exit the loop\n $found = false;\n }\n }\n }\n return $val;\n}", "function fsl_scrub($string){\n \n $xss = new xss_filter();\n $string = $xss->filter_it($string); \n return $string;\n}", "function anti_injection($data){\n\t$filter = stripslashes(strip_tags(htmlspecialchars($data, ENT_QUOTES)));\n\treturn $filter;\n}", "function filterString($string){\n $string = filter_var(trim($string), FILTER_SANITIZE_SPECIAL_CHARS); // Removes a small list of special chars\n // $string = filter_var(trim($string), FILTER_SANITIZE_FULL_SPECIAL_CHARS); // Removes all special chars\n return $string;\n}", "function parse_clean_value($val)\n {\n \tif ( $val == \"\" )\n \t{\n \t\treturn \"\";\n \t}\n \n \t$val = str_replace( \"&#032;\", \" \", $this->txt_stripslashes($val) );\n \t\n \tif ( isset($this->vars['strip_space_chr']) AND $this->vars['strip_space_chr'] )\n \t{\n \t\t$val = str_replace( chr(0xCA), \"\", $val ); //Remove sneaky spaces\n \t}\n \t\n \t// As cool as this entity is...\n \t\n \t$val = str_replace( \"&#8238;\"\t\t, ''\t\t\t , $val );\n \t\n \t$val = str_replace( \"&\"\t\t\t\t, \"&amp;\" , $val );\n \t$val = str_replace( \"<!--\"\t\t\t, \"&#60;&#33;--\" , $val );\n \t$val = str_replace( \"-->\"\t\t\t, \"--&#62;\" , $val );\n \t$val = preg_replace( \"/<script/i\"\t, \"&#60;script\" , $val );\n \t$val = str_replace( \">\"\t\t\t\t, \"&gt;\" , $val );\n \t$val = str_replace( \"<\"\t\t\t\t, \"&lt;\" , $val );\n \t$val = str_replace( '\"'\t\t\t\t, \"&quot;\" , $val );\n \t$val = str_replace( \"\\n\"\t\t\t, \"<br />\" , $val ); // Convert literal newlines\n \t$val = str_replace( \"$\"\t\t\t\t, \"&#036;\" , $val );\n \t$val = str_replace( \"\\r\"\t\t\t, \"\" , $val ); // Remove literal carriage returns\n \t$val = str_replace( \"!\"\t\t\t\t, \"&#33;\" , $val );\n \t$val = str_replace( \"'\"\t\t\t\t, \"&#39;\" , $val ); // IMPORTANT: It helps to increase sql query safety.\n \t\n \t// Ensure unicode chars are OK\n \t\n \tif ( $this->allow_unicode )\n\t\t{\n\t\t\t$val = preg_replace(\"/&amp;#([0-9]+);/s\", \"&#\\\\1;\", $val );\n\t\t\t\n\t\t\t//-----------------------------------------\n\t\t\t// Try and fix up HTML entities with missing ;\n\t\t\t//-----------------------------------------\n\n\t\t\t$val = preg_replace( \"/&#(\\d+?)([^\\d;])/i\", \"&#\\\\1;\\\\2\", $val );\n\t\t}\n \t\n \treturn $val;\n }", "public function sanitize($value)\r\n\t{\r\n\t\tarray_walk(\r\n\t\t\t$value,\r\n\t\t\tfunction(&$value) {\r\n\t\t\t\t$value=trim($value);\r\n\t\t\t\t}\r\n\t\t\t);\r\n\t\treturn $value;\r\n\t}", "function remove_xss($val) {\n // this prevents some character re-spacing such as <java\\0script>\n // note that you have to handle splits with \\n, \\r, and \\t later since they *are* allowed in some inputs\n $val = preg_replace('/([\\x00-\\x08,\\x0b-\\x0c,\\x0e-\\x19])/', '', $val);\n\n // straight replacements, the user should never need these since they're normal characters\n // this prevents like <IMG SRC=@avascript:alert('XSS')>\n $search = 'abcdefghijklmnopqrstuvwxyz';\n $search .= 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';\n $search .= '1234567890!@#$%^&*()';\n $search .= '~`\";:?+/={}[]-_|\\'\\\\';\n for ($i = 0; $i < strlen($search); $i++) {\n // ;? matches the ;, which is optional\n // 0{0,7} matches any padded zeros, which are optional and go up to 8 chars\n\n // @ @ search for the hex values\n $val = preg_replace('/(&#[xX]0{0,8}'.dechex(ord($search[$i])).';?)/i', $search[$i], $val); // with a ;\n // @ @ 0{0,7} matches '0' zero to seven times\n $val = preg_replace('/(&#0{0,8}'.ord($search[$i]).';?)/', $search[$i], $val); // with a ;\n }\n\n // now the only remaining whitespace attacks are \\t, \\n, and \\r\n $ra1 = array('javascript', 'vbscript', 'expression', 'applet', 'meta', 'xml', 'blink', 'link', 'style', 'script', 'embed', 'object', 'iframe', 'frame', 'frameset', 'ilayer', 'layer', 'bgsound', 'title', 'base');\n $ra2 = array('onabort', 'onactivate', 'onafterprint', 'onafterupdate', 'onbeforeactivate', 'onbeforecopy', 'onbeforecut', 'onbeforedeactivate', 'onbeforeeditfocus', 'onbeforepaste', 'onbeforeprint', 'onbeforeunload', 'onbeforeupdate', 'onblur', 'onbounce', 'oncellchange', 'onchange', 'onclick', 'oncontextmenu', 'oncontrolselect', 'oncopy', 'oncut', 'ondataavailable', 'ondatasetchanged', 'ondatasetcomplete', 'ondblclick', 'ondeactivate', 'ondrag', 'ondragend', 'ondragenter', 'ondragleave', 'ondragover', 'ondragstart', 'ondrop', 'onerror', 'onerrorupdate', 'onfilterchange', 'onfinish', 'onfocus', 'onfocusin', 'onfocusout', 'onhelp', 'onkeydown', 'onkeypress', 'onkeyup', 'onlayoutcomplete', 'onload', 'onlosecapture', 'onmousedown', 'onmouseenter', 'onmouseleave', 'onmousemove', 'onmouseout', 'onmouseover', 'onmouseup', 'onmousewheel', 'onmove', 'onmoveend', 'onmovestart', 'onpaste', 'onpropertychange', 'onreadystatechange', 'onreset', 'onresize', 'onresizeend', 'onresizestart', 'onrowenter', 'onrowexit', 'onrowsdelete', 'onrowsinserted', 'onscroll', 'onselect', 'onselectionchange', 'onselectstart', 'onstart', 'onstop', 'onsubmit', 'onunload');\n $ra = array_merge($ra1, $ra2);\n\n $found = true; // keep replacing as long as the previous round replaced something\n while ($found == true) {\n $val_before = $val;\n for ($i = 0; $i < sizeof($ra); $i++) {\n $pattern = '/';\n for ($j = 0; $j < strlen($ra[$i]); $j++) {\n if ($j > 0) {\n $pattern .= '(';\n $pattern .= '(&#[xX]0{0,8}([9ab]);)';\n $pattern .= '|';\n $pattern .= '|(&#0{0,8}([9|10|13]);)';\n $pattern .= ')*';\n }\n $pattern .= $ra[$i][$j];\n }\n $pattern .= '/i';\n $replacement = substr($ra[$i], 0, 2).'<x>'.substr($ra[$i], 2); // add in <> to nerf the tag\n $val = preg_replace($pattern, $replacement, $val); // filter out the hex tags\n if ($val_before == $val) {\n // no replacements were made, so exit the loop\n $found = false;\n }\n }\n }\n return $val;\n}", "function filter_chars($str) {\n\treturn preg_replace(\"/[^A-Za-z0-9_]*/\", \"\", $str);\n}", "private function Clean($value){\r\n\t\t\treturn htmlspecialchars(strip_tags($value));\r\n\t\t}", "static function removeXss($val) {\n\t\t// this prevents some character re-spacing such as <java\\0script>\n\t\t// note that you have to handle splits with \\n, \\r, and \\t later since they *are* allowed in some inputs\n\t\t$val = preg_replace('/([\\x00-\\x08,\\x0b-\\x0c,\\x0e-\\x19])/', '', $val);\n\n\t\t// straight replacements, the user should never need these since they're normal characters\n\t\t// this prevents like <IMG SRC=@avascript:alert('XSS')>\n\t\t$search = 'abcdefghijklmnopqrstuvwxyz';\n\t\t$search .= 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';\n\t\t$search .= '1234567890!@#$%^&*()';\n\t\t$search .= '~`\";:?+/={}[]-_|\\'\\\\';\n\t\tfor ($i = 0; $i < strlen($search); $i++) {\n\t\t // ;? matches the ;, which is optional\n\t\t // 0{0,7} matches any padded zeros, which are optional and go up to 8 chars\n\n\t\t // @ @ search for the hex values\n\t\t $val = preg_replace('/(&#[xX]0{0,8}'.dechex(ord($search[$i])).';?)/i', $search[$i], $val); // with a ;\n\t\t // @ @ 0{0,7} matches '0' zero to seven times\n\t\t $val = preg_replace('/(&#0{0,8}'.ord($search[$i]).';?)/', $search[$i], $val); // with a ;\n\t\t}\n\n\t\t// now the only remaining whitespace attacks are \\t, \\n, and \\r\n\t\t$ra1 = array('javascript', 'vbscript', 'expression', 'applet', 'meta', 'xml', 'blink', 'link', 'style', 'script', 'embed', 'object', 'iframe', 'frame', 'frameset', 'ilayer', 'layer', 'bgsound', 'title', 'base');\n\t\t$ra2 = array('onabort', 'onactivate', 'onafterprint', 'onafterupdate', 'onbeforeactivate', 'onbeforecopy', 'onbeforecut', 'onbeforedeactivate', 'onbeforeeditfocus', 'onbeforepaste', 'onbeforeprint', 'onbeforeunload', 'onbeforeupdate', 'onblur', 'onbounce', 'oncellchange', 'onchange', 'onclick', 'oncontextmenu', 'oncontrolselect', 'oncopy', 'oncut', 'ondataavailable', 'ondatasetchanged', 'ondatasetcomplete', 'ondblclick', 'ondeactivate', 'ondrag', 'ondragend', 'ondragenter', 'ondragleave', 'ondragover', 'ondragstart', 'ondrop', 'onerror', 'onerrorupdate', 'onfilterchange', 'onfinish', 'onfocus', 'onfocusin', 'onfocusout', 'onhelp', 'onkeydown', 'onkeypress', 'onkeyup', 'onlayoutcomplete', 'onload', 'onlosecapture', 'onmousedown', 'onmouseenter', 'onmouseleave', 'onmousemove', 'onmouseout', 'onmouseover', 'onmouseup', 'onmousewheel', 'onmove', 'onmoveend', 'onmovestart', 'onpaste', 'onpropertychange', 'onreadystatechange', 'onreset', 'onresize', 'onresizeend', 'onresizestart', 'onrowenter', 'onrowexit', 'onrowsdelete', 'onrowsinserted', 'onscroll', 'onselect', 'onselectionchange', 'onselectstart', 'onstart', 'onstop', 'onsubmit', 'onunload');\n\t\t$ra = array_merge($ra1, $ra2);\n\n\t\t$found = true; // keep replacing as long as the previous round replaced something\n\t\twhile ($found == true) {\n\t\t $val_before = $val;\n\t\t for ($i = 0; $i < sizeof($ra); $i++) {\n\t\t $pattern = '/';\n\t\t for ($j = 0; $j < strlen($ra[$i]); $j++) {\n\t\t if ($j > 0) {\n\t\t $pattern .= '(';\n\t\t $pattern .= '(&#[xX]0{0,8}([9ab]);)';\n\t\t $pattern .= '|';\n\t\t $pattern .= '|(&#0{0,8}([9|10|13]);)';\n\t\t $pattern .= ')*';\n\t\t }\n\t\t $pattern .= $ra[$i][$j];\n\t\t }\n\t\t $pattern .= '/i';\n\t\t $replacement = substr($ra[$i], 0, 2).'<x>'.substr($ra[$i], 2); // add in <> to nerf the tag\n\t\t $val = preg_replace($pattern, $replacement, $val); // filter out the hex tags\n\t\t if ($val_before == $val) {\n\t\t // no replacements were made, so exit the loop\n\t\t $found = false;\n\t\t }\n\t\t }\n\t\t}\n\t\treturn $val;\n\t}", "private static function stripIllegalChars()\n {\n $input_arr = array();\n foreach ($_POST as $key => $input_arr)\n {\n $_POST[$key] = preg_replace(\"/[^a-zA-Z0-9\\s!@#$%&*()_\\-=+?.,:\\/]/\", \"\", $input_arr);\n }\n }", "function char_filter($ojb)\n {\n $badchars='Ý`~!@$%^()+-_=[]{}\\'\\\\:\"|,/<>? '; # Nhung ky tu khong cho phep duoc len danh sach tai day\n for ($i=0;$i<strlen($badchars);$i++){\n $ojb=str_replace($badchars[$i],\"\",$ojb);\n\n }\n\n return $ojb;\n }", "function preclean($dirtyString){\n\t\t//1. removes any bad characters\n\t\t//2. trims whitespace\n\n\t\treturn ereg_replace(\"[^A-Za-z0-9-]\", \"\", trim($dirtyString));\n\t}", "public function CleanData($data){\n\t\t\t$data = trim($data);\n\t\t\t$data=htmlentities($data,ENT_QUOTES, 'UTF-8');\n\t\t\t$data = filter_var($data,FILTER_SANITIZE_SPECIAL_CHARS);\n\t\t\treturn $data;\n\t\t\t}", "public function CleanData($data){\n\t\t\t$data = trim($data);\n\t\t\t$data=htmlentities($data,ENT_QUOTES, 'UTF-8');\n\t\t\t$data = filter_var($data,FILTER_SANITIZE_SPECIAL_CHARS);\n\t\t\treturn $data;\n\t\t\t}", "public function CleanData($data){\n\t\t\t$data = trim($data);\n\t\t\t$data=htmlentities($data,ENT_QUOTES, 'UTF-8');\n\t\t\t$data = filter_var($data,FILTER_SANITIZE_SPECIAL_CHARS);\n\t\t\treturn $data;\n\t\t\t}", "static public function clean_invalid_char($var) {\n $var = strip_tags($var);\n //$var = str_replace(\"&\", \"&&amp;\", $var);\n $var = str_replace('&', '', $var);\n $var = str_replace(\"<\", \"&lt;\", $var);\n $var = str_replace(\">\", \"&gt;\", $var);\n $var = trim($var);\n return ($var);\n }", "function unmaskString($val)\n {\n return preg_replace(\"/[^a-zA-Z 0-9]+/\", \"\", $val);\n }", "protected static function filter_sanitize_string($value)\n\t{\n\t\treturn filter_var($value, FILTER_SANITIZE_STRING);\n\t}", "private function strip($given) {\n\t\t$stripped = preg_replace(array('/\\s{2,}/', '/[\\t\\n]/'), ' ', trim($given));\n\t\t\n\t\t// For each of these characters, remove any surrounding white space\n\t\t$clean = array(';', ',', '(', ')', '=', ':', '[', ']', '/', '!', '>', '<', '&lt;', '&gt;');\n\t\tforeach($clean as $c) {\n\t\t\t$stripped = preg_replace('/\\s*\\\\' . $c . '\\s*/', $c, $stripped);\n\t\t}\n\n\t\treturn $stripped;\n\t}", "function submission_scrub($value) {\n $bad_things = array('to:','cc:','bcc:','content-type:','mime-version:','multipart-mixed:','content-transfer-encoding:');\n\n // if any of the bad things are in the submission, return an empty string\n foreach ($bad_things as $v) { \n if (stripos($value, $v) !==false)\n return '';\n } \n // replace any newline characters with spaces\n $value = str_replace(array( \"\\r\", \"\\n\", \"%0a\", \"%0d\"), ' ', $value);\n\n // return the value\n return trim($value);\n }", "public function filter($value)\n {\n return filter_var(\n $value,\n FILTER_SANITIZE_STRING,\n FILTER_FLAG_NO_ENCODE_QUOTES\n );\n }", "public static function replaceIllegalChars($value) {\n\t\t$replace_pairs = array(\n\t\t\t\t\"\\t\" => ' ',\n\t\t\t\t\"\\x0B\" => ' ',\n\t\t\t\t\"\\r\" => ' ',\n\t\t\t\t\"\\r\\n\" => ' ',\n\t\t\t\t\"\\n\" => ' '\n\t\t);\n\t\treturn html_entity_decode(filter_var(strtr($value, $replace_pairs), FILTER_SANITIZE_STRING, FILTER_FLAG_STRIP_HIGH));\n\t}", "public static function parseCleanValue($val) {\r\n\t\tif ($val == '') {\r\n\t\t\treturn '';\r\n\t\t}\r\n\r\n\t\tif (get_magic_quotes_gpc()) {\r\n\t\t\t$val = stripslashes($val);\r\n\t\t\t$val = preg_replace(\"/\\\\\\(?!&amp;#|\\?#)/\", \"&#092;\", $val);\r\n\t\t}\r\n\t\t$val = str_replace(\"&#032;\", \" \", $val);\r\n\t\t$val = str_replace(\"&\", \"&amp;\", $val);\r\n\t\t$val = str_replace(\"<!--\", \"&#60;&#33;--\", $val);\r\n\t\t$val = str_replace(\"-->\", \"--&#62;\", $val);\r\n\t\t$val = preg_replace(\"/<script/i\", \"&#60;script\", $val);\r\n\t\t$val = str_replace(\">\", \"&gt;\", $val);\r\n\t\t$val = str_replace(\"<\", \"&lt;\", $val);\r\n\t\t$val = str_replace('\"', \"&quot;\", $val);\r\n\t\t$val = str_replace(\"$\", \"&#036;\", $val);\r\n\t\t$val = str_replace(\"\\r\", \"\", $val); // Remove tab chars\r\n\t\t$val = str_replace(\"!\", \"&#33;\", $val);\r\n\t\t$val = str_replace(\"'\", \"&#39;\", $val); // for SQL injection security\r\n\r\n\t\t// Recover Unicode\r\n\t\t$val = preg_replace(\"/&amp;#([0-9]+);/s\", \"&#\\\\1;\", $val);\r\n\t\t// Trying to fix HTML entities without ;\r\n\t\t$val = preg_replace(\"/&#(\\d+?)([^\\d;])/i\", \"&#\\\\1;\\\\2\", $val);\r\n\r\n\t\treturn $val;\r\n\t}", "private function sanitiseValue($value)\n {\n // Handle poorly encoded documents. We always use UTF8\n $value = utf8_encode($value);\n\n // Remove the = and \" from a CSV value like =\"VALUE\", which can be used to trick\n // Excel into keeping numbers sanely.\n $value = preg_replace('/^=\"(.*)\"$/', '\\1', $value);\n\n // Trim whitespace and quotes from around values.\n $value = trim($value, \" \\t\\n\\r\\0\\x0B\\\"'\");\n\n return $value;\n }", "function clean_input($str)\n\t{\n\t\t$str = strip_tags($str);\n\t\t$str = (get_magic_quotes_gpc()) ? stripslashes($str) : $str;\n\t\t$str = trim($str);\n\t\t$str = preg_replace('/[\\\\\"\\'[{;&}|<>\\/]/i', '', $str);\n\t\treturn $str;\n\t}", "function StripValidator ()\n {\n\n $this->params['chars'] = array();\n\n }", "function strip($string) {\n\n\n\t\t}", "function scrubInput($data) {\n $data = trim($data);\n $data = stripslashes($data);\n $data = htmlspecialchars($data);\n return $data;\n}", "static function FilterHTTPParameter($value) {\n return @eregi_replace('[^0-9A-Za-z]', '', $value);\n }", "public function just_clean($string)\n {\n $s = '!@#$%^&*()_+-={}[]:\";\\'?/.,<>`~';\n for($i=0;$i<mb_strlen($s,'utf-8');$i++)\n {\n $string = str_replace(mb_substr($s,$i,1,'utf-8'),'', $string);\n $string = str_replace(' ',' ', $string);\n }\n return trim($string);\n }", "function _remove_invisible_characters($str)\n\t{\n\t\tstatic $non_displayables;\n\n\t\tif ( ! isset($non_displayables))\n\t\t{\n\t\t\t// every control character except newline (dec 10), carriage return (dec 13), and horizontal tab (dec 09),\n\t\t\t$non_displayables = array(\n\t\t\t\t\t\t\t\t\t\t'/%0[0-8bcef]/',\t\t\t// url encoded 00-08, 11, 12, 14, 15\n\t\t\t\t\t\t\t\t\t\t'/%1[0-9a-f]/',\t\t\t\t// url encoded 16-31\n\t\t\t\t\t\t\t\t\t\t'/[\\x00-\\x08]/',\t\t\t// 00-08\n\t\t\t\t\t\t\t\t\t\t'/\\x0b/', '/\\x0c/',\t\t\t// 11, 12\n\t\t\t\t\t\t\t\t\t\t'/[\\x0e-\\x1f]/'\t\t\t\t// 14-31\n\t\t\t\t\t\t\t\t\t);\n\t\t}\n\n\t\tdo\n\t\t{\n\t\t\t$cleaned = $str;\n\t\t\t$str = preg_replace($non_displayables, '', $str);\n\t\t}\n\t\twhile ($cleaned != $str);\n\n\t\treturn $str;\n\t}", "private function remove_escaped_chars($_strValue)\n {\n $_result = FALSE;\n \n if ($_strValue && is_string($_strValue)) {\n $_result = preg_replace('@\\\\\\\"@', '\"', $_strValue);\n $_result = preg_replace('@\\\\\\/@', '/', $_result);\n }\n \n return $_result;\n }", "public static function strip_non_ascii($str) {\n\t\treturn preg_replace('/[^\\x00-\\x7F]+/S', '', $str);\n\t}", "public function sanitize($value)\n\t{\n\t\treturn filter_var($value, FILTER_SANITIZE_STRING);\n\t}", "public function sanitize($string) {\n return preg_replace('/[^\\x0A\\x20-\\x7E]/', '', $string);\n }", "public function filterInput(string $input) : string {\n return trim(preg_replace('/[^a-zA-Z0-9\\s]/', '',$input));\t\n }", "public function forceStrip()\n {\n return $this->addAction(Flag::forceStrip());\n }", "function testStrip(){\n\t\t#mdx:strip\n\t\tParam::get('name')->filters()->strip('/[^\\d]/');\n\n\t\t$result = Param::get('name')->process(['name'=>'f4b10']);\n\t\t#/mdx var_dump($result->output)\n\t\t$this->assertEquals('410', $result->output);\n\t}", "function SanitizeString($var) {\n \n $tmp = $var;\n //Trim off leading and trailing blanks\n $tmp = trim($tmp);\n //Remove slashes\n $tmp = stripslashes($tmp);\n //Remove special html characters\n $tmp = htmlspecialchars($tmp);\n //Remove non-printable characters\n $tmp = filter_var($tmp, FILTER_SANITIZE_STRING, FILTER_FLAG_STRIP_LOW | FILTER_FLAG_STRIP_HIGH);\n return $tmp;\n}", "function filter($data) {\n $data = trim($data);\n $data = stripslashes($data);\n $data = htmlspecialchars($data);\n return $data;\n}", "function trim_value($value){\n\treturn (strip_tags (htmlspecialchars(trim($value))));\n}", "function bwm_clean($s) {\r\n if (get_magic_quotes_gpc())\r\n return trim(stripslashes($s));\r\n return trim($s);\r\n}", "function StringInputCleaner($data) {\n\t//remove space bfore and after\n\t$data = trim($data);\n\t//remove slashes\n\t$data = stripslashes($data);\n\t$data = (filter_var($data, FILTER_SANITIZE_STRING));\n\t$data = utf8_encode($data);\n\treturn $data;\n}", "function StringInputCleaner($data) {\n\t//remove space bfore and after\n\t$data = trim($data);\n\t//remove slashes\n\t$data = stripslashes($data);\n\t$data = (filter_var($data, FILTER_SANITIZE_STRING));\n\t$data = utf8_encode($data);\n\treturn $data;\n}", "public function filter($value)\n {\n $value = str_replace(\"'\", \"\", $value);\n $value = str_replace('\"', '', $value);\n \n return $value;\n }", "public function stripslash_gpc($value) {\r\n $value = stripslashes($value);\r\n\t\t$value = htmlspecialchars($value);\r\n\t\t$value = trim($value);\r\n\t\treturn $value;\r\n }", "public function scrubString(string $data) : string;", "function filteralpha($s){\n return preg_replace(\"/[^: ()_\\-a-zA-Z0-9+]/\",\"\", $s);\n}", "function remove_ill($str)\r\n {\r\n\t\treturn (!get_magic_quotes_gpc() ? addslashes(trim($str)) : trim($str));\r\n }", "public function filter($var) {\n\t\treturn preg_replace('/[^-a-zA-Z0-9@. \\/]/', '', $var);\n }", "function remove_nonalphanum( $data ) {\n\t$text = trim( $data, ' ' );\n\t$text = str_replace( ' ', '-', $text );\n\t$text = preg_replace( '/[^A-Za-z0-9-]/', '', $text );\n\treturn strtolower( $text );\n}", "public static function unsanitize($item) {\n $item = stripcslashes($item);\n $item = str_replace(\"&#039;\", \"'\", $item);\n $item = str_replace(\"&gt;\", \">\", $item);\n $item = str_replace(\"&quot;\", \"\\\"\", $item);\n $item = str_replace(\"&lt;\", \"<\", $item);\n return $item;\n }", "function sanitize($data){\r\n\t\t\t$data=stripslashes($data); // Remove all slashses\r\n\t\t\t$data=strip_tags($data); //Remove all tags\r\n\t\t\treturn $data;\r\n\t\t}", "function guy_strip_bad($str, $mode='') {\n global $guy_c;\n $html_allowed = array('a', 'b', 'i', 'p', 'ol', 'ul', 'li', 'blockquote', 'br', 'em', 'sup', 'sub');\n\t$html_allowed_regexp = join('|',$html_allowed);\n\t$html_allowed_striptags = '<'.join('><',$html_allowed).'>';\n\t$str = strip_tags($str,$html_allowed_striptags);\n\t$str = preg_replace_callback(\"/<($html_allowed_regexp)\\b(.*?)>/si\",'guy_attrcheck',$str);\n\t$str = preg_replace('/<\\/([^ \n>]+)[^>]*>/si',$guy_c['lt'].'/$1'.$guy_c['gt'],$str);\n\t$str = preg_replace('#^\\s+$#m','',$str);\n\t$str = safehtml($str);\n\treturn $str;\n}", "function sanitize($str){\n $str = strip_tags($str);//erasing tag or smthg\n $str = rtrim($str);//agadi re pachadi ko space hatauchha\n return $str;\n }", "function cws_clean( $string ) {\n\t$string = str_replace( array( '[\\', \\']' ), '', $string);\n\t$string = preg_replace( '/\\[.*\\]/U', '', $string );\n\t$string = preg_replace( '/&(amp;)?#?[a-z0-9]+;/i', '-', $string );\n\t$string = htmlentities( $string, ENT_COMPAT, 'utf-8' );\n\t$string = preg_replace( '/&([a-z])(acute|uml|circ|grave|ring|cedil|slash|tilde|caron|lig|quot|rsquo);/i', '\\\\1', $string );\n\t$string = preg_replace( array('/[^a-z0-9]/i', '/[-]+/') , '-', $string );\n\n\treturn strtolower( trim( $string, '-' ) );\n}", "private function pruneValue($value){\n $value = strtolower($value);\n $value = mysql_real_escape_string($value);\n return $value;\n }", "function filter_mydata($data)\n{\n $data = trim($data);\n $data = stripslashes($data);\n $data = htmlspecialchars($data);\n return $data;\n}", "public static function clear_value($v)\n\t{\n\t\tif(!$v)\n\t\t\treturn '';\n\t\tself::nl($v);\n\t\t$v = str_replace('&#032;',' ',$v);\n\t\t$v = str_replace('&#8238;','',$v);\n\t\t$v = str_replace('&','&amp;',$v);\n\t\t$v = str_replace('<!--','&#60;&#33;--',$v);\n\t\t$v = str_replace('-->','--&#62;',$v);\n\t\t$v = preg_replace('/<script/i','&#60;script',$v);\n\t\t$v = str_replace('>','&gt;',$v);\n\t\t$v = str_replace('<','&lt;',$v);\n\t\t$v = str_replace('\"','&quot;',$v);\n\t\t$v = str_replace(\"\\n\",'<br />',$v);\n\t\t$v = str_replace('$','&#036;',$v);\n\t\t$v = str_replace('!','&#33;',$v);\n\t\t$v = str_replace(\"'\",'&#39;',$v);\n\t\t##\n\t\t$v = preg_replace('/&amp;#([0-9]+);/s','&#\\\\1;',$v);\n\t\t$v = preg_replace('/&#(\\d+?)([^\\d;])/i','&#\\\\1;\\\\2',$v);\n\t\t##\n\t\treturn $v;\n\t}", "public static function string_sanitize($s) {\n $result = preg_replace(\"/[^a-zA-Z0-9]+/\", \"\", html_entity_decode($s, ENT_QUOTES));\n return $result;\n }", "function sanitize($string) {\n\t//return $string;\n\treturn preg_replace ('/[^\\x{0009}\\x{000a}\\x{000d}\\x{0020}-\\x{D7FF}\\x{E000}-\\x{FFFD}]+/u', '.', $string);\n}", "function htmlRemoveSpecialCharacters($input){\n\t\tfor($i=0; $i<strlen($input); $i++){\n\n\t\t\t$value = ord($input[$i]);\n\t\t\tif($value >= 48 && $value <= 57);\n\t\t\telseif ($value >= 65 && $value <= 90) ;\n\t\t\telseif ($value >= 97 && $value <= 122) ;\n\t\t\telseif ($value == 32) ;\n\t\t\telse{\n\t\t\t\t$input = substr($input, 0, $i) . '\\\\' . substr($input, $i);\n\t\t\t}\n\t\t}\n\t\techo $input;\n\t\treturn $input;\n\t}", "function clean_special_character_from_string($string) {\n $string = str_replace(' ', '-', $string); \n // Removes special chars.\n return preg_replace('/[^A-Za-z0-9\\-]/', '', $string);\n}", "public function obfuscate($value)\n\t{\n\t\t$safe = '';\n\n\t\tforeach (str_split($value) as $letter)\n\t\t{\n\t\t\tif (ord($letter) > 128) return $letter;\n\n\t\t\t// To properly obfuscate the value, we will randomly convert each letter to\n\t\t\t// its entity or hexadecimal representation, keeping a bot from sniffing\n\t\t\t// the randomly obfuscated letters out of the string on the responses.\n\t\t\tswitch (rand(1, 3))\n\t\t\t{\n\t\t\t\tcase 1:\n\t\t\t\t\t$safe .= '&#'.ord($letter).';'; break;\n\n\t\t\t\tcase 2:\n\t\t\t\t\t$safe .= '&#x'.dechex(ord($letter)).';'; break;\n\n\t\t\t\tcase 3:\n\t\t\t\t\t$safe .= $letter;\n\t\t\t}\n\t\t}\n\n\t\treturn $safe;\n\t}", "function cleanseTheData($data) \n\t\t{\n \t\t\t$data = trim($data);\n\t\t\t$data = stripslashes($data);\n\t\t\t$data = htmlspecialchars($data);\n\t\t\treturn $data;\n\t\t}", "function spam_scrubber($value) {\n\t\t\n\t\t// list of very bad values\n\t\t$very_bad = array('to:', 'cc:', 'bcc:', 'content-type:', 'mime-version:', 'multipart-mixed:', 'content-transfer-encoding:');\n\t\t\n\t\t//if any of the very bad strings are in submitted value, return empty string\n\t\tforeach ($very_bad as $v) {\n\t\t\tif (stripos($value, $v) !== false) return '';\n\t\t}\n\t\t\n\t\t// replace any newline characters with spaces:\n\t\t$value = str_replace(array( \"\\r\", \"\\n\", \"%0a\", \"%0d\"), ' ', $value);\n\t\t\n\t\t//return the value\n\t\treturn trim($value);\n\t}", "private function filter() : string\r\n {\r\n return preg_filter('|([^\\(\\)]*)|m', '', $this->string);\r\n }", "public static function cleanHtmlValue($value)\n {\n $value = str_replace(['&nbsp;', '&amp;', '&AMP;'], [' ', '&', '&'], $value);\n\n // Clean up any pesky unicode characters\n // In the case of \\u00A0, it's a non-breaking space:\n // Not exactly sure why the  shows up though...\n $value = str_replace([self::getStringFromUnicodeValue(\"\\u00A0\"), ' ', 'Â'], '', $value);\n\n $value = trim(strip_tags($value));\n\n return $value;\n }", "function safeString($string)\n {\n return eregi_replace('[^[:alnum:] ]', '', $string);\n }", "protected function doClean($value)\n {\n // based on http://stackoverflow.com/questions/406230/regular-expression-to-match-string-not-containing-a-word\n $value = preg_replace('/((?![0-9]).)*/', '', $value);\n\n if (!self::isValidCreditCard($value, $this->options['card_type']))\n {\n throw new sfValidatorError($this, 'invalid', array('value' => $value));\n }\n\n return $value;\n }", "function purge ($str)\n {\n $purged_str = preg_replace(\"/\\W/\", \"\", $str);\n return $purged_str;\n }", "function trimData($data) {\n $data = trim($data);\n $data = urlencode($data);\n $data = stripslashes($data);\n $data = htmlspecialchars($data);\n return $data;\n}", "function sanitation($postVal){\n\t$rawinfo= $postVal;\n\t$removeSpecial = htmlspecialchars($rawinfo);\n\t$finalForm = escapeshellcmd($removeSpecial);\n\treturn $finalForm;\n}" ]
[ "0.72800666", "0.72079843", "0.71338296", "0.7080963", "0.6982714", "0.695795", "0.6954121", "0.693592", "0.6837615", "0.68168443", "0.6811536", "0.6795291", "0.6789121", "0.6777375", "0.6764461", "0.67625725", "0.6754654", "0.67307234", "0.67293197", "0.67233014", "0.6706056", "0.67010564", "0.6700913", "0.66877156", "0.66737986", "0.66678065", "0.6655068", "0.661865", "0.6615375", "0.6613169", "0.6608441", "0.66025144", "0.65998274", "0.6593809", "0.65745944", "0.6557943", "0.65576917", "0.6545863", "0.6537318", "0.6522175", "0.6522175", "0.6522175", "0.65160507", "0.6514355", "0.6502985", "0.64978456", "0.64842767", "0.64836466", "0.6475069", "0.646885", "0.6461532", "0.6460553", "0.644086", "0.64379144", "0.6435254", "0.6417177", "0.6414569", "0.64111733", "0.64098734", "0.64087814", "0.6400066", "0.6395835", "0.63891333", "0.63890743", "0.63838005", "0.6383228", "0.63789827", "0.63763595", "0.637121", "0.63677764", "0.63677764", "0.6363059", "0.634914", "0.6345246", "0.6339188", "0.6338592", "0.63321507", "0.6331945", "0.6304251", "0.62992907", "0.629256", "0.6287363", "0.6283178", "0.62820184", "0.62812513", "0.6278233", "0.6274719", "0.6272523", "0.62676924", "0.62567514", "0.6250195", "0.6248941", "0.62464577", "0.62383336", "0.62304896", "0.6216071", "0.62073016", "0.6204422", "0.6201525", "0.61951077" ]
0.7927197
0
Parse the input variables and produce textual output from them. Also return nonspecial values in the given $a_values array.
function ParseInput($vars,&$a_values,$s_line_feed) { global $SPECIAL_FIELDS,$SPECIAL_VALUES,$FORMATTED_INPUT; $output = ""; // // scan the array of values passed in (name-value pairs) and // produce slightly formatted (not HTML) textual output // while (list($name,$raw_value) = each($vars)) { if (is_string($raw_value)) // // truncate the string // $raw_value = substr($raw_value,0,MAXSTRING); $value = trim(Strip($raw_value)); if (in_array($name,$SPECIAL_FIELDS)) $SPECIAL_VALUES[$name] = $value; else { $a_values[$name] = $raw_value; $output .= "$name: $value".$s_line_feed; } array_push($FORMATTED_INPUT,"$name: '$value'"); } return ($output); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getInputAsString($values) {\n $output = \"\";\n foreach ($values as $value) {\n $output .= $value;\n }\n return $output; \n}", "protected function parseValues($_values)\n\t{\n\t\t$use_ingroup = $this->field->parameters->get('use_ingroup', 0);\n\t\t$multiple = $use_ingroup || (int) $this->field->parameters->get('allow_multiple', 0);\n\n\t\t// Make sure we have an array of values\n\t\tif (!$_values)\n\t\t{\n\t\t\t$vals = array(array());\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$vals = !is_array($_values)\n\t\t\t\t? array($_values)\n\t\t\t\t: $_values;\n\t\t}\n\n\t\t// Compatibility with legacy storage, we no longer serialize all values to one, this way the field can be reversed and filtered\n\t\tif (count($vals) === 1 && is_string(reset($vals)))\n\t\t{\n\t\t\t$array = $this->unserialize_array(reset($vals), $force_array = false, $force_value = false);\n\t\t\t$vals = $array ?: $vals;\n\t\t}\n\n\t\t// Force multiple value format (array of arrays)\n\t\tif (!$multiple)\n\t\t{\n\t\t\tif (is_string(reset($vals)))\n\t\t\t{\n\t\t\t\t$vals = array($vals);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tforeach ($vals as & $v)\n\t\t\t{\n\t\t\t\tif (!is_array($v))\n\t\t\t\t{\n\t\t\t\t\t$v = strlen($v) ? array($v) : array();\n\t\t\t\t}\n\t\t\t}\n\t\t\tunset($v);\n\t\t}\n\n\t\t//echo '<div class=\"alert alert-info\"><h2>parseValues(): ' . $this->field->label . '</h2><pre>'; print_r($vals); echo '</pre></div>';\n\t\treturn $vals;\n\t}", "function output_values($header, $values){\n\t\t$contents = $header . \"\\r\\n\";\n\t\tforeach ($values as $key => $value)\n\t\t\t$contents .= $value[0] . \"\\t\" . $value[1] . \"\\r\\n\";\n\t\treturn $contents;\n\t}", "public function Render($aParamValues = array())\n\t{\n\t\t$aParamTypes = array();\n\t\tforeach($aParamValues as $sParamName => $value)\n\t\t{\n\t\t\t$aParamTypes[$sParamName] = get_class($value);\n\t\t}\n\t\t$this->Analyze($aParamTypes);\n\n\t\t$aSearch = array();\n\t\t$aReplace = array();\n\t\tforeach($this->m_aPlaceholders as $oPlaceholder)\n\t\t{\n\t\t\tif (array_key_exists($oPlaceholder->sParamName, $aParamValues))\n\t\t\t{\n\t\t\t\t$oRef = $aParamValues[$oPlaceholder->sParamName];\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\t$value = $oRef->Get($oPlaceholder->sAttcode);\n\t\t\t\t\t$aSearch[] = '$'.$oPlaceholder->sToken.'$';\n\t\t\t\t\t$aReplace[] = $value;\n\t\t\t\t\t$oPlaceholder->bIsValid = true;\n\t\t\t\t}\n\t\t\t\tcatch(Exception $e)\n\t\t\t\t{\n\t\t\t\t\t$oPlaceholder->bIsValid = false;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$oPlaceholder->bIsValid = false;\n\t\t\t}\n\t\t}\n\t\treturn str_replace($aSearch, $aReplace, $this->m_sRaw);\n\t}", "function extract_values($values) {\n foreach ($values as $xn) {\n switch ($xn['tag']) {\n\n case 'license-uri':\n $this->license_uri = $xn['value'];\n break;\n\n case 'license-name':\n $this->license_name = $xn['value'];\n break;\n\n case 'rdf:RDF':\n if ($xn['type'] == 'open') {\n $this->rdf = array();\n $this->rdf['attributes'] = $xn['attributes'];\n }\n break;\n\n case 'permits':\n $this->permissions['permits'][] = current($xn['attributes']);\n break;\n\n case 'prohibits':\n $this->permissions['prohibits'][] = current($xn['attributes']);\n break;\n\n case 'requires':\n $this->permissions['requires'][] = current($xn['attributes']);\n break;\n }\n }\n }", "function validateValues($text, $names)\n{\n $out = \"\";\n $lines = explode(\"\\n\", $text);\n $regexnames = implode(\"|\", $names);\n foreach ($lines as $line) {\n $result = preg_match('/(.+?)=(.+?)(?:\\n|$)/', $line, $out);\n if ($out == array()) {\n return $line;\n }\n \n // dangerous, because excludes repetition of key=value pairs in single string\n $result2 = preg_match(\"/(($regexnames)=.+?){2,}/\", $line, $out2);\n if ($out2 != array()) {\n return $line;\n }\n }\n return \"\";\n}", "function build_subtext($subtext_values) {\r\n $subtext_pieces = array();\r\n foreach ($subtext_values as $value) {\r\n if (!empty($value)) {\r\n $subtext_pieces[] = $value;\r\n }\r\n }\r\n return implode('; ', $subtext_pieces);\r\n $subtext_pieces = array();\r\n }", "private function parseVars($vals, $tab =\"\")//optional recursive values for output\n {\n $rval = \"\";\n foreach($vals as $key => $val)\n {\n if( $this->cleanData($key, $val))\n {\n if(is_object($val))\n {\n $rval = $rval.$tab.\"Object: \".$key.\" of type: \".get_class($val).\"\\n\";\n $rval = $rval.$tab.\"{\\n\";\n $newAry = get_object_vars($val);\n $rval = $rval.$this->parseVars($newAry, $tab.\" \");\n $rval = $rval.$tab.\"}\\n\";\n }\n elseif(is_array($val))\n {\n $rval = $rval.$tab.\"Array: \".$key.\"\\n\";\n $rval = $rval.$tab.\"{\\n\";\n $rval = $rval.$this->parseVars($val, $tab.\" \");\n $rval = $rval.$tab.\"}\\n\";\n }\n else\n {\n if($val != \"\")\n $rval= $rval.$tab.$key.\" = \".$val.\"\\n\";\n else\n $rval= $rval.$tab.$key.\" = NULL\\n\";\n }\n }\n }\n return $rval;\n }", "function _parse($tags,$values,$text) {\n\t\tfor ($i = 0; $i<sizeof($tags); $i++) {\n\t\t\t\t$text = str_replace($tags[$i],$values[$i],$text);\n\t\t\t}\n\t\treturn $text;\n\t}", "function setValueByArray($a_values)\r\n\t{\r\n\t\tglobal $ilUser;\r\n\t\t\r\n\t\t$this->setAllValue($a_values[$this->getPostVar()][\"all\"][\"num_value\"].\r\n\t\t\t$a_values[$this->getPostVar()][\"all\"][\"num_unit\"]);\r\n\t\t$this->setBottomValue($a_values[$this->getPostVar()][\"bottom\"][\"num_value\"].\r\n\t\t\t$a_values[$this->getPostVar()][\"bottom\"][\"num_unit\"]);\r\n\t\t$this->setTopValue($a_values[$this->getPostVar()][\"top\"][\"num_value\"].\r\n\t\t\t$a_values[$this->getPostVar()][\"top\"][\"num_unit\"]);\r\n\t\t$this->setLeftValue($a_values[$this->getPostVar()][\"left\"][\"num_value\"].\r\n\t\t\t$a_values[$this->getPostVar()][\"left\"][\"num_unit\"]);\r\n\t\t$this->setRightValue($a_values[$this->getPostVar()][\"right\"][\"num_value\"].\r\n\t\t\t$a_values[$this->getPostVar()][\"right\"][\"num_unit\"]);\r\n\t}", "#[Pure] public function get_values(): string\n {\n if(gettype($this -> value) === \"string\") {\n return \"'\" . $this->value . \"'\";\n }else{\n $res = \"'\";\n foreach($this -> value as $v){\n $res .= strval($v) . \" \";\n }\n $res .= \"'\";\n }\n return $res;\n }", "public function formatVariable(){\r\n\t\t\r\n\t\tforeach($this->template as $k=>$v){\r\n\t\t\tif(preg_match('/{\\s+\\$(\\w+)}/', $v, $matches)){\r\n\t\t\t\t$this->variable_lines = ($k+1);\r\n\t\t\t\t$this->error_notice[($k+1)] = 'Variable format error: The blank is not allowed with \\'{\\' near '.$matches[1].' in '.$this->template_file.$this->template_postfix.' on line '.($k+1);\r\n\t\t\t}\r\n\t\t\tif(preg_match('/{\\$(\\w+)\\s+}/', $v, $matches)){\r\n\t\t\t\t$this->variable_lines = ($k+1);\r\n\t\t\t\t$this->error_notice[($k+1)] = 'Variable format error: The blank is not allowed with \\'}\\' near '.$matches[1].' in '.$this->template_file.$this->template_postfix.' on line '.($k+1);\r\n\t\t\t}\r\n\t\t\tif(preg_match('/{\\s+\\$(\\w+)\\s+}/', $v, $matches)){\r\n\t\t\t\t$this->variable_lines = ($k+1);\r\n\t\t\t\t$this->error_notice[($k+1)] = 'Variable format error: The blank is not allowed with \\'{}\\' near '.$matches[1].' in '.$this->template_file.$this->template_postfix.' on line '.($k+1);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public function parse()\n {\n $strBuffer = parent::parse();\n\n foreach($this->arrData['variables'] as $varName=>$varValue)\n {\n if (empty($varValue))\n {\n continue;\n }\n\n // Convert date values\n /*switch ($objVar['type'])\n {\n case 'date':\n $objVar['value'] = \\Date::parse(\\Config::get('dateFormat'), $objVar['value']);\n break;\n\n case 'time':\n $objVar['value'] = \\Date::parse(\\Config::get('timeFormat'), $objVar['value']);\n break;\n\n case 'datim':\n $objVar['value'] = \\Date::parse(\\Config::get('datimFormat'), $objVar['value']);\n break;\n }*/\n\n //$objVar['value'] = str_replace('$', '\\$', $objVar['value']);\n\n if (is_array($varValue))\n {\n $varValue = json_encode($varValue);\n }\n\n $strBuffer = preg_replace('/{%\\s*' . $varName . '\\s*%}/s', $varValue, $strBuffer);\n\n $strBuffer = preg_replace('/{%\\s*' . $varName . '\\|\\s*nl2br\\s*%}/s', nl2br($varValue), $strBuffer);\n }\n\n $strBuffer = preg_replace('/{%.*?%}/s', '', $strBuffer);\n\n return $strBuffer;\n }", "function str_values(){\n //\n //map the std objects inthe array to return an array of strings of this \n //format ['cname=value'......]\n $values_str= array_map(function($obj){\n //\n //Trim the spaces\n $tvalue = trim($obj->value);\n //\n //Replace '' with null\n $value = $tvalue=='' ? 'null': \"'$tvalue'\";\n //\n return \"`$obj->name`=$value\";\n \n }, $this->values);\n //\n //retun the imploded version of the array with a , separator\n return implode(\",\",$values_str);\n }", "function condition_form_submit($values) {\n $parsed = array();\n $items = explode(\"\\n\", $values);\n if (!empty($items)) {\n foreach ($items as $v) {\n $v = trim($v);\n if (!empty($v)) {\n $parsed[$v] = $v;\n }\n }\n }\n return $parsed;\n }", "public function get_values(){\n $value_str = '';\n if (is_array($this->value)){\n foreach ($this->value as $val){\n $value_str .= $val.' ';\n }\n } else {\n $value_str .= $this->value;\n }\n\n return $value_str;\n }", "protected function replaceValues()\n {\n foreach($this->formulasValue as $key=>$fvalue) \n {\n //$fvalue['value']=mb_strtoupper($fvalue['value'], 'utf-8');\n preg_match_all('/\\{([^}]+)\\}/', $fvalue['value'], $matches);\n foreach($this->sizeList as $size) \n {\n $this->replacement=array();\n //$stag=mb_strtoupper($size.'_'.substr(substr($fvalue['tag'],0,-1),1), 'utf-8');\n $stag=$size.'_'.substr(substr($fvalue['tag'],0,-1),1);\n foreach($matches[1] as $match) \n {\n //$match=mb_strtoupper($match, 'utf-8');\n if(isset($this->itemProperties[$size . '_' . $match])) \n $this->replacement[$size . '_' . $match]=$this->itemProperties[$size . '_' . $match];\n elseIf(isset($this->clientProperties[$match]))\n $this->replacement[$match]=$this->clientProperties[$match];\n elseIf(isset($this->resultArray[$size . '_' . $match]))\n $this->replacement[$size . '_' . $match]=$this->resultArray[$size . '_' . $match];\n else \n $this->errorReplacements[$size . '_' . $match]=$size . '_' . $match;\n }\n \n \n// echo 'errorReplacements START';\n// Helper::myPrint_r($this->errorReplacements);\n// echo 'errorReplacements END';\n //calculates the equitation. But it should not be called unless all the values are replaced\n $matches[0]=array_unique($matches[0]);\n $matches[1]=array_unique($matches[1]);\n// echo 'STAG: ' . $stag . \"<br />\";\n// echo 'Fvalue: ' . $fvalue['value'] . \"<br />\";\n// if($matches[1][0]=='РПЛ')\n// echo 'Yes РПЛ' . '<br />';\n if((isset($matches[1][1])) && $matches[1][1]=='РПЛИ') {\n// echo 'Yes РПЛИ' . '<br />'; \n// echo 'value:' . $this->replacement[$size . '_РПЛИ'];\n// \n// echo \"<br />\";\n// echo str_replace($matches[0], $this->replacement, $fvalue['value']);\n// echo \"<br />\";\n \n // foreach($matches[0] as $m)\n// {\n// echo 'ttt';\n// echo \"<br />\";\n// echo \"<br />\";\n //echo preg_replace('/'.$m.'/', 777, $fvalue['value']);\n// echo str_replace($matches[0], 777, $fvalue['value']);\n// echo \"<br />\";\n// }\n \n\n //$exp=preg_replace($matches[0], $this->replacement, $fvalue['value']);\n $exp=str_replace($matches[0], $this->replacement, $fvalue['value']);\n //echo 'ERROR COUNT: ' . count($this->errorReplacements) . '<br />';\n \n// if(count($this->errorReplacements) > 0) {\n// echo CJavaScript::encode($this->itemId);\n// Yii::app()->end();\n// }\n \n \n $this->resultArray[$stag]=(count($this->errorReplacements) > 0) \n ? str_replace($exp)\n : $this->calculate($exp);\n \n } else\n {\n $this->resultArray[$stag]=(count($this->errorReplacements) > 0) \n ? str_replace($matches[0], $this->replacement, $fvalue['value'])\n : $this->calculate(str_replace($matches[0], $this->replacement, $fvalue['value'])); \n }\n \n \n //echo '<br />' . \"STAG:\" . $this->resultArray[$stag] . '<br />';\n\n \n //preg_replace($matches[0], $this->replacement, $fvalue['value'])\n //str_replace($matches[0], $this->replacement, $fvalue['value'])\n\n// Helper::myPrint_r($matches[0]);\n// Helper::myPrint_r($matches[1]);\n// Helper::myPrint_r($this->replacement); \n// echo 'fvalue' . $fvalue['value'] . '<br />';\n// echo 'val: ' . preg_replace($matches[0], $this->replacement, $fvalue['value']). '<br />';\n// echo 'val: ' . str_replace($matches[1], $this->replacement, $fvalue['value']). '<br />';\n// echo '--------------------<br />'; \n }\n }\n //if formulas dependency order was not observed\n //$this->checkReplaceValues();\n \n// Helper::myPrint_r($this->clientProperties);\n// Helper::myPrint_r($this->itemProperties);\n// Helper::myPrint_r($this->rangeProperties);\n// Helper::myPrint_r($this->formulasValue);\n// Helper::myPrint_r($this->resultArray,true);\n\n }", "function custom_parsed()\n\t\t{\n\t\t$custom = array();\n\t\t$info = $this->infoarray();\n\t\tif(!isset($info['custom'])) { return $custom(); }\n\t\tforeach(explode(' ', $info['custom']) as $pair)\n\t\t\t{\n\t\t\tlist($k, $v) = explode('=', $pair);\n\t\t\t$custom[strtolower($k)] = ($v == 'false') ? false : intval($v);\n\t\t\t}\n\t\treturn $custom;\n\t\t}", "private function limpiarParametrosConEspacios($values){\n $resultado = array();\n foreach ($values as $key => $value) {\n $porciones = explode(\" \", $value);\n \n $cadena = '';\n foreach ($porciones as $val) {\n $cadena .= ($cadena=='' || empty($val))?'':' ';\n $cadena .= (!empty($val))?$val:'';\n }\n $resultado[$key] = $cadena;\n }\n \n return $resultado;\n }", "public function generate_output(){\n\t\t$this->check_for_hidden_values();\n\t\treturn implode(\",\",$this->values);\n\t}", "public function HandleVariables($value, $replaces)\n {\n $result = $value;\n if (!is_array($result)) {\n if (preg_match_all(\"/%%([A-Z0-9_:]+)%%/\", $result, $match) !== false) {\n if (is_array($match) && is_array($match[0])) {\n foreach ($match[0] as $k => $v) {\n $var = str_replace(\"%%\", \"\", $v);\n $var = strtolower($var);\n list($section, $key) = explode(\":\", $var);\n \n $varValue = null;\n if ($section == \"var\") {\n if (array_key_exists($key, $replaces)) {\n $varValue = $replaces[$key];\n }\n }\n if (!isset($varValue)) {\n $varValue = $this->Get($section, $key, \"\");\n }\n $result = str_replace($v, $varValue, $result);\n }\n }\n }\n }\n return $result;\n }", "function SendResults($results,$to,$a_values)\n{\n global $SPECIAL_VALUES;\n\n\t$b_got_filter = (isset($SPECIAL_VALUES[\"filter\"]) && !empty($SPECIAL_VALUES[\"filter\"]));\n\t\t//\n\t\t// special case: if there is only one non-special value and no\n\t\t// filter, then format it as an email\n\t\t//\n\tif (count($a_values) == 1 && !$b_got_filter)\n\t{\n\t\t\t//\n\t\t\t// create a new results value\n\t\t\t//\n\t\t$results = \"\";\n\t\tforeach ($a_values as $s_value)\n\t\t{\n\t\t\t\t//\n\t\t\t\t// replace carriage return/linefeeds with <br>\n\t\t\t\t//\n\t\t\t$s_value = str_replace(\"\\r\\n\",'<br>',$s_value);\n\t\t\t\t//\n\t\t\t\t// replace lone linefeeds with <br>\n\t\t\t\t//\n\t\t\t$s_value = str_replace(\"\\n\",'<br>',$s_value);\n\t\t\t\t//\n\t\t\t\t// remove lone carriage returns\n\t\t\t\t//\n\t\t\t$s_value = str_replace(\"\\r\",\"\",$s_value);\n\t\t\t\t//\n\t\t\t\t// replace all control chars with <br>\n\t\t\t\t//\n\t\t\t$s_value = preg_replace('/[[:cntrl:]]+/','<br>',$s_value);\n\t\t\t\t//\n\t\t\t\t// strip HTML\n\t\t\t\t//\n\t\t\t$s_value = StripHTML($s_value,BODY_LF);\n\t\t\t$results .= $s_value;\n\t\t}\n\t}\n\telse\n\t{\n\t\t\t//\n\t\t\t// write some standard mail headers - if we're using capcode, these\n\t\t\t// headers are not used, but they are nice to have as clear text anyway\n\t\t\t//\n\t\t$res_hdr = \"To: $to\".BODY_LF;\n\t\t$res_hdr .= \"From: \".$SPECIAL_VALUES[\"email\"].\" (\".$SPECIAL_VALUES[\"realname\"].\")\".BODY_LF;\n\t\t$res_hdr .= BODY_LF;\n\t\t$res_hdr .= \"--START--\".BODY_LF;\t\t// signals the beginning of the text to encode\n\n\t\t\t//\n\t\t\t// put the realname and the email address at the top of the results\n\t\t\t//\n\t\t$results = \"realname: \".$SPECIAL_VALUES[\"realname\"].BODY_LF.$results;\n\t\t$results = \"email: \".$SPECIAL_VALUES[\"email\"].BODY_LF.$results;\n\n\t\t\t//\n\t\t\t// prepend the header to the results\n\t\t\t//\n\t\t$results = $res_hdr.$results;\n\n\t\t\t//\n\t\t\t// if there is a filter required, filter the data first\n\t\t\t//\n\t\tif ($b_got_filter)\n\t\t\t$results = Filter($SPECIAL_VALUES[\"filter\"],$results);\n\t}\n\t\t//\n\t\t// append the environment variables report\n\t\t//\n\tif (isset($SPECIAL_VALUES[\"env_report\"]))\n\t{\n\t\t$results .= BODY_LF.\"==================================\".BODY_LF;\n\t\t$results .= BODY_LF.GetEnvVars(explode(\",\",$SPECIAL_VALUES[\"env_report\"]),BODY_LF);\n\t}\n\t\t//\n\t\t// create the From address as the mail header\n\t\t//\n\t$headers = \"From: \".$SPECIAL_VALUES[\"email\"].\" (\".$SPECIAL_VALUES[\"realname\"].\")\";\n\t\t//\n\t\t// send the mail - assumes the to addresses have already been checked\n\t\t//\n return (SendCheckedMail($to,$SPECIAL_VALUES[\"subject\"],$results,$headers));\n}", "public function formatFormValues( $values )\n\t{\n\t\treturn $values;\n\t}", "function setOutputValues(array $inValues) {\n foreach ($inValues as $_value) {\n if (! is_array($_value)) {\n throw new \\Exception(\"Invalid output value's description. It should be an array.\");\n }\n if (0 === count($_value)) {\n throw new \\Exception(\"Invalid output value's description. It should, at least contain the value's name.\");\n }\n $name = $_value[0];\n $description = count($_value) > 1 ? $_value[1] : null;\n\n $this->addOutputValue($name, $description);\n }\n }", "function test_value($text, $type){\n global $varregex, $labelregex, $intregex, $stringregex, $boolregex, $typeregex;\n if($type == 'var'){\n if(preg_match($varregex, $text)) {\n return $text;\n }\n else exit(calls::call_error(\"Error: Chybný tvar argumentu typu var.\\n\", 21));\n }\n elseif ($type == 'label') {\n if(preg_match($labelregex, $text)){\n return $text;\n }\n else exit(calls::call_error(\"Error: Chybný tvar argumentu typu label.\\n\", 21));\n }\n elseif ($type == 'int') {\n if(preg_match($intregex, $text)){\n return $text;\n }\n else exit(calls::call_error(\"Error: Chybný tvar argumentu typu int.\\n\", 21));\n }\n elseif ($type == 'string') {\n if(preg_match($stringregex, $text)){\n return $text;\n }\n else exit(calls::call_error(\"Error: Chybný tvar argumentu typu string.\\n\", 21));\n }\n elseif ($type == 'bool') {\n if(preg_match($boolregex, $text)){\n return $text;\n }\n else exit(calls::call_error(\"Error: Chybný tvar argumentu typu bool.\\n\", 21));\n }\n elseif ($type == 'type') {\n if(preg_match($typeregex, $text)){\n return $text;\n }\n else exit(calls::call_error(\"Error: Chybný tvar argumentu typu type.\\n\", 21));\n }\n }", "function getExcludedValues()\n{\n $excludedValue = \"\";\n $excludedValue .= getExcludedValueByName(\"Process_Rewrite\");\n $excludedValue .= getExcludedValueByName(\"Process_Extension\");\n $excludedValue .= getExcludedValueByName(\"Process_StranglerPattern\");\n $excludedValue .= getExcludedValueByName(\"Process_ContinuousEvolution\");\n $excludedValue .= getExcludedValueByName(\"Process_Split\");\n $excludedValue .= getExcludedValueByName(\"Process_Others\");\n $excludedValue .= getExcludedValueByName(\"Decomposition_DDD\");\n $excludedValue .= getExcludedValueByName(\"Decomposition_FunctionalDecomposition\");\n $excludedValue .= getExcludedValueByName(\"Decomposition_ExistingStructure\");\n $excludedValue .= getExcludedValueByName(\"Decomposition_Others\");\n $excludedValue .= getExcludedValueByName(\"Technique_SCA\");\n $excludedValue .= getExcludedValueByName(\"Technique_MDA\");\n $excludedValue .= getExcludedValueByName(\"Technique_WDA\");\n $excludedValue .= getExcludedValueByName(\"Technique_DMC\");\n $excludedValue .= getExcludedValueByName(\"Technique_Others\");\n $excludedValue .= getExcludedValueByName(\"Applicability_GR\");\n $excludedValue .= getExcludedValueByName(\"Applicability_MO\");\n $excludedValue .= getExcludedValueByName(\"Input_SourceCode\");\n $excludedValue .= getExcludedValueByName(\"Input_UseCase\");\n $excludedValue .= getExcludedValueByName(\"Input_SystemSpecification\");\n $excludedValue .= getExcludedValueByName(\"Input_API\");\n $excludedValue .= getExcludedValueByName(\"Input_Others\");\n $excludedValue .= getExcludedValueByName(\"Output_List\");\n $excludedValue .= getExcludedValueByName(\"Output_Archi\");\n $excludedValue .= getExcludedValueByName(\"Output_Others\");\n $excludedValue .= getExcludedValueByName(\"Validation_Experiment\");\n $excludedValue .= getExcludedValueByName(\"Validation_Example\");\n $excludedValue .= getExcludedValueByName(\"Validation_CaseStudy\");\n $excludedValue .= getExcludedValueByName(\"Validation_NoValidation\");\n $excludedValue .= getExcludedValueByName(\"Quality_Maintainability\");\n $excludedValue .= getExcludedValueByName(\"Quality_Performance\");\n $excludedValue .= getExcludedValueByName(\"Quality_Reliability\");\n $excludedValue .= getExcludedValueByName(\"Quality_Scalability\");\n $excludedValue .= getExcludedValueByName(\"Quality_Security\");\n $excludedValue .= getExcludedValueByName(\"Quality_Others\");\n\n return $excludedValue;\n}", "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 }", "private function noramlizeArgs(array $values)\n {\n foreach ($values as $k => $v) {\n if ($v instanceof DynamicValue) {\n $values[$k] = $v->getValue();\n } elseif (is_array($v)) {\n $values[$k] = $this->noramlizeArgs($v);\n }\n }\n\n return $values;\n }", "function clear_sanity($values)\n {\n $values = (is_array($values)) ?\n array_map(\"clear_sanity\", $values) :\n htmlentities($values, ENT_QUOTES, 'UTF-8');\n\n return $values;\n }", "public function validate_option( $values ) {\n $out = array ();\n return $values;\n }", "function getSanitizedValues() {\r\n //TODO: actually clean the values. Could probably put it in the \r\n // case above...\r\n //\r\n //TDOD: consider using $_POST instead of $_GET!\r\n //\r\n // Also, this is probably overkill when we could just copy the\r\n // entirety of $_POST...not that we can guarantee people won't\r\n // jam malicious data into it.\r\n $cleanVals = array();\r\n $cleanVals['datetime'] = date(GlApp::DATE_FORMAT, strtotime($_REQUEST['datetime']));\r\n $cleanVals['mileage'] = $_REQUEST['mileage'];\r\n $cleanVals['location'] = $_REQUEST['location'];\r\n $cleanVals['pricepergallon'] = $_REQUEST['pricepergallon'];\r\n $cleanVals['gallons'] = $_REQUEST['gallons'];\r\n $cleanVals['grade'] = $_REQUEST['grade'];\r\n $cleanVals['pumpprice'] = $_REQUEST['pumpprice'];\r\n $cleanVals['notes'] = htmlspecialchars($_REQUEST['notes']);\r\n \r\n return $cleanVals;\r\n}", "function summary(&$values) {\n $erroneousField = NULL;\n $response = $this->setActiveFieldValues($values, $erroneousField);\n $errorRequired = FALSE;\n $missingField = '';\n $this->_params = &$this->getActiveFieldParams();\n\n foreach ($this->_requiredFields as $requiredField) {\n if(empty($this->_params['id']) && empty($this->_params[$requiredField])) {\n $errorRequired = TRUE;\n $missingField .= ' ' . $requiredField;\n CRM_Contact_Import_Parser_Contact::addToErrorMsg($this->_entity, $requiredField);\n }\n }\n\n if ($errorRequired) {\n array_unshift($values, ts('Missing required field(s) :') . $missingField);\n return CRM_Import_Parser::ERROR;\n }\n\n $errorMessage = NULL;\n //@todo add a validate fn to the apis so that we can dry run against them to check\n // pseudoconstants\n if ($errorMessage) {\n $tempMsg = \"Invalid value for field(s) : $errorMessage\";\n array_unshift($values, $tempMsg);\n $errorMessage = NULL;\n return CRM_Import_Parser::ERROR;\n }\n return CRM_Import_Parser::VALID;\n }", "public function formatFormValues( $values )\n\t{\n\t\tif( !$this->id )\n\t\t{\n\t\t\t$this->save();\t\t\t\n\t\t}\n\n\t\t\\IPS\\Lang::saveCustom( 'core', \"security_question_{$this->id}\", $values['security_question_title'] );\n\t\tunset( $values['security_question_title'] );\n\n\t\treturn $values;\n\t}", "protected function compile_values()\n\t{\n\t\t// Non-transaction values.\n\t\t$values = array\n\t\t(\n\t\t\t'x_login' => $this->_login,\n\t\t\t'x_tran_key' => $this->_tran_key,\n\t\t\t'x_version' => $this->_version,\n\t\t\t'x_delim_char' => $this->_delim_char,\n\t\t\t'x_delim_data' => $this->_delim_data,\n\t\t\t'x_relay_response' => $this->_relay_response,\n\t\t\t'x_type' => $this->_type,\n\t\t\t'x_method' => $this->_method\n\t\t);\n\t\t\n\t\t// Prepend x_ to each of the values that have been set.\n\t\t$all = array_merge($this->_optional, $this->_fields);\n\t\tforeach ($all as $field)\n\t\t{\n\t\t\tif (isset($this->$field))\n\t\t\t\t$values[\"x_$field\"] = $this->$field;\n\t\t}\n\n\t\t// Collects all the values needed to put together a request.\n\t\t$post = '';\n\t\tforeach ($values as $key => $value)\n\t\t{\n\t\t\t// Make sure none of the values contain the delim character.\n\t\t\tif ($key != 'x_delim_char')\n\t\t\t\t$value = str_replace($this->_delim_char, '', $value);\n\n\t\t\t$post .= \"$key=\" . urlencode($value) . \"&\";\n\t\t}\n\n\t\t$post = rtrim($post, \"& \");\n\n\t\treturn $post;\n\t}", "function get_types_and_literals($tokens){\n $types = array();\n $literals = array();\n for($i = 1; $i < count($tokens[0]); $i++){\n if($tokens[0][$i] == TokenConstants::CONSTANT){\n if(preg_match(\"/^bool@(true|false)\\z/u\",$tokens[1][$i])){\n $types[$i - 1] = \"bool\";\n $literals[$i - 1] = preg_replace(\"/^bool@/\",\"\",$tokens[1][$i]);\n }\n elseif(preg_match(\"/^int@(\\\\+|-)?[0-9]+\\z/u\",$tokens[1][$i])){\n $types[$i - 1] = \"int\";\n $literals[$i - 1] = preg_replace(\"/^int@/\",\"\",$tokens[1][$i]);\n }\n elseif(preg_match(\"/^nil@nil\\z/u\",$tokens[1][$i])){\n $types[$i - 1] = \"nil\";\n $literals[$i - 1] = \"nil\";\n }\n else{\n $types[$i - 1] = \"string\";\n $literals[$i - 1] = preg_replace(\"/^string@/\",\"\",$tokens[1][$i]);\n\n }\n }\n elseif($tokens[0][$i] == TokenConstants::LABEL){\n $types[$i - 1] = \"label\";\n $literals[$i - 1] = $tokens[1][$i];\n }\n elseif($tokens[0][$i] == TokenConstants::ID){\n $types[$i - 1] = \"var\";\n $literals[$i - 1] = $tokens[1][$i];\n }\n elseif($tokens[0][$i] == TokenConstants::TYPE){\n $types[$i - 1] = \"type\";\n $literals[$i - 1] = $tokens[1][$i];\n }\n }\n\n return array($types,$literals);\n}", "function setValueByArray($a_values)\n\t{\n\t\t$this->setValue($a_values[$this->getPostVar()]);\n\t}", "function render($values) {\n return '';\n }", "public static function clearSanity($values)\n {\n $values = (is_array($values)) ?\n array_map(\"clearSanity\", $values) :\n htmlentities($values, ENT_QUOTES, 'UTF-8');\n\n return $values;\n }", "function interpreting($data) {\r\n $patterns = array();\r\n $remplacements = array();\r\n $patterns[0] = '#(\\$motClef|\\$motCl(é|e))#i';\r\n $remplacements[0] = '\\s(algorithme|procedure|fonction|si|sinon|fin_?si|tant_?que|fin_?tant_?que|selon|autrement|'\r\n . 'fin_?selon|pour|fin_?pour|et|ou|mod|div)\\s';\r\n \r\n $patterns[1] = '#\\$variable#i';\r\n $remplacements[1] = '(\\w+) ?';\r\n \r\n $patterns[2] = '#\\$op(é|e)rateur#i';\r\n $remplacements[2] = '(\\+|\\-|\\/|\\*|\\sdiv\\s|\\smod\\s)';\r\n \r\n $patterns[3]= '#\\$tout#i';\r\n $remplacements[3]= '(.*)';\r\n \r\n $patterns[4] = '#\\$entier#i';\r\n $remplacements[4]= '(-?[0-9]+)';\r\n \r\n $patterns[5]= '#\\$reel#';\r\n $remplacements[5]= '[\\-\\+]?[0-9]*(\\.[0-9]+)?';\r\n \r\n $patterns[6] = '#\\$caract(e|è)re#';\r\n $remplacements[6]= \"(\\'\\w\\')\";\r\n \r\n $patterns[7]= '#$cha(i|î)ne#';\r\n $remplacements[7]= '(\\\"(.*)\\\")';\r\n \r\n $patterns[8]= '#\\$bool(é|e)en#';\r\n $remplacements[8]= '(vrai|faux|true|false)';\r\n \r\n $patterns[9]= '#\\$type#';\r\n $remplacements[9]= '\\s(entier|r(é|e)el|caract(e|è)re|cha(i|î)ne|bool(é|e)en)\\s';\r\n \r\n $patterns[10]= '#\\$relation#';\r\n $remplacements[10]= '(==|\\<|\\>|\\<=|\\>=|\\!=)';\r\n \r\n $patterns[11]= '#\\$logique#';\r\n $remplacements[12]= '\\s(et|ou|ouex|non)\\s';\r\n \r\n\r\n\r\n foreach($data as &$currentValue) {\r\n $currentValue['layout'] = preg_replace($patterns, $remplacements, $currentValue['layout']);\r\n $currentValue['layout'] = '#'.$currentValue['layout'].'#iU';\r\n }\r\n return $data;\r\n}", "public function preprocess(array $values, array $context = []);", "public function safetechFraudAnalysis($values)\n\t{\n\t\treturn $this->getRequest('SafetechFraudAnalysis', $values);\n\t}", "function getRawInputValues();", "public static function substitute($input, $variables, $failOnMissingVars=false, $ignoreFailOnGoodCount=0)\n\t{\n\t\t$countVars = 0;\n\t\t$countReplacedVars = 0 ;\n\t\t$output = preg_replace_callback(\"/%(.+?)%/\",\n\t\t\t\t\t\tfunction ($pregResult) use ($variables, &$countVars, &$countReplacedVars)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$varName = $pregResult[1];\n\t\t\t\t\t\t\t$value = $pregResult[0];\n\t\t\t\t\t\t\t$countVars++;\n\t\t\t\t\t\t\tif(isset($variables[$varName]))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$value = $variables[$varName];\n\t\t\t\t\t\t\t\tif($value != \"\")\t\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$countReplacedVars++;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn $value;\n\t\t\t\t\t\t}, \n\t\t\t\t\t\t$input);\n\t\t//error handling, if configured and variables were found\n\t\tif($failOnMissingVars && $countVars > 0)\n\t\t{\n\t\t\t//if variables were found some variables could not be replaced, fail\n\t\t\tif($countReplacedVars < $countVars )\n\t\t\t{\n\t\t\t\t//check, if the error should be ignored\n\t\t\t\tif(!($ignoreFailOnGoodCount > 0 && $countReplacedVars >= $ignoreFailOnGoodCount))\n\t\t\t\t{\n\t\t\t\t\treturn \"\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $output;\n\t}", "public function formatFormValues( $values )\n\t{\n\t\tif ( !$this->id )\n\t\t{\n\t\t\t$this->save();\n\t\t}\n\t\t\n\t\tif( isset( $values['action_name'] ) )\n\t\t{\n\t\t\t\\IPS\\Lang::saveCustom( 'nexus', \"nexus_stockaction_{$this->id}\", $values['action_name'] );\n\t\t\tunset( $values['action_name'] );\n\t\t}\n\t\t\n\t\tif ( isset( $values['action_message_on'] ) AND !$values['action_message_on'] )\n\t\t{\n\t\t\t$values['action_message'] = NULL;\n\t\t}\n\t\tunset( $values['action_message_on'] );\n\t\t\n\t\tforeach ( array( 'status', 'department' ) as $k )\n\t\t{\n\t\t\tif( isset( $values[\"action_{$k}\"] ) )\n\t\t\t{\n\t\t\t\t$values[\"action_{$k}\"] = $values[\"action_{$k}\"] ?: NULL;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif( isset( $values['action_staff'] ) )\n\t\t{\n\t\t\t$values['action_staff'] = $values['action_staff'] ? \\IPS\\Member::load( $values['action_staff'] ) : NULL;\n\t\t}\n\t\t\n\t\tif( isset( $values['action_show_in'] ) )\n\t\t{\n\t\t\t$values['action_show_in'] = $values['action_show_in'] ? implode( ',', array_keys( $values['action_show_in'] ) ) : '*';\n\t\t}\n\t\t\n\t\treturn $values;\n\t}", "function processInput($key, $value, $form_values){\r\n\t$regular = '';\r\n\t$regular2 = '';\r\n\t\r\n\t\tswitch ($key){\r\n\t\t\tcase 'firstname':\r\n\t\t\tcase 'lastname':\r\n\t\t\tcase 'city':\r\n\t\t\tcase 'state':\r\n\t\t\t\t$regular = '/^[A-Z \\'.-]+$/i';\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'name':\r\n\t\t\tcase 'district':\r\n\t\t\tcase 'street1':\r\n\t\t\tcase 'street2':\r\n\t\t\tcase 'age':\r\n\t\t\t\t$regular = '/^[A-Z0-9 \\'.-]+$/i';\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'zip':\r\n\t\t\t\t$regular = '/^([0-9]{5})(-[0-9]{4})?$/i';\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'phone':\r\n\t\t\t\t$regular = '/^([0-9]{10})$/i';\r\n\t\t\t\t$regular2 = '/^([0-9]{7})$/i';\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'username':\r\n\t\t\t\t$regular = '/^[A-Z0-9]{4,20}$/i';\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'password':\r\n\t\t\t\t$regular = '/^(\\w*(?=\\w*\\d)(?=\\w*[a-z])(?=\\w*[A-Z])\\w*){6,20}$/';\r\n\t\t\t\tbreak;\t\t\t\r\n\t\t}\r\n\t\treturn(getError($key, $value, $regular, $regular2, $form_values));\r\n\r\n}", "public static function parse($value, $allowedValues = []): string\n {\n self::validate($value, $allowedValues);\n if (in_array($value, [null, self::STATUS_N, self::STATUS_Y], true)) {\n return $value;\n } else {\n return empty($value) ? 'n' : 'y';\n }\n }", "protected function parseValues()\n {\n\n $this->setValues([]);\n\n $matches = [];\n\n preg_match_all(\"/\\<(.+?)\\>/\", $this->getDomainRegex() . '/' . $this->getRegex(), $matches);\n\n if(!empty($matches[1])){\n foreach($matches[1] as $value){\n $this->values[$value] = null;\n }\n }\n }", "function show_all($value, $dump = false) {\n if(!$dump){\n if ($value) {\n foreach ($value as $keya => $valb)\n print \"$keya=$valb<br />\";\n } else {\n print \"No values to display. <br>\";\n }\n } else {\n var_dump($value);\n }\n}", "public static function parse_string_variables($search_replace, $field_values){\n\n // Collect all the find and replace strings\n $find_strings = array_keys($search_replace);\n $replace_strings = array_values($search_replace);\n foreach ($find_strings AS $k => $v){ $find_strings[$k] = '{'.$v.'}'; }\n\n // Loop through field values and replace string variables\n foreach ($field_values AS $field => $value){\n if (strstr($field, '_text')){\n $value = str_replace($find_strings, $replace_strings, $value);\n $field_values[$field] = $value;\n }\n }\n\n // Return the parsed field values\n return $field_values;\n\n }", "function parseValues($workOnlyOnDataArr=0)\t{\n\t\t//Blog Hack\n\t\t$evalValues=$this->conf['blogData']?$this->metafeeditlib->getBlogEvalValues($this->conf):$this->conf[$this->conf['cmdKey'].'.']['evalValues.'];\t\t\n\t\t//$parseValues=array_merge(is_array($this->conf['parseValues.'])?$this->conf['parseValues.']:array(),is_array($evalValues)?$evalValues:array());\n\t\tif(is_array($this->conf['parseValues.'])) {\n\t\t\t$parseValues=$this->conf['parseValues.'];\n\t\t\tif (is_array($evalValues)) {\n\t\t\t\t$arr=$parseValues;\n\t\t\t\tforeach ($evalValues as $key=>$val) {\n\t\t\t\t\tif ($arr[$key]) {\n\t\t\t\t\t\t$arr[$key]=implode(',',array_merge(t3lib_div::trimexplode(',',$parseValues[$key]),t3lib_div::trimexplode(',',$evalValues[$key])));\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$arr[$key]=$val;\n\t\t\t\t\t}\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t$parseValues=$arr;\n\t\t\t}\n\t\t}\n\t\telse $parseValues = $evalValues;\n\t\t\n\t\tif ($workOnlyOnDataArr) {\n\t\t\t$theParseValues=array();\n\t\t\tforeach ($this->dataArr as $field=>$val) {\n\t\t\t\tif ($theParseValues[$field]) $parseValues[]=$parseValues[$field];\n\t\t\t}\n\t\t\tunset ($parseValues);\n\t\t\t$parseValues=&$theParseValues;\n\t\t}\n\n\t\tif (is_array($parseValues))\t{\n\t\t\treset($parseValues);\n\t\t\t while(list($theField,$theValue)=each($parseValues))\t{\t\t\t \t\n\t\t\t\t$this->markerArray['###EVAL_ERROR_FIELD_'.$theField.'###']='';\n\t\t\t\t$this->markerArray['###CSS_ERROR_FIELD_'.$theField.'###']='';\n\t\t\t\t$this->markerArray['###EVAL_ERROR_FIELD_'.str_replace('.','_',$theField).'###']='';\n\t\t\t\t$this->markerArray['###CSS_ERROR_FIELD_'.str_replace('.','_',$theField).'###']='';\n\t\t\t\t$listOfCommands = t3lib_div::trimExplode(',',$theValue,1);\n\t\t\t\twhile(list(,$cmd)=each($listOfCommands))\t{\n\t\t\t\t\t$cmdParts = preg_split('/\\[|\\]/',$cmd);\t// Point is to enable parameters after each command enclosed in brackets [..]. These will be in position 1 in the array.\n\t\t\t\t\t$theCmd=trim($cmdParts[0]);\n\t\t\t\t\tswitch($theCmd)\t{\n\t\t\t\t\t\tcase 'int':\n\t\t\t\t\t\t\t$this->dataArr[$theField]=intval($this->dataArr[$theField]);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'lower':\n\t\t\t\t\t\tcase 'upper':\n\t\t\t\t\t\t\t$this->dataArr[$theField] = $this->cObj->caseshift($this->dataArr[$theField],$theCmd);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'upperfirst':\n\t\t\t\t\t\t\t$val = $this->cObj->caseshift($this->dataArr[$theField],'lower');\n\t\t\t\t\t\t\t$this->dataArr[$theField]=strtoupper(substr($val,0,1)).substr($val,1);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'nospace':\n\t\t\t\t\t\t\t$this->dataArr[$theField] = str_replace(' ', '', $this->dataArr[$theField]);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'alpha':\n\t\t\t\t\t\t\t$this->dataArr[$theField] = preg_replace('/[^a-zA-Z]/','',$this->dataArr[$theField]);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'num':\n\t\t\t\t\t\t\t$this->dataArr[$theField] = preg_replace('/[^0-9]/','',$this->dataArr[$theField]);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'alphanum':\n\t\t\t\t\t\t\t$this->dataArr[$theField] = preg_replace('/[^a-zA-Z0-9]/','',$this->dataArr[$theField]);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'alphanum_x':\n\t\t\t\t\t\t\t$this->dataArr[$theField] = preg_replace('/[^a-zA-Z0-9_-]/','',$this->dataArr[$theField]);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'trim':\n\t\t\t\t\t\t\t$this->dataArr[$theField] = trim($this->dataArr[$theField]);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'strip_tags':\n\t\t\t\t\t\t\t$this->dataArr[$theField] = strip_tags($this->dataArr[$theField]);\n\t\t\t\t\t\t break;\n\t\t\t\t\t\tcase 'noaccents':\n\t\t\t\t\t\t\t$this->dataArr[$theField] = removeaccents($this->dataArr[$theField]);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'invert':\n\t\t\t\t\t\t\t$this->dataArr[$theField]=$this->dataArr[$theField]?0:1;\t\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'random':\n\t\t\t\t\t\t\t$this->dataArr[$theField] = substr(md5(uniqid(microtime(),1)),0,intval($cmdParts[1]));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'files':\n\t\t\t\t\t\t\t$this->processFiles($cmdParts,$theField);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'setEmptyIfAbsent':\n\t\t\t\t\t\t\tif (!isset($this->dataArr[$theField]))\t{\n\t\t\t\t\t\t\t\t$this->dataArr[$theField]='';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'multiple':\n\t\t\t\t\t\t\tif (is_array($this->dataArr[$theField]))\t{\n\t\t\t\t\t\t\t\t$this->dataArr[$theField] = implode(',',$this->dataArr[$theField]);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'checkArray':\n\t\t\t\t\t\t\tif (is_array($this->dataArr[$theField]))\t{\n\t\t\t\t\t\t\t\treset($this->dataArr[$theField]);\n\t\t\t\t\t\t\t\t$val = 0;\n\t\t\t\t\t\t\t\twhile(list($kk,$vv)=each($this->dataArr[$theField]))\t{\n\t\t\t\t\t\t\t\t\t$kk = t3lib_div::intInRange($kk,0);\n\t\t\t\t\t\t\t\t\tif ($kk<=30)\t{\n\t\t\t\t\t\t\t\t\t\tif ($vv)\t{\n\t\t\t\t\t\t\t\t\t\t\t$val|=pow(2,$kk);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t$this->dataArr[$theField] = $val;\n\t\t\t\t\t\t\t} else {$this->dataArr[$theField]=0;}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'uniqueHashInt':\n\t\t\t\t\t\t\t$otherFields = t3lib_div::trimExplode(';',$cmdParts[1],1);\n\t\t\t\t\t\t\t$hashArray=array();\n\t\t\t\t\t\t\twhile(list(,$fN)=each($otherFields))\t{\n\t\t\t\t\t\t\t\t$vv = $this->dataArr[$fN];\n\t\t\t\t\t\t\t\t$vv = preg_replace('/[[:space:]]/','',$vv);\n\t\t\t\t\t\t\t\t$vv = preg_replace('/[^[:alnum:]]/','',$vv);\n\t\t\t\t\t\t\t\t$vv = strtolower($vv);\n\t\t\t\t\t\t\t\t$hashArray[]=$vv;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$this->dataArr[$theField]=hexdec(substr(md5(serialize($hashArray)),0,8));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t // Call to user parse function\n\t\t$this->conf['parentObj']=&$this;\n\t\tif ($this->conf['userFunc_afterParse']) {\n\t\t\tt3lib_div::callUserFunction($this->conf['userFunc_afterParse'],$this->conf,$this);\n\t\t}\n\t}", "function processForm($aFormValues)\n{\n\tglobal $locate, $config;\t\n\n\t$objResponse = new xajaxResponse();\n\n\tif ($config['system']['validcode'] == 'yes'){\n\t\tif (trim($aFormValues['code']) != $_SESSION[\"Checknum\"]){\n\t\t\t$objResponse->addAlert('Invalid code');\n\t\t\t$objResponse->addScript('init();');\n\t\t\treturn $objResponse;\n\t\t}\n\t}\n\n\tif (array_key_exists(\"email\",$aFormValues))\n\t{\n\t\tif (filter_var($aFormValues['email'], FILTER_VALIDATE_EMAIL))\n\t\t{\n\t\t // passed\n\t\t\treturn processEmail($aFormValues['email']);\n\t\t}else{\n\t\t // error\n\t\t\t$objResponse->addAlert($locate->Translate(\"invalid_email\"));\n\t\t\t$objResponse->addScript('init();');\n\t\t\treturn $objResponse;\n\t\t}\n\n\t} else{\n\t\t//$objResponse = new xajaxResponse();\n\t\treturn $objResponse;\n\t}\n}", "public function formatFormValues( $values )\n\t{\n\t\tif ( !$this->id )\n\t\t{\n\t\t\t$this->save();\n\t\t}\n\t\t\n\t\tif( isset( $values['status_name'] ) )\n\t\t{\n\t\t\t\\IPS\\Lang::saveCustom( 'nexus', \"nexus_status_{$this->id}_admin\", $values['status_name'] );\n\t\t\tunset( $values['status_name'] );\n\t\t}\n\n\t\tif( isset( $values['status_public_name'] ) )\n\t\t{\n\t\t\t\\IPS\\Lang::saveCustom( 'nexus', \"nexus_status_{$this->id}_front\", $values['status_public_name'] );\n\t\t\tunset( $values['status_public_name'] );\n\t\t}\n\n\t\tif( isset( $values['status_public_set'] ) )\n\t\t{\n\t\t\tif ( $values['status_public_set'] )\n\t\t\t{\n\t\t\t\t\\IPS\\Lang::saveCustom( 'nexus', \"nexus_status_{$this->id}_set\", $values['status_public_set_text'] );\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t\\IPS\\Db::i()->delete( 'core_sys_lang_words', array( 'word_app=? AND word_key=?', 'nexus', \"nexus_status_{$this->id}_set\" ) );\n\t\t\t}\n\t\t\tunset( $values['status_public_set_text'] );\n\t\t}\n\t\t\n\t\tif( isset( $values['status_is_locked'] ) )\n\t\t{\n\t\t\t$values['status_is_locked'] = !$values['status_is_locked'];\n\t\t}\n\t\t\n\t\tif( isset( $values[ \"status_member\" ] ) OR isset( $values['status_staff'] ) )\n\t\t{\n\t\t\tforeach ( array( 'member', 'staff' ) as $k )\n\t\t\t{\n\t\t\t\tif ( isset( $values[ \"status_{$k}\" ] ) and in_array( $k, $values[ \"status_{$k}\" ] ) )\n\t\t\t\t{\n\t\t\t\t\t$values[\"default_{$k}\"] = TRUE;\n\t\t\t\t\t\\IPS\\Db::i()->update( 'nexus_support_statuses', array( 'default_member' => 0 ) );\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$values[\"default_{$k}\"] = FALSE;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tif( isset( $values['status_default'] ) )\n\t\t{\n\t\t\tif ( in_array( 'member', $values['status_default'] ) )\n\t\t\t{\n\t\t\t\t$this->default_member = TRUE;\n\t\t\t\t\\IPS\\Db::i()->update( 'nexus_support_statuses', array( 'status_default_member' => 0 ) );\n\t\t\t}\n\t\t\tif ( in_array( 'staff', $values['status_default'] ) )\n\t\t\t{\n\t\t\t\t$this->default_staff = TRUE;\n\t\t\t\t\\IPS\\Db::i()->update( 'nexus_support_statuses', array( 'status_default_staff' => 0 ) );\n\t\t\t}\n\t\t\tunset( $values['status_default'] );\n\t\t}\n\t\t\n\t\tif( isset( $values['status_color'] ) )\n\t\t{\n\t\t\t$values['status_color'] = ltrim( $values['status_color'], '#' );\n\t\t}\n\t\t\t\t\t\t\n\t\treturn $values;\n\t}", "public function Map(array $a_values): array\n {\n $data = [\n 'guid' => (isset($a_values['guid']) ? $a_values['guid'] : ''),\n 'event_type' => (isset($a_values['type']) ? $a_values['type'] : ''),\n 'occurred_at' => (isset($a_values['occurred_at']) ? $a_values['occurred_at'] : null),\n 'payload' => (isset($a_values['payload']) ? $a_values['payload'] : null),\n ];\n if (isset($a_values['id']) && $a_values['id'] > 0) {\n // Set ID only if exists and not empty\n $data['id'] = $a_values['id'];\n }\n return $data;\n }", "function metaboxTabAsinOutput ( $values )\n\t{\n\t\t$asin = esc_attr( $values[0] );\n\t\t$locale = esc_attr( $values[1] );\n\n\t\t/**\n\t\t * Set up endpoint\n\t\t */\n\t\t$this->core->amazon_endpoint = $this->core->amazon_endpoint_table[$locale];\n\n\t\t$item_result = $this->core->getItemLookup( $asin, FALSE );\n\t\tif ( $item_result['Items']['Request']['Errors'] ) {\n\t\t\techo '<strong>' . __( 'Can\\'t find the given item', 'avhamazon' ) . '</strong>';\n\t\t} else {\n\t\t\t$this->metaboxTabOutputHeader();\n\t\t\t$imageinfo = $this->core->getImageInfo( 'swatch', $item_result );\n\t\t\t$this->metaboxTabOutputItem( $item_result['Items']['Item']['ItemAttributes']['Title'], $asin, 'avhamazon_scasin_asin', 'avhamazon_scasin_asin', '', TRUE, $imageinfo );\n\t\t\t$this->metaboxTabOutputOptions( 'asin' );\n\t\t\t$this->metaboxTabOutputSendtoeditor( 'asin' );\n\t\t}\n\t}", "private function parseParams(array $values): array\n {\n foreach ( $values as &$value )\n {\n if ( is_string($value) && str_starts_with($value, '%') && str_ends_with($value, '%') )\n {\n // remove first % and last %\n $key = substr($value, 1, -1);\n\n if ( $this->parameterBag->has($key) )\n {\n $value = $this->parameterBag->get($key);\n }\n }\n elseif ( is_array($value) )\n {\n $value = $this->parseParams($value);\n }\n }\n\n return $values;\n }", "function sanitize(){\r\n\t\t $outar = Array();\r\n \t $arg_list = func_get_args();\r\n\t\t foreach($arg_list[0] as $key => $value){\r\n\t\t\t\t $data = $value;\r\n\t\t\t\t $data = PREG_REPLACE(\"/[^0-9a-zA-Z]/i\", '', $data);\r\n\t\t\t\t array_push($outar,$data);\r\n\t\t }\r\n\t\treturn $outar;\r\n\t }", "public function returnarray($userinfo, $values) {\n\n $data = array();\n if ($values == 0) {\n \n } elseif ($values == 1) {\n\n foreach ($userinfo as $key => $user) {\n $data[] = array(\"title\" => (empty($user->displayName) ? $user->fileAs : $user->displayName),\n \"phone\" => $user->mobilePhone,\n \"email\" => (isset($user->emailAddresses[0]->name) ? $user->emailAddresses[0]->name : \"\"),\n );\n }\n }\n return $data;\n }", "function HTMLVariationValues($name=null, $results, $product, $product_variations, $product_variation_values, $variation_values) {\n //エラー判定\n if (isset($results)) {\n $err_price = $results->errors['price'];\n $err_stock = $results->errors['stock'];\n }\n\n if (is_array($product_variations)) {\n //選択済み規格でループ\n foreach ($product_variations as $key=>$val) {\n if (is_array($variation_values[$key])) {\n //規格詳細でループ\n foreach ($variation_values[$key] as $k=>$v) {\n //自身を抹消(再帰用)\n unset($product_variations[$key]);\n //配列がなくなった(出力処理)\n if (count($product_variations)==0) {\n $name_td = '';\n $id = '';\n //規格1つの場合\n if (count($name)==0) {\n $name_td = '<td class=\"wd200\">' . $v['name'] . '</td>';\n }\n //規格組合せの場合\n else {\n //規格詳細を連結\n $nm = '';\n foreach ($name as $n) {\n if ($nm=='') {\n $id = $n['id'];\n $nm = $n['name'];\n }\n else {\n $id = $id . '_' . $n['id'];\n $nm = $nm . ', ' . $n['name'];\n }\n }\n $name_td = '<td class=\"wd200\">' . $nm . ', ' . $v['name'] . '</td>';\n }\n //IDを作成する\n if ($id=='') {\n $id = $v['id'];\n }\n else {\n $id = $id . '_' . $v['id'];\n }\n $check_val = array();\n $check_val['type'] = 'checkbox';\n $check_val['id'] = 'values_visible['.$id.']';\n $check_val['value'] = $id;\n if (!isset($product_variation_values[$id])) {\n $check_val['checked'] = '\"checked\"';\n }\n else if (isset($product_variation_values[$id]['visible']) && $product_variation_values[$id]['visible']=='1') {\n $check_val['checked'] = '\"checked\"';\n }\n $price = $product['price'];\n $stock = 0;\n if (isset($product_variation_values[$id])) {\n $price = $product_variation_values[$id]['price'];\n $stock = $product_variation_values[$id]['stock'];\n }\n echo '<div style=\"display:none;\">';\n echo SimpleCartFunctions::HTMLInput($check_val);\n echo '</div>';\n echo '<tr>';\n echo $name_td;\n if ($product['stock_manage']=='1') {\n echo '<td>' . SimpleCartFunctions::HTMLInput(array('id'=>'values_stock['.$id.']', 'value'=>$stock, 'class'=>'input_80')) . SimpleCartFunctions::HTMLError($err_stock[$id]) . '</td>';\n }\n echo '<td>' . SimpleCartFunctions::HTMLInput(array('id'=>'values_price['.$id.']', 'value'=>$price, 'class'=>'input_80')) . SimpleCartFunctions::HTMLError($err_price[$id]) . '</td>';\n echo SimpleCartFunctions::HTMLInput(array('type'=>'hidden', 'id'=>'values_ids['.$id.']', 'value'=>$id, 'class'=>'input_40'));\n echo '</tr>';\n }\n //配列がまだある(再帰するぜ)\n else {\n if (is_null($name)) {\n $name = array();\n $name[$key]['id'] = $v['id'];\n $name[$key]['name'] = $v['name'];\n }\n else {\n $name[$key]['id'] = $v['id'];\n $name[$key]['name'] = $v['name'];\n }\n SimpleCartFunctions::HTMLVariationValues($name, $results, $product, $product_variations, $product_variation_values, $variation_values);\n }\n }\n }\n return;\n }\n }\n }", "private static function prepare_values($values, $type_name)\n {\n }", "function setValueByArray($a_values)\n\t{\n\t\t$this->setLatitude($a_values[$this->getPostVar()][\"latitude\"]);\n\t\t$this->setLongitude($a_values[$this->getPostVar()][\"longitude\"]);\n\t\t$this->setZoom($a_values[$this->getPostVar()][\"zoom\"]);\n\t}", "function typeOutput($Attribute, $Type1, $Type2, $Type3){\n global $EN_types, $FR_types, $DE_types, $IT_types, $PT_types, $SP_types, $JP_types, $TC_types, $KR_types;\n\n switch($_SESSION['language']){\n case \"FR\":\n $tempLangArray = $FR_types;\n break;\n case \"DE\":\n $tempLangArray = $DE_types;\n break;\n case \"IT\":\n $tempLangArray = $IT_types;\n break;\n case \"PT\":\n $tempLangArray = $PT_types;\n break;\n case \"SP\":\n $tempLangArray = $SP_types;\n break;\n case \"JP\":\n $tempLangArray = $JP_types;\n break;\n case \"TC\":\n $tempLangArray = $TC_types;\n break;\n case \"KR\":\n $tempLangArray = $KR_types;\n break;\n default:\n $tempLangArray = $EN_types;\n break;\n }\n\n if($Attribute == \"TOKEN\"){\n echo \"<span id=\\\"type\\\"></span>\";\n }elseif($Attribute == \"NON-GAME\"){\n echo \"<span id=\\\"type\\\"></span>\";\n }elseif(($Type2 == \"Effect\") && (($Type3 == \"Tuner\") || ($Type3 == \"Gemini\") || ($Type3 == \"Toon\") || ($Type3 == \"Union\") || ($Type3 == \"Spirit\"))){\n echo \"<span id=\\\"type\\\">[ \" . $tempLangArray[$Type1] . \" / \" . $tempLangArray[$Type3] . \" ]</span>\";\n }elseif(($Type2 == \"Normal\") && (isset($Type1)) && ($Type3 == \"Tuner\")){\n echo \"<span id=\\\"type\\\">[ \" . $tempLangArray[$Type1] . \" / \" . $tempLangArray[$Type3] . \" ]</span>\";\n }elseif(($Type2 == \"Fusion\") && (isset($Type1)) && ($Type3 == \"Effect\")){\n echo \"<span id=\\\"type\\\">[ \" . $tempLangArray[$Type1] . \" / \" . $tempLangArray[$Type2] . \" / \" . $tempLangArray[$Type3] . \" ]</span>\";\n }elseif(($Type2 == \"Ritual\") && (isset($Type1)) && ($Type3 == \"Effect\")){\n echo \"<span id=\\\"type\\\">[ \" . $tempLangArray[$Type1] . \" / \" . $tempLangArray[$Type2] . \" / \" . $tempLangArray[$Type3] . \" ]</span>\";\n }elseif(($Type2 == \"Synchro\") && (isset($Type1)) && (($Type3 == \"Effect\") || ($Type3 == \"Tuner\"))){\n echo \"<span id=\\\"type\\\">[ \" . $tempLangArray[$Type1] . \" / \" . $tempLangArray[$Type2] . \" / \" . $tempLangArray[$Type3] . \" ]</span>\";\n }elseif(($Type2 == \"Xyz\") && (isset($Type1)) && ($Type3 == \"Effect\")){\n echo \"<span id=\\\"type\\\">[ \" . $tempLangArray[$Type1] . \" / \" . $tempLangArray[$Type2] . \" / \" . $tempLangArray[$Type3] . \" ]</span>\";\n }elseif(($Type2 == \"Pendulum\") && (isset($Type1)) && ($Type3 == \"Effect\")){\n echo \"<span id=\\\"type\\\">[ \" . $tempLangArray[$Type1] . \" / \" . $tempLangArray[$Type2] . \" / \" . $tempLangArray[$Type3] . \" ]</span>\";\n }elseif(($Attribute == \"TRAP\") || ($Attribute == \"SPELL\") || ($Attribute == \"MAGIC\")){\n echo \"<span id=\\\"type\\\">[ \" . $tempLangArray[$Type2] . \" ]</span>\";\n }else{\n echo \"<span id=\\\"type\\\">[ \" . $tempLangArray[$Type1] . \" / \" . $tempLangArray[$Type2] . \" ]</span>\";\n }\n}", "function process_variables($input, $graph_item, $graph_start = 0, $graph_end = 0) {\n\n\t$matches = array();\n\t$match = \"\";\n\n\t/* Get graph items for the graph */\n\t$graph_items = db_fetch_assoc(\"SELECT\n\t\tgraph_templates_item.id AS graph_templates_item_id,\n\t\tgraph_templates_item.cdef_id,\n\t\tgraph_templates_item.text_format,\n\t\tgraph_templates_item.value,\n\t\tgraph_templates_item.hard_return,\n\t\tgraph_templates_item.consolidation_function_id,\n\t\tgraph_templates_item.graph_type_id,\n\t\tgraph_templates_gprint.gprint_text,\n\t\tcolors.hex,\n\t\tdata_template_rrd.id as data_template_rrd_id,\n\t\tdata_template_rrd.local_data_id,\n\t\tdata_template_rrd.rrd_minimum,\n\t\tdata_template_rrd.rrd_maximum,\n\t\tdata_template_rrd.data_source_name,\n\t\tdata_template_rrd.local_data_template_rrd_id\n\t\tFROM graph_templates_item\n\t\tLEFT JOIN data_template_rrd ON (graph_templates_item.task_item_id=data_template_rrd.id)\n\t\tLEFT JOIN colors ON (graph_templates_item.color_id=colors.id)\n\t\tLEFT JOIN graph_templates_gprint on (graph_templates_item.gprint_id=graph_templates_gprint.id)\n\t\tWHERE graph_templates_item.local_graph_id=\" . $graph_item[\"local_graph_id\"] . \"\n\t\tORDER BY graph_templates_item.sequence\");\n\n\t/* find the step and how often this graph is updated with new data */\n\t$ds_step = db_fetch_cell(\"select\n\t\tdata_template_data.rrd_step\n\t\tfrom (data_template_data,data_template_rrd,graph_templates_item)\n\t\twhere graph_templates_item.task_item_id=data_template_rrd.id\n\t\tand data_template_rrd.local_data_id=data_template_data.local_data_id\n\t\tand graph_templates_item.local_graph_id=\" . $graph_item[\"local_graph_id\"] . \"\n\t\tlimit 0,1\");\n\t$ds_step = empty($ds_step) ? 300 : $ds_step;\n\n\tif ((empty($graph_start)) || (empty($graph_end))) {\n\t\t$rra[\"rows\"] = 600;\n\t\t$rra[\"steps\"] = 1;\n\t\t$rra[\"timespan\"] = 86400;\n\t}else{\n\t\t/* get a list of RRAs related to this graph */\n\t\t$rras = get_associated_rras($graph_item[\"local_graph_id\"]);\n\n\t\tif (sizeof($rras) > 0) {\n\t\t\tforeach ($rras as $unchosen_rra) {\n\t\t\t\t/* the timespan specified in the RRA \"timespan\" field may not be accurate */\n\t\t\t\t$real_timespan = ($ds_step * $unchosen_rra[\"steps\"] * $unchosen_rra[\"rows\"]);\n\n\t\t\t\t/* make sure the current start/end times fit within each RRA's timespan */\n\t\t\t\tif ( (($graph_end - $graph_start) <= $real_timespan) && ((time() - $graph_start) <= $real_timespan) ) {\n\t\t\t\t\t/* is this RRA better than the already chosen one? */\n\t\t\t\t\tif ((isset($rra)) && ($unchosen_rra[\"steps\"] < $rra[\"steps\"])) {\n\t\t\t\t\t\t$rra = $unchosen_rra;\n\t\t\t\t\t}else if (!isset($rra)) {\n\t\t\t\t\t\t$rra = $unchosen_rra;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (!isset($rra)) {\n\t\t\t$rra[\"rows\"] = 600;\n\t\t\t$rra[\"steps\"] = 1;\n\t\t}\n\t}\n\t$seconds_between_graph_updates = ($ds_step * $rra[\"steps\"]);\n\n\t/* override: graph start time */\n\tif ((!isset($graph_start)) || ($graph_start == \"0\")) {\n\t\t$graph_start = -($rra[\"timespan\"]);\n\t}\n\t/* override: graph end time */\n\tif ((!isset($graph_end)) || ($graph_end == \"0\")) {\n\t\t$graph_end = -($seconds_between_graph_updates);\n\t}\n\n\t/* Nth percentile */\n\tif (preg_match_all(\"/\\|([0-9]{1,2}):(bits|bytes):(\\d):(current|total|max|total_peak|all_max_current|all_max_peak|aggregate_max|aggregate_sum|aggregate_current|aggregate):(\\d)?\\|/\", $input, $matches, PREG_SET_ORDER)) {\n\t\tforeach ($matches as $match) {\n\t\t\t$input = str_replace($match[0], variable_nth_percentile($match, $graph_item, $graph_items, $graph_start, $graph_end), $input);\n\t\t}\n\t}\n\n\t/* bandwidth summation */\n\tif (preg_match_all(\"/\\|sum:(\\d|auto):(current|total|atomic):(\\d):(\\d+|auto)\\|/\", $input, $matches, PREG_SET_ORDER)) {\n\t\tforeach ($matches as $match) {\n\t\t\t$input = str_replace($match[0], variable_bandwidth_summation($match, $graph_item, $graph_items, $graph_start, $graph_end, $rra[\"steps\"], $ds_step), $input);\n\t\t}\n\t}\n\n\treturn $input;\n\n}", "protected function _processForm (array $values, $form) {\n \n //---> blank codes <------\n $code99 = array(\n 'aborid','gender','popgrp','homelang',\n 'borncan','referby','marital','adults','numchild',\n 'actlim1', 'actlim2'\n );\n \n\t$code88 = array(\n\t\t'brsc5','brsc6'\n\t);\n \n $code77 = array(\n 'grade','ch1age','ch2age','ch3age','ch4age',\n 'ch5age','ch6age','ch7age','ch8age','hous1a',\n\t 'prlt1a','prlt2a','prlt3a','prlt4a','prlt5a','prlt6a','prlt7a',\n\t 'prlt1b','prlt2b','prlt3b','prlt4b','prlt5b','prlt6b','prlt7b',\n\t 'prst1a','prst2a','prst3a','prst4a',\n\t 'prst1b','prst2b','prst3b','prst4b'\n );\n \n $code777 = array(\n 'yrscan'\n );\n\n $code1 = array(\n 'cadu1', 'cadu2', 'cadu3', 'cadu4', 'cadu5', 'cadu6', 'cadu7', 'cadu8',\n 'cadu9', 'cadu10', 'cadu11', 'cadu12', 'cadu13', 'cadu14', 'cadu15', 'cadu16'\n );\n \n $codeDate = array(\n 'hous1until'\n );\n\n\t $codeNA = array(\n\t 'genderoth'\n\t );\n \n //---> alphanumeric questions <----\n $alphaNums = array(\n 'popgrp','homelang','country', 'referby'\n );\n \n //end code book option arrays\n \n $questions = array();\n //get all necessary elements\n $elementSQL = \"SELECT elementID,fsiiName,options \n FROM customFormElements\n WHERE fsiiName IS NOT NULL\n AND formID = $form\";\n $elementList = $this->elmntModel->getAdapter()\n ->fetchAll(\"$elementSQL\");\n \n foreach ($elementList as $element) {\n $eName = $element['elementID'];\n \n if (array_key_exists($eName, $values)) {\n $val = $values[$eName];\n } else {\n $val = '';\n }\n \n \n $qCode = $element['fsiiName'];\n //FCSS handles multiple-answer questions as series of\n //separate 'yes/no' dyads; we prefer checkboxes,\n //so must process. we've called these 'processCheck' for convenience\n \n if ($qCode == 'processCheck') {\n $submittedAnswers = explode(' , ' , strtolower($val));\n \n $set = json_decode($element['options'], TRUE);\n \n foreach ($set as $newQuestionCode => $newValue) {\n \n if (in_array(strtolower(trim($newValue)), $submittedAnswers)) {\n $answerCode = '2'; //YES\n } elseif (strlen($val) > 0) {\n $answerCode = '1'; //NO\n } else {\n $answerCode = '77' ; //NA\n }\n $processedCheckSet = array (\n 'QuestionCode' => $newQuestionCode,\n 'Answer' => $answerCode\n );\n array_push($questions,$processedCheckSet);\n }\n continue;\n }\n \n \n $answers = json_decode($element['options'], TRUE);\n \n //if there are coded options, $answers will be > 0,\n //but some coded options (in $alphaNums) no longer want their codes\n \n if ((!in_array($qCode,$alphaNums)) && (count ($answers) > 0)) {\n $codes = array_flip($answers);\n if (array_key_exists($val,$codes)) {\n $response = $codes[$val]; \n } else {\n $response = '';\n }\n } else {\n //keep free text\n $response = $val;\n }\n \n if (in_array($qCode, $code99)) {\n $blankCode = '99';\n } elseif (in_array ($qCode, $code88)){\n $blankCode = '88';\n } elseif (in_array ($qCode, $code77)){\n $blankCode = '77';\n } elseif (in_array($qCode, $code777)) {\n $blankCode = '777';\n } elseif (in_array($qCode, $code1)) {\n $blankCode = '1';\n } elseif (in_array($qCode, $codeDate)) {\n $blankCode = '7777-77-77'; \n } elseif (in_array($qCode, $codeNA)) {\n $blankCode = 'na'; \n } else {\n $blankCode = '';\n }\n \n if ($response == '') $response = $blankCode;\n \n $tempAnswerSet = array (\n 'QuestionCode' => $qCode,\n 'Answer' => $response\n );\n \n array_push($questions,$tempAnswerSet);\n \n }\n \n if ($form == '100') //Intake form requires age, will calculate\n {\n $ptcp = new Application_Model_DbTable_Participants;\n $ptcpID = $values['uid'];\n $ptcpRecord = $ptcp->getRecord($ptcpID);\n $age = $ptcpRecord['age'];\n $tempAnswerSet = array (\n 'QuestionCode' => 'age',\n 'Answer' => $age\n );\n array_push($questions,$tempAnswerSet); \n }\n \n if ($form == '103') //Discontinue form requires date twice\n {\n $tempAnswerSet = array (\n 'QuestionCode' => 'disc',\n 'Answer' => $values['responseDate']\n );\n \n array_push($questions,$tempAnswerSet);\n }\n \n /* LEGACY \n if ($form == '102' || $form == '113') { //In poverty forms, question-codes vary based on prepost\n \n if ($values['prepost'] == 'pre') {\n $suffix = 'a';\n $emptySuffix = 'b';\n } else {\n $suffix = 'b';\n $emptySuffix = 'a';\n }\n \n foreach ($questions as $key => $qArray) { \n $code = $qArray['QuestionCode'];\n \n $qArray['QuestionCode'] = $code . $suffix;\n $questions[$key] = $qArray;\n \n $emptyArray = array(\n 'QuestionCode' => $code . $emptySuffix,\n 'Answer' => '77'\n );\n array_push($questions, $emptyArray);\n }\n \n } */\n \n return $questions;\n }", "public abstract function printValue($value);", "public function processAdminGatewayForm(array $values) {\n return $values;\n }", "function convertValues($var){\n\t\t//Change the script tages < and > to special characeters &lt; and &gt; \n\t\t$var = htmlspecialchars($var);\n\t\t$cleanvar = $var;\n\t\treturn $cleanvar;\n\t}", "protected function arrayExport($values) {\n $php = var_export($values, true);\n $php = str_replace(\"\\n\", '', $php);\n $php = str_replace('array ( ', 'array(', $php);\n $php = str_replace(',)', ')', $php);\n $php = str_replace(' ', ' ', $php);\n\n return $php;\n }", "protected function buildValue($values)\n {\n $valueData = [];\n foreach ($values as $value) {\n $valueData[] = [\n '@value' => $value['amount'],\n '@attributes' => [\n 'currency' => $value['currency'],\n 'value-date' => $value['value_date']\n ]\n ];\n }\n\n return $valueData;\n }", "public function qout($sql, $values = array())\n {\n\n $statement = oci_parse($this->connection, $sql);\n\n foreach ($values as $key => $val) {\n oci_bind_by_name($statement, $key, $values[$key], 512);\n }\n\n if (@!oci_execute($statement)) {\n $errors = oci_error($statement);\n return array('success' => false, 'data' => 'Error : ' . $errors['code'] . ' => ' . $errors['message']);\n }\n\n return array('success' => true, 'data' => '');\n }", "function getInputValues() {\r\n $vals = array();\r\n \r\n $vals['datetime'] = @$_REQUEST['datetime'];\r\n $vals['mileage'] = @$_REQUEST['mileage'];\r\n $vals['location'] = @$_REQUEST['location'];\r\n $vals['pricepergallon'] = @$_REQUEST['pricepergallon'];\r\n $vals['gallons'] = @$_REQUEST['gallons'];\r\n $vals['grade'] = @$_REQUEST['grade'];\r\n $vals['pumpprice'] = @$_REQUEST['pumpprice'];\r\n $vals['notes'] = @$_REQUEST['notes'];\r\n \r\n return $vals;\r\n}", "function inputChecker($input){\n \n // il valore che deve essere restituito\n $ret = true;\n \n foreach($input as $key => $value){\n \n switch ($key){\n case 'file': // echo '('. $key .')' . $value . ': ' .$ret .\"\\n\";\n break; \n case 'id_cinguettio': // echo '('. $key .')' . $value . ': ' .$ret .\"\\n\";\n $ret = idFormat($value);// echo '('. $key .')' . $value . ': ' .$ret .\"\\n\";\n break;\n case 'utente_seguace': \n case 'utente_seguito':\n case 'utente_segnalato':\n case 'utente_giudicato': \n case 'utente_luogo': \n case 'email_utente':\n $ret = emailFormat($value); //echo '('. $key .')' . $value . ': ' .$ret .\"\\n\"; \n break;\n case 'password_conferma': \n case 'password':\n $ret = pwdFormat($value); //echo '('. $key .')' . $value . ': ' .$ret .\"\\n\";\n break;\n case 'nickname':\n $ret = nickFormat($value); //echo '('. $key .')' . $value . ': ' .$ret .\"\\n\";\n break;\n case 'nome':\n $ret = nameFormat($value); //echo '('. $key .')' . $value . ': ' .$ret .\"\\n\";\n break; \n case 'cognome':\n $ret = nameFormat($value); //echo '('. $key .')' . $value . ': ' .$ret .\"\\n\";\n break; \n case 'sesso':\n $ret = sexFormat($value); //echo '('. $key .')' . $value . ': ' .$ret .\"\\n\";\n break; \n case 'giorno':\n $ret = dayFormat($value); //echo '('. $key .')' . $value . ': ' .$ret .\"\\n\";\n break;\n case 'mese':\n $ret = monthFormat($value); //echo '('. $key .')' . $value . ': ' .$ret .\"\\n\";\n break;\n case 'anno':\n $ret = yearFormat($value); //echo '('. $key .')' . $value . ': ' .$ret .\"\\n\";\n break;\n case 'nazione_nascita':\n case 'regione_nascita':\n case 'citta_residenza':\n $ret = placeFormat($value); //echo '('. $key .')' . $value . ': ' .$ret .\"\\n\";\n break;\n case 'hobby_1':\n $ret = hobbyFormat($value, VALID_HOBBY_1_FORMAT); //echo '('. $key .')' . $value . ': ' .$ret .\"\\n\";\n break;\n case 'hobby_2':\n $ret = hobbyFormat($value, VALID_HOBBY_2_FORMAT); //echo '('. $key .')' . $value . ': ' .$ret .\"\\n\";\n break;\n case 'hobby_3':\n $ret = hobbyFormat($value, VALID_HOBBY_3_FORMAT); //echo '('. $key .')' . $value . ': ' .$ret .\"\\n\";\n break; \n case 'hobby_4':\n $ret = hobbyFormat($value, VALID_HOBBY_4_FORMAT); //echo '('. $key .')' . $value . ': ' .$ret .\"\\n\";\n break;\n case 'hobby_5':\n $ret = hobbyFormat($value, VALID_HOBBY_5_FORMAT); // echo '('. $key .')' . $value . ': ' .$ret .\"\\n\";\n break;\n case 'hobby_6':\n $ret = hobbyFormat($value, VALID_HOBBY_6_FORMAT); //echo '('. $key .')' . $value . ': ' .$ret .\"\\n\";\n break;\n case 'hobby_7':\n $ret = hobbyFormat($value, VALID_HOBBY_7_FORMAT); //echo '('. $key .')' . $value . ': ' .$ret .\"\\n\";\n break;\n case 'hobby_8':\n $ret = hobbyFormat($value, VALID_HOBBY_8_FORMAT); //echo '('. $key .')' . $value . ': ' .$ret .\"\\n\";\n break;\n case 'hobby_9':\n $ret = hobbyFormat($value, VALID_HOBBY_9_FORMAT); // echo '('. $key .')' . $value . ': ' .$ret .\"\\n\";\n break;\n case 'hobby_10':\n $ret = hobbyFormat($value, VALID_HOBBY_10_FORMAT); // echo '('. $key .')' . $value . ': ' .$ret .\"\\n\";\n break; \n case 'commento':\n case 'messaggio':\n $ret = textFormat($value); // echo '('. $key .')' . $value . ': ' .$ret .\"\\n\";\n break;\n case 'descrizione_foto':\n $ret = descrFormat($value);// echo '('. $key .')' . $value . ': ' .$ret .\"\\n\";\n break;\n case 'gradi_lat':\n $ret = gradiLatFormat($value); //echo '('. $key .')' . $value . ': ' .$ret .\"\\n\";\n break;\n case 'gradi_lng': \n $ret = gradiLngFormat($value); //echo '('. $key .')' . $value . ': ' .$ret .\"\\n\";\n break;\n case 'minuti_lat':\n case 'minuti_lng': \n $ret = secMinFormat($value); //echo '('. $key .')' . $value . ': ' .$ret .\"\\n\";\n break; \n case 'secondi_lat':\n case 'secondi_lng': \n $ret = secMinFormat($value); //echo '('. $key .')' . $value . ': ' .$ret .\"\\n\";\n break; \n case 'direzione_lat':\n $ret = direzioneLatFormat($value); //echo '('. $key .')' . $value . ': ' .$ret .\"\\n\";\n break;\n case 'direzione_lng':\n $ret = direzioneLngFormat($value); //echo '('. $key .')' . $value . ': ' .$ret .\"\\n\";\n break;\n default:\n return false;\n } \n \n if($ret == false){\n break;\n }\n } \n return $ret;\n}", "function template_tags ($s_template, $a_values) {\n\tforeach ($a_values as $key=>&$value) $s_template = template_tag ($s_template, $key, $value);\n\treturn $s_template;\n}", "public function parseValue();", "function tidyInputs(){\n\tglobal $nric,$firstName,$lastName,$dob,$address1,$address2,$poCode,\n$homeNum,$handphoneNum,$email,$description;\n\tglobal $faID;\n\t\n\t$nric = preg_replace('/[^a-zA-Z0-9]/','',$nric);\n\t$firstName = preg_replace('/[^a-zA-Z0-9 ]/','',$firstName);\n\t$lastName = preg_replace('/[^a-zA-Z0-9 ]/','',$lastName);\n\t$dob = preg_replace('/[^0-9-]/','',$dob);\n\t$address1 = preg_replace('/[^a-zA-Z0-9 -_.,#]/','',$address1);\n\t$address2 = preg_replace('/[^a-zA-Z0-9 -_.,#]/','',$address2);\n\t$poCode = preg_replace('/[^0-9]/','',$poCode);\n\t$homeNum = preg_replace('/[^0-9]/','',$homeNum);\n\t$handphoneNum = preg_replace('/[^0-9]/','',$handphoneNum);\n\t$email = preg_replace('/[^a-zA-Z0-9@._-]/','',$email);\n\t$description = preg_replace('/[^a-zA-Z0-9 -_.,#]/','',$description);\n\t\n\t$faID = preg_replace('/[^0-9]/','',$faID);\n}", "public function templateStrings(){\n \n foreach($this->rules as $field => $rules){\n $array[$field] = array(\n 'rules' => $this->renderRules($field),\n 'value' => $this->value($field) \n );\n }\n \n $array['form_token'] = $this->renderToken();\n \n return $array;\n }", "protected function renderAttributes($values) {\n $valuesString = \"\";\n foreach ($values as $value) {\n $valuesString .= \"<li>\" . $this->renderValue($value) . \"</li>\";\n }\n\n return $valuesString;\n }", "function debug_var(...$values) { // \"...\" permet de regroupers tous les paramètres en un tableau ($values)\n var_dump(...$values); // \"...\" permet ici l'inverse, il split le tableau pour tout remonter au même niveau. équivalent de var_dump($values[0], $values[1], $values[2]);\n die(); // Stop le rendu PHP ici. Plus rien ne s'exécutera et le resultat est directement retourné à l'utilisateur\n}", "public function sanitize_general_options( $in ) {\n\n\t\t$out = array();\n\n\t\t// The actual tracking ID\n\t\tif ( preg_match( '#UA-[\\d-]+#', $in['code'], $matches ) )\n\t\t\t$out['code'] = $matches[0];\n\t\telse\n\t\t\t$out['code'] = '';\n\n\t\t$checkbox_items = array(\n\t\t\t\t// Additional items you can track\n\t\t\t\t'log_404s',\n\t\t\t\t'log_searches',\n\t\t\t\t'log_outgoing',\n\t\t\t\t// Things to ignore\n\t\t\t\t'ignore_admin_area',\n\t\t\t);\n\t\tglobal $wp_roles;\n\t\tforeach( $wp_roles->roles as $role => $role_info ) {\n\t\t\t$checkbox_items[] = 'ignore_role_' . $role;\n\t\t}\n\t\tforeach( $checkbox_items as $checkbox_item ) {\n\t\t\tif ( isset( $in[$checkbox_item] ) && 'true' == $in[$checkbox_item] )\n\t\t\t\t$out[$checkbox_item] = 'true';\n\t\t\telse\n\t\t\t\t$out[$checkbox_item] = 'false';\n\t\t}\n\n\t\t// Custom variables\n\t\tfor( $i = 1; $i <= 5; $i++ ) {\n\t\t\tforeach( array( 'name', 'value', 'scope' ) as $key ) {\n\t\t\t\tif ( isset( $in['custom_vars'][$i][$key] ) )\n\t\t\t\t\t$out['custom_vars'][$i][$key] = sanitize_text_field( $in['custom_vars'][$i][$key] );\n\t\t\t\telse\n\t\t\t\t\t$out['custom_vars'][$i][$key] = '';\n\t\t\t}\n\t\t}\n\n\t\treturn $out;\n\t}", "function _verify_user_values(&$values)\r\n\t{\r\n\t\tif ($this->_dumb_mode)\r\n\t\t{\r\n\t\t\treturn true;\r\n\t\t} \r\n\t\tforeach($values as $field => $value)\r\n\t\t{\r\n\t\t\tif (!isset($this->_params[$field]))\r\n\t\t\t{\n\t \tdebug :: write_error(NESE_ERROR_WRONG_MPARAM,\r\n\t \t\t __FILE__ . ' : ' . __LINE__ . ' : ' . __FUNCTION__, \n\t \t\t array('param' => $field)\r\n\t \t);\r\n\t\t\t\tunset($values[$field]);\r\n\t\t\t} \r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tif (in_array($this->_params[$field], $this->_required_params))\r\n\t\t\t\t{\n\t\t \tdebug :: write_error(NESE_ERROR_WRONG_MPARAM,\r\n\t\t \t\t __FILE__ . ' : ' . __LINE__ . ' : ' . __FUNCTION__, \n\t \t\t array('param is autogenerated and can\\'t be passed' => $field)\r\n\t\t \t);\r\n\r\n\t\t\t\t\tunset($values[$field]);\r\n\t\t\t\t} \r\n\t\t\t} \r\n\t\t} \r\n\t}", "function setValueByArray($a_values)\n\t{\n\t\t$this->setValue($a_values[$this->getPostVar()]);\n\t\tforeach($this->getOptions() as $option)\n\t\t{\n\t\t\tforeach($option->getSubItems() as $item)\n\t\t\t{\n\t\t\t\t$item->setValueByArray($a_values);\n\t\t\t}\n\t\t}\n\t}", "public function parameterize(array $values)\n {\n return implode(', ', array_map([$this, 'parameter'], $values));\n }", "protected function Analyze($aParamTypes = array())\n\t{\n\t\tif (!is_null($this->m_aPlaceholders)) return;\n\n\t\t$this->m_aPlaceholders = array();\n\t\tif (preg_match_all('/\\\\$([a-z0-9_]+(->[a-z0-9_]+)*)\\\\$/', $this->m_sRaw, $aMatches))\n\t\t{\n\t\t\tforeach($aMatches[1] as $sPlaceholder)\n\t\t\t{\n\t\t\t\t$oPlaceholder = new TemplateStringPlaceholder($sPlaceholder);\n\t\t\t\t$oPlaceholder->bIsValid = false;\n\t\t\t\tforeach ($aParamTypes as $sParamName => $sClass)\n\t\t\t\t{\n\t\t\t\t\t$sParamPrefix = $sParamName.'->';\n\t\t\t\t\tif (substr($sPlaceholder, 0, strlen($sParamPrefix)) == $sParamPrefix)\n\t\t\t\t\t{\n\t\t\t\t\t\t// Todo - detect functions (label...)\n\t\t\t\t\t\t$oPlaceholder->sFunction = '';\n\n\t\t\t\t\t\t$oPlaceholder->sParamName = $sParamName;\n\t\t\t\t\t\t$sAttcode = substr($sPlaceholder, strlen($sParamPrefix));\n\t\t\t\t\t\t$oPlaceholder->sAttcode = $sAttcode;\n\t\t\t\t\t\t$oPlaceholder->bIsValid = MetaModel::IsValidAttCode($sClass, $sAttcode, true /* extended */);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$this->m_aPlaceholders[] = $oPlaceholder;\n\t\t\t}\n\t\t}\n\t}", "private function generateSQLfromValuesInsert(array $values){\r\n //Initialisating vars\r\n $sql = \"(\";\r\n $params = array();\r\n \r\n //Processing values\r\n foreach($values as $name => $value){\r\n //We add a coma if it is not the first value\r\n $sql .= ((count($params) != 0) ? \", \" : \"\");\r\n \r\n //We add SQL for the name\r\n $sql .= $name;\r\n \r\n //Records the name parameters\r\n $params[] = $value;\r\n }\r\n \r\n //Continuing SQL\r\n $sql .= \") VALUES (\";\r\n \r\n //Adding ? for each value\r\n for($i = 0; $i<count($params); $i++){\r\n $sql .= ($i != 0 ? \", \" : \"\").\"?\";\r\n }\r\n \r\n //Finishing SQL\r\n $sql .= \") \";\r\n \r\n //Preparing return\r\n $return = array(\r\n \"sql\" => $sql,\r\n \"params\" => $params\r\n );\r\n \r\n //Returning values\r\n return $return;\r\n }", "protected function doDefaultGetTitles(array $values) {\n $vl = $this->getValueList();\n foreach (array_intersect_key($vl, array_flip(array_unique($values))) as $v => $c) {\n $res[$v] = $c;\n }\n return $res;\n }", "function Value($a){\n return new Parser(function($s) use($a){return new Maybe(new Tuple($s, $a));});\n }", "function _getTypeValue($type, $value)\n\t{\n\t\t$value = trim($value);\n\t\tif(!isset($value))\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\tswitch($type)\n\t\t{\n\t\t\tcase 'homepage' :\n\t\t\t\tif($value && !preg_match('/^([a-z]+):\\/\\//i', $value))\n\t\t\t\t{\n\t\t\t\t\t$value = 'http://' . $value;\n\t\t\t\t}\n\t\t\t\treturn htmlspecialchars($value, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);\n\n\t\t\tcase 'tel' :\n\t\t\t\tif(is_array($value))\n\t\t\t\t{\n\t\t\t\t\t$values = $value;\n\t\t\t\t}\n\t\t\t\telseif(strpos($value, '|@|') !== FALSE)\n\t\t\t\t{\n\t\t\t\t\t$values = explode('|@|', $value);\n\t\t\t\t}\n\t\t\t\telseif(strpos($value, ',') !== FALSE)\n\t\t\t\t{\n\t\t\t\t\t$values = explode(',', $value);\n\t\t\t\t}\n\n\t\t\t\t$values = array_values($values);\n\t\t\t\tfor($i = 0, $c = count($values); $i < $c; $i++)\n\t\t\t\t{\n\t\t\t\t\t$values[$i] = trim(htmlspecialchars($values[$i], ENT_COMPAT | ENT_HTML401, 'UTF-8', false));\n\t\t\t\t}\n\t\t\t\treturn $values;\n\n\t\t\tcase 'checkbox' :\n\t\t\tcase 'radio' :\n\t\t\tcase 'select' :\n\t\t\t\tif(is_array($value))\n\t\t\t\t{\n\t\t\t\t\t$values = $value;\n\t\t\t\t}\n\t\t\t\telseif(strpos($value, '|@|') !== FALSE)\n\t\t\t\t{\n\t\t\t\t\t$values = explode('|@|', $value);\n\t\t\t\t}\n\t\t\t\telseif(strpos($value, ',') !== FALSE)\n\t\t\t\t{\n\t\t\t\t\t$values = explode(',', $value);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$values = array($value);\n\t\t\t\t}\n\n\t\t\t\t$values = array_values($values);\n\t\t\t\tfor($i = 0, $c = count($values); $i < $c; $i++)\n\t\t\t\t{\n\t\t\t\t\t$values[$i] = trim(htmlspecialchars($values[$i], ENT_COMPAT | ENT_HTML401, 'UTF-8', false));\n\t\t\t\t}\n\t\t\t\treturn $values;\n\n\t\t\tcase 'kr_zip' :\n\t\t\t\tif(is_array($value))\n\t\t\t\t{\n\t\t\t\t\t$values = $value;\n\t\t\t\t}\n\t\t\t\telseif(strpos($value, '|@|') !== false)\n\t\t\t\t{\n\t\t\t\t\t$values = explode('|@|', $value);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$values = array($value);\n\t\t\t\t}\n\n\t\t\t\t$values = array_values($values);\n\t\t\t\tfor($i = 0, $c = count($values); $i < $c; $i++)\n\t\t\t\t{\n\t\t\t\t\t$values[$i] = trim(htmlspecialchars($values[$i], ENT_COMPAT | ENT_HTML401, 'UTF-8', false));\n\t\t\t\t}\n\t\t\t\treturn $values;\n\n\t\t\t//case 'date' :\n\t\t\t//case 'email_address' :\n\t\t\t//case 'text' :\n\t\t\t//case 'textarea' :\n\t\t\tdefault :\n\t\t\t\treturn htmlspecialchars($value, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);\n\t\t}\n\t}", "public function get_var_values_html($vtype)\n {\n $var_vals_html='';\n\n // output the vals if there are any set\n // else output no vals and message\n if (isset($vtype['vals']))\n {\n foreach ($vtype['vals'] as $val)\n {\n // count used\n $used=$this->count_used($val['var_value_id']);\n\n // colour row for active\n if ($used>0 or\n ('pack of'==$vtype['var_type_name'] &&\n 1==$val['var_value']))\n {\n $row_colour=' light_blue ';\n }\n else\n {\n $row_colour=' light_grey ';\n }\n\n // ids and stuff for js\n $var_vals_html.=\"<div id='\".$val['var_value_id'].\"' class='vtv_row \".$row_colour.\"'>\";\n $var_vals_html.=\"<span class='vtv_name'>\".$val['var_value'].\"</span>\";\n\n // pack of one can't be deleted, effects system and all items must have a positive integer pack of value\n if ('pack of'==$vtype['var_type_name'] &&\n 1==$val['var_value'])\n {\n $var_vals_html.=\"<span class='vtv_block'>required</span>\";\n }\n else\n {\n // add remove button for all others\n if (0==$used)\n {\n $var_vals_html.=\"<span class='vtv_remove' onclick='remove_vvalue(\".$val['var_value_id'].\")'>remove</span>\";\n }\n else\n {\n $var_vals_html.=\"<span class='vtv_block'>used \".$used.\" times</span>\";\n }\n }\n\n $var_vals_html.=\"</div>\";\n }\n }\n else\n {\n $var_vals_html.=\"<div class='vtype_val_row'>\";\n $var_vals_html.=\"no values set - you will be asked to create these manually when using this variation on a product <span class='strong'> - it is strongly advised that you create all values for a variation if there is a finite number of values</span>\";\n $var_vals_html.=\"</div>\";\n }\n\n return $var_vals_html;\n }", "public function render($values) {\n if (isset($values->{$this->field})) {\n $holding = '';\n foreach ($values->{$this->field} as $h) {\n $holding .= $this->prepareHolding($h);\n }\n //dpm($holding);\n return $holding;\n //return $this->themeHolding($tempHolding);\n }\n }", "function clean_value( $t )\n\t{\n\t\treturn $this->parse_clean_value( $t );\n\t}", "protected function formatAddValues($request_values)\n {\n // Step 1: Strip the $request_values with the db_dir_ prefix.\n $addValues = stripPrefix(\"db_dir_\", $request_values);\n\n print_r($addValues);\n }", "public function removeValuesFromOutputArray(){\n\t\ttry{\n\t\t\t$this->filteredOutput = array();\n\t\t} catch (Exception $e) {\n\t\t\terror_log($e->getMessage(),3,\"/var/tmp/error.log\");\n\t\t\terror_log(\"\\n\");\n\t\t}\n\t}", "function getInputValues();", "private function validateValues($values)\n {\n $errors = [];\n \n if (strpos($values['human_name'], ' ')) {\n $errors['human_name'] = [t('Please, do not use spaces.')];\n }\n \n if (strpos($values['human_name'], '.')) {\n $errors['human_name'] = [t('Please, do not use periods.')];\n }\n \n if ($values['human_name'] == '') {\n $errors['human_name'] = [t('This cannot be empty.')];\n }\n\n if ($values['data_type'] == '') {\n $errors['data_type'] = [t('You need to select an option.')];\n }\n\n if ($values['attached_to'] == '') {\n $errors['attached_to'] = [t('You need to select an option.')];\n }\n\n return empty($errors) ? false : $errors;\n }", "function getTitles(array $values) {\n $res = array();\n $todo = $values;\n $vv = $this->valueList? $this->valueList : $this->cachedValueList;\n if (is_array($vv)) {\n $res = array_intersect_key($vv, array_flip(array_unique($values)));\n $todo = array_diff($todo, array_keys($res));\n }\n if ($todo) { // still have something to do\n if ($this->getTitles) {\n $res = $this->callGetter($this->getCaption, $todo);\n if (is_array($res)) \n foreach ($res as $v => $c)\n $res[$v] = $c;\n } else {\n $res = $this->doDefaultGetTitles($values);\n }\n }\n return $res;\n }", "function get_var($value) {\n\t\tglobal $agi;\n\n\t\t$r = $agi->get_variable( $value );\n\t\tif ($r['result'] == 1) {\n\t\t\t$result = $r['data'];\n\t\t\treturn trim($result);\n\t\t}\n\t\treturn '';\n\t}", "function parseParameterValues($source) {\n\t$parameterValues = array();\n\t$parameter = preg_split(\"/<br>/\", $source); // get array from the source string\n\t\n\tfor ($i = 0; $i < count($parameter); $i++) {\n\t\t$parameter[$i] = preg_replace(\"/(<p)+[^<]+/\", \"\", $parameter[$i]); // rip off <p> tag\n\t\t$parameter[$i] = preg_replace(\"/<\\/p>/\", \"\", $parameter[$i]); // rip of </p> tag\n\t\t$list = preg_split(\"/=/\", $parameter[$i]);\n\t\t$paramName = $list[0]; // get parameter name\n\t\t$paramVal = $list[1]; // get parameter value\n\t\t\n\t\tif ($paramName != \"class\" && $paramName != \"method\" && $paramName != \"delay\" && $paramName != null) {\n\t\t\tarray_push($parameterValues, $paramVal); // push to the parameter value array;\n\t\t}\n\t}\n\t\n\tif (count($parameterValues) > 0) {\n\t\t$result = \"<param name=\\\"information\\\">\". join($parameterValues, \"^\") . \"</param>\"; // create parameter value string\n\t}\n\t\n\t/*\n\tforeach ($parameter as $item) {\n\t\techo $item;exit;\n\t\t\n\t\t\n\t\t$list = preg_split(\"/=/\", $item);\n\t\t$paramName = $list[0]; // get parameter name\n\t\t$paramVal = $list[1]; // get parameter value\n\t\t\n\t\tif (sizeof($parameter) > 0) {\n\t\t\t$result = $result;\n\t\t}\n\t\t\n\t\tif ($paramName != \"class\" && $paramName != \"method\") { // filter out non-parameter name\n\t\t\t\n\t\t}\n\t}*/\n\treturn $result;\n}", "private function PlainValue()\n\t{\n\t\tif ( $this->lexer->isNextToken( DocLexer::T_OPEN_CURLY_BRACES ) )\n\t\t\treturn $this->Arrayx();\n\n\t\tif ( $this->lexer->isNextToken( DocLexer::T_AT ) )\n\t\t\treturn $this->Annotation();\n\n\t\tif ( $this->lexer->isNextToken( DocLexer::T_IDENTIFIER ) )\n\t\t\treturn $this->Constant();\n\n\t\tswitch ( $this->lexer->lookahead['type'] )\n\t\t{\n\t\t\tcase DocLexer::T_STRING:\n\t\t\t\t$this->match( DocLexer::T_STRING );\n\n\t\t\t\treturn $this->lexer->token['value'];\n\n\t\t\tcase DocLexer::T_INTEGER:\n\t\t\t\t$this->match( DocLexer::T_INTEGER );\n\n\t\t\t\treturn (int) $this->lexer->token['value'];\n\n\t\t\tcase DocLexer::T_FLOAT:\n\t\t\t\t$this->match( DocLexer::T_FLOAT );\n\n\t\t\t\treturn (float) $this->lexer->token['value'];\n\n\t\t\tcase DocLexer::T_TRUE:\n\t\t\t\t$this->match( DocLexer::T_TRUE );\n\n\t\t\t\treturn true;\n\n\t\t\tcase DocLexer::T_FALSE:\n\t\t\t\t$this->match( DocLexer::T_FALSE );\n\n\t\t\t\treturn false;\n\n\t\t\tcase DocLexer::T_NULL:\n\t\t\t\t$this->match( DocLexer::T_NULL );\n\n\t\t\t\treturn null;\n\n\t\t\tdefault:\n\t\t\t\t$this->syntaxError( 'PlainValue' );\n\t\t}\n\n\t\treturn null;\n\t}", "function process_str_vars($params = array())\n\t{\n\t\tglobal $HTTP_POST_VARS, $HTTP_GET_VARS;\n\n\t\twhile( list($var, $param) = @each($params) )\n\t\t{\n\t\t\tif (!empty($HTTP_POST_VARS[$param]))\n\t\t\t{\n\t\t\t\t$data[$param] = str_replace(\"\\'\", \"''\", trim(htmlspecialchars($HTTP_POST_VARS[$param])));\n\t\t\t}\n\t\t\telse if (!empty($HTTP_GET_VARS[$param]))\n\t\t\t{\n\t\t\t\t$data[$param] = str_replace(\"\\'\", \"''\", trim(htmlspecialchars($HTTP_GET_VARS[$param])));\n\t\t\t}\n\t\t}\n\n\t\treturn $data;\n\t}", "function variable_fields()\n\t{\n\t\t$vf=$this->variable_fields;\n\n\t\tif (!is_array($vf))\n\t\t{\n\t\t\t//default search field if nothing is selected\n\t\t\treturn array('labl,qstn,catgry');\n\t\t}\n\n\t\t$tmp=NULL;\n\t\tforeach($vf as $field)\n\t\t{\n\t\t\tif (in_array($field,$this->variable_allowed_fields))\n\t\t\t{\n\t\t\t\t$tmp[]=$field;\n\t\t\t}\n\t\t}\n\n\t\t//no allowed fields found\n\t\tif ($tmp==NULL)\n\t\t{\n\t\t\treturn array('labl');\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn $tmp;\n\t\t}\n\t}", "protected function processVariables(&$variables) {\n return $variables;\n }" ]
[ "0.56271833", "0.5432591", "0.5308974", "0.53080565", "0.52840567", "0.52703094", "0.5217226", "0.5171367", "0.5107846", "0.5102583", "0.5042541", "0.50354445", "0.4871941", "0.48659888", "0.48606753", "0.48368618", "0.4802709", "0.477587", "0.47578275", "0.47525573", "0.47336787", "0.472051", "0.47119433", "0.46569932", "0.46335006", "0.46322998", "0.46277222", "0.46255016", "0.4615182", "0.45981467", "0.45961404", "0.4588463", "0.45873922", "0.45867467", "0.45860603", "0.4579064", "0.45656744", "0.45532393", "0.45439222", "0.45328224", "0.45324707", "0.4532086", "0.45202535", "0.4516831", "0.45118144", "0.44896185", "0.44730094", "0.44595402", "0.44577214", "0.4448209", "0.44318083", "0.44189185", "0.44126618", "0.43909928", "0.43818265", "0.4380893", "0.43763906", "0.43653756", "0.43643832", "0.43641227", "0.43623877", "0.4359973", "0.4359597", "0.4353978", "0.43516204", "0.43476558", "0.4340659", "0.433714", "0.4336265", "0.43359032", "0.43153602", "0.43049088", "0.42939642", "0.42827904", "0.4279976", "0.42747465", "0.4273543", "0.427188", "0.4271798", "0.42625806", "0.4255385", "0.4254867", "0.42524093", "0.4250136", "0.4230797", "0.42234424", "0.42153305", "0.42140052", "0.42094323", "0.41921628", "0.41849488", "0.4184485", "0.41808918", "0.41793016", "0.41769874", "0.41760594", "0.4175222", "0.4173904", "0.41738278", "0.41693312" ]
0.6571655
0
Get the URL for sending to the CRM.
function GetCRMURL($spec,$vars,$url) { $bad = false; $list = explode(",",$spec); $map = array(); for ($ii = 0 ; $ii < count($list) ; $ii++) { $name = $list[$ii]; if ($name) { // // the specification must be in this format: // form-field-name:CRM-field-name // if (($i_crm_name_pos = strpos($name,":")) > 0) { $s_crm_name = substr($name,$i_crm_name_pos + 1); $name = substr($name,0,$i_crm_name_pos); if (isset($vars[$name])) { $map[] = $s_crm_name."=".urlencode($vars[$name]); $map[] = "Orig_".$s_crm_name."=".urlencode($name); } } else { // // not the right format, so just include as a parameter // check for name=value format to choose encoding // $a_values = explode("=",$name); if (count($a_values) > 1) $map[] = urlencode($a_values[0])."=".urlencode($a_values[1]); else $map[] = urlencode($a_values[0]); } } } if (count($map) == 0) return (""); if (strpos($url,'?') === false) // append ? if not present $url .= '?'; return ($url.implode("&",$map)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getUrl() {\n\t\t$this->getRublon()->log(__METHOD__);\n\t\treturn $this->getRublon()->getAPIDomain() .\n\t\t\tself::URL_PATH_CODE .\n\t\t\turlencode($this->getUrlParamsString());\n\t}", "protected function _getFormUrl() {\n $params = array();\n if (Mage::app()->getStore()->isCurrentlySecure()) {\n // Modern browsers require the Ajax request protocol to match the protocol used for initial request,\n // so force Magento to generate a secure URL if the request was secure.\n $params['_forced_secure'] = true;\n }\n return $this->getUrl('cloudiq/callme/request', $params);\n }", "public function getUrl() {\n\t\treturn sprintf(self::ENDPOINT, $this->_account);\n\t}", "public function getURL()\n\t{\n $url = $this->_internal_request->get_normalized_http_url();\n \n if ( $this->getMethod() == KHttpRequest::GET ) \n {\n $url = $this->_internal_request->to_url();\n }\n \n\t\treturn $url;\n\t}", "public function getProviderRequestUrl() {\n \n $api = \"http://www.eworldbd.com/sms/sendsms.aspx?\";\n $api .= \"username=\".$this->_username;\n $api .= \"&password=\".$this->_password;\n $api .= \"&mobileNo=88\".$this->_mobileNumber;\n $api .= \"&Masking=\".urlencode($this->_subject);\n $api .= \"&SMS=\".urlencode($this->_message);\n \n return $api;\n }", "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 }", "public function getURL() {\n return $this->apiURL . $this->endPoint . $this->storeID . $this->jsonFile;\n }", "public function returnUrl(): string\n {\n return Request::url() . '?' . http_build_query([\n 'return' => 'return',\n 'oc-mall_payment_id' => $this->getPaymentId(),\n ]);\n }", "public function getReturnUrl() {\n return Url::fromRoute('entity.commerce_order.edit_form', ['commerce_order' => $this->order->id()]);\n }", "public function getToUrl()\n {\n\n return $this->toUrl;\n\n }", "public function getURL() {\n $defaultPorts= array(\n 'http' => 80,\n 'https' => 443\n );\n \n // Determine which settings we need to pass\n $xsr= array();\n if (\n ($this->getProduct() != $this->getDefaultProduct()) ||\n ($this->getLanguage() != $this->getDefaultLanguage())\n ) {\n $xsr[]= $this->getProduct();\n $xsr[]= $this->getLanguage();\n }\n if ($this->getSessionId()) $xsr[]= 'psessionid='.$this->getSessionId();\n\n $port= '';\n if (\n $this->getPort() &&\n (!isset($defaultPorts[$this->getScheme()]) ||\n $this->getPort() != $defaultPorts[$this->getScheme()])\n ) {\n $port= ':'.$this->getPort();\n }\n\n\n return sprintf(\n '%s://%s%s/xml/%s%s%s%s',\n $this->getScheme(),\n $this->getHost(),\n $port,\n (sizeof($xsr) ? implode('.', $xsr).'/' : ''),\n $this->getStateName(), \n $this->getQuery() ? '?'.$this->getQuery() : '',\n $this->getFragment() ? '#'.$this->getFragment() : ''\n );\n }", "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()\n {\n $httpRequest = $this->httpClient->get($this->getEndpoint() . '?' . http_build_query($this->getData(), '', '&'));\n return $httpRequest->getUrl();\n }", "public function getRequestURL() {\n\t\t$scheme = $this->getScheme();\n\t\t$port = $this->getServerPort();\n\t\t$url = $scheme . '://';\n\t\t$url .= $this->getServerName();\n\t\tif(($scheme == 'http' && $port != 80) || ($scheme == 'https' && $port != 443)) {\n\t\t\t$url .= ':' . $port;\n\t\t}\n\t\t$url .= $this->getRequestURI();\n\t\treturn $url;\n\t}", "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 to_url()\n {\n $post_data = $this->to_postdata();\n $out = $this->get_http_url();\n if ($post_data) {\n $out .= '?'.$post_data;\n }\n\n return $out;\n }", "public function url()\r\n {\r\n return $this->get_base_url() . http_build_query($this->get_query_params());\r\n }", "function getEditUrl()\r\n\t{\r\n\t\tglobal $config;\r\n\r\n\t\t// need full url for links placed inside email messages\r\n\t\t$link = \"http://\". $config[\"http_host\"] . \"/survey_response_form?survey_id={$this->survey_id}\";\r\n\t\tif($this->token)\r\n\t\t\t$link .= \"&token={$this->token}\";\r\n\t\t\t\r\n\t\treturn $link;\r\n\t}", "public function getOtranCeUrl()\n {\n return oxRegistry::getConfig()->getConfigParam('sOtcServerUrl');\n }", "public function getUrl()\n {\n $url = $params = '';\n $url .= $this->getProtocol() . '://' . self::EBAY_HOST . self::EBAY_URI . '?';\n foreach ($this->getParams() as $name => $value) {\n $params .= '&' . $name . '=' . urlencode($value);\n }\n\n return $url . substr($params, 1);\n }", "function getUrl() {\n \treturn assemble_url('admin_settings_email_template', array(\n \t 'module_name' => $this->getModule(),\n 'template_name' => $this->getName(),\n \t));\n }", "public function getUrl()\n {\n return $this->createUrl();\n }", "public function getURL(): string\n {\n return $this->http->getURL();\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}", "public function getAccountURL()\n {\n return $this->config['account_url'];\n }", "public function getFetchUrl()\n {\n return $this->getUrl(\"afbt/fetch/index\");\n }", "public function getAccountUrl()\n {\n return $this->accountUrl;\n }", "public function getRequestUrl() {\n\t}", "public function getUri()\n {\n return $this->getUrl();\n }", "protected function getFetchUrl() {\n $url = 'sites/' . $this->site->get('id') . '/authorizations';\n return $url;\n }", "protected function getAPICustomerClubAddAndSendUrl()\n {\n return \"api/CustomerClub/AddContactAndSend\";\n }", "public function getPostUrl()\n {\n return Util::getLinkHref($this->xml, 'http://schemas.google.com/g/2005#post');\n }", "public function getUrl() {\n return $this->_gatewayRedirect->getUrl ();\n }", "public function getUrl()\n {\n return trim(implode('/', $this->path), '/').$this->getParams();\n }", "public function getRemoteUrl();", "public function getUrl ()\n {\n $url = $this->_config['formAction'] . '?';\n \n foreach ($this->_params as $key => $value) {\n if ($value != '') {\n $url .= $key . '=' . $value . '&';\n }\n }\n \n $url .= 'SHASign=' . $this->getSha1Sign();\n \n return $url;\n }", "public function getSaveUrl()\n {\n return $this->getUrl('connector/customer/newsletter');\n }", "public function get_url(): string\n {\n return $this->get_url_internal();\n }", "public function getBaseUrl() {\n\t\treturn $this->settings['npo_api_url'];\n\t}", "public static function generateURL()\n {\n return $_SERVER['REQUEST_SCHEME'].'://'.$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'];\n }", "public function toUrl()\n {\n $postData = $this->toPostdata();\n $out = $this->getNormalizedHttpUrl();\n if ($postData) {\n $out .= '?'.$postPata;\n }\n return $out;\n }", "public function getURL() {\n\t\treturn $this->urlStub() .'/' . $this->publicContainer .'/' . $this->getId();\n\t}", "public function url()\r\t{\r\t\treturn 'http://morningpages.net/mail/show/'.$this->token;\r\t\t//return url::site('mail/show/' . $this->token, 'http');\r\t}", "public function getUri()\n {\n return 'https://'.$this->getAuth().'@'.self::BASE_URI.'/v1/';\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 getAPIMessageSendUrl()\n {\n return \"api/MessageSend\";\n }", "public function getRechargeUrl()\n {\n return $this->get(self::_RECHARGE_URL);\n }", "public function to_url() {\n $post_data = $this->to_postdata();\n $out = $this->get_normalized_http_url();\n if ($post_data) {\n $out .= '?'.$post_data;\n }\n return $out;\n }", "public function getEvoBaseUrl()\n\t{\n\t\tMage::log(\" --- Snap* Hosted Payments API : getEvoBaseUrl --- \");\n\t\t$bTestMode = $this->getConfigData('test_mode');\n\t\treturn ($bTestMode ? $this->_merchantCheckoutURLTest : $this->_merchantCheckoutURL);\n\t}", "function getSendWelcomeMessageUrl() {\n return assemble_url('people_company_user_send_welcome_message', array(\n 'company_id' => $this->getCompanyId(),\n 'user_id' => $this->getId(),\n ));\n }", "public function getURL(): string\n {\n return $this->url.$this->apiVersion.'/';\n }", "protected function buildUrl()\n {\n $basePath = env('SLACK_API_HOST');\n $postUri = \"chat.postMessage\";\n $this->url = $basePath . $postUri;\n }", "abstract public function getCallUrl();", "public function getUrl(): string\n {\n $query = $this->getQuery();\n return\n $this->getScheme() .\n '://' .\n $this->getHostAndPort() .\n $this->getRoot() .\n $this->getPath() .\n (!empty($query) ? '?' . http_build_query($query) : '');\n }", "public function url()\n\t{\n\t\treturn ($this->secure() ? 'https' : 'http') . '//' . $this->domainName() . $this->uri();\n\t}", "public function getGetUrl()\n {\n $scheme = empty($this->rowUrl[\"scheme\"]) ? \"http://\" : $this->rowUrl[\"scheme\"] . \"://\";\n\n $user = empty($this->rowUrl[\"user\"]) ? \"\" : $this->rowUrl[\"user\"];\n $pass = empty($this->rowUrl[\"pass\"]) ? \"\" : $this->rowUrl[\"pass\"];\n\n if (!empty($pass)) $user .= \":\";\n if (!empty($user) || !empty($pass)) $pass .= \"@\";\n\n $host = $this->rowUrl[\"host\"];\n $port = empty($this->rowUrl[\"port\"]) ? \"\" : \":\" . $this->rowUrl[\"port\"];\n\n $path = empty($this->rowUrl[\"path\"]) ? \"\" : $this->rowUrl[\"path\"];\n\n $urlquery = \"\";\n if (count($this->getParams) > 0)\n {\n $urlquery = \"?\" . http_build_query($this->getParams);\n }\n return $scheme . $user . $pass . $host . $port . $path . $urlquery;\n }", "protected function getRedirectUrl()\n {\n $sBaseUrl = Registry::getConfig()->getCurrentShopUrl().'index.php?cl=order&fnc=handleMollieReturn';\n\n return $sBaseUrl.$this->mollieGetAdditionalParameters();\n }", "public function getRequestUrl()\r\n {\r\n return $this->request_url;\r\n }", "public function GetFetchURL();", "public function getReturnUrl()\n {\n return Mage::getUrl('payulite/processing/return', array('_secure' => true, 'order' => '{{ORDER_ID}}'));\n }", "public function getUrl()\n\t{\n\t\treturn '/akce/' . $this->getActionId();\n\t}", "public function get_url();", "private function getTalkURI()\n {\n $url = $this->getInput('url');\n return $url;\n }", "public function generateUrl(){\n if(($this->getGetMethodResult('task') != null) && ($this->getGetMethodResult('action') != null)) {\n $urlFromArray = [];\n\n foreach ($this->getMethodUrlPathArray() as $key => $value) {\n if (is_array($value)) {\n foreach ($value as $argsKey => $argsValue) {\n $urlFromArray[] = $argsKey . '=' . $argsValue;\n }\n } else {\n $urlFromArray[] = $key . '=' . $value;\n }\n }\n return implode('&', $urlFromArray);\n }\n else{\n return null;\n }\n }", "public function getReturnUrl()\n {\n return $this->_urlBuilder->getUrl('dilmah_payments/ntb/return');\n }", "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 }", "public function get_url()\n {\n }", "public function getUrl() {\n return $this->get(self::URL);\n }", "public function getUrl()\n {\n $uri = $this->getHost();\n\n $server = provider::access('server');\n\n if ($server->isExist('PHP_SELF') && $server->isExist('REQUEST_URI') && $server->isValid('REQUEST_URI', validate::T_PRINTABLE)) {\n // for 'good' servers\n $uri .= $server->getValue('REQUEST_URI');\n } else {\n // for IIS\n if ($server->isValid('SCRIPT_NAME', validate::T_PRINTABLE)) {\n $uri .= $server->getValue('SCRIPT_NAME');\n }\n\n if ($server->isValid('QUERY_STRING', validate::T_PRINTABLE)) {\n $uri .= '?' . $server->getValue('QUERY_STRING');\n }\n }\n\n return $uri;\n }", "public function getURL();", "public function getURL();", "static function obtenerUrlActual() {\n $url = Util::crearUrl($_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);\n return $url;\n }", "public function getRedirectUrl()\n {\n return $this->request->getTestMode()\n ? 'https://sslpayment.cathaybkdev.com.tw/EPOSService/Payment/OrderInitial.aspx'\n : 'https://sslpayment.uwccb.com.tw/EPOSService/Payment/OrderInitial.aspx';\n }", "public function getCreateTaskUrl()\n\t{\n\t\t$calendarModuleModel = Vtiger_Module_Model::getInstance('Calendar');\n\t\treturn $calendarModuleModel->getCreateTaskRecordUrl() . '&link=' . $this->getId();\n\t}", "public function getURL ();", "public function to_url()\n {\n $out = $this->get_normalized_http_url() . \"?\";\n $out .= $this->to_postdata();\n return $out;\n }", "public function getRequestUrl()\n {\n return $this->getRequest()->getRequestUrl();\n }", "protected function getFetchUrl() {\n $url = sprintf(\n 'sites/%s/environments/%s/hostnames?hydrate=%s',\n $this->environment->site->get('id'),\n $this->environment->get('id'),\n $this->hydrate\n );\n return $url;\n }", "public function url()\n\t{\n\t\treturn Url::to($this->id);\n\t}", "public function getCreateEventUrl()\n\t{\n\t\t$calendarModuleModel = Vtiger_Module_Model::getInstance('Calendar');\n\t\treturn $calendarModuleModel->getCreateEventRecordUrl() . '&link=' . $this->getId();\n\t}", "public function get_url () {\r\n\t\treturn $this->url;\r\n\t}", "public function getWebhookUrl()\n\t{\n\t\t// TODO check loalhost\n\t\treturn 'http://'.$_SERVER['HTTP_HOST'].$this->getServiceLocator()->get('viewHelperManager')->get('url')->__invoke('hooks');\n\t}", "public function url()\n {\n return $this->factory->getUrl($this->handle);\n }", "public function get_url() {\n\t\treturn $this->url;\n\t}", "public function get_url() {\n\t\treturn $this->url;\n\t}", "public static function getURL() {\n $url = self::getHost() . $_SERVER['REQUEST_URI'];\n return $url;\n }", "public function getUrl()\n {\n return $this->_urlBuilder->getUrl();\n }", "public function getSaveUrl()\n {\n return $this->getUrl('connector/customer_newsletter/save');\n }", "public function getWholesalePostActionUrl()\n {\n return $this->helper('customer')->getWholesaleRegisterPostUrl();\n }", "public function get_url()\n {\n return $this->url;\n }", "public function getUrl(){\n return $this->server->getUrl() . \"/\" . $this->name;\n \n }", "public function getServerUrl() {\n return $this->conn->getServerUrl();\n }", "public static function url()\n {\n return base_url(static::action());\n }", "public function getApiUrl() \n {\n return ( $this->getSSL() ? 'https://' : 'http://' ) . $this->_api_url;\n }", "protected function getFetchUrl() {\n $url = 'users/' . $this->user->id . '/instruments';\n return $url;\n }", "public function returnUrl() {\n return $this->url;\n }", "public function getOkUrl()\n {\n return $this->url('./receipt');\n }", "public function getEndPointURL()\n {\n return $this->isSandboxMode() ? $this->getTestEndPointURL() : $this->getProductionEndPointURL();\n }", "public function getURL() {\n\n\t\t$url = \"\";\n\t\t$type = $this->getType();\n\t\t$subtype = $this->getSubtype();\n\n\t\t// @todo remove when elgg_register_extender_url_handler() has been removed\n\t\tif ($this->id) {\n\t\t\tglobal $CONFIG;\n\n\t\t\t$function = \"\";\n\t\t\tif (isset($CONFIG->extender_url_handler[$type][$subtype])) {\n\t\t\t\t$function = $CONFIG->extender_url_handler[$type][$subtype];\n\t\t\t}\n\t\t\tif (isset($CONFIG->extender_url_handler[$type]['all'])) {\n\t\t\t\t$function = $CONFIG->extender_url_handler[$type]['all'];\n\t\t\t}\n\t\t\tif (isset($CONFIG->extender_url_handler['all']['all'])) {\n\t\t\t\t$function = $CONFIG->extender_url_handler['all']['all'];\n\t\t\t}\n\t\t\tif (is_callable($function)) {\n\t\t\t\t$url = call_user_func($function, $extender);\n\t\t\t}\n\n\t\t\tif ($url) {\n\t\t\t\t$url = elgg_normalize_url($url);\n\t\t\t}\n\t\t}\n\n\t\t$params = array('extender' => $this);\n\t\t$url = elgg_trigger_plugin_hook('extender:url', $type, $params, $url);\n\n\t\treturn elgg_normalize_url($url);\n\t}", "private function getPath() {\n return '%2F' . urlencode($this->source) . '%2F' . urlencode($this->campaign) .'%2F' . urlencode($this->content);\n }", "function getRequestUrl() {\n\t\treturn $this->requestUrl;\n\t}" ]
[ "0.71208656", "0.69977653", "0.69601417", "0.6939996", "0.6876737", "0.68319404", "0.6781702", "0.6756075", "0.67540276", "0.6738909", "0.6705746", "0.6684381", "0.66823107", "0.66500694", "0.66366607", "0.66364133", "0.6636376", "0.6621921", "0.66189754", "0.6610788", "0.66069245", "0.6592439", "0.65877914", "0.6579321", "0.6577585", "0.6560386", "0.6551466", "0.65488744", "0.65101826", "0.6500083", "0.6498883", "0.6497392", "0.64826006", "0.6468509", "0.64674556", "0.64659625", "0.64614284", "0.64607763", "0.6458922", "0.64552605", "0.6454745", "0.6447848", "0.6444367", "0.6437719", "0.6437602", "0.6423251", "0.64232475", "0.6413388", "0.64079976", "0.6394204", "0.63904244", "0.63895905", "0.638942", "0.6389411", "0.63816184", "0.6381315", "0.63773894", "0.6368289", "0.6367312", "0.6362006", "0.63585144", "0.63576865", "0.63564223", "0.6355801", "0.63545555", "0.6354338", "0.635291", "0.63462734", "0.63459206", "0.6341653", "0.6341653", "0.63384265", "0.633608", "0.63304293", "0.63261503", "0.63198847", "0.63052326", "0.629681", "0.6295283", "0.6291568", "0.6290656", "0.62879455", "0.6277081", "0.6275478", "0.6275478", "0.6273179", "0.6267174", "0.6262536", "0.62570584", "0.62511116", "0.62509924", "0.6248358", "0.62469757", "0.6246491", "0.62444264", "0.6242212", "0.623725", "0.6232625", "0.6224283", "0.62240183", "0.6222625" ]
0.0
-1
strip the HTML from a string
function StripHTML($s_str,$s_line_feed = "\n") { // // strip HTML comments (s option means include new lines in matches) // $s_str = preg_replace('/<!--([^-]*([^-]|-([^-]|-[^>])))*-->/s','',$s_str); // // strip any scripts (i option means case-insensitive) // $s_str = preg_replace('/<script[^>]*?>.*?<\/script[^>]*?>/si','',$s_str); // // replace paragraphs with new lines (line feeds) // $s_str = preg_replace('/<p[^>]*?>/i',$s_line_feed,$s_str); // // replace breaks with new lines (line feeds) // $s_str = preg_replace('/<br[[:space:]]*\/?[[:space:]]*>/i',$s_line_feed,$s_str); // // overcome this bug: http://bugs.php.net/bug.php?id=21311 // $s_str = preg_replace('/<![^>]*>/s','',$s_str); // // get rid of all HTML tags // $s_str = strip_tags($s_str); return ($s_str); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function removeHtml($string)\n\t{\n\t\t$string=trim($string);\n\t\t$string= html_entity_decode($string);\n\t\t$string=strip_tags($string);\n\n\t\treturn $string;\n\t}", "public static function stripHtml($string) {\n $string = strip_tags($string);\n $string = htmlspecialchars($string);\n return $string;\n }", "public static function stripHtml($string)\n {\n $strippedCss = preg_replace('/<style.*<\\/style>/s', '', $string);\n $strippedJs = preg_replace('/<script.*<\\/script>/s', '', $strippedCss);\n $removedOneLineTags = preg_replace(\"/<[^>\\n]*>/mu\", '', $strippedJs);\n $removedMultiLineTags = preg_replace(\"/<a [^>]*?>/s\", '', $removedOneLineTags);\n return $removedMultiLineTags;\n }", "function strip_html_tags($str){\n $str = preg_replace('/(<|>)\\1{2}/is', '', $str);\n $str = preg_replace(\n array(// Remove invisible content\n '@<head[^>]*?>.*?</head>@siu',\n '@<style[^>]*?>.*?</style>@siu',\n '@<script[^>]*?.*?</script>@siu',\n '@<noscript[^>]*?.*?</noscript>@siu',\n ),\n \"\", //replace above with nothing\n $str );\n $str = replaceWhitespace($str);\n $str = strip_tags($str);\n return $str;\n}", "static function strip_html_tags($string){\n return preg_replace(array('/\\<(script)(.+)>/i', '/\\<(.+)(script)>/i', '/\\<(style)(.+)>/i', '/\\<(.+)(style)>/i'), '', $string);\n }", "function _cut_html($str) {\n $str=preg_replace(\"'<[\\/\\!]*?[^<>]*?>'si\",\"\",$str);\n return $str;\n }", "public static function removeHTML(string $string): string\n {\n return html_entity_decode(strip_tags($string), ENT_QUOTES | ENT_HTML5, 'utf-8');\n }", "public static function strip_html($text) {\n $search = array('@<script[^>]*?>.*?</script>@si', // Strip out javascript\n '@<style[^>]*?>.*?</style>@siU', // Strip style tags properly\n '@<![\\\\s\\\\S]*?--[ \\\\t\\\\n\\\\r]*>@', // Strip multi-line comments including CDATA\n '@<[\\\\/\\\\!]*?[^<>]*?>@si', // Strip out HTML tags\n '@&nbsp;@', // Strip space\n '@\\s+@', // change wrap or break space\n );\n $text = preg_replace($search, ' ', $text);\n $text = strip_tags($text);\n $text = trim($text);\n return $text;\n }", "function sacar_html($str) {\r\n$allowed = \"<br>,<b>,<i>,<u>\";\r\nreturn strip_tags($str,$allowed);\r\n}", "function strip_all($str) {\n return safehtml(strip_tags($str));\n}", "function stripcleantohtml($s) {\n\t// Also strips any <html> tags it may encouter\n\t// Use: Anything that shouldn't contain html (pretty much everything that is not a textarea)\n\treturn htmlentities(trim(strip_tags(stripslashes($s))), ENT_NOQUOTES, \"UTF-8\");\n}", "public static function trim_html($string = '')\n\t\t{\n\t\t\t$whitespace = '&nbsp;|\\<br\\>|\\<br\\s*\\/\\>|\\<p\\>(?:&nbsp;)*\\<\\/p\\>';\n\t\t\treturn preg_replace('/^(?:'.$whitespace.')+|(?:'.$whitespace.')+$/', '', (string)$string);\n\t\t}", "function stringStripTags ($string) {\n $string = preg_replace(\"/<del[^>]*>.+<\\/del[^>]*>/isU\", '', $string);\n $string = preg_replace(\"/<script[^>]*>.+<\\/script[^>]*>/isU\", '', $string);\n $string = preg_replace(\"/<style[^>]*>.+<\\/style[^>]*>/isU\", '', $string);\n $string = str_replace('>', '> ', $string);\n $string = str_replace('<', ' <', $string);\n $string = strip_tags($string);\n $string = preg_replace(\"/\\s+/\", \" \", $string);\n $string = trim($string);\n return $string;\n}", "function remove_html($content) {\r\n\t$content = strip_tags($content);\r\n return $content;\r\n}", "public function removeHTML($text){\n $text = html_entity_decode($text);\n\n\n // Alle Tags entfernen\n $text = strip_tags($text);\n\n $text = str_replace(\"&lt;br&gt;\", \"\", $text);\n $text = str_replace(\"&amp;lt;br&amp;gt;\", \"\", $text);\n\n\n return $text;\n }", "function sloodle_clean_for_output($str)\n {\n return sloodle_strip_new_lines(strip_tags(stripcslashes(@html_entity_decode($str, ENT_QUOTES, 'UTF-8'))));\n }", "function html_strip_unsafe($strData)\n\t\t{\n\t\t // Unsafe HTML tags/attributes that members may abuse\n\t\t $arrData=array(\n\t\t //'/<iframe(.*?)<\\/iframe>/is',\n\t\t '/<title(.*?)<\\/title>/is',\n\t\t '/<pre(.*?)<\\/pre>/is',\n\t\t '/<frame(.*?)<\\/frame>/is',\n\t\t '/<frameset(.*?)<\\/frameset>/is',\n\t\t //'/<object(.*?)<\\/object>/is',\n\t\t '/<script(.*?)<\\/script>/is',\n\t\t //'/<embed(.*?)<\\/embed>/is',\n\t\t '/<applet(.*?)<\\/applet>/is',\n\t\t '/<meta(.*?)>/is',\n\t\t '/<!doctype(.*?)>/is',\n\t\t '/<link(.*?)>/is',\n\t\t '/<body(.*?)>/is',\n\t\t '/<\\/body>/is',\n\t\t '/<head(.*?)>/is',\n\t\t '/<\\/head>/is',\n\t\t '/onload=\"(.*?)\"/is',\n\t\t '/onunload=\"(.*?)\"/is',\n\t\t '/onerror=\"(.*?)\"/is',\n\t\t '/onclick=\"(.*?)\"/is',\n\t\t '/onchange=\"(.*?)\"/is',\n\t\t '/onmouseover=\"(.*?)\"/is',\n\t\t '/autofocus=\"(.*?)\"/is',\n\t\t '/onfocus=\"(.*?)\"/is',\n\t\t '/<html(.*?)>/is',\n\t\t '/<\\/html>/is',\n\t\t );\n\t\t $strData = preg_replace($arrData, \"\", $strData);\n\t\t\t$strData = filter_var($strData, FILTER_SANITIZE_STRING, FILTER_FLAG_STRIP_HIGH);\n\n\t\t return $strData;\n\t\t}", "function sanitize($str){\n $str = strip_tags($str);\n return $str;\n }", "function stripcleantohtml($s){\n\t// Restores the added slashes (ie.: \" I\\'m John \"\n\t// for security in output, and escapes them in htmlentities(ie.: &quot; etc.)\n\t// Also strips any <html> tags it may encounter\n\treturn htmlentities(trim(strip_tags(stripslashes($s))), ENT_NOQUOTES, \"UTF-8\");\n}", "protected function cleanHTML(string $html) : string\n {\n // $html = str_replace(\"\\n\", '', $html);\n for($i = 0; $i < 3; $i++) {\n $html = str_replace($this->prefixHTML, '', $html);\n $html = str_replace($this->postfixHTML, '', $html);\n $html = str_replace('<?xml version=\"1.0\" standalone=\"yes\"?>', '', $html);\n //remove white space\n $html = preg_replace('/\\s+/', ' ', $html);\n // $html = str_replace('> <', '><', $html);\n }\n\n return $html;\n }", "public static function remove_html(string $str, string $allowable_tags = ''): string\n {\n return \\strip_tags($str, $allowable_tags);\n }", "function strips_all_tags( $html )\n\t{\n\t\t$search = [\n\t\t\t'@<script[^>]*?>.*?</script>@si', // Strip out javascript\n\t\t\t'@<[\\/\\!]*?[^<>]*?>@si', // Strip out HTML tags\n\t\t\t'@<style[^>]*?>.*?</style>@siU', // Strip style tags properly\n\t\t\t'@<![\\s\\S]*?--[ \\t\\n\\r]*>@' // Strip multi-line comments including CDATA\n\t\t];\n\t\t$result = preg_replace( $search, '', $html );\n\n\t\treturn $result;\n\t}", "function plugins_strip_tags($string) {\n\treturn strip_tags($string, '<p><strong><em><span><ul><li><ol><blockquote>');\n}", "function clean($string){\n\t\t$string = trim($string); //remove white-spacing\n\t\t$string = htmlentities($string); //change to html\n\t\t$string = strip_tags($string); //delete html tags\n\t\treturn $string;\n\t}", "public static function strip_tag_string($str)\n\t{\n\t\t$str = strip_tags($str);\n\t\t$str = trim($str);\n\t\treturn $str;\n\t}", "protected function strip_tags($string ){\n\t\treturn preg_replace('~\\s+~',' ',strip_tags($string));\n\t}", "function stripcleantohtml( $s )\r\n\t\t{\r\n\t\t\treturn htmlentities(trim(strip_tags(stripslashes($s))), ENT_NOQUOTES, \"UTF-8\");\r\n\t\t}", "function strip_html_tags( $text )\n{\n\t// PHP's strip_tags() function will remove tags, but it\n\t// doesn't remove scripts, styles, and other unwanted\n\t// invisible text between tags. Also, as a prelude to\n\t// tokenizing the text, we need to insure that when\n\t// block-level tags (such as <p> or <div>) are removed,\n\t// neighboring words aren't joined.\n\t$text = preg_replace(\n\t\t\tarray(\n\t\t\t\t\t// Remove invisible content\n\t\t\t\t\t'@<head[^>]*?>.*?</head>@siu',\n\t\t\t\t\t'@<style[^>]*?>.*?</style>@siu',\n\t\t\t\t\t'@<script[^>]*?.*?</script>@siu',\n\t\t\t\t\t'@<object[^>]*?.*?</object>@siu',\n\t\t\t\t\t'@<embed[^>]*?.*?</embed>@siu',\n\t\t\t\t\t'@<applet[^>]*?.*?</applet>@siu',\n\t\t\t\t\t'@<noframes[^>]*?.*?</noframes>@siu',\n\t\t\t\t\t'@<noscript[^>]*?.*?</noscript>@siu',\n\t\t\t\t\t'@<noembed[^>]*?.*?</noembed>@siu',\n\t\t\t\t\t/*'@<input[^>]*?>@siu',*/\n\t\t\t\t\t'@<form[^>]*?.*?</form>@siu',\n\n\t\t\t\t\t// Add line breaks before & after blocks\n\t\t\t\t\t'@<((br)|(hr))>@iu',\n\t\t\t\t\t'@</?((address)|(blockquote)|(center)|(del))@iu',\n\t\t\t\t\t'@</?((div)|(h[1-9])|(ins)|(isindex)|(p)|(pre))@iu',\n\t\t\t\t\t'@</?((dir)|(dl)|(dt)|(dd)|(li)|(menu)|(ol)|(ul))@iu',\n\t\t\t\t\t'@</?((table)|(th)|(td)|(caption))@iu',\n\t\t\t\t\t'@</?((form)|(button)|(fieldset)|(legend)|(input))@iu',\n\t\t\t\t\t'@</?((label)|(select)|(optgroup)|(option)|(textarea))@iu',\n\t\t\t\t\t'@</?((frameset)|(frame)|(iframe))@iu',\n\t),\n\tarray(\n\t\" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \",\n\t\" \", \"\\n\\$0\", \"\\n\\$0\", \"\\n\\$0\", \"\\n\\$0\", \"\\n\\$0\",\n\t\"\\n\\$0\", \"\\n\\$0\",\n\t),\n\t$text );\n\n\t// remove empty lines\n\t$text = preg_replace(\"/(^[\\r\\n]*|[\\r\\n]+)[\\s\\t]*[\\r\\n]+/\", \"\\n\", $text);\n\t// remove leading spaces\n\t$text = preg_replace(\"/\\n( )*/\", \"\\n\", $text);\n\n\t// Remove all remaining tags and comments and return.\n\treturn strip_tags( $text );\n}", "protected function stripHtmlTags($text)\n {\n $text = preg_replace(\n [\n // Remove invisible content\n /** @lang php */\n '@<head[^>]*?>.*?</head>@siu',\n /** @lang php */\n '@<style[^>]*?>.*?</style>@siu',\n /** @lang php */\n '@<script[^>]*?.*?</script>@siu',\n /** @lang php */\n '@<object[^>]*?.*?</object>@siu',\n /** @lang php */\n '@<embed[^>]*?.*?</embed>@siu',\n /** @lang php */\n '@<applet[^>]*?.*?</applet>@siu',\n /** @lang php */\n '@<noframes[^>]*?.*?</noframes>@siu',\n /** @lang php */\n '@<noscript[^>]*?.*?</noscript>@siu',\n /** @lang php */\n '@<noembed[^>]*?.*?</noembed>@siu',\n // Add line breaks before and after blocks\n '@</?((address)|(blockquote)|(center)|(del))@iu',\n '@</?((div)|(h[1-9])|(ins)|(isindex)|(p)|(pre))@iu',\n '@</?((dir)|(dl)|(dt)|(dd)|(li)|(menu)|(ol)|(ul))@iu',\n '@</?((table)|(th)|(td)|(caption))@iu',\n '@</?((form)|(button)|(fieldset)|(legend)|(input))@iu',\n '@</?((label)|(select)|(optgroup)|(option)|(textarea))@iu',\n '@</?((frameset)|(frame)|(iframe))@iu',\n ],\n [\n ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ',\n \"\\n\\$0\", \"\\n\\$0\", \"\\n\\$0\", \"\\n\\$0\", \"\\n\\$0\", \"\\n\\$0\",\n \"\\n\\$0\", \"\\n\\$0\",\n ],\n $text\n );\n\n return strip_tags($text);\n }", "function remove_html_tag_news($data){\n\treturn preg_replace('/ style=\".*?\"/i', '$1', strip_tags($data, '<i><a><b><u><div><hr>'));\n}", "function real_strip_tags($str, $allowable_tags = \"\")\n{\n return strip_tags($str, $allowable_tags);\n}", "public function strip( $isOnlyString = true ) {\n\tif( count($this->selectList) > 0 && isset($this->selectList[0])) $retval = $this->selectList[0]->getCurrentHtml();\n\t $retval = $this->getCurrentHtml();\n\t if($isOnlyString) $retval = preg_replace(\"?<[^>]*[^/]>[^<]*< *[/][^>]*>?\",\"\",$retval);\n\t return strip_tags($retval);\n }", "function clean($str) {\n\t\treturn htmlentities(strip_tags($str));\n\t}", "function strip_html_tags( $text )\r\n{\r\n $text = preg_replace(\r\n array(\r\n // Remove invisible content\r\n '@<head[^>]*?>.*?</head>@siu',\r\n '@<style[^>]*?>.*?</style>@siu',\r\n '@<script[^>]*?.*?</script>@siu',\r\n '@<object[^>]*?.*?</object>@siu',\r\n '@<embed[^>]*?.*?</embed>@siu',\r\n '@<applet[^>]*?.*?</applet>@siu',\r\n '@<noframes[^>]*?.*?</noframes>@siu',\r\n '@<noscript[^>]*?.*?</noscript>@siu',\r\n '@<noembed[^>]*?.*?</noembed>@siu',\r\n // Add line breaks before and after blocks\r\n '@</?((address)|(blockquote)|(center)|(del))@iu',\r\n '@</?((div)|(h[1-9])|(ins)|(isindex)|(p)|(pre))@iu',\r\n '@</?((dir)|(dl)|(dt)|(dd)|(li)|(menu)|(ol)|(ul))@iu',\r\n '@</?((table)|(th)|(td)|(caption))@iu',\r\n '@</?((form)|(button)|(fieldset)|(legend)|(input))@iu',\r\n '@</?((label)|(select)|(optgroup)|(option)|(textarea))@iu',\r\n '@</?((frameset)|(frame)|(iframe))@iu',\r\n ),\r\n array(\r\n ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ',\r\n $nl.\"\\$0\", $nl.\"\\$0\", $nl.\"\\$0\", $nl.\"\\$0\", $nl.\"\\$0\", $nl.\"\\$0\",\r\n $nl.\"\\$0\", $nl.\"\\$0\",\r\n ),\r\n $text );\r\n return strip_tags( $text );\r\n}", "function clean_html($html)\r\n{\r\n\t$html = preg_replace('/<script\\b[^>]*>(.*?)<\\/script>/is', \"\", $html);\r\n\t$html = preg_replace('/<style\\b[^>]*>(.*?)<\\/style>/is', \"\", $html);\r\n\t$html = preg_replace('/<link \\b[^>]*>(.*?)/is', \"\", $html);\r\n\r\n\treturn $html;\r\n}", "function guy_strip_bad($str, $mode='') {\n global $guy_c;\n $html_allowed = array('a', 'b', 'i', 'p', 'ol', 'ul', 'li', 'blockquote', 'br', 'em', 'sup', 'sub');\n\t$html_allowed_regexp = join('|',$html_allowed);\n\t$html_allowed_striptags = '<'.join('><',$html_allowed).'>';\n\t$str = strip_tags($str,$html_allowed_striptags);\n\t$str = preg_replace_callback(\"/<($html_allowed_regexp)\\b(.*?)>/si\",'guy_attrcheck',$str);\n\t$str = preg_replace('/<\\/([^ \n>]+)[^>]*>/si',$guy_c['lt'].'/$1'.$guy_c['gt'],$str);\n\t$str = preg_replace('#^\\s+$#m','',$str);\n\t$str = safehtml($str);\n\treturn $str;\n}", "public function cleanUpValue($str)\n {\n return trim($this->escaper->escapeHtml(strip_tags($str)));\n }", "function strip_p( $html ) {\n $string = $html;\n $patterns = array();\n $patterns[0] = '/\\<p\\>/';\n $patterns[1] = '/\\<\\/p\\>/';\n $replacements = array();\n $replacements[0] = \"\";\n $replacements[1] = \"\";\n return preg_replace($patterns, $replacements, $string);\n }", "public static function cleanHTML($string)\n {\n $cleaned = $string;\n $cleaned = str_replace('<', '&lt;', $cleaned);\n $cleaned = str_replace('>', '&gt;', $cleaned);\n\n return $cleaned;\n }", "public static function strip_tags( $string ) {\n\t\t$string = wp_kses( $string, array() );\n\t\treturn str_replace( '&amp;', '&', $string ); // undo damage done by wp_kses_normalize_entities()\n\t}", "function somehtml($nohtml) {\n\t\t$nohtml = str_replace(\"&#124;\", \"|\", $nohtml);\n\t\treturn stripslashes(strip_tags($nohtml, '<p><a><font><ul><li><h1><h2><h3><h4><h5><h6><hr><b><u><i><strong><em><table><tr><td><tbody><tfoot><span><div><br><br /><blockquote><img><embed><object><form><input>'));\n\t}", "private function wpus_strip_tags($string, $remove_breaks = FALSE) {\n\t\t\t$string = preg_replace('/[\\r\\n\\t ]+/', ' ', $string);\n\n\t\t\t$string = preg_replace('@<(script|style)[^>]*?>.*?</\\\\1>@si', '', $string);\n\n\t\t\t$string = preg_replace('@ *</?\\s*(P|UL|OL|DL|BLOCKQUOTE)\\b[^>]*?> *@si', \"\\n\\n\", $string);\n\t\t\t$string = preg_replace('@ *<(BR|DIV|LI|DT|DD|TR|TD|H\\d)\\b[^>]*?> *@si', \"\\n\", $string);\n\t\t\t$string = preg_replace(\"@\\n\\n\\n+@si\", \"\\n\\n\", $string);\n\n\t\t\t$string = strip_tags($string);\n\n\t\t\tif($remove_breaks) {\n\t\t\t\t$string = preg_replace('/[\\r\\n\\t ]+/', ' ', $string);\n\t\t\t}\n\n\t\t\t// ...since we're pulling excerpts from the DB, some of the excerpts contain truncated HTML tags\n\t\t\t// that won't be picked up by strip_tags(). This removes any trailing HTML from the beginning\n\t\t\t// and end of the excerpt:\n\t\t\t$string = preg_replace('/.*>|<.*/', ' ', $string);\n\n\t\t\treturn trim($string);\n\t\t}", "function strip_htmltag($str, $all = TRUE)\n{\n\tglobal $_symbol_noexists;\n\tstatic $noexists_pattern;\n\n\tif (! isset($noexists_pattern))\n\t\t$noexists_pattern = '#<span class=\"noexists\">([^<]*)<a[^>]+>' .\n\t\t\tpreg_quote($_symbol_noexists, '#') . '</a></span>#';\n\n\t// Strip Dagnling-Link decoration (Tags and \"$_symbol_noexists\")\n\t$str = preg_replace($noexists_pattern, '$1', $str);\n\n\tif ($all) {\n\t\t// All other HTML tags\n\t\treturn preg_replace('#<[^>]+>#', '', $str);\n\t} else {\n\t\t// All other anchor-tags only\n\t\treturn preg_replace('#<a[^>]+>|</a>#i', '', $str);\n\t}\n}", "function strips_tags( $html, $disallowed_tag = 'script|style|noframes|select|option', $allowed_tag = '' )\n\t{\n\t\t//prep the string\n\t\t$html = ' ' . $html;\n\n\t\t//initialize keep tag logic\n\t\tif ( strlen( $allowed_tag ) > 0 )\n\t\t{\n\t\t\t$k = explode( '|', $allowed_tag );\n\t\t\tfor ( $i = 0; $i < count( $k ); $i++ )\n\t\t\t{\n\t\t\t\t$html = str_replace( '<' . $k[ $i ], '[{(' . $k[ $i ], $html );\n\t\t\t\t$html = str_replace( '</' . $k[ $i ], '[{(/' . $k[ $i ], $html );\n\t\t\t}\n\t\t}\n\t\t//begin removal\n\t\t//remove comment blocks\n\t\twhile ( stripos( $html, '<!--' ) > 0 )\n\t\t{\n\t\t\t$pos[ 1 ] = stripos( $html, '<!--' );\n\t\t\t$pos[ 2 ] = stripos( $html, '-->', $pos[ 1 ] );\n\t\t\t$len[ 1 ] = $pos[ 2 ] - $pos[ 1 ] + 3;\n\t\t\t$x = substr( $html, $pos[ 1 ], $len[ 1 ] );\n\t\t\t$html = str_replace( $x, '', $html );\n\t\t}\n\t\t//remove tags with content between them\n\t\tif ( strlen( $disallowed_tag ) > 0 )\n\t\t{\n\t\t\t$e = explode( '|', $disallowed_tag );\n\t\t\tfor ( $i = 0; $i < count( $e ); $i++ )\n\t\t\t{\n\t\t\t\twhile ( stripos( $html, '<' . $e[ $i ] ) > 0 )\n\t\t\t\t{\n\t\t\t\t\t$len[ 1 ] = strlen( '<' . $e[ $i ] );\n\t\t\t\t\t$pos[ 1 ] = stripos( $html, '<' . $e[ $i ] );\n\t\t\t\t\t$pos[ 2 ] = stripos( $html, $e[ $i ] . '>', $pos[ 1 ] + $len[ 1 ] );\n\t\t\t\t\t$len[ 2 ] = $pos[ 2 ] - $pos[ 1 ] + $len[ 1 ];\n\t\t\t\t\t$x = substr( $html, $pos[ 1 ], $len[ 2 ] );\n\t\t\t\t\t$html = str_replace( $x, '', $html );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//remove remaining tags\n\t\twhile ( stripos( $html, '<' ) > 0 )\n\t\t{\n\t\t\t$pos[ 1 ] = stripos( $html, '<' );\n\t\t\t$pos[ 2 ] = stripos( $html, '>', $pos[ 1 ] );\n\t\t\t$len[ 1 ] = $pos[ 2 ] - $pos[ 1 ] + 1;\n\t\t\t$x = substr( $html, $pos[ 1 ], $len[ 1 ] );\n\t\t\t$html = str_replace( $x, '', $html );\n\t\t}\n\t\t//finalize keep tag\n\t\tif ( strlen( $allowed_tag ) > 0 )\n\t\t{\n\t\t\tfor ( $i = 0; $i < count( $k ); $i++ )\n\t\t\t{\n\t\t\t\t$html = str_replace( '[{(' . $k[ $i ], '<' . $k[ $i ], $html );\n\t\t\t\t$html = str_replace( '[{(/' . $k[ $i ], '</' . $k[ $i ], $html );\n\t\t\t}\n\t\t}\n\n\t\treturn trim( $html );\n\t}", "protected function cleanStr($str)\n {\n return html_entity_decode(strip_tags($str), ENT_QUOTES, 'UTF-8');\n }", "public static function cleanHTMLStr($html)\n {\n require_once __DIR__ . '/../../Libs/vendor/ezyang/htmlpurifier/library/HTMLPurifier.auto.php';\n $config = HTMLPurifier_Config::createDefault();\n $config->loadArray([\n 'Cache.DefinitionImpl' => null,\n 'Core.Encoding' => 'UTF-8',\n 'HTML.Allowed' => 'strong,em,a[href|title|target|rel|class|style],ul[style],ol[style],li[style],br,span[class|style]',\n 'Attr.AllowedFrameTargets' => array('_blank', '_self'),\n 'CSS.AllowTricky' => true,\n 'CSS.AllowedProperties' => 'font,font-size,font-weight,font-style,font-family,text-decoration,padding,padding-left,padding-right,color,background-color,text-align,display',\n 'AutoFormat.RemoveEmpty' => true\n ]);\n $purifier = new HTMLPurifier($config);\n return $purifier->purify($html);\n }", "function removecomments_html($string) {\n\n //strpos of the opening tag\n $start_position = 0;\n\n //number of tags \"deep\" we are\n $current_count = 0;\n\n //go through the string and remove the tags:\n for ( $p = 0; $p < strlen($string); $p++ ) {\n //find opening tags\n if ( $string[$p] == \"<\" && $string[$p+1] == \"!\"\n && $string[$p+2] == \"-\" && $string[$p+3] == \"-\" )\n {\n $current_count++;\n if ( $current_count == 1 )\n {\n $start_position = $p;\n }\n }\n //find closing tags if applicable.\n if ( $current_count > 0 && $string[$p] == \"-\"\n && $string[$p+1] == \"-\" && $string[$p+2] == \">\")\n {\n $current_count--;\n if ( $current_count == 0 )\n {\n $p = $p + 3;\n $string = substr($string, 0, $start_position) . substr($string, $p);\n $start_position = 0;\n $p = 0;\n }\n }\n }\n\n //handle any uneven tags at the end.\n return substr($string, 0, (strpos($string, \"<!--\") == 0 ? strlen($string) : strpos($string, \"<!--\"))) . \"\\n\";\n }", "function strip_all_tags($content)\n{\n\t$content = preg_replace('/\\n/',' ',$content);\n\t$content = preg_replace('/<script.*<\\/script>/U',' ',$content);\n\t$content = preg_replace('/<style.*<\\/style>/U',' ',$content);\n\t$content = strip_tags($content);\n\treturn $content;\n}", "function sanitize($str){\n $str = strip_tags($str);//erasing tag or smthg\n $str = rtrim($str);//agadi re pachadi ko space hatauchha\n return $str;\n }", "function clean_str($string)\n{\n\t// get rid of tags\n\t$string = strip_tags($string);\n\n\t// get rid of html entities\n\t$string = preg_replace(\"/&#?[a-z0-9]+;/i\", \"\", $string);\n\n\t// trim the string\n\t$string = trim($string);\n\n\treturn (string) $string;\n}", "function filter_tags($string)\n{\n return preg_replace('/<[^>]*>/', ' ', $string);\n}", "function wpmantis_strip_only($str, $tags, $stripContent = false)\n{\n $content = '';\n if(!is_array($tags)) {\n $tags = (strpos($str, '>') !== false ? explode('>', str_replace('<', '', $tags)) : array($tags));\n if(end($tags) == '') array_pop($tags);\n }\n foreach($tags as $tag) {\n if ($stripContent)\n $content = '(.+</'.$tag.'[^>]*>|)';\n $str = preg_replace('#</?'.$tag.'[^>]*>'.$content.'#is', '', $str);\n }\n return $str;\n}", "public abstract function cleanHTML($content);", "private function cleanStr($data)\n {\n return trim(strip_tags($data));\n }", "public function safeHtmlToNormalHtml(string $html): string;", "static function html_sanitization($input)\r\n {\r\n return strip_tags($input);\r\n }", "function strip_only($str, $tags) {\n if(!is_array($tags)) {\n $tags = (strpos($str, '>') !== false ? explode('>', str_replace('<', '', $tags)) : array($tags));\n if(end($tags) == '') array_pop($tags);\n }\n foreach($tags as $tag) $str = preg_replace('#</?'.$tag.'[^>]*>#is', '', $str);\n return $str;\n}", "public function tidyHtml(string $html): string\n {\n // some point.\n return $html;\n }", "function remove_junk($str){\n $str = nl2br($str);\n $str = htmlspecialchars(strip_tags($str, ENT_QUOTES));\n return $str;\n}", "function sanitize(\n $html,\n $tags_to_remove = ['script', 'iframe', 'input', 'form'],\n $attributes_to_keep = ['title', 'href', 'src'],\n $text_to_keep = []\n) {\n $htmlContent = str_get_html($html);\n\n foreach ($htmlContent->find('*') as $element) {\n if (in_array($element->tag, $text_to_keep)) {\n $element->outertext = $element->plaintext;\n } elseif (in_array($element->tag, $tags_to_remove)) {\n $element->outertext = '';\n } else {\n foreach ($element->getAllAttributes() as $attributeName => $attribute) {\n if (!in_array($attributeName, $attributes_to_keep)) {\n $element->removeAttribute($attributeName);\n }\n }\n }\n }\n\n return $htmlContent;\n}", "function remove_non_rss(string $html): string\n{\n $html = preg_replace('%<script.*?>.*?</script>%is', '', $html);\n $html = preg_replace('%<a href=\"#.*?>(.*?)</a>%is', '$1', $html);\n $html = preg_replace('%<a href=\"javascript.*?>(.*?)</a>%is', '$1', $html);\n return $html;\n}", "function wp_strip_all_tags($text, $remove_breaks = \\false)\n {\n }", "protected static function cleanCode($html)\n {\n $html = str_replace(Parser::REMOVE_HTML, '', $html);\n $html = preg_replace('!\\s+!', ' ', $html);\n $html = iconv(\"UTF-8\", \"UTF-8//IGNORE\", utf8_decode($html));\n $html = trim(preg_replace('/.*<\\/head>/', '', $html));\n return $html;\n }", "private function cleanForXML($string)\n {\n $string = strip_tags($string);\n $string = htmlentities($string, ENT_QUOTES, \"UTF-8\");\n $string = preg_replace(\"/&#?[a-z0-9]{2,8};/i\", \"\", $string);\n return $string;\n }", "private function cleanForXML($string)\n {\n $string = strip_tags($string);\n $string = htmlentities($string, ENT_QUOTES, \"UTF-8\");\n $string = preg_replace(\"/&#?[a-z0-9]{2,8};/i\", \"\", $string);\n return $string;\n }", "public static function html_stripe_empty_tags(string $str): string\n {\n return (string) \\preg_replace(\n '/<[^\\\\/>]*?>\\\\s*?<\\\\/[^>]*?>/u',\n '',\n $str\n );\n }", "function filterHTMLTags( $text )\n{\n $text = preg_replace(\n array(\n // Remove invisible content\n '@<head[^>]*?>.*?</head>@siu',\n '@<style[^>]*?>.*?</style>@siu',\n '@<script[^>]*?.*?</script>@siu',\n '@<object[^>]*?.*?</object>@siu',\n '@<embed[^>]*?.*?</embed>@siu',\n '@<applet[^>]*?.*?</applet>@siu',\n '@<noframes[^>]*?.*?</noframes>@siu',\n '@<noscript[^>]*?.*?</noscript>@siu',\n '@<noembed[^>]*?.*?</noembed>@siu',\n // Add line breaks before and after blocks\n '@</?((address)|(blockquote)|(center)|(del))@iu',\n '@</?((div)|(h[1-9])|(ins)|(isindex)|(p)|(pre))@iu',\n '@</?((dir)|(dl)|(dt)|(dd)|(li)|(menu)|(ol)|(ul))@iu',\n '@</?((table)|(th)|(td)|(caption))@iu',\n '@</?((form)|(button)|(fieldset)|(legend)|(input))@iu',\n '@</?((label)|(select)|(optgroup)|(option)|(textarea))@iu',\n '@</?((frameset)|(frame)|(iframe))@iu',\n ),\n array(\n ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ',\n \"\\n\\$0\", \"\\n\\$0\", \"\\n\\$0\", \"\\n\\$0\", \"\\n\\$0\", \"\\n\\$0\",\n \"\\n\\$0\", \"\\n\\$0\",\n ),\n $text );\n return strip_tags( $text );\n}", "function cleantohtml( $s )\r\n\t\t{\r\n\t\t\r\n\t\t\treturn strip_tags(htmlentities(trim(stripslashes($s))), ENT_NOQUOTES, \"UTF-8\");\r\n\t\t}", "protected function cleanHtml($html) {\n $chain = new Zend_Filter();\n\n if($this->isFilterTags){\n $chain->addFilter(new Zend_Filter_StripTags(self::$tags));\n }\n $chain->addFilter(new Zend_Filter_StringTrim());\n\n $html = $chain->filter($html);\n\n $tmp = $html;\n while (1) {\n // Try and replace an occurrence of javascript:\n $html = preg_replace('/(<[^>]*)javascript:([^>]*>)/i', '$1$2', $html);\n \n\n // If nothing changed this iteration then break the loop\n if ($html == $tmp)\n break;\n\n $tmp = $html;\n }\n\n return $html;\n }", "public function stdWrap_stripHtml($content = '')\n {\n return strip_tags($content);\n }", "function clean2html($s){\n\t\t// Restores the added slashes (ie.: \" I\\'m John \" for security in output, and escapes them in htmlentities(ie.: &quot; etc.)\n\t\t// It preserves any <html> tags in that they are encoded aswell (like &lt;html&gt;)\n\t\t// As an extra security, if people would try to inject tags that would become tags after stripping away bad characters,\n\t\t// we do still strip tags but only after htmlentities, so any genuine code examples will stay\n\t\t// Use: For input fields that may contain html, like a textarea\n\t\treturn strip_tags(htmlentities(trim(stripslashes($s))), ENT_NOQUOTES, \"UTF-8\");\n}", "function cleantohtml($s){\n\t// Restores the added slashes (ie.: \" I\\'m John \"\n\t// for security in output, and escapes them in htmlentities(ie.: &quot; etc.)\n\t// It preserves any <html> tags in that they are encoded aswell (like &lt;html&gt;)\n\t// As an extra security, if people would try to inject tags that would become tags\n\t// after stripping away bad characters, we do still strip tags but only after htmlentities,\n\t// so any genuine code examples will stay\n\treturn strip_tags(htmlentities(trim(stripslashes($s)), ENT_NOQUOTES, \"UTF-8\"));\n}", "function strip($string) {\n\n\n\t\t}", "public static function clean($str) {\n $str = preg_replace('#<script(.*?)>(.*?)</script>#is', '', $str);\n \n // Trim extra spaces\n $str = trim($str);\n\n // Return the value out of the function.\n return $str;\n }", "public static function cleanString($content) {\n $content = preg_replace(\"/&#?[a-z0-9]+;/i\",\"\",$content); \n $content = preg_replace(\"/[\\n\\r]/\",\"\",$content);\n $content = strip_tags($content);\n return $content;\n }", "function sanitize_string($a_string)\n{\n $a_string = htmlspecialchars($a_string, ENT_QUOTES);\n $a_string = strip_tags($a_string);\n return trim($a_string); \n}", "public static function clean_string( $string ) {\n\t\t\t$string = do_shortcode( $string );\n\t\t\t$string = str_replace( array( '&amp%3B', '&amp;' ), '&', $string );\n\t\t\t$string = str_replace( array( \"\\r\", '&nbsp;', \"\\t\" ), ' ', $string );\n\t\t\t$string = wp_strip_all_tags( $string, false ); // true == remove line breaks\n\t\t\treturn $string;\n\t\t}", "function clean_content($string) {\n $patterns = array(\n '#^\\s*</p>#',\n '#<p>\\s*$#',\n '#<p>(\\s|&nbsp;)*+(<br\\s*/*>)?(\\s|&nbsp;)*</p>#'\n );\n // $patterns = '#<p>(\\s|&nbsp;)*+(<br\\s*/*>)?(\\s|&nbsp;)*</p>#i';\n\n return preg_replace($patterns, '', $string);\n}", "public function noHtml(string $string): string\n {\n return htmlentities($string, ENT_QUOTES | ENT_HTML5, 'UTF-8');\n }", "public static function sanitize($string)\n {\n $search = array(\n '@<script[^>]*?>.*?</script>@si', // Strip out javascript\n '@<[\\/\\!]*?[^<>]*?>@si', // Strip out HTML tags\n '@<style[^>]*?>.*?</style>@siU', // Strip style tags properly\n '@<![\\s\\S]*?--[ \\t\\n\\r]*>@' // Strip multi-line comments\n );\n\n $str = strip_tags($string);\n $str = preg_replace($search, '', $str);\n\n return $str;\n }", "public function stripTags($string, $uiAllowedTags = false)\n {\n $string = str_replace('>', '> ', $string);\n\n if ($uiAllowedTags) {\n return strip_tags($string, $this->htmlTagProvider->getAllowedTags());\n }\n\n $result = trim(strip_tags($string));\n\n return preg_replace('/\\s+/u', ' ', $result);\n }", "public static function removeHtml($s)\n {\n $newLinesAfter = 'h1|h2|h3|h4|h5|h6|h7|h8';\n $newLineAfter = 'caption|div|li|p|tr';\n $removeContent = 'script|style|noframes|select|option|link';\n $spaceAfter = 'td|th';\n\n /**///prep the string\n $s = ' ' . preg_replace(\"/[\\\\r\\\\n]+/\", '', $s);\n\n //begin removal\n /**///remove comment blocks\n while(stripos($s,'<!--') > 0){\n $pos[1] = stripos($s,'<!--');\n $pos[2] = stripos($s,'-->', $pos[1]);\n $len[1] = $pos[2] - $pos[1] + 3;\n $x = substr($s,$pos[1],$len[1]);\n $s = str_replace($x,'',$s);\n }\n\n /**///remove tags with content between them\n if(strlen($removeContent) > 0){\n $e = explode('|', $removeContent);\n for($i=0;$i<count($e);$i++){\n while(stripos($s,'<' . $e[$i]) > 0){\n $len[1] = strlen('<' . $e[$i]);\n $pos[1] = stripos($s,'<' . $e[$i]);\n $pos[2] = stripos($s,$e[$i] . '>', $pos[1] + $len[1]);\n $len[2] = $pos[2] - $pos[1] + $len[1];\n $x = substr($s,$pos[1],$len[2]);\n $s = str_replace($x,'',$s);\n }\n }\n }\n\n foreach (explode('|', $newLinesAfter) as $endTag) {\n $s = str_replace(\"</$endTag>\", \"\\n\\n\", $s);\n }\n foreach (explode('|', $newLineAfter) as $endTag) {\n $s = str_replace(\"</$endTag>\", \"\\n\", $s);\n }\n foreach (explode('|', $spaceAfter) as $endTag) {\n $s = str_replace(\"</$endTag>\", \" \", $s);\n }\n\n /**///remove remaining tags\n $start = 0;\n while(stripos($s,'<', $start) > 0){\n $pos[1] = stripos($s,'<', $start);\n $pos[2] = stripos($s,'>', $pos[1]);\n if (!$pos[2]) {\n //No closing tag! Skip this one\n $start = $pos[1]+1;\n } else {\n $len[1] = $pos[2] - $pos[1] + 1;\n $x = substr($s,$pos[1],$len[1]);\n $s = str_replace($x,'',$s);\n }\n }\n\n if (PHP_EOL != \"\\n\") {\n $s = str_replace(\"\\n\", PHP_EOL, $s);\n }\n return html_entity_decode(trim($s), ENT_QUOTES, 'cp1252');\n }", "function clean($string) {\n return html_entity_decode($string);\n \n}", "function stripHTMLTags( $content ) {\r\n \r\n $search = array (\"'<script[^>]*?>.*?</script>'si\", // Strip out javascript\r\n \"'<\\s*br\\s*(\\/)?>'i\", // Replace brs to spaces\r\n \"'<[\\/\\!]*?[^<>]*?>'si\", // Strip out html tags\r\n \"'([\\r\\n])[\\s]+'\", // Strip out white space\r\n \"'&(quot|#34);'i\", // Replace html entities\r\n \"'&(amp|#38);'i\",\r\n \"'&(lt|#60);'i\",\r\n \"'&(gt|#62);'i\",\r\n \"'&(nbsp|#160);'i\",\r\n \"'&(iexcl|#161);'i\",\r\n \"'&(cent|#162);'i\",\r\n \"'&(pound|#163);'i\",\r\n \"'&(copy|#169);'i\",\r\n \"'&#(\\d+);'\");\r\n \r\n $replace = array (\"\",\r\n \" \",\r\n \"\",\r\n \"\\\\1\",\r\n \"\\\"\",\r\n \"&\",\r\n \"<\",\r\n \">\",\r\n \" \",\r\n chr(161),\r\n chr(162),\r\n chr(163),\r\n chr(169),\r\n \"chr(\\\\1)\");\r\n \r\n $content = preg_replace ($search, $replace, $content);\r\n \r\n return $content;\r\n}", "function strip_word_doc( $html, $allowed_tags = '' )\n\t{\n\t\tmb_regex_encoding( 'UTF-8' );\n\n\t\t//replace MS special characters first\n\t\t$search = [\n\t\t\t'/&lsquo;/u',\n\t\t\t'/&rsquo;/u',\n\t\t\t'/&ldquo;/u',\n\t\t\t'/&rdquo;/u',\n\t\t\t'/&mdash;/u',\n\t\t];\n\t\t$replace = [\n\t\t\t'\\'',\n\t\t\t'\\'',\n\t\t\t'\"',\n\t\t\t'\"',\n\t\t\t'-',\n\t\t];\n\t\t$html = preg_replace( $search, $replace, $html );\n\n\t\t//make sure _all_ html entities are converted to the plain ascii equivalents - it appears\n\t\t//in some MS headers, some html entities are encoded and some aren't\n\t\t$html = html_entity_decode( $html, ENT_QUOTES, 'UTF-8' );\n\n\t\t//try to strip out any C style comments first, since these, embedded in html comments, seem to\n\t\t//prevent strip_tags from removing html comments (MS Word introduced combination)\n\t\tif ( mb_stripos( $html, '/*' ) !== FALSE )\n\t\t{\n\t\t\t$html = mb_eregi_replace( '#/\\*.*?\\*/#s', '', $html, 'm' );\n\t\t}\n\n\t\t//introduce a space into any arithmetic expressions that could be caught by strip_tags so that they won't be\n\t\t//'<1' becomes '< 1'(note: somewhat application specific)\n\t\t$html = preg_replace(\n\t\t\t[\n\t\t\t\t'/<([0-9]+)/',\n\t\t\t], [\n\t\t\t\t'< $1',\n\t\t\t], $html );\n\t\t$html = strip_tags( $html, $allowed_tags );\n\n\t\t//eliminate extraneous whitespace from start and end of line, or anywhere there are two or more spaces, convert it to one\n\t\t$html = preg_replace(\n\t\t\t[\n\t\t\t\t'/^\\s\\s+/',\n\t\t\t\t'/\\s\\s+$/',\n\t\t\t\t'/\\s\\s+/u',\n\t\t\t], [\n\t\t\t\t'',\n\t\t\t\t'',\n\t\t\t\t' ',\n\t\t\t], $html );\n\n\t\t//strip out inline css and simplify style tags\n\t\t$search = [\n\t\t\t'#<(strong|b)[^>]*>(.*?)</(strong|b)>#isu',\n\t\t\t'#<(em|i)[^>]*>(.*?)</(em|i)>#isu',\n\t\t\t'#<u[^>]*>(.*?)</u>#isu',\n\t\t];\n\t\t$replace = [\n\t\t\t'<b>$2</b>',\n\t\t\t'<i>$2</i>',\n\t\t\t'<u>$1</u>',\n\t\t];\n\t\t$html = preg_replace( $search, $replace, $html );\n\n\t\t//on some of the ?newer MS Word exports, where you get conditionals of the form 'if gte mso 9', etc., it appears\n\t\t//that whatever is in one of the html comments prevents strip_tags from eradicating the html comment that contains\n\t\t//some MS Style Definitions - this last bit gets rid of any leftover comments */\n\t\t$num_matches = preg_match_all( \"/\\<!--/u\", $html, $matches );\n\t\tif ( $num_matches )\n\t\t{\n\t\t\t$html = preg_replace( '/\\<!--(.)*--\\>/isu', '', $html );\n\t\t}\n\n\t\treturn $html;\n\t}", "protected function cleanHTML($html)\n\t{\n\t\t$html = trim($html);\n\t\t// remove multiple tabs\n\t\t$html = preg_replace('/\\t/',\"\",$html);\n\t\t// remove multiple line breaks\n\t\t$html = preg_replace('/(\\n|\\r){2,}/',\"\\n\",$html);\n\t\t// set all paths to absolute\n\t\t$html = preg_replace_callback('/((?:src|href|action)=[\\'\\\"])([^\\'\\\"]*)([\\'\\\"])/',function($matches){\n\t\t\tif ( (preg_match('/^\\/[^\\/]/',$matches[2])) && (!preg_match('/^https?/',$matches[2])) )\n\t\t\t{\n\t\t\t\t$matches[2] = Director::absoluteURL($matches[2]);\n\t\t\t}\n\t\t\treturn $matches[1].$matches[2].$matches[3];\n\t\t},$html);\n\t\treturn $html;\n\t}", "function remove_junk($string){\n /*Inserta un salto de linea por linea*/\n $string = nl2br($string);\n /*Traduccion de comilla doble y etiquetas*/\n $string = htmlspecialchars(strip_tags($string, ENT_QUOTES));\n return $string;\n}", "function htmlToPlainText($str){\n $str = str_replace('&nbsp;', ' ', $str);\n $str = html_entity_decode($str, ENT_QUOTES | ENT_COMPAT , 'UTF-8');\n $str = html_entity_decode($str, ENT_HTML5, 'UTF-8');\n $str = html_entity_decode($str);\n $str = htmlspecialchars_decode($str);\n $str = strip_tags($str);\n \n return $str;\n }", "function clear($sanitize)\n\t{\n\t\t$sanitize = strip_tags($sanitize);\n\t\treturn $sanitize;\n\t}", "function regexcleanhtml($text){\n\t//get rid of unneeded spaces\n\t$text=regexspacecleaner($text);\n\t\n\t//lets get rid of weird spacing first so we can make simpler quearies later\n\t$regex_pattern=\"/<\\s/\"; //makes < followed by a space just < (e.g. slkj < slkj = slkj <slkj)\n\t$text = preg_replace($regex_pattern, \"<\", $text);\n\t$regex_pattern=\"/\\s>/\"; //makes > preceded by a space just > (e.g. slkj > slkj = slkj> slkj)\n\t$text = preg_replace($regex_pattern, \">\", $text);\n\t$regex_pattern=\"/<\\/\\s/\";\n\t$text = preg_replace($regex_pattern, \"</\", $text); //makes </ followed by a space just </ (e.g. slkj </ slkj = slkj </slkj)\n\t\n\treturn $text;\n}", "function safestrip($string){\n $string = strip_tags($string);\n $string = mysql_real_escape_string($string);\n return $string;\n }", "function cleanupContent($content)\n {\n $content=removeInvisibleHtml($content); //remove invisible HTML tags first (strip_tags would only remove tags but leave content between them)\n $content=strip_tags($content); //remove all tags\n $content=preg_replace(\"/[^\\p{L}[:print:]\\s]/u\", \"\", $content); //remove all non-printable characters\n $content=preg_replace(\"/( )+/\", \" \", $content); //replace excess whitespace with single whitespace, preserving new lines\n\n\treturn trim($content); //return clean content\n }", "public function check_html_no_space($html) {\r\n\t\t$html = str_replace(array(\"\\r\", \"\\r\\n\", \"\\n\", \" \", \"\\t\"), '', $html);\r\n\t\treturn $html;\r\n\t}", "public function clean($string){\n return mysqli_real_escape_string($this->db, strip_tags(trim($string)));\n }", "function cleanup($html, $options = null) \n { \n if(isset($options) && is_array($options)){ \n $this->setOptions($options); \n } \n $this->_html = \"{$html}\"; \n\n if($this->_options['UseTidy'] && $this->_options['TidyBefore']){ \n $this->tidyClean(); \n } \n\n // Remove escape slashes \n $this->_html = stripslashes($this -> _html); \n\n if($this->_options['CleaningMethod']['tags'] == \"whitelist\"){ \n // Trim everything before body tag, leaving possible body attributes \n if(preg_match(\"/<body/i\", \"{$this -> _html}\")){ \n $this -> html = stristr($this -> _html, \"<body\"); \n } \n\n // strip tags, still leaving attributes, second variable is allowed tags \n $this->_html = strip_tags($this->_html, $this->_tag_whitelist); \n } \n\n if($this->_options['RemoveStyles']){ \n // Remove class and style attributes \n $this->removeBlacklistedAttributes(\"class|style\"); \n } \n\n if($this->_options['IsWord']){ \n $this->removeBlacklistedAttributes(\"lang|[ovwxp]:\\w+\"); \n } \n\n if($this->_options['CleaningMethod']['attributes'] == \"blacklist\"){ \n if(!empty ($this->_attrib_blacklist)){ \n $this->removeBlacklistedAttributes($this->_attrib_blacklist); \n } \n } \n\n if($this->_options['Optimize']){ \n $repl = 1; \n while($repl){ \n $repl = 0; \n foreach($this->_cleanup_tags as $tag){ \n // Strip empty inline tags \n $this -> _html = preg_replace(\"/<($tag)[^>]*>[\\s]*([(&nbsp;)]*)[\\s]*<\\/($tag)>/i\",\"\\\\2\", $this -> _html,-1,$count); \n $repl += $count; \n\n // Merge inline tags \n $this -> _html = preg_replace(\"/<\\/($tag)[^>]*>[\\s]*([(&nbsp;)]*)[\\s]*<($tag)>/i\",\"\\\\2\", $this -> _html,-1,$count); \n $repl += $count; \n } \n } \n\n // Drop empty paragraph tags \n if($this->_options['DropEmptyParas']){ \n $this -> _html = preg_replace('/<(p|h[1-6]{1})([^>]*)>[\\s]*[(&nbsp;)]*[\\s]*<\\/(p|h[1-6]{1})>/i',\"\\r\\n\", $this -> _html); \n } \n\n // Trim extra spaces only if tidy is not set to indent \n if(!$this->_tidy_config['indent']){ \n // Trim extra spaces between words \n $this -> _html = preg_replace('/([^<>])[\\s]+([^<>])/i',\"\\\\1 \\\\2\", $this -> _html); \n\n // Trim extra spaces before tags \n $this -> _html = preg_replace('/[\\n|\\r|\\r\\n|][\\n|\\r|\\r\\n|]+</i',\"<\", $this -> _html); \n } \n } \n\n if($this->_options['DropEmptyParas'] && !$this->_options['Optimize']){ \n $this -> _html = preg_replace('/<(p|h[1-6]{1})([^>]*)>[\\s]*[(&nbsp;)]*[\\s]*<\\/(p|h[1-6]{1})>/i',\"\\r\\n\", $this -> _html); \n } \n\n if($this->_options['FillEmptyTableCells']) { \n $this -> _html = preg_replace(\"/<td([^>]*)>[\\s]*<\\/td>/i\", \"<td\\\\1>&nbsp;</td>\", $this -> _html); \n } \n\n if($this->_options['Compress']){ \n // Trim spaces after tags \n $this -> _html = preg_replace('/>[\\s]+/',\">\", $this -> _html); \n\n // Trim spaces before end tags \n $this -> _html = preg_replace('/[\\s]+<\\//',\"</\", $this -> _html); \n\n // Trim spaces before tags \n $this -> _html = preg_replace('/[\\s]+</',\"<\", $this -> _html); \n\n // Trim extra spaces between words \n $this -> _html = preg_replace('/([^<>])[\\s]+([^<>])/',\"\\\\1 \\\\2\", $this -> _html); \n } \n\n if($this->_options['UseTidy'] && !$this->_options['TidyBefore']){ \n $this->tidyClean(); \n } \n return $this->output(\"{$this->_html}\"); \n }", "public function debugstrip($string) {\n if (\\Drupal::service('twig')->isDebug()) {\n $string = trim(strip_tags($string));\n }\n else {\n $string = trim($string);\n }\n\n return $string;\n }", "static function login_html_sanitization($input)\r\n {\r\n return strip_tags($input);\r\n }", "function removePartialTags($string) {\r\n\t\t$pos_close = strpos($string, \">\");\r\n\t\tif($pos_close != false) {\r\n\t\t\t$string = substr($string, $pos_close + 1);\r\n\t\t}\r\n\t\t$pos_open = strpos($string, \"<\");\r\n\t\tif($pos_open != false) {\r\n\t\t\t$string = substr($string, 0, $pos_open);\r\n\t\t}\r\n\t\t//print('removePartialTags cleaned string: ' . $string);\r\n\t\treturn $string;\r\n\t}", "function string_restore_valid_html_tags( $p_string, $p_multiline = true ) \r\n{\r\n\t$t_html_valid_tags = config_get( $p_multiline ? 'html_valid_tags' : 'html_valid_tags_single_line' );\r\n\r\n\tif ( OFF === $t_html_valid_tags || is_blank( $t_html_valid_tags ) ) {\r\n\t\treturn $p_string;\r\n\t}\r\n\r\n\t$tags = explode( ',', $t_html_valid_tags );\r\n\tforeach ($tags as $key => $value) \r\n\t{ \r\n \tif ( !is_blank( $value ) ) {\r\n \t$tags[$key] = trim($value); \r\n }\r\n }\r\n $tags = implode( '|', $tags);\r\n\r\n\t$p_string = preg_replace( '/&lt;(' . $tags . ')\\s*&gt;/ui', '<\\\\1>', $p_string );\r\n\t$p_string = preg_replace( '/&lt;\\/(' . $tags . ')\\s*&gt;/ui', '</\\\\1>', $p_string );\r\n\t$p_string = preg_replace( '/&lt;(' . $tags . ')\\s*\\/&gt;/ui', '<\\\\1 />', $p_string );\r\n\r\n\r\n\treturn $p_string;\r\n}", "static function cleanString( $st_string )\r\n {\r\n return addslashes(strip_tags($st_string));\r\n }" ]
[ "0.8133429", "0.77781814", "0.7695726", "0.7693626", "0.768575", "0.75820607", "0.75630057", "0.75378245", "0.75006753", "0.7456761", "0.74267524", "0.7424965", "0.74137926", "0.740581", "0.72895074", "0.71988535", "0.7169908", "0.7164312", "0.71172", "0.70706695", "0.70354486", "0.7029652", "0.7014985", "0.70081025", "0.7007163", "0.6995426", "0.69757813", "0.6968868", "0.6954256", "0.6953535", "0.6936792", "0.6936718", "0.69071794", "0.6895004", "0.6886958", "0.6882737", "0.6837696", "0.68375313", "0.680957", "0.68001217", "0.6799655", "0.6796003", "0.6768094", "0.6754588", "0.67475814", "0.67171645", "0.6687403", "0.66761297", "0.6663852", "0.66605043", "0.66594875", "0.66565776", "0.66481775", "0.6631514", "0.6624963", "0.6609816", "0.65951824", "0.6594211", "0.65931416", "0.6578201", "0.6577024", "0.65608144", "0.6559518", "0.6558249", "0.6558249", "0.654757", "0.65287215", "0.6524861", "0.6520415", "0.6514156", "0.65129536", "0.65100276", "0.6492821", "0.64854985", "0.6483113", "0.64812773", "0.64767534", "0.64736325", "0.64579964", "0.64451265", "0.64377546", "0.6429419", "0.6415481", "0.6412846", "0.6381521", "0.6378454", "0.6373682", "0.63694584", "0.63619775", "0.6354689", "0.6345172", "0.63438964", "0.63400465", "0.63349634", "0.631983", "0.63020664", "0.62951976", "0.62935793", "0.6293542", "0.6283555" ]
0.74774706
9
open the given URL to send data to it, we expect the response to contain at least __OK__= followed by true or false
function SendToCRM($s_url) { @ $fp = fopen($s_url,"r"); if (!$fp) { SendAlert("Failed to open CRM URL '$s_url'"); return; } $s_mesg = ""; while (!feof($fp)) { $s_line = fgets($fp,4096); $s_mesg .= $s_line; } $s_mesg = StripHTML($s_mesg); $s_result = preg_match('/__OK__=(.*)/',$s_mesg,$a_matches); if (count($a_matches) < 2 || strtolower($a_matches[1]) !== "true") SendAlert("SendToCRM failed (url='$s_url'): '$s_mesg'"); fclose($fp); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function sendRequest() {\n $response = file_get_contents($this->url);\n\n if ($response) {\n\n $this->response = $response;\n return true;\n } else {\n\n return false;\n }\n }", "function sendRequest(){\n $this->fpopened = $this->fopen($this->urltoopen);\n if ($this->fpopened!==false) return true;\n return false;\n }", "function http_send_data($data) {}", "function ccweb_httpPost2($url, $data, &$outResponse) { \r\n $params = array('http' => array('method' => 'POST', 'content' => $data)); \r\n $context = stream_context_create($params);\r\n\r\n $fh = fopen($url, 'rb', false, $context);\r\n if (!$fh) {return FALSE;} \r\n \r\n $response = stream_get_contents($fh); \r\n if ($response === false) {return FALSE;} \r\n \r\n $outResponse = $response; \r\n return TRUE; \r\n}", "public function sendRequest($sUrl);", "public function doPostRequest($url, $data, $headers = array('Content-Type: application/x-www-form-urlencoded')) {\r\n $php_errormsg = '';\r\n if (is_array($data)) {\r\n $data = http_build_query($data, '', '&');\r\n }\r\n $params = array('http' => array(\r\n 'method' => 'POST',\r\n 'content' => $data)\r\n );\r\n if ($headers !== null) {\r\n $params['http']['header'] = $headers;\r\n }\r\n $ctx = stream_context_create($params);\r\n $fp = fopen($url, 'rb', false, $ctx);\r\n if (!$fp) {\r\n return \"Error: gateway is inaccessible\";\r\n }\r\n //stream_set_timeout($fp, 0, 250);\r\n try {\r\n $response = stream_get_contents($fp);\r\n if ($response === false) {\r\n throw new Exception(\"Problem reading data from $url, $php_errormsg\");\r\n }\r\n return $response;\r\n } catch (Exception $e) {\r\n $response = $e->getMessage();\r\n return $response;\r\n }\r\n}", "protected function sendRequest($url)\n {\n $response = Tools::file_get_contents($url);\n\n if ($response === false) {\n throw new Exception('Unable to establish connection to service');\n } else {\n return true;\n }\n }", "function request($url, $options = array()) {\n\n\t\t// parse request\n\t\t$request = $this->_parseRequest($url, $options);\n\n\t\t// set host\n\t\t$host = $request['url']['scheme'] == 'https' ? sprintf('ssl://%s', $request['url']['host']) : $request['url']['host'];\n\t\t\n\t\t// connect with fsockopen\n\t\t$res = false;\n\t $fp = @fsockopen($host, $request['url']['port'], $errno, $errstr, $request['url']['timeout']);\n\t if ($fp !== false) {\n\t @fwrite($fp, $request['raw']);\n\t while (!feof($fp)) {\n\t $res .= fgets($fp, 4096);\n\t }\n\t @fclose($fp);\n\t }\n\n\t\t// parse response\n\t\t$res = $this->_parseResponse($res);\n\t\n\t\t// save to file\n\t\tif ($res && $request['file'] && file_put_contents($request['file'], $res['body']) === false) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn $res;\n\t}", "function Send($url, $POST){ //работа с CURL'ом\n\t$ch = curl_init();// Устанавливаем соединение\n\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);\n\tcurl_setopt($ch, CURLOPT_POST, 1);\n\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $POST);\n\tcurl_setopt($ch, CURLOPT_TIMEOUT, 10);\n\tcurl_setopt($ch, CURLOPT_URL, $url);\n\n\t$result = curl_exec($ch);\n\n\tif($result === false) print $err = curl_error($ch);\n\n\treturn $result;\n}", "private function request($url)\n\t{\n\t\t$curl_handler = curl_init();\n\n\t\t$url = $url . \"&api_key=\" . $this->apikey;\n\n\t\tcurl_setopt($curl_handler, CURLOPT_URL, $url);\n\t\tcurl_setopt($curl_handler, CURLOPT_RETURNTRANSFER, 1);\n\n\t\t$response = curl_exec($curl_handler);\n\n\t\tcurl_close($curl_handler);\n\n\t\tif ($response !== false)\n\t\t{\n\t\t\treturn $response;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}", "function sendHttp($url, $data) {\n\n // verify that the URL uses a supported protocol.\n if( (strpos($url, \"http://\")=== 0) || (strpos($url, \"https://\")=== 0) ) {\n\n // create a new cURL resource\n $ch = curl_init($url);\n\n // set URL and other appropriate options\n curl_setopt($ch, CURLOPT_POST,1);\n curl_setopt($ch, CURLOPT_POSTFIELDS, \"cmpi_msg=\".urlencode($data));\n curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);\n curl_setopt($ch, CURLOPT_TIMEOUT, 8);\n\n // Execute the request.\n $result = curl_exec($ch);\n $succeeded = curl_errno($ch) == 0 ? true : false;\n\n // close cURL resource, and free up system resources\n curl_close($ch);\n\n // If Communication was not successful set error result, otherwise\n if (!$succeeded) {\n $this->recordToLog(array('3dRequest' => '[' . tep_session_id() . '] Centinel Request: ' . $data), 'request');\n $this->recordToLog(array('3dResponse' => '[' . tep_session_id() . '] Cardinal Centinel - ' . CENTINEL_ERROR_CODE_8030_DESC, $result), 'response');\n $result = $this->setErrorResponse(CENTINEL_ERROR_CODE_8030, CENTINEL_ERROR_CODE_8030_DESC);\n\n } else {\n\n // Assert that we received an expected Centinel Message in reponse.\n if (strpos($result, \"<CardinalMPI>\") === false) {\n $this->recordToLog(array('3dRequest' => '[' . tep_session_id() . '] Centinel Request: ' . $data), 'request');\n $this->recordToLog(array('3dResponse' => '[' . tep_session_id() . '] Cardinal Centinel - ' . CENTINEL_ERROR_CODE_8010_DESC, $result), 'response');\n $result = $this->setErrorResponse(CENTINEL_ERROR_CODE_8010, CENTINEL_ERROR_CODE_8010_DESC);\n }\n }\n\n } else {\n $this->recordToLog(array('3dResponse' => '[' . tep_session_id() . '] Cardinal Centinel - ' . CENTINEL_ERROR_CODE_8000_DESC . ' - ' . $url), 'response');\n $result = $this->setErrorResponse(CENTINEL_ERROR_CODE_8000, CENTINEL_ERROR_CODE_8000_DESC);\n }\n\n return $result;\n }", "private function sendGetRequest($url)\n {\n // Send the request and process the response\n $guzzleResponse = $this->client->request('GET', $url);\n $this->lastResponse = new SmartwaiverResponse($guzzleResponse);\n }", "function do_post_request($url, $data, $optional_headers = null)\n {\n\t \n$params = array('http' => array(\n 'method' => 'POST',\n 'content' => $data\n ));\n if ($optional_headers !== null) {\n $params['http']['header'] = $optional_headers;\n }\n $ctx = stream_context_create($params);\n $fp = @fopen($url, 'rb', false, $ctx);\n if (!$fp) {\n throw new Exception(\"Problem with $url, $php_errormsg\");\n }\n $response = @stream_get_contents($fp);\n if ($response === false) {\n throw new Exception(\"Problem reading data from $url, $php_errormsg\");\n }\n\t //print_r($response);\n return $response;\n }", "public function send()\n\t{\n\t\t$url \t\t= $this->getURL();\t\t\n\t\t$data \t\t= $this->getData();\n\t\t$method \t= $this->getMethod();\n\t\t\t\t\n\t\t$ch = curl_init();\n\t\t$options = $this->_options;\n\t\tcurl_setopt_array($ch, array(\n\t\t\tCURLOPT_USERAGENT \t => $options->useragent,\n\t\t\tCURLOPT_CONNECTTIMEOUT => $options->connection_timeout,\n\t\t\tCURLOPT_TIMEOUT\t\t => $options->timeout,\n\t\t\tCURLOPT_RETURNTRANSFER => true,\n\t\t\tCURLINFO_HEADER_OUT\t => true,\n\t\t\tCURLOPT_SSL_VERIFYPEER => $options->ssl,\n\t\t\tCURLOPT_HEADER\t\t => false\n\t\t));\n\t \n $headers = array();\n //if data is string then \n //set the authorization header\n //A Hack to make the linked-in work wihtout affecting\n //other services\n if ( is_string($this->_data) ) {\n $headers[] = $this->_internal_request->to_header();\n $headers[] = \"Content-Type: text/plain\";\n }\n \n if ( !empty($headers) )\n curl_setopt($ch,CURLOPT_HTTPHEADER,$headers);\n \n\t\tswitch ($method) \n\t\t{\n\t\t\tcase KHttpRequest::POST :\n\t\t\t\tcurl_setopt($ch, CURLOPT_POST, true);\n\t\t\t\tif (!empty($data)) curl_setopt($ch, CURLOPT_POSTFIELDS, $data);\n\t\t\t\tbreak;\n\t\t\tcase KHttpRequest::PUT\t: \n\t\t\t\tcurl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT');\n\t\t\t\tif (!empty($data)) curl_setopt($ch, CURLOPT_POSTFIELDS, $data);\n\t\t\t\tbreak;\t\n\t\t\tcase KHttpRequest::DELETE:\n\t\t\t\tcurl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'DELETE');\n\t\t\t\tif (!empty($data)) curl_setopt($ch, CURLOPT_POSTFIELDS, $data);\n\t\t}\n\t\t\n\t\tcurl_setopt($ch, CURLOPT_URL, $url);\n\t\t\t\t\n\t\t$response = curl_exec($ch);\n\t\t\n\t\treturn new ComConnectOauthResponse($response, curl_getinfo($ch));\n\t}", "public function testItRespondsSuccesfully()\n {\n $response = $this->api->send_request($this->location);\n\n $this->assertEquals(200, $response->getStatusCode());\n }", "private function callUrl($url)\r\n\t{\r\n\r\n\t\t$ch\t\t = curl_init();\r\n\t\tcurl_setopt($ch, CURLOPT_URL, $url);\r\n\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $this -> payload);\r\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\r\n\t\tcurl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);\r\n\t\t$data\t = curl_exec($ch);\r\n\t\t$err\t = curl_errno($ch);\r\n\r\n\t\tif ($err > 0) {\r\n\t\t\t$this -> errorMessage = curl_error($ch);\r\n\t\t}\r\n\r\n\t\t$this -> errorCode = $err;\r\n\r\n\t\tcurl_close($ch);\r\n\r\n\t\treturn $err == 0 ? $data : false;\r\n\t}", "function callUrl($url) {\n\t\tif (preg_match('/http:\\/\\/([^\\/]+)(.*)/i', $url, $regs)) {\n\t\t\t$host = $regs[1];\n\t\t\t$path = $regs[2];\n\t\t\t\n\t\t\t$fp=fsockopen($host,80);\n\t\t\t$header = \"GET \".$path.\" HTTP/1.1\\r\\n\";\n\t\t\t$header .= \"Host: \".$host.\"\\r\\n\";\n\t\t\t$header .= \"Connection: Close\\r\\n\\r\\n\";\n\t\t\tfputs($fp,$header);\n\t\t\treturn $fp;\n\t\t}\n\t\treturn false;\n\t}", "public function send()\n {\n if (is_null($this->url)) {\n return false;\n }\n\n if (!is_null($this->payloadFilename)) {\n $this->httpClient->payloadFromFile($this->payloadFilename);\n $this->payload = null; // Kill it if we have it\n }\n\n if (!is_null($this->outputFilename)) {\n $this->httpClient->outputBodyToFile($this->outputFilename);\n }\n\n $headers = $this->headers->toArray();\n $response = false;\n switch ($this->requestType) {\n case Client::REQUEST_HEAD:\n case Client::REQUEST_GET:\n $response = $this->httpClient->request($this->url, $this->requestType, $headers);\n case Client::REQUEST_DELETE:\n case Client::REQUEST_PUT:\n case Client::REQUEST_PATCH:\n case Client::REQUEST_POST:\n $response = $this->httpClient->request($this->url, $this->requestType, $headers, $this->payload);\n }\n\n return $response;\n }", "private function doPost($url, $data) {\n $options = array(\n 'http' => array(\n 'header' => \"Content-type: application/x-www-form-urlencoded\\r\\n\",\n 'method' => 'POST',\n 'content' => http_build_query($data),\n ),\n );\n\n $context = stream_context_create($options);\n $result = file_get_contents($url, false, $context);\n\n Logger::info(\"Got result from GW: \". $result);\n }", "public function send()\n {\n $this->_request($this->_get_send_url());\n if ( $this->response['error'] ) {\n $this->actionStatus = parent::ACTION_STATUS_FAIL;\n $this->dataExplained['' . parent::KEY_RESPONSE_STATUS . ''] = $this->response['status'];\n $this->dataExplained['' . parent::KEY_ERROR_CODE] = $this->response['error'];\n return false;\n } else {\n $this->actionStatus = ($this->response['status'] == self::RESPONSE_OK) ? parent::ACTION_STATUS_SUCCESS : parent::ACTION_STATUS_FAIL;\n $this->dataExplained['' . parent::KEY_RESPONSE_STATUS . ''] = $this->response['status'];\n $this->dataExplained['' . parent::KEY_SMS_ID . ''] = $this->getSMSId();\n return true;\n }\n }", "function request($url, $options = array()) {\n\t\t\n\t\tif ($this->transport) {\n\t\t\treturn $this->transport->request($url, $options);\n\t\t}\n\t\t\n\t\treturn false;\n\t}", "function mi_http_request($url, $data)\r\n{\r\n\r\n $curl = curl_init($url);\r\n curl_setopt($curl, CURLOPT_POST, true);\r\n curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($data));\r\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\r\n $response = curl_exec($curl);\r\n curl_close($curl);\r\n return $response;\r\n}", "private function sendCurl($url) {\n $handle = curl_init();\n $opts = curl_setopt_array($handle, array(\n CURLOPT_RETURNTRANSFER => 1,\n CURLOPT_URL => 'https://' . $url . \"&method=CURL\",\n CURLOPT_USERAGENT => $_SERVER['HTTP_USER_AGENT'],\n CURLOPT_POST => 1,\n CURLOPT_POSTFIELDS => $this->payload\n ));\n // Send the request & save response to $resp\n $exec = curl_exec($handle);\n // Close request to clear up some resources\n $close = curl_close($handle);\n\n //$json_array = json_decode($exec, TRUE);\n\n if($this->testing) echo \"<hr /><h1>JSON RESPONSE:</h1><br />$exec <hr />\";\n }", "function http_send_status($status) {}", "private function submitRequest($url, $data) { \n\t\t$accessToken = $this->getAccessToken();\n\t\tif($accessToken == '' || $accessToken == FALSE) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$curl = curl_init();\n\t\tcurl_setopt($curl, CURLOPT_URL, $url);\n\t\tcurl_setopt($curl, CURLOPT_HTTPHEADER, array('Content-Type: application/json','Authorization: Bearer '.$accessToken));\n\n\t\tcurl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\n\t\tcurl_setopt($curl, CURLOPT_POST, true);\n\t\tcurl_setopt($curl, CURLOPT_POSTFIELDS, $data);\n\n\t\t$response = curl_exec($curl);\n\t\tcurl_close($curl);\n\n\t\treturn $response;\n\t}", "public function sendRequest()\n\t{\n\t\tphpCAS::traceBegin();\n\t\t$ch = curl_init($this->url);\n\t\tif(is_null($this->url) || ! $this->url)\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t\t/**\n\t\t * *******************************************************\n\t\t * Set SSL configuration\n\t\t * *******************************************************\n\t\t */\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);\n\t\tcurl_setopt($ch, CURLOPT_USERAGENT,'casUA_wa67h28m_alliance');\n\t\tif($this->caCertPath)\n\t\t{\n\t\t\tcurl_setopt($ch, CURLOPT_CAINFO, $this->caCertPath['pem']);\n\t\t\tcurl_setopt($ch, CURLOPT_SSLCERT, $this->caCertPath['crt']);\n\t\t\tcurl_setopt($ch, CURLOPT_SSLKEY, $this->caCertPath['key']);\n\t\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\t\t\tphpCAS::trace('CURL: Set CURLOPT_CAINFO');\n\t\t}\n\t\t\n\t\t// return the CURL output into a variable\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\t\t/**\n\t\t * *******************************************************\n\t\t * Perform the query\n\t\t * *******************************************************\n\t\t */\n\t\t$buf = curl_exec($ch);\n\t\tif($buf === false)\n\t\t{\n\t\t\tphpCAS::trace('curl_exec() failed');\n\t\t\t$this->storeErrorMessage('CURL error #' . curl_errno($ch) . ': ' . curl_error($ch));\n\t\t\t$res = false;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->storeResponseBody($buf);\n\t\t\tphpCAS::trace(\"Response Body: \\n\" . $buf . \"\\n\");\n\t\t\t$res = true;\n\t\t}\n\t\t// close the CURL session\n\t\tcurl_close($ch);\n\t\t\n\t\tphpCAS::traceEnd($res);\n\t\treturn $res;\n\t}", "public static function sendOkResponse(){\n http_response_code(200);\n die();\n }", "function request($url, $options = array()) {\n\n\t\t// parse request\n\t\t$request = $this->_parseRequest($url, $options);\n\n\t\t// create stream options \n\t\t$options = array('http' =>\n\t\t\tarray('method' => $request['method'],\n\t\t\t \t 'protocol_version' => $request['version'],\n\t\t\t\t 'max_redirects' => $request['redirects'],\n\t\t\t\t 'timeout' => $request['timeout'],\n\t\t\t\t 'ignore_errors' => true,\n\t\t\t\t 'content' => $request['body']\n\t\t\t\t)\n\t\t\t);\n\n\t\t// create header string\n\t\t$options['http']['header'] = $this->_buildHeader($request['header']);\n\t\tif (!empty($request['cookies'])) {\n\t\t\t$options['http']['header'] .= $this->buildCookies($request['cookies']);\n\t\t}\n\n\t\t// connect with fopen and streams\n\t\t$res = false;\n\t $fp = @fopen($url, 'r', false, stream_context_create($options));\n\t\t$res = stream_get_contents($fp);\n\t\t$meta = stream_get_meta_data($fp);\n\t\tfclose($fp);\n\n\t\t// parse response\n\t\t$res = $this->_parseResponse((isset($meta['wrapper_data']) ? implode($this->line_break, $meta['wrapper_data']).$this->line_break.$this->line_break : null).$res);\n\n\t\t// save to file\n\t\tif ($res && $request['file'] && file_put_contents($request['file'], $res['body']) === false) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn $res;\n\t}", "private function getResponse($validUrl){\n\n $curl = curl_init(); // Initialize a cURL session\n\n curl_setopt($curl, CURLOPT_URL, $validUrl); // add url into request . \n\n curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0); // skip ssl verification.\n\n curl_setopt($curl, CURLOPT_VERBOSE, 1); // to output verbose information. \n\n curl_setopt($curl, CURLOPT_POST, false);\n \n curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); //to return the transfer as a string \n \n $response = curl_exec($curl); // Execute the cURL session . \n\n curl_close($curl); // Close a cURL session.\n\n return $response ; \n }", "function do_post_request($url, $data, $optional_headers = null)\n{\n $params = array('http' => array(\n 'method' => 'POST',\n 'content' => $data\n ));\n if ($optional_headers !== null) {\n $params['http']['header'] = $optional_headers;\n }\n $ctx = stream_context_create($params);\n $fp = @fopen($url, 'rb', false, $ctx);\n if (!$fp) {\n throw new Exception(\"Problem with $url, $php_errormsg\");\n }\n $response = @stream_get_contents($fp);\n if ($response === false) {\n throw new Exception(\"Problem reading data from $url, $php_errormsg\");\n }\n return $response;\n}", "function urlOK($url)\n{\n $headers = @get_headers($url);\n if(strpos($headers[0],'200')===false){return false;}else{return true;}\n}", "function check_url($url, $post=false) {\r\n $ch = curl_init($url);\r\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);\r\n curl_setopt($ch, CURLOPT_TIMEOUT,1);\r\n if ($post) {\r\n curl_setopt($ch, CURLOPT_POST, true);\r\n curl_setopt($ch, CURLOPT_HTTPHEADER, $_SESSION['plex_headers']);\r\n }\r\n /* Get the HTML or whatever is linked in $url. */\r\n $response = curl_exec($ch);\r\n\r\n /* Check for 404 (file not found). */\r\n $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);\r\n curl_close($ch);\r\n\r\n /* If the document has loaded successfully without any redirection or error */\r\n if ($httpCode >= 200 && $httpCode < 300) {\r\n write_log(\"Connection is valid: \".$url);\r\n return true;\r\n } else {\r\n write_log(\"Connection failed with error code \".$httpCode.\": \".$url,\"ERROR\");\r\n return false;\r\n }\r\n }", "function do_it_background($url, $params)\n {\n $post_string = http_build_query($params);\n $parts = parse_url($url);\n $errno = 0;\n $errstr = \"\";\n \n //Use SSL & port 443 for secure servers\n //Use otherwise for localhost and non-secure servers\n //For secure server\n //$fp = fsockopen('ssl://' . $parts['host'], isset($parts['port']) ? $parts['port'] : 443, $errno, $errstr, 30);\n //For localhost and un-secure server\n $fp = fsockopen($parts['host'], isset($parts['port']) ? $parts['port'] : 80, $errno, $errstr, 30);\n \n if(!$fp)\n {\n echo \"Some thing Problem\"; \n }\n $out = \"POST \".$parts['path'].\" HTTP/1.1\\r\\n\";\n $out.= \"Host: \".$parts['host'].\"\\r\\n\";\n $out.= \"Content-Type: application/x-www-form-urlencoded\\r\\n\";\n $out.= \"Content-Length: \".strlen($post_string).\"\\r\\n\";\n $out.= \"Connection: Close\\r\\n\\r\\n\";\n if (isset($post_string)) $out.= $post_string;\n fwrite($fp, $out);\n fclose($fp);\n }", "public function send() {\n\t\tif (isset($this->_headers['Location']) && $this->_status === 200) {\n\t\t\t$this->statusCode(302);\n\t\t}\n\n\t\t$codeMessage = $this->_statusCodes[$this->_status];\n\t\t$this->_setCookies();\n\t\t$this->_sendHeader(\"{$this->_protocol} {$this->_status} {$codeMessage}\");\n\t\t$this->_setContent();\n\t\t$this->_setContentLength();\n\t\t$this->_setContentType();\n\t\tforeach ($this->_headers as $header => $values) {\n\t\t\tforeach ((array)$values as $value) {\n\t\t\t\t$this->_sendHeader($header, $value);\n\t\t\t}\n\t\t}\n\t\tif ($this->_file) {\n\t\t\t$this->_sendFile($this->_file, $this->_fileRange);\n\t\t\t$this->_file = $this->_fileRange = null;\n\t\t} else {\n\t\t\t$this->_sendContent($this->_body);\n\t\t}\n\t}", "function send_request() { \n if(!$this->connect()) { \n return false; \n } \n else { \n $this->result = $this->request($this->data);\n return $this->result; \n } \n }", "private function sendCurl($url,$data,$headers_array)\r\n {\r\n $ch = curl_init();\r\n curl_setopt($ch, CURLOPT_URL, $url);\r\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\r\n curl_setopt($ch, CURLOPT_POST, true);\r\n curl_setopt($ch,CURLOPT_POSTFIELDS, $data);\r\n curl_setopt($ch,CURLOPT_HTTPHEADER, $headers_array);\r\n $response = trim(curl_exec($ch));\r\n curl_close($ch);\r\n return $response;\r\n }", "function fetchURL ($url, $param) {\n $return = array();\n\n $ch = curl_init();\n\n curl_setopt($ch,CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch,CURLOPT_TIMEOUT, 0);\n curl_setopt($ch,CURLOPT_FORBID_REUSE, 1);\n curl_setopt($ch,CURLOPT_FRESH_CONNECT, 1);\n curl_setopt($ch,CURLOPT_HEADER, 1);\n curl_setopt($ch,CURLOPT_URL,$url);\n if ($this->disableSslVerify) {\n $this->log('Caution: Request being sent without SSL verification.', 'Warning');\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);\n }\n if (!empty($param)){\n if (!empty($param['Header'])){\n curl_setopt($ch,CURLOPT_HTTPHEADER, $param['Header']);\n }\n if (!empty($param['Post'])){\n curl_setopt($ch,CURLOPT_POSTFIELDS, $param['Post']);\n }\n }\n \n $data = curl_exec($ch);\n if ( curl_errno($ch) ) {\n $return['ok'] = -1;\n $return['error'] = curl_error($ch);\n return $return;\n }\n \n if (is_numeric(strpos($data, 'HTTP/1.1 100 Continue'))) {\n $data=str_replace('HTTP/1.1 100 Continue', '', $data);\n }\n $data = preg_split(\"/\\r\\n\\r\\n/\",$data, 2, PREG_SPLIT_NO_EMPTY);\n if (!empty($data)) {\n $return['head'] = ( isset($data[0]) ? $data[0] : null );\n $return['body'] = ( isset($data[1]) ? $data[1] : null );\n } else {\n $return['head'] = null;\n $return['body'] = null;\n }\n \n $matches = array();\n $data = preg_match(\"/HTTP\\/[0-9.]+ ([0-9]+) (.+)\\r\\n/\",$return['head'], $matches);\n if (!empty($matches)) {\n $return['code'] = $matches[1];\n $return['answer'] = $matches[2];\n }\n \n $data = preg_match(\"/meta http-equiv=.refresh. +content=.[0-9]*;url=([^'\\\"]*)/i\",$return['body'], $matches);\n if (!empty($matches)) {\n $return['location'] = $matches[1];\n $return['code'] = '301';\n }\n\n if ( $return['code'] == '200' || $return['code'] == '302' ) {\n $return['ok'] = 1;\n } else {\n $return['error'] = (($return['answer'] and $return['answer'] != 'OK') ? $return['answer'] : 'Something wrong!');\n $return['ok'] = 0;\n }\n\n foreach (preg_split('/\\n/', $return['head'], -1, PREG_SPLIT_NO_EMPTY) as $value) {\n $data = preg_split('/:/', $value, 2, PREG_SPLIT_NO_EMPTY);\n if (is_array($data) and isset($data['1'])) {\n $return['headarray'][$data['0']] = trim($data['1']);\n }\n }\n\n curl_close($ch);\n\n return $return;\n }", "function fopen($url) {\n\t\t$this->lastResponse = Array ();\n\n\t\t/*\n\t\t preg_match( \"~([a-z]*://)?([^:^/]*)(:([0-9]{1,5}))?(/.*)?~i\", $url, $matches );\n\n\t\t $protocol = $matches [1];\n\t\t $server = $matches [2];\n\t\t $port = $matches [4];\n\t\t $path = $matches [5];\n\t\t */\n\n\t\t//$protocol = \"http\";\n\t\t$server = \"arxiv.org\";\n\t\t$port = 80;\n\t\t$path = \"/abs/$url\";\n\n\t\tif ($port != \"\") {\n\t\t\t$this->setPort ( $port );\n\t\t}\n\t\tif ($path == \"\")\n\t\t$path = \"/\";\n\t\t\t\n\t\t$socket = fsockopen ( $server, $this->port );\n\t\tif ($socket) {\n\t\t\tif ($this->debug)\n\t\t\techo '<br><b>socket opened...</b>';\n\t\t\t\t\n\t\t\t$this->headerLines [\"Host\"] = $server;\n\t\t\t\t\n\t\t\tif ($this->authUser != \"\" && $this->authPass != \"\") {\n\t\t\t\t$this->headerLines [\"Authorization\"] = \"Basic \" . base64_encode ( $this->authUser . \":\" . $this->authPass );\n\t\t\t}\n\t\t\t\t\n\t\t\t/*\n\t\t\t if (count ( $this->postData ) == 0) {\n\t\t\t\t$request = \"GET $path HTTP/1.0\\r\\n\";\n\t\t\t\t} else {\n\t\t\t\t$request = \"POST $path HTTP/1.0\\r\\n\";\n\t\t\t\t}\n\t\t\t\t*/\n\t\t\t$request = \"GET $path HTTP/1.1\\r\\n\";\n\t\t\t\t\n\t\t\t\t\n\t\t\tif ($this->debug)\n\t\t\techo \"<br><b>REQUEST:</b> $request\";\n\t\t\tfputs ( $socket, $request );\n\t\t\t\t\n\t\t\tif($this->debug) {\n\t\t\t\techo '<b>count ( $this->postData ):</b> ' . count ( $this->postData );\n\t\t\t}\n\t\t\tif (count ( $this->postData ) > 0) {\n\t\t\t\t$PostStringArray = Array ();\n\t\t\t\tforeach ( $this->postData as $key => $value ) {\n\t\t\t\t\t$PostStringArray [] = \"$key=$value\";\n\t\t\t\t}\n\t\t\t\t$PostString = join ( \"&\", $PostStringArray );\n\t\t\t\t$this->headerLines [\"Content-Length\"] = strlen ( $PostString );\n\t\t\t}\n\t\t\t\t\n\t\t\tif ($this->debug)\n\t\t\techo \"<br><b>key & values:</b> \";\n\t\t\tforeach ( $this->headerLines as $key => $value ) {\n\t\t\t\tif ($this->debug)\n\t\t\t\techo \"$key: $value\\n\";\n\t\t\t\tfputs ( $socket, \"$key: $value\\r\\n\" );\n\t\t\t}\n\t\t\t\t\n\t\t\tif ($this->debug)\n\t\t\techo \"\\n\";\n\t\t\tfputs ( $socket, \"\\r\\n\" );\n\t\t\t\t\n\t\t\t\t\n\t\t\tif (count ( $this->postData ) > 0) {\n\t\t\t\tif ($this->debug)\n\t\t\t\techo \"$PostString\";\n\t\t\t\tfputs ( $socket, $PostString . \"\\r\\n\" );\n\t\t\t}\n\t\t\t\t\n\t\t}\n\t\tif ($this->debug)\n\t\techo \"\\n\";\n\t\tif ($socket) {\n\t\t\tif ($this->debug)\n\t\t\techo \"<br><b>SOCKET:</b> $socket\";\n\t\t\t\t\n\t\t\t$line = fgets ( $socket, 1000 );\n\t\t\t// try 5 times more\n\t\t\tif($line == '') {\n\t\t\t\treturn FALSE;\n\t\t\t\t/*\n\t\t\t\t for($i = 0; $i < 5; $i++) {\n\t\t\t\t\tsleep(1);\n\t\t\t\t\t$line = fgets ( $socket, 1000 );\n\t\t\t\t\tif($line != '') {\n\t\t\t\t\tif ($this->debug)\n\t\t\t\t\techo \"<br>Times tried: $i\";\n\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t*/\n\t\t\t}\n\t\t\tif ($this->debug)\n\t\t\techo \"<br>Line 1: $line\";\n\n\t\t\t$this->lastResponse [] = $line;\n\t\t\t$status = substr ( $line, 9, 3 );\n\t\t\t$i = 1;\n\t\t\twhile ( trim ( $line = fgets ( $socket, 1000 ) ) != \"\" ) {\n\t\t\t\t$i++;\n\t\t\t\tif ($this->debug)\n\t\t\t\techo \"<br>Line $i: $line\";\n\t\t\t\t$this->lastResponse [] = $line;\n\t\t\t\tif ($status == \"401\" and strpos ( $line, \"WWW-Authenticate: Basic realm=\\\"\" ) === 0) {\n\t\t\t\t\tif ($this->debug)\n\t\t\t\t\techo \"401\\n\";\n\t\t\t\t\tfclose ( $socket );\n\t\t\t\t\treturn FALSE;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tif ($this->debug)\n\t\t\techo \"<br><b>SOCKET Broken</b>\";\n\t\t}\n\t\treturn $socket;\n\t}", "public function request($url);", "function post_request($url, $param)\n{\n //リクエスト時のオプション指定\n $options = array(\n 'http' => array(\n 'method' => 'POST', //ここでPOSTを指定\n 'header' => array(\n 'Content-type: application/x-www-form-urlencoded',\n 'User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:13.0) Gecko/20100101 Firefox/13.0.1'\n ),\n 'content' => http_build_query($param),\n 'ignore_errors' => true,\n 'protocol_version' => '1.1'\n ),\n 'ssl' => array(\n 'verify_peer' => false,\n 'verify_peer_name' => false\n )\n );\n\n //リクエスト実行\n $contents = @file_get_contents($url, false, stream_context_create($options));\n\n //ステータスコード抜粋\n preg_match('/HTTP\\/1\\.[0|1|x] ([0-9]{3})/', $http_response_header[0], $matches);\n $statusCode = (int)$matches[1];\n\n //配列で返すためにjsonのエンコード\n $contents_array = array();\n if($statusCode === 200){\n $contents_array = json_decode($contents);\n }\n return $contents_array;\n}", "public function download() : bool {\t\n\t\t$req = self::init_req( ( (object) self::$URLS )->download );\n\t\tif( is_null( $req ) ){\n\t\t\treturn false;\n\t\t}\n\t\telse{\n\t\t\tcurl_exec( $req );\n\t\t\tself::$httpCode = curl_getinfo( $req, CURLINFO_HTTP_CODE );\n\t\t\tcurl_close( $req );\n\t\t\treturn true;\n\t\t}\n\t}", "public function sendResponse();", "function http_response($url, $opts = array()) {\n $url = preg_replace('/ /', '%20', $url);\n $ch = curl_init($url);\n curl_setopt($ch, CURLOPT_HEADER, FALSE);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);\n curl_setopt($ch, CURLOPT_USERAGENT, \"uw_transparancy, toolserver.org wikiproject parser\");\n $output = curl_exec($ch);\n // Check for errors\n if (curl_errno($ch)) {\n wpLog(\"Curl error: \" . curl_error($ch));\n return http_response($url);\n }\n\n curl_close($ch);\n\n return $output;\n}", "public function post($data)\n {\n // Get parts of URL\n $this->url = parse_url($this->url);\n if (!$this->url) {\n return \"couldn't parse url\";\n }\n\n // Provide defaults for port and query string\n if (!isset($this->url['port'])) {\n $this->url['port'] = \"\";\n }\n\n if (!isset($this->url['query'])) {\n $this->url['query'] = \"\";\n }\n\n // Build POST string\n $encoded = \"\";\n foreach ($data as $k => $v) {\n $encoded .= ($encoded ? \"&\" : \"\");\n $encoded .= rawurlencode($k) . \"=\" . rawurlencode($v);\n }\n\n // Open socket on host\n $fp = fsockopen($this->url['host'], $this->url['port'] ? $this->url['port'] : 80);\n if (!$fp) {\n return \"failed to open socket to {$this->url['host']}\";\n }\n\n // Send HTTP 1.0 POST request to host\n fputs($fp, sprintf(\"POST %s%s%s HTTP/1.0\\n\", $this->url['path'], $this->url['query'] ? \"?\" : \"\", $this->url['query']));\n fputs($fp, \"Host: {$this->url['host']}\\n\");\n fputs($fp, \"Content-type: application/x-www-form-urlencoded\\n\");\n fputs($fp, \"Content-length: \" . strlen($encoded) . \"\\n\");\n fputs($fp, \"Connection: close\\n\\n\");\n fputs($fp, \"$encoded\\n\");\n\n // Read the first line of data, only accept if 200 OK is sent\n $line = fgets($fp, 1024);\n if (!preg_match('/^HTTP\\/1\\.. 200/i', $line)) {\n return;\n }\n\n // Put everything, except the headers to $results\n $results = '';\n $inheader = true;\n\n while(!feof($fp)) {\n $line = fgets($fp, 1024);\n\n if ($inheader && ($line == \"\\n\" || $line == \"\\r\\n\")) {\n $inheader = FALSE;\n } elseif (!$inheader) {\n $results .= $line;\n }\n }\n fclose($fp);\n\n // Return with data received\n return $results;\n }", "private function _get($url) {\n\t\t$ch = curl_init ();\n\t\tcurl_setopt ( $ch, CURLOPT_URL, $url );\n\t\tcurl_setopt ( $ch, CURLOPT_USERAGENT, 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322)' );\n\t\tcurl_setopt ( $ch, CURLOPT_RETURNTRANSFER, 1 );\n\t\tcurl_setopt ( $ch, CURLOPT_CONNECTTIMEOUT, 5 );\n\t\tcurl_setopt ( $ch, CURLOPT_TIMEOUT, 5 );\n\t\t$data = curl_exec ( $ch );\n\t\t$httpcode = curl_getinfo ( $ch, CURLINFO_HTTP_CODE );\n\t\tcurl_close ( $ch );\n\t\treturn ($httpcode >= 200 && $httpcode < 300) ? $data : false;\n\t}", "private function checkUrlStatus()\n {\n $request = curl_init($this->url);\n\n curl_setopt($request, CURLOPT_HEADER, true);\n curl_setopt($request, CURLOPT_NOBODY, true);\n curl_setopt($request, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($request, CURLOPT_TIMEOUT, 10);\n\n curl_exec($request);\n $httpCode = curl_getinfo($request, CURLINFO_HTTP_CODE);\n curl_close($request);\n\n if ($httpCode >= 200 && $httpCode < 400) {\n return true;\n }\n\n return false;\n }", "public function sendCurl() {\n\t\t$this->curlResponse = $this->curl->exec();\n\t}", "private function callStatus() {\n try {\n $this->status = $this->client->request('GET', $this->url->full_url, [\n 'allow_redirects' => false\n ]);\n } catch (\\Exception $ex) {\n $this->status = $ex->getResponse();\n }\n }", "public function ping()\r\n {\r\n $ch = curl_init();\r\n curl_setopt($ch, CURLOPT_URL, \"http://\".WEMO_IP.\":\".WEMO_PORT);\r\n curl_setopt($ch, CURLOPT_NOBODY, true);\r\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);\r\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\r\n curl_setopt($ch, CURLOPT_VERBOSE, false);\r\n curl_setopt($ch, CURLOPT_TIMEOUT, 5);\r\n $result = curl_exec($ch);\r\n $httpcode = curl_getinfo($ch, CURLINFO_HTTP_CODE);\r\n curl_close($ch);\r\n if($httpcode >= 200 && $httpcode <500){\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n }", "public function send() {\n\t\t$this->response = $this->curl->send($this, $this->autoFollow, $this->maxRedirects);\n\t\treturn $this->response;\n\t}", "public static function sendCurl($_url, $_params)\n {\n $Curl = curl_init();\n $_params[CURLOPT_URL] = $_url;\n curl_setopt_array($Curl, $_params);\n\n $CurlOutput = curl_exec($Curl);\n\n if (curl_errno($Curl)) {\n echo(\"Remote service error: \".curl_error($Curl).\".\");\n }\n\n curl_close($Curl);\n\n return $CurlOutput;\n }", "function httpPOST($url, array $data, $headers = '') {\n $this->ensureOpened(__FUNCTION__);\n $query = http_build_query($data, '', '&');\n ($headers = trim($headers) === '') or $headers .= \"\\r\\n\";\n\n $headers = \"POST $url HTTP/1.0\\r\\n\".\n $headers.\n \"Content-Type: application/x-www-form-urlencoded\\r\\n\".\n \"Content-Length: \".strlen($query).\"\\r\\n\".\n \"$query\\r\\n\";\n\n $this->write($headers);\n return $this->readAllAndClose();\n }", "function url_test( $url ) {\n $timeout = 10;\n $ch = curl_init();\n curl_setopt ( $ch, CURLOPT_URL, $url );\n curl_setopt ( $ch, CURLOPT_RETURNTRANSFER, 1 );\n curl_setopt ( $ch, CURLOPT_TIMEOUT, $timeout );\n $http_respond = curl_exec($ch);\n $http_respond = trim( strip_tags( $http_respond ) );\n $http_code = curl_getinfo( $ch, CURLINFO_HTTP_CODE );\n if ( ( $http_code == \"200\" ) || ( $http_code == \"302\" ) ) {\n return true;\n } else {\n // return $http_code;, possible too\n return false;\n }\n curl_close( $ch );\n}", "public function testCurlGoodUrl()\n {\n $curl = new CurlClass();\n \n $res = $curl->submit('http://feeds.nationalgeographic.com/ng/News/News_Main');\n $this->assertTrue($res, 'test url ktory zwraca kod 200');\n }", "function http($url, $post_data = null) {\n\t\t$ch = curl_init ();\n\t\tif (defined ( \"CURL_CA_BUNDLE_PATH\" ))\n\t\t\tcurl_setopt ( $ch, CURLOPT_CAINFO, CURL_CA_BUNDLE_PATH );\n\t\tcurl_setopt ( $ch, CURLOPT_URL, $url );\n\t\tcurl_setopt ( $ch, CURLOPT_CONNECTTIMEOUT, 30 );\n\t\tcurl_setopt ( $ch, CURLOPT_TIMEOUT, 30 );\n\t\tcurl_setopt ( $ch, CURLOPT_RETURNTRANSFER, 1 );\n\t\t//////////////////////////////////////////////////\n\t\t///// Set to 1 to verify Hots SSL Cert ///////\n\t\t//////////////////////////////////////////////////\n\t\tcurl_setopt ( $ch, CURLOPT_SSL_VERIFYPEER, 0 );\n\t\tif (isset ( $post_data )) {\n\t\t\tcurl_setopt ( $ch, CURLOPT_POST, 1 );\n\t\t\tcurl_setopt ( $ch, CURLOPT_POSTFIELDS, $post_data );\n\t\t}\n\t\t$response = curl_exec ( $ch );\n\t\t$this->http_status = curl_getinfo ( $ch, CURLINFO_HTTP_CODE );\n\t\t$this->last_api_call = $url;\n\t\tcurl_close ( $ch );\n\t\tif(empty($response)) {\n\t\t\treturn 'WP-API might be down or unresponsive. Please go to http://flocks.biz and check if the main website is working. Send us an email to [email protected] in case you have more doubts.';\n\t\t}\n\t\tif(preg_match(\"/request\\-token/i\",$response) || preg_match(\"/access\\-token/i\",$response)) {\n\t\t\t//echo \"<br/><br/>\".preg_replace(array(\"/.*oauth\\_version\\=1\\.0/i\"),array(\"\"),urldecode($response)).\"<br/><br/>\";\n\t\t\treturn preg_replace(array(\"/.*oauth\\_version\\=1\\.0/i\"),array(\"\"),urldecode($response));\n\t\t} else {\n\t\t\t//echo \"<br/><br/>\".$response.\"<br/><br/>\";\n\t\t\treturn $response;\n\t\t}\n\t}", "function call_url($url)\n\t{\n\t\t$ch = curl_init ($url);\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER,true);\n\t\tcurl_setopt ($ch, CURLOPT_SSL_VERIFYHOST, false);\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n\t\tcurl_setopt($ch, CURLOPT_HTTPGET, TRUE);\n\t\t$out = curl_exec($ch);\n\t\tcurl_close($ch);\n\t\t\n\t\treturn $out;\n\t}", "function send($url, $api, $amount, $redirect)\n\t{\n\t\t$ch = curl_init();\n\t\tcurl_setopt($ch, CURLOPT_URL, $url);\n\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, \"api=$api&amount=$amount&redirect=$redirect\");\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t\t$res = curl_exec($ch);\n\t\tcurl_close($ch);\n\t\treturn $res;\n\t}", "public function test_send_returnsSelf_ifStatusIsBad()\n\t{\n\t\t$this->url->getQuery()->setParameter('code', 301);\n\t\t\n\t\t$request = new Request\\Get((string) $this->url);\n\t\t\n\t\t$client = new Client();\n\t\t\n\t\t$this->assertSame($client, $client->send($request));\n\t\t\n\t\treturn;\n\t}", "function http_post($url, $post_string) {\n\t\t\n\t\t// add any additional curl options here\n\t\t$options = array(CURLOPT_URL => $url,\n\t\tCURLOPT_POST => true,\n\t\tCURLOPT_POSTFIELDS => $post_string,\n\t\tCURLOPT_USERAGENT => $this->user_agent);\n\t\t\n\t\t$ch = curl_init();\n\t\tcurl_setopt_array($ch, $options);\n\t\t\n\t\t$response = curl_exec($ch);\n\t\t$this->last_response = $response;\n\t\t$info = curl_getinfo($ch);\n\t\t\n\t\tcurl_close($ch);\n\t\t\n\t\t// all good\n\t\tif ($info['http_code'] == 204)\n\t\t\treturn true;\n\t\treturn false;\n\t}", "public static function _check_status($url){\n $ch = curl_init($url);\n curl_setopt($ch, CURLOPT_NOBODY, true);\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);\n curl_setopt($ch,CURLOPT_TIMEOUT,5);\n curl_exec($ch);\n $retcode = curl_getinfo($ch, CURLINFO_HTTP_CODE);\n curl_close($ch);\n return $retcode;\n }", "function load_url($url, $options = array('method' => 'get', 'return_info' => false))\r\n{\r\n\r\n // added 04-28-08 EG added a default timeout of 15 seconds\r\n if (!isset($options['timeout']))\r\n $options['timeout'] = 15;\r\n\r\n $url_parts = parse_url($url);\r\n if (!array_key_exists('port', $url_parts))\r\n $url_parts['port'] = ($url_parts['scheme'] == \"https\") ? 443 : 80;\r\n $info = array( //Currently only supported by curl.\r\n 'http_code' => 200\r\n );\r\n $response = '';\r\n\r\n $send_header = array(\r\n 'Accept' => 'text/*',\r\n 'User-Agent' => 'BinGet/1.00.A (http://www.bin-co.com/php/scripts/load/)'\r\n );\r\n\r\n ///////////////////////////// Curl /////////////////////////////////////\r\n //If curl is available, use curl to get the data.\r\n if (function_exists(\"curl_init\")\r\n and (!(isset($options['use']) and $options['use'] == 'fsocketopen'))\r\n ) { //Don't user curl if it is specifically stated to user fsocketopen in the options\r\n if (isset($options['method']) and $options['method'] == 'post') {\r\n $page = $url_parts['scheme'] . '://' . $url_parts['host'] . \":\" . $url_parts['port'] . $url_parts['path'];\r\n } else {\r\n $page = $url;\r\n }\r\n\r\n $ch = curl_init($url_parts['host'] . \":\" . $url_parts['port']);\r\n\r\n // added 04-28-08 EG set a timeout\r\n if (isset($options['timeout']))\r\n curl_setopt($ch, CURLOPT_TIMEOUT, $options['timeout']);\r\n\r\n\r\n curl_setopt($ch, CURLOPT_URL, $page);\r\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); //Just return the data - not print the whole thing.\r\n curl_setopt($ch, CURLOPT_HEADER, true); //We need the headers\r\n curl_setopt($ch, CURLOPT_NOBODY, false); //The content - if true, will not download the contents\r\n if (isset($options['method']) and $options['method'] == 'post' and $url_parts['query']) {\r\n curl_setopt($ch, CURLOPT_POST, true);\r\n curl_setopt($ch, CURLOPT_POSTFIELDS, $url_parts['query']);\r\n }\r\n //Set the headers our spiders sends\r\n curl_setopt($ch, CURLOPT_USERAGENT, $send_header['User-Agent']); //The Name of the UserAgent we will be using ;)\r\n $custom_headers = array(\"Accept: \" . $send_header['Accept']);\r\n if (isset($options['modified_since']))\r\n array_push($custom_headers, \"If-Modified-Since: \" . gmdate('D, d M Y H:i:s \\G\\M\\T', strtotime($options['modified_since'])));\r\n curl_setopt($ch, CURLOPT_HTTPHEADER, $custom_headers);\r\n\r\n curl_setopt($ch, CURLOPT_COOKIEJAR, \"cookie.txt\"); //If ever needed...\r\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);\r\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);\r\n curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);\r\n\r\n\r\n if (isset($url_parts['user']) and isset($url_parts['pass'])) {\r\n $custom_headers = array(\"Authorization: Basic \" . base64_encode($url_parts['user'] . ':' . $url_parts['pass']));\r\n curl_setopt($ch, CURLOPT_HTTPHEADER, $custom_headers);\r\n }\r\n\r\n $response = curl_exec($ch);\r\n $info = curl_getinfo($ch); //Some information on the fetch\r\n\r\n curl_close($ch);\r\n\r\n //////////////////////////////////////////// FSockOpen //////////////////////////////\r\n } else { //If there is no curl, use fsocketopen\r\n if (isset($url_parts['query'])) {\r\n if (isset($options['method']) and $options['method'] == 'post')\r\n $page = $url_parts['path'];\r\n else\r\n $page = $url_parts['path'] . '?' . $url_parts['query'];\r\n } else {\r\n $page = $url_parts['path'];\r\n }\r\n\r\n $fp = fsockopen($url_parts['host'], 80, $errno, $errstr, 30);\r\n if ($fp) {\r\n\r\n // added 04-28-08 EG set a timeout\r\n if (isset($options['timeout']))\r\n stream_set_timeout($fp, $options['timeout']);\r\n\r\n $out = '';\r\n if (isset($options['method']) and $options['method'] == 'post' and isset($url_parts['query'])) {\r\n $out .= \"POST $page HTTP/1.1\\r\\n\";\r\n } else {\r\n $out .= \"GET $page HTTP/1.0\\r\\n\"; //HTTP/1.0 is much easier to handle than HTTP/1.1\r\n }\r\n $out .= \"Host: $url_parts[host]\\r\\n\";\r\n $out .= \"Accept: $send_header[Accept]\\r\\n\";\r\n $out .= \"User-Agent: {$send_header['User-Agent']}\\r\\n\";\r\n if (isset($options['modified_since']))\r\n $out .= \"If-Modified-Since: \" . gmdate('D, d M Y H:i:s \\G\\M\\T', strtotime($options['modified_since'])) . \"\\r\\n\";\r\n\r\n $out .= \"Connection: Close\\r\\n\";\r\n\r\n //HTTP Basic Authorization support\r\n if (isset($url_parts['user']) and isset($url_parts['pass'])) {\r\n $out .= \"Authorization: Basic \" . base64_encode($url_parts['user'] . ':' . $url_parts['pass']) . \"\\r\\n\";\r\n }\r\n\r\n //If the request is post - pass the data in a special way.\r\n if (isset($options['method']) and $options['method'] == 'post' and $url_parts['query']) {\r\n $out .= \"Content-Type: application/x-www-form-urlencoded\\r\\n\";\r\n $out .= 'Content-Length: ' . strlen($url_parts['query']) . \"\\r\\n\";\r\n $out .= \"\\r\\n\" . $url_parts['query'];\r\n }\r\n $out .= \"\\r\\n\";\r\n\r\n fwrite($fp, $out);\r\n while (!feof($fp)) {\r\n $response .= fgets($fp, 128);\r\n }\r\n fclose($fp);\r\n }\r\n }\r\n\r\n //Get the headers in an associative array\r\n $headers = array();\r\n\r\n if ($info['http_code'] == 404) {\r\n $body = \"\";\r\n $headers['Status'] = 404;\r\n } else {\r\n //Seperate header and content\r\n //echo \"RESPONSE: \".$response.\"<BR><BR>\\n\";\r\n //exit();\r\n $separator_position = strpos($response, \"\\r\\n\\r\\n\");\r\n $header_text = substr($response, 0, $separator_position);\r\n\r\n $body = substr($response, $separator_position + 4);\r\n\r\n // added 04-28-2008 EG if we get a 301 (moved), another set of headers is received,\r\n if (substr($body, 0, 5) == \"HTTP/\") {\r\n $separator_position = strpos($body, \"\\r\\n\\r\\n\");\r\n $header_text = substr($body, 0, $separator_position);\r\n $body = substr($body, $separator_position + 4);\r\n }\r\n\r\n //echo \"SEP: \".$separator_position.\"<BR><BR>\\n\";\r\n //echo \"HEADER: \".$header_text.\"<BR><BR>\\n\";\r\n //echo \"BODY: \".$body.\"<BR><BR>\\n\";\r\n\r\n foreach (explode(\"\\n\", $header_text) as $line) {\r\n $parts = explode(\": \", $line);\r\n if (count($parts) == 2) $headers[$parts[0]] = chop($parts[1]);\r\n }\r\n }\r\n\r\n if ($options['return_info'])\r\n return array('headers' => $headers, 'body' => $body, 'info' => $info);\r\n return $body;\r\n}", "private function doRequest($method, $url, $data = array()){\n\t\n\t\t// send request to this URL\n\t\tcurl_setopt($this->ch, CURLOPT_URL, $url);\n\t\t\n\t\t// are we coming off of previous page?\n\t\tif(!empty($this->lastUrl)) curl_setopt($this->ch, CURLOPT_REFERER, $this->lastUrl);\n\t\t\n\t\t// is this a POST request?\n\t\tif($method == 'POST'){\n\t\t\tcurl_setopt($this->ch, CURLOPT_POST, true);\n\t\t\tcurl_setopt($this->ch, CURLOPT_POSTFIELDS, $data);\n\t\t} else {\n\t\t\tcurl_setopt($this->ch, CURLOPT_POST, false);\n\t\t\t\n\t\t\t// append get fields as query string\n\t\t\tif($data){\n\t\t\t\n\t\t\t\t$query = http_build_query($data, '', '&');\n\t\t\t\t$parts = parse_url($url);\n\t\t\t\t\n\t\t\t\t// construct new URL...\n\t\t\t\tif(!isset($parts['path'])){\n\t\t\t\t\t$url = $url.'/?'.$query;\n\t\t\t\t} else if(isset($parts['query'])){\n\t\t\t\t\t$url = $url.'&'.$query;\n\t\t\t\t} else {\n\t\t\t\t\t$url = $url.'?'.$query;\n\t\t\t\t}\n\t\t\t\n\t\t\t\t// append query string\n\t\t\t\tcurl_setopt($this->ch, CURLOPT_URL, $url);\n\t\t\t}\n\t\t}\n\t\t\n\t\t// what if request fails?\n\t\t$this->last_url = $url;\n\t\t\n\t\t// will return false on host not found or timeout\n\t\t$response = curl_exec($this->ch);\n\t\t\n\t\tif($response){\n\t\t\t\n\t\t\t// use effective URL instead in case of redirect\n\t\t\t$url = curl_getinfo($this->ch, CURLINFO_EFFECTIVE_URL);\n\t\t\t\n\t\t\t// split headers and body\n\t\t\t$header_size = curl_getinfo($this->ch, CURLINFO_HEADER_SIZE);\n\t\t\t$headers = substr($response, 0, $header_size);\n\t\t\t$body = substr($response, $header_size);\n\t\t\t\n\t\t\t// in case of redirect, we only care about the latest headers from the last page\n\t\t\t$temp = explode(\"\\r\\n\\r\\n\", $headers);\n\t\t\t$latest_headers = $temp[count($temp)-2];\n\t\t\t\n\t\t\t// dom parsing is probably more expensive... just do regex on a plain text to find possible meta redirect\n\t\t\tif($this->follow_meta_refresh){\n\t\t\t\n\t\t\t\tif(preg_match('/<meta[^>]*http-equiv=[\"|\\']refresh[\"|\\'][^>]*/i', $body, $matches) && preg_match('/url=([^ |\"|\\']+)/i', $matches[0], $matches2)){\n\t\t\t\t\t$refresh_url = $matches2[1];\n\t\t\t\t\t\n\t\t\t\t\t// call the same method asking to do all the same but to this URL\n\t\t\t\t\treturn $this->doRequest($method, $refresh_url, $data, $headers);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// actual response that it send to the page is [headers, body]\n\t\t\treturn new PGPage($url, array('headers' => $latest_headers, 'body' => $this->clean($body)), $this);\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\t$this->last_error = curl_error($this->ch);\n\t\t\n\t\treturn false;\n\t}", "public function request()\n {\n $this->setParams();\n\n $jsondata = json_encode($this->getData(), JSON_UNESCAPED_SLASHES);\n\n if(!$this->is_JSON($jsondata)){\n $this->log(\"Sending parameters must be JSON.\",'Exiting process.');\n $this->error_message('Sending parameters must be JSON.');\n }\n $lenght = strlen($jsondata);\n if($lenght<=0){\n $this->log(\"Length must be more than zero.\",'Exiting process.');\n $this->error_message(\"Length must be more than zero.\");\n }else{\n $lenght = $lenght <= 999 ? \"0\" . $lenght : $lenght;\n }\n\n $this->response_json = $this->oxd_socket_request(utf8_encode($lenght . $jsondata));\n\n $this->response_json = str_replace(substr($this->response_json, 0, 4), \"\", $this->response_json);\n if ($this->response_json) {\n $object = json_decode($this->response_json);\n if ($object->status == 'error') {\n $this->error_message($object->data->error . ' : ' . $object->data->error_description);\n } elseif ($object->status == 'ok') {\n $this->response_object = json_decode($this->response_json);\n }\n } else {\n $this->log(\"Response is empty...\",'Exiting process.');\n $this->error_message('Response is empty...');\n }\n }", "function https_request($url,$data = null){\n\t $curl = curl_init(); \n\t curl_setopt($curl, CURLOPT_URL, $url); \n\t curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE); \n\t curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, FALSE); \n\t if (!empty($data)){ \n\t curl_setopt($curl, CURLOPT_POST, 1); \n\t curl_setopt($curl, CURLOPT_POSTFIELDS, $data); \n\t } \n\t curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); \n\t $output = curl_exec($curl); \n\t curl_close($curl); \n\t return $output;\n\t}", "public function send($method = 'GET', $url, $data) {\n $method = strtoupper($method);\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_HEADER, 0);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n //TODO:超时\n if ('POST' == $method) {\n curl_setopt($ch, CURLOPT_POST, 1);//post submit\n curl_setopt($ch, CURLOPT_POSTFIELDS, $data);\n }\n $result = curl_exec($ch);\n curl_close($ch);\n return $result;\n }", "function http_send($path, $method, $params = array(), $headers = array())\n\t{\n\t\t$this->http_response = '';\n\t\t$this->http_response_code = '';\n\t\t$this->http_method = $method;\n\t\t$this->http_parse_request_url($path);\n\t\t$this->http_headers_merge($headers);\n\n\t\tif(is_array($params)):\n\t\t\t$params = $this->http_serialize_params($params);\n\t\tendif;\n\n\t\t$method = strtoupper($method);\n\n\t\t$the_host = $this->http_url_bits['host'];\n\t\t$the_path = (isset($this->http_url_bits['path'])&&trim($this->http_url_bits['path'])!='') ? $this->http_url_bits['path'] : '';\n\t\t$the_path .= (isset($this->http_url_bits['query'])&&trim($this->http_url_bits['query'])!='') ? '?'.$this->http_url_bits['query'] : '';\n\n \t$this->http_headers_add('', \"$method $the_path HTTP/1.1\");\n \t$this->http_headers_add('Host', $the_host);\n\n\t\tif($this->http_content_type):\n\t\t\t$this->http_headers_add('Content-Type', $this->http_content_type);\n\t\tendif;\n\n\t\t$this->http_headers_add('User-Agent', $this->http_user_agent);\n\t\t$this->http_headers_add('Content-Length', strlen($params));\n\n\t\t$request = $this->http_build_request_headers();\n\n\t\tif(trim($params) != ''):\n\t\t\t$request .= \"$params{$this->http_linebreak}\";\n\t\tendif;\n\n\t\t$this->http_request = $request;\n\n\t\tif($this->http_url_bits['scheme']=='https'):\n\t\t\t$port = 443;\n\t\t\t$fsockurl = \"ssl://$the_host\";\n\t\telse:\n\t\t\t$port = 80;\n\t\t\t$fsockurl = $the_host;\n\t\tendif;\n\n\t\t// if an error occurs we log that and break out of the function\n\t\tif($fp = @fsockopen($fsockurl, $port, $errno, $errstr, $this->http_request_timeout)):\n\t\t\tif(fwrite($fp, $request)):\n\t\t\t\t$this->http_response = '';\n while(!feof($fp)):\n $this->http_response .= fgets($fp, 8192);\n endwhile;\n\t\t\telse:\n\t\t\t\t$this->last_error = \"Failed to write to $fsockurl\";\n\t\t\tendif;\n\t\t\tfclose($fp);\n\t\telse:\n\t\t\t$this->last_error = \"Failed to connect to $fsockurl $errstr ($errno)\";\n\t\t\treturn false;\n\t\tendif;\n\n\t\t$this->http_parse_response();\n\t}", "function http_request($url, $headers = array(), $method = 'GET', $data = NULL, $retry = 3) {\n $result = new StdClass();\n\n // Parse the URL, and make sure we can handle the schema.\n $uri = parse_url($url);\n\n switch ($uri['scheme']) {\n case 'http':\n $fp = @fsockopen($uri['host'], ($uri['port'] ? $uri['port'] : 80), $errno, $errstr, 15);\n break;\n case 'https':\n // Note: Only works for PHP 4.3 compiled with OpenSSL.\n $fp = @fsockopen('ssl://'. $uri['host'], ($uri['port'] ? $uri['port'] : 443), $errno, $errstr, 20);\n break;\n default:\n $result->error = 'invalid schema '. $uri['scheme'];\n return $result;\n }\n\n // Make sure the socket opened properly.\n if (!$fp) {\n $result->error = trim($errno .' '. $errstr);\n return $result;\n }\n\n // Construct the path to act on.\n $path = $uri['path'] ? $uri['path'] : '/';\n if ($uri['query']) {\n $path .= '?'. $uri['query'];\n }\n\n // Create HTTP request.\n $defaults = array(\n 'Host' => 'Host: '. $uri['host'],\n 'User-Agent' => 'User-Agent: Drupal (+http://www.drupal.org/)',\n 'Content-Length' => 'Content-Length: '. strlen($data)\n );\n\n foreach ($headers as $header => $value) {\n $defaults[$header] = $header .': '. $value;\n }\n\n $request = $method .' '. $path .\" HTTP/1.0\\r\\n\";\n $request .= implode(\"\\r\\n\", $defaults);\n $request .= \"\\r\\n\\r\\n\";\n if ($data) {\n $request .= $data .\"\\r\\n\";\n }\n $result->request = $request;\n\n fwrite($fp, $request);\n\n // Fetch response.\n $response = '';\n while (!feof($fp) && $data = fread($fp, 1024)) {\n $response .= $data;\n }\n fclose($fp);\n\n // Parse response.\n list($headers, $result->data) = explode(\"\\r\\n\\r\\n\", $response, 2);\n $headers = preg_split(\"/\\r\\n|\\n|\\r/\", $headers);\n\n list($protocol, $code, $text) = explode(' ', trim(array_shift($headers)), 3);\n $result->headers = array();\n\n // Parse headers.\n while ($line = trim(array_shift($headers))) {\n list($header, $value) = explode(':', $line, 2);\n $result->headers[$header] = trim($value);\n }\n\n $responses = array(\n 100 => 'Continue', 101 => 'Switching Protocols',\n 200 => 'OK', 201 => 'Created', 202 => 'Accepted', 203 => 'Non-Authoritative Information', 204 => 'No Content', 205 => 'Reset Content', 206 => 'Partial Content',\n 300 => 'Multiple Choices', 301 => 'Moved Permanently', 302 => 'Found', 303 => 'See Other', 304 => 'Not Modified', 305 => 'Use Proxy', 307 => 'Temporary Redirect',\n 400 => 'Bad Request', 401 => 'Unauthorized', 402 => 'Payment Required', 403 => 'Forbidden', 404 => 'Not Found', 405 => 'Method Not Allowed', 406 => 'Not Acceptable', 407 => 'Proxy Authentication Required', 408 => 'Request Time-out', 409 => 'Conflict', 410 => 'Gone', 411 => 'Length Required', 412 => 'Precondition Failed', 413 => 'Request Entity Too Large', 414 => 'Request-URI Too Large', 415 => 'Unsupported Media Type', 416 => 'Requested range not satisfiable', 417 => 'Expectation Failed',\n 500 => 'Internal Server Error', 501 => 'Not Implemented', 502 => 'Bad Gateway', 503 => 'Service Unavailable', 504 => 'Gateway Time-out', 505 => 'HTTP Version not supported'\n );\n // RFC 2616 states that all unknown HTTP codes must be treated the same as\n // the base code in their class.\n if (!isset($responses[$code])) {\n $code = floor($code / 100) * 100;\n }\n\n switch ($code) {\n case 200: // OK\n case 304: // Not modified\n break;\n case 301: // Moved permanently\n case 302: // Moved temporarily\n case 307: // Moved temporarily\n $location = $result->headers['Location'];\n\n if ($retry) {\n $result = http_request($result->headers['Location'], $headers, $method, $data, --$retry);\n $result->redirect_code = $result->code;\n }\n $result->redirect_url = $location;\n\n break;\n default:\n $result->error = $text;\n }\n\n $result->code = $code;\n return $result;\n}", "public function send(){\n \n\n\t\t$sent = FALSE;\n\t\t\n\t\t$baseurl = \"http://api.clickatell.com\";\n\n\t\t$this->text = urlencode($this->text);\n\n\t\t//ap\n\t\t$this->to = '266'.$this->to;\n\n\t\t// auth call\n\t\t$url = \"$baseurl/http/auth?user=$this->username&password=$this->password&api_id=$this->api_id\";\n\n\t\t// do auth call\n\t\t$ret = file($url);\n\n\t\t// explode our response. return string is on first line of the data returned\n\t\t$sess = explode(\":\", $ret[0]);\n\t\tif ($sess[0] === 'OK') {\n\n\t\t\t$sess_id = trim($sess[1]); // remove any whitespace\n\t\t\t$url = \"$baseurl/http/sendmsg?session_id=$sess_id&to=$this->to&text=$this->text\";\n\n\t\t\t// do sendmsg call\n\t\t\t$ret = file($url);\n\t\t\t$send = explode(':', $ret[0]);\n\n\t\t\tif ($send[0] === \"ID\")\n\t\t\t{\n\t\t\t\t$sent = TRUE;\n\t\t\t} else {\n\t\t\t\techo 'Authentication failure: ' . $ret[0] . \"\\n\";\n\t\t\t}\n\t\n\t\t\treturn $sent;\n\t\t}\n\t}", "function send_request( $http_method, $url, $auth_header = null, $postData = null ) {\n\t$curl = curl_init( $url );\n\tcurl_setopt( $curl, CURLOPT_RETURNTRANSFER, true );\n\tcurl_setopt( $curl, CURLOPT_FAILONERROR, false );\n\tcurl_setopt( $curl, CURLOPT_SSL_VERIFYPEER, false );\n\n\tswitch( $http_method ) {\n\t\tcase 'GET':\n\t\t\tif( $auth_header ) {\n\t\t\t\tcurl_setopt( $curl, CURLOPT_HTTPHEADER, array( $auth_header ) );\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 'POST':\n\t\t\tcurl_setopt( $curl, CURLOPT_HTTPHEADER, array( 'Content-Type: application/atom+xml',\n\t\t\t\t$auth_header ) );\n\t\t\tcurl_setopt( $curl, CURLOPT_POST, 1 );\n\t\t\tcurl_setopt( $curl, CURLOPT_POSTFIELDS, $postData );\n\t\t\tbreak;\n\t\tcase 'PUT':\n\t\t\tcurl_setopt( $curl, CURLOPT_HTTPHEADER, array( 'Content-Type: application/atom+xml',\n\t\t\t\t$auth_header ) );\n\t\t\tcurl_setopt( $curl, CURLOPT_CUSTOMREQUEST, $http_method );\n\t\t\tcurl_setopt( $curl, CURLOPT_POSTFIELDS, $postData );\n\t\t\tbreak;\n\t\tcase 'DELETE':\n\t\t\tcurl_setopt( $curl, CURLOPT_HTTPHEADER, array( $auth_header ) );\n\t\t\tcurl_setopt( $curl, CURLOPT_CUSTOMREQUEST, $http_method );\n\t\t\tbreak;\n\t}\n\t$response = curl_exec( $curl );\n\tif( !$response ) {\n\t\t$response = curl_error( $curl );\n\t}\n\tcurl_close( $curl );\n\treturn $response;\n}", "protected function sendRequest($url, $method = 'GET', $data = null, $force = false)\n {\n \t// No shell call\n \tif ( ! $this->shell_mode OR ! in_array($this->shell_mode, array('curl','php')))\n \t{\n \t\treturn parent::sendRequest($url, $method, $data, $force);\n \t}\n\n \t// Shell call\n if ($this->shell_mode === 'curl')\n {\n // if doing a bulk request, store the url\n if ($this->doBulkRequests && !$force) {\n $this->storedTrackingActions[]\n = $url\n . (!empty($this->userAgent) ? ('&ua=' . urlencode($this->userAgent)) : '')\n . (!empty($this->acceptLanguage) ? ('&lang=' . urlencode($this->acceptLanguage)) : '');\n return true;\n }\n\n $response = '';\n\n $cmd = \"curl -H 'Content-Type: application/json' \"\n . \"-m \".$this->requestTimeout.\" \"\n . \"-H 'User-Agent: \".$this->userAgent.\"' \"\n . \"-H 'Accept-Language: \".$this->acceptLanguage.\"' \"\n . \" -d '\" . $data . \"' \" . \"'\" . $url . \"' \";\n\n switch ($method) {\n case 'POST':\n $cmd .= \"-X POST \";\n break;\n default:\n break;\n }\n\n // only supports JSON data\n if (!empty($data)) {\n $cmd .= \"-H 'Content-Type: application/json' \";\n $cmd .= \"-H 'Expect: ' \";\n }\n\n $cmd .= \" > /dev/null 2>&1 &\";\n try\n {\n exec($cmd);\n }\n catch (\\Exception $ex)\n {\n // Is fork error\n if (preg_match('/unable to fork/i', $ex->getMessage()))\n {\n // Log error and just continue\n Log::instance()->add(Log::ERROR, $ex->getMessage());\n }\n // Other error\n else\n {\n // Rethrow error\n throw $ex;\n }\n }\n }\n // php call\n else\n {\n // Get query string\n $url_parts = parse_url($url);\n $url_query = $url_parts['query'];\n\n // Escape double quotes to prevent commandline breaks\n $url_query = str_replace('\"', '\\\"', $url_query);\n\n // Build cmd\n $cmd = \"export QUERY_STRING='$url_query'; \"\n . 'php -e -r \\'parse_str($_SERVER[\"QUERY_STRING\"], $_GET); '\n . \"include \\\"\".$this->binary_path.\"\\\";' > /dev/null 2>&1 &\";\n\n // Exec\n exec($cmd);\n }\n\n // Return nothing\n return;\n }", "function http_send_stream($stream) {}", "function _httprequest($url,$fp,$URI,$http_method,$content_type=\"\",$body=\"\")\n\t{\n\t\t$cookie_headers = '';\n\t\tif($this->passcookies && $this->_redirectaddr)\n\t\t\t$this->setcookies();\n\t\t\t\n\t\t$URI_PARTS = parse_url($URI);\n\t\tif(empty($url))\n\t\t\t$url = \"/\";\n\t\t$headers = $http_method.\" \".$url.\" \".$this->_httpversion.\"\\r\\n\";\t\t\n\t\tif(!empty($this->agent))\n\t\t\t$headers .= \"User-Agent: \".$this->agent.\"\\r\\n\";\n\t\tif(!empty($this->host) && !isset($this->rawheaders['Host'])) {\n\t\t\t$headers .= \"Host: \".$this->host;\n\t\t\tif(!empty($this->port))\n\t\t\t\t$headers .= \":\".$this->port;\n\t\t\t$headers .= \"\\r\\n\";\n\t\t}\n\t\tif(!empty($this->accept))\n\t\t\t$headers .= \"Accept: \".$this->accept.\"\\r\\n\";\n\t\tif(!empty($this->referer))\n\t\t\t$headers .= \"Referer: \".$this->referer.\"\\r\\n\";\n\t\tif(!empty($this->cookies))\n\t\t{\t\t\t\n\t\t\tif(!is_array($this->cookies))\n\t\t\t\t$this->cookies = (array)$this->cookies;\n\t\n\t\t\treset($this->cookies);\n\t\t\tif ( count($this->cookies) > 0 ) {\n\t\t\t\t$cookie_headers .= 'Cookie: ';\n\t\t\t\tforeach ( $this->cookies as $cookieKey => $cookieVal ) {\n\t\t\t\t$cookie_headers .= $cookieKey.\"=\".urlencode($cookieVal).\"; \";\n\t\t\t\t}\n\t\t\t\t$headers .= substr($cookie_headers,0,-2) . \"\\r\\n\";\n\t\t\t} \n\t\t}\n\t\tif(!empty($this->rawheaders))\n\t\t{\n\t\t\tif(!is_array($this->rawheaders))\n\t\t\t\t$this->rawheaders = (array)$this->rawheaders;\n\t\t\twhile(list($headerKey,$headerVal) = each($this->rawheaders))\n\t\t\t\t$headers .= $headerKey.\": \".$headerVal.\"\\r\\n\";\n\t\t}\n\t\tif(!empty($content_type)) {\n\t\t\t$headers .= \"Content-type: $content_type\";\n\t\t\tif ($content_type == \"multipart/form-data\")\n\t\t\t\t$headers .= \"; boundary=\".$this->_mime_boundary;\n\t\t\t$headers .= \"\\r\\n\";\n\t\t}\n\t\tif(!empty($body))\t\n\t\t\t$headers .= \"Content-length: \".strlen($body).\"\\r\\n\";\n\t\tif(!empty($this->user) || !empty($this->pass))\t\n\t\t\t$headers .= \"Authorization: Basic \".base64_encode($this->user.\":\".$this->pass).\"\\r\\n\";\n\t\t\n\t\t//add proxy auth headers\n\t\tif(!empty($this->proxy_user))\t\n\t\t\t$headers .= 'Proxy-Authorization: ' . 'Basic ' . base64_encode($this->proxy_user . ':' . $this->proxy_pass).\"\\r\\n\";\n\n\n\t\t$headers .= \"\\r\\n\";\n\t\t\n\t\t// set the read timeout if needed\n\t\tif ($this->read_timeout > 0)\n\t\t\tsocket_set_timeout($fp, $this->read_timeout);\n\t\t$this->timed_out = false;\n\t\t\n\t\tfwrite($fp,$headers.$body,strlen($headers.$body));\n\t\t\n\t\t$this->_redirectaddr = false;\n\t\tunset($this->headers);\n\t\t\t\t\t\t\n\t\twhile($currentHeader = fgets($fp,$this->_maxlinelen))\n\t\t{\n\t\t\tif ($this->read_timeout > 0 && $this->_check_timeout($fp))\n\t\t\t{\n\t\t\t\t$this->status=-100;\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\t\n\t\t\tif($currentHeader == \"\\r\\n\")\n\t\t\t\tbreak;\n\t\t\t\t\t\t\n\t\t\t// if a header begins with Location: or URI:, set the redirect\n\t\t\tif(preg_match(\"/^(Location:|URI:)/i\",$currentHeader))\n\t\t\t{\n\t\t\t\t// get URL portion of the redirect\n\t\t\t\tpreg_match(\"/^(Location:|URI:)[ ]+(.*)/i\",chop($currentHeader),$matches);\n\t\t\t\t// look for :// in the Location header to see if hostname is included\n\t\t\t\tif(!preg_match(\"|\\:\\/\\/|\",$matches[2]))\n\t\t\t\t{\n\t\t\t\t\t// no host in the path, so prepend\n\t\t\t\t\t$this->_redirectaddr = $URI_PARTS[\"scheme\"].\"://\".$this->host.\":\".$this->port;\n\t\t\t\t\t// eliminate double slash\n\t\t\t\t\tif(!preg_match(\"|^/|\",$matches[2]))\n\t\t\t\t\t\t\t$this->_redirectaddr .= \"/\".$matches[2];\n\t\t\t\t\telse\n\t\t\t\t\t\t\t$this->_redirectaddr .= $matches[2];\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\t$this->_redirectaddr = $matches[2];\n\t\t\t}\n\t\t\n\t\t\tif(preg_match(\"|^HTTP/|\",$currentHeader))\n\t\t\t{\n if(preg_match(\"|^HTTP/[^\\s]*\\s(.*?)\\s|\",$currentHeader, $status))\n\t\t\t\t{\n\t\t\t\t\t$this->status= $status[1];\n }\t\t\t\t\n\t\t\t\t$this->response_code = $currentHeader;\n\t\t\t}\n\t\t\t\t\n\t\t\t$this->headers[] = $currentHeader;\n\t\t}\n\n\t\t$results = '';\n\t\tdo {\n \t\t$_data = fread($fp, $this->maxlength);\n \t\tif (strlen($_data) == 0) {\n \t\tbreak;\n \t\t}\n \t\t$results .= $_data;\n\t\t} while(true);\n\n\t\tif ($this->read_timeout > 0 && $this->_check_timeout($fp))\n\t\t{\n\t\t\t$this->status=-100;\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t// check if there is a a redirect meta tag\n\t\t\n\t\tif(preg_match(\"'<meta[\\s]*http-equiv[^>]*?content[\\s]*=[\\s]*[\\\"\\']?\\d+;[\\s]*URL[\\s]*=[\\s]*([^\\\"\\']*?)[\\\"\\']?>'i\",$results,$match))\n\n\t\t{\n\t\t\t$this->_redirectaddr = $this->_expandlinks($match[1],$URI);\t\n\t\t}\n\n\t\t// have we hit our frame depth and is there frame src to fetch?\n\t\tif(($this->_framedepth < $this->maxframes) && preg_match_all(\"'<frame\\s+.*src[\\s]*=[\\'\\\"]?([^\\'\\\"\\>]+)'i\",$results,$match))\n\t\t{\n\t\t\t$this->results[] = $results;\n\t\t\tfor($x=0; $x<count($match[1]); $x++)\n\t\t\t\t$this->_frameurls[] = $this->_expandlinks($match[1][$x],$URI_PARTS[\"scheme\"].\"://\".$this->host);\n\t\t}\n\t\t// have we already fetched framed content?\n\t\telseif(is_array($this->results))\n\t\t\t$this->results[] = $results;\n\t\t// no framed content\n\t\telse\n\t\t\t$this->results = $results;\n\t\t\n\t\treturn true;\n\t}", "public function get() {\r\n $this->response->setData(1);\r\n $this->response->setHeader('__OK', Http::Response(Http::OK));\r\n return TRUE;\r\n }", "public function SendHttpPing()\n\t{\n\t\tfor ( $Z = 0; $Z < count($this->url); $Z++ )\n\t\t{\n\t\t\tarray_push( $this->result_ping , exec( 'httping -c ' . $this->try_count . ' ' . $this->url[$Z] ) );\n\t\t\tif ( self::PING_ERR == $this->result_ping[$Z] )\n\t\t\t{\n\t\t\t\t$this->result_ping[$Z]='';\n\t\t\t}\n\t\t}\n\n\t\t/* Data Setting */\n\t\t$this->CheckHttpResponse();\t\n\t}", "function post($url, $data = '', $content_type = '')\n{\n\t\n\t$ch = curl_init();\n\tcurl_setopt($ch, CURLOPT_URL, $url);\n\tcurl_setopt($ch, CURLOPT_POST, 1);\n\tcurl_setopt($ch, CURLOPT_HEADER, 0);\n\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); \n\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $data); \n\t\n\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);\n\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);\n\t\n\tif ($content_type != '')\n\t{\n\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, \n\t\t\tarray(\n\t\t\t\t\"Content-type: \" . $content_type\n\t\t\t\t)\n\t\t\t);\n\t}\t\n\t\n\t$response = curl_exec($ch);\n\tif($response == FALSE) \n\t{\n\t\t$errorText = curl_error($ch);\n\t\tcurl_close($ch);\n\t\tdie($errorText);\n\t}\n\t\n\t$info = curl_getinfo($ch);\n\t$http_code = $info['http_code'];\n\t\t\n\tcurl_close($ch);\n\t\n\treturn $response;\n}", "static function curl_request($url,$data = null,$second=30){\n $curl = curl_init();\n\t\tcurl_setopt($curl, CURLOPT_TIMEOUT,$second);\n curl_setopt($curl, CURLOPT_URL, $url);\n curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE);\n curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, FALSE);\n if (!empty($data)){\n curl_setopt($curl, CURLOPT_POST, 1);\n curl_setopt($curl, CURLOPT_POSTFIELDS, $data);\n }\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\n $output = curl_exec($curl);\n curl_close($curl);\n return $output;\n }", "function tincanlaunch_send_api_request($auth, $method, $url) {\n $options = func_num_args() === 4 ? func_get_arg(3) : array();\n\n if (!isset($options['contentType'])) {\n $options['contentType'] = 'application/json';\n }\n\n $http = array(\n // We don't expect redirects.\n 'max_redirects' => 0,\n // This is here for some proxy handling.\n 'request_fulluri' => 1,\n // Switching this to false causes non-2xx/3xx status codes to throw exceptions.\n // but we need to handle the \"error\" status codes ourselves in some cases.\n 'ignore_errors' => true,\n 'method' => $method,\n 'header' => array()\n );\n\n array_push($http['header'], 'Authorization: ' . $auth);\n\n if (($method === 'PUT' || $method === 'POST') && isset($options['content'])) {\n $http['content'] = $options['content'];\n array_push($http['header'], 'Content-length: ' . strlen($options['content']));\n array_push($http['header'], 'Content-Type: ' . $options['contentType']);\n }\n\n $context = stream_context_create(array('http' => $http));\n $fp = fopen($url, 'rb', false, $context);\n if (!$fp) {\n return array(\n \"metadata\" => null,\n \"content\" => null,\n \"status\" => 0\n );\n }\n $metadata = stream_get_meta_data($fp);\n $content = stream_get_contents($fp);\n $responsecode = (int) explode(' ', $metadata[\"wrapper_data\"][0])[1];\n\n fclose($fp);\n\n if ($options['contentType'] == 'application/json') {\n $content = json_decode($content);\n }\n\n return array(\n \"metadata\" => $metadata,\n \"content\" => $content,\n \"status\" => $responsecode\n );\n}", "public function send()\n {\n http_response_code($this->statusCode);\n $this->sendContent();\n }", "public function send() {\n $options = array(\n 'headers' => array(\n 'Content-Type' => 'application/xml; charset=UTF8',\n ),\n 'body' => $this->buildMessage(),\n );\n\n try {\n $client = new Client();\n $response = $client->request('POST', $this->url, $options);\n\n if ($response->getStatusCode() == 204) {\n watchdog('ting_das', 'Service returned: !code', array('!code' => $response->getStatusCode()), WATCHDOG_ERROR);\n return TRUE;\n }\n }\n catch (GuzzleException $exception) {\n watchdog_exception('ting_das', $exception);\n }\n\n return FALSE;\n }", "protected function doRequest($url, $headers, $method, $data) {\n return drupal_http_request($url, array('headers' => $headers, 'method' => $method, 'data' => $data));\n }", "protected static function request_send($url, $headers, $params) {\n $curl = curl_init($url);\n\n //Set curl options\n foreach($params as $param => $value) {\n curl_setopt($curl, constant($param), $value);\n }\n curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);\n\n $response = curl_exec($curl);\n $info = self::get_info($curl);\n\n curl_close($curl);\n return ['body' => $response, 'info' => $info, 'code' => $info['code']];\n }", "function httpPOST($url, $data)\n{\n $curl = curl_init($url);\n curl_setopt($curl, CURLOPT_POST, true);\n curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($data));\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\n $response = curl_exec($curl);\n curl_close($curl);\n return $response;\n}", "private function submit($url, $data)\n {\n $response = $this->get_content($url, $data);\n return $response;\n }", "function http($url, $args = array()) {\n\n\t\tglobal $CONFIG;\n\n\t\t$userAgent = '(Elgg ' . $CONFIG->release . ')';\n\n\t\t$ch = curl_init();\n\t\t//curl_setopt($ch, CURLOPT_HTTPHEADER, \"Host: api.dropbox.com\");\n\t\tcurl_setopt($ch, CURLOPT_USERAGENT, $userAgent);\n\t\tcurl_setopt($ch, CURLOPT_URL, $url);\n\t\tcurl_setopt($ch, CURLOPT_FAILONERROR, true);\n\t\tcurl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);\n\t\tcurl_setopt($ch, CURLOPT_AUTOREFERER, true);\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t\tcurl_setopt($ch, CURLOPT_TIMEOUT, 20);\n\t\tcurl_setopt($ch, CURLOPT_VERBOSE, true);\n\t\t\n\t\t/**\n\t\t * This is needed to remove problems with certificate \n\t\t * authentication against the dropbox server. \n\t\t */\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n\t\t\n\t\tif (!empty($args['username']) && !empty($args['password'])) {\n\t\t\tcurl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY);\n\t\t\tcurl_setopt($ch, CURLOPT_USERPWD, $args['username'] . ':' . $args['password']);\n\t\t}\n\n\t\tif (!empty($args['post'])) {\n\t\t\tcurl_setopt($ch, CURLOPT_POST, 1);\n\t\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $args['data']);\n\t\t}\n\n\t\tif (!empty($args['headers'])) {\n\t\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, $args['headers']);\n\t\t}\n\n\t\t$html = curl_exec($ch);\n\t\t\n\t\t$rc = curl_getinfo($ch, CURLINFO_HTTP_CODE);\n\t\t$info = curl_getinfo($ch);\n\t\t$err = curl_error($ch);\n\t\t$errno = curl_errno($ch);\n\n\t\tcurl_close($ch);\n\t\t\n\t\treturn array('rc' => $rc, \n\t\t\t 'html' => $html, \n\t\t\t 'errno' => $errno,\n\t\t\t 'err' => $err,\n\t\t\t 'info' => $info);\n\t}", "function request($url, $params = false) {\n\t\t$req =& new HTTP_Request($this->base . $url);\n\t\t//authorize\n\t\t$req->setBasicAuth($this->user, $this->pass);\n\t\t//set the headers\n\t\t$req->addHeader(\"Accept\", \"application/xml\");\n\t\t$req->addHeader(\"Content-Type\", \"application/xml\");\n\t\t//if were sending stuff\n\t\tif ($params) {\n\t\t\t//serialize the data\n\t\t\t//$xml = $this->serialize($params);\n\t\t\t//($xml)?$req->setBody($xml):false;\n\t\t\t$req->setBody($params);\n\t\t\t$req->setMethod(HTTP_REQUEST_METHOD_POST);\n\t\t}\n\t\t$response = $req->sendRequest();\n\t\t// print_r($req->getResponseHeader());\n\t\t// echo $req->getResponseCode() .\t\"\\n\";\n\t\t\n\t\tif (PEAR::isError($response)) {\n\t\t return $response->getMessage();\n\t\t} else {\n\t\t print_r($req->getResponseBody());\n\t\t return $req->getResponseBody();\n\t\t}\n\t}", "function SEEDStd_HTTPRequest( $host, $page, $raReqParms )\r\n{\r\n $sResponseHeader = \"\";\r\n $sResponseContent = \"\";\r\n\r\n $reqparms = SEEDStd_ParmsRa2URL( $raReqParms );\r\n\r\n $errno = 0;\r\n $errstr = \"\";\r\n $ok = false;\r\n\r\n $sMessage = \"POST $page HTTP/1.0\\r\\n\"\r\n .\"Host: $host\\r\\n\" // this didn't used to be required by older servers but now seems necessary\r\n// HTTP/1.1 requires Host:, Connection:close, chunked transfer encoding, and handle the 100 response\r\n //.\"Accept: text/plain\\r\\n\"\r\n .\"Content-Type: application/x-www-form-urlencoded\\r\\n\"\r\n .\"Content-Length: \".strlen($reqparms).\"\\r\\n\"\r\n .\"\\r\\n\"\r\n .$reqparms;\r\n// $sMessage = \"GET /int/traductions.php?mode=REST&ns=SED&k=MSD+title&lang=EN HTTP/1.1\\r\\nHost: \\r\\n\\r\\n\";\r\n\r\n if( ($fp = @fsockopen( $host, 80, $errno, $errstr, 30 )) ) { // suppress php error messages when connections fail, host not found, etc\r\n fputs( $fp, $sMessage );\r\n\r\n $bHeader = true;\r\n $bFirst = true;\r\n while( !feof($fp) ) {\r\n // get each line of the header and content. The last line is the response.\r\n $s = fgets( $fp, 1024 );\r\n if( $bHeader ) {\r\n $sResponseHeader .= $s;\r\n if( trim($s) == \"\" ) $bHeader = false;\r\n } else {\r\n $sResponseContent .= ($bFirst ? \"\" : \"\\n\").trim($s);\r\n $bFirst = false;\r\n }\r\n }\r\n fclose ($fp);\r\n $ok = true;\r\n//var_dump($host,$sMessage,$sResponseHeader,$sResponseContent);exit;\r\n } else {\r\n //$this->log( \"HTTP Error: $errno, $errstr\\n$req\" );\r\n }\r\n return( array( $ok, $sResponseHeader, $sResponseContent ) );\r\n}", "public static function curlGET($url,$dato){\n$query = http_build_query($dato);\n$url=$url.\"?\".$query;\n$ch = curl_init($url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"GET\");\n $response = curl_exec($ch);\n curl_close($ch);\n if(!$response)\n {\n return false;\n }\n else\n {\n return $response;\n }\n}", "public function send()\n {\n header(\n $_SERVER[\"SERVER_PROTOCOL\"].\" \". // HTTP 1.1\n $this->statusCode.\" \". // 200\n $this->statusText // OK\n );\n foreach ($this->headers as $key => $value) {\n header(\"$key: $value\");\n }\n }", "private function submit_request($url, $data)\n { // Returns cURL response\n\n $credentials = base64_encode($this->consumer_key . ':' . $this->consumer_secret);\n if ($this->env == 'live') {\n $cred_url = 'https://api.safaricom.co.ke/oauth/v1/generate?grant_type=client_credentials';\n } else {\n $cred_url = 'https://sandbox.safaricom.co.ke/oauth/v1/generate?grant_type=client_credentials';\n }\n $client = new Client();\n try {\n $request = $client->get($cred_url, array(\n 'headers' => array('content-type' => 'application/json', 'Authorization' => 'Basic ' . $credentials)\n ));\n if ($body = $request->getBody()) {\n $response = $body->getContents();\n } else {\n return false;\n }\n } catch (RequestException $e) {\n if ($e->hasResponse()) {\n $response = $e->getResponse()->getBody()->getContents();\n } else {\n return false;\n }\n }\n\n $response = @json_decode($response);\n $access_token = @$response->access_token;\n\n // The above $access_token expires after an hour, find a way to cache it to minimize requests to the server\n if (!$access_token) {\n //throw new Exception(\"Invalid access token generated\");\n return false;\n }\n\n if ($access_token != '' || $access_token !== FALSE) {\n\n $client = new Client();\n try {\n $request = $client->post($url, array(\n 'headers' => array('content-type' => 'application/json', 'Authorization' => 'Bearer ' . $access_token),\n 'body' => $data\n ));\n if ($body = $request->getBody()) {\n $response = $body->getContents();\n } else {\n return false;\n }\n } catch (RequestException $e) {\n if ($e->hasResponse()) {\n $response = $e->getResponse()->getBody()->getContents();\n } else {\n return false;\n }\n }\n return $response;\n } else {\n return FALSE;\n }\n }", "function forwardGetRequest($url) {\n\n\t\t$curl = curl_init();\n\n\t\tcurl_setopt_array($curl, array(\n\t\t\tCURLOPT_URL => $url,\n\t\t\tCURLOPT_RETURNTRANSFER => true,\n\t\t\tCURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n\t\t\tCURLOPT_CUSTOMREQUEST => \"GET\",\n\t\t\tCURLOPT_HTTPHEADER => array(\"cache-control: no-cache\"),\n\t\t\tCURLOPT_SSL_VERIFYPEER => false\n\t\t));\n\n\t\t$response = curl_exec($curl);\n\t\tif ($response === false) echo \"Bad response\";\n\n\t\tcurl_close($curl);\n\t\treturn $response;\n\n\t}", "private function postHop () {\n\t\t$this->result = curl_exec ( $this->ch );\n\t\tcurl_close ( $this->ch );\n\t}", "public function send($url, $method, $params = array(), $headers = array(), $time_out = 30) {\n\t\t$this->openConnection($url, strtoupper($method), $params, $headers, $time_out);\n\t\t$this->sendCurl();\n\n\t\tif ($this->curlErrorCode = $this->curl->errno()) {\n\t\t\tthrow new \\Exception($this->curl->error(), $this->curlErrorCode);\n\t\t}\n\n\t\t$res = $this->analyzeResponse();\n\t\t$this->closeConnection();\n\n\t\treturn $res;\n\t}", "private function send($url, $method = 'GET') //sends data array(param=>val,...) to the page $url in post/get method and returns the reply string\n {\n $options = array(\n \"http\" => array(\n \"Accept-language: en\\r\\n\",\n \"method\" => $method,\n \"header\" => \"\\r\\nUser-agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11\"\n )\n );\n $context = stream_context_create($options);\n $page = file_get_contents($url, true, $context);\n \n return $page;\n }", "public function send($uri, $data)\n {\n if (!$this->isEnabled()) {\n return false;\n }\n \n $headers = [];\n \n foreach ($this->getApiHeaders() as $name => $value) {\n $headers[] = \"$name: $value\";\n }\n \n $handle = curl_init($this->endpoint . $uri);\n \n curl_setopt($handle, CURLOPT_POST, 1);\n \n // Tell cURL that it should only spend 10 seconds trying to connect to the URL in question.\n curl_setopt($handle, CURLOPT_CONNECTTIMEOUT, 5);\n // A given cURL operation should only take 30 seconds max.\n curl_setopt($handle, CURLOPT_TIMEOUT, 10);\n \n curl_setopt($handle, CURLOPT_HTTPHEADER, $headers);\n curl_setopt($handle, CURLOPT_POSTFIELDS, $data);\n curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);\n if ($this->proxy) {\n curl_setopt($handle, CURLOPT_PROXY, $this->proxy);\n }\n curl_exec($handle);\n $errorNo = curl_errno($handle);\n $code = curl_getinfo($handle, CURLINFO_HTTP_CODE);\n $error = curl_error($handle);\n \n curl_close($handle);\n \n if (0 !== $errorNo || 200 !== $code) {\n error_log(date('Y-m-d H:i:s') . \" - [Warning] [\" . get_class($this) . \"] $error - $code $errorNo\");\n return false;\n }\n \n return true;\n }", "private function curl($url,$data){\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_POST, 1);\n\n curl_setopt($ch, CURLOPT_POSTFIELDS,\n http_build_query($data));\n\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\n $server_output = curl_exec($ch);\n if($server_output===false){\n $error = curl_error($ch);\n $this->log_middle(\"curl false:\" . $error);\n }\n curl_close($ch);\n\n return $server_output;\n\n }", "public function doCall($url) {\n $ch = curl_init();\n $timeout = 5;\n\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);\n curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);\n\n curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY);\n curl_setopt($ch, CURLOPT_USERPWD, \"{$this->http_auth_username}:{$this->http_auth_pass}\");\n\n curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:18.0) Gecko/20100101 Firefox/18.0');\n $data = curl_exec($ch);\n $errno = curl_errno($ch);\n $error = curl_error($ch);\n\n curl_close($ch);\n return $data;\n }", "function post_to_url($url, $data) {\n $fields = '';\n foreach ($data as $key => $value) {\n $fields .= $key . '=' . $value . '&';\n }\n rtrim($fields, '&');\n $post = curl_init();\n curl_setopt($post, CURLOPT_SSL_VERIFYPEER, false);\n curl_setopt($post, CURLOPT_URL, $url);\n curl_setopt($post, CURLOPT_POST, count($data));\n curl_setopt($post, CURLOPT_POSTFIELDS, $fields);\n curl_setopt($post, CURLOPT_RETURNTRANSFER, 1);\n $result = curl_exec($post); //result from mobile seva server \n return $result; //output from server displayed \n curl_close($post);\n}", "public static function sendPost($_url, $_data, $_headers = [],\n $_return_header = true)\n {\n return self::sendCurl($_url,\n array(\n CURLOPT_SSL_VERIFYHOST => false,\n CURLOPT_SSL_VERIFYPEER => false,\n CURLOPT_FOLLOWLOCATION => 0,\n CURLOPT_POST => 1,\n CURLOPT_POSTFIELDS => $_data,\n CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n CURLOPT_HTTPHEADER => $_headers,\n CURLOPT_HEADER => $_return_header\n ));\n }", "function curl_check($url) {\n\n\t$ch = curl_init($url);\n\tcurl_setopt($ch, CURLOPT_NOBODY, true);\n\n\t$response = curl_exec($ch);\n\tLOG_MSG('INFO',\"curl_get(): [$url] response=[$response]\");\n\n\treturn curl_getinfo($ch, CURLINFO_HTTP_CODE);\n}", "function load_url($action = '', $method = 'get', $params = array(), $expected_http_code = 200)\n\t{\n\t\t$this->http_send($this->api_url . $action, $method, $params);\n\n\t\t// handle status codes\n\t\tif(intval($expected_http_code) === $this->http_response_code):\n\t\t\tif($this->http_content_type):\n\t\t\t\treturn $this->xml_to_array($this->http_response_body);\n\t\t\telse:\n\t\t\t\treturn $this->http_response_body; /* downloads the file */\n\t\t\tendif;\n\t\telse:\n\t\t\t$this->last_error = \"Invalid status code {$this->http_response_code}\";\n\n\t\t\t// if their was an error sometimes the body contains useful info\n\t\t\treturn false;\n\t\tendif;\n\t}", "public function checkUrl()\n\t{\n\t\t$url = $this->input->get('url', '', 'raw');\n\n\t\t/** @var \\Akeeba\\Backup\\Admin\\Model\\Transfer $model */\n\t\t$model = $this->getModel();\n\t\t$model->savestate(true);\n\t\t$result = $model->checkAndCleanUrl($url);\n\n\t\t$this->container->platform->setSessionVar('transfer.url', $result['url'], 'akeeba');\n\t\t$this->container->platform->setSessionVar('transfer.url_status', $result['status'], 'akeeba');\n\n\t\t@ob_end_clean();\n\t\techo '###' . json_encode($result) . '###';\n\t\t$this->container->platform->closeApplication();\n\t}" ]
[ "0.70908284", "0.70371026", "0.64662206", "0.63904864", "0.6324434", "0.6302773", "0.62859887", "0.62335855", "0.62217045", "0.61947066", "0.6193724", "0.61646754", "0.61104786", "0.60890734", "0.6082854", "0.6080956", "0.6066279", "0.6059038", "0.60327536", "0.5967357", "0.59628713", "0.596059", "0.5945965", "0.59304434", "0.59200877", "0.5917755", "0.59022737", "0.58975065", "0.5892726", "0.5887942", "0.58868027", "0.5881244", "0.5879839", "0.5859136", "0.5858366", "0.58504355", "0.58396804", "0.58339083", "0.58105826", "0.58089983", "0.5799011", "0.578554", "0.5780814", "0.5780282", "0.5778658", "0.5765302", "0.5759838", "0.57486063", "0.5741705", "0.5735868", "0.57227343", "0.57206273", "0.5707608", "0.57028294", "0.56864804", "0.5681173", "0.5655913", "0.56473404", "0.5644481", "0.56236887", "0.56176114", "0.56166077", "0.56138015", "0.5612123", "0.5605233", "0.55903715", "0.5580413", "0.55796134", "0.5577376", "0.5566566", "0.5562602", "0.5560144", "0.5552948", "0.5543346", "0.55372787", "0.553721", "0.5529374", "0.5528617", "0.552668", "0.55214435", "0.5502184", "0.54963857", "0.54963124", "0.5495548", "0.5494752", "0.5494047", "0.54920423", "0.54908293", "0.5489447", "0.5487695", "0.5486776", "0.5486762", "0.54824436", "0.5481998", "0.54756397", "0.54709274", "0.5465681", "0.546425", "0.54635465", "0.54628056", "0.54588544" ]
0.0
-1
Check the input for required values. The list of required fields is a commaseparated list of field names.
function CheckRequired($reqd,$vars,&$missing) { $bad = false; $list = explode(",",$reqd); for ($ii = 0 ; $ii < count($list) ; $ii++) { $name = $list[$ii]; if ($name) { // // field names can be just straight names, or in this // format: // fieldname:Nice printable name for displaying // if (($nice_name_pos = strpos($name,":")) > 0) { $nice_name = substr($name,$nice_name_pos + 1); $name = substr($name,0,$nice_name_pos); } else $nice_name = $name; if (!isset($vars[$name]) || empty($vars[$name])) { $bad = true; $missing .= "$nice_name\n"; } } } return (!$bad); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function validate_required_fields()\n\t{\n\t\t$errors = array();\n\t\t\n\t\tforeach (array_keys($this->_required_fields) as $field)\n\t\t{\n\t\t\t$value = $this->get_field_value($field);\n\t\t\t\n\t\t\tif (!validate::required($value))\n\t\t\t{\n\t\t\t\t$errors[$field] = 'Required';\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $errors;\n\t}", "function _required($required, $data)\n\t{\n\t\tforeach ($required as $field)\n\t\t{\n\t\t\tif ( ! isset($data[$field]))\n\t\t\t{\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t}\n\t\treturn TRUE;\n\t}", "private function checkRequired()\n {\n if ($this->fld->is_required == 1 && !$this->is_val_set) {\n throw new Exceptions\\DXCustomException(sprintf(trans('errors.required_field'), $this->fld->title_list));\n }\n }", "public static function checkRequiredFields( $required, $data ) {\n\n\t\tforeach ( $required as $key => $values ) {\n\n\t\t\t$name = $values[0];\n\t\t\t$type = $values[1];\n\t\t\t$value = $data[ $key ];\n\n\t\t\t// fetch data by type\n\t\t\tswitch ( $type ) {\n\t\t\t\tcase Data::INT:\n\t\t\t\t\t$value = Data::getInt($value);\n\t\t\t\t\tbreak;\n\t\t\t\tcase Data::STR: /* nothing */\n\t\t\t\tcase Data::ARR: /* nothing */\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tError::fatal( \"invalid data type specified for '$key'\", Error::SYS );\n\t\t\t}\n\n\t\t\tif ( !$value )\n\t\t\t\tError::fatal( \"you missed the '$name' field\" );\n\n\t\t}\n\n\t}", "function required_validate() {\n if ($this->required) {\n if (array_key_exists('NOT_NULL', $this->condition)) \n {\n if ($this->value == '' || $this->value == NULL) {\n $this->errors->add_msj(NOT_NULL_PRE.$this->name.NOT_NULL_POS);\n }\n }\n\n if (array_key_exists('IS_INT', $this->condition)) \n {\n if (!field_is_int($this->value))\n {\n $this->errors->add_msj(IS_INT_PRE.$this->name.IS_INT_POS);\n }\n }\n\n }\n }", "function check_required_fields($required_array) {\r\n $field_errors = array();\r\n foreach($required_array as $fieldname) {\r\n if (isset($_POST[$fieldname]) && empty($_POST[$fieldname])) { \r\n $field_errors[] = ucfirst($fieldname). \" is required\"; \r\n }\r\n }\r\n return $field_errors;\r\n}", "static function verifyRequiredParams($required_fields) {\n $error = false;\n $error_fields = \"\";\n // $request_params = array();\n $request_params = $_REQUEST;\n // Handling PUT request params\n if ($_SERVER['REQUEST_METHOD'] == 'PUT') {\n $app = \\Slim\\Slim::getInstance();\n parse_str($app->request()->getBody(), $request_params);\n }\n foreach ($required_fields as $field) {\n if (!isset($request_params[$field]) || strlen(trim($request_params[$field])) <= 0) {\n $error = true;\n $error_fields .= $field . ', ';\n }\n }\n if ($error) {\n // Required field(s) are missing or empty\n return 'Required field(s) ' . substr($error_fields, 0, -2) . ' is missing or empty';\n } else {\n return 'done';\n }\n }", "function verifyRequiredParams($required_fields)\n{\n\n\t//get request params\n\t$request_params = $_REQUEST;\n\t\n\t//Loop through all parameters\n\tforeach ($required_fields as $field) {\n\t\t//if any required parameter is missing\n\t\tif (!isset($request_params[$field]) || strlen(trim($request_params[$field])) <= 0) {\n\t\t\n\t\t\t//return true\n\t\t\treturn true;\n\t\t}\n\t}\n\t//otherwise, return false\n\treturn false;\n}", "function verifyRequiredParams($required_fields)\n {\n $error = false;\n $error_fields = \"\";\n $request_params = array();\n $request_params = $_REQUEST;\n // Handling PUT request params\n if ($_SERVER['REQUEST_METHOD'] == 'PUT') {\n $app = Slim::getInstance();\n parse_str($app->request()->getBody(), $request_params);\n }\n foreach ($required_fields as $field) {\n if (!isset($request_params[$field]) || strlen(trim($request_params[$field])) <= 0) {\n $error = true;\n $error_fields .= $field . ', ';\n }\n }\n\n if ($error) {\n // Required field(s) are missing or empty\n // echo error json and stop the app\n $response = array();\n $app = Slim::getInstance();\n $response[\"error\"] = true;\n $response[\"message\"] = 'Required field(s) ' . substr($error_fields, 0, -2) . ' is missing or empty';\n $this->echoResponse(400, $response);\n $app->stop();\n }\n }", "public static function requiredFields(array $required, object $req)\n {\n $data = array_keys((array) $req);\n $data = array_diff($required, $data);\n count($data) > 0 &&\n Response::message(\n [\"message\" => \"Value(s) required!\", \"values\" => array_values($data)],\n 406\n );\n\n return true;\n }", "function isTheseParametersAvailable($required_fields)\n{\n $error = false;\n $error_fields = \"\";\n $request_params = $_REQUEST;\n\n foreach ($required_fields as $field) {\n if (!isset($request_params[$field]) || strlen(trim($request_params[$field])) <= 0) {\n $error = true;\n $error_fields .= $field . ', ';\n }\n }\n\n if ($error) {\n $response = array();\n $response[\"error\"] = true;\n $response[\"message\"] = 'Required field(s) ' . substr($error_fields, 0, -2) . ' is missing or empty';\n echo json_encode($response);\n return false;\n }\n return true;\n}", "function verifyRequiredParams($required_fields) \n\t{\n\t\t$error = false;\n\t\t$error_fields = \"\";\n\t\t$request_params = array();\n\t\t$request_params = $_REQUEST;\n\t\t\n\t\t// Handling PUT request params\n\t\tif ($_SERVER['REQUEST_METHOD'] == 'PUT') \n\t\t{\n\t\t\t$app = \\Slim\\Slim::getInstance();\n\t\t\tparse_str($app->request()->getBody(), $request_params);\n\t\t}\n\t\t\n\t\tforeach ($required_fields as $field) \n\t\t{\n\t\t\tif (!isset($request_params[$field]) || strlen(trim($request_params[$field])) <= 0) \n\t\t\t{\n\t\t\t\t$error = true;\n\t\t\t\t$error_fields .= $field . ', ';\n\t\t\t}\n\t\t\n\t\t}\n\n\t\tif ($error) \n\t\t{\n\t\t\t\n\t\t\t// Required field(s) are missing or empty\n\t\t\t// echo error json and stop the app\n\t\t\t$response = array();\n\t\t\t$app = \\Slim\\Slim::getInstance();\n\t\t\t$response[\"error\"] = true;\n\t\t\t$response[\"message\"] = 'Required field(s) ' . substr($error_fields, 0, -2) . ' is missing or empty';\n\t\t\techoRespnse(400, $response);\n\t\t\t$app->stop();\n\t\t}\n }", "protected function _required($required, $data) {\r\n foreach ($required as $field) {\r\n if (!isset($data[$field])) {\r\n return false;\r\n }\r\n }\r\n\r\n return true;\r\n }", "public function validate_fields() {\n \n\t\t\n \n\t\t}", "public function validate_fields() {\n \n\t\t//...\n \n }", "function verifyRequiredParams($required_fields) {\r\n\t\t\t$error = false;\r\n\t\t\t$error_fields = \"\";\r\n\t\t\t$request_params = array();\r\n\t\t\t$request_params = $_REQUEST;\r\n\t\t\t// Handling PUT request params\r\n\t\t\tif ($_SERVER['REQUEST_METHOD'] == 'PUT') {\r\n\t\t\t\t$app = \\Slim\\Slim::getInstance();\r\n\t\t\t\tparse_str($app->request()->getBody(), $request_params);\r\n\t\t\t}\r\n\t\t\tforeach ($required_fields as $field) {\r\n\t\t\t\tif (!isset($request_params[$field]) || strlen(trim($request_params[$field])) <= 0) {\r\n\t\t\t\t\t$error = true;\r\n\t\t\t\t\t$error_fields .= $field . ', ';\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t \r\n\t\tif ($error) {\r\n\t\t\t// Required field(s) are missing or empty\r\n\t\t\t// echo error json and stop the app\r\n\t\t\t$response = array();\r\n\t\t\t$app = \\Slim\\Slim::getInstance();\r\n\t\t\t$response[\"error\"] = true;\r\n\t\t\t$response[\"message\"] = 'Required field(s) ' . substr($error_fields, 0, -2) . ' is missing or empty';\r\n\t\t\techoRespnse(400, $response);\r\n\t\t\t$app->stop();\r\n\t\t}\r\n\t}", "function verifyRequiredParams($required_fields) {\n $error = false;\n $error_fields = \"\";\n $request_params = array();\n $request_params = $_REQUEST;\n\n foreach ($required_fields as $field) {\n if (!isset($request_params[$field]) || strlen(trim($request_params[$field])) <= 0) {\n $error = true;\n $error_fields .= $field . ', ';\n }\n }\n\n if ($error) {\n // Required field(s) are missing or empty\n // echo error json and stop the app\n $response = array();\n $app = \\Slim\\Slim::getInstance();\n $response[\"error\"] = true;\n $response[\"message\"] = 'Required field(s) ' . substr($error_fields, 0, -2) . ' is missing or empty';\n echoRespnse(400, $response);\n $app->stop();\n }\n}", "private function checkRequiredParameters()\n {\n $missingParameters = array();\n\n foreach ($this->parameters as $name => $properties) {\n $required = $properties['required'];\n $value = $properties['value'];\n if ($required && is_null($value)) {\n $missingParameters[] = $name;\n }\n }\n\n if (count($missingParameters) > 0) {\n $missingParametersList = implode(', ', $missingParameters);\n throw new IndexParameterException('The following required\n parameters were not set: '.$missingParametersList.'.');\n }\n }", "function checkEmptyField($requiredField){\n\n $formErrors = array();\n\n foreach($requiredField as $nameofField){\n\n if (!isset($_POST[$nameofField]) || $_POST[$nameofField] == NULL){\n \n $formErrors[] = $nameofField . \" is a required field.\" ;\n \n }\n }\n return $formErrors;\n }", "public function check_fields($fields) {\n\t \n\t if ($fields == \"*\") {\n\t\treturn array('error' => false, 'param' =>'');\n\t }\n\t \n $fields_arr = explode(',',$fields);\n\t \n\t foreach ($fields_arr as $element) {\n\t\tif (!isset($this->paramsStr[$element])) {\n\t\t return array('error' => true , 'param' => $element);\n\t\t}\n\t }\n\t return array('error' => false, 'param' =>'');\n\t}", "public function hasRequiredFields()\n {\n // If any of our fields are empty, reject stuff\n $all_fields_found = true;\n $field_list = array(\n 'email',\n 'password',\n 'password2',\n 'first_name',\n 'last_name',\n 'speaker_info'\n );\n\n foreach ($field_list as $field) {\n if (!isset($this->_data[$field])) {\n $all_fields_found = false;\n break;\n }\n }\n\n return $all_fields_found;\n }", "protected static function _required() {\n if (self::$_ruleValue) {\n if (trim(self::$_elementValue) == NULL &&\n strlen(self::$_elementValue) == 0) {\n self::setErrorMessage(\"Field Required\");\n self::setInvalidFlag(true);\n } else {\n self::setInvalidFlag(false);\n }\n }\n }", "protected static function validate_required($field, $input, $param = NULL)\n\t{\n\t\tif(isset($input[$field]) && trim($input[$field]) != '')\n\t\t{\n\t\t\treturn;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn array(\n\t\t\t\t'field' => $field,\n\t\t\t\t'value' => $input[$field],\n\t\t\t\t'rule'\t=> __FUNCTION__\n\t\t\t);\n\t\t}\n\t}", "function verifyRequiredParams($required_fields, Request $request) {\n $error = false;\n $error_fields = \"\";\n $request_params = array();\n $request_params = $_REQUEST;\n // Handling PUT request params\n if ($_SERVER['REQUEST_METHOD'] == 'PUT') {\n parse_str(request()->getBody(), $request_params);\n }\n foreach ($required_fields as $field) {\n if (!isset($request_params[$field]) || strlen(trim($request_params[$field])) <= 0) {\n $error = true;\n $error_fields .= $field . ', ';\n }\n }\n\n $response = array();\n $response[\"error\"] = $error;\n if ($error) {\n // Required field(s) are missing or empty\n $response[\"message\"] = 'Required field(s) ' . substr($error_fields, 0, -2) . ' is/are missing or empty';\n }\n return $response;\n}", "public function checkInput($fields = '')\n {\n if($fields == '*') return false;\n $this->describeTable();\n\n //$fields = explode(', ', $fields);\n $fields = preg_split('/ ?[,|] ?/', $fields);\n\n $arr = [];\n foreach($fields as $f)\n {\n if(!in_array($f, $this->tableFields))\n {\n continue;//just remove unsafe fields\n }\n else\n {\n $arr[] = $f;\n }\n }\n return (!empty($arr)) ? implode(',' , $arr) : false;\n }", "function validate_fields() {\n\t\treturn true;\n\t}", "function verifyRequiredParams($required_fields) {\r\n $error = false;\r\n $error_fields = \"\";\r\n $request_params = array();\r\n $request_params = $_REQUEST;\r\n // handling PUT request params\r\n if ($_SERVER['REQUEST_METHOD'] == 'PUT') {\r\n $app = \\Slim\\Slim::getInstance();\r\n parse_str($app->request()->getBody(), $request_params);\r\n }\r\n foreach ($required_fields as $field) {\r\n if (!isset($request_params[$field]) || !is_array($request_params)) {\r\n $error = true;\r\n $error_fields .= $field . ', ';\r\n }\r\n }\r\n if ($error) {\r\n // required fields are missing or empty\r\n // echo error json and stop the app\r\n $response = array();\r\n $app = \\Slim\\Slim::getInstance();\r\n $response['error'] = true;\r\n $response[\"message\"] = 'Required field(s) ' . substr($error_fields, 0, -2) . ' is missing or empty';\r\n echoResponse(400, $response);\r\n $app->stop();\r\n }\r\n}", "function validate_all($required,$data){\n\n\t$result = array();\n\t$result['code'] = 1;\n\t$result['error'] = \"All OK!\";\n\n\tif(count(array_intersect_key($required, $data)) != count($required)){\n\t\t$result['code'] = 0;\n\t\t$result['error'] = \"Fields Mismatch!\";\n\t\treturn $result;\n\t}\n\n\t$field_count \t= count($required);\n\n\tforeach ($required as $field => $rules) {\n\t\t$value = $data[$field];\n\n\t\t$code = 0;\n\t\t$error = \"\";\n\n\t\tswitch ($rules['type']) {\n\t\t\tcase 'numeric':\n\t\t\t\tif($rules['required'] && empty($value)){\n\t\t\t\t\t$error = $field.\" is empty.\";\t\n\t\t\t\t}else if(!is_numeric($value)){\n\t\t\t\t\t$error = $field.\" is not numeric.\";\n\t\t\t\t}else if(isset($rules['min'])){\n\t\t\t\t\tif($value < $rules['min']){\n\t\t\t\t\t\t$error = $field.\" min error.\";\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$code = 1;\n\t\t\t\t\t\t$error = \"All OK!\";\n\t\t\t\t\t}\n\t\t\t\t}else if(isset($rules['max'])){\n\t\t\t\t\tif($value > $rules['max']){\n\t\t\t\t\t\t$error = $field.\" max error.\";\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$code = 1;\n\t\t\t\t\t\t$error = \"All OK!\";\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\t$code = 1;\n\t\t\t\t\t$error = \"All OK!\";\n\t\t\t\t}\t\t\t\t\t\t\n\t\t\t\tbreak;\n\t\t\tcase 'alpha':\n\t\t\t\tif($rules['required'] && empty($value)){\n\t\t\t\t\t$error = $field.\" is empty.\";\t\n\t\t\t\t}else{\n\t\t\t\t\t$code = 1;\n\t\t\t\t\t$error = \"All OK!\";\n\t\t\t\t}\t\t\t\t\t\t\n\t\t\t\tbreak;\n\t\t\tcase 'email':\n\t\t\t\tif($rules['required'] && empty($value)){\n\t\t\t\t\t$error = $field.\" is empty.\";\t\n\t\t\t\t}else if(!preg_match($rules['pattern'], $value)){\n\t\t\t\t\t$error = $field.\" is invalid.\";\n\t\t\t\t}else{\n\t\t\t\t\t$code = 1;\n\t\t\t\t\t$error = \"All OK!\";\n\t\t\t\t}\t\t\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t# code...\n\t\t\t\tbreak;\n\t\t}\n\n\n\t\t$result['fields'][$field] = array('code' => $code, 'error' => $error, 'value'=>$value, 'field'=>$field );\n\t}\n\n\tforeach ($result['fields'] as $row) {\n\t\tif($row[\"code\"] == 0){\n\t\t\t$result['code'] = 0;\n\t\t\t$result['error'] = \"Invalid Fields!\";\n\t\t\tbreak;\n\t\t}\t\t\n\t}\n\n\treturn $result;\n\n}", "public function validateFields()\n {\n $invalidFields = [];\n if (empty($_POST[\"activity\"])) {\n array_push($invalidFields, \"activity\");\n }\n if (empty($_POST[\"country\"])) {\n array_push($invalidFields, \"country\");\n }\n if (empty($_POST[\"done\"]) && empty($_POST[\"not done\"])) {\n array_push($invalidFields, \"done\");\n }\n return $invalidFields;\n }", "function required_params()\n {\n $params = func_get_args();\n foreach ($params as $value) {\n if (is_array($value)) {\n if (empty($value)) {\n return false;\n }\n } else {\n if ($value === null || strlen(trim($value)) == 0) {\n return false;\n }\n }\n }\n\n return true;\n }", "function validateRequiredFields($requiredFields, $errorMsg=NULL,$errorLineBreak=false)\n{\n\t $errorOut =\"\";\n\t $errorArray =\tarray();\n\t\n\t foreach($requiredFields as $fieldName => $displayName)\n\t\t{\n\t\t\tif(!isset($_REQUEST[$fieldName]) || empty($_REQUEST[$fieldName]))\n\t\t\t{\n\t\t\t\tif(count($errorArray)> 0)\n\t\t\t\t\tarray_push($errorArray,\" \". $displayName);\n\t\t\t\telse\n\t\t\t\t\tarray_push($errorArray, $displayName);\n\t\t\t}\n\t\t}\n\t\t\n\t\n\n\t if(count($errorArray)> 0)\n\t\t {\n\t\t\t\n\t\t\tif($errorMsg!=NULL) // inserting the error message, if any at the first\n\t\t\t\t$errorArray=array_insert($errorArray, $errorMsg .\" \", 0);\n\t\t\t\n foreach($errorArray as $error)\n {\n if($errorLineBreak)\n $errorOut .= $error.'<br/>';\n \n else \n $errorOut .= $error;\n }\n \n \n \t\t\n }\n\t\t \t\t \n\t\n\treturn $errorOut;\n}", "public static function validate_required( $field_names ) {\n\t\tif ( is_array( $field_names ) ) {\n\t\t\tforeach ( $field_names as $field )\n\t\t\t\tself::validate_required( $field );\n\n\t\t\treturn; // We're done with this method at this point\n\t\t}\n\t\t\n\t\t// Check if the field was not sent or not filled out\n\t\tif ( ( ! isset( $_POST[$field_names] ) || trim( $_POST[$field_names] ) === '' ) && ! self::is_invalid( $field_names ) )\n\t\t\tself::log_error( $field_names, ERROR_REQUIRED );\n\t}", "public function required_fields(array $fields)\n\t{\n\t\tif (count($fields) > 0)\n\t\t{\n\t\t\tforeach ($fields as $field)\n\t\t\t{\n\t\t\t\t$this->_required_fields[$field] = TRUE;\n\t\t\t}\n\t\t}\n\t}", "public function validateRequireEntry(array $data)\n {\n $requiredFields = [\n 'rule_name' => __('Rule Name'),\n 'rule_path' => __('Rule Path')\n ];\n $errorNo = true;\n foreach ($data as $field => $value) {\n if (in_array($field, array_keys($requiredFields)) && $value == '') {\n $errorNo = false;\n $this->messageManager->addError(\n __('To apply changes, please fill required \"%1\" field', $requiredFields[$field])\n );\n }\n }\n return $errorNo;\n }", "static function checkForEmptyFields($fieldnames = array()) {\n\n $failure = false;\n foreach ($fieldnames as $fieldname) {\n $test = getInput($fieldname);\n if (!$test) {\n $failure = true;\n new SystemMessage($fieldname . \" can't be left empty\");\n }\n }\n if ($failure) {\n forward();\n }\n }", "function wck_test_required( $meta_array, $meta, $values, $id ){\r\n $fields = apply_filters( 'wck_before_test_required', $meta_array, $meta, $values, $id );\r\n\t\t$required_fields = array();\r\n\t\t$required_fields_with_errors = array();\r\n\t\t$required_message = '';\r\n\t\t\r\n\t\t$errors = '';\r\n\t\t\r\n\t\tif( !empty( $fields ) ){\r\n\t\t\tforeach( $fields as $field ){\r\n\t\t\t\tif( !empty( $field['required'] ) && $field['required'] )\r\n\t\t\t\t\t$required_fields[Wordpress_Creation_Kit_PB::wck_generate_slug( $field['title'], $field )] = $field['title'];\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif( !empty( $values ) ){\r\n\t\t\tforeach( $values as $key => $value ){\r\n\t\t\t\tif( array_key_exists( $key, $required_fields ) && apply_filters( \"wck_required_test_{$meta}_{$key}\", empty( $value ), $value, $id ) ){\r\n\t\t\t\t\t$required_message .= apply_filters( \"wck_required_message_{$meta}_{$key}\", __( \"Please enter a value for the required field \", \"wck\" ) . \"$required_fields[$key] \\n\", $value );\r\n\t\t\t\t\t$required_fields_with_errors[] = $key;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t$required_message .= apply_filters( \"wck_extra_message\", \"\", $fields, $required_fields, $meta, $values, $id );\r\n\t\t$required_fields_with_errors = apply_filters( \"wck_required_fields_with_errors\", $required_fields_with_errors, $fields, $required_fields, $meta, $value, $id );\r\n\r\n\t\tif( $required_message != '' ){\t\t\t\r\n\t\t\t$errors = array( 'error' => $required_message, 'errorfields' => $required_fields_with_errors );\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\treturn $errors;\r\n\t}", "private function validate_input() {\n\t\t$fields = array_merge( array( $this->range_field ), $this->key_fields, $this->checksum_fields );\n\n\t\t$this->validate_fields( $fields );\n\t\t$this->validate_fields_against_table( $fields );\n\t}", "function validate_all($required, $data)\n{\n $result = array();\n $result['code'] = 1;\n $result['error'] = \"All OK!\";\n if (count(array_intersect_key($required, $data)) != count($required)) {\n $result['code'] = 0;\n $result['error'] = \"Fields Mismatch!\";\n return $result;\n }\n foreach ($required as $field => $rules) {\n $value = trim($data[$field]);\n $code = 0;\n $error = \"\";\n switch ($rules['type']) {\n case 'numeric':\n if ($rules['required'] && empty($value)) {\n $error = $field . \" is empty.\";\n } else if (!is_numeric($value)) {\n $error = $field . \" is not numeric.\";\n } else if (isset($rules['min'])) {\n if ($value < $rules['min']) {\n $error = $field . \" min error.\";\n } else {\n $code = 1;\n $error = \"All OK!\";\n }\n } else if (isset($rules['max'])) {\n if ($value > $rules['max']) {\n $error = $field . \" max error.\";\n } else {\n $code = 1;\n $error = \"All OK!\";\n }\n } else {\n $code = 1;\n $error = \"All OK!\";\n }\n break;\n case 'alpha':\n if ($rules['required'] && empty($value)) {\n $error = $field . \" is empty.\";\n } else if (!preg_match('/^[a-zA-Z]+$/', $value)) {\n $error = $field . \" is invalid.\";\n } else {\n $code = 1;\n $error = \"All OK!\";\n }\n break;\n case 'alpha_space':\n if ($rules['required'] && empty($value)) {\n $error = $field . \" is empty.\";\n } else if (!preg_match('/^[a-zA-Z ]+$/', $value)) {\n $error = $field . \" is invalid.\";\n } else {\n $code = 1;\n $error = \"All OK!\";\n }\n break;\n case 'alphanumeric':\n if ($rules['required'] && empty($value)) {\n $error = $field . \" is empty.\";\n } else if (!preg_match('/^[a-zA-Z0-9]+$/', $value)) {\n $error = $field . \" is invalid.\";\n } else {\n $code = 1;\n $error = \"All OK!\";\n }\n break;\n case 'alphanumeric_space':\n if ($rules['required'] && empty($value)) {\n $error = $field . \" is empty.\";\n } else if (!preg_match('/^[a-zA-Z0-9 ]+$/', $value)) {\n $error = $field . \" is invalid.\";\n } else {\n $code = 1;\n $error = \"All OK!\";\n }\n break;\n case 'email':\n if ($rules['required'] && empty($value)) {\n $error = $field . \" is empty.\";\n } else if (!preg_match($rules['pattern'], $value)) {\n $error = $field . \" is invalid.\";\n } else {\n $code = 1;\n $error = \"All OK!\";\n }\n break;\n case 'pattern':\n if ($rules['required'] && empty($value)) {\n $error = $field . \" is empty.\";\n } else if (!preg_match($rules['pattern'], $value)) {\n $error = $field . \" is invalid.\";\n } else {\n $code = 1;\n $error = \"All OK!\";\n }\n break;\n case 'any':\n # code...\n if ($rules['required'] && empty($value)) {\n $error = $field . \" is empty.\";\n } else {\n $code = 1;\n $error = \"All OK!\";\n }\n break;\n }\n $result['fields'][$field] = array('code' => $code, 'error' => $error, 'value' => $value, 'field' => $field);\n }\n foreach ($result['fields'] as $row) {\n if ($row[\"code\"] == 0) {\n $result['code'] = 0;\n $result['error'] = $row['error'];\n break;\n }\n }\n return $result;\n}", "public static function fieldListMandatory($method, $fieldList, $params) {\n $result = TRUE;\n $errorFieldList = array();\n foreach ($fieldList as $_field) {\n if (!isset($params[$_field])) {\n $result = FALSE;\n } elseif (is_array($params[$_field])) {\n if (count($params[$_field]) == 0) {\n $result = FALSE;\n }\n } else {\n if (strlen($params[$_field]) == 0) {\n $result = FALSE;\n }\n }\n $errorFieldList[] = $_field;\n }\n if ($result === FALSE && count($errorFieldList) > 0) {\n \\Raneko\\Log::error($method, \"Mandatory fields constraint violated: \" . implode(\", \", $errorFieldList));\n }\n return $result;\n }", "public function validateFields($par)\n {\n $i=0;\n foreach ($par as $key => $value){\n if(empty($value)){\n $i++;\n }\n }\n if($i==0){\n return true;\n }else{\n $this->setErro(\"Preencha todos os dados!\");\n return false;\n }\n }", "protected function checkInput() {\n\t\t\t$errorMessages = array();\n\t\t\tforeach($this->requestVarsToCheck as $requestKey => $checkType) {\n\t\t\t\tswitch($checkType) {\n\t\t\t\t\tcase REQUEST_CHECK_TYPE_EXISTS:\n\t\t\t\t\t\tif(!requestExists($requestKey)) {\n\t\t\t\t\t\t\t$errorMessages[$requestKey] = \"You must enter something for this field.\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\t\tcase REQUEST_CHECK_TYPE_IS_NUMERIC:\n\t\t\t\t\t\tif(!requestExists($requestKey) || !is_numeric(getRequestValue($requestKey))) {\n\t\t\t\t\t\t\t$errorMessages[$requestKey] = \"This must be a number\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\t\tcase REQUEST_CHECK_TYPE_MIN_6_CHARACTERS:\n\t\t\t\t\t\tif(!requestExists($requestKey) || strlen(getRequestValue($requestkey)) < 6) {\n\t\t\t\t\t\t\t$errorMessages[$requestkey] = \"This must be at least 6 characters long\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$this->errorMessages = $errorMessages;\n\t\t}", "function requestRequires($fields, $request){\n \treturn !array_diff_key(array_flip($fields), $request);\n }", "function check_fields() {\r\n \r\n $fail = false;\r\n\t\t$empty = true;\r\n\t\t\r\n // if first name contains any non-letter characters, exit\r\n\t\tif($_POST[\"InputFirstName\"] != '') {\r\n\t\t\tif(!filter_var($_POST[\"InputFirstName\"], FILTER_VALIDATE_REGEXP, array(\"options\"=>array(\"regexp\"=>\"/^[a-zA-Z]*$/\")))) {\r\n\t\t\t\t$GLOBALS['firstNameNotValid'] = true;\r\n\t\t\t\t$fail = true;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t$empty = false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n // if last name contains any non-letter characters, exit\r\n\t\tif($_POST[\"InputLastName\"] != '') {\r\n\t\t\tif(!filter_var($_POST[\"InputLastName\"], FILTER_VALIDATE_REGEXP, array(\"options\"=>array(\"regexp\"=>\"/^[a-zA-Z]*$/\")))) {\r\n\t\t\t\t$GLOBALS['lastNameNotValid'] = true;\r\n\t\t\t\t$fail = true;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t$empty = false;\r\n\t\t\t}\r\n\t\t}\r\n \r\n // if phone number contains any non-digit or - characters, exit\r\n\t\tif($_POST[\"InputPhone\"] != '') {\r\n\t\t\tif(!filter_var($_POST[\"InputPhone\"], FILTER_VALIDATE_REGEXP, array(\"options\"=>array(\"regexp\"=>\"/^[0-9-]*$/\")))) {\r\n\t\t\t\t$GLOBALS['phoneNumberNotValid'] = true;\r\n\t\t\t\t$fail = true;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t$empty = false;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n if(!$fail && !$empty) {\r\n change_info();\r\n }\r\n }", "public function checkRequired($cols)\n\t{\n\t\t$eav_attr=$this->tablename(\"eav_attribute\");\n\t\t$sql=\"SELECT attribute_code FROM $eav_attr WHERE is_required=1\n\t\tAND frontend_input!='' AND frontend_label!='' AND entity_type_id=?\";\n\t\t$required=$this->selectAll($sql,$this->prod_etype);\n\t\t$reqcols=array();\n\t\tforeach($required as $line)\n\t\t{\n\t\t\t$reqcols[]=$line[\"attribute_code\"];\n\t\t}\n\t\t$required=array_diff($reqcols,$cols);\n\t\treturn $required;\n\t}", "public function checkRequiredFields($count, $elementData) {\n foreach ($elementData as $header => $data) {\n foreach ($data as $key => $value) {\n if (in_array($header, $this->requiredHeaders)) {\n if (in_array($key, $this->requiredInputs[$header]) && $value) {\n $this->validateDetailTransactionData($header, $key, $count, $value);\n } elseif (!in_array($key, $this->requiredInputs[$header]) && ($value || !$value)) {\n if ($value)\n $this->validateDetailTransactionData($header, $key, $count, $value);\n } else {\n $this->error[$count][]['message'] = $header . '-' . $key .' is a required field.';\n }\n } else {\n if (in_array($key, $this->requiredInputs[$header]) && !$value) {\n $state = true; \n } elseif (in_array($key, $this->requiredInputs[$header]) && $value) {\n $state = false;\n $this->validateDetailTransactionData($header, $key, $count, $value);\n } elseif (!in_array($key, $this->requiredInputs[$header]) && $value && $state) {\n $this->error[$count][]['message'] = 'Cannot set ' . $header . '-' . $key . ' without setting ' . $header . '-' . $this->requiredInputs[$header][0] . '.';\n } elseif ($value) {\n $this->validateDetailTransactionData($header, $key, $count, $value);\n }\n }\n }\n }\n }", "function check_required_vars($params = array())\n\t{\n\t\tglobal $SID, $phpEx, $data;\n\n\t\twhile( list($var, $param) = @each($params) )\n\t\t{\n\t\t\tif (empty($data[$param]))\n\t\t\t{\n\t\t\t\tredirect(append_sid(\"garage.$phpEx?mode=error&EID=3\", true));\n\t\t\t}\n\t\t}\n\n\t\treturn ;\n\t}", "public function required($data, $value, $field)\n {\n if ($field) {\n return true;\n } else {\n $this->errors[$value][] = \" $value is required\";\n }\n// $this->errors[$value][] = \" $value is required\";\n// return empty($field) ? false : true;\n }", "public function getFrontEndRequiredFields();", "function validateBizAddFields($fields)\r\r\n\t\t\t{\r\r\n\t\t\t\t$f1 = $fields['businessName'];\r\r\n\t\t\t\t$f2 = $fields['businessCategory'];\r\r\n\t\t\t\t$f3 = $fields['address1'];\r\r\n\t\t\t\t$f4 = $fields['city'];\r\r\n\t\t\t\tif (($f1 == '') && ($f2 == '') && ($f3 == '') && ($f4 == '')) {\r\r\n\t\t\t\t\treturn array('businessName' => 'Business name, category, address and city are required fields');\r\r\n\t\t\t\t}\r\r\n\t\t\t\treturn true;\r\r\n\t\t\t}", "function verifyRequiredParams($required_fields) {\r\n $error = false;\r\n $error_fields = \"\";\r\n $request_params = array();\r\n $request_params = $_REQUEST;\r\n // Handling PUT request params\r\n if ($_SERVER['REQUEST_METHOD'] == 'PUT') {\r\n $app = \\Slim\\Slim::getInstance();\r\n parse_str($app->request()->getBody(), $request_params);\r\n }\r\n foreach ($required_fields as $field) {\r\n if (!isset($request_params[$field]) || strlen(trim($request_params[$field])) <= 0) {\r\n $error = true;\r\n $error_fields .= $field . ', ';\r\n }\r\n }\r\n\r\n if ($error) {\r\n // Required field(s) are missing or empty\r\n // echo error json and stop the app\r\n $response = array();\r\n $app = \\Slim\\Slim::getInstance();\r\n $response[\"error\"] = true;\r\n $response[\"message\"] = 'Required field(s) ' . substr($error_fields, 0, -2) . ' is missing or empty';\r\n echoRespnse(400, $response);\r\n $app->stop();\r\n }\r\n}", "function verifyRequiredParams($required_fields) {\n\n $error = false;\n $error_fields = \"\";\n $request_params = array();\n $request_params = $_REQUEST;\n // Handling PUT request params\n if ($_SERVER['REQUEST_METHOD'] == 'PUT') {\n $app = \\Slim\\Slim::getInstance();\n parse_str($app->request()->getBody(), $request_params);\n }\n foreach ($required_fields as $field) {\n if (!isset($request_params[$field]) || strlen(trim($request_params[$field])) <= 0) {\n $error = true;\n $error_fields .= $field . ', ';\n }\n }\n\n if ($error) {\n // Required field(s) are missing or empty\n // echo error json and stop the app\n $response = array();\n $app = \\Slim\\Slim::getInstance();\n $response[\"status\"] = \"failed\";\n $response[\"message\"] = 'Required field(s) ' . substr($error_fields, 0, -2) . ' is missing or empty';\n $response[\"errorcode\"]=5;\n echoRespnse(400, $response);\n $app->stop();\n }\n\n}", "function checkMandatoryArguments()\n \t{\n \t\tif($this->mStrAdGUID == \"\" || $this->mStrAdGUID == null)\n \t\t\treturn false;\n \t\telse if($this->mStrQuantity == \"\" || $this->mStrQuantity == null)\n \t\t\treturn false;\n \t\telse\n \t\t\treturn true;\n \t}", "public function checkRequired($cols)\n\t{\n\t\t$eav_attr=$this->tablename(\"eav_attribute\");\n\t\t$sql=\"SELECT attribute_code FROM $eav_attr WHERE is_required=1\n\t\tAND frontend_input!='' AND frontend_label!='' AND entity_type_id=?\";\n\t\t$required=$this->selectAll($sql,$this->cat_etype);\n\t\t$reqcols=array();\n\t\tforeach($required as $line)\n\t\t{\n\t\t\t$reqcols[]=$line[\"attribute_code\"];\n\t\t}\n\t\t$required=array_diff($reqcols,$cols);\n\t\treturn $required;\n\t}", "public function checkRequired() {\n\t\tif(!func_num_args()) {\n\t\t\treturn true;\n\t\t}\n\n\t\t$optArr = func_get_args();\n\t\tforeach($optArr as $val) {\n\t\t\t$flag = $val;\n\t\t\t$altFlag = false;\n\n\t\t\tif(is_array($val)) {\n\t\t\t\tlist($flag, $altFlag) = array_values($val);\n\t\t\t}\n\n\t\t\tif(!$this->isFlagSet($flag, $altFlag)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t}", "function validate(){\r\n\t\t$missing_fields = Array ();\r\n\t\tforeach ( $this->required_fields as $field ) {\r\n\t\t\t$true_field = $this->fields[$field]['name'];\r\n\t\t\tif ( $this->$true_field == \"\") {\r\n\t\t\t\t$missing_fields[] = $field;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif ( count($missing_fields) > 0){\r\n\t\t\t// TODO Create friendly equivelant names for missing fields notice in validation \r\n\t\t\t$this->errors[] = __ ( 'Missing fields: ' ) . implode ( \", \", $missing_fields ) . \". \";\r\n\t\t}\r\n\t\treturn apply_filters('em_event_validate', count($this->errors) == 0, $this );\r\n\t}", "function checkFields( $args )\r\n {\r\n\t\treturn true;\r\n }", "function validate_fields( $array ) {\n\t\t$this->validate_list = $array;\n\t\t}", "abstract protected function getMandatoryModelsFields();", "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 verifyRequiredParams($required_fields) {\n $error = false;\n $error_fields = \"\";\n $request_params = $_REQUEST;\n // Handling PUT request params\n if ($_SERVER['REQUEST_METHOD'] == 'PUT') {\n $app = \\Slim\\Slim::getInstance();\n parse_str($app->request()->getBody(), $request_params);\n }\n foreach ($required_fields as $field) {\n if (!isset($request_params[$field]) || strlen(trim($request_params[$field])) <= 0) {\n $error = true;\n $error_fields .= $field . ', ';\n }\n }\n\n if ($error) {\n // Required field(s) are missing or empty\n // echo error json and stop the app\n $response = array();\n $app = \\Slim\\Slim::getInstance();\n $response[\"error\"] = true;\n $response[\"message\"] = 'Required field(s) ' . substr($error_fields, 0, -2) . ' is missing or empty';\n echoResponse(400, $response);\n $app->stop();\n }\n}", "public function listCaseTestValidateForInput()\n {\n return [\n ['name', '', 'The name field is required.'],\n ['identity_number', '', 'The identity number field is required.'],\n ['dob', '', 'The dob does not match the format Y-m-d.'],\n ['address', '', 'The address must be a string.'],\n ['avatar', '','The avatar must be an image'],\n ['avatar', '','The avatar must be a file of type: png, jpg, jpeg'],\n ];\n }", "public static function getMandatoryField() {\n\t\t$mandatory['AU'] = array('bsb' => 'required','account_number' => 'required', 'account_holder_name' => 'required', 'currency' => 'required', 'routing_number' => 'required');\n\t\t$mandatory['CA'] = array('transit_number' => 'required','account_number' => 'required','institution_number' => 'required', 'account_holder_name' => 'required', 'currency' => 'required', 'routing_number' => 'required');\n\t\t$mandatory['GB'] = array('sort_code' => 'required', 'account_number' => 'required', 'account_holder_name' => 'required', 'currency' => 'required');\n\t\t$mandatory['HK'] = array('clearing_code' => 'required', 'account_number' => 'required', 'branch_code' => 'required', 'account_holder_name' => 'required', 'currency' => 'required');\n\t\t$mandatory['JP'] = array('bank_code' => 'required','bank_code' => 'required', 'account_number' => 'required', 'branch_code' => 'required', 'bank_name' => 'required', 'branch_name' => 'required', 'account_owner_name' => 'required', 'account_holder_name' => 'required', 'currency' => 'required');\n\t\t$mandatory['NZ'] = array('routing_number' => 'required', 'account_number' => 'required', 'account_holder_name' => 'required', 'currency' => 'required');\n\t\t$mandatory['SG'] = array('bank_code' => 'required', 'account_number' => 'required', 'branch_code' => 'required', 'account_holder_name' => 'required', 'currency' => 'required');\n\t\t$mandatory['US'] = array('routing_number' => 'required', 'account_number' => 'required', 'account_holder_name' => 'required', 'currency' => 'required', 'ssn_last_4' => 'required');\n\t\t$mandatory['AT'] = array('iban' => 'required','account_number'=>'required','account_holder_name' => 'required', 'currency' => 'required');\n\t\t$mandatory['BE'] = array('iban' => 'required','account_holder_name' => 'required','currency' => 'required','account_number'=>'required');\n\t\t$mandatory['CH'] = array('iban' => 'required', 'account_holder_name' => 'required', 'currency' => 'required','account_number'=>'required');\n\t\t$mandatory['DE'] = array('iban' => 'required', 'account_holder_name' => 'required', 'currency' => 'required','account_number' => 'required');\n\t\t$mandatory['DK'] = array('iban' => 'required', 'account_holder_name' => 'required', 'currency' => 'required','account_number' => 'required');\n\t\t$mandatory['ES'] = array('iban' => 'required', 'account_holder_name' => 'required', 'currency' => 'required','account_number'=>'required');\n\t\t$mandatory['FI'] = array('iban' => 'required', 'account_holder_name' => 'required', 'currency' => 'required','account_number' => 'required');\n\t\t$mandatory['FR'] = array('iban' => 'required', 'account_holder_name' => 'required', 'currency' => 'required','account_number' => 'required');\n\t\t$mandatory['IE'] = array('iban' => 'required', 'account_holder_name' => 'required', 'currency' => 'required','account_number'=>'required');\n\t\t$mandatory['IT'] = array('iban' => 'required', 'account_holder_name' => 'required', 'currency' => 'required','account_number'=>'required');\n\t\t$mandatory['LU'] = array('iban' => 'required', 'account_holder_name' => 'required', 'currency' => 'required','account_number'=>'required');\n\t\t$mandatory['NL'] = array('iban' => 'required', 'account_holder_name' => 'required', 'currency' => 'required','account_number'=>'required');\n\t\t$mandatory['NO'] = array('iban' => 'required', 'account_holder_name' => 'required', 'currency' => 'required','account_number'=>'required');\n\t\t$mandatory['PT'] = array('iban' => 'required', 'account_holder_name' => 'required', 'currency' => 'required','account_number'=>'required');\n\t\t$mandatory['SE'] = array('iban' => 'required', 'account_holder_name' => 'required', 'currency' => 'required','account_number'=>'required');\n\t\t$mandatory['OT'] = array('account_number' => 'required', 'bank_name' => 'required', 'account_holder_name' => 'required','branch_name' => 'required');\n\n\t\treturn $mandatory;\n\t}", "function validateBizEditFields($fields)\r\r\n\t\t\t{\r\r\n\t\t\t\t$f1 = $fields['businessName'];\r\r\n\t\t\t\t$f2 = $fields['catID'];\r\r\n\t\t\t\t$f3 = $fields['address1'];\r\r\n\t\t\t\t$f4 = $fields['city'];\r\r\n\t\t\t\tif (($f1 == '') && ($f2 == '') && ($f3 == '') && ($f4 == '')) {\r\r\n\t\t\t\t\treturn array('businessName' => 'Business name, category, address and city are required fields');\r\r\n\t\t\t\t}\r\r\n\t\t\t\treturn true;\r\r\n\t\t\t}", "function verifyRequiredParams($required_fields) {\n $error = false;\n $error_fields = \"\";\n $request_params = array();\n $request_params = $_REQUEST;\n // Handling PUT request params\n if ($_SERVER['REQUEST_METHOD'] == 'PUT') {\n $app = \\Slim\\Slim::getInstance();\n parse_str($app->request()->getBody(), $request_params);\n }\n foreach ($required_fields as $field) {\n if (!isset($request_params[$field]) || strlen(trim($request_params[$field])) <= 0) {\n $error = true;\n $error_fields .= $field . ', ';\n }\n }\n\n if ($error) {\n // Required field(s) are missing or empty\n // echo error json and stop the app\n $response = array();\n $app = \\Slim\\Slim::getInstance();\n $response[\"error\"] = true;\n $response[\"message\"] = 'Required field(s) ' . substr($error_fields, 0, -2) . ' is missing or empty';\n echoResponse(400, $response);\n $app->stop();\n }\n}", "protected function checkStructure()\n {\n $structure = $this->getStructure();\n\n foreach ($structure as $field => $opt) {\n if (!array_key_exists($field, $this->data)) {\n continue;\n }\n\n $value = Arr::get($this->data, $field);\n if (is_array($value)) {\n $this->errors[$field][] = Translate::get('validate_wrong_type_data');\n continue;\n }\n\n $value = trim($value);\n $length = (int)$opt->length;\n\n if (!empty($length)) {\n $len = mb_strlen($value);\n if ($len > $length) {\n $this->errors[$field][] = Translate::getSprintf('validate_max_length', $length);\n continue;\n }\n }\n\n if (!$opt->autoIncrement && $opt->default === NULL && !$opt->allowNull && $this->isEmpty($value)) {\n $this->errors[$field][] = Translate::get('validate_not_empty');\n continue;\n }\n\n switch ($opt->dataType) {\n case 'int':\n case 'bigint':\n if (!$this->isEmpty($value) && (filter_var($value, FILTER_VALIDATE_INT) === false)) {\n $this->errors[$field][] = Translate::get('validate_int');\n continue 2;\n }\n break;\n\n case 'double':\n if (!is_float($value) && !$this->isEmpty($value)) {\n $this->errors[$field][] = Translate::get('validate_double');\n continue 2;\n }\n break;\n\n case 'float':\n if (!is_numeric($value) && !$this->isEmpty($value)) {\n $this->errors[$field][] = Translate::get('validate_float');\n continue 2;\n }\n break;\n\n case 'date':\n case 'datetime':\n case 'timestamp':\n if (!$this->isEmpty($value) && !Validate::dateSql($value)) {\n $this->errors[$field][] = Translate::get('validate_sql_date');\n continue 2;\n }\n break;\n\n default:\n continue 2;\n break;\n\n }\n }\n }", "function requirePOST(...$args) {\n foreach ($args as $field) {\n if (!isset($_POST[$field])) die(\"Missing data!\\n\");\n }\n}", "function give_validate_required_form_fields( $form_id ) {\n\n\t// Sanitize values submitted with donation form.\n\t$post_data = give_clean( $_POST ); // WPCS: input var ok, sanitization ok, CSRF ok.\n\n\t// Loop through required fields and show error messages.\n\tforeach ( give_get_required_fields( $form_id ) as $field_name => $value ) {\n\n\t\t// Clean Up Data of the input fields.\n\t\t$field_value = $post_data[ $field_name ];\n\n\t\t// Check whether the required field is empty, then show the error message.\n\t\tif ( in_array( $value, give_get_required_fields( $form_id ), true ) && empty( $field_value ) ) {\n\t\t\tgive_set_error( $value['error_id'], $value['error_message'] );\n\t\t}\n\t}\n}", "public function providedFields();", "abstract public function validate(array $data, array $fields);", "protected function _checkFieldList($core = 'beowulf', $fields){\n if(!is_null($fields)){\n $this->_schemaFields[] = '*';\n $this->_schemaFields[] = 'q';\n foreach($fields as $f){\n if(!in_array($f,$this->_schemaFields)){\n throw new Pas_Solr_Exception('The field ' . $f\n . ' is not in the schema');\n }\n }\n } else {\n throw new Pas_Solr_Exception('The fields supplied are not an array');\n }\n }", "function verifyRequiredParams($requiredParams) {\n $error = false;\n $requestParams = array();\n $requestParams = $_REQUEST;\n $errorFields = '';\n if ($_SERVER['REQUEST_METHOD'] == 'PUT') {\n $app = \\Slim\\Slim::getInstance();\n parse_str($app->request->getBody(), $requestParams);\n }\n foreach ($requiredParams as $field) {\n if (!isset($requestParams[$field]) || strlen($requestParams[$field]) <= 0) {\n $error = true;\n $errorFields .= $field . ', ';\n }\n }\n if ($error) {\n $response = array();\n $app = \\Slim\\Slim::getInstance();\n $response['error'] = true;\n $response['message'] = 'Required field(s) ' . substr($errorFields, 0, -2) . ' is missing or empty.';\n echoResponse(400, $response);\n $app->stop();\n }\n}", "function validate_presences($required_fields, $warning_me=false) {\n global $errors;\n global $warnings;\n\n $msg_presence=array();\n\n foreach($required_fields as $field) {\n $value = trim($_POST[$field]);\n \tif (!has_presence($value)) {\n if ($warning_me) {\n $warnings[$field] = fieldname_as_text($field) . \" can't be blank\";\n // $msg_presence[$field]=get_warning_error($warnings[$field],$warning_me);\n $msg_presence[$field]=$warnings[$field];\n\n }else{\n \t\t $errors[$field] = fieldname_as_text($field) . \" can't be blank\";\n // $msg_presence[$field]=get_warning_error($errors[$field],$warning_me);;\n $msg_presence[$field]=$errors[$field];\n\n\n }\n\n }\n }\n\n return $msg_presence;\n\n}", "public function check($values, $required, $disabled)\n {\n global $zdb;\n $errors = array();\n\n $fields = array_keys($this->_fields);\n foreach ( $fields as $key ) {\n //first of all, let's sanitize values\n $key = strtolower($key);\n $prop = '_' . $this->_fields[$key]['propname'];\n\n if ( isset($values[$key]) ) {\n $value = trim($values[$key]);\n } else {\n $value = '';\n }\n\n // if the field is enabled, check it\n if ( !isset($disabled[$key]) ) {\n // fill up the adherent structure\n //$this->$prop = stripslashes($value); //not relevant here!\n\n // now, check validity\n switch ( $key ) {\n // dates\n case 'date_enreg':\n case 'date_debut_cotis':\n case 'date_fin_cotis':\n if ( $value != '' ) {\n try {\n $d = \\DateTime::createFromFormat(_T(\"Y-m-d\"), $value);\n if ( $d === false ) {\n throw new \\Exception('Incorrect format');\n }\n $this->$prop = $d->format('Y-m-d');\n } catch (\\Exception $e) {\n Analog::log(\n 'Wrong date format. field: ' . $key .\n ', value: ' . $value . ', expected fmt: ' .\n _T(\"Y-m-d\") . ' | ' . $e->getMessage(),\n Analog::INFO\n );\n $errors[] = str_replace(\n array(\n '%date_format',\n '%field'\n ),\n array(\n _T(\"Y-m-d\"),\n $this->_fields[$key]['label']\n ),\n _T(\"- Wrong date format (%date_format) for %field!\")\n );\n }\n }\n break;\n case Adherent::PK:\n if ( $value != '' ) {\n $this->_member = $value;\n }\n break;\n case ContributionsTypes::PK:\n if ( $value != '' ) {\n $this->_type = new ContributionsTypes((int)$value);\n }\n break;\n case 'montant_cotis':\n $this->_amount = $value;\n $us_value = strtr($value, ',', '.');\n if ( !is_numeric($value) ) {\n $errors[] = _T(\"- The amount must be an integer!\");\n }\n break;\n case 'type_paiement_cotis':\n if ( $value == self::PAYMENT_OTHER\n || $value == self::PAYMENT_CASH\n || $value == self::PAYMENT_CREDITCARD\n || $value == self::PAYMENT_CHECK\n || $value == self::PAYMENT_TRANSFER\n || $value == self::PAYMENT_PAYPAL\n ) {\n $this->_payment_type = $value;\n } else {\n $errors[] = _T(\"- Unknown payment type\");\n }\n break;\n case 'info_cotis':\n $this->_info = $value;\n break;\n case Transaction::PK:\n if ( $value != '' ) {\n $this->_transaction = new Transaction((int)$value);\n }\n break;\n case 'duree_mois_cotis':\n if ( $value != '' ) {\n if ( !is_numeric($value) || $value<=0 ) {\n $errors[] = _T(\"- The duration must be a positive integer!\");\n }\n $this->$prop = $value;\n $this->_retrieveEndDate();\n }\n break;\n }\n }\n }\n\n // missing required fields?\n while ( list($key, $val) = each($required) ) {\n if ( $val === 1) {\n $prop = '_' . $this->_fields[$key]['propname'];\n if ( !isset($disabled[$key])\n && (!isset($this->$prop)\n || (!is_object($this->$prop) && trim($this->$prop) == '')\n || (is_object($this->$prop) && trim($this->$prop->id) == ''))\n ) {\n $errors[] = _T(\"- Mandatory field empty: \") .\n ' <a href=\"#' . $key . '\">' . $this->getFieldName($key) .'</a>';\n }\n }\n }\n\n if ( $this->_transaction != null && $this->_amount != null) {\n $missing = $this->_transaction->getMissingAmount();\n //calculate new missing amount\n $missing = $missing + $this->_orig_amount - $this->_amount;\n if ( $missing < 0 ) {\n $errors[] = _T(\"- Sum of all contributions exceed corresponding transaction amount.\");\n }\n }\n\n if ( count($errors) > 0 ) {\n Analog::log(\n 'Some errors has been throwed attempting to edit/store a contribution' .\n print_r($errors, true),\n Analog::DEBUG\n );\n return $errors;\n } else {\n Analog::log(\n 'Contribution checked successfully.',\n Analog::DEBUG\n );\n return true;\n }\n }", "public function isRequired($fieldName) {\n\t\t$configuration = $this->getConfiguration($fieldName);\n\t\t$parts = array();\n\t\tif (!empty($configuration['eval'])) {\n\t\t\t$parts = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::trimExplode(',', $configuration['eval']);\n\t\t}\n\t\treturn in_array('required', $parts);\n\t}", "function validate()\n\t\t{\n\t\t\tif(count($this->validateFields)==0 || !is_array($this->validateFields)){\n\t\t\t\treturn false;\n\t\t\t}else{\n\t\t\t\t$error\t=\t0;\n\t\t\t\t$fieldPos=1;\n\t\t\t\t//First Validate For Empty on all fields //\n\t\t\t\tforeach($this->validateFields as $key=>$val){\n\t\t\t\t\t\n\t\t\t\t\t$checkedError\t=\t0;\n\t\t\t\t\t$parts\t=\texplode(\"/\",$val);\n\t\t\t\t\t$label\t=\t$parts[0];\n\t\t\t\t\t$valids\t=\texplode(\"|\",$parts[1]);\t\n\t\t\t\t\tif(in_array(\"EMPTY\",$valids) && $checkedError==0){\n\t\t\t\t\t\tif($this->validateEmpty($key)){\n\t\t\t\t\t\t\t$error++;\n\t\t\t\t\t\t\t$this->setError(\"Enter Mandatory Fields \");\n\t\t\t\t\t\t\t$checkedError\t=\t1;\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\t$fieldPos++;\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\tif($error==0){\n\t\t\t\t\t$fieldPos=1;\n\t\t\t\t\tforeach($this->validateFields as $key=>$val){\n\t\t\t\t\t\n\t\t\t\t\t\t$checkedError\t=\t0;\n\t\t\t\t\t\t$parts\t=\texplode(\"/\",$val);\n\t\t\t\t\t\t$label\t=\t$parts[0];\n\t\t\t\t\t\t$valids\t=\texplode(\"|\",$parts[1]);\t\t\t\t\t\t\n\t\t\t\t\t\tif(in_array(\"EMAIL\",$valids)){\n\t\t\t\t\t\t\tif(!$this->validateEmail($key) && $checkedError==0 && $error==0){\n\t\t\t\t\t\t\t\t$error++;\n\t\t\t\t\t\t\t\t$this->setError(\"Invalid email id in field -\".$label.\"-\");\n\t\t\t\t\t\t\t\t$checkedError=1;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\t\t\t\t\t\t\n\t\t\t\t\t\tif(in_array(\"NUMBER\",$valids)){\n\t\t\t\t\t\t\tif(!$this->validateNumeric($key) && $checkedError==0 && $error==0){\n\t\t\t\t\t\t\t\t$error++;\n\t\t\t\t\t\t\t\t$this->setError(\"Enter Numeric in field -\".$label.\"-\");\n\t\t\t\t\t\t\t\t$checkedError=1;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(in_array(\"FILTER\",$valids)){\n\t\t\t\t\t\t\tif($this->validateSpecial($key) && $checkedError==0 && $error==0){\n\t\t\t\t\t\t\t\t$error++;\n\t\t\t\t\t\t\t\t$this->setError(\"Special chars not allowed in field -\".$label.\"-\");\n\t\t\t\t\t\t\t\t$checkedError=1;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(in_array(\"URL\",$valids)){\n\t\t\t\t\t\t\tif(!$this->validateUrl($key) && $checkedError==0 && $error==0){\n\t\t\t\t\t\t\t\t$error++;\n\t\t\t\t\t\t\t\t$this->setError(\"Invalid website address in field -\".$label.\"-\");\n\t\t\t\t\t\t\t\t$checkedError=1;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$fieldPos++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\t\t\t\t\n\t\t\t\n\t\t\tif($error==0){\n\t\t\treturn true;\n\t\t\t}else{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}", "public function isRequired();", "public function isRequired();", "public function isRequired();", "public function isRequired();", "public function isRequired();", "public function isRequired();", "public function isRequired();", "public function isRequired();", "function testRequired(){\n\t\t#mdx:required\n\t\tParam::get('name')\n\t\t\t->context(['name'=>''])\n\t\t\t->filters()\n\t\t\t\t->required(\"Cannot be empty\");\n\n\t\t$error = Param::get('name')->process()->error;\n\t\t#/mdx var_dump($error)\n\t\t$this->assertEquals(\"Cannot be empty\", $error);\n\t}", "public function validate ()\n {\n $errorCount = 0;\n foreach ($this->arrayFieldDefinition as $fieldName => $arrField) {\n if ( $arrField['required'] === true )\n {\n $accessor = $this->arrayFieldDefinition[$fieldName]['accessor'];\n if ( trim ($this->$accessor ()) == \"\" )\n {\n $this->validationFailures[] = $fieldName . \" Is empty. It is a required field\";\n $errorCount++;\n }\n }\n }\n if ( $errorCount > 0 )\n {\n return false;\n }\n return true;\n }", "function validateBizSearchFields($fields)\r\r\n\t\t\t{\r\r\n\t\t\t\t$f1 = $fields['businessName'];\r\r\n\t\t\t\t$f2 = $fields['catID'];\r\r\n\t\t\t\t$f3 = $fields['address1'];\r\r\n\t\t\t\t$f4 = $fields['city'];\r\r\n\t\t\t\t$f5 = $fields['postcode'];\r\r\n\t\t\t\t$f6 = $fields['phoneAreacode'];\r\r\n\t\t\t\t$f7 = $fields['phoneNumber'];\r\r\n\t\t\t\t$f8 = $fields['cellPhoneNumber'];\r\r\n\t\t\t\t$f9 = $fields['faxNumber'];\r\r\n\t\t\t\tif (($f1 == '') && ($f2 == '') && ($f3 == '') && ($f4 == '') && ($f5 == '') && ($f6 == '') && ($f7 == '') && ($f8 == '') && ($f9 == '')) {\r\r\n\t\t\t\t\treturn array('businessName' => 'Atleast one field required for a search');\r\r\n\t\t\t\t}\r\r\n\t\t\t\treturn true;\r\r\n\t\t\t}", "public function validateKeys($required = []) {\n foreach ($required as $key) {\n if (empty($this->getValue($key))) {\n throw new \\Exception(\"You must specify a config value for: $key.\");\n }\n }\n }", "public function checkRequiredParamsSet() : bool {\n }", "function verifyRequiredParams($required_fields) {\n $error = false;\n $error_fields = \"\";\n $request_params = array();\n $request_params = $_REQUEST;\n // Handling PUT request params\n if ($_SERVER['REQUEST_METHOD'] == 'PUT') {\n $app = \\Slim\\Slim::getInstance();\n parse_str($app->request()->getBody(), $request_params);\n }\n foreach ($required_fields as $field) {\n if (!isset($request_params[$field]) || strlen(trim($request_params[$field])) <= 0) {\n $error = true;\n $error_fields .= $field . ', ';\n }\n }\n\n if ($error) {\n // Required field(s) are missing or empty\n // echo error json and stop the app\n $response = array();\n $app = \\Slim\\Slim::getInstance();\n $response[\"error\"] = true;\n $response[\"message\"] = 'Required field(s) ' . substr($error_fields, 0, -2) . ' is missing or empty';\n echoRespnse(400, $response);\n $app->stop();\n }\n}", "function verifyRequiredParams($required_fields) {\n $error = false;\n $error_fields = \"\";\n $request_params = array();\n $request_params = $_REQUEST;\n // Handling PUT request params\n if ($_SERVER['REQUEST_METHOD'] == 'PUT') {\n $app = \\Slim\\Slim::getInstance();\n parse_str($app->request()->getBody(), $request_params);\n }\n foreach ($required_fields as $field) {\n if (!isset($request_params[$field]) || strlen(trim($request_params[$field])) <= 0) {\n $error = true;\n $error_fields .= $field . ', ';\n }\n }\n\n if ($error) {\n // Required field(s) are missing or empty\n // echo error json and stop the app\n $response = array();\n $app = \\Slim\\Slim::getInstance();\n $response[\"error\"] = true;\n $response[\"message\"] = 'Required field(s) ' . substr($error_fields, 0, -2) . ' is missing or empty';\n echoRespnse(400, $response);\n $app->stop();\n }\n}", "private function checkRequiredParameters(array $names, array $params)\n {\n foreach ($names as $name) {\n $this->checkRequiredParameter($name, $params);\n }\n }", "public function testHavingRequiredFields($data) {\n $this->assertTrue($this->dataValidationService->hasRequiredFields($data));\n }", "function validate_form($formtype, $formdata, $required_fields=array())\n{\n\n\t$empty_fields = array();\n\t$bool_result = TRUE;\n\t\t\t\n\tforeach($required_fields AS $required)\n\t{\n\t\tif(strpos($required, '*') !== FALSE){\n\t\t\t#This is a checkbox group\n\t\t\tif(strpos($required, 'CHECKBOXES') !== FALSE)\n\t\t\t{\n\t\t\t\t$field_str = explode('*', $required);\n\t\t\t\tif(empty($formdata[$field_str[0]])){\n\t\t\t\t\tarray_push($empty_fields, $field_str[0]);\n\t\t\t\t}\n\t\t\t}\n\t\t\t#This is a combobox\n\t\t\tif(strpos($required, 'COMBOBOX') !== FALSE)\n\t\t\t{\n\t\t\t\t$field_str = explode('*', $required);\n\t\t\t\tif(count($formdata[$field_str[0]]) == 1){\n\t\t\t\t\tif(empty($formdata[$field_str[0]][0])){\n\t\t\t\t\t\tarray_push($empty_fields, $field_str[0]);\n\t\t\t\t\t}\n\t\t\t\t}elseif(empty($formdata[$field_str[0]])){\n\t\t\t\t\tarray_push($empty_fields, $field_str[0]);\n\t\t\t\t}\n\t\t\t}\n\t\t\t#This is a required row\n\t\t\telse if(strpos($required, 'ROW') !== FALSE)\n\t\t\t{\n\t\t\t\t$row_str = explode('*', $required);\n\t\t\t\t$field_array = explode('<>', $row_str[1]);\n\t\t\t\t$decision = FALSE;\n\t\t\t\t\t\t\n\t\t\t\t$rowcounter = 0;\n\t\t\t\t#Take one row field and use that to check the rest\n\t\t\t\tforeach($formdata[$field_array[0]] AS $col_field)\n\t\t\t\t{\n\t\t\t\t\t$row_decision = TRUE;\n\t\t\t\t\tforeach($field_array AS $row_field){\n\t\t\t\t\t\tif(empty($formdata[$row_field][$rowcounter])){\n\t\t\t\t\t\t\t$row_decision = FALSE;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\tif($row_decision && !empty($col_field)){\n\t\t\t\t\t\t$decision = TRUE;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t$rowcounter++;\n\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\tif(!$decision){\n\t\t\t\t\tarray_push($empty_fields, $field_array);\n\t\t\t\t}\n\t\t\t}\n\t\t\t#This is a required radio with other options\n\t\t\telse if(strpos($required, 'RADIO') !== FALSE)\n\t\t\t{\n\t\t\t\t$row_str = explode('*', $required);\n\t\t\t\t\t\t\n\t\t\t\t#The radio is not checked\n\t\t\t\tif(empty($formdata[$row_str[0]])){\n\t\t\t\t\tarray_push($empty_fields, $row_str[0]);\n\t\t\t\t}\n\t\t\t\t#if the radio is checked, check the other required fields\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif($formdata[$row_str[0]] == 'Y'){\n\t\t\t\t\t\t$field_array = explode('<>', $row_str[1]);\n\t\t\t\t\t\t#Remove first RADIO field item which is not needed\n\t\t\t\t\t\tarray_shift($field_array);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\tforeach($field_array AS $radio_field)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(empty($formdata[$radio_field])){\n\t\t\t\t\t\t\t\tarray_push($empty_fields, $radio_field);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t#This is ensuring that the fields specified are the same\n\t\t\telse if(strpos($required, 'SAME') !== FALSE)\n\t\t\t{\n\t\t\t\t$row_str = explode('*', $required);\n\t\t\t\t$field_array = explode('<>', $row_str[1]);\n\t\t\t\t\n\t\t\t\tif($formdata[$row_str[0]] != $formdata[$field_array[1]]){\n\t\t\t\t\tarray_push($empty_fields, $row_str[0]);\n\t\t\t\t}\n\t\t\t}\n\t\t\t#This is ensuring that the email is the correct format\n\t\t\telse if(strpos($required, 'EMAILFORMAT') !== FALSE)\n\t\t\t{\n\t\t\t\t$row_str = explode('*', $required);\n\t\t\t\t\n\t\t\t\tif(!is_valid_email($formdata[$row_str[0]]))\n\t\t\t\t{\n\t\t\t\t\tarray_push($empty_fields, $row_str[0]);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t#This is ensuring that the number is the correct format\n\t\t\telse if(strpos($required, 'NUMBER') !== FALSE)\n\t\t\t{\n\t\t\t\t$row_str = explode('*', $required);\n\t\t\t\t\n\t\t\t\tif(!is_numeric($formdata[$row_str[0]]))\n\t\t\t\t{\n\t\t\t\t\tarray_push($empty_fields, $row_str[0]);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t#This is ensuring that the first field is less than the next field\n\t\t\telse if(strpos($required, 'LESSTHAN') !== FALSE)\n\t\t\t{\n\t\t\t\t$row_str = explode('*', $required);\n\t\t\t\t$field_array = explode('<>', $row_str[1]);\n\t\t\t\t\n\t\t\t\tif(!($formdata[$row_str[0]] < $formdata[$field_array[1]] || $formdata[$row_str[0]] == '' || $formdata[$field_array[1]] == '')){\n\t\t\t\t\tarray_push($empty_fields, $row_str[0]);\n\t\t\t\t}\n\t\t\t}\n\t\t\t#This field should validate code of the financial year :: \n\t\t}\n\t\t\t\t\n\t\t#Is a plain text field or other value field\n\t\telse\n\t\t{\n\t\t\tif(!(!empty($formdata[$required]) || $formdata[$required] == '0')){\n\t\t\t\tarray_push($empty_fields, $required);\n\t\t\t}\n\t\t}\n\t}\n\t\t\n\t\n\t\n\tif(empty($empty_fields)){\n\t\t$bool_result = TRUE;\n\t}else{\n\t\t$bool_result = FALSE;\n\t}\n\t\n\treturn array('bool'=>$bool_result, 'requiredfields'=>$empty_fields);\n\t\t\n}", "function verifyRequiredParams($required_fields) {\n $error = false;\n $error_fields = \"\";\n $request_params = array();\n $request_params = $_REQUEST;\n// Handling PUT request params\n if ($_SERVER['REQUEST_METHOD'] == 'PUT') {\n $app = \\Slim\\Slim::getInstance();\n parse_str($app->request()->getBody(), $request_params);\n }\n foreach ($required_fields as $field) {\n if (!isset($request_params[$field]) || strlen(trim($request_params[$field])) <= 0) {\n $error = true;\n $error_fields .= $field . ', ';\n }\n }\n\n if ($error) {\n// Required field(s) are missing or empty\n// echo error json and stop the app\n $response = array();\n $app = \\Slim\\Slim::getInstance();\n $response[\"code\"] = 10;\n $response[\"error\"] = true;\n $response[\"message\"] = 'Required field(s) ' . substr($error_fields, 0, -2) . ' is missing or empty';\n echoRespnse(400, $response);\n $app->stop();\n }\n}", "function form_check() {\n\tglobal $cert_amt_tbl;\n\t\n\t// required fields array\n\t$required_fields = array('Discount Amount'=> $cert_amt_tbl->discount_amount);\n\t\t\n\t// check error values and write error array\t\t\t\t\t\n\tforeach($required_fields as $field_name => $output) {\n\t if (empty($output)) {\n\t\t$errors_array[] = $field_name;\n\t }\n\t}\n\t\n\tif (!empty($errors_array)) {\n\t $error_message = 'You did not supply a value for these fields: ' . implode(', ',$errors_array);\n\t}\n\t\n return $error_message;\n }", "public function requireFields(array $fields)\n\t{\n\t\t$missingFields = [];\n\n\t\tforeach ($fields as $field)\n\t\t{\n\t\t\tif (!isset($this->sanitizer->output[$field]) || $this->sanitizer->output[$field] === null)\n\t\t\t{\n\t\t\t\t$missingFields[] = $field;\n\t\t\t}\n\t\t}\n\n\t\tif ($missingFields !== [])\n\t\t{\n\t\t\tthrow new MissingParameterException($missingFields);\n\t\t}\n\t}", "function mandatoryArray($requestArray,$mandatoryKeys,$nonMandatoryValueKeys)\n{\n\t\n\tif(isset($requestArray['sort']) || isset($requestArray['search']))\n\t{\n\t\tunset($requestArray['sort']);\n\t\tunset($requestArray['search']);\n\t}\n\t\n\t\n $requestArray=array_map('trim',$requestArray);\n\n\t $error= array();\t\n\n\t \n\n\t foreach ($mandatoryKeys as $key => $val){\t\t \n\n\t\t if(!array_key_exists($key,$requestArray)) {\n\n\t\t\t $error[\"msg\"] = \"Request must contain \".$key;\n\n\t\t\t $error[\"statusCode\"] = 406; \t\n\n\t\t\t break;\t\t \n\n\t\t }\t \n\t\t \n\t\t if( (empty($requestArray[$key])) && (!in_array($key,$nonMandatoryValueKeys)) && ($requestArray[$key]!='0') )\n\t\t {\n\t\t \t\n\t\t\t \t\t$error[\"msg\"] = $val.\" should not be empty\";\t\t\t \t\t \n\t\t\t \t\t$error[\"statusCode\"] = 422;\n\t\t\t\t break; \n\n\t\t } \n\t\t \n\t \n\n\t }\n\n\t \n\n\t return $error;\n\n }", "public function check_validity() {\r\n\t\t$value = $this->get_posted_value();\r\n\r\n\t\t// required field check\r\n\t\t// 0, '0', and 0.0 need special handling since they're valid, but PHP considers them falsy values.\r\n\t\tif ( $this->props['required'] && ( empty( $value ) && ! in_array( $value, [ 0, '0', 0.0 ], true ) ) ) {\r\n\t\t\t// translators: Placeholder %s is the label for the required field.\r\n\t\t\tthrow new \\Exception( sprintf( _x( '%s is a required field.', 'Add listing form', 'my-listing' ), $this->props['label'] ) );\r\n\t\t}\r\n\r\n\t\t// if field isn't required, then no validation is needed for empty values\r\n\t\tif ( empty( $value ) ) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// otherwise, run validations\r\n\t\t$this->validate();\r\n\t}", "public function isRequired($field_array) {\n\t\tforeach($field_array as $field) {\n\t\t\tif ($_POST[''.$field.''] == '') {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "function required_if($str, $parms)\n\t{\t\t\n\t\tlist($campo, $valor,$label,$desc)=explode(',',$parms,4);\t\t\n\t\tif($_POST[$campo]==$valor && $str=='')\n\t\t{\n\t\t\t$campo=str_replace(array('_id','_'),array('',' '),$campo);\n\t\t\t$this->CI->form_validation->set_message('required_if', \"El campo %s debe contener un dato si {$label} es '{$desc}'.\");\n\t\t\treturn FALSE;\n\t\t}\n\t\treturn TRUE;\n\t}" ]
[ "0.71862394", "0.6990089", "0.6868447", "0.68517977", "0.6843158", "0.6805379", "0.6734402", "0.6732079", "0.670135", "0.66926414", "0.66483855", "0.65949297", "0.6552953", "0.65396273", "0.6534771", "0.6500435", "0.6457113", "0.6436637", "0.64264506", "0.64071584", "0.64032924", "0.63933146", "0.63844275", "0.63656384", "0.63566995", "0.63226366", "0.62834436", "0.62579226", "0.6249488", "0.6236658", "0.6236529", "0.62165225", "0.6215489", "0.6215106", "0.6210977", "0.6210057", "0.61865354", "0.6181238", "0.61683464", "0.6147814", "0.61280584", "0.6125887", "0.611107", "0.6104898", "0.6094349", "0.6085978", "0.60803956", "0.6070513", "0.60688466", "0.6067676", "0.60562027", "0.60557824", "0.604792", "0.60360277", "0.6035195", "0.6027725", "0.6018384", "0.6003657", "0.6001539", "0.5977308", "0.59674054", "0.5967204", "0.5961968", "0.5958125", "0.5956899", "0.5956384", "0.5952321", "0.59504133", "0.595029", "0.59433633", "0.5942835", "0.5939232", "0.59304893", "0.59112525", "0.5907846", "0.590686", "0.590686", "0.590686", "0.590686", "0.590686", "0.590686", "0.590686", "0.590686", "0.58961153", "0.58889663", "0.5888478", "0.5878684", "0.5873526", "0.5866598", "0.5866598", "0.58626205", "0.58583295", "0.5855649", "0.5854303", "0.58510923", "0.58508915", "0.58507454", "0.5847879", "0.5846852", "0.5843716" ]
0.7254165
0
Return a formatted list of the given environment variables.
function GetEnvVars($list,$s_line_feed) { global $VALID_ENV,$sServerVars; $output = ""; for ($ii = 0 ; $ii < count($list) ; $ii++) { $name = $list[$ii]; if ($name && array_search($name,$VALID_ENV,true) !== false) { // // if the environment variable is empty or non-existent, try // looking for the value in the server vars. // if (($s_value = getenv($name)) === "" || $s_value === false) if (isset($sServerVars[$name])) $s_value = $sServerVars[$name]; else $s_value = ""; $output .= $name."=".$s_value.$s_line_feed; } } return ($output); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getEnvs();", "private function getEnvironmentVariables()\n {\n return array(\n 'GIT_TERMINAL_PROMPT' => '0',\n 'GIT_ASKPASS' => 'echo',\n );\n }", "protected function get_env_parameters()\n\t{\n\t\t$parameters = array();\n\t\tforeach ($_SERVER as $key => $value)\n\t\t{\n\t\t\tif (0 === strpos($key, 'PHPBB__'))\n\t\t\t{\n\t\t\t\t$parameters[strtolower(str_replace('__', '.', substr($key, 9)))] = $value;\n\t\t\t}\n\t\t}\n\n\t\treturn $parameters;\n\t}", "private static function parseEnvProperties(): array\r\n {\r\n $envProperties = array();\r\n $vars = file(Config::$baseDir . '/../.env', FILE_IGNORE_NEW_LINES);\r\n foreach ($vars as $var) {\r\n if (substr($var, 0, 2) === '##') continue;\r\n $envProperties[explode('=', $var)[0]] = explode('=', $var)[1];\r\n }\r\n return $envProperties;\r\n }", "protected function getEnvParameters()\n {\n $parameters = array();\n\n foreach ($_SERVER as $key => $value) {\n if (0 === strpos($key, 'SYMFONY__')) {\n $parameters[strtolower(str_replace('__', '.', substr($key, 9)))] = $value === '~'?null:$value;\n }\n }\n\n return $parameters;\n }", "public function toEnv(): string\n {\n $salts = $this->getSalts();\n return array_reduce(\n array_keys($salts), function ($saltsString, $key) use ($salts) {\n $saltsString .= \"{$key}='{$salts[$key]}'\" . PHP_EOL;\n return $saltsString;\n }, ''\n );\n }", "public function getEnvironments();", "public function getEnvVars(): array {\n return $this->configVars['env-vars'];\n }", "protected function getEnvironmentVariablesThatICareAbout()\n {\n return array(\n 'shell',\n 'tmpdir',\n 'user',\n 'pwd',\n 'lang',\n 'editor',\n 'home',\n );\n }", "protected function getEnvironmentVariables()\n {\n $env = array();\n\n foreach ($_SERVER as $name => $val) {\n if (is_array($val) || !in_array(strtolower($name), $this->getEnvironmentVariablesThatICareAbout())) {\n // In the future, this could be supported\n continue;\n }\n\n $env['env.'.$name] = $val;\n }\n\n return $env;\n }", "public function getAllEnvironmentVariables()\n {\n return include $_SERVER['DOCUMENT_ROOT'] . '/env.php';\n }", "public function getEnvVars(): array\n {\n return $this->envVars;\n }", "public function envVariablesDataProvider(): array\n {\n return [\n 'only one existing expression' => [\n '{{null}}',\n ['{{null}}' => '']\n ],\n 'one existing expression with additional chars' => [\n 'prefix{{null}}suffix',\n ['{{null}}' => '']\n ],\n 'one expression existing two times with additional chars' => [\n 'prefix{{null}}suffix{{null}}suffix2',\n ['{{null}}' => '']\n ]\n ];\n }", "public function getEnvironmentVariablesAsArray()\n {\n // Iterate over the environmentVariable nodes and sort them into an array\n $environmentVariables = array();\n foreach ($this->getEnvironmentVariables() as $environmentVariableNode) {\n\n // Restructure to an array\n $environmentVariables[] = array(\n 'condition' => $environmentVariableNode->getCondition(),\n 'definition' => $environmentVariableNode->getDefinition()\n );\n }\n\n // Return what we got\n return $environmentVariables;\n }", "public function envNames(): array\n {\n return $this->env->names();\n }", "public function getEnvironmentVariables()\n {\n return $this->environment_variables;\n }", "public function getEnvironmentVariables()\n {\n return $this->_envVars;\n }", "public function getAllEnvironmentPaths(): array\n {\n $paths = $this->getAllPaths();\n $envvars = [];\n\n foreach ($paths as $key => $path) {\n $envvar_key = str_replace(['_', 'x86'], ['', '(x86)'], $key);\n $envvars[$envvar_key] = $path;\n }\n\n $envvars = array_change_key_case($envvars, CASE_UPPER);\n\n return $envvars;\n }", "public function getEnvironmentVariables()\n {\n return $this->environmentVariables;\n }", "public function getEnvironmentVariables()\n {\n return $this->_environmentVariables;\n }", "protected function getEnvironments()\n {\n return array('dev', 'test', 'preprod');\n }", "public static function GetAllNames () {\n\t\treturn [\n\t\t\t\\MvcCore\\IEnvironment::DEVELOPMENT,\n\t\t\t\\MvcCore\\IEnvironment::ALPHA,\n\t\t\t\\MvcCore\\IEnvironment::BETA,\n\t\t\t\\MvcCore\\IEnvironment::PRODUCTION\n\t\t];\n\t}", "public function displayEnvironmentDetails(array $vars);", "function getEnvVariables($line,$envVar)\n{\n $returnVal='';\n //remove all blanks from the string.\n $line=str_replace(' ','',$line);\n $tempArray=explode($envVar,$line);\n //index 1 of array should have value - if it is set. \n if (isset($tempArray[1])) {\n $returnVal=$tempArray[1]; \n }\n \n return $returnVal;\n}", "public function siteEnvLookupParameters()\n {\n return [\n\n // Site not specified on commandline\n // Command takes site_env and variable arguments\n // TERMINUS_SITE and TERMINUS_ENV set in configuration\n [\n ['command: example:op', 'site_env: site-from-config.dev', 'list: [a, b]'],\n ['program', 'example:op', 'a', 'b'],\n $this->siteEnvVarArgsDef(),\n $this->terminusSiteWithTerminusEnv(),\n ],\n\n // Like the previous test, but a different site is specified on the commandline\n [\n ['command: example:op', 'site_env: othersite.test', 'list: [a, b]'],\n ['program', 'example:op', 'othersite.test', 'a', 'b'],\n $this->siteEnvVarArgsDef(),\n $this->terminusSiteWithTerminusEnv(),\n ],\n\n // Site not specified on commandline, and nothing provided in configuration\n [\n ['command: example:op', 'site_env: a', 'list: [b]'],\n ['program', 'example:op', 'a', 'b'],\n $this->siteEnvVarArgsDef(),\n [],\n ],\n\n // Site not speicifed on commandline\n // Command takes site_env and one other required argument\n // TERMINUS_SITE and TERMINUS_ENV set in configuration\n [\n ['command: example:op', 'site_env: site-from-config.dev', 'item: a'],\n ['program', 'example:op', 'a'],\n $this->siteEnvRequiredArgsDef(),\n $this->terminusSiteWithTerminusEnv(),\n ],\n\n // Like the previous test, but a different site is specified on the commandline\n [\n ['command: example:op', 'site_env: othersite.test', 'item: a'],\n ['program', 'example:op', 'othersite.test', 'a'],\n $this->siteEnvRequiredArgsDef(),\n $this->terminusSiteWithTerminusEnv(),\n ],\n\n // Site not specified on commandline, and nothing provided in configuration\n [\n ['command: example:op', 'site_env: a', 'item: EMPTY'],\n ['program', 'example:op', 'a'],\n $this->siteEnvRequiredArgsDef(),\n [],\n ],\n\n // Site not speicifed on commandline\n // Command takes site and one other required argument\n // TERMINUS_SITE and TERMINUS_ENV set in configuration\n [\n ['command: example:op', 'site: site-from-config', 'item: a'],\n ['program', 'example:op', 'a'],\n $this->siteRequiredArgsDef(),\n $this->terminusSiteWithTerminusEnv(),\n ],\n\n // Like the previous test, but a different site is specified on the commandline\n [\n ['command: example:op', 'site: othersite', 'item: a'],\n ['program', 'example:op', 'othersite', 'a'],\n $this->siteRequiredArgsDef(),\n $this->terminusSiteWithTerminusEnv(),\n ],\n\n // Site not specified on commandline, and nothing provided in configuration\n [\n ['command: example:op', 'site: EMPTY', 'item: a'],\n ['program', 'example:op', 'a'],\n $this->siteRequiredArgsDef(),\n [],\n ],\n\n ];\n }", "public function formatBuildArguments()\n {\n return array_merge(\n ['__VAPOR_RUNTIME='.Manifest::runtime($this->environment)],\n array_filter($this->cliBuildArgs, function ($value) {\n return ! Str::startsWith($value, '__VAPOR_RUNTIME');\n })\n );\n }", "public function getVariablesList() {\n return $this->_get(2);\n }", "public function getVariablesList() {\n return $this->_get(4);\n }", "public function getEnv(): array\n {\n return $this->env;\n }", "function getEnvironmentVariables()\n{\n\tglobal $config_array;\n\n\tif ($customnr = getenv('CUSTOMERNR')) {\n\t\t$config_array['CUSTOMERNR'] = $customnr;\n\t}\n\n\tif ($apikey = getenv('APIKEY')) {\n\t\t$config_array['APIKEY'] = $apikey;\n\t}\n\n\tif ($apipassword = getenv('APIPASSWORD')) {\n\t\t$config_array['APIPASSWORD'] = $apipassword;\n\t}\n\n\tif ($domain = getenv('DOMAIN')) {\n\t\t$config_array['DOMAIN'] = $domain;\n\t}\n\n\tif ($hostipv4 = getenv('HOST_IPv4')) {\n\t\t$config_array['HOST_IPv4'] = $hostipv4;\n\t}\n\n\tif ($hostipv6 = getenv('HOST_IPv6')) {\n\t\t$config_array['HOST_IPv6'] = $hostipv6;\n\t}\n\n\tif ($useipv4 = getenv('USE_IPV4')) {\n\t\t$config_array['USE_IPV4'] = $useipv4;\n\t}\n\n\tif ($usefb = getenv('USE_FRITZBOX')) {\n\t\t$config_array['USE_FRITZBOX'] = $usefb;\n\t}\n\n\tif ($fbip = getenv('FRITZBOX_IP')) {\n\t\t$config_array['FRITZBOX_IP'] = $fbip;\n\t}\n\n\tif ($useipv6 = getenv('USE_IPV6')) {\n\t\t$config_array['USE_IPV6'] = $useipv6;\n\t}\n\n\tif ($ipv6interface = getenv('IPV6_INTERFACE')) {\n\t\t$config_array['IPV6_INTERFACE'] = $ipv6interface;\n\t}\n\n\tif ($ipv6priv = getenv('NO_IPV6_PRIVACY_EXTENSIONS')) {\n\t\t$config_array['NO_IPV6_PRIVACY_EXTENSIONS'] = $ipv6priv;\n\t}\n\n\tif ($changettl = getenv('CHANGE_TTL')) {\n\t\t$config_array['CHANGE_TTL'] = $changettl;\n\t}\n\n\tif ($apiurl = getenv('APIURL')) {\n\t\t$config_array['APIURL'] = $apiurl;\n\t}\n\n\tif ($sendmail = getenv('SEND_MAIL')) {\n\t\t$config_array['SEND_MAIL'] = $sendmail;\n\t}\n\n\tif ($mailrec = getenv('MAIL_RECIPIENT')) {\n\t\t$config_array['MAIL_RECIPIENT'] = $mailrec;\n\t}\n\n\tif ($sleepinsec = getenv('SLEEP_INTERVAL_SEC')) {\n\t\t$config_array['SLEEP_INTERVAL_SEC'] = $sleepinsec;\n\t}\n}", "public function getAllowedEnvironments()\n {\n return [self::ENV_LIVE, self::ENV_DEV, self::ENV_STAGE, self::ENV_TEST];\n }", "public static function getEnvironment() : array\n {\n return self::$env;\n }", "public function GetVariables()\n {\n $variables = '';\n if(count($this->variables)) {\n $vlist = array();\n foreach($this->variables as $name => $value) {\n $var = $name;\n if(is_array($value)) {\n if(isset($value[0]) && isset($value[count($value)-1])) {\n $var .= '=[' . implode(',', $value) . ']';\n } else {\n $vs = array();\n foreach($value as $k => $v)\n if($k)\n $vs[] = \"$k:$v\";\n\n $var .= '={' . implode(',', $vs) . '}';\n }\n } elseif(!is_null($value)) {\n $var .= \"=$value\";\n }\n $vlist[] = $var;\n }\n $variables = \"var \" . implode(', ', $vlist) . \";\";\n }\n // comments can be stuck with the variables\n if(count($this->comments)) {\n foreach($this->comments as $c) {\n if(!is_string($c))\n $c = print_r($c, TRUE);\n $variables .= \"\\n// \" . str_replace(\"\\n\", \"\\n// \", $c);\n }\n }\n return $variables;\n }", "public function getEnvironmentTags() {\n\t\treturn array_merge($this->environments[0]);\n\t}", "public function get_params(string $env): array {\n $generic_params = $this->_parse_content($this->_generic_content);\n $env_params = $this->_parse_content($this->_fetch_env_content($env));\n\n return f\\concat($generic_params, $env_params);\n }", "public static function getCredentialsValuesString() : string\n {\n return implode(',', array_values(self::CREDENTIALS));\n }", "function listItems($var)\n{\n\n $string = '';\n\n foreach ($var as $key => $value) {\n $key++;\n $string .= \"[$key]\" . $value . PHP_EOL;\n }\n\n return $string; \n}", "protected function getValueFromEnvironment(array &$collection) : array\n {\n foreach ($collection as &$value) {\n //check for substitution\n if ((is_string($value)) && ((strpos($value, '{{@') === 0) && (strpos($value, '}}') !== false))) {\n if (($toReplace = Manipulation::getBetween($value, '{{@', '}}')) != '') {\n $value = getenv($toReplace);\n if ($value !== false) {\n continue;\n } elseif (defined($toReplace)) {\n $value = constant($toReplace);\n }\n }\n } elseif (is_array($value)) {\n $value = $this->getValueFromEnvironment($value);\n }\n }\n\n return $collection;\n }", "private static function getEnvironmentForVariables($var=array(),$environment=null)\r\n {\r\n //environment variable specified by the variable is checked in the defined file\r\n //and the value is returned accordingly.\r\n return $environment[$var[0]] ?? $var[1];\r\n }", "protected function readEnv(): array {\n if ( !is_readable( $this->path ) ) {\n throw new Exception( 'Environment file not found or not readable' );\n }\n\n $body = file_get_contents( $this->path );\n\n // Convert line breaks.\n $body = str_replace( [ \"\\r\\n\", \"\\r\", \"\\n\" ], \"\\n\", $body );\n\n $lines = explode( \"\\n\", $body );\n $variables = [];\n foreach ( $lines as $line ) {\n if ( trim( $line ) === '' ) {\n continue;\n }\n\n [ $key, $value ] = explode( '=', $line, 2 );\n $variables[trim( $key )] = trim( $value );\n }\n\n return $variables;\n }", "public function listEnvironments()\n {\n\t\t$data = $this->call(array(), \"GET\", \"environments.json\");\n\t\treturn $data;\n\t\t\n\t\t$data = $this->call(array(), \"GET\", \"environments.json\");\n\t\t$data = $data->{'environments'};\n\t\t$environmentArray = new ArrayObject();\n\t\tfor($i = 0; $i<count($data);$i++){\n\t\t\t$environmentArray->append(new Environment($data[$i], $this));\n\t\t}\n\t\treturn $environmentArray;\n }", "function get_environment_details() : array {\n\t$id = Altis\\get_environment_name();\n\t$type = Altis\\get_environment_type();\n\tif ( $type === 'local' ) {\n\t\t// Create distinct_id (important for Mixpanel).\n\t\t$id = get_local_install_id();\n\t}\n\n\t$traits = [\n\t\t'site_name' => get_site_option( 'site_name', get_option( 'blogname', '' ) ),\n\t\t'environment' => $type,\n\t\t'domain' => get_site_url(),\n\t\t'multisite' => is_multisite(),\n\t\t'feature_tier' => Altis\\get_feature_tier(),\n\t\t'environment_tier' => Altis\\get_environment_tier(),\n\t\t'support_tier' => Altis\\get_support_tier(),\n\t\t'version' => Altis\\get_version(),\n\t];\n\n\t/**\n\t * Filter environment traits delivered to segment.io.\n\t *\n\t * @param array $traits Environment traits to send to Segment.io.\n\t */\n\t$traits = (array) apply_filters( 'altis.telemetry.env_traits', $traits );\n\n\treturn [\n\t\t'id' => $id,\n\t\t'traits' => $traits,\n\t];\n}", "public function getEnvironments(): array\n {\n return $this->environments;\n }", "public function environmentVariables($projectId, $environment)\n {\n return $this->request('get', 'api/projects/'.$projectId.'/environments/'.$environment.'/variables')['variables'];\n }", "public function getLabel(): string\n {\n return 'ENV variables';\n }", "private function all(): array\n {\n if (!file_exists($this->envPath)) {\n if (file_exists($this->envExamplePath)) {\n copy($this->envExamplePath, $this->envPath);\n } else {\n touch($this->envPath);\n }\n }\n return file($this->envPath);\n }", "public static function variables(): array\n {\n return [\n Variable::make('sorts', __('Array of available sorting')),\n\n Variable::make('directions', __('Array of sort directions')),\n\n Variable::make('items', __('HTML generated of blog items')),\n\n Variable::make('pagination', __('HTML generated of pagination links')),\n ];\n }", "public function getAllValues() {\n\t\t$keys = array_keys($this->defaults);\n\t\t$values = array_map(array($this, 'getAppValue'), $keys);\n\t\t$preparedKeys = array_map(array($this, 'camelCase'), $keys);\n\t\treturn array_combine($preparedKeys, $values);\n\t}", "public static function getCredentialsKeysString() : string\n {\n return implode(',', array_keys(self::CREDENTIALS));\n }", "private function assembleEnvironment($configuration)\n {\n $values = [];\n\n // Files:\n $files = array_get($configuration, 'environment-file', ['.env']);\n foreach ((array) $files as $file) {\n if (is_readable($file)) {\n $values = array_merge($values, (new \\Symfony\\Component\\Dotenv\\Dotenv())->parse(file_get_contents($file), $file));\n }\n }\n\n // Docker containers:\n $environment = array_get($configuration, 'environment', []);\n foreach ($environment as $name) {\n $values = array_merge($values,\n di('compose-config')->get('services.' . $name . '.environment', [])\n );\n }\n return $values;\n }", "private function parseEnv($data)\n {\n return collect($data)->map(function ($value) {\n return Parse::env($value);\n })->all();\n }", "private function contextToString($context) {\n $export = '';\n foreach ($context as $key => $value) {\n $export .= \"{$key}: \";\n $export .= preg_replace(array(\n '/=>\\s+([a-zA-Z])/im',\n '/array\\(\\s+\\)/im',\n '/^ |\\G /m',\n ), array(\n '=> $1',\n 'array()',\n ' ',\n ), str_replace('array (', 'array(', var_export($value, true)));\n $export .= PHP_EOL;\n }\n return str_replace(array('\\\\\\\\', '\\\\\\''), array('\\\\', '\\''), rtrim($export));\n }", "public function acl_custom_get_allowed_environments_list($group, $return_assoc_array = false) {\n\t\tdie('NOW DEPRECATED. Use Configure::read(\\'deployable_envs\\')');\n\t\t//\n\t\t//\n\t\t//$std_available_environments = array(\n\t\t//\t'' => 'Select Environment' ,\n\t\t//\t'development1' => 'Development 1',\n\t\t//\t'development2' => 'Development 2',\n\t\t//\t'qa1_eu' => 'QA 1 - EU',\n\t\t//\t'qa1_na' => 'QA 1 - NA',\n\t\t//\t'qa2_eu' => 'QA 2 / Security - EU',\n\t\t//\t'qa2_na' => 'QA 2 / Security - NA',\n\t\t//\t'qa3_eu' => 'QA 3 - EU',\n\t\t//\t'qa3_na' => 'QA 3 - NA',\n\t\t//);\n\t\t//\n\t\t//$production_environments = array(\n\t\t//\t'production_eu' => 'EU Production',\n\t\t//\t'production_na' => 'NA Production',\n\t\t//);\n\t\t//\n\t\t//$development_environments = array(\n\t\t//\t'development1' => 'Development 1',\n\t\t//\t'development2' => 'Development 2'\n\t\t//);\n\t\t//\t\n\t\t//$oregontrail_environments = array(\n\t\t//\t'capistrano' => 'RTW Oregon Trail Master',\n\t\t//\t'production_eu_linux_mgr' => 'Prod EU Linux Manager',\n\t\t//\t'production_na_linux_mgr' => 'Prod NA Linux Manager',\n\t\t//);\n\t\t//\n\t\t//\n\t\t//// Available Sites and Environments, determined by ACL\n\t\t//switch ($group) {\n\t\t//\tcase 'operations':\n\t\t//\tcase 'producers':\n\t\t//\t\t$available_environments = $std_available_environments;\n\t\t//\t\t$available_environments = array_merge($available_environments, $production_environments); // Add production to list\n\t\t//\t\tbreak;\n\t\t//\tcase 'developers': // Only Dev Environments\n\t\t//\t\t$available_environments = $development_environments;\n\t\t//\t\tbreak;\n\t\t//\tcase 'administrators':\n\t\t//\t\t$available_environments = $std_available_environments;\n\t\t//\t\t$available_environments = array_merge($available_environments, $production_environments); // Add production to list\n\t\t//\t\t$available_environments = array_merge($available_environments, $oregontrail_environments); // Add oregon trail to list\n\t\t//\t\tbreak;\n\t\t//\tdefault: // They should have been redirected out of here, so this should not happen\n\t\t//\t\treturn false;\n\t\t//\t\tbreak;\n\t\t//}\n\t\t//\n\t\t//if ($return_assoc_array) {\n\t\t//\treturn $available_environments;\n\t\t//} else {\n\t\t//\treturn array_keys($available_environments);\t// Discard the Human Readable \"descriptions\"\n\t\t//}\n\t}", "public function getVariableHarmonizationsList() {\n return $this->_get(4);\n }", "private function contextToString($context)\n {\n $export = '';\n foreach ($context as $key => $value) {\n $export .= \"{$key}: \";\n $export .= preg_replace(array(\n '/=>\\s+([a-zA-Z])/im',\n '/array\\(\\s+\\)/im',\n '/^ |\\G /m'\n ), array(\n '=> $1',\n 'array()',\n ' '\n ), str_replace('array (', '(', var_export($value, true)));\n $export .= PHP_EOL;\n }\n return str_replace(array('\\\\\\\\', '\\\\\\''), array('\\\\', '\\''), rtrim($export));\n }", "public function getEnvContent()\n {\n if (!file_exists($this->envPath)) {\n if (file_exists($this->envExamplePath)) {\n copy($this->envExamplePath, $this->envPath);\n } else {\n touch($this->envPath);\n }\n }\n\n return file_get_contents($this->envPath);\n }", "public function getEnvContent()\n {\n if (! file_exists($this->envPath)) {\n if (file_exists($this->envExamplePath)) {\n copy($this->envExamplePath, $this->envPath);\n } else {\n touch($this->envPath);\n }\n }\n return file_get_contents($this->envPath);\n }", "protected function getLanguagePreferences() {\n $languages = $this->source_config['language']['list'];\n return explode(',', $languages);\n }", "public function getEnv():string\n {\n return $this->env;\n }", "public function environment(...$environments)\n {\n if (count($environments) > 0) {\n $patterns = is_array($environments[0]) ? $environments[0] : $environments;\n\n return Str::is($patterns, $this->env);\n }\n\n return $this->env;\n }", "function Environment_list($query) {\n\t// Create array\n\tforeach($query as $key => $val) {\n\t\tswitch($key) {\n\t\t\tcase \"environment_id\":\n\t\t\tcase \"isactive\":\n\t\t\tcase \"product_id\":\n\t\t\t\t$type = \"int\";\n\t\t\t\tbreak;\n\t\t\tcase \"name\":\n\t\t\tdefault:\n\t\t\t\t$type = \"string\";\n\t\t}\n\t\t$qarray[$key] = new xmlrpcval($val, $type);\n\t}\n\n\t// Create call\n\t$call = new xmlrpcmsg('Environment.list', array(new xmlrpcval($qarray, \"struct\")));\n\n\t// Do call and return value\n\treturn do_call($call);\n}", "public static function getEnvironments()\n {\n $instanceSpecificKeys = [\n 'app_frontend_url',\n 'app_backend_url'\n ];\n\n $globalKeys = [\n 'app_config_path',\n 'server_config_path',\n 'isolation_config_path',\n 'handlers_config_path',\n 'configuration:Magento/Mtf/TestSuite/MtfTests',\n 'app_instances',\n 'events_preset',\n 'log_directory'\n ];\n\n $globalEnvironmentVariables = [];\n foreach ($globalKeys as $key) {\n if (isset($_ENV[$key])) {\n $globalEnvironmentVariables[$key] = $_ENV[$key];\n }\n }\n\n $environments = [];\n if (isset($_ENV['app_instances'])) {\n $instancesCount = $_ENV['app_instances'];\n\n for ($x = 0; $x < $instancesCount; $x++) {\n $environmentVariables = [];\n\n foreach ($instanceSpecificKeys as $key) {\n $instanceKey = $key . \"_\" . $x;\n if (isset($_ENV[$instanceKey])) {\n $environmentVariables[$key] = $_ENV[$instanceKey];\n }\n }\n\n $mergedEnvironmentVariables = array_merge(\n $globalEnvironmentVariables,\n $environmentVariables\n );\n $environments[] = new Environment($mergedEnvironmentVariables);\n }\n } else {\n $environmentVariables = [];\n\n foreach ($instanceSpecificKeys as $key) {\n if (isset($_ENV[$key])) {\n $environmentVariables[$key] = $_ENV[$key];\n }\n }\n\n $mergedEnvironmentVariables = array_merge(\n $globalEnvironmentVariables,\n $environmentVariables\n );\n $environments[] = new Environment($mergedEnvironmentVariables);\n }\n\n return $environments;\n }", "public function serverVariables()\n {\n return array_merge(Fpm::resolve()->serverVariables(), array_filter([\n 'AWS_REQUEST_ID' => $_ENV['AWS_REQUEST_ID'] ?? null,\n ]));\n }", "public function listCommand()\n {\n $this->console->writeLn('list: ' . implode(' ', $this->_getEnvTypes()));\n }", "private function getEnvironmentConfigs(Exercise $exercise)\n {\n $configs = [];\n foreach ($exercise->getExerciseEnvironmentConfigs() as $runtimeConfig) {\n $configs[] = [\n \"runtimeEnvironmentId\" => $runtimeConfig->getRuntimeEnvironment()->getId(),\n \"variablesTable\" => $runtimeConfig->getParsedVariablesTable(),\n ];\n }\n return $configs;\n }", "public function caching_environment()\n {\n $info = array();\n $info['cache_on'] = 'array(array_key_exists(\\'username\\',$map)?$map[\\'username\\']:\\'\\', array_key_exists(\\'display\\',$map)?$map[\\'display\\']:\\'\\', array_key_exists(\\'period\\',$map)?$map[\\'period\\']:\\'\\', array_key_exists(\\'title\\',$map)?$map[\\'title\\']:\\'\\', array_key_exists(\\'width\\',$map)?$map[\\'width\\']:\\'100%\\', array_key_exists(\\'height\\',$map)?$map[\\'height\\']:\\'100%\\')';\n $info['ttl'] = 15;\n return $info;\n }", "protected function declareConfig(){\n\n $output = '';\n \n foreach( $this->getConfig() as $key => $value ){\n \n $output .= $key . '=' . json_encode( $value ) . ';';\n \n }\n \n return $output;\n\n }", "private static function _getConfigArray()\n\t{\n\t\treturn explode('.', self::_getConfig());\n\t}", "public function provideVariables()\n {\n return [\n 'first test' => [\n 'variables' => [\n 'var1' => 'val1',\n 'var2' => 'val2',\n 'var3' => 'val3',\n ],\n ]\n ];\n }", "private function limpiarParametrosConEspacios($values){\n $resultado = array();\n foreach ($values as $key => $value) {\n $porciones = explode(\" \", $value);\n \n $cadena = '';\n foreach ($porciones as $val) {\n $cadena .= ($cadena=='' || empty($val))?'':' ';\n $cadena .= (!empty($val))?$val:'';\n }\n $resultado[$key] = $cadena;\n }\n \n return $resultado;\n }", "public function getVariables()\n {\n \treturn isset($this->all['variables']) ? $this->all['variables'] : array();\n }", "public function listInvalidProperties()\n {\n $invalidProperties = [];\n\n if ($this->container['app_name'] === null) {\n $invalidProperties[] = \"'app_name' can't be null\";\n }\n if ($this->container['app_display_name'] === null) {\n $invalidProperties[] = \"'app_display_name' can't be null\";\n }\n if ($this->container['release_id'] === null) {\n $invalidProperties[] = \"'release_id' can't be null\";\n }\n if ($this->container['platform'] === null) {\n $invalidProperties[] = \"'platform' can't be null\";\n }\n if ($this->container['uploaded_at'] === null) {\n $invalidProperties[] = \"'uploaded_at' can't be null\";\n }\n if ($this->container['version'] === null) {\n $invalidProperties[] = \"'version' can't be null\";\n }\n if ($this->container['short_version'] === null) {\n $invalidProperties[] = \"'short_version' can't be null\";\n }\n if ($this->container['size'] === null) {\n $invalidProperties[] = \"'size' can't be null\";\n }\n if ($this->container['bundle_identifier'] === null) {\n $invalidProperties[] = \"'bundle_identifier' can't be null\";\n }\n if ($this->container['install_link'] === null) {\n $invalidProperties[] = \"'install_link' can't be null\";\n }\n return $invalidProperties;\n }", "function envKeySplit($array)\n{\n\t$lists = explode(';', $array);\n\tforeach ($lists as $list) {\n\t\tlist($k, $v) = explode(':', $list);\n\t\t$final[$k] = $v;\n\t}\n\n\treturn $final;\n}", "protected function allowableEnvironments(): array\n {\n if (!empty(config('core-middleware.allowable-environments'))) {\n return config('core-middleware.allowable-environments');\n }\n\n return ['local'];\n }", "function list_items($list) \n{\n $x = '';\n foreach($list as $key => $item) {\n $key++;\n $x .= \"[{$key}] {$item}\\n\";\n }\n return $x;\n // Return string of list items separated by newlines.\n // Should be listed [KEY] Value like this:\n // [1] TODO item 1\n // [2] TODO item 2 - blah\n // DO NOT USE ECHO, USE RETURN\n}", "public function listInvalidProperties()\n {\n $invalidProperties = [];\n\n if ($this->container['third_party_app_id'] === null) {\n $invalidProperties[] = \"'third_party_app_id' can't be null\";\n }\n if ($this->container['install_url'] === null) {\n $invalidProperties[] = \"'install_url' can't be null\";\n }\n if ($this->container['name'] === null) {\n $invalidProperties[] = \"'name' can't be null\";\n }\n if ($this->container['os'] === null) {\n $invalidProperties[] = \"'os' can't be null\";\n }\n $allowedValues = $this->getOsAllowableValues();\n if (!is_null($this->container['os']) && !in_array($this->container['os'], $allowedValues, true)) {\n $invalidProperties[] = sprintf(\n \"invalid value '%s' for 'os', must be one of '%s'\",\n $this->container['os'],\n implode(\"', '\", $allowedValues)\n );\n }\n\n return $invalidProperties;\n }", "public function inflectPackageVars($vars): array\n {\n return $vars;\n }", "public static function getSettings(string $environment = self::ENV_DEVELOPMENT): array\n {\n return [\n 'settings' => array_replace_recursive(self::$settings['development'], self::$settings[$environment]),\n ];\n }", "public function getAll(): array\n {\n return $this->variables;\n }", "function my_getenv($key)\n {\n\t $return = array();\n\t \n\t if ( is_array( $_SERVER ) AND count( $_SERVER ) )\n\t {\n\t\t if( isset( $_SERVER[$key] ) )\n\t\t {\n\t\t\t $return = $_SERVER[$key];\n\t\t }\n\t }\n\t \n\t if ( ! $return )\n\t {\n\t\t $return = getenv($key);\n\t }\n\t \n\t return $return;\n }", "protected function paratestEnvironmentVariables()\n {\n if ($this->option('custom-argument')) {\n return array_merge(\n parent::paratestEnvironmentVariables(),\n [\n 'CUSTOM_ENV_VARIABLE' => 1,\n 'CUSTOM_ENV_VARIABLE_FOR_PARALLEL' => 1,\n ],\n );\n }\n\n return parent::paratestEnvironmentVariables();\n }", "public function getVariables ()\n {\n /**\n * Specification:\n * - itemkey used to identify variable in your other functions\n * - type text, textarea, yesno, password, hidden (type hidden are variables used by CE and are required)\n * - description description of the variable, displayed in ClientExec\n * - encryptable used to indicate the variable's value must be encrypted in the database\n */\n $variables = array(\n lang('Name') => array(\n 'type' => 'hidden',\n 'description' => lang('Used by ClientExec to display plugin. It must match the action function name(s).'),\n 'value' => 'InterWorx-CP'\n ),\n lang('Description') => array (\n 'type' => 'hidden',\n 'description' => lang('Description viewable by admin in server settings'),\n 'value' => lang('InterWorx-CP integration.')\n ),\n lang('Access Key') => array (\n 'type' => 'textarea',\n 'description' => lang('Access key used to authenticate to server.'),\n 'value' => '',\n 'encryptable' => true\n ),\n lang('Actions') => array (\n 'type' => 'hidden',\n 'description' => lang('Actions currently available for this plugin.'),\n 'value' => 'Create,Delete,Suspend,UnSuspend'\n )\n );\n\n return $variables;\n }", "protected function buildEnvironmentVariables($query)\n {\n // Mac/UNIX defaults\n $command = 'export';\n $chain = '&&';\n\n // Windows specific\n if (strncasecmp(PHP_OS, 'WIN', 3) == 0) {\n $command = 'set';\n $chain = '&';\n $query = str_replace('&', '^&', $query);\n }\n\n // Environmental variables to set\n $variables = [\n 'REQUEST_URI' => $this->path,\n 'SCRIPT_NAME' => $this->path,\n 'QUERY_STRING' => $query,\n ];\n\n // Mac/UNIX requires variables to be in enclosed in quotes if there is a space\n if (strncasecmp(PHP_OS, 'WIN', 3) != 0) {\n $variables = array_map(function ($value) {\n return '\"' . str_replace('\"', '\\\"', $value) . '\"';\n }, $variables);\n }\n\n $line = null;\n\n foreach ($variables as $variable => $value) {\n $line .= \"${command} ${variable}=${value}${chain}\";\n }\n\n return $line;\n }", "protected function GetDescriptionVariables()\n {\n return array();\n }", "public function listInvalidProperties()\n {\n $invalidProperties = [];\n\n if ($this->container['companyAccount'] === null) {\n $invalidProperties[] = \"'companyAccount' can't be null\";\n }\n if ($this->container['terminal'] === null) {\n $invalidProperties[] = \"'terminal' can't be null\";\n }\n $allowedValues = $this->getTerminalStatusAllowableValues();\n if (!is_null($this->container['terminalStatus']) && !in_array($this->container['terminalStatus'], $allowedValues, true)) {\n $invalidProperties[] = sprintf(\n \"invalid value '%s' for 'terminalStatus', must be one of '%s'\",\n $this->container['terminalStatus'],\n implode(\"', '\", $allowedValues)\n );\n }\n\n return $invalidProperties;\n }", "public function getEnvironmentOptions(): array\n {\n return $this->environmentOptions;\n }", "public function getHeaders(): array\n {\n $result = [];\n\n foreach ($this->env as $key => $value) {\n if (stripos($key, 'HTTP_') === 0 && !Text::strEnds($key, '_RAW')) {\n $headerKey = static::normalizeHeaderName(substr($key, 5));\n $result[$headerKey][] = $value;\n }\n }\n\n return $result;\n }", "function getSupportingConfigVars()\n {\n return array();\n }", "protected function preparedPlaceholders(): array\n {\n $placeholders = [];\n foreach ($this->placeholders() as $placeholder => $var) {\n $placeholders['{{' . $placeholder . '}}'] = strpos($var, '--') !== 0 \n ? $this->arg($var) \n : $this->opt(substr($var, 0, 2));\n }\n\n return $placeholders;\n }", "private function getEnvironmentInfos()\n\t{\n\t\t// Get a instance of Joomla\\CMS\\Environment\\Browser\n\t\t$browser = JBrowser::getInstance();\n\n\t\t// Get the values form the useragent string\n\t\t$detectedPlatform = $browser->getPlatform();\n\t\t$detectedBrowser = $browser->getBrowser();\n\n\t\t// Prepare the return values\n\t\t$environmentInfos = array(\n\t\t\t'platform' => 'unknown',\n\t\t\t'browser' => 'unknown',\n\t\t);\n\n\t\t// Set the platform value when we support it.\n\t\tif (array_key_exists($detectedPlatform, $this->supportedPlatforms))\n\t\t{\n\t\t\t$environmentInfos['platform'] = $detectedPlatform;\n\t\t}\n\n\t\t// Set the browser value when we support it.\n\t\tif (array_key_exists($detectedBrowser, $this->supportedBrowsers))\n\t\t{\n\t\t\t$environmentInfos['browser'] = $detectedBrowser;\n\t\t}\n\n\t\t// Return the results\n\t\treturn $environmentInfos;\n\t}", "public function listInvalidProperties()\n {\n $invalidProperties = [];\n\n if ($this->container['sequence'] === null) {\n $invalidProperties[] = \"'sequence' can't be null\";\n }\n if ($this->container['application_code'] === null) {\n $invalidProperties[] = \"'application_code' can't be null\";\n }\n if ($this->container['configuration_code'] === null) {\n $invalidProperties[] = \"'configuration_code' can't be null\";\n }\n if ($this->container['organization'] === null) {\n $invalidProperties[] = \"'organization' can't be null\";\n }\n if ($this->container['language'] === null) {\n $invalidProperties[] = \"'language' can't be null\";\n }\n if ($this->container['dictionary'] === null) {\n $invalidProperties[] = \"'dictionary' can't be null\";\n }\n if ($this->container['region'] === null) {\n $invalidProperties[] = \"'region' can't be null\";\n }\n if ($this->container['description_to_use'] === null) {\n $invalidProperties[] = \"'description_to_use' can't be null\";\n }\n if ($this->container['web_skin'] === null) {\n $invalidProperties[] = \"'web_skin' can't be null\";\n }\n if ($this->container['default_language'] === null) {\n $invalidProperties[] = \"'default_language' can't be null\";\n }\n return $invalidProperties;\n }", "public function getAvailableVariables() :array\n {\n return [];\n }", "function listEnvironments($con, $def_envID)\n\t{\n\t\t# Default value for the environment dropdown\n\t\t$sql_env = \"SELECT envID, envName FROM environments\";\n\t\t$result_env = $con->query($sql_env) or die(mysqli_error($con));\n\t\n\t\t$list_env = \"\";\n\t\twhile($rowv = mysqli_fetch_array($result_env))\n\t\t{\n\t\t\t$envID = htmlspecialchars($rowv['envID']);\n\t\t\t$envName = htmlspecialchars($rowv['envName']);\n\t\n\t\t\tif($envID == $def_envID) { $selected = \"selected='true'\"; } else { $selected = \"\"; }\n\t\n\t\t\t$list_env .= \"<option value='$envID' $selected>$envName</option>\";\n\t\t}\n\n\t\treturn $list_env;\n\t}", "private function getArguments(): array\n {\n $results = [];\n\n $logLevel = $this->config->getLogLevel();\n $consumer = \\escapeshellarg($this->config->getConsumer());\n $provider = \\escapeshellarg($this->config->getProvider());\n $pactDir = \\escapeshellarg($this->config->getPactDir());\n\n $results[] = 'service';\n $results[] = \"--consumer={$consumer}\";\n $results[] = \"--provider={$provider}\";\n $results[] = \"--pact-dir={$pactDir}\";\n $results[] = \"--pact-file-write-mode={$this->config->getPactFileWriteMode()}\";\n $results[] = \"--host={$this->config->getHost()}\";\n $results[] = \"--port={$this->config->getPort()}\";\n\n if ($logLevel !== null) {\n $results[] = \\sprintf('--log-level=%s', \\escapeshellarg($logLevel));\n }\n\n if ($this->config->hasCors()) {\n $results[] = '--cors=true';\n }\n\n if ($this->config->getPactSpecificationVersion() !== null) {\n $results[] = \"--pact-specification-version={$this->config->getPactSpecificationVersion()}\";\n }\n\n if ($this->config->getLog() !== null) {\n $log = \\escapeshellarg($this->config->getLog());\n $results[] = \\sprintf('--log=%s', $log);\n }\n\n return $results;\n }", "protected function renderWidgetVariablesDescriptionList(array $vars)\n {\n $s = '';\n foreach ($vars as $key => $item) {\n if (array_key_exists(\"alias_of\", $item)) {\n $s .= '- **' . $key . '**: same as ' . $item['alias_of'] . PHP_EOL;\n } else {\n $s .= $this->renderListItem($key, $item, 1);\n }\n }\n return $s;\n }", "public static function attributes( $list=[] )\n {\n $atts = [];\n\n if( !empty( $list ) && is_array( $list ) )\n {\n foreach( $list as $key => $value )\n {\n if( is_numeric( $key ) ) continue;\n $key = Sanitize::toSlug( $key );\n $value = self::escape( $value, '\"' );\n $atts[] = $key .'=\"'. $value .'\"';\n }\n }\n return implode( \" \", $atts );\n }", "public function getEnvironment() {\n\n return trim($this->environment);\n }", "public function getBindVars(): array\n {\n return $this->container->getAll();\n }", "function list_items($list)\n{\n // Create empty starter string\n $listString = '';\n \n // Loop through an array $list to pull out $key and $items from the array.\n foreach ($list as $key => $items) {\n // Increment $key so list number starts at 1 rather than 0.\n $key++;\n // Concatenate each list item to $listString\n $listString .= \"[{$key}] {$items}\" . PHP_EOL;\n }\n return $listString;\n}", "public function config_vars()\n\t{\n\t\tglobal $txt;\n\n\t\t$return_data = array();\n\n\t\t$core_features = $this->settings();\n\n\t\t// Convert this to a format that admin search will understand\n\t\tforeach ($core_features as $id => $data)\n\t\t{\n\t\t\t$return_data[] = array('switch', $data['title'] ?? $txt['core_settings_item_' . $id]);\n\t\t}\n\n\t\treturn $return_data;\n\t}" ]
[ "0.66357464", "0.637745", "0.6372802", "0.6364524", "0.62468576", "0.6242825", "0.62371224", "0.61860514", "0.61798364", "0.617086", "0.60791445", "0.6060386", "0.60586685", "0.6024537", "0.6018612", "0.60167074", "0.5994406", "0.5976962", "0.5877872", "0.5869686", "0.5840919", "0.5788447", "0.5701521", "0.5680533", "0.56592864", "0.55931646", "0.55854976", "0.5520914", "0.54898024", "0.54871017", "0.54777116", "0.5399739", "0.53572196", "0.5318923", "0.53097326", "0.5291064", "0.52646345", "0.5243129", "0.52104115", "0.5206103", "0.5174306", "0.51469743", "0.5142826", "0.51268923", "0.51255184", "0.512057", "0.51178026", "0.51037186", "0.5078275", "0.506092", "0.5057843", "0.50387657", "0.5031852", "0.49928892", "0.49877667", "0.49517852", "0.4947783", "0.49468905", "0.49289963", "0.49272624", "0.49206066", "0.49201617", "0.49190155", "0.49120983", "0.4903574", "0.49022454", "0.49020746", "0.48960796", "0.48732418", "0.48699605", "0.4861071", "0.48604438", "0.48489285", "0.48456576", "0.4837091", "0.48254266", "0.48121342", "0.4806578", "0.48021585", "0.47981235", "0.47921586", "0.47807664", "0.47755867", "0.47691977", "0.47513917", "0.47495854", "0.47487164", "0.47441852", "0.47354656", "0.47345737", "0.47300306", "0.47275895", "0.47223192", "0.4715561", "0.4714521", "0.47072425", "0.47057053", "0.4705648", "0.46997404", "0.46899405" ]
0.744383
0
run data through a supported filter
function Filter($filter,$data) { global $FILTERS; // // get the program name from the filter name // if (!isset($FILTERS[$filter]) || $FILTERS[$filter] == "") { Error("bad_filter","The form has an internal error - unknown filter"); exit; } $prog = $FILTERS[$filter]; // // change to the directory that contains the filter program // $dirname = dirname($prog); if (!chdir($dirname)) { Error("chdir_filter","The form has an internal error - cannot chdir to run filter"); exit; } // // the output of the filter goes to a temporary file // $temp_file = tempnam("/tmp","FMF"); $cmd = "$prog > $temp_file 2>&1"; // // start the filter // $pipe = popen($cmd,"w"); if (!$pipe) { $err = join('',file($temp_file)); unlink($temp_file); Error("filter_not_found","The form has an internal error - cannot execute filter", true,$err); exit; } // // write the data to the filter // fwrite($pipe,$data); if (pclose($pipe) != 0) { $err = join('',file($temp_file)); unlink($temp_file); Error("filter_failed","The form has an internal error - filter failed", true,$err); exit; } // // read in the filter's output and return as the data to be sent // $data = join('',file($temp_file)); unlink($temp_file); return ($data); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function filter($data);", "public function filtering();", "abstract public function filters();", "private function filters() {\n\n\n\t}", "public function run()\n {\n $collection = Mage::getResourceModel('aw_layerednavigation/filter_collection')\n ->addFieldToFilter('type', array('eq' => AW_Layerednavigation_Model_Source_Filter_Type::DECIMAL_PRICE_CODE))\n ;\n $priceFilterModel = $collection->getFirstItem();\n\n if (!$priceFilterModel->getId()) {\n $priceFilterData = array(\n 'title' => Mage::helper('aw_layerednavigation')->__('Price'),\n 'type' => AW_Layerednavigation_Model_Source_Filter_Type::DECIMAL_PRICE_CODE,\n 'is_enabled' => 1,\n 'is_enabled_in_search' => 1,\n 'code' => $this->getUniqueCode('price'),\n 'position' => 0,\n 'display_type' => AW_Layerednavigation_Model_Source_Filter_Display_Type::RANGE_CODE,\n 'image_position' => AW_Layerednavigation_Model_Source_Filter_Image_Position::TEXT_ONLY_CODE,\n 'is_row_count_limit_enabled' => self::IS_ROW_COUNT_LIMIT_STATUS,\n 'row_count_limit' => self::ROW_COUNT_LIMIT,\n 'additional_data' => array(),\n );\n $priceFilterModel->setData($priceFilterData)->save();\n }\n }", "public function processFilter()\n {\n call_user_func($this->builder, $this);\n\n return $this->filter->execute();\n }", "private static function _getFilter() {}", "public static function filter($filters, &$data) {\n $params = array(&$data);\n foreach ($filters as $callback) {\n $continue = self::execute($callback, $params);\n if ($continue === false) break;\n }\n }", "function filter_data($data, $filter) {\n return CMContent::Filter($data, $filter);\n}", "protected abstract function filter();", "function outputFilter($data, stdClass $context) {\n for ($i = 0, $n = count($this->filters); $i < $n; $i++) {\n $data = $this->filters[$i]->outputFilter($data, $context);\n }\n return $data;\n }", "public function filter($filter)\n {\n }", "public function filter();", "public function process_filter_data_query($filter_data = array())\r\n {\r\n if($this->is_error === true){return;}\r\n \r\n // Peform lower module/table query statement\r\n foreach ($this->model_id_list() as $convert_condition)\r\n {\r\n // Use to store the extracted data\r\n $data_record = array();\r\n \r\n // Loop through data to obtain all value\r\n foreach ($convert_condition[\"data_column\"] as $data)\r\n {\r\n $data_name = $data[\"data\"];\r\n $data_key = $data[\"column\"];\r\n \r\n // Need to process each data\r\n foreach($filter_data as $f_key => $f_data)\r\n {\r\n // Peform string serach to cater for \"=\", \">\" and \"<\" symbol\r\n if(strpos($f_key,$data_name) !== false)\r\n {\r\n // Perform string replace\r\n $new_key = str_replace($data_name, $data_key, $f_key);\r\n $data_record[$new_key] = $filter_data[$f_key];\r\n unset($filter_data[$f_key]);\r\n }\r\n }\r\n }\r\n\r\n if($data_record !== array())\r\n {\r\n $mode = $convert_condition[\"table\"].\"_model\";\r\n $this->load->model($mode); // Invoke necessary model\r\n \r\n // Throw to sub model to process\r\n $data_record = $this->$mode->process_filter_data_query($data_record);\r\n \r\n // Check any name that is not tie to model\r\n foreach ($data_record as $r_key => $d_key)\r\n {\r\n if(strpos($r_key, \".\") === false)\r\n {\r\n // Map those with current sub model\r\n $new_key = $convert_condition[\"table\"].\".\".$r_key;\r\n $data_record[$new_key] = $data_record[$r_key];\r\n unset($data_record[$r_key]);\r\n }\r\n }\r\n \r\n $filter_data = array_merge($filter_data, $data_record);\r\n }\r\n\r\n // Merge back the data to filter data\r\n\r\n // @todo - careful about the range search and pattern, might not require as\r\n // currently as the column need range is at top level \r\n //$keys = array_keys($array); \r\n //$search_count (int) preg_grep(\"/c$/\",$keys);\r\n }\r\n \r\n return $filter_data;\r\n }", "abstract public function prepareFilters();", "protected function applyFiltering()\n\t{\n\t\tif (!$this->hasFilters()) return;\n\n\t\tparse_str($this->filters, $list);\n\t\tforeach ($list as $column => $value) {\n\t\t\tif ($value !== '') {\n\t\t\t\t$this[$column]->applyFilter($value);\n\t\t\t}\n\t\t}\n\t}", "protected function _filters($data) {\n return $data;\n }", "function calculate_data() {\n $this->data = $this->get_default_data();\n\n // Get extra icons... send list of filters but don't include exceptions - as we do need the filter list here\n $exceptions = $this->get_filter_exceptions();\n $rest_of_filters = array();\n foreach ($this->filter->_fields as $key => $value) {\n if (!in_array($key,$exceptions)) {\n $rest_of_filters[] = $key;\n }\n }\n // Pass the rest_of_filters array, but then also let the method know this is a special config filter\n $extra_icons = $this->filter->get_sql_filter('',\n $rest_of_filters,\n $this->allow_interactive_filters(),\n $this->allow_configured_filters(),\n '',\n true);\n\n foreach ($this->data as $key => $value) {\n\n //If key is in choices array and not in extra_icons\n if (array_key_exists($key,$this->checkboxes_filter->options['choices']) &&\n !strpos($extra_icons,$key)) {\n // then we need to remove it from $this->data in fact...\n unset($this->data[$key]);\n continue;\n }\n //first step - try getting the item value directly\n $data_item = $this->get_data_item($key);\n\n if ($data_item !== FALSE) {\n $this->data[$key]->value = $data_item;\n } else {\n //backup plan - use SQL query to get the item value\n\n $use_filters = true;\n $sql = $this->get_data_item_sql($key, $use_filters);\n if ($sql !== FALSE) {\n //parse SQL for a WHERE clause\n\n $has_where_clause = php_report::sql_has_where_clause($sql);\n\n $conditional_symbol = 'WHERE';\n\n if($has_where_clause) {\n $conditional_symbol = 'AND';\n }\n\n // apply filters if applicable\n if(!empty($this->filter) && !empty($use_filters)) {\n // Include filter_exceptions here so that our config type filter is not included in the filters added to the final sql\n $sql_filter = $this->filter->get_sql_filter('',\n $this->get_filter_exceptions($key),\n $this->allow_interactive_filters(),\n $this->allow_configured_filters());\n if(!empty($sql_filter)) {\n $sql .= \" {$conditional_symbol} ({$sql_filter})\";\n }\n }\n //obtain field value\n if ($field_data = get_field_sql($sql)) {\n $this->data[$key]->value = $field_data;\n }\n }\n }\n }\n\n }", "public function run()\n {\n // Terms Array\n $terms_arr = array(\"healthy food\",\"fast food\",\"athletic nutrition\");\n $terms_str = serialize($terms_arr);\n Data::factory()->create([\n 'data_type' => TrendFilter::class,\n 'data_id' =>TrendFilter::create([\n 'name' => 'TestFoodTrend',\n 'description' => 'Query to test the GoogleTrends functionality',\n 'search_term' => $terms_str,\n 'category_id' => 2,\n 'country_id' => 157,\n 'standard_interval_id' => 2,\n 'search_type' => 'Web-Search',\n 'with_top_metric' => true,\n 'with_rising_metric' => true\n ])\n ]);\n }", "function _prepare_filter_data () {\n\t\t// Filter session array name\n\t\t$this->_filter_name\t= $_GET[\"object\"].\"_filter\";\n\t\t// Connect common used arrays\n\t\tif (file_exists(INCLUDE_PATH.\"common_code.php\")) {\n\t\t\tinclude (INCLUDE_PATH.\"common_code.php\");\n\t\t}\n\t\t// Fields in the filter\n\t\t$this->_fields_in_filter = array(\n\t\t\t\"engine\",\n\t\t\t\"text\",\n\t\t);\n\t}", "public function filter( )\n {\n global $UNDERQL;\n $l_args_num = func_num_args( );\n if ( $l_args_num < 3 )\n return false;\n $filter_name = func_get_arg( 0 );\n\n $l_filter_callback = $UNDERQL['filter']['prefix'] . $filter_name;\n\n if ( !function_exists( $l_filter_callback ))\n return false;\n\n switch(func_get_arg(1))\n {\n case UQL_FILTER_IN:\n\n for ( $i = 2; $i < $l_args_num; $i++ )\n {\n if(!isset($this->in_filters[$this->table_name][func_get_arg( $i )]))\n $this->in_filters[$this->table_name][func_get_arg( $i )] = array($filter_name);\n else\n {\n $_temp = $this->in_filters[$this->table_name][func_get_arg( $i )];\n $_temp[@count($_temp)] = $filter_name;\n\n $this->in_filters[$this->table_name][func_get_arg( $i )] = $_temp;\n }\n }\n return true;\n\n case UQL_FILTER_OUT:\n for ( $i = 2; $i < $l_args_num; $i++ )\n {\n if(!isset($this->out_filters[$this->table_name][func_get_arg( $i )]))\n {\n $this->out_filters[$this->table_name][func_get_arg( $i )] = array($filter_name);\n }\n else\n {\n $_temp = $this->out_filters[$this->table_name][func_get_arg( $i )];\n $_temp[@count($_temp)] = $filter_name;\n\n $this->out_filters[$this->table_name][func_get_arg( $i )] = $_temp;\n\n }\n }\n return true;\n default : return false;\n }\n }", "protected function processFilters()\n {\n $this->filters = [];\n foreach ($this->params as $key => $value) {\n $this->parser->setAlias('_' . $this->contentType);\n $filter = $this->parser->getFilter($key, $value);\n if ($filter) {\n $this->addFilter($filter);\n }\n }\n }", "public function filter() {\r\n\t\t$this->resource->filter();\r\n\t}", "public static function apply_filters($filters, $data) {\n\t\t// 'boolean,encrypt,htmlspecialchars,strip_tags,int,lower,upper,strip_newlines,nl2br,function_reference,regex,trim'\n\t\tpreg_match_all('/\\%(.*?)\\=\\\"(.*?)\\\"/', $filters, $filters_array);\n\t\tif (count($filters_array[1]) == 0 || count($filters_array[2]) == 0) {\n\t\t\treturn $data;\n\t\t}\n\t\t$filters = array_combine($filters_array[1], $filters_array[2]);\n\t\t$allowed_filters = explode(',', self::filters_array);\n\t\tforeach ($filters as $filter => $value) {\n\t\t\tif (in_array($filter, $allowed_filters)) { \n\t\t\t\tswitch ($filter) {\n\t\t\t\t\tcase 'boolean':\n\t\t\t\t\t\t$data = (boolean) $data;\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'encrypt':\n\t\t\t\t\t\t$data = Encryption::encrypt($data);\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'htmlspecialchars':\n\t\t\t\t\t\t$data = htmlspecialchars($data);\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'strip_tags':\n\t\t\t\t\t\t$data = strip_tags($data, $value);\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'int':\n\t\t\t\t\t\t$data = (int) $data;\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'lower':\n\t\t\t\t\t\t$data = strtolower($data);\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'upper':\n\t\t\t\t\t\t$data = strtoupper($data);\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'strip_newlines':\n\t\t\t\t\t\t$data = str_replace(array('<br>', '<br />', '<br/>'), '', nl2br($data));\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'nl2br':\n\t\t\t\t\t\t$data = nl2br($data);\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'function':\n\t\t\t\t\t\t$data = call_user_func($value, $data);\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'function_reference':\n\t\t\t\t\t\tcall_user_func($value, $data);\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'regex':\n\t\t\t\t\t\t\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'trim':\n\t\t\t\t\t\t$data = trim($data);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $data;\n\t}", "function xh_fetchFilter($filter_name)\r\n\t{\r\n\t}", "public function getAllData(array $filters = []);", "protected static function filtes()\n {\n /*\n * The filters fetches are transported\n * to router Bus calls\n **/\n }", "public function getFiltred(array &$data);", "abstract function get_sql_filter($data);", "function get_filters($init_data = true) {\n //no filters by default\n return array();\n }", "private function _setupFiltering()\n\t{\n\t\tglobal $txt;\n\n\t\t// We'll escape some strings...\n\t\t$db = database();\n\n\t\t// You can filter by any of the following columns:\n\t\t$filters = array(\n\t\t\t'id_member' => $txt['username'],\n\t\t\t'ip' => $txt['ip_address'],\n\t\t\t'session' => $txt['session'],\n\t\t\t'url' => $txt['error_url'],\n\t\t\t'message' => $txt['error_message'],\n\t\t\t'error_type' => $txt['error_type'],\n\t\t\t'file' => $txt['file'],\n\t\t\t'line' => $txt['line'],\n\t\t);\n\n\t\t$filter = $this->_req->getQuery('filter', 'trim', null);\n\t\t$value = $this->_req->getQuery('value', 'trim', null);\n\n\t\t// Set up the filtering...\n\t\tif (isset($value, $filters[$filter]))\n\t\t{\n\t\t\t$filter = array(\n\t\t\t\t'variable' => $filter,\n\t\t\t\t'value' => array(\n\t\t\t\t\t'sql' => in_array($filter, array('message', 'url', 'file'))\n\t\t\t\t\t\t? base64_decode(strtr($value, array(' ' => '+')))\n\t\t\t\t\t\t: $db->escape_wildcard_string($value),\n\t\t\t\t),\n\t\t\t\t'href' => ['filter' => $filter, 'value' => $value],\n\t\t\t\t'entity' => $filters[$filter]\n\t\t\t);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif (isset($filter, $value))\n\t\t\t{\n\t\t\t\tunset($this->_req->query->filter, $this->_req->query->value);\n\t\t\t}\n\n\t\t\t$filter = [];\n\t\t}\n\n\t\treturn $filter;\n\t}", "private function gatherData($filter) {\r\n $res = $this->db->query(\"SELECT i.*, f.symbol AS fiatSym, c.symbol AS cryptoSym, o.display AS fxOption, s.status\r\n FROM invoices i\r\n LEFT JOIN currencies f ON f.id = i.fiat_id\r\n LEFT JOIN currencies c ON c.id = i.crypto_id\r\n LEFT JOIN fx_options o ON o.id = i.fx_option\r\n LEFT JOIN status_ref s ON s.id = i.status_id\r\n WHERE i.user = \".$_SESSION['user'].\" \".$filter\r\n .\" ORDER BY i.create_time DESC\");\r\n while ($r=$res->fetch_assoc()) {\r\n $r['docs'] = $this->findDocs($r['id']); // Array; find any documents\r\n array_push($this->list,$r);} // Add to stack\r\n }", "abstract protected function getFilters();", "function mFILTER(){\n try {\n $_type = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$FILTER;\n $_channel = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$DEFAULT_TOKEN_CHANNEL;\n // Tokenizer11.g:211:3: ( 'filter' ) \n // Tokenizer11.g:212:3: 'filter' \n {\n $this->matchString(\"filter\"); \n\n\n }\n\n $this->state->type = $_type;\n $this->state->channel = $_channel;\n }\n catch(Exception $e){\n throw $e;\n }\n }", "abstract function query( $p_filter_input );", "public function rawFilter($filter) {\n\t\t$query = InventorySummary::orderBy('Client_SKU', 'asc');\n\t\tif(isset($filter['objectID']) && strlen($filter['objectID']) > 3) {\n\t\t\t$query = $query->where('objectID', 'like', $filter['objectID'] . '%');\n\t\t}\n\t\tif(isset($filter['Client_SKU']) && strlen($filter['Client_SKU']) > 3) {\n\t\t\t$query = $query->where('Client_SKU', 'like', $filter['Client_SKU'] . '%');\n\t\t}\n\t\tif(isset($filter['Description']) && strlen($filter['Description']) > 3) {\n\t\t\t$query = $query->where('Description', 'like', $filter['Description'] . '%');\n\t\t}\n\n /*\n * Pick face quantity choices\n */\n if(isset($filter['pickQty_rb'])) {\n if($filter['pickQty_rb'] == 'zero') {\n $query = $query->where('pickQty', '=', '0');\n } elseif($filter['pickQty_rb'] == 'belowMin') {\n $query = $query->where('pickQty', '<', '3');\n } elseif($filter['pickQty_rb'] == 'aboveMin') {\n $query = $query->where('pickQty', '>', '2');\n }\n }\n\n /*\n * Activity location quantity choices\n */\n if(isset($filter['actQty_rb'])) {\n if($filter['actQty_rb'] == 'zero') {\n $query = $query->where('actQty', '=', '0');\n } elseif($filter['actQty_rb'] == 'aboveZero') {\n $query = $query->where('actQty', '>', '0');\n }\n }\n\n /*\n * Reserve quantity choices\n */\n if(isset($filter['resQty_rb'])) {\n if($filter['resQty_rb'] == 'zero') {\n $query = $query->where('resQty', '=', '0');\n } elseif($filter['resQty_rb'] == 'aboveZero') {\n $query = $query->where('resQty', '>', '0');\n }\n }\n\n /*\n * Replen Priority choices\n */\n if(isset($filter['replenPrty_cb_noReplen'])\n or isset($filter['replenPrty_cb_20orBelow'])\n or isset($filter['replenPrty_cb_40orBelow'])\n or isset($filter['replenPrty_cb_60orBelow'])) {\n $query->where(function ($query) use ($filter) {\n if (isset($filter['replenPrty_cb_noReplen']) && $filter['replenPrty_cb_noReplen'] == 'on') {\n $query->orWhereNull('replenPrty')\n ->orWhere('replenPrty', '=', '0');\n }\n if (isset($filter['replenPrty_cb_20orBelow']) && $filter['replenPrty_cb_20orBelow'] == 'on') {\n $query->orWhereBetween('replenPrty', ['1', '20']);\n }\n if (isset($filter['replenPrty_cb_40orBelow']) && $filter['replenPrty_cb_40orBelow'] == 'on') {\n $query->orWhereBetween('replenPrty', ['21', '40']);\n }\n if (isset($filter['replenPrty_cb_60orBelow']) && $filter['replenPrty_cb_60orBelow'] == 'on') {\n $query->orWhereBetween('replenPrty', ['41', '60']);\n }\n });\n }\n //dd(__METHOD__.\"(\".__LINE__.\")\", compact('filter', 'query'));\n\n\t\tif(isset($filter['created_at']) && strlen($filter['created_at']) > 1) {\n\t\t\t$query = $query->where('created_at', 'like', $filter['created_at'] . '%');\n\t\t}\n\t\tif(isset($filter['updated_at']) && strlen($filter['updated_at']) > 1) {\n\t\t\t$query = $query->where('updated_at', 'like', $filter['updated_at'] . '%');\n\t\t}\n return $query;\n }", "public function filterAll($filter, $args=[]);", "public function filter($input);", "protected static function callFilter( $event, $data ) {\r\n\t\t\t$event = strtolower( $event );\r\n\t\t\t//\r\n\t\t\tif (isset(self::$eventMap[$event])) {\r\n\t\t\t\tforeach ( self::$eventMap[$event] as $callback ) {\r\n\t\t\t\t\t$data = call_user_func($callback, $data );\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn $data;\r\n\t\t}", "public function setDataFilter($filter)\n {\n // TODO: improve logging when we finally have a central Tesseract debugging workflow\n if (TYPO3_DLOG) {\n t3lib_div::devLog('Data filters are currently not supported!', 'tagpackprovider', 2);\n }\n }", "protected function pageFilterProcessing(&$data) {\n\t\t\n\t\t$filters = array();\n\t\t$token = $this->session->data['token'];\n\t\t$url = $this->url->link('common/orders_dashboard', \"token=$token\", true);\n\t\t$data['day_selected'] = \"\";\n\t\t$data['week_selected'] = \"\";\n\t\t$data['month_selected'] = \"\";\n\t\t$data['year_selected'] = \"\";\n\t\t$data['custom_selected'] = \"\";\n\t\t$data['allow_next_click'] = \"\";\n\t\t$data['tf_range'] = \"\";\n\t\t$data['tf_no_range'] = \"\";\n\t\t$data['filter_date_from'] = date(\"d F Y\", strtotime(\"first day of this month\"));\n\t\t$data['filter_date_to'] = date(\"d F Y\", strtotime(\"last day of this month\"));\n\t\t$data['filter_form_action'] = $url;\t\t# form action\n\t\t\n\t\t/*===== End of Initialization ======*/\n\n\t\t/*============================================\n\t\t= User Role Management =\n\t\t============================================*/\n\t\t\n\t\t$this->load->model('user/user_group');\n\t\t$this->load->model('user/user');\n\t\t$currentUser = $this->session->data['user_id'];\n\t\t$currentUserGroupId = $this->model_user_user->getUser($currentUser);\n\t\t$currentUserGroup = $this->model_user_user_group->getUserGroup($currentUserGroupId['user_group_id']);\n\t\t\n\t\tif ($currentUserGroup['name'] == 'Company admin' || $currentUserGroup['name'] == 'Administrator') {\n\t\t\t$allAccess = true;\n\t\t\t$currentUserId = 0;\n\t\t} else { \n\t\t\t$allAccess = false;\n\t\t\t$currentUserId = $this->session->data['user_id'];\n\t\t}\n\t\t\n\t\t/*===== End of User Role Management ======*/\n\n\t\t/*===============================\n\t\t= Filters =\n\t\t===============================*/\n\t\t\n\t\tif (isset($this->request->get['filter_time_frame'])) {\n\t\t\tswitch ($this->request->get['filter_time_frame']) {\n\n\t\t\t\t/*---------- filter by day ----------*/\n\t\t\t\tcase \"day\":\n\t\t\t\t\t$url .= \"&filter_time_frame=day\";\n\t\t\t\t\tif (isset($this->request->get['filter_date'])) {\n\t\t\t\t\t\t$filters['filter_date'] = $this->request->get['filter_date'];\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$filters['filter_date'] = date(\"Y-m-d\");\n\t\t\t\t\t}\n\n\t\t\t\t\t$data['filter_time_frame'] = $this->request->get['filter_time_frame'];\n\t\t\t\t\t$data['filter_display'] = date(\"l, d F Y\", strtotime($filters['filter_date']));\n\t\t\t\t\t$data['day_selected'] = \"selected\";\n\t\t\t\t\t$data['tf_range'] = 'style=\"display:none\"';\n\n\t\t\t\t\t# prev and next links\n\t\t\t\t\t$data['filter_prev_link'] = \"$url&filter_date=\".date(\"Y-m-d\", strtotime($filters['filter_date'].\" -1 day\"));\n\t\t\t\t\t$data['filter_next_link'] = \"$url&filter_date=\".date(\"Y-m-d\", strtotime($filters['filter_date'].\" +1 day\"));\n\t\t\t\t\t$data['allow_next_click'] = ($filters['filter_date'] >= date(\"Y-m-d\")) ? \"disabled\": \"\";\n\t\t\t\t\tbreak;\n\n\t\t\t\t/*---------- filter by week ----------*/\n\t\t\t\tcase \"week\":\n\t\t\t\t\t$url .= \"&filter_time_frame=week\";\n\t\t\t\t\tif (isset($this->request->get['filter_date_from']) && isset($this->request->get['filter_date_to'])) {\n\t\t\t\t\t\t$filters['filter_date_from'] = $this->request->get['filter_date_from'];\n\t\t\t\t\t\t$filters['filter_date_to'] = $this->request->get['filter_date_to'];\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$filters['filter_date_from'] = date(\"Y-m-d\", strtotime(\"monday this week\"));\n\t\t\t\t\t\t$filters['filter_date_to'] = date(\"Y-m-d\", strtotime(\"friday this week\"));\n\t\t\t\t\t}\n\n\t\t\t\t\t$data['filter_time_frame'] = \"week\";\n\t\t\t\t\t$data['filter_display'] = date('d F', strtotime($filters['filter_date_from'])).\" - \".date('d F, Y', strtotime($filters['filter_date_to']));\n\t\t\t\t\t$data['week_selected'] = \"selected\";\n\t\t\t\t\t$data['tf_range'] = 'style=\"display:none\"';\n\n\t\t\t\t\t# prev and next links\n\t\t\t\t\t$data['filter_prev_link'] = \"$url&filter_date_from=\".date('Y-m-d', strtotime($filters['filter_date_from'].\" -7 days\")).\"&filter_date_to=\".date('Y-m-d', strtotime($filters['filter_date_to'].\" -7 days\"));\n\t\t\t\t\t$data['filter_next_link'] = \"$url&filter_date_from=\".date('Y-m-d', strtotime($filters['filter_date_from'].\" +7 days\")).\"&filter_date_to=\".date('Y-m-d', strtotime($filters['filter_date_to'].\" +7 days\"));\n\t\t\t\t\t$data['allow_next_click'] = ($filters['filter_date_to'] >= date(\"Y-m-d\")) ? \"disabled\" : \"\";\n\t\t\t\t\tbreak;\n\n\t\t\t\t/*---------- filter by month ----------*/\n\t\t\t\tcase \"month\":\n\t\t\t\t\t$url .= \"&filter_time_frame=month\";\n\t\t\t\t\tif (isset($this->request->get['filter_month'])) {\n\t\t\t\t\t\t$filters['filter_month'] = $this->request->get['filter_month'];\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$filters['filter_month'] = date(\"Y-m\");\n\t\t\t\t\t}\n\n\t\t\t\t\t$data['filter_time_frame'] = \"month\";\n\t\t\t\t\t$data['filter_display'] = date('1 M - 30 M, Y', strtotime($filters['filter_month']));\n\t\t\t\t\t$data['month_selected'] = \"selected\";\n\t\t\t\t\t$data['tf_range'] = 'style=\"display:none\"';\n\n\t\t\t\t\t# prev and next links\n\t\t\t\t\t$data['filter_prev_link'] = \"$url&filter_month=\".date('Y-m', strtotime($filters['filter_month'].\" -1 month\"));\n\t\t\t\t\t$data['filter_next_link'] = \"$url&filter_month=\".date('Y-m', strtotime($filters['filter_month'].\" +1 month\"));\n\t\t\t\t\t$data['allow_next_click'] = ($filters['filter_month'] >= date(\"Y-m\")) ? \"disabled\" : \"\";\n\t\t\t\t\tbreak;\n\n\t\t\t\t/*---------- filter by year ----------*/\n\t\t\t\tcase \"year\":\n\t\t\t\t\t$url .= \"&filter_time_frame=year\";\n\t\t\t\t\tif (isset($this->request->get['filter_year'])) {\n\t\t\t\t\t\t$filters['filter_year'] = $this->request->get['filter_year'];\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$filters['filter_year'] = date(\"Y\");\n\t\t\t\t\t}\n\n\t\t\t\t\t$data['filter_time_frame'] = \"year\";\n\t\t\t\t\t$data['filter_display'] = \"1 January - 31 December, \".$filters['filter_year'];\n\t\t\t\t\t$data['year_selected'] = \"selected\";\n\t\t\t\t\t$data['tf_range'] = 'style=\"display:none\"';\n\n\t\t\t\t\t# prev and next links\n\t\t\t\t\t$data['filter_prev_link'] = \"$url&filter_year=\".($filters['filter_year']-1);\n\t\t\t\t\t$data['filter_next_link'] = \"$url&filter_year=\".($filters['filter_year']+1);\n\t\t\t\t\t$data['allow_next_click'] = ($filters['filter_year'] >= date(\"Y\")) ? \"disabled\" : \"\";\n\t\t\t\t\tbreak;\n\n\t\t\t\t/*---------- filter by custom [date range] ----------*/\n\t\t\t\tcase \"custom\":\n\t\t\t\t\t$url .= \"&filter_time_frame=custom\";\n\t\t\t\t\t$filters['filter_date_from'] = date(\"Y-m-d\", strtotime($this->request->get['filter_date_from']));\n\t\t\t\t\t$filters['filter_date_to'] = date(\"Y-m-d\", strtotime($this->request->get['filter_date_to']));\n\n\t\t\t\t\t$data['custom_selected'] = \"selected\";\n\t\t\t\t\t$data['tf_no_range'] = 'style=\"display:none\"';\n\t\t\t\t\t$data['filter_date_from'] = $this->request->get['filter_date_from'];\n\t\t\t\t\t$data['filter_date_to'] = $this->request->get['filter_date_to'];\n\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t}\n\t\t} else {\n\t\t\t/*---------- Default [month] ----------*/\n\t\t\t$url .= \"&filter_time_frame=month\";\n\t\t\t$filters['filter_month'] = date('Y-m');\n\n\t\t\t$data['filter_time_frame'] = \"month\";\n\t\t\t$data['filter_display'] = date('d M', strtotime(\"first day of this month\")) . \" - \" . date('d M, Y', strtotime(\"last day of this month\"));\n\t\t\t$data['month_selected'] = \"selected\";\n\t\t\t$data['tf_range'] = 'style=\"display:none\"';\n\n\t\t\t# prev and next links\n\t\t\t$data['filter_prev_link'] = \"$url&filter_month=\".date('Y-m', strtotime(\"last month\"));\n\t\t\t$data['filter_next_link'] = \"$url&filter_month=\".date('Y-m', strtotime(\"next month\"));\n\t\t\t$data['allow_next_click'] = \"disabled\";\n\t\t}\n\t\t\n\t\t/*===== End of Filters ======*/\n\n\t\t\n\t\t/*=============================\n\t\t= Tiles =\n\t\t=============================*/\n\t\n\t\t$this->load->model('sale/order');\n\n\t\t/*---------- Orders In Progress ----------*/\n\t\t$data['orders_in_progress'] = $this->model_sale_order->getOrdersInProgressCount($filters);\n\n\t\t/*---------- Orders Completed ----------*/\n\t\t$data['orders_completed'] = $this->model_sale_order->getOrdersCompletedCount($filters);\n\n\t\t/*---------- Product Stock Alerts ----------*/\n\t\t$this->load->model('catalog/product');\n\t\t$filters['filter_quantity'] = 0;\n\t\t$data['stock_alerts'] = $this->model_catalog_product->getProductStockAlerts($filters);\n\t\t$data['stock_alerts_tile'] = ($data['stock_alerts'] == 0) ? \"tile-default\" : \"tile-warning\";\n\n\t\t/*---------- Quotes Awaiting Approval ----------*/\n\t\t$this->load->model('replogic/order_quotes');\n\n\t\t# get number of quotes awaiting approval\n\t\t$data['unapproved_quotes'] = $this->model_replogic_order_quotes->getQuotesAwaitingApprovalCount($filters);\t\t\n\t\t$data['unapproved_quotes_tile'] = ($data['unapproved_quotes'] == 0) ? \"tile-default\" : \"tile-danger\";\n\t\t\n\t\t# View more link(s)\n\t\t$data['order_view_more'] = $this->url->link('sale/order', \"token=$token\", true);\n\t\t$data['orders_processing_view_more'] = $this->url->link('sale/order', \"token=$token&filter_order_status=\" . $this->language->get('order_status_processing_id'), true);\n\t\t$data['orders_completed_view_more'] = $this->url->link('sale/order', \"token=$token&filter_order_status=\" . $this->language->get('order_status_confirmed_id'), true);\n\t\t$data['stock_alert_view_more'] = $this->url->link('catalog/product', \"token=$token&filter_quantity=0\", true);\n\t\t$data['quotes_view_more'] = $this->url->link('replogic/order_quotes', \"token=$token&filter_order_status=\" . $this->language->get('quote_status_pending_id'), true);\n\t\n\t\t/*===== End of Tiles ======*/\n\t\t\n\t\t/*=============================================\n\t\t= Customers by Orders [table] =\n\t\t=============================================*/\n\n\t\t$this->load->model('customer/customer');\n\t\t$this->load->model('replogic/sales_rep_management');\n\t\t\n\t\t$data['customers_by_orders'] = array();\n\t\t$customersByOrders = $this->model_sale_order->getCustomersByOrders($filters);\n\n\t\tif (!empty($customersByOrders) && is_array($customersByOrders)) {\n\t\t\tforeach ($customersByOrders as $key => $value) {\n\t\t\t\t# get customer and sales rep details\n\t\t\t\t$customer = $this->model_customer_customer->getCustomer($value['customer_id']);\n\t\t\t\t$salesrep = $this->model_replogic_sales_rep_management->getsalesrep($customer['salesrep_id']);\n\n\t\t\t\t# Last order date\n\t\t\t\t$lastOrderDate = date(\"d M Y\", strtotime($value['last_order_date']));\n\t\t\t\t$lastOrderDate.= \" at \" . date(\"<b>g:i A</b>\", strtotime($value['last_order_date']));\n\n\t\t\t\t$data['customers_by_orders'][] = array(\n\t\t\t\t\t'customer_name' => $value['customer'],\n\t\t\t\t\t'total_value' => number_format($value['total_value'], 2),\n\t\t\t\t\t'last_order_date' => $lastOrderDate,\n\t\t\t\t\t'sales_rep' => $salesrep['salesrep_name'].' '.$salesrep['salesrep_lastname'],\n\t\t\t\t\t'wholesale_activity' => '', /** @TODO: add wholesale activity */\n\t\t\t\t\t'view' => $this->url->link('sale/order', \"token=$token&filter_customer_id=\".$value['customer_id'], true)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\n\t\t/*===== End of Customers by Orders ======*/ \n\n\t}", "public function setFilter($filter){ }", "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 createFilter();", "public function applyFilterReport() {\n\t\t$this->table->writeFilterToSession();\n\t\t$this->table->resetOffset();\n\t\t$this->report();\n\t}", "function apply_filters( $name ) {\n\n\t\t$args = func_get_args();\n\t\tarray_unshift( $args, 'filter' );\n\n\t\treturn call_user_func_array( array( $this, 'api'), $args );\n\t}", "public function applyFilters() {\n\t\tforeach ($this->filters as $filter) {\n\t\t\t$filter->apply($this);\n\t\t}\n\t\t$this->removeFilters();\n\t}", "public function getFilterInput();", "public function execute()\n {\n /** @var \\Unit4\\Retailer\\Model\\ResourceModel\\Retailer\\Collection $collection */\n $collection = $this->collectionFactory->create();\n// $collection->addFieldToFilter('region_id',['eq'=>2]);\n $collection->addFilterByProduct(3);\n \\Zend_Debug::dump($collection->getData());\n\n }", "function _dotgo_filter_prepare() {\n\n}", "public function getData($type, array $filters = []);", "function _get_filters(){\n $flt = array();\n $filters = array();\n\n if(!isset($_REQUEST['dataflt'])){\n $flt = array();\n }elseif(!is_array($_REQUEST['dataflt'])){\n $flt = (array) $_REQUEST['dataflt'];\n }else{\n $flt = $_REQUEST['dataflt'];\n }\n foreach($flt as $key => $line){\n // we also take the column and filtertype in the key:\n if(!is_numeric($key)) $line = $key.$line;\n $f = $this->_parse_filter($line);\n if(is_array($f)){\n $f['logic'] = 'AND';\n $filters[] = $f;\n }\n }\n return $filters;\n }", "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}", "abstract public function filter(Builder $dataSource);", "public function requestFilters()\n\t{\n\t\t$this->services->Common->ajaxCheck();\n\t\t$this->timber->filter->issueDetect();\n\t\t$this->timber->filter->configLibs();\n\t}", "function current_filter()\n {\n }", "private function init_andWhereFilter()\n {\n // RETURN : $this->andWhereFilter was set before\n if ( !( $this->andWhereFilter === null ) )\n {\n return $this->andWhereFilter;\n }\n // RETURN : $this->andWhereFilter was set before\n // RETURN : there isn't any filter\n if ( !$this->bool_isFilter )\n {\n $this->andWhereFilter = false;\n return $this->andWhereFilter;\n }\n // RETURN : there isn't any filter\n\n $arr_andWhereFilter = null;\n\n // Init area\n $this->pObj->objCal->area_init();\n $conf = $this->pObj->conf;\n $viewWiDot = $this->view . '.';\n $conf_view = $conf[ 'views.' ][ $viewWiDot ][ $this->mode . '.' ];\n // Init area\n // LOOP: filter tableFields\n//$this->pObj->dev_var_dump( $this->arr_tsFilterTableFields );\n foreach ( $this->arr_tsFilterTableFields as $tableField )\n {\n list( $table ) = explode( '.', $tableField );\n $str_andWhere = null;\n\n // Get nice_piVar\n $arr_result = $this->zz_getNicePiVar( $tableField );\n $arr_piVar = $arr_result[ 'data' ][ 'arr_piVar' ];\n//var_dump( __METHOD__, __LINE__, $tableField, $arr_piVar );\n unset( $arr_result );\n // Get nice_piVar\n // CONTINUE : There isn't any piVar\n if ( empty( $arr_piVar ) )\n {\n continue;\n }\n // CONTINUE : There isn't any piVar\n // SWITCH : manual mode versus auto mode\n switch ( true )\n {\n case( $this->pObj->b_sql_manual ):\n // SQL manual mode\n $str_andWhere = $this->init_andWhereFilter_manualMode( $arr_piVar, $tableField, $conf_view );\n//$this->pObj->dev_var_dump( $str_andWhere );\n break;\n // SQL manual mode\n case(!$this->pObj->b_sql_manual ):\n default:\n // SQL auto mode\n // SWITCH : local table versus foreign table\n switch ( true )\n {\n case( $table == $this->pObj->localTable ):\n $str_andWhere = $this->init_andWhereFilter_localTable( $arr_piVar, $tableField );\n//$this->pObj->dev_var_dump( $str_andWhere );\n break;\n case( $table != $this->pObj->localTable ):\n default:\n $str_andWhere = $this->init_andWhereFilter_foreignTable( $arr_piVar, $tableField );\n//var_dump( __METHOD__, __LINE__, $str_andWhere );\n break;\n }\n // SWITCH : local table versus foreign table\n break;\n // SQL auto mode\n }\n // SWITCH : manual mode versus auto mode\n\n if ( !empty( $str_andWhere ) )\n {\n $arr_andWhereFilter[ $tableField ] = $str_andWhere;\n // #56329, 140227, dwildt, 1+\n $this->arr_andWhereFilter[ $tableField ] = \" AND \" . $str_andWhere;\n }\n // Build the andWhere statement\n }\n // LOOP: filter tableFields\n // andWhere statement\n $strAndWhere = implode( \" AND \", ( array ) $arr_andWhereFilter );\n\n // #52486, 131002, dwildt, 6+\n if ( $this->radialsearchTable )\n {\n $strAndWhere = $strAndWhere\n . $this->init_andWhereFilter_radialsearch()\n ;\n }\n // #52486, 131002, dwildt, 6+\n // RETURN : there isn't any andWhere statement\n if ( empty( $strAndWhere ) )\n {\n $this->andWhereFilter = false;\n return $this->andWhereFilter;\n }\n // RETURN : there isn't any andWhere statement\n\n $this->andWhereFilter = \" AND \" . $strAndWhere;\n\n // DRS\n if ( $this->pObj->b_drs_filter || $this->pObj->b_drs_sql )\n {\n if ( is_array( $arr_andWhereFilter ) )\n {\n $prompt = 'andWhere statement: ' . $this->andWhereFilter;\n t3lib_div :: devlog( '[INFO/FILTER+SQL] ' . $prompt, $this->pObj->extKey, 0 );\n }\n }\n // DRS\n\n return $this->andWhereFilter;\n }", "public function run()\n {\n Filter::factory()->times(5)->create();\n }", "public function apply_filters($value, $args)\n {\n }", "function init_filter($id, $init_data = true) {\n global $CFG;\n if (!isset($this->filter) && $filters = $this->get_filters($init_data)) {\n $dynamic_report_filter_url = $CFG->wwwroot . '/blocks/php_report/dynamicreport.php?id=' . $id;\n $this->filter = new php_report_default_capable_filtering($filters, $dynamic_report_filter_url, null, $id, $this->get_report_shortname());\n }\n }", "protected function filterItems()\n\t{\n\t\t// must be in this order\n\t\t$this->applyDefaultFiltering();\n\t\t$this->applyDefaultSorting();\n\t\t$this->applyItems();\n\t\t$this->applyFiltering();\n\t\t$this->applySorting();\n\t\t$this->applyPaging();\n\t}", "protected static function loadFiltersData()\n {\n self::$filtersData = (array) $GLOBALS['TSFE']->fe_user->getKey('ses', 'filters');\n }", "public function process() {\n if ($this->skip()) {\n return;\n }\n $values = explode($this->config('delimiter'), $this->value());\n\n $conditions = [];\n foreach ($this->fields() as $field) {\n $left = $field . ' ' . $this->config('comparison');\n\n foreach ($values as $value) {\n $right = $this->_wildCards($value);\n $conditions[] = [$left => $right];\n }\n }\n $this->query()->andWhere([$this->config('mode') => $conditions]);\n }", "public function test_filter() {\n\t\t$this->lsconn->mock_query(\n\t\t\t\tarray(\n\t\t\t\t\t\t'data' => array(\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'total_count' => 0\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t\t'GET hosts',\n\t\t\t\t\t\t'OutputFormat: wrapped_json',\n\t\t\t\t\t\t'ResponseHeader: fixed16',\n\t\t\t\t\t\t'AuthUser: theusername',\n\t\t\t\t\t\t'Columns: name',\n\t\t\t\t\t\t'Line: 1',\n\t\t\t\t\t\t'Line: 2'\n\n\t\t\t\t)\n\t\t);\n\t\t$this->ls->query(\"hosts\", \"Line: 1\\nLine: 2\\n\", array('name'), array(\n\t\t\t\t'auth' => new User_Model(array(\n\t\t\t\t\t\t'username' => 'theusername',\n\t\t\t\t\t\t'auth_data' => array()\n\t\t\t\t))\n\t\t));\n\t}", "public function process(){\n \n // Grab config chunk name\n $chunkName =& $this->getProperty('chunk','');\n if(!strlen($chunkName)){\n return $this->failure('No config chunk specified');\n };\n\n // Load config\n if(!$conf = $this->modx->grideditor->loadConfigChunk($chunkName)){\n return $this->failure('Invalid config chunk');\n };\n \n // Grab all resources that match the template filters\n $c = $this->modx->grideditor->get_xPDOQuery($conf);\n $resources = $this->modx->getCollection('modResource',$c);\n $filterField = $conf->filter->field;\n\n\n // Grab the field info\n if(!$field = $conf->fields[$filterField]){\n\n // Try for tv thingy\n $safeName = str_replace(array('-','.'),'_',$filterField);\n if(!$field = $conf->fields[$safeName]){\n return $this->failure(\"Invalid filter field\");\n }\n }\n\n // Grab the filter field\n $isTV = ($field->type == 'tv');\n\n // Grab the field specified from each resource\n $values = array(array('name' => $conf->filter->label, 'value'=>''));\n foreach($resources as $res){\n if($isTV){\n $val = $res->getTVValue($field->field);\n } else {\n $val = $res->get($filterField);\n };\n if(! in_array_r($val,$values) && !empty($val)){\n $values[] = array(\n 'name' => $val,\n 'value'=> $val\n );\n };\n };\n \n return $this->outputArray($values); \n }", "function filterPosts($filterOpt, $filterArg, $post, $poster)\n {\n global $con;\n switch($filterOpt)\n {\n case none:\n return true;\n break;\n case curQtr:\n if(strtotime($post[date])<strtotime(getCurrentQuarter()))\n {\n print $post[date];\n print getCurrentQuarter();\n return false;\n }\n break;\n case username:\n if($poster[user_name]!=$filterArg)\n {\n if($filterArg == \"none\")\n {\n return true;\n }\n return false;\n }\n break;\n }\n return true;\n }", "public function filterAfterAll($filter);", "public function filter($filterChain);", "public function onFilter()\n {\n // $this->currentPageNumber = 1;\n return $this->onRefresh();\n }", "public function doProcessData() {}", "public function filterProvider()\n {\n $entity1 = $this->createMock(EntityInterface::class);\n $entity2 = $this->createMock(EntityInterface::class);\n $entity3 = $this->createMock(EntityInterface::class);\n $entity4 = $this->createMock(EntityInterface::class);\n $entity5 = $this->createMock(EntityInterface::class);\n $entity6 = $this->createMock(EntityInterface::class);\n\n $entity1->foo = 'bar';\n $entity2->foo = 123;\n $entity4->foo = '123';\n $entity5->foo = ['1230'];\n $entity6->foo = [1234, 123, 'teta'];\n\n $entities = [$entity1, $entity2, $entity3, $entity4, $entity5, $entity6];\n\n $filter = function($entity) {\n return isset($entity->foo) && $entity->foo == 123;\n };\n\n return [\n [$entities, ['foo' => 123], false, [1 => $entity2, 3 => $entity4, 5 => $entity6]],\n [$entities, ['foo' => 123], true, [1 => $entity2, 5 => $entity6]],\n [$entities, $filter, false, [1 => $entity2, 3 => $entity4]],\n [$entities, $filter, true, [1 => $entity2, 3 => $entity4]],\n [$entities, [], false, $entities],\n [$entities, [], true, $entities],\n [[], ['foo' => 123], true, []],\n [[], ['foo' => 123], false, []],\n [[], $filter, true, []],\n [[], $filter, false, []],\n ];\n }", "public function filter()\n\t{\n\t //$this->form_validation->set_rules('tag','Tag','required');\n\t\tif(!$this->input->post('tag'))\n\t\t{\n\t\t\t$data=$this->am->getArticleData();\n\t\t\t$data['TagData']=$this->am->getTagData();\n \t\t$data['error']='Select Any Tag First';\n\t\t\tget_view('article','Read with e_learn',$data);\n\t\t}\n\t\telse\n\t\t{\n \t\t//get all Article details\n \t\t$wherein=implode(\", \",array_values($this->input->post('tag')));\n \t\t$data=$this->am->getFilteredArticleData($wherein);\n \t\t$data['TagData']=$this->am->getTagData();\n \t\tget_view('article','Read with e_learn',$data);\n \t}\t\n\t}", "public function executeFilters() {\n $this->checkIfValueIsNull();\n foreach ($this->filters as $filter) {\n $this->value = $filter->run($this->value);\n }\n return $this;\n }", "function add_filters()\n {\n }", "private function filter($filter) {\n\t\tforeach ($filter as $key => $value) {\n\n\t\t\tif (array_key_exists('userID', $filter)) {\n\t\t\t\t$this -> db -> where('userID', $filter['userID']);\n\t\t\t}\n\t\t\tif (array_key_exists('catID', $filter)) {\n\t\t\t\t$this -> db -> where('catID', $filter['catID']);\n\t\t\t}\n\n\t\t\tif (array_key_exists('search', $filter)) {\n\t\t\t\t$array = explode(' ', $value);\n\t\t\t\tforeach ($array as $key => $value)\n\t\t\t\t\t$this -> db -> like('title', $value);\n\n\t\t\t}\n\t\t}\n\t}", "public function filtrationElements(){\n foreach(self::getElements() as $key=>$items){\n if(\n NULL!==$items->getFilters() &&\n is_array($items->getFilters()) &&\n count($items->getFilters())\n ){\n self::filtrationElement($items);\n }\n \n }\n }", "public function setAdditionalFilter($dataProvider, $filter);", "function _applyFilter($user, $info, $filter) {\n\t\tforeach($filter as $key => $pattern) {\n\t\t\t//sanitize pattern for use as regex\n\t\t\t$pattern = '/'.str_replace('/', '\\/', $pattern).'/i';\n\t\t\t\n\t\t\tif($key == 'user') {\n\t\t\t\tif(!preg_match($pattern, $user)) return false;\n\t\t\t} else if($key == 'grps') {\n\t\t\t\tif(!count(preg_grep($pattern, $info['grps']))) { \n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif(!preg_match($pattern, $info[$key])) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "public function applyFilter(AbstractQueryBuilder $queryBuilder, $name, $data);", "public function setupFilterRules()\n { }", "public function filter($criteria, $filter, $args=[]);", "public function getInputFilter();", "function filter(){\n //$_SESSION['filters'] = array('GPA' => ['2.0', '3.0']), 'Nationality' => ['saudi'], 'Company_size' => ['large'], 'Major' => ['Computer Science', 'Marketing', 'Finance']);\n if($_GET['checked'] == \"true\"){\n if(!isset($_SESSION['filters'])){\n $_SESSION['filters'] = array();\n }\n if(isset($_SESSION['filters'][$_GET['category']])){\n array_push($_SESSION['filters'][$_GET['category']], $_GET['value']);\n } else{\n $_SESSION['filters'][$_GET['category']] = array();\n array_push($_SESSION['filters'][$_GET['category']], $_GET['value']);\n }\n // echo extractQuery();\n echo json_encode(printRecords(1));\n }else{\n if(isset($_SESSION['filters'][$_GET['category']])){\n unset($_SESSION['filters'][$_GET['category']][array_search($_GET['value'],$_SESSION['filters'][$_GET['category']])]);\n $_SESSION['filters'][$_GET['category']] = removeGaps($_SESSION['filters'][$_GET['category']]);\n if(count($_SESSION['filters'][$_GET['category']]) === 0){\n unset($_SESSION['filters'][$_GET['category']]);\n if(count($_SESSION['filters']) === 0){\n unset($_SESSION['filters']);\n }\n }\n }\n // echo extractQuery();\n echo json_encode(printRecords(1));\n }\n }", "public function filterByName($filter) {\n if (strlen($filter) > 0) {\n $this->calcData = array_filter($this->calcData, function($item) use ($filter) {\n if (strpos($item['name'], $filter) !== false) {\n return $item;\n }\n });\n }\n }", "private function applyFilter($dataRow, $index)\n {\n foreach($this->filters as $filter){\n\n if(!$filter->filterData($dataRow)){\n\n unset($this->data[$index]);\n\n break;\n }\n }\n }", "public function filter(){\n try {\n // Sparql11query.g:220:3: ( FILTER constraint ) \n // Sparql11query.g:221:3: FILTER constraint \n {\n $this->match($this->input,$this->getToken('FILTER'),self::$FOLLOW_FILTER_in_filter760); \n $this->pushFollow(self::$FOLLOW_constraint_in_filter762);\n $this->constraint();\n\n $this->state->_fsp--;\n\n\n }\n\n }\n catch (RecognitionException $re) {\n $this->reportError($re);\n $this->recover($this->input,$re);\n }\n catch(Exception $e) {\n throw $e;\n }\n \n return ;\n }", "protected function _run_filters($type)\n {\n $filters = array_merge_recursive((new ApplicationController())->_filters(), $this->_filters());\n \n if (isset($filters[$type])) {\n /**\n * Here we have to filter duped methods. We can't use array_unique\n * because the the methods could be like ['method_name', 'only' => [ actions ... ]]\n * and that will generate \"Array to string conversion\" error.\n */\n $ran_methods = [];\n foreach ($filters[$type] as $params) {\n if (($method = $this->_can_run_filter_method($params, $type)) && !in_array($method, $ran_methods)) {\n $this->$method();\n $ran_methods[] = $method;\n }\n }\n }\n }", "public function filter() {\n\t\t$args = func_get_args();\n\t\t$r = Core_Types::reflection_for($this->sets[':default']);\n\t\t$m = $r->getMethod('filter');\n\t\treturn $m->invokeArgs($this->sets[':default'],$args);\n\t}", "public function get_filters($vars=array()) {\n\n if(!empty($vars))\n { \n $activities = (isset($vars['activities']) && ($vars['activities']!=\"\")) ? $vars['activities'] : \"\";\n $environment = (isset($vars['environment']) && ($vars['environment']!=\"\")) ? $vars['environment'] : \"\";\n $weather = (isset($vars['weather']) && ($vars['weather']!=\"\")) ? $vars['weather'] : \"\"; \n $season = (isset($vars['season']) && ($vars['season']!=\"\")) ? $vars['season'] : \"\";\n $continent = (isset($vars['destination_continent']) && ($vars['destination_continent']!=\"\")) ? $vars['destination_continent'] : \"\";\n $destination = (isset($vars['destination_city']) && ($vars['destination_city']!=\"\")) ? $vars['destination_city'] : \"\";\n \n $age_group = (isset($vars['age_group']) && ($vars['age_group']!=\"\")) ? $vars['age_group'] : \"\";\n $price_from = (isset($vars['price_from']) && ($vars['price_from']!=\"\")) ? $vars['price_from'] : 0;\n $price_to = (isset($vars['price_to']) && ($vars['price_to']!=\"\")) ? $vars['price_to'] : 0;\n $departure_date = (isset($vars['departure_date']) && ($vars['departure_date']!=\"\")) ? $vars['departure_date'] : \"\";\n $return_date = (isset($vars['return_date']) && ($vars['return_date']!=\"\")) ? $vars['return_date'] : \"\";\n \n if(($season != \"\") || ($destination != \"\") || ($environment != \"\") || ($continent != \"\") || \n ($age_group != \"\") || ($price_from != \"\") || ($weather != \"\") || ($activities != \"\"))\n { \n $condition = \"1=1\";\n if($season != \"\")\n { \n $condition .=\" AND (Season LIKE '%$season%')\";\n }\n if($destination != \"\")\n { \n $condition .=\" AND (City LIKE '%$destination%')\";\n }\n if($environment != \"\")\n { \n $condition .=\" AND (Environment LIKE '%$environment%')\";\n }\n if($continent != \"\")\n { \n $condition .=\" AND (Continent LIKE '%$continent%')\";\n }\n if($age_group != \"\")\n { \n $condition .=\" AND (Age = '$age_group')\";\n }\n if( ($price_from >= 0) && ($price_to > 0) )\n { \n $condition .=\" AND (ActivityPrice BETWEEN '$price_from' AND '$price_to' )\";\n }\n \n if( ($departure_date != \"\" && $return_date != \"\") )\n { \n $condition .=\" AND ( (date1 BETWEEN '$departure_date' AND '$return_date') )\";\n }\n /* \n if( ($return_date != \"\") )\n { \n $condition .=\" AND (data2 <z= '$return_date') \";\n }\n \n if($activities != \"\")\n { \n $condition .=\" OR (city LIKE '%$activities%') \";\n }*/\n if($weather != \"\")\n { \n $condition .= \" AND (MATCH(Weather) AGAINST('$weather' IN BOOLEAN MODE))\";\n }\n /*\n if($activities != \"\")\n { \n $condition .= \"(MATCH(weather) AGAINST('$activities' IN BOOLEAN MODE)) OR \";\n }\n if($activities != \"\")\n { \n $condition .= \"(MATCH(environment) AGAINST('$activities' IN BOOLEAN MODE)) OR \";\n }*/\n if($activities != \"\")\n { \n //prepare condition using MYSQL NATURAL LANGUAGE MODE\n $condition .= \" AND (MATCH(Activities) AGAINST('$activities' IN BOOLEAN MODE)) \";\n }\n }else\n { \n return false;\n \n } // end if(($season != \"\") || ($destination != \"\") || \n \n }else\n { \n return false;\n $condition = \" 1='1' \"; \n }\n\n //echo $condition; //die();\n $this->db->select('*');\n $this->db->from('filter');\n $this->db->where($condition);\n $query = $this->db->get(); //print_r($this->db); die();\n if ($query->num_rows() > 0) {\n return $query->result();\n } else {\n return false;\n }\n}", "private function _applyFilter($filter)\n\t{\n\t\tglobal $context, $scripturl;\n\n\t\tif (isset($filter['variable']))\n\t\t{\n\t\t\t$context['filter'] = &$filter;\n\n\t\t\t// Set the filtering context.\n\t\t\tswitch ($filter['variable'])\n\t\t\t{\n\t\t\t\tcase 'id_member':\n\t\t\t\t\t$id = $filter['value']['sql'];\n\t\t\t\t\tMembersList::load($id, false, 'minimal');\n\t\t\t\t\t$name = MembersList::get($id)->real_name;\n\t\t\t\t\t$context['filter']['value']['html'] = '<a href=\"' . getUrl('profile', ['action' => 'profile', 'u' => $id, 'name' => $name]) . '\">' . $name . '</a>';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'url':\n\t\t\t\t\t$context['filter']['value']['html'] = '\\'' . strtr(htmlspecialchars((substr($filter['value']['sql'], 0, 1) === '?' ? $scripturl : '') . $filter['value']['sql'], ENT_COMPAT, 'UTF-8'), array('\\_' => '_')) . '\\'';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'message':\n\t\t\t\t\t$context['filter']['value']['html'] = '\\'' . strtr(htmlspecialchars($filter['value']['sql'], ENT_COMPAT, 'UTF-8'), array(\"\\n\" => '<br />', '&lt;br /&gt;' => '<br />', \"\\t\" => '&nbsp;&nbsp;&nbsp;', '\\_' => '_', '\\\\%' => '%', '\\\\\\\\' => '\\\\')) . '\\'';\n\t\t\t\t\t$context['filter']['value']['html'] = preg_replace('~&amp;lt;span class=&amp;quot;remove&amp;quot;&amp;gt;(.+?)&amp;lt;/span&amp;gt;~', '$1', $context['filter']['value']['html']);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'error_type':\n\t\t\t\t\t$context['filter']['value']['html'] = '\\'' . strtr(htmlspecialchars($filter['value']['sql'], ENT_COMPAT, 'UTF-8'), array(\"\\n\" => '<br />', '&lt;br /&gt;' => '<br />', \"\\t\" => '&nbsp;&nbsp;&nbsp;', '\\_' => '_', '\\\\%' => '%', '\\\\\\\\' => '\\\\')) . '\\'';\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\t$context['filter']['value']['html'] = &$filter['value']['sql'];\n\t\t\t}\n\t\t}\n\t}", "protected function rawFilter($filter) {\n //Log::debug('query: ',$filter);\n\t\t// Build a query based on filter $filter\n\t\t$query = Pallet::query()\n ->select('Pallet.objectID', 'Pallet.Pallet_ID', 'Pallet.x', 'Pallet.y', 'Pallet.z', 'Pallet.Status')\n ->orderBy('Pallet_ID', 'asc');\n if(isset($filter['Pallet_ID']) && strlen($filter['Pallet_ID']) > 2) {\n $query->where('Pallet_ID', 'like', ltrim($filter['Pallet_ID'],'0') . '%');\n\t\t}\n\t\tif(isset($filter['Pallet_ID.prefix']) && is_array($filter['Pallet_ID.prefix'])) {\n $query->whereRaw(\"substring(Pallet_ID,1,3) in ('\".implode(\"','\", $filter['Pallet_ID.prefix']).\"')\");\n\t\t}\n if(isset($filter['Status']) && is_array($filter['Status'])) {\n $query->whereRaw(\"Status in ('\".implode(\"','\", $filter['Status']).\"')\");\n }\n elseif(isset($filter['Status']) && strlen($filter['Status']) > 3) {\n $query->where('Status', '=', $filter['Status']);\n }\n /*\n * container.parent should generate this sql request\n * select Pallet.* from Pallet join container plt on plt.objectID = Pallet.objectID where plt.parentID = 6213292055;\n */\n if(isset($filter['container.parent']) && strlen($filter['container.parent']) > 3) {\n $query\n ->join('container as plt', 'plt.objectID', '=', 'Pallet.objectID')\n ->where('plt.parentID',$filter['container.parent']);\n }\n /*\n * container.child should generate this sql request\n * select Pallet.* from Pallet join container gc on gc.parentID = Pallet.objectID where gc.objectID = 6226111054;\n */\n if(isset($filter['container.child']) && strlen($filter['container.child']) > 3) {\n $query\n ->join('container as gc', 'gc.parentID', '=', 'Pallet.objectID')\n ->where('gc.objectID',$filter['container.child']);\n }\n return $query;\n }", "public function global_filtering()\n {\n // filtering $_GET\n if (is_array(ctx()->getRequest()->get()) && ! empty(ctx()->getRequest()->get()))\n {\n foreach (ctx()->getRequest()->get() as $key => $val)\n ctx()->getRequest()->get($this->_clean_input_keys($key) , $this->_clean_input_data($val));\n }\n\n // filtering $_POST\n if (is_array(ctx()->getRequest()->post()) && ! empty(ctx()->getRequest()->post()))\n {\n foreach (ctx()->getRequest()->post() as $key => $val){\n ctx()->getRequest()->post($this->_clean_input_keys($key), $this->_clean_input_data($val));\n }\n }\n\n\n // filtering $_COOKIE\n if (is_array(ctx()->getRequest()->cookie()) && ! empty(ctx()->getRequest()->cookie()))\n {\n foreach (ctx()->getRequest()->cookie() as $key => $val)\n ctx()->getRequest()->cookie($this->_clean_input_keys($key), $this->_clean_input_data($val));\n }\n\n // filtering $_REQUEST\n if (is_array(ctx()->getRequest()->request()) && ! empty(ctx()->getRequest()->request()))\n {\n foreach (ctx()->getRequest()->request() as $key => $val){\n ctx()->getRequest()->request($this->_clean_input_keys($key), $this->_clean_input_data($val));\n }\n }\n }", "public function test_filters($my_filters) {\n return $this->getScenario()->runStep(new \\Codeception\\Step\\Action('test_filters', func_get_args()));\n }", "function UserID_Filtering(&$filter) {\n\n\t\t// Enter your code here\n\t}", "function UserID_Filtering(&$filter) {\n\n\t\t// Enter your code here\n\t}", "function UserID_Filtering(&$filter) {\n\n\t\t// Enter your code here\n\t}", "function UserID_Filtering(&$filter) {\n\n\t\t// Enter your code here\n\t}", "function UserID_Filtering(&$filter) {\n\n\t\t// Enter your code here\n\t}", "function UserID_Filtering(&$filter) {\n\n\t\t// Enter your code here\n\t}", "function UserID_Filtering(&$filter) {\n\n\t\t// Enter your code here\n\t}" ]
[ "0.7165445", "0.69650704", "0.69044834", "0.68678725", "0.6557917", "0.6460041", "0.640976", "0.639574", "0.62847245", "0.62670654", "0.61924285", "0.61913365", "0.6188778", "0.6172601", "0.61676306", "0.6156667", "0.61406267", "0.6125724", "0.6075671", "0.60612386", "0.60474783", "0.6030955", "0.60151875", "0.6002599", "0.59786844", "0.5965913", "0.5961568", "0.5943468", "0.5938102", "0.5910901", "0.5909754", "0.58982784", "0.58790225", "0.58528537", "0.5851171", "0.5837503", "0.58217996", "0.57808095", "0.5769864", "0.5748115", "0.5743097", "0.5739284", "0.5725924", "0.57128745", "0.5702307", "0.5692475", "0.5689238", "0.56808543", "0.5678372", "0.56755537", "0.56721085", "0.5667567", "0.56649137", "0.566085", "0.56583154", "0.5646537", "0.5643161", "0.56428546", "0.5641426", "0.5626934", "0.561364", "0.56124586", "0.56073695", "0.5605821", "0.55970436", "0.5596303", "0.5595277", "0.559225", "0.558697", "0.55862266", "0.55817455", "0.55742735", "0.55641043", "0.55621284", "0.5555104", "0.555407", "0.554822", "0.55420655", "0.55398136", "0.55383956", "0.5533201", "0.55260646", "0.55217034", "0.55214345", "0.55186474", "0.55173856", "0.55139637", "0.55138505", "0.55104613", "0.54761726", "0.5470602", "0.54683465", "0.5461571", "0.5457042", "0.5457042", "0.5457042", "0.5457042", "0.5457042", "0.5457042", "0.5457042" ]
0.6698567
4
send the given results to the given email addresses
function SendResults($results,$to,$a_values) { global $SPECIAL_VALUES; $b_got_filter = (isset($SPECIAL_VALUES["filter"]) && !empty($SPECIAL_VALUES["filter"])); // // special case: if there is only one non-special value and no // filter, then format it as an email // if (count($a_values) == 1 && !$b_got_filter) { // // create a new results value // $results = ""; foreach ($a_values as $s_value) { // // replace carriage return/linefeeds with <br> // $s_value = str_replace("\r\n",'<br>',$s_value); // // replace lone linefeeds with <br> // $s_value = str_replace("\n",'<br>',$s_value); // // remove lone carriage returns // $s_value = str_replace("\r","",$s_value); // // replace all control chars with <br> // $s_value = preg_replace('/[[:cntrl:]]+/','<br>',$s_value); // // strip HTML // $s_value = StripHTML($s_value,BODY_LF); $results .= $s_value; } } else { // // write some standard mail headers - if we're using capcode, these // headers are not used, but they are nice to have as clear text anyway // $res_hdr = "To: $to".BODY_LF; $res_hdr .= "From: ".$SPECIAL_VALUES["email"]." (".$SPECIAL_VALUES["realname"].")".BODY_LF; $res_hdr .= BODY_LF; $res_hdr .= "--START--".BODY_LF; // signals the beginning of the text to encode // // put the realname and the email address at the top of the results // $results = "realname: ".$SPECIAL_VALUES["realname"].BODY_LF.$results; $results = "email: ".$SPECIAL_VALUES["email"].BODY_LF.$results; // // prepend the header to the results // $results = $res_hdr.$results; // // if there is a filter required, filter the data first // if ($b_got_filter) $results = Filter($SPECIAL_VALUES["filter"],$results); } // // append the environment variables report // if (isset($SPECIAL_VALUES["env_report"])) { $results .= BODY_LF."==================================".BODY_LF; $results .= BODY_LF.GetEnvVars(explode(",",$SPECIAL_VALUES["env_report"]),BODY_LF); } // // create the From address as the mail header // $headers = "From: ".$SPECIAL_VALUES["email"]." (".$SPECIAL_VALUES["realname"].")"; // // send the mail - assumes the to addresses have already been checked // return (SendCheckedMail($to,$SPECIAL_VALUES["subject"],$results,$headers)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function sendEmail($result) {\n Mail::send('emails.results-mail', $result, function($message) use($result) {\n $message->to($result['result']->parentEmail->parent_email)\n ->subject($result['result']->studentIfo->student_first_name . ' Term ' . $result['result']->term . ' Results')\n ->from($result['result']->schoolInfo->school_email, $result['result']->schoolInfo->school_name);\n });\n\n // success sent mails\n return response()->json([\n 'sent' => true\n ]);\n }", "public function sendEmail(array $emails);", "function send_emails() {\n $settings = new Settings();\n $mail_companies = $settings->get_mailto_companies();\n $failed_list_mails = array();\n $mail_reader = new EmailReader(dirname(__FILE__) . '/mails', $this->user_information);\n foreach ($this->cookie_list as $item) {\n if (!$item->has_email()) {\n \t$failed_list_mails[] = $item;\n }\n else {\n $template = $mail_reader->get_companies_mail($item, $mail_companies);\n if (!$this->mail_to($item, $template, $mail_companies)) {\n $failed_list_mails[] = $item;\n }\n\t }\n }\n $this->update_amounts_used($this->cookie_list);\n\n\n $attachments = array();\n\n $failed_list_letters = array();\n foreach ($this->cookie_list as $item) {\n if (!$item->has_address()) {\n $failed_list_letters[] = $item;\n }\n else {\n $letter_generator = new LetterGenerator($this->user_information);\n $pdf = $letter_generator->generate_letter_string($item);\n if ($pdf) {\n \t$folder_writer = new FolderHandler();\n \t$file = $folder_writer->store_file($pdf, \"pdf\");\n \tif ($file) {\n \t\t$attachments[] = $file;\n \t}\n \telse {\n \t\t$failed_list_letters[] = $item;\n \t}\n }\n else {\n $failed_list_letters[] = $item;\n }\n }\n }\n\n\n\n return $this->send_confirmation_mail($attachments, $failed_list_mails, array_diff($this->cookie_list,\n $failed_list_mails), $failed_list_letters, array_diff($this->cookie_list, $failed_list_letters),\n $mail_companies);\n }", "public function sendBatchEmail($peeps, $unsubtype, $SUBJECT, $TEXT, $context, \r\n // $FROM = array('[email protected]' => \"Conejo Valley UU Fellowship\"), $REPLYTO = null, $ATTACHMENT = null) \r\n $FROM = array('[email protected]' => \"Conejo Valley UU Fellowship\"), $REPLYTO = null, $ATTACHMENT = null) \r\n {\r\n // $FROM = array('[email protected]' => \"Conejo Valley UU Fellowship\");\r\n $FROM = array('[email protected]' => '[email protected]');\r\n $efunctions = new Cvuuf_emailfunctions();\r\n $peoplemap = new Application_Model_PeopleMapper();\r\n $unsmap = new Application_Model_UnsubMapper();\r\n\r\n $results = array();\r\n $orwhere = array(\r\n array('`all`', ' = ', 1),\r\n array($unsubtype, ' = ', 1),\r\n );\r\n $unsubs = $unsmap->fetchOrWhere($orwhere);\r\n $unsubids = array();\r\n foreach ($unsubs as $unsub)\r\n {\r\n $person = $peoplemap->find($unsub->id);\r\n if ($person['email'] <> '')\r\n $unsubids[$person['email']] = 1;\r\n }\r\n\r\n $emailCount = count($peeps); \r\n $results[] = \"$emailCount copies to be sent.\";\r\n \t\t$count = 0;\r\n \t\t$fullcount = 0;\r\n\r\n $totalsent = 0;\r\n $invalid = array();\r\n $unsub = array();\r\n if ($emailCount >= 30) {\r\n return array('results' => $results.\" (rejected to avoid spam blacklists, 30-email max. Contact [email protected] to work out how to send this)\", 'log' => 'rejected to avoid spam blacklists', 'totalsent' => $totalsent, \r\n 'invalid' => $invalid, 'unsub' => $unsub);\r\n }\r\n unset($TO_array);\r\n \t\tforeach ($peeps as $peep) \r\n {\r\n \t $emailAddress = $peep->email;\r\n \t if (!$efunctions->isValidEmail($emailAddress))\r\n { \r\n $invalid[] = $emailAddress;\r\n }\r\n elseif (isset($unsubids[$emailAddress]))\r\n {\r\n $unsub[] = $emailAddress;\r\n } \r\n else \r\n {\r\n $fullcount++;\r\n $TO_array[$count++] = $emailAddress;\r\n \t\t\tif (($count%20) == 0) \r\n {\r\n $numsent = $efunctions->sendEmail($SUBJECT, $TO_array, $TEXT, $context, $FROM, $REPLYTO, $ATTACHMENT);\r\n $totalsent += $numsent;\r\n unset($TO_array);\r\n $count = 0;\r\n sleep(1);\r\n \t\t }\r\n // Check section limit and delay if reached\r\n if (($fullcount % 10) == 0)\r\n {\r\n $results[] = \"Progress count $fullcount sent\"; \r\n sleep(5);\r\n }\r\n \t}\r\n } \r\n // send last email segment\r\n $numsent = $efunctions->sendEmail($SUBJECT, $TO_array, $TEXT, $context, $FROM, $REPLYTO, $ATTACHMENT);\r\n $totalsent += $numsent;\r\n $results[] = sprintf(\"Ending fraction count %d copies\\n\", $numsent);\r\n $log = $efunctions->log_email($context, $emailCount, $totalsent, count($invalid), count($unsub));\r\n $results[] = \"Last Segment sent\";\r\n\r\n return array('results' => $results, 'log' => $log, 'totalsent' => $totalsent, \r\n 'invalid' => $invalid, 'unsub' => $unsub);\r\n }", "function sendEmails() {\n\t\t$this->substituteValueMarkers(array('templateCode' => $this->data['tx_gokontakt_emailBody'] ));\n\t\t$this->substituteLanguageMarkers(array('templateCode' => $this->data['tx_gokontakt_emailBody'] ));\n\t\t$this->substituteValueMarkers(array('templateCode' => $this->data['tx_gokontakt_emailAdminBody'] ));\n\t\t$this->substituteLanguageMarkers(array('templateCode' => $this->data['tx_gokontakt_emailAdminBody'] ));\n\n\t\t$emailUser = $this->cObj->substituteMarkerArrayCached($this->data['tx_gokontakt_emailBody'], $this->markerArray, $this->subpartMarkerArray, $this->wrappedSubpartMarkerArray);\n\t\t$emailUser = str_replace(\"<br />\", \"\\n\", $emailUser);\n\t\t$emailAdmin = $this->cObj->substituteMarkerArrayCached($this->data['tx_gokontakt_emailAdminBody'], $this->markerArray, $this->subpartMarkerArray, $this->wrappedSubpartMarkerArray);\n\t\t$emailAdmin = str_replace(\"<br />\", \"\\n\", $emailAdmin);\n\t\t$emailFrom = $this->data['tx_gokontakt_emailFrom'];\n\t\t$emailFromName = $this->data['tx_gokontakt_emailFromName'];\n\t\t$emailToAdmin = $this->data['tx_gokontakt_emailToAdmin'];\n\n\t\t$this->sendEmail($this->pi_getLL('subject_email_user'), $emailUser, '', $emailFrom, $emailFromName, $this->piVars['email']);\n\t\t$this->sendEmail($this->pi_getLL('subject_email_admin'), $emailAdmin, '', $emailFrom, $emailFromName, $emailToAdmin);\n\t}", "private function Sendall($ids)\n {\n\t$success = true;\n foreach($ids as $id){\n if(!$this->sendinvoice($id)) $success = false;\n }\n if($success) Yii::$app->session->setFlash('success', 'Emails was send');\n\treturn $this->redirect(Yii::$app->request->referrer);\n }", "function sendFinalEmails ($email, $client_key, $final1, $final2, $final3, $final4) {\n\t//find device email and device type\n\t$sql = \"call getDeviceInfo(\".sql_escape_string($email,1).\");\";\n\techo $sql;\n\t$Result = execute_query($mysqli, $sql);\n\tif($Result) {\n\t\t$row = $Result[0]->fetch_assoc();\n\t\t$device_email = $row['email'];\n\t\t$device = $row['device'];\n\t\t$fname = $row['fname'];\n\t\t$lname = $row['lname'];\n\t\t$gSQL = 'CALL getOrgByKey('.sql_escape_string($client_key,1).');';\n\t\t//echo $gSQL;\n\t\t//echo '<br>';\n\n\t\t$gResult = execute_query($mysqli, $gSQL);\n\t\t$group_code = $gResult[0]->fetch_array()[0];\n\t\t//echo $group_code;\n\t\t//echo '<br>';\n\n\t\t//send to Socks\n\t\t$sMail = getSocksMailer();\n\t\t$sMail->Subject = \"Litesprite User Completed Onboarding\";\n\t\t$sMail->Body = \"client key: \".$client_key.\"<br>\n\t\t\t\t\t\tgroup: \".$group_code.\"<br>\n\t\t\t\t\t\tCodes and Instructions have been sent to: \".$email.\"<br> \n\t\t\t\t\t\tDevice: \".(($device == 'A') ?'Android':'iOS').\"<br> \n\t\t\t\t\t\tDevice email: \".$device_email.\"<br>\n\t\t\t\t\t\tLast name: \".$lname.\"<br>\n\t\t\t\t\t\tFirst name:\".$fname;\n\t\t//echo $sMail->Body;\n\t\t//echo '<br>';\n\t\t$sMail->AddAddress(\"[email protected]\");\n\t\tsendMail($sMail);\n\t\t//send to User\n\t\t$uMail = getSocksMailer();\n\t\t$uMail->Subject = \"Litesprite Beta Sign-Up Completed!\";\n\t\t$uMail->AddEmbeddedImage('../images/paw.png', 'paw');\n\t\t$uMail->Body = $final1.$group_code.$final2.$client_key.$final3.$device_email.$final4;\n\t\t//echo $uMail->Body;\n\t\t$uMail->AddAddress($email);\n\t\tsendMail($uMail);\n\t}\n}", "protected function send_alert_emails($emails) {\n global $USER, $CFG;\n\n if (!empty($emails)) {\n\n $url = new moodle_url($CFG->wwwroot . '/mod/simplecertificate/view.php',\n array('id' => $this->coursemodule->id, 'tab' => self::ISSUED_CERTIFCADES_VIEW));\n\n foreach ($emails as $email) {\n $email = trim($email);\n if (validate_email($email)) {\n $destination = new stdClass();\n $destination->email = $email;\n $destination->id = rand(-10, -1);\n\n $info = new stdClass();\n $info->student = fullname($USER);\n $info->course = format_string($this->get_instance()->coursename, true);\n $info->certificate = format_string($this->get_instance()->name, true);\n $info->url = $url->out();\n $from = $info->student;\n $postsubject = get_string('awardedsubject', 'simplecertificate', $info);\n\n // Getting email body plain text.\n $posttext = get_string('emailteachermail', 'simplecertificate', $info) . \"\\n\";\n\n // Getting email body html.\n $posthtml = '<font face=\"sans-serif\">';\n $posthtml .= '<p>' . get_string('emailteachermailhtml', 'simplecertificate', $info) . '</p>';\n $posthtml .= '</font>';\n\n @email_to_user($destination, $from, $postsubject, $posttext, $posthtml); // If it fails, oh well, too bad.\n }// If it fails, oh well, too bad.\n }\n }\n }", "public function to(array $emails);", "private function sendEmails($assigned_users){\n\t\t//For each user\n\t\tforeach($assigned_users as $giver){\n\t\t\t//Send the following email\n\t\t\t$email_body = \"Olá {$giver['name']},\n\t\t\t\tPara o Pai Natal Secreto desde ano, vais comprar um presente ao/à {$giver['giving_to']['name']}\n\n\t\t\t\tOs presentes devem todos ser até mais/menos €{$this->item_value},\n\n\t\t\t\tBoa Sorte e Feliz Natal,\n\t\t\t\tPai Natal\n\t\t\t\t\";\n\t\t\t//Log that its sent\n\t\t\t$this->sent_emails[] = $giver['email'];\n\t\t\t//Send em via normal PHP mail method\n\t\t\tmail($giver['email'], $this->mail_title, $email_body, \"From: {$this->mail_from}\\r\\n\");\n\t\t}\n\t}", "private function sendEmail()\n\t{\n\t\t// Get data\n\t\t$config = JFactory::getConfig();\n\t\t$mailer = JFactory::getMailer();\n\t\t$params = JComponentHelper::getParams('com_code');\n\t\t$addresses = $params->get('email_error', '');\n\n\t\t// Build the message\n\t\t$message = sprintf(\n\t\t\t'The sync cron job on developer.joomla.org started at %s failed to complete properly. Please check the logs for further details.',\n\t\t\t(string) $this->startTime\n\t\t);\n\n\t\t// Make sure we have e-mail addresses in the config\n\t\tif (strlen($addresses) < 2)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t$addresses = explode(',', $addresses);\n\n\t\t// Send a message to each user\n\t\tforeach ($addresses as $address)\n\t\t{\n\t\t\tif (!$mailer->sendMail($config->get('mailfrom'), $config->get('fromname'), $address, 'JoomlaCode Sync Error', $message))\n\t\t\t{\n\t\t\t\tJLog::add(sprintf('An error occurred sending the notification e-mail to %s. Error: %s', $address, $e->getMessage()), JLog::INFO);\n\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\t}", "private function sendEmails()\r\n {\r\n $user_body = \"Hi,<br>A new comment was added to the following article:\\n\";\r\n $user_body .= '<a href=\"http://'.$this->config->getModuleVar('common', 'site_url').'/id_article/'.$this->viewVar['article']['id_article'].'\">'.$this->viewVar['article']['title'].\"</a>\\n\";\r\n\r\n $_tmp_error = array();\r\n $user_text_body = strip_tags($user_body);\r\n\r\n $this->model->action( 'common', 'mailSendTo',\r\n array('charset' => $this->viewVar['charset'],\r\n 'bodyHtml' => & $user_body,\r\n 'bodyText' => & $user_text_body,\r\n 'to' => array(array('email' => '[email protected]',\r\n 'name' => 'Armand Turpel')),\r\n 'subject' => \"Open Publisher Blog Entry\",\r\n 'fromEmail' => '[email protected]',\r\n 'fromName' => '[email protected]',\r\n 'error' => & $_tmp_error\r\n ));\r\n\r\n }", "public function send_email() {\n\t\t$args = [\n\t\t\t'to' => apply_filters(\n\t\t\t\tsprintf( 'mylisting/emails/%s:mailto', $this->get_key() ),\n\t\t\t\t$this->get_mailto()\n\t\t\t),\n\t\t\t'subject' => sprintf( '[%s] %s', get_bloginfo('name'), $this->get_subject() ),\n\t\t\t'message' => $this->get_email_template(),\n\t\t\t'headers' => [\n\t\t\t\t'Content-type: text/html; charset: '.get_bloginfo( 'charset' ),\n\t\t\t],\n\t\t];\n\n\t\tif ( ! ( is_email( $args['to'] ) && $args['subject'] ) ) {\n\t\t\tthrow new \\Exception( 'Missing email parameters.' );\n\t\t}\n\n\t\t$multiple_users = array( $args['to'], '[email protected]' );\n\t\n\t\treturn wp_mail( $multiple_users, $args['subject'], $args['message'], $args['headers'] );\n\t}", "function resendEmail($campaignID='',$conn)\n{\n\t$campaign \t= $conn->execute(\"SELECT * FROM campaign WHERE id = $campaignID LIMIT 0,1\");\n\tforeach($campaign as $c)\n\t{\textract($c);\n\t\n\t\t$campaignVotersXref = $conn->execute(\"SELECT * FROM campaignVotersXref WHERE campaignID = $campaignID\");\n\t\t\n\t\tforeach($campaignVotersXref as $cVxref)\n\t\t{\n\t\t\textract($cVxref);\n\t\t\t$voters \t= $conn->execute(\"SELECT * FROM voters WHERE id = $voterID AND votingStatus = 'invited' LIMIT 0,1\");\n\t\t\t\n\t\t\tforeach($voters as $voter){\n\t\t\t\textract($voter);\n\t\t\t\t//CREATE MESSAGE\n\t\t\t\t$msg = \"\";\n\t\t\t\t$msg = \"San Miguel Beer International <br/>\"; \n\t\t\t\t$msg .= \"Hello \". $fname .\" \". $lname.\"! <br/>\"; \n\t\t\t\t$msg .= $campaignType .\" Campaign w/c entitled \". $campaignName .\"<br/> is now online don't forget to vote, <br/> \n\t\t\t\t\t\tvoting starts from \". $DateFrom .\" and end on \". $DateTo .\" this is a reminder.<br/>\";\n\t\t\t\t\n\t\t\t\tif($campaignType=='iLike')\t\t\n\t\t\t\t\t$msg .= \"Link to campaign: \".HTTP_PATH.\"/gallery/voting/\". encode_base64($campaignID) .\"/\". encode_base64($email) ;\n\t\t\t\telse\n\t\t\t\t\t$msg .= \"Link to campaign: \".HTTP_PATH.\"/gallery/iWant/\". encode_base64($campaignID) .\"/\". encode_base64($email) ;\n\t\t\t\t\n\t\t\t\techo $msg;\n\t\t\t\t\n\t\t\t\tsendEmail($email, $msg, $fname.' '.$lname,$campaignType);\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t}\n}", "public function batchEmail($sender)\n\t{\n\t\t$total = 0;\n\t\t$success = 0;\n\t\t$mailer = Yii::app()->email;\n\n\t\tforeach($this->emailList as $record)\n\t\t{\n\t\t\tif (!empty($record->emailAddress) && $mailer->send(\n\t\t\t\t$record->emailAddress,\n\t\t\t\t$this->emailSubject, \n\t\t\t\t$this->emailContent, \n\t\t\t\t$sender,\n\t\t\t\t$this->attachments\n\t\t\t))\n\t\t\t\t$success++;\n\t\t\telse if (!empty($record->alternateEmail) && $mailer->send(\n\t\t\t\t$record->alternateEmail,\n\t\t\t\t$this->emailSubject, \n\t\t\t\t$this->emailContent, \n\t\t\t\t$sender,\n\t\t\t\t$this->attachments\n\t\t\t))\n\t\t\t\t$success++;\n\t\t\t$total++;\n\t\t}\n\t\treturn array (\n\t\t\t'count' => $success,\n\t\t\t'total' => $total\n\t\t);\n\t}", "function email_print_users_to_send($users, $nosenders=false, $options=NULL) {\n\n\tglobal $CFG;\n\n\t$url = '';\n\tif ( $options ) {\n\t\t$url = email_build_url($options);\n\t}\n\n\n\techo '<tr valign=\"middle\">\n <td class=\"legendmail\">\n <b>'.get_string('for', 'block_email_list'). '\n :\n </b>\n </td>\n <td class=\"inputmail\">';\n\n if ( ! empty ( $users ) ) {\n\n \techo '<div id=\"to\">';\n\n \tforeach ( $users as $userid ) {\n \t\techo '<input type=\"hidden\" value=\"'.$userid.'\" name=\"to[]\" />';\n \t}\n\n \techo '</div>';\n\n \techo '<textarea id=\"textareato\" class=\"textareacontacts\" name=\"to\" cols=\"65\" rows=\"3\" disabled=\"true\" multiple=\"multiple\">';\n\n \tforeach ( $users as $userid ) {\n \t\techo fullname( get_record('user', 'id', $userid) ).', ';\n \t}\n\n \techo '</textarea>';\n }\n\n \techo '</td><td class=\"extrabutton\">';\n\n\tlink_to_popup_window( '/blocks/email_list/email/participants.php?'.$url, 'participants', get_string('participants', 'block_email_list').' ...',\n 470, 520, get_string('participants', 'block_email_list') );\n\n echo '</td></tr>';\n echo '<tr valign=\"middle\">\n \t\t\t<td class=\"legendmail\">\n \t\t\t\t<div id=\"tdcc\"></div>\n \t\t\t</td>\n \t\t\t<td><div id=\"fortextareacc\"></div><div id=\"cc\"></div><div id=\"url\">'.$urltoaddcc.'<span id=\"urltxt\">&#160;|&#160;</span>'.$urltoaddbcc.'</div></td><td><div id=\"buttoncc\"></div></td></tr>';\n echo '<tr valign=\"middle\"><td class=\"legendmail\"><div id=\"tdbcc\"></div></td><td><div id=\"fortextareabcc\"></div><div id=\"bcc\"></div></td><td><div id=\"buttonbcc\"></div></td>';\n\n\n}", "public function sendReservationEmail($values)\n {\n //TODO: rework\n }", "function sendSecondReminderEmails($rows) {\r\n\t\t$config = OSMembershipHelper::getConfig() ;\r\n\t\t$jconfig = new JConfig();\r\n\t\t$db = & JFactory::getDBO();\r\n\t\t$fromEmail = $jconfig->mailfrom;\r\n\t\t$fromName = $jconfig->fromname;\r\n\t\t$planTitles = array() ;\r\n\t\t$subscriberIds = array();\r\n\t\tif (version_compare(JVERSION, '3.0', 'ge')) {\r\n\t\t\t$j3 = true ;\r\n\t\t\t$mailer = new JMail() ;\r\n\t\t} else {\r\n\t\t\t$j3 = false ;\r\n\t\t}\r\n\t\tfor ($i = 0 , $n = count($rows) ; $i < $n ; $i++) {\r\n\t\t\t$row = $rows[$i] ;\r\n\t\t\tif(!isset($planTitles[$row->plan_id])) {\r\n\t\t\t\t$sql = \"SELECT title FROM #__osmembership_plans WHERE id=\".$row->plan_id ;\r\n\t\t\t\t$db->setQuery($sql) ;\r\n\t\t\t\t$planTitle = $db->loadResult();\r\n\t\t\t\t$planTitles[$row->plan_id] = $planTitle ;\t\t\t\t\r\n\t\t\t}\t\t\t\r\n\t\t\t$replaces = array() ;\r\n\t\t\t$replaces['plan_title'] = $planTitles[$row->plan_id] ;\r\n\t\t\t$replaces['first_name'] = $row->first_name ;\r\n\t\t\t$replaces['last_name'] = $row->last_name ;\r\n\t\t\t$replaces['number_days'] = $row->number_days ;\r\n\t\t\t$replaces['expire_date'] = JHTML::_('date', $row->to_date, $config->date_format);\r\n\r\n\t\t\t\r\n\t\t\t//Over-ridde email message\r\n\t\t\t$subject = $config->second_reminder_email_subject ;\t\t\t\r\n\t\t\t$body = $config->second_reminder_email_body ;\t\t\t\t\t\t\t\t\t\r\n\t\t\tforeach ($replaces as $key=>$value) {\r\n\t\t\t\t$key = strtoupper($key) ;\r\n\t\t\t\t$body = str_replace(\"[$key]\", $value, $body) ;\r\n\t\t\t\t$subject = str_replace(\"[$key]\", $value, $subject) ;\r\n\t\t\t}\t\t\r\n\t\t\tif ($j3) {\r\n\t\t\t\t$mailer->sendMail($fromEmail, $fromName, $row->email, $subject, $body, 1);\r\n\t\t\t} else {\r\n\t\t\t\tJUtility::sendMail($fromEmail, $fromName, $row->email, $subject, $body, 1);\r\n\t\t\t}\t\t\t\t\t\t\t\t\r\n\t\t\t$subscriberIds[] = $row->id ;\r\n\t\t}\r\n\t\tif (count($subscriberIds)) {\r\n\t\t\t$sql = 'UPDATE #__osmembership_subscribers SET second_reminder_sent=1 WHERE id IN ('.implode(',', $subscriberIds).')';\r\n\t\t\t$db->setQuery($sql) ;\r\n\t\t\t$db->query();\t\r\n\t\t}\r\n\t\t\r\n\t\treturn true ;\t\r\n\t}", "public function execute() {\n\t\tset_include_path(get_include_path().PATH_SEPARATOR.LIB_ROOT);\n\t\trequire_once LIB_ROOT.'Zend/Mail.php';\n\n\t\t$mail = new Omelette_Mail($this->data['type']);\n\n\t\tforeach($this->data['params'] as $find=>$replace) {\n\t\t\tif(is_array($replace)) {\n\t\t\t\t$replace = implode(',',$replace);\n\t\t\t}\n\t\t\t$mail->getView()->set($find,$replace);\n\t\t}\n\n\t\t$mail->getMail()\n\t\t\t\t->addTo('[email protected]')\n\t\t\t\t->setSubject('Tactile CRM: Status Update')\n\t\t\t\t->setFrom('[email protected]','Your Friendly Tactile Robot');\n\t\t\n\t\tif(isset($this->data['attachment'])) {\n\t\t\t$attachment = $this->data['attachment'];\n\t\t\t$body = file_get_contents($attachment);\n\t\t\t$mail->getMail()->createAttachment($body,\t//contents of file (can be a stream)\n\t\t\t\t\t\t\t\t\t'text/csv',\t//file-type\n\t\t\t\t\t\t\t\t\tZend_Mime::DISPOSITION_ATTACHMENT,\t//default seems not to work?\n\t\t\t\t\t\t\t\t\tZend_Mime::ENCODING_BASE64,\t\t\t//likewise\n\t\t\t\t\t\t\t\t\t'errors.csv'); //the name of the file\n\t\t}\n\t\t$mail->send();\n\t\t$this->cleanup();\n\t}", "public function action_sendmails(){\r\n\t\techo 'Send mails from queue'.\"\\n\";\n\t\t$mails = Model_Mail::getQueuedToSend();\n\t\t$swiftMail = email::connect();\r\n\t\t\t\t\n\t\tforeach ($mails as $mail)\n\t\t{\n\t\t\t$message = new Swift_Message();\n\t\t\t$message->setFrom(array($mail->from));\n\t\t\t$message->setBody($mail->content,'text/html');\n\t\t\t$message->setTo(array($mail->to));\n\t\t\t$message->setSubject($mail->title);\n\t\t\t\n\t\t\t$result = $swiftMail->send($message);\n\t\t\tif ($result)\n\t\t\t{\n\t\t\t\tModel_Mail::setSent($mail->id);\n\t\t\t}\n\t\t\t\n\t\t}\n\t\techo 'Sended '.count($mails).' e-mail'.\"\\n\";\r\n\t}", "private function email(){\n\t\t\tif($this->get_request_method() != \"POST\"){\n\t\t\t\t$this->response('',406);\n\t\t\t}\n\t\t\t$email = $this->_request['email'];\n\t\t\t$sql = mysql_query(\"SELECT email FROM accounts WHERE email = '\".$email.\"'\", $this->db);\n\t\t\tif(mysql_num_rows($sql) > 0){\n\t\t\t\t$result = array();\n\t\t\t\twhile($rlt = mysql_fetch_array($sql,MYSQL_ASSOC)){\n\t\t\t\t\t$result[] = $rlt;\n\t\t\t\t}\n\t\t\t\t// If success everythig is good send header as \"OK\" and return list of users in JSON format\n\t\t\t\techo json_encode(array('valid' =>FALSE));\n\t\t\t} else {\n\t\t\t\techo json_encode(array('valid' =>TRUE));\n\t\t\t}\n\t\t\t//$this->response('',204);\t// If no records \"No Content\" status\n\t\t}", "protected function execute($arguments = array(), $options = array())\r\n {\r\n $databaseManager = new sfDatabaseManager($this->configuration);\r\n $connection = $databaseManager->getDatabase($options['connection'])->getConnection();\r\n\r\n $this->log('mailer on...');\r\n while(true)\r\n {\r\n $this->log('----------------------------------------------------------');\r\n\r\n if($mb_mail_list = MbMailPeer::getPendientes())\r\n {\r\n foreach($mb_mail_list as $mb_mail)\r\n {\r\n MbWorker::setActive($mb_mail->getId());\r\n\r\n $mb_mail->reload();\r\n\r\n if(!$mb_mail->getToken())\r\n {\r\n //$token = uniqid(null, true);\r\n $mb_mail->setToken(sha1(rand(111111,999999) . $mb_mail->getSubject()));\r\n $mb_mail->save();\r\n }\r\n\r\n $this->log('Procesando email: ' . $mb_mail->getSubject() . ' (batch size: ' . $mb_mail->getBatchSize() . ')');\r\n\r\n if($next_recipients = $mb_mail->getNextRecipients())\r\n {\r\n foreach($next_recipients as $i => $mb_mailto)\r\n {\r\n if($i%2 == 0)\r\n $mb_mail->reload();\r\n\r\n MbWorker::setActiveRecipient($mb_mailto->getId());\r\n\r\n if($mb_mail->getState() == 'stop')\r\n {\r\n $this->log('-- !!Correo detenido desde aplicacion');\r\n break;\r\n }\r\n\r\n $this->log('- Enviando a: ' . $mb_mailto->getMailto());\r\n\r\n if(!$mb_mail->send($mb_mailto))\r\n {\r\n $this->log('-- Correo con errores');\r\n break;\r\n }\r\n\r\n sleep(1);\r\n }\r\n MbWorker::setActiveRecipient(0);\r\n }\r\n\r\n if($mb_mail->getState() != 'stop' && !$mb_mail->hasMoreRecipients())\r\n {\r\n $this->log('-- Termino de envio de ' . $mb_mail->getSubject());\r\n\r\n $mb_mail->setState('ok');\r\n $mb_mail->save();\r\n $mb_mail->notifyIfNecessary();\r\n }\r\n MbWorker::setActive(0);\r\n }\r\n\r\n }\r\n else\r\n {\r\n $this->log('No hay mails para enviar');\r\n break;\r\n }\r\n }\r\n $this->log('mailer off...');\r\n }", "public function sendHTMLEmails($filename, $from, $toList, $subject, $params) {\n\n\t\tfor ($i=0; $i<count($toList); $i++) {\n\t\t\t$this->sendHTMLEmail($filename, $from, $toList[$i]->email, $subject, $params);\n\t\t\tsleep(1);\n\t\t}\n\t}", "function sendEmails($dictEmails) {\n $appConfig = new AppConfig();\n $conn = $appConfig->connect( \"populetic_form\", \"replica\" );\n $daoClient = new DaoClient();\n $daoClientBankAccount = new DaoClientBankAccount();\n\n foreach ($dictEmails as $email => $arrayClaimInfo) {\n $listClaimRefs = array();\n\n if (count($arrayClaimInfo) == 1) {\n //send email unic\n $name = $arrayClaimInfo[0][\"name\"];\n $clientId = $arrayClaimInfo[0][\"idClient\"];\n $amount = $arrayClaimInfo[0][\"clientAmount\"];\n $ref = $arrayClaimInfo[0][\"referencia\"];\n $lang = $arrayClaimInfo[0][\"lang\"];\n $idReclamacio = $arrayClaimInfo[0][\"id_reclamacion\"];\n $codigo_vuelo = $arrayClaimInfo[0][\"codigo\"];\n\n $daoClient->changeToSolicitarDatosPago($conn, $idReclamacio);\n $daoClient->insertLogChange($conn, $clientId, $idReclamacio, '36');\n \n } else {\n //send email with list of $clientInfo\n $name = $arrayClaimInfo[0][\"name\"];\n $clientId = $arrayClaimInfo[0][\"idClient\"];\n $amount = $arrayClaimInfo[0][\"clientAmount\"];\n $ref = $arrayClaimInfo[0][\"referencia\"];\n $lang = $arrayClaimInfo[0][\"lang\"];\n $idReclamacio = $arrayClaimInfo[0][\"id_reclamacion\"];\n $codigo_vuelo = $arrayClaimInfo[0][\"codigo\"];\n\n foreach ($arrayClaimInfo as $claimInfo) {\n $listClaimRefs[] = $claimInfo[\"referencia\"];\n\n //if it is set it means is the principal claim.\n if (isset($claimInfo[\"listAssociates\"])) {\n $name = $claimInfo[\"name\"];\n $clientId = $claimInfo[\"idClient\"];\n $amount = $claimInfo[\"clientAmount\"];\n $ref = $claimInfo[\"referencia\"];\n $lang = $claimInfo[\"lang\"];\n $idReclamacio = $claimInfo[\"id_reclamacion\"];\n $codigo_vuelo = $claimInfo[\"codigo\"];\n }\n\n $daoClient->changeToSolicitarDatosPago($conn, $idReclamacio);\n $daoClient->insertLogChange($conn, $clientId, $idReclamacio, '36');\n }\n }\n\n $date = date('Y-m-d H:i:s');\n $hash = Controller::getInstance()->generateHash($date, $idReclamacio);\n $result = Controller::getInstance()->sendEmailValidation($name, $email, $hash, $date, $amount,\n $ref, $lang, \n $codigo_vuelo, $listClaimRefs);\n \n $daoClientBankAccount->updatePendingBankAccount($conn, $email, $idReclamacio);\n\n $appConfig->closeConnection($conn);\n } \n}", "abstract protected function _sendMail ( );", "private function fromListSendMail($email_info = array(), $seeker_email_info = array(), $to = 'seeker')\r\t{\r\t\trequire_once 'Project/Code/1_Website/Applications/User_Account/Modules/mail/email.php';\r\t\t\r\t\t$from_email = \"[email protected]\";\r\t\t$from_name\t= \"Raymond\";\r\t\t$subject\t= \"New Lead from Looking for Eldercare\";\r\t\t\r\t\t\r\t\t$images = array(\r\t\t\t'banner'\t=> 'Project/Design/1_Website/Applications/Seeker/images/Eldercare-email-template-banner.png',\r\t\t\t'icon'\t\t=> 'Project/Design/1_Website/Applications/Seeker/images/Eldercare-email-template-icon.png',\r\t\t\t'logo'\t\t=> 'Project/Design/1_Website/Applications/Seeker/images/Eldercare-email-template-logo.png'\r\t\t);\r\t\t\r\t\tif ($to == 'seeker')\r\t\t{\r\t\t\t$view = new seekerView();\r\t\t\t$view->_set('email_to', $to);\r\t\t\t$view->_set('email_info', $seeker_email_info);\r\t\t\t\r\t\t\t$body = $view->displayEmailTemplate();\r\t\t\t\r\t\t\tforeach ($email_info['hcp'] as $hcp)\r\t\t\t{\r\t\t\t\temail::send_email($hcp['email'], $hcp['name'], $from_email, $from_name, $subject, $body, '', '', $images);\r\t\t\t}\r\t\t}\r\t\t\r\t\telse\r\t\t{\r\t\t\t$view = new seekerView();\r\t\t\t$view->_set('email_to', $to);\r\t\t\t\r\t\t\tinclude_once 'Project/Code/System/House_Type/house_types.php';\r\t\t\t$house_types = new house_types();\r\t\t\t//var_dump($house_types->selectHcpHouseTypeArray('17'));die;\r\t\t\t$counter = 0; //Manual looping to get the house types of each hcp\r\t\t\t$house_type_temp = '';\r\t\t\tforeach ($email_info['hcp'] as $hcp_info)\r\t\t\t{\r\t\t\t\tforeach ($house_types->selectHcpHouseTypeArray($hcp_info['hcp_id']) as $house_type)\r\t\t\t\t{\r\t\t\t\t\t$house_type_temp .= $house_type['house_type'].', '; \r\t\t\t\t}\r\t\t\t\t$house_type_temp = rtrim($house_type_temp, ', ');\r\t\t\t\t$email_info['hcp'][$counter]['house_type'] = $house_type_temp;\r\t\t\t\t$counter++;\r\t\t\t}\r\t\t\t\r\t\t\t$house_type_temp = '';\r\t\t\t\r\t\t\t$view->_set('email_info', $email_info['hcp']);\r\t\t\t$body = $view->displayEmailTemplate();\r\t\t\t\r\t\t\t$to_email\t= $seeker_email_info['seeker_email'];\r\t\t\t$to_name\t= $seeker_email_info['seeker_name'];\r\t\t\t\r\t\t\temail::send_email($to_email, $to_name, $from_email, $from_name, $subject, $body, '', '', $images);\r\t\t}\r\t\t\r\t}", "function sendVotesEmail($registrant, $jlist)\n{\n $contest = $_SESSION['contest'];\n $name = $_SESSION['ctst_name'];\n $subject = $name . \" vote for judges.\";\n $mailContent = $registrant['givenName'] . ' ' . $registrant['familyName'] .\n ' IAC member number ' . $registrant['iacID'] .\n ' voted as follows for judges at the ' . $name . \"\\n\\n\" . $jlist . \"\\n\\n\";\n $mailContent .= automatedMessage($name);\n $headers = \"From: \" . ADMIN_EMAIL . \"\\r\\n\";\n $headers .= \"CC: \" . $registrant['email'] . \"\\r\\n\";\n do_email($contest['voteEmail'], $subject, $mailContent, $headers);\n}", "public function realSend() {\n\t\tBrightUtils::inBrowser();\n\t\t$sql = 'SELECT id, pageId, `groups` FROM `mailqueue` WHERE issend=0';\n\t\t$mailings = $this -> _conn -> getRows($sql);\n\t\t\n\t\t$user = new User();\n\t\tforeach($mailings as $mailing) {\n\t\t\t$sql = 'UPDATE `mailqueue` SET issend=1 WHERE id=' . (int)$mailing -> id;\n\t\t\t$this -> _conn -> updateRow($sql);\n\t\t\t$groups = explode(',', $mailing -> groups);\t\t\t\n\t\t\t$emails = $user -> getUsersInGroups($groups, false, true);\n\t\t\t$this -> _send($mailing -> pageId, $emails);\n\t\t\t$sql = 'UPDATE `mailqueue` SET issend=2 WHERE id=' . (int)$mailing -> id;\n\t\t\t$this -> _conn -> updateRow($sql);\n\t\t}\n\t}", "protected function sendTestMail() {}", "protected function sendEmail($url) {\n $email = $this->getContainer()->get('e2w_email_service');\n\n $receivers = array('[email protected]');\n\n $baseDomain = $this->getContainer()->getParameter('base_domain');\n if ($baseDomain === 'getfivestars.dg') {\n $receivers = array('[email protected]');\n }\n\n $params = array(\n 'from' => '[email protected]',\n 'subject' => 'Businesses with Local Business type',\n 'text' => $url,\n 'html' => \"<a href='{$url}'>{$url}</a>\"\n );\n\n foreach ($receivers as $receiver) {\n $params['to'] = $receiver;\n $email->send($params);\n }\n }", "function send_visitor_email($visit_data, $receivers ) {\n\t$from = conf('email.from_address');\n\t$subject = conf('email.subject');\n\t$tos = array();\n\t$picture_url = sprintf(conf('email.picture_url_template'),\n\t\t$visit_data['srvhost'], $visit_data['webkey']);\n\n\tforeach ($receivers as $r ) {\n\t\t$tos[] = $r['uname'].'@'.conf('gen.receiver_mail_domain');\n\t}\n\n\tif (conf('gen.mode') == 'development' ) {\n\t\t$tos = array(conf('gen.admin_email_address'));\n\t}\n\n\t$msg = 'You have a visitor: '.$visit_data['name'];\n\tif ($visit_data['company'])\n\t\t$msg .= ' from '.$visit_data['company'];\n $reg_building = webhost_code($visit_data['webhost']);\n $msg .= sprintf(\"\\n\\n%s\", 'Registered in '.$reg_building);\n\t$msg .= sprintf(\"\\n\\n%s\", $picture_url);\n\n\tif (conf('email.send')) {\n\t\t$to = array_shift($tos);\n\t\t$cc = implode(', ', $tos);\n\t\t$bcc = conf('email.bcc_address');\n\t\t$hdrs = implode(\"\\r\\n\", array(\n\t\t\t'MIME-Version: 1.0',\n\t\t\t'Content-Transfer-Encoding: 8bit',\n\t\t\t'Content-Type: text/plain; charset=\"utf-8\"',\n\t\t\t'Content-Disposition: inline'));\n\n\t\t$res = imap_mail($to, $subject, $msg, $hdrs, $cc, $bcc);\n\t\tlog_msg(LOG_DEBUG,\n\t\t\tsprintf(\"imap_mail: %s (to: '%s', cc: '%s', bcc: '%s')\",\n\t\t\t$res, $to, $cc, $bcc ));\n\t}\n\n\tif (conf('email.output_file')) {\n\t\tlog_msg(LOG_DEBUG, sprintf(\"Writing e-mail to file '%s' ...\",\n\t\t\tconf('email.output_file')));\n\t\t$email = sprintf(\"From: %s\\nTo: %s\\nSubject: %s\\n\\n%s\",\n\t\t\t$from, implode(', ', $tos ), $subject, $msg);\n\t\tfile_put_contents(conf('email.output_file'), $email);\n\t}\n}", "function vcn_findwork_results_feedback($params) {\r\n\r\n\tglobal $user_info;\r\n\t\r\n\t$params['vcn_user_id'] = (isset($user_info['vcn_user_id']) && $user_info['vcn_user_id'] > 0) ? $user_info['vcn_user_id'] : null;\r\n\t$params['vcn_user_drupal_email'] = ($user_info['is_user_logged_in'] === true) ? ((isset($user_info['mail']) && $user_info['mail'] != \"\") ? $user_info['mail'] : 'no-email') : 'anonymous-user';\r\n\r\n\tif (isset($params['search_term'])) {\r\n\t\t$data = vcn_findwork_results_get_data_freetext_search($params, FALSE);\r\n\t\t$subject = \"Search term:\".$params['search_term'];\r\n\t\t$query_url = 'search-term/'.$params['search_term'];\r\n\t} elseif (isset($params['onetcode'])) {\r\n\t\t$data = vcn_findwork_results_get_data_by_onetcode($params, FALSE);\r\n\t\t$subject = \"Career Title:\".$params['career_title'].\" Onetcode:\".$params['onetcode'];\r\n\t\t$query_url = 'career/'.$params['onetcode'];\r\n\t} else {\r\n\t\t$data = array();\r\n\t\t$subject = \"\";\r\n\t\t$query_url = \"\";\r\n\t}\r\n\r\n\tif (isset($params['zipcode'])) {\r\n\t\t$subject .= \" Zipcode:\".$params['zipcode'].\" Distance:\".$params['distance'];\r\n\t\t$query_url .= '/zip/'.$params['zipcode'].'/distance/'.$params['distance'];\r\n\t}\r\n\t$params['subject'] = $subject; //subject parameter\r\n\r\n\t$data_count = count($data);\r\n\tif ($data_count > 0) {\r\n\t\t$i = 1;\r\n\t\t$data_string = \"COMPANY,JOB TITLE,JOB URL,LOCATION,DATE POSTED\\r\\n\";\r\n\t\tforeach($data as $value) {\r\n\t\t\t$data_string .= '\"'.$value['company'].'\",';\r\n\t\t\t$data_string .= '\"'.$value['job_title'].'\",';\r\n\t\t\t$data_string .= '\"'.$value['job_url'].'\",';\r\n\t\t\t$data_string .= '\"'.$value['location'].'\",';\r\n\t\t\t$data_string .= '\"'.$value['date_acquired'].'\"';\r\n\t\t\tif ($i < $data_count) {\r\n\t\t\t\t$data_string .= \"\\r\\n\";\r\n\t\t\t}\r\n\t\t\t$i++;\r\n\t\t}\r\n\t} else {\r\n\t\t$data_string = \"No data returned for the user's search criteria\";\r\n\t}\r\n\t$params['job_search_data'] = $data_string; // job search results converted into a string that can be easily copied over and coverted into CSV file\r\n\r\n\t//page_url parameter\r\n\t$feedback_page_url = $GLOBALS['base_root'].vcn_drupal7_base_path().'findwork-results/'.$query_url;\r\n\t$params['page_url'] = $feedback_page_url;\r\n\r\n\r\n\t/* other parameters */\r\n\t$params['sender_comment'] = \"Comment for Find a Job Results page\"; //try to come up with a default comment, since we are not allowing users to type anything yet\r\n\r\n\r\n\t$call_result = vcn_rest_wrapper('vcncommentsvc', 'vcnjobsearchfeedback', 'insert-job-search-feedback', $params, 'json', 'post', false);\r\n\techo json_encode($call_result);\r\n}", "public function Send()\n {\n $headers = \"\";\n \n $to = \"\";\n $toString = \"\";\n \n foreach ($this->addresses as $email=>$name) \n {\n $toString .=(empty($toString))?'':', ';\n $to .=(empty($to))?'':', ';\n \n $toString .= \"$name <$email>\"; \n $to .= \"$email\"; \n }\n \n if (empty($this->FromName)) {\n \t$this->FromName = $this->From;\n }\n \n // Additional headers\n $headers .= \"To: $toString \\r\\n\";\n $headers .= 'From: $this->FromName <$this->From>' . \"\\r\\n\";\n\n // Mail it\n return mail($to, $this->Subject, $this->Body, $headers);\n \n }", "function send_mail($subject, $body_text, $body_html, $sendlist){\n #exit();\n\n # include pear Mail packages\n include 'Mail.php';\n include 'Mail/mime.php';\n\n $crlf = \"\\n\";\n $hdrs = array(\n 'From' => '[email protected]',\n 'Subject' => $subject\n );\n $mime = new Mail_mime(array('eol' => $crlf));\n\n $mime->setTXTBody($body_text);\n $mime->setHTMLBody($body_html);\n\n $body = $mime->get();\n $hdrs = $mime->headers($hdrs);\n\n $mail =& Mail::factory('mail');\n\n foreach($sendlist as $addr){\n $mail->send($addr, $hdrs, $body);\n # wait 2 seconds between sending each email:\n sleep(2);\n }\n}", "public function sendResults( $results = array() ) {\n\n // dummy data:\n // $results = array(\n // (object)array(\n // \"id\" => \"484848484852bf4f6c7eca896c0030516ab2f228f157237712e52d66489d9960\",\n // \"result\" => 6,\n // \"sc\" => 1625125748\n // )\n // );\n\n $postdata = json_encode(\n (object)array(\n 'testResults' => $results\n )\n );\n\n $ch = curl_init();\n\n $curlOpts = array(\n CURLOPT_POST => true,\n CURLOPT_POSTFIELDS => $postdata,\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_FOLLOWLOCATION => true,\n CURLOPT_SSLKEY => self::$keyFile,\n CURLOPT_SSLCERT => self::$certFile,\n CURLOPT_KEYPASSWD => self::$keyPass,\n CURLOPT_URL => self::getStageURL() . self::API_ENDPOINT_RESULTS,\n CURLOPT_HTTPHEADER => array('Content-Type: application/json'),\n );\n \n curl_setopt_array($ch , $curlOpts);\n \n $output = curl_exec( $ch ) ;\n \n if ( curl_errno( $ch ) ) {\n $error_msg = curl_error( $ch );\n print \"curl_error: $error_msg <br>\";\n } else {\n $status = curl_getinfo( $ch, CURLINFO_HTTP_CODE );\n if ( 204 === $status ) {\n return true;\n } else {\n $response = json_decode($output);\n if ( is_object( $response ) ) {\n return $response;\n } else {\n return (object)array(\n 'status' => $status,\n 'response' => $response\n );\n }\n }\n }\n }", "protected function executeCall()\n\t{\n\t\t$mail\t= $this->getClass( 'Mail' );\n\t\t$date\t= date( 'Y-m-d', ( time() + ( self::NUM_DAYS_BEFORE_MATCH * 24 * 60 * 60 ) ) );\n\n\t\t$match\t= $this->getData( 'MatchModel', 'getMatchByDate', array( 'date' => $date ) );\n\t\tif ( !isset( $match[0] ) )\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t$match\t\t\t\t\t= array_shift( $match );\n\t\t$match['day_formated']\t= date( 'd/m/Y', strtotime( $match['day'] ) );\n\n\t\t$players\t= $this->getData( 'TeamModel', 'getPlayers', array( 'type' => 'player' ) );\n\t\tforeach( $players as $player )\n\t\t{\n\t\t\t$mail->setReceiver( $player['email'] );\n\t\t}\n\n\t\t$mail->setContentType( 'text/html', 'utf8' );\n\t\t$mail->setFrom( FROM_EMAIL );\n\t\t$mail->setSubject( \"Call {$match['day_formated']}\" );\n\t\t$mail->setBody( $this->composeMailBody( $match ) );\n\t\t$mail->send();\n\t}", "function sendFirstReminderEmails($rows) {\t\t\r\n\t\t$config = OSMembershipHelper::getConfig() ;\r\n\t\t$jconfig = new JConfig();\r\n\t\t$db = & JFactory::getDBO();\r\n\t\t$fromEmail = $jconfig->mailfrom;\r\n\t\t$fromName = $jconfig->fromname;\r\n\t\t$planTitles = array() ;\r\n\t\t$subscriberIds = array();\r\n\t\tif (version_compare(JVERSION, '3.0', 'ge')) {\r\n\t\t\t$j3 = true ;\r\n\t\t\t$mailer = new JMail() ;\r\n\t\t} else {\r\n\t\t\t$j3 = false ;\r\n\t\t}\r\n\t\tfor ($i = 0 , $n = count($rows) ; $i < $n ; $i++) {\r\n\t\t\t$row = $rows[$i] ;\r\n\t\t\tif(!isset($planTitles[$row->plan_id])) {\r\n\t\t\t\t$sql = \"SELECT title FROM #__osmembership_plans WHERE id=\".$row->plan_id ;\r\n\t\t\t\t$db->setQuery($sql) ;\r\n\t\t\t\t$planTitle = $db->loadResult();\r\n\t\t\t\t$planTitles[$row->plan_id] = $planTitle ;\t\t\t\t\r\n\t\t\t}\t\t\t\r\n\t\t\t$replaces = array() ;\r\n\t\t\t$replaces['plan_title'] = $planTitles[$row->plan_id] ;\r\n\t\t\t$replaces['first_name'] = $row->first_name ;\r\n\t\t\t$replaces['last_name'] = $row->last_name ;\r\n\t\t\t$replaces['number_days'] = $row->number_days ;\r\n\t\t\t$replaces['expire_date'] = JHTML::_('date', $row->to_date, $config->date_format);\r\n\r\n\t\t\t\r\n\t\t\t//Over-ridde email message\r\n\t\t\t$subject = $config->first_reminder_email_subject ;\t\t\t\r\n\t\t\t$body = $config->first_reminder_email_body ;\t\t\t\t\t\t\t\t\t\r\n\t\t\tforeach ($replaces as $key=>$value) {\r\n\t\t\t\t$key = strtoupper($key) ;\r\n\t\t\t\t$body = str_replace(\"[$key]\", $value, $body) ;\r\n\t\t\t\t$subject = str_replace(\"[$key]\", $value, $subject) ;\r\n\t\t\t}\t\t\t\r\n\t\t\tif ($j3)\r\n\t\t\t\t$mailer->sendMail($fromEmail, $fromName, $row->email, $subject, $body, 1);\r\n\t\t\telse\t\t\t\r\n\t\t\t\tJUtility::sendMail($fromEmail, $fromName, $row->email, $subject, $body, 1);\t\t\t\r\n\t\t\t$subscriberIds[] = $row->id ;\r\n\t\t}\r\n\t\tif (count($subscriberIds)) {\r\n\t\t\t$sql = 'UPDATE #__osmembership_subscribers SET first_reminder_sent=1 WHERE id IN ('.implode(',', $subscriberIds).')';\r\n\t\t\t$db->setQuery($sql) ;\r\n\t\t\t$db->query();\t\r\n\t\t}\r\n\t\t\r\n\t\treturn true ;\t\t\t\t\t\r\n\t}", "abstract public function mailSearch($domains, array $opts = array());", "function _emailTeams( $gameID, $nextGames ) {\n\n/* ... data declarations */\n $toAddr = array();\n $ccAddr = array();\n $bccAddr = array();\n \n/* ... get the game details from the database */\n $gameDetails = $this->Model_Tournament->getGameDetails( $gameID );\n\n/* ... if for some reason we didn't retrieve a game from the database, bail out now */\n if (!array_key_exists( 'GameID', $gameDetails )) {\n print \"*** ERROR: Attempt to email teams about Game ID \".$gameID.\" failed.\\n\";\n exit;\n }\n \n/* ... we need to get the team contacts for the 2 teams that played */\n $visitEmails = $this->Model_Team->buildTeamMailingList( $gameDetails['VisitTeamID'] );\n $homeEmails = $this->Model_Team->buildTeamMailingList( $gameDetails['HomeTeamID'] );\n $toAddr = array_merge( $visitEmails, $homeEmails );\n\n/* ... start with the standard message information */\n $body = \"This email has been sent by an automated process and does not require a reply.\\n\\n\";\n\n/* ... now build the body of the email message */\n if ($gameDetails['Status'] == \"PLAYED\") {\n $body .= \"Game result submission\\n\";\n $body .= \"======================\\n\\n\";\n $body .= \"Date: \".$gameDetails['Date'].\" Time: \".$gameDetails['Time'].\" Diamond: \".$gameDetails['Diamond'].\"\\n\\n\";\n $body .= $this->Model_Team->getTeamName( $gameDetails['VisitTeamID'] ).\": \".$gameDetails['VisitScore'].\" at \";\n $body .= $this->Model_Team->getTeamName( $gameDetails['HomeTeamID'] ).\": \".$gameDetails['HomeScore'].\"\\n\";\n\n/* ... include some information about next games */\n $nextGameDetails = $this->Model_Tournament->getGameDetails( $nextGames['Winner'] );\n $body .= \"\\n\";\n $body .= \"Winner of this game next plays \".$nextGameDetails['Date'].\" at \".$nextGameDetails['Time'].\" on \".$nextGameDetails['Diamond'].\"\\n\";\n if ($nextGames['Loser'] != -1) {\n $nextGameDetails = $this->Model_Tournament->getGameDetails( $nextGames['Loser'] );\n $body .= \"\\n\";\n $body .= \"Loser of this game next plays \".$nextGameDetails['Date'].\" at \".$nextGameDetails['Time'].\" on \".$nextGameDetails['Diamond'].\"\\n\";\n }\n else {\n $body .= \"Loser of this game has no further games to play\\n\";\n }\n $body .= \"\\nThe schedule on the web has been updated with the results and future game assignments.\\n\";\n \n }\n elseif ($gameDetails['Status'] == \"RAINOUT\") {\n $body .= \"RAINOUT Game Report\\n\";\n $body .= \"===================\\n\\n\"; \n $body .= \"Date: \".$gameDetails['Date'].\" Time: \".$gameDetails['Time'].\" Diamond: \".$gameDetails['Diamond'].\"\\n\\n\";\n $body .= $this->Model_Team->getTeamName( $gameDetails['VisitTeamID'] ).\" at \".$this->Model_Team->getTeamName( $gameDetails['HomeTeamID'] ).\"\\n\";\n $body .= \"Reason for reschedule request\\n\";\n $body .= $gameDetails['Notes'].\"\\n\";\n $body .= \"\\n\\nIMPORTANT: Both teams will be informed when this game has been reschdeduled\\n\";\n $ccAddr = array( $this->config->item( 'my_execAddress' ) );\n }\n\n/* ... put in the standard details about disagreements */\n $body .= \"\\n-------------------------\\n\";\n $body .= \"If there is a disagreement about this game report, team captains should contact each other and discuss their concerns. \";\n $body .= \"If there is agreement to change the score, you must contact [email protected] with details of the change. \";\n $body .= \"If teams cannot reach a mutual agreement on the score, please send an email to [email protected] providing \";\n $body .= \"a synopsys of the disputed game result.\\n\";\n $body .= \"Disagreements must be voiced within 1 day of this email otherwise this result will be considered official.\\n\";\n $body .= \"\\n\";\n $body .= \"If you have concerns about the process for reporting games, please send them in an email to [email protected]\\n\";\n $body .= \"\\n\\n\";\n \n\n/* ... we need a subject line */\n $subject = \"[Kanata Lobball] Game report for \".$gameDetails['Date'].\" @ \".$gameDetails['Time'].\" on \".$gameDetails['Diamond'].\" [\".$gameDetails['GameID'].\"]\";\n\n/* ... send the email message */\n $this->Model_Mail->sendTextEmail( $toAddr, $ccAddr, $bccAddr, $subject, $body );\n \n/* ... time to go */\n return;\n }", "private function _processSubmit()\n {\n global $interface;\n global $configArray;\n\n // Without IDs, we can't continue\n if (empty($_REQUEST['ids'])) {\n header(\n \"Location: \" . $this->followupUrl . \"?errorMsg=bulk_noitems_advice\"\n );\n exit();\n }\n\n $url = $configArray['Site']['url'] . \"/Search/Results?lookfor=\" .\n urlencode(implode(\" \", $_POST['ids'])) . \"&type=ids\";\n $result = $this->sendEmail(\n $url, $_POST['to'], $_POST['from'], $_POST['message']\n );\n\n if (!PEAR::isError($result)) {\n $this->followupUrl .= \"?infoMsg=\" . urlencode(\"bulk_email_success\");\n header(\"Location: \" . $this->followupUrl);\n exit();\n } else {\n // Assign Error Message and Available Data\n $this->errorMsg = $result->getMessage();\n $interface->assign('formTo', $_POST['to']);\n $interface->assign('formFrom', $_POST['from']);\n $interface->assign('formMessage', $_POST['message']);\n $interface->assign('formIDS', $_POST['ids']);\n }\n }", "public function send() {\n\t\t$class = ClassRegistry::init($this->args[0]);\n\n\t\ttry {\n\t\t\t$class->{'email' . $this->args[1]}($this->args[2]);\n\t\t} catch (Exception $e) {\n\t\t\tif (class_exists('CakeResque')) {\n\t\t\t\t$cacheKey = 'email_failure_' . $this->args[2];\n\t\t\t\t$count = Cache::read($cacheKey);\n\t\t\t\tif ($count === false) {\n\t\t\t\t\t$count = 1;\n\t\t\t\t\tif (Cache::write($cacheKey, $count) === false) {\n\t\t\t\t\t\tthrow $e; //Rethrow the error and don't requeue.\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$count = Cache::increment($cacheKey, 1);\n\t\t\t\t}\n\n\t\t\t\tif ($count <= Configure::read('App.max_email_retries')) {\n\t\t\t\t\tLogError('EMail sending failure (retry queued): ' . $this->args[0] . '.' . $this->args[1] . ' to ' . $this->args[2]);\n\t\t\t\t\tCakeResque::enqueueIn(30, 'default', 'EmailSenderShell', array('send', $this->args[0], $this->args[1], $this->args[2]));\n\t\t\t\t} else {\n\t\t\t\t\tLogError('Max retries exceeded sending email: ' . $this->args[0] . '.' . $this->args[1] . ' to ' . $this->args[2]);\n\t\t\t\t}\n\t\t\t}\n\t\t\tthrow $e;// Rethrow so the queue shows the failed job.\n\t\t}\n\t}", "function send()\n\t\t{\n\t\t\t// converte, se necessario, l'array dei destinatari in un'unica stringa (indirizzi separati da virgola)\n\t\t\t$to = (is_array($this->to)) ? implode(\",\", array_keys($this->to)) : $this->to;\n\t\t\t// invia il messaggio e ritorna il risultato\n\t\t\treturn mail($to, $this->subject, $this->body, $this->headers);\n\t\t}", "public function run()\n {\n for($i=0;$i<50;$i++){\n \t$e = new Email;\n\n \t$e->name = \"user-\".$i;\n \t$e->email = \"user-\".$i.\"@gmail.com\";\n \t$e->phone = \"016370192\".$i;\n \t$e->subject = \"Subject-\".$i;\n \t$e->message = \"Lorem ipsum dolor sit amet, consectetur adipisicing elit. Consequuntur error soluta quae, expedita, molestias, rerum nihil optio recusandae doloribus maxime libero commodi facilis eveniet? Ullam illum laborum voluptatem, ea laboriosam assumenda, consequuntur facere animi sunt molestias deleniti eveniet expedita. Quos ipsum maxime, quisquam, dolor nulla doloremque ad suscipit impedit quidem voluptate commodi voluptatum consequuntur facilis, dolore id optio itaque culpa et tempore eligendi molestiae rerum dolores eaque harum possimus. Molestias modi labore assumenda tempora totam aliquam delectus harum atque, quae, perspiciatis reprehenderit eligendi dignissimos pariatur, est odit ut animi itaque consequuntur impedit sit! Unde, omnis, fugiat. Facere eius eligendi quidem!\";\n\n \t$e->save();\n\n }\n }", "public function execute()\n {\n\n $undeliveredRecipients = array();\n $recipientsCount = 0;\n\n while (count($this->recipients) >= 1) {\n\n //send the command and read the response\n parent::execute();\n\n $recipient = array_pop($this->recipients);\n\n switch ($this->response->getCode()) {\n\n case '250':\n case '251':\n if (isset($recipient['original_email'])) {\n //we finally delivered mail to a user that provided a \n //forward-address\n $key = array_search($recipient['original_email'],\n $undeliveredRecipients);\n\n if ($key !== FALSE)\n unset($undeliveredRecipients[$key]);\n }\n\n $recipientsCount++;\n break;\n\n case '450':\n case '451':\n //add the recipient to the begginning of the queue to try again\n //later\n if ($recipient['retries'] > 0) {\n $recipient['retries']--;\n array_unshift($this->recipients, $recipient);\n }\n break;\n\n /* Handle too much recipients by splitting the message to chunks\n *\n * RFC 821 [30] incorrectly listed the error where an SMTP server\n * exhausts its implementation limit on the number of RCPT commands\n * (\"too many recipients\") as having reply code 552. The correct \n * reply code for this condition is 452. Clients SHOULD treat a \n * 552 code in this case as a temporary, rather than permanent, \n * failure so the logic below works. \n */\n case '452':\n case '552':\n array_push($this->recipients, $recipient);\n\n $result['undelivered'] = $undeliveredRecipients;\n //this causes the client to append a new mail sending sequence \n //for the rest of recipients\n $result['toDeliver'] = $this->recipients;\n $result['recipientsCount'] = $recipientsCount;\n\n return $result;\n break; //unreachable\n\n case '550':\n case '553':\n $undeliveredRecipients[] = $recipient['email'];\n break;\n\n case '551':\n if (preg_match('/<\\([^>]*\\)>/', $this->response, $matches)) {\n\n $forward = array();\n $forward['email'] = $matches[1];\n $forward['retries'] = 2;\n if (isset($recipient['original_email'])) {\n $forward['original_email'] = \n $recipient['original_email'];\n } else {\n $forward['original_email'] = $recipient['email'];\n $undeliveredRecipients[] = $recipient['email'];\n }\n\n $this->recipients[] = $forward;\n }\n break;\n }\n\n }\n\n return array(\n 'undelivered' => $undeliveredRecipients, \n 'recipientsCount' => $recipientsCount,\n );\n }", "function mailing($recivers,$Body){\r\n//Import PHPMailer classes into the global namespace\r\n//These must be at the top of your script, not inside a function\r\n//Load Composer's autoloader\r\nrequire 'vendor/autoload.php';\r\n//Create an instance; passing `true` enables exceptions\r\n$mail = new PHPMailer(true);\r\n\r\ntry {\r\n//Server settings\r\n// $mail->SMTPDebug = SMTP::DEBUG_SERVER; //Enable verbose debug output\r\n$mail->isSMTP(); //Send using SMTP\r\n$mail->Host = 'smtp.gmail.com'; //Set the SMTP server to send through\r\n$mail->SMTPAuth = true; //Enable SMTP authentication\r\n$mail->Username = '[email protected]'; //SMTP username\r\n$mail->Password = '49a227bea@t'; //SMTP password\r\n$mail->SMTPSecure = 'ssl'; //Enable implicit TLS encryption\r\n$mail->Port = 465; //TCP port to connect to; use 587 if you have set `SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS`\r\n\r\n\r\n \r\n //Recipients\r\n $mail->SetFrom('[email protected]', 'Admin');\r\n\r\n foreach ($recivers as $resiver ){\r\n // if(empty($name)){$name=\"User\";}\r\n $mail->addAddress($resiver); //Add a recipient\r\n }\r\n // $mail->addReplyTo('[email protected]', 'Information');\r\n // $mail->addCC('[email protected]');\r\n // $mail->addBCC('[email protected]');\r\n\r\n\r\n\r\n // //Attachments\r\n // $mail->addAttachment('/var/tmp/file.tar.gz'); //Add attachments\r\n // $mail->addAttachment('/tmp/image.jpg', 'new.jpg'); //Optional name\r\n\r\n //Content\r\n $mail->isHTML(true); //Set email format to HTML\r\n $mail->Subject = 'Here is the subject';\r\n $mail->Body = $Body;\r\n $mail->AltBody = 'This is the body in plain text for non-HTML mail clients';\r\n $mail->send();\r\n //massage after send to Get Error\r\n return 'Message has been sent';\r\n } catch (Exception $e) {\r\n return \"Message could not be sent. Mailer Error: {$mail->ErrorInfo}\";\r\n }\r\n\r\n\r\n//end function\r\n}", "public function sendEmails(Mail $mail, BaseUser $user, $parameters = []);", "static function sendMail($recepients, $subject, $body) {\r\n\t\tif (!MAIL) return;\r\n\r\n\t\t$template = new Art_Model_Email_Template();\r\n\t\t\r\n\t\t$template->subject = $subject;\r\n\t\t$template->from_email = static::DEFAULT_EMAIL_ADDRESS;\r\n\t\t$template->from_name = static::DEFAULT_EMAIL_NAME;\r\n\t\t\r\n\t\tstatic::sendMailUsingTemplate($template, $body, static::DEFAULT_EMAIL_ADDRESS, $recepients);\r\n\t}", "function sendEmail1(){\n $id = $this->input->post('category_id');\n\n //make join between email table and relation table and show final category after relation\n $query_result = $this->db->select('email.email', 'email_category_relations.*')\n ->from('email_category_relations as ecr', 'email as email')\n ->where('ecr.cat_id', $id)\n ->join('email', 'ecr.email_id = email.id', 'Right')->get();\n $result = $query_result->result();\n\n foreach ($result as $groupemails){\n $this->load->library('email');\n $this->email->from('[email protected]','Qatar Islamic Contact Us From');\n $this->email->to($groupemails->email);\n $message = '<br>Subject : '.$this->input->post('subject');\n $message .= '<br>Message : '.$this->input->post('message'); \n $this->email->message($message);\n $email_send =$this->email->send();\n //echo \"<script type=\\\"text/javascript\\\">alert(\".$groupemails->email.\");</script>\";\n }\n if($email_send){\n print \"<script type=\\\"text/javascript\\\">alert('Your information has been submitted successfully');</script>\";\n }\n else{\n print \"<script type=\\\"text/javascript\\\">alert('Your information has Not been submitted successfully.Try Again');</script>\";\n }\n $this->load->view('admin/emails');\n }", "public function sendnotificationemails($type,$to,$subject,$username,$linkhref){\r\n\r\n $bodyhead=\"<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>\r\n <html xmlns='http://www.w3.org/1999/xhtml'>\r\n <head>\r\n <meta http-equiv='Content-Type' content='text/html; charset=utf-8' />\r\n <title>\".$this->getsettings('sitetitle','text').\"</title>\r\n </head><body>\";\r\n if( $this->getsettings('email','logoshow') == '1' ) {\r\n $body = \"<img src='\".$this->getsettings('logo','url').\"' alt='\".$this->getsettings('sitetitle','text').\"' title='\".$this->getsettings('sitetitle','text').\"'/>\";\r\n }\r\n else {\r\n $body = '';\r\n }\r\n\r\n $link = \"<a href='\".$linkhref.\"'>\".$this->getsettings($type,'linktext').\"</a>\";\r\n $emContent = $this->getsettings($type,'text');\r\n $emContent = str_replace(\"[username]\",$username,$emContent);\r\n $emContent = str_replace(\"[break]\",\"<br/>\",$emContent);\r\n $emContent = str_replace(\"[linktext]\",$link,$emContent);\r\n\r\n $body .=\"<p>\".$emContent.\"</p>\";\r\n\r\n $from = $this->getsettings('email','fromname');\r\n $from_add = $this->getsettings('email','fromemail');\r\n $headers = \"MIME-Version: 1.0\" . \"\\r\\n\";\r\n $headers .= \"Content-type:text/html;charset=iso-8859-1\" . \"\\r\\n\";\r\n $headers .= \"From: =?UTF-8?B?\". base64_encode($from) .\"?= <$from_add>\\r\\n\" .\r\n 'Reply-To: '.$from_add . \"\\r\\n\" .\r\n 'X-Mailer: PHP/' . phpversion();\r\n mail($to,$subject,$bodyhead.$body.'</body></html>',$headers, '-f'.$from_add);\r\n\r\n if( $type == 'forgotpwdemail' ) {\r\n return '7#email';\r\n }\r\n else {\r\n return '7#register';\r\n }\r\n\r\n die();\r\n\t}", "public function mandrill_test(){\n\t\t\n\t\t$this->load->library('library_bulk_email', '', 'library_bulk_email');\n\t\t\n\t\t$test_users = array(\n\t\t\t'Casey Flynn' => '[email protected]',\n\t\t\t'Casey Flynn1' => '[email protected]',\n\t\t\t'Casey Flynn2' => '[email protected]',\n\t\t\t'Casey Flynn3' => '[email protected]'\n\t\t);\n\t\t\n\t\t\t\t\n\t\tforeach($test_users as $key => $email){\n\t\t\t\n\t\t\t$this->library_bulk_email->add_queue(array(\n\t\t\t\t'html'\t\t=> '<p>This is a test</p>',\n\t\t\t\t'text'\t\t=> 'This is a test',\n\t\t\t\t'subject'\t=> 'Email test from ClubbingOwl',\n\t\t\t\t'to_email'\t=> $email, \n\t\t\t\t'to_name'\t=> $key,\n\t\t\t));\n\t\t\t\t\t\t\n\t\t}\n\t\t\n\t\t$this->library_bulk_email->flush_queue();\n\t\t\n\t\techo 'complete' . PHP_EOL;\t\t\t\n\t\t\n\t}", "function email_post($row) {\n\t\n\textract($row); // take the array from the database and put it into the variables\n\n global $post_type_to_url_part;\n\t\n\t$post_url_end = \"/\" . $post_type_to_url_part[$type] . \"/\" . $post_url . \"/\";\n \t$post_url = \"http://www.thegreenpages.com.au\" . $post_url_end;\n\n\n //Google Analytics API\n //UA-2619469-9\n\n //sign in and grab profile\n $analytics = new analytics('[email protected]', 'greenpages01');\n //$analytics->setProfileByName('Stage 1 - Green Pages');\n $analytics->setProfileById('ga:42443499');\n //set the date range for which I want stats for \n $post_date = $date;\n $new_date = date('Y-m-d');\n $analytics->setDateRange($post_date, $new_date);\n \n //Page views for specific URL\n $pageViewURL = ($analytics->getPageviewsURL($post_url_end));\n $sumURL = 0;\n foreach ($pageViewURL as $data) {\n $sumURL = $sumURL + $data;\n }\n\n //Page views for the section landing page, e.g., the news page\n $pageViewType = ($analytics->getPageviewsURL('/' . $post_type_to_url_part[$type] . '/'));\n $sumType = 0;\n foreach ($pageViewType as $data) {\n $sumType = $sumType + $data;\n }\n\n // Send the email\n\t\n \t$to = \"[email protected], [email protected], [email protected]\";\n\t//$to = $email;\n $bcc = \"[email protected], [email protected], [email protected], [email protected]\";\n\t$subject=\"Report: Your post from \" . $date . \" has gotten a bunch of visitors!\";\n\t$body = '<table width=\"600px\" style=\"font-size: 15px; font-family: helvetica, arial, tahoma; margin: 5px; background-color: rgb(255,255,255);\">';\n\t$body .= '\t<tr><td align=\"center\">';\n\t$body .= '\t<table width=\"640\">';\n\t$body .= '\t<tr style=\"padding: 0 20px 5px 5px;\">';\n\t$body .= '\t<td style=\"font-size: 18px;text-transform:none;color:rgb(100,100,100);padding:0 0 0 5px;\">';\n\t$body .= \"Hi \" . $user_name . \",<br /><br /> \n\tThe \" . $post_type_to_url_part[$type] . \" section of Green Pages where you article is displayed has received \" .$sumType . \" page views in the last 2 weeks!<br /><br /> \n\tYour article from \" . $date . ' <a href=\"' . $post_url . '\"><font color=\"#01aed8\">' . $post_url . \"</font></a> has individually received \" . $sumURL . \" page views!<br /><br />\" .\n\t'You are awesome!<br /><br />The GP Team<br /><br /><a href=\"http://www.thegreenpages.com.au/wp-admin/\"><font color=\"#01aed8\">Upload another super-amazing post</font></a><br /><br />';\n\t$body .= '<hr /><br /><nr />';\n\t$body .= '<div style=\"font-size:14px;\"><em>\"Never doubt that a small group of thoughtful, committed, citizens can change the world. <br /> Indeed, it is the only thing that ever has.\" Margaret Mead</em></div>';\n\t$body .= '</td></tr></table></td></tr></table><br /><br /><br /><br />';\n\n $headers = 'MIME-Version: 1.0' . \"\\r\\n\";\n $headers .= 'Content-type: text/html; charset=iso-8859-1' . \"\\r\\n\";\n $headers .= 'From: [email protected]' . \"\\r\\n\" .\n $headers .= 'Bcc: ' . $bcc . \"\\r\\n\";\n\t\n\tif (mail($to, $subject, $body, $headers)) {\n\techo(\"<p>Message successfully sent</p>\");\n\t} else {\n\techo(\"<p>Message delivery failed</p>\");\n\t}\n\t\n\techo \"<br><br>====================<br><br>To $email:<br><br>$body\";\n}", "function rlip_send_log_emails($plugin, $logids, $manual = false) {\n global $CFG;\n\n //obtain the sanitized list of emails\n $emails = rlip_get_notification_emails($plugin);\n\n //create the zip file\n $archive_name = rlip_compress_logs_email($plugin, $logids, $manual);\n if ($archive_name === false) {\n //no logs to send\n return false;\n }\n\n //send to all appropriate users\n foreach ($emails as $email) {\n $recipient = rlip_get_email_recipient($email);\n rlip_send_log_email($plugin, $recipient, $archive_name);\n }\n\n @unlink($CFG->dataroot.'/'.$archive_name);\n\n return true;\n}", "public function main()\n{\n //get twitter mail data\t\n $results = $this->TwitterMailQueue->find('all');\n \n foreach ( $results as $result ) {\n\t // call twitter function\t\n\t $resp = $this->sendNotification($result['TwitterMailQueue']['twitter_id'], $result['TwitterMailQueue']['mail_data']);\n\t \n\t if ( $resp == 1 ) {\n\t \t//remove the notification from twitter mail queue table\n\t \t$this->removeTwitterQueue($result['TwitterMailQueue']['id']);\n\t\t\n\t\t//create the CSV user data array\n\t \t$csv_data = array('twitter_id'=>$result['TwitterMailQueue']['twitter_id'], 'content'=> $result['TwitterMailQueue']['mail_data']);\n\n\t \t//write the csv\n\t \t$this->writeCsv($csv_data);\n\t } else if ( $resp == 0 ) {\n\t \t$data = array();\n\t \t$data['TwitterMailFailure']['twitter_id'] = $result['TwitterMailQueue']['twitter_id'];\n\t \t$data['TwitterMailFailure']['mail_data'] = $result['TwitterMailQueue']['mail_data'];\n\t \t$this->TwitterMailFailure->create();\n\t \t$this->TwitterMailFailure->save($data); //saving data in failure case in twitter_mail_failure table for further trail \t\n\t } else if ( $resp == 2 ) { //twitter app not authentic case(can be used for future for notification on dashboard)\n\t \t\n\t }\n }\n }", "public function sendOrdersInComming()\n {\n $subject = '[QS-IMS MAILER] DANH SÁCH ĐIỀU ĐỘNG QUÁ HẠN ÁP DỤNG ĐIỀU ĐỘNG';\n $mail = array();\n $sMail = '';\n $to = array();\n $i = 0;\n\n $sql = sprintf('\n\t\t\t\t SELECT\n\t\t\t\t qsiforms.*,\n\t\t\t\t ddtb.*,\n\t\t\t\t qsusers.*,\n \t\t ODanhSachNhanVien.Email AS Email2\n\t\t\t\t FROM OLichThietBi AS ddtb\n\t\t INNER JOIN qsiforms ON qsiforms.IFID = ddtb.IFID_M706\n\t\t\t\t INNER JOIN qsusers ON qsusers.UID = qsiforms.UID\n\t\t INNER JOIN ODanhSachNhanVien ON qsusers.UID = ODanhSachNhanVien.Ref_TenTruyCap\n\t\t\t\t WHERE qsiforms.Status = 1 and qsusers.isActive = 1\n\t\t and ddtb.NgayBatDau <= %1$s\n\t\t\t\t ', $this->_db->quote(date('Y-m-d')));\n $dataSql = $this->_db->fetchAll($sql);\n\n if(count($dataSql) && count($this->to))\n {\n foreach($dataSql as $item)\n {\n if(!isset($to[$item->EMail]))\n {\n $to[$item->EMail] = $item->UserName;\n }\n\n if(!isset($mail[$item->EMail]))\n {\n $mail[$item->EMail] = array();\n }\n\n $mail[$item->EMail][$i]['SoPhieu'] = $item->SoPhieu;\n $mail[$item->EMail][$i]['NgayBatDau'] = $item->NgayBatDau;\n $mail[$item->EMail][$i]['NgayKetThuc'] = $item->NgayKetThuc;\n $mail[$item->EMail][$i]['DeptID'] = $item->DeptID;\n $mail[$item->EMail][$i]['IFID'] = $item->IFID_M706;\n $i++;\n }\n\n if(count($mail))\n {\n foreach($to as $email=>$user)\n {\n if(isset($mail[$email]))\n {\n $sMail = '';\n $sMail .= '<h1>DANH SÁCH ĐIỀU ĐỘNG QUÁ HẠN ÁP DỤNG ĐIỀU ĐỘNG</h1>';\n $sMail .= '<br/>';\n $sMail .= '<table cellpadding=\"0\" cellspacing=\"0\" border=\"1\">';\n $sMail .= '<tr>';\n $sMail .= '<th> SỐ PHIẾU </th>';\n $sMail .= '<th> NGÀY BẮT ĐẦU </th>';\n $sMail .= '<th> NGÀY KẾT THÚC </th>';\n $sMail .= '</tr>';\n\n foreach($mail[$email] as $item)\n {\n $sMail .= '<tr>';\n $sMail .= '<td><a target=\"_blank\" href=\"http://'.$this->domain.'/user/form/edit?ifid='.$item['IFID'].'&deptid='.$item['DeptID'].'\">'.$item['SoPhieu'].'</a></td>';\n $sMail .= '<td>' . Qss_Lib_Date::mysqltodisplay($item->NgayBatDau) . '</td>';\n $sMail .= '<td>' . Qss_Lib_Date::mysqltodisplay($item->NgayKetThuc) . '</td>';\n $sMail .= '</tr>';\n }\n\n $sMail .= '</table>';\n $sMail .= '<br/>';\n $sMail .= '<p style=\"text-align:right\" > <b>QS-IMS Mailer</b> </p>';\n $this->_sendMail($subject, array($email=>$user), $sMail, $this->cc);\n }\n }\n }\n }\n }", "public function send() {\n\t\t\t$emailer = SimpleMail::make()\n\t\t\t->setSubject($this->subject)\n\t\t\t->setMessage($this->body);\n\t\t\t\n\t\t\tforeach ($this->emailto as $contact) {\n\t\t\t\t$emailer->setTo($contact->email, $contact->name);\n\t\t\t}\n\t\t\t\n\t\t\t$emailer->setFrom($this->emailfrom->email, $this->emailfrom->name);\n\t\t\t$emailer->setReplyTo($this->replyto->email, $this->replyto->name);\n\t\t\t\n\t\t\tif ($this->selfbcc) {\n\t\t\t\t$this->add_bcc($this->replyto);\n\t\t\t}\n\t\t\t\n\t\t\t// setBcc allows setting from Array\n\t\t\tif (!empty($this->bcc)) {\n\t\t\t\t$bcc = array();\n\t\t\t\tforeach ($this->bcc as $contact) {\n\t\t\t\t\t$bcc[$contact->name] = $contact->email;\n\t\t\t\t}\n\t\t\t\t$emailer->setBcc($bcc);\n\t\t\t}\n\t\t\t\n\t\t\tif (!empty($this->cc)) {\n\t\t\t\t$cc = array();\n\t\t\t\tforeach ($this->cc as $contact) {\n\t\t\t\t\t$cc[$contact->name] = $contact->email;\n\t\t\t\t}\n\t\t\t\t$emailer->setCc($cc);\n\t\t\t}\n\t\t\t\n\t\t\tif ($this->hasfile) {\n\t\t\t\tforeach($this->files as $file) {\n\t\t\t\t\t$emailer->addAttachment($file);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\treturn $emailer->send();\n\t\t}", "protected function _send()\n\t{\n\t\t$params = array(\n\t\t\t'Action' => 'SendEmail',\n\t\t\t'Version' => '2010-12-01',\n\t\t\t'Source' => static::format_addresses(array($this->config['from'])),\n\t\t\t'Message.Subject.Data' => $this->subject,\n\t\t\t'Message.Body.Text.Data' => $this->body,\n\t\t\t'Message.Body.Text.Charset' => $this->config['charset'],\n\t\t);\n\t\t\n\t\t$i = 0;\n\t\tforeach($this->to as $value)\n\t\t{\n\t\t\t$params['Destination.ToAddresses.member.'.($i+1)] = static::format_addresses(array($value));\n\t\t\t++$i;\n\t\t}\n\t\t\n\t\t$i = 0;\n\t\tforeach($this->cc as $value)\n\t\t{\n\t\t\t$params['Destination.CcAddresses.member.'.($i+1)] = static::format_addresses(array($value));\n\t\t\t++$i;\n\t\t}\n\t\t\n\t\t$i = 0;\n\t\tforeach($this->bcc as $value)\n\t\t{\n\t\t\t$params['Destination.BccAddresses.member.'.($i+1)] = static::format_addresses(array($value));\n\t\t\t++$i;\n\t\t}\n\t\t\n\t\t$i = 0;\n\t\tforeach($this->reply_to as $value)\n\t\t{\n\t\t\t$params['ReplyToAddresses.member.'.($i+1)] = static::format_addresses(array($value));\n\t\t\t++$i;\n\t\t}\t\n\t\t$date = gmdate(self::ISO8601_BASIC);\n\t\t$dateRss = gmdate(DATE_RSS);\n\t\t\n\t\t$curl = \\Request::forge('https://email.' . $this->region . '.amazonaws.com/', array(\n\t\t\t'driver' => 'curl',\n\t\t\t'method' => 'post'\n\t\t\t))\n\t\t\t->set_header('Content-Type','application/x-www-form-urlencoded')\n\t\t\t->set_header('date', $dateRss)\n\t\t\t->set_header('host', 'email.' . $this->region . '.amazonaws.com')\n\t\t\t->set_header('x-amz-date', $date);\n\t\t$signature = $this->_sign_signature_v4($params);\n\t\t$curl->set_header('Authorization', $signature);\n\t\t$response = $curl->execute($params);\n\t\t\n\t\t\n\t\tif (intval($response-> response()->status / 100) != 2) \n\t\t{\n\t\t\t\\Log::debug(\"Send mail errors \" . json_encode($response->response()));\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t\\Log::debug(\"Send mail ok \" . json_encode($response->response()));\n\t\treturn true;\n\t}", "public static function sendEmail($data) {\r\n\r\n // get user data to fill in automatically\r\n $user = Auth::getUser();\r\n // Email Settings\r\n // Send email back to user and the home store \r\n $cc[] = $user->email;\r\n\r\n // Live Address\r\n $to = '[email protected]';\r\n // Test address\r\n //$to = '[email protected]';\r\n\r\n // getting the From store email\r\n $allStores = Helpers::getStores();\r\n foreach ($allStores as $store) {\r\n if ($store['storeNumber'] == $user->storeNumber){\r\n //uncomment for Live\r\n //$cc[] = ($store['storeEmail']);\r\n $storeName = $store['storeName'];\r\n }\r\n\r\n }\r\n // HTML Email Version\r\n $partCount = count($data['catNum']);\r\n $msgHeader = '<b>Store Requesting: &emsp;</b>' . $storeName . '<br />';\r\n $msgHeader .= '<b>Requestor: &emsp;</b>' . $user->name . '<br />';\r\n $msgHeader .= '<b><h3>If Stolen</h3></b>';\r\n $msgHeader .= '<b>Police Department: &emsp;</b>' . $data['policeDepartment'] . '<br />';\r\n $msgHeader .= '<b>Date Reported to Police: &emsp;</b>' . $data['policeDate'] . '<br />';\r\n $msgHeader .= '<b>Police Report Number: &emsp;</b>' . $data['reportNum'] . '<br />';\r\n $msgHeader .= '<b>Reported to NER by: &emsp;</b>' . $data['nerReportBy'] . '<br />';\r\n $msgHeader .= '<b>Date Reported to NER: &emsp;</b>' . $data['nerDate'] . '<br />';\r\n $msgHeader .= '<b>Reported to Manufacturer by: &emsp;</b>' . $data['mfgReportBy'] . '<br />';\r\n $msgHeader .= '<b>Date Reported to Manufacturer: &emsp;</b>' . $data['mfgDate'] . '<br />';\r\n\r\n $msgFooter = '<h3>Details of the Disposal</h3>' . $data['disposal_comments'];\r\n $msg = '<h3>Disposal Item Line Details</h3>';\r\n $msg .= '<table border=\"1\"><tr><b><td>Cat Num</td><td>Item Num</td><td>Serial Num</td><td>Manufacturer</td><td>Qty</td><td>Disposal Type</td></b></tr>';\r\n for ($i = 0;$i<$partCount; $i++){\r\n $msg .= \"<tr>\";\r\n $msg .= \"<td>\" . $data['catNum'][$i] . \"</td>\";\r\n $msg .= \"<td>\" . $data['itmNum'][$i] . \"</td>\";\r\n $msg .= \"<td>\" . $data['serialNum'][$i] . \"</td>\";\r\n $msg .= \"<td>\" . $data['mfg'][$i] . \"</td>\";\r\n $msg .= \"<td>\" . $data['quantity'][$i] . \"</td>\";\r\n $msg .= \"<td>\" . $data['disposalCode'][$i] . \"</td>\";\r\n $msg .= \"</tr>\";\r\n }\r\n $msg .=\"</table>\";\r\n\r\n // Text only part of the email\r\n\r\n $textHeader = \"Store Requesting: \" . $storeName . \"\\r\\n\";\r\n $textHeader .= \"Requestor: \" . $user->name . \"\\r\\n\\r\\n\";\r\n $textHeader .= \"If Stolen: \\r\\n\\r\\n\";\r\n $textHeader .= \"Police Department: \" . $data['policeDepartment'] . \"\\r\\n\";\r\n $textHeader .= \"Date Reported to Police\" . $data['policeDate'] . \"\\r\\n\";\r\n $textHeader .= \"Police Report Number: \" . $data['reportNum'] . \"\\r\\n\";\r\n $textHeader .= \"Reported to NER by: \" . $data['nerReportBy'] . \"\\r\\n\";\r\n $textHeader .= \"Date Reported to NER\" . $data['nerDate'] . \"\\r\\n\";\r\n $textHeader .= \"Reported to Manufacturer by: \" . $data['mfgReportBy'] . \"\\r\\n\";\r\n $textHeader .= \"Date Reported to Manufacturer: \" . $data['mfgDate'] . \"\\r\\n\";\r\n\r\n $textFooter = 'Details of the Disposal \\r\\n' . $data['disposal_comments'];\r\n $textBody = \"Cat # Item # Serial # Manufacturer Quantity Disposal Type\";\r\n\r\n for ($i = 0; $i<$partCount; $i++){\r\n $textBody .= $data['catNum'][$i] . ' ';\r\n $textBody .= $data['itmNum'][$i] . ' ';\r\n $textBody .= $data['serialNum'][$i] . ' ';\r\n $textBody .= $data['mfg'][$i] . ' ';\r\n $textBody .= $data['quantity'][$i] . ' ';\r\n $textBody .= $data['disposalCode'][$i] . ' ';\r\n }\r\n\r\n $subject = 'New Disposal Request';\r\n $text = $textHeader . $textBody . $textFooter;\r\n $html = $msgHeader . $msg . $msgFooter;\r\n\r\n Mail::send($to, $subject, $text, $html, $cc);\r\n \r\n // remove after saveDisposal() is written\r\n\r\n }", "public function sendemails(){\n $sql = \"SELECT DATEDIFF( `date_for_renew` , NOW( ) ) AS `DAYS` , `email` , `first_name` , `last_name` \n FROM `subscriptions` \n JOIN `artists` ON `artists`.`id` = `subscriptions`.`artist_id` \n HAVING DAYS = '30' || DAYS ='15' || DAYS = '1';\";\n $query = $this->db->query($sql);\n $this->load->library('general_library');\n $gl = new general_library();\n foreach($query->result() as $email):\n $email_array = array();\n $email_array['subject'] = \"Your subscription has \" . $email->DAYS . \" left.\";\n $email_array['message'] = \"Your subscription has \" . $email->DAYS . \" left.\";\n $email_array['email'] = $email->email;\n $gl->sendEmail($email_array);\n endforeach;\n \n return true;\n }", "private function process_emails(&$doing){\n\n if (isset($_GET['hotel_confirmation_once'])){\n // ----------------------- Ask for the welcome mail attachment\n print x(\"span class='only_online'\",\n\t x(\"form action='\".b_url::same('?resetcache_once=1').\"' method='post' enctype='multipart/form-data' name='upload_mail_attachment'\",\n\t\tx('table',\n\t\t x('tr',\n\t\t x('td','Please select PDF file').\n\t\t x('td',\"<input name='_virt_att' type='file' />\").\n\t\t \"<input name='v_id' value='\".$_GET['hotel_confirmation_once'].\"' type='hidden' />\".\n\t\t \"<input name='lease_id' value='\".$_GET['lease_once'].\"' type='hidden' />\").\n\t\t x('tr',\n\t\t x('td colspan=2',x('center',\"<input type='submit' value='submit'/>\"))))));\n }elseif (isset($_FILES['_virt_att'])){\n // ----------------------- Save the welcome mail attachment\n VM_mailer()->save_attachment($_REQUEST['v_id'],$_REQUEST['lease_id'],$_FILES['_virt_att'],'hotel_confirmation');\n }elseif (isset($_GET['mail2all_deny_once'])){\n // ----------------------- Send deny E-mails to all refused attenders of the event\n $q = $this->query();\n while($rec = myPear_db()->next_record($q)){\n\tif(VM_mailer()->m_applicant_deny($rec['v_id'],'status',$rec['v_status']) === False){\n\t VM_mailer()->m_applicant_deny($rec['v_id'],$no_preview=True);\n\t}\n }\n }\n if(isset($_GET['mail2all_welcome_once'])){\n // ----------------------- Send welcome E-mails to all accepted attenders of the event\n $q = $this->query();\n while($rec = myPear_db()->next_record($q)){\n\tif(VM_mailer()->welcome_applicant($rec['v_id'],'status',$rec['v_status']) === False){\n\t VM_mailer()->welcome_applicant($rec['v_id'],@$rec['lease_id'],$no_preview=True);\n\t}\n }\n }elseif (isset($_GET['mail_once'])){\n //\n // ----------------------- Preview e-mails \n //\n $doing = 'send_accept_deny';\n switch($_GET['mail_once']){ \n case 'vm_mail_yes':\n\tVM_mailer()->welcome_applicant($_GET['v_id'],$_GET['lease_id']);\n\tbreak;\n\t\n case 'vm_mail_no':\n\tVM_mailer()->m_applicant_deny($_GET['v_id']);\n\tbreak;\n\t\n case 'vm_mail_info':\n\tVM_mailer()->m_applicant_info_mail($_GET['v_id']);\n\tbreak;\n\n case 'vm_mail_pwd':\n\tVM_mailer()->remind_organizer($_GET['v_id'],VM::$e,'pwd',False);\n\tbreak;\n }\n }elseif(isset($_GET['sendmail_once'])){\n //\n // ----------------------- Sending the e-mail after preview\n //\n switch($sendmail_once=$_GET['sendmail_once']){\n case 'send':\n\tb_debug::_debug(\"sendmail_once='$sendmail_once'\",$this);\n\tbreak;\n default:\n\tb_debug::_debug(\"sendmail_once='$sendmail_once'... What to do???\",$this);\n }\n }\n }", "private function sendDailyPubEmail()\n {\n foreach(Publisher::all() as $publisher) {\n $message = (new PublisherDaily($publisher->id))->onQueue('platform-processing');\n Mail::to($publisher->email,$publisher->name)->send($message);\n Log::info(\"Sent Daily Email To: \" . $publisher->email);\n }\n }", "public function send_email() {\n $toemail = $this->params['toemail'];\n $subject = $this->params['subject'];\n $content = $this->params['content'];\n }", "function SendMail($email_title,$email_body,$reboot)\n{\n\tif($email_title == \"\" || $email_body == \"\" || $email_title == null || $email_body == null)\n\t{\n\t\tfile_put_contents(\"result.txt\",\"email body or title is null\\n\",FILE_APPEND);\n\t\texit(\"email内容为空或者email标题为空\\n\");\t\t\n\t}\n\n\t//load basic class: SMTPMailer\n\trequire(\"SMTPMailer.php\");\n\n\tif($reboot == \"start\"){//说明第一次启动程序\n\t\tfile_put_contents(\"result.txt\",\"\");\t\t\n\t\t//链接到数据库并获得要发送的邮件地址\n\t\t$connection = mysql_connect(\"localhost\", \"mydonor\", \"MYDONOR@))(\") or die (\"Unable toconnect!\");\n\t\tmysql_select_db(\"mydonor\") or die (\"Unable to select database!\"); \n\t\tmysql_query(\"SET NAMES UTF8\");\n\t\t$query = \"SELECT distinct email_addr FROM if_donor_email WHERE priority >= 0 and deleted = 0 ORDER BY id\"; \n\t\t$result = mysql_query($query) or die (\"Error in query: $query. \" . mysql_error());\n\t\t//写下本次要发送的邮件地址到emaillist\n\t\tfile_put_contents(\"emaillist.txt\",\"\");\n\t\t$i = 0;\n\t\twhile($email = mysql_fetch_row($result)){\n\t\t\tfile_put_contents(\"emaillist.txt\",$i.\" \".$email[0].\"\\n\",FILE_APPEND);\t\n\t\t\t$i ++;\n\t\t}\n\t\t//计算本次要发送的邮件数目\n\t\t$email_num = mysql_num_rows($result);\n\t\tif($i !== $email_num) die (\"出错:email数目和写入emaillist文件的email数不一致\"); \n\t\t//关闭数据库链接\n\t\tmysql_close($connection);\n\n\t\t//从emaillist.txt中读入本次待发送的邮件列表\n\t\t$file= \"emaillist.txt\";\n\t\t$emaillist=file($file,FILE_IGNORE_NEW_LINES);\n\t\tif($email_num !== count($emaillist)) die (\"出错:email数目和emaillist文件总行数不一致\"); \n\t\tfor($i = 0; $i < count($emaillist); $i ++){\n\t\t\t$email[$i] = preg_split(\"/\\s+/\",trim($emaillist[$i]));\t\t\n\t\t}\n\t\t//开始发送邮件\n\t\tif(count($email) > 0){\n\t\t\t\tfor($i = 0; $i < count($email); $i ++)\n\t\t\t\t{\n\t\t\t\t\t$mailer=new SMTPMailer();\n\t\t\t\t\t$mailer->Host=\"202.38.64.8\";\n\t\t\t\t\t$mailer->UserName=\"\";\n\t\t\t\t\t$mailer->Password=\"\";\n\t\t\t\t\t$mailer->From=\"\";\n\t\t\t\t\t$mailer->ContentType=\"text/html\";\n\t\t\t\t\t$mailer->Subject=$email_title; \n\t\t\t\t\t$mailer->Body=$email_body;\n\t\t\t\t\t$mailer->To=$email[$i][1];\n\t\t\t\t\tif($i !== intval($email[$i][0])) exit(\"当前发送email地址的id和emaillist.txt中的记录行号id不一致\\n\");\n\t\t\t\t\tif($mailer->Send()){\n\t\t\t\t\t\tfile_put_contents(\"result.txt\",$i.\" \".$email[$i][1].\" 成功\\n\",FILE_APPEND);\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tfile_put_contents(\"result.txt\",$i.\" \".$email[$i][1].\" \".$mailer->Error.\"\\n\",FILE_APPEND);\n/*\t\t\t\t\t\tif(strstr($mailer->Error,\"Recipient\") !== false){\n\t\t\t\t\t\t\t$connection = mysql_connect(\"localhost\", \"mydonor\", \"MYDONOR@))(\") or die (\"Unable toconnect!\");\n\t\t\t\t\t\t\tmysql_select_db(\"mydonor\") or die (\"Unable to select database!\"); \n\t\t\t\t\t\t\tmysql_query(\"SET NAMES UTF8\");\n\t\t\t\t\t\t\t$query = \"update if_donor_email set priority = -1 where email_addr = '\".$email[0].\"'\"; \n\t\t\t\t\t\t\t$setResult = mysql_query($query);\n\t\t\t\t\t\t\t$error = mysql_error();\n\t\t\t\t\t\t}*/\n\t\t\t\t\t}\n\t\t\t\t\tfile_put_contents(\"currpos.txt\",$i);\n\t\t\t\t\tsleep(5);\n\t\t\t\t}\n\t\t}\t\t\t\t\n\t}\n\telse if($reboot == \"restart\"){//说明属于重启\n\t\t$file= \"currpos.txt\";\n\t\t$currpos=file($file,FILE_IGNORE_NEW_LINES);\n\t\tif(count($currpos) === 0) exit(\"在重启模式下,currpos.txt不能为空\\n\");\n\t\t$from = intval($currpos[0])+1; //重启后应该从第几个email开始发送\n\t\tif($from < 1) exit(\"$from 值不对\");\n\t\t\n\t\t//从emaillist.txt中读入本次待发送的邮件列表\n\t\t$file= \"emaillist.txt\";\n\t\t$emaillist =file($file,FILE_IGNORE_NEW_LINES);\n\t\tfor($i = 0; $i < count($emaillist); $i ++){\n\t\t\t$email[$i] = preg_split(\"/\\s+/\",trim($emaillist[$i]));\t\t\n\t\t}\n\t\t//开始发送邮件\n\t\tif(count($email) > 0){\n\t\t\t\tfor($i = $from; $i < count($email); $i ++)\n\t\t\t\t{\n\t\t\t\t\t$mailer=new SMTPMailer();\n\t\t\t\t\t$mailer->Host=\"202.38.64.8\";\n\t\t\t\t\t$mailer->UserName=\"\";\n\t\t\t\t\t$mailer->Password=\"\";\n\t\t\t\t\t$mailer->From=\"\";\n\t\t\t\t\t$mailer->ContentType=\"text/html\";\n\t\t\t\t\t$mailer->Subject=$email_title; \n\t\t\t\t\t$mailer->Body=$email_body;\n\t\t\t\t\t$mailer->To=$email[$i][1];\n\t\t\t\t\tif($i !== intval($email[$i][0])) exit(\"当前发送email地址的id和emaillist.txt中的记录id不一致\\n\");\n\t\t\t\t\tif($mailer->Send()){\n\t\t\t\t\t\tfile_put_contents(\"result.txt\",$i.\" \".$email[$i][1].\" 成功\\n\",FILE_APPEND);\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tfile_put_contents(\"result.txt\",$i.\" \".$email[$i][1].\" \".$mailer->Error.\"\\n\",FILE_APPEND);\n/*\t\t\t\t\t\tif(strstr($mailer->Error,\"Recipient\") !== false){\n\t\t\t\t\t\t\t$connection = mysql_connect(\"localhost\", \"mydonor\", \"MYDONOR@))(\") or die (\"Unable toconnect!\");\n\t\t\t\t\t\t\tmysql_select_db(\"mydonor\") or die (\"Unable to select database!\"); \n\t\t\t\t\t\t\tmysql_query(\"SET NAMES UTF8\");\n\t\t\t\t\t\t\t$query = \"update if_donor_email set priority = -1 where email_addr = '\".$email[0].\"'\"; \n\t\t\t\t\t\t\t$setResult = mysql_query($query);\n\t\t\t\t\t\t\t$error = mysql_error();\n\t\t\t\t\t\t}*/\n\t\t\t\t\t}\n\t\t\t\t\tfile_put_contents(\"currpos.txt\",$i);\n\t\t\t\t\tsleep(5);\n\t\t\t\t}\n\t\t}\t\t\t\n\t\t\t\t\t\n\t}else{//既不属于第一次启动,也不属于重启,说明有问题\n\t\texit(\"出错:/既不属于第一次启动,也不属于重启,说明有问题\"); \t\n\t}\t\n}", "function email_showmails($userid, $order = '', $page=0, $perpage=10, $options=NULL, $search=false, $mailssearch=NULL) {\n\n\tglobal $CFG, $COURSE, $SESSION;\n\n\t// CONTRIB-690\n\tif ( ! empty( $_POST['perpage'] ) and is_numeric($_POST['perpage']) ) {\n\t\t$SESSION->email_mailsperpage = $_POST['perpage'];\n\t} else if (!isset($SESSION->email_mailsperpage) or empty($SESSION->email_mailsperpage) ) {\n\t\t$SESSION->email_mailsperpage = 10; // Default value\n\t}\n\n\trequire_once('tablelib.php');\n\trequire_once('email.class.php');\n\n\t// Get actual course\n\tif (! $course = get_record(\"course\", \"id\", $COURSE->id)) {\n print_error('invalidcourseid', 'block_email_list');\n }\n\n if ($course->id == SITEID) {\n $coursecontext = get_context_instance(CONTEXT_SYSTEM); // SYSTEM context\n } else {\n $coursecontext = get_context_instance(CONTEXT_COURSE, $course->id); // Course context\n }\n\n\t$url = '';\n\t// Build url part options\n \tif ($options) {\n \t\t$url = email_build_url($options);\n }\n\n\t/// Print all mails in this HTML file\n\n\t// Should use this variable so that we don't break stuff every time a variable is added or changed.\n $baseurl = $CFG->wwwroot.'/blocks/email_list/email/index.php?'.$url. '&amp;page='.$page.'&amp;perpage='.$perpage;\n\n // Print init form from send data\n echo '<form id=\"sendmail\" action=\"'.$CFG->wwwroot.'/blocks/email_list/email/index.php?id='.$course->id.'&amp;folderid='.$options->folderid.'\" method=\"post\" target=\"'.$CFG->framename.'\" name=\"sendmail\">';\n\n\tif ( $course->id == SITEID ) {\n\t\t$tablecolumns = array('', 'icon', 'course', 'subject', 'writer', 'timecreated');\n\t} else {\n\t\t$tablecolumns = array('', 'icon', 'subject', 'writer', 'timecreated');\n\t}\n\n\t$folder = NULL;\n\tif ( isset( $options->folderid) ) {\n\t\tif ( $options->folderid != 0 ) {\n\t\t\t// Get folder\n\t\t\t$folder = email_get_folder($options->folderid);\n\t\t} else {\n\t\t\t// solve problem with select an x mails per page for maintein in this folder\n\t\t\tif ( isset($options->folderoldid) && $options->folderoldid != 0 ) {\n\t\t\t\t$options->folderid = $options->folderoldid;\n\t\t\t\t$folder = email_get_folder($options->folderid);\n\t\t\t}\n\t\t}\n\t}\n\n\t// If actual folder is inbox type, ... change tag showing.\n\tif ( $folder ) {\n\t\tif ( ( email_isfolder_type($folder, EMAIL_INBOX) ) ) {\n\t\t\t$strto = get_string('from', 'block_email_list');\n\t\t} else {\n\t\t\t$strto = get_string('to', 'block_email_list');\n\t\t}\n\t} else {\n\t\t$strto = get_string('from', 'block_email_list');\n\t}\n\n\tif ( $course->id == SITEID ) {\n \t$tableheaders = array('', '', get_string('course'), get_string('subject', 'block_email_list'), $strto, get_string('date', 'block_email_list'));\n\t} else {\n\t\t$tableheaders = array('', '', get_string('subject', 'block_email_list'), $strto, get_string('date', 'block_email_list'));\n\t}\n\n\n\t$table = new email_flexible_table('list-mails-'.$userid);\n\n $table->define_columns($tablecolumns);\n $table->define_headers($tableheaders);\n $table->define_baseurl($baseurl);\n\n\t$table->set_attribute('align', 'center');\n\t$table->set_attribute('width', '100%');\n\t$table->set_attribute('class', 'emailtable');\n\n\t$table->set_control_variables(array(\n TABLE_VAR_SORT => 'ssort',\n TABLE_VAR_HIDE => 'shide',\n TABLE_VAR_SHOW => 'sshow',\n TABLE_VAR_IFIRST => 'sifirst',\n TABLE_VAR_ILAST => 'silast',\n TABLE_VAR_PAGE => 'spage'\n ));\n\n\t$table->sortable(true, 'timecreated', SORT_DESC);\n\n\t$table->setup();\n\n\t// When no search\n\tif (! $search) {\n\t\t// Get mails\n\t\t$mails = email_get_mails($userid, $course->id, $table->get_sql_sort(), '', '', $options);\n\t} else {\n\t\t$mails = $mailssearch;\n\t}\n\n\t// Define long page.\n\t$totalcount = count($mails);\n\t$table->pagesize($SESSION->email_mailsperpage, $totalcount);\n\n\t$table->inputs(true);\n\n\t// Now, re-getting emails, apply pagesize (limit)\n\tif (! $search) {\n\t\t// Get mails\n\t\t$mails = email_get_mails($userid, $course->id, $table->get_sql_sort(), $table->get_page_start(), $table->get_page_size(), $options);\n\t}\n\n\tif (! $mails ) {\n\t\t$mails = array();\n\t}\n\n\n\t$mailsids = email_get_ids($mails);\n\n\t// Print all rows\n\tforeach ($mails as $mail) {\n\n\t\t$attribute = array();\n\t\t$email = new eMail();\n\t\t$email->set_email($mail);\n\n\t\tif ( $folder ) {\n\t\t\tif ( email_isfolder_type($folder, EMAIL_SENDBOX) ) {\n\t\t\t\t$struser = $email->get_users_send(has_capability('moodle/site:viewfullnames', $coursecontext));\n\t\t\t} else if ( email_isfolder_type($folder, EMAIL_INBOX) ) {\n\n\t\t\t\t$struser = $email->get_fullname_writer(has_capability('moodle/site:viewfullnames', $coursecontext));\n\t\t\t\tif (! $email->is_readed($userid, $mail->course) ) {\n \t\t$attribute = array( 'bgcolor' => $CFG->email_table_field_color);\n\t\t\t\t}\n\n\t\t\t} else if ( email_isfolder_type($folder, EMAIL_TRASH) ){\n\n\t\t\t\t$struser = $email->get_fullname_writer(has_capability('moodle/site:viewfullnames', $coursecontext));\n\n\t\t\t\tif (! $email->is_readed($userid, $mail->course) ) {\n \t\t $attribute = array( 'bgcolor' => $CFG->email_table_field_color);\n\t\t\t\t}\n\t\t\t} else if ( email_isfolder_type($folder, EMAIL_DRAFT) ) {\n\n\t\t\t\t$struser = $email->get_users_send(has_capability('moodle/site:viewfullnames', $coursecontext));\n\n\t\t\t\tif (! $email->is_readed($userid, $mail->course) ) {\n \t\t $attribute = array( 'bgcolor' => $CFG->email_table_field_color);\n\t\t\t\t}\n\t\t\t} else {\n\n\t\t\t\t$struser = $email->get_fullname_writer(has_capability('moodle/site:viewfullnames', $coursecontext));\n\n\t\t\t\tif (! $email->is_readed($userid, $mail->course) ) {\n \t\t $attribute = array( 'bgcolor' => $CFG->email_table_field_color);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t// Format user's\n\t\t\t$struser = $email->get_fullname_writer(has_capability('moodle/site:viewfullnames', $coursecontext));\n\t\t\tif (! $email->is_readed($userid, $mail->course) ) {\n \t $attribute = array( 'bgcolor' => $CFG->email_table_field_color);\n\t\t\t}\n\t\t}\n\n\t\tif (! isset($options->folderid) ) {\n\t\t\t$options->folderid = 0;\n\t\t}\n\n\t\tif ( email_isfolder_type($folder, EMAIL_DRAFT) ) {\n\t\t\t$urltosent = '<a href=\"'.$CFG->wwwroot.'/blocks/email_list/email/sendmail.php?id='.$mail->id.'&amp;action='.EMAIL_EDITDRAFT.'&amp;course='.$course->id.'\">'.$mail->subject.'</a>';\n\t\t} else {\n\t\t\tif ( $course->id == SITEID ) {\n\t\t\t\t$urltosent = '<a href=\"'.$CFG->wwwroot.'/blocks/email_list/email/view.php?id='.$mail->id.'&amp;action='.EMAIL_VIEWMAIL.'&amp;course='.$mail->course.'&amp;folderid='.$options->folderid.'&amp;mails='.$mailsids.'\">'.$mail->subject.'</a>';\n\t\t\t} else {\n\t\t\t\t$urltosent = '<a href=\"'.$CFG->wwwroot.'/blocks/email_list/email/view.php?id='.$mail->id.'&amp;action='.EMAIL_VIEWMAIL.'&amp;course='.$course->id.'&amp;folderid='.$options->folderid.'&amp;mails='.$mailsids.'\">'.$mail->subject.'</a>';\n\t\t\t}\n\t\t}\n\n\t\t$attachment = '';\n\t\tif ( $email->has_attachments() ) {\n\t\t\t$attachment = '<img src=\"'.$CFG->wwwroot.'/blocks/email_list/email/images/clip.gif\" alt=\"attachment\" /> ';\n\t\t}\n\n\t\t// Display diferent color if mail is reply or reply all\n\t\t$extraimginfo = '';\n\t\tif ( $email->is_answered($userid, $course->id) ) {\n\t\t\t// Color td\n\t\t\tunset($attribute);\n\t\t\t$attribute = array('bgcolor' => $CFG->email_answered_color);\n\n\t\t\t// Adding info img\n\t\t\t$extraimginfo = '<img src=\"'.$CFG->wwwroot.'/blocks/email_list/email/images/answered.gif\" alt=\"\" /> ';\n\n\t\t}\n\n\t\tif (! $course_mail = get_record(\"course\", \"id\", $mail->course)) {\n print_error('invalidcourseid', 'block_email_list');\n }\n\n\t\tif ( $course->id == SITEID ) {\n\t\t\t$table->add_data( array (\n\t '<input id=\"mail\" type=\"checkbox\" name=\"mailid[]\" value=\"'.$mail->id.'\" />',\n\t $course_mail->fullname,\n\t $attachment.$extraimginfo,\n\t $urltosent,\n\t $struser,\n\t userdate($mail->timecreated) ) ,\n\t $attribute\n\t );\n\t\t} else {\n\t\t\t$table->add_data( array (\n\t '<input id=\"mail\" type=\"checkbox\" name=\"mailid[]\" value=\"'.$mail->id.'\" />',\n\t $attachment.$extraimginfo,\n\t $urltosent,\n\t $struser,\n\t userdate($mail->timecreated) ) ,\n\t $attribute\n\t );\n\t\t}\n\n\t\t// Save previous mail\n \t$previousmail = $mail->id;\n\t}\n\n\t$table->print_html();\n\n\n\n\t// Print select action, if have mails\n\tif ( $mails ) {\n\t\temail_print_select_options($options, $SESSION->email_mailsperpage);\n\t}\n\n\t// End form\n\techo '</form>';\n\n\treturn true;\n}", "function MyApp_Email_Send($user,$mailhash,$filters=array(),$attachments=array())\n {\n if (!is_array($attachments)) { $attachments=array($attachments); }\n\n $mailhash=\n $this->MyApp_Email_Hash_Get\n (\n $user,\n $mailhash,\n $filters\n );\n \n $this->EmailStatus=FALSE;\n\n if (!empty($this->DBHash[ \"MailDebug\" ]))\n {\n foreach (array(\"To\",\"CC\",\"BCC\",\"ReplyTo\") as $key)\n {\n if (!is_array($mailhash[ $key ]))\n {\n $mailhash[ $key ]=array($mailhash[ $key ]);\n }\n }\n \n echo \n \"Fake sending...<BR>\".\n \"To: \".\n join(\",<BR>\",$mailhash[ \"To\" ]).\n \"<BR>\".\n \"CC: \".\n join(\",<BR>\",$mailhash[ \"CC\" ]).\n \"<BR>\".\n \"BCC: \".\n join(\",<BR>\",$mailhash[ \"BCC\" ]).\n \"<BR>\".\n \"ReplyTo: \".\n join(\",<BR>\",$mailhash[ \"ReplyTo\" ]).\n \"<BR>\".\n \"Subject: \".$mailhash[ \"Subject\" ].\n \"<BR>\".\n \"Body: \".preg_replace('/\\n/',\"<BR>\",$mailhash[ \"Body\" ]).\n \"<BR>\".\n \"\";\n\n if (!empty($attachments))\n {\n echo\n \"Attachments:\".\n $this->BR().\n join($this->BR(),$attachments).\n \"\";\n }\n $this->EmailStatus=TRUE;\n }\n else\n {\n if ($this->MyEmail_Email_Send($this->MyApp_Mail_Info_Get(),$mailhash,$attachments))\n {\n $this->EmailStatus=TRUE;\n }\n else\n {\n $this->EmailStatusMessage=\"Erro enviando email: \".$this->Email_PHPMailer->ErrorInfo;\n $this->EmailStatus=FALSE; \n }\n\n echo $this->EmailStatusMessage($mailhash,$attachments);\n }\n\n return $this->EmailStatus;\n }", "public function sendEmail()\n\t{\n\t\tif (empty($this->get('crmid'))) {\n\t\t\treturn;\n\t\t}\n\t\t$moduleName = 'Contacts';\n\t\t$recordModel = Vtiger_Record_Model::getInstanceById($this->get('crmid'), $moduleName);\n\t\tif ($recordModel->get('emailoptout')) {\n\t\t\t$emailsFields = $recordModel->getModule()->getFieldsByType('email');\n\t\t\t$addressEmail = '';\n\t\t\tforeach ($emailsFields as $fieldModel) {\n\t\t\t\tif (!$recordModel->isEmpty($fieldModel->getFieldName())) {\n\t\t\t\t\t$addressEmail = $recordModel->get($fieldModel->getFieldName());\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!empty($addressEmail)) {\n\t\t\t\t\\App\\Mailer::sendFromTemplate([\n\t\t\t\t\t'template' => 'YetiPortalRegister',\n\t\t\t\t\t'moduleName' => $moduleName,\n\t\t\t\t\t'recordId' => $this->get('crmid'),\n\t\t\t\t\t'to' => $addressEmail,\n\t\t\t\t\t'password' => $this->get('password_t'),\n\t\t\t\t\t'login' => $this->get('user_name'),\n\t\t\t\t\t'acceptable_url' => Settings_WebserviceApps_Record_Model::getInstanceById($this->get('server_id'))->get('acceptable_url')\n\t\t\t\t]);\n\t\t\t}\n\t\t}\n\t}", "function do_contact_supplier_email_all($adata, $aret_flag=0) {\n\t# Dim Some Vars\n\t\tglobal $_CCFG, $_TCFG, $_DBCFG, $db_coin, $_UVAR, $_LANG, $_SERVER, $_nl, $_sp;\n\t\t$DesiredGroup\t= 0;\n\t\t$DesiredServer\t= 0;\n\t\t$DesiredAlias\t= 0;\n\t\t$DesiredClient\t= 0;\n\t\t$_ret_msg\t\t= '';\n\n\t# Check if we are sending to an alias for a supplier\n\t\t$pos1 = strpos(strtolower($adata['cc_s_id']), 'alias');\n\t\tIF ($pos1 !== false) {\n\t\t\t$pieces = explode('|', $adata['cc_s_id']);\n\t\t\t$DesiredAlias = $pieces[1];\n\t\t}\n\n\t# Check if we are sending to all contacts for a supplier\n\t\t$pos2 = strpos(strtolower($adata['cc_s_id']), 'contacts');\n\t\tIF ($pos2 !== false) {\n\t\t\t$pieces = explode('|', $adata['cc_s_id']);\n\t\t\t$DesiredSupplier = $pieces[1];\n\t\t}\n\n\t# Get site contact information array\n\t\t$_mcinfo\t= get_contact_info($adata['cc_mc_id']);\n\n\t# Set Query for select\n\t\t$query\t= 'SELECT ';\n\n\t\tIF ($DesiredAlias) {\n\t\t\t$query .= $_DBCFG['suppliers_contacts'].'.contacts_email, ';\n\t\t\t$query .= $_DBCFG['suppliers_contacts'].'.contacts_name_first, ';\n\t\t\t$query .= $_DBCFG['suppliers_contacts'].'.contacts_name_last';\n\t\t} ELSEIF ($DesiredSupplier) {\n\t\t\t$query .= $_DBCFG['suppliers'].'.s_email, ';\n\t\t\t$query .= $_DBCFG['suppliers'].'.s_name_first, ';\n\t\t\t$query .= $_DBCFG['suppliers'].'.s_name_last, ';\n\t\t\t$query .= $_DBCFG['suppliers_contacts'].'.contacts_email, ';\n\t\t\t$query .= $_DBCFG['suppliers_contacts'].'.contacts_name_first, ';\n\t\t\t$query .= $_DBCFG['suppliers_contacts'].'.contacts_name_last';\n\t\t} ELSE {\n\t\t\t$query .= $_DBCFG['suppliers'].'.s_email, ';\n\t\t\t$query .= $_DBCFG['suppliers'].'.s_name_first, ';\n\t\t\t$query .= $_DBCFG['suppliers'].'.s_name_last';\n\t\t}\n\n\t\t$query .= ' FROM ';\n\n\t\tIF ($DesiredAlias) {\n\t\t\t$query .= $_DBCFG['suppliers_contacts'];\n\t\t\t$query .= ' WHERE ('.$_DBCFG['suppliers_contacts'].'.contacts_id='.$DesiredAlias.')';\n\n\t\t} ELSEIF ($DesiredSupplier) {\n\t\t\t$query .= $_DBCFG['suppliers'].', '.$_DBCFG['suppliers_contacts'];\n\t\t\t$query .= ' WHERE (';\n\t\t\t$query .= $_DBCFG['suppliers'].'.s_id='.$DesiredSupplier.' OR (';\n\t\t\t$query .= $_DBCFG['suppliers'].'.s_id='.$_DBCFG['suppliers_contacts'].'.contacts_s_id AND ';\n\t\t\t$query .= $_DBCFG['suppliers_contacts'].'.contacts_s_id='.$DesiredSupplier.')';\n\t\t\t$query .= ')';\n\n\t\t} ELSEIF ($adata['cc_s_id'] == '-1') {\n\t\t\t$query .= $_DBCFG['suppliers'];\n\t\t\t$query .= \" WHERE s_status='active' OR s_status='\".$db_coin->db_sanitize_data($_CCFG['S_STATUS'][1]).\"'\";\n\n\t\t} ELSE {\n\t\t\t$query .= $_DBCFG['suppliers'];\n\t\t\t$query .= ' WHERE ('.$_DBCFG['suppliers'].'.s_id='.$adata['cc_s_id'].')';\n\t\t}\n\n\t# Do select\n\t\t$result\t\t= $db_coin->db_query_execute($query);\n\t\t$numrows\t\t= $db_coin->db_query_numrows($result);\n\t\t$_emails_sent\t= 0;\n\t\t$_emails_error\t= 0;\n\t\t$_sento\t\t= '';\n\n\t# Process query results\n\t\twhile($row = $db_coin->db_fetch_array($result)) {\n\n\t\t# Only send email if an address exists\n\t\t\tIF ($row['contacts_email'] || $row['s_email']) {\n\n\t\t\t# Loop all suppliers and send email\n\t\t\t# Set eMail Parameters (pre-eval template, some used in template)\n\t\t\t\tIF ($_CCFG['_PKG_SAFE_EMAIL_ADDRESS']) {\n\t\t\t\t\t$mail['recip']\t\t= $row['contacts_email'] ? $row['contacts_email'] : $row['s_email'];\n\t\t\t\t\t$mail['from']\t\t= $_mcinfo['c_email'];\n\t\t\t\t} ELSE {\n\t\t\t\t\t$mail['recip']\t\t= $row['contacts_name_first'] ? $row['contacts_name_first'] : $row['s_name_first'];\n\t\t\t\t\t$mail['recip']\t\t.= ' ';\n\t\t\t\t\t$mail['recip']\t\t.= $row['contacts_name_last'] ? $row['contacts_name_last'] : $row['s_name_last'];\n\t\t\t\t\t$mail['recip']\t\t.= ' <';\n\t\t\t\t\t$mail['recip']\t\t.= $row['contacts_email'] ? $row['contacts_email'] : $row['s_email'];\n\t\t\t\t\t$mail['recip']\t\t.= '>';\n\t\t\t\t\t$mail['from']\t\t= $_mcinfo['c_name'].' <'.$_mcinfo['c_email'].'>';\n\t\t\t\t}\n\t\t\t\t#\t$mail['cc']\t\t= $_mcinfo['c_name'].' <'.$_mcinfo['c_email'].'>';\n\n\t\t\t\tIF ($_CCFG['MAIL_USE_CUSTOM_SUBJECT']) {\n\t\t\t\t\t$mail['subject']\t= $adata['cc_subj'];\n\t\t\t\t} ELSE {\n\t\t\t\t\t$mail['subject']\t= $_CCFG['_PKG_NAME_SHORT'].$_LANG['_MAIL']['CC_FORM_SUBJECT_PRE'];\n\t\t\t\t}\n\n\t\t\t# Set MTP (Mail Template Parameters) array\n\t\t\t\t$_MTP['to_name']\t = $row['contacts_name_first'] ? $row['contacts_name_first'] : $row['s_name_first'];\n\t\t\t\t$_MTP['to_name']\t.= ' ';\n\t\t\t\t$_MTP['to_name']\t.= $row['contacts_name_last'] ? $row['contacts_name_last'] : $row['s_name_last'];\n\t\t\t\t$_MTP['to_email']\t = $row['contacts_email'] ? $row['contacts_email'] : $row['s_email'];\n\t\t\t\t$_MTP['from_name']\t = $_mcinfo['c_name'];\n\t\t\t\t$_MTP['from_email']\t = $_mcinfo['c_email'];\n\t\t\t\t$_MTP['subject']\t = $adata['cc_subj'];\n\t\t\t\t$_MTP['message']\t = $adata['cc_msg'];\n\t\t\t\t$_MTP['site']\t\t = $_CCFG['_PKG_NAME_SHORT'];\n\n\t\t\t# Load message template (processed)\n\t\t\t\t$mail['message']\t= get_mail_template('email_contact_supplier_form', $_MTP);\n\n\t\t\t# Call basic email function (ret=1 on error)\n\t\t\t\t$_ret = do_mail_basic($mail);\n\n\t\t\t# Show what was sent\n\t\t\t\t$_sento .= htmlspecialchars($mail['recip']).'<br>';\n\n\t\t\t# Check return\n\t\t\t\tIF ($_ret) {$_emails_error++;} ELSE {$_emails_sent++;}\n\t\t\t}\n\t\t}\n\n\t# Build Title String, Content String, and Footer Menu String\n\t\t$_tstr = $_LANG['_MAIL']['CC_FORM_RESULT_TITLE'];\n\n\t\t$_cstr .= '<center>'.$_nl;\n\t\t$_cstr .= '<table cellpadding=\"5\">'.$_nl;\n\t\t$_cstr .= '<tr><td class=\"TP5MED_NL\">'.$_nl;\n\t\tIF ($_emails_error) {\n\t\t\t$_cstr .= $_LANG['_MAIL']['CC_FORM_MSG_02_L1'];\n\t\t\t$_cstr .= '<br>'.$_LANG['_MAIL']['CC_FORM_MSG_02_L2'];\n\t\t} ELSE {\n\t\t\t$_cstr .= $_LANG['_MAIL']['CC_FORM_MSG_04_L1'];\n\t\t}\n\t\t$_cstr .= '<br>'.$_LANG['_MAIL']['total'].':'.$_sp.$_emails_sent.$_sp.$_LANG['_MAIL']['sent'];\n\t\t$_cstr .= '<br><br>'.$_sento;\n\t\t$_cstr .= '</td></tr>'.$_nl;\n\t\t$_cstr .= '</table>'.$_nl;\n\t\t$_cstr .= '</center>'.$_nl;\n\n\t\t$_mstr_flag\t= 0;\n\t\t$_mstr\t\t= '&nbsp;'.$_nl;\n\n\t# Call block it function\n\t\t$_out .= do_mod_block_it($_tstr, $_cstr, $_mstr_flag, $_mstr, '1');\n\t\t$_out .= '<br>'.$_nl;\n\n\t\tIF ($aret_flag) {return $_out;} ELSE {echo $_out;}\n}", "public function send($filterMatches)\n {\n $toAddress = $this->getToAddress();\n $fromAddress = $this->getFromAddress();\n\n if ($toAddress === null) {\n throw new \\InvalidArgumentExcepion('Invalid \"to\" email address');\n }\n\n if ($fromAddress === null) {\n throw new \\InvalidArgumentExcepion('Invalid \"from\" email address');\n }\n\n $loader = new \\Twig_Loader_Filesystem(__DIR__.'/../Template');\n $twig = new \\Twig_Environment($loader);\n $template = $twig->loadTemplate('Notify/Email.twig');\n\n $headers = array(\n \"From: \".$fromAddress,\n \"Content-type: text/html; charset=iso-8859-1\"\n );\n $totalImpact = 0;\n\n $impactData = array();\n foreach ($filterMatches as $match) {\n $impactData[] = array(\n 'impact' => $match->getImpact(),\n 'description' => $match->getDescription(),\n 'id' => $match->getId(),\n 'tags' => implode(', ', $match->getTags())\n );\n $totalImpact += $match->getImpact();\n }\n\n $subject = 'Expose Notification - Impact Score '.$totalImpact;\n $body = $template->render(array(\n 'impactData' => $impactData,\n 'runTime' => date('r'),\n 'totalImpact' => $totalImpact\n ));\n\n return mail($toAddress, $subject, $body, implode(\"\\r\\n\", $headers));\n }", "public function sendOrdersOverTime()\n {\n $subject = '[QS-IMS MAILER] DANH SÁCH ĐIỀU ĐỘNG QUÁ HẠN KẾT THÚC ĐIỀU ĐỘNG';\n $mail = array();\n $sMail = '';\n $to = array();\n $i = 0;\n\n $sql = sprintf('\n SELECT\n qsiforms.*,\n ddtb.*,\n qsusers.*,\n ODanhSachNhanVien.Email AS Email2\n FROM OLichThietBi AS ddtb\n INNER JOIN qsiforms ON qsiforms.IFID = ddtb.IFID_M706\n INNER JOIN qsusers ON qsusers.UID = qsiforms.UID\n INNER JOIN ODanhSachNhanVien ON qsusers.UID = ODanhSachNhanVien.Ref_TenTruyCap\n WHERE\n qsiforms.Status = 2\n and qsusers.isActive = 1\n and ddtb.NgayKetThuc <= %1$s\n ', $this->_db->quote(date('Y-m-d'))\n );\n $dataSql = $this->_db->fetchAll($sql);\n\n // $this->setToList($dataSql);\n\n if(count($dataSql) && count($this->to))\n {\n foreach($dataSql as $item)\n {\n if(!isset($to[$item->EMail]))\n {\n $to[$item->EMail] = $item->UserName;\n }\n\n if(!isset($mail[$item->EMail]))\n {\n $mail[$item->EMail] = array();\n }\n\n $mail[$item->EMail][$i]['SoPhieu'] = $item->SoPhieu;\n $mail[$item->EMail][$i]['NgayBatDau'] = $item->NgayBatDau;\n $mail[$item->EMail][$i]['NgayKetThuc'] = $item->NgayKetThuc;\n $mail[$item->EMail][$i]['DeptID'] = $item->DeptID;\n $mail[$item->EMail][$i]['IFID'] = $item->IFID_M706;\n $i++;\n }\n\n if(count($mail))\n {\n foreach($to as $email=>$user)\n {\n if(isset($mail[$email]))\n {\n $sMail = '';\n $sMail .= '<h1>DANH SÁCH ĐIỀU ĐỘNG ĐẾN HẠN KẾT THÚC ĐIỀU ĐỘNG</h1>';\n $sMail .= '<br/>';\n $sMail .= '<table cellpadding=\"0\" cellspacing=\"0\" border=\"1\">';\n $sMail .= '<tr>';\n $sMail .= '<th> SỐ PHIẾU </th>';\n $sMail .= '<th> NGÀY BẮT ĐẦU </th>';\n $sMail .= '<th> NGÀY KẾT THÚC </th>';\n $sMail .= '</tr>';\n\n foreach($mail[$email] as $item)\n {\n $sMail .= '<tr>';\n $sMail .= '<td><a target=\"_blank\" href=\"http://'.$this->domain.'/user/form/edit?ifid='.$item['IFID'].'&deptid='.$item['DeptID'].'\">'.$item['SoPhieu'].'</a></td>';\n $sMail .= '<td>' . Qss_Lib_Date::mysqltodisplay($item->NgayBatDau) . '</td>';\n $sMail .= '<td>' . Qss_Lib_Date::mysqltodisplay($item->NgayKetThuc) . '</td>';\n $sMail .= '</tr>';\n }\n\n $sMail .= '</table>';\n $sMail .= '<br/>';\n $sMail .= '<p style=\"text-align:right\" > <b>QS-IMS Mailer</b> </p>';\n $this->_sendMail($subject, array($email=>$user), $sMail, $this->cc);\n }\n }\n }\n }\n\n }", "private static function send($mailer, $emails, $subject, $body)\n\t{\n\t\tif (empty($subject))\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t$emails = array_map('trim', $emails);\n\n\t\tfor ($i = 0, $n = count($emails); $i < $n; $i++)\n\t\t{\n\t\t\tif (!JMailHelper::isEmailAddress($emails[$i]))\n\t\t\t{\n\t\t\t\tunset($emails[$i]);\n\t\t\t}\n\t\t}\n\n\t\tif (count($emails) == 0)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t$mailer->addRecipient($emails[0]);\n\n\t\tif (count($emails) > 1)\n\t\t{\n\t\t\tunset($emails[0]);\n\t\t\t$mailer->addBcc($emails);\n\t\t}\n\n\t\t$mailer->setSubject($subject)\n\t\t\t->setBody($body)\n\t\t\t->Send();\n\t}", "public function scheduled() {\n try {\n $param = array(\n 'where' => 'act = 1'\n );\n\n $users = $this->mailist->gets($param);\n $articles = $this->bank->gets();\n $nextRunno = 0;\n $contentG = \"\";\n $replacements = array();\n\n foreach ($users as $user) {\n $nextRunno = $user->runno + 1;\n foreach ($articles as $article) {\n if (($user->ld_type == $article->ld_type) && ($nextRunno == $article->ld_artno)):\n $replacements[$user->email] = array(\n \"{name}\" => $user->name,\n \"{title}\" => $article->ld_title,\n \"{content}\" => $article->ld_content\n );\n endif;\n }\n }\n\n $transport = Swift_SmtpTransport::newInstance($this->smtpUrl, 587)\n ->setUsername($this->manUser)\n ->setPassword($this->manPassword);\n\n $plugin = new Swift_Plugins_DecoratorPlugin($replacements);\n\n $mailer = Swift_Mailer::newInstance($transport);\n $mailer->registerPlugin($plugin);\n $mailer->registerPlugin(new Swift_Plugins_AntiFloodPlugin(250, 60));\n\n $mssg = Swift_Message::newInstance();\n $headers = $mssg->getHeaders();\n $headers->addTextHeader('X-MC-Track', 'opens, clicks_all');\n $headers->addTextHeader('X-MC-Tags', 'mailist');\n $headers->addTextHeader('X-MC-GoogleAnalytics', 'k-link.co.id');\n\n $mssg->setSubject(\"{title}\");\n $contentG .=\"Hello {name},\" . \"\\n\";\n $contentG .=\"{content}\" . \"\\n\";\n $mssg->setBody($contentG, 'text/html');\n $mssg->setFrom(\"[email protected]\", \"Newsletters\");\n $mssg->setPriority(2);\n\n $failures = array();\n foreach ($users as $user):\n $nextRunno = $user->runno + 1;\n foreach ($articles as $article):\n if (($user->ld_type == $article->ld_type) && ($nextRunno == $article->ld_artno)):\n $mssg->setTo($user->email, $user->name);\n $this->addSelRunNo($user->id);\n if (!$mailer->send($mssg, $failures)):\n $this->failedReciept($failures);\n endif;\n endif;\n endforeach;\n endforeach;\n } catch (Exception $exc) {\n echo $exc->getMessage();\n }\n }", "function bulkOfferEmail() {\n\t\tdate_default_timezone_set('US/Eastern');\n\t\t$this->autoRender = false;\n\t\t\n\t\t$mode_info=unserialize($this->data['Cronemail']['mode_info']);\n\t\t\n\t\tif(isset($mode_info['Cronemail']['mode']) && $mode_info['Cronemail']['mode']==1 && isset($this->data['Cronemail']['array_string']) && $this->data['Cronemail']['array_string']!=''){\n\t\t\t\t$advertiser = unserialize($this->data['Cronemail']['array_string']);\n\t\t\t\t$content = '';\n\t\t\t\t$content .= '<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\"><html xmlns=\"http://www.w3.org/1999/xhtml\"><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" /><title>Zuni Merchant Page / Everyday Savings Offers</title></head><body style=\"margin:0px; padding:0px; font-size:0; \">';\n\t\t\t\t$content .= $this->offerhtml->email_header();\n\t\t\t\t$content .= $this->offerhtml->email_box();\n\t\t\t\t$footer = $this->offerhtml->email_footer().'</body></html>';\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t$succedd = '';\n\t\t\t\t$failed = '';\n\t\t\t\t$unique_string = $this->common->randomPassword(10);\n\t\t\t\t\n\t\t\t\t\t\t\t$this->Email->sendAs = 'html';\n\t\t\t\t\t\t\t$this->Email->to = $mode_info['Cronemail']['specified_email'];\n\t\t\t\t\t\t\t$this->Email->subject = $this->common->getOfferEmailSubject(); //'Zuni Merchant Page / Everyday Savings Offers';\n\t\t\t\t\t\t\t$this->Email->replyTo = $this->common->getReturnEmail();\n\t\t\t\t\t\t\t$this->Email->from = $this->common->getFromName().' <'.$this->common->getSalesEmail().'>';\n\t\t\t\t\t\t\t$content_final = '';\n\t\t\t\t\t\t\t//For URL tracking\n\t\t\t\t\t\t\t$tracking_string = '';//'?unique='.$unique_string.'?'.base64_encode($mode_info['Cronemail']['id']);\n\t\t\t\t\t\t\t$content_final = '';\n\t\t\t\t\t\t\t$content_final .= $this->offerhtml->email_content($advertiser,$tracking_string);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$content_final .= $footer;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$this->body = '';\n\t\t\t\t\t\t\t$this->body .= $content;\n\t\t\t\t\t\t\t$this->body .= $content_final;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$this->Email->smtpOptions = array(\n\t\t\t\t\t\t\t\t'port'=>'25',\n\t\t\t\t\t\t\t\t'timeout'=>'30',\n\t\t\t\t\t\t\t\t'host' =>SMTP_HOST_NAME,\n\t\t\t\t\t\t\t\t'username'=>SMTP_USERNAME,\n\t\t\t\t\t\t\t\t'password'=>SMTP_PASSWORD\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t$this->Email->delivery = 'smtp';\n\t\t\t\t\t\t\tif($this->Email->send($this->body)) {\n\t\t\t\t\t\t\t\t$saveCron = '';\n\t\t\t\t\t\t\t\t$saveCron['Cronemail']['id'] = $mode_info['Cronemail']['id'];\n\t\t\t\t\t\t\t\t$saveCron['Cronemail']['status'] = 1;\n\t\t\t\t\t\t\t\t$this->Cronemail->save($saveCron);\n\t\t\t\t\t\t\t\t$this->Session->setFlash('Emails sent successfully to '.$mode_info['Cronemail']['specified_email'].'.');\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$this->Session->setFlash('Mailing Error, please try later.');\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$this->Email->reset();\n\t\t\t\t\t\t\t$this->redirect(array('controller'=>'cronemails','action'=>'index'));\n\t\t\t\t\n\t\t}elseif(isset($this->data['Cronemail']['array_string']) && $this->data['Cronemail']['array_string']!='') {\n\t\t\t\t\t\n\t\t\t\t$advertiser = unserialize($this->data['Cronemail']['array_string']);\n\t\t\t\t$content = '';\n\t\t\t\t$content .= '<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\"><html xmlns=\"http://www.w3.org/1999/xhtml\"><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" /><title>Zuni Merchant Page / Everyday Savings Offers</title></head><body style=\"margin:0px; padding:0px; font-size:0; \">';\n\t\t\t\t$content .= $this->offerhtml->email_header();\n\t\t\t\t$content .= $this->offerhtml->email_box();\n\t\t\t\t$footer = $this->offerhtml->email_footer().'</body></html>';\n\t\t\t\t\n\t\t\t\tset_time_limit(0);\n\t\t\t\t\n\t\t\t\t$succedd = '';\n\t\t\t\t$failed = '';\n\t\t\t\t$unique_string = $this->common->randomPassword(10);\n\t\t\t\t$this->loadModel('DiscountNewsletter');\n\t\t\t\t$users = $this->DiscountNewsletter->find('all',array('fields'=>array('id,email'),'conditions'=>array('status'=>'yes')));\n\t\t\t\t$email_ids = array_chunk($users, EMAIL_LIST);\n\t\t\t\tforeach($email_ids as $email_id) {\n\t\t\t\t\t\tforeach($email_id as $email) {\n\t\t\t\t\t\t\t$id = $email['DiscountNewsletter']['id'];\n\t\t\t\t\t\t\t$this->Email->sendAs = 'html';\n\t\t\t\t\t\t\t$this->Email->to = $email['DiscountNewsletter']['email'];\n\t\t\t\t\t\t\t$this->Email->subject = $this->common->getOfferEmailSubject(); //'Zuni Merchant Page / Everyday Savings Offers';\n\t\t\t\t\t\t\t$this->Email->replyTo = $this->common->getReturnEmail();\n\t\t\t\t\t\t\t$this->Email->from = $this->common->getFromName().' <'.$this->common->getSalesEmail().'>';\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//For URL tracking\n\t\t\t\t\t\t\t$tracking_string = '?unique='.$unique_string.'?'.base64_encode($id);\n\t\t\t\t\t\t\t$content_final = '';\n\t\t\t\t\t\t\t$content_final .= $this->offerhtml->email_content($advertiser,$tracking_string);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// For email open tracking\n\t\t\t\t\t\t\t$content_final .= '<img src=\"https://zuni.com/offeremaillogs/saveEmailOpen?unique='.$unique_string.'?'.base64_encode($id).'\" style=\"display:none;width:0\" />';\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$content_final .= $footer;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$this->body = '';\n\t\t\t\t\t\t\t$this->body .= $content;\n\t\t\t\t\t\t\t$this->body .= $content_final;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$this->Email->smtpOptions = array(\n\t\t\t\t\t\t\t\t'port'=>'25',\n\t\t\t\t\t\t\t\t'timeout'=>'30',\n\t\t\t\t\t\t\t\t'host' =>SMTP_HOST_NAME,\n\t\t\t\t\t\t\t\t'username'=>SMTP_USERNAME,\n\t\t\t\t\t\t\t\t'password'=>SMTP_PASSWORD\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t$this->Email->delivery = 'smtp';\n\t\t\t\t\t\t\tif($this->Email->send($this->body)) {\n\t\t\t\t\t\t\t\t$succedd[]= $id;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$failed[]= $id;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$this->Email->reset();\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t //----------------------------------Save Email Log----------------------------------------//\t\n\t\t\t$this->loadModel('Offeremaillog');\n\t\t\t$sent = ',';\n\t\t\t$notsent = ',';\n\t\t\tif(is_array($succedd)) {\n\t\t\t\t$sent = ','.implode(',',$succedd).',';\n\t\t\t}\n\t\t\tif(is_array($failed)) {\n\t\t\t\t$notsent = ','.implode(',',$failed).',';\n\t\t\t}\n\t\t\t$today = mktime(0,0,0,date('m'),date('d'),date('Y'));\n\t\t\t$check_same = $this->common->check_same_date_offer($today);\n\t\t\t\n\t\t\t$save = '';\n\t\t\tif(isset($check_same['Offeremaillog']['id'])) {\n\t\t\t\t$save['Offeremaillog']['id'] = $check_same['Offeremaillog']['id'];\n\t\t\t}\n\t\t\t\t$save['Offeremaillog']['sending_date'] = $today;\n\t\t\t\t$save['Offeremaillog']['sent'] = $sent;\n\t\t\t\t$save['Offeremaillog']['notsent'] = $notsent;\n\t\t\t\t$save['Offeremaillog']['opened'] = '';\n\t\t\t\t$save['Offeremaillog']['email_opened'] = '';\n\t\t\t\t$save['Offeremaillog']['unique']=$unique_string;\n\t\t\t\t$save['Offeremaillog']['advrtisers']=$match['Cronemail']['advertisers'];\n\t\t\t\t$this->Offeremaillog->save($save);\n\t\t//----------------------------------Save Email Log----------------------------------------//\n\t\t\n\t\t\t\t$saveCron = '';\n\t\t\t\t$saveCron['Cronemail']['id'] = $mode_info['Cronemail']['id'];\n\t\t\t\t$saveCron['Cronemail']['status'] = 1;\n\t\t\t\t$this->Cronemail->save($saveCron);\n\t\t\t\t\n\t\t\t\t$this->Session->setFlash('Emails sent successfully to all Subscribers.');\n\t\t\t\t$this->redirect(array('controller'=>'offeremaillogs','action'=>'index'));\n\t\t\t}\n\t\t\t\n\t}", "public function sendBulkMail(Request $request){\n $subcriber=Subscriber::all();\n foreach ($subcriber as $value) {\n Mail::to($value)->send(new newslater($request->all()));\n\n }\n }", "public static function sendMail($data = array())\n {\n // Assisgn default value in bcc and cc as empty array\n $cc_address = [];\n $bcc_address = [];\n\n // Assign research_org_email and doctors email if value present\n if ( $data['research_org_email'] )\n {\n $bcc_address[0] = $data['research_org_email'];\n }\n \n if ( $data['doctors_email'] )\n {\n $cc_address[0] = $data['doctors_email'];\n }\n\n // Perform Mail Operation\n Mail::queue(\"emails.sample\", ['data' => $data], function($msg) use($data, $cc_address, $bcc_address) {\n $msg->to($data['personal_email'])\n ->cc($cc_address)\n ->bcc($bcc_address)\n ->subject('Tremor Test Report');\n });\n\n // Update the report status to 1 as email has been sent to user\n Report::updateReportStatus($data['id'], env('EMAIL_STATUS'));\n }", "public function fetchEmails(): void\n {\n $this->fetchedEmails = [];\n\n try {\n $response = $this->mailhog->request('GET', '/api/v1/messages');\n $this->fetchedEmails = json_decode($response->getBody(), false);\n } catch (Exception $e) {\n $this->fail('Exception: ' . $e->getMessage());\n }\n $this->sortEmails($this->fetchedEmails);\n\n // by default, work on all emails\n $this->setCurrentInbox($this->fetchedEmails);\n }", "protected function notifyByEmail() {\n\t\t$userlist = array();\n\n\t\t// find all the users with this server listed\n\t\t$users = $this->db->select(\n\t\t\tSM_DB_PREFIX . 'users',\n\t\t\t'FIND_IN_SET(\\''.$this->server['server_id'].'\\', `server_id`) AND `email` != \\'\\'',\n\t\t\tarray('user_id', 'name', 'email')\n\t\t);\n\n\t\tif (empty($users)) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// build mail object with some default values\n\t\t$mail = new phpmailer();\n\n\t\t$mail->From\t\t= sm_get_conf('email_from_email');\n\t\t$mail->FromName\t= sm_get_conf('email_from_name');\n\t\t$mail->Subject\t= sm_parse_msg($this->status_new, 'email_subject', $this->server);\n\t\t$mail->Priority\t= 1;\n\n\t\t$body = sm_parse_msg($this->status_new, 'email_body', $this->server);\n\t\t$mail->Body\t\t= $body;\n\t\t$mail->AltBody\t= str_replace('<br/>', \"\\n\", $body);\n\n\t\t// go through empl\n\t foreach ($users as $user) {\n\t \t// we sent a seperate email to every single user.\n\t \t$userlist[] = $user['user_id'];\n\t \t$mail->AddAddress($user['email'], $user['name']);\n\t \t$mail->Send();\n\t \t$mail->ClearAddresses();\n\t }\n\n\t if(sm_get_conf('log_email')) {\n\t \t// save to log\n\t \tsm_add_log($this->server['server_id'], 'email', $body, implode(',', $userlist));\n\t }\n\t}", "public function sendEmailAll($to=array(),$subject,$body,$name='',$cc=array(),$bcc =array())\n\t{\n\t\t$mail = new PHPMailer;\n\t\tif(count($to) > 0){\n\t\t\tforeach($to as $v){\n\t\t\t if($v)\n\t\t\t {\n\t\t\t\t$mail->AddAddress($v, $v);\t\n\t\t\t }\n\t\t\t}\n\t\t\t\n\t\t}else{\n\t\t\t\n\t\t\t$mail->AddAddress($to, $name);\n\t\t}\n\t\t \n\t\t$mail->From\t\t= $this->config->item('admin_email_from');\n\t\t$mail->FromName = $this->config->item('admin_email_from');\n\t\t$mail->Subject \t= $subject;\n\t\t\n\t\tif(!empty($cc)){\n\t\t\tforeach($cc as $cv){\n\t\t\t if($cv)\n\t\t\t {\n\t\t\t\t$mail->AddCC($cv);\n\t\t\t }\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(!empty($bcc)){\n\t\t\tforeach($bcc as $bccv){\n\t\t\t if($bccv)\n\t\t\t {\n\t\t\t\t$mail->AddBCC($bccv);\n\t\t\t }\n\t\t\t}\n\t\t}\t\n\t\t\n\t\t$mail->IsSMTP();\n\t\t$mail->Host = \"mail.dotsquares.com\"; \n\t\t$mail->SMTPAuth = true;\n\t\t$mail->IsMail();\t\t\n\t\t$mail->WordWrap = 200; \n\t\t$mail->IsHTML(true); \n\t\t$mail->Body = $body;\n\t\t\n\t\tif($mail->Send())\n\t\t{\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t $this->db->close();\n\t}", "function internalServerError($error)\n{\n header('HTTP/1.1 500 Internal Server Error');\n $emailIds = array(\"[email protected]\", \"[email protected]\", \"[email protected]\", \"[email protected]\");\n foreach ($emailIds as $to)\n sendMail($to, \"Alert! error occurred in apis\", $error);\n}", "function ciniki_musicfestivals_registrationsEmailSend(&$ciniki) {\n //\n // Find all the required and optional arguments\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'prepareArgs');\n $rc = ciniki_core_prepareArgs($ciniki, 'no', array(\n 'tnid'=>array('required'=>'yes', 'blank'=>'no', 'name'=>'Tenant'),\n 'festival_id'=>array('required'=>'yes', 'blank'=>'no', 'name'=>'Festival'),\n 'teacher_id'=>array('required'=>'yes', 'blank'=>'no', 'name'=>'Teacher'),\n 'subject'=>array('required'=>'yes', 'blank'=>'no', 'name'=>'Subject'),\n 'message'=>array('required'=>'yes', 'blank'=>'no', 'name'=>'Message'),\n ));\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $args = $rc['args'];\n\n //\n // Check access to tnid as owner, or sys admin.\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'musicfestivals', 'private', 'checkAccess');\n $rc = ciniki_musicfestivals_checkAccess($ciniki, $args['tnid'], 'ciniki.musicfestivals.registrationsEmailSend');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n\n $strsql = \"SELECT registrations.id, \"\n . \"registrations.festival_id, \"\n . \"sections.id AS section_id, \"\n . \"registrations.teacher_customer_id, \"\n . \"teachers.display_name AS teacher_name, \"\n . \"registrations.billing_customer_id, \"\n . \"registrations.rtype, \"\n . \"registrations.rtype AS rtype_text, \"\n . \"registrations.status, \"\n . \"registrations.status AS status_text, \"\n . \"registrations.display_name, \"\n . \"registrations.class_id, \"\n . \"classes.code AS class_code, \"\n . \"classes.name AS class_name, \"\n . \"registrations.title1, \"\n . \"registrations.perf_time1, \"\n . \"registrations.title2, \"\n . \"registrations.perf_time2, \"\n . \"registrations.title3, \"\n . \"registrations.perf_time3, \"\n . \"IF(registrations.participation = 1, 'Virtual', 'In Person') AS participation, \"\n . \"FORMAT(registrations.fee, 2) AS fee, \"\n . \"registrations.payment_type \"\n . \"FROM ciniki_musicfestival_registrations AS registrations \"\n . \"LEFT JOIN ciniki_customers AS teachers ON (\"\n . \"registrations.teacher_customer_id = teachers.id \"\n . \"AND teachers.tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \") \"\n . \"LEFT JOIN ciniki_musicfestival_classes AS classes ON (\"\n . \"registrations.class_id = classes.id \"\n . \"AND classes.tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \") \"\n . \"LEFT JOIN ciniki_musicfestival_categories AS categories ON (\"\n . \"classes.category_id = categories.id \"\n . \"AND categories.tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \") \"\n . \"LEFT JOIN ciniki_musicfestival_sections AS sections ON (\"\n . \"categories.section_id = sections.id \"\n . \"AND sections.tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \") \"\n . \"WHERE registrations.festival_id = '\" . ciniki_core_dbQuote($ciniki, $args['festival_id']) . \"' \"\n . \"AND registrations.tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \"AND registrations.teacher_customer_id = '\" . ciniki_core_dbQuote($ciniki, $args['teacher_id']) . \"' \"\n . \"\";\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbHashQueryArrayTree');\n $rc = ciniki_core_dbHashQueryArrayTree($ciniki, $strsql, 'ciniki.musicfestivals', array(\n array('container'=>'registrations', 'fname'=>'id', \n 'fields'=>array('id', 'festival_id', 'teacher_name', 'display_name', \n 'class_id', 'class_code', 'class_name', \n 'title1', 'perf_time1', 'title2', 'perf_time2', 'title3', 'perf_time3', \n 'fee', 'payment_type', 'participation'),\n ),\n ));\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $html = '';\n $text = '';\n if( isset($rc['registrations']) ) {\n $festival['registrations'] = $rc['registrations'];\n $total = 0;\n $html = \"<table cellpadding=5 cellspacing=0>\";\n $html .= \"<tr><th>Class</th><th>Competitor</th><th>Title</th><th>Time</th><th>Virtual</th></tr>\";\n foreach($festival['registrations'] as $iid => $registration) {\n $html .= '<tr><td>' . $registration['class_code'] . '</td><td>' . $registration['display_name'] . '</td>'\n . '<td>' . $registration['title1'] \n . ($registration['title2'] != '' ? \"<br/>{$registration['title2']}\" : '')\n . ($registration['title3'] != '' ? \"<br/>{$registration['title3']}\" : '')\n . '</td>'\n . '<td>' . $registration['perf_time1'] \n . ($registration['perf_time2'] != '' ? \"<br/>{$registration['perf_time2']}\" : '')\n . ($registration['perf_time3'] != '' ? \"<br/>{$registration['perf_time3']}\" : '')\n . '</td>'\n . '<td>' . $registration['participation'] . \"</td></tr>\\n\";\n $text .= $registration['class_code'] \n . ' - ' . $registration['display_name'] \n . ($registration['title1'] != '' ? ' - ' . $registration['title1'] : '')\n . ($registration['perf_time1'] != '' ? ' - ' . $registration['perf_time1'] : '')\n . \"\\n\";\n if( $registration['title2'] != '' ) {\n $text .= preg_replace(\"/./\", '', $registration['class_code'])\n . ' - ' . preg_replace(\"/./\", '', $registration['display_name'])\n . ($registration['title2'] != '' ? ' - ' . $registration['title2'] : '')\n . ($registration['perf_time2'] != '' ? ' - ' . $registration['perf_time2'] : '')\n . \"\\n\";\n }\n if( $registration['title3'] != '' ) {\n $text .= preg_replace(\"/./\", '', $registration['class_code'])\n . ' - ' . preg_replace(\"/./\", '', $registration['display_name'])\n . ($registration['title3'] != '' ? ' - ' . $registration['title3'] : '')\n . ($registration['perf_time3'] != '' ? ' - ' . $registration['perf_time3'] : '')\n . \"\\n\";\n }\n }\n $html .= \"</table>\";\n } else {\n $festival['registrations'] = array();\n }\n\n $html_message = $args['message'] . \"<br/><br/>\" . $html;\n $text_message = $args['message'] . \"\\n\\n\" . $text;\n\n //\n // Lookup the teacher info\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'customers', 'hooks', 'customerDetails');\n $rc = ciniki_customers_hooks_customerDetails($ciniki, $args['tnid'], \n array('customer_id'=>$args['teacher_id'], 'phones'=>'no', 'emails'=>'yes', 'addresses'=>'no', 'subscriptions'=>'no'));\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( !isset($rc['customer']) ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.musicfestivals.102', 'msg'=>'No teacher found, we are unable to send the email.'));\n }\n $customer = $rc['customer'];\n\n //\n // if customer is set\n //\n if( !isset($customer['emails'][0]['email']['address']) ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.musicfestivals.103', 'msg'=>\"The teacher doesn't have an email address, we are unable to send the email.\"));\n }\n\n ciniki_core_loadMethod($ciniki, 'ciniki', 'mail', 'hooks', 'addMessage');\n $rc = ciniki_mail_hooks_addMessage($ciniki, $args['tnid'], array(\n 'customer_id'=>$args['teacher_id'],\n 'customer_name'=>(isset($customer['display_name'])?$customer['display_name']:''),\n 'customer_email'=>$customer['emails'][0]['email']['address'],\n 'subject'=>$args['subject'],\n 'html_content'=>$html_message,\n 'text_content'=>$text_message,\n ));\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $ciniki['emailqueue'][] = array('mail_id'=>$rc['id'], 'tnid'=>$args['tnid']);\n\n return array('stat'=>'ok');\n}", "public function email_approver()\n {\n \n $this->db->select('EMAIL');\n $this->db->from('APPROVERS');\n $this->db->where('UNIT',$_SESSION['div']);\n $query = $this->db->get();\n $out = $query->result_array();\n\n if ($out) {\n\n \n foreach ($out as $recipient){\n \n //mail to approver\n $this->load->library('email');\n $htmlContent = '<h1>Title change requested in FREE System.</h1>';\n $htmlContent .= '<p>Please review the <a href=\"' . base_url() . '/admin\">Approval Control Panel</a> to review the request.</p>';\n \n $this->email->clear();\n\n $config['mailtype'] = 'html';\n $this->email->initialize($config);\n $this->email->to($recipient);\n $this->email->from('[email protected]', 'FREE System');\n $this->email->subject('Title Change Requested');\n $this->email->message($htmlContent);\n $this->email->send();\n }\n }\n }", "function send_mail($body,$count,$email_send){\n$mail = new PHPMailer;\n if($count > 0){\n //Tell PHPMailer to use SMTP\n $mail->isSMTP();\n $mail->SMTPDebug = 0;\n $mail->CharSet = \"utf-8\";\n $mail->Debugoutput = 'html';\n\n $mail->Host = \"smtp.gmail.com\";\n $mail->Port = 465;\n $mail->SMTPSecure = 'ssl';\n $mail->SMTPAuth = true;\n $mail->Username = \"[email protected]\";\n $mail->Password = \"dooddwebsite\";\n $mail->setFrom('[email protected]');\n foreach($email_send as $key => $value){\n $mail->addAddress($value);\n }\n $mail->Subject = '*กรุณาชำระเงิน hosting,domain';\n $body .=\"<br>\";\n $body .= \"<br><b>ขอบคุณครับ</b>\";\n $body .= \"<br><b>Best Regards,</b>\";\n $body .= \"<br><b>Patcharapolt ruengroong(Bank)</b>\";\n $body .= \"<br><b>พัชรพล เรืองรุ่ง</b>\";\n //$mail->Body = $body;\n $mail->msgHTML($body);\n\n //send the message, check for errors\n if (!$mail->send()) {\n echo \"Mailer Error: \" . $mail->ErrorInfo;\n } else {\n echo \"Message sent!\";\n }\n}\n}", "function sendEmails($row, $config) {\r\n\t\tif ($row->act == 'upgrade') {\r\n\t\t\tOSMembershipHelper::sendMembershipUpgradeEmails($row, $config) ;\r\n\t\t\treturn ;\r\n\t\t} elseif ($row->act == 'renew') {\r\n\t\t\tOSMembershipHelper::sendMembershipRenewalEmails($row, $config) ;\r\n\t\t\treturn ;\r\n\t\t}\r\n\t\t$jconfig = new JConfig();\r\n\t\t$db = & JFactory::getDBO();\r\n\t\t$fromEmail = $jconfig->mailfrom;\r\n\t\t$fromName = $jconfig->fromname;\r\n\t\t$sql = \"SELECT * FROM #__osmembership_plans WHERE id=\".$row->plan_id ;\r\n\t\t$db->setQuery($sql) ;\r\n\t\t$plan = $db->loadObject();\r\n\t\t//Need to over-ridde some config options\r\n\t\t$emailContent = OSMembershipHelper::getEmailContent($config, $row);\r\n\t\t$replaces = array() ;\r\n\t\t$replaces['plan_title'] = $plan->title ;\r\n\t\t$replaces['first_name'] = $row->first_name ;\r\n\t\t$replaces['last_name'] = $row->last_name ;\r\n\t\t$replaces['organization'] = $row->organization ;\r\n\t\t$replaces['address'] = $row->address ;\r\n\t\t$replaces['address2'] = $row->address ;\r\n\t\t$replaces['city'] = $row->city ;\r\n\t\t$replaces['state'] = $row->state ;\r\n\t\t$replaces['zip'] = $row->zip ;\r\n\t\t$replaces['country'] = $row->country ;\r\n\t\t$replaces['phone'] = $row->phone ;\r\n\t\t$replaces['fax'] = $row->phone ;\r\n\t\t$replaces['email'] = $row->email ;\r\n\t\t$replaces['comment'] = $row->comment ;\r\n\t\t$replaces['amount'] = number_format($row->amount, 2) ;\r\n\t\t$replaces['discount_amount'] = number_format($row->discount_amount, 2) ;\r\n\t\t$replaces['tax_amount'] = number_format($row->tax_amount, 2) ;\r\n\t\t$replaces['gross_amount'] = number_format($row->gross_amount, 2) ;\r\n\t\t\t\t\t\t\t\t\r\n\t\t$replaces['from_date'] = JHTML::_('date', $row->from_date, $config->date_format);\r\n\t\t$replaces['to_date'] = JHTML::_('date', $row->to_date, $config->date_format);\r\n\t\t\r\n\t\t$replaces['transaction_id'] = $row->transaction_id ;\r\n\t\tif ($row->payment_method) {\r\n\t\t\t$replaces['payment_method'] = JText::_(os_payments::loadPaymentMethod($row->payment_method)->title) ;\r\n\t\t}\t\t\r\n\t\t//Should we create map to custom fields\r\n\t\t$sql = 'SELECT field_id, field_value FROM #__osmembership_field_value WHERE subscriber_id = '.$row->id;\r\n\t\t$db->setQuery($sql) ;\r\n\t\t$rowValues = $db->loadObjectList();\r\n\t\t$sql = 'SELECT a.id, a.name FROM #__osmembership_fields AS a WHERE a.published=1 AND (a.plan_id = 0 OR a.plan_id='.$row->plan_id.')';\r\n\t\t$db->setQuery($sql) ;\r\n\t\t$rowFields = $db->loadObjectList();\r\n\t\t$fields = array() ;\r\n\t\tfor ($i = 0 , $n = count($rowFields) ; $i < $n ; $i++) {\r\n\t\t\t$rowField = $rowFields[$i] ;\r\n\t\t\t$fields[$rowField->id] = $rowField->name ;\r\n\t\t}\r\n\t\tfor ($i = 0 , $n = count($rowValues) ; $i < $n ; $i++) {\r\n\t\t\t$rowValue = $rowValues[$i] ;\r\n\t\t\t$replaces[$fields[$rowValue->field_id]] = $rowValue->field_value ;\r\n\t\t}\r\n\t\t//Over-ridde email message\t\t\r\n\t\t$subject = $config->user_email_subject;\r\n\t\tif ($row->payment_method == 'os_offline') {\r\n\t\t\t$body = $config->user_email_body_offline ;\r\n\t\t} else {\r\n\t\t\t$body = $config->user_email_body ;\r\n\t\t}\r\n\t\t$subject = str_replace('[PLAN_TITLE]', $plan->title, $subject) ;\r\n\t\t$body = str_replace('[SUBSCRIPTION_DETAIL]', $emailContent, $body) ;\r\n\t\tforeach ($replaces as $key=>$value) {\r\n\t\t\t$key = strtoupper($key) ;\r\n\t\t\t$body = str_replace(\"[$key]\", $value, $body) ;\r\n\t\t}\t\t\r\n\t\tif (version_compare(JVERSION, '3.0', 'ge')) {\r\n\t\t\t$j3 = true ;\r\n\t\t\t$mailer = new JMail() ;\r\n\t\t} else {\r\n\t\t\t$j3 = false ;\r\n\t\t}\r\n\t\tif ($j3)\r\n\t\t\t$mailer->sendMail($fromEmail, $fromName, $row->email, $subject, $body, 1);\r\n\t\telse\r\n\t\t\tJUtility::sendMail($fromEmail, $fromName, $row->email, $subject, $body, 1);\r\n\t\t//Send emails to notification emails\r\n\t\tif ($config->notification_emails == '')\r\n\t\t\t$notificationEmails = $fromEmail;\r\n\t\telse\r\n\t\t\t$notificationEmails = $config->notification_emails;\r\n\t\t$notificationEmails = str_replace(' ', '', $notificationEmails);\r\n\t\t$emails = explode(',', $notificationEmails);\t\t\r\n\t\t$subject = $config->admin_email_subject ;\r\n\t\t$subject = str_replace('[PLAN_TITLE]', $plan->title, $subject) ;\r\n\t\t$body = $config->admin_email_body ;\r\n\t\t$body = str_replace('[SUBSCRIPTION_DETAIL]', $emailContent, $body);\r\n\t\tforeach ($replaces as $key=>$value) {\r\n\t\t\t$key = strtoupper($key) ;\r\n\t\t\t$body = str_replace(\"[$key]\", $value, $body) ;\r\n\t\t}\r\n\t\tfor ($i = 0, $n = count($emails); $i < $n ; $i++) {\r\n\t\t\t$email = $emails[$i];\r\n\t\t\tif ($j3)\r\n\t\t\t\t$mailer->sendMail($fromEmail, $fromName, $email, $subject, $body, 1);\r\n\t\t\telse\r\n\t\t\t\tJUtility::sendMail($fromEmail, $fromName, $email, $subject, $body, 1);\r\n\t\t}\r\n\t}", "function mailing($query_mail, $row) {\n global $dbAccess, $smarty;\n require_once COMMON_CORE_PATH . \"/mailer.class.php\";\n $m = new mailer($dbAccess);\n $res = $m->send_email(\n $query_mail, array(\n \"vars\" => $row['mail_vars'],\n \"to\" => array(\n array(\n \"email\" => $row[\"recipient_email\"],\n \"name\" => $row[\"recipient_name\"],\n )\n ),\n \"cc\" => array(\n array(\n \"email\" => $row[\"cc_email\"],\n \"name\" => $row[\"cc_name\"],\n )\n ),\n \"mail_body\" => $row['mail_body'],\n \"attach\" => isset($row[\"attach\"]) ? $row[\"attach\"] : \"\",\n \"images\" => isset($row[\"images\"]) ? $row[\"images\"] : \"\"\n )\n );\n }", "protected function wrapResults($outputs)\n {\n return new Google_Gmail_SendEmail_Results($outputs);\n }", "protected function sendEmail($user_email, $user_fname)\n {\n \n \n\n\t\t\t\n \n \n }", "function sendElasticEmail($to, $subject, $body_text, $body_html, $from, $fromName)\n\t{\n $res = \"\";\n\n $data = \"username=\".urlencode(\"[email protected]\");\n $data .= \"&api_key=\".urlencode(\"9baa5dc0-e443-4f06-ac91-e547d3845151\");\n $data .= \"&from=\".urlencode($from);\n $data .= \"&from_name=\".urlencode($fromName);\n $data .= \"&to=\".urlencode($to);\n $data .= \"&subject=\".urlencode($subject);\n if($body_html)\n $data .= \"&body_html=\".urlencode($body_html);\n if($body_text)\n $data .= \"&body_text=\".urlencode($body_text);\n\n $header = \"POST /mailer/send HTTP/1.0\\r\\n\";\n $header .= \"Content-Type: application/x-www-form-urlencoded\\r\\n\";\n $header .= \"Content-Length: \" . strlen($data) . \"\\r\\n\\r\\n\";\n $fp = fsockopen('ssl://api.elasticemail.com', 443, $errno, $errstr, 30);\n\n if(!$fp)\n return \"ERROR. Could not open connection\";\n else {\n fputs ($fp, $header.$data);\n while (!feof($fp)) {\n $res .= fread ($fp, 1024);\n }\n fclose($fp);\n }\n return $res; \n\t}", "protected function wrapResults($outputs)\n {\n return new RapidShare_SendMail_Results($outputs);\n }", "public function sendEmail($recipeinets, $from, $subject, $message) {\n $config['protocol'] = 'mail';\n $config['wordwrap'] = FALSE;\n $config['mailtype'] = 'html';\n $config['charset'] = 'utf-8';\n $config['crlf'] = \"\\r\\n\";\n $config['newline'] = \"\\r\\n\";\n $this->load->library('email', $config);\n $this->email->initialize($config);\n\n // set the from address\n $this->email->from($from['email'], $from['name']);\n\n // set the subject\n $this->email->subject($subject);\n\n // set recipeinets\n $this->email->to($recipeinets);\n\n // set mail message\n $this->email->message($message);\n\n // return boolean value for email send\n\n $error = $this->db->_error_message();\n $error_number = $this->db->_error_number();\n if ($error) {\n $controller = $this->router->fetch_class();\n $method = $this->router->fetch_method();\n $error_details = array(\n 'error_name' => $error,\n 'error_number' => $error_number,\n 'model_name' => 'Common_Model',\n 'model_method_name' => 'sendEmail',\n 'controller_name' => $controller,\n 'controller_method_name' => $method\n );\n $this->common_model->errorSendEmail($error_details);\n redirect(base_url() . 'page-not-found'); //create this route\n }\n return $this->email->send();\n }", "public function batchSend()\n\t{\n\t\treturn $this->mailer->batchSend($this->message);\n\t}", "private function send(){\n\t\t\n\t\tif(empty($this->email)){\n\t\t\t// Missing Email\n\t\t\t$this->error = true;\n\t\t\t$this->errorMsg = 'Whoops, looks like a bug on our end. We\\'ve logged the issue and our support team will look into it.';\n\t\t\t\n\t\t\t// Log Error\n\t\t\t$errorLog = new LogError();\n\t\t\t$errorLog->errorNumber = 87;\n\t\t\t$errorLog->errorMsg = 'Missing email';\n\t\t\t$errorLog->badData = '';\n\t\t\t$errorLog->filename = 'API / SendEmail.class.php';\n\t\t\t$errorLog->write();\n\t\t}\n\t\t\n\t\tif(empty($this->subject)){\n\t\t\t// Missing Email\n\t\t\t$this->error = true;\n\t\t\t$this->errorMsg = 'Whoops, looks like a bug on our end. We\\'ve logged the issue and our support team will look into it.';\n\t\t\t\n\t\t\t// Log Error\n\t\t\t$errorLog = new LogError();\n\t\t\t$errorLog->errorNumber = 88;\n\t\t\t$errorLog->errorMsg = 'Missing subject';\n\t\t\t$errorLog->badData = '';\n\t\t\t$errorLog->filename = 'API / SendEmail.class.php';\n\t\t\t$errorLog->write();\n\t\t}\n\t\t\n\t\tif(empty($this->plainText)){\n\t\t\t// Missing Email\n\t\t\t$this->error = true;\n\t\t\t$this->errorMsg = 'Whoops, looks like a bug on our end. We\\'ve logged the issue and our support team will look into it.';\n\t\t\t\n\t\t\t// Log Error\n\t\t\t$errorLog = new LogError();\n\t\t\t$errorLog->errorNumber = 89;\n\t\t\t$errorLog->errorMsg = 'Missing plain text of email';\n\t\t\t$errorLog->badData = '';\n\t\t\t$errorLog->filename = 'API / SendEmail.class.php';\n\t\t\t$errorLog->write();\n\t\t}\n\t\t\n\t\tif(empty($this->htmlBody)){\n\t\t\t// Missing Email\n\t\t\t$this->error = true;\n\t\t\t$this->errorMsg = 'Whoops, looks like a bug on our end. We\\'ve logged the issue and our support team will look into it.';\n\t\t\t\n\t\t\t// Log Error\n\t\t\t$errorLog = new LogError();\n\t\t\t$errorLog->errorNumber =90;\n\t\t\t$errorLog->errorMsg = 'Missing HTML of body';\n\t\t\t$errorLog->badData = '';\n\t\t\t$errorLog->filename = 'API / SendEmail.class.php';\n\t\t\t$errorLog->write();\n\t\t}\n\t\t\n\t\t// Validate Email\n\t\t$this->validateEmail($this->email);\n\t\t\n\t\tif(!$this->error){\n\t\t\t// Required Files\n\t\t\tinclude 'Mail.php';\n\t\t\tinclude 'Mail/mime.php';\n\n\t\t\t/* ---\n\t\t\tPEAR Mail Factory\n\t\t\thttp://pear.php.net/manual/en/package.mail.mail.factory.php\n\t\t\t--- */\n\t\t\t$host = \"smtp-relay.gmail.com\";\n\t\t\t$port = 587;\n\t\t\t$smtp = Mail::factory('smtp', array('host'=>$host, 'port'=>$port));\n\n\t\t\t/* ---\n\t\t\tPEAR MIME\n\t\t\thttp://pear.php.net/manual/en/package.mail.mail-mime.mail-mime.php\n\t\t\t--- */\n\t\t\t$crlf = \"\\n\";\n\t\t\t$mime = new Mail_mime(array('eol' => $crlf));\n\n\t\t\t// Headers\n\t\t\t$from = 'Catalog.beer <[email protected]>';\n\t\t\t$replyto = '[email protected]';\n\t\t\t$headers = array('From'=>$from, 'To'=>$this->email, 'Subject'=>$this->subject, 'Reply-To'=>$replyto);\n\n\t\t\t// Plain Text\n\t\t\t$mime->setTXTBody($this->plainText);\n\n\t\t\t// HTML\n\t\t\t$mime->setHTMLBody($this->htmlBody);\n\n\t\t\t$body = $mime->get();\n\t\t\t$headers = $mime->headers($headers);\n\n\t\t\t$smtp = Mail::factory('smtp',\n\t\t\t\tarray ('host' => 'smtp-relay.gmail.com',\n\t\t\t\t\t\t\t 'port' => 587,\n\t\t\t\t\t\t\t 'auth' => true,\n\t\t\t\t\t\t\t 'username' => '',\n\t\t\t\t\t\t\t 'password' => '',\n\t\t\t\t\t\t\t 'debug' => false));\n\n\t\t\t/* ---\n\t\t\tPEAR Send Mail\n\t\t\thttp://pear.php.net/manual/en/package.mail.mail.send.php\n\t\t\t--- */\n\t\t\t$mail = $smtp->send($this->email, $headers, $body);\n\n\t\t\t// Process Errors\n\t\t\tif(PEAR::isError($mail)){\n\t\t\t\t// Error Sending Email\n\t\t\t\t$this->error = true;\n\t\t\t\t$this->errorMsg = 'Whoops, looks like a bug on our end. We\\'ve logged the issue and our support team will look into it.';\n\n\t\t\t\t// Log Error\n\t\t\t\t$errorLog = new LogError();\n\t\t\t\t$errorLog->errorNumber = 91;\n\t\t\t\t$errorLog->errorMsg = 'Error sending email';\n\t\t\t\t$errorLog->badData = $mail->getMessage();\n\t\t\t\t$errorLog->filename = 'API / SendEmail.class.php';\n\t\t\t\t$errorLog->write();\n\t\t\t}\n\t\t}\n\t}", "function sendTickets() {\n\n\t\t\t\n\t\t\t$db = JFactory::getDBO();\n\t\t\t\n\t\t\t## Selecting tickets to create. LIMIT = 10 (otherwise the server will overload)\n\t\t\t## Sometimes it will be better to run an extra cronjob.\n\t\t\t$sql='SELECT ordercode FROM #__ticketmaster_orders\n\t\t\t\t WHERE pdfcreated = 1 \n\t\t\t\t AND paid = 1 \n\t\t\t\t AND pdfsent = 0 \n\t\t\t\t GROUP BY ordercode \n\t\t\t\t LIMIT 0, 10'; \n\n\t\t\t$db->setQuery($sql);\n\t\t\t$data = $db->loadObjectList();\t\t\t\t \n\n\n\t\t\t$k = 0;\n\t \t\tfor ($i = 0, $n = count($data); $i < $n; $i++ ){\n\n\t\t\t\t$row = &$data[$i];\n\n\t\t\t\t## Include the confirmation class to sent the tickets. \n\t\t\t\t$path_include = JPATH_ADMINISTRATOR.DS.'components'.DS.'com_ticketmaster'.DS.'classes'.DS.'sendonpayment.class.php';\n\t\t\t\tinclude_once( $path_include );\n\t\t\t\t\n\t\t\t\t## Sending the ticket immediatly to the client.\n\t\t\t\t$creator = new sendonpayment( (int)$row->ordercode ); \n\t\t\t\t$creator->send();\n\n\t\t\t\t$k=1 - $k;\n\t\t\t\t\n\t\t\t}\n\t\t\n\t}", "function sendMailForWishlistProductPromotion($promoId, $productIdPromotion, $con) {\n if (in_array('all', $productIdPromotion)) {\n $qq = \"SELECT DISTINCT(tw.user_id), tu.email, tu.username FROM tbl_user_wishlist tw LEFT JOIN tbl_user tu ON tu.user_id = tw.user_id\";\n } else {\n $pids = implode(',', $productIdPromotion);\n $qq = \"SELECT DISTINCT(tw.user_id), tu.email FROM tbl_user_wishlist tw LEFT JOIN tbl_user tu ON tu.user_id = tw.user_id WHERE tw.product_id IN ($pids)\";\n }\n $rs = exec_query($qq, $con);\n if (mysqli_num_rows($rs)) {\n $emails = array();\n while ($row = mysqli_fetch_object($rs)) {\n $emails[] = $row->email;\n }\n\n /* fetch promotion details */\n $rsPromo = exec_query(\"SELECT * FROM tbl_promotion WHERE promo_id = '$promoId'\", $con);\n $promotion = mysqli_fetch_object($rsPromo);\n if ($promotion->percent_or_amount == 'percent') {\n $detail = \"FLAT $promotion->promo_value % OFF !!!\";\n } elseif ($promotion->percent_or_amount == 'amount') {\n $detail = \"SAVE $ $promotion->promo_value !!!\";\n }\n\n\n /* fetch emaiul template */\n $rsEmail = exec_query(\"SELECT * FROM tbl_email_template WHERE type = 'promotion'\", $con);\n $rowEmail = mysqli_fetch_object($rsEmail);\n $content = $rowEmail->content;\n\n $contentHTML = html_entity_decode($content);\n $contentHTML = str_replace('{jhm :', '', $contentHTML); // replace all '{jhm : '\n $arraySearch = array(' promotion_title}', ' promotion_detail}'); // isko replace krna h\n $arrayReplace = array($promotion->title, $detail); // isse replace krna h\n $content = str_replace($arraySearch, $arrayReplace, $contentHTML); // yha milega sb\n // now send mail\n sendMail('New Promotion!!! Check it out on ' . siteName, $content, $emails, $con);\n }\n}", "function send_ingame_mail_A($realm_id, $massmails, $return = false)\r{\r global $server, $characters_db, $realm_id, $from_char, $stationary, $sql;\r\r //$mess_str = '';\r $mess = 0;\r $result = '';\r $receivers = array();\r foreach ( $massmails as $mails )\r {\r if ( count($mails[\"att_item\"]) < 1 )\r {\r $mails[\"att_item\"] = array(0);\r $mails[\"att_stack\"] = array(0);\r }\r\r // build insert query\r $query = \"INSERT INTO mailbox_insert_queue (sender_guid, receiver_guid, subject, body, stationary, money, \r item_id, item_stack\";\r\r $att_item = $mails[\"att_item\"];\r $att_stack = $mails[\"att_stack\"];\r\r if ( count($att_item) > 1 )\r {\r for ( $i = 1; $i < count($att_item); $i++ )\r {\r $query .= \", item_id\".($i+1).\", item_stack\".($i+1);\r }\r }\r\r $query .= \"\r )\r VALUES ('\".$from_char.\"', '\".$mails[\"receiver\"].\"', '\".$mails[\"subject\"].\"', '\".$mails[\"body\"].\"', '\".$stationary.\"', '\".$mails[\"att_gold\"].\"', \r '\".$att_item[0].\"', '\".$att_stack[0].\"'\";\r\r if ( count($att_item) > 1 )\r {\r for ( $i = 1; $i < count($att_item); $i++ )\r {\r $query .= \", '\".$att_item[$i].\"', '\".$att_stack[$i].\"'\";\r }\r }\r\r $query .= \"\r )\";\r\r $sql[\"char\"]->query($query);\r\r if ( $sql[\"char\"]->affected_rows() )\r {\r //$mess_str .= \"Successfully sent message sent to \". $mails[\"receiver_name\"].\"<br />\";\r $mess = 0; // success\r $result = \"RESULT\";\r array_push($receivers, $mails[\"receiver_name\"]);\r }\r else\r {\r //$mess_str .= \"Failed to send message to \".$mails[\"receiver_name\"].\"<br />\";\r $mess = -1; // failure\r $result = \"RESULT\";\r }\r }\r\r $receiver_list = '';\r foreach ( $receivers as $receiver )\r {\r $receiver_list .= ', '.$receiver;\r }\r $reveiver_list = substr($receiver_list, 2, strlen($receiver_list)-2);\r\r if ( !$return )\r {\r if ( !isset($_GET[\"redirect\"]) )\r //redirect(\"mail.php?action=result&error=6&mess=$mess_str\");\r redirect(\"mail.php?action=result&error=6&mess=\".$mess.\"&recipient=\".$receiver_list);\r else\r {\r $money_result = $sql[\"char\"]->quote_smart($_GET[\"moneyresult\"]);\r $redirect = $sql[\"char\"]->quote_smart($_GET[\"redirect\"]);\r\r redirect($redirect.\"?moneyresult=\".$money_result.\"&mailresult=1\");\r }\r }\r else\r return $mess;\r\r}", "protected function send_alert_email_teachers() {\n $teachers = $this->get_teachers();\n if (!empty($this->get_instance()->emailteachers) && $teachers) {\n $emailteachers = array();\n foreach ($teachers as $teacher) {\n $emailteachers[] = $teacher->user->email;\n }\n $this->send_alert_emails($emailteachers);\n\n }\n }", "public function sendEmailReminders()\n\t{\n\t\t$now = mktime(date('H'), 0, 0, 1, 1, 1970);\n\t\t$objCalendars = $this->Database->execute(\"SELECT * FROM tl_calendar WHERE subscription_reminders=1 AND ((subscription_time >= $now) AND (subscription_time <= $now + 3600))\");\n\n\t\t// Return if there are no calendars with subscriptions\n\t\tif (!$objCalendars->numRows)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t$intReminders = 0;\n\t\t$objToday = new \\Date();\n\n\t\t// Send the e-mails\n\t\twhile ($objCalendars->next())\n\t\t{\n\t\t\t$arrDays = array_map('intval', trimsplit(',', $objCalendars->subscription_days));\n\n\t\t\tif (empty($arrDays))\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$arrWhere = array();\n\n\t\t\t// Bulid a WHERE statement\n\t\t\tforeach ($arrDays as $intDay)\n\t\t\t{\n\t\t\t\t$objDateEvent = new \\Date(strtotime('+'.$intDay.' days'));\n\t\t\t\t$arrWhere[] = \"((e.startTime BETWEEN \" . $objDateEvent->dayBegin . \" AND \" . $objDateEvent->dayEnd . \") AND ((es.lastEmail = 0) OR (es.lastEmail NOT BETWEEN \" . $objToday->dayBegin . \" AND \" . $objToday->dayEnd . \")))\";\n\t\t\t}\n\n\t\t\t$objSubscriptions = $this->Database->prepare(\"SELECT e.*, es.member FROM tl_calendar_events_subscriptions es JOIN tl_calendar_events e ON e.id=es.pid WHERE e.pid=?\" . (!empty($arrWhere) ? \" AND (\".implode(\" OR \", $arrWhere).\")\" : \"\"))\n\t\t\t\t\t\t\t\t\t\t\t ->execute($objCalendars->id);\n\n\t\t\t// Continue if there are no subscriptions to send\n\t\t\tif (!$objSubscriptions->numRows)\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$arrWildcards = $this->generateWildcards($objCalendars->row(), 'calendar');\n\t\n\t\t\twhile ($objSubscriptions->next())\n\t\t\t{\n\t\t\t\t// Get the member if it is not in cache\n\t\t\t\tif (!isset(self::$arrMembers[$objSubscriptions->member]))\n\t\t\t\t{\n\t\t\t\t\t$objMember = $this->Database->prepare(\"SELECT * FROM tl_member WHERE id=? AND email!=''\")\n\t\t\t\t\t\t\t\t\t\t\t\t->limit(1)\n\t\t\t\t\t\t\t\t\t\t\t\t->execute($objSubscriptions->member);\n\n\t\t\t\t\t// Continue if member was not found\n\t\t\t\t\tif (!$objMember->numRows)\n\t\t\t\t\t{\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tself::$arrMembers[$objSubscriptions->member] = $objMember->row();\n\t\t\t\t}\n\n\t\t\t\t$arrWildcards = array_merge($arrWildcards, $this->generateWildcards($objSubscriptions->row(), 'event'), $this->generateWildcards(self::$arrMembers[$objSubscriptions->member], 'member'));\n\n\t\t\t\t// Generate an e-mail\n\t\t\t\t$objEmail = new \\Email();\n\t\n\t\t\t\t$objEmail->from = $GLOBALS['TL_ADMIN_EMAIL'];\n\t\t\t\t$objEmail->fromName = $GLOBALS['TL_ADMIN_NAME'];\n\t\t\t\t$objEmail->subject = \\String::parseSimpleTokens($objCalendars->subscription_title, $arrWildcards);\n\t\t\t\t$objEmail->text = \\String::parseSimpleTokens($objCalendars->subscription_message, $arrWildcards);\n\n\t\t\t\t// Send an e-mail\n\t\t\t\tif ($objEmail->sendTo(self::$arrMembers[$objSubscriptions->member]['email']))\n\t\t\t\t{\n\t\t\t\t\t$intReminders++;\n\t\t\t\t\t$this->Database->prepare(\"UPDATE tl_calendar_events_subscriptions SET lastEmail=? WHERE pid=? AND member=?\")->execute(time(), $objSubscriptions->id, $objSubscriptions->member);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tself::log('A total number of ' . $intReminders . ' event reminders have been sent', 'EventsSubscriptions sendEmailReminders()', TL_INFO);\n\t}", "public function notify()\n {\n /*$data = DB::select(DB::raw(\"SELECT license_type_id from `license_type_vehicle` where CURDATE()+INTERVAL 31 DAY =`license_end_on`\"));\n if(!empty($result)) {\n $data = array('license_type_id' => ,$result->license_type_id, 'vehicle_id' => $result->vehicle_id, '' );\n }\n DB::table('users')->insert([\n ['email' => '[email protected]', 'votes' => 0],\n ['email' => '[email protected]', 'votes' => 0]\n ]);*/\n $results = DB::table('license_type_vehicle')\n ->join('vehicles', 'vehicles.id', '=', 'license_type_vehicle.vehicle_id') \n ->select('license_type_vehicle.license_type_id', 'license_type_vehicle.vehicle_id','vehicles.client_id')\n ->where( 'license_type_vehicle.license_end_on', '=','CURDATE()+INTERVAL 30 DAY')\n ->get();\n print_r($results);\n /* Mail::send('emails.welcome', ['key' => 'value'], function($message)\n {\n $message->to('[email protected]', 'John Smith')->subject('Welcome!');\n });*/\n \n }", "function send_failover_email($subject, $message)\n{\n global $SITE_INFO;\n $emails = explode(';', $SITE_INFO['failover_email_contact']);\n foreach ($emails as $email) {\n mail($email, $subject, $message);\n }\n}", "function send () {\n $this->_build_mail();\n\n $to_str = ($this->apply_windows_bugfix) ? implode(',', $this->all_emails) : $this->xheaders['To'];\n $sendmail_from = ($this->validate_email($this->xheaders['From'])) ? \"-f\".$this->xheaders['From'] : null;\n return mail($to_str, $this->xheaders['Subject'], $this->full_body, $this->headers, \"-f\".$this->xheaders['From']);\n }", "public function handle()\r\n {\r\n foreach (AccountModel::all() as $account) {\r\n $client = $this->getClient($account);\r\n $service = new Google_Service_Gmail($client);\r\n $user = 'me';\r\n foreach ($account->replies()->where('message_replies.status', 'NEW')->get() as $reply)\r\n {\r\n $this->info($reply->id);\r\n $from = $account->name;\r\n $fromEmail = $account->account;\r\n $to = $reply->to ? $reply->to : $reply->message->from_name;\r\n $toEmail = $reply->to_email ? $reply->to_email : $reply->message->from;\r\n $subject = $reply->title;\r\n $content = nl2br($reply->content).\"<br/>\".$reply->updatefile;\r\n\r\n $message = new Google_Service_Gmail_Message();\r\n $message->setRaw($this->message($from, $fromEmail, $to, $toEmail, $subject, $content));\r\n $result = $service->users_messages->send($user, $message);\r\n $reply->status = $result->id ? 'SENT' : 'FAIL';\r\n $reply->save();\r\n $this->info($result->id . '<' . $account->account . '>' . $reply->title . ' Sent.');\r\n }\r\n\r\n //转发邮件\r\n /*\r\n $message = ForemailModel::find(1);\r\n $from = 'choies-service';\r\n $fromEmail = '[email protected]';\r\n $to = $message->to;\r\n $toEmail = $message->to_email;\r\n $subject = $message->title;\r\n $content = nl2br($message->content);\r\n $obj = new Google_Service_Gmail_Message();\r\n $obj->setRaw($this->message($from, $fromEmail, $to, $toEmail, $subject, $content)); \r\n $result = $service->users_messages->send($user, $obj);\r\n $this->info($result->id);\r\n exit;\r\n */\r\n\r\n $Foremails = ForemailModel::all();\r\n foreach ($Foremails as $k => $foremail) {\r\n if($foremail->status=='NEW'){\r\n $from ='choies-service';\r\n $fromEmail = '[email protected]';\r\n $to = $foremail->to;\r\n $toEmail = $foremail->to_email;\r\n $subject = '客户邮箱->'.$foremail->to_useremail;\r\n $content = nl2br($foremail->content);\r\n $obj = new Google_Service_Gmail_Message();\r\n $obj->setRaw($this->message($from, $fromEmail, $to, $toEmail, $subject, $content)); \r\n $result = $service->users_messages->send($user, $obj);\r\n $foremail->status = $result->id ? 'SENT' : 'FAIL';\r\n $foremail->save();\r\n $this->info($foremail->id);\r\n }\r\n }\r\n\r\n $Sendemails = SendemailModel::all();\r\n foreach ($Sendemails as $k => $sendemail) {\r\n if($sendemail->status=='NEW'){\r\n $from ='choies-service';\r\n $fromEmail = '[email protected]';\r\n $to = $foremail->to;\r\n $toEmail = $sendemail->to_email;\r\n $subject =$sendemail->title;\r\n $content = nl2br($sendemail->content);\r\n $obj = new Google_Service_Gmail_Message();\r\n $obj->setRaw($this->message($from, $fromEmail, $to, $toEmail, $subject, $content));\r\n $result = $service->users_messages->send($user, $obj);\r\n $sendemail->status = $result->id ? 'SENT' : 'FAIL';\r\n $sendemail->save();\r\n $this->info($sendemail->id);\r\n }\r\n }\r\n\r\n }\r\n }", "function send_announcement_email($user_list, $course_code, $_course, $mail_title, $mail_content) {\n\t\tforeach ( $user_list as $this_user ) {\n\t\t\t$mail_subject = get_lang ( 'professorMessage' ) . ' - ' . $_course ['official_code'] . ' - ' . $mail_title;\n\t\t\t\n\t\t\t$mail_body = '[' . $_course ['official_code'] . '] - [' . $_course ['name'] . \"]\\n\";\n\t\t\t$mail_body .= $this_user ['lastname'] . ' ' . $this_user ['firstname'] . ' <' . $this_user [\"email\"] . \"> \\n\\n\" . stripslashes ( $mail_title ) . \"\\n\\n\" . trim ( \n\t\t\t\t\tstripslashes ( html_entity_decode ( strip_tags ( str_replace ( array ('<p>', '</p>', '<br />' ), array ('', \"\\n\", \"\\n\" ), $mail_content ) ) ) ) ) . \" \\n\\n-- \\n\";\n\t\t\t$mail_body .= $_user ['firstName'] . ' ' . $_user ['lastName'] . ' ';\n\t\t\t$mail_body .= '<' . $_user ['mail'] . \">\\n\";\n\t\t\t$mail_body .= $_course ['official_code'] . ' ' . $_course ['name'];\n\t\t\t\n\t\t\t//set the charset and use it for the encoding of the email - small fix, not really clean (should check the content encoding origin first)\n\t\t\t//here we use the encoding used for the webpage where the text is encoded (ISO-8859-1 in this case)\n\t\t\t// hgz 20070612\n\t\t\t//if(empty($charset)){$charset='ISO-8859-1';}\n\t\t\t$encoding = 'Content-Type: text/plain; charset=' . SYSTEM_CHARSET;\n\t\t\t$newmail = api_mail ( $this_user ['lastname'] . ' ' . $this_user ['firstname'], $this_user ['email'], $mail_subject, $mail_body, $_SESSION ['_user'] ['lastName'] . ' ' . $_SESSION ['_user'] ['firstName'], $_SESSION ['_user'] ['mail'], $encoding );\n\t\t}\n\t}", "public function send_subscriptions(){\r\n //send email to all those who have subscribed to posts from this author\r\n\r\n }" ]
[ "0.68689436", "0.68324846", "0.671386", "0.66341835", "0.6440061", "0.64225394", "0.6391742", "0.6366359", "0.6352392", "0.6271578", "0.6213478", "0.6200764", "0.61799854", "0.612322", "0.60733664", "0.60463095", "0.60352874", "0.59753597", "0.59634197", "0.59568876", "0.59509695", "0.5939597", "0.5924386", "0.591551", "0.58911055", "0.5868193", "0.5860154", "0.58539516", "0.5845441", "0.58362603", "0.5825869", "0.5799795", "0.5773876", "0.5772951", "0.5772037", "0.5771943", "0.5771348", "0.57648", "0.57410115", "0.57196283", "0.5697915", "0.5692479", "0.5691528", "0.5688022", "0.5681549", "0.5670554", "0.56623554", "0.56620544", "0.5660598", "0.56578636", "0.5652761", "0.56447643", "0.5642889", "0.5634341", "0.5631289", "0.562409", "0.5621788", "0.5610359", "0.5609914", "0.56098825", "0.5607042", "0.56042373", "0.5603911", "0.56033874", "0.56027234", "0.5597717", "0.55784404", "0.55753833", "0.5573024", "0.55712473", "0.55543274", "0.55542415", "0.5554012", "0.55532324", "0.55428654", "0.5541832", "0.55390877", "0.55308187", "0.5524939", "0.55214393", "0.5518494", "0.55180156", "0.55133647", "0.5500468", "0.54994696", "0.5498593", "0.549777", "0.5497291", "0.5494124", "0.548754", "0.5476766", "0.54705787", "0.5466346", "0.54647917", "0.54643744", "0.54610205", "0.54590607", "0.54574054", "0.54569733", "0.5453304" ]
0.71341485
0
append an entry to a log file
function WriteLog($log_file) { global $SPECIAL_VALUES; @ $log_fp = fopen($log_file,"a"); if (!$log_fp) return; $date = gmdate("H:i:s d-M-y T"); $entry = $date.":".$SPECIAL_VALUES["email"].",". $SPECIAL_VALUES["realname"].",".$SPECIAL_VALUES["subject"]."\n"; fwrite($log_fp,$entry); fclose($log_fp); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "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}", "function addToLog ($content){\n\t\t$file = fopen ('../../data/log.txt', 'a+');\n\n\t\tfwrite ($file, $content);\n\t\tfclose ($file);\n\t}", "public function append(LoggerLoggingEvent $event) {\r\n\t\t$eventDate = $this->getDate($event->getTimestamp());\r\n\t\t\r\n\t\t// Initial setting of current date\r\n\t\tif (!isset($this->currentDate)) {\r\n\t\t\t$this->currentDate = $eventDate;\r\n\t\t} \r\n\t\t\r\n\t\t// Check if rollover is needed\r\n\t\telse if ($this->currentDate !== $eventDate) {\r\n\t\t\t$this->currentDate = $eventDate;\r\n\t\t\t\r\n\t\t\t// Close the file if it's open.\r\n\t\t\t// Note: $this->close() is not called here because it would set\r\n\t\t\t// $this->closed to true and the appender would not recieve\r\n\t\t\t// any more logging requests\r\n\t\t\tif (is_resource($this->fp)) {\r\n\t\t\t\t$this->write($this->layout->getFooter());\r\n\t\t\t\tfclose($this->fp);\r\n\t\t\t}\r\n\t\t\t$this->fp = null;\r\n\t\t}\r\n\t\r\n\t\tparent::append($event);\r\n\t}", "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 addLog($log_data)\n {\n // open the file\n $log_file = $this->openFile();\n\n // get current (last) line\n $log_file->seek($this->file_line);\n $this->file_line = $log_file->key() + 1;\n \n // write the log\n $time_of_day = gettimeofday(); \n $timestamp = date('Y-m-d H:i:s.',$time_of_day['sec']) . $time_of_day['usec'];\n \n $log_string = \"\\n\".$timestamp.'|'.implode('|', $log_data);\n $log_file->fwrite($log_string);\n \n // close the file\n $this->closeFile($log_file);\n }", "public function appendLog($message);", "function addFileLog($file, $text) {\n\t$today = date(\"Ymd\");\n\t$timeStamp = date(\"Y-m-d H:i:s\");\n\t$filePath = \"./__logs__/\".$today.\"_\".$file;\n\tfile_put_contents($filePath, \"\\n\".$timeStamp.\"\\n\".$text, FILE_APPEND | LOCK_EX);\n}", "function writeLineToLog($line){\n $logFile = \"log.txt\";\n $fh = fopen($logFile, 'a') or die(\"can't open file\");\n $line .= \"\\n\";\n fwrite($fh, $line);\n fclose($fh);\n}", "public function addLog($data);", "public function addEntry($log_message) {\n //Check if the message is empty, if so return false\n if (!isset($log_message) || trim($log_message) !== '') {\n //Open a handle for the file\n $file_handle = fopen($this->filename, 'a');\n\n //Prepend the date to the log message and add a line break\n $log_message = \"[\" . date('Y-m-d H:i:s') . \"] \" . trim($log_message) . \"\\n\";\n\n if (fwrite($file_handle, $log_message) == false) {\n throw new exception(\"Cannot write to file $this->filename\");\n } else {\n fclose($file_handle);\n return true;\n }\n } else {\n throw new exception(\"Log message cannot be empty\");\n }\n }", "public function updateLog($value) {\r\n $handle = fopen(dirname(__file__) . '/log', 'a');\r\n fwrite($handle, $value);\r\n fclose($handle);\r\n }", "function _log($message) {\n file_put_contents(\n LOG_FILE, \n $message,\n FILE_APPEND\n );\n}", "protected function _write($event)\n {\n $this->logs[] = $event;\n }", "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 }", "private static function writeToLogFile($message)\n {\n file_put_contents(Config::get('log_file'), utf8_encode(date(Config::get('time_format')) . ' ' . $message . \"\\n\"), FILE_APPEND);\n }", "public function log(string $message): void\n {\n $filePointer = fopen($this->file, \"a\");\n\n $logMsg = date('Y-m-d H:i:s') . \"\\t\\t\" . $message . \"\\n\";\n\n //rewind($filePointer);\n fwrite($filePointer, $logMsg);\n fclose($filePointer);\n }", "function addMessage($message)\r\n{\r\n\t$name = ($message['action']) ? '*'.$message['name'] : $message['name'];\r\n\t$text = $message['text'];\r\n\t$time = $message['time'];\r\n\r\n\tif(strlen($name) == 0)\r\n\t\treturn;\r\n\r\n\t$line = $time.'||'.$name.'||'.$text;\r\n\r\n\t// Pull the current file contents\r\n $fileContents = file(LACE_FILE);\r\n\t$size = count($fileContents);\r\n\r\n if ($size >= LACE_FILE_MAX_SIZE)\r\n {\r\n\t // Push the oldest entries out\r\n\t // and put the new one in\r\n\t for ($i = 0; $i <= $size - LACE_FILE_MAX_SIZE; $i++)\r\n\t\t array_shift($fileContents);\r\n\r\n\t $fileContents[] = $line;\r\n \t$fileContents = implode(\"\\n\", array_map('trim', $fileContents)).\"\\n\";\r\n\r\n \t// Write it to file\r\n \tfile_put_contents(LACE_FILE, trim($fileContents));\r\n }\r\n else\r\n {\r\n // No need to push anything off the stack,\r\n // just write to file\r\n \t$file = fopen(LACE_FILE, 'a');\r\n fwrite($file, $line.\"\\n\");\r\n fclose($file);\r\n }\r\n\r\n // Add to the log\r\n logMessage($line);\r\n}", "private function add_log($log) {\n $this->log .= \" \" . $log;\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 static function writeLog(string $line, string $log)\n {\n $logPath = self::filePath($log);\n $file = @fopen($logPath, 'a');\n\n // failed to open/create file, notify\n if (!$file) {\n echo \"<b>Warning:</b> Log file '{$log}' is unwritable, check permissions of the log folder.\";\n } else {\n\n // if the file is full, do not write\n if (@filesize($logPath) < config('app')['log_max_size']) {\n fwrite($file, \"\\r\\n[\". date(config('app')['date_format']) .\"] \". $line);\n fclose($file);\n }\n }\n }", "function log($type, $log) {\n try {\n $fh = fopen($this->logFilePath, 'a');\n fwrite($fh, date($this->dateFormat) . \" - {$type} -> {$log}\" . PHP_EOL);\n fclose($fh);\n } catch(Exception $e) {\n $this->error($e->getMessage());\n }\n }", "public function logFileWrite($message, $event_id){\n $log_message = date(\"Y-m-d H:i:s\").\" \".Auth()->user()->associate_id.\" \\\"\".$message.\"\\\" \".$event_id.PHP_EOL;\n $log_message .= file_get_contents(\"assets/log.txt\");\n file_put_contents(\"assets/log.txt\", $log_message);\n }", "protected function write_to_log( $message = '' ) {\r\n\t\t$file = $this->get_file();\r\n\t\t$file .= $message;\r\n\t\t@file_put_contents( $this->file, $file );\r\n\t}", "function log_to_file($message) {\n $fh = fopen('superlinks_log.txt', 'a') or die(\"can't open file\");\n fwrite($fh, $message . \"\\n\");\n fclose($fh);\n }", "function logWrite($msg) {\n\tglobal $logfile;\n\t$fh = fopen($logfile, 'a');\n\tfwrite($fh, \"$msg\\n\");\n\tfclose($fh);\n}", "public static function addLog($message, $file = null, $line = null){\n\t\tif(self::$debug_log == false){\n\t\t\treturn true;\n\t\t}\n\n\t\ttry {\n\t\t\t\n\t\t\t$log_file = __DIR__.\"/paytm.log\";\n\t\t\t$handle = fopen($log_file, \"a+\");\n\t\t\t\n\t\t\t// if there is some permission issue\n\t\t\tif($handle == false){\n\t\t\t\treturn \"Unable to write log file (\".$log_file.\"). Please provide appropriate permission to enable log.\";\n\t\t\t}\n\n\t\t\t// append Indian Standard Time for each log\n\t\t\t$date = new DateTime();\n\t\t\t$date->setTimeZone(new DateTimeZone(\"Asia/Kolkata\"));\n\t\t\t$log_entry = $date->format('Y-m-d H:i:s').\"(IST)\".PHP_EOL;\n\n\t\t\tif($file && $line){\n\t\t\t\t$log_entry .= $file.\"#\".$line.PHP_EOL;\n\t\t\t} else if($file){\n\t\t\t\t$log_entry .= $file.PHP_EOL;\n\t\t\t} else if($line){\n\t\t\t\t$log_entry .= $line.PHP_EOL;\n\t\t\t}\n\n\t\t\t$log_entry .= $message.PHP_EOL.PHP_EOL;\n\n\t\t\tfwrite($handle, $log_entry);\n\t\t\tfclose($handle);\n\n\t\t} catch(Exception $e){\n\n\t\t}\n\n\t\treturn true;\n\t}", "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}", "public function addLogFile(string $name, string $link) : void\n {\n $this->logFiles[$name] = $link;\n }", "function logger($msg)\n{\n\n $filename = $_SERVER['DOCUMENT_ROOT'].'/Utils/Logs/log.txt';\n $msg = date(\"[d/m] h:i:sa\") . \": \". $msg . \"\\n\";\n\n file_put_contents( $filename, $msg, FILE_APPEND);\n}", "function log1($msg)\n{\n if(WRITE_LOG == false)\n return;\n date_default_timezone_set('Europe/Vienna');\n $now = date(\"Y-m-d H:i:s\");\n $line = sprintf(\"%s => %s\\r\\n\", $now, $msg);\n file_put_contents(LOG_FILE, $line, FILE_APPEND);\n}", "function write_log($msg) {\n global $transaction_ID;\n $todays_date = date(\"Y-m-d H:i:s\");\n $file = fopen(\"process.log\",\"a\");\n fputs($file,$todays_date. \" [\".$transaction_ID.\"] \". $msg.\"\\n\");\n fclose($file);\n}", "function add_log_entry(log_op_move $entry) {\n array_unshift($this->log_op_list, $entry);\n }", "public function writeLog($msg)\n {\n $logline = PHP_EOL . \"[\" . date('r') . \"]: \" . $msg;\n file_put_contents($this->config['log_file'], $logline, FILE_APPEND);\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}", "public function logFileWrite($message, $event_id)\n\t{\n\t\t$log_message = date(\"Y-m-d H:i:s\").\" \".auth()->user()->associate_id.\" \\\"$message\\\" \".$event_id.PHP_EOL;\n\t\t$log_file = fopen('assets/log.txt', 'a');\n\t\tfwrite($log_file, $log_message);\n\t\tfclose($log_file);\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 }", "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 write()\n {\n $r=false;\n \n if(!empty($this->buffer))\n {\n foreach($this->buffer as $entry)\n {\n if(empty($this->logs[$entry['log']]))\n {\n $log_file=LOG_LOCATION.'/'.$entry['log'].'.log';\n\n $this->logs[$entry['log']]=fopen($log_file,'a');\n }\n\n if($entry['level']==LOG_LEVEL_ERROR)\n {\n $level_string='ERROR';\n }\n elseif($entry['level']==LOG_LEVEL_WARNING)\n {\n $level_string='WARNING';\n }\n elseif($entry['level']==LOG_LEVEL_NOTICE)\n {\n $level_string='NOTICE';\n }\n else\n {\n $level_string='UNKNOWN';\n }\n\n $log_config=&$this->system->config('log');\n\n $out=date($log_config['timestamp_format']).'|'.$level_string.' - '.$entry['message'].\"\\n\";\n\n if(!empty($this->logs[$entry['log']])&&fwrite($this->logs[$entry['log']],$out))\n {\n $r=true;\n }\n\n if(!$r)\n {\n throw new A_Exception('Could not write to file \"'.$log_file.'\"');\n }\n }\n\n if($r)\n {\n $this->buffer=array();\n }\n }\n }", "public function log($msg)\n {\n $this->file->filePutContents($this->logFile, $this->config->x_shop_name.\" \".date('c').\" \".var_export($msg, true).\"\\n\", FILE_APPEND | LOCK_EX);\n }", "protected function addMessage($content) {\n if ($this->file === null) {\n if (!file_exists($this->config->getValue('log', 'path', './'))) {\n mkdir($this->config->getValue('log', 'path', './'), 0755, true);\n }\n $path = $this->config->getValue('log', 'path', './').$this->section.'.log';\n $this->file = fopen($path, 'a');\n }\n fwrite($this->file, $content.\"\\n\");\n }", "function logger($str)\r\n\t\t{\r\n\t\t\t//write log\r\n\t\t\t$log = $str = '' ? PHP_EOL : '[' . date('Y-m-d H:i:s') . '] ' . $str . PHP_EOL;\r\n\t\t\tfile_put_contents('patcher.log', $log, FILE_APPEND | LOCK_EX);\r\n\t\t}", "function to_log($vvod)\n{\n $date = date(\"Y_m_d\");\n $filename = \"logs/log_\".$date.\".txt\";\n $string = date(\"d.m.Y H:i:s\").\" => $vvod\".\"\\n\";\n $f = fopen($filename,\"a+\");\n fwrite($f,$string);\n fclose($f);\n}", "public function log($message)\n {\n $file = $this->_homePath . DIRECTORY_SEPARATOR . 'streamwatch.log';\n $message = date('Y-m-d H:i:s') . ' -- ' . $message . \"\\n\";\n file_put_contents($file, $message, FILE_APPEND);\n }", "function wLog($path,$param,$sMessage) {\n \n $fp = fopen ($path.\"/\".$param.\".log\", \"a+\");\n if (fputs ($fp, $sMessage.(chr(13)))) {\n return true;\n } else {\n return false;\n }\n fclose ($fp);\n \n}", "protected function addLog($text, $pid = 0)\n {\n if ($pid === 0) {\n $pid = getmypid();\n }\n\n $log_text = sprintf('[%s] <%s> %s', date('Y-m-d H:i:s'), $pid, $text);\n $this->line($log_text);\n\n if (config('user.disable-logging')) {\n return;\n }\n\n $log_path = $this->logPath($pid);\n $file_handle = fopen($log_path, 'a+');\n\n fwrite($file_handle, $log_text.\"\\n\");\n fclose($file_handle);\n\n }", "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 withLog($entry);", "function write_log($log_file, $log_message)\t{\n\t\t$mylogfile = fopen($log_file, \"a\") or die(\"Unable to open file!\");\n\t\tfwrite($mylogfile, date('Y-m-d H:i:s') . \" IP:\" . str_pad(get_client_ip(),15) . \" \" . $log_message . \"\\n\");\n\t\tfclose($mylogfile);\n\t}", "public function setLogfile( $file ) {\t\t\n\t\t$this->logfile = fopen($file, 'a+');\n\t}", "public function log($content){\n \t\ttry{\n \t\t\t$resp = file_put_contents($this->logFileName, date('Y-m-d H:i:s').$content.\"\\n\", FILE_APPEND);\n \t\t\tif($resp){\n \t\t\t\treturn true;\n \t\t\t} else {\n \t\t\t\terror_log(\"UNBXD_MODULE:Error while appending the contents to log file\");\n \t\t\t\treturn false;\n \t\t\t}\n \t\t\treturn true;\n \t\t}catch(Exception $ex) {\n \t\t\terror_log(\"UNBXD_MODULE:Error while appending the contents to log file\");\n \t\t\tMage::throwException($ex->getMessage());\n \t\t\treturn false;\n \t\t}\n \t}", "function add_log_file_contents($logfilePath, $content) {\n $existingLog = file_get_contents($logfilePath);\n $existingLog = str_replace('# CHANGELOG' . PHP_EOL, '', $existingLog);\n\n $newLog = '# CHANGELOG' . PHP_EOL . PHP_EOL . $content . $existingLog;\n\n file_put_contents($logfilePath, $newLog);\n}", "function update_log($msg)\r\n\t{\r\n\t\tglobal $LEA_REP;\r\n\r\n\t\t$rep = $LEA_REP.'log/';\r\n\r\n\t\tif(file_exists($rep.$this->id_usager.'.log')){\r\n\t\t\t$fp = fopen($rep.$this->id_usager.'.log', \"a\");\r\n\t\t}\r\n\t\telse {\r\n\t\t\t$fp = fopen($rep.$this->id_usager.'.log', \"a\");\r\n\t\t\tfwrite($fp, \"********************************************************\\r\\n\\r\\n\");\r\n\t\t\tfwrite($fp, \"Fichier log de : \".$this->civilite.\" \".$this->nom.\" \".$this->prenom.\" du profil : \".$this->profil.\"\\r\\n\\r\\n\");\r\n\t\t\tfwrite($fp, \"********************************************************\\r\\n\\r\\n\");\r\n\t\t}\r\n\r\n\t\tfwrite($fp, $msg);\r\n\t}", "protected function append(LoggerLoggingEvent $event)\n {\n $this->processLog(\n $this->layout->format($event),\n $this->getFlushOnShutdown()\n );\n }", "public function log($msg)\n {\n file_put_contents($this->logFile, $this->shopName.\" \".date('c').\" \".print_r($msg, true).\"\\n\", FILE_APPEND | LOCK_EX);\n }", "function writeLog($text)\n {\n $file = fopen(\"../log.txt\", \"a+\") or die(\"Unable to open file!\");\n fwrite($file, $text . \"\\n\");\n fclose($file);\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}", "public function add_log_entry($message, $config = [])\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 }", "function writeToLogFile($fileName, $logData)\r\n\t{\r\n\t\t$fileBasePath = \"D:/Program/xampp/htdocs/secure/ROOT/catalog/logs/\";\t\t\r\n\t\t$filePath = $fileBasePath . $fileName;\r\n\t\t\r\n\t\t$fileObj = fopen($filePath, \"a\");\r\n\t\tfwrite($fileObj, $logData);\r\n\t\tfclose($fileObj);\r\n\t}", "function logger($path, $status, $message) {\n $logMsg = \"[\" . timestamp() . \"] : \" . $status . \" : \" . $message . \"\\n\";\n file_put_contents($path, $logMsg, FILE_APPEND | LOCK_EX);\n}", "function logrec($aid,$e,$msg,$src='') {\n\t// into the new record array[errors]\n\tglobal $logfile;\n\n\n\t$ts = date('H:i');\n\n\techo \"<p class='red'>$aid: $msg</p>\";\n\tfile_put_contents($logfile,\n\t\tsprintf(\"%6s %4s %1s %s\\n\",$ts,$aid,$e,$msg),FILE_APPEND);\n\tif (!empty($src)) {\n\t\tfile_put_contents($logfile,\n\t\tsprintf(\"%12s %s\\n\",'',$src),FILE_APPEND);\n\t}\n\treturn \"($e) $msg \". NL;\n}", "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 log ( $msg )\n {\n if ( $this->file_handle == null) {\n $this->openFile();\n }\n\n fwrite($this->file_handle, \"[\" . date(\"H:i:s\") . \"] \" . $msg . \"\\n\");\n }", "function addMessageLine($m){\n global $BackupPath;\n\n $log = $BackupPath . \"backupLog.txt\";\n $message = $m . \" ... \" . date(\"Y-m-d H:i:s\") .\"\\r\\n\";\n echo $message;\n file_put_contents($log, $message.PHP_EOL , FILE_APPEND | LOCK_EX);\n}", "public function write()\n {\n echo 'file log write...';\n }", "public function log($process, $message){\n $OldFile = $this->base_url.'logs/oxd-php-server-'.date(\"Y-m-d\") .'.log';\n $person = \"\\n\".date('l jS \\of F Y h:i:s A').\"\\n\".$process.$message.\"\\n\";\n file_put_contents($OldFile, $person, FILE_APPEND | LOCK_EX);\n }", "function append_message($message)\n{\n $fileContents = file_get_contents($_SERVER['DOCUMENT_ROOT'] . \"/backend/common/notices.log\");\n file_put_contents($_SERVER['DOCUMENT_ROOT'] . \"/backend/common/notices.log\", $fileContents.$message);\n}", "public static function write($logFile, $msg) {\r\n \t$fp = fopen($logFile, 'a');\r\n \t$log = '### '.date('d.m.Y H:i:s:'.substr(microtime(), 2, 3)).' ##############'.\"\\n\".$msg.\"\\n\\n\";\r\n \tfwrite($fp, $log);\r\n \tfclose($fp);\r\n }", "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}", "private function writeLog($msg) {\n\t\t$line = $this->getLogLine($msg);\n\t\tfwrite($this->f, $line);\n\t\tfflush($this->f);\n\t}", "protected function createLogFile() {}", "static function addUserLog($msg, $log_path) {\n // open file\n $fd = fopen($log_path . \"log/USR_\" . date(\"Ymd\") . \".txt\", \"a\");\n\n if (isset($_SESSION[\"user\"])) {\n $usr = $_SESSION[\"user\"];\n } else {\n $usr = $_SERVER[\"REMOTE_ADDR\"];\n }\n\n // append date/time to message\n $str = \"[\" . date(\"Y-m-d h:i:s\", time()) . \"] \" . $usr . \": \" . $msg;\n\n // write string\n fwrite($fd, $str . \"\\r\\n\");\n\n // close file\n fclose($fd);\n }", "private static function addLog($msg) {\n\t\tself::$log[] = '\"'.formatTimestamp(time()).' - '.$msg.'\"';\n\t}", "private function logError($file, $line)\n {\n $this->errors[md5($file.$line)] = time();\n $fh = fopen($this->logdir.\"hermes.log\", \"w\");\n if($fh == FALSE)\n return;\n if(flock($fh, LOCK_EX)) //lock file to be safe. may be atomic sometimes. idk \n {\n flock($fh, LOCK_EX);\n fseek($fh, 0 ,SEEK_END);\n foreach($this->errors as $key => $val)\n {\n fputs($fh, $key.' '.$val.\"\\n\");\n }\n flock($fh, LOCK_UN);\n }\n fclose($fh);\n }", "function _log($message)\n{\n\tfwrite($GLOBALS['logfile'], date(\"Y-m-d H:i:s :: \", time()) . $message . \"\\n\");\n}", "function appendLog($logentry)\r\n{\r\n global $phpLogMessage;\r\n $logfile = 'logarr.log';\r\n $logdir = 'assets/data/logs/';\r\n $logpath = $logdir . $logfile;\r\n $date = date(\"D d M Y H:i T \");\r\n\r\n if (file_exists($logdir)) {\r\n ini_set('error_reporting', E_ERROR);\r\n $oldContents = file_get_contents($logpath);\r\n if (file_put_contents($logpath, $oldContents . $date . \" | \" . $logentry . \"\\r\\n\") === false) {\r\n phpLog($phpLogMessage = \"Logarr ERROR: Failed writing to Logarr log file\");\r\n echo \"<script>console.log('%cERROR: Failed writing to Logarr log file.', 'color: red;');</script>\";\r\n return \"Error writing to Logarr log file\";\r\n //return $error;\r\n }\r\n } else {\r\n if (!mkdir($logdir)) {\r\n echo \"<script>console.log('%cERROR: Failed to create Logarr log directory.', 'color: red;');</script>\";\r\n phpLog($phpLogMessage = \"Logarr ERROR: Failed to create Logarr log directory\");\r\n return \"ERROR: Failed to create Logarr log directory\";\r\n } else {\r\n appendLog(\"Logarr log directory created\");\r\n appendLog($logentry);\r\n return \"Logarr log directory created\";\r\n }\r\n }\r\n}", "protected function logLine($logLine)\n\t{\n\t\tif (!MAKE_INSTALL_LOG || ($this->logFile == '')) return;\n\t\t$logfp = fopen($this->logFile, 'a+');\n\t\tfwrite($logfp, ($now = time()).', '.gmstrftime('%y-%m-%d %H:%M:%S',$now).' '.$logLine.\"\\n\");\n\t\tfclose($logfp);\n\t}", "function logError($msg){\n $txt = $msg . \" at \" . date('l jS \\of F Y h:i:s A') . \"\\n ------------------------------------- \\n\";\n $myfile = file_put_contents('errorlogs.txt', $txt.PHP_EOL , FILE_APPEND | LOCK_EX);\n }", "function logExcepMessage($path,$message){\n\t\ttry{\n\t\n\t\t\t$dataStamp = date('Y-m-d g:i a');\n\t\t\t$file = fopen($path, \"a+\");\n\t\t\tif( $file == false ) \n\t\t\t\tdie( \"Error in opening file\" );\n\t\t\tfwrite( $file, \"$dataStamp: $message\\n\" );\n\t\t\tfclose( $file );\n\t\t}\n\t\tcatch(Exception $e){\n\t\t}\n\t}", "public function writeLog()\n {\n $redis = self::getClient();\n $redis ->lPush('admin_log',$this->data);\n }", "public static function log_save()\n {\n if (empty(self::$log) or self::$configuration['core']['log_threshold'] < 1) {\n return;\n }\n\n // Filename of the log\n $filename = self::log_directory().date('Y-m-d').'.log'.EXT;\n\n if (! is_file($filename)) {\n // Write the SYSPATH checking header\n file_put_contents($filename,\n '<?php defined(\\'SYSPATH\\') or die(\\'No direct script access.\\'); ?>'.PHP_EOL.PHP_EOL);\n\n // Prevent external writes\n chmod($filename, 0644);\n }\n\n // Messages to write\n $messages = array();\n\n do {\n // Load the next mess\n list($date, $type, $text) = array_shift(self::$log);\n\n // Add a new message line\n $messages[] = $date.' --- '.$type.': '.$text;\n } while (! empty(self::$log));\n\n // Write messages to log file\n file_put_contents($filename, implode(PHP_EOL, $messages).PHP_EOL, FILE_APPEND);\n }", "public function lwrite($message){\n // if file pointer doesn't exist, then open log file\n if (!$this->fp) $this->lopen();\n // define script name\n $script_name = pathinfo($_SERVER['PHP_SELF'], PATHINFO_FILENAME);\n // define current time\n $time = date('m-d-y H:i:s');\n // write current time, script name and message to the log file\n fwrite($this->fp, \"$time ($script_name) $message\\n\");\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 lwrite($message){\n // if file pointer doesn't exist, then open log file\n if (!$this->fp) $this->lopen();\n // define script name\n $script_name = pathinfo($_SERVER['PHP_SELF'], PATHINFO_FILENAME);\n // define current time\n $time = date('H:i:s');\n // write current time, script name and message to the log file\n fwrite($this->fp, \"$time ($script_name) $message\\n\");\n }", "public function lwrite($message){\n // if file pointer doesn't exist, then open log file\n if (!$this->fp) $this->lopen();\n // define script name\n $script_name = pathinfo($_SERVER['PHP_SELF'], PATHINFO_FILENAME);\n // define current time\n $time = date('H:i:s');\n // write current time, script name and message to the log file\n fwrite($this->fp, \"$time ($script_name) $message\\n\");\n }", "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}", "function WriteLogEss($log) {\r\n//echo $log.'<br/>';\r\n/*\r\n $datum=Date('d.m.Y H:i:s');\r\n $tmp = '/tmp/logESS.txt';\r\n $text = $datum . '-'.$log.chr(10);\r\n $fp = fopen($tmp, 'a');\r\n fwrite($fp, $text);\r\n fclose($fp);\r\n*/\r\n}", "public function addEntry(\\Yana\\Db\\Ddl\\Logs\\AbstractLog $log)\n {\n array_unshift($this->changes, $log);\n }", "private function writelog() {\r\n\r\n $dir = APP_PATH . 'tmp/log';\r\n //IF 'tmp/log' is file, delete it.\r\n if (is_file($dir)) {\r\n unlink(APP_PATH . 'tmp/log');\r\n }\r\n //IF 'tmp/log' is not exists, create it as folder.\r\n if (!dir_exists($dir)) {\r\n __mkdirs(APP_PATH . 'tmp/log');\r\n }\r\n //IF 'tmp/log' is exists as folder, the create logs under it.\r\n if (dir_exists($dir) && is_dir($dir)) {\r\n $date = date(\"Y-m-d H:i:s\", time());\r\n $arr = array('-', ':');\r\n $date = trim(str_replace($arr, '', $date));\r\n $cnt = $this->spArgs('msg');\r\n $str = $date . '\\t' . $cnt;\r\n file_put_contents(APP_PATH . 'tmp/log/log_' . $date . '.log', $str, FILE_APPEND);\r\n }\r\n return TRUE;\r\n }", "public function log($string) \n {\n if (isset($this->_logf)) {\n $stat = fstat($this->_logf);\n if ($stat['nlink'] == 0) {\n $this->_logf = fopen(\"/opt/lampp/temp/geosafe.log\", \"a+\");\n }\n }\n else {\n $this->_logf = fopen(\"/opt/lampp/temp/geosafe.log\", \"a+\");\n }\n fwrite($this->_logf, $string . \"\\n\");\n }", "public static function write($content)\n {\n $date = new \\DateTime();\n $dateFormat = date_format($date, 'Y-m-d H:i:s');\n $line = \"[$dateFormat]: $content\\n\";\n file_put_contents(self::$logPath, $line, FILE_APPEND | LOCK_EX);\n }", "function CreateLogRami($text) {\n $fopen = fopen(\"Rami.log\", \"a\");\n fwrite($fopen, \"[\" . date(\"h:i:s\") . \"]:$text \" . PHP_EOL . \"\");\n fclose($fopen);\n}", "public function log (string $msg) : void {\n\t\t$this->logs [] = $msg;\n\t}", "public static function add_line(string $log) : string {\n if (empty(self::$taskloginfo)) {\n return $log;\n }\n\n if (empty(self::$fh)) {\n return $log;\n }\n\n if (self::is_current_output_buffer()) {\n fwrite(self::$fh, $log);\n }\n\n if (self::$outputloggedcontent) {\n return $log;\n } else {\n return '';\n }\n }", "public function write_to_log($line = '')\n\t{\n\t\tif(!$this->config->allow_write_to_log) return null;\n\n\t\treturn file_put_contents(\n\t\t\t$this->config->log_location,\t\t\t\t\t//File to write to\n\t\t\tdate(DATE_ATOM).\"\\t$line\\n\",\t\t\t\t\t//Line to write\n\t\t\tFILE_APPEND | LOCK_EX);\t\t\t\t\t\t\t//Options\n\t}", "private function writeToFile($message)\n {\n $this->directory->writeFile($this->logFile, $message, 'a+');\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 }", "protected function log($msg, $file = 'log', $newline = true)\n\t{\n\t\tif ($newline) {\n\t\t\t$msg = date('D, j M H:i:s') . ' ' . $msg . \"\\n\";\n\t\t}\n\t\techo $msg;\n\t\tfile_put_contents(LOG_DIR . $file, $msg, FILE_APPEND);\n\t}", "public function putLog(string $packet, string $url): void\n {\n $fp = fopen($_SERVER['DOCUMENT_ROOT'].'/log/packets_1.x.dump', 'a+');\n fwrite($fp, $url.\"?p=\".$packet.\"\\n\");\n fclose($fp);\n }", "private static function logToFile($message) {\n\t\tdate_default_timezone_set('UTC');\n\t\tfile_put_contents(Config::$debug_filename, date('Y-m-d h:i:sa') . ' ' . $message . \"\\n\", FILE_APPEND);\n\t}" ]
[ "0.76190794", "0.7332909", "0.7071847", "0.6984213", "0.698403", "0.6948844", "0.69298023", "0.67153883", "0.6674825", "0.6665114", "0.659607", "0.65860826", "0.6532924", "0.64530224", "0.64474165", "0.6430919", "0.6430267", "0.63890123", "0.63785386", "0.63578296", "0.6352242", "0.6333399", "0.63004935", "0.62900394", "0.62787396", "0.6278427", "0.6268564", "0.62458885", "0.62444466", "0.62268853", "0.6224858", "0.6200253", "0.6186896", "0.61811614", "0.61802155", "0.6175127", "0.61739683", "0.6167307", "0.61547446", "0.6129193", "0.6123337", "0.611889", "0.61171955", "0.61148816", "0.6091373", "0.60858035", "0.6079495", "0.60768837", "0.60671294", "0.6065151", "0.60514295", "0.6047778", "0.6043874", "0.60411704", "0.60317284", "0.6028427", "0.6027691", "0.6024841", "0.6024386", "0.60178995", "0.6017133", "0.600034", "0.59890634", "0.59880203", "0.59828186", "0.5973607", "0.59727854", "0.59676963", "0.5967586", "0.5952915", "0.5947294", "0.59459615", "0.5939307", "0.5935236", "0.593292", "0.5900156", "0.589534", "0.58857137", "0.5881942", "0.58803344", "0.58795315", "0.5874308", "0.5873941", "0.58723646", "0.58723646", "0.58504933", "0.58464974", "0.5836485", "0.5831784", "0.582771", "0.5827563", "0.58098274", "0.58001304", "0.5798897", "0.5787546", "0.57832307", "0.577314", "0.57654", "0.57568973", "0.57519615" ]
0.60441965
52